1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | function _classCallCheck(instance, Constructor) {
|
28 | if (!(instance instanceof Constructor)) {
|
29 | throw new TypeError("Cannot call a class as a function");
|
30 | }
|
31 | }
|
32 |
|
33 | var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
34 |
|
35 | function getDefaultExportFromCjs (x) {
|
36 | return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
37 | }
|
38 |
|
39 | var defineProperty$f = {exports: {}};
|
40 |
|
41 | var check = function (it) {
|
42 | return it && it.Math === Math && it;
|
43 | };
|
44 |
|
45 |
|
46 | var global$p =
|
47 |
|
48 | check(typeof globalThis == 'object' && globalThis) ||
|
49 | check(typeof window == 'object' && window) ||
|
50 |
|
51 | check(typeof self == 'object' && self) ||
|
52 | check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
53 |
|
54 | (function () { return this; })() || commonjsGlobal || Function('return this')();
|
55 |
|
56 | var fails$u = function (exec) {
|
57 | try {
|
58 | return !!exec();
|
59 | } catch (error) {
|
60 | return true;
|
61 | }
|
62 | };
|
63 |
|
64 | var fails$t = fails$u;
|
65 |
|
66 | var functionBindNative = !fails$t(function () {
|
67 |
|
68 | var test = (function () { }).bind();
|
69 |
|
70 | return typeof test != 'function' || test.hasOwnProperty('prototype');
|
71 | });
|
72 |
|
73 | var NATIVE_BIND$4 = functionBindNative;
|
74 |
|
75 | var FunctionPrototype$4 = Function.prototype;
|
76 | var apply$6 = FunctionPrototype$4.apply;
|
77 | var call$k = FunctionPrototype$4.call;
|
78 |
|
79 |
|
80 | var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$4 ? call$k.bind(apply$6) : function () {
|
81 | return call$k.apply(apply$6, arguments);
|
82 | });
|
83 |
|
84 | var NATIVE_BIND$3 = functionBindNative;
|
85 |
|
86 | var FunctionPrototype$3 = Function.prototype;
|
87 | var call$j = FunctionPrototype$3.call;
|
88 | var uncurryThisWithBind = NATIVE_BIND$3 && FunctionPrototype$3.bind.bind(call$j, call$j);
|
89 |
|
90 | var functionUncurryThis = NATIVE_BIND$3 ? uncurryThisWithBind : function (fn) {
|
91 | return function () {
|
92 | return call$j.apply(fn, arguments);
|
93 | };
|
94 | };
|
95 |
|
96 | var uncurryThis$q = functionUncurryThis;
|
97 |
|
98 | var toString$9 = uncurryThis$q({}.toString);
|
99 | var stringSlice$1 = uncurryThis$q(''.slice);
|
100 |
|
101 | var classofRaw$2 = function (it) {
|
102 | return stringSlice$1(toString$9(it), 8, -1);
|
103 | };
|
104 |
|
105 | var classofRaw$1 = classofRaw$2;
|
106 | var uncurryThis$p = functionUncurryThis;
|
107 |
|
108 | var functionUncurryThisClause = function (fn) {
|
109 |
|
110 |
|
111 |
|
112 | if (classofRaw$1(fn) === 'Function') return uncurryThis$p(fn);
|
113 | };
|
114 |
|
115 | var documentAll$2 = typeof document == 'object' && document.all;
|
116 |
|
117 |
|
118 |
|
119 | var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
|
120 |
|
121 | var documentAll_1 = {
|
122 | all: documentAll$2,
|
123 | IS_HTMLDDA: IS_HTMLDDA
|
124 | };
|
125 |
|
126 | var $documentAll$1 = documentAll_1;
|
127 |
|
128 | var documentAll$1 = $documentAll$1.all;
|
129 |
|
130 |
|
131 |
|
132 | var isCallable$m = $documentAll$1.IS_HTMLDDA ? function (argument) {
|
133 | return typeof argument == 'function' || argument === documentAll$1;
|
134 | } : function (argument) {
|
135 | return typeof argument == 'function';
|
136 | };
|
137 |
|
138 | var objectGetOwnPropertyDescriptor = {};
|
139 |
|
140 | var fails$s = fails$u;
|
141 |
|
142 |
|
143 | var descriptors = !fails$s(function () {
|
144 |
|
145 | return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
|
146 | });
|
147 |
|
148 | var NATIVE_BIND$2 = functionBindNative;
|
149 |
|
150 | var call$i = Function.prototype.call;
|
151 |
|
152 | var functionCall = NATIVE_BIND$2 ? call$i.bind(call$i) : function () {
|
153 | return call$i.apply(call$i, arguments);
|
154 | };
|
155 |
|
156 | var objectPropertyIsEnumerable = {};
|
157 |
|
158 | var $propertyIsEnumerable$1 = {}.propertyIsEnumerable;
|
159 |
|
160 | var getOwnPropertyDescriptor$7 = Object.getOwnPropertyDescriptor;
|
161 |
|
162 |
|
163 | var NASHORN_BUG = getOwnPropertyDescriptor$7 && !$propertyIsEnumerable$1.call({ 1: 2 }, 1);
|
164 |
|
165 |
|
166 |
|
167 | objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
168 | var descriptor = getOwnPropertyDescriptor$7(this, V);
|
169 | return !!descriptor && descriptor.enumerable;
|
170 | } : $propertyIsEnumerable$1;
|
171 |
|
172 | var createPropertyDescriptor$7 = function (bitmap, value) {
|
173 | return {
|
174 | enumerable: !(bitmap & 1),
|
175 | configurable: !(bitmap & 2),
|
176 | writable: !(bitmap & 4),
|
177 | value: value
|
178 | };
|
179 | };
|
180 |
|
181 | var uncurryThis$o = functionUncurryThis;
|
182 | var fails$r = fails$u;
|
183 | var classof$f = classofRaw$2;
|
184 |
|
185 | var $Object$4 = Object;
|
186 | var split = uncurryThis$o(''.split);
|
187 |
|
188 |
|
189 | var indexedObject = fails$r(function () {
|
190 |
|
191 |
|
192 | return !$Object$4('z').propertyIsEnumerable(0);
|
193 | }) ? function (it) {
|
194 | return classof$f(it) === 'String' ? split(it, '') : $Object$4(it);
|
195 | } : $Object$4;
|
196 |
|
197 |
|
198 |
|
199 | var isNullOrUndefined$6 = function (it) {
|
200 | return it === null || it === undefined;
|
201 | };
|
202 |
|
203 | var isNullOrUndefined$5 = isNullOrUndefined$6;
|
204 |
|
205 | var $TypeError$g = TypeError;
|
206 |
|
207 |
|
208 |
|
209 | var requireObjectCoercible$3 = function (it) {
|
210 | if (isNullOrUndefined$5(it)) throw new $TypeError$g("Can't call method on " + it);
|
211 | return it;
|
212 | };
|
213 |
|
214 |
|
215 | var IndexedObject$3 = indexedObject;
|
216 | var requireObjectCoercible$2 = requireObjectCoercible$3;
|
217 |
|
218 | var toIndexedObject$a = function (it) {
|
219 | return IndexedObject$3(requireObjectCoercible$2(it));
|
220 | };
|
221 |
|
222 | var isCallable$l = isCallable$m;
|
223 | var $documentAll = documentAll_1;
|
224 |
|
225 | var documentAll = $documentAll.all;
|
226 |
|
227 | var isObject$h = $documentAll.IS_HTMLDDA ? function (it) {
|
228 | return typeof it == 'object' ? it !== null : isCallable$l(it) || it === documentAll;
|
229 | } : function (it) {
|
230 | return typeof it == 'object' ? it !== null : isCallable$l(it);
|
231 | };
|
232 |
|
233 | var path$o = {};
|
234 |
|
235 | var path$n = path$o;
|
236 | var global$o = global$p;
|
237 | var isCallable$k = isCallable$m;
|
238 |
|
239 | var aFunction = function (variable) {
|
240 | return isCallable$k(variable) ? variable : undefined;
|
241 | };
|
242 |
|
243 | var getBuiltIn$f = function (namespace, method) {
|
244 | return arguments.length < 2 ? aFunction(path$n[namespace]) || aFunction(global$o[namespace])
|
245 | : path$n[namespace] && path$n[namespace][method] || global$o[namespace] && global$o[namespace][method];
|
246 | };
|
247 |
|
248 | var uncurryThis$n = functionUncurryThis;
|
249 |
|
250 | var objectIsPrototypeOf = uncurryThis$n({}.isPrototypeOf);
|
251 |
|
252 | var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
|
253 |
|
254 | var global$n = global$p;
|
255 | var userAgent$5 = engineUserAgent;
|
256 |
|
257 | var process$3 = global$n.process;
|
258 | var Deno$1 = global$n.Deno;
|
259 | var versions = process$3 && process$3.versions || Deno$1 && Deno$1.version;
|
260 | var v8 = versions && versions.v8;
|
261 | var match, version;
|
262 |
|
263 | if (v8) {
|
264 | match = v8.split('.');
|
265 |
|
266 |
|
267 | version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
268 | }
|
269 |
|
270 |
|
271 |
|
272 | if (!version && userAgent$5) {
|
273 | match = userAgent$5.match(/Edge\/(\d+)/);
|
274 | if (!match || match[1] >= 74) {
|
275 | match = userAgent$5.match(/Chrome\/(\d+)/);
|
276 | if (match) version = +match[1];
|
277 | }
|
278 | }
|
279 |
|
280 | var engineV8Version = version;
|
281 |
|
282 |
|
283 | var V8_VERSION$3 = engineV8Version;
|
284 | var fails$q = fails$u;
|
285 | var global$m = global$p;
|
286 |
|
287 | var $String$5 = global$m.String;
|
288 |
|
289 |
|
290 | var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$q(function () {
|
291 | var symbol = Symbol('symbol detection');
|
292 |
|
293 |
|
294 |
|
295 |
|
296 | return !$String$5(symbol) || !(Object(symbol) instanceof Symbol) ||
|
297 |
|
298 | !Symbol.sham && V8_VERSION$3 && V8_VERSION$3 < 41;
|
299 | });
|
300 |
|
301 |
|
302 | var NATIVE_SYMBOL$5 = symbolConstructorDetection;
|
303 |
|
304 | var useSymbolAsUid = NATIVE_SYMBOL$5
|
305 | && !Symbol.sham
|
306 | && typeof Symbol.iterator == 'symbol';
|
307 |
|
308 | var getBuiltIn$e = getBuiltIn$f;
|
309 | var isCallable$j = isCallable$m;
|
310 | var isPrototypeOf$k = objectIsPrototypeOf;
|
311 | var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
312 |
|
313 | var $Object$3 = Object;
|
314 |
|
315 | var isSymbol$5 = USE_SYMBOL_AS_UID$1 ? function (it) {
|
316 | return typeof it == 'symbol';
|
317 | } : function (it) {
|
318 | var $Symbol = getBuiltIn$e('Symbol');
|
319 | return isCallable$j($Symbol) && isPrototypeOf$k($Symbol.prototype, $Object$3(it));
|
320 | };
|
321 |
|
322 | var $String$4 = String;
|
323 |
|
324 | var tryToString$6 = function (argument) {
|
325 | try {
|
326 | return $String$4(argument);
|
327 | } catch (error) {
|
328 | return 'Object';
|
329 | }
|
330 | };
|
331 |
|
332 | var isCallable$i = isCallable$m;
|
333 | var tryToString$5 = tryToString$6;
|
334 |
|
335 | var $TypeError$f = TypeError;
|
336 |
|
337 |
|
338 | var aCallable$e = function (argument) {
|
339 | if (isCallable$i(argument)) return argument;
|
340 | throw new $TypeError$f(tryToString$5(argument) + ' is not a function');
|
341 | };
|
342 |
|
343 | var aCallable$d = aCallable$e;
|
344 | var isNullOrUndefined$4 = isNullOrUndefined$6;
|
345 |
|
346 |
|
347 |
|
348 | var getMethod$3 = function (V, P) {
|
349 | var func = V[P];
|
350 | return isNullOrUndefined$4(func) ? undefined : aCallable$d(func);
|
351 | };
|
352 |
|
353 | var call$h = functionCall;
|
354 | var isCallable$h = isCallable$m;
|
355 | var isObject$g = isObject$h;
|
356 |
|
357 | var $TypeError$e = TypeError;
|
358 |
|
359 |
|
360 |
|
361 | var ordinaryToPrimitive$1 = function (input, pref) {
|
362 | var fn, val;
|
363 | if (pref === 'string' && isCallable$h(fn = input.toString) && !isObject$g(val = call$h(fn, input))) return val;
|
364 | if (isCallable$h(fn = input.valueOf) && !isObject$g(val = call$h(fn, input))) return val;
|
365 | if (pref !== 'string' && isCallable$h(fn = input.toString) && !isObject$g(val = call$h(fn, input))) return val;
|
366 | throw new $TypeError$e("Can't convert object to primitive value");
|
367 | };
|
368 |
|
369 | var shared$7 = {exports: {}};
|
370 |
|
371 | var isPure = true;
|
372 |
|
373 | var global$l = global$p;
|
374 |
|
375 |
|
376 | var defineProperty$e = Object.defineProperty;
|
377 |
|
378 | var defineGlobalProperty$1 = function (key, value) {
|
379 | try {
|
380 | defineProperty$e(global$l, key, { value: value, configurable: true, writable: true });
|
381 | } catch (error) {
|
382 | global$l[key] = value;
|
383 | } return value;
|
384 | };
|
385 |
|
386 | var global$k = global$p;
|
387 | var defineGlobalProperty = defineGlobalProperty$1;
|
388 |
|
389 | var SHARED = '__core-js_shared__';
|
390 | var store$3 = global$k[SHARED] || defineGlobalProperty(SHARED, {});
|
391 |
|
392 | var sharedStore = store$3;
|
393 |
|
394 | var store$2 = sharedStore;
|
395 |
|
396 | (shared$7.exports = function (key, value) {
|
397 | return store$2[key] || (store$2[key] = value !== undefined ? value : {});
|
398 | })('versions', []).push({
|
399 | version: '3.33.2',
|
400 | mode: 'pure' ,
|
401 | copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
|
402 | license: 'https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE',
|
403 | source: 'https://github.com/zloirock/core-js'
|
404 | });
|
405 |
|
406 | var sharedExports = shared$7.exports;
|
407 |
|
408 | var requireObjectCoercible$1 = requireObjectCoercible$3;
|
409 |
|
410 | var $Object$2 = Object;
|
411 |
|
412 |
|
413 |
|
414 | var toObject$e = function (argument) {
|
415 | return $Object$2(requireObjectCoercible$1(argument));
|
416 | };
|
417 |
|
418 | var uncurryThis$m = functionUncurryThis;
|
419 | var toObject$d = toObject$e;
|
420 |
|
421 | var hasOwnProperty = uncurryThis$m({}.hasOwnProperty);
|
422 |
|
423 |
|
424 |
|
425 |
|
426 | var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
427 | return hasOwnProperty(toObject$d(it), key);
|
428 | };
|
429 |
|
430 | var uncurryThis$l = functionUncurryThis;
|
431 |
|
432 | var id$1 = 0;
|
433 | var postfix = Math.random();
|
434 | var toString$8 = uncurryThis$l(1.0.toString);
|
435 |
|
436 | var uid$4 = function (key) {
|
437 | return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$8(++id$1 + postfix, 36);
|
438 | };
|
439 |
|
440 | var global$j = global$p;
|
441 | var shared$6 = sharedExports;
|
442 | var hasOwn$j = hasOwnProperty_1;
|
443 | var uid$3 = uid$4;
|
444 | var NATIVE_SYMBOL$4 = symbolConstructorDetection;
|
445 | var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
446 |
|
447 | var Symbol$3 = global$j.Symbol;
|
448 | var WellKnownSymbolsStore$2 = shared$6('wks');
|
449 | var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$3['for'] || Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid$3;
|
450 |
|
451 | var wellKnownSymbol$n = function (name) {
|
452 | if (!hasOwn$j(WellKnownSymbolsStore$2, name)) {
|
453 | WellKnownSymbolsStore$2[name] = NATIVE_SYMBOL$4 && hasOwn$j(Symbol$3, name)
|
454 | ? Symbol$3[name]
|
455 | : createWellKnownSymbol('Symbol.' + name);
|
456 | } return WellKnownSymbolsStore$2[name];
|
457 | };
|
458 |
|
459 | var call$g = functionCall;
|
460 | var isObject$f = isObject$h;
|
461 | var isSymbol$4 = isSymbol$5;
|
462 | var getMethod$2 = getMethod$3;
|
463 | var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
464 | var wellKnownSymbol$m = wellKnownSymbol$n;
|
465 |
|
466 | var $TypeError$d = TypeError;
|
467 | var TO_PRIMITIVE = wellKnownSymbol$m('toPrimitive');
|
468 |
|
469 |
|
470 |
|
471 | var toPrimitive$6 = function (input, pref) {
|
472 | if (!isObject$f(input) || isSymbol$4(input)) return input;
|
473 | var exoticToPrim = getMethod$2(input, TO_PRIMITIVE);
|
474 | var result;
|
475 | if (exoticToPrim) {
|
476 | if (pref === undefined) pref = 'default';
|
477 | result = call$g(exoticToPrim, input, pref);
|
478 | if (!isObject$f(result) || isSymbol$4(result)) return result;
|
479 | throw new $TypeError$d("Can't convert object to primitive value");
|
480 | }
|
481 | if (pref === undefined) pref = 'number';
|
482 | return ordinaryToPrimitive(input, pref);
|
483 | };
|
484 |
|
485 | var toPrimitive$5 = toPrimitive$6;
|
486 | var isSymbol$3 = isSymbol$5;
|
487 |
|
488 |
|
489 |
|
490 | var toPropertyKey$4 = function (argument) {
|
491 | var key = toPrimitive$5(argument, 'string');
|
492 | return isSymbol$3(key) ? key : key + '';
|
493 | };
|
494 |
|
495 | var global$i = global$p;
|
496 | var isObject$e = isObject$h;
|
497 |
|
498 | var document$3 = global$i.document;
|
499 |
|
500 | var EXISTS$1 = isObject$e(document$3) && isObject$e(document$3.createElement);
|
501 |
|
502 | var documentCreateElement$1 = function (it) {
|
503 | return EXISTS$1 ? document$3.createElement(it) : {};
|
504 | };
|
505 |
|
506 | var DESCRIPTORS$h = descriptors;
|
507 | var fails$p = fails$u;
|
508 | var createElement$1 = documentCreateElement$1;
|
509 |
|
510 |
|
511 | var ie8DomDefine = !DESCRIPTORS$h && !fails$p(function () {
|
512 |
|
513 | return Object.defineProperty(createElement$1('div'), 'a', {
|
514 | get: function () { return 7; }
|
515 | }).a !== 7;
|
516 | });
|
517 |
|
518 | var DESCRIPTORS$g = descriptors;
|
519 | var call$f = functionCall;
|
520 | var propertyIsEnumerableModule$2 = objectPropertyIsEnumerable;
|
521 | var createPropertyDescriptor$6 = createPropertyDescriptor$7;
|
522 | var toIndexedObject$9 = toIndexedObject$a;
|
523 | var toPropertyKey$3 = toPropertyKey$4;
|
524 | var hasOwn$i = hasOwnProperty_1;
|
525 | var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
526 |
|
527 |
|
528 | var $getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
|
529 |
|
530 |
|
531 |
|
532 | objectGetOwnPropertyDescriptor.f = DESCRIPTORS$g ? $getOwnPropertyDescriptor$2 : function getOwnPropertyDescriptor(O, P) {
|
533 | O = toIndexedObject$9(O);
|
534 | P = toPropertyKey$3(P);
|
535 | if (IE8_DOM_DEFINE$1) try {
|
536 | return $getOwnPropertyDescriptor$2(O, P);
|
537 | } catch (error) { }
|
538 | if (hasOwn$i(O, P)) return createPropertyDescriptor$6(!call$f(propertyIsEnumerableModule$2.f, O, P), O[P]);
|
539 | };
|
540 |
|
541 | var fails$o = fails$u;
|
542 | var isCallable$g = isCallable$m;
|
543 |
|
544 | var replacement = /#|\.prototype\./;
|
545 |
|
546 | var isForced$2 = function (feature, detection) {
|
547 | var value = data[normalize(feature)];
|
548 | return value === POLYFILL ? true
|
549 | : value === NATIVE ? false
|
550 | : isCallable$g(detection) ? fails$o(detection)
|
551 | : !!detection;
|
552 | };
|
553 |
|
554 | var normalize = isForced$2.normalize = function (string) {
|
555 | return String(string).replace(replacement, '.').toLowerCase();
|
556 | };
|
557 |
|
558 | var data = isForced$2.data = {};
|
559 | var NATIVE = isForced$2.NATIVE = 'N';
|
560 | var POLYFILL = isForced$2.POLYFILL = 'P';
|
561 |
|
562 | var isForced_1 = isForced$2;
|
563 |
|
564 | var uncurryThis$k = functionUncurryThisClause;
|
565 | var aCallable$c = aCallable$e;
|
566 | var NATIVE_BIND$1 = functionBindNative;
|
567 |
|
568 | var bind$i = uncurryThis$k(uncurryThis$k.bind);
|
569 |
|
570 |
|
571 | var functionBindContext = function (fn, that) {
|
572 | aCallable$c(fn);
|
573 | return that === undefined ? fn : NATIVE_BIND$1 ? bind$i(fn, that) : function (/* ...args */) {
|
574 | return fn.apply(that, arguments);
|
575 | };
|
576 | };
|
577 |
|
578 | var objectDefineProperty = {};
|
579 |
|
580 | var DESCRIPTORS$f = descriptors;
|
581 | var fails$n = fails$u;
|
582 |
|
583 |
|
584 |
|
585 | var v8PrototypeDefineBug = DESCRIPTORS$f && fails$n(function () {
|
586 |
|
587 | return Object.defineProperty(function () { }, 'prototype', {
|
588 | value: 42,
|
589 | writable: false
|
590 | }).prototype !== 42;
|
591 | });
|
592 |
|
593 | var isObject$d = isObject$h;
|
594 |
|
595 | var $String$3 = String;
|
596 | var $TypeError$c = TypeError;
|
597 |
|
598 |
|
599 | var anObject$d = function (argument) {
|
600 | if (isObject$d(argument)) return argument;
|
601 | throw new $TypeError$c($String$3(argument) + ' is not an object');
|
602 | };
|
603 |
|
604 | var DESCRIPTORS$e = descriptors;
|
605 | var IE8_DOM_DEFINE = ie8DomDefine;
|
606 | var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
|
607 | var anObject$c = anObject$d;
|
608 | var toPropertyKey$2 = toPropertyKey$4;
|
609 |
|
610 | var $TypeError$b = TypeError;
|
611 |
|
612 | var $defineProperty$1 = Object.defineProperty;
|
613 |
|
614 | var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
615 | var ENUMERABLE = 'enumerable';
|
616 | var CONFIGURABLE$1 = 'configurable';
|
617 | var WRITABLE = 'writable';
|
618 |
|
619 |
|
620 |
|
621 | objectDefineProperty.f = DESCRIPTORS$e ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
|
622 | anObject$c(O);
|
623 | P = toPropertyKey$2(P);
|
624 | anObject$c(Attributes);
|
625 | if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
626 | var current = $getOwnPropertyDescriptor$1(O, P);
|
627 | if (current && current[WRITABLE]) {
|
628 | O[P] = Attributes.value;
|
629 | Attributes = {
|
630 | configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
|
631 | enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
632 | writable: false
|
633 | };
|
634 | }
|
635 | } return $defineProperty$1(O, P, Attributes);
|
636 | } : $defineProperty$1 : function defineProperty(O, P, Attributes) {
|
637 | anObject$c(O);
|
638 | P = toPropertyKey$2(P);
|
639 | anObject$c(Attributes);
|
640 | if (IE8_DOM_DEFINE) try {
|
641 | return $defineProperty$1(O, P, Attributes);
|
642 | } catch (error) { }
|
643 | if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$b('Accessors not supported');
|
644 | if ('value' in Attributes) O[P] = Attributes.value;
|
645 | return O;
|
646 | };
|
647 |
|
648 | var DESCRIPTORS$d = descriptors;
|
649 | var definePropertyModule$4 = objectDefineProperty;
|
650 | var createPropertyDescriptor$5 = createPropertyDescriptor$7;
|
651 |
|
652 | var createNonEnumerableProperty$9 = DESCRIPTORS$d ? function (object, key, value) {
|
653 | return definePropertyModule$4.f(object, key, createPropertyDescriptor$5(1, value));
|
654 | } : function (object, key, value) {
|
655 | object[key] = value;
|
656 | return object;
|
657 | };
|
658 |
|
659 | var global$h = global$p;
|
660 | var apply$5 = functionApply;
|
661 | var uncurryThis$j = functionUncurryThisClause;
|
662 | var isCallable$f = isCallable$m;
|
663 | var getOwnPropertyDescriptor$6 = objectGetOwnPropertyDescriptor.f;
|
664 | var isForced$1 = isForced_1;
|
665 | var path$m = path$o;
|
666 | var bind$h = functionBindContext;
|
667 | var createNonEnumerableProperty$8 = createNonEnumerableProperty$9;
|
668 | var hasOwn$h = hasOwnProperty_1;
|
669 |
|
670 | var wrapConstructor = function (NativeConstructor) {
|
671 | var Wrapper = function (a, b, c) {
|
672 | if (this instanceof Wrapper) {
|
673 | switch (arguments.length) {
|
674 | case 0: return new NativeConstructor();
|
675 | case 1: return new NativeConstructor(a);
|
676 | case 2: return new NativeConstructor(a, b);
|
677 | } return new NativeConstructor(a, b, c);
|
678 | } return apply$5(NativeConstructor, this, arguments);
|
679 | };
|
680 | Wrapper.prototype = NativeConstructor.prototype;
|
681 | return Wrapper;
|
682 | };
|
683 |
|
684 |
|
685 |
|
686 |
|
687 |
|
688 |
|
689 |
|
690 |
|
691 |
|
692 |
|
693 |
|
694 |
|
695 |
|
696 |
|
697 |
|
698 |
|
699 | var _export = function (options, source) {
|
700 | var TARGET = options.target;
|
701 | var GLOBAL = options.global;
|
702 | var STATIC = options.stat;
|
703 | var PROTO = options.proto;
|
704 |
|
705 | var nativeSource = GLOBAL ? global$h : STATIC ? global$h[TARGET] : (global$h[TARGET] || {}).prototype;
|
706 |
|
707 | var target = GLOBAL ? path$m : path$m[TARGET] || createNonEnumerableProperty$8(path$m, TARGET, {})[TARGET];
|
708 | var targetPrototype = target.prototype;
|
709 |
|
710 | var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;
|
711 | var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;
|
712 |
|
713 | for (key in source) {
|
714 | FORCED = isForced$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
715 |
|
716 | USE_NATIVE = !FORCED && nativeSource && hasOwn$h(nativeSource, key);
|
717 |
|
718 | targetProperty = target[key];
|
719 |
|
720 | if (USE_NATIVE) if (options.dontCallGetSet) {
|
721 | descriptor = getOwnPropertyDescriptor$6(nativeSource, key);
|
722 | nativeProperty = descriptor && descriptor.value;
|
723 | } else nativeProperty = nativeSource[key];
|
724 |
|
725 |
|
726 | sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];
|
727 |
|
728 | if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue;
|
729 |
|
730 |
|
731 | if (options.bind && USE_NATIVE) resultProperty = bind$h(sourceProperty, global$h);
|
732 |
|
733 | else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);
|
734 |
|
735 | else if (PROTO && isCallable$f(sourceProperty)) resultProperty = uncurryThis$j(sourceProperty);
|
736 |
|
737 | else resultProperty = sourceProperty;
|
738 |
|
739 |
|
740 | if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {
|
741 | createNonEnumerableProperty$8(resultProperty, 'sham', true);
|
742 | }
|
743 |
|
744 | createNonEnumerableProperty$8(target, key, resultProperty);
|
745 |
|
746 | if (PROTO) {
|
747 | VIRTUAL_PROTOTYPE = TARGET + 'Prototype';
|
748 | if (!hasOwn$h(path$m, VIRTUAL_PROTOTYPE)) {
|
749 | createNonEnumerableProperty$8(path$m, VIRTUAL_PROTOTYPE, {});
|
750 | }
|
751 |
|
752 | createNonEnumerableProperty$8(path$m[VIRTUAL_PROTOTYPE], key, sourceProperty);
|
753 |
|
754 | if (options.real && targetPrototype && (FORCED || !targetPrototype[key])) {
|
755 | createNonEnumerableProperty$8(targetPrototype, key, sourceProperty);
|
756 | }
|
757 | }
|
758 | }
|
759 | };
|
760 |
|
761 | var $$P = _export;
|
762 | var DESCRIPTORS$c = descriptors;
|
763 | var defineProperty$d = objectDefineProperty.f;
|
764 |
|
765 |
|
766 |
|
767 |
|
768 | $$P({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty$d, sham: !DESCRIPTORS$c }, {
|
769 | defineProperty: defineProperty$d
|
770 | });
|
771 |
|
772 | var path$l = path$o;
|
773 |
|
774 | var Object$4 = path$l.Object;
|
775 |
|
776 | var defineProperty$c = defineProperty$f.exports = function defineProperty(it, key, desc) {
|
777 | return Object$4.defineProperty(it, key, desc);
|
778 | };
|
779 |
|
780 | if (Object$4.defineProperty.sham) defineProperty$c.sham = true;
|
781 |
|
782 | var definePropertyExports = defineProperty$f.exports;
|
783 |
|
784 | var parent$18 = definePropertyExports;
|
785 |
|
786 | var defineProperty$b = parent$18;
|
787 |
|
788 | var parent$17 = defineProperty$b;
|
789 |
|
790 | var defineProperty$a = parent$17;
|
791 |
|
792 | var parent$16 = defineProperty$a;
|
793 |
|
794 | var defineProperty$9 = parent$16;
|
795 |
|
796 | var defineProperty$8 = defineProperty$9;
|
797 |
|
798 | var _Object$defineProperty$1 = getDefaultExportFromCjs(defineProperty$8);
|
799 |
|
800 | var classof$e = classofRaw$2;
|
801 |
|
802 |
|
803 |
|
804 |
|
805 | var isArray$e = Array.isArray || function isArray(argument) {
|
806 | return classof$e(argument) === 'Array';
|
807 | };
|
808 |
|
809 | var ceil = Math.ceil;
|
810 | var floor$1 = Math.floor;
|
811 |
|
812 |
|
813 |
|
814 |
|
815 | var mathTrunc = Math.trunc || function trunc(x) {
|
816 | var n = +x;
|
817 | return (n > 0 ? floor$1 : ceil)(n);
|
818 | };
|
819 |
|
820 | var trunc = mathTrunc;
|
821 |
|
822 |
|
823 |
|
824 | var toIntegerOrInfinity$4 = function (argument) {
|
825 | var number = +argument;
|
826 |
|
827 | return number !== number || number === 0 ? 0 : trunc(number);
|
828 | };
|
829 |
|
830 | var toIntegerOrInfinity$3 = toIntegerOrInfinity$4;
|
831 |
|
832 | var min$2 = Math.min;
|
833 |
|
834 |
|
835 |
|
836 | var toLength$1 = function (argument) {
|
837 | return argument > 0 ? min$2(toIntegerOrInfinity$3(argument), 0x1FFFFFFFFFFFFF) : 0;
|
838 | };
|
839 |
|
840 | var toLength = toLength$1;
|
841 |
|
842 |
|
843 |
|
844 | var lengthOfArrayLike$d = function (obj) {
|
845 | return toLength(obj.length);
|
846 | };
|
847 |
|
848 | var $TypeError$a = TypeError;
|
849 | var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
850 |
|
851 | var doesNotExceedSafeInteger$4 = function (it) {
|
852 | if (it > MAX_SAFE_INTEGER) throw $TypeError$a('Maximum allowed index exceeded');
|
853 | return it;
|
854 | };
|
855 |
|
856 | var toPropertyKey$1 = toPropertyKey$4;
|
857 | var definePropertyModule$3 = objectDefineProperty;
|
858 | var createPropertyDescriptor$4 = createPropertyDescriptor$7;
|
859 |
|
860 | var createProperty$6 = function (object, key, value) {
|
861 | var propertyKey = toPropertyKey$1(key);
|
862 | if (propertyKey in object) definePropertyModule$3.f(object, propertyKey, createPropertyDescriptor$4(0, value));
|
863 | else object[propertyKey] = value;
|
864 | };
|
865 |
|
866 | var wellKnownSymbol$l = wellKnownSymbol$n;
|
867 |
|
868 | var TO_STRING_TAG$4 = wellKnownSymbol$l('toStringTag');
|
869 | var test$2 = {};
|
870 |
|
871 | test$2[TO_STRING_TAG$4] = 'z';
|
872 |
|
873 | var toStringTagSupport = String(test$2) === '[object z]';
|
874 |
|
875 | var TO_STRING_TAG_SUPPORT$2 = toStringTagSupport;
|
876 | var isCallable$e = isCallable$m;
|
877 | var classofRaw = classofRaw$2;
|
878 | var wellKnownSymbol$k = wellKnownSymbol$n;
|
879 |
|
880 | var TO_STRING_TAG$3 = wellKnownSymbol$k('toStringTag');
|
881 | var $Object$1 = Object;
|
882 |
|
883 |
|
884 | var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
|
885 |
|
886 |
|
887 | var tryGet = function (it, key) {
|
888 | try {
|
889 | return it[key];
|
890 | } catch (error) { }
|
891 | };
|
892 |
|
893 |
|
894 | var classof$d = TO_STRING_TAG_SUPPORT$2 ? classofRaw : function (it) {
|
895 | var O, tag, result;
|
896 | return it === undefined ? 'Undefined' : it === null ? 'Null'
|
897 |
|
898 | : typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$3)) == 'string' ? tag
|
899 |
|
900 | : CORRECT_ARGUMENTS ? classofRaw(O)
|
901 |
|
902 | : (result = classofRaw(O)) === 'Object' && isCallable$e(O.callee) ? 'Arguments' : result;
|
903 | };
|
904 |
|
905 | var uncurryThis$i = functionUncurryThis;
|
906 | var isCallable$d = isCallable$m;
|
907 | var store$1 = sharedStore;
|
908 |
|
909 | var functionToString = uncurryThis$i(Function.toString);
|
910 |
|
911 |
|
912 | if (!isCallable$d(store$1.inspectSource)) {
|
913 | store$1.inspectSource = function (it) {
|
914 | return functionToString(it);
|
915 | };
|
916 | }
|
917 |
|
918 | var inspectSource$2 = store$1.inspectSource;
|
919 |
|
920 | var uncurryThis$h = functionUncurryThis;
|
921 | var fails$m = fails$u;
|
922 | var isCallable$c = isCallable$m;
|
923 | var classof$c = classof$d;
|
924 | var getBuiltIn$d = getBuiltIn$f;
|
925 | var inspectSource$1 = inspectSource$2;
|
926 |
|
927 | var noop = function () { };
|
928 | var empty = [];
|
929 | var construct$4 = getBuiltIn$d('Reflect', 'construct');
|
930 | var constructorRegExp = /^\s*(?:class|function)\b/;
|
931 | var exec$1 = uncurryThis$h(constructorRegExp.exec);
|
932 | var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
|
933 |
|
934 | var isConstructorModern = function isConstructor(argument) {
|
935 | if (!isCallable$c(argument)) return false;
|
936 | try {
|
937 | construct$4(noop, empty, argument);
|
938 | return true;
|
939 | } catch (error) {
|
940 | return false;
|
941 | }
|
942 | };
|
943 |
|
944 | var isConstructorLegacy = function isConstructor(argument) {
|
945 | if (!isCallable$c(argument)) return false;
|
946 | switch (classof$c(argument)) {
|
947 | case 'AsyncFunction':
|
948 | case 'GeneratorFunction':
|
949 | case 'AsyncGeneratorFunction': return false;
|
950 | }
|
951 | try {
|
952 |
|
953 |
|
954 |
|
955 | return INCORRECT_TO_STRING || !!exec$1(constructorRegExp, inspectSource$1(argument));
|
956 | } catch (error) {
|
957 | return true;
|
958 | }
|
959 | };
|
960 |
|
961 | isConstructorLegacy.sham = true;
|
962 |
|
963 |
|
964 |
|
965 | var isConstructor$4 = !construct$4 || fails$m(function () {
|
966 | var called;
|
967 | return isConstructorModern(isConstructorModern.call)
|
968 | || !isConstructorModern(Object)
|
969 | || !isConstructorModern(function () { called = true; })
|
970 | || called;
|
971 | }) ? isConstructorLegacy : isConstructorModern;
|
972 |
|
973 | var isArray$d = isArray$e;
|
974 | var isConstructor$3 = isConstructor$4;
|
975 | var isObject$c = isObject$h;
|
976 | var wellKnownSymbol$j = wellKnownSymbol$n;
|
977 |
|
978 | var SPECIES$5 = wellKnownSymbol$j('species');
|
979 | var $Array$3 = Array;
|
980 |
|
981 |
|
982 |
|
983 | var arraySpeciesConstructor$1 = function (originalArray) {
|
984 | var C;
|
985 | if (isArray$d(originalArray)) {
|
986 | C = originalArray.constructor;
|
987 |
|
988 | if (isConstructor$3(C) && (C === $Array$3 || isArray$d(C.prototype))) C = undefined;
|
989 | else if (isObject$c(C)) {
|
990 | C = C[SPECIES$5];
|
991 | if (C === null) C = undefined;
|
992 | }
|
993 | } return C === undefined ? $Array$3 : C;
|
994 | };
|
995 |
|
996 | var arraySpeciesConstructor = arraySpeciesConstructor$1;
|
997 |
|
998 |
|
999 |
|
1000 | var arraySpeciesCreate$4 = function (originalArray, length) {
|
1001 | return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
|
1002 | };
|
1003 |
|
1004 | var fails$l = fails$u;
|
1005 | var wellKnownSymbol$i = wellKnownSymbol$n;
|
1006 | var V8_VERSION$2 = engineV8Version;
|
1007 |
|
1008 | var SPECIES$4 = wellKnownSymbol$i('species');
|
1009 |
|
1010 | var arrayMethodHasSpeciesSupport$5 = function (METHOD_NAME) {
|
1011 |
|
1012 |
|
1013 |
|
1014 | return V8_VERSION$2 >= 51 || !fails$l(function () {
|
1015 | var array = [];
|
1016 | var constructor = array.constructor = {};
|
1017 | constructor[SPECIES$4] = function () {
|
1018 | return { foo: 1 };
|
1019 | };
|
1020 | return array[METHOD_NAME](Boolean).foo !== 1;
|
1021 | });
|
1022 | };
|
1023 |
|
1024 | var $$O = _export;
|
1025 | var fails$k = fails$u;
|
1026 | var isArray$c = isArray$e;
|
1027 | var isObject$b = isObject$h;
|
1028 | var toObject$c = toObject$e;
|
1029 | var lengthOfArrayLike$c = lengthOfArrayLike$d;
|
1030 | var doesNotExceedSafeInteger$3 = doesNotExceedSafeInteger$4;
|
1031 | var createProperty$5 = createProperty$6;
|
1032 | var arraySpeciesCreate$3 = arraySpeciesCreate$4;
|
1033 | var arrayMethodHasSpeciesSupport$4 = arrayMethodHasSpeciesSupport$5;
|
1034 | var wellKnownSymbol$h = wellKnownSymbol$n;
|
1035 | var V8_VERSION$1 = engineV8Version;
|
1036 |
|
1037 | var IS_CONCAT_SPREADABLE = wellKnownSymbol$h('isConcatSpreadable');
|
1038 |
|
1039 |
|
1040 |
|
1041 |
|
1042 | var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION$1 >= 51 || !fails$k(function () {
|
1043 | var array = [];
|
1044 | array[IS_CONCAT_SPREADABLE] = false;
|
1045 | return array.concat()[0] !== array;
|
1046 | });
|
1047 |
|
1048 | var isConcatSpreadable = function (O) {
|
1049 | if (!isObject$b(O)) return false;
|
1050 | var spreadable = O[IS_CONCAT_SPREADABLE];
|
1051 | return spreadable !== undefined ? !!spreadable : isArray$c(O);
|
1052 | };
|
1053 |
|
1054 | var FORCED$6 = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport$4('concat');
|
1055 |
|
1056 |
|
1057 |
|
1058 |
|
1059 | $$O({ target: 'Array', proto: true, arity: 1, forced: FORCED$6 }, {
|
1060 |
|
1061 | concat: function concat(arg) {
|
1062 | var O = toObject$c(this);
|
1063 | var A = arraySpeciesCreate$3(O, 0);
|
1064 | var n = 0;
|
1065 | var i, k, length, len, E;
|
1066 | for (i = -1, length = arguments.length; i < length; i++) {
|
1067 | E = i === -1 ? O : arguments[i];
|
1068 | if (isConcatSpreadable(E)) {
|
1069 | len = lengthOfArrayLike$c(E);
|
1070 | doesNotExceedSafeInteger$3(n + len);
|
1071 | for (k = 0; k < len; k++, n++) if (k in E) createProperty$5(A, n, E[k]);
|
1072 | } else {
|
1073 | doesNotExceedSafeInteger$3(n + 1);
|
1074 | createProperty$5(A, n++, E);
|
1075 | }
|
1076 | }
|
1077 | A.length = n;
|
1078 | return A;
|
1079 | }
|
1080 | });
|
1081 |
|
1082 | var classof$b = classof$d;
|
1083 |
|
1084 | var $String$2 = String;
|
1085 |
|
1086 | var toString$7 = function (argument) {
|
1087 | if (classof$b(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
|
1088 | return $String$2(argument);
|
1089 | };
|
1090 |
|
1091 | var objectDefineProperties = {};
|
1092 |
|
1093 | var toIntegerOrInfinity$2 = toIntegerOrInfinity$4;
|
1094 |
|
1095 | var max$3 = Math.max;
|
1096 | var min$1 = Math.min;
|
1097 |
|
1098 |
|
1099 |
|
1100 |
|
1101 | var toAbsoluteIndex$4 = function (index, length) {
|
1102 | var integer = toIntegerOrInfinity$2(index);
|
1103 | return integer < 0 ? max$3(integer + length, 0) : min$1(integer, length);
|
1104 | };
|
1105 |
|
1106 | var toIndexedObject$8 = toIndexedObject$a;
|
1107 | var toAbsoluteIndex$3 = toAbsoluteIndex$4;
|
1108 | var lengthOfArrayLike$b = lengthOfArrayLike$d;
|
1109 |
|
1110 |
|
1111 | var createMethod$3 = function (IS_INCLUDES) {
|
1112 | return function ($this, el, fromIndex) {
|
1113 | var O = toIndexedObject$8($this);
|
1114 | var length = lengthOfArrayLike$b(O);
|
1115 | var index = toAbsoluteIndex$3(fromIndex, length);
|
1116 | var value;
|
1117 |
|
1118 |
|
1119 | if (IS_INCLUDES && el !== el) while (length > index) {
|
1120 | value = O[index++];
|
1121 |
|
1122 | if (value !== value) return true;
|
1123 |
|
1124 | } else for (;length > index; index++) {
|
1125 | if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
1126 | } return !IS_INCLUDES && -1;
|
1127 | };
|
1128 | };
|
1129 |
|
1130 | var arrayIncludes = {
|
1131 |
|
1132 |
|
1133 | includes: createMethod$3(true),
|
1134 |
|
1135 |
|
1136 | indexOf: createMethod$3(false)
|
1137 | };
|
1138 |
|
1139 | var hiddenKeys$6 = {};
|
1140 |
|
1141 | var uncurryThis$g = functionUncurryThis;
|
1142 | var hasOwn$g = hasOwnProperty_1;
|
1143 | var toIndexedObject$7 = toIndexedObject$a;
|
1144 | var indexOf = arrayIncludes.indexOf;
|
1145 | var hiddenKeys$5 = hiddenKeys$6;
|
1146 |
|
1147 | var push$c = uncurryThis$g([].push);
|
1148 |
|
1149 | var objectKeysInternal = function (object, names) {
|
1150 | var O = toIndexedObject$7(object);
|
1151 | var i = 0;
|
1152 | var result = [];
|
1153 | var key;
|
1154 | for (key in O) !hasOwn$g(hiddenKeys$5, key) && hasOwn$g(O, key) && push$c(result, key);
|
1155 |
|
1156 | while (names.length > i) if (hasOwn$g(O, key = names[i++])) {
|
1157 | ~indexOf(result, key) || push$c(result, key);
|
1158 | }
|
1159 | return result;
|
1160 | };
|
1161 |
|
1162 |
|
1163 | var enumBugKeys$3 = [
|
1164 | 'constructor',
|
1165 | 'hasOwnProperty',
|
1166 | 'isPrototypeOf',
|
1167 | 'propertyIsEnumerable',
|
1168 | 'toLocaleString',
|
1169 | 'toString',
|
1170 | 'valueOf'
|
1171 | ];
|
1172 |
|
1173 | var internalObjectKeys$1 = objectKeysInternal;
|
1174 | var enumBugKeys$2 = enumBugKeys$3;
|
1175 |
|
1176 |
|
1177 |
|
1178 |
|
1179 | var objectKeys$3 = Object.keys || function keys(O) {
|
1180 | return internalObjectKeys$1(O, enumBugKeys$2);
|
1181 | };
|
1182 |
|
1183 | var DESCRIPTORS$b = descriptors;
|
1184 | var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
|
1185 | var definePropertyModule$2 = objectDefineProperty;
|
1186 | var anObject$b = anObject$d;
|
1187 | var toIndexedObject$6 = toIndexedObject$a;
|
1188 | var objectKeys$2 = objectKeys$3;
|
1189 |
|
1190 |
|
1191 |
|
1192 |
|
1193 | objectDefineProperties.f = DESCRIPTORS$b && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
1194 | anObject$b(O);
|
1195 | var props = toIndexedObject$6(Properties);
|
1196 | var keys = objectKeys$2(Properties);
|
1197 | var length = keys.length;
|
1198 | var index = 0;
|
1199 | var key;
|
1200 | while (length > index) definePropertyModule$2.f(O, key = keys[index++], props[key]);
|
1201 | return O;
|
1202 | };
|
1203 |
|
1204 | var getBuiltIn$c = getBuiltIn$f;
|
1205 |
|
1206 | var html$2 = getBuiltIn$c('document', 'documentElement');
|
1207 |
|
1208 | var shared$5 = sharedExports;
|
1209 | var uid$2 = uid$4;
|
1210 |
|
1211 | var keys$7 = shared$5('keys');
|
1212 |
|
1213 | var sharedKey$4 = function (key) {
|
1214 | return keys$7[key] || (keys$7[key] = uid$2(key));
|
1215 | };
|
1216 |
|
1217 |
|
1218 | var anObject$a = anObject$d;
|
1219 | var definePropertiesModule$1 = objectDefineProperties;
|
1220 | var enumBugKeys$1 = enumBugKeys$3;
|
1221 | var hiddenKeys$4 = hiddenKeys$6;
|
1222 | var html$1 = html$2;
|
1223 | var documentCreateElement = documentCreateElement$1;
|
1224 | var sharedKey$3 = sharedKey$4;
|
1225 |
|
1226 | var GT = '>';
|
1227 | var LT = '<';
|
1228 | var PROTOTYPE$1 = 'prototype';
|
1229 | var SCRIPT = 'script';
|
1230 | var IE_PROTO$1 = sharedKey$3('IE_PROTO');
|
1231 |
|
1232 | var EmptyConstructor = function () { };
|
1233 |
|
1234 | var scriptTag = function (content) {
|
1235 | return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
1236 | };
|
1237 |
|
1238 |
|
1239 | var NullProtoObjectViaActiveX = function (activeXDocument) {
|
1240 | activeXDocument.write(scriptTag(''));
|
1241 | activeXDocument.close();
|
1242 | var temp = activeXDocument.parentWindow.Object;
|
1243 | activeXDocument = null;
|
1244 | return temp;
|
1245 | };
|
1246 |
|
1247 |
|
1248 | var NullProtoObjectViaIFrame = function () {
|
1249 |
|
1250 | var iframe = documentCreateElement('iframe');
|
1251 | var JS = 'java' + SCRIPT + ':';
|
1252 | var iframeDocument;
|
1253 | iframe.style.display = 'none';
|
1254 | html$1.appendChild(iframe);
|
1255 |
|
1256 | iframe.src = String(JS);
|
1257 | iframeDocument = iframe.contentWindow.document;
|
1258 | iframeDocument.open();
|
1259 | iframeDocument.write(scriptTag('document.F=Object'));
|
1260 | iframeDocument.close();
|
1261 | return iframeDocument.F;
|
1262 | };
|
1263 |
|
1264 |
|
1265 |
|
1266 |
|
1267 |
|
1268 |
|
1269 | var activeXDocument;
|
1270 | var NullProtoObject = function () {
|
1271 | try {
|
1272 | activeXDocument = new ActiveXObject('htmlfile');
|
1273 | } catch (error) { }
|
1274 | NullProtoObject = typeof document != 'undefined'
|
1275 | ? document.domain && activeXDocument
|
1276 | ? NullProtoObjectViaActiveX(activeXDocument)
|
1277 | : NullProtoObjectViaIFrame()
|
1278 | : NullProtoObjectViaActiveX(activeXDocument);
|
1279 | var length = enumBugKeys$1.length;
|
1280 | while (length--) delete NullProtoObject[PROTOTYPE$1][enumBugKeys$1[length]];
|
1281 | return NullProtoObject();
|
1282 | };
|
1283 |
|
1284 | hiddenKeys$4[IE_PROTO$1] = true;
|
1285 |
|
1286 |
|
1287 |
|
1288 |
|
1289 | var objectCreate = Object.create || function create(O, Properties) {
|
1290 | var result;
|
1291 | if (O !== null) {
|
1292 | EmptyConstructor[PROTOTYPE$1] = anObject$a(O);
|
1293 | result = new EmptyConstructor();
|
1294 | EmptyConstructor[PROTOTYPE$1] = null;
|
1295 |
|
1296 | result[IE_PROTO$1] = O;
|
1297 | } else result = NullProtoObject();
|
1298 | return Properties === undefined ? result : definePropertiesModule$1.f(result, Properties);
|
1299 | };
|
1300 |
|
1301 | var objectGetOwnPropertyNames = {};
|
1302 |
|
1303 | var internalObjectKeys = objectKeysInternal;
|
1304 | var enumBugKeys = enumBugKeys$3;
|
1305 |
|
1306 | var hiddenKeys$3 = enumBugKeys.concat('length', 'prototype');
|
1307 |
|
1308 |
|
1309 |
|
1310 |
|
1311 | objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
1312 | return internalObjectKeys(O, hiddenKeys$3);
|
1313 | };
|
1314 |
|
1315 | var objectGetOwnPropertyNamesExternal = {};
|
1316 |
|
1317 | var toAbsoluteIndex$2 = toAbsoluteIndex$4;
|
1318 | var lengthOfArrayLike$a = lengthOfArrayLike$d;
|
1319 | var createProperty$4 = createProperty$6;
|
1320 |
|
1321 | var $Array$2 = Array;
|
1322 | var max$2 = Math.max;
|
1323 |
|
1324 | var arraySliceSimple = function (O, start, end) {
|
1325 | var length = lengthOfArrayLike$a(O);
|
1326 | var k = toAbsoluteIndex$2(start, length);
|
1327 | var fin = toAbsoluteIndex$2(end === undefined ? length : end, length);
|
1328 | var result = $Array$2(max$2(fin - k, 0));
|
1329 | var n = 0;
|
1330 | for (; k < fin; k++, n++) createProperty$4(result, n, O[k]);
|
1331 | result.length = n;
|
1332 | return result;
|
1333 | };
|
1334 |
|
1335 |
|
1336 | var classof$a = classofRaw$2;
|
1337 | var toIndexedObject$5 = toIndexedObject$a;
|
1338 | var $getOwnPropertyNames$1 = objectGetOwnPropertyNames.f;
|
1339 | var arraySlice$6 = arraySliceSimple;
|
1340 |
|
1341 | var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
1342 | ? Object.getOwnPropertyNames(window) : [];
|
1343 |
|
1344 | var getWindowNames = function (it) {
|
1345 | try {
|
1346 | return $getOwnPropertyNames$1(it);
|
1347 | } catch (error) {
|
1348 | return arraySlice$6(windowNames);
|
1349 | }
|
1350 | };
|
1351 |
|
1352 |
|
1353 | objectGetOwnPropertyNamesExternal.f = function getOwnPropertyNames(it) {
|
1354 | return windowNames && classof$a(it) === 'Window'
|
1355 | ? getWindowNames(it)
|
1356 | : $getOwnPropertyNames$1(toIndexedObject$5(it));
|
1357 | };
|
1358 |
|
1359 | var objectGetOwnPropertySymbols = {};
|
1360 |
|
1361 |
|
1362 | objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
1363 |
|
1364 | var createNonEnumerableProperty$7 = createNonEnumerableProperty$9;
|
1365 |
|
1366 | var defineBuiltIn$6 = function (target, key, value, options) {
|
1367 | if (options && options.enumerable) target[key] = value;
|
1368 | else createNonEnumerableProperty$7(target, key, value);
|
1369 | return target;
|
1370 | };
|
1371 |
|
1372 | var defineProperty$7 = objectDefineProperty;
|
1373 |
|
1374 | var defineBuiltInAccessor$3 = function (target, name, descriptor) {
|
1375 | return defineProperty$7.f(target, name, descriptor);
|
1376 | };
|
1377 |
|
1378 | var wellKnownSymbolWrapped = {};
|
1379 |
|
1380 | var wellKnownSymbol$g = wellKnownSymbol$n;
|
1381 |
|
1382 | wellKnownSymbolWrapped.f = wellKnownSymbol$g;
|
1383 |
|
1384 | var path$k = path$o;
|
1385 | var hasOwn$f = hasOwnProperty_1;
|
1386 | var wrappedWellKnownSymbolModule$1 = wellKnownSymbolWrapped;
|
1387 | var defineProperty$6 = objectDefineProperty.f;
|
1388 |
|
1389 | var wellKnownSymbolDefine = function (NAME) {
|
1390 | var Symbol = path$k.Symbol || (path$k.Symbol = {});
|
1391 | if (!hasOwn$f(Symbol, NAME)) defineProperty$6(Symbol, NAME, {
|
1392 | value: wrappedWellKnownSymbolModule$1.f(NAME)
|
1393 | });
|
1394 | };
|
1395 |
|
1396 | var call$e = functionCall;
|
1397 | var getBuiltIn$b = getBuiltIn$f;
|
1398 | var wellKnownSymbol$f = wellKnownSymbol$n;
|
1399 | var defineBuiltIn$5 = defineBuiltIn$6;
|
1400 |
|
1401 | var symbolDefineToPrimitive = function () {
|
1402 | var Symbol = getBuiltIn$b('Symbol');
|
1403 | var SymbolPrototype = Symbol && Symbol.prototype;
|
1404 | var valueOf = SymbolPrototype && SymbolPrototype.valueOf;
|
1405 | var TO_PRIMITIVE = wellKnownSymbol$f('toPrimitive');
|
1406 |
|
1407 | if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {
|
1408 |
|
1409 |
|
1410 |
|
1411 | defineBuiltIn$5(SymbolPrototype, TO_PRIMITIVE, function (hint) {
|
1412 | return call$e(valueOf, this);
|
1413 | }, { arity: 1 });
|
1414 | }
|
1415 | };
|
1416 |
|
1417 | var TO_STRING_TAG_SUPPORT$1 = toStringTagSupport;
|
1418 | var classof$9 = classof$d;
|
1419 |
|
1420 |
|
1421 |
|
1422 | var objectToString = TO_STRING_TAG_SUPPORT$1 ? {}.toString : function toString() {
|
1423 | return '[object ' + classof$9(this) + ']';
|
1424 | };
|
1425 |
|
1426 | var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
1427 | var defineProperty$5 = objectDefineProperty.f;
|
1428 | var createNonEnumerableProperty$6 = createNonEnumerableProperty$9;
|
1429 | var hasOwn$e = hasOwnProperty_1;
|
1430 | var toString$6 = objectToString;
|
1431 | var wellKnownSymbol$e = wellKnownSymbol$n;
|
1432 |
|
1433 | var TO_STRING_TAG$2 = wellKnownSymbol$e('toStringTag');
|
1434 |
|
1435 | var setToStringTag$7 = function (it, TAG, STATIC, SET_METHOD) {
|
1436 | if (it) {
|
1437 | var target = STATIC ? it : it.prototype;
|
1438 | if (!hasOwn$e(target, TO_STRING_TAG$2)) {
|
1439 | defineProperty$5(target, TO_STRING_TAG$2, { configurable: true, value: TAG });
|
1440 | }
|
1441 | if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {
|
1442 | createNonEnumerableProperty$6(target, 'toString', toString$6);
|
1443 | }
|
1444 | }
|
1445 | };
|
1446 |
|
1447 | var global$g = global$p;
|
1448 | var isCallable$b = isCallable$m;
|
1449 |
|
1450 | var WeakMap$1 = global$g.WeakMap;
|
1451 |
|
1452 | var weakMapBasicDetection = isCallable$b(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
1453 |
|
1454 | var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
1455 | var global$f = global$p;
|
1456 | var isObject$a = isObject$h;
|
1457 | var createNonEnumerableProperty$5 = createNonEnumerableProperty$9;
|
1458 | var hasOwn$d = hasOwnProperty_1;
|
1459 | var shared$4 = sharedStore;
|
1460 | var sharedKey$2 = sharedKey$4;
|
1461 | var hiddenKeys$2 = hiddenKeys$6;
|
1462 |
|
1463 | var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
1464 | var TypeError$3 = global$f.TypeError;
|
1465 | var WeakMap = global$f.WeakMap;
|
1466 | var set$4, get, has;
|
1467 |
|
1468 | var enforce = function (it) {
|
1469 | return has(it) ? get(it) : set$4(it, {});
|
1470 | };
|
1471 |
|
1472 | var getterFor = function (TYPE) {
|
1473 | return function (it) {
|
1474 | var state;
|
1475 | if (!isObject$a(it) || (state = get(it)).type !== TYPE) {
|
1476 | throw new TypeError$3('Incompatible receiver, ' + TYPE + ' required');
|
1477 | } return state;
|
1478 | };
|
1479 | };
|
1480 |
|
1481 | if (NATIVE_WEAK_MAP || shared$4.state) {
|
1482 | var store = shared$4.state || (shared$4.state = new WeakMap());
|
1483 |
|
1484 | store.get = store.get;
|
1485 | store.has = store.has;
|
1486 | store.set = store.set;
|
1487 |
|
1488 | set$4 = function (it, metadata) {
|
1489 | if (store.has(it)) throw new TypeError$3(OBJECT_ALREADY_INITIALIZED);
|
1490 | metadata.facade = it;
|
1491 | store.set(it, metadata);
|
1492 | return metadata;
|
1493 | };
|
1494 | get = function (it) {
|
1495 | return store.get(it) || {};
|
1496 | };
|
1497 | has = function (it) {
|
1498 | return store.has(it);
|
1499 | };
|
1500 | } else {
|
1501 | var STATE = sharedKey$2('state');
|
1502 | hiddenKeys$2[STATE] = true;
|
1503 | set$4 = function (it, metadata) {
|
1504 | if (hasOwn$d(it, STATE)) throw new TypeError$3(OBJECT_ALREADY_INITIALIZED);
|
1505 | metadata.facade = it;
|
1506 | createNonEnumerableProperty$5(it, STATE, metadata);
|
1507 | return metadata;
|
1508 | };
|
1509 | get = function (it) {
|
1510 | return hasOwn$d(it, STATE) ? it[STATE] : {};
|
1511 | };
|
1512 | has = function (it) {
|
1513 | return hasOwn$d(it, STATE);
|
1514 | };
|
1515 | }
|
1516 |
|
1517 | var internalState = {
|
1518 | set: set$4,
|
1519 | get: get,
|
1520 | has: has,
|
1521 | enforce: enforce,
|
1522 | getterFor: getterFor
|
1523 | };
|
1524 |
|
1525 | var bind$g = functionBindContext;
|
1526 | var uncurryThis$f = functionUncurryThis;
|
1527 | var IndexedObject$2 = indexedObject;
|
1528 | var toObject$b = toObject$e;
|
1529 | var lengthOfArrayLike$9 = lengthOfArrayLike$d;
|
1530 | var arraySpeciesCreate$2 = arraySpeciesCreate$4;
|
1531 |
|
1532 | var push$b = uncurryThis$f([].push);
|
1533 |
|
1534 | // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
|
1535 | var createMethod$2 = function (TYPE) {
|
1536 | var IS_MAP = TYPE === 1;
|
1537 | var IS_FILTER = TYPE === 2;
|
1538 | var IS_SOME = TYPE === 3;
|
1539 | var IS_EVERY = TYPE === 4;
|
1540 | var IS_FIND_INDEX = TYPE === 6;
|
1541 | var IS_FILTER_REJECT = TYPE === 7;
|
1542 | var NO_HOLES = TYPE === 5 || IS_FIND_INDEX;
|
1543 | return function ($this, callbackfn, that, specificCreate) {
|
1544 | var O = toObject$b($this);
|
1545 | var self = IndexedObject$2(O);
|
1546 | var boundFunction = bind$g(callbackfn, that);
|
1547 | var length = lengthOfArrayLike$9(self);
|
1548 | var index = 0;
|
1549 | var create = specificCreate || arraySpeciesCreate$2;
|
1550 | var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
|
1551 | var value, result;
|
1552 | for (;length > index; index++) if (NO_HOLES || index in self) {
|
1553 | value = self[index];
|
1554 | result = boundFunction(value, index, O);
|
1555 | if (TYPE) {
|
1556 | if (IS_MAP) target[index] = result; // map
|
1557 | else if (result) switch (TYPE) {
|
1558 | case 3: return true; // some
|
1559 | case 5: return value; // find
|
1560 | case 6: return index; // findIndex
|
1561 | case 2: push$b(target, value); // filter
|
1562 | } else switch (TYPE) {
|
1563 | case 4: return false; // every
|
1564 | case 7: push$b(target, value); // filterReject
|
1565 | }
|
1566 | }
|
1567 | }
|
1568 | return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
1569 | };
|
1570 | };
|
1571 |
|
1572 | var arrayIteration = {
|
1573 | // `Array.prototype.forEach` method
|
1574 | // https://tc39.es/ecma262/#sec-array.prototype.foreach
|
1575 | forEach: createMethod$2(0),
|
1576 | // `Array.prototype.map` method
|
1577 | // https://tc39.es/ecma262/#sec-array.prototype.map
|
1578 | map: createMethod$2(1),
|
1579 | // `Array.prototype.filter` method
|
1580 | // https://tc39.es/ecma262/#sec-array.prototype.filter
|
1581 | filter: createMethod$2(2),
|
1582 | // `Array.prototype.some` method
|
1583 | // https://tc39.es/ecma262/#sec-array.prototype.some
|
1584 | some: createMethod$2(3),
|
1585 | // `Array.prototype.every` method
|
1586 | // https://tc39.es/ecma262/#sec-array.prototype.every
|
1587 | every: createMethod$2(4),
|
1588 | // `Array.prototype.find` method
|
1589 | // https://tc39.es/ecma262/#sec-array.prototype.find
|
1590 | find: createMethod$2(5),
|
1591 | // `Array.prototype.findIndex` method
|
1592 | // https://tc39.es/ecma262/#sec-array.prototype.findIndex
|
1593 | findIndex: createMethod$2(6),
|
1594 | // `Array.prototype.filterReject` method
|
1595 | // https://github.com/tc39/proposal-array-filtering
|
1596 | filterReject: createMethod$2(7)
|
1597 | };
|
1598 |
|
1599 | var $$N = _export;
|
1600 | var global$e = global$p;
|
1601 | var call$d = functionCall;
|
1602 | var uncurryThis$e = functionUncurryThis;
|
1603 | var DESCRIPTORS$a = descriptors;
|
1604 | var NATIVE_SYMBOL$3 = symbolConstructorDetection;
|
1605 | var fails$j = fails$u;
|
1606 | var hasOwn$c = hasOwnProperty_1;
|
1607 | var isPrototypeOf$j = objectIsPrototypeOf;
|
1608 | var anObject$9 = anObject$d;
|
1609 | var toIndexedObject$4 = toIndexedObject$a;
|
1610 | var toPropertyKey = toPropertyKey$4;
|
1611 | var $toString = toString$7;
|
1612 | var createPropertyDescriptor$3 = createPropertyDescriptor$7;
|
1613 | var nativeObjectCreate = objectCreate;
|
1614 | var objectKeys$1 = objectKeys$3;
|
1615 | var getOwnPropertyNamesModule$2 = objectGetOwnPropertyNames;
|
1616 | var getOwnPropertyNamesExternal = objectGetOwnPropertyNamesExternal;
|
1617 | var getOwnPropertySymbolsModule$3 = objectGetOwnPropertySymbols;
|
1618 | var getOwnPropertyDescriptorModule$2 = objectGetOwnPropertyDescriptor;
|
1619 | var definePropertyModule$1 = objectDefineProperty;
|
1620 | var definePropertiesModule = objectDefineProperties;
|
1621 | var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
|
1622 | var defineBuiltIn$4 = defineBuiltIn$6;
|
1623 | var defineBuiltInAccessor$2 = defineBuiltInAccessor$3;
|
1624 | var shared$3 = sharedExports;
|
1625 | var sharedKey$1 = sharedKey$4;
|
1626 | var hiddenKeys$1 = hiddenKeys$6;
|
1627 | var uid$1 = uid$4;
|
1628 | var wellKnownSymbol$d = wellKnownSymbol$n;
|
1629 | var wrappedWellKnownSymbolModule = wellKnownSymbolWrapped;
|
1630 | var defineWellKnownSymbol$l = wellKnownSymbolDefine;
|
1631 | var defineSymbolToPrimitive$1 = symbolDefineToPrimitive;
|
1632 | var setToStringTag$6 = setToStringTag$7;
|
1633 | var InternalStateModule$5 = internalState;
|
1634 | var $forEach$1 = arrayIteration.forEach;
|
1635 |
|
1636 | var HIDDEN = sharedKey$1('hidden');
|
1637 | var SYMBOL = 'Symbol';
|
1638 | var PROTOTYPE = 'prototype';
|
1639 |
|
1640 | var setInternalState$5 = InternalStateModule$5.set;
|
1641 | var getInternalState$2 = InternalStateModule$5.getterFor(SYMBOL);
|
1642 |
|
1643 | var ObjectPrototype$2 = Object[PROTOTYPE];
|
1644 | var $Symbol = global$e.Symbol;
|
1645 | var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
|
1646 | var RangeError = global$e.RangeError;
|
1647 | var TypeError$2 = global$e.TypeError;
|
1648 | var QObject = global$e.QObject;
|
1649 | var nativeGetOwnPropertyDescriptor$1 = getOwnPropertyDescriptorModule$2.f;
|
1650 | var nativeDefineProperty = definePropertyModule$1.f;
|
1651 | var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
|
1652 | var nativePropertyIsEnumerable = propertyIsEnumerableModule$1.f;
|
1653 | var push$a = uncurryThis$e([].push);
|
1654 |
|
1655 | var AllSymbols = shared$3('symbols');
|
1656 | var ObjectPrototypeSymbols = shared$3('op-symbols');
|
1657 | var WellKnownSymbolsStore$1 = shared$3('wks');
|
1658 |
|
1659 | // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
|
1660 | var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
|
1661 |
|
1662 | // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
|
1663 | var fallbackDefineProperty = function (O, P, Attributes) {
|
1664 | var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$1(ObjectPrototype$2, P);
|
1665 | if (ObjectPrototypeDescriptor) delete ObjectPrototype$2[P];
|
1666 | nativeDefineProperty(O, P, Attributes);
|
1667 | if (ObjectPrototypeDescriptor && O !== ObjectPrototype$2) {
|
1668 | nativeDefineProperty(ObjectPrototype$2, P, ObjectPrototypeDescriptor);
|
1669 | }
|
1670 | };
|
1671 |
|
1672 | var setSymbolDescriptor = DESCRIPTORS$a && fails$j(function () {
|
1673 | return nativeObjectCreate(nativeDefineProperty({}, 'a', {
|
1674 | get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
|
1675 | })).a !== 7;
|
1676 | }) ? fallbackDefineProperty : nativeDefineProperty;
|
1677 |
|
1678 | var wrap = function (tag, description) {
|
1679 | var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
|
1680 | setInternalState$5(symbol, {
|
1681 | type: SYMBOL,
|
1682 | tag: tag,
|
1683 | description: description
|
1684 | });
|
1685 | if (!DESCRIPTORS$a) symbol.description = description;
|
1686 | return symbol;
|
1687 | };
|
1688 |
|
1689 | var $defineProperty = function defineProperty(O, P, Attributes) {
|
1690 | if (O === ObjectPrototype$2) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
|
1691 | anObject$9(O);
|
1692 | var key = toPropertyKey(P);
|
1693 | anObject$9(Attributes);
|
1694 | if (hasOwn$c(AllSymbols, key)) {
|
1695 | if (!Attributes.enumerable) {
|
1696 | if (!hasOwn$c(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor$3(1, {}));
|
1697 | O[HIDDEN][key] = true;
|
1698 | } else {
|
1699 | if (hasOwn$c(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
|
1700 | Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor$3(0, false) });
|
1701 | } return setSymbolDescriptor(O, key, Attributes);
|
1702 | } return nativeDefineProperty(O, key, Attributes);
|
1703 | };
|
1704 |
|
1705 | var $defineProperties = function defineProperties(O, Properties) {
|
1706 | anObject$9(O);
|
1707 | var properties = toIndexedObject$4(Properties);
|
1708 | var keys = objectKeys$1(properties).concat($getOwnPropertySymbols(properties));
|
1709 | $forEach$1(keys, function (key) {
|
1710 | if (!DESCRIPTORS$a || call$d($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]);
|
1711 | });
|
1712 | return O;
|
1713 | };
|
1714 |
|
1715 | var $create = function create(O, Properties) {
|
1716 | return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
|
1717 | };
|
1718 |
|
1719 | var $propertyIsEnumerable = function propertyIsEnumerable(V) {
|
1720 | var P = toPropertyKey(V);
|
1721 | var enumerable = call$d(nativePropertyIsEnumerable, this, P);
|
1722 | if (this === ObjectPrototype$2 && hasOwn$c(AllSymbols, P) && !hasOwn$c(ObjectPrototypeSymbols, P)) return false;
|
1723 | return enumerable || !hasOwn$c(this, P) || !hasOwn$c(AllSymbols, P) || hasOwn$c(this, HIDDEN) && this[HIDDEN][P]
|
1724 | ? enumerable : true;
|
1725 | };
|
1726 |
|
1727 | var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
|
1728 | var it = toIndexedObject$4(O);
|
1729 | var key = toPropertyKey(P);
|
1730 | if (it === ObjectPrototype$2 && hasOwn$c(AllSymbols, key) && !hasOwn$c(ObjectPrototypeSymbols, key)) return;
|
1731 | var descriptor = nativeGetOwnPropertyDescriptor$1(it, key);
|
1732 | if (descriptor && hasOwn$c(AllSymbols, key) && !(hasOwn$c(it, HIDDEN) && it[HIDDEN][key])) {
|
1733 | descriptor.enumerable = true;
|
1734 | }
|
1735 | return descriptor;
|
1736 | };
|
1737 |
|
1738 | var $getOwnPropertyNames = function getOwnPropertyNames(O) {
|
1739 | var names = nativeGetOwnPropertyNames(toIndexedObject$4(O));
|
1740 | var result = [];
|
1741 | $forEach$1(names, function (key) {
|
1742 | if (!hasOwn$c(AllSymbols, key) && !hasOwn$c(hiddenKeys$1, key)) push$a(result, key);
|
1743 | });
|
1744 | return result;
|
1745 | };
|
1746 |
|
1747 | var $getOwnPropertySymbols = function (O) {
|
1748 | var IS_OBJECT_PROTOTYPE = O === ObjectPrototype$2;
|
1749 | var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject$4(O));
|
1750 | var result = [];
|
1751 | $forEach$1(names, function (key) {
|
1752 | if (hasOwn$c(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn$c(ObjectPrototype$2, key))) {
|
1753 | push$a(result, AllSymbols[key]);
|
1754 | }
|
1755 | });
|
1756 | return result;
|
1757 | };
|
1758 |
|
1759 | // `Symbol` constructor
|
1760 | // https://tc39.es/ecma262/#sec-symbol-constructor
|
1761 | if (!NATIVE_SYMBOL$3) {
|
1762 | $Symbol = function Symbol() {
|
1763 | if (isPrototypeOf$j(SymbolPrototype, this)) throw new TypeError$2('Symbol is not a constructor');
|
1764 | var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);
|
1765 | var tag = uid$1(description);
|
1766 | var setter = function (value) {
|
1767 | var $this = this === undefined ? global$e : this;
|
1768 | if ($this === ObjectPrototype$2) call$d(setter, ObjectPrototypeSymbols, value);
|
1769 | if (hasOwn$c($this, HIDDEN) && hasOwn$c($this[HIDDEN], tag)) $this[HIDDEN][tag] = false;
|
1770 | var descriptor = createPropertyDescriptor$3(1, value);
|
1771 | try {
|
1772 | setSymbolDescriptor($this, tag, descriptor);
|
1773 | } catch (error) {
|
1774 | if (!(error instanceof RangeError)) throw error;
|
1775 | fallbackDefineProperty($this, tag, descriptor);
|
1776 | }
|
1777 | };
|
1778 | if (DESCRIPTORS$a && USE_SETTER) setSymbolDescriptor(ObjectPrototype$2, tag, { configurable: true, set: setter });
|
1779 | return wrap(tag, description);
|
1780 | };
|
1781 |
|
1782 | SymbolPrototype = $Symbol[PROTOTYPE];
|
1783 |
|
1784 | defineBuiltIn$4(SymbolPrototype, 'toString', function toString() {
|
1785 | return getInternalState$2(this).tag;
|
1786 | });
|
1787 |
|
1788 | defineBuiltIn$4($Symbol, 'withoutSetter', function (description) {
|
1789 | return wrap(uid$1(description), description);
|
1790 | });
|
1791 |
|
1792 | propertyIsEnumerableModule$1.f = $propertyIsEnumerable;
|
1793 | definePropertyModule$1.f = $defineProperty;
|
1794 | definePropertiesModule.f = $defineProperties;
|
1795 | getOwnPropertyDescriptorModule$2.f = $getOwnPropertyDescriptor;
|
1796 | getOwnPropertyNamesModule$2.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
|
1797 | getOwnPropertySymbolsModule$3.f = $getOwnPropertySymbols;
|
1798 |
|
1799 | wrappedWellKnownSymbolModule.f = function (name) {
|
1800 | return wrap(wellKnownSymbol$d(name), name);
|
1801 | };
|
1802 |
|
1803 | if (DESCRIPTORS$a) {
|
1804 | // https://github.com/tc39/proposal-Symbol-description
|
1805 | defineBuiltInAccessor$2(SymbolPrototype, 'description', {
|
1806 | configurable: true,
|
1807 | get: function description() {
|
1808 | return getInternalState$2(this).description;
|
1809 | }
|
1810 | });
|
1811 | }
|
1812 | }
|
1813 |
|
1814 | $$N({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL$3, sham: !NATIVE_SYMBOL$3 }, {
|
1815 | Symbol: $Symbol
|
1816 | });
|
1817 |
|
1818 | $forEach$1(objectKeys$1(WellKnownSymbolsStore$1), function (name) {
|
1819 | defineWellKnownSymbol$l(name);
|
1820 | });
|
1821 |
|
1822 | $$N({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL$3 }, {
|
1823 | useSetter: function () { USE_SETTER = true; },
|
1824 | useSimple: function () { USE_SETTER = false; }
|
1825 | });
|
1826 |
|
1827 | $$N({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL$3, sham: !DESCRIPTORS$a }, {
|
1828 | // `Object.create` method
|
1829 | // https://tc39.es/ecma262/#sec-object.create
|
1830 | create: $create,
|
1831 | // `Object.defineProperty` method
|
1832 | // https://tc39.es/ecma262/#sec-object.defineproperty
|
1833 | defineProperty: $defineProperty,
|
1834 | // `Object.defineProperties` method
|
1835 | // https://tc39.es/ecma262/#sec-object.defineproperties
|
1836 | defineProperties: $defineProperties,
|
1837 | // `Object.getOwnPropertyDescriptor` method
|
1838 | // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
|
1839 | getOwnPropertyDescriptor: $getOwnPropertyDescriptor
|
1840 | });
|
1841 |
|
1842 | $$N({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL$3 }, {
|
1843 | // `Object.getOwnPropertyNames` method
|
1844 | // https://tc39.es/ecma262/#sec-object.getownpropertynames
|
1845 | getOwnPropertyNames: $getOwnPropertyNames
|
1846 | });
|
1847 |
|
1848 | // `Symbol.prototype[@@toPrimitive]` method
|
1849 | // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
|
1850 | defineSymbolToPrimitive$1();
|
1851 |
|
1852 | // `Symbol.prototype[@@toStringTag]` property
|
1853 | // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
|
1854 | setToStringTag$6($Symbol, SYMBOL);
|
1855 |
|
1856 | hiddenKeys$1[HIDDEN] = true;
|
1857 |
|
1858 | var NATIVE_SYMBOL$2 = symbolConstructorDetection;
|
1859 |
|
1860 | /* eslint-disable es/no-symbol -- safe */
|
1861 | var symbolRegistryDetection = NATIVE_SYMBOL$2 && !!Symbol['for'] && !!Symbol.keyFor;
|
1862 |
|
1863 | var $$M = _export;
|
1864 | var getBuiltIn$a = getBuiltIn$f;
|
1865 | var hasOwn$b = hasOwnProperty_1;
|
1866 | var toString$5 = toString$7;
|
1867 | var shared$2 = sharedExports;
|
1868 | var NATIVE_SYMBOL_REGISTRY$1 = symbolRegistryDetection;
|
1869 |
|
1870 | var StringToSymbolRegistry = shared$2('string-to-symbol-registry');
|
1871 | var SymbolToStringRegistry$1 = shared$2('symbol-to-string-registry');
|
1872 |
|
1873 | // `Symbol.for` method
|
1874 | // https://tc39.es/ecma262/#sec-symbol.for
|
1875 | $$M({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY$1 }, {
|
1876 | 'for': function (key) {
|
1877 | var string = toString$5(key);
|
1878 | if (hasOwn$b(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
|
1879 | var symbol = getBuiltIn$a('Symbol')(string);
|
1880 | StringToSymbolRegistry[string] = symbol;
|
1881 | SymbolToStringRegistry$1[symbol] = string;
|
1882 | return symbol;
|
1883 | }
|
1884 | });
|
1885 |
|
1886 | var $$L = _export;
|
1887 | var hasOwn$a = hasOwnProperty_1;
|
1888 | var isSymbol$2 = isSymbol$5;
|
1889 | var tryToString$4 = tryToString$6;
|
1890 | var shared$1 = sharedExports;
|
1891 | var NATIVE_SYMBOL_REGISTRY = symbolRegistryDetection;
|
1892 |
|
1893 | var SymbolToStringRegistry = shared$1('symbol-to-string-registry');
|
1894 |
|
1895 | // `Symbol.keyFor` method
|
1896 | // https://tc39.es/ecma262/#sec-symbol.keyfor
|
1897 | $$L({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
|
1898 | keyFor: function keyFor(sym) {
|
1899 | if (!isSymbol$2(sym)) throw new TypeError(tryToString$4(sym) + ' is not a symbol');
|
1900 | if (hasOwn$a(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
|
1901 | }
|
1902 | });
|
1903 |
|
1904 | var uncurryThis$d = functionUncurryThis;
|
1905 |
|
1906 | var arraySlice$5 = uncurryThis$d([].slice);
|
1907 |
|
1908 | var uncurryThis$c = functionUncurryThis;
|
1909 | var isArray$b = isArray$e;
|
1910 | var isCallable$a = isCallable$m;
|
1911 | var classof$8 = classofRaw$2;
|
1912 | var toString$4 = toString$7;
|
1913 |
|
1914 | var push$9 = uncurryThis$c([].push);
|
1915 |
|
1916 | var getJsonReplacerFunction = function (replacer) {
|
1917 | if (isCallable$a(replacer)) return replacer;
|
1918 | if (!isArray$b(replacer)) return;
|
1919 | var rawLength = replacer.length;
|
1920 | var keys = [];
|
1921 | for (var i = 0; i < rawLength; i++) {
|
1922 | var element = replacer[i];
|
1923 | if (typeof element == 'string') push$9(keys, element);
|
1924 | else if (typeof element == 'number' || classof$8(element) === 'Number' || classof$8(element) === 'String') push$9(keys, toString$4(element));
|
1925 | }
|
1926 | var keysLength = keys.length;
|
1927 | var root = true;
|
1928 | return function (key, value) {
|
1929 | if (root) {
|
1930 | root = false;
|
1931 | return value;
|
1932 | }
|
1933 | if (isArray$b(this)) return value;
|
1934 | for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value;
|
1935 | };
|
1936 | };
|
1937 |
|
1938 | var $$K = _export;
|
1939 | var getBuiltIn$9 = getBuiltIn$f;
|
1940 | var apply$4 = functionApply;
|
1941 | var call$c = functionCall;
|
1942 | var uncurryThis$b = functionUncurryThis;
|
1943 | var fails$i = fails$u;
|
1944 | var isCallable$9 = isCallable$m;
|
1945 | var isSymbol$1 = isSymbol$5;
|
1946 | var arraySlice$4 = arraySlice$5;
|
1947 | var getReplacerFunction = getJsonReplacerFunction;
|
1948 | var NATIVE_SYMBOL$1 = symbolConstructorDetection;
|
1949 |
|
1950 | var $String$1 = String;
|
1951 | var $stringify = getBuiltIn$9('JSON', 'stringify');
|
1952 | var exec = uncurryThis$b(/./.exec);
|
1953 | var charAt$2 = uncurryThis$b(''.charAt);
|
1954 | var charCodeAt$1 = uncurryThis$b(''.charCodeAt);
|
1955 | var replace$1 = uncurryThis$b(''.replace);
|
1956 | var numberToString = uncurryThis$b(1.0.toString);
|
1957 |
|
1958 | var tester = /[\uD800-\uDFFF]/g;
|
1959 | var low = /^[\uD800-\uDBFF]$/;
|
1960 | var hi = /^[\uDC00-\uDFFF]$/;
|
1961 |
|
1962 | var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL$1 || fails$i(function () {
|
1963 | var symbol = getBuiltIn$9('Symbol')('stringify detection');
|
1964 | // MS Edge converts symbol values to JSON as {}
|
1965 | return $stringify([symbol]) !== '[null]'
|
1966 | // WebKit converts symbol values to JSON as null
|
1967 | || $stringify({ a: symbol }) !== '{}'
|
1968 | // V8 throws on boxed symbols
|
1969 | || $stringify(Object(symbol)) !== '{}';
|
1970 | });
|
1971 |
|
1972 | // https://github.com/tc39/proposal-well-formed-stringify
|
1973 | var ILL_FORMED_UNICODE = fails$i(function () {
|
1974 | return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
|
1975 | || $stringify('\uDEAD') !== '"\\udead"';
|
1976 | });
|
1977 |
|
1978 | var stringifyWithSymbolsFix = function (it, replacer) {
|
1979 | var args = arraySlice$4(arguments);
|
1980 | var $replacer = getReplacerFunction(replacer);
|
1981 | if (!isCallable$9($replacer) && (it === undefined || isSymbol$1(it))) return; // IE8 returns string on undefined
|
1982 | args[1] = function (key, value) {
|
1983 | // some old implementations (like WebKit) could pass numbers as keys
|
1984 | if (isCallable$9($replacer)) value = call$c($replacer, this, $String$1(key), value);
|
1985 | if (!isSymbol$1(value)) return value;
|
1986 | };
|
1987 | return apply$4($stringify, null, args);
|
1988 | };
|
1989 |
|
1990 | var fixIllFormed = function (match, offset, string) {
|
1991 | var prev = charAt$2(string, offset - 1);
|
1992 | var next = charAt$2(string, offset + 1);
|
1993 | if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {
|
1994 | return '\\u' + numberToString(charCodeAt$1(match, 0), 16);
|
1995 | } return match;
|
1996 | };
|
1997 |
|
1998 | if ($stringify) {
|
1999 | // `JSON.stringify` method
|
2000 | // https://tc39.es/ecma262/#sec-json.stringify
|
2001 | $$K({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
|
2002 | // eslint-disable-next-line no-unused-vars -- required for `.length`
|
2003 | stringify: function stringify(it, replacer, space) {
|
2004 | var args = arraySlice$4(arguments);
|
2005 | var result = apply$4(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
|
2006 | return ILL_FORMED_UNICODE && typeof result == 'string' ? replace$1(result, tester, fixIllFormed) : result;
|
2007 | }
|
2008 | });
|
2009 | }
|
2010 |
|
2011 | var $$J = _export;
|
2012 | var NATIVE_SYMBOL = symbolConstructorDetection;
|
2013 | var fails$h = fails$u;
|
2014 | var getOwnPropertySymbolsModule$2 = objectGetOwnPropertySymbols;
|
2015 | var toObject$a = toObject$e;
|
2016 |
|
2017 | // V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
|
2018 | // https://bugs.chromium.org/p/v8/issues/detail?id=3443
|
2019 | var FORCED$5 = !NATIVE_SYMBOL || fails$h(function () { getOwnPropertySymbolsModule$2.f(1); });
|
2020 |
|
2021 | // `Object.getOwnPropertySymbols` method
|
2022 | // https://tc39.es/ecma262/#sec-object.getownpropertysymbols
|
2023 | $$J({ target: 'Object', stat: true, forced: FORCED$5 }, {
|
2024 | getOwnPropertySymbols: function getOwnPropertySymbols(it) {
|
2025 | var $getOwnPropertySymbols = getOwnPropertySymbolsModule$2.f;
|
2026 | return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject$a(it)) : [];
|
2027 | }
|
2028 | });
|
2029 |
|
2030 | var defineWellKnownSymbol$k = wellKnownSymbolDefine;
|
2031 |
|
2032 | // `Symbol.asyncIterator` well-known symbol
|
2033 | // https://tc39.es/ecma262/#sec-symbol.asynciterator
|
2034 | defineWellKnownSymbol$k('asyncIterator');
|
2035 |
|
2036 | var defineWellKnownSymbol$j = wellKnownSymbolDefine;
|
2037 |
|
2038 | // `Symbol.hasInstance` well-known symbol
|
2039 | // https://tc39.es/ecma262/#sec-symbol.hasinstance
|
2040 | defineWellKnownSymbol$j('hasInstance');
|
2041 |
|
2042 | var defineWellKnownSymbol$i = wellKnownSymbolDefine;
|
2043 |
|
2044 | // `Symbol.isConcatSpreadable` well-known symbol
|
2045 | // https://tc39.es/ecma262/#sec-symbol.isconcatspreadable
|
2046 | defineWellKnownSymbol$i('isConcatSpreadable');
|
2047 |
|
2048 | var defineWellKnownSymbol$h = wellKnownSymbolDefine;
|
2049 |
|
2050 | // `Symbol.iterator` well-known symbol
|
2051 | // https://tc39.es/ecma262/#sec-symbol.iterator
|
2052 | defineWellKnownSymbol$h('iterator');
|
2053 |
|
2054 | var defineWellKnownSymbol$g = wellKnownSymbolDefine;
|
2055 |
|
2056 | // `Symbol.match` well-known symbol
|
2057 | // https://tc39.es/ecma262/#sec-symbol.match
|
2058 | defineWellKnownSymbol$g('match');
|
2059 |
|
2060 | var defineWellKnownSymbol$f = wellKnownSymbolDefine;
|
2061 |
|
2062 | // `Symbol.matchAll` well-known symbol
|
2063 | // https://tc39.es/ecma262/#sec-symbol.matchall
|
2064 | defineWellKnownSymbol$f('matchAll');
|
2065 |
|
2066 | var defineWellKnownSymbol$e = wellKnownSymbolDefine;
|
2067 |
|
2068 | // `Symbol.replace` well-known symbol
|
2069 | // https://tc39.es/ecma262/#sec-symbol.replace
|
2070 | defineWellKnownSymbol$e('replace');
|
2071 |
|
2072 | var defineWellKnownSymbol$d = wellKnownSymbolDefine;
|
2073 |
|
2074 | // `Symbol.search` well-known symbol
|
2075 | // https://tc39.es/ecma262/#sec-symbol.search
|
2076 | defineWellKnownSymbol$d('search');
|
2077 |
|
2078 | var defineWellKnownSymbol$c = wellKnownSymbolDefine;
|
2079 |
|
2080 | // `Symbol.species` well-known symbol
|
2081 | // https://tc39.es/ecma262/#sec-symbol.species
|
2082 | defineWellKnownSymbol$c('species');
|
2083 |
|
2084 | var defineWellKnownSymbol$b = wellKnownSymbolDefine;
|
2085 |
|
2086 | // `Symbol.split` well-known symbol
|
2087 | // https://tc39.es/ecma262/#sec-symbol.split
|
2088 | defineWellKnownSymbol$b('split');
|
2089 |
|
2090 | var defineWellKnownSymbol$a = wellKnownSymbolDefine;
|
2091 | var defineSymbolToPrimitive = symbolDefineToPrimitive;
|
2092 |
|
2093 | // `Symbol.toPrimitive` well-known symbol
|
2094 | // https://tc39.es/ecma262/#sec-symbol.toprimitive
|
2095 | defineWellKnownSymbol$a('toPrimitive');
|
2096 |
|
2097 | // `Symbol.prototype[@@toPrimitive]` method
|
2098 | // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
|
2099 | defineSymbolToPrimitive();
|
2100 |
|
2101 | var getBuiltIn$8 = getBuiltIn$f;
|
2102 | var defineWellKnownSymbol$9 = wellKnownSymbolDefine;
|
2103 | var setToStringTag$5 = setToStringTag$7;
|
2104 |
|
2105 | // `Symbol.toStringTag` well-known symbol
|
2106 | // https://tc39.es/ecma262/#sec-symbol.tostringtag
|
2107 | defineWellKnownSymbol$9('toStringTag');
|
2108 |
|
2109 | // `Symbol.prototype[@@toStringTag]` property
|
2110 | // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
|
2111 | setToStringTag$5(getBuiltIn$8('Symbol'), 'Symbol');
|
2112 |
|
2113 | var defineWellKnownSymbol$8 = wellKnownSymbolDefine;
|
2114 |
|
2115 | // `Symbol.unscopables` well-known symbol
|
2116 | // https://tc39.es/ecma262/#sec-symbol.unscopables
|
2117 | defineWellKnownSymbol$8('unscopables');
|
2118 |
|
2119 | var global$d = global$p;
|
2120 | var setToStringTag$4 = setToStringTag$7;
|
2121 |
|
2122 | // JSON[@@toStringTag] property
|
2123 | // https://tc39.es/ecma262/#sec-json-@@tostringtag
|
2124 | setToStringTag$4(global$d.JSON, 'JSON', true);
|
2125 |
|
2126 | var path$j = path$o;
|
2127 |
|
2128 | var symbol$5 = path$j.Symbol;
|
2129 |
|
2130 | var iterators = {};
|
2131 |
|
2132 | var DESCRIPTORS$9 = descriptors;
|
2133 | var hasOwn$9 = hasOwnProperty_1;
|
2134 |
|
2135 | var FunctionPrototype$2 = Function.prototype;
|
2136 | // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
2137 | var getDescriptor = DESCRIPTORS$9 && Object.getOwnPropertyDescriptor;
|
2138 |
|
2139 | var EXISTS = hasOwn$9(FunctionPrototype$2, 'name');
|
2140 | // additional protection from minified / mangled / dropped function names
|
2141 | var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
2142 | var CONFIGURABLE = EXISTS && (!DESCRIPTORS$9 || (DESCRIPTORS$9 && getDescriptor(FunctionPrototype$2, 'name').configurable));
|
2143 |
|
2144 | var functionName = {
|
2145 | EXISTS: EXISTS,
|
2146 | PROPER: PROPER,
|
2147 | CONFIGURABLE: CONFIGURABLE
|
2148 | };
|
2149 |
|
2150 | var fails$g = fails$u;
|
2151 |
|
2152 | var correctPrototypeGetter = !fails$g(function () {
|
2153 | function F() { /* empty */ }
|
2154 | F.prototype.constructor = null;
|
2155 | // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
2156 | return Object.getPrototypeOf(new F()) !== F.prototype;
|
2157 | });
|
2158 |
|
2159 | var hasOwn$8 = hasOwnProperty_1;
|
2160 | var isCallable$8 = isCallable$m;
|
2161 | var toObject$9 = toObject$e;
|
2162 | var sharedKey = sharedKey$4;
|
2163 | var CORRECT_PROTOTYPE_GETTER$1 = correctPrototypeGetter;
|
2164 |
|
2165 | var IE_PROTO = sharedKey('IE_PROTO');
|
2166 | var $Object = Object;
|
2167 | var ObjectPrototype$1 = $Object.prototype;
|
2168 |
|
2169 | // `Object.getPrototypeOf` method
|
2170 | // https://tc39.es/ecma262/#sec-object.getprototypeof
|
2171 | // eslint-disable-next-line es/no-object-getprototypeof -- safe
|
2172 | var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER$1 ? $Object.getPrototypeOf : function (O) {
|
2173 | var object = toObject$9(O);
|
2174 | if (hasOwn$8(object, IE_PROTO)) return object[IE_PROTO];
|
2175 | var constructor = object.constructor;
|
2176 | if (isCallable$8(constructor) && object instanceof constructor) {
|
2177 | return constructor.prototype;
|
2178 | } return object instanceof $Object ? ObjectPrototype$1 : null;
|
2179 | };
|
2180 |
|
2181 | var fails$f = fails$u;
|
2182 | var isCallable$7 = isCallable$m;
|
2183 | var isObject$9 = isObject$h;
|
2184 | var create$b = objectCreate;
|
2185 | var getPrototypeOf$7 = objectGetPrototypeOf;
|
2186 | var defineBuiltIn$3 = defineBuiltIn$6;
|
2187 | var wellKnownSymbol$c = wellKnownSymbol$n;
|
2188 |
|
2189 | var ITERATOR$4 = wellKnownSymbol$c('iterator');
|
2190 | var BUGGY_SAFARI_ITERATORS$1 = false;
|
2191 |
|
2192 | // `%IteratorPrototype%` object
|
2193 | // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
|
2194 | var IteratorPrototype$1, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
2195 |
|
2196 | /* eslint-disable es/no-array-prototype-keys -- safe */
|
2197 | if ([].keys) {
|
2198 | arrayIterator = [].keys();
|
2199 | // Safari 8 has buggy iterators w/o `next`
|
2200 | if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
|
2201 | else {
|
2202 | PrototypeOfArrayIteratorPrototype = getPrototypeOf$7(getPrototypeOf$7(arrayIterator));
|
2203 | if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$1 = PrototypeOfArrayIteratorPrototype;
|
2204 | }
|
2205 | }
|
2206 |
|
2207 | var NEW_ITERATOR_PROTOTYPE = !isObject$9(IteratorPrototype$1) || fails$f(function () {
|
2208 | var test = {};
|
2209 | // FF44- legacy iterators case
|
2210 | return IteratorPrototype$1[ITERATOR$4].call(test) !== test;
|
2211 | });
|
2212 |
|
2213 | if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$1 = {};
|
2214 | else IteratorPrototype$1 = create$b(IteratorPrototype$1);
|
2215 |
|
2216 | // `%IteratorPrototype%[@@iterator]()` method
|
2217 | // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
2218 | if (!isCallable$7(IteratorPrototype$1[ITERATOR$4])) {
|
2219 | defineBuiltIn$3(IteratorPrototype$1, ITERATOR$4, function () {
|
2220 | return this;
|
2221 | });
|
2222 | }
|
2223 |
|
2224 | var iteratorsCore = {
|
2225 | IteratorPrototype: IteratorPrototype$1,
|
2226 | BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
|
2227 | };
|
2228 |
|
2229 | var IteratorPrototype = iteratorsCore.IteratorPrototype;
|
2230 | var create$a = objectCreate;
|
2231 | var createPropertyDescriptor$2 = createPropertyDescriptor$7;
|
2232 | var setToStringTag$3 = setToStringTag$7;
|
2233 | var Iterators$5 = iterators;
|
2234 |
|
2235 | var returnThis$1 = function () { return this; };
|
2236 |
|
2237 | var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
2238 | var TO_STRING_TAG = NAME + ' Iterator';
|
2239 | IteratorConstructor.prototype = create$a(IteratorPrototype, { next: createPropertyDescriptor$2(+!ENUMERABLE_NEXT, next) });
|
2240 | setToStringTag$3(IteratorConstructor, TO_STRING_TAG, false, true);
|
2241 | Iterators$5[TO_STRING_TAG] = returnThis$1;
|
2242 | return IteratorConstructor;
|
2243 | };
|
2244 |
|
2245 | var uncurryThis$a = functionUncurryThis;
|
2246 | var aCallable$b = aCallable$e;
|
2247 |
|
2248 | var functionUncurryThisAccessor = function (object, key, method) {
|
2249 | try {
|
2250 | // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
2251 | return uncurryThis$a(aCallable$b(Object.getOwnPropertyDescriptor(object, key)[method]));
|
2252 | } catch (error) { /* empty */ }
|
2253 | };
|
2254 |
|
2255 | var isCallable$6 = isCallable$m;
|
2256 |
|
2257 | var $String = String;
|
2258 | var $TypeError$9 = TypeError;
|
2259 |
|
2260 | var aPossiblePrototype$1 = function (argument) {
|
2261 | if (typeof argument == 'object' || isCallable$6(argument)) return argument;
|
2262 | throw new $TypeError$9("Can't set " + $String(argument) + ' as a prototype');
|
2263 | };
|
2264 |
|
2265 | /* eslint-disable no-proto -- safe */
|
2266 | var uncurryThisAccessor = functionUncurryThisAccessor;
|
2267 | var anObject$8 = anObject$d;
|
2268 | var aPossiblePrototype = aPossiblePrototype$1;
|
2269 |
|
2270 | // `Object.setPrototypeOf` method
|
2271 | // https://tc39.es/ecma262/#sec-object.setprototypeof
|
2272 | // Works with __proto__ only. Old v8 can't work with null proto objects.
|
2273 | // eslint-disable-next-line es/no-object-setprototypeof -- safe
|
2274 | var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
2275 | var CORRECT_SETTER = false;
|
2276 | var test = {};
|
2277 | var setter;
|
2278 | try {
|
2279 | setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
|
2280 | setter(test, []);
|
2281 | CORRECT_SETTER = test instanceof Array;
|
2282 | } catch (error) { /* empty */ }
|
2283 | return function setPrototypeOf(O, proto) {
|
2284 | anObject$8(O);
|
2285 | aPossiblePrototype(proto);
|
2286 | if (CORRECT_SETTER) setter(O, proto);
|
2287 | else O.__proto__ = proto;
|
2288 | return O;
|
2289 | };
|
2290 | }() : undefined);
|
2291 |
|
2292 | var $$I = _export;
|
2293 | var call$b = functionCall;
|
2294 | var FunctionName = functionName;
|
2295 | var createIteratorConstructor = iteratorCreateConstructor;
|
2296 | var getPrototypeOf$6 = objectGetPrototypeOf;
|
2297 | var setToStringTag$2 = setToStringTag$7;
|
2298 | var defineBuiltIn$2 = defineBuiltIn$6;
|
2299 | var wellKnownSymbol$b = wellKnownSymbol$n;
|
2300 | var Iterators$4 = iterators;
|
2301 | var IteratorsCore = iteratorsCore;
|
2302 |
|
2303 | var PROPER_FUNCTION_NAME = FunctionName.PROPER;
|
2304 | FunctionName.CONFIGURABLE;
|
2305 | IteratorsCore.IteratorPrototype;
|
2306 | var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
2307 | var ITERATOR$3 = wellKnownSymbol$b('iterator');
|
2308 | var KEYS = 'keys';
|
2309 | var VALUES = 'values';
|
2310 | var ENTRIES = 'entries';
|
2311 |
|
2312 | var returnThis = function () { return this; };
|
2313 |
|
2314 | var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
2315 | createIteratorConstructor(IteratorConstructor, NAME, next);
|
2316 |
|
2317 | var getIterationMethod = function (KIND) {
|
2318 | if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
2319 | if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
|
2320 |
|
2321 | switch (KIND) {
|
2322 | case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
2323 | case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
2324 | case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
2325 | }
|
2326 |
|
2327 | return function () { return new IteratorConstructor(this); };
|
2328 | };
|
2329 |
|
2330 | var TO_STRING_TAG = NAME + ' Iterator';
|
2331 | var INCORRECT_VALUES_NAME = false;
|
2332 | var IterablePrototype = Iterable.prototype;
|
2333 | var nativeIterator = IterablePrototype[ITERATOR$3]
|
2334 | || IterablePrototype['@@iterator']
|
2335 | || DEFAULT && IterablePrototype[DEFAULT];
|
2336 | var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
|
2337 | var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
2338 | var CurrentIteratorPrototype, methods, KEY;
|
2339 |
|
2340 | // fix native
|
2341 | if (anyNativeIterator) {
|
2342 | CurrentIteratorPrototype = getPrototypeOf$6(anyNativeIterator.call(new Iterable()));
|
2343 | if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
|
2344 | // Set @@toStringTag to native iterators
|
2345 | setToStringTag$2(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
|
2346 | Iterators$4[TO_STRING_TAG] = returnThis;
|
2347 | }
|
2348 | }
|
2349 |
|
2350 | // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
|
2351 | if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
2352 | {
|
2353 | INCORRECT_VALUES_NAME = true;
|
2354 | defaultIterator = function values() { return call$b(nativeIterator, this); };
|
2355 | }
|
2356 | }
|
2357 |
|
2358 | // export additional methods
|
2359 | if (DEFAULT) {
|
2360 | methods = {
|
2361 | values: getIterationMethod(VALUES),
|
2362 | keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
2363 | entries: getIterationMethod(ENTRIES)
|
2364 | };
|
2365 | if (FORCED) for (KEY in methods) {
|
2366 | if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
2367 | defineBuiltIn$2(IterablePrototype, KEY, methods[KEY]);
|
2368 | }
|
2369 | } else $$I({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
2370 | }
|
2371 |
|
2372 | // define iterator
|
2373 | if ((FORCED) && IterablePrototype[ITERATOR$3] !== defaultIterator) {
|
2374 | defineBuiltIn$2(IterablePrototype, ITERATOR$3, defaultIterator, { name: DEFAULT });
|
2375 | }
|
2376 | Iterators$4[NAME] = defaultIterator;
|
2377 |
|
2378 | return methods;
|
2379 | };
|
2380 |
|
2381 | // `CreateIterResultObject` abstract operation
|
2382 | // https://tc39.es/ecma262/#sec-createiterresultobject
|
2383 | var createIterResultObject$3 = function (value, done) {
|
2384 | return { value: value, done: done };
|
2385 | };
|
2386 |
|
2387 | var toIndexedObject$3 = toIndexedObject$a;
|
2388 | var Iterators$3 = iterators;
|
2389 | var InternalStateModule$4 = internalState;
|
2390 | objectDefineProperty.f;
|
2391 | var defineIterator$2 = iteratorDefine;
|
2392 | var createIterResultObject$2 = createIterResultObject$3;
|
2393 |
|
2394 | var ARRAY_ITERATOR = 'Array Iterator';
|
2395 | var setInternalState$4 = InternalStateModule$4.set;
|
2396 | var getInternalState$1 = InternalStateModule$4.getterFor(ARRAY_ITERATOR);
|
2397 |
|
2398 | // `Array.prototype.entries` method
|
2399 | // https://tc39.es/ecma262/#sec-array.prototype.entries
|
2400 | // `Array.prototype.keys` method
|
2401 | // https://tc39.es/ecma262/#sec-array.prototype.keys
|
2402 | // `Array.prototype.values` method
|
2403 | // https://tc39.es/ecma262/#sec-array.prototype.values
|
2404 | // `Array.prototype[@@iterator]` method
|
2405 | // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
|
2406 | // `CreateArrayIterator` internal method
|
2407 | // https://tc39.es/ecma262/#sec-createarrayiterator
|
2408 | defineIterator$2(Array, 'Array', function (iterated, kind) {
|
2409 | setInternalState$4(this, {
|
2410 | type: ARRAY_ITERATOR,
|
2411 | target: toIndexedObject$3(iterated), // target
|
2412 | index: 0, // next index
|
2413 | kind: kind // kind
|
2414 | });
|
2415 | // `%ArrayIteratorPrototype%.next` method
|
2416 | // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
|
2417 | }, function () {
|
2418 | var state = getInternalState$1(this);
|
2419 | var target = state.target;
|
2420 | var index = state.index++;
|
2421 | if (!target || index >= target.length) {
|
2422 | state.target = undefined;
|
2423 | return createIterResultObject$2(undefined, true);
|
2424 | }
|
2425 | switch (state.kind) {
|
2426 | case 'keys': return createIterResultObject$2(index, false);
|
2427 | case 'values': return createIterResultObject$2(target[index], false);
|
2428 | } return createIterResultObject$2([index, target[index]], false);
|
2429 | }, 'values');
|
2430 |
|
2431 | // argumentsList[@@iterator] is %ArrayProto_values%
|
2432 | // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
|
2433 | // https://tc39.es/ecma262/#sec-createmappedargumentsobject
|
2434 | Iterators$3.Arguments = Iterators$3.Array;
|
2435 |
|
2436 | // iterable DOM collections
|
2437 | // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
|
2438 | var domIterables = {
|
2439 | CSSRuleList: 0,
|
2440 | CSSStyleDeclaration: 0,
|
2441 | CSSValueList: 0,
|
2442 | ClientRectList: 0,
|
2443 | DOMRectList: 0,
|
2444 | DOMStringList: 0,
|
2445 | DOMTokenList: 1,
|
2446 | DataTransferItemList: 0,
|
2447 | FileList: 0,
|
2448 | HTMLAllCollection: 0,
|
2449 | HTMLCollection: 0,
|
2450 | HTMLFormElement: 0,
|
2451 | HTMLSelectElement: 0,
|
2452 | MediaList: 0,
|
2453 | MimeTypeArray: 0,
|
2454 | NamedNodeMap: 0,
|
2455 | NodeList: 1,
|
2456 | PaintRequestList: 0,
|
2457 | Plugin: 0,
|
2458 | PluginArray: 0,
|
2459 | SVGLengthList: 0,
|
2460 | SVGNumberList: 0,
|
2461 | SVGPathSegList: 0,
|
2462 | SVGPointList: 0,
|
2463 | SVGStringList: 0,
|
2464 | SVGTransformList: 0,
|
2465 | SourceBufferList: 0,
|
2466 | StyleSheetList: 0,
|
2467 | TextTrackCueList: 0,
|
2468 | TextTrackList: 0,
|
2469 | TouchList: 0
|
2470 | };
|
2471 |
|
2472 | var DOMIterables$4 = domIterables;
|
2473 | var global$c = global$p;
|
2474 | var classof$7 = classof$d;
|
2475 | var createNonEnumerableProperty$4 = createNonEnumerableProperty$9;
|
2476 | var Iterators$2 = iterators;
|
2477 | var wellKnownSymbol$a = wellKnownSymbol$n;
|
2478 |
|
2479 | var TO_STRING_TAG$1 = wellKnownSymbol$a('toStringTag');
|
2480 |
|
2481 | for (var COLLECTION_NAME in DOMIterables$4) {
|
2482 | var Collection = global$c[COLLECTION_NAME];
|
2483 | var CollectionPrototype = Collection && Collection.prototype;
|
2484 | if (CollectionPrototype && classof$7(CollectionPrototype) !== TO_STRING_TAG$1) {
|
2485 | createNonEnumerableProperty$4(CollectionPrototype, TO_STRING_TAG$1, COLLECTION_NAME);
|
2486 | }
|
2487 | Iterators$2[COLLECTION_NAME] = Iterators$2.Array;
|
2488 | }
|
2489 |
|
2490 | var parent$15 = symbol$5;
|
2491 |
|
2492 |
|
2493 | var symbol$4 = parent$15;
|
2494 |
|
2495 | var wellKnownSymbol$9 = wellKnownSymbol$n;
|
2496 | var defineProperty$4 = objectDefineProperty.f;
|
2497 |
|
2498 | var METADATA$1 = wellKnownSymbol$9('metadata');
|
2499 | var FunctionPrototype$1 = Function.prototype;
|
2500 |
|
2501 | // Function.prototype[@@metadata]
|
2502 | // https://github.com/tc39/proposal-decorator-metadata
|
2503 | if (FunctionPrototype$1[METADATA$1] === undefined) {
|
2504 | defineProperty$4(FunctionPrototype$1, METADATA$1, {
|
2505 | value: null
|
2506 | });
|
2507 | }
|
2508 |
|
2509 | var defineWellKnownSymbol$7 = wellKnownSymbolDefine;
|
2510 |
|
2511 | // `Symbol.asyncDispose` well-known symbol
|
2512 | // https://github.com/tc39/proposal-async-explicit-resource-management
|
2513 | defineWellKnownSymbol$7('asyncDispose');
|
2514 |
|
2515 | var defineWellKnownSymbol$6 = wellKnownSymbolDefine;
|
2516 |
|
2517 | // `Symbol.dispose` well-known symbol
|
2518 | // https://github.com/tc39/proposal-explicit-resource-management
|
2519 | defineWellKnownSymbol$6('dispose');
|
2520 |
|
2521 | var defineWellKnownSymbol$5 = wellKnownSymbolDefine;
|
2522 |
|
2523 | // `Symbol.metadata` well-known symbol
|
2524 | // https://github.com/tc39/proposal-decorators
|
2525 | defineWellKnownSymbol$5('metadata');
|
2526 |
|
2527 | var parent$14 = symbol$4;
|
2528 |
|
2529 |
|
2530 |
|
2531 |
|
2532 |
|
2533 |
|
2534 | var symbol$3 = parent$14;
|
2535 |
|
2536 | var getBuiltIn$7 = getBuiltIn$f;
|
2537 | var uncurryThis$9 = functionUncurryThis;
|
2538 |
|
2539 | var Symbol$2 = getBuiltIn$7('Symbol');
|
2540 | var keyFor = Symbol$2.keyFor;
|
2541 | var thisSymbolValue$1 = uncurryThis$9(Symbol$2.prototype.valueOf);
|
2542 |
|
2543 | // `Symbol.isRegisteredSymbol` method
|
2544 | // https://tc39.es/proposal-symbol-predicates/#sec-symbol-isregisteredsymbol
|
2545 | var symbolIsRegistered = Symbol$2.isRegisteredSymbol || function isRegisteredSymbol(value) {
|
2546 | try {
|
2547 | return keyFor(thisSymbolValue$1(value)) !== undefined;
|
2548 | } catch (error) {
|
2549 | return false;
|
2550 | }
|
2551 | };
|
2552 |
|
2553 | var $$H = _export;
|
2554 | var isRegisteredSymbol$1 = symbolIsRegistered;
|
2555 |
|
2556 | // `Symbol.isRegisteredSymbol` method
|
2557 | // https://tc39.es/proposal-symbol-predicates/#sec-symbol-isregisteredsymbol
|
2558 | $$H({ target: 'Symbol', stat: true }, {
|
2559 | isRegisteredSymbol: isRegisteredSymbol$1
|
2560 | });
|
2561 |
|
2562 | var shared = sharedExports;
|
2563 | var getBuiltIn$6 = getBuiltIn$f;
|
2564 | var uncurryThis$8 = functionUncurryThis;
|
2565 | var isSymbol = isSymbol$5;
|
2566 | var wellKnownSymbol$8 = wellKnownSymbol$n;
|
2567 |
|
2568 | var Symbol$1 = getBuiltIn$6('Symbol');
|
2569 | var $isWellKnownSymbol = Symbol$1.isWellKnownSymbol;
|
2570 | var getOwnPropertyNames = getBuiltIn$6('Object', 'getOwnPropertyNames');
|
2571 | var thisSymbolValue = uncurryThis$8(Symbol$1.prototype.valueOf);
|
2572 | var WellKnownSymbolsStore = shared('wks');
|
2573 |
|
2574 | for (var i = 0, symbolKeys = getOwnPropertyNames(Symbol$1), symbolKeysLength = symbolKeys.length; i < symbolKeysLength; i++) {
|
2575 | // some old engines throws on access to some keys like `arguments` or `caller`
|
2576 | try {
|
2577 | var symbolKey = symbolKeys[i];
|
2578 | if (isSymbol(Symbol$1[symbolKey])) wellKnownSymbol$8(symbolKey);
|
2579 | } catch (error) { /* empty */ }
|
2580 | }
|
2581 |
|
2582 | // `Symbol.isWellKnownSymbol` method
|
2583 | // https://tc39.es/proposal-symbol-predicates/#sec-symbol-iswellknownsymbol
|
2584 | // We should patch it for newly added well-known symbols. If it's not required, this module just will not be injected
|
2585 | var symbolIsWellKnown = function isWellKnownSymbol(value) {
|
2586 | if ($isWellKnownSymbol && $isWellKnownSymbol(value)) return true;
|
2587 | try {
|
2588 | var symbol = thisSymbolValue(value);
|
2589 | for (var j = 0, keys = getOwnPropertyNames(WellKnownSymbolsStore), keysLength = keys.length; j < keysLength; j++) {
|
2590 | // eslint-disable-next-line eqeqeq -- polyfilled symbols case
|
2591 | if (WellKnownSymbolsStore[keys[j]] == symbol) return true;
|
2592 | }
|
2593 | } catch (error) { /* empty */ }
|
2594 | return false;
|
2595 | };
|
2596 |
|
2597 | var $$G = _export;
|
2598 | var isWellKnownSymbol$1 = symbolIsWellKnown;
|
2599 |
|
2600 | // `Symbol.isWellKnownSymbol` method
|
2601 | // https://tc39.es/proposal-symbol-predicates/#sec-symbol-iswellknownsymbol
|
2602 | // We should patch it for newly added well-known symbols. If it's not required, this module just will not be injected
|
2603 | $$G({ target: 'Symbol', stat: true, forced: true }, {
|
2604 | isWellKnownSymbol: isWellKnownSymbol$1
|
2605 | });
|
2606 |
|
2607 | var defineWellKnownSymbol$4 = wellKnownSymbolDefine;
|
2608 |
|
2609 | // `Symbol.matcher` well-known symbol
|
2610 | // https://github.com/tc39/proposal-pattern-matching
|
2611 | defineWellKnownSymbol$4('matcher');
|
2612 |
|
2613 | var defineWellKnownSymbol$3 = wellKnownSymbolDefine;
|
2614 |
|
2615 | // `Symbol.observable` well-known symbol
|
2616 | // https://github.com/tc39/proposal-observable
|
2617 | defineWellKnownSymbol$3('observable');
|
2618 |
|
2619 | var $$F = _export;
|
2620 | var isRegisteredSymbol = symbolIsRegistered;
|
2621 |
|
2622 | // `Symbol.isRegistered` method
|
2623 | // obsolete version of https://tc39.es/proposal-symbol-predicates/#sec-symbol-isregisteredsymbol
|
2624 | $$F({ target: 'Symbol', stat: true, name: 'isRegisteredSymbol' }, {
|
2625 | isRegistered: isRegisteredSymbol
|
2626 | });
|
2627 |
|
2628 | var $$E = _export;
|
2629 | var isWellKnownSymbol = symbolIsWellKnown;
|
2630 |
|
2631 | // `Symbol.isWellKnown` method
|
2632 | // obsolete version of https://tc39.es/proposal-symbol-predicates/#sec-symbol-iswellknownsymbol
|
2633 | // We should patch it for newly added well-known symbols. If it's not required, this module just will not be injected
|
2634 | $$E({ target: 'Symbol', stat: true, name: 'isWellKnownSymbol', forced: true }, {
|
2635 | isWellKnown: isWellKnownSymbol
|
2636 | });
|
2637 |
|
2638 | // TODO: Remove from `core-js@4`
|
2639 | var defineWellKnownSymbol$2 = wellKnownSymbolDefine;
|
2640 |
|
2641 | // `Symbol.metadataKey` well-known symbol
|
2642 | // https://github.com/tc39/proposal-decorator-metadata
|
2643 | defineWellKnownSymbol$2('metadataKey');
|
2644 |
|
2645 | // TODO: remove from `core-js@4`
|
2646 | var defineWellKnownSymbol$1 = wellKnownSymbolDefine;
|
2647 |
|
2648 | // `Symbol.patternMatch` well-known symbol
|
2649 | // https://github.com/tc39/proposal-pattern-matching
|
2650 | defineWellKnownSymbol$1('patternMatch');
|
2651 |
|
2652 | // TODO: remove from `core-js@4`
|
2653 | var defineWellKnownSymbol = wellKnownSymbolDefine;
|
2654 |
|
2655 | defineWellKnownSymbol('replaceAll');
|
2656 |
|
2657 | var parent$13 = symbol$3;
|
2658 |
|
2659 |
|
2660 |
|
2661 |
|
2662 | // TODO: Remove from `core-js@4`
|
2663 |
|
2664 |
|
2665 |
|
2666 |
|
2667 |
|
2668 |
|
2669 | var symbol$2 = parent$13;
|
2670 |
|
2671 | var symbol$1 = symbol$2;
|
2672 |
|
2673 | var _Symbol$1 = /*@__PURE__*/getDefaultExportFromCjs(symbol$1);
|
2674 |
|
2675 | var uncurryThis$7 = functionUncurryThis;
|
2676 | var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
|
2677 | var toString$3 = toString$7;
|
2678 | var requireObjectCoercible = requireObjectCoercible$3;
|
2679 |
|
2680 | var charAt$1 = uncurryThis$7(''.charAt);
|
2681 | var charCodeAt = uncurryThis$7(''.charCodeAt);
|
2682 | var stringSlice = uncurryThis$7(''.slice);
|
2683 |
|
2684 | var createMethod$1 = function (CONVERT_TO_STRING) {
|
2685 | return function ($this, pos) {
|
2686 | var S = toString$3(requireObjectCoercible($this));
|
2687 | var position = toIntegerOrInfinity$1(pos);
|
2688 | var size = S.length;
|
2689 | var first, second;
|
2690 | if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
2691 | first = charCodeAt(S, position);
|
2692 | return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
2693 | || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
|
2694 | ? CONVERT_TO_STRING
|
2695 | ? charAt$1(S, position)
|
2696 | : first
|
2697 | : CONVERT_TO_STRING
|
2698 | ? stringSlice(S, position, position + 2)
|
2699 | : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
2700 | };
|
2701 | };
|
2702 |
|
2703 | var stringMultibyte = {
|
2704 | // `String.prototype.codePointAt` method
|
2705 | // https://tc39.es/ecma262/#sec-string.prototype.codepointat
|
2706 | codeAt: createMethod$1(false),
|
2707 | // `String.prototype.at` method
|
2708 | // https://github.com/mathiasbynens/String.prototype.at
|
2709 | charAt: createMethod$1(true)
|
2710 | };
|
2711 |
|
2712 | var charAt = stringMultibyte.charAt;
|
2713 | var toString$2 = toString$7;
|
2714 | var InternalStateModule$3 = internalState;
|
2715 | var defineIterator$1 = iteratorDefine;
|
2716 | var createIterResultObject$1 = createIterResultObject$3;
|
2717 |
|
2718 | var STRING_ITERATOR = 'String Iterator';
|
2719 | var setInternalState$3 = InternalStateModule$3.set;
|
2720 | var getInternalState = InternalStateModule$3.getterFor(STRING_ITERATOR);
|
2721 |
|
2722 | // `String.prototype[@@iterator]` method
|
2723 | // https://tc39.es/ecma262/#sec-string.prototype-@@iterator
|
2724 | defineIterator$1(String, 'String', function (iterated) {
|
2725 | setInternalState$3(this, {
|
2726 | type: STRING_ITERATOR,
|
2727 | string: toString$2(iterated),
|
2728 | index: 0
|
2729 | });
|
2730 | // `%StringIteratorPrototype%.next` method
|
2731 | // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
|
2732 | }, function next() {
|
2733 | var state = getInternalState(this);
|
2734 | var string = state.string;
|
2735 | var index = state.index;
|
2736 | var point;
|
2737 | if (index >= string.length) return createIterResultObject$1(undefined, true);
|
2738 | point = charAt(string, index);
|
2739 | state.index += point.length;
|
2740 | return createIterResultObject$1(point, false);
|
2741 | });
|
2742 |
|
2743 | var WrappedWellKnownSymbolModule$1 = wellKnownSymbolWrapped;
|
2744 |
|
2745 | var iterator$5 = WrappedWellKnownSymbolModule$1.f('iterator');
|
2746 |
|
2747 | var parent$12 = iterator$5;
|
2748 |
|
2749 |
|
2750 | var iterator$4 = parent$12;
|
2751 |
|
2752 | var parent$11 = iterator$4;
|
2753 |
|
2754 | var iterator$3 = parent$11;
|
2755 |
|
2756 | var parent$10 = iterator$3;
|
2757 |
|
2758 | var iterator$2 = parent$10;
|
2759 |
|
2760 | var iterator$1 = iterator$2;
|
2761 |
|
2762 | var _Symbol$iterator$1 = /*@__PURE__*/getDefaultExportFromCjs(iterator$1);
|
2763 |
|
2764 | function _typeof$1(o) {
|
2765 | "@babel/helpers - typeof";
|
2766 |
|
2767 | return _typeof$1 = "function" == typeof _Symbol$1 && "symbol" == typeof _Symbol$iterator$1 ? function (o) {
|
2768 | return typeof o;
|
2769 | } : function (o) {
|
2770 | return o && "function" == typeof _Symbol$1 && o.constructor === _Symbol$1 && o !== _Symbol$1.prototype ? "symbol" : typeof o;
|
2771 | }, _typeof$1(o);
|
2772 | }
|
2773 |
|
2774 | var WrappedWellKnownSymbolModule = wellKnownSymbolWrapped;
|
2775 |
|
2776 | var toPrimitive$4 = WrappedWellKnownSymbolModule.f('toPrimitive');
|
2777 |
|
2778 | var parent$$ = toPrimitive$4;
|
2779 |
|
2780 | var toPrimitive$3 = parent$$;
|
2781 |
|
2782 | var parent$_ = toPrimitive$3;
|
2783 |
|
2784 | var toPrimitive$2 = parent$_;
|
2785 |
|
2786 | var parent$Z = toPrimitive$2;
|
2787 |
|
2788 | var toPrimitive$1 = parent$Z;
|
2789 |
|
2790 | var toPrimitive = toPrimitive$1;
|
2791 |
|
2792 | var _Symbol$toPrimitive = /*@__PURE__*/getDefaultExportFromCjs(toPrimitive);
|
2793 |
|
2794 | function _toPrimitive(input, hint) {
|
2795 | if (_typeof$1(input) !== "object" || input === null) return input;
|
2796 | var prim = input[_Symbol$toPrimitive];
|
2797 | if (prim !== undefined) {
|
2798 | var res = prim.call(input, hint || "default");
|
2799 | if (_typeof$1(res) !== "object") return res;
|
2800 | throw new TypeError("@@toPrimitive must return a primitive value.");
|
2801 | }
|
2802 | return (hint === "string" ? String : Number)(input);
|
2803 | }
|
2804 |
|
2805 | function _toPropertyKey(arg) {
|
2806 | var key = _toPrimitive(arg, "string");
|
2807 | return _typeof$1(key) === "symbol" ? key : String(key);
|
2808 | }
|
2809 |
|
2810 | function _defineProperties(target, props) {
|
2811 | for (var i = 0; i < props.length; i++) {
|
2812 | var descriptor = props[i];
|
2813 | descriptor.enumerable = descriptor.enumerable || false;
|
2814 | descriptor.configurable = true;
|
2815 | if ("value" in descriptor) descriptor.writable = true;
|
2816 | _Object$defineProperty$1(target, _toPropertyKey(descriptor.key), descriptor);
|
2817 | }
|
2818 | }
|
2819 | function _createClass(Constructor, protoProps, staticProps) {
|
2820 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
2821 | if (staticProps) _defineProperties(Constructor, staticProps);
|
2822 | _Object$defineProperty$1(Constructor, "prototype", {
|
2823 | writable: false
|
2824 | });
|
2825 | return Constructor;
|
2826 | }
|
2827 |
|
2828 | function _defineProperty(obj, key, value) {
|
2829 | key = _toPropertyKey(key);
|
2830 | if (key in obj) {
|
2831 | _Object$defineProperty$1(obj, key, {
|
2832 | value: value,
|
2833 | enumerable: true,
|
2834 | configurable: true,
|
2835 | writable: true
|
2836 | });
|
2837 | } else {
|
2838 | obj[key] = value;
|
2839 | }
|
2840 | return obj;
|
2841 | }
|
2842 |
|
2843 | var uncurryThis$6 = functionUncurryThis;
|
2844 | var aCallable$a = aCallable$e;
|
2845 | var isObject$8 = isObject$h;
|
2846 | var hasOwn$7 = hasOwnProperty_1;
|
2847 | var arraySlice$3 = arraySlice$5;
|
2848 | var NATIVE_BIND = functionBindNative;
|
2849 |
|
2850 | var $Function = Function;
|
2851 | var concat$6 = uncurryThis$6([].concat);
|
2852 | var join = uncurryThis$6([].join);
|
2853 | var factories = {};
|
2854 |
|
2855 | var construct$3 = function (C, argsLength, args) {
|
2856 | if (!hasOwn$7(factories, argsLength)) {
|
2857 | var list = [];
|
2858 | var i = 0;
|
2859 | for (; i < argsLength; i++) list[i] = 'a[' + i + ']';
|
2860 | factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')');
|
2861 | } return factories[argsLength](C, args);
|
2862 | };
|
2863 |
|
2864 | // `Function.prototype.bind` method implementation
|
2865 | // https://tc39.es/ecma262/#sec-function.prototype.bind
|
2866 | // eslint-disable-next-line es/no-function-prototype-bind -- detection
|
2867 | var functionBind = NATIVE_BIND ? $Function.bind : function bind(that /* , ...args */) {
|
2868 | var F = aCallable$a(this);
|
2869 | var Prototype = F.prototype;
|
2870 | var partArgs = arraySlice$3(arguments, 1);
|
2871 | var boundFunction = function bound(/* args... */) {
|
2872 | var args = concat$6(partArgs, arraySlice$3(arguments));
|
2873 | return this instanceof boundFunction ? construct$3(F, args.length, args) : F.apply(that, args);
|
2874 | };
|
2875 | if (isObject$8(Prototype)) boundFunction.prototype = Prototype;
|
2876 | return boundFunction;
|
2877 | };
|
2878 |
|
2879 | // TODO: Remove from `core-js@4`
|
2880 | var $$D = _export;
|
2881 | var bind$f = functionBind;
|
2882 |
|
2883 | // `Function.prototype.bind` method
|
2884 | // https://tc39.es/ecma262/#sec-function.prototype.bind
|
2885 | // eslint-disable-next-line es/no-function-prototype-bind -- detection
|
2886 | $$D({ target: 'Function', proto: true, forced: Function.bind !== bind$f }, {
|
2887 | bind: bind$f
|
2888 | });
|
2889 |
|
2890 | var global$b = global$p;
|
2891 | var path$i = path$o;
|
2892 |
|
2893 | var getBuiltInPrototypeMethod$g = function (CONSTRUCTOR, METHOD) {
|
2894 | var Namespace = path$i[CONSTRUCTOR + 'Prototype'];
|
2895 | var pureMethod = Namespace && Namespace[METHOD];
|
2896 | if (pureMethod) return pureMethod;
|
2897 | var NativeConstructor = global$b[CONSTRUCTOR];
|
2898 | var NativePrototype = NativeConstructor && NativeConstructor.prototype;
|
2899 | return NativePrototype && NativePrototype[METHOD];
|
2900 | };
|
2901 |
|
2902 | var getBuiltInPrototypeMethod$f = getBuiltInPrototypeMethod$g;
|
2903 |
|
2904 | var bind$e = getBuiltInPrototypeMethod$f('Function', 'bind');
|
2905 |
|
2906 | var isPrototypeOf$i = objectIsPrototypeOf;
|
2907 | var method$f = bind$e;
|
2908 |
|
2909 | var FunctionPrototype = Function.prototype;
|
2910 |
|
2911 | var bind$d = function (it) {
|
2912 | var own = it.bind;
|
2913 | return it === FunctionPrototype || (isPrototypeOf$i(FunctionPrototype, it) && own === FunctionPrototype.bind) ? method$f : own;
|
2914 | };
|
2915 |
|
2916 | var parent$Y = bind$d;
|
2917 |
|
2918 | var bind$c = parent$Y;
|
2919 |
|
2920 | var bind$b = bind$c;
|
2921 |
|
2922 | var _bindInstanceProperty$1 = /*@__PURE__*/getDefaultExportFromCjs(bind$b);
|
2923 |
|
2924 | var aCallable$9 = aCallable$e;
|
2925 | var toObject$8 = toObject$e;
|
2926 | var IndexedObject$1 = indexedObject;
|
2927 | var lengthOfArrayLike$8 = lengthOfArrayLike$d;
|
2928 |
|
2929 | var $TypeError$8 = TypeError;
|
2930 |
|
2931 | // `Array.prototype.{ reduce, reduceRight }` methods implementation
|
2932 | var createMethod = function (IS_RIGHT) {
|
2933 | return function (that, callbackfn, argumentsLength, memo) {
|
2934 | aCallable$9(callbackfn);
|
2935 | var O = toObject$8(that);
|
2936 | var self = IndexedObject$1(O);
|
2937 | var length = lengthOfArrayLike$8(O);
|
2938 | var index = IS_RIGHT ? length - 1 : 0;
|
2939 | var i = IS_RIGHT ? -1 : 1;
|
2940 | if (argumentsLength < 2) while (true) {
|
2941 | if (index in self) {
|
2942 | memo = self[index];
|
2943 | index += i;
|
2944 | break;
|
2945 | }
|
2946 | index += i;
|
2947 | if (IS_RIGHT ? index < 0 : length <= index) {
|
2948 | throw new $TypeError$8('Reduce of empty array with no initial value');
|
2949 | }
|
2950 | }
|
2951 | for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
|
2952 | memo = callbackfn(memo, self[index], index, O);
|
2953 | }
|
2954 | return memo;
|
2955 | };
|
2956 | };
|
2957 |
|
2958 | var arrayReduce = {
|
2959 | // `Array.prototype.reduce` method
|
2960 | // https://tc39.es/ecma262/#sec-array.prototype.reduce
|
2961 | left: createMethod(false),
|
2962 | // `Array.prototype.reduceRight` method
|
2963 | // https://tc39.es/ecma262/#sec-array.prototype.reduceright
|
2964 | right: createMethod(true)
|
2965 | };
|
2966 |
|
2967 | var fails$e = fails$u;
|
2968 |
|
2969 | var arrayMethodIsStrict$4 = function (METHOD_NAME, argument) {
|
2970 | var method = [][METHOD_NAME];
|
2971 | return !!method && fails$e(function () {
|
2972 | // eslint-disable-next-line no-useless-call -- required for testing
|
2973 | method.call(null, argument || function () { return 1; }, 1);
|
2974 | });
|
2975 | };
|
2976 |
|
2977 | var global$a = global$p;
|
2978 | var classof$6 = classofRaw$2;
|
2979 |
|
2980 | var engineIsNode = classof$6(global$a.process) === 'process';
|
2981 |
|
2982 | var $$C = _export;
|
2983 | var $reduce = arrayReduce.left;
|
2984 | var arrayMethodIsStrict$3 = arrayMethodIsStrict$4;
|
2985 | var CHROME_VERSION = engineV8Version;
|
2986 | var IS_NODE$4 = engineIsNode;
|
2987 |
|
2988 | // Chrome 80-82 has a critical bug
|
2989 | // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
|
2990 | var CHROME_BUG = !IS_NODE$4 && CHROME_VERSION > 79 && CHROME_VERSION < 83;
|
2991 | var FORCED$4 = CHROME_BUG || !arrayMethodIsStrict$3('reduce');
|
2992 |
|
2993 | // `Array.prototype.reduce` method
|
2994 | // https://tc39.es/ecma262/#sec-array.prototype.reduce
|
2995 | $$C({ target: 'Array', proto: true, forced: FORCED$4 }, {
|
2996 | reduce: function reduce(callbackfn /* , initialValue */) {
|
2997 | var length = arguments.length;
|
2998 | return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
|
2999 | }
|
3000 | });
|
3001 |
|
3002 | var getBuiltInPrototypeMethod$e = getBuiltInPrototypeMethod$g;
|
3003 |
|
3004 | var reduce$3 = getBuiltInPrototypeMethod$e('Array', 'reduce');
|
3005 |
|
3006 | var isPrototypeOf$h = objectIsPrototypeOf;
|
3007 | var method$e = reduce$3;
|
3008 |
|
3009 | var ArrayPrototype$f = Array.prototype;
|
3010 |
|
3011 | var reduce$2 = function (it) {
|
3012 | var own = it.reduce;
|
3013 | return it === ArrayPrototype$f || (isPrototypeOf$h(ArrayPrototype$f, it) && own === ArrayPrototype$f.reduce) ? method$e : own;
|
3014 | };
|
3015 |
|
3016 | var parent$X = reduce$2;
|
3017 |
|
3018 | var reduce$1 = parent$X;
|
3019 |
|
3020 | var reduce = reduce$1;
|
3021 |
|
3022 | var _reduceInstanceProperty = /*@__PURE__*/getDefaultExportFromCjs(reduce);
|
3023 |
|
3024 | var $$B = _export;
|
3025 | var $filter = arrayIteration.filter;
|
3026 | var arrayMethodHasSpeciesSupport$3 = arrayMethodHasSpeciesSupport$5;
|
3027 |
|
3028 | var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport$3('filter');
|
3029 |
|
3030 | // `Array.prototype.filter` method
|
3031 | // https://tc39.es/ecma262/#sec-array.prototype.filter
|
3032 | // with adding support of @@species
|
3033 | $$B({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, {
|
3034 | filter: function filter(callbackfn /* , thisArg */) {
|
3035 | return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
3036 | }
|
3037 | });
|
3038 |
|
3039 | var getBuiltInPrototypeMethod$d = getBuiltInPrototypeMethod$g;
|
3040 |
|
3041 | var filter$3 = getBuiltInPrototypeMethod$d('Array', 'filter');
|
3042 |
|
3043 | var isPrototypeOf$g = objectIsPrototypeOf;
|
3044 | var method$d = filter$3;
|
3045 |
|
3046 | var ArrayPrototype$e = Array.prototype;
|
3047 |
|
3048 | var filter$2 = function (it) {
|
3049 | var own = it.filter;
|
3050 | return it === ArrayPrototype$e || (isPrototypeOf$g(ArrayPrototype$e, it) && own === ArrayPrototype$e.filter) ? method$d : own;
|
3051 | };
|
3052 |
|
3053 | var parent$W = filter$2;
|
3054 |
|
3055 | var filter$1 = parent$W;
|
3056 |
|
3057 | var filter = filter$1;
|
3058 |
|
3059 | var _filterInstanceProperty = /*@__PURE__*/getDefaultExportFromCjs(filter);
|
3060 |
|
3061 | var $$A = _export;
|
3062 | var $map = arrayIteration.map;
|
3063 | var arrayMethodHasSpeciesSupport$2 = arrayMethodHasSpeciesSupport$5;
|
3064 |
|
3065 | var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport$2('map');
|
3066 |
|
3067 | // `Array.prototype.map` method
|
3068 | // https://tc39.es/ecma262/#sec-array.prototype.map
|
3069 | // with adding support of @@species
|
3070 | $$A({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, {
|
3071 | map: function map(callbackfn /* , thisArg */) {
|
3072 | return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
3073 | }
|
3074 | });
|
3075 |
|
3076 | var getBuiltInPrototypeMethod$c = getBuiltInPrototypeMethod$g;
|
3077 |
|
3078 | var map$6 = getBuiltInPrototypeMethod$c('Array', 'map');
|
3079 |
|
3080 | var isPrototypeOf$f = objectIsPrototypeOf;
|
3081 | var method$c = map$6;
|
3082 |
|
3083 | var ArrayPrototype$d = Array.prototype;
|
3084 |
|
3085 | var map$5 = function (it) {
|
3086 | var own = it.map;
|
3087 | return it === ArrayPrototype$d || (isPrototypeOf$f(ArrayPrototype$d, it) && own === ArrayPrototype$d.map) ? method$c : own;
|
3088 | };
|
3089 |
|
3090 | var parent$V = map$5;
|
3091 |
|
3092 | var map$4 = parent$V;
|
3093 |
|
3094 | var map$3 = map$4;
|
3095 |
|
3096 | var _mapInstanceProperty = /*@__PURE__*/getDefaultExportFromCjs(map$3);
|
3097 |
|
3098 | var isArray$a = isArray$e;
|
3099 | var lengthOfArrayLike$7 = lengthOfArrayLike$d;
|
3100 | var doesNotExceedSafeInteger$2 = doesNotExceedSafeInteger$4;
|
3101 | var bind$a = functionBindContext;
|
3102 |
|
3103 | // `FlattenIntoArray` abstract operation
|
3104 | // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
|
3105 | var flattenIntoArray$1 = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
|
3106 | var targetIndex = start;
|
3107 | var sourceIndex = 0;
|
3108 | var mapFn = mapper ? bind$a(mapper, thisArg) : false;
|
3109 | var element, elementLen;
|
3110 |
|
3111 | while (sourceIndex < sourceLen) {
|
3112 | if (sourceIndex in source) {
|
3113 | element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
|
3114 |
|
3115 | if (depth > 0 && isArray$a(element)) {
|
3116 | elementLen = lengthOfArrayLike$7(element);
|
3117 | targetIndex = flattenIntoArray$1(target, original, element, elementLen, targetIndex, depth - 1) - 1;
|
3118 | } else {
|
3119 | doesNotExceedSafeInteger$2(targetIndex + 1);
|
3120 | target[targetIndex] = element;
|
3121 | }
|
3122 |
|
3123 | targetIndex++;
|
3124 | }
|
3125 | sourceIndex++;
|
3126 | }
|
3127 | return targetIndex;
|
3128 | };
|
3129 |
|
3130 | var flattenIntoArray_1 = flattenIntoArray$1;
|
3131 |
|
3132 | var $$z = _export;
|
3133 | var flattenIntoArray = flattenIntoArray_1;
|
3134 | var aCallable$8 = aCallable$e;
|
3135 | var toObject$7 = toObject$e;
|
3136 | var lengthOfArrayLike$6 = lengthOfArrayLike$d;
|
3137 | var arraySpeciesCreate$1 = arraySpeciesCreate$4;
|
3138 |
|
3139 | // `Array.prototype.flatMap` method
|
3140 | // https://tc39.es/ecma262/#sec-array.prototype.flatmap
|
3141 | $$z({ target: 'Array', proto: true }, {
|
3142 | flatMap: function flatMap(callbackfn /* , thisArg */) {
|
3143 | var O = toObject$7(this);
|
3144 | var sourceLen = lengthOfArrayLike$6(O);
|
3145 | var A;
|
3146 | aCallable$8(callbackfn);
|
3147 | A = arraySpeciesCreate$1(O, 0);
|
3148 | A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
3149 | return A;
|
3150 | }
|
3151 | });
|
3152 |
|
3153 | var getBuiltInPrototypeMethod$b = getBuiltInPrototypeMethod$g;
|
3154 |
|
3155 | var flatMap$3 = getBuiltInPrototypeMethod$b('Array', 'flatMap');
|
3156 |
|
3157 | var isPrototypeOf$e = objectIsPrototypeOf;
|
3158 | var method$b = flatMap$3;
|
3159 |
|
3160 | var ArrayPrototype$c = Array.prototype;
|
3161 |
|
3162 | var flatMap$2 = function (it) {
|
3163 | var own = it.flatMap;
|
3164 | return it === ArrayPrototype$c || (isPrototypeOf$e(ArrayPrototype$c, it) && own === ArrayPrototype$c.flatMap) ? method$b : own;
|
3165 | };
|
3166 |
|
3167 | var parent$U = flatMap$2;
|
3168 |
|
3169 | var flatMap$1 = parent$U;
|
3170 |
|
3171 | var flatMap = flatMap$1;
|
3172 |
|
3173 | var _flatMapInstanceProperty = /*@__PURE__*/getDefaultExportFromCjs(flatMap);
|
3174 |
|
3175 | /**
|
3176 | * Create new data pipe.
|
3177 | *
|
3178 | * @param from - The source data set or data view.
|
3179 | * @remarks
|
3180 | * Example usage:
|
3181 | * ```typescript
|
3182 | * interface AppItem {
|
3183 | * whoami: string;
|
3184 | * appData: unknown;
|
3185 | * visData: VisItem;
|
3186 | * }
|
3187 | * interface VisItem {
|
3188 | * id: number;
|
3189 | * label: string;
|
3190 | * color: string;
|
3191 | * x: number;
|
3192 | * y: number;
|
3193 | * }
|
3194 | *
|
3195 | * const ds1 = new DataSet<AppItem, "whoami">([], { fieldId: "whoami" });
|
3196 | * const ds2 = new DataSet<VisItem, "id">();
|
3197 | *
|
3198 | * const pipe = createNewDataPipeFrom(ds1)
|
3199 | * .filter((item): boolean => item.enabled === true)
|
3200 | * .map<VisItem, "id">((item): VisItem => item.visData)
|
3201 | * .to(ds2);
|
3202 | *
|
3203 | * pipe.start();
|
3204 | * ```
|
3205 | * @returns A factory whose methods can be used to configure the pipe.
|
3206 | */
|
3207 | function createNewDataPipeFrom(from) {
|
3208 | return new DataPipeUnderConstruction(from);
|
3209 | }
|
3210 | /**
|
3211 | * Internal implementation of the pipe. This should be accessible only through
|
3212 | * `createNewDataPipeFrom` from the outside.
|
3213 | *
|
3214 | * @typeParam SI - Source item type.
|
3215 | * @typeParam SP - Source item type's id property name.
|
3216 | * @typeParam TI - Target item type.
|
3217 | * @typeParam TP - Target item type's id property name.
|
3218 | */
|
3219 | var SimpleDataPipe = /*#__PURE__*/function () {
|
3220 | /**
|
3221 | * Create a new data pipe.
|
3222 | *
|
3223 | * @param _source - The data set or data view that will be observed.
|
3224 | * @param _transformers - An array of transforming functions to be used to
|
3225 | * filter or transform the items in the pipe.
|
3226 | * @param _target - The data set or data view that will receive the items.
|
3227 | */
|
3228 | function SimpleDataPipe(_source, _transformers, _target) {
|
3229 | var _context, _context2, _context3;
|
3230 | _classCallCheck(this, SimpleDataPipe);
|
3231 | /**
|
3232 | * Bound listeners for use with `DataInterface['on' | 'off']`.
|
3233 | */
|
3234 | _defineProperty(this, "_listeners", {
|
3235 | add: _bindInstanceProperty$1(_context = this._add).call(_context, this),
|
3236 | remove: _bindInstanceProperty$1(_context2 = this._remove).call(_context2, this),
|
3237 | update: _bindInstanceProperty$1(_context3 = this._update).call(_context3, this)
|
3238 | });
|
3239 | this._source = _source;
|
3240 | this._transformers = _transformers;
|
3241 | this._target = _target;
|
3242 | }
|
3243 | /** @inheritDoc */
|
3244 | _createClass(SimpleDataPipe, [{
|
3245 | key: "all",
|
3246 | value: function all() {
|
3247 | this._target.update(this._transformItems(this._source.get()));
|
3248 | return this;
|
3249 | }
|
3250 | /** @inheritDoc */
|
3251 | }, {
|
3252 | key: "start",
|
3253 | value: function start() {
|
3254 | this._source.on("add", this._listeners.add);
|
3255 | this._source.on("remove", this._listeners.remove);
|
3256 | this._source.on("update", this._listeners.update);
|
3257 | return this;
|
3258 | }
|
3259 | /** @inheritDoc */
|
3260 | }, {
|
3261 | key: "stop",
|
3262 | value: function stop() {
|
3263 | this._source.off("add", this._listeners.add);
|
3264 | this._source.off("remove", this._listeners.remove);
|
3265 | this._source.off("update", this._listeners.update);
|
3266 | return this;
|
3267 | }
|
3268 | /**
|
3269 | * Apply the transformers to the items.
|
3270 | *
|
3271 | * @param items - The items to be transformed.
|
3272 | * @returns The transformed items.
|
3273 | */
|
3274 | }, {
|
3275 | key: "_transformItems",
|
3276 | value: function _transformItems(items) {
|
3277 | var _context4;
|
3278 | return _reduceInstanceProperty(_context4 = this._transformers).call(_context4, function (items, transform) {
|
3279 | return transform(items);
|
3280 | }, items);
|
3281 | }
|
3282 | /**
|
3283 | * Handle an add event.
|
3284 | *
|
3285 | * @param _name - Ignored.
|
3286 | * @param payload - The payload containing the ids of the added items.
|
3287 | */
|
3288 | }, {
|
3289 | key: "_add",
|
3290 | value: function _add(_name, payload) {
|
3291 | if (payload == null) {
|
3292 | return;
|
3293 | }
|
3294 | this._target.add(this._transformItems(this._source.get(payload.items)));
|
3295 | }
|
3296 | /**
|
3297 | * Handle an update event.
|
3298 | *
|
3299 | * @param _name - Ignored.
|
3300 | * @param payload - The payload containing the ids of the updated items.
|
3301 | */
|
3302 | }, {
|
3303 | key: "_update",
|
3304 | value: function _update(_name, payload) {
|
3305 | if (payload == null) {
|
3306 | return;
|
3307 | }
|
3308 | this._target.update(this._transformItems(this._source.get(payload.items)));
|
3309 | }
|
3310 | /**
|
3311 | * Handle a remove event.
|
3312 | *
|
3313 | * @param _name - Ignored.
|
3314 | * @param payload - The payload containing the data of the removed items.
|
3315 | */
|
3316 | }, {
|
3317 | key: "_remove",
|
3318 | value: function _remove(_name, payload) {
|
3319 | if (payload == null) {
|
3320 | return;
|
3321 | }
|
3322 | this._target.remove(this._transformItems(payload.oldData));
|
3323 | }
|
3324 | }]);
|
3325 | return SimpleDataPipe;
|
3326 | }();
|
3327 | /**
|
3328 | * Internal implementation of the pipe factory. This should be accessible
|
3329 | * only through `createNewDataPipeFrom` from the outside.
|
3330 | *
|
3331 | * @typeParam TI - Target item type.
|
3332 | * @typeParam TP - Target item type's id property name.
|
3333 | */
|
3334 | var DataPipeUnderConstruction = /*#__PURE__*/function () {
|
3335 | /**
|
3336 | * Create a new data pipe factory. This is an internal constructor that
|
3337 | * should never be called from outside of this file.
|
3338 | *
|
3339 | * @param _source - The source data set or data view for this pipe.
|
3340 | */
|
3341 | function DataPipeUnderConstruction(_source) {
|
3342 | _classCallCheck(this, DataPipeUnderConstruction);
|
3343 | /**
|
3344 | * Array transformers used to transform items within the pipe. This is typed
|
3345 | * as any for the sake of simplicity.
|
3346 | */
|
3347 | _defineProperty(this, "_transformers", []);
|
3348 | this._source = _source;
|
3349 | }
|
3350 | /**
|
3351 | * Filter the items.
|
3352 | *
|
3353 | * @param callback - A filtering function that returns true if given item
|
3354 | * should be piped and false if not.
|
3355 | * @returns This factory for further configuration.
|
3356 | */
|
3357 | _createClass(DataPipeUnderConstruction, [{
|
3358 | key: "filter",
|
3359 | value: function filter(callback) {
|
3360 | this._transformers.push(function (input) {
|
3361 | return _filterInstanceProperty(input).call(input, callback);
|
3362 | });
|
3363 | return this;
|
3364 | }
|
3365 | /**
|
3366 | * Map each source item to a new type.
|
3367 | *
|
3368 | * @param callback - A mapping function that takes a source item and returns
|
3369 | * corresponding mapped item.
|
3370 | * @typeParam TI - Target item type.
|
3371 | * @typeParam TP - Target item type's id property name.
|
3372 | * @returns This factory for further configuration.
|
3373 | */
|
3374 | }, {
|
3375 | key: "map",
|
3376 | value: function map(callback) {
|
3377 | this._transformers.push(function (input) {
|
3378 | return _mapInstanceProperty(input).call(input, callback);
|
3379 | });
|
3380 | return this;
|
3381 | }
|
3382 | /**
|
3383 | * Map each source item to zero or more items of a new type.
|
3384 | *
|
3385 | * @param callback - A mapping function that takes a source item and returns
|
3386 | * an array of corresponding mapped items.
|
3387 | * @typeParam TI - Target item type.
|
3388 | * @typeParam TP - Target item type's id property name.
|
3389 | * @returns This factory for further configuration.
|
3390 | */
|
3391 | }, {
|
3392 | key: "flatMap",
|
3393 | value: function flatMap(callback) {
|
3394 | this._transformers.push(function (input) {
|
3395 | return _flatMapInstanceProperty(input).call(input, callback);
|
3396 | });
|
3397 | return this;
|
3398 | }
|
3399 | /**
|
3400 | * Connect this pipe to given data set.
|
3401 | *
|
3402 | * @param target - The data set that will receive the items from this pipe.
|
3403 | * @returns The pipe connected between given data sets and performing
|
3404 | * configured transformation on the processed items.
|
3405 | */
|
3406 | }, {
|
3407 | key: "to",
|
3408 | value: function to(target) {
|
3409 | return new SimpleDataPipe(this._source, this._transformers, target);
|
3410 | }
|
3411 | }]);
|
3412 | return DataPipeUnderConstruction;
|
3413 | }();
|
3414 |
|
3415 | var componentEmitter = {exports: {}};
|
3416 |
|
3417 | (function (module) {
|
3418 | function Emitter(object) {
|
3419 | if (object) {
|
3420 | return mixin(object);
|
3421 | }
|
3422 |
|
3423 | this._callbacks = new Map();
|
3424 | }
|
3425 |
|
3426 | function mixin(object) {
|
3427 | Object.assign(object, Emitter.prototype);
|
3428 | object._callbacks = new Map();
|
3429 | return object;
|
3430 | }
|
3431 |
|
3432 | Emitter.prototype.on = function (event, listener) {
|
3433 | const callbacks = this._callbacks.get(event) ?? [];
|
3434 | callbacks.push(listener);
|
3435 | this._callbacks.set(event, callbacks);
|
3436 | return this;
|
3437 | };
|
3438 |
|
3439 | Emitter.prototype.once = function (event, listener) {
|
3440 | const on = (...arguments_) => {
|
3441 | this.off(event, on);
|
3442 | listener.apply(this, arguments_);
|
3443 | };
|
3444 |
|
3445 | on.fn = listener;
|
3446 | this.on(event, on);
|
3447 | return this;
|
3448 | };
|
3449 |
|
3450 | Emitter.prototype.off = function (event, listener) {
|
3451 | if (event === undefined && listener === undefined) {
|
3452 | this._callbacks.clear();
|
3453 | return this;
|
3454 | }
|
3455 |
|
3456 | if (listener === undefined) {
|
3457 | this._callbacks.delete(event);
|
3458 | return this;
|
3459 | }
|
3460 |
|
3461 | const callbacks = this._callbacks.get(event);
|
3462 | if (callbacks) {
|
3463 | for (const [index, callback] of callbacks.entries()) {
|
3464 | if (callback === listener || callback.fn === listener) {
|
3465 | callbacks.splice(index, 1);
|
3466 | break;
|
3467 | }
|
3468 | }
|
3469 |
|
3470 | if (callbacks.length === 0) {
|
3471 | this._callbacks.delete(event);
|
3472 | } else {
|
3473 | this._callbacks.set(event, callbacks);
|
3474 | }
|
3475 | }
|
3476 |
|
3477 | return this;
|
3478 | };
|
3479 |
|
3480 | Emitter.prototype.emit = function (event, ...arguments_) {
|
3481 | const callbacks = this._callbacks.get(event);
|
3482 | if (callbacks) {
|
3483 | // Create a copy of the callbacks array to avoid issues if it's modified during iteration
|
3484 | const callbacksCopy = [...callbacks];
|
3485 |
|
3486 | for (const callback of callbacksCopy) {
|
3487 | callback.apply(this, arguments_);
|
3488 | }
|
3489 | }
|
3490 |
|
3491 | return this;
|
3492 | };
|
3493 |
|
3494 | Emitter.prototype.listeners = function (event) {
|
3495 | return this._callbacks.get(event) ?? [];
|
3496 | };
|
3497 |
|
3498 | Emitter.prototype.listenerCount = function (event) {
|
3499 | if (event) {
|
3500 | return this.listeners(event).length;
|
3501 | }
|
3502 |
|
3503 | let totalCount = 0;
|
3504 | for (const callbacks of this._callbacks.values()) {
|
3505 | totalCount += callbacks.length;
|
3506 | }
|
3507 |
|
3508 | return totalCount;
|
3509 | };
|
3510 |
|
3511 | Emitter.prototype.hasListeners = function (event) {
|
3512 | return this.listenerCount(event) > 0;
|
3513 | };
|
3514 |
|
3515 | // Aliases
|
3516 | Emitter.prototype.addEventListener = Emitter.prototype.on;
|
3517 | Emitter.prototype.removeListener = Emitter.prototype.off;
|
3518 | Emitter.prototype.removeEventListener = Emitter.prototype.off;
|
3519 | Emitter.prototype.removeAllListeners = Emitter.prototype.off;
|
3520 |
|
3521 | {
|
3522 | module.exports = Emitter;
|
3523 | }
|
3524 | } (componentEmitter));
|
3525 |
|
3526 | var componentEmitterExports = componentEmitter.exports;
|
3527 | var Emitter = /*@__PURE__*/getDefaultExportFromCjs(componentEmitterExports);
|
3528 |
|
3529 | /*! Hammer.JS - v2.0.17-rc - 2019-12-16
|
3530 | * http://naver.github.io/egjs
|
3531 | *
|
3532 | * Forked By Naver egjs
|
3533 | * Copyright (c) hammerjs
|
3534 | * Licensed under the MIT license */
|
3535 | function _extends() {
|
3536 | _extends = Object.assign || function (target) {
|
3537 | for (var i = 1; i < arguments.length; i++) {
|
3538 | var source = arguments[i];
|
3539 |
|
3540 | for (var key in source) {
|
3541 | if (Object.prototype.hasOwnProperty.call(source, key)) {
|
3542 | target[key] = source[key];
|
3543 | }
|
3544 | }
|
3545 | }
|
3546 |
|
3547 | return target;
|
3548 | };
|
3549 |
|
3550 | return _extends.apply(this, arguments);
|
3551 | }
|
3552 |
|
3553 | function _inheritsLoose(subClass, superClass) {
|
3554 | subClass.prototype = Object.create(superClass.prototype);
|
3555 | subClass.prototype.constructor = subClass;
|
3556 | subClass.__proto__ = superClass;
|
3557 | }
|
3558 |
|
3559 | function _assertThisInitialized$1(self) {
|
3560 | if (self === void 0) {
|
3561 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
3562 | }
|
3563 |
|
3564 | return self;
|
3565 | }
|
3566 |
|
3567 | /**
|
3568 | * @private
|
3569 | * extend object.
|
3570 | * means that properties in dest will be overwritten by the ones in src.
|
3571 | * @param {Object} target
|
3572 | * @param {...Object} objects_to_assign
|
3573 | * @returns {Object} target
|
3574 | */
|
3575 | var assign$4;
|
3576 |
|
3577 | if (typeof Object.assign !== 'function') {
|
3578 | assign$4 = function assign(target) {
|
3579 | if (target === undefined || target === null) {
|
3580 | throw new TypeError('Cannot convert undefined or null to object');
|
3581 | }
|
3582 |
|
3583 | var output = Object(target);
|
3584 |
|
3585 | for (var index = 1; index < arguments.length; index++) {
|
3586 | var source = arguments[index];
|
3587 |
|
3588 | if (source !== undefined && source !== null) {
|
3589 | for (var nextKey in source) {
|
3590 | if (source.hasOwnProperty(nextKey)) {
|
3591 | output[nextKey] = source[nextKey];
|
3592 | }
|
3593 | }
|
3594 | }
|
3595 | }
|
3596 |
|
3597 | return output;
|
3598 | };
|
3599 | } else {
|
3600 | assign$4 = Object.assign;
|
3601 | }
|
3602 |
|
3603 | var assign$1$1 = assign$4;
|
3604 |
|
3605 | var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];
|
3606 | var TEST_ELEMENT = typeof document === "undefined" ? {
|
3607 | style: {}
|
3608 | } : document.createElement('div');
|
3609 | var TYPE_FUNCTION = 'function';
|
3610 | var round = Math.round,
|
3611 | abs = Math.abs;
|
3612 | var now = Date.now;
|
3613 |
|
3614 | /**
|
3615 | * @private
|
3616 | * get the prefixed property
|
3617 | * @param {Object} obj
|
3618 | * @param {String} property
|
3619 | * @returns {String|Undefined} prefixed
|
3620 | */
|
3621 |
|
3622 | function prefixed(obj, property) {
|
3623 | var prefix;
|
3624 | var prop;
|
3625 | var camelProp = property[0].toUpperCase() + property.slice(1);
|
3626 | var i = 0;
|
3627 |
|
3628 | while (i < VENDOR_PREFIXES.length) {
|
3629 | prefix = VENDOR_PREFIXES[i];
|
3630 | prop = prefix ? prefix + camelProp : property;
|
3631 |
|
3632 | if (prop in obj) {
|
3633 | return prop;
|
3634 | }
|
3635 |
|
3636 | i++;
|
3637 | }
|
3638 |
|
3639 | return undefined;
|
3640 | }
|
3641 |
|
3642 | /* eslint-disable no-new-func, no-nested-ternary */
|
3643 | var win;
|
3644 |
|
3645 | if (typeof window === "undefined") {
|
3646 | // window is undefined in node.js
|
3647 | win = {};
|
3648 | } else {
|
3649 | win = window;
|
3650 | }
|
3651 |
|
3652 | var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
|
3653 | var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
|
3654 | function getTouchActionProps() {
|
3655 | if (!NATIVE_TOUCH_ACTION) {
|
3656 | return false;
|
3657 | }
|
3658 |
|
3659 | var touchMap = {};
|
3660 | var cssSupports = win.CSS && win.CSS.supports;
|
3661 | ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function (val) {
|
3662 | // If css.supports is not supported but there is native touch-action assume it supports
|
3663 | // all values. This is the case for IE 10 and 11.
|
3664 | return touchMap[val] = cssSupports ? win.CSS.supports('touch-action', val) : true;
|
3665 | });
|
3666 | return touchMap;
|
3667 | }
|
3668 |
|
3669 | var TOUCH_ACTION_COMPUTE = 'compute';
|
3670 | var TOUCH_ACTION_AUTO = 'auto';
|
3671 | var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
|
3672 |
|
3673 | var TOUCH_ACTION_NONE = 'none';
|
3674 | var TOUCH_ACTION_PAN_X = 'pan-x';
|
3675 | var TOUCH_ACTION_PAN_Y = 'pan-y';
|
3676 | var TOUCH_ACTION_MAP = getTouchActionProps();
|
3677 |
|
3678 | var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
|
3679 | var SUPPORT_TOUCH = 'ontouchstart' in win;
|
3680 | var SUPPORT_POINTER_EVENTS = prefixed(win, 'PointerEvent') !== undefined;
|
3681 | var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
|
3682 | var INPUT_TYPE_TOUCH = 'touch';
|
3683 | var INPUT_TYPE_PEN = 'pen';
|
3684 | var INPUT_TYPE_MOUSE = 'mouse';
|
3685 | var INPUT_TYPE_KINECT = 'kinect';
|
3686 | var COMPUTE_INTERVAL = 25;
|
3687 | var INPUT_START = 1;
|
3688 | var INPUT_MOVE = 2;
|
3689 | var INPUT_END = 4;
|
3690 | var INPUT_CANCEL = 8;
|
3691 | var DIRECTION_NONE = 1;
|
3692 | var DIRECTION_LEFT = 2;
|
3693 | var DIRECTION_RIGHT = 4;
|
3694 | var DIRECTION_UP = 8;
|
3695 | var DIRECTION_DOWN = 16;
|
3696 | var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
|
3697 | var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
|
3698 | var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
|
3699 | var PROPS_XY = ['x', 'y'];
|
3700 | var PROPS_CLIENT_XY = ['clientX', 'clientY'];
|
3701 |
|
3702 | /**
|
3703 | * @private
|
3704 | * walk objects and arrays
|
3705 | * @param {Object} obj
|
3706 | * @param {Function} iterator
|
3707 | * @param {Object} context
|
3708 | */
|
3709 | function each(obj, iterator, context) {
|
3710 | var i;
|
3711 |
|
3712 | if (!obj) {
|
3713 | return;
|
3714 | }
|
3715 |
|
3716 | if (obj.forEach) {
|
3717 | obj.forEach(iterator, context);
|
3718 | } else if (obj.length !== undefined) {
|
3719 | i = 0;
|
3720 |
|
3721 | while (i < obj.length) {
|
3722 | iterator.call(context, obj[i], i, obj);
|
3723 | i++;
|
3724 | }
|
3725 | } else {
|
3726 | for (i in obj) {
|
3727 | obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
|
3728 | }
|
3729 | }
|
3730 | }
|
3731 |
|
3732 | /**
|
3733 | * @private
|
3734 | * let a boolean value also be a function that must return a boolean
|
3735 | * this first item in args will be used as the context
|
3736 | * @param {Boolean|Function} val
|
3737 | * @param {Array} [args]
|
3738 | * @returns {Boolean}
|
3739 | */
|
3740 |
|
3741 | function boolOrFn(val, args) {
|
3742 | if (typeof val === TYPE_FUNCTION) {
|
3743 | return val.apply(args ? args[0] || undefined : undefined, args);
|
3744 | }
|
3745 |
|
3746 | return val;
|
3747 | }
|
3748 |
|
3749 | /**
|
3750 | * @private
|
3751 | * small indexOf wrapper
|
3752 | * @param {String} str
|
3753 | * @param {String} find
|
3754 | * @returns {Boolean} found
|
3755 | */
|
3756 | function inStr(str, find) {
|
3757 | return str.indexOf(find) > -1;
|
3758 | }
|
3759 |
|
3760 | /**
|
3761 | * @private
|
3762 | * when the touchActions are collected they are not a valid value, so we need to clean things up. *
|
3763 | * @param {String} actions
|
3764 | * @returns {*}
|
3765 | */
|
3766 |
|
3767 | function cleanTouchActions(actions) {
|
3768 | // none
|
3769 | if (inStr(actions, TOUCH_ACTION_NONE)) {
|
3770 | return TOUCH_ACTION_NONE;
|
3771 | }
|
3772 |
|
3773 | var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
|
3774 | var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y); // if both pan-x and pan-y are set (different recognizers
|
3775 | // for different directions, e.g. horizontal pan but vertical swipe?)
|
3776 | // we need none (as otherwise with pan-x pan-y combined none of these
|
3777 | // recognizers will work, since the browser would handle all panning
|
3778 |
|
3779 | if (hasPanX && hasPanY) {
|
3780 | return TOUCH_ACTION_NONE;
|
3781 | } // pan-x OR pan-y
|
3782 |
|
3783 |
|
3784 | if (hasPanX || hasPanY) {
|
3785 | return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
|
3786 | } // manipulation
|
3787 |
|
3788 |
|
3789 | if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
|
3790 | return TOUCH_ACTION_MANIPULATION;
|
3791 | }
|
3792 |
|
3793 | return TOUCH_ACTION_AUTO;
|
3794 | }
|
3795 |
|
3796 | /**
|
3797 | * @private
|
3798 | * Touch Action
|
3799 | * sets the touchAction property or uses the js alternative
|
3800 | * @param {Manager} manager
|
3801 | * @param {String} value
|
3802 | * @constructor
|
3803 | */
|
3804 |
|
3805 | var TouchAction =
|
3806 | /*#__PURE__*/
|
3807 | function () {
|
3808 | function TouchAction(manager, value) {
|
3809 | this.manager = manager;
|
3810 | this.set(value);
|
3811 | }
|
3812 | /**
|
3813 | * @private
|
3814 | * set the touchAction value on the element or enable the polyfill
|
3815 | * @param {String} value
|
3816 | */
|
3817 |
|
3818 |
|
3819 | var _proto = TouchAction.prototype;
|
3820 |
|
3821 | _proto.set = function set(value) {
|
3822 | // find out the touch-action by the event handlers
|
3823 | if (value === TOUCH_ACTION_COMPUTE) {
|
3824 | value = this.compute();
|
3825 | }
|
3826 |
|
3827 | if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {
|
3828 | this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
|
3829 | }
|
3830 |
|
3831 | this.actions = value.toLowerCase().trim();
|
3832 | };
|
3833 | /**
|
3834 | * @private
|
3835 | * just re-set the touchAction value
|
3836 | */
|
3837 |
|
3838 |
|
3839 | _proto.update = function update() {
|
3840 | this.set(this.manager.options.touchAction);
|
3841 | };
|
3842 | /**
|
3843 | * @private
|
3844 | * compute the value for the touchAction property based on the recognizer's settings
|
3845 | * @returns {String} value
|
3846 | */
|
3847 |
|
3848 |
|
3849 | _proto.compute = function compute() {
|
3850 | var actions = [];
|
3851 | each(this.manager.recognizers, function (recognizer) {
|
3852 | if (boolOrFn(recognizer.options.enable, [recognizer])) {
|
3853 | actions = actions.concat(recognizer.getTouchAction());
|
3854 | }
|
3855 | });
|
3856 | return cleanTouchActions(actions.join(' '));
|
3857 | };
|
3858 | /**
|
3859 | * @private
|
3860 | * this method is called on each input cycle and provides the preventing of the browser behavior
|
3861 | * @param {Object} input
|
3862 | */
|
3863 |
|
3864 |
|
3865 | _proto.preventDefaults = function preventDefaults(input) {
|
3866 | var srcEvent = input.srcEvent;
|
3867 | var direction = input.offsetDirection; // if the touch action did prevented once this session
|
3868 |
|
3869 | if (this.manager.session.prevented) {
|
3870 | srcEvent.preventDefault();
|
3871 | return;
|
3872 | }
|
3873 |
|
3874 | var actions = this.actions;
|
3875 | var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];
|
3876 | var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];
|
3877 | var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];
|
3878 |
|
3879 | if (hasNone) {
|
3880 | // do not prevent defaults if this is a tap gesture
|
3881 | var isTapPointer = input.pointers.length === 1;
|
3882 | var isTapMovement = input.distance < 2;
|
3883 | var isTapTouchTime = input.deltaTime < 250;
|
3884 |
|
3885 | if (isTapPointer && isTapMovement && isTapTouchTime) {
|
3886 | return;
|
3887 | }
|
3888 | }
|
3889 |
|
3890 | if (hasPanX && hasPanY) {
|
3891 | // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent
|
3892 | return;
|
3893 | }
|
3894 |
|
3895 | if (hasNone || hasPanY && direction & DIRECTION_HORIZONTAL || hasPanX && direction & DIRECTION_VERTICAL) {
|
3896 | return this.preventSrc(srcEvent);
|
3897 | }
|
3898 | };
|
3899 | /**
|
3900 | * @private
|
3901 | * call preventDefault to prevent the browser's default behavior (scrolling in most cases)
|
3902 | * @param {Object} srcEvent
|
3903 | */
|
3904 |
|
3905 |
|
3906 | _proto.preventSrc = function preventSrc(srcEvent) {
|
3907 | this.manager.session.prevented = true;
|
3908 | srcEvent.preventDefault();
|
3909 | };
|
3910 |
|
3911 | return TouchAction;
|
3912 | }();
|
3913 |
|
3914 | /**
|
3915 | * @private
|
3916 | * find if a node is in the given parent
|
3917 | * @method hasParent
|
3918 | * @param {HTMLElement} node
|
3919 | * @param {HTMLElement} parent
|
3920 | * @return {Boolean} found
|
3921 | */
|
3922 | function hasParent(node, parent) {
|
3923 | while (node) {
|
3924 | if (node === parent) {
|
3925 | return true;
|
3926 | }
|
3927 |
|
3928 | node = node.parentNode;
|
3929 | }
|
3930 |
|
3931 | return false;
|
3932 | }
|
3933 |
|
3934 | /**
|
3935 | * @private
|
3936 | * get the center of all the pointers
|
3937 | * @param {Array} pointers
|
3938 | * @return {Object} center contains `x` and `y` properties
|
3939 | */
|
3940 |
|
3941 | function getCenter(pointers) {
|
3942 | var pointersLength = pointers.length; // no need to loop when only one touch
|
3943 |
|
3944 | if (pointersLength === 1) {
|
3945 | return {
|
3946 | x: round(pointers[0].clientX),
|
3947 | y: round(pointers[0].clientY)
|
3948 | };
|
3949 | }
|
3950 |
|
3951 | var x = 0;
|
3952 | var y = 0;
|
3953 | var i = 0;
|
3954 |
|
3955 | while (i < pointersLength) {
|
3956 | x += pointers[i].clientX;
|
3957 | y += pointers[i].clientY;
|
3958 | i++;
|
3959 | }
|
3960 |
|
3961 | return {
|
3962 | x: round(x / pointersLength),
|
3963 | y: round(y / pointersLength)
|
3964 | };
|
3965 | }
|
3966 |
|
3967 | /**
|
3968 | * @private
|
3969 | * create a simple clone from the input used for storage of firstInput and firstMultiple
|
3970 | * @param {Object} input
|
3971 | * @returns {Object} clonedInputData
|
3972 | */
|
3973 |
|
3974 | function simpleCloneInputData(input) {
|
3975 | // make a simple copy of the pointers because we will get a reference if we don't
|
3976 | // we only need clientXY for the calculations
|
3977 | var pointers = [];
|
3978 | var i = 0;
|
3979 |
|
3980 | while (i < input.pointers.length) {
|
3981 | pointers[i] = {
|
3982 | clientX: round(input.pointers[i].clientX),
|
3983 | clientY: round(input.pointers[i].clientY)
|
3984 | };
|
3985 | i++;
|
3986 | }
|
3987 |
|
3988 | return {
|
3989 | timeStamp: now(),
|
3990 | pointers: pointers,
|
3991 | center: getCenter(pointers),
|
3992 | deltaX: input.deltaX,
|
3993 | deltaY: input.deltaY
|
3994 | };
|
3995 | }
|
3996 |
|
3997 | /**
|
3998 | * @private
|
3999 | * calculate the absolute distance between two points
|
4000 | * @param {Object} p1 {x, y}
|
4001 | * @param {Object} p2 {x, y}
|
4002 | * @param {Array} [props] containing x and y keys
|
4003 | * @return {Number} distance
|
4004 | */
|
4005 |
|
4006 | function getDistance(p1, p2, props) {
|
4007 | if (!props) {
|
4008 | props = PROPS_XY;
|
4009 | }
|
4010 |
|
4011 | var x = p2[props[0]] - p1[props[0]];
|
4012 | var y = p2[props[1]] - p1[props[1]];
|
4013 | return Math.sqrt(x * x + y * y);
|
4014 | }
|
4015 |
|
4016 | /**
|
4017 | * @private
|
4018 | * calculate the angle between two coordinates
|
4019 | * @param {Object} p1
|
4020 | * @param {Object} p2
|
4021 | * @param {Array} [props] containing x and y keys
|
4022 | * @return {Number} angle
|
4023 | */
|
4024 |
|
4025 | function getAngle(p1, p2, props) {
|
4026 | if (!props) {
|
4027 | props = PROPS_XY;
|
4028 | }
|
4029 |
|
4030 | var x = p2[props[0]] - p1[props[0]];
|
4031 | var y = p2[props[1]] - p1[props[1]];
|
4032 | return Math.atan2(y, x) * 180 / Math.PI;
|
4033 | }
|
4034 |
|
4035 | /**
|
4036 | * @private
|
4037 | * get the direction between two points
|
4038 | * @param {Number} x
|
4039 | * @param {Number} y
|
4040 | * @return {Number} direction
|
4041 | */
|
4042 |
|
4043 | function getDirection(x, y) {
|
4044 | if (x === y) {
|
4045 | return DIRECTION_NONE;
|
4046 | }
|
4047 |
|
4048 | if (abs(x) >= abs(y)) {
|
4049 | return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
|
4050 | }
|
4051 |
|
4052 | return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
|
4053 | }
|
4054 |
|
4055 | function computeDeltaXY(session, input) {
|
4056 | var center = input.center; // let { offsetDelta:offset = {}, prevDelta = {}, prevInput = {} } = session;
|
4057 | // jscs throwing error on defalut destructured values and without defaults tests fail
|
4058 |
|
4059 | var offset = session.offsetDelta || {};
|
4060 | var prevDelta = session.prevDelta || {};
|
4061 | var prevInput = session.prevInput || {};
|
4062 |
|
4063 | if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
|
4064 | prevDelta = session.prevDelta = {
|
4065 | x: prevInput.deltaX || 0,
|
4066 | y: prevInput.deltaY || 0
|
4067 | };
|
4068 | offset = session.offsetDelta = {
|
4069 | x: center.x,
|
4070 | y: center.y
|
4071 | };
|
4072 | }
|
4073 |
|
4074 | input.deltaX = prevDelta.x + (center.x - offset.x);
|
4075 | input.deltaY = prevDelta.y + (center.y - offset.y);
|
4076 | }
|
4077 |
|
4078 | /**
|
4079 | * @private
|
4080 | * calculate the velocity between two points. unit is in px per ms.
|
4081 | * @param {Number} deltaTime
|
4082 | * @param {Number} x
|
4083 | * @param {Number} y
|
4084 | * @return {Object} velocity `x` and `y`
|
4085 | */
|
4086 | function getVelocity(deltaTime, x, y) {
|
4087 | return {
|
4088 | x: x / deltaTime || 0,
|
4089 | y: y / deltaTime || 0
|
4090 | };
|
4091 | }
|
4092 |
|
4093 | /**
|
4094 | * @private
|
4095 | * calculate the scale factor between two pointersets
|
4096 | * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
|
4097 | * @param {Array} start array of pointers
|
4098 | * @param {Array} end array of pointers
|
4099 | * @return {Number} scale
|
4100 | */
|
4101 |
|
4102 | function getScale(start, end) {
|
4103 | return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
|
4104 | }
|
4105 |
|
4106 | /**
|
4107 | * @private
|
4108 | * calculate the rotation degrees between two pointersets
|
4109 | * @param {Array} start array of pointers
|
4110 | * @param {Array} end array of pointers
|
4111 | * @return {Number} rotation
|
4112 | */
|
4113 |
|
4114 | function getRotation(start, end) {
|
4115 | return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);
|
4116 | }
|
4117 |
|
4118 | /**
|
4119 | * @private
|
4120 | * velocity is calculated every x ms
|
4121 | * @param {Object} session
|
4122 | * @param {Object} input
|
4123 | */
|
4124 |
|
4125 | function computeIntervalInputData(session, input) {
|
4126 | var last = session.lastInterval || input;
|
4127 | var deltaTime = input.timeStamp - last.timeStamp;
|
4128 | var velocity;
|
4129 | var velocityX;
|
4130 | var velocityY;
|
4131 | var direction;
|
4132 |
|
4133 | if (input.eventType !== INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
|
4134 | var deltaX = input.deltaX - last.deltaX;
|
4135 | var deltaY = input.deltaY - last.deltaY;
|
4136 | var v = getVelocity(deltaTime, deltaX, deltaY);
|
4137 | velocityX = v.x;
|
4138 | velocityY = v.y;
|
4139 | velocity = abs(v.x) > abs(v.y) ? v.x : v.y;
|
4140 | direction = getDirection(deltaX, deltaY);
|
4141 | session.lastInterval = input;
|
4142 | } else {
|
4143 | // use latest velocity info if it doesn't overtake a minimum period
|
4144 | velocity = last.velocity;
|
4145 | velocityX = last.velocityX;
|
4146 | velocityY = last.velocityY;
|
4147 | direction = last.direction;
|
4148 | }
|
4149 |
|
4150 | input.velocity = velocity;
|
4151 | input.velocityX = velocityX;
|
4152 | input.velocityY = velocityY;
|
4153 | input.direction = direction;
|
4154 | }
|
4155 |
|
4156 | /**
|
4157 | * @private
|
4158 | * extend the data with some usable properties like scale, rotate, velocity etc
|
4159 | * @param {Object} manager
|
4160 | * @param {Object} input
|
4161 | */
|
4162 |
|
4163 | function computeInputData(manager, input) {
|
4164 | var session = manager.session;
|
4165 | var pointers = input.pointers;
|
4166 | var pointersLength = pointers.length; // store the first input to calculate the distance and direction
|
4167 |
|
4168 | if (!session.firstInput) {
|
4169 | session.firstInput = simpleCloneInputData(input);
|
4170 | } // to compute scale and rotation we need to store the multiple touches
|
4171 |
|
4172 |
|
4173 | if (pointersLength > 1 && !session.firstMultiple) {
|
4174 | session.firstMultiple = simpleCloneInputData(input);
|
4175 | } else if (pointersLength === 1) {
|
4176 | session.firstMultiple = false;
|
4177 | }
|
4178 |
|
4179 | var firstInput = session.firstInput,
|
4180 | firstMultiple = session.firstMultiple;
|
4181 | var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
|
4182 | var center = input.center = getCenter(pointers);
|
4183 | input.timeStamp = now();
|
4184 | input.deltaTime = input.timeStamp - firstInput.timeStamp;
|
4185 | input.angle = getAngle(offsetCenter, center);
|
4186 | input.distance = getDistance(offsetCenter, center);
|
4187 | computeDeltaXY(session, input);
|
4188 | input.offsetDirection = getDirection(input.deltaX, input.deltaY);
|
4189 | var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);
|
4190 | input.overallVelocityX = overallVelocity.x;
|
4191 | input.overallVelocityY = overallVelocity.y;
|
4192 | input.overallVelocity = abs(overallVelocity.x) > abs(overallVelocity.y) ? overallVelocity.x : overallVelocity.y;
|
4193 | input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
|
4194 | input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
|
4195 | input.maxPointers = !session.prevInput ? input.pointers.length : input.pointers.length > session.prevInput.maxPointers ? input.pointers.length : session.prevInput.maxPointers;
|
4196 | computeIntervalInputData(session, input); // find the correct target
|
4197 |
|
4198 | var target = manager.element;
|
4199 | var srcEvent = input.srcEvent;
|
4200 | var srcEventTarget;
|
4201 |
|
4202 | if (srcEvent.composedPath) {
|
4203 | srcEventTarget = srcEvent.composedPath()[0];
|
4204 | } else if (srcEvent.path) {
|
4205 | srcEventTarget = srcEvent.path[0];
|
4206 | } else {
|
4207 | srcEventTarget = srcEvent.target;
|
4208 | }
|
4209 |
|
4210 | if (hasParent(srcEventTarget, target)) {
|
4211 | target = srcEventTarget;
|
4212 | }
|
4213 |
|
4214 | input.target = target;
|
4215 | }
|
4216 |
|
4217 | /**
|
4218 | * @private
|
4219 | * handle input events
|
4220 | * @param {Manager} manager
|
4221 | * @param {String} eventType
|
4222 | * @param {Object} input
|
4223 | */
|
4224 |
|
4225 | function inputHandler(manager, eventType, input) {
|
4226 | var pointersLen = input.pointers.length;
|
4227 | var changedPointersLen = input.changedPointers.length;
|
4228 | var isFirst = eventType & INPUT_START && pointersLen - changedPointersLen === 0;
|
4229 | var isFinal = eventType & (INPUT_END | INPUT_CANCEL) && pointersLen - changedPointersLen === 0;
|
4230 | input.isFirst = !!isFirst;
|
4231 | input.isFinal = !!isFinal;
|
4232 |
|
4233 | if (isFirst) {
|
4234 | manager.session = {};
|
4235 | } // source event is the normalized value of the domEvents
|
4236 | // like 'touchstart, mouseup, pointerdown'
|
4237 |
|
4238 |
|
4239 | input.eventType = eventType; // compute scale, rotation etc
|
4240 |
|
4241 | computeInputData(manager, input); // emit secret event
|
4242 |
|
4243 | manager.emit('hammer.input', input);
|
4244 | manager.recognize(input);
|
4245 | manager.session.prevInput = input;
|
4246 | }
|
4247 |
|
4248 | /**
|
4249 | * @private
|
4250 | * split string on whitespace
|
4251 | * @param {String} str
|
4252 | * @returns {Array} words
|
4253 | */
|
4254 | function splitStr(str) {
|
4255 | return str.trim().split(/\s+/g);
|
4256 | }
|
4257 |
|
4258 | /**
|
4259 | * @private
|
4260 | * addEventListener with multiple events at once
|
4261 | * @param {EventTarget} target
|
4262 | * @param {String} types
|
4263 | * @param {Function} handler
|
4264 | */
|
4265 |
|
4266 | function addEventListeners(target, types, handler) {
|
4267 | each(splitStr(types), function (type) {
|
4268 | target.addEventListener(type, handler, false);
|
4269 | });
|
4270 | }
|
4271 |
|
4272 | /**
|
4273 | * @private
|
4274 | * removeEventListener with multiple events at once
|
4275 | * @param {EventTarget} target
|
4276 | * @param {String} types
|
4277 | * @param {Function} handler
|
4278 | */
|
4279 |
|
4280 | function removeEventListeners(target, types, handler) {
|
4281 | each(splitStr(types), function (type) {
|
4282 | target.removeEventListener(type, handler, false);
|
4283 | });
|
4284 | }
|
4285 |
|
4286 | /**
|
4287 | * @private
|
4288 | * get the window object of an element
|
4289 | * @param {HTMLElement} element
|
4290 | * @returns {DocumentView|Window}
|
4291 | */
|
4292 | function getWindowForElement(element) {
|
4293 | var doc = element.ownerDocument || element;
|
4294 | return doc.defaultView || doc.parentWindow || window;
|
4295 | }
|
4296 |
|
4297 | /**
|
4298 | * @private
|
4299 | * create new input type manager
|
4300 | * @param {Manager} manager
|
4301 | * @param {Function} callback
|
4302 | * @returns {Input}
|
4303 | * @constructor
|
4304 | */
|
4305 |
|
4306 | var Input =
|
4307 | /*#__PURE__*/
|
4308 | function () {
|
4309 | function Input(manager, callback) {
|
4310 | var self = this;
|
4311 | this.manager = manager;
|
4312 | this.callback = callback;
|
4313 | this.element = manager.element;
|
4314 | this.target = manager.options.inputTarget; // smaller wrapper around the handler, for the scope and the enabled state of the manager,
|
4315 | // so when disabled the input events are completely bypassed.
|
4316 |
|
4317 | this.domHandler = function (ev) {
|
4318 | if (boolOrFn(manager.options.enable, [manager])) {
|
4319 | self.handler(ev);
|
4320 | }
|
4321 | };
|
4322 |
|
4323 | this.init();
|
4324 | }
|
4325 | /**
|
4326 | * @private
|
4327 | * should handle the inputEvent data and trigger the callback
|
4328 | * @virtual
|
4329 | */
|
4330 |
|
4331 |
|
4332 | var _proto = Input.prototype;
|
4333 |
|
4334 | _proto.handler = function handler() {};
|
4335 | /**
|
4336 | * @private
|
4337 | * bind the events
|
4338 | */
|
4339 |
|
4340 |
|
4341 | _proto.init = function init() {
|
4342 | this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
|
4343 | this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
|
4344 | this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
|
4345 | };
|
4346 | /**
|
4347 | * @private
|
4348 | * unbind the events
|
4349 | */
|
4350 |
|
4351 |
|
4352 | _proto.destroy = function destroy() {
|
4353 | this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
|
4354 | this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
|
4355 | this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
|
4356 | };
|
4357 |
|
4358 | return Input;
|
4359 | }();
|
4360 |
|
4361 | /**
|
4362 | * @private
|
4363 | * find if a array contains the object using indexOf or a simple polyFill
|
4364 | * @param {Array} src
|
4365 | * @param {String} find
|
4366 | * @param {String} [findByKey]
|
4367 | * @return {Boolean|Number} false when not found, or the index
|
4368 | */
|
4369 | function inArray(src, find, findByKey) {
|
4370 | if (src.indexOf && !findByKey) {
|
4371 | return src.indexOf(find);
|
4372 | } else {
|
4373 | var i = 0;
|
4374 |
|
4375 | while (i < src.length) {
|
4376 | if (findByKey && src[i][findByKey] == find || !findByKey && src[i] === find) {
|
4377 | // do not use === here, test fails
|
4378 | return i;
|
4379 | }
|
4380 |
|
4381 | i++;
|
4382 | }
|
4383 |
|
4384 | return -1;
|
4385 | }
|
4386 | }
|
4387 |
|
4388 | var POINTER_INPUT_MAP = {
|
4389 | pointerdown: INPUT_START,
|
4390 | pointermove: INPUT_MOVE,
|
4391 | pointerup: INPUT_END,
|
4392 | pointercancel: INPUT_CANCEL,
|
4393 | pointerout: INPUT_CANCEL
|
4394 | }; // in IE10 the pointer types is defined as an enum
|
4395 |
|
4396 | var IE10_POINTER_TYPE_ENUM = {
|
4397 | 2: INPUT_TYPE_TOUCH,
|
4398 | 3: INPUT_TYPE_PEN,
|
4399 | 4: INPUT_TYPE_MOUSE,
|
4400 | 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816
|
4401 |
|
4402 | };
|
4403 | var POINTER_ELEMENT_EVENTS = 'pointerdown';
|
4404 | var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel'; // IE10 has prefixed support, and case-sensitive
|
4405 |
|
4406 | if (win.MSPointerEvent && !win.PointerEvent) {
|
4407 | POINTER_ELEMENT_EVENTS = 'MSPointerDown';
|
4408 | POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
|
4409 | }
|
4410 | /**
|
4411 | * @private
|
4412 | * Pointer events input
|
4413 | * @constructor
|
4414 | * @extends Input
|
4415 | */
|
4416 |
|
4417 |
|
4418 | var PointerEventInput =
|
4419 | /*#__PURE__*/
|
4420 | function (_Input) {
|
4421 | _inheritsLoose(PointerEventInput, _Input);
|
4422 |
|
4423 | function PointerEventInput() {
|
4424 | var _this;
|
4425 |
|
4426 | var proto = PointerEventInput.prototype;
|
4427 | proto.evEl = POINTER_ELEMENT_EVENTS;
|
4428 | proto.evWin = POINTER_WINDOW_EVENTS;
|
4429 | _this = _Input.apply(this, arguments) || this;
|
4430 | _this.store = _this.manager.session.pointerEvents = [];
|
4431 | return _this;
|
4432 | }
|
4433 | /**
|
4434 | * @private
|
4435 | * handle mouse events
|
4436 | * @param {Object} ev
|
4437 | */
|
4438 |
|
4439 |
|
4440 | var _proto = PointerEventInput.prototype;
|
4441 |
|
4442 | _proto.handler = function handler(ev) {
|
4443 | var store = this.store;
|
4444 | var removePointer = false;
|
4445 | var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
|
4446 | var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
|
4447 | var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
|
4448 | var isTouch = pointerType === INPUT_TYPE_TOUCH; // get index of the event in the store
|
4449 |
|
4450 | var storeIndex = inArray(store, ev.pointerId, 'pointerId'); // start and mouse must be down
|
4451 |
|
4452 | if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
|
4453 | if (storeIndex < 0) {
|
4454 | store.push(ev);
|
4455 | storeIndex = store.length - 1;
|
4456 | }
|
4457 | } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
|
4458 | removePointer = true;
|
4459 | } // it not found, so the pointer hasn't been down (so it's probably a hover)
|
4460 |
|
4461 |
|
4462 | if (storeIndex < 0) {
|
4463 | return;
|
4464 | } // update the event in the store
|
4465 |
|
4466 |
|
4467 | store[storeIndex] = ev;
|
4468 | this.callback(this.manager, eventType, {
|
4469 | pointers: store,
|
4470 | changedPointers: [ev],
|
4471 | pointerType: pointerType,
|
4472 | srcEvent: ev
|
4473 | });
|
4474 |
|
4475 | if (removePointer) {
|
4476 | // remove from the store
|
4477 | store.splice(storeIndex, 1);
|
4478 | }
|
4479 | };
|
4480 |
|
4481 | return PointerEventInput;
|
4482 | }(Input);
|
4483 |
|
4484 | /**
|
4485 | * @private
|
4486 | * convert array-like objects to real arrays
|
4487 | * @param {Object} obj
|
4488 | * @returns {Array}
|
4489 | */
|
4490 | function toArray(obj) {
|
4491 | return Array.prototype.slice.call(obj, 0);
|
4492 | }
|
4493 |
|
4494 | /**
|
4495 | * @private
|
4496 | * unique array with objects based on a key (like 'id') or just by the array's value
|
4497 | * @param {Array} src [{id:1},{id:2},{id:1}]
|
4498 | * @param {String} [key]
|
4499 | * @param {Boolean} [sort=False]
|
4500 | * @returns {Array} [{id:1},{id:2}]
|
4501 | */
|
4502 |
|
4503 | function uniqueArray(src, key, sort) {
|
4504 | var results = [];
|
4505 | var values = [];
|
4506 | var i = 0;
|
4507 |
|
4508 | while (i < src.length) {
|
4509 | var val = key ? src[i][key] : src[i];
|
4510 |
|
4511 | if (inArray(values, val) < 0) {
|
4512 | results.push(src[i]);
|
4513 | }
|
4514 |
|
4515 | values[i] = val;
|
4516 | i++;
|
4517 | }
|
4518 |
|
4519 | if (sort) {
|
4520 | if (!key) {
|
4521 | results = results.sort();
|
4522 | } else {
|
4523 | results = results.sort(function (a, b) {
|
4524 | return a[key] > b[key];
|
4525 | });
|
4526 | }
|
4527 | }
|
4528 |
|
4529 | return results;
|
4530 | }
|
4531 |
|
4532 | var TOUCH_INPUT_MAP = {
|
4533 | touchstart: INPUT_START,
|
4534 | touchmove: INPUT_MOVE,
|
4535 | touchend: INPUT_END,
|
4536 | touchcancel: INPUT_CANCEL
|
4537 | };
|
4538 | var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
|
4539 | /**
|
4540 | * @private
|
4541 | * Multi-user touch events input
|
4542 | * @constructor
|
4543 | * @extends Input
|
4544 | */
|
4545 |
|
4546 | var TouchInput =
|
4547 | /*#__PURE__*/
|
4548 | function (_Input) {
|
4549 | _inheritsLoose(TouchInput, _Input);
|
4550 |
|
4551 | function TouchInput() {
|
4552 | var _this;
|
4553 |
|
4554 | TouchInput.prototype.evTarget = TOUCH_TARGET_EVENTS;
|
4555 | _this = _Input.apply(this, arguments) || this;
|
4556 | _this.targetIds = {}; // this.evTarget = TOUCH_TARGET_EVENTS;
|
4557 |
|
4558 | return _this;
|
4559 | }
|
4560 |
|
4561 | var _proto = TouchInput.prototype;
|
4562 |
|
4563 | _proto.handler = function handler(ev) {
|
4564 | var type = TOUCH_INPUT_MAP[ev.type];
|
4565 | var touches = getTouches.call(this, ev, type);
|
4566 |
|
4567 | if (!touches) {
|
4568 | return;
|
4569 | }
|
4570 |
|
4571 | this.callback(this.manager, type, {
|
4572 | pointers: touches[0],
|
4573 | changedPointers: touches[1],
|
4574 | pointerType: INPUT_TYPE_TOUCH,
|
4575 | srcEvent: ev
|
4576 | });
|
4577 | };
|
4578 |
|
4579 | return TouchInput;
|
4580 | }(Input);
|
4581 |
|
4582 | function getTouches(ev, type) {
|
4583 | var allTouches = toArray(ev.touches);
|
4584 | var targetIds = this.targetIds; // when there is only one touch, the process can be simplified
|
4585 |
|
4586 | if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
|
4587 | targetIds[allTouches[0].identifier] = true;
|
4588 | return [allTouches, allTouches];
|
4589 | }
|
4590 |
|
4591 | var i;
|
4592 | var targetTouches;
|
4593 | var changedTouches = toArray(ev.changedTouches);
|
4594 | var changedTargetTouches = [];
|
4595 | var target = this.target; // get target touches from touches
|
4596 |
|
4597 | targetTouches = allTouches.filter(function (touch) {
|
4598 | return hasParent(touch.target, target);
|
4599 | }); // collect touches
|
4600 |
|
4601 | if (type === INPUT_START) {
|
4602 | i = 0;
|
4603 |
|
4604 | while (i < targetTouches.length) {
|
4605 | targetIds[targetTouches[i].identifier] = true;
|
4606 | i++;
|
4607 | }
|
4608 | } // filter changed touches to only contain touches that exist in the collected target ids
|
4609 |
|
4610 |
|
4611 | i = 0;
|
4612 |
|
4613 | while (i < changedTouches.length) {
|
4614 | if (targetIds[changedTouches[i].identifier]) {
|
4615 | changedTargetTouches.push(changedTouches[i]);
|
4616 | } // cleanup removed touches
|
4617 |
|
4618 |
|
4619 | if (type & (INPUT_END | INPUT_CANCEL)) {
|
4620 | delete targetIds[changedTouches[i].identifier];
|
4621 | }
|
4622 |
|
4623 | i++;
|
4624 | }
|
4625 |
|
4626 | if (!changedTargetTouches.length) {
|
4627 | return;
|
4628 | }
|
4629 |
|
4630 | return [// merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
|
4631 | uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true), changedTargetTouches];
|
4632 | }
|
4633 |
|
4634 | var MOUSE_INPUT_MAP = {
|
4635 | mousedown: INPUT_START,
|
4636 | mousemove: INPUT_MOVE,
|
4637 | mouseup: INPUT_END
|
4638 | };
|
4639 | var MOUSE_ELEMENT_EVENTS = 'mousedown';
|
4640 | var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
|
4641 | /**
|
4642 | * @private
|
4643 | * Mouse events input
|
4644 | * @constructor
|
4645 | * @extends Input
|
4646 | */
|
4647 |
|
4648 | var MouseInput =
|
4649 | /*#__PURE__*/
|
4650 | function (_Input) {
|
4651 | _inheritsLoose(MouseInput, _Input);
|
4652 |
|
4653 | function MouseInput() {
|
4654 | var _this;
|
4655 |
|
4656 | var proto = MouseInput.prototype;
|
4657 | proto.evEl = MOUSE_ELEMENT_EVENTS;
|
4658 | proto.evWin = MOUSE_WINDOW_EVENTS;
|
4659 | _this = _Input.apply(this, arguments) || this;
|
4660 | _this.pressed = false; // mousedown state
|
4661 |
|
4662 | return _this;
|
4663 | }
|
4664 | /**
|
4665 | * @private
|
4666 | * handle mouse events
|
4667 | * @param {Object} ev
|
4668 | */
|
4669 |
|
4670 |
|
4671 | var _proto = MouseInput.prototype;
|
4672 |
|
4673 | _proto.handler = function handler(ev) {
|
4674 | var eventType = MOUSE_INPUT_MAP[ev.type]; // on start we want to have the left mouse button down
|
4675 |
|
4676 | if (eventType & INPUT_START && ev.button === 0) {
|
4677 | this.pressed = true;
|
4678 | }
|
4679 |
|
4680 | if (eventType & INPUT_MOVE && ev.which !== 1) {
|
4681 | eventType = INPUT_END;
|
4682 | } // mouse must be down
|
4683 |
|
4684 |
|
4685 | if (!this.pressed) {
|
4686 | return;
|
4687 | }
|
4688 |
|
4689 | if (eventType & INPUT_END) {
|
4690 | this.pressed = false;
|
4691 | }
|
4692 |
|
4693 | this.callback(this.manager, eventType, {
|
4694 | pointers: [ev],
|
4695 | changedPointers: [ev],
|
4696 | pointerType: INPUT_TYPE_MOUSE,
|
4697 | srcEvent: ev
|
4698 | });
|
4699 | };
|
4700 |
|
4701 | return MouseInput;
|
4702 | }(Input);
|
4703 |
|
4704 | /**
|
4705 | * @private
|
4706 | * Combined touch and mouse input
|
4707 | *
|
4708 | * Touch has a higher priority then mouse, and while touching no mouse events are allowed.
|
4709 | * This because touch devices also emit mouse events while doing a touch.
|
4710 | *
|
4711 | * @constructor
|
4712 | * @extends Input
|
4713 | */
|
4714 |
|
4715 | var DEDUP_TIMEOUT = 2500;
|
4716 | var DEDUP_DISTANCE = 25;
|
4717 |
|
4718 | function setLastTouch(eventData) {
|
4719 | var _eventData$changedPoi = eventData.changedPointers,
|
4720 | touch = _eventData$changedPoi[0];
|
4721 |
|
4722 | if (touch.identifier === this.primaryTouch) {
|
4723 | var lastTouch = {
|
4724 | x: touch.clientX,
|
4725 | y: touch.clientY
|
4726 | };
|
4727 | var lts = this.lastTouches;
|
4728 | this.lastTouches.push(lastTouch);
|
4729 |
|
4730 | var removeLastTouch = function removeLastTouch() {
|
4731 | var i = lts.indexOf(lastTouch);
|
4732 |
|
4733 | if (i > -1) {
|
4734 | lts.splice(i, 1);
|
4735 | }
|
4736 | };
|
4737 |
|
4738 | setTimeout(removeLastTouch, DEDUP_TIMEOUT);
|
4739 | }
|
4740 | }
|
4741 |
|
4742 | function recordTouches(eventType, eventData) {
|
4743 | if (eventType & INPUT_START) {
|
4744 | this.primaryTouch = eventData.changedPointers[0].identifier;
|
4745 | setLastTouch.call(this, eventData);
|
4746 | } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
|
4747 | setLastTouch.call(this, eventData);
|
4748 | }
|
4749 | }
|
4750 |
|
4751 | function isSyntheticEvent(eventData) {
|
4752 | var x = eventData.srcEvent.clientX;
|
4753 | var y = eventData.srcEvent.clientY;
|
4754 |
|
4755 | for (var i = 0; i < this.lastTouches.length; i++) {
|
4756 | var t = this.lastTouches[i];
|
4757 | var dx = Math.abs(x - t.x);
|
4758 | var dy = Math.abs(y - t.y);
|
4759 |
|
4760 | if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {
|
4761 | return true;
|
4762 | }
|
4763 | }
|
4764 |
|
4765 | return false;
|
4766 | }
|
4767 |
|
4768 | var TouchMouseInput =
|
4769 | /*#__PURE__*/
|
4770 | function () {
|
4771 | var TouchMouseInput =
|
4772 | /*#__PURE__*/
|
4773 | function (_Input) {
|
4774 | _inheritsLoose(TouchMouseInput, _Input);
|
4775 |
|
4776 | function TouchMouseInput(_manager, callback) {
|
4777 | var _this;
|
4778 |
|
4779 | _this = _Input.call(this, _manager, callback) || this;
|
4780 |
|
4781 | _this.handler = function (manager, inputEvent, inputData) {
|
4782 | var isTouch = inputData.pointerType === INPUT_TYPE_TOUCH;
|
4783 | var isMouse = inputData.pointerType === INPUT_TYPE_MOUSE;
|
4784 |
|
4785 | if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {
|
4786 | return;
|
4787 | } // when we're in a touch event, record touches to de-dupe synthetic mouse event
|
4788 |
|
4789 |
|
4790 | if (isTouch) {
|
4791 | recordTouches.call(_assertThisInitialized$1(_assertThisInitialized$1(_this)), inputEvent, inputData);
|
4792 | } else if (isMouse && isSyntheticEvent.call(_assertThisInitialized$1(_assertThisInitialized$1(_this)), inputData)) {
|
4793 | return;
|
4794 | }
|
4795 |
|
4796 | _this.callback(manager, inputEvent, inputData);
|
4797 | };
|
4798 |
|
4799 | _this.touch = new TouchInput(_this.manager, _this.handler);
|
4800 | _this.mouse = new MouseInput(_this.manager, _this.handler);
|
4801 | _this.primaryTouch = null;
|
4802 | _this.lastTouches = [];
|
4803 | return _this;
|
4804 | }
|
4805 | /**
|
4806 | * @private
|
4807 | * handle mouse and touch events
|
4808 | * @param {Hammer} manager
|
4809 | * @param {String} inputEvent
|
4810 | * @param {Object} inputData
|
4811 | */
|
4812 |
|
4813 |
|
4814 | var _proto = TouchMouseInput.prototype;
|
4815 |
|
4816 | /**
|
4817 | * @private
|
4818 | * remove the event listeners
|
4819 | */
|
4820 | _proto.destroy = function destroy() {
|
4821 | this.touch.destroy();
|
4822 | this.mouse.destroy();
|
4823 | };
|
4824 |
|
4825 | return TouchMouseInput;
|
4826 | }(Input);
|
4827 |
|
4828 | return TouchMouseInput;
|
4829 | }();
|
4830 |
|
4831 | /**
|
4832 | * @private
|
4833 | * create new input type manager
|
4834 | * called by the Manager constructor
|
4835 | * @param {Hammer} manager
|
4836 | * @returns {Input}
|
4837 | */
|
4838 |
|
4839 | function createInputInstance(manager) {
|
4840 | var Type; // let inputClass = manager.options.inputClass;
|
4841 |
|
4842 | var inputClass = manager.options.inputClass;
|
4843 |
|
4844 | if (inputClass) {
|
4845 | Type = inputClass;
|
4846 | } else if (SUPPORT_POINTER_EVENTS) {
|
4847 | Type = PointerEventInput;
|
4848 | } else if (SUPPORT_ONLY_TOUCH) {
|
4849 | Type = TouchInput;
|
4850 | } else if (!SUPPORT_TOUCH) {
|
4851 | Type = MouseInput;
|
4852 | } else {
|
4853 | Type = TouchMouseInput;
|
4854 | }
|
4855 |
|
4856 | return new Type(manager, inputHandler);
|
4857 | }
|
4858 |
|
4859 | /**
|
4860 | * @private
|
4861 | * if the argument is an array, we want to execute the fn on each entry
|
4862 | * if it aint an array we don't want to do a thing.
|
4863 | * this is used by all the methods that accept a single and array argument.
|
4864 | * @param {*|Array} arg
|
4865 | * @param {String} fn
|
4866 | * @param {Object} [context]
|
4867 | * @returns {Boolean}
|
4868 | */
|
4869 |
|
4870 | function invokeArrayArg(arg, fn, context) {
|
4871 | if (Array.isArray(arg)) {
|
4872 | each(arg, context[fn], context);
|
4873 | return true;
|
4874 | }
|
4875 |
|
4876 | return false;
|
4877 | }
|
4878 |
|
4879 | var STATE_POSSIBLE = 1;
|
4880 | var STATE_BEGAN = 2;
|
4881 | var STATE_CHANGED = 4;
|
4882 | var STATE_ENDED = 8;
|
4883 | var STATE_RECOGNIZED = STATE_ENDED;
|
4884 | var STATE_CANCELLED = 16;
|
4885 | var STATE_FAILED = 32;
|
4886 |
|
4887 | /**
|
4888 | * @private
|
4889 | * get a unique id
|
4890 | * @returns {number} uniqueId
|
4891 | */
|
4892 | var _uniqueId = 1;
|
4893 | function uniqueId() {
|
4894 | return _uniqueId++;
|
4895 | }
|
4896 |
|
4897 | /**
|
4898 | * @private
|
4899 | * get a recognizer by name if it is bound to a manager
|
4900 | * @param {Recognizer|String} otherRecognizer
|
4901 | * @param {Recognizer} recognizer
|
4902 | * @returns {Recognizer}
|
4903 | */
|
4904 | function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
|
4905 | var manager = recognizer.manager;
|
4906 |
|
4907 | if (manager) {
|
4908 | return manager.get(otherRecognizer);
|
4909 | }
|
4910 |
|
4911 | return otherRecognizer;
|
4912 | }
|
4913 |
|
4914 | /**
|
4915 | * @private
|
4916 | * get a usable string, used as event postfix
|
4917 | * @param {constant} state
|
4918 | * @returns {String} state
|
4919 | */
|
4920 |
|
4921 | function stateStr(state) {
|
4922 | if (state & STATE_CANCELLED) {
|
4923 | return 'cancel';
|
4924 | } else if (state & STATE_ENDED) {
|
4925 | return 'end';
|
4926 | } else if (state & STATE_CHANGED) {
|
4927 | return 'move';
|
4928 | } else if (state & STATE_BEGAN) {
|
4929 | return 'start';
|
4930 | }
|
4931 |
|
4932 | return '';
|
4933 | }
|
4934 |
|
4935 | /**
|
4936 | * @private
|
4937 | * Recognizer flow explained; *
|
4938 | * All recognizers have the initial state of POSSIBLE when a input session starts.
|
4939 | * The definition of a input session is from the first input until the last input, with all it's movement in it. *
|
4940 | * Example session for mouse-input: mousedown -> mousemove -> mouseup
|
4941 | *
|
4942 | * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed
|
4943 | * which determines with state it should be.
|
4944 | *
|
4945 | * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to
|
4946 | * POSSIBLE to give it another change on the next cycle.
|
4947 | *
|
4948 | * Possible
|
4949 | * |
|
4950 | * +-----+---------------+
|
4951 | * | |
|
4952 | * +-----+-----+ |
|
4953 | * | | |
|
4954 | * Failed Cancelled |
|
4955 | * +-------+------+
|
4956 | * | |
|
4957 | * Recognized Began
|
4958 | * |
|
4959 | * Changed
|
4960 | * |
|
4961 | * Ended/Recognized
|
4962 | */
|
4963 |
|
4964 | /**
|
4965 | * @private
|
4966 | * Recognizer
|
4967 | * Every recognizer needs to extend from this class.
|
4968 | * @constructor
|
4969 | * @param {Object} options
|
4970 | */
|
4971 |
|
4972 | var Recognizer =
|
4973 | /*#__PURE__*/
|
4974 | function () {
|
4975 | function Recognizer(options) {
|
4976 | if (options === void 0) {
|
4977 | options = {};
|
4978 | }
|
4979 |
|
4980 | this.options = _extends({
|
4981 | enable: true
|
4982 | }, options);
|
4983 | this.id = uniqueId();
|
4984 | this.manager = null; // default is enable true
|
4985 |
|
4986 | this.state = STATE_POSSIBLE;
|
4987 | this.simultaneous = {};
|
4988 | this.requireFail = [];
|
4989 | }
|
4990 | /**
|
4991 | * @private
|
4992 | * set options
|
4993 | * @param {Object} options
|
4994 | * @return {Recognizer}
|
4995 | */
|
4996 |
|
4997 |
|
4998 | var _proto = Recognizer.prototype;
|
4999 |
|
5000 | _proto.set = function set(options) {
|
5001 | assign$1$1(this.options, options); // also update the touchAction, in case something changed about the directions/enabled state
|
5002 |
|
5003 | this.manager && this.manager.touchAction.update();
|
5004 | return this;
|
5005 | };
|
5006 | /**
|
5007 | * @private
|
5008 | * recognize simultaneous with an other recognizer.
|
5009 | * @param {Recognizer} otherRecognizer
|
5010 | * @returns {Recognizer} this
|
5011 | */
|
5012 |
|
5013 |
|
5014 | _proto.recognizeWith = function recognizeWith(otherRecognizer) {
|
5015 | if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
|
5016 | return this;
|
5017 | }
|
5018 |
|
5019 | var simultaneous = this.simultaneous;
|
5020 | otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
|
5021 |
|
5022 | if (!simultaneous[otherRecognizer.id]) {
|
5023 | simultaneous[otherRecognizer.id] = otherRecognizer;
|
5024 | otherRecognizer.recognizeWith(this);
|
5025 | }
|
5026 |
|
5027 | return this;
|
5028 | };
|
5029 | /**
|
5030 | * @private
|
5031 | * drop the simultaneous link. it doesnt remove the link on the other recognizer.
|
5032 | * @param {Recognizer} otherRecognizer
|
5033 | * @returns {Recognizer} this
|
5034 | */
|
5035 |
|
5036 |
|
5037 | _proto.dropRecognizeWith = function dropRecognizeWith(otherRecognizer) {
|
5038 | if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
|
5039 | return this;
|
5040 | }
|
5041 |
|
5042 | otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
|
5043 | delete this.simultaneous[otherRecognizer.id];
|
5044 | return this;
|
5045 | };
|
5046 | /**
|
5047 | * @private
|
5048 | * recognizer can only run when an other is failing
|
5049 | * @param {Recognizer} otherRecognizer
|
5050 | * @returns {Recognizer} this
|
5051 | */
|
5052 |
|
5053 |
|
5054 | _proto.requireFailure = function requireFailure(otherRecognizer) {
|
5055 | if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
|
5056 | return this;
|
5057 | }
|
5058 |
|
5059 | var requireFail = this.requireFail;
|
5060 | otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
|
5061 |
|
5062 | if (inArray(requireFail, otherRecognizer) === -1) {
|
5063 | requireFail.push(otherRecognizer);
|
5064 | otherRecognizer.requireFailure(this);
|
5065 | }
|
5066 |
|
5067 | return this;
|
5068 | };
|
5069 | /**
|
5070 | * @private
|
5071 | * drop the requireFailure link. it does not remove the link on the other recognizer.
|
5072 | * @param {Recognizer} otherRecognizer
|
5073 | * @returns {Recognizer} this
|
5074 | */
|
5075 |
|
5076 |
|
5077 | _proto.dropRequireFailure = function dropRequireFailure(otherRecognizer) {
|
5078 | if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
|
5079 | return this;
|
5080 | }
|
5081 |
|
5082 | otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
|
5083 | var index = inArray(this.requireFail, otherRecognizer);
|
5084 |
|
5085 | if (index > -1) {
|
5086 | this.requireFail.splice(index, 1);
|
5087 | }
|
5088 |
|
5089 | return this;
|
5090 | };
|
5091 | /**
|
5092 | * @private
|
5093 | * has require failures boolean
|
5094 | * @returns {boolean}
|
5095 | */
|
5096 |
|
5097 |
|
5098 | _proto.hasRequireFailures = function hasRequireFailures() {
|
5099 | return this.requireFail.length > 0;
|
5100 | };
|
5101 | /**
|
5102 | * @private
|
5103 | * if the recognizer can recognize simultaneous with an other recognizer
|
5104 | * @param {Recognizer} otherRecognizer
|
5105 | * @returns {Boolean}
|
5106 | */
|
5107 |
|
5108 |
|
5109 | _proto.canRecognizeWith = function canRecognizeWith(otherRecognizer) {
|
5110 | return !!this.simultaneous[otherRecognizer.id];
|
5111 | };
|
5112 | /**
|
5113 | * @private
|
5114 | * You should use `tryEmit` instead of `emit` directly to check
|
5115 | * that all the needed recognizers has failed before emitting.
|
5116 | * @param {Object} input
|
5117 | */
|
5118 |
|
5119 |
|
5120 | _proto.emit = function emit(input) {
|
5121 | var self = this;
|
5122 | var state = this.state;
|
5123 |
|
5124 | function emit(event) {
|
5125 | self.manager.emit(event, input);
|
5126 | } // 'panstart' and 'panmove'
|
5127 |
|
5128 |
|
5129 | if (state < STATE_ENDED) {
|
5130 | emit(self.options.event + stateStr(state));
|
5131 | }
|
5132 |
|
5133 | emit(self.options.event); // simple 'eventName' events
|
5134 |
|
5135 | if (input.additionalEvent) {
|
5136 | // additional event(panleft, panright, pinchin, pinchout...)
|
5137 | emit(input.additionalEvent);
|
5138 | } // panend and pancancel
|
5139 |
|
5140 |
|
5141 | if (state >= STATE_ENDED) {
|
5142 | emit(self.options.event + stateStr(state));
|
5143 | }
|
5144 | };
|
5145 | /**
|
5146 | * @private
|
5147 | * Check that all the require failure recognizers has failed,
|
5148 | * if true, it emits a gesture event,
|
5149 | * otherwise, setup the state to FAILED.
|
5150 | * @param {Object} input
|
5151 | */
|
5152 |
|
5153 |
|
5154 | _proto.tryEmit = function tryEmit(input) {
|
5155 | if (this.canEmit()) {
|
5156 | return this.emit(input);
|
5157 | } // it's failing anyway
|
5158 |
|
5159 |
|
5160 | this.state = STATE_FAILED;
|
5161 | };
|
5162 | /**
|
5163 | * @private
|
5164 | * can we emit?
|
5165 | * @returns {boolean}
|
5166 | */
|
5167 |
|
5168 |
|
5169 | _proto.canEmit = function canEmit() {
|
5170 | var i = 0;
|
5171 |
|
5172 | while (i < this.requireFail.length) {
|
5173 | if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
|
5174 | return false;
|
5175 | }
|
5176 |
|
5177 | i++;
|
5178 | }
|
5179 |
|
5180 | return true;
|
5181 | };
|
5182 | /**
|
5183 | * @private
|
5184 | * update the recognizer
|
5185 | * @param {Object} inputData
|
5186 | */
|
5187 |
|
5188 |
|
5189 | _proto.recognize = function recognize(inputData) {
|
5190 | // make a new copy of the inputData
|
5191 | // so we can change the inputData without messing up the other recognizers
|
5192 | var inputDataClone = assign$1$1({}, inputData); // is is enabled and allow recognizing?
|
5193 |
|
5194 | if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
|
5195 | this.reset();
|
5196 | this.state = STATE_FAILED;
|
5197 | return;
|
5198 | } // reset when we've reached the end
|
5199 |
|
5200 |
|
5201 | if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
|
5202 | this.state = STATE_POSSIBLE;
|
5203 | }
|
5204 |
|
5205 | this.state = this.process(inputDataClone); // the recognizer has recognized a gesture
|
5206 | // so trigger an event
|
5207 |
|
5208 | if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
|
5209 | this.tryEmit(inputDataClone);
|
5210 | }
|
5211 | };
|
5212 | /**
|
5213 | * @private
|
5214 | * return the state of the recognizer
|
5215 | * the actual recognizing happens in this method
|
5216 | * @virtual
|
5217 | * @param {Object} inputData
|
5218 | * @returns {constant} STATE
|
5219 | */
|
5220 |
|
5221 | /* jshint ignore:start */
|
5222 |
|
5223 |
|
5224 | _proto.process = function process(inputData) {};
|
5225 | /* jshint ignore:end */
|
5226 |
|
5227 | /**
|
5228 | * @private
|
5229 | * return the preferred touch-action
|
5230 | * @virtual
|
5231 | * @returns {Array}
|
5232 | */
|
5233 |
|
5234 |
|
5235 | _proto.getTouchAction = function getTouchAction() {};
|
5236 | /**
|
5237 | * @private
|
5238 | * called when the gesture isn't allowed to recognize
|
5239 | * like when another is being recognized or it is disabled
|
5240 | * @virtual
|
5241 | */
|
5242 |
|
5243 |
|
5244 | _proto.reset = function reset() {};
|
5245 |
|
5246 | return Recognizer;
|
5247 | }();
|
5248 |
|
5249 | /**
|
5250 | * @private
|
5251 | * A tap is recognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur
|
5252 | * between the given interval and position. The delay option can be used to recognize multi-taps without firing
|
5253 | * a single tap.
|
5254 | *
|
5255 | * The eventData from the emitted event contains the property `tapCount`, which contains the amount of
|
5256 | * multi-taps being recognized.
|
5257 | * @constructor
|
5258 | * @extends Recognizer
|
5259 | */
|
5260 |
|
5261 | var TapRecognizer =
|
5262 | /*#__PURE__*/
|
5263 | function (_Recognizer) {
|
5264 | _inheritsLoose(TapRecognizer, _Recognizer);
|
5265 |
|
5266 | function TapRecognizer(options) {
|
5267 | var _this;
|
5268 |
|
5269 | if (options === void 0) {
|
5270 | options = {};
|
5271 | }
|
5272 |
|
5273 | _this = _Recognizer.call(this, _extends({
|
5274 | event: 'tap',
|
5275 | pointers: 1,
|
5276 | taps: 1,
|
5277 | interval: 300,
|
5278 | // max time between the multi-tap taps
|
5279 | time: 250,
|
5280 | // max time of the pointer to be down (like finger on the screen)
|
5281 | threshold: 9,
|
5282 | // a minimal movement is ok, but keep it low
|
5283 | posThreshold: 10
|
5284 | }, options)) || this; // previous time and center,
|
5285 | // used for tap counting
|
5286 |
|
5287 | _this.pTime = false;
|
5288 | _this.pCenter = false;
|
5289 | _this._timer = null;
|
5290 | _this._input = null;
|
5291 | _this.count = 0;
|
5292 | return _this;
|
5293 | }
|
5294 |
|
5295 | var _proto = TapRecognizer.prototype;
|
5296 |
|
5297 | _proto.getTouchAction = function getTouchAction() {
|
5298 | return [TOUCH_ACTION_MANIPULATION];
|
5299 | };
|
5300 |
|
5301 | _proto.process = function process(input) {
|
5302 | var _this2 = this;
|
5303 |
|
5304 | var options = this.options;
|
5305 | var validPointers = input.pointers.length === options.pointers;
|
5306 | var validMovement = input.distance < options.threshold;
|
5307 | var validTouchTime = input.deltaTime < options.time;
|
5308 | this.reset();
|
5309 |
|
5310 | if (input.eventType & INPUT_START && this.count === 0) {
|
5311 | return this.failTimeout();
|
5312 | } // we only allow little movement
|
5313 | // and we've reached an end event, so a tap is possible
|
5314 |
|
5315 |
|
5316 | if (validMovement && validTouchTime && validPointers) {
|
5317 | if (input.eventType !== INPUT_END) {
|
5318 | return this.failTimeout();
|
5319 | }
|
5320 |
|
5321 | var validInterval = this.pTime ? input.timeStamp - this.pTime < options.interval : true;
|
5322 | var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
|
5323 | this.pTime = input.timeStamp;
|
5324 | this.pCenter = input.center;
|
5325 |
|
5326 | if (!validMultiTap || !validInterval) {
|
5327 | this.count = 1;
|
5328 | } else {
|
5329 | this.count += 1;
|
5330 | }
|
5331 |
|
5332 | this._input = input; // if tap count matches we have recognized it,
|
5333 | // else it has began recognizing...
|
5334 |
|
5335 | var tapCount = this.count % options.taps;
|
5336 |
|
5337 | if (tapCount === 0) {
|
5338 | // no failing requirements, immediately trigger the tap event
|
5339 | // or wait as long as the multitap interval to trigger
|
5340 | if (!this.hasRequireFailures()) {
|
5341 | return STATE_RECOGNIZED;
|
5342 | } else {
|
5343 | this._timer = setTimeout(function () {
|
5344 | _this2.state = STATE_RECOGNIZED;
|
5345 |
|
5346 | _this2.tryEmit();
|
5347 | }, options.interval);
|
5348 | return STATE_BEGAN;
|
5349 | }
|
5350 | }
|
5351 | }
|
5352 |
|
5353 | return STATE_FAILED;
|
5354 | };
|
5355 |
|
5356 | _proto.failTimeout = function failTimeout() {
|
5357 | var _this3 = this;
|
5358 |
|
5359 | this._timer = setTimeout(function () {
|
5360 | _this3.state = STATE_FAILED;
|
5361 | }, this.options.interval);
|
5362 | return STATE_FAILED;
|
5363 | };
|
5364 |
|
5365 | _proto.reset = function reset() {
|
5366 | clearTimeout(this._timer);
|
5367 | };
|
5368 |
|
5369 | _proto.emit = function emit() {
|
5370 | if (this.state === STATE_RECOGNIZED) {
|
5371 | this._input.tapCount = this.count;
|
5372 | this.manager.emit(this.options.event, this._input);
|
5373 | }
|
5374 | };
|
5375 |
|
5376 | return TapRecognizer;
|
5377 | }(Recognizer);
|
5378 |
|
5379 | /**
|
5380 | * @private
|
5381 | * This recognizer is just used as a base for the simple attribute recognizers.
|
5382 | * @constructor
|
5383 | * @extends Recognizer
|
5384 | */
|
5385 |
|
5386 | var AttrRecognizer =
|
5387 | /*#__PURE__*/
|
5388 | function (_Recognizer) {
|
5389 | _inheritsLoose(AttrRecognizer, _Recognizer);
|
5390 |
|
5391 | function AttrRecognizer(options) {
|
5392 | if (options === void 0) {
|
5393 | options = {};
|
5394 | }
|
5395 |
|
5396 | return _Recognizer.call(this, _extends({
|
5397 | pointers: 1
|
5398 | }, options)) || this;
|
5399 | }
|
5400 | /**
|
5401 | * @private
|
5402 | * Used to check if it the recognizer receives valid input, like input.distance > 10.
|
5403 | * @memberof AttrRecognizer
|
5404 | * @param {Object} input
|
5405 | * @returns {Boolean} recognized
|
5406 | */
|
5407 |
|
5408 |
|
5409 | var _proto = AttrRecognizer.prototype;
|
5410 |
|
5411 | _proto.attrTest = function attrTest(input) {
|
5412 | var optionPointers = this.options.pointers;
|
5413 | return optionPointers === 0 || input.pointers.length === optionPointers;
|
5414 | };
|
5415 | /**
|
5416 | * @private
|
5417 | * Process the input and return the state for the recognizer
|
5418 | * @memberof AttrRecognizer
|
5419 | * @param {Object} input
|
5420 | * @returns {*} State
|
5421 | */
|
5422 |
|
5423 |
|
5424 | _proto.process = function process(input) {
|
5425 | var state = this.state;
|
5426 | var eventType = input.eventType;
|
5427 | var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
|
5428 | var isValid = this.attrTest(input); // on cancel input and we've recognized before, return STATE_CANCELLED
|
5429 |
|
5430 | if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
|
5431 | return state | STATE_CANCELLED;
|
5432 | } else if (isRecognized || isValid) {
|
5433 | if (eventType & INPUT_END) {
|
5434 | return state | STATE_ENDED;
|
5435 | } else if (!(state & STATE_BEGAN)) {
|
5436 | return STATE_BEGAN;
|
5437 | }
|
5438 |
|
5439 | return state | STATE_CHANGED;
|
5440 | }
|
5441 |
|
5442 | return STATE_FAILED;
|
5443 | };
|
5444 |
|
5445 | return AttrRecognizer;
|
5446 | }(Recognizer);
|
5447 |
|
5448 | /**
|
5449 | * @private
|
5450 | * direction cons to string
|
5451 | * @param {constant} direction
|
5452 | * @returns {String}
|
5453 | */
|
5454 |
|
5455 | function directionStr(direction) {
|
5456 | if (direction === DIRECTION_DOWN) {
|
5457 | return 'down';
|
5458 | } else if (direction === DIRECTION_UP) {
|
5459 | return 'up';
|
5460 | } else if (direction === DIRECTION_LEFT) {
|
5461 | return 'left';
|
5462 | } else if (direction === DIRECTION_RIGHT) {
|
5463 | return 'right';
|
5464 | }
|
5465 |
|
5466 | return '';
|
5467 | }
|
5468 |
|
5469 | /**
|
5470 | * @private
|
5471 | * Pan
|
5472 | * Recognized when the pointer is down and moved in the allowed direction.
|
5473 | * @constructor
|
5474 | * @extends AttrRecognizer
|
5475 | */
|
5476 |
|
5477 | var PanRecognizer =
|
5478 | /*#__PURE__*/
|
5479 | function (_AttrRecognizer) {
|
5480 | _inheritsLoose(PanRecognizer, _AttrRecognizer);
|
5481 |
|
5482 | function PanRecognizer(options) {
|
5483 | var _this;
|
5484 |
|
5485 | if (options === void 0) {
|
5486 | options = {};
|
5487 | }
|
5488 |
|
5489 | _this = _AttrRecognizer.call(this, _extends({
|
5490 | event: 'pan',
|
5491 | threshold: 10,
|
5492 | pointers: 1,
|
5493 | direction: DIRECTION_ALL
|
5494 | }, options)) || this;
|
5495 | _this.pX = null;
|
5496 | _this.pY = null;
|
5497 | return _this;
|
5498 | }
|
5499 |
|
5500 | var _proto = PanRecognizer.prototype;
|
5501 |
|
5502 | _proto.getTouchAction = function getTouchAction() {
|
5503 | var direction = this.options.direction;
|
5504 | var actions = [];
|
5505 |
|
5506 | if (direction & DIRECTION_HORIZONTAL) {
|
5507 | actions.push(TOUCH_ACTION_PAN_Y);
|
5508 | }
|
5509 |
|
5510 | if (direction & DIRECTION_VERTICAL) {
|
5511 | actions.push(TOUCH_ACTION_PAN_X);
|
5512 | }
|
5513 |
|
5514 | return actions;
|
5515 | };
|
5516 |
|
5517 | _proto.directionTest = function directionTest(input) {
|
5518 | var options = this.options;
|
5519 | var hasMoved = true;
|
5520 | var distance = input.distance;
|
5521 | var direction = input.direction;
|
5522 | var x = input.deltaX;
|
5523 | var y = input.deltaY; // lock to axis?
|
5524 |
|
5525 | if (!(direction & options.direction)) {
|
5526 | if (options.direction & DIRECTION_HORIZONTAL) {
|
5527 | direction = x === 0 ? DIRECTION_NONE : x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
|
5528 | hasMoved = x !== this.pX;
|
5529 | distance = Math.abs(input.deltaX);
|
5530 | } else {
|
5531 | direction = y === 0 ? DIRECTION_NONE : y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
|
5532 | hasMoved = y !== this.pY;
|
5533 | distance = Math.abs(input.deltaY);
|
5534 | }
|
5535 | }
|
5536 |
|
5537 | input.direction = direction;
|
5538 | return hasMoved && distance > options.threshold && direction & options.direction;
|
5539 | };
|
5540 |
|
5541 | _proto.attrTest = function attrTest(input) {
|
5542 | return AttrRecognizer.prototype.attrTest.call(this, input) && ( // replace with a super call
|
5543 | this.state & STATE_BEGAN || !(this.state & STATE_BEGAN) && this.directionTest(input));
|
5544 | };
|
5545 |
|
5546 | _proto.emit = function emit(input) {
|
5547 | this.pX = input.deltaX;
|
5548 | this.pY = input.deltaY;
|
5549 | var direction = directionStr(input.direction);
|
5550 |
|
5551 | if (direction) {
|
5552 | input.additionalEvent = this.options.event + direction;
|
5553 | }
|
5554 |
|
5555 | _AttrRecognizer.prototype.emit.call(this, input);
|
5556 | };
|
5557 |
|
5558 | return PanRecognizer;
|
5559 | }(AttrRecognizer);
|
5560 |
|
5561 | /**
|
5562 | * @private
|
5563 | * Swipe
|
5564 | * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.
|
5565 | * @constructor
|
5566 | * @extends AttrRecognizer
|
5567 | */
|
5568 |
|
5569 | var SwipeRecognizer =
|
5570 | /*#__PURE__*/
|
5571 | function (_AttrRecognizer) {
|
5572 | _inheritsLoose(SwipeRecognizer, _AttrRecognizer);
|
5573 |
|
5574 | function SwipeRecognizer(options) {
|
5575 | if (options === void 0) {
|
5576 | options = {};
|
5577 | }
|
5578 |
|
5579 | return _AttrRecognizer.call(this, _extends({
|
5580 | event: 'swipe',
|
5581 | threshold: 10,
|
5582 | velocity: 0.3,
|
5583 | direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
|
5584 | pointers: 1
|
5585 | }, options)) || this;
|
5586 | }
|
5587 |
|
5588 | var _proto = SwipeRecognizer.prototype;
|
5589 |
|
5590 | _proto.getTouchAction = function getTouchAction() {
|
5591 | return PanRecognizer.prototype.getTouchAction.call(this);
|
5592 | };
|
5593 |
|
5594 | _proto.attrTest = function attrTest(input) {
|
5595 | var direction = this.options.direction;
|
5596 | var velocity;
|
5597 |
|
5598 | if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
|
5599 | velocity = input.overallVelocity;
|
5600 | } else if (direction & DIRECTION_HORIZONTAL) {
|
5601 | velocity = input.overallVelocityX;
|
5602 | } else if (direction & DIRECTION_VERTICAL) {
|
5603 | velocity = input.overallVelocityY;
|
5604 | }
|
5605 |
|
5606 | 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;
|
5607 | };
|
5608 |
|
5609 | _proto.emit = function emit(input) {
|
5610 | var direction = directionStr(input.offsetDirection);
|
5611 |
|
5612 | if (direction) {
|
5613 | this.manager.emit(this.options.event + direction, input);
|
5614 | }
|
5615 |
|
5616 | this.manager.emit(this.options.event, input);
|
5617 | };
|
5618 |
|
5619 | return SwipeRecognizer;
|
5620 | }(AttrRecognizer);
|
5621 |
|
5622 | /**
|
5623 | * @private
|
5624 | * Pinch
|
5625 | * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).
|
5626 | * @constructor
|
5627 | * @extends AttrRecognizer
|
5628 | */
|
5629 |
|
5630 | var PinchRecognizer =
|
5631 | /*#__PURE__*/
|
5632 | function (_AttrRecognizer) {
|
5633 | _inheritsLoose(PinchRecognizer, _AttrRecognizer);
|
5634 |
|
5635 | function PinchRecognizer(options) {
|
5636 | if (options === void 0) {
|
5637 | options = {};
|
5638 | }
|
5639 |
|
5640 | return _AttrRecognizer.call(this, _extends({
|
5641 | event: 'pinch',
|
5642 | threshold: 0,
|
5643 | pointers: 2
|
5644 | }, options)) || this;
|
5645 | }
|
5646 |
|
5647 | var _proto = PinchRecognizer.prototype;
|
5648 |
|
5649 | _proto.getTouchAction = function getTouchAction() {
|
5650 | return [TOUCH_ACTION_NONE];
|
5651 | };
|
5652 |
|
5653 | _proto.attrTest = function attrTest(input) {
|
5654 | return _AttrRecognizer.prototype.attrTest.call(this, input) && (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
|
5655 | };
|
5656 |
|
5657 | _proto.emit = function emit(input) {
|
5658 | if (input.scale !== 1) {
|
5659 | var inOut = input.scale < 1 ? 'in' : 'out';
|
5660 | input.additionalEvent = this.options.event + inOut;
|
5661 | }
|
5662 |
|
5663 | _AttrRecognizer.prototype.emit.call(this, input);
|
5664 | };
|
5665 |
|
5666 | return PinchRecognizer;
|
5667 | }(AttrRecognizer);
|
5668 |
|
5669 | /**
|
5670 | * @private
|
5671 | * Rotate
|
5672 | * Recognized when two or more pointer are moving in a circular motion.
|
5673 | * @constructor
|
5674 | * @extends AttrRecognizer
|
5675 | */
|
5676 |
|
5677 | var RotateRecognizer =
|
5678 | /*#__PURE__*/
|
5679 | function (_AttrRecognizer) {
|
5680 | _inheritsLoose(RotateRecognizer, _AttrRecognizer);
|
5681 |
|
5682 | function RotateRecognizer(options) {
|
5683 | if (options === void 0) {
|
5684 | options = {};
|
5685 | }
|
5686 |
|
5687 | return _AttrRecognizer.call(this, _extends({
|
5688 | event: 'rotate',
|
5689 | threshold: 0,
|
5690 | pointers: 2
|
5691 | }, options)) || this;
|
5692 | }
|
5693 |
|
5694 | var _proto = RotateRecognizer.prototype;
|
5695 |
|
5696 | _proto.getTouchAction = function getTouchAction() {
|
5697 | return [TOUCH_ACTION_NONE];
|
5698 | };
|
5699 |
|
5700 | _proto.attrTest = function attrTest(input) {
|
5701 | return _AttrRecognizer.prototype.attrTest.call(this, input) && (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
|
5702 | };
|
5703 |
|
5704 | return RotateRecognizer;
|
5705 | }(AttrRecognizer);
|
5706 |
|
5707 | /**
|
5708 | * @private
|
5709 | * Press
|
5710 | * Recognized when the pointer is down for x ms without any movement.
|
5711 | * @constructor
|
5712 | * @extends Recognizer
|
5713 | */
|
5714 |
|
5715 | var PressRecognizer =
|
5716 | /*#__PURE__*/
|
5717 | function (_Recognizer) {
|
5718 | _inheritsLoose(PressRecognizer, _Recognizer);
|
5719 |
|
5720 | function PressRecognizer(options) {
|
5721 | var _this;
|
5722 |
|
5723 | if (options === void 0) {
|
5724 | options = {};
|
5725 | }
|
5726 |
|
5727 | _this = _Recognizer.call(this, _extends({
|
5728 | event: 'press',
|
5729 | pointers: 1,
|
5730 | time: 251,
|
5731 | // minimal time of the pointer to be pressed
|
5732 | threshold: 9
|
5733 | }, options)) || this;
|
5734 | _this._timer = null;
|
5735 | _this._input = null;
|
5736 | return _this;
|
5737 | }
|
5738 |
|
5739 | var _proto = PressRecognizer.prototype;
|
5740 |
|
5741 | _proto.getTouchAction = function getTouchAction() {
|
5742 | return [TOUCH_ACTION_AUTO];
|
5743 | };
|
5744 |
|
5745 | _proto.process = function process(input) {
|
5746 | var _this2 = this;
|
5747 |
|
5748 | var options = this.options;
|
5749 | var validPointers = input.pointers.length === options.pointers;
|
5750 | var validMovement = input.distance < options.threshold;
|
5751 | var validTime = input.deltaTime > options.time;
|
5752 | this._input = input; // we only allow little movement
|
5753 | // and we've reached an end event, so a tap is possible
|
5754 |
|
5755 | if (!validMovement || !validPointers || input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime) {
|
5756 | this.reset();
|
5757 | } else if (input.eventType & INPUT_START) {
|
5758 | this.reset();
|
5759 | this._timer = setTimeout(function () {
|
5760 | _this2.state = STATE_RECOGNIZED;
|
5761 |
|
5762 | _this2.tryEmit();
|
5763 | }, options.time);
|
5764 | } else if (input.eventType & INPUT_END) {
|
5765 | return STATE_RECOGNIZED;
|
5766 | }
|
5767 |
|
5768 | return STATE_FAILED;
|
5769 | };
|
5770 |
|
5771 | _proto.reset = function reset() {
|
5772 | clearTimeout(this._timer);
|
5773 | };
|
5774 |
|
5775 | _proto.emit = function emit(input) {
|
5776 | if (this.state !== STATE_RECOGNIZED) {
|
5777 | return;
|
5778 | }
|
5779 |
|
5780 | if (input && input.eventType & INPUT_END) {
|
5781 | this.manager.emit(this.options.event + "up", input);
|
5782 | } else {
|
5783 | this._input.timeStamp = now();
|
5784 | this.manager.emit(this.options.event, this._input);
|
5785 | }
|
5786 | };
|
5787 |
|
5788 | return PressRecognizer;
|
5789 | }(Recognizer);
|
5790 |
|
5791 | var defaults = {
|
5792 | /**
|
5793 | * @private
|
5794 | * set if DOM events are being triggered.
|
5795 | * But this is slower and unused by simple implementations, so disabled by default.
|
5796 | * @type {Boolean}
|
5797 | * @default false
|
5798 | */
|
5799 | domEvents: false,
|
5800 |
|
5801 | /**
|
5802 | * @private
|
5803 | * The value for the touchAction property/fallback.
|
5804 | * When set to `compute` it will magically set the correct value based on the added recognizers.
|
5805 | * @type {String}
|
5806 | * @default compute
|
5807 | */
|
5808 | touchAction: TOUCH_ACTION_COMPUTE,
|
5809 |
|
5810 | /**
|
5811 | * @private
|
5812 | * @type {Boolean}
|
5813 | * @default true
|
5814 | */
|
5815 | enable: true,
|
5816 |
|
5817 | /**
|
5818 | * @private
|
5819 | * EXPERIMENTAL FEATURE -- can be removed/changed
|
5820 | * Change the parent input target element.
|
5821 | * If Null, then it is being set the to main element.
|
5822 | * @type {Null|EventTarget}
|
5823 | * @default null
|
5824 | */
|
5825 | inputTarget: null,
|
5826 |
|
5827 | /**
|
5828 | * @private
|
5829 | * force an input class
|
5830 | * @type {Null|Function}
|
5831 | * @default null
|
5832 | */
|
5833 | inputClass: null,
|
5834 |
|
5835 | /**
|
5836 | * @private
|
5837 | * Some CSS properties can be used to improve the working of Hammer.
|
5838 | * Add them to this method and they will be set when creating a new Manager.
|
5839 | * @namespace
|
5840 | */
|
5841 | cssProps: {
|
5842 | /**
|
5843 | * @private
|
5844 | * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.
|
5845 | * @type {String}
|
5846 | * @default 'none'
|
5847 | */
|
5848 | userSelect: "none",
|
5849 |
|
5850 | /**
|
5851 | * @private
|
5852 | * Disable the Windows Phone grippers when pressing an element.
|
5853 | * @type {String}
|
5854 | * @default 'none'
|
5855 | */
|
5856 | touchSelect: "none",
|
5857 |
|
5858 | /**
|
5859 | * @private
|
5860 | * Disables the default callout shown when you touch and hold a touch target.
|
5861 | * On iOS, when you touch and hold a touch target such as a link, Safari displays
|
5862 | * a callout containing information about the link. This property allows you to disable that callout.
|
5863 | * @type {String}
|
5864 | * @default 'none'
|
5865 | */
|
5866 | touchCallout: "none",
|
5867 |
|
5868 | /**
|
5869 | * @private
|
5870 | * Specifies whether zooming is enabled. Used by IE10>
|
5871 | * @type {String}
|
5872 | * @default 'none'
|
5873 | */
|
5874 | contentZooming: "none",
|
5875 |
|
5876 | /**
|
5877 | * @private
|
5878 | * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.
|
5879 | * @type {String}
|
5880 | * @default 'none'
|
5881 | */
|
5882 | userDrag: "none",
|
5883 |
|
5884 | /**
|
5885 | * @private
|
5886 | * Overrides the highlight color shown when the user taps a link or a JavaScript
|
5887 | * clickable element in iOS. This property obeys the alpha value, if specified.
|
5888 | * @type {String}
|
5889 | * @default 'rgba(0,0,0,0)'
|
5890 | */
|
5891 | tapHighlightColor: "rgba(0,0,0,0)"
|
5892 | }
|
5893 | };
|
5894 | /**
|
5895 | * @private
|
5896 | * Default recognizer setup when calling `Hammer()`
|
5897 | * When creating a new Manager these will be skipped.
|
5898 | * This is separated with other defaults because of tree-shaking.
|
5899 | * @type {Array}
|
5900 | */
|
5901 |
|
5902 | var preset = [[RotateRecognizer, {
|
5903 | enable: false
|
5904 | }], [PinchRecognizer, {
|
5905 | enable: false
|
5906 | }, ['rotate']], [SwipeRecognizer, {
|
5907 | direction: DIRECTION_HORIZONTAL
|
5908 | }], [PanRecognizer, {
|
5909 | direction: DIRECTION_HORIZONTAL
|
5910 | }, ['swipe']], [TapRecognizer], [TapRecognizer, {
|
5911 | event: 'doubletap',
|
5912 | taps: 2
|
5913 | }, ['tap']], [PressRecognizer]];
|
5914 |
|
5915 | var STOP = 1;
|
5916 | var FORCED_STOP = 2;
|
5917 | /**
|
5918 | * @private
|
5919 | * add/remove the css properties as defined in manager.options.cssProps
|
5920 | * @param {Manager} manager
|
5921 | * @param {Boolean} add
|
5922 | */
|
5923 |
|
5924 | function toggleCssProps(manager, add) {
|
5925 | var element = manager.element;
|
5926 |
|
5927 | if (!element.style) {
|
5928 | return;
|
5929 | }
|
5930 |
|
5931 | var prop;
|
5932 | each(manager.options.cssProps, function (value, name) {
|
5933 | prop = prefixed(element.style, name);
|
5934 |
|
5935 | if (add) {
|
5936 | manager.oldCssProps[prop] = element.style[prop];
|
5937 | element.style[prop] = value;
|
5938 | } else {
|
5939 | element.style[prop] = manager.oldCssProps[prop] || "";
|
5940 | }
|
5941 | });
|
5942 |
|
5943 | if (!add) {
|
5944 | manager.oldCssProps = {};
|
5945 | }
|
5946 | }
|
5947 | /**
|
5948 | * @private
|
5949 | * trigger dom event
|
5950 | * @param {String} event
|
5951 | * @param {Object} data
|
5952 | */
|
5953 |
|
5954 |
|
5955 | function triggerDomEvent(event, data) {
|
5956 | var gestureEvent = document.createEvent("Event");
|
5957 | gestureEvent.initEvent(event, true, true);
|
5958 | gestureEvent.gesture = data;
|
5959 | data.target.dispatchEvent(gestureEvent);
|
5960 | }
|
5961 | /**
|
5962 | * @private
|
5963 | * Manager
|
5964 | * @param {HTMLElement} element
|
5965 | * @param {Object} [options]
|
5966 | * @constructor
|
5967 | */
|
5968 |
|
5969 |
|
5970 | var Manager =
|
5971 | /*#__PURE__*/
|
5972 | function () {
|
5973 | function Manager(element, options) {
|
5974 | var _this = this;
|
5975 |
|
5976 | this.options = assign$1$1({}, defaults, options || {});
|
5977 | this.options.inputTarget = this.options.inputTarget || element;
|
5978 | this.handlers = {};
|
5979 | this.session = {};
|
5980 | this.recognizers = [];
|
5981 | this.oldCssProps = {};
|
5982 | this.element = element;
|
5983 | this.input = createInputInstance(this);
|
5984 | this.touchAction = new TouchAction(this, this.options.touchAction);
|
5985 | toggleCssProps(this, true);
|
5986 | each(this.options.recognizers, function (item) {
|
5987 | var recognizer = _this.add(new item[0](item[1]));
|
5988 |
|
5989 | item[2] && recognizer.recognizeWith(item[2]);
|
5990 | item[3] && recognizer.requireFailure(item[3]);
|
5991 | }, this);
|
5992 | }
|
5993 | /**
|
5994 | * @private
|
5995 | * set options
|
5996 | * @param {Object} options
|
5997 | * @returns {Manager}
|
5998 | */
|
5999 |
|
6000 |
|
6001 | var _proto = Manager.prototype;
|
6002 |
|
6003 | _proto.set = function set(options) {
|
6004 | assign$1$1(this.options, options); // Options that need a little more setup
|
6005 |
|
6006 | if (options.touchAction) {
|
6007 | this.touchAction.update();
|
6008 | }
|
6009 |
|
6010 | if (options.inputTarget) {
|
6011 | // Clean up existing event listeners and reinitialize
|
6012 | this.input.destroy();
|
6013 | this.input.target = options.inputTarget;
|
6014 | this.input.init();
|
6015 | }
|
6016 |
|
6017 | return this;
|
6018 | };
|
6019 | /**
|
6020 | * @private
|
6021 | * stop recognizing for this session.
|
6022 | * This session will be discarded, when a new [input]start event is fired.
|
6023 | * When forced, the recognizer cycle is stopped immediately.
|
6024 | * @param {Boolean} [force]
|
6025 | */
|
6026 |
|
6027 |
|
6028 | _proto.stop = function stop(force) {
|
6029 | this.session.stopped = force ? FORCED_STOP : STOP;
|
6030 | };
|
6031 | /**
|
6032 | * @private
|
6033 | * run the recognizers!
|
6034 | * called by the inputHandler function on every movement of the pointers (touches)
|
6035 | * it walks through all the recognizers and tries to detect the gesture that is being made
|
6036 | * @param {Object} inputData
|
6037 | */
|
6038 |
|
6039 |
|
6040 | _proto.recognize = function recognize(inputData) {
|
6041 | var session = this.session;
|
6042 |
|
6043 | if (session.stopped) {
|
6044 | return;
|
6045 | } // run the touch-action polyfill
|
6046 |
|
6047 |
|
6048 | this.touchAction.preventDefaults(inputData);
|
6049 | var recognizer;
|
6050 | var recognizers = this.recognizers; // this holds the recognizer that is being recognized.
|
6051 | // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED
|
6052 | // if no recognizer is detecting a thing, it is set to `null`
|
6053 |
|
6054 | var curRecognizer = session.curRecognizer; // reset when the last recognizer is recognized
|
6055 | // or when we're in a new session
|
6056 |
|
6057 | if (!curRecognizer || curRecognizer && curRecognizer.state & STATE_RECOGNIZED) {
|
6058 | session.curRecognizer = null;
|
6059 | curRecognizer = null;
|
6060 | }
|
6061 |
|
6062 | var i = 0;
|
6063 |
|
6064 | while (i < recognizers.length) {
|
6065 | recognizer = recognizers[i]; // find out if we are allowed try to recognize the input for this one.
|
6066 | // 1. allow if the session is NOT forced stopped (see the .stop() method)
|
6067 | // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one
|
6068 | // that is being recognized.
|
6069 | // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.
|
6070 | // this can be setup with the `recognizeWith()` method on the recognizer.
|
6071 |
|
6072 | if (session.stopped !== FORCED_STOP && ( // 1
|
6073 | !curRecognizer || recognizer === curRecognizer || // 2
|
6074 | recognizer.canRecognizeWith(curRecognizer))) {
|
6075 | // 3
|
6076 | recognizer.recognize(inputData);
|
6077 | } else {
|
6078 | recognizer.reset();
|
6079 | } // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the
|
6080 | // current active recognizer. but only if we don't already have an active recognizer
|
6081 |
|
6082 |
|
6083 | if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
|
6084 | session.curRecognizer = recognizer;
|
6085 | curRecognizer = recognizer;
|
6086 | }
|
6087 |
|
6088 | i++;
|
6089 | }
|
6090 | };
|
6091 | /**
|
6092 | * @private
|
6093 | * get a recognizer by its event name.
|
6094 | * @param {Recognizer|String} recognizer
|
6095 | * @returns {Recognizer|Null}
|
6096 | */
|
6097 |
|
6098 |
|
6099 | _proto.get = function get(recognizer) {
|
6100 | if (recognizer instanceof Recognizer) {
|
6101 | return recognizer;
|
6102 | }
|
6103 |
|
6104 | var recognizers = this.recognizers;
|
6105 |
|
6106 | for (var i = 0; i < recognizers.length; i++) {
|
6107 | if (recognizers[i].options.event === recognizer) {
|
6108 | return recognizers[i];
|
6109 | }
|
6110 | }
|
6111 |
|
6112 | return null;
|
6113 | };
|
6114 | /**
|
6115 | * @private add a recognizer to the manager
|
6116 | * existing recognizers with the same event name will be removed
|
6117 | * @param {Recognizer} recognizer
|
6118 | * @returns {Recognizer|Manager}
|
6119 | */
|
6120 |
|
6121 |
|
6122 | _proto.add = function add(recognizer) {
|
6123 | if (invokeArrayArg(recognizer, "add", this)) {
|
6124 | return this;
|
6125 | } // remove existing
|
6126 |
|
6127 |
|
6128 | var existing = this.get(recognizer.options.event);
|
6129 |
|
6130 | if (existing) {
|
6131 | this.remove(existing);
|
6132 | }
|
6133 |
|
6134 | this.recognizers.push(recognizer);
|
6135 | recognizer.manager = this;
|
6136 | this.touchAction.update();
|
6137 | return recognizer;
|
6138 | };
|
6139 | /**
|
6140 | * @private
|
6141 | * remove a recognizer by name or instance
|
6142 | * @param {Recognizer|String} recognizer
|
6143 | * @returns {Manager}
|
6144 | */
|
6145 |
|
6146 |
|
6147 | _proto.remove = function remove(recognizer) {
|
6148 | if (invokeArrayArg(recognizer, "remove", this)) {
|
6149 | return this;
|
6150 | }
|
6151 |
|
6152 | var targetRecognizer = this.get(recognizer); // let's make sure this recognizer exists
|
6153 |
|
6154 | if (recognizer) {
|
6155 | var recognizers = this.recognizers;
|
6156 | var index = inArray(recognizers, targetRecognizer);
|
6157 |
|
6158 | if (index !== -1) {
|
6159 | recognizers.splice(index, 1);
|
6160 | this.touchAction.update();
|
6161 | }
|
6162 | }
|
6163 |
|
6164 | return this;
|
6165 | };
|
6166 | /**
|
6167 | * @private
|
6168 | * bind event
|
6169 | * @param {String} events
|
6170 | * @param {Function} handler
|
6171 | * @returns {EventEmitter} this
|
6172 | */
|
6173 |
|
6174 |
|
6175 | _proto.on = function on(events, handler) {
|
6176 | if (events === undefined || handler === undefined) {
|
6177 | return this;
|
6178 | }
|
6179 |
|
6180 | var handlers = this.handlers;
|
6181 | each(splitStr(events), function (event) {
|
6182 | handlers[event] = handlers[event] || [];
|
6183 | handlers[event].push(handler);
|
6184 | });
|
6185 | return this;
|
6186 | };
|
6187 | /**
|
6188 | * @private unbind event, leave emit blank to remove all handlers
|
6189 | * @param {String} events
|
6190 | * @param {Function} [handler]
|
6191 | * @returns {EventEmitter} this
|
6192 | */
|
6193 |
|
6194 |
|
6195 | _proto.off = function off(events, handler) {
|
6196 | if (events === undefined) {
|
6197 | return this;
|
6198 | }
|
6199 |
|
6200 | var handlers = this.handlers;
|
6201 | each(splitStr(events), function (event) {
|
6202 | if (!handler) {
|
6203 | delete handlers[event];
|
6204 | } else {
|
6205 | handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);
|
6206 | }
|
6207 | });
|
6208 | return this;
|
6209 | };
|
6210 | /**
|
6211 | * @private emit event to the listeners
|
6212 | * @param {String} event
|
6213 | * @param {Object} data
|
6214 | */
|
6215 |
|
6216 |
|
6217 | _proto.emit = function emit(event, data) {
|
6218 | // we also want to trigger dom events
|
6219 | if (this.options.domEvents) {
|
6220 | triggerDomEvent(event, data);
|
6221 | } // no handlers, so skip it all
|
6222 |
|
6223 |
|
6224 | var handlers = this.handlers[event] && this.handlers[event].slice();
|
6225 |
|
6226 | if (!handlers || !handlers.length) {
|
6227 | return;
|
6228 | }
|
6229 |
|
6230 | data.type = event;
|
6231 |
|
6232 | data.preventDefault = function () {
|
6233 | data.srcEvent.preventDefault();
|
6234 | };
|
6235 |
|
6236 | var i = 0;
|
6237 |
|
6238 | while (i < handlers.length) {
|
6239 | handlers[i](data);
|
6240 | i++;
|
6241 | }
|
6242 | };
|
6243 | /**
|
6244 | * @private
|
6245 | * destroy the manager and unbinds all events
|
6246 | * it doesn't unbind dom events, that is the user own responsibility
|
6247 | */
|
6248 |
|
6249 |
|
6250 | _proto.destroy = function destroy() {
|
6251 | this.element && toggleCssProps(this, false);
|
6252 | this.handlers = {};
|
6253 | this.session = {};
|
6254 | this.input.destroy();
|
6255 | this.element = null;
|
6256 | };
|
6257 |
|
6258 | return Manager;
|
6259 | }();
|
6260 |
|
6261 | var SINGLE_TOUCH_INPUT_MAP = {
|
6262 | touchstart: INPUT_START,
|
6263 | touchmove: INPUT_MOVE,
|
6264 | touchend: INPUT_END,
|
6265 | touchcancel: INPUT_CANCEL
|
6266 | };
|
6267 | var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
|
6268 | var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
|
6269 | /**
|
6270 | * @private
|
6271 | * Touch events input
|
6272 | * @constructor
|
6273 | * @extends Input
|
6274 | */
|
6275 |
|
6276 | var SingleTouchInput =
|
6277 | /*#__PURE__*/
|
6278 | function (_Input) {
|
6279 | _inheritsLoose(SingleTouchInput, _Input);
|
6280 |
|
6281 | function SingleTouchInput() {
|
6282 | var _this;
|
6283 |
|
6284 | var proto = SingleTouchInput.prototype;
|
6285 | proto.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
|
6286 | proto.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
|
6287 | _this = _Input.apply(this, arguments) || this;
|
6288 | _this.started = false;
|
6289 | return _this;
|
6290 | }
|
6291 |
|
6292 | var _proto = SingleTouchInput.prototype;
|
6293 |
|
6294 | _proto.handler = function handler(ev) {
|
6295 | var type = SINGLE_TOUCH_INPUT_MAP[ev.type]; // should we handle the touch events?
|
6296 |
|
6297 | if (type === INPUT_START) {
|
6298 | this.started = true;
|
6299 | }
|
6300 |
|
6301 | if (!this.started) {
|
6302 | return;
|
6303 | }
|
6304 |
|
6305 | var touches = normalizeSingleTouches.call(this, ev, type); // when done, reset the started state
|
6306 |
|
6307 | if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
|
6308 | this.started = false;
|
6309 | }
|
6310 |
|
6311 | this.callback(this.manager, type, {
|
6312 | pointers: touches[0],
|
6313 | changedPointers: touches[1],
|
6314 | pointerType: INPUT_TYPE_TOUCH,
|
6315 | srcEvent: ev
|
6316 | });
|
6317 | };
|
6318 |
|
6319 | return SingleTouchInput;
|
6320 | }(Input);
|
6321 |
|
6322 | function normalizeSingleTouches(ev, type) {
|
6323 | var all = toArray(ev.touches);
|
6324 | var changed = toArray(ev.changedTouches);
|
6325 |
|
6326 | if (type & (INPUT_END | INPUT_CANCEL)) {
|
6327 | all = uniqueArray(all.concat(changed), 'identifier', true);
|
6328 | }
|
6329 |
|
6330 | return [all, changed];
|
6331 | }
|
6332 |
|
6333 | /**
|
6334 | * @private
|
6335 | * wrap a method with a deprecation warning and stack trace
|
6336 | * @param {Function} method
|
6337 | * @param {String} name
|
6338 | * @param {String} message
|
6339 | * @returns {Function} A new function wrapping the supplied method.
|
6340 | */
|
6341 | function deprecate(method, name, message) {
|
6342 | var deprecationMessage = "DEPRECATED METHOD: " + name + "\n" + message + " AT \n";
|
6343 | return function () {
|
6344 | var e = new Error('get-stack-trace');
|
6345 | var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, '').replace(/^\s+at\s+/gm, '').replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';
|
6346 | var log = window.console && (window.console.warn || window.console.log);
|
6347 |
|
6348 | if (log) {
|
6349 | log.call(window.console, deprecationMessage, stack);
|
6350 | }
|
6351 |
|
6352 | return method.apply(this, arguments);
|
6353 | };
|
6354 | }
|
6355 |
|
6356 | /**
|
6357 | * @private
|
6358 | * extend object.
|
6359 | * means that properties in dest will be overwritten by the ones in src.
|
6360 | * @param {Object} dest
|
6361 | * @param {Object} src
|
6362 | * @param {Boolean} [merge=false]
|
6363 | * @returns {Object} dest
|
6364 | */
|
6365 |
|
6366 | var extend = deprecate(function (dest, src, merge) {
|
6367 | var keys = Object.keys(src);
|
6368 | var i = 0;
|
6369 |
|
6370 | while (i < keys.length) {
|
6371 | if (!merge || merge && dest[keys[i]] === undefined) {
|
6372 | dest[keys[i]] = src[keys[i]];
|
6373 | }
|
6374 |
|
6375 | i++;
|
6376 | }
|
6377 |
|
6378 | return dest;
|
6379 | }, 'extend', 'Use `assign`.');
|
6380 |
|
6381 | /**
|
6382 | * @private
|
6383 | * merge the values from src in the dest.
|
6384 | * means that properties that exist in dest will not be overwritten by src
|
6385 | * @param {Object} dest
|
6386 | * @param {Object} src
|
6387 | * @returns {Object} dest
|
6388 | */
|
6389 |
|
6390 | var merge$1 = deprecate(function (dest, src) {
|
6391 | return extend(dest, src, true);
|
6392 | }, 'merge', 'Use `assign`.');
|
6393 |
|
6394 | /**
|
6395 | * @private
|
6396 | * simple class inheritance
|
6397 | * @param {Function} child
|
6398 | * @param {Function} base
|
6399 | * @param {Object} [properties]
|
6400 | */
|
6401 |
|
6402 | function inherit(child, base, properties) {
|
6403 | var baseP = base.prototype;
|
6404 | var childP;
|
6405 | childP = child.prototype = Object.create(baseP);
|
6406 | childP.constructor = child;
|
6407 | childP._super = baseP;
|
6408 |
|
6409 | if (properties) {
|
6410 | assign$1$1(childP, properties);
|
6411 | }
|
6412 | }
|
6413 |
|
6414 | /**
|
6415 | * @private
|
6416 | * simple function bind
|
6417 | * @param {Function} fn
|
6418 | * @param {Object} context
|
6419 | * @returns {Function}
|
6420 | */
|
6421 | function bindFn(fn, context) {
|
6422 | return function boundFn() {
|
6423 | return fn.apply(context, arguments);
|
6424 | };
|
6425 | }
|
6426 |
|
6427 | /**
|
6428 | * @private
|
6429 | * Simple way to create a manager with a default set of recognizers.
|
6430 | * @param {HTMLElement} element
|
6431 | * @param {Object} [options]
|
6432 | * @constructor
|
6433 | */
|
6434 |
|
6435 | var Hammer =
|
6436 | /*#__PURE__*/
|
6437 | function () {
|
6438 | var Hammer =
|
6439 | /**
|
6440 | * @private
|
6441 | * @const {string}
|
6442 | */
|
6443 | function Hammer(element, options) {
|
6444 | if (options === void 0) {
|
6445 | options = {};
|
6446 | }
|
6447 |
|
6448 | return new Manager(element, _extends({
|
6449 | recognizers: preset.concat()
|
6450 | }, options));
|
6451 | };
|
6452 |
|
6453 | Hammer.VERSION = "2.0.17-rc";
|
6454 | Hammer.DIRECTION_ALL = DIRECTION_ALL;
|
6455 | Hammer.DIRECTION_DOWN = DIRECTION_DOWN;
|
6456 | Hammer.DIRECTION_LEFT = DIRECTION_LEFT;
|
6457 | Hammer.DIRECTION_RIGHT = DIRECTION_RIGHT;
|
6458 | Hammer.DIRECTION_UP = DIRECTION_UP;
|
6459 | Hammer.DIRECTION_HORIZONTAL = DIRECTION_HORIZONTAL;
|
6460 | Hammer.DIRECTION_VERTICAL = DIRECTION_VERTICAL;
|
6461 | Hammer.DIRECTION_NONE = DIRECTION_NONE;
|
6462 | Hammer.DIRECTION_DOWN = DIRECTION_DOWN;
|
6463 | Hammer.INPUT_START = INPUT_START;
|
6464 | Hammer.INPUT_MOVE = INPUT_MOVE;
|
6465 | Hammer.INPUT_END = INPUT_END;
|
6466 | Hammer.INPUT_CANCEL = INPUT_CANCEL;
|
6467 | Hammer.STATE_POSSIBLE = STATE_POSSIBLE;
|
6468 | Hammer.STATE_BEGAN = STATE_BEGAN;
|
6469 | Hammer.STATE_CHANGED = STATE_CHANGED;
|
6470 | Hammer.STATE_ENDED = STATE_ENDED;
|
6471 | Hammer.STATE_RECOGNIZED = STATE_RECOGNIZED;
|
6472 | Hammer.STATE_CANCELLED = STATE_CANCELLED;
|
6473 | Hammer.STATE_FAILED = STATE_FAILED;
|
6474 | Hammer.Manager = Manager;
|
6475 | Hammer.Input = Input;
|
6476 | Hammer.TouchAction = TouchAction;
|
6477 | Hammer.TouchInput = TouchInput;
|
6478 | Hammer.MouseInput = MouseInput;
|
6479 | Hammer.PointerEventInput = PointerEventInput;
|
6480 | Hammer.TouchMouseInput = TouchMouseInput;
|
6481 | Hammer.SingleTouchInput = SingleTouchInput;
|
6482 | Hammer.Recognizer = Recognizer;
|
6483 | Hammer.AttrRecognizer = AttrRecognizer;
|
6484 | Hammer.Tap = TapRecognizer;
|
6485 | Hammer.Pan = PanRecognizer;
|
6486 | Hammer.Swipe = SwipeRecognizer;
|
6487 | Hammer.Pinch = PinchRecognizer;
|
6488 | Hammer.Rotate = RotateRecognizer;
|
6489 | Hammer.Press = PressRecognizer;
|
6490 | Hammer.on = addEventListeners;
|
6491 | Hammer.off = removeEventListeners;
|
6492 | Hammer.each = each;
|
6493 | Hammer.merge = merge$1;
|
6494 | Hammer.extend = extend;
|
6495 | Hammer.bindFn = bindFn;
|
6496 | Hammer.assign = assign$1$1;
|
6497 | Hammer.inherit = inherit;
|
6498 | Hammer.bindFn = bindFn;
|
6499 | Hammer.prefixed = prefixed;
|
6500 | Hammer.toArray = toArray;
|
6501 | Hammer.inArray = inArray;
|
6502 | Hammer.uniqueArray = uniqueArray;
|
6503 | Hammer.splitStr = splitStr;
|
6504 | Hammer.boolOrFn = boolOrFn;
|
6505 | Hammer.hasParent = hasParent;
|
6506 | Hammer.addEventListeners = addEventListeners;
|
6507 | Hammer.removeEventListeners = removeEventListeners;
|
6508 | Hammer.defaults = assign$1$1({}, defaults, {
|
6509 | preset: preset
|
6510 | });
|
6511 | return Hammer;
|
6512 | }();
|
6513 |
|
6514 | var RealHammer = Hammer;
|
6515 |
|
6516 | /**
|
6517 | * vis-util
|
6518 | * https://github.com/visjs/vis-util
|
6519 | *
|
6520 | * utilitie collection for visjs
|
6521 | *
|
6522 | * @version 5.0.7
|
6523 | * @date 2023-11-20T09:06:51.067Z
|
6524 | *
|
6525 | * @copyright (c) 2011-2017 Almende B.V, http://almende.com
|
6526 | * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
|
6527 | *
|
6528 | * @license
|
6529 | * vis.js is dual licensed under both
|
6530 | *
|
6531 | * 1. The Apache 2.0 License
|
6532 | * http://www.apache.org/licenses/LICENSE-2.0
|
6533 | *
|
6534 | * and
|
6535 | *
|
6536 | * 2. The MIT License
|
6537 | * http://opensource.org/licenses/MIT
|
6538 | *
|
6539 | * vis.js may be distributed under either license.
|
6540 | */
|
6541 |
|
6542 |
|
6543 | /**
|
6544 | * Use this symbol to delete properies in deepObjectAssign.
|
6545 | */
|
6546 | const DELETE = Symbol("DELETE");
|
6547 | /**
|
6548 | * Pure version of deepObjectAssign, it doesn't modify any of it's arguments.
|
6549 | *
|
6550 | * @param base - The base object that fullfils the whole interface T.
|
6551 | * @param updates - Updates that may change or delete props.
|
6552 | * @returns A brand new instance with all the supplied objects deeply merged.
|
6553 | */
|
6554 | function pureDeepObjectAssign(base, ...updates) {
|
6555 | return deepObjectAssign({}, base, ...updates);
|
6556 | }
|
6557 | /**
|
6558 | * Deep version of object assign with additional deleting by the DELETE symbol.
|
6559 | *
|
6560 | * @param values - Objects to be deeply merged.
|
6561 | * @returns The first object from values.
|
6562 | */
|
6563 | function deepObjectAssign(...values) {
|
6564 | const merged = deepObjectAssignNonentry(...values);
|
6565 | stripDelete(merged);
|
6566 | return merged;
|
6567 | }
|
6568 | /**
|
6569 | * Deep version of object assign with additional deleting by the DELETE symbol.
|
6570 | *
|
6571 | * @remarks
|
6572 | * This doesn't strip the DELETE symbols so they may end up in the final object.
|
6573 | * @param values - Objects to be deeply merged.
|
6574 | * @returns The first object from values.
|
6575 | */
|
6576 | function deepObjectAssignNonentry(...values) {
|
6577 | if (values.length < 2) {
|
6578 | return values[0];
|
6579 | }
|
6580 | else if (values.length > 2) {
|
6581 | return deepObjectAssignNonentry(deepObjectAssign(values[0], values[1]), ...values.slice(2));
|
6582 | }
|
6583 | const a = values[0];
|
6584 | const b = values[1];
|
6585 | if (a instanceof Date && b instanceof Date) {
|
6586 | a.setTime(b.getTime());
|
6587 | return a;
|
6588 | }
|
6589 | for (const prop of Reflect.ownKeys(b)) {
|
6590 | if (!Object.prototype.propertyIsEnumerable.call(b, prop)) ;
|
6591 | else if (b[prop] === DELETE) {
|
6592 | delete a[prop];
|
6593 | }
|
6594 | else if (a[prop] !== null &&
|
6595 | b[prop] !== null &&
|
6596 | typeof a[prop] === "object" &&
|
6597 | typeof b[prop] === "object" &&
|
6598 | !Array.isArray(a[prop]) &&
|
6599 | !Array.isArray(b[prop])) {
|
6600 | a[prop] = deepObjectAssignNonentry(a[prop], b[prop]);
|
6601 | }
|
6602 | else {
|
6603 | a[prop] = clone(b[prop]);
|
6604 | }
|
6605 | }
|
6606 | return a;
|
6607 | }
|
6608 | /**
|
6609 | * Deep clone given object or array. In case of primitive simply return.
|
6610 | *
|
6611 | * @param a - Anything.
|
6612 | * @returns Deep cloned object/array or unchanged a.
|
6613 | */
|
6614 | function clone(a) {
|
6615 | if (Array.isArray(a)) {
|
6616 | return a.map((value) => clone(value));
|
6617 | }
|
6618 | else if (typeof a === "object" && a !== null) {
|
6619 | if (a instanceof Date) {
|
6620 | return new Date(a.getTime());
|
6621 | }
|
6622 | return deepObjectAssignNonentry({}, a);
|
6623 | }
|
6624 | else {
|
6625 | return a;
|
6626 | }
|
6627 | }
|
6628 | /**
|
6629 | * Strip DELETE from given object.
|
6630 | *
|
6631 | * @param a - Object which may contain DELETE but won't after this is executed.
|
6632 | */
|
6633 | function stripDelete(a) {
|
6634 | for (const prop of Object.keys(a)) {
|
6635 | if (a[prop] === DELETE) {
|
6636 | delete a[prop];
|
6637 | }
|
6638 | else if (typeof a[prop] === "object" && a[prop] !== null) {
|
6639 | stripDelete(a[prop]);
|
6640 | }
|
6641 | }
|
6642 | }
|
6643 |
|
6644 | /**
|
6645 | * Setup a mock hammer.js object, for unit testing.
|
6646 | *
|
6647 | * Inspiration: https://github.com/uber/deck.gl/pull/658
|
6648 | *
|
6649 | * @returns {{on: noop, off: noop, destroy: noop, emit: noop, get: get}}
|
6650 | */
|
6651 | function hammerMock() {
|
6652 | const noop = () => {};
|
6653 |
|
6654 | return {
|
6655 | on: noop,
|
6656 | off: noop,
|
6657 | destroy: noop,
|
6658 | emit: noop,
|
6659 |
|
6660 | get() {
|
6661 | return {
|
6662 | set: noop,
|
6663 | };
|
6664 | },
|
6665 | };
|
6666 | }
|
6667 |
|
6668 | const Hammer$1 =
|
6669 | typeof window !== "undefined"
|
6670 | ? window.Hammer || RealHammer
|
6671 | : function () {
|
6672 | // hammer.js is only available in a browser, not in node.js. Replacing it with a mock object.
|
6673 | return hammerMock();
|
6674 | };
|
6675 |
|
6676 | /**
|
6677 | * Turn an element into an clickToUse element.
|
6678 | * When not active, the element has a transparent overlay. When the overlay is
|
6679 | * clicked, the mode is changed to active.
|
6680 | * When active, the element is displayed with a blue border around it, and
|
6681 | * the interactive contents of the element can be used. When clicked outside
|
6682 | * the element, the elements mode is changed to inactive.
|
6683 | *
|
6684 | * @param {Element} container
|
6685 | * @class Activator
|
6686 | */
|
6687 | function Activator$1(container) {
|
6688 | this._cleanupQueue = [];
|
6689 |
|
6690 | this.active = false;
|
6691 |
|
6692 | this._dom = {
|
6693 | container,
|
6694 | overlay: document.createElement("div"),
|
6695 | };
|
6696 |
|
6697 | this._dom.overlay.classList.add("vis-overlay");
|
6698 |
|
6699 | this._dom.container.appendChild(this._dom.overlay);
|
6700 | this._cleanupQueue.push(() => {
|
6701 | this._dom.overlay.parentNode.removeChild(this._dom.overlay);
|
6702 | });
|
6703 |
|
6704 | const hammer = Hammer$1(this._dom.overlay);
|
6705 | hammer.on("tap", this._onTapOverlay.bind(this));
|
6706 | this._cleanupQueue.push(() => {
|
6707 | hammer.destroy();
|
6708 | // FIXME: cleaning up hammer instances doesn't work (Timeline not removed
|
6709 | // from memory)
|
6710 | });
|
6711 |
|
6712 | // block all touch events (except tap)
|
6713 | const events = [
|
6714 | "tap",
|
6715 | "doubletap",
|
6716 | "press",
|
6717 | "pinch",
|
6718 | "pan",
|
6719 | "panstart",
|
6720 | "panmove",
|
6721 | "panend",
|
6722 | ];
|
6723 | events.forEach((event) => {
|
6724 | hammer.on(event, (event) => {
|
6725 | event.srcEvent.stopPropagation();
|
6726 | });
|
6727 | });
|
6728 |
|
6729 | // attach a click event to the window, in order to deactivate when clicking outside the timeline
|
6730 | if (document && document.body) {
|
6731 | this._onClick = (event) => {
|
6732 | if (!_hasParent(event.target, container)) {
|
6733 | this.deactivate();
|
6734 | }
|
6735 | };
|
6736 | document.body.addEventListener("click", this._onClick);
|
6737 | this._cleanupQueue.push(() => {
|
6738 | document.body.removeEventListener("click", this._onClick);
|
6739 | });
|
6740 | }
|
6741 |
|
6742 | // prepare escape key listener for deactivating when active
|
6743 | this._escListener = (event) => {
|
6744 | if (
|
6745 | "key" in event
|
6746 | ? event.key === "Escape"
|
6747 | : event.keyCode === 27 /* the keyCode is for IE11 */
|
6748 | ) {
|
6749 | this.deactivate();
|
6750 | }
|
6751 | };
|
6752 | }
|
6753 |
|
6754 | // turn into an event emitter
|
6755 | Emitter(Activator$1.prototype);
|
6756 |
|
6757 | // The currently active activator
|
6758 | Activator$1.current = null;
|
6759 |
|
6760 | /**
|
6761 | * Destroy the activator. Cleans up all created DOM and event listeners
|
6762 | */
|
6763 | Activator$1.prototype.destroy = function () {
|
6764 | this.deactivate();
|
6765 |
|
6766 | for (const callback of this._cleanupQueue.splice(0).reverse()) {
|
6767 | callback();
|
6768 | }
|
6769 | };
|
6770 |
|
6771 | /**
|
6772 | * Activate the element
|
6773 | * Overlay is hidden, element is decorated with a blue shadow border
|
6774 | */
|
6775 | Activator$1.prototype.activate = function () {
|
6776 | // we allow only one active activator at a time
|
6777 | if (Activator$1.current) {
|
6778 | Activator$1.current.deactivate();
|
6779 | }
|
6780 | Activator$1.current = this;
|
6781 |
|
6782 | this.active = true;
|
6783 | this._dom.overlay.style.display = "none";
|
6784 | this._dom.container.classList.add("vis-active");
|
6785 |
|
6786 | this.emit("change");
|
6787 | this.emit("activate");
|
6788 |
|
6789 | // ugly hack: bind ESC after emitting the events, as the Network rebinds all
|
6790 | // keyboard events on a 'change' event
|
6791 | document.body.addEventListener("keydown", this._escListener);
|
6792 | };
|
6793 |
|
6794 | /**
|
6795 | * Deactivate the element
|
6796 | * Overlay is displayed on top of the element
|
6797 | */
|
6798 | Activator$1.prototype.deactivate = function () {
|
6799 | this.active = false;
|
6800 | this._dom.overlay.style.display = "block";
|
6801 | this._dom.container.classList.remove("vis-active");
|
6802 | document.body.removeEventListener("keydown", this._escListener);
|
6803 |
|
6804 | this.emit("change");
|
6805 | this.emit("deactivate");
|
6806 | };
|
6807 |
|
6808 | /**
|
6809 | * Handle a tap event: activate the container
|
6810 | *
|
6811 | * @param {Event} event The event
|
6812 | * @private
|
6813 | */
|
6814 | Activator$1.prototype._onTapOverlay = function (event) {
|
6815 | // activate the container
|
6816 | this.activate();
|
6817 | event.srcEvent.stopPropagation();
|
6818 | };
|
6819 |
|
6820 | /**
|
6821 | * Test whether the element has the requested parent element somewhere in
|
6822 | * its chain of parent nodes.
|
6823 | *
|
6824 | * @param {HTMLElement} element
|
6825 | * @param {HTMLElement} parent
|
6826 | * @returns {boolean} Returns true when the parent is found somewhere in the
|
6827 | * chain of parent nodes.
|
6828 | * @private
|
6829 | */
|
6830 | function _hasParent(element, parent) {
|
6831 | while (element) {
|
6832 | if (element === parent) {
|
6833 | return true;
|
6834 | }
|
6835 | element = element.parentNode;
|
6836 | }
|
6837 | return false;
|
6838 | }
|
6839 |
|
6840 | var isConstructor$2 = isConstructor$4;
|
6841 | var tryToString$3 = tryToString$6;
|
6842 |
|
6843 | var $TypeError$7 = TypeError;
|
6844 |
|
6845 | // `Assert: IsConstructor(argument) is true`
|
6846 | var aConstructor$2 = function (argument) {
|
6847 | if (isConstructor$2(argument)) return argument;
|
6848 | throw new $TypeError$7(tryToString$3(argument) + ' is not a constructor');
|
6849 | };
|
6850 |
|
6851 | var $$y = _export;
|
6852 | var getBuiltIn$5 = getBuiltIn$f;
|
6853 | var apply$3 = functionApply;
|
6854 | var bind$9 = functionBind;
|
6855 | var aConstructor$1 = aConstructor$2;
|
6856 | var anObject$7 = anObject$d;
|
6857 | var isObject$7 = isObject$h;
|
6858 | var create$9 = objectCreate;
|
6859 | var fails$d = fails$u;
|
6860 |
|
6861 | var nativeConstruct = getBuiltIn$5('Reflect', 'construct');
|
6862 | var ObjectPrototype = Object.prototype;
|
6863 | var push$8 = [].push;
|
6864 |
|
6865 | // `Reflect.construct` method
|
6866 | // https://tc39.es/ecma262/#sec-reflect.construct
|
6867 | // MS Edge supports only 2 arguments and argumentsList argument is optional
|
6868 | // FF Nightly sets third argument as `new.target`, but does not create `this` from it
|
6869 | var NEW_TARGET_BUG = fails$d(function () {
|
6870 | function F() { /* empty */ }
|
6871 | return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F);
|
6872 | });
|
6873 |
|
6874 | var ARGS_BUG = !fails$d(function () {
|
6875 | nativeConstruct(function () { /* empty */ });
|
6876 | });
|
6877 |
|
6878 | var FORCED$3 = NEW_TARGET_BUG || ARGS_BUG;
|
6879 |
|
6880 | $$y({ target: 'Reflect', stat: true, forced: FORCED$3, sham: FORCED$3 }, {
|
6881 | construct: function construct(Target, args /* , newTarget */) {
|
6882 | aConstructor$1(Target);
|
6883 | anObject$7(args);
|
6884 | var newTarget = arguments.length < 3 ? Target : aConstructor$1(arguments[2]);
|
6885 | if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
|
6886 | if (Target === newTarget) {
|
6887 | // w/o altered newTarget, optimization for 0-4 arguments
|
6888 | switch (args.length) {
|
6889 | case 0: return new Target();
|
6890 | case 1: return new Target(args[0]);
|
6891 | case 2: return new Target(args[0], args[1]);
|
6892 | case 3: return new Target(args[0], args[1], args[2]);
|
6893 | case 4: return new Target(args[0], args[1], args[2], args[3]);
|
6894 | }
|
6895 | // w/o altered newTarget, lot of arguments case
|
6896 | var $args = [null];
|
6897 | apply$3(push$8, $args, args);
|
6898 | return new (apply$3(bind$9, Target, $args))();
|
6899 | }
|
6900 | // with altered newTarget, not support built-in constructors
|
6901 | var proto = newTarget.prototype;
|
6902 | var instance = create$9(isObject$7(proto) ? proto : ObjectPrototype);
|
6903 | var result = apply$3(Target, instance, args);
|
6904 | return isObject$7(result) ? result : instance;
|
6905 | }
|
6906 | });
|
6907 |
|
6908 | var path$h = path$o;
|
6909 |
|
6910 | var construct$2 = path$h.Reflect.construct;
|
6911 |
|
6912 | var parent$T = construct$2;
|
6913 |
|
6914 | var construct$1 = parent$T;
|
6915 |
|
6916 | var construct = construct$1;
|
6917 |
|
6918 | var _Reflect$construct = /*@__PURE__*/getDefaultExportFromCjs(construct);
|
6919 |
|
6920 | var $$x = _export;
|
6921 | var isArray$9 = isArray$e;
|
6922 | var isConstructor$1 = isConstructor$4;
|
6923 | var isObject$6 = isObject$h;
|
6924 | var toAbsoluteIndex$1 = toAbsoluteIndex$4;
|
6925 | var lengthOfArrayLike$5 = lengthOfArrayLike$d;
|
6926 | var toIndexedObject$2 = toIndexedObject$a;
|
6927 | var createProperty$3 = createProperty$6;
|
6928 | var wellKnownSymbol$7 = wellKnownSymbol$n;
|
6929 | var arrayMethodHasSpeciesSupport$1 = arrayMethodHasSpeciesSupport$5;
|
6930 | var nativeSlice = arraySlice$5;
|
6931 |
|
6932 | var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport$1('slice');
|
6933 |
|
6934 | var SPECIES$3 = wellKnownSymbol$7('species');
|
6935 | var $Array$1 = Array;
|
6936 | var max$1 = Math.max;
|
6937 |
|
6938 | // `Array.prototype.slice` method
|
6939 | // https://tc39.es/ecma262/#sec-array.prototype.slice
|
6940 | // fallback for not array-like ES3 strings and DOM objects
|
6941 | $$x({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
|
6942 | slice: function slice(start, end) {
|
6943 | var O = toIndexedObject$2(this);
|
6944 | var length = lengthOfArrayLike$5(O);
|
6945 | var k = toAbsoluteIndex$1(start, length);
|
6946 | var fin = toAbsoluteIndex$1(end === undefined ? length : end, length);
|
6947 | // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
|
6948 | var Constructor, result, n;
|
6949 | if (isArray$9(O)) {
|
6950 | Constructor = O.constructor;
|
6951 |
|
6952 | if (isConstructor$1(Constructor) && (Constructor === $Array$1 || isArray$9(Constructor.prototype))) {
|
6953 | Constructor = undefined;
|
6954 | } else if (isObject$6(Constructor)) {
|
6955 | Constructor = Constructor[SPECIES$3];
|
6956 | if (Constructor === null) Constructor = undefined;
|
6957 | }
|
6958 | if (Constructor === $Array$1 || Constructor === undefined) {
|
6959 | return nativeSlice(O, k, fin);
|
6960 | }
|
6961 | }
|
6962 | result = new (Constructor === undefined ? $Array$1 : Constructor)(max$1(fin - k, 0));
|
6963 | for (n = 0; k < fin; k++, n++) if (k in O) createProperty$3(result, n, O[k]);
|
6964 | result.length = n;
|
6965 | return result;
|
6966 | }
|
6967 | });
|
6968 |
|
6969 | var getBuiltInPrototypeMethod$a = getBuiltInPrototypeMethod$g;
|
6970 |
|
6971 | var slice$6 = getBuiltInPrototypeMethod$a('Array', 'slice');
|
6972 |
|
6973 | var isPrototypeOf$d = objectIsPrototypeOf;
|
6974 | var method$a = slice$6;
|
6975 |
|
6976 | var ArrayPrototype$b = Array.prototype;
|
6977 |
|
6978 | var slice$5 = function (it) {
|
6979 | var own = it.slice;
|
6980 | return it === ArrayPrototype$b || (isPrototypeOf$d(ArrayPrototype$b, it) && own === ArrayPrototype$b.slice) ? method$a : own;
|
6981 | };
|
6982 |
|
6983 | var parent$S = slice$5;
|
6984 |
|
6985 | var slice$4 = parent$S;
|
6986 |
|
6987 | var slice$3 = slice$4;
|
6988 |
|
6989 | var _sliceInstanceProperty$1 = getDefaultExportFromCjs(slice$3);
|
6990 |
|
6991 | var call$a = functionCall;
|
6992 | var anObject$6 = anObject$d;
|
6993 | var getMethod$1 = getMethod$3;
|
6994 |
|
6995 | var iteratorClose$2 = function (iterator, kind, value) {
|
6996 | var innerResult, innerError;
|
6997 | anObject$6(iterator);
|
6998 | try {
|
6999 | innerResult = getMethod$1(iterator, 'return');
|
7000 | if (!innerResult) {
|
7001 | if (kind === 'throw') throw value;
|
7002 | return value;
|
7003 | }
|
7004 | innerResult = call$a(innerResult, iterator);
|
7005 | } catch (error) {
|
7006 | innerError = true;
|
7007 | innerResult = error;
|
7008 | }
|
7009 | if (kind === 'throw') throw value;
|
7010 | if (innerError) throw innerResult;
|
7011 | anObject$6(innerResult);
|
7012 | return value;
|
7013 | };
|
7014 |
|
7015 | var anObject$5 = anObject$d;
|
7016 | var iteratorClose$1 = iteratorClose$2;
|
7017 |
|
7018 |
|
7019 | var callWithSafeIterationClosing$1 = function (iterator, fn, value, ENTRIES) {
|
7020 | try {
|
7021 | return ENTRIES ? fn(anObject$5(value)[0], value[1]) : fn(value);
|
7022 | } catch (error) {
|
7023 | iteratorClose$1(iterator, 'throw', error);
|
7024 | }
|
7025 | };
|
7026 |
|
7027 | var wellKnownSymbol$6 = wellKnownSymbol$n;
|
7028 | var Iterators$1 = iterators;
|
7029 |
|
7030 | var ITERATOR$2 = wellKnownSymbol$6('iterator');
|
7031 | var ArrayPrototype$a = Array.prototype;
|
7032 |
|
7033 |
|
7034 | var isArrayIteratorMethod$2 = function (it) {
|
7035 | return it !== undefined && (Iterators$1.Array === it || ArrayPrototype$a[ITERATOR$2] === it);
|
7036 | };
|
7037 |
|
7038 | var classof$5 = classof$d;
|
7039 | var getMethod = getMethod$3;
|
7040 | var isNullOrUndefined$3 = isNullOrUndefined$6;
|
7041 | var Iterators = iterators;
|
7042 | var wellKnownSymbol$5 = wellKnownSymbol$n;
|
7043 |
|
7044 | var ITERATOR$1 = wellKnownSymbol$5('iterator');
|
7045 |
|
7046 | var getIteratorMethod$9 = function (it) {
|
7047 | if (!isNullOrUndefined$3(it)) return getMethod(it, ITERATOR$1)
|
7048 | || getMethod(it, '@@iterator')
|
7049 | || Iterators[classof$5(it)];
|
7050 | };
|
7051 |
|
7052 | var call$9 = functionCall;
|
7053 | var aCallable$7 = aCallable$e;
|
7054 | var anObject$4 = anObject$d;
|
7055 | var tryToString$2 = tryToString$6;
|
7056 | var getIteratorMethod$8 = getIteratorMethod$9;
|
7057 |
|
7058 | var $TypeError$6 = TypeError;
|
7059 |
|
7060 | var getIterator$8 = function (argument, usingIterator) {
|
7061 | var iteratorMethod = arguments.length < 2 ? getIteratorMethod$8(argument) : usingIterator;
|
7062 | if (aCallable$7(iteratorMethod)) return anObject$4(call$9(iteratorMethod, argument));
|
7063 | throw new $TypeError$6(tryToString$2(argument) + ' is not iterable');
|
7064 | };
|
7065 |
|
7066 | var bind$8 = functionBindContext;
|
7067 | var call$8 = functionCall;
|
7068 | var toObject$6 = toObject$e;
|
7069 | var callWithSafeIterationClosing = callWithSafeIterationClosing$1;
|
7070 | var isArrayIteratorMethod$1 = isArrayIteratorMethod$2;
|
7071 | var isConstructor = isConstructor$4;
|
7072 | var lengthOfArrayLike$4 = lengthOfArrayLike$d;
|
7073 | var createProperty$2 = createProperty$6;
|
7074 | var getIterator$7 = getIterator$8;
|
7075 | var getIteratorMethod$7 = getIteratorMethod$9;
|
7076 |
|
7077 | var $Array = Array;
|
7078 |
|
7079 |
|
7080 |
|
7081 | var arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
|
7082 | var O = toObject$6(arrayLike);
|
7083 | var IS_CONSTRUCTOR = isConstructor(this);
|
7084 | var argumentsLength = arguments.length;
|
7085 | var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
|
7086 | var mapping = mapfn !== undefined;
|
7087 | if (mapping) mapfn = bind$8(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
|
7088 | var iteratorMethod = getIteratorMethod$7(O);
|
7089 | var index = 0;
|
7090 | var length, result, step, iterator, next, value;
|
7091 |
|
7092 | if (iteratorMethod && !(this === $Array && isArrayIteratorMethod$1(iteratorMethod))) {
|
7093 | iterator = getIterator$7(O, iteratorMethod);
|
7094 | next = iterator.next;
|
7095 | result = IS_CONSTRUCTOR ? new this() : [];
|
7096 | for (;!(step = call$8(next, iterator)).done; index++) {
|
7097 | value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
|
7098 | createProperty$2(result, index, value);
|
7099 | }
|
7100 | } else {
|
7101 | length = lengthOfArrayLike$4(O);
|
7102 | result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
|
7103 | for (;length > index; index++) {
|
7104 | value = mapping ? mapfn(O[index], index) : O[index];
|
7105 | createProperty$2(result, index, value);
|
7106 | }
|
7107 | }
|
7108 | result.length = index;
|
7109 | return result;
|
7110 | };
|
7111 |
|
7112 | var wellKnownSymbol$4 = wellKnownSymbol$n;
|
7113 |
|
7114 | var ITERATOR = wellKnownSymbol$4('iterator');
|
7115 | var SAFE_CLOSING = false;
|
7116 |
|
7117 | try {
|
7118 | var called = 0;
|
7119 | var iteratorWithReturn = {
|
7120 | next: function () {
|
7121 | return { done: !!called++ };
|
7122 | },
|
7123 | 'return': function () {
|
7124 | SAFE_CLOSING = true;
|
7125 | }
|
7126 | };
|
7127 | iteratorWithReturn[ITERATOR] = function () {
|
7128 | return this;
|
7129 | };
|
7130 |
|
7131 | Array.from(iteratorWithReturn, function () { throw 2; });
|
7132 | } catch (error) { }
|
7133 |
|
7134 | var checkCorrectnessOfIteration$2 = function (exec, SKIP_CLOSING) {
|
7135 | try {
|
7136 | if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
|
7137 | } catch (error) { return false; }
|
7138 | var ITERATION_SUPPORT = false;
|
7139 | try {
|
7140 | var object = {};
|
7141 | object[ITERATOR] = function () {
|
7142 | return {
|
7143 | next: function () {
|
7144 | return { done: ITERATION_SUPPORT = true };
|
7145 | }
|
7146 | };
|
7147 | };
|
7148 | exec(object);
|
7149 | } catch (error) { }
|
7150 | return ITERATION_SUPPORT;
|
7151 | };
|
7152 |
|
7153 | var $$w = _export;
|
7154 | var from$6 = arrayFrom;
|
7155 | var checkCorrectnessOfIteration$1 = checkCorrectnessOfIteration$2;
|
7156 |
|
7157 | var INCORRECT_ITERATION = !checkCorrectnessOfIteration$1(function (iterable) {
|
7158 |
|
7159 | Array.from(iterable);
|
7160 | });
|
7161 |
|
7162 |
|
7163 |
|
7164 | $$w({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
|
7165 | from: from$6
|
7166 | });
|
7167 |
|
7168 | var path$g = path$o;
|
7169 |
|
7170 | var from$5 = path$g.Array.from;
|
7171 |
|
7172 | var parent$R = from$5;
|
7173 |
|
7174 | var from$4 = parent$R;
|
7175 |
|
7176 | var from$3 = from$4;
|
7177 |
|
7178 | var _Array$from$1 = getDefaultExportFromCjs(from$3);
|
7179 |
|
7180 | var symbol = symbol$4;
|
7181 |
|
7182 | var _Symbol = getDefaultExportFromCjs(symbol);
|
7183 |
|
7184 | var getIteratorMethod$6 = getIteratorMethod$9;
|
7185 |
|
7186 | var getIteratorMethod_1 = getIteratorMethod$6;
|
7187 |
|
7188 | var parent$Q = getIteratorMethod_1;
|
7189 |
|
7190 |
|
7191 | var getIteratorMethod$5 = parent$Q;
|
7192 |
|
7193 | var parent$P = getIteratorMethod$5;
|
7194 |
|
7195 | var getIteratorMethod$4 = parent$P;
|
7196 |
|
7197 | var parent$O = getIteratorMethod$4;
|
7198 |
|
7199 | var getIteratorMethod$3 = parent$O;
|
7200 |
|
7201 | var getIteratorMethod$2 = getIteratorMethod$3;
|
7202 |
|
7203 | var _getIteratorMethod$1 = getDefaultExportFromCjs(getIteratorMethod$2);
|
7204 |
|
7205 | var getIteratorMethod$1 = getIteratorMethod$2;
|
7206 |
|
7207 | var _getIteratorMethod = getDefaultExportFromCjs(getIteratorMethod$1);
|
7208 |
|
7209 | var path$f = path$o;
|
7210 |
|
7211 | var getOwnPropertySymbols$2 = path$f.Object.getOwnPropertySymbols;
|
7212 |
|
7213 | var parent$N = getOwnPropertySymbols$2;
|
7214 |
|
7215 | var getOwnPropertySymbols$1 = parent$N;
|
7216 |
|
7217 | var getOwnPropertySymbols = getOwnPropertySymbols$1;
|
7218 |
|
7219 | var _Object$getOwnPropertySymbols = getDefaultExportFromCjs(getOwnPropertySymbols);
|
7220 |
|
7221 | var getOwnPropertyDescriptor$5 = {exports: {}};
|
7222 |
|
7223 | var $$v = _export;
|
7224 | var fails$c = fails$u;
|
7225 | var toIndexedObject$1 = toIndexedObject$a;
|
7226 | var nativeGetOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
7227 | var DESCRIPTORS$8 = descriptors;
|
7228 |
|
7229 | var FORCED$2 = !DESCRIPTORS$8 || fails$c(function () { nativeGetOwnPropertyDescriptor(1); });
|
7230 |
|
7231 |
|
7232 |
|
7233 | $$v({ target: 'Object', stat: true, forced: FORCED$2, sham: !DESCRIPTORS$8 }, {
|
7234 | getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
|
7235 | return nativeGetOwnPropertyDescriptor(toIndexedObject$1(it), key);
|
7236 | }
|
7237 | });
|
7238 |
|
7239 | var path$e = path$o;
|
7240 |
|
7241 | var Object$3 = path$e.Object;
|
7242 |
|
7243 | var getOwnPropertyDescriptor$4 = getOwnPropertyDescriptor$5.exports = function getOwnPropertyDescriptor(it, key) {
|
7244 | return Object$3.getOwnPropertyDescriptor(it, key);
|
7245 | };
|
7246 |
|
7247 | if (Object$3.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor$4.sham = true;
|
7248 |
|
7249 | var getOwnPropertyDescriptorExports = getOwnPropertyDescriptor$5.exports;
|
7250 |
|
7251 | var parent$M = getOwnPropertyDescriptorExports;
|
7252 |
|
7253 | var getOwnPropertyDescriptor$3 = parent$M;
|
7254 |
|
7255 | var getOwnPropertyDescriptor$2 = getOwnPropertyDescriptor$3;
|
7256 |
|
7257 | var _Object$getOwnPropertyDescriptor = getDefaultExportFromCjs(getOwnPropertyDescriptor$2);
|
7258 |
|
7259 | var $forEach = arrayIteration.forEach;
|
7260 | var arrayMethodIsStrict$2 = arrayMethodIsStrict$4;
|
7261 |
|
7262 | var STRICT_METHOD$2 = arrayMethodIsStrict$2('forEach');
|
7263 |
|
7264 |
|
7265 |
|
7266 | var arrayForEach = !STRICT_METHOD$2 ? function forEach(callbackfn /* , thisArg */) {
|
7267 | return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
7268 |
|
7269 | } : [].forEach;
|
7270 |
|
7271 | var $$u = _export;
|
7272 | var forEach$8 = arrayForEach;
|
7273 |
|
7274 |
|
7275 |
|
7276 |
|
7277 | $$u({ target: 'Array', proto: true, forced: [].forEach !== forEach$8 }, {
|
7278 | forEach: forEach$8
|
7279 | });
|
7280 |
|
7281 | var getBuiltInPrototypeMethod$9 = getBuiltInPrototypeMethod$g;
|
7282 |
|
7283 | var forEach$7 = getBuiltInPrototypeMethod$9('Array', 'forEach');
|
7284 |
|
7285 | var parent$L = forEach$7;
|
7286 |
|
7287 | var forEach$6 = parent$L;
|
7288 |
|
7289 | var classof$4 = classof$d;
|
7290 | var hasOwn$6 = hasOwnProperty_1;
|
7291 | var isPrototypeOf$c = objectIsPrototypeOf;
|
7292 | var method$9 = forEach$6;
|
7293 |
|
7294 |
|
7295 | var ArrayPrototype$9 = Array.prototype;
|
7296 |
|
7297 | var DOMIterables$3 = {
|
7298 | DOMTokenList: true,
|
7299 | NodeList: true
|
7300 | };
|
7301 |
|
7302 | var forEach$5 = function (it) {
|
7303 | var own = it.forEach;
|
7304 | return it === ArrayPrototype$9 || (isPrototypeOf$c(ArrayPrototype$9, it) && own === ArrayPrototype$9.forEach)
|
7305 | || hasOwn$6(DOMIterables$3, classof$4(it)) ? method$9 : own;
|
7306 | };
|
7307 |
|
7308 | var forEach$4 = forEach$5;
|
7309 |
|
7310 | var _forEachInstanceProperty = getDefaultExportFromCjs(forEach$4);
|
7311 |
|
7312 | var getBuiltIn$4 = getBuiltIn$f;
|
7313 | var uncurryThis$5 = functionUncurryThis;
|
7314 | var getOwnPropertyNamesModule$1 = objectGetOwnPropertyNames;
|
7315 | var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
|
7316 | var anObject$3 = anObject$d;
|
7317 |
|
7318 | var concat$5 = uncurryThis$5([].concat);
|
7319 |
|
7320 |
|
7321 | var ownKeys$7 = getBuiltIn$4('Reflect', 'ownKeys') || function ownKeys(it) {
|
7322 | var keys = getOwnPropertyNamesModule$1.f(anObject$3(it));
|
7323 | var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
|
7324 | return getOwnPropertySymbols ? concat$5(keys, getOwnPropertySymbols(it)) : keys;
|
7325 | };
|
7326 |
|
7327 | var $$t = _export;
|
7328 | var DESCRIPTORS$7 = descriptors;
|
7329 | var ownKeys$6 = ownKeys$7;
|
7330 | var toIndexedObject = toIndexedObject$a;
|
7331 | var getOwnPropertyDescriptorModule$1 = objectGetOwnPropertyDescriptor;
|
7332 | var createProperty$1 = createProperty$6;
|
7333 |
|
7334 |
|
7335 |
|
7336 | $$t({ target: 'Object', stat: true, sham: !DESCRIPTORS$7 }, {
|
7337 | getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
|
7338 | var O = toIndexedObject(object);
|
7339 | var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule$1.f;
|
7340 | var keys = ownKeys$6(O);
|
7341 | var result = {};
|
7342 | var index = 0;
|
7343 | var key, descriptor;
|
7344 | while (keys.length > index) {
|
7345 | descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);
|
7346 | if (descriptor !== undefined) createProperty$1(result, key, descriptor);
|
7347 | }
|
7348 | return result;
|
7349 | }
|
7350 | });
|
7351 |
|
7352 | var path$d = path$o;
|
7353 |
|
7354 | var getOwnPropertyDescriptors$2 = path$d.Object.getOwnPropertyDescriptors;
|
7355 |
|
7356 | var parent$K = getOwnPropertyDescriptors$2;
|
7357 |
|
7358 | var getOwnPropertyDescriptors$1 = parent$K;
|
7359 |
|
7360 | var getOwnPropertyDescriptors = getOwnPropertyDescriptors$1;
|
7361 |
|
7362 | var _Object$getOwnPropertyDescriptors = getDefaultExportFromCjs(getOwnPropertyDescriptors);
|
7363 |
|
7364 | var defineProperties$4 = {exports: {}};
|
7365 |
|
7366 | var $$s = _export;
|
7367 | var DESCRIPTORS$6 = descriptors;
|
7368 | var defineProperties$3 = objectDefineProperties.f;
|
7369 |
|
7370 |
|
7371 |
|
7372 |
|
7373 | $$s({ target: 'Object', stat: true, forced: Object.defineProperties !== defineProperties$3, sham: !DESCRIPTORS$6 }, {
|
7374 | defineProperties: defineProperties$3
|
7375 | });
|
7376 |
|
7377 | var path$c = path$o;
|
7378 |
|
7379 | var Object$2 = path$c.Object;
|
7380 |
|
7381 | var defineProperties$2 = defineProperties$4.exports = function defineProperties(T, D) {
|
7382 | return Object$2.defineProperties(T, D);
|
7383 | };
|
7384 |
|
7385 | if (Object$2.defineProperties.sham) defineProperties$2.sham = true;
|
7386 |
|
7387 | var definePropertiesExports = defineProperties$4.exports;
|
7388 |
|
7389 | var parent$J = definePropertiesExports;
|
7390 |
|
7391 | var defineProperties$1 = parent$J;
|
7392 |
|
7393 | var defineProperties = defineProperties$1;
|
7394 |
|
7395 | var _Object$defineProperties = getDefaultExportFromCjs(defineProperties);
|
7396 |
|
7397 | var defineProperty$3 = defineProperty$b;
|
7398 |
|
7399 | var _Object$defineProperty = getDefaultExportFromCjs(defineProperty$3);
|
7400 |
|
7401 | var $$r = _export;
|
7402 | var isArray$8 = isArray$e;
|
7403 |
|
7404 |
|
7405 |
|
7406 | $$r({ target: 'Array', stat: true }, {
|
7407 | isArray: isArray$8
|
7408 | });
|
7409 |
|
7410 | var path$b = path$o;
|
7411 |
|
7412 | var isArray$7 = path$b.Array.isArray;
|
7413 |
|
7414 | var parent$I = isArray$7;
|
7415 |
|
7416 | var isArray$6 = parent$I;
|
7417 |
|
7418 | var parent$H = isArray$6;
|
7419 |
|
7420 | var isArray$5 = parent$H;
|
7421 |
|
7422 | var parent$G = isArray$5;
|
7423 |
|
7424 | var isArray$4 = parent$G;
|
7425 |
|
7426 | var isArray$3 = isArray$4;
|
7427 |
|
7428 | var _Array$isArray$1 = getDefaultExportFromCjs(isArray$3);
|
7429 |
|
7430 | function _arrayLikeToArray$3(arr, len) {
|
7431 | if (len == null || len > arr.length) len = arr.length;
|
7432 | for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
7433 | return arr2;
|
7434 | }
|
7435 |
|
7436 | function _arrayWithoutHoles(arr) {
|
7437 | if (_Array$isArray$1(arr)) return _arrayLikeToArray$3(arr);
|
7438 | }
|
7439 |
|
7440 | var parent$F = from$4;
|
7441 |
|
7442 | var from$2 = parent$F;
|
7443 |
|
7444 | var parent$E = from$2;
|
7445 |
|
7446 | var from$1 = parent$E;
|
7447 |
|
7448 | var from = from$1;
|
7449 |
|
7450 | var _Array$from = getDefaultExportFromCjs(from);
|
7451 |
|
7452 | function _iterableToArray(iter) {
|
7453 | if (typeof _Symbol$1 !== "undefined" && _getIteratorMethod$1(iter) != null || iter["@@iterator"] != null) return _Array$from(iter);
|
7454 | }
|
7455 |
|
7456 | var parent$D = slice$4;
|
7457 |
|
7458 | var slice$2 = parent$D;
|
7459 |
|
7460 | var parent$C = slice$2;
|
7461 |
|
7462 | var slice$1 = parent$C;
|
7463 |
|
7464 | var slice = slice$1;
|
7465 |
|
7466 | var _sliceInstanceProperty = getDefaultExportFromCjs(slice);
|
7467 |
|
7468 | function _unsupportedIterableToArray$3(o, minLen) {
|
7469 | var _context;
|
7470 | if (!o) return;
|
7471 | if (typeof o === "string") return _arrayLikeToArray$3(o, minLen);
|
7472 | var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1);
|
7473 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
7474 | if (n === "Map" || n === "Set") return _Array$from(o);
|
7475 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen);
|
7476 | }
|
7477 |
|
7478 | function _nonIterableSpread() {
|
7479 | throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
7480 | }
|
7481 |
|
7482 | function _toConsumableArray(arr) {
|
7483 | return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$3(arr) || _nonIterableSpread();
|
7484 | }
|
7485 |
|
7486 | function _assertThisInitialized(self) {
|
7487 | if (self === void 0) {
|
7488 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
7489 | }
|
7490 | return self;
|
7491 | }
|
7492 |
|
7493 |
|
7494 | var $$q = _export;
|
7495 | var DESCRIPTORS$5 = descriptors;
|
7496 | var create$8 = objectCreate;
|
7497 |
|
7498 |
|
7499 |
|
7500 | $$q({ target: 'Object', stat: true, sham: !DESCRIPTORS$5 }, {
|
7501 | create: create$8
|
7502 | });
|
7503 |
|
7504 | var path$a = path$o;
|
7505 |
|
7506 | var Object$1 = path$a.Object;
|
7507 |
|
7508 | var create$7 = function create(P, D) {
|
7509 | return Object$1.create(P, D);
|
7510 | };
|
7511 |
|
7512 | var parent$B = create$7;
|
7513 |
|
7514 | var create$6 = parent$B;
|
7515 |
|
7516 | var parent$A = create$6;
|
7517 |
|
7518 | var create$5 = parent$A;
|
7519 |
|
7520 | var parent$z = create$5;
|
7521 |
|
7522 | var create$4 = parent$z;
|
7523 |
|
7524 | var create$3 = create$4;
|
7525 |
|
7526 | var _Object$create$1 = getDefaultExportFromCjs(create$3);
|
7527 |
|
7528 | var $$p = _export;
|
7529 | var setPrototypeOf$6 = objectSetPrototypeOf;
|
7530 |
|
7531 |
|
7532 |
|
7533 | $$p({ target: 'Object', stat: true }, {
|
7534 | setPrototypeOf: setPrototypeOf$6
|
7535 | });
|
7536 |
|
7537 | var path$9 = path$o;
|
7538 |
|
7539 | var setPrototypeOf$5 = path$9.Object.setPrototypeOf;
|
7540 |
|
7541 | var parent$y = setPrototypeOf$5;
|
7542 |
|
7543 | var setPrototypeOf$4 = parent$y;
|
7544 |
|
7545 | var parent$x = setPrototypeOf$4;
|
7546 |
|
7547 | var setPrototypeOf$3 = parent$x;
|
7548 |
|
7549 | var parent$w = setPrototypeOf$3;
|
7550 |
|
7551 | var setPrototypeOf$2 = parent$w;
|
7552 |
|
7553 | var setPrototypeOf$1 = setPrototypeOf$2;
|
7554 |
|
7555 | var _Object$setPrototypeOf = getDefaultExportFromCjs(setPrototypeOf$1);
|
7556 |
|
7557 | var parent$v = bind$c;
|
7558 |
|
7559 | var bind$7 = parent$v;
|
7560 |
|
7561 | var parent$u = bind$7;
|
7562 |
|
7563 | var bind$6 = parent$u;
|
7564 |
|
7565 | var bind$5 = bind$6;
|
7566 |
|
7567 | var _bindInstanceProperty = getDefaultExportFromCjs(bind$5);
|
7568 |
|
7569 | function _setPrototypeOf(o, p) {
|
7570 | var _context;
|
7571 | _setPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$setPrototypeOf).call(_context) : function _setPrototypeOf(o, p) {
|
7572 | o.__proto__ = p;
|
7573 | return o;
|
7574 | };
|
7575 | return _setPrototypeOf(o, p);
|
7576 | }
|
7577 |
|
7578 | function _inherits(subClass, superClass) {
|
7579 | if (typeof superClass !== "function" && superClass !== null) {
|
7580 | throw new TypeError("Super expression must either be null or a function");
|
7581 | }
|
7582 | subClass.prototype = _Object$create$1(superClass && superClass.prototype, {
|
7583 | constructor: {
|
7584 | value: subClass,
|
7585 | writable: true,
|
7586 | configurable: true
|
7587 | }
|
7588 | });
|
7589 | _Object$defineProperty$1(subClass, "prototype", {
|
7590 | writable: false
|
7591 | });
|
7592 | if (superClass) _setPrototypeOf(subClass, superClass);
|
7593 | }
|
7594 |
|
7595 | function _possibleConstructorReturn(self, call) {
|
7596 | if (call && (_typeof$1(call) === "object" || typeof call === "function")) {
|
7597 | return call;
|
7598 | } else if (call !== void 0) {
|
7599 | throw new TypeError("Derived constructors may only return object or undefined");
|
7600 | }
|
7601 | return _assertThisInitialized(self);
|
7602 | }
|
7603 |
|
7604 | var $$o = _export;
|
7605 | var fails$b = fails$u;
|
7606 | var toObject$5 = toObject$e;
|
7607 | var nativeGetPrototypeOf = objectGetPrototypeOf;
|
7608 | var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
|
7609 |
|
7610 | var FAILS_ON_PRIMITIVES$2 = fails$b(function () { nativeGetPrototypeOf(1); });
|
7611 |
|
7612 |
|
7613 |
|
7614 | $$o({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$2, sham: !CORRECT_PROTOTYPE_GETTER }, {
|
7615 | getPrototypeOf: function getPrototypeOf(it) {
|
7616 | return nativeGetPrototypeOf(toObject$5(it));
|
7617 | }
|
7618 | });
|
7619 |
|
7620 | var path$8 = path$o;
|
7621 |
|
7622 | var getPrototypeOf$5 = path$8.Object.getPrototypeOf;
|
7623 |
|
7624 | var parent$t = getPrototypeOf$5;
|
7625 |
|
7626 | var getPrototypeOf$4 = parent$t;
|
7627 |
|
7628 | var parent$s = getPrototypeOf$4;
|
7629 |
|
7630 | var getPrototypeOf$3 = parent$s;
|
7631 |
|
7632 | var parent$r = getPrototypeOf$3;
|
7633 |
|
7634 | var getPrototypeOf$2 = parent$r;
|
7635 |
|
7636 | var getPrototypeOf$1 = getPrototypeOf$2;
|
7637 |
|
7638 | var _Object$getPrototypeOf = getDefaultExportFromCjs(getPrototypeOf$1);
|
7639 |
|
7640 | function _getPrototypeOf(o) {
|
7641 | var _context;
|
7642 | _getPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$getPrototypeOf).call(_context) : function _getPrototypeOf(o) {
|
7643 | return o.__proto__ || _Object$getPrototypeOf(o);
|
7644 | };
|
7645 | return _getPrototypeOf(o);
|
7646 | }
|
7647 |
|
7648 | var regeneratorRuntime$1 = {exports: {}};
|
7649 |
|
7650 | var _typeof = {exports: {}};
|
7651 |
|
7652 | (function (module) {
|
7653 | var _Symbol = symbol$1;
|
7654 | var _Symbol$iterator = iterator$1;
|
7655 | function _typeof(o) {
|
7656 | "@babel/helpers - typeof";
|
7657 |
|
7658 | return (module.exports = _typeof = "function" == typeof _Symbol && "symbol" == typeof _Symbol$iterator ? function (o) {
|
7659 | return typeof o;
|
7660 | } : function (o) {
|
7661 | return o && "function" == typeof _Symbol && o.constructor === _Symbol && o !== _Symbol.prototype ? "symbol" : typeof o;
|
7662 | }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
|
7663 | }
|
7664 | module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
7665 | } (_typeof));
|
7666 |
|
7667 | var _typeofExports = _typeof.exports;
|
7668 |
|
7669 | var parent$q = forEach$5;
|
7670 |
|
7671 | var forEach$3 = parent$q;
|
7672 |
|
7673 | var parent$p = forEach$3;
|
7674 |
|
7675 | var forEach$2 = parent$p;
|
7676 |
|
7677 | var forEach$1 = forEach$2;
|
7678 |
|
7679 | var DESCRIPTORS$4 = descriptors;
|
7680 | var isArray$2 = isArray$e;
|
7681 |
|
7682 | var $TypeError$5 = TypeError;
|
7683 |
|
7684 | var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
7685 |
|
7686 |
|
7687 | var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$4 && !function () {
|
7688 |
|
7689 | if (this !== undefined) return true;
|
7690 | try {
|
7691 |
|
7692 | Object.defineProperty([], 'length', { writable: false }).length = 1;
|
7693 | } catch (error) {
|
7694 | return error instanceof TypeError;
|
7695 | }
|
7696 | }();
|
7697 |
|
7698 | var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
|
7699 | if (isArray$2(O) && !getOwnPropertyDescriptor$1(O, 'length').writable) {
|
7700 | throw new $TypeError$5('Cannot set read only .length');
|
7701 | } return O.length = length;
|
7702 | } : function (O, length) {
|
7703 | return O.length = length;
|
7704 | };
|
7705 |
|
7706 | var $$n = _export;
|
7707 | var toObject$4 = toObject$e;
|
7708 | var lengthOfArrayLike$3 = lengthOfArrayLike$d;
|
7709 | var setArrayLength$1 = arraySetLength;
|
7710 | var doesNotExceedSafeInteger$1 = doesNotExceedSafeInteger$4;
|
7711 | var fails$a = fails$u;
|
7712 |
|
7713 | var INCORRECT_TO_LENGTH = fails$a(function () {
|
7714 | return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
|
7715 | });
|
7716 |
|
7717 |
|
7718 |
|
7719 | var properErrorOnNonWritableLength = function () {
|
7720 | try {
|
7721 |
|
7722 | Object.defineProperty([], 'length', { writable: false }).push();
|
7723 | } catch (error) {
|
7724 | return error instanceof TypeError;
|
7725 | }
|
7726 | };
|
7727 |
|
7728 | var FORCED$1 = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
|
7729 |
|
7730 |
|
7731 |
|
7732 | $$n({ target: 'Array', proto: true, arity: 1, forced: FORCED$1 }, {
|
7733 |
|
7734 | push: function push(item) {
|
7735 | var O = toObject$4(this);
|
7736 | var len = lengthOfArrayLike$3(O);
|
7737 | var argCount = arguments.length;
|
7738 | doesNotExceedSafeInteger$1(len + argCount);
|
7739 | for (var i = 0; i < argCount; i++) {
|
7740 | O[len] = arguments[i];
|
7741 | len++;
|
7742 | }
|
7743 | setArrayLength$1(O, len);
|
7744 | return len;
|
7745 | }
|
7746 | });
|
7747 |
|
7748 | var getBuiltInPrototypeMethod$8 = getBuiltInPrototypeMethod$g;
|
7749 |
|
7750 | var push$7 = getBuiltInPrototypeMethod$8('Array', 'push');
|
7751 |
|
7752 | var isPrototypeOf$b = objectIsPrototypeOf;
|
7753 | var method$8 = push$7;
|
7754 |
|
7755 | var ArrayPrototype$8 = Array.prototype;
|
7756 |
|
7757 | var push$6 = function (it) {
|
7758 | var own = it.push;
|
7759 | return it === ArrayPrototype$8 || (isPrototypeOf$b(ArrayPrototype$8, it) && own === ArrayPrototype$8.push) ? method$8 : own;
|
7760 | };
|
7761 |
|
7762 | var parent$o = push$6;
|
7763 |
|
7764 | var push$5 = parent$o;
|
7765 |
|
7766 | var parent$n = push$5;
|
7767 |
|
7768 | var push$4 = parent$n;
|
7769 |
|
7770 | var parent$m = push$4;
|
7771 |
|
7772 | var push$3 = parent$m;
|
7773 |
|
7774 | var push$2 = push$3;
|
7775 |
|
7776 | var _pushInstanceProperty = getDefaultExportFromCjs(push$2);
|
7777 |
|
7778 | var hasOwn$5 = hasOwnProperty_1;
|
7779 | var ownKeys$5 = ownKeys$7;
|
7780 | var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
|
7781 | var definePropertyModule = objectDefineProperty;
|
7782 |
|
7783 | var copyConstructorProperties$1 = function (target, source, exceptions) {
|
7784 | var keys = ownKeys$5(source);
|
7785 | var defineProperty = definePropertyModule.f;
|
7786 | var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
7787 | for (var i = 0; i < keys.length; i++) {
|
7788 | var key = keys[i];
|
7789 | if (!hasOwn$5(target, key) && !(exceptions && hasOwn$5(exceptions, key))) {
|
7790 | defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
7791 | }
|
7792 | }
|
7793 | };
|
7794 |
|
7795 | var isObject$5 = isObject$h;
|
7796 | var createNonEnumerableProperty$3 = createNonEnumerableProperty$9;
|
7797 |
|
7798 |
|
7799 |
|
7800 | var installErrorCause$1 = function (O, options) {
|
7801 | if (isObject$5(options) && 'cause' in options) {
|
7802 | createNonEnumerableProperty$3(O, 'cause', options.cause);
|
7803 | }
|
7804 | };
|
7805 |
|
7806 | var uncurryThis$4 = functionUncurryThis;
|
7807 |
|
7808 | var $Error$1 = Error;
|
7809 | var replace = uncurryThis$4(''.replace);
|
7810 |
|
7811 | var TEST = (function (arg) { return String(new $Error$1(arg).stack); })('zxcasd');
|
7812 |
|
7813 | var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
|
7814 | var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
|
7815 |
|
7816 | var errorStackClear = function (stack, dropEntries) {
|
7817 | if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error$1.prepareStackTrace) {
|
7818 | while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
|
7819 | } return stack;
|
7820 | };
|
7821 |
|
7822 | var fails$9 = fails$u;
|
7823 | var createPropertyDescriptor$1 = createPropertyDescriptor$7;
|
7824 |
|
7825 | var errorStackInstallable = !fails$9(function () {
|
7826 | var error = new Error('a');
|
7827 | if (!('stack' in error)) return true;
|
7828 |
|
7829 | Object.defineProperty(error, 'stack', createPropertyDescriptor$1(1, 7));
|
7830 | return error.stack !== 7;
|
7831 | });
|
7832 |
|
7833 | var createNonEnumerableProperty$2 = createNonEnumerableProperty$9;
|
7834 | var clearErrorStack = errorStackClear;
|
7835 | var ERROR_STACK_INSTALLABLE = errorStackInstallable;
|
7836 |
|
7837 |
|
7838 | var captureStackTrace = Error.captureStackTrace;
|
7839 |
|
7840 | var errorStackInstall = function (error, C, stack, dropEntries) {
|
7841 | if (ERROR_STACK_INSTALLABLE) {
|
7842 | if (captureStackTrace) captureStackTrace(error, C);
|
7843 | else createNonEnumerableProperty$2(error, 'stack', clearErrorStack(stack, dropEntries));
|
7844 | }
|
7845 | };
|
7846 |
|
7847 | var bind$4 = functionBindContext;
|
7848 | var call$7 = functionCall;
|
7849 | var anObject$2 = anObject$d;
|
7850 | var tryToString$1 = tryToString$6;
|
7851 | var isArrayIteratorMethod = isArrayIteratorMethod$2;
|
7852 | var lengthOfArrayLike$2 = lengthOfArrayLike$d;
|
7853 | var isPrototypeOf$a = objectIsPrototypeOf;
|
7854 | var getIterator$6 = getIterator$8;
|
7855 | var getIteratorMethod = getIteratorMethod$9;
|
7856 | var iteratorClose = iteratorClose$2;
|
7857 |
|
7858 | var $TypeError$4 = TypeError;
|
7859 |
|
7860 | var Result = function (stopped, result) {
|
7861 | this.stopped = stopped;
|
7862 | this.result = result;
|
7863 | };
|
7864 |
|
7865 | var ResultPrototype = Result.prototype;
|
7866 |
|
7867 | var iterate$7 = function (iterable, unboundFunction, options) {
|
7868 | var that = options && options.that;
|
7869 | var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
7870 | var IS_RECORD = !!(options && options.IS_RECORD);
|
7871 | var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
7872 | var INTERRUPTED = !!(options && options.INTERRUPTED);
|
7873 | var fn = bind$4(unboundFunction, that);
|
7874 | var iterator, iterFn, index, length, result, next, step;
|
7875 |
|
7876 | var stop = function (condition) {
|
7877 | if (iterator) iteratorClose(iterator, 'normal', condition);
|
7878 | return new Result(true, condition);
|
7879 | };
|
7880 |
|
7881 | var callFn = function (value) {
|
7882 | if (AS_ENTRIES) {
|
7883 | anObject$2(value);
|
7884 | return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
7885 | } return INTERRUPTED ? fn(value, stop) : fn(value);
|
7886 | };
|
7887 |
|
7888 | if (IS_RECORD) {
|
7889 | iterator = iterable.iterator;
|
7890 | } else if (IS_ITERATOR) {
|
7891 | iterator = iterable;
|
7892 | } else {
|
7893 | iterFn = getIteratorMethod(iterable);
|
7894 | if (!iterFn) throw new $TypeError$4(tryToString$1(iterable) + ' is not iterable');
|
7895 |
|
7896 | if (isArrayIteratorMethod(iterFn)) {
|
7897 | for (index = 0, length = lengthOfArrayLike$2(iterable); length > index; index++) {
|
7898 | result = callFn(iterable[index]);
|
7899 | if (result && isPrototypeOf$a(ResultPrototype, result)) return result;
|
7900 | } return new Result(false);
|
7901 | }
|
7902 | iterator = getIterator$6(iterable, iterFn);
|
7903 | }
|
7904 |
|
7905 | next = IS_RECORD ? iterable.next : iterator.next;
|
7906 | while (!(step = call$7(next, iterator)).done) {
|
7907 | try {
|
7908 | result = callFn(step.value);
|
7909 | } catch (error) {
|
7910 | iteratorClose(iterator, 'throw', error);
|
7911 | }
|
7912 | if (typeof result == 'object' && result && isPrototypeOf$a(ResultPrototype, result)) return result;
|
7913 | } return new Result(false);
|
7914 | };
|
7915 |
|
7916 | var toString$1 = toString$7;
|
7917 |
|
7918 | var normalizeStringArgument$1 = function (argument, $default) {
|
7919 | return argument === undefined ? arguments.length < 2 ? '' : $default : toString$1(argument);
|
7920 | };
|
7921 |
|
7922 | var $$m = _export;
|
7923 | var isPrototypeOf$9 = objectIsPrototypeOf;
|
7924 | var getPrototypeOf = objectGetPrototypeOf;
|
7925 | var setPrototypeOf = objectSetPrototypeOf;
|
7926 | var copyConstructorProperties = copyConstructorProperties$1;
|
7927 | var create$2 = objectCreate;
|
7928 | var createNonEnumerableProperty$1 = createNonEnumerableProperty$9;
|
7929 | var createPropertyDescriptor = createPropertyDescriptor$7;
|
7930 | var installErrorCause = installErrorCause$1;
|
7931 | var installErrorStack = errorStackInstall;
|
7932 | var iterate$6 = iterate$7;
|
7933 | var normalizeStringArgument = normalizeStringArgument$1;
|
7934 | var wellKnownSymbol$3 = wellKnownSymbol$n;
|
7935 |
|
7936 | var TO_STRING_TAG = wellKnownSymbol$3('toStringTag');
|
7937 | var $Error = Error;
|
7938 | var push$1 = [].push;
|
7939 |
|
7940 | var $AggregateError = function AggregateError(errors, message /* , options */) {
|
7941 | var isInstance = isPrototypeOf$9(AggregateErrorPrototype, this);
|
7942 | var that;
|
7943 | if (setPrototypeOf) {
|
7944 | that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
|
7945 | } else {
|
7946 | that = isInstance ? this : create$2(AggregateErrorPrototype);
|
7947 | createNonEnumerableProperty$1(that, TO_STRING_TAG, 'Error');
|
7948 | }
|
7949 | if (message !== undefined) createNonEnumerableProperty$1(that, 'message', normalizeStringArgument(message));
|
7950 | installErrorStack(that, $AggregateError, that.stack, 1);
|
7951 | if (arguments.length > 2) installErrorCause(that, arguments[2]);
|
7952 | var errorsArray = [];
|
7953 | iterate$6(errors, push$1, { that: errorsArray });
|
7954 | createNonEnumerableProperty$1(that, 'errors', errorsArray);
|
7955 | return that;
|
7956 | };
|
7957 |
|
7958 | if (setPrototypeOf) setPrototypeOf($AggregateError, $Error);
|
7959 | else copyConstructorProperties($AggregateError, $Error, { name: true });
|
7960 |
|
7961 | var AggregateErrorPrototype = $AggregateError.prototype = create$2($Error.prototype, {
|
7962 | constructor: createPropertyDescriptor(1, $AggregateError),
|
7963 | message: createPropertyDescriptor(1, ''),
|
7964 | name: createPropertyDescriptor(1, 'AggregateError')
|
7965 | });
|
7966 |
|
7967 | // `AggregateError` constructor
|
7968 | // https://tc39.es/ecma262/#sec-aggregate-error-constructor
|
7969 | $$m({ global: true, constructor: true, arity: 2 }, {
|
7970 | AggregateError: $AggregateError
|
7971 | });
|
7972 |
|
7973 | var getBuiltIn$3 = getBuiltIn$f;
|
7974 | var defineBuiltInAccessor$1 = defineBuiltInAccessor$3;
|
7975 | var wellKnownSymbol$2 = wellKnownSymbol$n;
|
7976 | var DESCRIPTORS$3 = descriptors;
|
7977 |
|
7978 | var SPECIES$2 = wellKnownSymbol$2('species');
|
7979 |
|
7980 | var setSpecies$2 = function (CONSTRUCTOR_NAME) {
|
7981 | var Constructor = getBuiltIn$3(CONSTRUCTOR_NAME);
|
7982 |
|
7983 | if (DESCRIPTORS$3 && Constructor && !Constructor[SPECIES$2]) {
|
7984 | defineBuiltInAccessor$1(Constructor, SPECIES$2, {
|
7985 | configurable: true,
|
7986 | get: function () { return this; }
|
7987 | });
|
7988 | }
|
7989 | };
|
7990 |
|
7991 | var isPrototypeOf$8 = objectIsPrototypeOf;
|
7992 |
|
7993 | var $TypeError$3 = TypeError;
|
7994 |
|
7995 | var anInstance$3 = function (it, Prototype) {
|
7996 | if (isPrototypeOf$8(Prototype, it)) return it;
|
7997 | throw new $TypeError$3('Incorrect invocation');
|
7998 | };
|
7999 |
|
8000 | var anObject$1 = anObject$d;
|
8001 | var aConstructor = aConstructor$2;
|
8002 | var isNullOrUndefined$2 = isNullOrUndefined$6;
|
8003 | var wellKnownSymbol$1 = wellKnownSymbol$n;
|
8004 |
|
8005 | var SPECIES$1 = wellKnownSymbol$1('species');
|
8006 |
|
8007 |
|
8008 |
|
8009 | var speciesConstructor$2 = function (O, defaultConstructor) {
|
8010 | var C = anObject$1(O).constructor;
|
8011 | var S;
|
8012 | return C === undefined || isNullOrUndefined$2(S = anObject$1(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
|
8013 | };
|
8014 |
|
8015 | var $TypeError$2 = TypeError;
|
8016 |
|
8017 | var validateArgumentsLength$2 = function (passed, required) {
|
8018 | if (passed < required) throw new $TypeError$2('Not enough arguments');
|
8019 | return passed;
|
8020 | };
|
8021 |
|
8022 | var userAgent$4 = engineUserAgent;
|
8023 |
|
8024 |
|
8025 | var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$4);
|
8026 |
|
8027 | var global$9 = global$p;
|
8028 | var apply$2 = functionApply;
|
8029 | var bind$3 = functionBindContext;
|
8030 | var isCallable$5 = isCallable$m;
|
8031 | var hasOwn$4 = hasOwnProperty_1;
|
8032 | var fails$8 = fails$u;
|
8033 | var html = html$2;
|
8034 | var arraySlice$2 = arraySlice$5;
|
8035 | var createElement = documentCreateElement$1;
|
8036 | var validateArgumentsLength$1 = validateArgumentsLength$2;
|
8037 | var IS_IOS$1 = engineIsIos;
|
8038 | var IS_NODE$3 = engineIsNode;
|
8039 |
|
8040 | var set$3 = global$9.setImmediate;
|
8041 | var clear = global$9.clearImmediate;
|
8042 | var process$2 = global$9.process;
|
8043 | var Dispatch = global$9.Dispatch;
|
8044 | var Function$2 = global$9.Function;
|
8045 | var MessageChannel = global$9.MessageChannel;
|
8046 | var String$1 = global$9.String;
|
8047 | var counter = 0;
|
8048 | var queue$2 = {};
|
8049 | var ONREADYSTATECHANGE = 'onreadystatechange';
|
8050 | var $location, defer, channel, port;
|
8051 |
|
8052 | fails$8(function () {
|
8053 |
|
8054 | $location = global$9.location;
|
8055 | });
|
8056 |
|
8057 | var run = function (id) {
|
8058 | if (hasOwn$4(queue$2, id)) {
|
8059 | var fn = queue$2[id];
|
8060 | delete queue$2[id];
|
8061 | fn();
|
8062 | }
|
8063 | };
|
8064 |
|
8065 | var runner = function (id) {
|
8066 | return function () {
|
8067 | run(id);
|
8068 | };
|
8069 | };
|
8070 |
|
8071 | var eventListener = function (event) {
|
8072 | run(event.data);
|
8073 | };
|
8074 |
|
8075 | var globalPostMessageDefer = function (id) {
|
8076 |
|
8077 | global$9.postMessage(String$1(id), $location.protocol + '//' + $location.host);
|
8078 | };
|
8079 |
|
8080 |
|
8081 | if (!set$3 || !clear) {
|
8082 | set$3 = function setImmediate(handler) {
|
8083 | validateArgumentsLength$1(arguments.length, 1);
|
8084 | var fn = isCallable$5(handler) ? handler : Function$2(handler);
|
8085 | var args = arraySlice$2(arguments, 1);
|
8086 | queue$2[++counter] = function () {
|
8087 | apply$2(fn, undefined, args);
|
8088 | };
|
8089 | defer(counter);
|
8090 | return counter;
|
8091 | };
|
8092 | clear = function clearImmediate(id) {
|
8093 | delete queue$2[id];
|
8094 | };
|
8095 |
|
8096 | if (IS_NODE$3) {
|
8097 | defer = function (id) {
|
8098 | process$2.nextTick(runner(id));
|
8099 | };
|
8100 |
|
8101 | } else if (Dispatch && Dispatch.now) {
|
8102 | defer = function (id) {
|
8103 | Dispatch.now(runner(id));
|
8104 | };
|
8105 |
|
8106 |
|
8107 | } else if (MessageChannel && !IS_IOS$1) {
|
8108 | channel = new MessageChannel();
|
8109 | port = channel.port2;
|
8110 | channel.port1.onmessage = eventListener;
|
8111 | defer = bind$3(port.postMessage, port);
|
8112 |
|
8113 |
|
8114 | } else if (
|
8115 | global$9.addEventListener &&
|
8116 | isCallable$5(global$9.postMessage) &&
|
8117 | !global$9.importScripts &&
|
8118 | $location && $location.protocol !== 'file:' &&
|
8119 | !fails$8(globalPostMessageDefer)
|
8120 | ) {
|
8121 | defer = globalPostMessageDefer;
|
8122 | global$9.addEventListener('message', eventListener, false);
|
8123 |
|
8124 | } else if (ONREADYSTATECHANGE in createElement('script')) {
|
8125 | defer = function (id) {
|
8126 | html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
|
8127 | html.removeChild(this);
|
8128 | run(id);
|
8129 | };
|
8130 | };
|
8131 |
|
8132 | } else {
|
8133 | defer = function (id) {
|
8134 | setTimeout(runner(id), 0);
|
8135 | };
|
8136 | }
|
8137 | }
|
8138 |
|
8139 | var task$1 = {
|
8140 | set: set$3,
|
8141 | clear: clear
|
8142 | };
|
8143 |
|
8144 | var Queue$3 = function () {
|
8145 | this.head = null;
|
8146 | this.tail = null;
|
8147 | };
|
8148 |
|
8149 | Queue$3.prototype = {
|
8150 | add: function (item) {
|
8151 | var entry = { item: item, next: null };
|
8152 | var tail = this.tail;
|
8153 | if (tail) tail.next = entry;
|
8154 | else this.head = entry;
|
8155 | this.tail = entry;
|
8156 | },
|
8157 | get: function () {
|
8158 | var entry = this.head;
|
8159 | if (entry) {
|
8160 | var next = this.head = entry.next;
|
8161 | if (next === null) this.tail = null;
|
8162 | return entry.item;
|
8163 | }
|
8164 | }
|
8165 | };
|
8166 |
|
8167 | var queue$1 = Queue$3;
|
8168 |
|
8169 | var userAgent$3 = engineUserAgent;
|
8170 |
|
8171 | var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$3) && typeof Pebble != 'undefined';
|
8172 |
|
8173 | var userAgent$2 = engineUserAgent;
|
8174 |
|
8175 | var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent$2);
|
8176 |
|
8177 | var global$8 = global$p;
|
8178 | var bind$2 = functionBindContext;
|
8179 | var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
8180 | var macrotask = task$1.set;
|
8181 | var Queue$2 = queue$1;
|
8182 | var IS_IOS = engineIsIos;
|
8183 | var IS_IOS_PEBBLE = engineIsIosPebble;
|
8184 | var IS_WEBOS_WEBKIT = engineIsWebosWebkit;
|
8185 | var IS_NODE$2 = engineIsNode;
|
8186 |
|
8187 | var MutationObserver = global$8.MutationObserver || global$8.WebKitMutationObserver;
|
8188 | var document$2 = global$8.document;
|
8189 | var process$1 = global$8.process;
|
8190 | var Promise$1 = global$8.Promise;
|
8191 | // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
|
8192 | var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global$8, 'queueMicrotask');
|
8193 | var microtask$1 = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
|
8194 | var notify$1, toggle, node, promise$5, then;
|
8195 |
|
8196 | // modern engines have queueMicrotask method
|
8197 | if (!microtask$1) {
|
8198 | var queue = new Queue$2();
|
8199 |
|
8200 | var flush = function () {
|
8201 | var parent, fn;
|
8202 | if (IS_NODE$2 && (parent = process$1.domain)) parent.exit();
|
8203 | while (fn = queue.get()) try {
|
8204 | fn();
|
8205 | } catch (error) {
|
8206 | if (queue.head) notify$1();
|
8207 | throw error;
|
8208 | }
|
8209 | if (parent) parent.enter();
|
8210 | };
|
8211 |
|
8212 |
|
8213 |
|
8214 | if (!IS_IOS && !IS_NODE$2 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
|
8215 | toggle = true;
|
8216 | node = document$2.createTextNode('');
|
8217 | new MutationObserver(flush).observe(node, { characterData: true });
|
8218 | notify$1 = function () {
|
8219 | node.data = toggle = !toggle;
|
8220 | };
|
8221 |
|
8222 | } else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
|
8223 |
|
8224 | promise$5 = Promise$1.resolve(undefined);
|
8225 |
|
8226 | promise$5.constructor = Promise$1;
|
8227 | then = bind$2(promise$5.then, promise$5);
|
8228 | notify$1 = function () {
|
8229 | then(flush);
|
8230 | };
|
8231 |
|
8232 | } else if (IS_NODE$2) {
|
8233 | notify$1 = function () {
|
8234 | process$1.nextTick(flush);
|
8235 | };
|
8236 |
|
8237 |
|
8238 |
|
8239 |
|
8240 |
|
8241 |
|
8242 | } else {
|
8243 |
|
8244 | macrotask = bind$2(macrotask, global$8);
|
8245 | notify$1 = function () {
|
8246 | macrotask(flush);
|
8247 | };
|
8248 | }
|
8249 |
|
8250 | microtask$1 = function (fn) {
|
8251 | if (!queue.head) notify$1();
|
8252 | queue.add(fn);
|
8253 | };
|
8254 | }
|
8255 |
|
8256 | var microtask_1 = microtask$1;
|
8257 |
|
8258 | var hostReportErrors$1 = function (a, b) {
|
8259 | try {
|
8260 |
|
8261 | arguments.length === 1 ? console.error(a) : console.error(a, b);
|
8262 | } catch (error) { }
|
8263 | };
|
8264 |
|
8265 | var perform$6 = function (exec) {
|
8266 | try {
|
8267 | return { error: false, value: exec() };
|
8268 | } catch (error) {
|
8269 | return { error: true, value: error };
|
8270 | }
|
8271 | };
|
8272 |
|
8273 | var global$7 = global$p;
|
8274 |
|
8275 | var promiseNativeConstructor = global$7.Promise;
|
8276 |
|
8277 |
|
8278 | var engineIsDeno = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';
|
8279 |
|
8280 | var IS_DENO$1 = engineIsDeno;
|
8281 | var IS_NODE$1 = engineIsNode;
|
8282 |
|
8283 | var engineIsBrowser = !IS_DENO$1 && !IS_NODE$1
|
8284 | && typeof window == 'object'
|
8285 | && typeof document == 'object';
|
8286 |
|
8287 | var global$6 = global$p;
|
8288 | var NativePromiseConstructor$5 = promiseNativeConstructor;
|
8289 | var isCallable$4 = isCallable$m;
|
8290 | var isForced = isForced_1;
|
8291 | var inspectSource = inspectSource$2;
|
8292 | var wellKnownSymbol = wellKnownSymbol$n;
|
8293 | var IS_BROWSER = engineIsBrowser;
|
8294 | var IS_DENO = engineIsDeno;
|
8295 | var V8_VERSION = engineV8Version;
|
8296 |
|
8297 | var NativePromisePrototype$2 = NativePromiseConstructor$5 && NativePromiseConstructor$5.prototype;
|
8298 | var SPECIES = wellKnownSymbol('species');
|
8299 | var SUBCLASSING = false;
|
8300 | var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$4(global$6.PromiseRejectionEvent);
|
8301 |
|
8302 | var FORCED_PROMISE_CONSTRUCTOR$5 = isForced('Promise', function () {
|
8303 | var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor$5);
|
8304 | var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$5);
|
8305 |
|
8306 |
|
8307 |
|
8308 | if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
|
8309 |
|
8310 | if (!(NativePromisePrototype$2['catch'] && NativePromisePrototype$2['finally'])) return true;
|
8311 |
|
8312 |
|
8313 |
|
8314 | if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
|
8315 |
|
8316 | var promise = new NativePromiseConstructor$5(function (resolve) { resolve(1); });
|
8317 | var FakePromise = function (exec) {
|
8318 | exec(function () { }, function () { });
|
8319 | };
|
8320 | var constructor = promise.constructor = {};
|
8321 | constructor[SPECIES] = FakePromise;
|
8322 | SUBCLASSING = promise.then(function () { }) instanceof FakePromise;
|
8323 | if (!SUBCLASSING) return true;
|
8324 |
|
8325 | } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT$1;
|
8326 | });
|
8327 |
|
8328 | var promiseConstructorDetection = {
|
8329 | CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
|
8330 | REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
|
8331 | SUBCLASSING: SUBCLASSING
|
8332 | };
|
8333 |
|
8334 | var newPromiseCapability$2 = {};
|
8335 |
|
8336 | var aCallable$6 = aCallable$e;
|
8337 |
|
8338 | var $TypeError$1 = TypeError;
|
8339 |
|
8340 | var PromiseCapability = function (C) {
|
8341 | var resolve, reject;
|
8342 | this.promise = new C(function ($$resolve, $$reject) {
|
8343 | if (resolve !== undefined || reject !== undefined) throw new $TypeError$1('Bad Promise constructor');
|
8344 | resolve = $$resolve;
|
8345 | reject = $$reject;
|
8346 | });
|
8347 | this.resolve = aCallable$6(resolve);
|
8348 | this.reject = aCallable$6(reject);
|
8349 | };
|
8350 |
|
8351 |
|
8352 |
|
8353 | newPromiseCapability$2.f = function (C) {
|
8354 | return new PromiseCapability(C);
|
8355 | };
|
8356 |
|
8357 | var $$l = _export;
|
8358 | var IS_NODE = engineIsNode;
|
8359 | var global$5 = global$p;
|
8360 | var call$6 = functionCall;
|
8361 | var defineBuiltIn$1 = defineBuiltIn$6;
|
8362 | var setToStringTag$1 = setToStringTag$7;
|
8363 | var setSpecies$1 = setSpecies$2;
|
8364 | var aCallable$5 = aCallable$e;
|
8365 | var isCallable$3 = isCallable$m;
|
8366 | var isObject$4 = isObject$h;
|
8367 | var anInstance$2 = anInstance$3;
|
8368 | var speciesConstructor$1 = speciesConstructor$2;
|
8369 | var task = task$1.set;
|
8370 | var microtask = microtask_1;
|
8371 | var hostReportErrors = hostReportErrors$1;
|
8372 | var perform$5 = perform$6;
|
8373 | var Queue$1 = queue$1;
|
8374 | var InternalStateModule$2 = internalState;
|
8375 | var NativePromiseConstructor$4 = promiseNativeConstructor;
|
8376 | var PromiseConstructorDetection = promiseConstructorDetection;
|
8377 | var newPromiseCapabilityModule$7 = newPromiseCapability$2;
|
8378 |
|
8379 | var PROMISE = 'Promise';
|
8380 | var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR;
|
8381 | var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
|
8382 | PromiseConstructorDetection.SUBCLASSING;
|
8383 | var getInternalPromiseState = InternalStateModule$2.getterFor(PROMISE);
|
8384 | var setInternalState$2 = InternalStateModule$2.set;
|
8385 | var NativePromisePrototype$1 = NativePromiseConstructor$4 && NativePromiseConstructor$4.prototype;
|
8386 | var PromiseConstructor = NativePromiseConstructor$4;
|
8387 | var PromisePrototype = NativePromisePrototype$1;
|
8388 | var TypeError$1 = global$5.TypeError;
|
8389 | var document$1 = global$5.document;
|
8390 | var process = global$5.process;
|
8391 | var newPromiseCapability$1 = newPromiseCapabilityModule$7.f;
|
8392 | var newGenericPromiseCapability = newPromiseCapability$1;
|
8393 |
|
8394 | var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$5.dispatchEvent);
|
8395 | var UNHANDLED_REJECTION = 'unhandledrejection';
|
8396 | var REJECTION_HANDLED = 'rejectionhandled';
|
8397 | var PENDING = 0;
|
8398 | var FULFILLED = 1;
|
8399 | var REJECTED = 2;
|
8400 | var HANDLED = 1;
|
8401 | var UNHANDLED = 2;
|
8402 |
|
8403 | var Internal, OwnPromiseCapability, PromiseWrapper;
|
8404 |
|
8405 | // helpers
|
8406 | var isThenable = function (it) {
|
8407 | var then;
|
8408 | return isObject$4(it) && isCallable$3(then = it.then) ? then : false;
|
8409 | };
|
8410 |
|
8411 | var callReaction = function (reaction, state) {
|
8412 | var value = state.value;
|
8413 | var ok = state.state === FULFILLED;
|
8414 | var handler = ok ? reaction.ok : reaction.fail;
|
8415 | var resolve = reaction.resolve;
|
8416 | var reject = reaction.reject;
|
8417 | var domain = reaction.domain;
|
8418 | var result, then, exited;
|
8419 | try {
|
8420 | if (handler) {
|
8421 | if (!ok) {
|
8422 | if (state.rejection === UNHANDLED) onHandleUnhandled(state);
|
8423 | state.rejection = HANDLED;
|
8424 | }
|
8425 | if (handler === true) result = value;
|
8426 | else {
|
8427 | if (domain) domain.enter();
|
8428 | result = handler(value);
|
8429 | if (domain) {
|
8430 | domain.exit();
|
8431 | exited = true;
|
8432 | }
|
8433 | }
|
8434 | if (result === reaction.promise) {
|
8435 | reject(new TypeError$1('Promise-chain cycle'));
|
8436 | } else if (then = isThenable(result)) {
|
8437 | call$6(then, result, resolve, reject);
|
8438 | } else resolve(result);
|
8439 | } else reject(value);
|
8440 | } catch (error) {
|
8441 | if (domain && !exited) domain.exit();
|
8442 | reject(error);
|
8443 | }
|
8444 | };
|
8445 |
|
8446 | var notify = function (state, isReject) {
|
8447 | if (state.notified) return;
|
8448 | state.notified = true;
|
8449 | microtask(function () {
|
8450 | var reactions = state.reactions;
|
8451 | var reaction;
|
8452 | while (reaction = reactions.get()) {
|
8453 | callReaction(reaction, state);
|
8454 | }
|
8455 | state.notified = false;
|
8456 | if (isReject && !state.rejection) onUnhandled(state);
|
8457 | });
|
8458 | };
|
8459 |
|
8460 | var dispatchEvent = function (name, promise, reason) {
|
8461 | var event, handler;
|
8462 | if (DISPATCH_EVENT) {
|
8463 | event = document$1.createEvent('Event');
|
8464 | event.promise = promise;
|
8465 | event.reason = reason;
|
8466 | event.initEvent(name, false, true);
|
8467 | global$5.dispatchEvent(event);
|
8468 | } else event = { promise: promise, reason: reason };
|
8469 | if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global$5['on' + name])) handler(event);
|
8470 | else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
|
8471 | };
|
8472 |
|
8473 | var onUnhandled = function (state) {
|
8474 | call$6(task, global$5, function () {
|
8475 | var promise = state.facade;
|
8476 | var value = state.value;
|
8477 | var IS_UNHANDLED = isUnhandled(state);
|
8478 | var result;
|
8479 | if (IS_UNHANDLED) {
|
8480 | result = perform$5(function () {
|
8481 | if (IS_NODE) {
|
8482 | process.emit('unhandledRejection', value, promise);
|
8483 | } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
|
8484 | });
|
8485 |
|
8486 | state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
|
8487 | if (result.error) throw result.value;
|
8488 | }
|
8489 | });
|
8490 | };
|
8491 |
|
8492 | var isUnhandled = function (state) {
|
8493 | return state.rejection !== HANDLED && !state.parent;
|
8494 | };
|
8495 |
|
8496 | var onHandleUnhandled = function (state) {
|
8497 | call$6(task, global$5, function () {
|
8498 | var promise = state.facade;
|
8499 | if (IS_NODE) {
|
8500 | process.emit('rejectionHandled', promise);
|
8501 | } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
|
8502 | });
|
8503 | };
|
8504 |
|
8505 | var bind$1 = function (fn, state, unwrap) {
|
8506 | return function (value) {
|
8507 | fn(state, value, unwrap);
|
8508 | };
|
8509 | };
|
8510 |
|
8511 | var internalReject = function (state, value, unwrap) {
|
8512 | if (state.done) return;
|
8513 | state.done = true;
|
8514 | if (unwrap) state = unwrap;
|
8515 | state.value = value;
|
8516 | state.state = REJECTED;
|
8517 | notify(state, true);
|
8518 | };
|
8519 |
|
8520 | var internalResolve = function (state, value, unwrap) {
|
8521 | if (state.done) return;
|
8522 | state.done = true;
|
8523 | if (unwrap) state = unwrap;
|
8524 | try {
|
8525 | if (state.facade === value) throw new TypeError$1("Promise can't be resolved itself");
|
8526 | var then = isThenable(value);
|
8527 | if (then) {
|
8528 | microtask(function () {
|
8529 | var wrapper = { done: false };
|
8530 | try {
|
8531 | call$6(then, value,
|
8532 | bind$1(internalResolve, wrapper, state),
|
8533 | bind$1(internalReject, wrapper, state)
|
8534 | );
|
8535 | } catch (error) {
|
8536 | internalReject(wrapper, error, state);
|
8537 | }
|
8538 | });
|
8539 | } else {
|
8540 | state.value = value;
|
8541 | state.state = FULFILLED;
|
8542 | notify(state, false);
|
8543 | }
|
8544 | } catch (error) {
|
8545 | internalReject({ done: false }, error, state);
|
8546 | }
|
8547 | };
|
8548 |
|
8549 |
|
8550 | if (FORCED_PROMISE_CONSTRUCTOR$4) {
|
8551 |
|
8552 | PromiseConstructor = function Promise(executor) {
|
8553 | anInstance$2(this, PromisePrototype);
|
8554 | aCallable$5(executor);
|
8555 | call$6(Internal, this);
|
8556 | var state = getInternalPromiseState(this);
|
8557 | try {
|
8558 | executor(bind$1(internalResolve, state), bind$1(internalReject, state));
|
8559 | } catch (error) {
|
8560 | internalReject(state, error);
|
8561 | }
|
8562 | };
|
8563 |
|
8564 | PromisePrototype = PromiseConstructor.prototype;
|
8565 |
|
8566 |
|
8567 | Internal = function Promise(executor) {
|
8568 | setInternalState$2(this, {
|
8569 | type: PROMISE,
|
8570 | done: false,
|
8571 | notified: false,
|
8572 | parent: false,
|
8573 | reactions: new Queue$1(),
|
8574 | rejection: false,
|
8575 | state: PENDING,
|
8576 | value: undefined
|
8577 | });
|
8578 | };
|
8579 |
|
8580 |
|
8581 |
|
8582 | Internal.prototype = defineBuiltIn$1(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
|
8583 | var state = getInternalPromiseState(this);
|
8584 | var reaction = newPromiseCapability$1(speciesConstructor$1(this, PromiseConstructor));
|
8585 | state.parent = true;
|
8586 | reaction.ok = isCallable$3(onFulfilled) ? onFulfilled : true;
|
8587 | reaction.fail = isCallable$3(onRejected) && onRejected;
|
8588 | reaction.domain = IS_NODE ? process.domain : undefined;
|
8589 | if (state.state === PENDING) state.reactions.add(reaction);
|
8590 | else microtask(function () {
|
8591 | callReaction(reaction, state);
|
8592 | });
|
8593 | return reaction.promise;
|
8594 | });
|
8595 |
|
8596 | OwnPromiseCapability = function () {
|
8597 | var promise = new Internal();
|
8598 | var state = getInternalPromiseState(promise);
|
8599 | this.promise = promise;
|
8600 | this.resolve = bind$1(internalResolve, state);
|
8601 | this.reject = bind$1(internalReject, state);
|
8602 | };
|
8603 |
|
8604 | newPromiseCapabilityModule$7.f = newPromiseCapability$1 = function (C) {
|
8605 | return C === PromiseConstructor || C === PromiseWrapper
|
8606 | ? new OwnPromiseCapability(C)
|
8607 | : newGenericPromiseCapability(C);
|
8608 | };
|
8609 | }
|
8610 |
|
8611 | $$l({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
|
8612 | Promise: PromiseConstructor
|
8613 | });
|
8614 |
|
8615 | setToStringTag$1(PromiseConstructor, PROMISE, false, true);
|
8616 | setSpecies$1(PROMISE);
|
8617 |
|
8618 | var NativePromiseConstructor$3 = promiseNativeConstructor;
|
8619 | var checkCorrectnessOfIteration = checkCorrectnessOfIteration$2;
|
8620 | var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
|
8621 |
|
8622 | var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function (iterable) {
|
8623 | NativePromiseConstructor$3.all(iterable).then(undefined, function () { });
|
8624 | });
|
8625 |
|
8626 | var $$k = _export;
|
8627 | var call$5 = functionCall;
|
8628 | var aCallable$4 = aCallable$e;
|
8629 | var newPromiseCapabilityModule$6 = newPromiseCapability$2;
|
8630 | var perform$4 = perform$6;
|
8631 | var iterate$5 = iterate$7;
|
8632 | var PROMISE_STATICS_INCORRECT_ITERATION$3 = promiseStaticsIncorrectIteration;
|
8633 |
|
8634 |
|
8635 |
|
8636 | $$k({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$3 }, {
|
8637 | all: function all(iterable) {
|
8638 | var C = this;
|
8639 | var capability = newPromiseCapabilityModule$6.f(C);
|
8640 | var resolve = capability.resolve;
|
8641 | var reject = capability.reject;
|
8642 | var result = perform$4(function () {
|
8643 | var $promiseResolve = aCallable$4(C.resolve);
|
8644 | var values = [];
|
8645 | var counter = 0;
|
8646 | var remaining = 1;
|
8647 | iterate$5(iterable, function (promise) {
|
8648 | var index = counter++;
|
8649 | var alreadyCalled = false;
|
8650 | remaining++;
|
8651 | call$5($promiseResolve, C, promise).then(function (value) {
|
8652 | if (alreadyCalled) return;
|
8653 | alreadyCalled = true;
|
8654 | values[index] = value;
|
8655 | --remaining || resolve(values);
|
8656 | }, reject);
|
8657 | });
|
8658 | --remaining || resolve(values);
|
8659 | });
|
8660 | if (result.error) reject(result.value);
|
8661 | return capability.promise;
|
8662 | }
|
8663 | });
|
8664 |
|
8665 | var $$j = _export;
|
8666 | var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
|
8667 | var NativePromiseConstructor$2 = promiseNativeConstructor;
|
8668 |
|
8669 | NativePromiseConstructor$2 && NativePromiseConstructor$2.prototype;
|
8670 |
|
8671 |
|
8672 |
|
8673 | $$j({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
|
8674 | 'catch': function (onRejected) {
|
8675 | return this.then(undefined, onRejected);
|
8676 | }
|
8677 | });
|
8678 |
|
8679 | var $$i = _export;
|
8680 | var call$4 = functionCall;
|
8681 | var aCallable$3 = aCallable$e;
|
8682 | var newPromiseCapabilityModule$5 = newPromiseCapability$2;
|
8683 | var perform$3 = perform$6;
|
8684 | var iterate$4 = iterate$7;
|
8685 | var PROMISE_STATICS_INCORRECT_ITERATION$2 = promiseStaticsIncorrectIteration;
|
8686 |
|
8687 |
|
8688 |
|
8689 | $$i({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$2 }, {
|
8690 | race: function race(iterable) {
|
8691 | var C = this;
|
8692 | var capability = newPromiseCapabilityModule$5.f(C);
|
8693 | var reject = capability.reject;
|
8694 | var result = perform$3(function () {
|
8695 | var $promiseResolve = aCallable$3(C.resolve);
|
8696 | iterate$4(iterable, function (promise) {
|
8697 | call$4($promiseResolve, C, promise).then(capability.resolve, reject);
|
8698 | });
|
8699 | });
|
8700 | if (result.error) reject(result.value);
|
8701 | return capability.promise;
|
8702 | }
|
8703 | });
|
8704 |
|
8705 | var $$h = _export;
|
8706 | var call$3 = functionCall;
|
8707 | var newPromiseCapabilityModule$4 = newPromiseCapability$2;
|
8708 | var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
|
8709 |
|
8710 |
|
8711 |
|
8712 | $$h({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
|
8713 | reject: function reject(r) {
|
8714 | var capability = newPromiseCapabilityModule$4.f(this);
|
8715 | call$3(capability.reject, undefined, r);
|
8716 | return capability.promise;
|
8717 | }
|
8718 | });
|
8719 |
|
8720 | var anObject = anObject$d;
|
8721 | var isObject$3 = isObject$h;
|
8722 | var newPromiseCapability = newPromiseCapability$2;
|
8723 |
|
8724 | var promiseResolve$2 = function (C, x) {
|
8725 | anObject(C);
|
8726 | if (isObject$3(x) && x.constructor === C) return x;
|
8727 | var promiseCapability = newPromiseCapability.f(C);
|
8728 | var resolve = promiseCapability.resolve;
|
8729 | resolve(x);
|
8730 | return promiseCapability.promise;
|
8731 | };
|
8732 |
|
8733 | var $$g = _export;
|
8734 | var getBuiltIn$2 = getBuiltIn$f;
|
8735 | var IS_PURE = isPure;
|
8736 | var NativePromiseConstructor$1 = promiseNativeConstructor;
|
8737 | var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
|
8738 | var promiseResolve$1 = promiseResolve$2;
|
8739 |
|
8740 | var PromiseConstructorWrapper = getBuiltIn$2('Promise');
|
8741 | var CHECK_WRAPPER = !FORCED_PROMISE_CONSTRUCTOR;
|
8742 |
|
8743 |
|
8744 |
|
8745 | $$g({ target: 'Promise', stat: true, forced: IS_PURE }, {
|
8746 | resolve: function resolve(x) {
|
8747 | return promiseResolve$1(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor$1 : this, x);
|
8748 | }
|
8749 | });
|
8750 |
|
8751 | var $$f = _export;
|
8752 | var call$2 = functionCall;
|
8753 | var aCallable$2 = aCallable$e;
|
8754 | var newPromiseCapabilityModule$3 = newPromiseCapability$2;
|
8755 | var perform$2 = perform$6;
|
8756 | var iterate$3 = iterate$7;
|
8757 | var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
|
8758 |
|
8759 |
|
8760 |
|
8761 | $$f({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
|
8762 | allSettled: function allSettled(iterable) {
|
8763 | var C = this;
|
8764 | var capability = newPromiseCapabilityModule$3.f(C);
|
8765 | var resolve = capability.resolve;
|
8766 | var reject = capability.reject;
|
8767 | var result = perform$2(function () {
|
8768 | var promiseResolve = aCallable$2(C.resolve);
|
8769 | var values = [];
|
8770 | var counter = 0;
|
8771 | var remaining = 1;
|
8772 | iterate$3(iterable, function (promise) {
|
8773 | var index = counter++;
|
8774 | var alreadyCalled = false;
|
8775 | remaining++;
|
8776 | call$2(promiseResolve, C, promise).then(function (value) {
|
8777 | if (alreadyCalled) return;
|
8778 | alreadyCalled = true;
|
8779 | values[index] = { status: 'fulfilled', value: value };
|
8780 | --remaining || resolve(values);
|
8781 | }, function (error) {
|
8782 | if (alreadyCalled) return;
|
8783 | alreadyCalled = true;
|
8784 | values[index] = { status: 'rejected', reason: error };
|
8785 | --remaining || resolve(values);
|
8786 | });
|
8787 | });
|
8788 | --remaining || resolve(values);
|
8789 | });
|
8790 | if (result.error) reject(result.value);
|
8791 | return capability.promise;
|
8792 | }
|
8793 | });
|
8794 |
|
8795 | var $$e = _export;
|
8796 | var call$1 = functionCall;
|
8797 | var aCallable$1 = aCallable$e;
|
8798 | var getBuiltIn$1 = getBuiltIn$f;
|
8799 | var newPromiseCapabilityModule$2 = newPromiseCapability$2;
|
8800 | var perform$1 = perform$6;
|
8801 | var iterate$2 = iterate$7;
|
8802 | var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
|
8803 |
|
8804 | var PROMISE_ANY_ERROR = 'No one promise resolved';
|
8805 |
|
8806 |
|
8807 |
|
8808 | $$e({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
|
8809 | any: function any(iterable) {
|
8810 | var C = this;
|
8811 | var AggregateError = getBuiltIn$1('AggregateError');
|
8812 | var capability = newPromiseCapabilityModule$2.f(C);
|
8813 | var resolve = capability.resolve;
|
8814 | var reject = capability.reject;
|
8815 | var result = perform$1(function () {
|
8816 | var promiseResolve = aCallable$1(C.resolve);
|
8817 | var errors = [];
|
8818 | var counter = 0;
|
8819 | var remaining = 1;
|
8820 | var alreadyResolved = false;
|
8821 | iterate$2(iterable, function (promise) {
|
8822 | var index = counter++;
|
8823 | var alreadyRejected = false;
|
8824 | remaining++;
|
8825 | call$1(promiseResolve, C, promise).then(function (value) {
|
8826 | if (alreadyRejected || alreadyResolved) return;
|
8827 | alreadyResolved = true;
|
8828 | resolve(value);
|
8829 | }, function (error) {
|
8830 | if (alreadyRejected || alreadyResolved) return;
|
8831 | alreadyRejected = true;
|
8832 | errors[index] = error;
|
8833 | --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
|
8834 | });
|
8835 | });
|
8836 | --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
|
8837 | });
|
8838 | if (result.error) reject(result.value);
|
8839 | return capability.promise;
|
8840 | }
|
8841 | });
|
8842 |
|
8843 | var $$d = _export;
|
8844 | var NativePromiseConstructor = promiseNativeConstructor;
|
8845 | var fails$7 = fails$u;
|
8846 | var getBuiltIn = getBuiltIn$f;
|
8847 | var isCallable$2 = isCallable$m;
|
8848 | var speciesConstructor = speciesConstructor$2;
|
8849 | var promiseResolve = promiseResolve$2;
|
8850 |
|
8851 | var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
|
8852 |
|
8853 |
|
8854 | var NON_GENERIC = !!NativePromiseConstructor && fails$7(function () {
|
8855 |
|
8856 | NativePromisePrototype['finally'].call({ then: function () { } }, function () { });
|
8857 | });
|
8858 |
|
8859 |
|
8860 |
|
8861 | $$d({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
|
8862 | 'finally': function (onFinally) {
|
8863 | var C = speciesConstructor(this, getBuiltIn('Promise'));
|
8864 | var isFunction = isCallable$2(onFinally);
|
8865 | return this.then(
|
8866 | isFunction ? function (x) {
|
8867 | return promiseResolve(C, onFinally()).then(function () { return x; });
|
8868 | } : onFinally,
|
8869 | isFunction ? function (e) {
|
8870 | return promiseResolve(C, onFinally()).then(function () { throw e; });
|
8871 | } : onFinally
|
8872 | );
|
8873 | }
|
8874 | });
|
8875 |
|
8876 | var path$7 = path$o;
|
8877 |
|
8878 | var promise$4 = path$7.Promise;
|
8879 |
|
8880 | var parent$l = promise$4;
|
8881 |
|
8882 |
|
8883 | var promise$3 = parent$l;
|
8884 |
|
8885 | var $$c = _export;
|
8886 | var newPromiseCapabilityModule$1 = newPromiseCapability$2;
|
8887 |
|
8888 |
|
8889 |
|
8890 | $$c({ target: 'Promise', stat: true }, {
|
8891 | withResolvers: function withResolvers() {
|
8892 | var promiseCapability = newPromiseCapabilityModule$1.f(this);
|
8893 | return {
|
8894 | promise: promiseCapability.promise,
|
8895 | resolve: promiseCapability.resolve,
|
8896 | reject: promiseCapability.reject
|
8897 | };
|
8898 | }
|
8899 | });
|
8900 |
|
8901 | var parent$k = promise$3;
|
8902 |
|
8903 |
|
8904 | var promise$2 = parent$k;
|
8905 |
|
8906 |
|
8907 | var $$b = _export;
|
8908 | var newPromiseCapabilityModule = newPromiseCapability$2;
|
8909 | var perform = perform$6;
|
8910 |
|
8911 |
|
8912 |
|
8913 | $$b({ target: 'Promise', stat: true, forced: true }, {
|
8914 | 'try': function (callbackfn) {
|
8915 | var promiseCapability = newPromiseCapabilityModule.f(this);
|
8916 | var result = perform(callbackfn);
|
8917 | (result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value);
|
8918 | return promiseCapability.promise;
|
8919 | }
|
8920 | });
|
8921 |
|
8922 | var parent$j = promise$2;
|
8923 |
|
8924 |
|
8925 |
|
8926 |
|
8927 |
|
8928 |
|
8929 | var promise$1 = parent$j;
|
8930 |
|
8931 | var promise = promise$1;
|
8932 |
|
8933 | var $$a = _export;
|
8934 | var uncurryThis$3 = functionUncurryThis;
|
8935 | var isArray$1 = isArray$e;
|
8936 |
|
8937 | var nativeReverse = uncurryThis$3([].reverse);
|
8938 | var test$1 = [1, 2];
|
8939 |
|
8940 |
|
8941 |
|
8942 |
|
8943 |
|
8944 | $$a({ target: 'Array', proto: true, forced: String(test$1) === String(test$1.reverse()) }, {
|
8945 | reverse: function reverse() {
|
8946 |
|
8947 | if (isArray$1(this)) this.length = this.length;
|
8948 | return nativeReverse(this);
|
8949 | }
|
8950 | });
|
8951 |
|
8952 | var getBuiltInPrototypeMethod$7 = getBuiltInPrototypeMethod$g;
|
8953 |
|
8954 | var reverse$5 = getBuiltInPrototypeMethod$7('Array', 'reverse');
|
8955 |
|
8956 | var isPrototypeOf$7 = objectIsPrototypeOf;
|
8957 | var method$7 = reverse$5;
|
8958 |
|
8959 | var ArrayPrototype$7 = Array.prototype;
|
8960 |
|
8961 | var reverse$4 = function (it) {
|
8962 | var own = it.reverse;
|
8963 | return it === ArrayPrototype$7 || (isPrototypeOf$7(ArrayPrototype$7, it) && own === ArrayPrototype$7.reverse) ? method$7 : own;
|
8964 | };
|
8965 |
|
8966 | var parent$i = reverse$4;
|
8967 |
|
8968 | var reverse$3 = parent$i;
|
8969 |
|
8970 | var parent$h = reverse$3;
|
8971 |
|
8972 | var reverse$2 = parent$h;
|
8973 |
|
8974 | var parent$g = reverse$2;
|
8975 |
|
8976 | var reverse$1 = parent$g;
|
8977 |
|
8978 | var reverse = reverse$1;
|
8979 |
|
8980 | (function (module) {
|
8981 | var _typeof = _typeofExports["default"];
|
8982 | var _Object$defineProperty = defineProperty$8;
|
8983 | var _Symbol = symbol$1;
|
8984 | var _Object$create = create$3;
|
8985 | var _Object$getPrototypeOf = getPrototypeOf$1;
|
8986 | var _forEachInstanceProperty = forEach$1;
|
8987 | var _pushInstanceProperty = push$2;
|
8988 | var _Object$setPrototypeOf = setPrototypeOf$1;
|
8989 | var _Promise = promise;
|
8990 | var _reverseInstanceProperty = reverse;
|
8991 | var _sliceInstanceProperty = slice;
|
8992 | function _regeneratorRuntime() {
|
8993 | module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
8994 | return e;
|
8995 | }, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
8996 | var t,
|
8997 | e = {},
|
8998 | r = Object.prototype,
|
8999 | n = r.hasOwnProperty,
|
9000 | o = _Object$defineProperty || function (t, e, r) {
|
9001 | t[e] = r.value;
|
9002 | },
|
9003 | i = "function" == typeof _Symbol ? _Symbol : {},
|
9004 | a = i.iterator || "@@iterator",
|
9005 | c = i.asyncIterator || "@@asyncIterator",
|
9006 | u = i.toStringTag || "@@toStringTag";
|
9007 | function define(t, e, r) {
|
9008 | return _Object$defineProperty(t, e, {
|
9009 | value: r,
|
9010 | enumerable: !0,
|
9011 | configurable: !0,
|
9012 | writable: !0
|
9013 | }), t[e];
|
9014 | }
|
9015 | try {
|
9016 | define({}, "");
|
9017 | } catch (t) {
|
9018 | define = function define(t, e, r) {
|
9019 | return t[e] = r;
|
9020 | };
|
9021 | }
|
9022 | function wrap(t, e, r, n) {
|
9023 | var i = e && e.prototype instanceof Generator ? e : Generator,
|
9024 | a = _Object$create(i.prototype),
|
9025 | c = new Context(n || []);
|
9026 | return o(a, "_invoke", {
|
9027 | value: makeInvokeMethod(t, r, c)
|
9028 | }), a;
|
9029 | }
|
9030 | function tryCatch(t, e, r) {
|
9031 | try {
|
9032 | return {
|
9033 | type: "normal",
|
9034 | arg: t.call(e, r)
|
9035 | };
|
9036 | } catch (t) {
|
9037 | return {
|
9038 | type: "throw",
|
9039 | arg: t
|
9040 | };
|
9041 | }
|
9042 | }
|
9043 | e.wrap = wrap;
|
9044 | var h = "suspendedStart",
|
9045 | l = "suspendedYield",
|
9046 | f = "executing",
|
9047 | s = "completed",
|
9048 | y = {};
|
9049 | function Generator() {}
|
9050 | function GeneratorFunction() {}
|
9051 | function GeneratorFunctionPrototype() {}
|
9052 | var p = {};
|
9053 | define(p, a, function () {
|
9054 | return this;
|
9055 | });
|
9056 | var d = _Object$getPrototypeOf,
|
9057 | v = d && d(d(values([])));
|
9058 | v && v !== r && n.call(v, a) && (p = v);
|
9059 | var g = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(p);
|
9060 | function defineIteratorMethods(t) {
|
9061 | var _context;
|
9062 | _forEachInstanceProperty(_context = ["next", "throw", "return"]).call(_context, function (e) {
|
9063 | define(t, e, function (t) {
|
9064 | return this._invoke(e, t);
|
9065 | });
|
9066 | });
|
9067 | }
|
9068 | function AsyncIterator(t, e) {
|
9069 | function invoke(r, o, i, a) {
|
9070 | var c = tryCatch(t[r], t, o);
|
9071 | if ("throw" !== c.type) {
|
9072 | var u = c.arg,
|
9073 | h = u.value;
|
9074 | return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
9075 | invoke("next", t, i, a);
|
9076 | }, function (t) {
|
9077 | invoke("throw", t, i, a);
|
9078 | }) : e.resolve(h).then(function (t) {
|
9079 | u.value = t, i(u);
|
9080 | }, function (t) {
|
9081 | return invoke("throw", t, i, a);
|
9082 | });
|
9083 | }
|
9084 | a(c.arg);
|
9085 | }
|
9086 | var r;
|
9087 | o(this, "_invoke", {
|
9088 | value: function value(t, n) {
|
9089 | function callInvokeWithMethodAndArg() {
|
9090 | return new e(function (e, r) {
|
9091 | invoke(t, n, e, r);
|
9092 | });
|
9093 | }
|
9094 | return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
9095 | }
|
9096 | });
|
9097 | }
|
9098 | function makeInvokeMethod(e, r, n) {
|
9099 | var o = h;
|
9100 | return function (i, a) {
|
9101 | if (o === f) throw new Error("Generator is already running");
|
9102 | if (o === s) {
|
9103 | if ("throw" === i) throw a;
|
9104 | return {
|
9105 | value: t,
|
9106 | done: !0
|
9107 | };
|
9108 | }
|
9109 | for (n.method = i, n.arg = a;;) {
|
9110 | var c = n.delegate;
|
9111 | if (c) {
|
9112 | var u = maybeInvokeDelegate(c, n);
|
9113 | if (u) {
|
9114 | if (u === y) continue;
|
9115 | return u;
|
9116 | }
|
9117 | }
|
9118 | if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
9119 | if (o === h) throw o = s, n.arg;
|
9120 | n.dispatchException(n.arg);
|
9121 | } else "return" === n.method && n.abrupt("return", n.arg);
|
9122 | o = f;
|
9123 | var p = tryCatch(e, r, n);
|
9124 | if ("normal" === p.type) {
|
9125 | if (o = n.done ? s : l, p.arg === y) continue;
|
9126 | return {
|
9127 | value: p.arg,
|
9128 | done: n.done
|
9129 | };
|
9130 | }
|
9131 | "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
9132 | }
|
9133 | };
|
9134 | }
|
9135 | function maybeInvokeDelegate(e, r) {
|
9136 | var n = r.method,
|
9137 | o = e.iterator[n];
|
9138 | if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
9139 | var i = tryCatch(o, e.iterator, r.arg);
|
9140 | if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
9141 | var a = i.arg;
|
9142 | return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
9143 | }
|
9144 | function pushTryEntry(t) {
|
9145 | var _context2;
|
9146 | var e = {
|
9147 | tryLoc: t[0]
|
9148 | };
|
9149 | 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), _pushInstanceProperty(_context2 = this.tryEntries).call(_context2, e);
|
9150 | }
|
9151 | function resetTryEntry(t) {
|
9152 | var e = t.completion || {};
|
9153 | e.type = "normal", delete e.arg, t.completion = e;
|
9154 | }
|
9155 | function Context(t) {
|
9156 | this.tryEntries = [{
|
9157 | tryLoc: "root"
|
9158 | }], _forEachInstanceProperty(t).call(t, pushTryEntry, this), this.reset(!0);
|
9159 | }
|
9160 | function values(e) {
|
9161 | if (e || "" === e) {
|
9162 | var r = e[a];
|
9163 | if (r) return r.call(e);
|
9164 | if ("function" == typeof e.next) return e;
|
9165 | if (!isNaN(e.length)) {
|
9166 | var o = -1,
|
9167 | i = function next() {
|
9168 | for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
9169 | return next.value = t, next.done = !0, next;
|
9170 | };
|
9171 | return i.next = i;
|
9172 | }
|
9173 | }
|
9174 | throw new TypeError(_typeof(e) + " is not iterable");
|
9175 | }
|
9176 | return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
9177 | value: GeneratorFunctionPrototype,
|
9178 | configurable: !0
|
9179 | }), o(GeneratorFunctionPrototype, "constructor", {
|
9180 | value: GeneratorFunction,
|
9181 | configurable: !0
|
9182 | }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
9183 | var e = "function" == typeof t && t.constructor;
|
9184 | return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
9185 | }, e.mark = function (t) {
|
9186 | return _Object$setPrototypeOf ? _Object$setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = _Object$create(g), t;
|
9187 | }, e.awrap = function (t) {
|
9188 | return {
|
9189 | __await: t
|
9190 | };
|
9191 | }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
9192 | return this;
|
9193 | }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
9194 | void 0 === i && (i = _Promise);
|
9195 | var a = new AsyncIterator(wrap(t, r, n, o), i);
|
9196 | return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
9197 | return t.done ? t.value : a.next();
|
9198 | });
|
9199 | }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
9200 | return this;
|
9201 | }), define(g, "toString", function () {
|
9202 | return "[object Generator]";
|
9203 | }), e.keys = function (t) {
|
9204 | var e = Object(t),
|
9205 | r = [];
|
9206 | for (var n in e) _pushInstanceProperty(r).call(r, n);
|
9207 | return _reverseInstanceProperty(r).call(r), function next() {
|
9208 | for (; r.length;) {
|
9209 | var t = r.pop();
|
9210 | if (t in e) return next.value = t, next.done = !1, next;
|
9211 | }
|
9212 | return next.done = !0, next;
|
9213 | };
|
9214 | }, e.values = values, Context.prototype = {
|
9215 | constructor: Context,
|
9216 | reset: function reset(e) {
|
9217 | var _context3;
|
9218 | if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, _forEachInstanceProperty(_context3 = this.tryEntries).call(_context3, resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+_sliceInstanceProperty(r).call(r, 1)) && (this[r] = t);
|
9219 | },
|
9220 | stop: function stop() {
|
9221 | this.done = !0;
|
9222 | var t = this.tryEntries[0].completion;
|
9223 | if ("throw" === t.type) throw t.arg;
|
9224 | return this.rval;
|
9225 | },
|
9226 | dispatchException: function dispatchException(e) {
|
9227 | if (this.done) throw e;
|
9228 | var r = this;
|
9229 | function handle(n, o) {
|
9230 | return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
9231 | }
|
9232 | for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
9233 | var i = this.tryEntries[o],
|
9234 | a = i.completion;
|
9235 | if ("root" === i.tryLoc) return handle("end");
|
9236 | if (i.tryLoc <= this.prev) {
|
9237 | var c = n.call(i, "catchLoc"),
|
9238 | u = n.call(i, "finallyLoc");
|
9239 | if (c && u) {
|
9240 | if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
9241 | if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
9242 | } else if (c) {
|
9243 | if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
9244 | } else {
|
9245 | if (!u) throw new Error("try statement without catch or finally");
|
9246 | if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
9247 | }
|
9248 | }
|
9249 | }
|
9250 | },
|
9251 | abrupt: function abrupt(t, e) {
|
9252 | for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
9253 | var o = this.tryEntries[r];
|
9254 | if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
9255 | var i = o;
|
9256 | break;
|
9257 | }
|
9258 | }
|
9259 | i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
9260 | var a = i ? i.completion : {};
|
9261 | return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
9262 | },
|
9263 | complete: function complete(t, e) {
|
9264 | if ("throw" === t.type) throw t.arg;
|
9265 | return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
9266 | },
|
9267 | finish: function finish(t) {
|
9268 | for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
9269 | var r = this.tryEntries[e];
|
9270 | if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
9271 | }
|
9272 | },
|
9273 | "catch": function _catch(t) {
|
9274 | for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
9275 | var r = this.tryEntries[e];
|
9276 | if (r.tryLoc === t) {
|
9277 | var n = r.completion;
|
9278 | if ("throw" === n.type) {
|
9279 | var o = n.arg;
|
9280 | resetTryEntry(r);
|
9281 | }
|
9282 | return o;
|
9283 | }
|
9284 | }
|
9285 | throw new Error("illegal catch attempt");
|
9286 | },
|
9287 | delegateYield: function delegateYield(e, r, n) {
|
9288 | return this.delegate = {
|
9289 | iterator: values(e),
|
9290 | resultName: r,
|
9291 | nextLoc: n
|
9292 | }, "next" === this.method && (this.arg = t), y;
|
9293 | }
|
9294 | }, e;
|
9295 | }
|
9296 | module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
9297 | } (regeneratorRuntime$1));
|
9298 |
|
9299 | var regeneratorRuntimeExports = regeneratorRuntime$1.exports;
|
9300 |
|
9301 |
|
9302 |
|
9303 | var runtime = regeneratorRuntimeExports();
|
9304 | var regenerator = runtime;
|
9305 |
|
9306 |
|
9307 | try {
|
9308 | regeneratorRuntime = runtime;
|
9309 | } catch (accidentalStrictMode) {
|
9310 | if (typeof globalThis === "object") {
|
9311 | globalThis.regeneratorRuntime = runtime;
|
9312 | } else {
|
9313 | Function("r", "regeneratorRuntime = r")(runtime);
|
9314 | }
|
9315 | }
|
9316 |
|
9317 | var _regeneratorRuntime = getDefaultExportFromCjs(regenerator);
|
9318 |
|
9319 | var isArray = isArray$6;
|
9320 |
|
9321 | var _Array$isArray = getDefaultExportFromCjs(isArray);
|
9322 |
|
9323 | var internalMetadata = {exports: {}};
|
9324 |
|
9325 |
|
9326 | var fails$6 = fails$u;
|
9327 |
|
9328 | var arrayBufferNonExtensible = fails$6(function () {
|
9329 | if (typeof ArrayBuffer == 'function') {
|
9330 | var buffer = new ArrayBuffer(8);
|
9331 |
|
9332 | if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
|
9333 | }
|
9334 | });
|
9335 |
|
9336 | var fails$5 = fails$u;
|
9337 | var isObject$2 = isObject$h;
|
9338 | var classof$3 = classofRaw$2;
|
9339 | var ARRAY_BUFFER_NON_EXTENSIBLE = arrayBufferNonExtensible;
|
9340 |
|
9341 |
|
9342 | var $isExtensible = Object.isExtensible;
|
9343 | var FAILS_ON_PRIMITIVES$1 = fails$5(function () { $isExtensible(1); });
|
9344 |
|
9345 |
|
9346 |
|
9347 | var objectIsExtensible = (FAILS_ON_PRIMITIVES$1 || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) {
|
9348 | if (!isObject$2(it)) return false;
|
9349 | if (ARRAY_BUFFER_NON_EXTENSIBLE && classof$3(it) === 'ArrayBuffer') return false;
|
9350 | return $isExtensible ? $isExtensible(it) : true;
|
9351 | } : $isExtensible;
|
9352 |
|
9353 | var fails$4 = fails$u;
|
9354 |
|
9355 | var freezing = !fails$4(function () {
|
9356 |
|
9357 | return Object.isExtensible(Object.preventExtensions({}));
|
9358 | });
|
9359 |
|
9360 | var $$9 = _export;
|
9361 | var uncurryThis$2 = functionUncurryThis;
|
9362 | var hiddenKeys = hiddenKeys$6;
|
9363 | var isObject$1 = isObject$h;
|
9364 | var hasOwn$3 = hasOwnProperty_1;
|
9365 | var defineProperty$2 = objectDefineProperty.f;
|
9366 | var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
9367 | var getOwnPropertyNamesExternalModule = objectGetOwnPropertyNamesExternal;
|
9368 | var isExtensible = objectIsExtensible;
|
9369 | var uid = uid$4;
|
9370 | var FREEZING = freezing;
|
9371 |
|
9372 | var REQUIRED = false;
|
9373 | var METADATA = uid('meta');
|
9374 | var id = 0;
|
9375 |
|
9376 | var setMetadata = function (it) {
|
9377 | defineProperty$2(it, METADATA, { value: {
|
9378 | objectID: 'O' + id++,
|
9379 | weakData: {}
|
9380 | } });
|
9381 | };
|
9382 |
|
9383 | var fastKey$1 = function (it, create) {
|
9384 |
|
9385 | if (!isObject$1(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
9386 | if (!hasOwn$3(it, METADATA)) {
|
9387 |
|
9388 | if (!isExtensible(it)) return 'F';
|
9389 |
|
9390 | if (!create) return 'E';
|
9391 |
|
9392 | setMetadata(it);
|
9393 |
|
9394 | } return it[METADATA].objectID;
|
9395 | };
|
9396 |
|
9397 | var getWeakData = function (it, create) {
|
9398 | if (!hasOwn$3(it, METADATA)) {
|
9399 |
|
9400 | if (!isExtensible(it)) return true;
|
9401 |
|
9402 | if (!create) return false;
|
9403 |
|
9404 | setMetadata(it);
|
9405 |
|
9406 | } return it[METADATA].weakData;
|
9407 | };
|
9408 |
|
9409 |
|
9410 | var onFreeze = function (it) {
|
9411 | if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn$3(it, METADATA)) setMetadata(it);
|
9412 | return it;
|
9413 | };
|
9414 |
|
9415 | var enable = function () {
|
9416 | meta.enable = function () { };
|
9417 | REQUIRED = true;
|
9418 | var getOwnPropertyNames = getOwnPropertyNamesModule.f;
|
9419 | var splice = uncurryThis$2([].splice);
|
9420 | var test = {};
|
9421 | test[METADATA] = 1;
|
9422 |
|
9423 |
|
9424 | if (getOwnPropertyNames(test).length) {
|
9425 | getOwnPropertyNamesModule.f = function (it) {
|
9426 | var result = getOwnPropertyNames(it);
|
9427 | for (var i = 0, length = result.length; i < length; i++) {
|
9428 | if (result[i] === METADATA) {
|
9429 | splice(result, i, 1);
|
9430 | break;
|
9431 | }
|
9432 | } return result;
|
9433 | };
|
9434 |
|
9435 | $$9({ target: 'Object', stat: true, forced: true }, {
|
9436 | getOwnPropertyNames: getOwnPropertyNamesExternalModule.f
|
9437 | });
|
9438 | }
|
9439 | };
|
9440 |
|
9441 | var meta = internalMetadata.exports = {
|
9442 | enable: enable,
|
9443 | fastKey: fastKey$1,
|
9444 | getWeakData: getWeakData,
|
9445 | onFreeze: onFreeze
|
9446 | };
|
9447 |
|
9448 | hiddenKeys[METADATA] = true;
|
9449 |
|
9450 | var internalMetadataExports = internalMetadata.exports;
|
9451 |
|
9452 | var $$8 = _export;
|
9453 | var global$4 = global$p;
|
9454 | var InternalMetadataModule = internalMetadataExports;
|
9455 | var fails$3 = fails$u;
|
9456 | var createNonEnumerableProperty = createNonEnumerableProperty$9;
|
9457 | var iterate$1 = iterate$7;
|
9458 | var anInstance$1 = anInstance$3;
|
9459 | var isCallable$1 = isCallable$m;
|
9460 | var isObject = isObject$h;
|
9461 | var isNullOrUndefined$1 = isNullOrUndefined$6;
|
9462 | var setToStringTag = setToStringTag$7;
|
9463 | var defineProperty$1 = objectDefineProperty.f;
|
9464 | var forEach = arrayIteration.forEach;
|
9465 | var DESCRIPTORS$2 = descriptors;
|
9466 | var InternalStateModule$1 = internalState;
|
9467 |
|
9468 | var setInternalState$1 = InternalStateModule$1.set;
|
9469 | var internalStateGetterFor$1 = InternalStateModule$1.getterFor;
|
9470 |
|
9471 | var collection$2 = function (CONSTRUCTOR_NAME, wrapper, common) {
|
9472 | var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
|
9473 | var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
|
9474 | var ADDER = IS_MAP ? 'set' : 'add';
|
9475 | var NativeConstructor = global$4[CONSTRUCTOR_NAME];
|
9476 | var NativePrototype = NativeConstructor && NativeConstructor.prototype;
|
9477 | var exported = {};
|
9478 | var Constructor;
|
9479 |
|
9480 | if (!DESCRIPTORS$2 || !isCallable$1(NativeConstructor)
|
9481 | || !(IS_WEAK || NativePrototype.forEach && !fails$3(function () { new NativeConstructor().entries().next(); }))
|
9482 | ) {
|
9483 |
|
9484 | Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
|
9485 | InternalMetadataModule.enable();
|
9486 | } else {
|
9487 | Constructor = wrapper(function (target, iterable) {
|
9488 | setInternalState$1(anInstance$1(target, Prototype), {
|
9489 | type: CONSTRUCTOR_NAME,
|
9490 | collection: new NativeConstructor()
|
9491 | });
|
9492 | if (!isNullOrUndefined$1(iterable)) iterate$1(iterable, target[ADDER], { that: target, AS_ENTRIES: IS_MAP });
|
9493 | });
|
9494 |
|
9495 | var Prototype = Constructor.prototype;
|
9496 |
|
9497 | var getInternalState = internalStateGetterFor$1(CONSTRUCTOR_NAME);
|
9498 |
|
9499 | forEach(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {
|
9500 | var IS_ADDER = KEY === 'add' || KEY === 'set';
|
9501 | if (KEY in NativePrototype && !(IS_WEAK && KEY === 'clear')) {
|
9502 | createNonEnumerableProperty(Prototype, KEY, function (a, b) {
|
9503 | var collection = getInternalState(this).collection;
|
9504 | if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY === 'get' ? undefined : false;
|
9505 | var result = collection[KEY](a === 0 ? 0 : a, b);
|
9506 | return IS_ADDER ? this : result;
|
9507 | });
|
9508 | }
|
9509 | });
|
9510 |
|
9511 | IS_WEAK || defineProperty$1(Prototype, 'size', {
|
9512 | configurable: true,
|
9513 | get: function () {
|
9514 | return getInternalState(this).collection.size;
|
9515 | }
|
9516 | });
|
9517 | }
|
9518 |
|
9519 | setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true);
|
9520 |
|
9521 | exported[CONSTRUCTOR_NAME] = Constructor;
|
9522 | $$8({ global: true, forced: true }, exported);
|
9523 |
|
9524 | if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
|
9525 |
|
9526 | return Constructor;
|
9527 | };
|
9528 |
|
9529 | var defineBuiltIn = defineBuiltIn$6;
|
9530 |
|
9531 | var defineBuiltIns$1 = function (target, src, options) {
|
9532 | for (var key in src) {
|
9533 | if (options && options.unsafe && target[key]) target[key] = src[key];
|
9534 | else defineBuiltIn(target, key, src[key], options);
|
9535 | } return target;
|
9536 | };
|
9537 |
|
9538 | var create$1 = objectCreate;
|
9539 | var defineBuiltInAccessor = defineBuiltInAccessor$3;
|
9540 | var defineBuiltIns = defineBuiltIns$1;
|
9541 | var bind = functionBindContext;
|
9542 | var anInstance = anInstance$3;
|
9543 | var isNullOrUndefined = isNullOrUndefined$6;
|
9544 | var iterate = iterate$7;
|
9545 | var defineIterator = iteratorDefine;
|
9546 | var createIterResultObject = createIterResultObject$3;
|
9547 | var setSpecies = setSpecies$2;
|
9548 | var DESCRIPTORS$1 = descriptors;
|
9549 | var fastKey = internalMetadataExports.fastKey;
|
9550 | var InternalStateModule = internalState;
|
9551 |
|
9552 | var setInternalState = InternalStateModule.set;
|
9553 | var internalStateGetterFor = InternalStateModule.getterFor;
|
9554 |
|
9555 | var collectionStrong$2 = {
|
9556 | getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
|
9557 | var Constructor = wrapper(function (that, iterable) {
|
9558 | anInstance(that, Prototype);
|
9559 | setInternalState(that, {
|
9560 | type: CONSTRUCTOR_NAME,
|
9561 | index: create$1(null),
|
9562 | first: undefined,
|
9563 | last: undefined,
|
9564 | size: 0
|
9565 | });
|
9566 | if (!DESCRIPTORS$1) that.size = 0;
|
9567 | if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
9568 | });
|
9569 |
|
9570 | var Prototype = Constructor.prototype;
|
9571 |
|
9572 | var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
9573 |
|
9574 | var define = function (that, key, value) {
|
9575 | var state = getInternalState(that);
|
9576 | var entry = getEntry(that, key);
|
9577 | var previous, index;
|
9578 |
|
9579 | if (entry) {
|
9580 | entry.value = value;
|
9581 |
|
9582 | } else {
|
9583 | state.last = entry = {
|
9584 | index: index = fastKey(key, true),
|
9585 | key: key,
|
9586 | value: value,
|
9587 | previous: previous = state.last,
|
9588 | next: undefined,
|
9589 | removed: false
|
9590 | };
|
9591 | if (!state.first) state.first = entry;
|
9592 | if (previous) previous.next = entry;
|
9593 | if (DESCRIPTORS$1) state.size++;
|
9594 | else that.size++;
|
9595 |
|
9596 | if (index !== 'F') state.index[index] = entry;
|
9597 | } return that;
|
9598 | };
|
9599 |
|
9600 | var getEntry = function (that, key) {
|
9601 | var state = getInternalState(that);
|
9602 |
|
9603 | var index = fastKey(key);
|
9604 | var entry;
|
9605 | if (index !== 'F') return state.index[index];
|
9606 |
|
9607 | for (entry = state.first; entry; entry = entry.next) {
|
9608 | if (entry.key === key) return entry;
|
9609 | }
|
9610 | };
|
9611 |
|
9612 | defineBuiltIns(Prototype, {
|
9613 |
|
9614 |
|
9615 |
|
9616 | clear: function clear() {
|
9617 | var that = this;
|
9618 | var state = getInternalState(that);
|
9619 | var data = state.index;
|
9620 | var entry = state.first;
|
9621 | while (entry) {
|
9622 | entry.removed = true;
|
9623 | if (entry.previous) entry.previous = entry.previous.next = undefined;
|
9624 | delete data[entry.index];
|
9625 | entry = entry.next;
|
9626 | }
|
9627 | state.first = state.last = undefined;
|
9628 | if (DESCRIPTORS$1) state.size = 0;
|
9629 | else that.size = 0;
|
9630 | },
|
9631 |
|
9632 |
|
9633 |
|
9634 | 'delete': function (key) {
|
9635 | var that = this;
|
9636 | var state = getInternalState(that);
|
9637 | var entry = getEntry(that, key);
|
9638 | if (entry) {
|
9639 | var next = entry.next;
|
9640 | var prev = entry.previous;
|
9641 | delete state.index[entry.index];
|
9642 | entry.removed = true;
|
9643 | if (prev) prev.next = next;
|
9644 | if (next) next.previous = prev;
|
9645 | if (state.first === entry) state.first = next;
|
9646 | if (state.last === entry) state.last = prev;
|
9647 | if (DESCRIPTORS$1) state.size--;
|
9648 | else that.size--;
|
9649 | } return !!entry;
|
9650 | },
|
9651 |
|
9652 |
|
9653 |
|
9654 | forEach: function forEach(callbackfn /* , that = undefined */) {
|
9655 | var state = getInternalState(this);
|
9656 | var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
9657 | var entry;
|
9658 | while (entry = entry ? entry.next : state.first) {
|
9659 | boundFunction(entry.value, entry.key, this);
|
9660 |
|
9661 | while (entry && entry.removed) entry = entry.previous;
|
9662 | }
|
9663 | },
|
9664 |
|
9665 |
|
9666 |
|
9667 | has: function has(key) {
|
9668 | return !!getEntry(this, key);
|
9669 | }
|
9670 | });
|
9671 |
|
9672 | defineBuiltIns(Prototype, IS_MAP ? {
|
9673 |
|
9674 |
|
9675 | get: function get(key) {
|
9676 | var entry = getEntry(this, key);
|
9677 | return entry && entry.value;
|
9678 | },
|
9679 |
|
9680 |
|
9681 | set: function set(key, value) {
|
9682 | return define(this, key === 0 ? 0 : key, value);
|
9683 | }
|
9684 | } : {
|
9685 |
|
9686 |
|
9687 | add: function add(value) {
|
9688 | return define(this, value = value === 0 ? 0 : value, value);
|
9689 | }
|
9690 | });
|
9691 | if (DESCRIPTORS$1) defineBuiltInAccessor(Prototype, 'size', {
|
9692 | configurable: true,
|
9693 | get: function () {
|
9694 | return getInternalState(this).size;
|
9695 | }
|
9696 | });
|
9697 | return Constructor;
|
9698 | },
|
9699 | setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {
|
9700 | var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
|
9701 | var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
9702 | var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
|
9703 |
|
9704 |
|
9705 |
|
9706 |
|
9707 |
|
9708 |
|
9709 |
|
9710 |
|
9711 |
|
9712 | defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {
|
9713 | setInternalState(this, {
|
9714 | type: ITERATOR_NAME,
|
9715 | target: iterated,
|
9716 | state: getInternalCollectionState(iterated),
|
9717 | kind: kind,
|
9718 | last: undefined
|
9719 | });
|
9720 | }, function () {
|
9721 | var state = getInternalIteratorState(this);
|
9722 | var kind = state.kind;
|
9723 | var entry = state.last;
|
9724 |
|
9725 | while (entry && entry.removed) entry = entry.previous;
|
9726 |
|
9727 | if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
|
9728 |
|
9729 | state.target = undefined;
|
9730 | return createIterResultObject(undefined, true);
|
9731 | }
|
9732 |
|
9733 | if (kind === 'keys') return createIterResultObject(entry.key, false);
|
9734 | if (kind === 'values') return createIterResultObject(entry.value, false);
|
9735 | return createIterResultObject([entry.key, entry.value], false);
|
9736 | }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
|
9737 |
|
9738 |
|
9739 |
|
9740 |
|
9741 | setSpecies(CONSTRUCTOR_NAME);
|
9742 | }
|
9743 | };
|
9744 |
|
9745 | var collection$1 = collection$2;
|
9746 | var collectionStrong$1 = collectionStrong$2;
|
9747 |
|
9748 |
|
9749 |
|
9750 | collection$1('Map', function (init) {
|
9751 | return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
|
9752 | }, collectionStrong$1);
|
9753 |
|
9754 | var path$6 = path$o;
|
9755 |
|
9756 | var map$2 = path$6.Map;
|
9757 |
|
9758 | var parent$f = map$2;
|
9759 |
|
9760 |
|
9761 | var map$1 = parent$f;
|
9762 |
|
9763 | var map = map$1;
|
9764 |
|
9765 | var _Map = getDefaultExportFromCjs(map);
|
9766 |
|
9767 | var $$7 = _export;
|
9768 | var $some = arrayIteration.some;
|
9769 | var arrayMethodIsStrict$1 = arrayMethodIsStrict$4;
|
9770 |
|
9771 | var STRICT_METHOD$1 = arrayMethodIsStrict$1('some');
|
9772 |
|
9773 |
|
9774 |
|
9775 | $$7({ target: 'Array', proto: true, forced: !STRICT_METHOD$1 }, {
|
9776 | some: function some(callbackfn /* , thisArg */) {
|
9777 | return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
9778 | }
|
9779 | });
|
9780 |
|
9781 | var getBuiltInPrototypeMethod$6 = getBuiltInPrototypeMethod$g;
|
9782 |
|
9783 | var some$3 = getBuiltInPrototypeMethod$6('Array', 'some');
|
9784 |
|
9785 | var isPrototypeOf$6 = objectIsPrototypeOf;
|
9786 | var method$6 = some$3;
|
9787 |
|
9788 | var ArrayPrototype$6 = Array.prototype;
|
9789 |
|
9790 | var some$2 = function (it) {
|
9791 | var own = it.some;
|
9792 | return it === ArrayPrototype$6 || (isPrototypeOf$6(ArrayPrototype$6, it) && own === ArrayPrototype$6.some) ? method$6 : own;
|
9793 | };
|
9794 |
|
9795 | var parent$e = some$2;
|
9796 |
|
9797 | var some$1 = parent$e;
|
9798 |
|
9799 | var some = some$1;
|
9800 |
|
9801 | var _someInstanceProperty = getDefaultExportFromCjs(some);
|
9802 |
|
9803 | var DESCRIPTORS = descriptors;
|
9804 | var uncurryThis$1 = functionUncurryThis;
|
9805 | var call = functionCall;
|
9806 | var fails$2 = fails$u;
|
9807 | var objectKeys = objectKeys$3;
|
9808 | var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
9809 | var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
9810 | var toObject$3 = toObject$e;
|
9811 | var IndexedObject = indexedObject;
|
9812 |
|
9813 |
|
9814 | var $assign = Object.assign;
|
9815 |
|
9816 | var defineProperty = Object.defineProperty;
|
9817 | var concat$4 = uncurryThis$1([].concat);
|
9818 |
|
9819 |
|
9820 |
|
9821 | var objectAssign = !$assign || fails$2(function () {
|
9822 |
|
9823 | if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
|
9824 | enumerable: true,
|
9825 | get: function () {
|
9826 | defineProperty(this, 'b', {
|
9827 | value: 3,
|
9828 | enumerable: false
|
9829 | });
|
9830 | }
|
9831 | }), { b: 2 })).b !== 1) return true;
|
9832 |
|
9833 | var A = {};
|
9834 | var B = {};
|
9835 |
|
9836 | var symbol = Symbol('assign detection');
|
9837 | var alphabet = 'abcdefghijklmnopqrst';
|
9838 | A[symbol] = 7;
|
9839 | alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
9840 | return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
|
9841 | }) ? function assign(target, source) {
|
9842 | var T = toObject$3(target);
|
9843 | var argumentsLength = arguments.length;
|
9844 | var index = 1;
|
9845 | var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
9846 | var propertyIsEnumerable = propertyIsEnumerableModule.f;
|
9847 | while (argumentsLength > index) {
|
9848 | var S = IndexedObject(arguments[index++]);
|
9849 | var keys = getOwnPropertySymbols ? concat$4(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
|
9850 | var length = keys.length;
|
9851 | var j = 0;
|
9852 | var key;
|
9853 | while (length > j) {
|
9854 | key = keys[j++];
|
9855 | if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
|
9856 | }
|
9857 | } return T;
|
9858 | } : $assign;
|
9859 |
|
9860 | var $$6 = _export;
|
9861 | var assign$3 = objectAssign;
|
9862 |
|
9863 |
|
9864 |
|
9865 |
|
9866 | $$6({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign$3 }, {
|
9867 | assign: assign$3
|
9868 | });
|
9869 |
|
9870 | var path$5 = path$o;
|
9871 |
|
9872 | var assign$2 = path$5.Object.assign;
|
9873 |
|
9874 | var parent$d = assign$2;
|
9875 |
|
9876 | var assign$1 = parent$d;
|
9877 |
|
9878 | var assign = assign$1;
|
9879 |
|
9880 | var _Object$assign = getDefaultExportFromCjs(assign);
|
9881 |
|
9882 | var getBuiltInPrototypeMethod$5 = getBuiltInPrototypeMethod$g;
|
9883 |
|
9884 | var concat$3 = getBuiltInPrototypeMethod$5('Array', 'concat');
|
9885 |
|
9886 | var isPrototypeOf$5 = objectIsPrototypeOf;
|
9887 | var method$5 = concat$3;
|
9888 |
|
9889 | var ArrayPrototype$5 = Array.prototype;
|
9890 |
|
9891 | var concat$2 = function (it) {
|
9892 | var own = it.concat;
|
9893 | return it === ArrayPrototype$5 || (isPrototypeOf$5(ArrayPrototype$5, it) && own === ArrayPrototype$5.concat) ? method$5 : own;
|
9894 | };
|
9895 |
|
9896 | var parent$c = concat$2;
|
9897 |
|
9898 | var concat$1 = parent$c;
|
9899 |
|
9900 | var concat = concat$1;
|
9901 |
|
9902 | var _concatInstanceProperty = getDefaultExportFromCjs(concat);
|
9903 |
|
9904 | var getBuiltInPrototypeMethod$4 = getBuiltInPrototypeMethod$g;
|
9905 |
|
9906 | var keys$6 = getBuiltInPrototypeMethod$4('Array', 'keys');
|
9907 |
|
9908 | var parent$b = keys$6;
|
9909 |
|
9910 | var keys$5 = parent$b;
|
9911 |
|
9912 | var classof$2 = classof$d;
|
9913 | var hasOwn$2 = hasOwnProperty_1;
|
9914 | var isPrototypeOf$4 = objectIsPrototypeOf;
|
9915 | var method$4 = keys$5;
|
9916 |
|
9917 | var ArrayPrototype$4 = Array.prototype;
|
9918 |
|
9919 | var DOMIterables$2 = {
|
9920 | DOMTokenList: true,
|
9921 | NodeList: true
|
9922 | };
|
9923 |
|
9924 | var keys$4 = function (it) {
|
9925 | var own = it.keys;
|
9926 | return it === ArrayPrototype$4 || (isPrototypeOf$4(ArrayPrototype$4, it) && own === ArrayPrototype$4.keys)
|
9927 | || hasOwn$2(DOMIterables$2, classof$2(it)) ? method$4 : own;
|
9928 | };
|
9929 |
|
9930 | var keys$3 = keys$4;
|
9931 |
|
9932 | var _keysInstanceProperty = getDefaultExportFromCjs(keys$3);
|
9933 |
|
9934 | var $$5 = _export;
|
9935 | var toObject$2 = toObject$e;
|
9936 | var nativeKeys = objectKeys$3;
|
9937 | var fails$1 = fails$u;
|
9938 |
|
9939 | var FAILS_ON_PRIMITIVES = fails$1(function () { nativeKeys(1); });
|
9940 |
|
9941 |
|
9942 |
|
9943 | $$5({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
|
9944 | keys: function keys(it) {
|
9945 | return nativeKeys(toObject$2(it));
|
9946 | }
|
9947 | });
|
9948 |
|
9949 | var path$4 = path$o;
|
9950 |
|
9951 | var keys$2 = path$4.Object.keys;
|
9952 |
|
9953 | var parent$a = keys$2;
|
9954 |
|
9955 | var keys$1 = parent$a;
|
9956 |
|
9957 | var keys = keys$1;
|
9958 |
|
9959 | var _Object$keys = getDefaultExportFromCjs(keys);
|
9960 |
|
9961 | var tryToString = tryToString$6;
|
9962 |
|
9963 | var $TypeError = TypeError;
|
9964 |
|
9965 | var deletePropertyOrThrow$2 = function (O, P) {
|
9966 | if (!delete O[P]) throw new $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
|
9967 | };
|
9968 |
|
9969 | var arraySlice$1 = arraySliceSimple;
|
9970 |
|
9971 | var floor = Math.floor;
|
9972 |
|
9973 | var mergeSort = function (array, comparefn) {
|
9974 | var length = array.length;
|
9975 | var middle = floor(length / 2);
|
9976 | return length < 8 ? insertionSort(array, comparefn) : merge(
|
9977 | array,
|
9978 | mergeSort(arraySlice$1(array, 0, middle), comparefn),
|
9979 | mergeSort(arraySlice$1(array, middle), comparefn),
|
9980 | comparefn
|
9981 | );
|
9982 | };
|
9983 |
|
9984 | var insertionSort = function (array, comparefn) {
|
9985 | var length = array.length;
|
9986 | var i = 1;
|
9987 | var element, j;
|
9988 |
|
9989 | while (i < length) {
|
9990 | j = i;
|
9991 | element = array[i];
|
9992 | while (j && comparefn(array[j - 1], element) > 0) {
|
9993 | array[j] = array[--j];
|
9994 | }
|
9995 | if (j !== i++) array[j] = element;
|
9996 | } return array;
|
9997 | };
|
9998 |
|
9999 | var merge = function (array, left, right, comparefn) {
|
10000 | var llength = left.length;
|
10001 | var rlength = right.length;
|
10002 | var lindex = 0;
|
10003 | var rindex = 0;
|
10004 |
|
10005 | while (lindex < llength || rindex < rlength) {
|
10006 | array[lindex + rindex] = (lindex < llength && rindex < rlength)
|
10007 | ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
|
10008 | : lindex < llength ? left[lindex++] : right[rindex++];
|
10009 | } return array;
|
10010 | };
|
10011 |
|
10012 | var arraySort = mergeSort;
|
10013 |
|
10014 | var userAgent$1 = engineUserAgent;
|
10015 |
|
10016 | var firefox = userAgent$1.match(/firefox\/(\d+)/i);
|
10017 |
|
10018 | var engineFfVersion = !!firefox && +firefox[1];
|
10019 |
|
10020 | var UA = engineUserAgent;
|
10021 |
|
10022 | var engineIsIeOrEdge = /MSIE|Trident/.test(UA);
|
10023 |
|
10024 | var userAgent = engineUserAgent;
|
10025 |
|
10026 | var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
|
10027 |
|
10028 | var engineWebkitVersion = !!webkit && +webkit[1];
|
10029 |
|
10030 | var $$4 = _export;
|
10031 | var uncurryThis = functionUncurryThis;
|
10032 | var aCallable = aCallable$e;
|
10033 | var toObject$1 = toObject$e;
|
10034 | var lengthOfArrayLike$1 = lengthOfArrayLike$d;
|
10035 | var deletePropertyOrThrow$1 = deletePropertyOrThrow$2;
|
10036 | var toString = toString$7;
|
10037 | var fails = fails$u;
|
10038 | var internalSort = arraySort;
|
10039 | var arrayMethodIsStrict = arrayMethodIsStrict$4;
|
10040 | var FF = engineFfVersion;
|
10041 | var IE_OR_EDGE = engineIsIeOrEdge;
|
10042 | var V8 = engineV8Version;
|
10043 | var WEBKIT = engineWebkitVersion;
|
10044 |
|
10045 | var test = [];
|
10046 | var nativeSort = uncurryThis(test.sort);
|
10047 | var push = uncurryThis(test.push);
|
10048 |
|
10049 |
|
10050 | var FAILS_ON_UNDEFINED = fails(function () {
|
10051 | test.sort(undefined);
|
10052 | });
|
10053 |
|
10054 | var FAILS_ON_NULL = fails(function () {
|
10055 | test.sort(null);
|
10056 | });
|
10057 |
|
10058 | var STRICT_METHOD = arrayMethodIsStrict('sort');
|
10059 |
|
10060 | var STABLE_SORT = !fails(function () {
|
10061 |
|
10062 | if (V8) return V8 < 70;
|
10063 | if (FF && FF > 3) return;
|
10064 | if (IE_OR_EDGE) return true;
|
10065 | if (WEBKIT) return WEBKIT < 603;
|
10066 |
|
10067 | var result = '';
|
10068 | var code, chr, value, index;
|
10069 |
|
10070 |
|
10071 | for (code = 65; code < 76; code++) {
|
10072 | chr = String.fromCharCode(code);
|
10073 |
|
10074 | switch (code) {
|
10075 | case 66: case 69: case 70: case 72: value = 3; break;
|
10076 | case 68: case 71: value = 4; break;
|
10077 | default: value = 2;
|
10078 | }
|
10079 |
|
10080 | for (index = 0; index < 47; index++) {
|
10081 | test.push({ k: chr + index, v: value });
|
10082 | }
|
10083 | }
|
10084 |
|
10085 | test.sort(function (a, b) { return b.v - a.v; });
|
10086 |
|
10087 | for (index = 0; index < test.length; index++) {
|
10088 | chr = test[index].k.charAt(0);
|
10089 | if (result.charAt(result.length - 1) !== chr) result += chr;
|
10090 | }
|
10091 |
|
10092 | return result !== 'DGBEFHACIJK';
|
10093 | });
|
10094 |
|
10095 | var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
|
10096 |
|
10097 | var getSortCompare = function (comparefn) {
|
10098 | return function (x, y) {
|
10099 | if (y === undefined) return -1;
|
10100 | if (x === undefined) return 1;
|
10101 | if (comparefn !== undefined) return +comparefn(x, y) || 0;
|
10102 | return toString(x) > toString(y) ? 1 : -1;
|
10103 | };
|
10104 | };
|
10105 |
|
10106 |
|
10107 |
|
10108 | $$4({ target: 'Array', proto: true, forced: FORCED }, {
|
10109 | sort: function sort(comparefn) {
|
10110 | if (comparefn !== undefined) aCallable(comparefn);
|
10111 |
|
10112 | var array = toObject$1(this);
|
10113 |
|
10114 | if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn);
|
10115 |
|
10116 | var items = [];
|
10117 | var arrayLength = lengthOfArrayLike$1(array);
|
10118 | var itemsLength, index;
|
10119 |
|
10120 | for (index = 0; index < arrayLength; index++) {
|
10121 | if (index in array) push(items, array[index]);
|
10122 | }
|
10123 |
|
10124 | internalSort(items, getSortCompare(comparefn));
|
10125 |
|
10126 | itemsLength = lengthOfArrayLike$1(items);
|
10127 | index = 0;
|
10128 |
|
10129 | while (index < itemsLength) array[index] = items[index++];
|
10130 | while (index < arrayLength) deletePropertyOrThrow$1(array, index++);
|
10131 |
|
10132 | return array;
|
10133 | }
|
10134 | });
|
10135 |
|
10136 | var getBuiltInPrototypeMethod$3 = getBuiltInPrototypeMethod$g;
|
10137 |
|
10138 | var sort$3 = getBuiltInPrototypeMethod$3('Array', 'sort');
|
10139 |
|
10140 | var isPrototypeOf$3 = objectIsPrototypeOf;
|
10141 | var method$3 = sort$3;
|
10142 |
|
10143 | var ArrayPrototype$3 = Array.prototype;
|
10144 |
|
10145 | var sort$2 = function (it) {
|
10146 | var own = it.sort;
|
10147 | return it === ArrayPrototype$3 || (isPrototypeOf$3(ArrayPrototype$3, it) && own === ArrayPrototype$3.sort) ? method$3 : own;
|
10148 | };
|
10149 |
|
10150 | var parent$9 = sort$2;
|
10151 |
|
10152 | var sort$1 = parent$9;
|
10153 |
|
10154 | var sort = sort$1;
|
10155 |
|
10156 | var _sortInstanceProperty = getDefaultExportFromCjs(sort);
|
10157 |
|
10158 | var getBuiltInPrototypeMethod$2 = getBuiltInPrototypeMethod$g;
|
10159 |
|
10160 | var values$3 = getBuiltInPrototypeMethod$2('Array', 'values');
|
10161 |
|
10162 | var parent$8 = values$3;
|
10163 |
|
10164 | var values$2 = parent$8;
|
10165 |
|
10166 | var classof$1 = classof$d;
|
10167 | var hasOwn$1 = hasOwnProperty_1;
|
10168 | var isPrototypeOf$2 = objectIsPrototypeOf;
|
10169 | var method$2 = values$2;
|
10170 |
|
10171 | var ArrayPrototype$2 = Array.prototype;
|
10172 |
|
10173 | var DOMIterables$1 = {
|
10174 | DOMTokenList: true,
|
10175 | NodeList: true
|
10176 | };
|
10177 |
|
10178 | var values$1 = function (it) {
|
10179 | var own = it.values;
|
10180 | return it === ArrayPrototype$2 || (isPrototypeOf$2(ArrayPrototype$2, it) && own === ArrayPrototype$2.values)
|
10181 | || hasOwn$1(DOMIterables$1, classof$1(it)) ? method$2 : own;
|
10182 | };
|
10183 |
|
10184 | var values = values$1;
|
10185 |
|
10186 | var _valuesInstanceProperty = getDefaultExportFromCjs(values);
|
10187 |
|
10188 | var path$3 = path$o;
|
10189 | var apply$1 = functionApply;
|
10190 |
|
10191 |
|
10192 | if (!path$3.JSON) path$3.JSON = { stringify: JSON.stringify };
|
10193 |
|
10194 |
|
10195 | var stringify$2 = function stringify(it, replacer, space) {
|
10196 | return apply$1(path$3.JSON.stringify, null, arguments);
|
10197 | };
|
10198 |
|
10199 | var parent$7 = stringify$2;
|
10200 |
|
10201 | var stringify$1 = parent$7;
|
10202 |
|
10203 | var stringify = stringify$1;
|
10204 |
|
10205 | var _JSON$stringify = getDefaultExportFromCjs(stringify);
|
10206 |
|
10207 | var iterator = iterator$4;
|
10208 |
|
10209 | var _Symbol$iterator = getDefaultExportFromCjs(iterator);
|
10210 |
|
10211 | var getBuiltInPrototypeMethod$1 = getBuiltInPrototypeMethod$g;
|
10212 |
|
10213 | var entries$3 = getBuiltInPrototypeMethod$1('Array', 'entries');
|
10214 |
|
10215 | var parent$6 = entries$3;
|
10216 |
|
10217 | var entries$2 = parent$6;
|
10218 |
|
10219 | var classof = classof$d;
|
10220 | var hasOwn = hasOwnProperty_1;
|
10221 | var isPrototypeOf$1 = objectIsPrototypeOf;
|
10222 | var method$1 = entries$2;
|
10223 |
|
10224 | var ArrayPrototype$1 = Array.prototype;
|
10225 |
|
10226 | var DOMIterables = {
|
10227 | DOMTokenList: true,
|
10228 | NodeList: true
|
10229 | };
|
10230 |
|
10231 | var entries$1 = function (it) {
|
10232 | var own = it.entries;
|
10233 | return it === ArrayPrototype$1 || (isPrototypeOf$1(ArrayPrototype$1, it) && own === ArrayPrototype$1.entries)
|
10234 | || hasOwn(DOMIterables, classof(it)) ? method$1 : own;
|
10235 | };
|
10236 |
|
10237 | var entries = entries$1;
|
10238 |
|
10239 | var _entriesInstanceProperty = getDefaultExportFromCjs(entries);
|
10240 |
|
10241 |
|
10242 |
|
10243 |
|
10244 | let getRandomValues;
|
10245 | const rnds8 = new Uint8Array(16);
|
10246 | function rng() {
|
10247 |
|
10248 | if (!getRandomValues) {
|
10249 |
|
10250 | getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
10251 |
|
10252 | if (!getRandomValues) {
|
10253 | throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
10254 | }
|
10255 | }
|
10256 |
|
10257 | return getRandomValues(rnds8);
|
10258 | }
|
10259 |
|
10260 |
|
10261 |
|
10262 |
|
10263 |
|
10264 |
|
10265 | const byteToHex = [];
|
10266 |
|
10267 | for (let i = 0; i < 256; ++i) {
|
10268 | byteToHex.push((i + 0x100).toString(16).slice(1));
|
10269 | }
|
10270 |
|
10271 | function unsafeStringify(arr, offset = 0) {
|
10272 |
|
10273 |
|
10274 | return 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]];
|
10275 | }
|
10276 |
|
10277 | const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
10278 | var native = {
|
10279 | randomUUID
|
10280 | };
|
10281 |
|
10282 | function v4(options, buf, offset) {
|
10283 | if (native.randomUUID && !buf && !options) {
|
10284 | return native.randomUUID();
|
10285 | }
|
10286 |
|
10287 | options = options || {};
|
10288 | const rnds = options.random || (options.rng || rng)();
|
10289 |
|
10290 | rnds[6] = rnds[6] & 0x0f | 0x40;
|
10291 | rnds[8] = rnds[8] & 0x3f | 0x80;
|
10292 |
|
10293 | if (buf) {
|
10294 | offset = offset || 0;
|
10295 |
|
10296 | for (let i = 0; i < 16; ++i) {
|
10297 | buf[offset + i] = rnds[i];
|
10298 | }
|
10299 |
|
10300 | return buf;
|
10301 | }
|
10302 |
|
10303 | return unsafeStringify(rnds);
|
10304 | }
|
10305 |
|
10306 |
|
10307 |
|
10308 |
|
10309 |
|
10310 |
|
10311 |
|
10312 | function isId(value) {
|
10313 | return typeof value === "string" || typeof value === "number";
|
10314 | }
|
10315 |
|
10316 |
|
10317 | var engineIsBun = typeof Bun == 'function' && Bun && typeof Bun.version == 'string';
|
10318 |
|
10319 | var global$3 = global$p;
|
10320 | var apply = functionApply;
|
10321 | var isCallable = isCallable$m;
|
10322 | var ENGINE_IS_BUN = engineIsBun;
|
10323 | var USER_AGENT = engineUserAgent;
|
10324 | var arraySlice = arraySlice$5;
|
10325 | var validateArgumentsLength = validateArgumentsLength$2;
|
10326 |
|
10327 | var Function$1 = global$3.Function;
|
10328 |
|
10329 | var WRAP = /MSIE .\./.test(USER_AGENT) || ENGINE_IS_BUN && (function () {
|
10330 | var version = global$3.Bun.version.split('.');
|
10331 | return version.length < 3 || version[0] === '0' && (version[1] < 3 || version[1] === '3' && version[2] === '0');
|
10332 | })();
|
10333 |
|
10334 |
|
10335 |
|
10336 |
|
10337 | var schedulersFix$2 = function (scheduler, hasTimeArg) {
|
10338 | var firstParamIndex = hasTimeArg ? 2 : 1;
|
10339 | return WRAP ? function (handler, timeout /* , ...arguments */) {
|
10340 | var boundArgs = validateArgumentsLength(arguments.length, 1) > firstParamIndex;
|
10341 | var fn = isCallable(handler) ? handler : Function$1(handler);
|
10342 | var params = boundArgs ? arraySlice(arguments, firstParamIndex) : [];
|
10343 | var callback = boundArgs ? function () {
|
10344 | apply(fn, this, params);
|
10345 | } : fn;
|
10346 | return hasTimeArg ? scheduler(callback, timeout) : scheduler(callback);
|
10347 | } : scheduler;
|
10348 | };
|
10349 |
|
10350 | var $$3 = _export;
|
10351 | var global$2 = global$p;
|
10352 | var schedulersFix$1 = schedulersFix$2;
|
10353 |
|
10354 | var setInterval = schedulersFix$1(global$2.setInterval, true);
|
10355 |
|
10356 |
|
10357 |
|
10358 | $$3({ global: true, bind: true, forced: global$2.setInterval !== setInterval }, {
|
10359 | setInterval: setInterval
|
10360 | });
|
10361 |
|
10362 | var $$2 = _export;
|
10363 | var global$1 = global$p;
|
10364 | var schedulersFix = schedulersFix$2;
|
10365 |
|
10366 | var setTimeout$3 = schedulersFix(global$1.setTimeout, true);
|
10367 |
|
10368 |
|
10369 |
|
10370 | $$2({ global: true, bind: true, forced: global$1.setTimeout !== setTimeout$3 }, {
|
10371 | setTimeout: setTimeout$3
|
10372 | });
|
10373 |
|
10374 | var path$2 = path$o;
|
10375 |
|
10376 | var setTimeout$2 = path$2.setTimeout;
|
10377 |
|
10378 | var setTimeout$1 = setTimeout$2;
|
10379 |
|
10380 | var _setTimeout = getDefaultExportFromCjs(setTimeout$1);
|
10381 |
|
10382 | var $$1 = _export;
|
10383 | var toObject = toObject$e;
|
10384 | var toAbsoluteIndex = toAbsoluteIndex$4;
|
10385 | var toIntegerOrInfinity = toIntegerOrInfinity$4;
|
10386 | var lengthOfArrayLike = lengthOfArrayLike$d;
|
10387 | var setArrayLength = arraySetLength;
|
10388 | var doesNotExceedSafeInteger = doesNotExceedSafeInteger$4;
|
10389 | var arraySpeciesCreate = arraySpeciesCreate$4;
|
10390 | var createProperty = createProperty$6;
|
10391 | var deletePropertyOrThrow = deletePropertyOrThrow$2;
|
10392 | var arrayMethodHasSpeciesSupport = arrayMethodHasSpeciesSupport$5;
|
10393 |
|
10394 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
|
10395 |
|
10396 | var max = Math.max;
|
10397 | var min = Math.min;
|
10398 |
|
10399 |
|
10400 |
|
10401 |
|
10402 | $$1({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
10403 | splice: function splice(start, deleteCount /* , ...items */) {
|
10404 | var O = toObject(this);
|
10405 | var len = lengthOfArrayLike(O);
|
10406 | var actualStart = toAbsoluteIndex(start, len);
|
10407 | var argumentsLength = arguments.length;
|
10408 | var insertCount, actualDeleteCount, A, k, from, to;
|
10409 | if (argumentsLength === 0) {
|
10410 | insertCount = actualDeleteCount = 0;
|
10411 | } else if (argumentsLength === 1) {
|
10412 | insertCount = 0;
|
10413 | actualDeleteCount = len - actualStart;
|
10414 | } else {
|
10415 | insertCount = argumentsLength - 2;
|
10416 | actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
|
10417 | }
|
10418 | doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
|
10419 | A = arraySpeciesCreate(O, actualDeleteCount);
|
10420 | for (k = 0; k < actualDeleteCount; k++) {
|
10421 | from = actualStart + k;
|
10422 | if (from in O) createProperty(A, k, O[from]);
|
10423 | }
|
10424 | A.length = actualDeleteCount;
|
10425 | if (insertCount < actualDeleteCount) {
|
10426 | for (k = actualStart; k < len - actualDeleteCount; k++) {
|
10427 | from = k + actualDeleteCount;
|
10428 | to = k + insertCount;
|
10429 | if (from in O) O[to] = O[from];
|
10430 | else deletePropertyOrThrow(O, to);
|
10431 | }
|
10432 | for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1);
|
10433 | } else if (insertCount > actualDeleteCount) {
|
10434 | for (k = len - actualDeleteCount; k > actualStart; k--) {
|
10435 | from = k + actualDeleteCount - 1;
|
10436 | to = k + insertCount - 1;
|
10437 | if (from in O) O[to] = O[from];
|
10438 | else deletePropertyOrThrow(O, to);
|
10439 | }
|
10440 | }
|
10441 | for (k = 0; k < insertCount; k++) {
|
10442 | O[k + actualStart] = arguments[k + 2];
|
10443 | }
|
10444 | setArrayLength(O, len - actualDeleteCount + insertCount);
|
10445 | return A;
|
10446 | }
|
10447 | });
|
10448 |
|
10449 | var getBuiltInPrototypeMethod = getBuiltInPrototypeMethod$g;
|
10450 |
|
10451 | var splice$3 = getBuiltInPrototypeMethod('Array', 'splice');
|
10452 |
|
10453 | var isPrototypeOf = objectIsPrototypeOf;
|
10454 | var method = splice$3;
|
10455 |
|
10456 | var ArrayPrototype = Array.prototype;
|
10457 |
|
10458 | var splice$2 = function (it) {
|
10459 | var own = it.splice;
|
10460 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.splice) ? method : own;
|
10461 | };
|
10462 |
|
10463 | var parent$5 = splice$2;
|
10464 |
|
10465 | var splice$1 = parent$5;
|
10466 |
|
10467 | var splice = splice$1;
|
10468 |
|
10469 | var _spliceInstanceProperty = getDefaultExportFromCjs(splice);
|
10470 |
|
10471 |
|
10472 |
|
10473 |
|
10474 |
|
10475 |
|
10476 | var Queue = function () {
|
10477 | |
10478 |
|
10479 |
|
10480 |
|
10481 |
|
10482 | function Queue(options) {
|
10483 | _classCallCheck(this, Queue);
|
10484 |
|
10485 |
|
10486 | _defineProperty(this, "_queue", []);
|
10487 | _defineProperty(this, "_timeout", null);
|
10488 | _defineProperty(this, "_extended", null);
|
10489 |
|
10490 | this.delay = null;
|
10491 | this.max = Infinity;
|
10492 | this.setOptions(options);
|
10493 | }
|
10494 | |
10495 |
|
10496 |
|
10497 |
|
10498 |
|
10499 | _createClass(Queue, [{
|
10500 | key: "setOptions",
|
10501 | value: function setOptions(options) {
|
10502 | if (options && typeof options.delay !== "undefined") {
|
10503 | this.delay = options.delay;
|
10504 | }
|
10505 | if (options && typeof options.max !== "undefined") {
|
10506 | this.max = options.max;
|
10507 | }
|
10508 | this._flushIfNeeded();
|
10509 | }
|
10510 | |
10511 |
|
10512 |
|
10513 |
|
10514 |
|
10515 |
|
10516 |
|
10517 |
|
10518 | }, {
|
10519 | key: "destroy",
|
10520 | value:
|
10521 | |
10522 |
|
10523 |
|
10524 | function destroy() {
|
10525 | this.flush();
|
10526 | if (this._extended) {
|
10527 | var object = this._extended.object;
|
10528 | var methods = this._extended.methods;
|
10529 | for (var i = 0; i < methods.length; i++) {
|
10530 | var method = methods[i];
|
10531 | if (method.original) {
|
10532 |
|
10533 | object[method.name] = method.original;
|
10534 | } else {
|
10535 |
|
10536 | delete object[method.name];
|
10537 | }
|
10538 | }
|
10539 | this._extended = null;
|
10540 | }
|
10541 | }
|
10542 | |
10543 |
|
10544 |
|
10545 |
|
10546 |
|
10547 |
|
10548 | }, {
|
10549 | key: "replace",
|
10550 | value: function replace(object, method) {
|
10551 |
|
10552 | var me = this;
|
10553 | var original = object[method];
|
10554 | if (!original) {
|
10555 | throw new Error("Method " + method + " undefined");
|
10556 | }
|
10557 | object[method] = function () {
|
10558 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
10559 | args[_key] = arguments[_key];
|
10560 | }
|
10561 |
|
10562 | me.queue({
|
10563 | args: args,
|
10564 | fn: original,
|
10565 | context: this
|
10566 | });
|
10567 | };
|
10568 | }
|
10569 | |
10570 |
|
10571 |
|
10572 |
|
10573 |
|
10574 | }, {
|
10575 | key: "queue",
|
10576 | value: function queue(entry) {
|
10577 | if (typeof entry === "function") {
|
10578 | this._queue.push({
|
10579 | fn: entry
|
10580 | });
|
10581 | } else {
|
10582 | this._queue.push(entry);
|
10583 | }
|
10584 | this._flushIfNeeded();
|
10585 | }
|
10586 | |
10587 |
|
10588 |
|
10589 | }, {
|
10590 | key: "_flushIfNeeded",
|
10591 | value: function _flushIfNeeded() {
|
10592 | var _this = this;
|
10593 |
|
10594 | if (this._queue.length > this.max) {
|
10595 | this.flush();
|
10596 | }
|
10597 |
|
10598 | if (this._timeout != null) {
|
10599 | clearTimeout(this._timeout);
|
10600 | this._timeout = null;
|
10601 | }
|
10602 | if (this.queue.length > 0 && typeof this.delay === "number") {
|
10603 | this._timeout = _setTimeout(function () {
|
10604 | _this.flush();
|
10605 | }, this.delay);
|
10606 | }
|
10607 | }
|
10608 | |
10609 |
|
10610 |
|
10611 | }, {
|
10612 | key: "flush",
|
10613 | value: function flush() {
|
10614 | var _context, _context2;
|
10615 | _forEachInstanceProperty(_context = _spliceInstanceProperty(_context2 = this._queue).call(_context2, 0)).call(_context, function (entry) {
|
10616 | entry.fn.apply(entry.context || entry.fn, entry.args || []);
|
10617 | });
|
10618 | }
|
10619 | }], [{
|
10620 | key: "extend",
|
10621 | value: function extend(object, options) {
|
10622 | var queue = new Queue(options);
|
10623 | if (object.flush !== undefined) {
|
10624 | throw new Error("Target object already has a property flush");
|
10625 | }
|
10626 | object.flush = function () {
|
10627 | queue.flush();
|
10628 | };
|
10629 | var methods = [{
|
10630 | name: "flush",
|
10631 | original: undefined
|
10632 | }];
|
10633 | if (options && options.replace) {
|
10634 | for (var i = 0; i < options.replace.length; i++) {
|
10635 | var name = options.replace[i];
|
10636 | methods.push({
|
10637 | name: name,
|
10638 |
|
10639 | original: object[name]
|
10640 | });
|
10641 |
|
10642 | queue.replace(object, name);
|
10643 | }
|
10644 | }
|
10645 | queue._extended = {
|
10646 | object: object,
|
10647 | methods: methods
|
10648 | };
|
10649 | return queue;
|
10650 | }
|
10651 | }]);
|
10652 | return Queue;
|
10653 | }();
|
10654 |
|
10655 |
|
10656 |
|
10657 |
|
10658 |
|
10659 |
|
10660 |
|
10661 | var DataSetPart = function () {
|
10662 | function DataSetPart() {
|
10663 | _classCallCheck(this, DataSetPart);
|
10664 | _defineProperty(this, "_subscribers", {
|
10665 | "*": [],
|
10666 | add: [],
|
10667 | remove: [],
|
10668 | update: []
|
10669 | });
|
10670 | |
10671 |
|
10672 |
|
10673 | _defineProperty(this, "subscribe", DataSetPart.prototype.on);
|
10674 | |
10675 |
|
10676 |
|
10677 | _defineProperty(this, "unsubscribe", DataSetPart.prototype.off);
|
10678 | }
|
10679 | _createClass(DataSetPart, [{
|
10680 | key: "_trigger",
|
10681 | value:
|
10682 | |
10683 |
|
10684 |
|
10685 |
|
10686 |
|
10687 |
|
10688 |
|
10689 | function _trigger(event, payload, senderId) {
|
10690 | var _context, _context2;
|
10691 | if (event === "*") {
|
10692 | throw new Error("Cannot trigger event *");
|
10693 | }
|
10694 | _forEachInstanceProperty(_context = _concatInstanceProperty(_context2 = []).call(_context2, _toConsumableArray(this._subscribers[event]), _toConsumableArray(this._subscribers["*"]))).call(_context, function (subscriber) {
|
10695 | subscriber(event, payload, senderId != null ? senderId : null);
|
10696 | });
|
10697 | }
|
10698 | |
10699 |
|
10700 |
|
10701 |
|
10702 |
|
10703 |
|
10704 |
|
10705 | }, {
|
10706 | key: "on",
|
10707 | value: function on(event, callback) {
|
10708 | if (typeof callback === "function") {
|
10709 | this._subscribers[event].push(callback);
|
10710 | }
|
10711 |
|
10712 | }
|
10713 | |
10714 |
|
10715 |
|
10716 |
|
10717 |
|
10718 |
|
10719 |
|
10720 | }, {
|
10721 | key: "off",
|
10722 | value: function off(event, callback) {
|
10723 | var _context3;
|
10724 | this._subscribers[event] = _filterInstanceProperty(_context3 = this._subscribers[event]).call(_context3, function (subscriber) {
|
10725 | return subscriber !== callback;
|
10726 | });
|
10727 | }
|
10728 | }, {
|
10729 | key: "testLeakSubscribers",
|
10730 | get: /* develblock:start */
|
10731 | function get() {
|
10732 | return this._subscribers;
|
10733 | }
|
10734 | }]);
|
10735 | return DataSetPart;
|
10736 | }();
|
10737 |
|
10738 | function _arrayWithHoles(arr) {
|
10739 | if (_Array$isArray$1(arr)) return arr;
|
10740 | }
|
10741 |
|
10742 | function _iterableToArrayLimit(r, l) {
|
10743 | var t = null == r ? null : "undefined" != typeof _Symbol$1 && _getIteratorMethod$1(r) || r["@@iterator"];
|
10744 | if (null != t) {
|
10745 | var e,
|
10746 | n,
|
10747 | i,
|
10748 | u,
|
10749 | a = [],
|
10750 | f = !0,
|
10751 | o = !1;
|
10752 | try {
|
10753 | if (i = (t = t.call(r)).next, 0 === l) {
|
10754 | if (Object(t) !== t) return;
|
10755 | f = !1;
|
10756 | } else for (; !(f = (e = i.call(t)).done) && (_pushInstanceProperty(a).call(a, e.value), a.length !== l); f = !0);
|
10757 | } catch (r) {
|
10758 | o = !0, n = r;
|
10759 | } finally {
|
10760 | try {
|
10761 | if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
10762 | } finally {
|
10763 | if (o) throw n;
|
10764 | }
|
10765 | }
|
10766 | return a;
|
10767 | }
|
10768 | }
|
10769 |
|
10770 | function _nonIterableRest() {
|
10771 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
10772 | }
|
10773 |
|
10774 | function _slicedToArray(arr, i) {
|
10775 | return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$3(arr, i) || _nonIterableRest();
|
10776 | }
|
10777 |
|
10778 | var create = create$6;
|
10779 |
|
10780 | var _Object$create = getDefaultExportFromCjs(create);
|
10781 |
|
10782 | var collection = collection$2;
|
10783 | var collectionStrong = collectionStrong$2;
|
10784 |
|
10785 |
|
10786 |
|
10787 | collection('Set', function (init) {
|
10788 | return function Set() { return init(this, arguments.length ? arguments[0] : undefined); };
|
10789 | }, collectionStrong);
|
10790 |
|
10791 | var path$1 = path$o;
|
10792 |
|
10793 | var set$2 = path$1.Set;
|
10794 |
|
10795 | var parent$4 = set$2;
|
10796 |
|
10797 |
|
10798 | var set$1 = parent$4;
|
10799 |
|
10800 | var set = set$1;
|
10801 |
|
10802 | var _Set = /*@__PURE__*/getDefaultExportFromCjs(set);
|
10803 |
|
10804 | var getIterator$5 = getIterator$8;
|
10805 |
|
10806 | var getIterator_1 = getIterator$5;
|
10807 |
|
10808 | var parent$3 = getIterator_1;
|
10809 |
|
10810 |
|
10811 | var getIterator$4 = parent$3;
|
10812 |
|
10813 | var parent$2 = getIterator$4;
|
10814 |
|
10815 | var getIterator$3 = parent$2;
|
10816 |
|
10817 | var parent$1 = getIterator$3;
|
10818 |
|
10819 | var getIterator$2 = parent$1;
|
10820 |
|
10821 | var getIterator$1 = getIterator$2;
|
10822 |
|
10823 | var getIterator = getIterator$1;
|
10824 |
|
10825 | var _getIterator = /*@__PURE__*/getDefaultExportFromCjs(getIterator);
|
10826 |
|
10827 | function _createForOfIteratorHelper$2(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (_Array$isArray(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; } } }; }
|
10828 | function _unsupportedIterableToArray$2(o, minLen) { var _context10; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$2(o, minLen); var n = _sliceInstanceProperty$1(_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 _Array$from$1(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen); }
|
10829 | 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; }
|
10830 |
|
10831 |
|
10832 |
|
10833 |
|
10834 |
|
10835 |
|
10836 |
|
10837 |
|
10838 |
|
10839 | var DataStream = function (_Symbol$iterator$1) {
|
10840 | |
10841 |
|
10842 |
|
10843 |
|
10844 |
|
10845 | function DataStream(pairs) {
|
10846 | _classCallCheck(this, DataStream);
|
10847 | this._pairs = pairs;
|
10848 | }
|
10849 | |
10850 |
|
10851 |
|
10852 | _createClass(DataStream, [{
|
10853 | key: _Symbol$iterator$1,
|
10854 | value:
|
10855 |
|
10856 | _regeneratorRuntime.mark(function value() {
|
10857 | var _iterator, _step, _step$value, id, item;
|
10858 | return _regeneratorRuntime.wrap(function value$(_context) {
|
10859 | while (1) switch (_context.prev = _context.next) {
|
10860 | case 0:
|
10861 | _iterator = _createForOfIteratorHelper$2(this._pairs);
|
10862 | _context.prev = 1;
|
10863 | _iterator.s();
|
10864 | case 3:
|
10865 | if ((_step = _iterator.n()).done) {
|
10866 | _context.next = 9;
|
10867 | break;
|
10868 | }
|
10869 | _step$value = _slicedToArray(_step.value, 2), id = _step$value[0], item = _step$value[1];
|
10870 | _context.next = 7;
|
10871 | return [id, item];
|
10872 | case 7:
|
10873 | _context.next = 3;
|
10874 | break;
|
10875 | case 9:
|
10876 | _context.next = 14;
|
10877 | break;
|
10878 | case 11:
|
10879 | _context.prev = 11;
|
10880 | _context.t0 = _context["catch"](1);
|
10881 | _iterator.e(_context.t0);
|
10882 | case 14:
|
10883 | _context.prev = 14;
|
10884 | _iterator.f();
|
10885 | return _context.finish(14);
|
10886 | case 17:
|
10887 | case "end":
|
10888 | return _context.stop();
|
10889 | }
|
10890 | }, value, this, [[1, 11, 14, 17]]);
|
10891 | })
|
10892 | |
10893 |
|
10894 |
|
10895 | }, {
|
10896 | key: "entries",
|
10897 | value:
|
10898 |
|
10899 | _regeneratorRuntime.mark(function entries() {
|
10900 | var _iterator2, _step2, _step2$value, id, item;
|
10901 | return _regeneratorRuntime.wrap(function entries$(_context2) {
|
10902 | while (1) switch (_context2.prev = _context2.next) {
|
10903 | case 0:
|
10904 | _iterator2 = _createForOfIteratorHelper$2(this._pairs);
|
10905 | _context2.prev = 1;
|
10906 | _iterator2.s();
|
10907 | case 3:
|
10908 | if ((_step2 = _iterator2.n()).done) {
|
10909 | _context2.next = 9;
|
10910 | break;
|
10911 | }
|
10912 | _step2$value = _slicedToArray(_step2.value, 2), id = _step2$value[0], item = _step2$value[1];
|
10913 | _context2.next = 7;
|
10914 | return [id, item];
|
10915 | case 7:
|
10916 | _context2.next = 3;
|
10917 | break;
|
10918 | case 9:
|
10919 | _context2.next = 14;
|
10920 | break;
|
10921 | case 11:
|
10922 | _context2.prev = 11;
|
10923 | _context2.t0 = _context2["catch"](1);
|
10924 | _iterator2.e(_context2.t0);
|
10925 | case 14:
|
10926 | _context2.prev = 14;
|
10927 | _iterator2.f();
|
10928 | return _context2.finish(14);
|
10929 | case 17:
|
10930 | case "end":
|
10931 | return _context2.stop();
|
10932 | }
|
10933 | }, entries, this, [[1, 11, 14, 17]]);
|
10934 | })
|
10935 | |
10936 |
|
10937 |
|
10938 | }, {
|
10939 | key: "keys",
|
10940 | value:
|
10941 |
|
10942 | _regeneratorRuntime.mark(function keys() {
|
10943 | var _iterator3, _step3, _step3$value, id;
|
10944 | return _regeneratorRuntime.wrap(function keys$(_context3) {
|
10945 | while (1) switch (_context3.prev = _context3.next) {
|
10946 | case 0:
|
10947 | _iterator3 = _createForOfIteratorHelper$2(this._pairs);
|
10948 | _context3.prev = 1;
|
10949 | _iterator3.s();
|
10950 | case 3:
|
10951 | if ((_step3 = _iterator3.n()).done) {
|
10952 | _context3.next = 9;
|
10953 | break;
|
10954 | }
|
10955 | _step3$value = _slicedToArray(_step3.value, 1), id = _step3$value[0];
|
10956 | _context3.next = 7;
|
10957 | return id;
|
10958 | case 7:
|
10959 | _context3.next = 3;
|
10960 | break;
|
10961 | case 9:
|
10962 | _context3.next = 14;
|
10963 | break;
|
10964 | case 11:
|
10965 | _context3.prev = 11;
|
10966 | _context3.t0 = _context3["catch"](1);
|
10967 | _iterator3.e(_context3.t0);
|
10968 | case 14:
|
10969 | _context3.prev = 14;
|
10970 | _iterator3.f();
|
10971 | return _context3.finish(14);
|
10972 | case 17:
|
10973 | case "end":
|
10974 | return _context3.stop();
|
10975 | }
|
10976 | }, keys, this, [[1, 11, 14, 17]]);
|
10977 | })
|
10978 | |
10979 |
|
10980 |
|
10981 | }, {
|
10982 | key: "values",
|
10983 | value:
|
10984 |
|
10985 | _regeneratorRuntime.mark(function values() {
|
10986 | var _iterator4, _step4, _step4$value, item;
|
10987 | return _regeneratorRuntime.wrap(function values$(_context4) {
|
10988 | while (1) switch (_context4.prev = _context4.next) {
|
10989 | case 0:
|
10990 | _iterator4 = _createForOfIteratorHelper$2(this._pairs);
|
10991 | _context4.prev = 1;
|
10992 | _iterator4.s();
|
10993 | case 3:
|
10994 | if ((_step4 = _iterator4.n()).done) {
|
10995 | _context4.next = 9;
|
10996 | break;
|
10997 | }
|
10998 | _step4$value = _slicedToArray(_step4.value, 2), item = _step4$value[1];
|
10999 | _context4.next = 7;
|
11000 | return item;
|
11001 | case 7:
|
11002 | _context4.next = 3;
|
11003 | break;
|
11004 | case 9:
|
11005 | _context4.next = 14;
|
11006 | break;
|
11007 | case 11:
|
11008 | _context4.prev = 11;
|
11009 | _context4.t0 = _context4["catch"](1);
|
11010 | _iterator4.e(_context4.t0);
|
11011 | case 14:
|
11012 | _context4.prev = 14;
|
11013 | _iterator4.f();
|
11014 | return _context4.finish(14);
|
11015 | case 17:
|
11016 | case "end":
|
11017 | return _context4.stop();
|
11018 | }
|
11019 | }, values, this, [[1, 11, 14, 17]]);
|
11020 | })
|
11021 | |
11022 |
|
11023 |
|
11024 |
|
11025 |
|
11026 |
|
11027 |
|
11028 | }, {
|
11029 | key: "toIdArray",
|
11030 | value: function toIdArray() {
|
11031 | var _context5;
|
11032 | return _mapInstanceProperty(_context5 = _toConsumableArray(this._pairs)).call(_context5, function (pair) {
|
11033 | return pair[0];
|
11034 | });
|
11035 | }
|
11036 | |
11037 |
|
11038 |
|
11039 |
|
11040 |
|
11041 |
|
11042 |
|
11043 | }, {
|
11044 | key: "toItemArray",
|
11045 | value: function toItemArray() {
|
11046 | var _context6;
|
11047 | return _mapInstanceProperty(_context6 = _toConsumableArray(this._pairs)).call(_context6, function (pair) {
|
11048 | return pair[1];
|
11049 | });
|
11050 | }
|
11051 | |
11052 |
|
11053 |
|
11054 |
|
11055 |
|
11056 |
|
11057 |
|
11058 | }, {
|
11059 | key: "toEntryArray",
|
11060 | value: function toEntryArray() {
|
11061 | return _toConsumableArray(this._pairs);
|
11062 | }
|
11063 | |
11064 |
|
11065 |
|
11066 |
|
11067 |
|
11068 |
|
11069 |
|
11070 | }, {
|
11071 | key: "toObjectMap",
|
11072 | value: function toObjectMap() {
|
11073 | var map = _Object$create(null);
|
11074 | var _iterator5 = _createForOfIteratorHelper$2(this._pairs),
|
11075 | _step5;
|
11076 | try {
|
11077 | for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
11078 | var _step5$value = _slicedToArray(_step5.value, 2),
|
11079 | id = _step5$value[0],
|
11080 | item = _step5$value[1];
|
11081 | map[id] = item;
|
11082 | }
|
11083 | } catch (err) {
|
11084 | _iterator5.e(err);
|
11085 | } finally {
|
11086 | _iterator5.f();
|
11087 | }
|
11088 | return map;
|
11089 | }
|
11090 | |
11091 |
|
11092 |
|
11093 |
|
11094 |
|
11095 | }, {
|
11096 | key: "toMap",
|
11097 | value: function toMap() {
|
11098 | return new _Map(this._pairs);
|
11099 | }
|
11100 | |
11101 |
|
11102 |
|
11103 |
|
11104 |
|
11105 | }, {
|
11106 | key: "toIdSet",
|
11107 | value: function toIdSet() {
|
11108 | return new _Set(this.toIdArray());
|
11109 | }
|
11110 | |
11111 |
|
11112 |
|
11113 |
|
11114 |
|
11115 | }, {
|
11116 | key: "toItemSet",
|
11117 | value: function toItemSet() {
|
11118 | return new _Set(this.toItemArray());
|
11119 | }
|
11120 | |
11121 |
|
11122 |
|
11123 |
|
11124 |
|
11125 |
|
11126 |
|
11127 |
|
11128 |
|
11129 |
|
11130 |
|
11131 |
|
11132 |
|
11133 |
|
11134 |
|
11135 |
|
11136 |
|
11137 |
|
11138 |
|
11139 |
|
11140 |
|
11141 |
|
11142 | }, {
|
11143 | key: "cache",
|
11144 | value: function cache() {
|
11145 | return new DataStream(_toConsumableArray(this._pairs));
|
11146 | }
|
11147 | |
11148 |
|
11149 |
|
11150 |
|
11151 |
|
11152 |
|
11153 |
|
11154 | }, {
|
11155 | key: "distinct",
|
11156 | value: function distinct(callback) {
|
11157 | var set = new _Set();
|
11158 | var _iterator6 = _createForOfIteratorHelper$2(this._pairs),
|
11159 | _step6;
|
11160 | try {
|
11161 | for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
11162 | var _step6$value = _slicedToArray(_step6.value, 2),
|
11163 | id = _step6$value[0],
|
11164 | item = _step6$value[1];
|
11165 | set.add(callback(item, id));
|
11166 | }
|
11167 | } catch (err) {
|
11168 | _iterator6.e(err);
|
11169 | } finally {
|
11170 | _iterator6.f();
|
11171 | }
|
11172 | return set;
|
11173 | }
|
11174 | /**
|
11175 | * Filter the items of the stream.
|
11176 | *
|
11177 | * @param callback - The function that decides whether an item will be included.
|
11178 | * @returns A new data stream with the filtered items.
|
11179 | */
|
11180 | }, {
|
11181 | key: "filter",
|
11182 | value: function filter(callback) {
|
11183 | var pairs = this._pairs;
|
11184 | return new DataStream({
|
11185 | [_Symbol$iterator]() {
|
11186 | return _regeneratorRuntime.mark(function _callee() {
|
11187 | var _iterator7, _step7, _step7$value, id, item;
|
11188 | return _regeneratorRuntime.wrap(function _callee$(_context7) {
|
11189 | while (1) switch (_context7.prev = _context7.next) {
|
11190 | case 0:
|
11191 | _iterator7 = _createForOfIteratorHelper$2(pairs);
|
11192 | _context7.prev = 1;
|
11193 | _iterator7.s();
|
11194 | case 3:
|
11195 | if ((_step7 = _iterator7.n()).done) {
|
11196 | _context7.next = 10;
|
11197 | break;
|
11198 | }
|
11199 | _step7$value = _slicedToArray(_step7.value, 2), id = _step7$value[0], item = _step7$value[1];
|
11200 | if (!callback(item, id)) {
|
11201 | _context7.next = 8;
|
11202 | break;
|
11203 | }
|
11204 | _context7.next = 8;
|
11205 | return [id, item];
|
11206 | case 8:
|
11207 | _context7.next = 3;
|
11208 | break;
|
11209 | case 10:
|
11210 | _context7.next = 15;
|
11211 | break;
|
11212 | case 12:
|
11213 | _context7.prev = 12;
|
11214 | _context7.t0 = _context7["catch"](1);
|
11215 | _iterator7.e(_context7.t0);
|
11216 | case 15:
|
11217 | _context7.prev = 15;
|
11218 | _iterator7.f();
|
11219 | return _context7.finish(15);
|
11220 | case 18:
|
11221 | case "end":
|
11222 | return _context7.stop();
|
11223 | }
|
11224 | }, _callee, null, [[1, 12, 15, 18]]);
|
11225 | })();
|
11226 | }
|
11227 | });
|
11228 | }
|
11229 | |
11230 |
|
11231 |
|
11232 |
|
11233 |
|
11234 | }, {
|
11235 | key: "forEach",
|
11236 | value: function forEach(callback) {
|
11237 | var _iterator8 = _createForOfIteratorHelper$2(this._pairs),
|
11238 | _step8;
|
11239 | try {
|
11240 | for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
11241 | var _step8$value = _slicedToArray(_step8.value, 2),
|
11242 | id = _step8$value[0],
|
11243 | item = _step8$value[1];
|
11244 | callback(item, id);
|
11245 | }
|
11246 | } catch (err) {
|
11247 | _iterator8.e(err);
|
11248 | } finally {
|
11249 | _iterator8.f();
|
11250 | }
|
11251 | }
|
11252 | |
11253 |
|
11254 |
|
11255 |
|
11256 |
|
11257 |
|
11258 |
|
11259 | }, {
|
11260 | key: "map",
|
11261 | value: function map(callback) {
|
11262 | var pairs = this._pairs;
|
11263 | return new DataStream({
|
11264 | [_Symbol$iterator]() {
|
11265 | return _regeneratorRuntime.mark(function _callee2() {
|
11266 | var _iterator9, _step9, _step9$value, id, item;
|
11267 | return _regeneratorRuntime.wrap(function _callee2$(_context8) {
|
11268 | while (1) switch (_context8.prev = _context8.next) {
|
11269 | case 0:
|
11270 | _iterator9 = _createForOfIteratorHelper$2(pairs);
|
11271 | _context8.prev = 1;
|
11272 | _iterator9.s();
|
11273 | case 3:
|
11274 | if ((_step9 = _iterator9.n()).done) {
|
11275 | _context8.next = 9;
|
11276 | break;
|
11277 | }
|
11278 | _step9$value = _slicedToArray(_step9.value, 2), id = _step9$value[0], item = _step9$value[1];
|
11279 | _context8.next = 7;
|
11280 | return [id, callback(item, id)];
|
11281 | case 7:
|
11282 | _context8.next = 3;
|
11283 | break;
|
11284 | case 9:
|
11285 | _context8.next = 14;
|
11286 | break;
|
11287 | case 11:
|
11288 | _context8.prev = 11;
|
11289 | _context8.t0 = _context8["catch"](1);
|
11290 | _iterator9.e(_context8.t0);
|
11291 | case 14:
|
11292 | _context8.prev = 14;
|
11293 | _iterator9.f();
|
11294 | return _context8.finish(14);
|
11295 | case 17:
|
11296 | case "end":
|
11297 | return _context8.stop();
|
11298 | }
|
11299 | }, _callee2, null, [[1, 11, 14, 17]]);
|
11300 | })();
|
11301 | }
|
11302 | });
|
11303 | }
|
11304 | |
11305 |
|
11306 |
|
11307 |
|
11308 |
|
11309 |
|
11310 | }, {
|
11311 | key: "max",
|
11312 | value: function max(callback) {
|
11313 | var iter = _getIterator(this._pairs);
|
11314 | var curr = iter.next();
|
11315 | if (curr.done) {
|
11316 | return null;
|
11317 | }
|
11318 | var maxItem = curr.value[1];
|
11319 | var maxValue = callback(curr.value[1], curr.value[0]);
|
11320 | while (!(curr = iter.next()).done) {
|
11321 | var _curr$value = _slicedToArray(curr.value, 2),
|
11322 | id = _curr$value[0],
|
11323 | item = _curr$value[1];
|
11324 | var _value = callback(item, id);
|
11325 | if (_value > maxValue) {
|
11326 | maxValue = _value;
|
11327 | maxItem = item;
|
11328 | }
|
11329 | }
|
11330 | return maxItem;
|
11331 | }
|
11332 | |
11333 |
|
11334 |
|
11335 |
|
11336 |
|
11337 |
|
11338 | }, {
|
11339 | key: "min",
|
11340 | value: function min(callback) {
|
11341 | var iter = _getIterator(this._pairs);
|
11342 | var curr = iter.next();
|
11343 | if (curr.done) {
|
11344 | return null;
|
11345 | }
|
11346 | var minItem = curr.value[1];
|
11347 | var minValue = callback(curr.value[1], curr.value[0]);
|
11348 | while (!(curr = iter.next()).done) {
|
11349 | var _curr$value2 = _slicedToArray(curr.value, 2),
|
11350 | id = _curr$value2[0],
|
11351 | item = _curr$value2[1];
|
11352 | var _value2 = callback(item, id);
|
11353 | if (_value2 < minValue) {
|
11354 | minValue = _value2;
|
11355 | minItem = item;
|
11356 | }
|
11357 | }
|
11358 | return minItem;
|
11359 | }
|
11360 | |
11361 |
|
11362 |
|
11363 |
|
11364 |
|
11365 |
|
11366 |
|
11367 |
|
11368 | }, {
|
11369 | key: "reduce",
|
11370 | value: function reduce(callback, accumulator) {
|
11371 | var _iterator10 = _createForOfIteratorHelper$2(this._pairs),
|
11372 | _step10;
|
11373 | try {
|
11374 | for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
11375 | var _step10$value = _slicedToArray(_step10.value, 2),
|
11376 | id = _step10$value[0],
|
11377 | item = _step10$value[1];
|
11378 | accumulator = callback(accumulator, item, id);
|
11379 | }
|
11380 | } catch (err) {
|
11381 | _iterator10.e(err);
|
11382 | } finally {
|
11383 | _iterator10.f();
|
11384 | }
|
11385 | return accumulator;
|
11386 | }
|
11387 | |
11388 |
|
11389 |
|
11390 |
|
11391 |
|
11392 |
|
11393 | }, {
|
11394 | key: "sort",
|
11395 | value: function sort(callback) {
|
11396 | var _this = this;
|
11397 | return new DataStream({
|
11398 | [_Symbol$iterator]: function () {
|
11399 | var _context9;
|
11400 | return _getIterator(_sortInstanceProperty(_context9 = _toConsumableArray(_this._pairs)).call(_context9, function (_ref, _ref2) {
|
11401 | var _ref3 = _slicedToArray(_ref, 2),
|
11402 | idA = _ref3[0],
|
11403 | itemA = _ref3[1];
|
11404 | var _ref4 = _slicedToArray(_ref2, 2),
|
11405 | idB = _ref4[0],
|
11406 | itemB = _ref4[1];
|
11407 | return callback(itemA, itemB, idA, idB);
|
11408 | }));
|
11409 | }
|
11410 | });
|
11411 | }
|
11412 | }]);
|
11413 | return DataStream;
|
11414 | }(_Symbol$iterator);
|
11415 |
|
11416 | function ownKeys$4(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
11417 | function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context10, _context11; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context10 = ownKeys$4(Object(t), !0)).call(_context10, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context11 = ownKeys$4(Object(t))).call(_context11, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
11418 | function _createForOfIteratorHelper$1(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (_Array$isArray(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; } } }; }
|
11419 | function _unsupportedIterableToArray$1(o, minLen) { var _context9; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = _sliceInstanceProperty$1(_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 _Array$from$1(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
|
11420 | 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; }
|
11421 | function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
11422 | function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
11423 |
|
11424 |
|
11425 |
|
11426 |
|
11427 |
|
11428 |
|
11429 |
|
11430 |
|
11431 |
|
11432 |
|
11433 |
|
11434 | function ensureFullItem(item, idProp) {
|
11435 | if (item[idProp] == null) {
|
11436 |
|
11437 | item[idProp] = v4();
|
11438 | }
|
11439 | return item;
|
11440 | }
|
11441 |
|
11442 |
|
11443 |
|
11444 |
|
11445 |
|
11446 |
|
11447 |
|
11448 |
|
11449 |
|
11450 |
|
11451 |
|
11452 |
|
11453 |
|
11454 |
|
11455 |
|
11456 |
|
11457 |
|
11458 |
|
11459 |
|
11460 |
|
11461 |
|
11462 |
|
11463 |
|
11464 |
|
11465 |
|
11466 |
|
11467 |
|
11468 |
|
11469 |
|
11470 |
|
11471 |
|
11472 |
|
11473 |
|
11474 |
|
11475 |
|
11476 |
|
11477 |
|
11478 |
|
11479 |
|
11480 |
|
11481 |
|
11482 |
|
11483 |
|
11484 |
|
11485 |
|
11486 |
|
11487 |
|
11488 |
|
11489 |
|
11490 |
|
11491 |
|
11492 |
|
11493 |
|
11494 |
|
11495 |
|
11496 |
|
11497 |
|
11498 |
|
11499 |
|
11500 | var DataSet = function (_DataSetPart) {
|
11501 | _inherits(DataSet, _DataSetPart);
|
11502 | var _super = _createSuper$1(DataSet);
|
11503 | |
11504 |
|
11505 |
|
11506 |
|
11507 |
|
11508 |
|
11509 | function DataSet(data, options) {
|
11510 | var _this;
|
11511 | _classCallCheck(this, DataSet);
|
11512 | _this = _super.call(this);
|
11513 |
|
11514 | _defineProperty(_assertThisInitialized(_this), "_queue", null);
|
11515 | if (data && !_Array$isArray(data)) {
|
11516 | options = data;
|
11517 | data = [];
|
11518 | }
|
11519 | _this._options = options || {};
|
11520 | _this._data = new _Map();
|
11521 | _this.length = 0;
|
11522 | _this._idProp = _this._options.fieldId || "id";
|
11523 |
|
11524 | if (data && data.length) {
|
11525 | _this.add(data);
|
11526 | }
|
11527 | _this.setOptions(options);
|
11528 | return _this;
|
11529 | }
|
11530 | |
11531 |
|
11532 |
|
11533 |
|
11534 |
|
11535 | _createClass(DataSet, [{
|
11536 | key: "idProp",
|
11537 | get: /** Flush all queued calls. */
|
11538 |
|
11539 | /** @inheritDoc */
|
11540 |
|
11541 | /** @inheritDoc */
|
11542 | function get() {
|
11543 | return this._idProp;
|
11544 | }
|
11545 | }, {
|
11546 | key: "setOptions",
|
11547 | value: function setOptions(options) {
|
11548 | if (options && options.queue !== undefined) {
|
11549 | if (options.queue === false) {
|
11550 |
|
11551 | if (this._queue) {
|
11552 | this._queue.destroy();
|
11553 | this._queue = null;
|
11554 | }
|
11555 | } else {
|
11556 |
|
11557 | if (!this._queue) {
|
11558 | this._queue = Queue.extend(this, {
|
11559 | replace: ["add", "update", "remove"]
|
11560 | });
|
11561 | }
|
11562 | if (options.queue && typeof options.queue === "object") {
|
11563 | this._queue.setOptions(options.queue);
|
11564 | }
|
11565 | }
|
11566 | }
|
11567 | }
|
11568 | |
11569 |
|
11570 |
|
11571 |
|
11572 |
|
11573 |
|
11574 |
|
11575 |
|
11576 |
|
11577 |
|
11578 |
|
11579 |
|
11580 |
|
11581 |
|
11582 |
|
11583 |
|
11584 |
|
11585 |
|
11586 |
|
11587 |
|
11588 |
|
11589 |
|
11590 |
|
11591 |
|
11592 |
|
11593 |
|
11594 | }, {
|
11595 | key: "add",
|
11596 | value: function add(data, senderId) {
|
11597 | var _this2 = this;
|
11598 | var addedIds = [];
|
11599 | var id;
|
11600 | if (_Array$isArray(data)) {
|
11601 |
|
11602 | var idsToAdd = _mapInstanceProperty(data).call(data, function (d) {
|
11603 | return d[_this2._idProp];
|
11604 | });
|
11605 | if (_someInstanceProperty(idsToAdd).call(idsToAdd, function (id) {
|
11606 | return _this2._data.has(id);
|
11607 | })) {
|
11608 | throw new Error("A duplicate id was found in the parameter array.");
|
11609 | }
|
11610 | for (var i = 0, len = data.length; i < len; i++) {
|
11611 | id = this._addItem(data[i]);
|
11612 | addedIds.push(id);
|
11613 | }
|
11614 | } else if (data && typeof data === "object") {
|
11615 |
|
11616 | id = this._addItem(data);
|
11617 | addedIds.push(id);
|
11618 | } else {
|
11619 | throw new Error("Unknown dataType");
|
11620 | }
|
11621 | if (addedIds.length) {
|
11622 | this._trigger("add", {
|
11623 | items: addedIds
|
11624 | }, senderId);
|
11625 | }
|
11626 | return addedIds;
|
11627 | }
|
11628 | |
11629 |
|
11630 |
|
11631 |
|
11632 |
|
11633 |
|
11634 |
|
11635 |
|
11636 |
|
11637 |
|
11638 |
|
11639 |
|
11640 |
|
11641 |
|
11642 |
|
11643 |
|
11644 |
|
11645 |
|
11646 |
|
11647 |
|
11648 |
|
11649 |
|
11650 |
|
11651 |
|
11652 |
|
11653 |
|
11654 |
|
11655 |
|
11656 |
|
11657 |
|
11658 |
|
11659 |
|
11660 |
|
11661 |
|
11662 | }, {
|
11663 | key: "update",
|
11664 | value: function update(data, senderId) {
|
11665 | var _this3 = this;
|
11666 | var addedIds = [];
|
11667 | var updatedIds = [];
|
11668 | var oldData = [];
|
11669 | var updatedData = [];
|
11670 | var idProp = this._idProp;
|
11671 | var addOrUpdate = function addOrUpdate(item) {
|
11672 | var origId = item[idProp];
|
11673 | if (origId != null && _this3._data.has(origId)) {
|
11674 | var fullItem = item;
|
11675 | var oldItem = _Object$assign({}, _this3._data.get(origId));
|
11676 |
|
11677 | var id = _this3._updateItem(fullItem);
|
11678 | updatedIds.push(id);
|
11679 | updatedData.push(fullItem);
|
11680 | oldData.push(oldItem);
|
11681 | } else {
|
11682 |
|
11683 | var _id = _this3._addItem(item);
|
11684 | addedIds.push(_id);
|
11685 | }
|
11686 | };
|
11687 | if (_Array$isArray(data)) {
|
11688 |
|
11689 | for (var i = 0, len = data.length; i < len; i++) {
|
11690 | if (data[i] && typeof data[i] === "object") {
|
11691 | addOrUpdate(data[i]);
|
11692 | } else {
|
11693 | console.warn("Ignoring input item, which is not an object at index " + i);
|
11694 | }
|
11695 | }
|
11696 | } else if (data && typeof data === "object") {
|
11697 |
|
11698 | addOrUpdate(data);
|
11699 | } else {
|
11700 | throw new Error("Unknown dataType");
|
11701 | }
|
11702 | if (addedIds.length) {
|
11703 | this._trigger("add", {
|
11704 | items: addedIds
|
11705 | }, senderId);
|
11706 | }
|
11707 | if (updatedIds.length) {
|
11708 | var props = {
|
11709 | items: updatedIds,
|
11710 | oldData: oldData,
|
11711 | data: updatedData
|
11712 | };
|
11713 |
|
11714 |
|
11715 |
|
11716 |
|
11717 |
|
11718 |
|
11719 |
|
11720 | this._trigger("update", props, senderId);
|
11721 | }
|
11722 | return _concatInstanceProperty(addedIds).call(addedIds, updatedIds);
|
11723 | }
|
11724 | |
11725 |
|
11726 |
|
11727 |
|
11728 |
|
11729 |
|
11730 |
|
11731 |
|
11732 |
|
11733 |
|
11734 |
|
11735 |
|
11736 |
|
11737 |
|
11738 |
|
11739 |
|
11740 |
|
11741 |
|
11742 |
|
11743 |
|
11744 |
|
11745 |
|
11746 |
|
11747 |
|
11748 |
|
11749 |
|
11750 |
|
11751 |
|
11752 |
|
11753 |
|
11754 |
|
11755 |
|
11756 |
|
11757 |
|
11758 | }, {
|
11759 | key: "updateOnly",
|
11760 | value: function updateOnly(data, senderId) {
|
11761 | var _context,
|
11762 | _this4 = this;
|
11763 | if (!_Array$isArray(data)) {
|
11764 | data = [data];
|
11765 | }
|
11766 | var updateEventData = _mapInstanceProperty(_context = _mapInstanceProperty(data).call(data, function (update) {
|
11767 | var oldData = _this4._data.get(update[_this4._idProp]);
|
11768 | if (oldData == null) {
|
11769 | throw new Error("Updating non-existent items is not allowed.");
|
11770 | }
|
11771 | return {
|
11772 | oldData,
|
11773 | update
|
11774 | };
|
11775 | })).call(_context, function (_ref) {
|
11776 | var oldData = _ref.oldData,
|
11777 | update = _ref.update;
|
11778 | var id = oldData[_this4._idProp];
|
11779 | var updatedData = pureDeepObjectAssign(oldData, update);
|
11780 | _this4._data.set(id, updatedData);
|
11781 | return {
|
11782 | id,
|
11783 | oldData: oldData,
|
11784 | updatedData
|
11785 | };
|
11786 | });
|
11787 | if (updateEventData.length) {
|
11788 | var props = {
|
11789 | items: _mapInstanceProperty(updateEventData).call(updateEventData, function (value) {
|
11790 | return value.id;
|
11791 | }),
|
11792 | oldData: _mapInstanceProperty(updateEventData).call(updateEventData, function (value) {
|
11793 | return value.oldData;
|
11794 | }),
|
11795 | data: _mapInstanceProperty(updateEventData).call(updateEventData, function (value) {
|
11796 | return value.updatedData;
|
11797 | })
|
11798 | };
|
11799 |
|
11800 |
|
11801 |
|
11802 |
|
11803 |
|
11804 |
|
11805 |
|
11806 | this._trigger("update", props, senderId);
|
11807 | return props.items;
|
11808 | } else {
|
11809 | return [];
|
11810 | }
|
11811 | }
|
11812 |
|
11813 | }, {
|
11814 | key: "get",
|
11815 | value: function get(first, second) {
|
11816 |
|
11817 |
|
11818 | var id = undefined;
|
11819 | var ids = undefined;
|
11820 | var options = undefined;
|
11821 | if (isId(first)) {
|
11822 |
|
11823 | id = first;
|
11824 | options = second;
|
11825 | } else if (_Array$isArray(first)) {
|
11826 |
|
11827 | ids = first;
|
11828 | options = second;
|
11829 | } else {
|
11830 |
|
11831 | options = first;
|
11832 | }
|
11833 |
|
11834 | var returnType = options && options.returnType === "Object" ? "Object" : "Array";
|
11835 |
|
11836 |
|
11837 |
|
11838 |
|
11839 |
|
11840 |
|
11841 |
|
11842 |
|
11843 |
|
11844 |
|
11845 |
|
11846 |
|
11847 | var filter = options && _filterInstanceProperty(options);
|
11848 | var items = [];
|
11849 | var item = undefined;
|
11850 | var itemIds = undefined;
|
11851 | var itemId = undefined;
|
11852 |
|
11853 | if (id != null) {
|
11854 |
|
11855 | item = this._data.get(id);
|
11856 | if (item && filter && !filter(item)) {
|
11857 | item = undefined;
|
11858 | }
|
11859 | } else if (ids != null) {
|
11860 |
|
11861 | for (var i = 0, len = ids.length; i < len; i++) {
|
11862 | item = this._data.get(ids[i]);
|
11863 | if (item != null && (!filter || filter(item))) {
|
11864 | items.push(item);
|
11865 | }
|
11866 | }
|
11867 | } else {
|
11868 | var _context2;
|
11869 |
|
11870 | itemIds = _toConsumableArray(_keysInstanceProperty(_context2 = this._data).call(_context2));
|
11871 | for (var _i = 0, _len = itemIds.length; _i < _len; _i++) {
|
11872 | itemId = itemIds[_i];
|
11873 | item = this._data.get(itemId);
|
11874 | if (item != null && (!filter || filter(item))) {
|
11875 | items.push(item);
|
11876 | }
|
11877 | }
|
11878 | }
|
11879 |
|
11880 | if (options && options.order && id == undefined) {
|
11881 | this._sort(items, options.order);
|
11882 | }
|
11883 |
|
11884 | if (options && options.fields) {
|
11885 | var fields = options.fields;
|
11886 | if (id != undefined && item != null) {
|
11887 | item = this._filterFields(item, fields);
|
11888 | } else {
|
11889 | for (var _i2 = 0, _len2 = items.length; _i2 < _len2; _i2++) {
|
11890 | items[_i2] = this._filterFields(items[_i2], fields);
|
11891 | }
|
11892 | }
|
11893 | }
|
11894 |
|
11895 | if (returnType == "Object") {
|
11896 | var result = {};
|
11897 | for (var _i3 = 0, _len3 = items.length; _i3 < _len3; _i3++) {
|
11898 | var resultant = items[_i3];
|
11899 |
|
11900 |
|
11901 | var _id2 = resultant[this._idProp];
|
11902 | result[_id2] = resultant;
|
11903 | }
|
11904 | return result;
|
11905 | } else {
|
11906 | if (id != null) {
|
11907 | var _item;
|
11908 |
|
11909 | return (_item = item) !== null && _item !== void 0 ? _item : null;
|
11910 | } else {
|
11911 |
|
11912 | return items;
|
11913 | }
|
11914 | }
|
11915 | }
|
11916 |
|
11917 | }, {
|
11918 | key: "getIds",
|
11919 | value: function getIds(options) {
|
11920 | var data = this._data;
|
11921 | var filter = options && _filterInstanceProperty(options);
|
11922 | var order = options && options.order;
|
11923 | var itemIds = _toConsumableArray(_keysInstanceProperty(data).call(data));
|
11924 | var ids = [];
|
11925 | if (filter) {
|
11926 |
|
11927 | if (order) {
|
11928 |
|
11929 | var items = [];
|
11930 | for (var i = 0, len = itemIds.length; i < len; i++) {
|
11931 | var id = itemIds[i];
|
11932 | var item = this._data.get(id);
|
11933 | if (item != null && filter(item)) {
|
11934 | items.push(item);
|
11935 | }
|
11936 | }
|
11937 | this._sort(items, order);
|
11938 | for (var _i4 = 0, _len4 = items.length; _i4 < _len4; _i4++) {
|
11939 | ids.push(items[_i4][this._idProp]);
|
11940 | }
|
11941 | } else {
|
11942 |
|
11943 | for (var _i5 = 0, _len5 = itemIds.length; _i5 < _len5; _i5++) {
|
11944 | var _id3 = itemIds[_i5];
|
11945 | var _item2 = this._data.get(_id3);
|
11946 | if (_item2 != null && filter(_item2)) {
|
11947 | ids.push(_item2[this._idProp]);
|
11948 | }
|
11949 | }
|
11950 | }
|
11951 | } else {
|
11952 |
|
11953 | if (order) {
|
11954 |
|
11955 | var _items = [];
|
11956 | for (var _i6 = 0, _len6 = itemIds.length; _i6 < _len6; _i6++) {
|
11957 | var _id4 = itemIds[_i6];
|
11958 | _items.push(data.get(_id4));
|
11959 | }
|
11960 | this._sort(_items, order);
|
11961 | for (var _i7 = 0, _len7 = _items.length; _i7 < _len7; _i7++) {
|
11962 | ids.push(_items[_i7][this._idProp]);
|
11963 | }
|
11964 | } else {
|
11965 |
|
11966 | for (var _i8 = 0, _len8 = itemIds.length; _i8 < _len8; _i8++) {
|
11967 | var _id5 = itemIds[_i8];
|
11968 | var _item3 = data.get(_id5);
|
11969 | if (_item3 != null) {
|
11970 | ids.push(_item3[this._idProp]);
|
11971 | }
|
11972 | }
|
11973 | }
|
11974 | }
|
11975 | return ids;
|
11976 | }
|
11977 |
|
11978 | }, {
|
11979 | key: "getDataSet",
|
11980 | value: function getDataSet() {
|
11981 | return this;
|
11982 | }
|
11983 |
|
11984 | }, {
|
11985 | key: "forEach",
|
11986 | value: function forEach(callback, options) {
|
11987 | var filter = options && _filterInstanceProperty(options);
|
11988 | var data = this._data;
|
11989 | var itemIds = _toConsumableArray(_keysInstanceProperty(data).call(data));
|
11990 | if (options && options.order) {
|
11991 |
|
11992 | var items = this.get(options);
|
11993 | for (var i = 0, len = items.length; i < len; i++) {
|
11994 | var item = items[i];
|
11995 | var id = item[this._idProp];
|
11996 | callback(item, id);
|
11997 | }
|
11998 | } else {
|
11999 |
|
12000 | for (var _i9 = 0, _len9 = itemIds.length; _i9 < _len9; _i9++) {
|
12001 | var _id6 = itemIds[_i9];
|
12002 | var _item4 = this._data.get(_id6);
|
12003 | if (_item4 != null && (!filter || filter(_item4))) {
|
12004 | callback(_item4, _id6);
|
12005 | }
|
12006 | }
|
12007 | }
|
12008 | }
|
12009 |
|
12010 | }, {
|
12011 | key: "map",
|
12012 | value: function map(callback, options) {
|
12013 | var filter = options && _filterInstanceProperty(options);
|
12014 | var mappedItems = [];
|
12015 | var data = this._data;
|
12016 | var itemIds = _toConsumableArray(_keysInstanceProperty(data).call(data));
|
12017 |
|
12018 | for (var i = 0, len = itemIds.length; i < len; i++) {
|
12019 | var id = itemIds[i];
|
12020 | var item = this._data.get(id);
|
12021 | if (item != null && (!filter || filter(item))) {
|
12022 | mappedItems.push(callback(item, id));
|
12023 | }
|
12024 | }
|
12025 |
|
12026 | if (options && options.order) {
|
12027 | this._sort(mappedItems, options.order);
|
12028 | }
|
12029 | return mappedItems;
|
12030 | }
|
12031 | |
12032 |
|
12033 |
|
12034 |
|
12035 |
|
12036 |
|
12037 |
|
12038 |
|
12039 | }, {
|
12040 | key: "_filterFields",
|
12041 | value: function _filterFields(item, fields) {
|
12042 | var _context3;
|
12043 | if (!item) {
|
12044 |
|
12045 | return item;
|
12046 | }
|
12047 | return _reduceInstanceProperty(_context3 = _Array$isArray(fields) ?
|
12048 |
|
12049 | fields :
|
12050 |
|
12051 | _Object$keys(fields)).call(_context3, function (filteredItem, field) {
|
12052 | filteredItem[field] = item[field];
|
12053 | return filteredItem;
|
12054 | }, {});
|
12055 | }
|
12056 | |
12057 |
|
12058 |
|
12059 |
|
12060 |
|
12061 |
|
12062 |
|
12063 | }, {
|
12064 | key: "_sort",
|
12065 | value: function _sort(items, order) {
|
12066 | if (typeof order === "string") {
|
12067 |
|
12068 | var name = order;
|
12069 | _sortInstanceProperty(items).call(items, function (a, b) {
|
12070 |
|
12071 | var av = a[name];
|
12072 | var bv = b[name];
|
12073 | return av > bv ? 1 : av < bv ? -1 : 0;
|
12074 | });
|
12075 | } else if (typeof order === "function") {
|
12076 |
|
12077 | _sortInstanceProperty(items).call(items, order);
|
12078 | } else {
|
12079 |
|
12080 |
|
12081 | throw new TypeError("Order must be a function or a string");
|
12082 | }
|
12083 | }
|
12084 | |
12085 |
|
12086 |
|
12087 |
|
12088 |
|
12089 |
|
12090 |
|
12091 |
|
12092 |
|
12093 |
|
12094 |
|
12095 |
|
12096 |
|
12097 |
|
12098 |
|
12099 |
|
12100 |
|
12101 |
|
12102 |
|
12103 |
|
12104 |
|
12105 |
|
12106 |
|
12107 |
|
12108 |
|
12109 |
|
12110 | }, {
|
12111 | key: "remove",
|
12112 | value: function remove(id, senderId) {
|
12113 | var removedIds = [];
|
12114 | var removedItems = [];
|
12115 |
|
12116 | var ids = _Array$isArray(id) ? id : [id];
|
12117 | for (var i = 0, len = ids.length; i < len; i++) {
|
12118 | var item = this._remove(ids[i]);
|
12119 | if (item) {
|
12120 | var itemId = item[this._idProp];
|
12121 | if (itemId != null) {
|
12122 | removedIds.push(itemId);
|
12123 | removedItems.push(item);
|
12124 | }
|
12125 | }
|
12126 | }
|
12127 | if (removedIds.length) {
|
12128 | this._trigger("remove", {
|
12129 | items: removedIds,
|
12130 | oldData: removedItems
|
12131 | }, senderId);
|
12132 | }
|
12133 | return removedIds;
|
12134 | }
|
12135 | |
12136 |
|
12137 |
|
12138 |
|
12139 |
|
12140 |
|
12141 | }, {
|
12142 | key: "_remove",
|
12143 | value: function _remove(id) {
|
12144 |
|
12145 |
|
12146 | var ident;
|
12147 |
|
12148 | if (isId(id)) {
|
12149 | ident = id;
|
12150 | } else if (id && typeof id === "object") {
|
12151 | ident = id[this._idProp];
|
12152 | }
|
12153 |
|
12154 | if (ident != null && this._data.has(ident)) {
|
12155 | var item = this._data.get(ident) || null;
|
12156 | this._data.delete(ident);
|
12157 | --this.length;
|
12158 | return item;
|
12159 | }
|
12160 | return null;
|
12161 | }
|
12162 | |
12163 |
|
12164 |
|
12165 |
|
12166 |
|
12167 |
|
12168 |
|
12169 |
|
12170 | }, {
|
12171 | key: "clear",
|
12172 | value: function clear(senderId) {
|
12173 | var _context4;
|
12174 | var ids = _toConsumableArray(_keysInstanceProperty(_context4 = this._data).call(_context4));
|
12175 | var items = [];
|
12176 | for (var i = 0, len = ids.length; i < len; i++) {
|
12177 | items.push(this._data.get(ids[i]));
|
12178 | }
|
12179 | this._data.clear();
|
12180 | this.length = 0;
|
12181 | this._trigger("remove", {
|
12182 | items: ids,
|
12183 | oldData: items
|
12184 | }, senderId);
|
12185 | return ids;
|
12186 | }
|
12187 | |
12188 |
|
12189 |
|
12190 |
|
12191 |
|
12192 |
|
12193 | }, {
|
12194 | key: "max",
|
12195 | value: function max(field) {
|
12196 | var _context5;
|
12197 | var max = null;
|
12198 | var maxField = null;
|
12199 | var _iterator = _createForOfIteratorHelper$1(_valuesInstanceProperty(_context5 = this._data).call(_context5)),
|
12200 | _step;
|
12201 | try {
|
12202 | for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
12203 | var item = _step.value;
|
12204 | var itemField = item[field];
|
12205 | if (typeof itemField === "number" && (maxField == null || itemField > maxField)) {
|
12206 | max = item;
|
12207 | maxField = itemField;
|
12208 | }
|
12209 | }
|
12210 | } catch (err) {
|
12211 | _iterator.e(err);
|
12212 | } finally {
|
12213 | _iterator.f();
|
12214 | }
|
12215 | return max || null;
|
12216 | }
|
12217 | |
12218 |
|
12219 |
|
12220 |
|
12221 |
|
12222 |
|
12223 | }, {
|
12224 | key: "min",
|
12225 | value: function min(field) {
|
12226 | var _context6;
|
12227 | var min = null;
|
12228 | var minField = null;
|
12229 | var _iterator2 = _createForOfIteratorHelper$1(_valuesInstanceProperty(_context6 = this._data).call(_context6)),
|
12230 | _step2;
|
12231 | try {
|
12232 | for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
12233 | var item = _step2.value;
|
12234 | var itemField = item[field];
|
12235 | if (typeof itemField === "number" && (minField == null || itemField < minField)) {
|
12236 | min = item;
|
12237 | minField = itemField;
|
12238 | }
|
12239 | }
|
12240 | } catch (err) {
|
12241 | _iterator2.e(err);
|
12242 | } finally {
|
12243 | _iterator2.f();
|
12244 | }
|
12245 | return min || null;
|
12246 | }
|
12247 | |
12248 |
|
12249 |
|
12250 |
|
12251 |
|
12252 |
|
12253 | }, {
|
12254 | key: "distinct",
|
12255 | value: function distinct(prop) {
|
12256 | var data = this._data;
|
12257 | var itemIds = _toConsumableArray(_keysInstanceProperty(data).call(data));
|
12258 | var values = [];
|
12259 | var count = 0;
|
12260 | for (var i = 0, len = itemIds.length; i < len; i++) {
|
12261 | var id = itemIds[i];
|
12262 | var item = data.get(id);
|
12263 | var value = item[prop];
|
12264 | var exists = false;
|
12265 | for (var j = 0; j < count; j++) {
|
12266 | if (values[j] == value) {
|
12267 | exists = true;
|
12268 | break;
|
12269 | }
|
12270 | }
|
12271 | if (!exists && value !== undefined) {
|
12272 | values[count] = value;
|
12273 | count++;
|
12274 | }
|
12275 | }
|
12276 | return values;
|
12277 | }
|
12278 | |
12279 |
|
12280 |
|
12281 |
|
12282 |
|
12283 |
|
12284 | }, {
|
12285 | key: "_addItem",
|
12286 | value: function _addItem(item) {
|
12287 | var fullItem = ensureFullItem(item, this._idProp);
|
12288 | var id = fullItem[this._idProp];
|
12289 |
|
12290 | if (this._data.has(id)) {
|
12291 |
|
12292 | throw new Error("Cannot add item: item with id " + id + " already exists");
|
12293 | }
|
12294 | this._data.set(id, fullItem);
|
12295 | ++this.length;
|
12296 | return id;
|
12297 | }
|
12298 | |
12299 |
|
12300 |
|
12301 |
|
12302 |
|
12303 |
|
12304 |
|
12305 | }, {
|
12306 | key: "_updateItem",
|
12307 | value: function _updateItem(update) {
|
12308 | var id = update[this._idProp];
|
12309 | if (id == null) {
|
12310 | throw new Error("Cannot update item: item has no id (item: " + _JSON$stringify(update) + ")");
|
12311 | }
|
12312 | var item = this._data.get(id);
|
12313 | if (!item) {
|
12314 |
|
12315 | throw new Error("Cannot update item: no item with id " + id + " found");
|
12316 | }
|
12317 | this._data.set(id, _objectSpread(_objectSpread({}, item), update));
|
12318 | return id;
|
12319 | }
|
12320 |
|
12321 | }, {
|
12322 | key: "stream",
|
12323 | value: function stream(ids) {
|
12324 | if (ids) {
|
12325 | var data = this._data;
|
12326 | return new DataStream({
|
12327 | [_Symbol$iterator]() {
|
12328 | return _regeneratorRuntime.mark(function _callee() {
|
12329 | var _iterator3, _step3, id, item;
|
12330 | return _regeneratorRuntime.wrap(function _callee$(_context7) {
|
12331 | while (1) switch (_context7.prev = _context7.next) {
|
12332 | case 0:
|
12333 | _iterator3 = _createForOfIteratorHelper$1(ids);
|
12334 | _context7.prev = 1;
|
12335 | _iterator3.s();
|
12336 | case 3:
|
12337 | if ((_step3 = _iterator3.n()).done) {
|
12338 | _context7.next = 11;
|
12339 | break;
|
12340 | }
|
12341 | id = _step3.value;
|
12342 | item = data.get(id);
|
12343 | if (!(item != null)) {
|
12344 | _context7.next = 9;
|
12345 | break;
|
12346 | }
|
12347 | _context7.next = 9;
|
12348 | return [id, item];
|
12349 | case 9:
|
12350 | _context7.next = 3;
|
12351 | break;
|
12352 | case 11:
|
12353 | _context7.next = 16;
|
12354 | break;
|
12355 | case 13:
|
12356 | _context7.prev = 13;
|
12357 | _context7.t0 = _context7["catch"](1);
|
12358 | _iterator3.e(_context7.t0);
|
12359 | case 16:
|
12360 | _context7.prev = 16;
|
12361 | _iterator3.f();
|
12362 | return _context7.finish(16);
|
12363 | case 19:
|
12364 | case "end":
|
12365 | return _context7.stop();
|
12366 | }
|
12367 | }, _callee, null, [[1, 13, 16, 19]]);
|
12368 | })();
|
12369 | }
|
12370 | });
|
12371 | } else {
|
12372 | var _context8;
|
12373 | return new DataStream({
|
12374 | [_Symbol$iterator]: _bindInstanceProperty$1(_context8 = _entriesInstanceProperty(this._data)).call(_context8, this._data)
|
12375 | });
|
12376 | }
|
12377 | }
|
12378 |
|
12379 | }, {
|
12380 | key: "testLeakData",
|
12381 | get: function get() {
|
12382 | return this._data;
|
12383 | }
|
12384 | }, {
|
12385 | key: "testLeakIdProp",
|
12386 | get: function get() {
|
12387 | return this._idProp;
|
12388 | }
|
12389 | }, {
|
12390 | key: "testLeakOptions",
|
12391 | get: function get() {
|
12392 | return this._options;
|
12393 | }
|
12394 | }, {
|
12395 | key: "testLeakQueue",
|
12396 | get: function get() {
|
12397 | return this._queue;
|
12398 | },
|
12399 | set: function set(v) {
|
12400 | this._queue = v;
|
12401 | }
|
12402 | }]);
|
12403 | return DataSet;
|
12404 | }(DataSetPart);
|
12405 |
|
12406 | var $ = _export;
|
12407 | var ownKeys$3 = ownKeys$7;
|
12408 |
|
12409 |
|
12410 |
|
12411 | $({ target: 'Reflect', stat: true }, {
|
12412 | ownKeys: ownKeys$3
|
12413 | });
|
12414 |
|
12415 | var path = path$o;
|
12416 |
|
12417 | var ownKeys$2 = path.Reflect.ownKeys;
|
12418 |
|
12419 | var parent = ownKeys$2;
|
12420 |
|
12421 | var ownKeys$1 = parent;
|
12422 |
|
12423 | var ownKeys = ownKeys$1;
|
12424 |
|
12425 | var _Reflect$ownKeys = getDefaultExportFromCjs(ownKeys);
|
12426 |
|
12427 | function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (_Array$isArray(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; } } }; }
|
12428 | function _unsupportedIterableToArray(o, minLen) { var _context5; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty$1(_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 _Array$from$1(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
12429 | 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; }
|
12430 | function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
12431 | function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
12432 |
|
12433 |
|
12434 |
|
12435 |
|
12436 |
|
12437 |
|
12438 |
|
12439 |
|
12440 |
|
12441 |
|
12442 |
|
12443 |
|
12444 |
|
12445 |
|
12446 |
|
12447 |
|
12448 |
|
12449 |
|
12450 |
|
12451 |
|
12452 |
|
12453 |
|
12454 |
|
12455 |
|
12456 |
|
12457 |
|
12458 |
|
12459 |
|
12460 |
|
12461 |
|
12462 |
|
12463 |
|
12464 |
|
12465 |
|
12466 |
|
12467 |
|
12468 |
|
12469 |
|
12470 |
|
12471 |
|
12472 |
|
12473 |
|
12474 |
|
12475 |
|
12476 |
|
12477 | var DataView = function (_DataSetPart) {
|
12478 | _inherits(DataView, _DataSetPart);
|
12479 | var _super = _createSuper(DataView);
|
12480 |
|
12481 |
|
12482 | |
12483 |
|
12484 |
|
12485 |
|
12486 |
|
12487 |
|
12488 | function DataView(data, options) {
|
12489 | var _context;
|
12490 | var _this;
|
12491 | _classCallCheck(this, DataView);
|
12492 | _this = _super.call(this);
|
12493 |
|
12494 | _defineProperty(_assertThisInitialized(_this), "length", 0);
|
12495 |
|
12496 | _defineProperty(_assertThisInitialized(_this), "_ids", new _Set());
|
12497 | _this._options = options || {};
|
12498 | _this._listener = _bindInstanceProperty$1(_context = _this._onEvent).call(_context, _assertThisInitialized(_this));
|
12499 | _this.setData(data);
|
12500 | return _this;
|
12501 | }
|
12502 |
|
12503 |
|
12504 | |
12505 |
|
12506 |
|
12507 |
|
12508 |
|
12509 |
|
12510 |
|
12511 |
|
12512 |
|
12513 |
|
12514 | _createClass(DataView, [{
|
12515 | key: "idProp",
|
12516 | get: /** @inheritDoc */
|
12517 | function get() {
|
12518 | return this.getDataSet().idProp;
|
12519 | }
|
12520 | }, {
|
12521 | key: "setData",
|
12522 | value: function setData(data) {
|
12523 | if (this._data) {
|
12524 |
|
12525 | if (this._data.off) {
|
12526 | this._data.off("*", this._listener);
|
12527 | }
|
12528 |
|
12529 | var ids = this._data.getIds({
|
12530 | filter: _filterInstanceProperty(this._options)
|
12531 | });
|
12532 | var items = this._data.get(ids);
|
12533 | this._ids.clear();
|
12534 | this.length = 0;
|
12535 | this._trigger("remove", {
|
12536 | items: ids,
|
12537 | oldData: items
|
12538 | });
|
12539 | }
|
12540 | if (data != null) {
|
12541 | this._data = data;
|
12542 |
|
12543 | var _ids = this._data.getIds({
|
12544 | filter: _filterInstanceProperty(this._options)
|
12545 | });
|
12546 | for (var i = 0, len = _ids.length; i < len; i++) {
|
12547 | var id = _ids[i];
|
12548 | this._ids.add(id);
|
12549 | }
|
12550 | this.length = _ids.length;
|
12551 | this._trigger("add", {
|
12552 | items: _ids
|
12553 | });
|
12554 | } else {
|
12555 | this._data = new DataSet();
|
12556 | }
|
12557 |
|
12558 | if (this._data.on) {
|
12559 | this._data.on("*", this._listener);
|
12560 | }
|
12561 | }
|
12562 | |
12563 |
|
12564 |
|
12565 |
|
12566 | }, {
|
12567 | key: "refresh",
|
12568 | value: function refresh() {
|
12569 | var ids = this._data.getIds({
|
12570 | filter: _filterInstanceProperty(this._options)
|
12571 | });
|
12572 | var oldIds = _toConsumableArray(this._ids);
|
12573 | var newIds = {};
|
12574 | var addedIds = [];
|
12575 | var removedIds = [];
|
12576 | var removedItems = [];
|
12577 |
|
12578 | for (var i = 0, len = ids.length; i < len; i++) {
|
12579 | var id = ids[i];
|
12580 | newIds[id] = true;
|
12581 | if (!this._ids.has(id)) {
|
12582 | addedIds.push(id);
|
12583 | this._ids.add(id);
|
12584 | }
|
12585 | }
|
12586 |
|
12587 | for (var _i = 0, _len = oldIds.length; _i < _len; _i++) {
|
12588 | var _id = oldIds[_i];
|
12589 | var item = this._data.get(_id);
|
12590 | if (item == null) {
|
12591 |
|
12592 |
|
12593 |
|
12594 |
|
12595 | console.error("If you see this, report it please.");
|
12596 | } else if (!newIds[_id]) {
|
12597 | removedIds.push(_id);
|
12598 | removedItems.push(item);
|
12599 | this._ids.delete(_id);
|
12600 | }
|
12601 | }
|
12602 | this.length += addedIds.length - removedIds.length;
|
12603 |
|
12604 | if (addedIds.length) {
|
12605 | this._trigger("add", {
|
12606 | items: addedIds
|
12607 | });
|
12608 | }
|
12609 | if (removedIds.length) {
|
12610 | this._trigger("remove", {
|
12611 | items: removedIds,
|
12612 | oldData: removedItems
|
12613 | });
|
12614 | }
|
12615 | }
|
12616 |
|
12617 | }, {
|
12618 | key: "get",
|
12619 | value: function get(first, second) {
|
12620 | if (this._data == null) {
|
12621 | return null;
|
12622 | }
|
12623 |
|
12624 | var ids = null;
|
12625 | var options;
|
12626 | if (isId(first) || _Array$isArray(first)) {
|
12627 | ids = first;
|
12628 | options = second;
|
12629 | } else {
|
12630 | options = first;
|
12631 | }
|
12632 |
|
12633 | var viewOptions = _Object$assign({}, this._options, options);
|
12634 |
|
12635 | var thisFilter = _filterInstanceProperty(this._options);
|
12636 | var optionsFilter = options && _filterInstanceProperty(options);
|
12637 | if (thisFilter && optionsFilter) {
|
12638 | viewOptions.filter = function (item) {
|
12639 | return thisFilter(item) && optionsFilter(item);
|
12640 | };
|
12641 | }
|
12642 | if (ids == null) {
|
12643 | return this._data.get(viewOptions);
|
12644 | } else {
|
12645 | return this._data.get(ids, viewOptions);
|
12646 | }
|
12647 | }
|
12648 |
|
12649 | }, {
|
12650 | key: "getIds",
|
12651 | value: function getIds(options) {
|
12652 | if (this._data.length) {
|
12653 | var defaultFilter = _filterInstanceProperty(this._options);
|
12654 | var optionsFilter = options != null ? _filterInstanceProperty(options) : null;
|
12655 | var filter;
|
12656 | if (optionsFilter) {
|
12657 | if (defaultFilter) {
|
12658 | filter = function filter(item) {
|
12659 | return defaultFilter(item) && optionsFilter(item);
|
12660 | };
|
12661 | } else {
|
12662 | filter = optionsFilter;
|
12663 | }
|
12664 | } else {
|
12665 | filter = defaultFilter;
|
12666 | }
|
12667 | return this._data.getIds({
|
12668 | filter: filter,
|
12669 | order: options && options.order
|
12670 | });
|
12671 | } else {
|
12672 | return [];
|
12673 | }
|
12674 | }
|
12675 |
|
12676 | }, {
|
12677 | key: "forEach",
|
12678 | value: function forEach(callback, options) {
|
12679 | if (this._data) {
|
12680 | var _context2;
|
12681 | var defaultFilter = _filterInstanceProperty(this._options);
|
12682 | var optionsFilter = options && _filterInstanceProperty(options);
|
12683 | var filter;
|
12684 | if (optionsFilter) {
|
12685 | if (defaultFilter) {
|
12686 | filter = function filter(item) {
|
12687 | return defaultFilter(item) && optionsFilter(item);
|
12688 | };
|
12689 | } else {
|
12690 | filter = optionsFilter;
|
12691 | }
|
12692 | } else {
|
12693 | filter = defaultFilter;
|
12694 | }
|
12695 | _forEachInstanceProperty(_context2 = this._data).call(_context2, callback, {
|
12696 | filter: filter,
|
12697 | order: options && options.order
|
12698 | });
|
12699 | }
|
12700 | }
|
12701 |
|
12702 | }, {
|
12703 | key: "map",
|
12704 | value: function map(callback, options) {
|
12705 | if (this._data) {
|
12706 | var _context3;
|
12707 | var defaultFilter = _filterInstanceProperty(this._options);
|
12708 | var optionsFilter = options && _filterInstanceProperty(options);
|
12709 | var filter;
|
12710 | if (optionsFilter) {
|
12711 | if (defaultFilter) {
|
12712 | filter = function filter(item) {
|
12713 | return defaultFilter(item) && optionsFilter(item);
|
12714 | };
|
12715 | } else {
|
12716 | filter = optionsFilter;
|
12717 | }
|
12718 | } else {
|
12719 | filter = defaultFilter;
|
12720 | }
|
12721 | return _mapInstanceProperty(_context3 = this._data).call(_context3, callback, {
|
12722 | filter: filter,
|
12723 | order: options && options.order
|
12724 | });
|
12725 | } else {
|
12726 | return [];
|
12727 | }
|
12728 | }
|
12729 |
|
12730 | }, {
|
12731 | key: "getDataSet",
|
12732 | value: function getDataSet() {
|
12733 | return this._data.getDataSet();
|
12734 | }
|
12735 |
|
12736 | }, {
|
12737 | key: "stream",
|
12738 | value: function stream(ids) {
|
12739 | var _context4;
|
12740 | return this._data.stream(ids || {
|
12741 | [_Symbol$iterator]: _bindInstanceProperty$1(_context4 = _keysInstanceProperty(this._ids)).call(_context4, this._ids)
|
12742 | });
|
12743 | }
|
12744 | |
12745 |
|
12746 |
|
12747 |
|
12748 |
|
12749 |
|
12750 |
|
12751 |
|
12752 | }, {
|
12753 | key: "dispose",
|
12754 | value: function dispose() {
|
12755 | var _this$_data;
|
12756 | if ((_this$_data = this._data) !== null && _this$_data !== void 0 && _this$_data.off) {
|
12757 | this._data.off("*", this._listener);
|
12758 | }
|
12759 | var message = "This data view has already been disposed of.";
|
12760 | var replacement = {
|
12761 | get: function get() {
|
12762 | throw new Error(message);
|
12763 | },
|
12764 | set: function set() {
|
12765 | throw new Error(message);
|
12766 | },
|
12767 | configurable: false
|
12768 | };
|
12769 | var _iterator = _createForOfIteratorHelper(_Reflect$ownKeys(DataView.prototype)),
|
12770 | _step;
|
12771 | try {
|
12772 | for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
12773 | var key = _step.value;
|
12774 | _Object$defineProperty(this, key, replacement);
|
12775 | }
|
12776 | } catch (err) {
|
12777 | _iterator.e(err);
|
12778 | } finally {
|
12779 | _iterator.f();
|
12780 | }
|
12781 | }
|
12782 | |
12783 |
|
12784 |
|
12785 |
|
12786 |
|
12787 |
|
12788 |
|
12789 | }, {
|
12790 | key: "_onEvent",
|
12791 | value: function _onEvent(event, params, senderId) {
|
12792 | if (!params || !params.items || !this._data) {
|
12793 | return;
|
12794 | }
|
12795 | var ids = params.items;
|
12796 | var addedIds = [];
|
12797 | var updatedIds = [];
|
12798 | var removedIds = [];
|
12799 | var oldItems = [];
|
12800 | var updatedItems = [];
|
12801 | var removedItems = [];
|
12802 | switch (event) {
|
12803 | case "add":
|
12804 |
|
12805 | for (var i = 0, len = ids.length; i < len; i++) {
|
12806 | var id = ids[i];
|
12807 | var item = this.get(id);
|
12808 | if (item) {
|
12809 | this._ids.add(id);
|
12810 | addedIds.push(id);
|
12811 | }
|
12812 | }
|
12813 | break;
|
12814 | case "update":
|
12815 |
|
12816 |
|
12817 | for (var _i2 = 0, _len2 = ids.length; _i2 < _len2; _i2++) {
|
12818 | var _id2 = ids[_i2];
|
12819 | var _item = this.get(_id2);
|
12820 | if (_item) {
|
12821 | if (this._ids.has(_id2)) {
|
12822 | updatedIds.push(_id2);
|
12823 | updatedItems.push(params.data[_i2]);
|
12824 | oldItems.push(params.oldData[_i2]);
|
12825 | } else {
|
12826 | this._ids.add(_id2);
|
12827 | addedIds.push(_id2);
|
12828 | }
|
12829 | } else {
|
12830 | if (this._ids.has(_id2)) {
|
12831 | this._ids.delete(_id2);
|
12832 | removedIds.push(_id2);
|
12833 | removedItems.push(params.oldData[_i2]);
|
12834 | }
|
12835 | }
|
12836 | }
|
12837 | break;
|
12838 | case "remove":
|
12839 |
|
12840 | for (var _i3 = 0, _len3 = ids.length; _i3 < _len3; _i3++) {
|
12841 | var _id3 = ids[_i3];
|
12842 | if (this._ids.has(_id3)) {
|
12843 | this._ids.delete(_id3);
|
12844 | removedIds.push(_id3);
|
12845 | removedItems.push(params.oldData[_i3]);
|
12846 | }
|
12847 | }
|
12848 | break;
|
12849 | }
|
12850 | this.length += addedIds.length - removedIds.length;
|
12851 | if (addedIds.length) {
|
12852 | this._trigger("add", {
|
12853 | items: addedIds
|
12854 | }, senderId);
|
12855 | }
|
12856 | if (updatedIds.length) {
|
12857 | this._trigger("update", {
|
12858 | items: updatedIds,
|
12859 | oldData: oldItems,
|
12860 | data: updatedItems
|
12861 | }, senderId);
|
12862 | }
|
12863 | if (removedIds.length) {
|
12864 | this._trigger("remove", {
|
12865 | items: removedIds,
|
12866 | oldData: removedItems
|
12867 | }, senderId);
|
12868 | }
|
12869 | }
|
12870 | }]);
|
12871 | return DataView;
|
12872 | }(DataSetPart);
|
12873 |
|
12874 |
|
12875 |
|
12876 |
|
12877 |
|
12878 |
|
12879 |
|
12880 |
|
12881 | function isDataSetLike(idProp, v) {
|
12882 | return typeof v === "object" && v !== null && idProp === v.idProp && typeof v.add === "function" && typeof v.clear === "function" && typeof v.distinct === "function" && typeof _forEachInstanceProperty(v) === "function" && typeof v.get === "function" && typeof v.getDataSet === "function" && typeof v.getIds === "function" && typeof v.length === "number" && typeof _mapInstanceProperty(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";
|
12883 | }
|
12884 |
|
12885 |
|
12886 |
|
12887 |
|
12888 |
|
12889 |
|
12890 |
|
12891 |
|
12892 | function isDataViewLike(idProp, v) {
|
12893 | return typeof v === "object" && v !== null && idProp === v.idProp && typeof _forEachInstanceProperty(v) === "function" && typeof v.get === "function" && typeof v.getDataSet === "function" && typeof v.getIds === "function" && typeof v.length === "number" && typeof _mapInstanceProperty(v) === "function" && typeof v.off === "function" && typeof v.on === "function" && typeof v.stream === "function" && isDataSetLike(idProp, v.getDataSet());
|
12894 | }
|
12895 |
|
12896 |
|
12897 | console.warn("You're running a development build.");
|
12898 |
|
12899 |
|
12900 | var index = {
|
12901 | DataSet,
|
12902 | DataView,
|
12903 | Queue
|
12904 | };
|
12905 |
|
12906 | export { DELETE, DataSet, DataStream, DataView, Queue, createNewDataPipeFrom, index as default, isDataSetLike, isDataViewLike };
|
12907 |
|