1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | (function (global, factory) {
|
11 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
12 | typeof define === 'function' && define.amd ? define(factory) :
|
13 | (global = global || self, global.SimpleBar = factory());
|
14 | }(this, function () { 'use strict';
|
15 |
|
16 | var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
17 |
|
18 | function createCommonjsModule(fn, module) {
|
19 | return module = { exports: {} }, fn(module, module.exports), module.exports;
|
20 | }
|
21 |
|
22 | var O = 'object';
|
23 | var check = function (it) {
|
24 | return it && it.Math == Math && it;
|
25 | };
|
26 |
|
27 |
|
28 | var global_1 =
|
29 |
|
30 | check(typeof globalThis == O && globalThis) ||
|
31 | check(typeof window == O && window) ||
|
32 | check(typeof self == O && self) ||
|
33 | check(typeof commonjsGlobal == O && commonjsGlobal) ||
|
34 |
|
35 | Function('return this')();
|
36 |
|
37 | var fails = function (exec) {
|
38 | try {
|
39 | return !!exec();
|
40 | } catch (error) {
|
41 | return true;
|
42 | }
|
43 | };
|
44 |
|
45 |
|
46 | var descriptors = !fails(function () {
|
47 | return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
|
48 | });
|
49 |
|
50 | var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
|
51 | var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
52 |
|
53 |
|
54 | var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
|
55 |
|
56 |
|
57 |
|
58 | var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
59 | var descriptor = getOwnPropertyDescriptor(this, V);
|
60 | return !!descriptor && descriptor.enumerable;
|
61 | } : nativePropertyIsEnumerable;
|
62 |
|
63 | var objectPropertyIsEnumerable = {
|
64 | f: f
|
65 | };
|
66 |
|
67 | var createPropertyDescriptor = function (bitmap, value) {
|
68 | return {
|
69 | enumerable: !(bitmap & 1),
|
70 | configurable: !(bitmap & 2),
|
71 | writable: !(bitmap & 4),
|
72 | value: value
|
73 | };
|
74 | };
|
75 |
|
76 | var toString = {}.toString;
|
77 |
|
78 | var classofRaw = function (it) {
|
79 | return toString.call(it).slice(8, -1);
|
80 | };
|
81 |
|
82 | var split = ''.split;
|
83 |
|
84 |
|
85 | var indexedObject = fails(function () {
|
86 |
|
87 |
|
88 | return !Object('z').propertyIsEnumerable(0);
|
89 | }) ? function (it) {
|
90 | return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
|
91 | } : Object;
|
92 |
|
93 |
|
94 |
|
95 | var requireObjectCoercible = function (it) {
|
96 | if (it == undefined) throw TypeError("Can't call method on " + it);
|
97 | return it;
|
98 | };
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 | var toIndexedObject = function (it) {
|
105 | return indexedObject(requireObjectCoercible(it));
|
106 | };
|
107 |
|
108 | var isObject = function (it) {
|
109 | return typeof it === 'object' ? it !== null : typeof it === 'function';
|
110 | };
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 | var toPrimitive = function (input, PREFERRED_STRING) {
|
117 | if (!isObject(input)) return input;
|
118 | var fn, val;
|
119 | if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
120 | if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
|
121 | if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
122 | throw TypeError("Can't convert object to primitive value");
|
123 | };
|
124 |
|
125 | var hasOwnProperty = {}.hasOwnProperty;
|
126 |
|
127 | var has = function (it, key) {
|
128 | return hasOwnProperty.call(it, key);
|
129 | };
|
130 |
|
131 | var document$1 = global_1.document;
|
132 |
|
133 | var EXISTS = isObject(document$1) && isObject(document$1.createElement);
|
134 |
|
135 | var documentCreateElement = function (it) {
|
136 | return EXISTS ? document$1.createElement(it) : {};
|
137 | };
|
138 |
|
139 |
|
140 | var ie8DomDefine = !descriptors && !fails(function () {
|
141 | return Object.defineProperty(documentCreateElement('div'), 'a', {
|
142 | get: function () { return 7; }
|
143 | }).a != 7;
|
144 | });
|
145 |
|
146 | var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
147 |
|
148 |
|
149 |
|
150 | var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
151 | O = toIndexedObject(O);
|
152 | P = toPrimitive(P, true);
|
153 | if (ie8DomDefine) try {
|
154 | return nativeGetOwnPropertyDescriptor(O, P);
|
155 | } catch (error) { }
|
156 | if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
|
157 | };
|
158 |
|
159 | var objectGetOwnPropertyDescriptor = {
|
160 | f: f$1
|
161 | };
|
162 |
|
163 | var anObject = function (it) {
|
164 | if (!isObject(it)) {
|
165 | throw TypeError(String(it) + ' is not an object');
|
166 | } return it;
|
167 | };
|
168 |
|
169 | var nativeDefineProperty = Object.defineProperty;
|
170 |
|
171 |
|
172 |
|
173 | var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
|
174 | anObject(O);
|
175 | P = toPrimitive(P, true);
|
176 | anObject(Attributes);
|
177 | if (ie8DomDefine) try {
|
178 | return nativeDefineProperty(O, P, Attributes);
|
179 | } catch (error) { }
|
180 | if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
181 | if ('value' in Attributes) O[P] = Attributes.value;
|
182 | return O;
|
183 | };
|
184 |
|
185 | var objectDefineProperty = {
|
186 | f: f$2
|
187 | };
|
188 |
|
189 | var hide = descriptors ? function (object, key, value) {
|
190 | return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
|
191 | } : function (object, key, value) {
|
192 | object[key] = value;
|
193 | return object;
|
194 | };
|
195 |
|
196 | var setGlobal = function (key, value) {
|
197 | try {
|
198 | hide(global_1, key, value);
|
199 | } catch (error) {
|
200 | global_1[key] = value;
|
201 | } return value;
|
202 | };
|
203 |
|
204 | var shared = createCommonjsModule(function (module) {
|
205 | var SHARED = '__core-js_shared__';
|
206 | var store = global_1[SHARED] || setGlobal(SHARED, {});
|
207 |
|
208 | (module.exports = function (key, value) {
|
209 | return store[key] || (store[key] = value !== undefined ? value : {});
|
210 | })('versions', []).push({
|
211 | version: '3.2.1',
|
212 | mode: 'global',
|
213 | copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
|
214 | });
|
215 | });
|
216 |
|
217 | var functionToString = shared('native-function-to-string', Function.toString);
|
218 |
|
219 | var WeakMap$1 = global_1.WeakMap;
|
220 |
|
221 | var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(functionToString.call(WeakMap$1));
|
222 |
|
223 | var id = 0;
|
224 | var postfix = Math.random();
|
225 |
|
226 | var uid = function (key) {
|
227 | return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
|
228 | };
|
229 |
|
230 | var keys = shared('keys');
|
231 |
|
232 | var sharedKey = function (key) {
|
233 | return keys[key] || (keys[key] = uid(key));
|
234 | };
|
235 |
|
236 | var hiddenKeys = {};
|
237 |
|
238 | var WeakMap$2 = global_1.WeakMap;
|
239 | var set, get, has$1;
|
240 |
|
241 | var enforce = function (it) {
|
242 | return has$1(it) ? get(it) : set(it, {});
|
243 | };
|
244 |
|
245 | var getterFor = function (TYPE) {
|
246 | return function (it) {
|
247 | var state;
|
248 | if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
249 | throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
250 | } return state;
|
251 | };
|
252 | };
|
253 |
|
254 | if (nativeWeakMap) {
|
255 | var store = new WeakMap$2();
|
256 | var wmget = store.get;
|
257 | var wmhas = store.has;
|
258 | var wmset = store.set;
|
259 | set = function (it, metadata) {
|
260 | wmset.call(store, it, metadata);
|
261 | return metadata;
|
262 | };
|
263 | get = function (it) {
|
264 | return wmget.call(store, it) || {};
|
265 | };
|
266 | has$1 = function (it) {
|
267 | return wmhas.call(store, it);
|
268 | };
|
269 | } else {
|
270 | var STATE = sharedKey('state');
|
271 | hiddenKeys[STATE] = true;
|
272 | set = function (it, metadata) {
|
273 | hide(it, STATE, metadata);
|
274 | return metadata;
|
275 | };
|
276 | get = function (it) {
|
277 | return has(it, STATE) ? it[STATE] : {};
|
278 | };
|
279 | has$1 = function (it) {
|
280 | return has(it, STATE);
|
281 | };
|
282 | }
|
283 |
|
284 | var internalState = {
|
285 | set: set,
|
286 | get: get,
|
287 | has: has$1,
|
288 | enforce: enforce,
|
289 | getterFor: getterFor
|
290 | };
|
291 |
|
292 | var redefine = createCommonjsModule(function (module) {
|
293 | var getInternalState = internalState.get;
|
294 | var enforceInternalState = internalState.enforce;
|
295 | var TEMPLATE = String(functionToString).split('toString');
|
296 |
|
297 | shared('inspectSource', function (it) {
|
298 | return functionToString.call(it);
|
299 | });
|
300 |
|
301 | (module.exports = function (O, key, value, options) {
|
302 | var unsafe = options ? !!options.unsafe : false;
|
303 | var simple = options ? !!options.enumerable : false;
|
304 | var noTargetGet = options ? !!options.noTargetGet : false;
|
305 | if (typeof value == 'function') {
|
306 | if (typeof key == 'string' && !has(value, 'name')) hide(value, 'name', key);
|
307 | enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
|
308 | }
|
309 | if (O === global_1) {
|
310 | if (simple) O[key] = value;
|
311 | else setGlobal(key, value);
|
312 | return;
|
313 | } else if (!unsafe) {
|
314 | delete O[key];
|
315 | } else if (!noTargetGet && O[key]) {
|
316 | simple = true;
|
317 | }
|
318 | if (simple) O[key] = value;
|
319 | else hide(O, key, value);
|
320 |
|
321 | })(Function.prototype, 'toString', function toString() {
|
322 | return typeof this == 'function' && getInternalState(this).source || functionToString.call(this);
|
323 | });
|
324 | });
|
325 |
|
326 | var path = global_1;
|
327 |
|
328 | var aFunction = function (variable) {
|
329 | return typeof variable == 'function' ? variable : undefined;
|
330 | };
|
331 |
|
332 | var getBuiltIn = function (namespace, method) {
|
333 | return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
|
334 | : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
|
335 | };
|
336 |
|
337 | var ceil = Math.ceil;
|
338 | var floor = Math.floor;
|
339 |
|
340 |
|
341 |
|
342 | var toInteger = function (argument) {
|
343 | return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
|
344 | };
|
345 |
|
346 | var min = Math.min;
|
347 |
|
348 |
|
349 |
|
350 | var toLength = function (argument) {
|
351 | return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0;
|
352 | };
|
353 |
|
354 | var max = Math.max;
|
355 | var min$1 = Math.min;
|
356 |
|
357 |
|
358 |
|
359 |
|
360 | var toAbsoluteIndex = function (index, length) {
|
361 | var integer = toInteger(index);
|
362 | return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
|
363 | };
|
364 |
|
365 |
|
366 | var createMethod = function (IS_INCLUDES) {
|
367 | return function ($this, el, fromIndex) {
|
368 | var O = toIndexedObject($this);
|
369 | var length = toLength(O.length);
|
370 | var index = toAbsoluteIndex(fromIndex, length);
|
371 | var value;
|
372 |
|
373 |
|
374 | if (IS_INCLUDES && el != el) while (length > index) {
|
375 | value = O[index++];
|
376 |
|
377 | if (value != value) return true;
|
378 |
|
379 | } else for (;length > index; index++) {
|
380 | if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
381 | } return !IS_INCLUDES && -1;
|
382 | };
|
383 | };
|
384 |
|
385 | var arrayIncludes = {
|
386 |
|
387 |
|
388 | includes: createMethod(true),
|
389 |
|
390 |
|
391 | indexOf: createMethod(false)
|
392 | };
|
393 |
|
394 | var indexOf = arrayIncludes.indexOf;
|
395 |
|
396 |
|
397 | var objectKeysInternal = function (object, names) {
|
398 | var O = toIndexedObject(object);
|
399 | var i = 0;
|
400 | var result = [];
|
401 | var key;
|
402 | for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
|
403 |
|
404 | while (names.length > i) if (has(O, key = names[i++])) {
|
405 | ~indexOf(result, key) || result.push(key);
|
406 | }
|
407 | return result;
|
408 | };
|
409 |
|
410 |
|
411 | var enumBugKeys = [
|
412 | 'constructor',
|
413 | 'hasOwnProperty',
|
414 | 'isPrototypeOf',
|
415 | 'propertyIsEnumerable',
|
416 | 'toLocaleString',
|
417 | 'toString',
|
418 | 'valueOf'
|
419 | ];
|
420 |
|
421 | var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
|
422 |
|
423 |
|
424 |
|
425 | var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
426 | return objectKeysInternal(O, hiddenKeys$1);
|
427 | };
|
428 |
|
429 | var objectGetOwnPropertyNames = {
|
430 | f: f$3
|
431 | };
|
432 |
|
433 | var f$4 = Object.getOwnPropertySymbols;
|
434 |
|
435 | var objectGetOwnPropertySymbols = {
|
436 | f: f$4
|
437 | };
|
438 |
|
439 |
|
440 | var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
441 | var keys = objectGetOwnPropertyNames.f(anObject(it));
|
442 | var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
443 | return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
|
444 | };
|
445 |
|
446 | var copyConstructorProperties = function (target, source) {
|
447 | var keys = ownKeys(source);
|
448 | var defineProperty = objectDefineProperty.f;
|
449 | var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
450 | for (var i = 0; i < keys.length; i++) {
|
451 | var key = keys[i];
|
452 | if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
453 | }
|
454 | };
|
455 |
|
456 | var replacement = /#|\.prototype\./;
|
457 |
|
458 | var isForced = function (feature, detection) {
|
459 | var value = data[normalize(feature)];
|
460 | return value == POLYFILL ? true
|
461 | : value == NATIVE ? false
|
462 | : typeof detection == 'function' ? fails(detection)
|
463 | : !!detection;
|
464 | };
|
465 |
|
466 | var normalize = isForced.normalize = function (string) {
|
467 | return String(string).replace(replacement, '.').toLowerCase();
|
468 | };
|
469 |
|
470 | var data = isForced.data = {};
|
471 | var NATIVE = isForced.NATIVE = 'N';
|
472 | var POLYFILL = isForced.POLYFILL = 'P';
|
473 |
|
474 | var isForced_1 = isForced;
|
475 |
|
476 | var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
477 |
|
478 |
|
479 |
|
480 |
|
481 |
|
482 |
|
483 | |
484 |
|
485 |
|
486 |
|
487 |
|
488 |
|
489 |
|
490 |
|
491 |
|
492 |
|
493 |
|
494 |
|
495 |
|
496 |
|
497 | var _export = function (options, source) {
|
498 | var TARGET = options.target;
|
499 | var GLOBAL = options.global;
|
500 | var STATIC = options.stat;
|
501 | var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
502 | if (GLOBAL) {
|
503 | target = global_1;
|
504 | } else if (STATIC) {
|
505 | target = global_1[TARGET] || setGlobal(TARGET, {});
|
506 | } else {
|
507 | target = (global_1[TARGET] || {}).prototype;
|
508 | }
|
509 | if (target) for (key in source) {
|
510 | sourceProperty = source[key];
|
511 | if (options.noTargetGet) {
|
512 | descriptor = getOwnPropertyDescriptor$1(target, key);
|
513 | targetProperty = descriptor && descriptor.value;
|
514 | } else targetProperty = target[key];
|
515 | FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
516 |
|
517 | if (!FORCED && targetProperty !== undefined) {
|
518 | if (typeof sourceProperty === typeof targetProperty) continue;
|
519 | copyConstructorProperties(sourceProperty, targetProperty);
|
520 | }
|
521 |
|
522 | if (options.sham || (targetProperty && targetProperty.sham)) {
|
523 | hide(sourceProperty, 'sham', true);
|
524 | }
|
525 |
|
526 | redefine(target, key, sourceProperty, options);
|
527 | }
|
528 | };
|
529 |
|
530 | var aFunction$1 = function (it) {
|
531 | if (typeof it != 'function') {
|
532 | throw TypeError(String(it) + ' is not a function');
|
533 | } return it;
|
534 | };
|
535 |
|
536 |
|
537 | var bindContext = function (fn, that, length) {
|
538 | aFunction$1(fn);
|
539 | if (that === undefined) return fn;
|
540 | switch (length) {
|
541 | case 0: return function () {
|
542 | return fn.call(that);
|
543 | };
|
544 | case 1: return function (a) {
|
545 | return fn.call(that, a);
|
546 | };
|
547 | case 2: return function (a, b) {
|
548 | return fn.call(that, a, b);
|
549 | };
|
550 | case 3: return function (a, b, c) {
|
551 | return fn.call(that, a, b, c);
|
552 | };
|
553 | }
|
554 | return function (/* ...args */) {
|
555 | return fn.apply(that, arguments);
|
556 | };
|
557 | };
|
558 |
|
559 |
|
560 |
|
561 | var toObject = function (argument) {
|
562 | return Object(requireObjectCoercible(argument));
|
563 | };
|
564 |
|
565 |
|
566 |
|
567 | var isArray = Array.isArray || function isArray(arg) {
|
568 | return classofRaw(arg) == 'Array';
|
569 | };
|
570 |
|
571 | var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
572 |
|
573 |
|
574 | return !String(Symbol());
|
575 | });
|
576 |
|
577 | var Symbol$1 = global_1.Symbol;
|
578 | var store$1 = shared('wks');
|
579 |
|
580 | var wellKnownSymbol = function (name) {
|
581 | return store$1[name] || (store$1[name] = nativeSymbol && Symbol$1[name]
|
582 | || (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name));
|
583 | };
|
584 |
|
585 | var SPECIES = wellKnownSymbol('species');
|
586 |
|
587 |
|
588 |
|
589 | var arraySpeciesCreate = function (originalArray, length) {
|
590 | var C;
|
591 | if (isArray(originalArray)) {
|
592 | C = originalArray.constructor;
|
593 |
|
594 | if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
|
595 | else if (isObject(C)) {
|
596 | C = C[SPECIES];
|
597 | if (C === null) C = undefined;
|
598 | }
|
599 | } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
|
600 | };
|
601 |
|
602 | var push = [].push;
|
603 |
|
604 |
|
605 | var createMethod$1 = function (TYPE) {
|
606 | var IS_MAP = TYPE == 1;
|
607 | var IS_FILTER = TYPE == 2;
|
608 | var IS_SOME = TYPE == 3;
|
609 | var IS_EVERY = TYPE == 4;
|
610 | var IS_FIND_INDEX = TYPE == 6;
|
611 | var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
612 | return function ($this, callbackfn, that, specificCreate) {
|
613 | var O = toObject($this);
|
614 | var self = indexedObject(O);
|
615 | var boundFunction = bindContext(callbackfn, that, 3);
|
616 | var length = toLength(self.length);
|
617 | var index = 0;
|
618 | var create = specificCreate || arraySpeciesCreate;
|
619 | var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
|
620 | var value, result;
|
621 | for (;length > index; index++) if (NO_HOLES || index in self) {
|
622 | value = self[index];
|
623 | result = boundFunction(value, index, O);
|
624 | if (TYPE) {
|
625 | if (IS_MAP) target[index] = result;
|
626 | else if (result) switch (TYPE) {
|
627 | case 3: return true;
|
628 | case 5: return value;
|
629 | case 6: return index;
|
630 | case 2: push.call(target, value);
|
631 | } else if (IS_EVERY) return false;
|
632 | }
|
633 | }
|
634 | return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
635 | };
|
636 | };
|
637 |
|
638 | var arrayIteration = {
|
639 |
|
640 |
|
641 | forEach: createMethod$1(0),
|
642 |
|
643 |
|
644 | map: createMethod$1(1),
|
645 |
|
646 |
|
647 | filter: createMethod$1(2),
|
648 |
|
649 |
|
650 | some: createMethod$1(3),
|
651 |
|
652 |
|
653 | every: createMethod$1(4),
|
654 |
|
655 |
|
656 | find: createMethod$1(5),
|
657 |
|
658 |
|
659 | findIndex: createMethod$1(6)
|
660 | };
|
661 |
|
662 | var sloppyArrayMethod = function (METHOD_NAME, argument) {
|
663 | var method = [][METHOD_NAME];
|
664 | return !method || !fails(function () {
|
665 |
|
666 | method.call(null, argument || function () { throw 1; }, 1);
|
667 | });
|
668 | };
|
669 |
|
670 | var $forEach = arrayIteration.forEach;
|
671 |
|
672 |
|
673 |
|
674 |
|
675 | var arrayForEach = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) {
|
676 | return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
677 | } : [].forEach;
|
678 |
|
679 |
|
680 |
|
681 | _export({ target: 'Array', proto: true, forced: [].forEach != arrayForEach }, {
|
682 | forEach: arrayForEach
|
683 | });
|
684 |
|
685 |
|
686 |
|
687 | var domIterables = {
|
688 | CSSRuleList: 0,
|
689 | CSSStyleDeclaration: 0,
|
690 | CSSValueList: 0,
|
691 | ClientRectList: 0,
|
692 | DOMRectList: 0,
|
693 | DOMStringList: 0,
|
694 | DOMTokenList: 1,
|
695 | DataTransferItemList: 0,
|
696 | FileList: 0,
|
697 | HTMLAllCollection: 0,
|
698 | HTMLCollection: 0,
|
699 | HTMLFormElement: 0,
|
700 | HTMLSelectElement: 0,
|
701 | MediaList: 0,
|
702 | MimeTypeArray: 0,
|
703 | NamedNodeMap: 0,
|
704 | NodeList: 1,
|
705 | PaintRequestList: 0,
|
706 | Plugin: 0,
|
707 | PluginArray: 0,
|
708 | SVGLengthList: 0,
|
709 | SVGNumberList: 0,
|
710 | SVGPathSegList: 0,
|
711 | SVGPointList: 0,
|
712 | SVGStringList: 0,
|
713 | SVGTransformList: 0,
|
714 | SourceBufferList: 0,
|
715 | StyleSheetList: 0,
|
716 | TextTrackCueList: 0,
|
717 | TextTrackList: 0,
|
718 | TouchList: 0
|
719 | };
|
720 |
|
721 | for (var COLLECTION_NAME in domIterables) {
|
722 | var Collection = global_1[COLLECTION_NAME];
|
723 | var CollectionPrototype = Collection && Collection.prototype;
|
724 |
|
725 | if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
|
726 | hide(CollectionPrototype, 'forEach', arrayForEach);
|
727 | } catch (error) {
|
728 | CollectionPrototype.forEach = arrayForEach;
|
729 | }
|
730 | }
|
731 |
|
732 | var canUseDOM = !!(
|
733 | typeof window !== 'undefined' &&
|
734 | window.document &&
|
735 | window.document.createElement
|
736 | );
|
737 |
|
738 | var canUseDom = canUseDOM;
|
739 |
|
740 | var SPECIES$1 = wellKnownSymbol('species');
|
741 |
|
742 | var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
|
743 | return !fails(function () {
|
744 | var array = [];
|
745 | var constructor = array.constructor = {};
|
746 | constructor[SPECIES$1] = function () {
|
747 | return { foo: 1 };
|
748 | };
|
749 | return array[METHOD_NAME](Boolean).foo !== 1;
|
750 | });
|
751 | };
|
752 |
|
753 | var $filter = arrayIteration.filter;
|
754 |
|
755 |
|
756 |
|
757 |
|
758 |
|
759 | _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('filter') }, {
|
760 | filter: function filter(callbackfn /* , thisArg */) {
|
761 | return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
762 | }
|
763 | });
|
764 |
|
765 |
|
766 |
|
767 | var objectKeys = Object.keys || function keys(O) {
|
768 | return objectKeysInternal(O, enumBugKeys);
|
769 | };
|
770 |
|
771 |
|
772 |
|
773 | var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
|
774 | anObject(O);
|
775 | var keys = objectKeys(Properties);
|
776 | var length = keys.length;
|
777 | var index = 0;
|
778 | var key;
|
779 | while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
|
780 | return O;
|
781 | };
|
782 |
|
783 | var html = getBuiltIn('document', 'documentElement');
|
784 |
|
785 | var IE_PROTO = sharedKey('IE_PROTO');
|
786 |
|
787 | var PROTOTYPE = 'prototype';
|
788 | var Empty = function () { };
|
789 |
|
790 |
|
791 | var createDict = function () {
|
792 |
|
793 | var iframe = documentCreateElement('iframe');
|
794 | var length = enumBugKeys.length;
|
795 | var lt = '<';
|
796 | var script = 'script';
|
797 | var gt = '>';
|
798 | var js = 'java' + script + ':';
|
799 | var iframeDocument;
|
800 | iframe.style.display = 'none';
|
801 | html.appendChild(iframe);
|
802 | iframe.src = String(js);
|
803 | iframeDocument = iframe.contentWindow.document;
|
804 | iframeDocument.open();
|
805 | iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt);
|
806 | iframeDocument.close();
|
807 | createDict = iframeDocument.F;
|
808 | while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]];
|
809 | return createDict();
|
810 | };
|
811 |
|
812 |
|
813 |
|
814 | var objectCreate = Object.create || function create(O, Properties) {
|
815 | var result;
|
816 | if (O !== null) {
|
817 | Empty[PROTOTYPE] = anObject(O);
|
818 | result = new Empty();
|
819 | Empty[PROTOTYPE] = null;
|
820 |
|
821 | result[IE_PROTO] = O;
|
822 | } else result = createDict();
|
823 | return Properties === undefined ? result : objectDefineProperties(result, Properties);
|
824 | };
|
825 |
|
826 | hiddenKeys[IE_PROTO] = true;
|
827 |
|
828 | var UNSCOPABLES = wellKnownSymbol('unscopables');
|
829 | var ArrayPrototype = Array.prototype;
|
830 |
|
831 |
|
832 |
|
833 | if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
834 | hide(ArrayPrototype, UNSCOPABLES, objectCreate(null));
|
835 | }
|
836 |
|
837 |
|
838 | var addToUnscopables = function (key) {
|
839 | ArrayPrototype[UNSCOPABLES][key] = true;
|
840 | };
|
841 |
|
842 | var iterators = {};
|
843 |
|
844 | var correctPrototypeGetter = !fails(function () {
|
845 | function F() { }
|
846 | F.prototype.constructor = null;
|
847 | return Object.getPrototypeOf(new F()) !== F.prototype;
|
848 | });
|
849 |
|
850 | var IE_PROTO$1 = sharedKey('IE_PROTO');
|
851 | var ObjectPrototype = Object.prototype;
|
852 |
|
853 |
|
854 |
|
855 | var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) {
|
856 | O = toObject(O);
|
857 | if (has(O, IE_PROTO$1)) return O[IE_PROTO$1];
|
858 | if (typeof O.constructor == 'function' && O instanceof O.constructor) {
|
859 | return O.constructor.prototype;
|
860 | } return O instanceof Object ? ObjectPrototype : null;
|
861 | };
|
862 |
|
863 | var ITERATOR = wellKnownSymbol('iterator');
|
864 | var BUGGY_SAFARI_ITERATORS = false;
|
865 |
|
866 | var returnThis = function () { return this; };
|
867 |
|
868 |
|
869 |
|
870 | var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
871 |
|
872 | if ([].keys) {
|
873 | arrayIterator = [].keys();
|
874 |
|
875 | if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
|
876 | else {
|
877 | PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
|
878 | if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
|
879 | }
|
880 | }
|
881 |
|
882 | if (IteratorPrototype == undefined) IteratorPrototype = {};
|
883 |
|
884 |
|
885 | if ( !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);
|
886 |
|
887 | var iteratorsCore = {
|
888 | IteratorPrototype: IteratorPrototype,
|
889 | BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
|
890 | };
|
891 |
|
892 | var defineProperty = objectDefineProperty.f;
|
893 |
|
894 |
|
895 |
|
896 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
897 |
|
898 | var setToStringTag = function (it, TAG, STATIC) {
|
899 | if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
|
900 | defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
|
901 | }
|
902 | };
|
903 |
|
904 | var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
|
905 |
|
906 |
|
907 |
|
908 |
|
909 |
|
910 | var returnThis$1 = function () { return this; };
|
911 |
|
912 | var createIteratorConstructor = function (IteratorConstructor, NAME, next) {
|
913 | var TO_STRING_TAG = NAME + ' Iterator';
|
914 | IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(1, next) });
|
915 | setToStringTag(IteratorConstructor, TO_STRING_TAG, false);
|
916 | iterators[TO_STRING_TAG] = returnThis$1;
|
917 | return IteratorConstructor;
|
918 | };
|
919 |
|
920 | var aPossiblePrototype = function (it) {
|
921 | if (!isObject(it) && it !== null) {
|
922 | throw TypeError("Can't set " + String(it) + ' as a prototype');
|
923 | } return it;
|
924 | };
|
925 |
|
926 |
|
927 |
|
928 |
|
929 |
|
930 | var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
931 | var CORRECT_SETTER = false;
|
932 | var test = {};
|
933 | var setter;
|
934 | try {
|
935 | setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
|
936 | setter.call(test, []);
|
937 | CORRECT_SETTER = test instanceof Array;
|
938 | } catch (error) { }
|
939 | return function setPrototypeOf(O, proto) {
|
940 | anObject(O);
|
941 | aPossiblePrototype(proto);
|
942 | if (CORRECT_SETTER) setter.call(O, proto);
|
943 | else O.__proto__ = proto;
|
944 | return O;
|
945 | };
|
946 | }() : undefined);
|
947 |
|
948 | var IteratorPrototype$2 = iteratorsCore.IteratorPrototype;
|
949 | var BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS;
|
950 | var ITERATOR$1 = wellKnownSymbol('iterator');
|
951 | var KEYS = 'keys';
|
952 | var VALUES = 'values';
|
953 | var ENTRIES = 'entries';
|
954 |
|
955 | var returnThis$2 = function () { return this; };
|
956 |
|
957 | var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
958 | createIteratorConstructor(IteratorConstructor, NAME, next);
|
959 |
|
960 | var getIterationMethod = function (KIND) {
|
961 | if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
962 | if (!BUGGY_SAFARI_ITERATORS$1 && KIND in IterablePrototype) return IterablePrototype[KIND];
|
963 | switch (KIND) {
|
964 | case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
965 | case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
966 | case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
967 | } return function () { return new IteratorConstructor(this); };
|
968 | };
|
969 |
|
970 | var TO_STRING_TAG = NAME + ' Iterator';
|
971 | var INCORRECT_VALUES_NAME = false;
|
972 | var IterablePrototype = Iterable.prototype;
|
973 | var nativeIterator = IterablePrototype[ITERATOR$1]
|
974 | || IterablePrototype['@@iterator']
|
975 | || DEFAULT && IterablePrototype[DEFAULT];
|
976 | var defaultIterator = !BUGGY_SAFARI_ITERATORS$1 && nativeIterator || getIterationMethod(DEFAULT);
|
977 | var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
978 | var CurrentIteratorPrototype, methods, KEY;
|
979 |
|
980 |
|
981 | if (anyNativeIterator) {
|
982 | CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable()));
|
983 | if (IteratorPrototype$2 !== Object.prototype && CurrentIteratorPrototype.next) {
|
984 | if ( objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype$2) {
|
985 | if (objectSetPrototypeOf) {
|
986 | objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$2);
|
987 | } else if (typeof CurrentIteratorPrototype[ITERATOR$1] != 'function') {
|
988 | hide(CurrentIteratorPrototype, ITERATOR$1, returnThis$2);
|
989 | }
|
990 | }
|
991 |
|
992 | setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
|
993 | }
|
994 | }
|
995 |
|
996 |
|
997 | if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
998 | INCORRECT_VALUES_NAME = true;
|
999 | defaultIterator = function values() { return nativeIterator.call(this); };
|
1000 | }
|
1001 |
|
1002 |
|
1003 | if ( IterablePrototype[ITERATOR$1] !== defaultIterator) {
|
1004 | hide(IterablePrototype, ITERATOR$1, defaultIterator);
|
1005 | }
|
1006 | iterators[NAME] = defaultIterator;
|
1007 |
|
1008 |
|
1009 | if (DEFAULT) {
|
1010 | methods = {
|
1011 | values: getIterationMethod(VALUES),
|
1012 | keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
1013 | entries: getIterationMethod(ENTRIES)
|
1014 | };
|
1015 | if (FORCED) for (KEY in methods) {
|
1016 | if (BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
1017 | redefine(IterablePrototype, KEY, methods[KEY]);
|
1018 | }
|
1019 | } else _export({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME }, methods);
|
1020 | }
|
1021 |
|
1022 | return methods;
|
1023 | };
|
1024 |
|
1025 | var ARRAY_ITERATOR = 'Array Iterator';
|
1026 | var setInternalState = internalState.set;
|
1027 | var getInternalState = internalState.getterFor(ARRAY_ITERATOR);
|
1028 |
|
1029 |
|
1030 |
|
1031 |
|
1032 |
|
1033 |
|
1034 |
|
1035 |
|
1036 |
|
1037 |
|
1038 |
|
1039 | var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
|
1040 | setInternalState(this, {
|
1041 | type: ARRAY_ITERATOR,
|
1042 | target: toIndexedObject(iterated),
|
1043 | index: 0,
|
1044 | kind: kind
|
1045 | });
|
1046 |
|
1047 |
|
1048 | }, function () {
|
1049 | var state = getInternalState(this);
|
1050 | var target = state.target;
|
1051 | var kind = state.kind;
|
1052 | var index = state.index++;
|
1053 | if (!target || index >= target.length) {
|
1054 | state.target = undefined;
|
1055 | return { value: undefined, done: true };
|
1056 | }
|
1057 | if (kind == 'keys') return { value: index, done: false };
|
1058 | if (kind == 'values') return { value: target[index], done: false };
|
1059 | return { value: [index, target[index]], done: false };
|
1060 | }, 'values');
|
1061 |
|
1062 |
|
1063 |
|
1064 |
|
1065 | iterators.Arguments = iterators.Array;
|
1066 |
|
1067 |
|
1068 | addToUnscopables('keys');
|
1069 | addToUnscopables('values');
|
1070 | addToUnscopables('entries');
|
1071 |
|
1072 | var nativeAssign = Object.assign;
|
1073 |
|
1074 |
|
1075 |
|
1076 |
|
1077 | var objectAssign = !nativeAssign || fails(function () {
|
1078 | var A = {};
|
1079 | var B = {};
|
1080 |
|
1081 | var symbol = Symbol();
|
1082 | var alphabet = 'abcdefghijklmnopqrst';
|
1083 | A[symbol] = 7;
|
1084 | alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
1085 | return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
|
1086 | }) ? function assign(target, source) {
|
1087 | var T = toObject(target);
|
1088 | var argumentsLength = arguments.length;
|
1089 | var index = 1;
|
1090 | var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
|
1091 | var propertyIsEnumerable = objectPropertyIsEnumerable.f;
|
1092 | while (argumentsLength > index) {
|
1093 | var S = indexedObject(arguments[index++]);
|
1094 | var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
|
1095 | var length = keys.length;
|
1096 | var j = 0;
|
1097 | var key;
|
1098 | while (length > j) {
|
1099 | key = keys[j++];
|
1100 | if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];
|
1101 | }
|
1102 | } return T;
|
1103 | } : nativeAssign;
|
1104 |
|
1105 |
|
1106 |
|
1107 | _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
|
1108 | assign: objectAssign
|
1109 | });
|
1110 |
|
1111 | var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
|
1112 |
|
1113 | var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
1114 |
|
1115 |
|
1116 | var tryGet = function (it, key) {
|
1117 | try {
|
1118 | return it[key];
|
1119 | } catch (error) { }
|
1120 | };
|
1121 |
|
1122 |
|
1123 | var classof = function (it) {
|
1124 | var O, tag, result;
|
1125 | return it === undefined ? 'Undefined' : it === null ? 'Null'
|
1126 |
|
1127 | : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$1)) == 'string' ? tag
|
1128 |
|
1129 | : CORRECT_ARGUMENTS ? classofRaw(O)
|
1130 |
|
1131 | : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
|
1132 | };
|
1133 |
|
1134 | var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
|
1135 | var test = {};
|
1136 |
|
1137 | test[TO_STRING_TAG$2] = 'z';
|
1138 |
|
1139 |
|
1140 |
|
1141 | var objectToString = String(test) !== '[object z]' ? function toString() {
|
1142 | return '[object ' + classof(this) + ']';
|
1143 | } : test.toString;
|
1144 |
|
1145 | var ObjectPrototype$1 = Object.prototype;
|
1146 |
|
1147 |
|
1148 |
|
1149 | if (objectToString !== ObjectPrototype$1.toString) {
|
1150 | redefine(ObjectPrototype$1, 'toString', objectToString, { unsafe: true });
|
1151 | }
|
1152 |
|
1153 |
|
1154 |
|
1155 | var whitespaces = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
1156 |
|
1157 | var whitespace = '[' + whitespaces + ']';
|
1158 | var ltrim = RegExp('^' + whitespace + whitespace + '*');
|
1159 | var rtrim = RegExp(whitespace + whitespace + '*$');
|
1160 |
|
1161 |
|
1162 | var createMethod$2 = function (TYPE) {
|
1163 | return function ($this) {
|
1164 | var string = String(requireObjectCoercible($this));
|
1165 | if (TYPE & 1) string = string.replace(ltrim, '');
|
1166 | if (TYPE & 2) string = string.replace(rtrim, '');
|
1167 | return string;
|
1168 | };
|
1169 | };
|
1170 |
|
1171 | var stringTrim = {
|
1172 |
|
1173 |
|
1174 | start: createMethod$2(1),
|
1175 |
|
1176 |
|
1177 | end: createMethod$2(2),
|
1178 |
|
1179 |
|
1180 | trim: createMethod$2(3)
|
1181 | };
|
1182 |
|
1183 | var trim = stringTrim.trim;
|
1184 |
|
1185 |
|
1186 | var nativeParseInt = global_1.parseInt;
|
1187 | var hex = /^[+-]?0[Xx]/;
|
1188 | var FORCED = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22;
|
1189 |
|
1190 |
|
1191 |
|
1192 | var _parseInt = FORCED ? function parseInt(string, radix) {
|
1193 | var S = trim(String(string));
|
1194 | return nativeParseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
|
1195 | } : nativeParseInt;
|
1196 |
|
1197 |
|
1198 |
|
1199 | _export({ global: true, forced: parseInt != _parseInt }, {
|
1200 | parseInt: _parseInt
|
1201 | });
|
1202 |
|
1203 |
|
1204 | var createMethod$3 = function (CONVERT_TO_STRING) {
|
1205 | return function ($this, pos) {
|
1206 | var S = String(requireObjectCoercible($this));
|
1207 | var position = toInteger(pos);
|
1208 | var size = S.length;
|
1209 | var first, second;
|
1210 | if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
1211 | first = S.charCodeAt(position);
|
1212 | return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
1213 | || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
|
1214 | ? CONVERT_TO_STRING ? S.charAt(position) : first
|
1215 | : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
1216 | };
|
1217 | };
|
1218 |
|
1219 | var stringMultibyte = {
|
1220 |
|
1221 |
|
1222 | codeAt: createMethod$3(false),
|
1223 |
|
1224 |
|
1225 | charAt: createMethod$3(true)
|
1226 | };
|
1227 |
|
1228 | var charAt = stringMultibyte.charAt;
|
1229 |
|
1230 |
|
1231 |
|
1232 | var STRING_ITERATOR = 'String Iterator';
|
1233 | var setInternalState$1 = internalState.set;
|
1234 | var getInternalState$1 = internalState.getterFor(STRING_ITERATOR);
|
1235 |
|
1236 |
|
1237 |
|
1238 | defineIterator(String, 'String', function (iterated) {
|
1239 | setInternalState$1(this, {
|
1240 | type: STRING_ITERATOR,
|
1241 | string: String(iterated),
|
1242 | index: 0
|
1243 | });
|
1244 |
|
1245 |
|
1246 | }, function next() {
|
1247 | var state = getInternalState$1(this);
|
1248 | var string = state.string;
|
1249 | var index = state.index;
|
1250 | var point;
|
1251 | if (index >= string.length) return { value: undefined, done: true };
|
1252 | point = charAt(string, index);
|
1253 | state.index += point.length;
|
1254 | return { value: point, done: false };
|
1255 | });
|
1256 |
|
1257 | var redefineAll = function (target, src, options) {
|
1258 | for (var key in src) redefine(target, key, src[key], options);
|
1259 | return target;
|
1260 | };
|
1261 |
|
1262 | var freezing = !fails(function () {
|
1263 | return Object.isExtensible(Object.preventExtensions({}));
|
1264 | });
|
1265 |
|
1266 | var internalMetadata = createCommonjsModule(function (module) {
|
1267 | var defineProperty = objectDefineProperty.f;
|
1268 |
|
1269 |
|
1270 |
|
1271 | var METADATA = uid('meta');
|
1272 | var id = 0;
|
1273 |
|
1274 | var isExtensible = Object.isExtensible || function () {
|
1275 | return true;
|
1276 | };
|
1277 |
|
1278 | var setMetadata = function (it) {
|
1279 | defineProperty(it, METADATA, { value: {
|
1280 | objectID: 'O' + ++id,
|
1281 | weakData: {}
|
1282 | } });
|
1283 | };
|
1284 |
|
1285 | var fastKey = function (it, create) {
|
1286 |
|
1287 | if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
1288 | if (!has(it, METADATA)) {
|
1289 |
|
1290 | if (!isExtensible(it)) return 'F';
|
1291 |
|
1292 | if (!create) return 'E';
|
1293 |
|
1294 | setMetadata(it);
|
1295 |
|
1296 | } return it[METADATA].objectID;
|
1297 | };
|
1298 |
|
1299 | var getWeakData = function (it, create) {
|
1300 | if (!has(it, METADATA)) {
|
1301 |
|
1302 | if (!isExtensible(it)) return true;
|
1303 |
|
1304 | if (!create) return false;
|
1305 |
|
1306 | setMetadata(it);
|
1307 |
|
1308 | } return it[METADATA].weakData;
|
1309 | };
|
1310 |
|
1311 |
|
1312 | var onFreeze = function (it) {
|
1313 | if (freezing && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it);
|
1314 | return it;
|
1315 | };
|
1316 |
|
1317 | var meta = module.exports = {
|
1318 | REQUIRED: false,
|
1319 | fastKey: fastKey,
|
1320 | getWeakData: getWeakData,
|
1321 | onFreeze: onFreeze
|
1322 | };
|
1323 |
|
1324 | hiddenKeys[METADATA] = true;
|
1325 | });
|
1326 | var internalMetadata_1 = internalMetadata.REQUIRED;
|
1327 | var internalMetadata_2 = internalMetadata.fastKey;
|
1328 | var internalMetadata_3 = internalMetadata.getWeakData;
|
1329 | var internalMetadata_4 = internalMetadata.onFreeze;
|
1330 |
|
1331 | var ITERATOR$2 = wellKnownSymbol('iterator');
|
1332 | var ArrayPrototype$1 = Array.prototype;
|
1333 |
|
1334 |
|
1335 | var isArrayIteratorMethod = function (it) {
|
1336 | return it !== undefined && (iterators.Array === it || ArrayPrototype$1[ITERATOR$2] === it);
|
1337 | };
|
1338 |
|
1339 | var ITERATOR$3 = wellKnownSymbol('iterator');
|
1340 |
|
1341 | var getIteratorMethod = function (it) {
|
1342 | if (it != undefined) return it[ITERATOR$3]
|
1343 | || it['@@iterator']
|
1344 | || iterators[classof(it)];
|
1345 | };
|
1346 |
|
1347 |
|
1348 | var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
|
1349 | try {
|
1350 | return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
|
1351 |
|
1352 | } catch (error) {
|
1353 | var returnMethod = iterator['return'];
|
1354 | if (returnMethod !== undefined) anObject(returnMethod.call(iterator));
|
1355 | throw error;
|
1356 | }
|
1357 | };
|
1358 |
|
1359 | var iterate_1 = createCommonjsModule(function (module) {
|
1360 | var Result = function (stopped, result) {
|
1361 | this.stopped = stopped;
|
1362 | this.result = result;
|
1363 | };
|
1364 |
|
1365 | var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {
|
1366 | var boundFunction = bindContext(fn, that, AS_ENTRIES ? 2 : 1);
|
1367 | var iterator, iterFn, index, length, result, step;
|
1368 |
|
1369 | if (IS_ITERATOR) {
|
1370 | iterator = iterable;
|
1371 | } else {
|
1372 | iterFn = getIteratorMethod(iterable);
|
1373 | if (typeof iterFn != 'function') throw TypeError('Target is not iterable');
|
1374 |
|
1375 | if (isArrayIteratorMethod(iterFn)) {
|
1376 | for (index = 0, length = toLength(iterable.length); length > index; index++) {
|
1377 | result = AS_ENTRIES
|
1378 | ? boundFunction(anObject(step = iterable[index])[0], step[1])
|
1379 | : boundFunction(iterable[index]);
|
1380 | if (result && result instanceof Result) return result;
|
1381 | } return new Result(false);
|
1382 | }
|
1383 | iterator = iterFn.call(iterable);
|
1384 | }
|
1385 |
|
1386 | while (!(step = iterator.next()).done) {
|
1387 | result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);
|
1388 | if (result && result instanceof Result) return result;
|
1389 | } return new Result(false);
|
1390 | };
|
1391 |
|
1392 | iterate.stop = function (result) {
|
1393 | return new Result(true, result);
|
1394 | };
|
1395 | });
|
1396 |
|
1397 | var anInstance = function (it, Constructor, name) {
|
1398 | if (!(it instanceof Constructor)) {
|
1399 | throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
|
1400 | } return it;
|
1401 | };
|
1402 |
|
1403 | var ITERATOR$4 = wellKnownSymbol('iterator');
|
1404 | var SAFE_CLOSING = false;
|
1405 |
|
1406 | try {
|
1407 | var called = 0;
|
1408 | var iteratorWithReturn = {
|
1409 | next: function () {
|
1410 | return { done: !!called++ };
|
1411 | },
|
1412 | 'return': function () {
|
1413 | SAFE_CLOSING = true;
|
1414 | }
|
1415 | };
|
1416 | iteratorWithReturn[ITERATOR$4] = function () {
|
1417 | return this;
|
1418 | };
|
1419 |
|
1420 | Array.from(iteratorWithReturn, function () { throw 2; });
|
1421 | } catch (error) { }
|
1422 |
|
1423 | var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
|
1424 | if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
|
1425 | var ITERATION_SUPPORT = false;
|
1426 | try {
|
1427 | var object = {};
|
1428 | object[ITERATOR$4] = function () {
|
1429 | return {
|
1430 | next: function () {
|
1431 | return { done: ITERATION_SUPPORT = true };
|
1432 | }
|
1433 | };
|
1434 | };
|
1435 | exec(object);
|
1436 | } catch (error) { }
|
1437 | return ITERATION_SUPPORT;
|
1438 | };
|
1439 |
|
1440 |
|
1441 | var inheritIfRequired = function ($this, dummy, Wrapper) {
|
1442 | var NewTarget, NewTargetPrototype;
|
1443 | if (
|
1444 |
|
1445 | objectSetPrototypeOf &&
|
1446 |
|
1447 | typeof (NewTarget = dummy.constructor) == 'function' &&
|
1448 | NewTarget !== Wrapper &&
|
1449 | isObject(NewTargetPrototype = NewTarget.prototype) &&
|
1450 | NewTargetPrototype !== Wrapper.prototype
|
1451 | ) objectSetPrototypeOf($this, NewTargetPrototype);
|
1452 | return $this;
|
1453 | };
|
1454 |
|
1455 | var collection = function (CONSTRUCTOR_NAME, wrapper, common, IS_MAP, IS_WEAK) {
|
1456 | var NativeConstructor = global_1[CONSTRUCTOR_NAME];
|
1457 | var NativePrototype = NativeConstructor && NativeConstructor.prototype;
|
1458 | var Constructor = NativeConstructor;
|
1459 | var ADDER = IS_MAP ? 'set' : 'add';
|
1460 | var exported = {};
|
1461 |
|
1462 | var fixMethod = function (KEY) {
|
1463 | var nativeMethod = NativePrototype[KEY];
|
1464 | redefine(NativePrototype, KEY,
|
1465 | KEY == 'add' ? function add(value) {
|
1466 | nativeMethod.call(this, value === 0 ? 0 : value);
|
1467 | return this;
|
1468 | } : KEY == 'delete' ? function (key) {
|
1469 | return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
|
1470 | } : KEY == 'get' ? function get(key) {
|
1471 | return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key);
|
1472 | } : KEY == 'has' ? function has(key) {
|
1473 | return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
|
1474 | } : function set(key, value) {
|
1475 | nativeMethod.call(this, key === 0 ? 0 : key, value);
|
1476 | return this;
|
1477 | }
|
1478 | );
|
1479 | };
|
1480 |
|
1481 |
|
1482 | if (isForced_1(CONSTRUCTOR_NAME, typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
|
1483 | new NativeConstructor().entries().next();
|
1484 | })))) {
|
1485 |
|
1486 | Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
|
1487 | internalMetadata.REQUIRED = true;
|
1488 | } else if (isForced_1(CONSTRUCTOR_NAME, true)) {
|
1489 | var instance = new Constructor();
|
1490 |
|
1491 | var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
|
1492 |
|
1493 | var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
|
1494 |
|
1495 |
|
1496 | var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });
|
1497 |
|
1498 | var BUGGY_ZERO = !IS_WEAK && fails(function () {
|
1499 |
|
1500 | var $instance = new NativeConstructor();
|
1501 | var index = 5;
|
1502 | while (index--) $instance[ADDER](index, index);
|
1503 | return !$instance.has(-0);
|
1504 | });
|
1505 |
|
1506 | if (!ACCEPT_ITERABLES) {
|
1507 | Constructor = wrapper(function (dummy, iterable) {
|
1508 | anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
|
1509 | var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
|
1510 | if (iterable != undefined) iterate_1(iterable, that[ADDER], that, IS_MAP);
|
1511 | return that;
|
1512 | });
|
1513 | Constructor.prototype = NativePrototype;
|
1514 | NativePrototype.constructor = Constructor;
|
1515 | }
|
1516 |
|
1517 | if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
|
1518 | fixMethod('delete');
|
1519 | fixMethod('has');
|
1520 | IS_MAP && fixMethod('get');
|
1521 | }
|
1522 |
|
1523 | if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
|
1524 |
|
1525 |
|
1526 | if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;
|
1527 | }
|
1528 |
|
1529 | exported[CONSTRUCTOR_NAME] = Constructor;
|
1530 | _export({ global: true, forced: Constructor != NativeConstructor }, exported);
|
1531 |
|
1532 | setToStringTag(Constructor, CONSTRUCTOR_NAME);
|
1533 |
|
1534 | if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
|
1535 |
|
1536 | return Constructor;
|
1537 | };
|
1538 |
|
1539 | var getWeakData = internalMetadata.getWeakData;
|
1540 |
|
1541 |
|
1542 |
|
1543 |
|
1544 |
|
1545 |
|
1546 |
|
1547 |
|
1548 | var setInternalState$2 = internalState.set;
|
1549 | var internalStateGetterFor = internalState.getterFor;
|
1550 | var find = arrayIteration.find;
|
1551 | var findIndex = arrayIteration.findIndex;
|
1552 | var id$1 = 0;
|
1553 |
|
1554 |
|
1555 | var uncaughtFrozenStore = function (store) {
|
1556 | return store.frozen || (store.frozen = new UncaughtFrozenStore());
|
1557 | };
|
1558 |
|
1559 | var UncaughtFrozenStore = function () {
|
1560 | this.entries = [];
|
1561 | };
|
1562 |
|
1563 | var findUncaughtFrozen = function (store, key) {
|
1564 | return find(store.entries, function (it) {
|
1565 | return it[0] === key;
|
1566 | });
|
1567 | };
|
1568 |
|
1569 | UncaughtFrozenStore.prototype = {
|
1570 | get: function (key) {
|
1571 | var entry = findUncaughtFrozen(this, key);
|
1572 | if (entry) return entry[1];
|
1573 | },
|
1574 | has: function (key) {
|
1575 | return !!findUncaughtFrozen(this, key);
|
1576 | },
|
1577 | set: function (key, value) {
|
1578 | var entry = findUncaughtFrozen(this, key);
|
1579 | if (entry) entry[1] = value;
|
1580 | else this.entries.push([key, value]);
|
1581 | },
|
1582 | 'delete': function (key) {
|
1583 | var index = findIndex(this.entries, function (it) {
|
1584 | return it[0] === key;
|
1585 | });
|
1586 | if (~index) this.entries.splice(index, 1);
|
1587 | return !!~index;
|
1588 | }
|
1589 | };
|
1590 |
|
1591 | var collectionWeak = {
|
1592 | getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
|
1593 | var C = wrapper(function (that, iterable) {
|
1594 | anInstance(that, C, CONSTRUCTOR_NAME);
|
1595 | setInternalState$2(that, {
|
1596 | type: CONSTRUCTOR_NAME,
|
1597 | id: id$1++,
|
1598 | frozen: undefined
|
1599 | });
|
1600 | if (iterable != undefined) iterate_1(iterable, that[ADDER], that, IS_MAP);
|
1601 | });
|
1602 |
|
1603 | var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
1604 |
|
1605 | var define = function (that, key, value) {
|
1606 | var state = getInternalState(that);
|
1607 | var data = getWeakData(anObject(key), true);
|
1608 | if (data === true) uncaughtFrozenStore(state).set(key, value);
|
1609 | else data[state.id] = value;
|
1610 | return that;
|
1611 | };
|
1612 |
|
1613 | redefineAll(C.prototype, {
|
1614 |
|
1615 |
|
1616 | 'delete': function (key) {
|
1617 | var state = getInternalState(this);
|
1618 | if (!isObject(key)) return false;
|
1619 | var data = getWeakData(key);
|
1620 | if (data === true) return uncaughtFrozenStore(state)['delete'](key);
|
1621 | return data && has(data, state.id) && delete data[state.id];
|
1622 | },
|
1623 |
|
1624 |
|
1625 | has: function has$1(key) {
|
1626 | var state = getInternalState(this);
|
1627 | if (!isObject(key)) return false;
|
1628 | var data = getWeakData(key);
|
1629 | if (data === true) return uncaughtFrozenStore(state).has(key);
|
1630 | return data && has(data, state.id);
|
1631 | }
|
1632 | });
|
1633 |
|
1634 | redefineAll(C.prototype, IS_MAP ? {
|
1635 |
|
1636 | get: function get(key) {
|
1637 | var state = getInternalState(this);
|
1638 | if (isObject(key)) {
|
1639 | var data = getWeakData(key);
|
1640 | if (data === true) return uncaughtFrozenStore(state).get(key);
|
1641 | return data ? data[state.id] : undefined;
|
1642 | }
|
1643 | },
|
1644 |
|
1645 | set: function set(key, value) {
|
1646 | return define(this, key, value);
|
1647 | }
|
1648 | } : {
|
1649 |
|
1650 | add: function add(value) {
|
1651 | return define(this, value, true);
|
1652 | }
|
1653 | });
|
1654 |
|
1655 | return C;
|
1656 | }
|
1657 | };
|
1658 |
|
1659 | var es_weakMap = createCommonjsModule(function (module) {
|
1660 |
|
1661 |
|
1662 |
|
1663 |
|
1664 |
|
1665 |
|
1666 | var enforceIternalState = internalState.enforce;
|
1667 |
|
1668 |
|
1669 | var IS_IE11 = !global_1.ActiveXObject && 'ActiveXObject' in global_1;
|
1670 | var isExtensible = Object.isExtensible;
|
1671 | var InternalWeakMap;
|
1672 |
|
1673 | var wrapper = function (get) {
|
1674 | return function WeakMap() {
|
1675 | return get(this, arguments.length ? arguments[0] : undefined);
|
1676 | };
|
1677 | };
|
1678 |
|
1679 | // `WeakMap` constructor
|
1680 | // https://tc39.github.io/ecma262/#sec-weakmap-constructor
|
1681 | var $WeakMap = module.exports = collection('WeakMap', wrapper, collectionWeak, true, true);
|
1682 |
|
1683 | // IE11 WeakMap frozen keys fix
|
1684 | // We can't use feature detection because it crash some old IE builds
|
1685 | // https://github.com/zloirock/core-js/issues/485
|
1686 | if (nativeWeakMap && IS_IE11) {
|
1687 | InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true);
|
1688 | internalMetadata.REQUIRED = true;
|
1689 | var WeakMapPrototype = $WeakMap.prototype;
|
1690 | var nativeDelete = WeakMapPrototype['delete'];
|
1691 | var nativeHas = WeakMapPrototype.has;
|
1692 | var nativeGet = WeakMapPrototype.get;
|
1693 | var nativeSet = WeakMapPrototype.set;
|
1694 | redefineAll(WeakMapPrototype, {
|
1695 | 'delete': function (key) {
|
1696 | if (isObject(key) && !isExtensible(key)) {
|
1697 | var state = enforceIternalState(this);
|
1698 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
1699 | return nativeDelete.call(this, key) || state.frozen['delete'](key);
|
1700 | } return nativeDelete.call(this, key);
|
1701 | },
|
1702 | has: function has(key) {
|
1703 | if (isObject(key) && !isExtensible(key)) {
|
1704 | var state = enforceIternalState(this);
|
1705 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
1706 | return nativeHas.call(this, key) || state.frozen.has(key);
|
1707 | } return nativeHas.call(this, key);
|
1708 | },
|
1709 | get: function get(key) {
|
1710 | if (isObject(key) && !isExtensible(key)) {
|
1711 | var state = enforceIternalState(this);
|
1712 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
1713 | return nativeHas.call(this, key) ? nativeGet.call(this, key) : state.frozen.get(key);
|
1714 | } return nativeGet.call(this, key);
|
1715 | },
|
1716 | set: function set(key, value) {
|
1717 | if (isObject(key) && !isExtensible(key)) {
|
1718 | var state = enforceIternalState(this);
|
1719 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
1720 | nativeHas.call(this, key) ? nativeSet.call(this, key, value) : state.frozen.set(key, value);
|
1721 | } else nativeSet.call(this, key, value);
|
1722 | return this;
|
1723 | }
|
1724 | });
|
1725 | }
|
1726 | });
|
1727 |
|
1728 | var ITERATOR$5 = wellKnownSymbol('iterator');
|
1729 | var TO_STRING_TAG$3 = wellKnownSymbol('toStringTag');
|
1730 | var ArrayValues = es_array_iterator.values;
|
1731 |
|
1732 | for (var COLLECTION_NAME$1 in domIterables) {
|
1733 | var Collection$1 = global_1[COLLECTION_NAME$1];
|
1734 | var CollectionPrototype$1 = Collection$1 && Collection$1.prototype;
|
1735 | if (CollectionPrototype$1) {
|
1736 |
|
1737 | if (CollectionPrototype$1[ITERATOR$5] !== ArrayValues) try {
|
1738 | hide(CollectionPrototype$1, ITERATOR$5, ArrayValues);
|
1739 | } catch (error) {
|
1740 | CollectionPrototype$1[ITERATOR$5] = ArrayValues;
|
1741 | }
|
1742 | if (!CollectionPrototype$1[TO_STRING_TAG$3]) hide(CollectionPrototype$1, TO_STRING_TAG$3, COLLECTION_NAME$1);
|
1743 | if (domIterables[COLLECTION_NAME$1]) for (var METHOD_NAME in es_array_iterator) {
|
1744 |
|
1745 | if (CollectionPrototype$1[METHOD_NAME] !== es_array_iterator[METHOD_NAME]) try {
|
1746 | hide(CollectionPrototype$1, METHOD_NAME, es_array_iterator[METHOD_NAME]);
|
1747 | } catch (error) {
|
1748 | CollectionPrototype$1[METHOD_NAME] = es_array_iterator[METHOD_NAME];
|
1749 | }
|
1750 | }
|
1751 | }
|
1752 | }
|
1753 |
|
1754 | |
1755 |
|
1756 |
|
1757 |
|
1758 |
|
1759 |
|
1760 |
|
1761 |
|
1762 |
|
1763 |
|
1764 | var FUNC_ERROR_TEXT = 'Expected a function';
|
1765 |
|
1766 |
|
1767 | var NAN = 0 / 0;
|
1768 |
|
1769 |
|
1770 | var symbolTag = '[object Symbol]';
|
1771 |
|
1772 |
|
1773 | var reTrim = /^\s+|\s+$/g;
|
1774 |
|
1775 |
|
1776 | var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
1777 |
|
1778 |
|
1779 | var reIsBinary = /^0b[01]+$/i;
|
1780 |
|
1781 |
|
1782 | var reIsOctal = /^0o[0-7]+$/i;
|
1783 |
|
1784 |
|
1785 | var freeParseInt = parseInt;
|
1786 |
|
1787 |
|
1788 | var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
1789 |
|
1790 |
|
1791 | var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
1792 |
|
1793 |
|
1794 | var root = freeGlobal || freeSelf || Function('return this')();
|
1795 |
|
1796 |
|
1797 | var objectProto = Object.prototype;
|
1798 |
|
1799 | |
1800 |
|
1801 |
|
1802 |
|
1803 |
|
1804 | var objectToString$1 = objectProto.toString;
|
1805 |
|
1806 |
|
1807 | var nativeMax = Math.max,
|
1808 | nativeMin = Math.min;
|
1809 |
|
1810 | |
1811 |
|
1812 |
|
1813 |
|
1814 |
|
1815 |
|
1816 |
|
1817 |
|
1818 |
|
1819 |
|
1820 |
|
1821 |
|
1822 |
|
1823 |
|
1824 |
|
1825 |
|
1826 | var now = function() {
|
1827 | return root.Date.now();
|
1828 | };
|
1829 |
|
1830 | |
1831 |
|
1832 |
|
1833 |
|
1834 |
|
1835 |
|
1836 |
|
1837 |
|
1838 |
|
1839 |
|
1840 |
|
1841 |
|
1842 |
|
1843 |
|
1844 |
|
1845 |
|
1846 |
|
1847 |
|
1848 |
|
1849 |
|
1850 |
|
1851 |
|
1852 |
|
1853 |
|
1854 |
|
1855 |
|
1856 |
|
1857 |
|
1858 |
|
1859 |
|
1860 |
|
1861 |
|
1862 |
|
1863 |
|
1864 |
|
1865 |
|
1866 |
|
1867 |
|
1868 |
|
1869 |
|
1870 |
|
1871 |
|
1872 |
|
1873 |
|
1874 |
|
1875 |
|
1876 |
|
1877 |
|
1878 |
|
1879 |
|
1880 |
|
1881 |
|
1882 |
|
1883 |
|
1884 | function debounce(func, wait, options) {
|
1885 | var lastArgs,
|
1886 | lastThis,
|
1887 | maxWait,
|
1888 | result,
|
1889 | timerId,
|
1890 | lastCallTime,
|
1891 | lastInvokeTime = 0,
|
1892 | leading = false,
|
1893 | maxing = false,
|
1894 | trailing = true;
|
1895 |
|
1896 | if (typeof func != 'function') {
|
1897 | throw new TypeError(FUNC_ERROR_TEXT);
|
1898 | }
|
1899 | wait = toNumber(wait) || 0;
|
1900 | if (isObject$1(options)) {
|
1901 | leading = !!options.leading;
|
1902 | maxing = 'maxWait' in options;
|
1903 | maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
1904 | trailing = 'trailing' in options ? !!options.trailing : trailing;
|
1905 | }
|
1906 |
|
1907 | function invokeFunc(time) {
|
1908 | var args = lastArgs,
|
1909 | thisArg = lastThis;
|
1910 |
|
1911 | lastArgs = lastThis = undefined;
|
1912 | lastInvokeTime = time;
|
1913 | result = func.apply(thisArg, args);
|
1914 | return result;
|
1915 | }
|
1916 |
|
1917 | function leadingEdge(time) {
|
1918 |
|
1919 | lastInvokeTime = time;
|
1920 |
|
1921 | timerId = setTimeout(timerExpired, wait);
|
1922 |
|
1923 | return leading ? invokeFunc(time) : result;
|
1924 | }
|
1925 |
|
1926 | function remainingWait(time) {
|
1927 | var timeSinceLastCall = time - lastCallTime,
|
1928 | timeSinceLastInvoke = time - lastInvokeTime,
|
1929 | result = wait - timeSinceLastCall;
|
1930 |
|
1931 | return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
|
1932 | }
|
1933 |
|
1934 | function shouldInvoke(time) {
|
1935 | var timeSinceLastCall = time - lastCallTime,
|
1936 | timeSinceLastInvoke = time - lastInvokeTime;
|
1937 |
|
1938 |
|
1939 |
|
1940 |
|
1941 | return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
|
1942 | (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
|
1943 | }
|
1944 |
|
1945 | function timerExpired() {
|
1946 | var time = now();
|
1947 | if (shouldInvoke(time)) {
|
1948 | return trailingEdge(time);
|
1949 | }
|
1950 |
|
1951 | timerId = setTimeout(timerExpired, remainingWait(time));
|
1952 | }
|
1953 |
|
1954 | function trailingEdge(time) {
|
1955 | timerId = undefined;
|
1956 |
|
1957 |
|
1958 |
|
1959 | if (trailing && lastArgs) {
|
1960 | return invokeFunc(time);
|
1961 | }
|
1962 | lastArgs = lastThis = undefined;
|
1963 | return result;
|
1964 | }
|
1965 |
|
1966 | function cancel() {
|
1967 | if (timerId !== undefined) {
|
1968 | clearTimeout(timerId);
|
1969 | }
|
1970 | lastInvokeTime = 0;
|
1971 | lastArgs = lastCallTime = lastThis = timerId = undefined;
|
1972 | }
|
1973 |
|
1974 | function flush() {
|
1975 | return timerId === undefined ? result : trailingEdge(now());
|
1976 | }
|
1977 |
|
1978 | function debounced() {
|
1979 | var time = now(),
|
1980 | isInvoking = shouldInvoke(time);
|
1981 |
|
1982 | lastArgs = arguments;
|
1983 | lastThis = this;
|
1984 | lastCallTime = time;
|
1985 |
|
1986 | if (isInvoking) {
|
1987 | if (timerId === undefined) {
|
1988 | return leadingEdge(lastCallTime);
|
1989 | }
|
1990 | if (maxing) {
|
1991 |
|
1992 | timerId = setTimeout(timerExpired, wait);
|
1993 | return invokeFunc(lastCallTime);
|
1994 | }
|
1995 | }
|
1996 | if (timerId === undefined) {
|
1997 | timerId = setTimeout(timerExpired, wait);
|
1998 | }
|
1999 | return result;
|
2000 | }
|
2001 | debounced.cancel = cancel;
|
2002 | debounced.flush = flush;
|
2003 | return debounced;
|
2004 | }
|
2005 |
|
2006 | |
2007 |
|
2008 |
|
2009 |
|
2010 |
|
2011 |
|
2012 |
|
2013 |
|
2014 |
|
2015 |
|
2016 |
|
2017 |
|
2018 |
|
2019 |
|
2020 |
|
2021 |
|
2022 |
|
2023 |
|
2024 |
|
2025 |
|
2026 |
|
2027 |
|
2028 |
|
2029 |
|
2030 |
|
2031 |
|
2032 |
|
2033 |
|
2034 |
|
2035 |
|
2036 |
|
2037 |
|
2038 |
|
2039 |
|
2040 |
|
2041 |
|
2042 |
|
2043 |
|
2044 |
|
2045 |
|
2046 |
|
2047 |
|
2048 |
|
2049 |
|
2050 | function throttle(func, wait, options) {
|
2051 | var leading = true,
|
2052 | trailing = true;
|
2053 |
|
2054 | if (typeof func != 'function') {
|
2055 | throw new TypeError(FUNC_ERROR_TEXT);
|
2056 | }
|
2057 | if (isObject$1(options)) {
|
2058 | leading = 'leading' in options ? !!options.leading : leading;
|
2059 | trailing = 'trailing' in options ? !!options.trailing : trailing;
|
2060 | }
|
2061 | return debounce(func, wait, {
|
2062 | 'leading': leading,
|
2063 | 'maxWait': wait,
|
2064 | 'trailing': trailing
|
2065 | });
|
2066 | }
|
2067 |
|
2068 | |
2069 |
|
2070 |
|
2071 |
|
2072 |
|
2073 |
|
2074 |
|
2075 |
|
2076 |
|
2077 |
|
2078 |
|
2079 |
|
2080 |
|
2081 |
|
2082 |
|
2083 |
|
2084 |
|
2085 |
|
2086 |
|
2087 |
|
2088 |
|
2089 |
|
2090 |
|
2091 |
|
2092 |
|
2093 | function isObject$1(value) {
|
2094 | var type = typeof value;
|
2095 | return !!value && (type == 'object' || type == 'function');
|
2096 | }
|
2097 |
|
2098 | |
2099 |
|
2100 |
|
2101 |
|
2102 |
|
2103 |
|
2104 |
|
2105 |
|
2106 |
|
2107 |
|
2108 |
|
2109 |
|
2110 |
|
2111 |
|
2112 |
|
2113 |
|
2114 |
|
2115 |
|
2116 |
|
2117 |
|
2118 |
|
2119 |
|
2120 |
|
2121 |
|
2122 | function isObjectLike(value) {
|
2123 | return !!value && typeof value == 'object';
|
2124 | }
|
2125 |
|
2126 | |
2127 |
|
2128 |
|
2129 |
|
2130 |
|
2131 |
|
2132 |
|
2133 |
|
2134 |
|
2135 |
|
2136 |
|
2137 |
|
2138 |
|
2139 |
|
2140 |
|
2141 |
|
2142 |
|
2143 | function isSymbol(value) {
|
2144 | return typeof value == 'symbol' ||
|
2145 | (isObjectLike(value) && objectToString$1.call(value) == symbolTag);
|
2146 | }
|
2147 |
|
2148 | |
2149 |
|
2150 |
|
2151 |
|
2152 |
|
2153 |
|
2154 |
|
2155 |
|
2156 |
|
2157 |
|
2158 |
|
2159 |
|
2160 |
|
2161 |
|
2162 |
|
2163 |
|
2164 |
|
2165 |
|
2166 |
|
2167 |
|
2168 |
|
2169 |
|
2170 |
|
2171 | function toNumber(value) {
|
2172 | if (typeof value == 'number') {
|
2173 | return value;
|
2174 | }
|
2175 | if (isSymbol(value)) {
|
2176 | return NAN;
|
2177 | }
|
2178 | if (isObject$1(value)) {
|
2179 | var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
2180 | value = isObject$1(other) ? (other + '') : other;
|
2181 | }
|
2182 | if (typeof value != 'string') {
|
2183 | return value === 0 ? value : +value;
|
2184 | }
|
2185 | value = value.replace(reTrim, '');
|
2186 | var isBinary = reIsBinary.test(value);
|
2187 | return (isBinary || reIsOctal.test(value))
|
2188 | ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
2189 | : (reIsBadHex.test(value) ? NAN : +value);
|
2190 | }
|
2191 |
|
2192 | var lodash_throttle = throttle;
|
2193 |
|
2194 | |
2195 |
|
2196 |
|
2197 |
|
2198 |
|
2199 |
|
2200 |
|
2201 |
|
2202 |
|
2203 |
|
2204 | var FUNC_ERROR_TEXT$1 = 'Expected a function';
|
2205 |
|
2206 |
|
2207 | var NAN$1 = 0 / 0;
|
2208 |
|
2209 |
|
2210 | var symbolTag$1 = '[object Symbol]';
|
2211 |
|
2212 |
|
2213 | var reTrim$1 = /^\s+|\s+$/g;
|
2214 |
|
2215 |
|
2216 | var reIsBadHex$1 = /^[-+]0x[0-9a-f]+$/i;
|
2217 |
|
2218 |
|
2219 | var reIsBinary$1 = /^0b[01]+$/i;
|
2220 |
|
2221 |
|
2222 | var reIsOctal$1 = /^0o[0-7]+$/i;
|
2223 |
|
2224 |
|
2225 | var freeParseInt$1 = parseInt;
|
2226 |
|
2227 |
|
2228 | var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
2229 |
|
2230 |
|
2231 | var freeSelf$1 = typeof self == 'object' && self && self.Object === Object && self;
|
2232 |
|
2233 |
|
2234 | var root$1 = freeGlobal$1 || freeSelf$1 || Function('return this')();
|
2235 |
|
2236 |
|
2237 | var objectProto$1 = Object.prototype;
|
2238 |
|
2239 | |
2240 |
|
2241 |
|
2242 |
|
2243 |
|
2244 | var objectToString$2 = objectProto$1.toString;
|
2245 |
|
2246 |
|
2247 | var nativeMax$1 = Math.max,
|
2248 | nativeMin$1 = Math.min;
|
2249 |
|
2250 | |
2251 |
|
2252 |
|
2253 |
|
2254 |
|
2255 |
|
2256 |
|
2257 |
|
2258 |
|
2259 |
|
2260 |
|
2261 |
|
2262 |
|
2263 |
|
2264 |
|
2265 |
|
2266 | var now$1 = function() {
|
2267 | return root$1.Date.now();
|
2268 | };
|
2269 |
|
2270 | |
2271 |
|
2272 |
|
2273 |
|
2274 |
|
2275 |
|
2276 |
|
2277 |
|
2278 |
|
2279 |
|
2280 |
|
2281 |
|
2282 |
|
2283 |
|
2284 |
|
2285 |
|
2286 |
|
2287 |
|
2288 |
|
2289 |
|
2290 |
|
2291 |
|
2292 |
|
2293 |
|
2294 |
|
2295 |
|
2296 |
|
2297 |
|
2298 |
|
2299 |
|
2300 |
|
2301 |
|
2302 |
|
2303 |
|
2304 |
|
2305 |
|
2306 |
|
2307 |
|
2308 |
|
2309 |
|
2310 |
|
2311 |
|
2312 |
|
2313 |
|
2314 |
|
2315 |
|
2316 |
|
2317 |
|
2318 |
|
2319 |
|
2320 |
|
2321 |
|
2322 |
|
2323 |
|
2324 | function debounce$1(func, wait, options) {
|
2325 | var lastArgs,
|
2326 | lastThis,
|
2327 | maxWait,
|
2328 | result,
|
2329 | timerId,
|
2330 | lastCallTime,
|
2331 | lastInvokeTime = 0,
|
2332 | leading = false,
|
2333 | maxing = false,
|
2334 | trailing = true;
|
2335 |
|
2336 | if (typeof func != 'function') {
|
2337 | throw new TypeError(FUNC_ERROR_TEXT$1);
|
2338 | }
|
2339 | wait = toNumber$1(wait) || 0;
|
2340 | if (isObject$2(options)) {
|
2341 | leading = !!options.leading;
|
2342 | maxing = 'maxWait' in options;
|
2343 | maxWait = maxing ? nativeMax$1(toNumber$1(options.maxWait) || 0, wait) : maxWait;
|
2344 | trailing = 'trailing' in options ? !!options.trailing : trailing;
|
2345 | }
|
2346 |
|
2347 | function invokeFunc(time) {
|
2348 | var args = lastArgs,
|
2349 | thisArg = lastThis;
|
2350 |
|
2351 | lastArgs = lastThis = undefined;
|
2352 | lastInvokeTime = time;
|
2353 | result = func.apply(thisArg, args);
|
2354 | return result;
|
2355 | }
|
2356 |
|
2357 | function leadingEdge(time) {
|
2358 |
|
2359 | lastInvokeTime = time;
|
2360 |
|
2361 | timerId = setTimeout(timerExpired, wait);
|
2362 |
|
2363 | return leading ? invokeFunc(time) : result;
|
2364 | }
|
2365 |
|
2366 | function remainingWait(time) {
|
2367 | var timeSinceLastCall = time - lastCallTime,
|
2368 | timeSinceLastInvoke = time - lastInvokeTime,
|
2369 | result = wait - timeSinceLastCall;
|
2370 |
|
2371 | return maxing ? nativeMin$1(result, maxWait - timeSinceLastInvoke) : result;
|
2372 | }
|
2373 |
|
2374 | function shouldInvoke(time) {
|
2375 | var timeSinceLastCall = time - lastCallTime,
|
2376 | timeSinceLastInvoke = time - lastInvokeTime;
|
2377 |
|
2378 |
|
2379 |
|
2380 |
|
2381 | return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
|
2382 | (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
|
2383 | }
|
2384 |
|
2385 | function timerExpired() {
|
2386 | var time = now$1();
|
2387 | if (shouldInvoke(time)) {
|
2388 | return trailingEdge(time);
|
2389 | }
|
2390 |
|
2391 | timerId = setTimeout(timerExpired, remainingWait(time));
|
2392 | }
|
2393 |
|
2394 | function trailingEdge(time) {
|
2395 | timerId = undefined;
|
2396 |
|
2397 |
|
2398 |
|
2399 | if (trailing && lastArgs) {
|
2400 | return invokeFunc(time);
|
2401 | }
|
2402 | lastArgs = lastThis = undefined;
|
2403 | return result;
|
2404 | }
|
2405 |
|
2406 | function cancel() {
|
2407 | if (timerId !== undefined) {
|
2408 | clearTimeout(timerId);
|
2409 | }
|
2410 | lastInvokeTime = 0;
|
2411 | lastArgs = lastCallTime = lastThis = timerId = undefined;
|
2412 | }
|
2413 |
|
2414 | function flush() {
|
2415 | return timerId === undefined ? result : trailingEdge(now$1());
|
2416 | }
|
2417 |
|
2418 | function debounced() {
|
2419 | var time = now$1(),
|
2420 | isInvoking = shouldInvoke(time);
|
2421 |
|
2422 | lastArgs = arguments;
|
2423 | lastThis = this;
|
2424 | lastCallTime = time;
|
2425 |
|
2426 | if (isInvoking) {
|
2427 | if (timerId === undefined) {
|
2428 | return leadingEdge(lastCallTime);
|
2429 | }
|
2430 | if (maxing) {
|
2431 |
|
2432 | timerId = setTimeout(timerExpired, wait);
|
2433 | return invokeFunc(lastCallTime);
|
2434 | }
|
2435 | }
|
2436 | if (timerId === undefined) {
|
2437 | timerId = setTimeout(timerExpired, wait);
|
2438 | }
|
2439 | return result;
|
2440 | }
|
2441 | debounced.cancel = cancel;
|
2442 | debounced.flush = flush;
|
2443 | return debounced;
|
2444 | }
|
2445 |
|
2446 | |
2447 |
|
2448 |
|
2449 |
|
2450 |
|
2451 |
|
2452 |
|
2453 |
|
2454 |
|
2455 |
|
2456 |
|
2457 |
|
2458 |
|
2459 |
|
2460 |
|
2461 |
|
2462 |
|
2463 |
|
2464 |
|
2465 |
|
2466 |
|
2467 |
|
2468 |
|
2469 |
|
2470 |
|
2471 | function isObject$2(value) {
|
2472 | var type = typeof value;
|
2473 | return !!value && (type == 'object' || type == 'function');
|
2474 | }
|
2475 |
|
2476 | |
2477 |
|
2478 |
|
2479 |
|
2480 |
|
2481 |
|
2482 |
|
2483 |
|
2484 |
|
2485 |
|
2486 |
|
2487 |
|
2488 |
|
2489 |
|
2490 |
|
2491 |
|
2492 |
|
2493 |
|
2494 |
|
2495 |
|
2496 |
|
2497 |
|
2498 |
|
2499 |
|
2500 | function isObjectLike$1(value) {
|
2501 | return !!value && typeof value == 'object';
|
2502 | }
|
2503 |
|
2504 | |
2505 |
|
2506 |
|
2507 |
|
2508 |
|
2509 |
|
2510 |
|
2511 |
|
2512 |
|
2513 |
|
2514 |
|
2515 |
|
2516 |
|
2517 |
|
2518 |
|
2519 |
|
2520 |
|
2521 | function isSymbol$1(value) {
|
2522 | return typeof value == 'symbol' ||
|
2523 | (isObjectLike$1(value) && objectToString$2.call(value) == symbolTag$1);
|
2524 | }
|
2525 |
|
2526 | |
2527 |
|
2528 |
|
2529 |
|
2530 |
|
2531 |
|
2532 |
|
2533 |
|
2534 |
|
2535 |
|
2536 |
|
2537 |
|
2538 |
|
2539 |
|
2540 |
|
2541 |
|
2542 |
|
2543 |
|
2544 |
|
2545 |
|
2546 |
|
2547 |
|
2548 |
|
2549 | function toNumber$1(value) {
|
2550 | if (typeof value == 'number') {
|
2551 | return value;
|
2552 | }
|
2553 | if (isSymbol$1(value)) {
|
2554 | return NAN$1;
|
2555 | }
|
2556 | if (isObject$2(value)) {
|
2557 | var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
2558 | value = isObject$2(other) ? (other + '') : other;
|
2559 | }
|
2560 | if (typeof value != 'string') {
|
2561 | return value === 0 ? value : +value;
|
2562 | }
|
2563 | value = value.replace(reTrim$1, '');
|
2564 | var isBinary = reIsBinary$1.test(value);
|
2565 | return (isBinary || reIsOctal$1.test(value))
|
2566 | ? freeParseInt$1(value.slice(2), isBinary ? 2 : 8)
|
2567 | : (reIsBadHex$1.test(value) ? NAN$1 : +value);
|
2568 | }
|
2569 |
|
2570 | var lodash_debounce = debounce$1;
|
2571 |
|
2572 | |
2573 |
|
2574 |
|
2575 |
|
2576 |
|
2577 |
|
2578 |
|
2579 |
|
2580 |
|
2581 |
|
2582 | var FUNC_ERROR_TEXT$2 = 'Expected a function';
|
2583 |
|
2584 |
|
2585 | var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
2586 |
|
2587 |
|
2588 | var funcTag = '[object Function]',
|
2589 | genTag = '[object GeneratorFunction]';
|
2590 |
|
2591 | |
2592 |
|
2593 |
|
2594 |
|
2595 | var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
2596 |
|
2597 |
|
2598 | var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
2599 |
|
2600 |
|
2601 | var freeGlobal$2 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
2602 |
|
2603 |
|
2604 | var freeSelf$2 = typeof self == 'object' && self && self.Object === Object && self;
|
2605 |
|
2606 |
|
2607 | var root$2 = freeGlobal$2 || freeSelf$2 || Function('return this')();
|
2608 |
|
2609 | |
2610 |
|
2611 |
|
2612 |
|
2613 |
|
2614 |
|
2615 |
|
2616 |
|
2617 | function getValue(object, key) {
|
2618 | return object == null ? undefined : object[key];
|
2619 | }
|
2620 |
|
2621 | |
2622 |
|
2623 |
|
2624 |
|
2625 |
|
2626 |
|
2627 |
|
2628 | function isHostObject(value) {
|
2629 |
|
2630 |
|
2631 | var result = false;
|
2632 | if (value != null && typeof value.toString != 'function') {
|
2633 | try {
|
2634 | result = !!(value + '');
|
2635 | } catch (e) {}
|
2636 | }
|
2637 | return result;
|
2638 | }
|
2639 |
|
2640 |
|
2641 | var arrayProto = Array.prototype,
|
2642 | funcProto = Function.prototype,
|
2643 | objectProto$2 = Object.prototype;
|
2644 |
|
2645 |
|
2646 | var coreJsData = root$2['__core-js_shared__'];
|
2647 |
|
2648 |
|
2649 | var maskSrcKey = (function() {
|
2650 | var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
2651 | return uid ? ('Symbol(src)_1.' + uid) : '';
|
2652 | }());
|
2653 |
|
2654 |
|
2655 | var funcToString = funcProto.toString;
|
2656 |
|
2657 |
|
2658 | var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
|
2659 |
|
2660 | |
2661 |
|
2662 |
|
2663 |
|
2664 |
|
2665 | var objectToString$3 = objectProto$2.toString;
|
2666 |
|
2667 |
|
2668 | var reIsNative = RegExp('^' +
|
2669 | funcToString.call(hasOwnProperty$1).replace(reRegExpChar, '\\$&')
|
2670 | .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
2671 | );
|
2672 |
|
2673 |
|
2674 | var splice = arrayProto.splice;
|
2675 |
|
2676 |
|
2677 | var Map$1 = getNative(root$2, 'Map'),
|
2678 | nativeCreate = getNative(Object, 'create');
|
2679 |
|
2680 | |
2681 |
|
2682 |
|
2683 |
|
2684 |
|
2685 |
|
2686 |
|
2687 | function Hash(entries) {
|
2688 | var index = -1,
|
2689 | length = entries ? entries.length : 0;
|
2690 |
|
2691 | this.clear();
|
2692 | while (++index < length) {
|
2693 | var entry = entries[index];
|
2694 | this.set(entry[0], entry[1]);
|
2695 | }
|
2696 | }
|
2697 |
|
2698 | |
2699 |
|
2700 |
|
2701 |
|
2702 |
|
2703 |
|
2704 |
|
2705 | function hashClear() {
|
2706 | this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
2707 | }
|
2708 |
|
2709 | |
2710 |
|
2711 |
|
2712 |
|
2713 |
|
2714 |
|
2715 |
|
2716 |
|
2717 |
|
2718 |
|
2719 | function hashDelete(key) {
|
2720 | return this.has(key) && delete this.__data__[key];
|
2721 | }
|
2722 |
|
2723 | |
2724 |
|
2725 |
|
2726 |
|
2727 |
|
2728 |
|
2729 |
|
2730 |
|
2731 |
|
2732 | function hashGet(key) {
|
2733 | var data = this.__data__;
|
2734 | if (nativeCreate) {
|
2735 | var result = data[key];
|
2736 | return result === HASH_UNDEFINED ? undefined : result;
|
2737 | }
|
2738 | return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
|
2739 | }
|
2740 |
|
2741 | |
2742 |
|
2743 |
|
2744 |
|
2745 |
|
2746 |
|
2747 |
|
2748 |
|
2749 |
|
2750 | function hashHas(key) {
|
2751 | var data = this.__data__;
|
2752 | return nativeCreate ? data[key] !== undefined : hasOwnProperty$1.call(data, key);
|
2753 | }
|
2754 |
|
2755 | |
2756 |
|
2757 |
|
2758 |
|
2759 |
|
2760 |
|
2761 |
|
2762 |
|
2763 |
|
2764 |
|
2765 | function hashSet(key, value) {
|
2766 | var data = this.__data__;
|
2767 | data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
2768 | return this;
|
2769 | }
|
2770 |
|
2771 |
|
2772 | Hash.prototype.clear = hashClear;
|
2773 | Hash.prototype['delete'] = hashDelete;
|
2774 | Hash.prototype.get = hashGet;
|
2775 | Hash.prototype.has = hashHas;
|
2776 | Hash.prototype.set = hashSet;
|
2777 |
|
2778 | |
2779 |
|
2780 |
|
2781 |
|
2782 |
|
2783 |
|
2784 |
|
2785 | function ListCache(entries) {
|
2786 | var index = -1,
|
2787 | length = entries ? entries.length : 0;
|
2788 |
|
2789 | this.clear();
|
2790 | while (++index < length) {
|
2791 | var entry = entries[index];
|
2792 | this.set(entry[0], entry[1]);
|
2793 | }
|
2794 | }
|
2795 |
|
2796 | |
2797 |
|
2798 |
|
2799 |
|
2800 |
|
2801 |
|
2802 |
|
2803 | function listCacheClear() {
|
2804 | this.__data__ = [];
|
2805 | }
|
2806 |
|
2807 | |
2808 |
|
2809 |
|
2810 |
|
2811 |
|
2812 |
|
2813 |
|
2814 |
|
2815 |
|
2816 | function listCacheDelete(key) {
|
2817 | var data = this.__data__,
|
2818 | index = assocIndexOf(data, key);
|
2819 |
|
2820 | if (index < 0) {
|
2821 | return false;
|
2822 | }
|
2823 | var lastIndex = data.length - 1;
|
2824 | if (index == lastIndex) {
|
2825 | data.pop();
|
2826 | } else {
|
2827 | splice.call(data, index, 1);
|
2828 | }
|
2829 | return true;
|
2830 | }
|
2831 |
|
2832 | |
2833 |
|
2834 |
|
2835 |
|
2836 |
|
2837 |
|
2838 |
|
2839 |
|
2840 |
|
2841 | function listCacheGet(key) {
|
2842 | var data = this.__data__,
|
2843 | index = assocIndexOf(data, key);
|
2844 |
|
2845 | return index < 0 ? undefined : data[index][1];
|
2846 | }
|
2847 |
|
2848 | |
2849 |
|
2850 |
|
2851 |
|
2852 |
|
2853 |
|
2854 |
|
2855 |
|
2856 |
|
2857 | function listCacheHas(key) {
|
2858 | return assocIndexOf(this.__data__, key) > -1;
|
2859 | }
|
2860 |
|
2861 | |
2862 |
|
2863 |
|
2864 |
|
2865 |
|
2866 |
|
2867 |
|
2868 |
|
2869 |
|
2870 |
|
2871 | function listCacheSet(key, value) {
|
2872 | var data = this.__data__,
|
2873 | index = assocIndexOf(data, key);
|
2874 |
|
2875 | if (index < 0) {
|
2876 | data.push([key, value]);
|
2877 | } else {
|
2878 | data[index][1] = value;
|
2879 | }
|
2880 | return this;
|
2881 | }
|
2882 |
|
2883 |
|
2884 | ListCache.prototype.clear = listCacheClear;
|
2885 | ListCache.prototype['delete'] = listCacheDelete;
|
2886 | ListCache.prototype.get = listCacheGet;
|
2887 | ListCache.prototype.has = listCacheHas;
|
2888 | ListCache.prototype.set = listCacheSet;
|
2889 |
|
2890 | |
2891 |
|
2892 |
|
2893 |
|
2894 |
|
2895 |
|
2896 |
|
2897 | function MapCache(entries) {
|
2898 | var index = -1,
|
2899 | length = entries ? entries.length : 0;
|
2900 |
|
2901 | this.clear();
|
2902 | while (++index < length) {
|
2903 | var entry = entries[index];
|
2904 | this.set(entry[0], entry[1]);
|
2905 | }
|
2906 | }
|
2907 |
|
2908 | |
2909 |
|
2910 |
|
2911 |
|
2912 |
|
2913 |
|
2914 |
|
2915 | function mapCacheClear() {
|
2916 | this.__data__ = {
|
2917 | 'hash': new Hash,
|
2918 | 'map': new (Map$1 || ListCache),
|
2919 | 'string': new Hash
|
2920 | };
|
2921 | }
|
2922 |
|
2923 | |
2924 |
|
2925 |
|
2926 |
|
2927 |
|
2928 |
|
2929 |
|
2930 |
|
2931 |
|
2932 | function mapCacheDelete(key) {
|
2933 | return getMapData(this, key)['delete'](key);
|
2934 | }
|
2935 |
|
2936 | |
2937 |
|
2938 |
|
2939 |
|
2940 |
|
2941 |
|
2942 |
|
2943 |
|
2944 |
|
2945 | function mapCacheGet(key) {
|
2946 | return getMapData(this, key).get(key);
|
2947 | }
|
2948 |
|
2949 | |
2950 |
|
2951 |
|
2952 |
|
2953 |
|
2954 |
|
2955 |
|
2956 |
|
2957 |
|
2958 | function mapCacheHas(key) {
|
2959 | return getMapData(this, key).has(key);
|
2960 | }
|
2961 |
|
2962 | |
2963 |
|
2964 |
|
2965 |
|
2966 |
|
2967 |
|
2968 |
|
2969 |
|
2970 |
|
2971 |
|
2972 | function mapCacheSet(key, value) {
|
2973 | getMapData(this, key).set(key, value);
|
2974 | return this;
|
2975 | }
|
2976 |
|
2977 |
|
2978 | MapCache.prototype.clear = mapCacheClear;
|
2979 | MapCache.prototype['delete'] = mapCacheDelete;
|
2980 | MapCache.prototype.get = mapCacheGet;
|
2981 | MapCache.prototype.has = mapCacheHas;
|
2982 | MapCache.prototype.set = mapCacheSet;
|
2983 |
|
2984 | |
2985 |
|
2986 |
|
2987 |
|
2988 |
|
2989 |
|
2990 |
|
2991 |
|
2992 | function assocIndexOf(array, key) {
|
2993 | var length = array.length;
|
2994 | while (length--) {
|
2995 | if (eq(array[length][0], key)) {
|
2996 | return length;
|
2997 | }
|
2998 | }
|
2999 | return -1;
|
3000 | }
|
3001 |
|
3002 | |
3003 |
|
3004 |
|
3005 |
|
3006 |
|
3007 |
|
3008 |
|
3009 |
|
3010 | function baseIsNative(value) {
|
3011 | if (!isObject$3(value) || isMasked(value)) {
|
3012 | return false;
|
3013 | }
|
3014 | var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
|
3015 | return pattern.test(toSource(value));
|
3016 | }
|
3017 |
|
3018 | |
3019 |
|
3020 |
|
3021 |
|
3022 |
|
3023 |
|
3024 |
|
3025 |
|
3026 | function getMapData(map, key) {
|
3027 | var data = map.__data__;
|
3028 | return isKeyable(key)
|
3029 | ? data[typeof key == 'string' ? 'string' : 'hash']
|
3030 | : data.map;
|
3031 | }
|
3032 |
|
3033 | |
3034 |
|
3035 |
|
3036 |
|
3037 |
|
3038 |
|
3039 |
|
3040 |
|
3041 | function getNative(object, key) {
|
3042 | var value = getValue(object, key);
|
3043 | return baseIsNative(value) ? value : undefined;
|
3044 | }
|
3045 |
|
3046 | |
3047 |
|
3048 |
|
3049 |
|
3050 |
|
3051 |
|
3052 |
|
3053 | function isKeyable(value) {
|
3054 | var type = typeof value;
|
3055 | return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
3056 | ? (value !== '__proto__')
|
3057 | : (value === null);
|
3058 | }
|
3059 |
|
3060 | |
3061 |
|
3062 |
|
3063 |
|
3064 |
|
3065 |
|
3066 |
|
3067 | function isMasked(func) {
|
3068 | return !!maskSrcKey && (maskSrcKey in func);
|
3069 | }
|
3070 |
|
3071 | |
3072 |
|
3073 |
|
3074 |
|
3075 |
|
3076 |
|
3077 |
|
3078 | function toSource(func) {
|
3079 | if (func != null) {
|
3080 | try {
|
3081 | return funcToString.call(func);
|
3082 | } catch (e) {}
|
3083 | try {
|
3084 | return (func + '');
|
3085 | } catch (e) {}
|
3086 | }
|
3087 | return '';
|
3088 | }
|
3089 |
|
3090 | |
3091 |
|
3092 |
|
3093 |
|
3094 |
|
3095 |
|
3096 |
|
3097 |
|
3098 |
|
3099 |
|
3100 |
|
3101 |
|
3102 |
|
3103 |
|
3104 |
|
3105 |
|
3106 |
|
3107 |
|
3108 |
|
3109 |
|
3110 |
|
3111 |
|
3112 |
|
3113 |
|
3114 |
|
3115 |
|
3116 |
|
3117 |
|
3118 |
|
3119 |
|
3120 |
|
3121 |
|
3122 |
|
3123 |
|
3124 |
|
3125 |
|
3126 |
|
3127 |
|
3128 |
|
3129 |
|
3130 |
|
3131 |
|
3132 |
|
3133 |
|
3134 | function memoize(func, resolver) {
|
3135 | if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
|
3136 | throw new TypeError(FUNC_ERROR_TEXT$2);
|
3137 | }
|
3138 | var memoized = function() {
|
3139 | var args = arguments,
|
3140 | key = resolver ? resolver.apply(this, args) : args[0],
|
3141 | cache = memoized.cache;
|
3142 |
|
3143 | if (cache.has(key)) {
|
3144 | return cache.get(key);
|
3145 | }
|
3146 | var result = func.apply(this, args);
|
3147 | memoized.cache = cache.set(key, result);
|
3148 | return result;
|
3149 | };
|
3150 | memoized.cache = new (memoize.Cache || MapCache);
|
3151 | return memoized;
|
3152 | }
|
3153 |
|
3154 |
|
3155 | memoize.Cache = MapCache;
|
3156 |
|
3157 | |
3158 |
|
3159 |
|
3160 |
|
3161 |
|
3162 |
|
3163 |
|
3164 |
|
3165 |
|
3166 |
|
3167 |
|
3168 |
|
3169 |
|
3170 |
|
3171 |
|
3172 |
|
3173 |
|
3174 |
|
3175 |
|
3176 |
|
3177 |
|
3178 |
|
3179 |
|
3180 |
|
3181 |
|
3182 |
|
3183 |
|
3184 |
|
3185 |
|
3186 |
|
3187 |
|
3188 |
|
3189 | function eq(value, other) {
|
3190 | return value === other || (value !== value && other !== other);
|
3191 | }
|
3192 |
|
3193 | |
3194 |
|
3195 |
|
3196 |
|
3197 |
|
3198 |
|
3199 |
|
3200 |
|
3201 |
|
3202 |
|
3203 |
|
3204 |
|
3205 |
|
3206 |
|
3207 |
|
3208 |
|
3209 |
|
3210 | function isFunction(value) {
|
3211 |
|
3212 |
|
3213 | var tag = isObject$3(value) ? objectToString$3.call(value) : '';
|
3214 | return tag == funcTag || tag == genTag;
|
3215 | }
|
3216 |
|
3217 | |
3218 |
|
3219 |
|
3220 |
|
3221 |
|
3222 |
|
3223 |
|
3224 |
|
3225 |
|
3226 |
|
3227 |
|
3228 |
|
3229 |
|
3230 |
|
3231 |
|
3232 |
|
3233 |
|
3234 |
|
3235 |
|
3236 |
|
3237 |
|
3238 |
|
3239 |
|
3240 |
|
3241 |
|
3242 | function isObject$3(value) {
|
3243 | var type = typeof value;
|
3244 | return !!value && (type == 'object' || type == 'function');
|
3245 | }
|
3246 |
|
3247 | var lodash_memoize = memoize;
|
3248 |
|
3249 | |
3250 |
|
3251 |
|
3252 |
|
3253 |
|
3254 |
|
3255 |
|
3256 | var MapShim = (function () {
|
3257 | if (typeof Map !== 'undefined') {
|
3258 | return Map;
|
3259 | }
|
3260 | |
3261 |
|
3262 |
|
3263 |
|
3264 |
|
3265 |
|
3266 |
|
3267 | function getIndex(arr, key) {
|
3268 | var result = -1;
|
3269 | arr.some(function (entry, index) {
|
3270 | if (entry[0] === key) {
|
3271 | result = index;
|
3272 | return true;
|
3273 | }
|
3274 | return false;
|
3275 | });
|
3276 | return result;
|
3277 | }
|
3278 | return (function () {
|
3279 | function class_1() {
|
3280 | this.__entries__ = [];
|
3281 | }
|
3282 | Object.defineProperty(class_1.prototype, "size", {
|
3283 | |
3284 |
|
3285 |
|
3286 | get: function () {
|
3287 | return this.__entries__.length;
|
3288 | },
|
3289 | enumerable: true,
|
3290 | configurable: true
|
3291 | });
|
3292 | |
3293 |
|
3294 |
|
3295 |
|
3296 | class_1.prototype.get = function (key) {
|
3297 | var index = getIndex(this.__entries__, key);
|
3298 | var entry = this.__entries__[index];
|
3299 | return entry && entry[1];
|
3300 | };
|
3301 | |
3302 |
|
3303 |
|
3304 |
|
3305 |
|
3306 | class_1.prototype.set = function (key, value) {
|
3307 | var index = getIndex(this.__entries__, key);
|
3308 | if (~index) {
|
3309 | this.__entries__[index][1] = value;
|
3310 | }
|
3311 | else {
|
3312 | this.__entries__.push([key, value]);
|
3313 | }
|
3314 | };
|
3315 | |
3316 |
|
3317 |
|
3318 |
|
3319 | class_1.prototype.delete = function (key) {
|
3320 | var entries = this.__entries__;
|
3321 | var index = getIndex(entries, key);
|
3322 | if (~index) {
|
3323 | entries.splice(index, 1);
|
3324 | }
|
3325 | };
|
3326 | |
3327 |
|
3328 |
|
3329 |
|
3330 | class_1.prototype.has = function (key) {
|
3331 | return !!~getIndex(this.__entries__, key);
|
3332 | };
|
3333 | |
3334 |
|
3335 |
|
3336 | class_1.prototype.clear = function () {
|
3337 | this.__entries__.splice(0);
|
3338 | };
|
3339 | |
3340 |
|
3341 |
|
3342 |
|
3343 |
|
3344 | class_1.prototype.forEach = function (callback, ctx) {
|
3345 | if (ctx === void 0) { ctx = null; }
|
3346 | for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
|
3347 | var entry = _a[_i];
|
3348 | callback.call(ctx, entry[1], entry[0]);
|
3349 | }
|
3350 | };
|
3351 | return class_1;
|
3352 | }());
|
3353 | })();
|
3354 |
|
3355 | |
3356 |
|
3357 |
|
3358 | var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
|
3359 |
|
3360 |
|
3361 | var global$1 = (function () {
|
3362 | if (typeof global !== 'undefined' && global.Math === Math) {
|
3363 | return global;
|
3364 | }
|
3365 | if (typeof self !== 'undefined' && self.Math === Math) {
|
3366 | return self;
|
3367 | }
|
3368 | if (typeof window !== 'undefined' && window.Math === Math) {
|
3369 | return window;
|
3370 | }
|
3371 |
|
3372 | return Function('return this')();
|
3373 | })();
|
3374 |
|
3375 | |
3376 |
|
3377 |
|
3378 |
|
3379 |
|
3380 |
|
3381 | var requestAnimationFrame$1 = (function () {
|
3382 | if (typeof requestAnimationFrame === 'function') {
|
3383 |
|
3384 |
|
3385 |
|
3386 | return requestAnimationFrame.bind(global$1);
|
3387 | }
|
3388 | return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
|
3389 | })();
|
3390 |
|
3391 |
|
3392 | var trailingTimeout = 2;
|
3393 | |
3394 |
|
3395 |
|
3396 |
|
3397 |
|
3398 |
|
3399 |
|
3400 |
|
3401 | function throttle$1 (callback, delay) {
|
3402 | var leadingCall = false, trailingCall = false, lastCallTime = 0;
|
3403 | |
3404 |
|
3405 |
|
3406 |
|
3407 |
|
3408 |
|
3409 | function resolvePending() {
|
3410 | if (leadingCall) {
|
3411 | leadingCall = false;
|
3412 | callback();
|
3413 | }
|
3414 | if (trailingCall) {
|
3415 | proxy();
|
3416 | }
|
3417 | }
|
3418 | |
3419 |
|
3420 |
|
3421 |
|
3422 |
|
3423 |
|
3424 |
|
3425 | function timeoutCallback() {
|
3426 | requestAnimationFrame$1(resolvePending);
|
3427 | }
|
3428 | |
3429 |
|
3430 |
|
3431 |
|
3432 |
|
3433 | function proxy() {
|
3434 | var timeStamp = Date.now();
|
3435 | if (leadingCall) {
|
3436 |
|
3437 | if (timeStamp - lastCallTime < trailingTimeout) {
|
3438 | return;
|
3439 | }
|
3440 |
|
3441 |
|
3442 |
|
3443 |
|
3444 | trailingCall = true;
|
3445 | }
|
3446 | else {
|
3447 | leadingCall = true;
|
3448 | trailingCall = false;
|
3449 | setTimeout(timeoutCallback, delay);
|
3450 | }
|
3451 | lastCallTime = timeStamp;
|
3452 | }
|
3453 | return proxy;
|
3454 | }
|
3455 |
|
3456 |
|
3457 | var REFRESH_DELAY = 20;
|
3458 |
|
3459 |
|
3460 | var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
|
3461 |
|
3462 | var mutationObserverSupported = typeof MutationObserver !== 'undefined';
|
3463 | |
3464 |
|
3465 |
|
3466 | var ResizeObserverController = (function () {
|
3467 | |
3468 |
|
3469 |
|
3470 |
|
3471 |
|
3472 | function ResizeObserverController() {
|
3473 | |
3474 |
|
3475 |
|
3476 |
|
3477 |
|
3478 | this.connected_ = false;
|
3479 | |
3480 |
|
3481 |
|
3482 |
|
3483 |
|
3484 | this.mutationEventsAdded_ = false;
|
3485 | |
3486 |
|
3487 |
|
3488 |
|
3489 |
|
3490 | this.mutationsObserver_ = null;
|
3491 | |
3492 |
|
3493 |
|
3494 |
|
3495 |
|
3496 | this.observers_ = [];
|
3497 | this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
|
3498 | this.refresh = throttle$1(this.refresh.bind(this), REFRESH_DELAY);
|
3499 | }
|
3500 | |
3501 |
|
3502 |
|
3503 |
|
3504 |
|
3505 |
|
3506 | ResizeObserverController.prototype.addObserver = function (observer) {
|
3507 | if (!~this.observers_.indexOf(observer)) {
|
3508 | this.observers_.push(observer);
|
3509 | }
|
3510 |
|
3511 | if (!this.connected_) {
|
3512 | this.connect_();
|
3513 | }
|
3514 | };
|
3515 | |
3516 |
|
3517 |
|
3518 |
|
3519 |
|
3520 |
|
3521 | ResizeObserverController.prototype.removeObserver = function (observer) {
|
3522 | var observers = this.observers_;
|
3523 | var index = observers.indexOf(observer);
|
3524 |
|
3525 | if (~index) {
|
3526 | observers.splice(index, 1);
|
3527 | }
|
3528 |
|
3529 | if (!observers.length && this.connected_) {
|
3530 | this.disconnect_();
|
3531 | }
|
3532 | };
|
3533 | |
3534 |
|
3535 |
|
3536 |
|
3537 |
|
3538 |
|
3539 | ResizeObserverController.prototype.refresh = function () {
|
3540 | var changesDetected = this.updateObservers_();
|
3541 |
|
3542 |
|
3543 | if (changesDetected) {
|
3544 | this.refresh();
|
3545 | }
|
3546 | };
|
3547 | |
3548 |
|
3549 |
|
3550 |
|
3551 |
|
3552 |
|
3553 |
|
3554 |
|
3555 | ResizeObserverController.prototype.updateObservers_ = function () {
|
3556 |
|
3557 | var activeObservers = this.observers_.filter(function (observer) {
|
3558 | return observer.gatherActive(), observer.hasActive();
|
3559 | });
|
3560 |
|
3561 |
|
3562 |
|
3563 |
|
3564 |
|
3565 | activeObservers.forEach(function (observer) { return observer.broadcastActive(); });
|
3566 | return activeObservers.length > 0;
|
3567 | };
|
3568 | |
3569 |
|
3570 |
|
3571 |
|
3572 |
|
3573 |
|
3574 | ResizeObserverController.prototype.connect_ = function () {
|
3575 |
|
3576 |
|
3577 | if (!isBrowser || this.connected_) {
|
3578 | return;
|
3579 | }
|
3580 |
|
3581 |
|
3582 |
|
3583 | document.addEventListener('transitionend', this.onTransitionEnd_);
|
3584 | window.addEventListener('resize', this.refresh);
|
3585 | if (mutationObserverSupported) {
|
3586 | this.mutationsObserver_ = new MutationObserver(this.refresh);
|
3587 | this.mutationsObserver_.observe(document, {
|
3588 | attributes: true,
|
3589 | childList: true,
|
3590 | characterData: true,
|
3591 | subtree: true
|
3592 | });
|
3593 | }
|
3594 | else {
|
3595 | document.addEventListener('DOMSubtreeModified', this.refresh);
|
3596 | this.mutationEventsAdded_ = true;
|
3597 | }
|
3598 | this.connected_ = true;
|
3599 | };
|
3600 | |
3601 |
|
3602 |
|
3603 |
|
3604 |
|
3605 |
|
3606 | ResizeObserverController.prototype.disconnect_ = function () {
|
3607 |
|
3608 |
|
3609 | if (!isBrowser || !this.connected_) {
|
3610 | return;
|
3611 | }
|
3612 | document.removeEventListener('transitionend', this.onTransitionEnd_);
|
3613 | window.removeEventListener('resize', this.refresh);
|
3614 | if (this.mutationsObserver_) {
|
3615 | this.mutationsObserver_.disconnect();
|
3616 | }
|
3617 | if (this.mutationEventsAdded_) {
|
3618 | document.removeEventListener('DOMSubtreeModified', this.refresh);
|
3619 | }
|
3620 | this.mutationsObserver_ = null;
|
3621 | this.mutationEventsAdded_ = false;
|
3622 | this.connected_ = false;
|
3623 | };
|
3624 | |
3625 |
|
3626 |
|
3627 |
|
3628 |
|
3629 |
|
3630 |
|
3631 | ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {
|
3632 | var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;
|
3633 |
|
3634 | var isReflowProperty = transitionKeys.some(function (key) {
|
3635 | return !!~propertyName.indexOf(key);
|
3636 | });
|
3637 | if (isReflowProperty) {
|
3638 | this.refresh();
|
3639 | }
|
3640 | };
|
3641 | |
3642 |
|
3643 |
|
3644 |
|
3645 |
|
3646 | ResizeObserverController.getInstance = function () {
|
3647 | if (!this.instance_) {
|
3648 | this.instance_ = new ResizeObserverController();
|
3649 | }
|
3650 | return this.instance_;
|
3651 | };
|
3652 | |
3653 |
|
3654 |
|
3655 |
|
3656 |
|
3657 | ResizeObserverController.instance_ = null;
|
3658 | return ResizeObserverController;
|
3659 | }());
|
3660 |
|
3661 | |
3662 |
|
3663 |
|
3664 |
|
3665 |
|
3666 |
|
3667 |
|
3668 | var defineConfigurable = (function (target, props) {
|
3669 | for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
|
3670 | var key = _a[_i];
|
3671 | Object.defineProperty(target, key, {
|
3672 | value: props[key],
|
3673 | enumerable: false,
|
3674 | writable: false,
|
3675 | configurable: true
|
3676 | });
|
3677 | }
|
3678 | return target;
|
3679 | });
|
3680 |
|
3681 | |
3682 |
|
3683 |
|
3684 |
|
3685 |
|
3686 |
|
3687 | var getWindowOf = (function (target) {
|
3688 |
|
3689 |
|
3690 |
|
3691 | var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
|
3692 |
|
3693 |
|
3694 | return ownerGlobal || global$1;
|
3695 | });
|
3696 |
|
3697 |
|
3698 | var emptyRect = createRectInit(0, 0, 0, 0);
|
3699 | |
3700 |
|
3701 |
|
3702 |
|
3703 |
|
3704 |
|
3705 | function toFloat(value) {
|
3706 | return parseFloat(value) || 0;
|
3707 | }
|
3708 | |
3709 |
|
3710 |
|
3711 |
|
3712 |
|
3713 |
|
3714 |
|
3715 | function getBordersSize(styles) {
|
3716 | var positions = [];
|
3717 | for (var _i = 1; _i < arguments.length; _i++) {
|
3718 | positions[_i - 1] = arguments[_i];
|
3719 | }
|
3720 | return positions.reduce(function (size, position) {
|
3721 | var value = styles['border-' + position + '-width'];
|
3722 | return size + toFloat(value);
|
3723 | }, 0);
|
3724 | }
|
3725 | |
3726 |
|
3727 |
|
3728 |
|
3729 |
|
3730 |
|
3731 | function getPaddings(styles) {
|
3732 | var positions = ['top', 'right', 'bottom', 'left'];
|
3733 | var paddings = {};
|
3734 | for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
|
3735 | var position = positions_1[_i];
|
3736 | var value = styles['padding-' + position];
|
3737 | paddings[position] = toFloat(value);
|
3738 | }
|
3739 | return paddings;
|
3740 | }
|
3741 | |
3742 |
|
3743 |
|
3744 |
|
3745 |
|
3746 |
|
3747 |
|
3748 | function getSVGContentRect(target) {
|
3749 | var bbox = target.getBBox();
|
3750 | return createRectInit(0, 0, bbox.width, bbox.height);
|
3751 | }
|
3752 | |
3753 |
|
3754 |
|
3755 |
|
3756 |
|
3757 |
|
3758 | function getHTMLElementContentRect(target) {
|
3759 |
|
3760 |
|
3761 | var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
|
3762 |
|
3763 |
|
3764 |
|
3765 |
|
3766 |
|
3767 |
|
3768 |
|
3769 |
|
3770 | if (!clientWidth && !clientHeight) {
|
3771 | return emptyRect;
|
3772 | }
|
3773 | var styles = getWindowOf(target).getComputedStyle(target);
|
3774 | var paddings = getPaddings(styles);
|
3775 | var horizPad = paddings.left + paddings.right;
|
3776 | var vertPad = paddings.top + paddings.bottom;
|
3777 |
|
3778 |
|
3779 |
|
3780 |
|
3781 | var width = toFloat(styles.width), height = toFloat(styles.height);
|
3782 |
|
3783 |
|
3784 | if (styles.boxSizing === 'border-box') {
|
3785 |
|
3786 |
|
3787 |
|
3788 |
|
3789 |
|
3790 |
|
3791 | if (Math.round(width + horizPad) !== clientWidth) {
|
3792 | width -= getBordersSize(styles, 'left', 'right') + horizPad;
|
3793 | }
|
3794 | if (Math.round(height + vertPad) !== clientHeight) {
|
3795 | height -= getBordersSize(styles, 'top', 'bottom') + vertPad;
|
3796 | }
|
3797 | }
|
3798 |
|
3799 |
|
3800 |
|
3801 |
|
3802 | if (!isDocumentElement(target)) {
|
3803 |
|
3804 |
|
3805 |
|
3806 |
|
3807 | var vertScrollbar = Math.round(width + horizPad) - clientWidth;
|
3808 | var horizScrollbar = Math.round(height + vertPad) - clientHeight;
|
3809 |
|
3810 |
|
3811 |
|
3812 |
|
3813 |
|
3814 | if (Math.abs(vertScrollbar) !== 1) {
|
3815 | width -= vertScrollbar;
|
3816 | }
|
3817 | if (Math.abs(horizScrollbar) !== 1) {
|
3818 | height -= horizScrollbar;
|
3819 | }
|
3820 | }
|
3821 | return createRectInit(paddings.left, paddings.top, width, height);
|
3822 | }
|
3823 | |
3824 |
|
3825 |
|
3826 |
|
3827 |
|
3828 |
|
3829 | var isSVGGraphicsElement = (function () {
|
3830 |
|
3831 |
|
3832 | if (typeof SVGGraphicsElement !== 'undefined') {
|
3833 | return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };
|
3834 | }
|
3835 |
|
3836 |
|
3837 |
|
3838 | return function (target) { return (target instanceof getWindowOf(target).SVGElement &&
|
3839 | typeof target.getBBox === 'function'); };
|
3840 | })();
|
3841 | |
3842 |
|
3843 |
|
3844 |
|
3845 |
|
3846 |
|
3847 | function isDocumentElement(target) {
|
3848 | return target === getWindowOf(target).document.documentElement;
|
3849 | }
|
3850 | |
3851 |
|
3852 |
|
3853 |
|
3854 |
|
3855 |
|
3856 | function getContentRect(target) {
|
3857 | if (!isBrowser) {
|
3858 | return emptyRect;
|
3859 | }
|
3860 | if (isSVGGraphicsElement(target)) {
|
3861 | return getSVGContentRect(target);
|
3862 | }
|
3863 | return getHTMLElementContentRect(target);
|
3864 | }
|
3865 | |
3866 |
|
3867 |
|
3868 |
|
3869 |
|
3870 |
|
3871 |
|
3872 | function createReadOnlyRect(_a) {
|
3873 | var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
|
3874 |
|
3875 | var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;
|
3876 | var rect = Object.create(Constr.prototype);
|
3877 |
|
3878 | defineConfigurable(rect, {
|
3879 | x: x, y: y, width: width, height: height,
|
3880 | top: y,
|
3881 | right: x + width,
|
3882 | bottom: height + y,
|
3883 | left: x
|
3884 | });
|
3885 | return rect;
|
3886 | }
|
3887 | |
3888 |
|
3889 |
|
3890 |
|
3891 |
|
3892 |
|
3893 |
|
3894 |
|
3895 |
|
3896 |
|
3897 | function createRectInit(x, y, width, height) {
|
3898 | return { x: x, y: y, width: width, height: height };
|
3899 | }
|
3900 |
|
3901 | |
3902 |
|
3903 |
|
3904 |
|
3905 | var ResizeObservation = (function () {
|
3906 | |
3907 |
|
3908 |
|
3909 |
|
3910 |
|
3911 | function ResizeObservation(target) {
|
3912 | |
3913 |
|
3914 |
|
3915 |
|
3916 |
|
3917 | this.broadcastWidth = 0;
|
3918 | |
3919 |
|
3920 |
|
3921 |
|
3922 |
|
3923 | this.broadcastHeight = 0;
|
3924 | |
3925 |
|
3926 |
|
3927 |
|
3928 |
|
3929 | this.contentRect_ = createRectInit(0, 0, 0, 0);
|
3930 | this.target = target;
|
3931 | }
|
3932 | |
3933 |
|
3934 |
|
3935 |
|
3936 |
|
3937 |
|
3938 | ResizeObservation.prototype.isActive = function () {
|
3939 | var rect = getContentRect(this.target);
|
3940 | this.contentRect_ = rect;
|
3941 | return (rect.width !== this.broadcastWidth ||
|
3942 | rect.height !== this.broadcastHeight);
|
3943 | };
|
3944 | |
3945 |
|
3946 |
|
3947 |
|
3948 |
|
3949 |
|
3950 | ResizeObservation.prototype.broadcastRect = function () {
|
3951 | var rect = this.contentRect_;
|
3952 | this.broadcastWidth = rect.width;
|
3953 | this.broadcastHeight = rect.height;
|
3954 | return rect;
|
3955 | };
|
3956 | return ResizeObservation;
|
3957 | }());
|
3958 |
|
3959 | var ResizeObserverEntry = (function () {
|
3960 | |
3961 |
|
3962 |
|
3963 |
|
3964 |
|
3965 |
|
3966 | function ResizeObserverEntry(target, rectInit) {
|
3967 | var contentRect = createReadOnlyRect(rectInit);
|
3968 |
|
3969 |
|
3970 |
|
3971 |
|
3972 |
|
3973 |
|
3974 | defineConfigurable(this, { target: target, contentRect: contentRect });
|
3975 | }
|
3976 | return ResizeObserverEntry;
|
3977 | }());
|
3978 |
|
3979 | var ResizeObserverSPI = (function () {
|
3980 | |
3981 |
|
3982 |
|
3983 |
|
3984 |
|
3985 |
|
3986 |
|
3987 |
|
3988 |
|
3989 |
|
3990 | function ResizeObserverSPI(callback, controller, callbackCtx) {
|
3991 | |
3992 |
|
3993 |
|
3994 |
|
3995 |
|
3996 |
|
3997 | this.activeObservations_ = [];
|
3998 | |
3999 |
|
4000 |
|
4001 |
|
4002 |
|
4003 | this.observations_ = new MapShim();
|
4004 | if (typeof callback !== 'function') {
|
4005 | throw new TypeError('The callback provided as parameter 1 is not a function.');
|
4006 | }
|
4007 | this.callback_ = callback;
|
4008 | this.controller_ = controller;
|
4009 | this.callbackCtx_ = callbackCtx;
|
4010 | }
|
4011 | |
4012 |
|
4013 |
|
4014 |
|
4015 |
|
4016 |
|
4017 | ResizeObserverSPI.prototype.observe = function (target) {
|
4018 | if (!arguments.length) {
|
4019 | throw new TypeError('1 argument required, but only 0 present.');
|
4020 | }
|
4021 |
|
4022 | if (typeof Element === 'undefined' || !(Element instanceof Object)) {
|
4023 | return;
|
4024 | }
|
4025 | if (!(target instanceof getWindowOf(target).Element)) {
|
4026 | throw new TypeError('parameter 1 is not of type "Element".');
|
4027 | }
|
4028 | var observations = this.observations_;
|
4029 |
|
4030 | if (observations.has(target)) {
|
4031 | return;
|
4032 | }
|
4033 | observations.set(target, new ResizeObservation(target));
|
4034 | this.controller_.addObserver(this);
|
4035 |
|
4036 | this.controller_.refresh();
|
4037 | };
|
4038 | |
4039 |
|
4040 |
|
4041 |
|
4042 |
|
4043 |
|
4044 | ResizeObserverSPI.prototype.unobserve = function (target) {
|
4045 | if (!arguments.length) {
|
4046 | throw new TypeError('1 argument required, but only 0 present.');
|
4047 | }
|
4048 |
|
4049 | if (typeof Element === 'undefined' || !(Element instanceof Object)) {
|
4050 | return;
|
4051 | }
|
4052 | if (!(target instanceof getWindowOf(target).Element)) {
|
4053 | throw new TypeError('parameter 1 is not of type "Element".');
|
4054 | }
|
4055 | var observations = this.observations_;
|
4056 |
|
4057 | if (!observations.has(target)) {
|
4058 | return;
|
4059 | }
|
4060 | observations.delete(target);
|
4061 | if (!observations.size) {
|
4062 | this.controller_.removeObserver(this);
|
4063 | }
|
4064 | };
|
4065 | |
4066 |
|
4067 |
|
4068 |
|
4069 |
|
4070 | ResizeObserverSPI.prototype.disconnect = function () {
|
4071 | this.clearActive();
|
4072 | this.observations_.clear();
|
4073 | this.controller_.removeObserver(this);
|
4074 | };
|
4075 | |
4076 |
|
4077 |
|
4078 |
|
4079 |
|
4080 |
|
4081 | ResizeObserverSPI.prototype.gatherActive = function () {
|
4082 | var _this = this;
|
4083 | this.clearActive();
|
4084 | this.observations_.forEach(function (observation) {
|
4085 | if (observation.isActive()) {
|
4086 | _this.activeObservations_.push(observation);
|
4087 | }
|
4088 | });
|
4089 | };
|
4090 | |
4091 |
|
4092 |
|
4093 |
|
4094 |
|
4095 |
|
4096 | ResizeObserverSPI.prototype.broadcastActive = function () {
|
4097 |
|
4098 | if (!this.hasActive()) {
|
4099 | return;
|
4100 | }
|
4101 | var ctx = this.callbackCtx_;
|
4102 |
|
4103 | var entries = this.activeObservations_.map(function (observation) {
|
4104 | return new ResizeObserverEntry(observation.target, observation.broadcastRect());
|
4105 | });
|
4106 | this.callback_.call(ctx, entries, ctx);
|
4107 | this.clearActive();
|
4108 | };
|
4109 | |
4110 |
|
4111 |
|
4112 |
|
4113 |
|
4114 | ResizeObserverSPI.prototype.clearActive = function () {
|
4115 | this.activeObservations_.splice(0);
|
4116 | };
|
4117 | |
4118 |
|
4119 |
|
4120 |
|
4121 |
|
4122 | ResizeObserverSPI.prototype.hasActive = function () {
|
4123 | return this.activeObservations_.length > 0;
|
4124 | };
|
4125 | return ResizeObserverSPI;
|
4126 | }());
|
4127 |
|
4128 |
|
4129 |
|
4130 |
|
4131 | var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();
|
4132 | |
4133 |
|
4134 |
|
4135 |
|
4136 | var ResizeObserver = (function () {
|
4137 | |
4138 |
|
4139 |
|
4140 |
|
4141 |
|
4142 |
|
4143 | function ResizeObserver(callback) {
|
4144 | if (!(this instanceof ResizeObserver)) {
|
4145 | throw new TypeError('Cannot call a class as a function.');
|
4146 | }
|
4147 | if (!arguments.length) {
|
4148 | throw new TypeError('1 argument required, but only 0 present.');
|
4149 | }
|
4150 | var controller = ResizeObserverController.getInstance();
|
4151 | var observer = new ResizeObserverSPI(callback, controller, this);
|
4152 | observers.set(this, observer);
|
4153 | }
|
4154 | return ResizeObserver;
|
4155 | }());
|
4156 |
|
4157 | [
|
4158 | 'observe',
|
4159 | 'unobserve',
|
4160 | 'disconnect'
|
4161 | ].forEach(function (method) {
|
4162 | ResizeObserver.prototype[method] = function () {
|
4163 | var _a;
|
4164 | return (_a = observers.get(this))[method].apply(_a, arguments);
|
4165 | };
|
4166 | });
|
4167 |
|
4168 | var index = (function () {
|
4169 |
|
4170 | if (typeof global$1.ResizeObserver !== 'undefined') {
|
4171 | return global$1.ResizeObserver;
|
4172 | }
|
4173 | return ResizeObserver;
|
4174 | })();
|
4175 |
|
4176 | var cachedScrollbarWidth = null;
|
4177 | var cachedDevicePixelRatio = null;
|
4178 |
|
4179 | if (canUseDom) {
|
4180 | window.addEventListener('resize', function () {
|
4181 | if (cachedDevicePixelRatio !== window.devicePixelRatio) {
|
4182 | cachedDevicePixelRatio = window.devicePixelRatio;
|
4183 | cachedScrollbarWidth = null;
|
4184 | }
|
4185 | });
|
4186 | }
|
4187 |
|
4188 | function scrollbarWidth() {
|
4189 | if (cachedScrollbarWidth === null) {
|
4190 | if (typeof document === 'undefined') {
|
4191 | cachedScrollbarWidth = 0;
|
4192 | return cachedScrollbarWidth;
|
4193 | }
|
4194 |
|
4195 | var body = document.body;
|
4196 | var box = document.createElement('div');
|
4197 | box.classList.add('simplebar-hide-scrollbar');
|
4198 | body.appendChild(box);
|
4199 | var width = box.getBoundingClientRect().right;
|
4200 | body.removeChild(box);
|
4201 | cachedScrollbarWidth = width;
|
4202 | }
|
4203 |
|
4204 | return cachedScrollbarWidth;
|
4205 | }
|
4206 |
|
4207 |
|
4208 | var createMethod$4 = function (IS_RIGHT) {
|
4209 | return function (that, callbackfn, argumentsLength, memo) {
|
4210 | aFunction$1(callbackfn);
|
4211 | var O = toObject(that);
|
4212 | var self = indexedObject(O);
|
4213 | var length = toLength(O.length);
|
4214 | var index = IS_RIGHT ? length - 1 : 0;
|
4215 | var i = IS_RIGHT ? -1 : 1;
|
4216 | if (argumentsLength < 2) while (true) {
|
4217 | if (index in self) {
|
4218 | memo = self[index];
|
4219 | index += i;
|
4220 | break;
|
4221 | }
|
4222 | index += i;
|
4223 | if (IS_RIGHT ? index < 0 : length <= index) {
|
4224 | throw TypeError('Reduce of empty array with no initial value');
|
4225 | }
|
4226 | }
|
4227 | for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
|
4228 | memo = callbackfn(memo, self[index], index, O);
|
4229 | }
|
4230 | return memo;
|
4231 | };
|
4232 | };
|
4233 |
|
4234 | var arrayReduce = {
|
4235 |
|
4236 |
|
4237 | left: createMethod$4(false),
|
4238 |
|
4239 |
|
4240 | right: createMethod$4(true)
|
4241 | };
|
4242 |
|
4243 | var $reduce = arrayReduce.left;
|
4244 |
|
4245 |
|
4246 |
|
4247 |
|
4248 | _export({ target: 'Array', proto: true, forced: sloppyArrayMethod('reduce') }, {
|
4249 | reduce: function reduce(callbackfn /* , initialValue */) {
|
4250 | return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
|
4251 | }
|
4252 | });
|
4253 |
|
4254 | var defineProperty$1 = objectDefineProperty.f;
|
4255 |
|
4256 | var FunctionPrototype = Function.prototype;
|
4257 | var FunctionPrototypeToString = FunctionPrototype.toString;
|
4258 | var nameRE = /^\s*function ([^ (]*)/;
|
4259 | var NAME = 'name';
|
4260 |
|
4261 |
|
4262 |
|
4263 | if (descriptors && !(NAME in FunctionPrototype)) {
|
4264 | defineProperty$1(FunctionPrototype, NAME, {
|
4265 | configurable: true,
|
4266 | get: function () {
|
4267 | try {
|
4268 | return FunctionPrototypeToString.call(this).match(nameRE)[1];
|
4269 | } catch (error) {
|
4270 | return '';
|
4271 | }
|
4272 | }
|
4273 | });
|
4274 | }
|
4275 |
|
4276 |
|
4277 |
|
4278 | var regexpFlags = function () {
|
4279 | var that = anObject(this);
|
4280 | var result = '';
|
4281 | if (that.global) result += 'g';
|
4282 | if (that.ignoreCase) result += 'i';
|
4283 | if (that.multiline) result += 'm';
|
4284 | if (that.dotAll) result += 's';
|
4285 | if (that.unicode) result += 'u';
|
4286 | if (that.sticky) result += 'y';
|
4287 | return result;
|
4288 | };
|
4289 |
|
4290 | var nativeExec = RegExp.prototype.exec;
|
4291 |
|
4292 |
|
4293 |
|
4294 | var nativeReplace = String.prototype.replace;
|
4295 |
|
4296 | var patchedExec = nativeExec;
|
4297 |
|
4298 | var UPDATES_LAST_INDEX_WRONG = (function () {
|
4299 | var re1 = /a/;
|
4300 | var re2 = /b*/g;
|
4301 | nativeExec.call(re1, 'a');
|
4302 | nativeExec.call(re2, 'a');
|
4303 | return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
4304 | })();
|
4305 |
|
4306 |
|
4307 | var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
4308 |
|
4309 | var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
|
4310 |
|
4311 | if (PATCH) {
|
4312 | patchedExec = function exec(str) {
|
4313 | var re = this;
|
4314 | var lastIndex, reCopy, match, i;
|
4315 |
|
4316 | if (NPCG_INCLUDED) {
|
4317 | reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
|
4318 | }
|
4319 | if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
4320 |
|
4321 | match = nativeExec.call(re, str);
|
4322 |
|
4323 | if (UPDATES_LAST_INDEX_WRONG && match) {
|
4324 | re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
4325 | }
|
4326 | if (NPCG_INCLUDED && match && match.length > 1) {
|
4327 |
|
4328 |
|
4329 | nativeReplace.call(match[0], reCopy, function () {
|
4330 | for (i = 1; i < arguments.length - 2; i++) {
|
4331 | if (arguments[i] === undefined) match[i] = undefined;
|
4332 | }
|
4333 | });
|
4334 | }
|
4335 |
|
4336 | return match;
|
4337 | };
|
4338 | }
|
4339 |
|
4340 | var regexpExec = patchedExec;
|
4341 |
|
4342 | _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
|
4343 | exec: regexpExec
|
4344 | });
|
4345 |
|
4346 | var SPECIES$2 = wellKnownSymbol('species');
|
4347 |
|
4348 | var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
4349 |
|
4350 |
|
4351 |
|
4352 | var re = /./;
|
4353 | re.exec = function () {
|
4354 | var result = [];
|
4355 | result.groups = { a: '7' };
|
4356 | return result;
|
4357 | };
|
4358 | return ''.replace(re, '$<a>') !== '7';
|
4359 | });
|
4360 |
|
4361 |
|
4362 |
|
4363 | var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
|
4364 | var re = /(?:)/;
|
4365 | var originalExec = re.exec;
|
4366 | re.exec = function () { return originalExec.apply(this, arguments); };
|
4367 | var result = 'ab'.split(re);
|
4368 | return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
|
4369 | });
|
4370 |
|
4371 | var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
|
4372 | var SYMBOL = wellKnownSymbol(KEY);
|
4373 |
|
4374 | var DELEGATES_TO_SYMBOL = !fails(function () {
|
4375 |
|
4376 | var O = {};
|
4377 | O[SYMBOL] = function () { return 7; };
|
4378 | return ''[KEY](O) != 7;
|
4379 | });
|
4380 |
|
4381 | var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
|
4382 |
|
4383 | var execCalled = false;
|
4384 | var re = /a/;
|
4385 | re.exec = function () { execCalled = true; return null; };
|
4386 |
|
4387 | if (KEY === 'split') {
|
4388 |
|
4389 |
|
4390 | re.constructor = {};
|
4391 | re.constructor[SPECIES$2] = function () { return re; };
|
4392 | }
|
4393 |
|
4394 | re[SYMBOL]('');
|
4395 | return !execCalled;
|
4396 | });
|
4397 |
|
4398 | if (
|
4399 | !DELEGATES_TO_SYMBOL ||
|
4400 | !DELEGATES_TO_EXEC ||
|
4401 | (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
|
4402 | (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
|
4403 | ) {
|
4404 | var nativeRegExpMethod = /./[SYMBOL];
|
4405 | var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
4406 | if (regexp.exec === regexpExec) {
|
4407 | if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
4408 |
|
4409 |
|
4410 |
|
4411 | return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
|
4412 | }
|
4413 | return { done: true, value: nativeMethod.call(str, regexp, arg2) };
|
4414 | }
|
4415 | return { done: false };
|
4416 | });
|
4417 | var stringMethod = methods[0];
|
4418 | var regexMethod = methods[1];
|
4419 |
|
4420 | redefine(String.prototype, KEY, stringMethod);
|
4421 | redefine(RegExp.prototype, SYMBOL, length == 2
|
4422 |
|
4423 |
|
4424 | ? function (string, arg) { return regexMethod.call(string, this, arg); }
|
4425 |
|
4426 |
|
4427 | : function (string) { return regexMethod.call(string, this); }
|
4428 | );
|
4429 | if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true);
|
4430 | }
|
4431 | };
|
4432 |
|
4433 | var charAt$1 = stringMultibyte.charAt;
|
4434 |
|
4435 |
|
4436 |
|
4437 | var advanceStringIndex = function (S, index, unicode) {
|
4438 | return index + (unicode ? charAt$1(S, index).length : 1);
|
4439 | };
|
4440 |
|
4441 |
|
4442 |
|
4443 | var regexpExecAbstract = function (R, S) {
|
4444 | var exec = R.exec;
|
4445 | if (typeof exec === 'function') {
|
4446 | var result = exec.call(R, S);
|
4447 | if (typeof result !== 'object') {
|
4448 | throw TypeError('RegExp exec method returned something other than an Object or null');
|
4449 | }
|
4450 | return result;
|
4451 | }
|
4452 |
|
4453 | if (classofRaw(R) !== 'RegExp') {
|
4454 | throw TypeError('RegExp#exec called on incompatible receiver');
|
4455 | }
|
4456 |
|
4457 | return regexpExec.call(R, S);
|
4458 | };
|
4459 |
|
4460 |
|
4461 | fixRegexpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
|
4462 | return [
|
4463 |
|
4464 |
|
4465 | function match(regexp) {
|
4466 | var O = requireObjectCoercible(this);
|
4467 | var matcher = regexp == undefined ? undefined : regexp[MATCH];
|
4468 | return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
|
4469 | },
|
4470 |
|
4471 |
|
4472 | function (regexp) {
|
4473 | var res = maybeCallNative(nativeMatch, regexp, this);
|
4474 | if (res.done) return res.value;
|
4475 |
|
4476 | var rx = anObject(regexp);
|
4477 | var S = String(this);
|
4478 |
|
4479 | if (!rx.global) return regexpExecAbstract(rx, S);
|
4480 |
|
4481 | var fullUnicode = rx.unicode;
|
4482 | rx.lastIndex = 0;
|
4483 | var A = [];
|
4484 | var n = 0;
|
4485 | var result;
|
4486 | while ((result = regexpExecAbstract(rx, S)) !== null) {
|
4487 | var matchStr = String(result[0]);
|
4488 | A[n] = matchStr;
|
4489 | if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
4490 | n++;
|
4491 | }
|
4492 | return n === 0 ? null : A;
|
4493 | }
|
4494 | ];
|
4495 | });
|
4496 |
|
4497 | var max$1 = Math.max;
|
4498 | var min$2 = Math.min;
|
4499 | var floor$1 = Math.floor;
|
4500 | var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
|
4501 | var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
|
4502 |
|
4503 | var maybeToString = function (it) {
|
4504 | return it === undefined ? it : String(it);
|
4505 | };
|
4506 |
|
4507 |
|
4508 | fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative) {
|
4509 | return [
|
4510 |
|
4511 |
|
4512 | function replace(searchValue, replaceValue) {
|
4513 | var O = requireObjectCoercible(this);
|
4514 | var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
|
4515 | return replacer !== undefined
|
4516 | ? replacer.call(searchValue, O, replaceValue)
|
4517 | : nativeReplace.call(String(O), searchValue, replaceValue);
|
4518 | },
|
4519 |
|
4520 |
|
4521 | function (regexp, replaceValue) {
|
4522 | var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
|
4523 | if (res.done) return res.value;
|
4524 |
|
4525 | var rx = anObject(regexp);
|
4526 | var S = String(this);
|
4527 |
|
4528 | var functionalReplace = typeof replaceValue === 'function';
|
4529 | if (!functionalReplace) replaceValue = String(replaceValue);
|
4530 |
|
4531 | var global = rx.global;
|
4532 | if (global) {
|
4533 | var fullUnicode = rx.unicode;
|
4534 | rx.lastIndex = 0;
|
4535 | }
|
4536 | var results = [];
|
4537 | while (true) {
|
4538 | var result = regexpExecAbstract(rx, S);
|
4539 | if (result === null) break;
|
4540 |
|
4541 | results.push(result);
|
4542 | if (!global) break;
|
4543 |
|
4544 | var matchStr = String(result[0]);
|
4545 | if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
4546 | }
|
4547 |
|
4548 | var accumulatedResult = '';
|
4549 | var nextSourcePosition = 0;
|
4550 | for (var i = 0; i < results.length; i++) {
|
4551 | result = results[i];
|
4552 |
|
4553 | var matched = String(result[0]);
|
4554 | var position = max$1(min$2(toInteger(result.index), S.length), 0);
|
4555 | var captures = [];
|
4556 |
|
4557 |
|
4558 |
|
4559 |
|
4560 |
|
4561 | for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
|
4562 | var namedCaptures = result.groups;
|
4563 | if (functionalReplace) {
|
4564 | var replacerArgs = [matched].concat(captures, position, S);
|
4565 | if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
|
4566 | var replacement = String(replaceValue.apply(undefined, replacerArgs));
|
4567 | } else {
|
4568 | replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
|
4569 | }
|
4570 | if (position >= nextSourcePosition) {
|
4571 | accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
|
4572 | nextSourcePosition = position + matched.length;
|
4573 | }
|
4574 | }
|
4575 | return accumulatedResult + S.slice(nextSourcePosition);
|
4576 | }
|
4577 | ];
|
4578 |
|
4579 |
|
4580 | function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
|
4581 | var tailPos = position + matched.length;
|
4582 | var m = captures.length;
|
4583 | var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
|
4584 | if (namedCaptures !== undefined) {
|
4585 | namedCaptures = toObject(namedCaptures);
|
4586 | symbols = SUBSTITUTION_SYMBOLS;
|
4587 | }
|
4588 | return nativeReplace.call(replacement, symbols, function (match, ch) {
|
4589 | var capture;
|
4590 | switch (ch.charAt(0)) {
|
4591 | case '$': return '$';
|
4592 | case '&': return matched;
|
4593 | case '`': return str.slice(0, position);
|
4594 | case "'": return str.slice(tailPos);
|
4595 | case '<':
|
4596 | capture = namedCaptures[ch.slice(1, -1)];
|
4597 | break;
|
4598 | default:
|
4599 | var n = +ch;
|
4600 | if (n === 0) return match;
|
4601 | if (n > m) {
|
4602 | var f = floor$1(n / 10);
|
4603 | if (f === 0) return match;
|
4604 | if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
|
4605 | return match;
|
4606 | }
|
4607 | capture = captures[n - 1];
|
4608 | }
|
4609 | return capture === undefined ? '' : capture;
|
4610 | });
|
4611 | }
|
4612 | });
|
4613 |
|
4614 |
|
4615 | var getOptions = function getOptions(obj) {
|
4616 | var options = Array.prototype.reduce.call(obj, function (acc, attribute) {
|
4617 | var option = attribute.name.match(/data-simplebar-(.+)/);
|
4618 |
|
4619 | if (option) {
|
4620 | var key = option[1].replace(/\W+(.)/g, function (x, chr) {
|
4621 | return chr.toUpperCase();
|
4622 | });
|
4623 |
|
4624 | switch (attribute.value) {
|
4625 | case 'true':
|
4626 | acc[key] = true;
|
4627 | break;
|
4628 |
|
4629 | case 'false':
|
4630 | acc[key] = false;
|
4631 | break;
|
4632 |
|
4633 | case undefined:
|
4634 | acc[key] = true;
|
4635 | break;
|
4636 |
|
4637 | default:
|
4638 | acc[key] = attribute.value;
|
4639 | }
|
4640 | }
|
4641 |
|
4642 | return acc;
|
4643 | }, {});
|
4644 | return options;
|
4645 | };
|
4646 | function getElementWindow(element) {
|
4647 | if (!element || !element.ownerDocument || !element.ownerDocument.defaultView) {
|
4648 | return window;
|
4649 | }
|
4650 |
|
4651 | return element.ownerDocument.defaultView;
|
4652 | }
|
4653 | function getElementDocument(element) {
|
4654 | if (!element || !element.ownerDocument) {
|
4655 | return document;
|
4656 | }
|
4657 |
|
4658 | return element.ownerDocument;
|
4659 | }
|
4660 |
|
4661 | var SimpleBar =
|
4662 |
|
4663 | function () {
|
4664 | function SimpleBar(element, options) {
|
4665 | var _this = this;
|
4666 |
|
4667 | this.onScroll = function () {
|
4668 | var elWindow = getElementWindow(_this.el);
|
4669 |
|
4670 | if (!_this.scrollXTicking) {
|
4671 | elWindow.requestAnimationFrame(_this.scrollX);
|
4672 | _this.scrollXTicking = true;
|
4673 | }
|
4674 |
|
4675 | if (!_this.scrollYTicking) {
|
4676 | elWindow.requestAnimationFrame(_this.scrollY);
|
4677 | _this.scrollYTicking = true;
|
4678 | }
|
4679 | };
|
4680 |
|
4681 | this.scrollX = function () {
|
4682 | if (_this.axis.x.isOverflowing) {
|
4683 | _this.showScrollbar('x');
|
4684 |
|
4685 | _this.positionScrollbar('x');
|
4686 | }
|
4687 |
|
4688 | _this.scrollXTicking = false;
|
4689 | };
|
4690 |
|
4691 | this.scrollY = function () {
|
4692 | if (_this.axis.y.isOverflowing) {
|
4693 | _this.showScrollbar('y');
|
4694 |
|
4695 | _this.positionScrollbar('y');
|
4696 | }
|
4697 |
|
4698 | _this.scrollYTicking = false;
|
4699 | };
|
4700 |
|
4701 | this.onMouseEnter = function () {
|
4702 | _this.showScrollbar('x');
|
4703 |
|
4704 | _this.showScrollbar('y');
|
4705 | };
|
4706 |
|
4707 | this.onMouseMove = function (e) {
|
4708 | _this.mouseX = e.clientX;
|
4709 | _this.mouseY = e.clientY;
|
4710 |
|
4711 | if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) {
|
4712 | _this.onMouseMoveForAxis('x');
|
4713 | }
|
4714 |
|
4715 | if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) {
|
4716 | _this.onMouseMoveForAxis('y');
|
4717 | }
|
4718 | };
|
4719 |
|
4720 | this.onMouseLeave = function () {
|
4721 | _this.onMouseMove.cancel();
|
4722 |
|
4723 | if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) {
|
4724 | _this.onMouseLeaveForAxis('x');
|
4725 | }
|
4726 |
|
4727 | if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) {
|
4728 | _this.onMouseLeaveForAxis('y');
|
4729 | }
|
4730 |
|
4731 | _this.mouseX = -1;
|
4732 | _this.mouseY = -1;
|
4733 | };
|
4734 |
|
4735 | this.onWindowResize = function () {
|
4736 |
|
4737 | _this.scrollbarWidth = _this.getScrollbarWidth();
|
4738 |
|
4739 | _this.hideNativeScrollbar();
|
4740 | };
|
4741 |
|
4742 | this.hideScrollbars = function () {
|
4743 | _this.axis.x.track.rect = _this.axis.x.track.el.getBoundingClientRect();
|
4744 | _this.axis.y.track.rect = _this.axis.y.track.el.getBoundingClientRect();
|
4745 |
|
4746 | if (!_this.isWithinBounds(_this.axis.y.track.rect)) {
|
4747 | _this.axis.y.scrollbar.el.classList.remove(_this.classNames.visible);
|
4748 |
|
4749 | _this.axis.y.isVisible = false;
|
4750 | }
|
4751 |
|
4752 | if (!_this.isWithinBounds(_this.axis.x.track.rect)) {
|
4753 | _this.axis.x.scrollbar.el.classList.remove(_this.classNames.visible);
|
4754 |
|
4755 | _this.axis.x.isVisible = false;
|
4756 | }
|
4757 | };
|
4758 |
|
4759 | this.onPointerEvent = function (e) {
|
4760 | var isWithinTrackXBounds, isWithinTrackYBounds;
|
4761 | _this.axis.x.track.rect = _this.axis.x.track.el.getBoundingClientRect();
|
4762 | _this.axis.y.track.rect = _this.axis.y.track.el.getBoundingClientRect();
|
4763 |
|
4764 | if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) {
|
4765 | isWithinTrackXBounds = _this.isWithinBounds(_this.axis.x.track.rect);
|
4766 | }
|
4767 |
|
4768 | if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) {
|
4769 | isWithinTrackYBounds = _this.isWithinBounds(_this.axis.y.track.rect);
|
4770 | }
|
4771 |
|
4772 |
|
4773 | if (isWithinTrackXBounds || isWithinTrackYBounds) {
|
4774 |
|
4775 |
|
4776 | e.preventDefault();
|
4777 |
|
4778 | e.stopPropagation();
|
4779 |
|
4780 | if (e.type === 'mousedown') {
|
4781 | if (isWithinTrackXBounds) {
|
4782 | _this.axis.x.scrollbar.rect = _this.axis.x.scrollbar.el.getBoundingClientRect();
|
4783 |
|
4784 | if (_this.isWithinBounds(_this.axis.x.scrollbar.rect)) {
|
4785 | _this.onDragStart(e, 'x');
|
4786 | } else {
|
4787 | _this.onTrackClick(e, 'x');
|
4788 | }
|
4789 | }
|
4790 |
|
4791 | if (isWithinTrackYBounds) {
|
4792 | _this.axis.y.scrollbar.rect = _this.axis.y.scrollbar.el.getBoundingClientRect();
|
4793 |
|
4794 | if (_this.isWithinBounds(_this.axis.y.scrollbar.rect)) {
|
4795 | _this.onDragStart(e, 'y');
|
4796 | } else {
|
4797 | _this.onTrackClick(e, 'y');
|
4798 | }
|
4799 | }
|
4800 | }
|
4801 | }
|
4802 | };
|
4803 |
|
4804 | this.drag = function (e) {
|
4805 | var eventOffset;
|
4806 | var track = _this.axis[_this.draggedAxis].track;
|
4807 | var trackSize = track.rect[_this.axis[_this.draggedAxis].sizeAttr];
|
4808 | var scrollbar = _this.axis[_this.draggedAxis].scrollbar;
|
4809 | var contentSize = _this.contentWrapperEl[_this.axis[_this.draggedAxis].scrollSizeAttr];
|
4810 | var hostSize = parseInt(_this.elStyles[_this.axis[_this.draggedAxis].sizeAttr], 10);
|
4811 | e.preventDefault();
|
4812 | e.stopPropagation();
|
4813 |
|
4814 | if (_this.draggedAxis === 'y') {
|
4815 | eventOffset = e.pageY;
|
4816 | } else {
|
4817 | eventOffset = e.pageX;
|
4818 | }
|
4819 |
|
4820 |
|
4821 | var dragPos = eventOffset - track.rect[_this.axis[_this.draggedAxis].offsetAttr] - _this.axis[_this.draggedAxis].dragOffset;
|
4822 |
|
4823 | var dragPerc = dragPos / (trackSize - scrollbar.size);
|
4824 |
|
4825 | var scrollPos = dragPerc * (contentSize - hostSize);
|
4826 |
|
4827 | if (_this.draggedAxis === 'x') {
|
4828 | scrollPos = _this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollbarInverted ? scrollPos - (trackSize + scrollbar.size) : scrollPos;
|
4829 | scrollPos = _this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollingInverted ? -scrollPos : scrollPos;
|
4830 | }
|
4831 |
|
4832 | _this.contentWrapperEl[_this.axis[_this.draggedAxis].scrollOffsetAttr] = scrollPos;
|
4833 | };
|
4834 |
|
4835 | this.onEndDrag = function (e) {
|
4836 | var elDocument = getElementDocument(_this.el);
|
4837 | var elWindow = getElementWindow(_this.el);
|
4838 | e.preventDefault();
|
4839 | e.stopPropagation();
|
4840 |
|
4841 | _this.el.classList.remove(_this.classNames.dragging);
|
4842 |
|
4843 | elDocument.removeEventListener('mousemove', _this.drag, true);
|
4844 | elDocument.removeEventListener('mouseup', _this.onEndDrag, true);
|
4845 | _this.removePreventClickId = elWindow.setTimeout(function () {
|
4846 |
|
4847 |
|
4848 | elDocument.removeEventListener('click', _this.preventClick, true);
|
4849 | elDocument.removeEventListener('dblclick', _this.preventClick, true);
|
4850 | _this.removePreventClickId = null;
|
4851 | });
|
4852 | };
|
4853 |
|
4854 | this.preventClick = function (e) {
|
4855 | e.preventDefault();
|
4856 | e.stopPropagation();
|
4857 | };
|
4858 |
|
4859 | this.el = element;
|
4860 | this.minScrollbarWidth = 20;
|
4861 | this.options = Object.assign({}, SimpleBar.defaultOptions, {}, options);
|
4862 | this.classNames = Object.assign({}, SimpleBar.defaultOptions.classNames, {}, this.options.classNames);
|
4863 | this.axis = {
|
4864 | x: {
|
4865 | scrollOffsetAttr: 'scrollLeft',
|
4866 | sizeAttr: 'width',
|
4867 | scrollSizeAttr: 'scrollWidth',
|
4868 | offsetSizeAttr: 'offsetWidth',
|
4869 | offsetAttr: 'left',
|
4870 | overflowAttr: 'overflowX',
|
4871 | dragOffset: 0,
|
4872 | isOverflowing: true,
|
4873 | isVisible: false,
|
4874 | forceVisible: false,
|
4875 | track: {},
|
4876 | scrollbar: {}
|
4877 | },
|
4878 | y: {
|
4879 | scrollOffsetAttr: 'scrollTop',
|
4880 | sizeAttr: 'height',
|
4881 | scrollSizeAttr: 'scrollHeight',
|
4882 | offsetSizeAttr: 'offsetHeight',
|
4883 | offsetAttr: 'top',
|
4884 | overflowAttr: 'overflowY',
|
4885 | dragOffset: 0,
|
4886 | isOverflowing: true,
|
4887 | isVisible: false,
|
4888 | forceVisible: false,
|
4889 | track: {},
|
4890 | scrollbar: {}
|
4891 | }
|
4892 | };
|
4893 | this.removePreventClickId = null;
|
4894 |
|
4895 | if (SimpleBar.instances.has(this.el)) {
|
4896 | return;
|
4897 | }
|
4898 |
|
4899 | this.recalculate = lodash_throttle(this.recalculate.bind(this), 64);
|
4900 | this.onMouseMove = lodash_throttle(this.onMouseMove.bind(this), 64);
|
4901 | this.hideScrollbars = lodash_debounce(this.hideScrollbars.bind(this), this.options.timeout);
|
4902 | this.onWindowResize = lodash_debounce(this.onWindowResize.bind(this), 64, {
|
4903 | leading: true
|
4904 | });
|
4905 | SimpleBar.getRtlHelpers = lodash_memoize(SimpleBar.getRtlHelpers);
|
4906 | this.init();
|
4907 | }
|
4908 | |
4909 |
|
4910 |
|
4911 |
|
4912 | |
4913 |
|
4914 |
|
4915 |
|
4916 |
|
4917 |
|
4918 |
|
4919 |
|
4920 | SimpleBar.getRtlHelpers = function getRtlHelpers() {
|
4921 | var dummyDiv = document.createElement('div');
|
4922 | dummyDiv.innerHTML = '<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>';
|
4923 | var scrollbarDummyEl = dummyDiv.firstElementChild;
|
4924 | document.body.appendChild(scrollbarDummyEl);
|
4925 | var dummyContainerChild = scrollbarDummyEl.firstElementChild;
|
4926 | scrollbarDummyEl.scrollLeft = 0;
|
4927 | var dummyContainerOffset = SimpleBar.getOffset(scrollbarDummyEl);
|
4928 | var dummyContainerChildOffset = SimpleBar.getOffset(dummyContainerChild);
|
4929 | scrollbarDummyEl.scrollLeft = 999;
|
4930 | var dummyContainerScrollOffsetAfterScroll = SimpleBar.getOffset(dummyContainerChild);
|
4931 | return {
|
4932 |
|
4933 | isRtlScrollingInverted: dummyContainerOffset.left !== dummyContainerChildOffset.left && dummyContainerChildOffset.left - dummyContainerScrollOffsetAfterScroll.left !== 0,
|
4934 |
|
4935 | isRtlScrollbarInverted: dummyContainerOffset.left !== dummyContainerChildOffset.left
|
4936 | };
|
4937 | };
|
4938 |
|
4939 | SimpleBar.getOffset = function getOffset(el) {
|
4940 | var rect = el.getBoundingClientRect();
|
4941 | var elDocument = getElementDocument(el);
|
4942 | var elWindow = getElementWindow(el);
|
4943 | return {
|
4944 | top: rect.top + (elWindow.pageYOffset || elDocument.documentElement.scrollTop),
|
4945 | left: rect.left + (elWindow.pageXOffset || elDocument.documentElement.scrollLeft)
|
4946 | };
|
4947 | };
|
4948 |
|
4949 | var _proto = SimpleBar.prototype;
|
4950 |
|
4951 | _proto.init = function init() {
|
4952 |
|
4953 | SimpleBar.instances.set(this.el, this);
|
4954 |
|
4955 | if (canUseDom) {
|
4956 | this.initDOM();
|
4957 | this.scrollbarWidth = this.getScrollbarWidth();
|
4958 | this.recalculate();
|
4959 | this.initListeners();
|
4960 | }
|
4961 | };
|
4962 |
|
4963 | _proto.initDOM = function initDOM() {
|
4964 | var _this2 = this;
|
4965 |
|
4966 |
|
4967 | if (Array.prototype.filter.call(this.el.children, function (child) {
|
4968 | return child.classList.contains(_this2.classNames.wrapper);
|
4969 | }).length) {
|
4970 |
|
4971 | this.wrapperEl = this.el.querySelector("." + this.classNames.wrapper);
|
4972 | this.contentWrapperEl = this.options.scrollableNode || this.el.querySelector("." + this.classNames.contentWrapper);
|
4973 | this.contentEl = this.options.contentNode || this.el.querySelector("." + this.classNames.contentEl);
|
4974 | this.offsetEl = this.el.querySelector("." + this.classNames.offset);
|
4975 | this.maskEl = this.el.querySelector("." + this.classNames.mask);
|
4976 | this.placeholderEl = this.findChild(this.wrapperEl, "." + this.classNames.placeholder);
|
4977 | this.heightAutoObserverWrapperEl = this.el.querySelector("." + this.classNames.heightAutoObserverWrapperEl);
|
4978 | this.heightAutoObserverEl = this.el.querySelector("." + this.classNames.heightAutoObserverEl);
|
4979 | this.axis.x.track.el = this.findChild(this.el, "." + this.classNames.track + "." + this.classNames.horizontal);
|
4980 | this.axis.y.track.el = this.findChild(this.el, "." + this.classNames.track + "." + this.classNames.vertical);
|
4981 | } else {
|
4982 |
|
4983 | this.wrapperEl = document.createElement('div');
|
4984 | this.contentWrapperEl = document.createElement('div');
|
4985 | this.offsetEl = document.createElement('div');
|
4986 | this.maskEl = document.createElement('div');
|
4987 | this.contentEl = document.createElement('div');
|
4988 | this.placeholderEl = document.createElement('div');
|
4989 | this.heightAutoObserverWrapperEl = document.createElement('div');
|
4990 | this.heightAutoObserverEl = document.createElement('div');
|
4991 | this.wrapperEl.classList.add(this.classNames.wrapper);
|
4992 | this.contentWrapperEl.classList.add(this.classNames.contentWrapper);
|
4993 | this.offsetEl.classList.add(this.classNames.offset);
|
4994 | this.maskEl.classList.add(this.classNames.mask);
|
4995 | this.contentEl.classList.add(this.classNames.contentEl);
|
4996 | this.placeholderEl.classList.add(this.classNames.placeholder);
|
4997 | this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl);
|
4998 | this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);
|
4999 |
|
5000 | while (this.el.firstChild) {
|
5001 | this.contentEl.appendChild(this.el.firstChild);
|
5002 | }
|
5003 |
|
5004 | this.contentWrapperEl.appendChild(this.contentEl);
|
5005 | this.offsetEl.appendChild(this.contentWrapperEl);
|
5006 | this.maskEl.appendChild(this.offsetEl);
|
5007 | this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl);
|
5008 | this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl);
|
5009 | this.wrapperEl.appendChild(this.maskEl);
|
5010 | this.wrapperEl.appendChild(this.placeholderEl);
|
5011 | this.el.appendChild(this.wrapperEl);
|
5012 | }
|
5013 |
|
5014 | if (!this.axis.x.track.el || !this.axis.y.track.el) {
|
5015 | var track = document.createElement('div');
|
5016 | var scrollbar = document.createElement('div');
|
5017 | track.classList.add(this.classNames.track);
|
5018 | scrollbar.classList.add(this.classNames.scrollbar);
|
5019 | track.appendChild(scrollbar);
|
5020 | this.axis.x.track.el = track.cloneNode(true);
|
5021 | this.axis.x.track.el.classList.add(this.classNames.horizontal);
|
5022 | this.axis.y.track.el = track.cloneNode(true);
|
5023 | this.axis.y.track.el.classList.add(this.classNames.vertical);
|
5024 | this.el.appendChild(this.axis.x.track.el);
|
5025 | this.el.appendChild(this.axis.y.track.el);
|
5026 | }
|
5027 |
|
5028 | this.axis.x.scrollbar.el = this.axis.x.track.el.querySelector("." + this.classNames.scrollbar);
|
5029 | this.axis.y.scrollbar.el = this.axis.y.track.el.querySelector("." + this.classNames.scrollbar);
|
5030 |
|
5031 | if (!this.options.autoHide) {
|
5032 | this.axis.x.scrollbar.el.classList.add(this.classNames.visible);
|
5033 | this.axis.y.scrollbar.el.classList.add(this.classNames.visible);
|
5034 | }
|
5035 |
|
5036 | this.el.setAttribute('data-simplebar', 'init');
|
5037 | };
|
5038 |
|
5039 | _proto.initListeners = function initListeners() {
|
5040 | var _this3 = this;
|
5041 |
|
5042 | var elWindow = getElementWindow(this.el);
|
5043 |
|
5044 | if (this.options.autoHide) {
|
5045 | this.el.addEventListener('mouseenter', this.onMouseEnter);
|
5046 | }
|
5047 |
|
5048 | ['mousedown', 'click', 'dblclick'].forEach(function (e) {
|
5049 | _this3.el.addEventListener(e, _this3.onPointerEvent, true);
|
5050 | });
|
5051 | ['touchstart', 'touchend', 'touchmove'].forEach(function (e) {
|
5052 | _this3.el.addEventListener(e, _this3.onPointerEvent, {
|
5053 | capture: true,
|
5054 | passive: true
|
5055 | });
|
5056 | });
|
5057 | this.el.addEventListener('mousemove', this.onMouseMove);
|
5058 | this.el.addEventListener('mouseleave', this.onMouseLeave);
|
5059 | this.contentWrapperEl.addEventListener('scroll', this.onScroll);
|
5060 |
|
5061 | elWindow.addEventListener('resize', this.onWindowResize);
|
5062 |
|
5063 | var resizeObserverStarted = false;
|
5064 | var resizeObserver = elWindow.ResizeObserver || index;
|
5065 | this.resizeObserver = new resizeObserver(function () {
|
5066 | if (!resizeObserverStarted) return;
|
5067 |
|
5068 | _this3.recalculate();
|
5069 | });
|
5070 | this.resizeObserver.observe(this.el);
|
5071 | this.resizeObserver.observe(this.contentEl);
|
5072 | elWindow.requestAnimationFrame(function () {
|
5073 | resizeObserverStarted = true;
|
5074 | });
|
5075 |
|
5076 | this.mutationObserver = new elWindow.MutationObserver(this.recalculate);
|
5077 | this.mutationObserver.observe(this.contentEl, {
|
5078 | childList: true,
|
5079 | subtree: true,
|
5080 | characterData: true
|
5081 | });
|
5082 | };
|
5083 |
|
5084 | _proto.recalculate = function recalculate() {
|
5085 | var elWindow = getElementWindow(this.el);
|
5086 | this.elStyles = elWindow.getComputedStyle(this.el);
|
5087 | this.isRtl = this.elStyles.direction === 'rtl';
|
5088 | var contentElOffsetWidth = this.contentEl.offsetWidth;
|
5089 | var isHeightAuto = this.heightAutoObserverEl.offsetHeight <= 1;
|
5090 | var isWidthAuto = this.heightAutoObserverEl.offsetWidth <= 1 || contentElOffsetWidth > 0;
|
5091 | var contentWrapperElOffsetWidth = this.contentWrapperEl.offsetWidth;
|
5092 | var elOverflowX = this.elStyles.overflowX;
|
5093 | var elOverflowY = this.elStyles.overflowY;
|
5094 | this.contentEl.style.padding = this.elStyles.paddingTop + " " + this.elStyles.paddingRight + " " + this.elStyles.paddingBottom + " " + this.elStyles.paddingLeft;
|
5095 | this.wrapperEl.style.margin = "-" + this.elStyles.paddingTop + " -" + this.elStyles.paddingRight + " -" + this.elStyles.paddingBottom + " -" + this.elStyles.paddingLeft;
|
5096 | var contentElScrollHeight = this.contentEl.scrollHeight;
|
5097 | var contentElScrollWidth = this.contentEl.scrollWidth;
|
5098 | this.contentWrapperEl.style.height = isHeightAuto ? 'auto' : '100%';
|
5099 |
|
5100 | this.placeholderEl.style.width = isWidthAuto ? (contentElOffsetWidth || contentElScrollWidth) + "px" : 'auto';
|
5101 | this.placeholderEl.style.height = contentElScrollHeight + "px";
|
5102 | var contentWrapperElOffsetHeight = this.contentWrapperEl.offsetHeight;
|
5103 | this.axis.x.isOverflowing = contentElOffsetWidth !== 0 && contentElScrollWidth > contentElOffsetWidth;
|
5104 | this.axis.y.isOverflowing = contentElScrollHeight > contentWrapperElOffsetHeight;
|
5105 |
|
5106 | this.axis.x.isOverflowing = elOverflowX === 'hidden' ? false : this.axis.x.isOverflowing;
|
5107 | this.axis.y.isOverflowing = elOverflowY === 'hidden' ? false : this.axis.y.isOverflowing;
|
5108 | this.axis.x.forceVisible = this.options.forceVisible === 'x' || this.options.forceVisible === true;
|
5109 | this.axis.y.forceVisible = this.options.forceVisible === 'y' || this.options.forceVisible === true;
|
5110 | this.hideNativeScrollbar();
|
5111 |
|
5112 | var offsetForXScrollbar = this.axis.x.isOverflowing ? this.scrollbarWidth : 0;
|
5113 | var offsetForYScrollbar = this.axis.y.isOverflowing ? this.scrollbarWidth : 0;
|
5114 | this.axis.x.isOverflowing = this.axis.x.isOverflowing && contentElScrollWidth > contentWrapperElOffsetWidth - offsetForYScrollbar;
|
5115 | this.axis.y.isOverflowing = this.axis.y.isOverflowing && contentElScrollHeight > contentWrapperElOffsetHeight - offsetForXScrollbar;
|
5116 | this.axis.x.scrollbar.size = this.getScrollbarSize('x');
|
5117 | this.axis.y.scrollbar.size = this.getScrollbarSize('y');
|
5118 | this.axis.x.scrollbar.el.style.width = this.axis.x.scrollbar.size + "px";
|
5119 | this.axis.y.scrollbar.el.style.height = this.axis.y.scrollbar.size + "px";
|
5120 | this.positionScrollbar('x');
|
5121 | this.positionScrollbar('y');
|
5122 | this.toggleTrackVisibility('x');
|
5123 | this.toggleTrackVisibility('y');
|
5124 | }
|
5125 | |
5126 |
|
5127 |
|
5128 | ;
|
5129 |
|
5130 | _proto.getScrollbarSize = function getScrollbarSize(axis) {
|
5131 | if (axis === void 0) {
|
5132 | axis = 'y';
|
5133 | }
|
5134 |
|
5135 | if (!this.axis[axis].isOverflowing) {
|
5136 | return 0;
|
5137 | }
|
5138 |
|
5139 | var contentSize = this.contentEl[this.axis[axis].scrollSizeAttr];
|
5140 | var trackSize = this.axis[axis].track.el[this.axis[axis].offsetSizeAttr];
|
5141 | var scrollbarSize;
|
5142 | var scrollbarRatio = trackSize / contentSize;
|
5143 |
|
5144 | scrollbarSize = Math.max(~~(scrollbarRatio * trackSize), this.options.scrollbarMinSize);
|
5145 |
|
5146 | if (this.options.scrollbarMaxSize) {
|
5147 | scrollbarSize = Math.min(scrollbarSize, this.options.scrollbarMaxSize);
|
5148 | }
|
5149 |
|
5150 | return scrollbarSize;
|
5151 | };
|
5152 |
|
5153 | _proto.positionScrollbar = function positionScrollbar(axis) {
|
5154 | if (axis === void 0) {
|
5155 | axis = 'y';
|
5156 | }
|
5157 |
|
5158 | if (!this.axis[axis].isOverflowing) {
|
5159 | return;
|
5160 | }
|
5161 |
|
5162 | var contentSize = this.contentWrapperEl[this.axis[axis].scrollSizeAttr];
|
5163 | var trackSize = this.axis[axis].track.el[this.axis[axis].offsetSizeAttr];
|
5164 | var hostSize = parseInt(this.elStyles[this.axis[axis].sizeAttr], 10);
|
5165 | var scrollbar = this.axis[axis].scrollbar;
|
5166 | var scrollOffset = this.contentWrapperEl[this.axis[axis].scrollOffsetAttr];
|
5167 | scrollOffset = axis === 'x' && this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollingInverted ? -scrollOffset : scrollOffset;
|
5168 | var scrollPourcent = scrollOffset / (contentSize - hostSize);
|
5169 | var handleOffset = ~~((trackSize - scrollbar.size) * scrollPourcent);
|
5170 | handleOffset = axis === 'x' && this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollbarInverted ? handleOffset + (trackSize - scrollbar.size) : handleOffset;
|
5171 | scrollbar.el.style.transform = axis === 'x' ? "translate3d(" + handleOffset + "px, 0, 0)" : "translate3d(0, " + handleOffset + "px, 0)";
|
5172 | };
|
5173 |
|
5174 | _proto.toggleTrackVisibility = function toggleTrackVisibility(axis) {
|
5175 | if (axis === void 0) {
|
5176 | axis = 'y';
|
5177 | }
|
5178 |
|
5179 | var track = this.axis[axis].track.el;
|
5180 | var scrollbar = this.axis[axis].scrollbar.el;
|
5181 |
|
5182 | if (this.axis[axis].isOverflowing || this.axis[axis].forceVisible) {
|
5183 | track.style.visibility = 'visible';
|
5184 | this.contentWrapperEl.style[this.axis[axis].overflowAttr] = 'scroll';
|
5185 | } else {
|
5186 | track.style.visibility = 'hidden';
|
5187 | this.contentWrapperEl.style[this.axis[axis].overflowAttr] = 'hidden';
|
5188 | }
|
5189 |
|
5190 |
|
5191 | if (this.axis[axis].isOverflowing) {
|
5192 | scrollbar.style.display = 'block';
|
5193 | } else {
|
5194 | scrollbar.style.display = 'none';
|
5195 | }
|
5196 | };
|
5197 |
|
5198 | _proto.hideNativeScrollbar = function hideNativeScrollbar() {
|
5199 | this.offsetEl.style[this.isRtl ? 'left' : 'right'] = this.axis.y.isOverflowing || this.axis.y.forceVisible ? "-" + this.scrollbarWidth + "px" : 0;
|
5200 | this.offsetEl.style.bottom = this.axis.x.isOverflowing || this.axis.x.forceVisible ? "-" + this.scrollbarWidth + "px" : 0;
|
5201 | }
|
5202 | |
5203 |
|
5204 |
|
5205 | ;
|
5206 |
|
5207 | _proto.onMouseMoveForAxis = function onMouseMoveForAxis(axis) {
|
5208 | if (axis === void 0) {
|
5209 | axis = 'y';
|
5210 | }
|
5211 |
|
5212 | this.axis[axis].track.rect = this.axis[axis].track.el.getBoundingClientRect();
|
5213 | this.axis[axis].scrollbar.rect = this.axis[axis].scrollbar.el.getBoundingClientRect();
|
5214 | var isWithinScrollbarBoundsX = this.isWithinBounds(this.axis[axis].scrollbar.rect);
|
5215 |
|
5216 | if (isWithinScrollbarBoundsX) {
|
5217 | this.axis[axis].scrollbar.el.classList.add(this.classNames.hover);
|
5218 | } else {
|
5219 | this.axis[axis].scrollbar.el.classList.remove(this.classNames.hover);
|
5220 | }
|
5221 |
|
5222 | if (this.isWithinBounds(this.axis[axis].track.rect)) {
|
5223 | this.showScrollbar(axis);
|
5224 | this.axis[axis].track.el.classList.add(this.classNames.hover);
|
5225 | } else {
|
5226 | this.axis[axis].track.el.classList.remove(this.classNames.hover);
|
5227 | }
|
5228 | };
|
5229 |
|
5230 | _proto.onMouseLeaveForAxis = function onMouseLeaveForAxis(axis) {
|
5231 | if (axis === void 0) {
|
5232 | axis = 'y';
|
5233 | }
|
5234 |
|
5235 | this.axis[axis].track.el.classList.remove(this.classNames.hover);
|
5236 | this.axis[axis].scrollbar.el.classList.remove(this.classNames.hover);
|
5237 | };
|
5238 |
|
5239 | |
5240 |
|
5241 |
|
5242 | _proto.showScrollbar = function showScrollbar(axis) {
|
5243 | if (axis === void 0) {
|
5244 | axis = 'y';
|
5245 | }
|
5246 |
|
5247 | var scrollbar = this.axis[axis].scrollbar.el;
|
5248 |
|
5249 | if (!this.axis[axis].isVisible) {
|
5250 | scrollbar.classList.add(this.classNames.visible);
|
5251 | this.axis[axis].isVisible = true;
|
5252 | }
|
5253 |
|
5254 | if (this.options.autoHide) {
|
5255 | this.hideScrollbars();
|
5256 | }
|
5257 | }
|
5258 | |
5259 |
|
5260 |
|
5261 | ;
|
5262 |
|
5263 | |
5264 |
|
5265 |
|
5266 | _proto.onDragStart = function onDragStart(e, axis) {
|
5267 | if (axis === void 0) {
|
5268 | axis = 'y';
|
5269 | }
|
5270 |
|
5271 | var elDocument = getElementDocument(this.el);
|
5272 | var elWindow = getElementWindow(this.el);
|
5273 | var scrollbar = this.axis[axis].scrollbar;
|
5274 |
|
5275 | var eventOffset = axis === 'y' ? e.pageY : e.pageX;
|
5276 | this.axis[axis].dragOffset = eventOffset - scrollbar.rect[this.axis[axis].offsetAttr];
|
5277 | this.draggedAxis = axis;
|
5278 | this.el.classList.add(this.classNames.dragging);
|
5279 | elDocument.addEventListener('mousemove', this.drag, true);
|
5280 | elDocument.addEventListener('mouseup', this.onEndDrag, true);
|
5281 |
|
5282 | if (this.removePreventClickId === null) {
|
5283 | elDocument.addEventListener('click', this.preventClick, true);
|
5284 | elDocument.addEventListener('dblclick', this.preventClick, true);
|
5285 | } else {
|
5286 | elWindow.clearTimeout(this.removePreventClickId);
|
5287 | this.removePreventClickId = null;
|
5288 | }
|
5289 | }
|
5290 | |
5291 |
|
5292 |
|
5293 | ;
|
5294 |
|
5295 | _proto.onTrackClick = function onTrackClick(e, axis) {
|
5296 | var _this4 = this;
|
5297 |
|
5298 | if (axis === void 0) {
|
5299 | axis = 'y';
|
5300 | }
|
5301 |
|
5302 | if (!this.options.clickOnTrack) return;
|
5303 | var elWindow = getElementWindow(this.el);
|
5304 | this.axis[axis].scrollbar.rect = this.axis[axis].scrollbar.el.getBoundingClientRect();
|
5305 | var scrollbar = this.axis[axis].scrollbar;
|
5306 | var scrollbarOffset = scrollbar.rect[this.axis[axis].offsetAttr];
|
5307 | var hostSize = parseInt(this.elStyles[this.axis[axis].sizeAttr], 10);
|
5308 | var scrolled = this.contentWrapperEl[this.axis[axis].scrollOffsetAttr];
|
5309 | var t = axis === 'y' ? this.mouseY - scrollbarOffset : this.mouseX - scrollbarOffset;
|
5310 | var dir = t < 0 ? -1 : 1;
|
5311 | var scrollSize = dir === -1 ? scrolled - hostSize : scrolled + hostSize;
|
5312 | var speed = 40;
|
5313 |
|
5314 | var scrollTo = function scrollTo() {
|
5315 | if (dir === -1) {
|
5316 | if (scrolled > scrollSize) {
|
5317 | var _this4$contentWrapper;
|
5318 |
|
5319 | scrolled -= speed;
|
5320 |
|
5321 | _this4.contentWrapperEl.scrollTo((_this4$contentWrapper = {}, _this4$contentWrapper[_this4.axis[axis].offsetAttr] = scrolled, _this4$contentWrapper));
|
5322 |
|
5323 | elWindow.requestAnimationFrame(scrollTo);
|
5324 | }
|
5325 | } else {
|
5326 | if (scrolled < scrollSize) {
|
5327 | var _this4$contentWrapper2;
|
5328 |
|
5329 | scrolled += speed;
|
5330 |
|
5331 | _this4.contentWrapperEl.scrollTo((_this4$contentWrapper2 = {}, _this4$contentWrapper2[_this4.axis[axis].offsetAttr] = scrolled, _this4$contentWrapper2));
|
5332 |
|
5333 | elWindow.requestAnimationFrame(scrollTo);
|
5334 | }
|
5335 | }
|
5336 | };
|
5337 |
|
5338 | scrollTo();
|
5339 | }
|
5340 | |
5341 |
|
5342 |
|
5343 | ;
|
5344 |
|
5345 | _proto.getContentElement = function getContentElement() {
|
5346 | return this.contentEl;
|
5347 | }
|
5348 | |
5349 |
|
5350 |
|
5351 | ;
|
5352 |
|
5353 | _proto.getScrollElement = function getScrollElement() {
|
5354 | return this.contentWrapperEl;
|
5355 | };
|
5356 |
|
5357 | _proto.getScrollbarWidth = function getScrollbarWidth() {
|
5358 |
|
5359 | try {
|
5360 |
|
5361 | if (getComputedStyle(this.contentWrapperEl, '::-webkit-scrollbar').display === 'none' || 'scrollbarWidth' in document.documentElement.style || '-ms-overflow-style' in document.documentElement.style) {
|
5362 | return 0;
|
5363 | } else {
|
5364 | return scrollbarWidth();
|
5365 | }
|
5366 | } catch (e) {
|
5367 | return scrollbarWidth();
|
5368 | }
|
5369 | };
|
5370 |
|
5371 | _proto.removeListeners = function removeListeners() {
|
5372 | var _this5 = this;
|
5373 |
|
5374 | var elWindow = getElementWindow(this.el);
|
5375 |
|
5376 | if (this.options.autoHide) {
|
5377 | this.el.removeEventListener('mouseenter', this.onMouseEnter);
|
5378 | }
|
5379 |
|
5380 | ['mousedown', 'click', 'dblclick'].forEach(function (e) {
|
5381 | _this5.el.removeEventListener(e, _this5.onPointerEvent, true);
|
5382 | });
|
5383 | ['touchstart', 'touchend', 'touchmove'].forEach(function (e) {
|
5384 | _this5.el.removeEventListener(e, _this5.onPointerEvent, {
|
5385 | capture: true,
|
5386 | passive: true
|
5387 | });
|
5388 | });
|
5389 | this.el.removeEventListener('mousemove', this.onMouseMove);
|
5390 | this.el.removeEventListener('mouseleave', this.onMouseLeave);
|
5391 | this.contentWrapperEl.removeEventListener('scroll', this.onScroll);
|
5392 | elWindow.removeEventListener('resize', this.onWindowResize);
|
5393 | this.mutationObserver.disconnect();
|
5394 | this.resizeObserver.disconnect();
|
5395 |
|
5396 | this.recalculate.cancel();
|
5397 | this.onMouseMove.cancel();
|
5398 | this.hideScrollbars.cancel();
|
5399 | this.onWindowResize.cancel();
|
5400 | }
|
5401 | |
5402 |
|
5403 |
|
5404 | ;
|
5405 |
|
5406 | _proto.unMount = function unMount() {
|
5407 | this.removeListeners();
|
5408 | SimpleBar.instances.delete(this.el);
|
5409 | }
|
5410 | |
5411 |
|
5412 |
|
5413 | ;
|
5414 |
|
5415 | _proto.isWithinBounds = function isWithinBounds(bbox) {
|
5416 | return this.mouseX >= bbox.left && this.mouseX <= bbox.left + bbox.width && this.mouseY >= bbox.top && this.mouseY <= bbox.top + bbox.height;
|
5417 | }
|
5418 | |
5419 |
|
5420 |
|
5421 | ;
|
5422 |
|
5423 | _proto.findChild = function findChild(el, query) {
|
5424 | var matches = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;
|
5425 | return Array.prototype.filter.call(el.children, function (child) {
|
5426 | return matches.call(child, query);
|
5427 | })[0];
|
5428 | };
|
5429 |
|
5430 | return SimpleBar;
|
5431 | }();
|
5432 |
|
5433 | SimpleBar.defaultOptions = {
|
5434 | autoHide: true,
|
5435 | forceVisible: false,
|
5436 | clickOnTrack: true,
|
5437 | classNames: {
|
5438 | contentEl: 'simplebar-content',
|
5439 | contentWrapper: 'simplebar-content-wrapper',
|
5440 | offset: 'simplebar-offset',
|
5441 | mask: 'simplebar-mask',
|
5442 | wrapper: 'simplebar-wrapper',
|
5443 | placeholder: 'simplebar-placeholder',
|
5444 | scrollbar: 'simplebar-scrollbar',
|
5445 | track: 'simplebar-track',
|
5446 | heightAutoObserverWrapperEl: 'simplebar-height-auto-observer-wrapper',
|
5447 | heightAutoObserverEl: 'simplebar-height-auto-observer',
|
5448 | visible: 'simplebar-visible',
|
5449 | horizontal: 'simplebar-horizontal',
|
5450 | vertical: 'simplebar-vertical',
|
5451 | hover: 'simplebar-hover',
|
5452 | dragging: 'simplebar-dragging'
|
5453 | },
|
5454 | scrollbarMinSize: 25,
|
5455 | scrollbarMaxSize: 0,
|
5456 | timeout: 1000
|
5457 | };
|
5458 | SimpleBar.instances = new WeakMap();
|
5459 |
|
5460 | SimpleBar.initDOMLoadedElements = function () {
|
5461 | document.removeEventListener('DOMContentLoaded', this.initDOMLoadedElements);
|
5462 | window.removeEventListener('load', this.initDOMLoadedElements);
|
5463 | Array.prototype.forEach.call(document.querySelectorAll('[data-simplebar]'), function (el) {
|
5464 | if (el.getAttribute('data-simplebar') !== 'init' && !SimpleBar.instances.has(el)) new SimpleBar(el, getOptions(el.attributes));
|
5465 | });
|
5466 | };
|
5467 |
|
5468 | SimpleBar.removeObserver = function () {
|
5469 | this.globalObserver.disconnect();
|
5470 | };
|
5471 |
|
5472 | SimpleBar.initHtmlApi = function () {
|
5473 | this.initDOMLoadedElements = this.initDOMLoadedElements.bind(this);
|
5474 |
|
5475 | if (typeof MutationObserver !== 'undefined') {
|
5476 |
|
5477 | this.globalObserver = new MutationObserver(SimpleBar.handleMutations);
|
5478 | this.globalObserver.observe(document, {
|
5479 | childList: true,
|
5480 | subtree: true
|
5481 | });
|
5482 | }
|
5483 |
|
5484 |
|
5485 |
|
5486 | if (document.readyState === 'complete' || document.readyState !== 'loading' && !document.documentElement.doScroll) {
|
5487 |
|
5488 | window.setTimeout(this.initDOMLoadedElements);
|
5489 | } else {
|
5490 | document.addEventListener('DOMContentLoaded', this.initDOMLoadedElements);
|
5491 | window.addEventListener('load', this.initDOMLoadedElements);
|
5492 | }
|
5493 | };
|
5494 |
|
5495 | SimpleBar.handleMutations = function (mutations) {
|
5496 | mutations.forEach(function (mutation) {
|
5497 | Array.prototype.forEach.call(mutation.addedNodes, function (addedNode) {
|
5498 | if (addedNode.nodeType === 1) {
|
5499 | if (addedNode.hasAttribute('data-simplebar')) {
|
5500 | !SimpleBar.instances.has(addedNode) && new SimpleBar(addedNode, getOptions(addedNode.attributes));
|
5501 | } else {
|
5502 | Array.prototype.forEach.call(addedNode.querySelectorAll('[data-simplebar]'), function (el) {
|
5503 | if (el.getAttribute('data-simplebar') !== 'init' && !SimpleBar.instances.has(el)) new SimpleBar(el, getOptions(el.attributes));
|
5504 | });
|
5505 | }
|
5506 | }
|
5507 | });
|
5508 | Array.prototype.forEach.call(mutation.removedNodes, function (removedNode) {
|
5509 | if (removedNode.nodeType === 1) {
|
5510 | if (removedNode.hasAttribute('[data-simplebar="init"]')) {
|
5511 | SimpleBar.instances.has(removedNode) && SimpleBar.instances.get(removedNode).unMount();
|
5512 | } else {
|
5513 | Array.prototype.forEach.call(removedNode.querySelectorAll('[data-simplebar="init"]'), function (el) {
|
5514 | SimpleBar.instances.has(el) && SimpleBar.instances.get(el).unMount();
|
5515 | });
|
5516 | }
|
5517 | }
|
5518 | });
|
5519 | });
|
5520 | };
|
5521 |
|
5522 | SimpleBar.getOptions = getOptions;
|
5523 | |
5524 |
|
5525 |
|
5526 |
|
5527 |
|
5528 | if (canUseDom) {
|
5529 | SimpleBar.initHtmlApi();
|
5530 | }
|
5531 |
|
5532 | return SimpleBar;
|
5533 |
|
5534 | }));
|