vendor: 6,449 bytes, lines 1-197
1/** 2 * SimpleBar.js - v5.3.6 3 * Scrollbars, simpler. 4 * https://grsmto.github.io/simplebar/ 5 * 6 * Made by Adrien Denat from a fork by Jonathan Nicol 7 * Under MIT License 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 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 28 var global_1 = 29 // eslint-disable-next-line no-undef 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 // eslint-disable-next-line no-new-func 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 // Thank's IE8 for his funny defineProperty 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 // Nashorn ~ JDK8 bug 54 var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1); 55 56 // `Object.prototype.propertyIsEnumerable` method implementation 57 // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable 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 // fallback for non-array-like ES3 and non-enumerable old V8 strings 85 var indexedObject = fails(function () { 86 // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 87 // eslint-disable-next-line no-prototype-builtins 88 return !Object('z').propertyIsEnumerable(0); 89 }) ? function (it) { 90 return classofRaw(it) == 'String' ? split.call(it, '') : Object(it); 91 } : Object; 92 93 // `RequireObjectCoercible` abstract operation 94 // https://tc39.github.io/ecma262/#sec-requireobjectcoercible 95 var requireObjectCoercible = function (it) { 96 if (it == undefined) throw TypeError("Can't call method on " + it); 97 return it; 98 }; 99 100 // toObject with fallback for non-array-like ES3 strings 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 // `ToPrimitive` abstract operation 113 // https://tc39.github.io/ecma262/#sec-toprimitive 114 // instead of the ES6 spec version, we didn't implement @@toPrimitive case 115 // and the second argument - flag - preferred type is a string 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 // typeof document.createElement is 'object' in old IE 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 // Thank's IE8 for his funny defineProperty 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 // `Object.getOwnPropertyDescriptor` method 149 // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor 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) { /* empty */ } 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 // `Object.defineProperty` method 172 // https://tc39.github.io/ecma262/#sec-object.defineproperty 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) { /* empty */ } 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 {
vendor: 2,744 bytes, lines 198-304
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;
vendor: 5,974 bytes, lines 305-489
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 // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative 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 // `ToInteger` abstract operation 341 // https://tc39.github.io/ecma262/#sec-tointeger 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 // `ToLength` abstract operation 349 // https://tc39.github.io/ecma262/#sec-tolength 350 var toLength = function (argument) { 351 return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 352 }; 353 354 var max = Math.max; 355 var min$1 = Math.min; 356 357 // Helper for a popular repeating case of the spec: 358 // Let integer be ? ToInteger(index). 359 // If integer < 0, let result be max((length + integer), 0); else let result be min(length, length). 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 // `Array.prototype.{ indexOf, includes }` methods implementation 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 // Array#includes uses SameValueZero equality algorithm 373 // eslint-disable-next-line no-self-compare 374 if (IS_INCLUDES && el != el) while (length > index) { 375 value = O[index++]; 376 // eslint-disable-next-line no-self-compare 377 if (value != value) return true; 378 // Array#indexOf ignores holes, Array#includes - not 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 // `Array.prototype.includes` method 387 // https://tc39.github.io/ecma262/#sec-array.prototype.includes 388 includes: createMethod(true), 389 // `Array.prototype.indexOf` method 390 // https://tc39.github.io/ecma262/#sec-array.prototype.indexof 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 // Don't enum bug & hidden keys 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 // IE8- don't enum bug keys 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 // `Object.getOwnPropertyNames` method 424 // https://tc39.github.io/ecma262/#sec-object.getownpropertynames 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 // all object keys, includes non-enumerable and symbols 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 options.target - name of the target object 485 options.global - target is the global object 486 options.stat - export as static methods of target 487 options.proto - export as prototype methods of target 488 options.real - real prototype method for the `pure` version 489 options.forced - export even if the native feature is available
vendor: 5,359 bytes, lines 490-640
490 options.bind - bind methods to the target, required for the `pure` version 491 options.wrap - wrap constructors to preventing global pollution, required for the `pure` version 492 options.unsafe - use the simple assignment of property instead of delete + defineProperty 493 options.sham - add a flag to not completely full polyfills 494 options.enumerable - export as enumerable property 495 options.noTargetGet - prevent calling a getter on target 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 // contained in target 517 if (!FORCED && targetProperty !== undefined) { 518 if (typeof sourceProperty === typeof targetProperty) continue; 519 copyConstructorProperties(sourceProperty, targetProperty); 520 } 521 // add a flag to not completely full polyfills 522 if (options.sham || (targetProperty && targetProperty.sham)) { 523 hide(sourceProperty, 'sham', true); 524 } 525 // extend global 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 // optional / simple context binding 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 // `ToObject` abstract operation 560 // https://tc39.github.io/ecma262/#sec-toobject 561 var toObject = function (argument) { 562 return Object(requireObjectCoercible(argument)); 563 }; 564 565 // `IsArray` abstract operation 566 // https://tc39.github.io/ecma262/#sec-isarray 567 var isArray = Array.isArray || function isArray(arg) { 568 return classofRaw(arg) == 'Array'; 569 }; 570 571 var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () { 572 // Chrome 38 Symbol has incorrect toString conversion 573 // eslint-disable-next-line no-undef 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 // `ArraySpeciesCreate` abstract operation 588 // https://tc39.github.io/ecma262/#sec-arrayspeciescreate 589 var arraySpeciesCreate = function (originalArray, length) { 590 var C; 591 if (isArray(originalArray)) { 592 C = originalArray.constructor; 593 // cross-realm fallback 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 // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation 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; // map 626 else if (result) switch (TYPE) { 627 case 3: return true; // some 628 case 5: return value; // find 629 case 6: return index; // findIndex 630 case 2: push.call(target, value); // filter 631 } else if (IS_EVERY) return false; // every 632 } 633 } 634 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; 635 }; 636 }; 637 638 var arrayIteration = { 639 // `Array.prototype.forEach` method 640 // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
641 forEach: createMethod$1(0), 642 // `Array.prototype.map` method 643 // https://tc39.github.io/ecma262/#sec-array.prototype.map 644 map: createMethod$1(1), 645 // `Array.prototype.filter` method 646 // https://tc39.github.io/ecma262/#sec-array.prototype.filter 647 filter: createMethod$1(2), 648 // `Array.prototype.some` method 649 // https://tc39.github.io/ecma262/#sec-array.prototype.some 650 some: createMethod$1(3), 651 // `Array.prototype.every` method 652 // https://tc39.github.io/ecma262/#sec-array.prototype.every 653 every: createMethod$1(4), 654 // `Array.prototype.find` method 655 // https://tc39.github.io/ecma262/#sec-array.prototype.find 656 find: createMethod$1(5), 657 // `Array.prototype.findIndex` method 658 // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex 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 // eslint-disable-next-line no-useless-call,no-throw-literal 666 method.call(null, argument || function () { throw 1; }, 1); 667 }); 668 }; 669 670 var $forEach = arrayIteration.forEach; 671 672 673 // `Array.prototype.forEach` method implementation 674 // https://tc39.github.io/ecma262/#sec-array.prototype.foreach 675 var arrayForEach = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) { 676 return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); 677 } : [].forEach; 678 679 // `Array.prototype.forEach` method 680 // https://tc39.github.io/ecma262/#sec-array.prototype.foreach 681 _export({ target: 'Array', proto: true, forced: [].forEach != arrayForEach }, { 682 forEach: arrayForEach 683 }); 684 685 // iterable DOM collections 686 // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods 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 // some Chrome versions have non-configurable methods on DOMTokenList 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 // `Array.prototype.filter` method 757 // https://tc39.github.io/ecma262/#sec-array.prototype.filter 758 // with adding support of @@species 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 // `Object.keys` method 766 // https://tc39.github.io/ecma262/#sec-object.keys 767 var objectKeys = Object.keys || function keys(O) { 768 return objectKeysInternal(O, enumBugKeys); 769 }; 770 771 // `Object.defineProperties` method 772 // https://tc39.github.io/ecma262/#sec-object.defineproperties 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 () { /* empty */ }; 789 790 // Create object with fake `null` prototype: use iframe Object with cleared prototype 791 var createDict = function () {
vendor: 11,612 bytes, lines 792-1100
792 // Thrash, waste and sodomy: IE GC bug 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 // `Object.create` method 813 // https://tc39.github.io/ecma262/#sec-object.create 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 // add "__proto__" for Object.getPrototypeOf polyfill 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 // Array.prototype[@@unscopables] 832 // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables 833 if (ArrayPrototype[UNSCOPABLES] == undefined) { 834 hide(ArrayPrototype, UNSCOPABLES, objectCreate(null)); 835 } 836 837 // add a key to Array.prototype[@@unscopables] 838 var addToUnscopables = function (key) { 839 ArrayPrototype[UNSCOPABLES][key] = true; 840 }; 841 842 var iterators = {}; 843 844 var correctPrototypeGetter = !fails(function () { 845 function F() { /* empty */ } 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 // `Object.getPrototypeOf` method 854 // https://tc39.github.io/ecma262/#sec-object.getprototypeof 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 // `%IteratorPrototype%` object 869 // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object 870 var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; 871 872 if ([].keys) { 873 arrayIterator = [].keys(); 874 // Safari 8 has buggy iterators w/o `next` 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 // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() 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 // `Object.setPrototypeOf` method 927 // https://tc39.github.io/ecma262/#sec-object.setprototypeof 928 // Works with __proto__ only. Old v8 can't work with null proto objects. 929 /* eslint-disable no-proto */ 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) { /* empty */ } 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 // fix native 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 // Set @@toStringTag to native iterators 992 setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true); 993 } 994 } 995 996 // fix Array#{values, @@iterator}.name in V8 / FF 997 if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { 998 INCORRECT_VALUES_NAME = true; 999 defaultIterator = function values() { return nativeIterator.call(this); }; 1000 } 1001 1002 // define iterator 1003 if ( IterablePrototype[ITERATOR$1] !== defaultIterator) { 1004 hide(IterablePrototype, ITERATOR$1, defaultIterator); 1005 } 1006 iterators[NAME] = defaultIterator; 1007 1008 // export additional methods 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 // `Array.prototype.entries` method 1030 // https://tc39.github.io/ecma262/#sec-array.prototype.entries 1031 // `Array.prototype.keys` method 1032 // https://tc39.github.io/ecma262/#sec-array.prototype.keys 1033 // `Array.prototype.values` method 1034 // https://tc39.github.io/ecma262/#sec-array.prototype.values 1035 // `Array.prototype[@@iterator]` method 1036 // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator 1037 // `CreateArrayIterator` internal method 1038 // https://tc39.github.io/ecma262/#sec-createarrayiterator 1039 var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) { 1040 setInternalState(this, { 1041 type: ARRAY_ITERATOR, 1042 target: toIndexedObject(iterated), // target 1043 index: 0, // next index 1044 kind: kind // kind 1045 }); 1046 // `%ArrayIteratorPrototype%.next` method 1047 // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next 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 // argumentsList[@@iterator] is %ArrayProto_values% 1063 // https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject 1064 // https://tc39.github.io/ecma262/#sec-createmappedargumentsobject 1065 iterators.Arguments = iterators.Array; 1066 1067 // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables 1068 addToUnscopables('keys'); 1069 addToUnscopables('values'); 1070 addToUnscopables('entries'); 1071 1072 var nativeAssign = Object.assign; 1073 1074 // `Object.assign` method 1075 // https://tc39.github.io/ecma262/#sec-object.assign 1076 // should work with symbols and should have deterministic property order (V8 bug) 1077 var objectAssign = !nativeAssign || fails(function () { 1078 var A = {}; 1079 var B = {}; 1080 // eslint-disable-next-line no-undef 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) { // eslint-disable-line no-unused-vars 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[ke
vendor: 3,030 bytes, lines 1100-1187
1100y] = S[key]; 1101 } 1102 } return T; 1103 } : nativeAssign; 1104 1105 // `Object.assign` method 1106 // https://tc39.github.io/ecma262/#sec-object.assign 1107 _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, { 1108 assign: objectAssign 1109 }); 1110 1111 var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag'); 1112 // ES3 wrong here 1113 var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments'; 1114 1115 // fallback for IE11 Script Access Denied error 1116 var tryGet = function (it, key) { 1117 try { 1118 return it[key]; 1119 } catch (error) { /* empty */ } 1120 }; 1121 1122 // getting tag from ES6+ `Object.prototype.toString` 1123 var classof = function (it) { 1124 var O, tag, result; 1125 return it === undefined ? 'Undefined' : it === null ? 'Null' 1126 // @@toStringTag case 1127 : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$1)) == 'string' ? tag 1128 // builtinTag case 1129 : CORRECT_ARGUMENTS ? classofRaw(O) 1130 // ES3 arguments fallback 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 // `Object.prototype.toString` method implementation 1140 // https://tc39.github.io/ecma262/#sec-object.prototype.tostring 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 // `Object.prototype.toString` method 1148 // https://tc39.github.io/ecma262/#sec-object.prototype.tostring 1149 if (objectToString !== ObjectPrototype$1.toString) { 1150 redefine(ObjectPrototype$1, 'toString', objectToString, { unsafe: true }); 1151 } 1152 1153 // a string of all valid unicode whitespaces 1154 // eslint-disable-next-line max-len 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 // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation 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 // `String.prototype.{ trimLeft, trimStart }` methods 1173 // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart 1174 start: createMethod$2(1), 1175 // `String.prototype.{ trimRight, trimEnd }` methods 1176 // https://tc39.github.io/ecma262/#sec-string.prototype.trimend 1177 end: createMethod$2(2), 1178 // `String.prototype.trim` method 1179 // https://tc39.github.io/ecma262/#sec-string.prototype.trim 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]/;
vendor: 7,100 bytes, lines 1188-1404
1188 var FORCED = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22; 1189 1190 // `parseInt` method 1191 // https://tc39.github.io/ecma262/#sec-parseint-string-radix 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 // `parseInt` method 1198 // https://tc39.github.io/ecma262/#sec-parseint-string-radix 1199 _export({ global: true, forced: parseInt != _parseInt }, { 1200 parseInt: _parseInt 1201 }); 1202 1203 // `String.prototype.{ codePointAt, at }` methods implementation 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 // `String.prototype.codePointAt` method 1221 // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat 1222 codeAt: createMethod$3(false), 1223 // `String.prototype.at` method 1224 // https://github.com/mathiasbynens/String.prototype.at 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 // `String.prototype[@@iterator]` method 1237 // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator 1238 defineIterator(String, 'String', function (iterated) { 1239 setInternalState$1(this, { 1240 type: STRING_ITERATOR, 1241 string: String(iterated), 1242 index: 0 1243 }); 1244 // `%StringIteratorPrototype%.next` method 1245 // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next 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, // object ID 1281 weakData: {} // weak collections IDs 1282 } }); 1283 }; 1284 1285 var fastKey = function (it, create) { 1286 // return a primitive with prefix 1287 if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; 1288 if (!has(it, METADATA)) { 1289 // can't set metadata to uncaught frozen object 1290 if (!isExtensible(it)) return 'F'; 1291 // not necessary to add metadata 1292 if (!create) return 'E'; 1293 // add missing metadata 1294 setMetadata(it); 1295 // return object ID 1296 } return it[METADATA].objectID; 1297 }; 1298 1299 var getWeakData = function (it, create) { 1300 if (!has(it, METADATA)) { 1301 // can't set metadata to uncaught frozen object 1302 if (!isExtensible(it)) return true; 1303 // not necessary to add metadata 1304 if (!create) return false; 1305 // add missing metadata 1306 setMetadata(it); 1307 // return the store of weak collections IDs 1308 } return it[METADATA].weakData; 1309 }; 1310 1311 // add metadata on freeze-family methods calling 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 // check on default Array iterator 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 // call something on iterator step with safe closing on error 1348 var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) { 1349 try { 1350 return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); 1351 // 7.4.6 IteratorClose(iterator, completion) 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 // optimisation for array iterators 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;
vendor: 5,293 bytes, lines 1405-1553
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 // eslint-disable-next-line no-throw-literal 1420 Array.from(iteratorWithReturn, function () { throw 2; }); 1421 } catch (error) { /* empty */ } 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) { /* empty */ } 1437 return ITERATION_SUPPORT; 1438 }; 1439 1440 // makes subclassing work correct for wrapped built-ins 1441 var inheritIfRequired = function ($this, dummy, Wrapper) { 1442 var NewTarget, NewTargetPrototype; 1443 if ( 1444 // it can work only with native `setPrototypeOf` 1445 objectSetPrototypeOf && 1446 // we haven't completely correct pre-ES6 way for getting `new.target`, so use this 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 // eslint-disable-next-line max-len 1482 if (isForced_1(CONSTRUCTOR_NAME, typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () { 1483 new NativeConstructor().entries().next(); 1484 })))) { 1485 // create collection constructor 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 // early implementations not supports chaining 1491 var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; 1492 // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false 1493 var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); 1494 // most early implementations doesn't supports iterables, most modern - not close it correctly 1495 // eslint-disable-next-line no-new 1496 var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); }); 1497 // for early implementations -0 and +0 not the same 1498 var BUGGY_ZERO = !IS_WEAK && fails(function () { 1499 // V8 ~ Chromium 42- fails only with 5+ elements 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 // weak collections should not contains .clear method 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 // fallback for uncaught frozen keys 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 // 23.3.3.2 WeakMap.prototype.delete(key) 1615 // 23.4.3.3 WeakSet.prototype.delete(value) 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 // 23.3.3.4 WeakMap.prototype.has(key) 1624 // 23.4.3.4 WeakSet.prototype.has(value) 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 // 23.3.3.3 WeakMap.prototype.get(key) 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 // 23.3.3.5 WeakMap.prototype.set(key, value) 1645 set: function set(key, value) { 1646 return define(this, key, value); 1647 } 1648 } : { 1649 // 23.4.3.1 WeakSet.prototype.add(value) 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 // some Chrome versions have non-configurable methods on DOMTokenList 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 // some Chrome versions have non-configurable methods on DOMTokenList 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
vendor: 9,219 bytes, lines 1754-2022
1754 /** 1755 * lodash (Custom Build) <https://lodash.com/> 1756 * Build: `lodash modularize exports="npm" -o ./` 1757 * Copyright jQuery Foundation and other contributors <https://jquery.org/> 1758 * Released under MIT license <https://lodash.com/license> 1759 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 1760 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 1761 */ 1762 1763 /** Used as the `TypeError` message for "Functions" methods. */ 1764 var FUNC_ERROR_TEXT = 'Expected a function'; 1765 1766 /** Used as references for various `Number` constants. */ 1767 var NAN = 0 / 0; 1768 1769 /** `Object#toString` result references. */ 1770 var symbolTag = '[object Symbol]'; 1771 1772 /** Used to match leading and trailing whitespace. */ 1773 var reTrim = /^\s+|\s+$/g; 1774 1775 /** Used to detect bad signed hexadecimal string values. */ 1776 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; 1777 1778 /** Used to detect binary string values. */ 1779 var reIsBinary = /^0b[01]+$/i; 1780 1781 /** Used to detect octal string values. */ 1782 var reIsOctal = /^0o[0-7]+$/i; 1783 1784 /** Built-in method references without a dependency on `root`. */ 1785 var freeParseInt = parseInt; 1786 1787 /** Detect free variable `global` from Node.js. */ 1788 var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; 1789 1790 /** Detect free variable `self`. */ 1791 var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 1792 1793 /** Used as a reference to the global object. */ 1794 var root = freeGlobal || freeSelf || Function('return this')(); 1795 1796 /** Used for built-in method references. */ 1797 var objectProto = Object.prototype; 1798 1799 /** 1800 * Used to resolve the 1801 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 1802 * of values. 1803 */ 1804 var objectToString$1 = objectProto.toString; 1805 1806 /* Built-in method references for those with the same name as other `lodash` methods. */ 1807 var nativeMax = Math.max, 1808 nativeMin = Math.min; 1809 1810 /** 1811 * Gets the timestamp of the number of milliseconds that have elapsed since 1812 * the Unix epoch (1 January 1970 00:00:00 UTC). 1813 * 1814 * @static 1815 * @memberOf _ 1816 * @since 2.4.0 1817 * @category Date 1818 * @returns {number} Returns the timestamp. 1819 * @example 1820 * 1821 * _.defer(function(stamp) { 1822 * console.log(_.now() - stamp); 1823 * }, _.now()); 1824 * // => Logs the number of milliseconds it took for the deferred invocation. 1825 */ 1826 var now = function() { 1827 return root.Date.now(); 1828 }; 1829 1830 /** 1831 * Creates a debounced function that delays invoking `func` until after `wait` 1832 * milliseconds have elapsed since the last time the debounced function was 1833 * invoked. The debounced function comes with a `cancel` method to cancel 1834 * delayed `func` invocations and a `flush` method to immediately invoke them. 1835 * Provide `options` to indicate whether `func` should be invoked on the 1836 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked 1837 * with the last arguments provided to the debounced function. Subsequent 1838 * calls to the debounced function return the result of the last `func` 1839 * invocation. 1840 * 1841 * **Note:** If `leading` and `trailing` options are `true`, `func` is 1842 * invoked on the trailing edge of the timeout only if the debounced function 1843 * is invoked more than once during the `wait` timeout. 1844 * 1845 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 1846 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 1847 * 1848 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 1849 * for details over the differences between `_.debounce` and `_.throttle`. 1850 * 1851 * @static 1852 * @memberOf _ 1853 * @since 0.1.0 1854 * @category Function 1855 * @param {Function} func The function to debounce. 1856 * @param {number} [wait=0] The number of milliseconds to delay. 1857 * @param {Object} [options={}] The options object. 1858 * @param {boolean} [options.leading=false] 1859 * Specify invoking on the leading edge of the timeout. 1860 * @param {number} [options.maxWait] 1861 * The maximum time `func` is allowed to be delayed before it's invoked. 1862 * @param {boolean} [options.trailing=true] 1863 * Specify invoking on the trailing edge of the timeout. 1864 * @returns {Function} Returns the new debounced function. 1865 * @example 1866 * 1867 * // Avoid costly calculations while the window size is in flux. 1868 * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); 1869 * 1870 * // Invoke `sendMail` when clicked, debouncing subsequent calls. 1871 * jQuery(element).on('click', _.debounce(sendMail, 300, { 1872 * 'leading': true, 1873 * 'trailing': false 1874 * })); 1875 * 1876 * // Ensure `batchLog` is invoked once after 1 second of debounced calls. 1877 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); 1878 * var source = new EventSource('/stream'); 1879 * jQuery(source).on('message', debounced); 1880 * 1881 * // Cancel the trailing debounced invocation. 1882 * jQuery(window).on('popstate', debounced.cancel); 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 // Reset any `maxWait` timer. 1919 lastInvokeTime = time; 1920 // Start the timer for the trailing edge. 1921 timerId = setTimeout(timerExpired, wait); 1922 // Invoke the leading edge. 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 // Either this is the first call, activity has stopped and we're at the 1939 // trailing edge, the system time has gone backwards and we're treating 1940 // it as the trailing edge, or we've hit the `maxWait` limit. 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 // Restart the timer. 1951 timerId = setTimeout(timerExpired, remainingWait(time)); 1952 } 1953 1954 function trailingEdge(time) { 1955 timerId = undefined; 1956 1957 // Only invoke if we have `lastArgs` which means `func` has been 1958 // debounced at least once. 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 // Handle invocations in a tight loop. 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 * Creates a throttled function that only invokes `func` at most once per 2008 * every `wait` milliseconds. The throttled function comes with a `cancel` 2009 * method to cancel delayed `func` invocations and a `flush` method to 2010 * immediately invoke them. Provide `options` to indicate whether `func` 2011 * should be invoked on the leading and/or trailing edge of the `wait` 2012 * timeout. The `func` is invoked with the last arguments provided to the 2013 * throttled function. Subsequent calls to the throttled function return the 2014 * result of the last `func` invocation. 2015 * 2016 * **Note:** If `leading` and `trailing` options are `true`, `func` is 2017 * invoked on the trailing edge of the timeout only if the throttled function 2018 * is invoked more than once during the `wait` timeout. 2019 * 2020 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 2021 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 2022 *
2023 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 2024 * for details over the differences between `_.throttle` and `_.debounce`. 2025 * 2026 * @static 2027 * @memberOf _ 2028 * @since 0.1.0 2029 * @category Function 2030 * @param {Function} func The function to throttle. 2031 * @param {number} [wait=0] The number of milliseconds to throttle invocations to. 2032 * @param {Object} [options={}] The options object. 2033 * @param {boolean} [options.leading=true] 2034 * Specify invoking on the leading edge of the timeout. 2035 * @param {boolean} [options.trailing=true] 2036 * Specify invoking on the trailing edge of the timeout. 2037 * @returns {Function} Returns the new throttled function. 2038 * @example 2039 * 2040 * // Avoid excessively updating the position while scrolling. 2041 * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); 2042 * 2043 * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. 2044 * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); 2045 * jQuery(element).on('click', throttled); 2046 * 2047 * // Cancel the trailing throttled invocation. 2048 * jQuery(window).on('popstate', throttled.cancel); 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 * Checks if `value` is the 2070 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 2071 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 2072 * 2073 * @static 2074 * @memberOf _ 2075 * @since 0.1.0 2076 * @category Lang 2077 * @param {*} value The value to check. 2078 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 2079 * @example 2080 * 2081 * _.isObject({}); 2082 * // => true 2083 * 2084 * _.isObject([1, 2, 3]); 2085 * // => true 2086 * 2087 * _.isObject(_.noop); 2088 * // => true 2089 * 2090 * _.isObject(null); 2091 * // => false 2092 */ 2093 function isObject$1(value) { 2094 var type = typeof value; 2095 return !!value && (type == 'object' || type == 'function'); 2096 } 2097 2098 /** 2099 * Checks if `value` is object-like. A value is object-like if it's not `null` 2100 * and has a `typeof` result of "object". 2101 * 2102 * @static 2103 * @memberOf _ 2104 * @since 4.0.0 2105 * @category Lang 2106 * @param {*} value The value to check. 2107 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 2108 * @example 2109 * 2110 * _.isObjectLike({}); 2111 * // => true 2112 * 2113 * _.isObjectLike([1, 2, 3]); 2114 * // => true 2115 * 2116 * _.isObjectLike(_.noop); 2117 * // => false 2118 * 2119 * _.isObjectLike(null); 2120 * // => false 2121 */ 2122 function isObjectLike(value) { 2123 return !!value && typeof value == 'object'; 2124 } 2125 2126 /** 2127 * Checks if `value` is classified as a `Symbol` primitive or object. 2128 * 2129 * @static 2130 * @memberOf _ 2131 * @since 4.0.0 2132 * @category Lang 2133 * @param {*} value The value to check. 2134 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. 2135 * @example 2136 * 2137 * _.isSymbol(Symbol.iterator); 2138 * // => true 2139 * 2140 * _.isSymbol('abc'); 2141 * // => false 2142 */ 2143 function isSymbol(value) { 2144 return typeof value == 'symbol' || 2145 (isObjectLike(value) && objectToString$1.call(value) == symbolTag); 2146 } 2147 2148 /** 2149 * Converts `value` to a number. 2150 * 2151 * @static 2152 * @memberOf _ 2153 * @since 4.0.0 2154 * @category Lang 2155 * @param {*} value The value to process. 2156 * @returns {number} Returns the number. 2157 * @example 2158 * 2159 * _.toNumber(3.2); 2160 * // => 3.2 2161 * 2162 * _.toNumber(Number.MIN_VALUE); 2163 * // => 5e-324 2164 * 2165 * _.toNumber(Infinity); 2166 * // => Infinity 2167 * 2168 * _.toNumber('3.2'); 2169 * // => 3.2 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 * lodash (Custom Build) <https://lodash.com/> 2196 * Build: `lodash modularize exports="npm" -o ./` 2197 * Copyright jQuery Foundation and other contributors <https://jquery.org/> 2198 * Released under MIT license <https://lodash.com/license> 2199 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 2200 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 2201 */ 2202 2203 /** Used as the `TypeError` message for "Functions" methods. */
vendor: 11,258 bytes, lines 2204-2581
2204 var FUNC_ERROR_TEXT$1 = 'Expected a function'; 2205 2206 /** Used as references for various `Number` constants. */ 2207 var NAN$1 = 0 / 0; 2208 2209 /** `Object#toString` result references. */ 2210 var symbolTag$1 = '[object Symbol]'; 2211 2212 /** Used to match leading and trailing whitespace. */ 2213 var reTrim$1 = /^\s+|\s+$/g; 2214 2215 /** Used to detect bad signed hexadecimal string values. */ 2216 var reIsBadHex$1 = /^[-+]0x[0-9a-f]+$/i; 2217 2218 /** Used to detect binary string values. */ 2219 var reIsBinary$1 = /^0b[01]+$/i; 2220 2221 /** Used to detect octal string values. */ 2222 var reIsOctal$1 = /^0o[0-7]+$/i; 2223 2224 /** Built-in method references without a dependency on `root`. */ 2225 var freeParseInt$1 = parseInt; 2226 2227 /** Detect free variable `global` from Node.js. */ 2228 var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; 2229 2230 /** Detect free variable `self`. */ 2231 var freeSelf$1 = typeof self == 'object' && self && self.Object === Object && self; 2232 2233 /** Used as a reference to the global object. */ 2234 var root$1 = freeGlobal$1 || freeSelf$1 || Function('return this')(); 2235 2236 /** Used for built-in method references. */ 2237 var objectProto$1 = Object.prototype; 2238 2239 /** 2240 * Used to resolve the 2241 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 2242 * of values. 2243 */ 2244 var objectToString$2 = objectProto$1.toString; 2245 2246 /* Built-in method references for those with the same name as other `lodash` methods. */ 2247 var nativeMax$1 = Math.max, 2248 nativeMin$1 = Math.min; 2249 2250 /** 2251 * Gets the timestamp of the number of milliseconds that have elapsed since 2252 * the Unix epoch (1 January 1970 00:00:00 UTC). 2253 * 2254 * @static 2255 * @memberOf _ 2256 * @since 2.4.0 2257 * @category Date 2258 * @returns {number} Returns the timestamp. 2259 * @example 2260 * 2261 * _.defer(function(stamp) { 2262 * console.log(_.now() - stamp); 2263 * }, _.now()); 2264 * // => Logs the number of milliseconds it took for the deferred invocation. 2265 */ 2266 var now$1 = function() { 2267 return root$1.Date.now(); 2268 }; 2269 2270 /** 2271 * Creates a debounced function that delays invoking `func` until after `wait` 2272 * milliseconds have elapsed since the last time the debounced function was 2273 * invoked. The debounced function comes with a `cancel` method to cancel 2274 * delayed `func` invocations and a `flush` method to immediately invoke them. 2275 * Provide `options` to indicate whether `func` should be invoked on the 2276 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked 2277 * with the last arguments provided to the debounced function. Subsequent 2278 * calls to the debounced function return the result of the last `func` 2279 * invocation. 2280 * 2281 * **Note:** If `leading` and `trailing` options are `true`, `func` is 2282 * invoked on the trailing edge of the timeout only if the debounced function 2283 * is invoked more than once during the `wait` timeout. 2284 * 2285 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 2286 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 2287 * 2288 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 2289 * for details over the differences between `_.debounce` and `_.throttle`. 2290 * 2291 * @static 2292 * @memberOf _ 2293 * @since 0.1.0 2294 * @category Function 2295 * @param {Function} func The function to debounce. 2296 * @param {number} [wait=0] The number of milliseconds to delay. 2297 * @param {Object} [options={}] The options object. 2298 * @param {boolean} [options.leading=false] 2299 * Specify invoking on the leading edge of the timeout. 2300 * @param {number} [options.maxWait] 2301 * The maximum time `func` is allowed to be delayed before it's invoked. 2302 * @param {boolean} [options.trailing=true] 2303 * Specify invoking on the trailing edge of the timeout. 2304 * @returns {Function} Returns the new debounced function. 2305 * @example 2306 * 2307 * // Avoid costly calculations while the window size is in flux. 2308 * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); 2309 * 2310 * // Invoke `sendMail` when clicked, debouncing subsequent calls. 2311 * jQuery(element).on('click', _.debounce(sendMail, 300, { 2312 * 'leading': true, 2313 * 'trailing': false 2314 * })); 2315 * 2316 * // Ensure `batchLog` is invoked once after 1 second of debounced calls. 2317 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); 2318 * var source = new EventSource('/stream'); 2319 * jQuery(source).on('message', debounced); 2320 * 2321 * // Cancel the trailing debounced invocation. 2322 * jQuery(window).on('popstate', debounced.cancel); 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 // Reset any `maxWait` timer. 2359 lastInvokeTime = time; 2360 // Start the timer for the trailing edge. 2361 timerId = setTimeout(timerExpired, wait); 2362 // Invoke the leading edge. 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 // Either this is the first call, activity has stopped and we're at the 2379 // trailing edge, the system time has gone backwards and we're treating 2380 // it as the trailing edge, or we've hit the `maxWait` limit. 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 // Restart the timer. 2391 timerId = setTimeout(timerExpired, remainingWait(time)); 2392 } 2393 2394 function trailingEdge(time) { 2395 timerId = undefined; 2396 2397 // Only invoke if we have `lastArgs` which means `func` has been 2398 // debounced at least once. 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 // Handle invocations in a tight loop. 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 * Checks if `value` is the 2448 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 2449 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 2450 * 2451 * @static 2452 * @memberOf _ 2453 * @since 0.1.0 2454 * @category Lang 2455 * @param {*} value The value to check. 2456 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 2457 * @example 2458 * 2459 * _.isObject({}); 2460 * // => true 2461 * 2462 * _.isObject([1, 2, 3]); 2463 * // => true 2464 * 2465 * _.isObject(_.noop); 2466 * // => true 2467 * 2468 * _.isObject(null); 2469 * // => false 2470 */ 2471 function isObject$2(value) { 2472 var type = typeof value; 2473 return !!value && (type == 'object' || type == 'function'); 2474 } 2475 2476 /** 2477 * Checks if `value` is object-like. A value is object-like if it's not `null` 2478 * and has a `typeof` result of "object". 2479 * 2480 * @static 2481 * @memberOf _ 2482 * @since 4.0.0 2483 * @category Lang 2484 * @param {*} value The value to check. 2485 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 2486 * @example 2487 * 2488 * _.isObjectLike({}); 2489 * // => true 2490 * 2491 * _.isObjectLike([1, 2, 3]); 2492 * // => true 2493 * 2494 * _.isObjectLike(_.noop); 2495 * // => false 2496 * 2497 * _.isObjectLike(null); 2498 * // => false 2499 */ 2500 function isObjectLike$1(value) { 2501 return !!value && typeof value == 'object'; 2502 } 2503 2504 /** 2505 * Checks if `value` is classified as a `Symbol` primitive or object. 2506 * 2507 * @static 2508 * @memberOf _ 2509 * @since 4.0.0 2510 * @category Lang 2511 * @param {*} value The value to check. 2512 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. 2513 * @example 2514 * 2515 * _.isSymbol(Symbol.iterator); 2516 * // => true 2517 * 2518 * _.isSymbol('abc'); 2519 * // => false 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 * Converts `value` to a number. 2528 * 2529 * @static 2530 * @memberOf _ 2531 * @since 4.0.0 2532 * @category Lang 2533 * @param {*} value The value to process. 2534 * @returns {number} Returns the number. 2535 * @example 2536 * 2537 * _.toNumber(3.2); 2538 * // => 3.2 2539 * 2540 * _.toNumber(Number.MIN_VALUE); 2541 * // => 5e-324 2542 * 2543 * _.toNumber(Infinity); 2544 * // => Infinity 2545 * 2546 * _.toNumber('3.2'); 2547 * // => 3.2 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 * lodash (Custom Build) <https://lodash.com/> 2574 * Build: `lodash modularize exports="npm" -o ./` 2575 * Copyright jQuery Foundation and other contributors <https://jquery.org/> 2576 * Released under MIT license <https://lodash.com/license> 2577 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 2578 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 2579 */ 2580 2581 /** Used as the `TypeError` message for "Functions" methods. */
2582 var FUNC_ERROR_TEXT$2 = 'Expected a function'; 2583 2584 /** Used to stand-in for `undefined` hash values. */ 2585 var HASH_UNDEFINED = '__lodash_hash_undefined__'; 2586 2587 /** `Object#toString` result references. */ 2588 var funcTag = '[object Function]', 2589 genTag = '[object GeneratorFunction]'; 2590 2591 /** 2592 * Used to match `RegExp` 2593 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). 2594 */ 2595 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; 2596 2597 /** Used to detect host constructors (Safari). */ 2598 var reIsHostCtor = /^\[object .+?Constructor\]$/; 2599 2600 /** Detect free variable `global` from Node.js. */ 2601 var freeGlobal$2 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; 2602 2603 /** Detect free variable `self`. */ 2604 var freeSelf$2 = typeof self == 'object' && self && self.Object === Object && self; 2605 2606 /** Used as a reference to the global object. */ 2607 var root$2 = freeGlobal$2 || freeSelf$2 || Function('return this')(); 2608 2609 /** 2610 * Gets the value at `key` of `object`. 2611 * 2612 * @private 2613 * @param {Object} [object] The object to query. 2614 * @param {string} key The key of the property to get. 2615 * @returns {*} Returns the property value. 2616 */ 2617 function getValue(object, key) { 2618 return object == null ? undefined : object[key]; 2619 } 2620 2621 /** 2622 * Checks if `value` is a host object in IE < 9. 2623 * 2624 * @private 2625 * @param {*} value The value to check. 2626 * @returns {boolean} Returns `true` if `value` is a host object, else `false`. 2627 */ 2628 function isHostObject(value) { 2629 // Many host objects are `Object` objects that can coerce to strings 2630 // despite having improperly defined `toString` methods. 2631 var result = false;
vendor: 4,190 bytes, lines 2632-2795
2632 if (value != null && typeof value.toString != 'function') { 2633 try { 2634 result = !!(value + ''); 2635 } catch (e) {} 2636 } 2637 return result; 2638 } 2639 2640 /** Used for built-in method references. */ 2641 var arrayProto = Array.prototype, 2642 funcProto = Function.prototype, 2643 objectProto$2 = Object.prototype; 2644 2645 /** Used to detect overreaching core-js shims. */ 2646 var coreJsData = root$2['__core-js_shared__']; 2647 2648 /** Used to detect methods masquerading as native. */ 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 /** Used to resolve the decompiled source of functions. */ 2655 var funcToString = funcProto.toString; 2656 2657 /** Used to check objects for own properties. */ 2658 var hasOwnProperty$1 = objectProto$2.hasOwnProperty; 2659 2660 /** 2661 * Used to resolve the 2662 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 2663 * of values. 2664 */ 2665 var objectToString$3 = objectProto$2.toString; 2666 2667 /** Used to detect if a method is native. */ 2668 var reIsNative = RegExp('^' + 2669 funcToString.call(hasOwnProperty$1).replace(reRegExpChar, '\\$&') 2670 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' 2671 ); 2672 2673 /** Built-in value references. */ 2674 var splice = arrayProto.splice; 2675 2676 /* Built-in method references that are verified to be native. */ 2677 var Map = getNative(root$2, 'Map'), 2678 nativeCreate = getNative(Object, 'create'); 2679 2680 /** 2681 * Creates a hash object. 2682 * 2683 * @private 2684 * @constructor 2685 * @param {Array} [entries] The key-value pairs to cache. 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 * Removes all key-value entries from the hash. 2700 * 2701 * @private 2702 * @name clear 2703 * @memberOf Hash 2704 */ 2705 function hashClear() { 2706 this.__data__ = nativeCreate ? nativeCreate(null) : {}; 2707 } 2708 2709 /** 2710 * Removes `key` and its value from the hash. 2711 * 2712 * @private 2713 * @name delete 2714 * @memberOf Hash 2715 * @param {Object} hash The hash to modify. 2716 * @param {string} key The key of the value to remove. 2717 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 2718 */ 2719 function hashDelete(key) { 2720 return this.has(key) && delete this.__data__[key]; 2721 } 2722 2723 /** 2724 * Gets the hash value for `key`. 2725 * 2726 * @private 2727 * @name get 2728 * @memberOf Hash 2729 * @param {string} key The key of the value to get. 2730 * @returns {*} Returns the entry value. 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 * Checks if a hash value for `key` exists. 2743 * 2744 * @private 2745 * @name has 2746 * @memberOf Hash 2747 * @param {string} key The key of the entry to check. 2748 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 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 * Sets the hash `key` to `value`. 2757 * 2758 * @private 2759 * @name set 2760 * @memberOf Hash 2761 * @param {string} key The key of the value to set. 2762 * @param {*} value The value to set. 2763 * @returns {Object} Returns the hash instance. 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 // Add methods to `Hash`. 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 * Creates an list cache object. 2780 * 2781 * @private 2782 * @constructor 2783 * @param {Array} [entries] The key-value pairs to cache. 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
vendor: 4,451 bytes, lines 2796-2989
2796 /** 2797 * Removes all key-value entries from the list cache. 2798 * 2799 * @private 2800 * @name clear 2801 * @memberOf ListCache 2802 */ 2803 function listCacheClear() { 2804 this.__data__ = []; 2805 } 2806 2807 /** 2808 * Removes `key` and its value from the list cache. 2809 * 2810 * @private 2811 * @name delete 2812 * @memberOf ListCache 2813 * @param {string} key The key of the value to remove. 2814 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 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 * Gets the list cache value for `key`. 2834 * 2835 * @private 2836 * @name get 2837 * @memberOf ListCache 2838 * @param {string} key The key of the value to get. 2839 * @returns {*} Returns the entry value. 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 * Checks if a list cache value for `key` exists. 2850 * 2851 * @private 2852 * @name has 2853 * @memberOf ListCache 2854 * @param {string} key The key of the entry to check. 2855 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 2856 */ 2857 function listCacheHas(key) { 2858 return assocIndexOf(this.__data__, key) > -1; 2859 } 2860 2861 /** 2862 * Sets the list cache `key` to `value`. 2863 * 2864 * @private 2865 * @name set 2866 * @memberOf ListCache 2867 * @param {string} key The key of the value to set. 2868 * @param {*} value The value to set. 2869 * @returns {Object} Returns the list cache instance. 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 // Add methods to `ListCache`. 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 * Creates a map cache object to store key-value pairs. 2892 * 2893 * @private 2894 * @constructor 2895 * @param {Array} [entries] The key-value pairs to cache. 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 * Removes all key-value entries from the map. 2910 * 2911 * @private 2912 * @name clear 2913 * @memberOf MapCache 2914 */ 2915 function mapCacheClear() { 2916 this.__data__ = { 2917 'hash': new Hash, 2918 'map': new (Map || ListCache), 2919 'string': new Hash 2920 }; 2921 } 2922 2923 /** 2924 * Removes `key` and its value from the map. 2925 * 2926 * @private 2927 * @name delete 2928 * @memberOf MapCache 2929 * @param {string} key The key of the value to remove. 2930 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 2931 */ 2932 function mapCacheDelete(key) { 2933 return getMapData(this, key)['delete'](key); 2934 } 2935 2936 /** 2937 * Gets the map value for `key`. 2938 * 2939 * @private 2940 * @name get 2941 * @memberOf MapCache 2942 * @param {string} key The key of the value to get. 2943 * @returns {*} Returns the entry value. 2944 */ 2945 function mapCacheGet(key) { 2946 return getMapData(this, key).get(key); 2947 } 2948 2949 /** 2950 * Checks if a map value for `key` exists. 2951 * 2952 * @private 2953 * @name has 2954 * @memberOf MapCache 2955 * @param {string} key The key of the entry to check. 2956 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 2957 */ 2958 function mapCacheHas(key) { 2959 return getMapData(this, key).has(key); 2960 } 2961 2962 /** 2963 * Sets the map `key` to `value`. 2964 * 2965 * @private 2966 * @name set 2967 * @memberOf MapCache 2968 * @param {string} key The key of the value to set. 2969 * @param {*} value The value to set. 2970 * @returns {Object} Returns the map cache instance. 2971 */ 2972 function mapCacheSet(key, value) { 2973 getMapData(this, key).set(key, value); 2974 return this; 2975 } 2976 2977 // Add methods to `MapCache`. 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 * Gets the index at which the `key` is found in `array` of key-value pairs. 2986 * 2987 * @private 2988 * @param {Array} array The array to inspect. 2989 * @param {*}
vendor: 5,856 bytes, lines 2989-3210
2989 key The key to search for. 2990 * @returns {number} Returns the index of the matched value, else `-1`. 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 * The base implementation of `_.isNative` without bad shim checks. 3004 * 3005 * @private 3006 * @param {*} value The value to check. 3007 * @returns {boolean} Returns `true` if `value` is a native function, 3008 * else `false`. 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 * Gets the data for `map`. 3020 * 3021 * @private 3022 * @param {Object} map The map to query. 3023 * @param {string} key The reference key. 3024 * @returns {*} Returns the map data. 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 * Gets the native function at `key` of `object`. 3035 * 3036 * @private 3037 * @param {Object} object The object to query. 3038 * @param {string} key The key of the method to get. 3039 * @returns {*} Returns the function if it's native, else `undefined`. 3040 */ 3041 function getNative(object, key) { 3042 var value = getValue(object, key); 3043 return baseIsNative(value) ? value : undefined; 3044 } 3045 3046 /** 3047 * Checks if `value` is suitable for use as unique object key. 3048 * 3049 * @private 3050 * @param {*} value The value to check. 3051 * @returns {boolean} Returns `true` if `value` is suitable, else `false`. 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 * Checks if `func` has its source masked. 3062 * 3063 * @private 3064 * @param {Function} func The function to check. 3065 * @returns {boolean} Returns `true` if `func` is masked, else `false`. 3066 */ 3067 function isMasked(func) { 3068 return !!maskSrcKey && (maskSrcKey in func); 3069 } 3070 3071 /** 3072 * Converts `func` to its source code. 3073 * 3074 * @private 3075 * @param {Function} func The function to process. 3076 * @returns {string} Returns the source code. 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 * Creates a function that memoizes the result of `func`. If `resolver` is 3092 * provided, it determines the cache key for storing the result based on the 3093 * arguments provided to the memoized function. By default, the first argument 3094 * provided to the memoized function is used as the map cache key. The `func` 3095 * is invoked with the `this` binding of the memoized function. 3096 * 3097 * **Note:** The cache is exposed as the `cache` property on the memoized 3098 * function. Its creation may be customized by replacing the `_.memoize.Cache` 3099 * constructor with one whose instances implement the 3100 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) 3101 * method interface of `delete`, `get`, `has`, and `set`. 3102 * 3103 * @static 3104 * @memberOf _ 3105 * @since 0.1.0 3106 * @category Function 3107 * @param {Function} func The function to have its output memoized. 3108 * @param {Function} [resolver] The function to resolve the cache key. 3109 * @returns {Function} Returns the new memoized function. 3110 * @example 3111 * 3112 * var object = { 'a': 1, 'b': 2 }; 3113 * var other = { 'c': 3, 'd': 4 }; 3114 * 3115 * var values = _.memoize(_.values); 3116 * values(object); 3117 * // => [1, 2] 3118 * 3119 * values(other); 3120 * // => [3, 4] 3121 * 3122 * object.a = 2; 3123 * values(object); 3124 * // => [1, 2] 3125 * 3126 * // Modify the result cache. 3127 * values.cache.set(object, ['a', 'b']); 3128 * values(object); 3129 * // => ['a', 'b'] 3130 * 3131 * // Replace `_.memoize.Cache`. 3132 * _.memoize.Cache = WeakMap; 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 // Assign cache to `_.memoize`. 3155 memoize.Cache = MapCache; 3156 3157 /** 3158 * Performs a 3159 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 3160 * comparison between two values to determine if they are equivalent. 3161 * 3162 * @static 3163 * @memberOf _ 3164 * @since 4.0.0 3165 * @category Lang 3166 * @param {*} value The value to compare. 3167 * @param {*} other The other value to compare. 3168 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 3169 * @example 3170 * 3171 * var object = { 'a': 1 }; 3172 * var other = { 'a': 1 }; 3173 * 3174 * _.eq(object, object); 3175 * // => true 3176 * 3177 * _.eq(object, other); 3178 * // => false 3179 * 3180 * _.eq('a', 'a'); 3181 * // => true 3182 * 3183 * _.eq('a', Object('a')); 3184 * // => false 3185 * 3186 * _.eq(NaN, NaN); 3187 * // => true 3188 */ 3189 function eq(value, other) { 3190 return value === other || (value !== value && other !== other); 3191 } 3192 3193 /** 3194 * Checks if `value` is classified as a `Function` object. 3195 * 3196 * @static 3197 * @memberOf _ 3198 * @since 0.1.0 3199 * @category Lang 3200 * @param {*} value The value to check. 3201 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 3202 * @example 3203 * 3204 * _.isFunction(_); 3205 * // => true 3206 * 3207 * _.isFunction(/abc/); 3208 * // => false 3209 */ 3210 function isFunction(value) {
vendor: 4,210 bytes, lines 3211-3334
3211 // The use of `Object#toString` avoids issues with the `typeof` operator 3212 // in Safari 8-9 which returns 'object' for typed array and other constructors. 3213 var tag = isObject$3(value) ? objectToString$3.call(value) : ''; 3214 return tag == funcTag || tag == genTag; 3215 } 3216 3217 /** 3218 * Checks if `value` is the 3219 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 3220 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 3221 * 3222 * @static 3223 * @memberOf _ 3224 * @since 0.1.0 3225 * @category Lang 3226 * @param {*} value The value to check. 3227 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 3228 * @example 3229 * 3230 * _.isObject({}); 3231 * // => true 3232 * 3233 * _.isObject([1, 2, 3]); 3234 * // => true 3235 * 3236 * _.isObject(_.noop); 3237 * // => true 3238 * 3239 * _.isObject(null); 3240 * // => false 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 var resizeObservers = []; 3250 3251 var hasActiveObservations = function () { 3252 return resizeObservers.some(function (ro) { return ro.activeTargets.length > 0; }); 3253 }; 3254 3255 var hasSkippedObservations = function () { 3256 return resizeObservers.some(function (ro) { return ro.skippedTargets.length > 0; }); 3257 }; 3258 3259 var msg = 'ResizeObserver loop completed with undelivered notifications.'; 3260 var deliverResizeLoopError = function () { 3261 var event; 3262 if (typeof ErrorEvent === 'function') { 3263 event = new ErrorEvent('error', { 3264 message: msg 3265 }); 3266 } 3267 else { 3268 event = document.createEvent('Event'); 3269 event.initEvent('error', false, false); 3270 event.message = msg; 3271 } 3272 window.dispatchEvent(event); 3273 }; 3274 3275 var ResizeObserverBoxOptions; 3276 (function (ResizeObserverBoxOptions) { 3277 ResizeObserverBoxOptions["BORDER_BOX"] = "border-box"; 3278 ResizeObserverBoxOptions["CONTENT_BOX"] = "content-box"; 3279 ResizeObserverBoxOptions["DEVICE_PIXEL_CONTENT_BOX"] = "device-pixel-content-box"; 3280 })(ResizeObserverBoxOptions || (ResizeObserverBoxOptions = {})); 3281 3282 var freeze = function (obj) { return Object.freeze(obj); }; 3283 3284 var ResizeObserverSize = (function () { 3285 function ResizeObserverSize(inlineSize, blockSize) { 3286 this.inlineSize = inlineSize; 3287 this.blockSize = blockSize; 3288 freeze(this); 3289 } 3290 return ResizeObserverSize; 3291 }()); 3292 3293 var DOMRectReadOnly = (function () { 3294 function DOMRectReadOnly(x, y, width, height) { 3295 this.x = x; 3296 this.y = y; 3297 this.width = width; 3298 this.height = height; 3299 this.top = this.y; 3300 this.left = this.x; 3301 this.bottom = this.top + this.height; 3302 this.right = this.left + this.width; 3303 return freeze(this); 3304 } 3305 DOMRectReadOnly.prototype.toJSON = function () { 3306 var _a = this, x = _a.x, y = _a.y, top = _a.top, right = _a.right, bottom = _a.bottom, left = _a.left, width = _a.width, height = _a.height; 3307 return { x: x, y: y, top: top, right: right, bottom: bottom, left: left, width: width, height: height }; 3308 }; 3309 DOMRectReadOnly.fromRect = function (rectangle) { 3310 return new DOMRectReadOnly(rectangle.x, rectangle.y, rectangle.width, rectangle.height); 3311 }; 3312 return DOMRectReadOnly; 3313 }()); 3314 3315 var isSVG = function (target) { return target instanceof SVGElement && 'getBBox' in target; }; 3316 var isHidden = function (target) { 3317 if (isSVG(target)) { 3318 var _a = target.getBBox(), width = _a.width, height = _a.height; 3319 return !width && !height; 3320 } 3321 var _b = target, offsetWidth = _b.offsetWidth, offsetHeight = _b.offsetHeight; 3322 return !(offsetWidth || offsetHeight || target.getClientRects().length); 3323 }; 3324 var isElement = function (obj) { 3325 var _a, _b; 3326 if (obj instanceof Element) { 3327 return true; 3328 } 3329 var scope = (_b = (_a = obj) === null || _a === void 0 ? void 0 : _a.ownerDocument) === null || _b === void 0 ? void 0 : _b.defaultView; 3330 return !!(scope && obj instanceof scope.Element); 3331 }; 3332 var isReplacedElement = function (target) { 3333 switch (target.tagName) { 3334 case 'INPUT':
vendor: 5,443 bytes, lines 3335-3452
3335 if (target.type !== 'image') { 3336 break; 3337 } 3338 case 'VIDEO': 3339 case 'AUDIO': 3340 case 'EMBED': 3341 case 'OBJECT': 3342 case 'CANVAS': 3343 case 'IFRAME': 3344 case 'IMG': 3345 return true; 3346 } 3347 return false; 3348 }; 3349 3350 var global$1 = typeof window !== 'undefined' ? window : {}; 3351 3352 var cache = new WeakMap(); 3353 var scrollRegexp = /auto|scroll/; 3354 var verticalRegexp = /^tb|vertical/; 3355 var IE = (/msie|trident/i).test(global$1.navigator && global$1.navigator.userAgent); 3356 var parseDimension = function (pixel) { return parseFloat(pixel || '0'); }; 3357 var size = function (inlineSize, blockSize, switchSizes) { 3358 if (inlineSize === void 0) { inlineSize = 0; } 3359 if (blockSize === void 0) { blockSize = 0; } 3360 if (switchSizes === void 0) { switchSizes = false; } 3361 return new ResizeObserverSize((switchSizes ? blockSize : inlineSize) || 0, (switchSizes ? inlineSize : blockSize) || 0); 3362 }; 3363 var zeroBoxes = freeze({ 3364 devicePixelContentBoxSize: size(), 3365 borderBoxSize: size(), 3366 contentBoxSize: size(), 3367 contentRect: new DOMRectReadOnly(0, 0, 0, 0) 3368 }); 3369 var calculateBoxSizes = function (target, forceRecalculation) { 3370 if (forceRecalculation === void 0) { forceRecalculation = false; } 3371 if (cache.has(target) && !forceRecalculation) { 3372 return cache.get(target); 3373 } 3374 if (isHidden(target)) { 3375 cache.set(target, zeroBoxes); 3376 return zeroBoxes; 3377 } 3378 var cs = getComputedStyle(target); 3379 var svg = isSVG(target) && target.ownerSVGElement && target.getBBox(); 3380 var removePadding = !IE && cs.boxSizing === 'border-box'; 3381 var switchSizes = verticalRegexp.test(cs.writingMode || ''); 3382 var canScrollVertically = !svg && scrollRegexp.test(cs.overflowY || ''); 3383 var canScrollHorizontally = !svg && scrollRegexp.test(cs.overflowX || ''); 3384 var paddingTop = svg ? 0 : parseDimension(cs.paddingTop); 3385 var paddingRight = svg ? 0 : parseDimension(cs.paddingRight); 3386 var paddingBottom = svg ? 0 : parseDimension(cs.paddingBottom); 3387 var paddingLeft = svg ? 0 : parseDimension(cs.paddingLeft); 3388 var borderTop = svg ? 0 : parseDimension(cs.borderTopWidth); 3389 var borderRight = svg ? 0 : parseDimension(cs.borderRightWidth); 3390 var borderBottom = svg ? 0 : parseDimension(cs.borderBottomWidth); 3391 var borderLeft = svg ? 0 : parseDimension(cs.borderLeftWidth); 3392 var horizontalPadding = paddingLeft + paddingRight; 3393 var verticalPadding = paddingTop + paddingBottom; 3394 var horizontalBorderArea = borderLeft + borderRight; 3395 var verticalBorderArea = borderTop + borderBottom; 3396 var horizontalScrollbarThickness = !canScrollHorizontally ? 0 : target.offsetHeight - verticalBorderArea - target.clientHeight; 3397 var verticalScrollbarThickness = !canScrollVertically ? 0 : target.offsetWidth - horizontalBorderArea - target.clientWidth; 3398 var widthReduction = removePadding ? horizontalPadding + horizontalBorderArea : 0; 3399 var heightReduction = removePadding ? verticalPadding + verticalBorderArea : 0; 3400 var contentWidth = svg ? svg.width : parseDimension(cs.width) - widthReduction - verticalScrollbarThickness; 3401 var contentHeight = svg ? svg.height : parseDimension(cs.height) - heightReduction - horizontalScrollbarThickness; 3402 var borderBoxWidth = contentWidth + horizontalPadding + verticalScrollbarThickness + horizontalBorderArea; 3403 var borderBoxHeight = contentHeight + verticalPadding + horizontalScrollbarThickness + verticalBorderArea; 3404 var boxes = freeze({ 3405 devicePixelContentBoxSize: size(Math.round(contentWidth * devicePixelRatio), Math.round(contentHeight * devicePixelRatio), switchSizes), 3406 borderBoxSize: size(borderBoxWidth, borderBoxHeight, switchSizes), 3407 contentBoxSize: size(contentWidth, contentHeight, switchSizes), 3408 contentRect: new DOMRectReadOnly(paddingLeft, paddingTop, contentWidth, contentHeight) 3409 }); 3410 cache.set(target, boxes); 3411 return boxes; 3412 }; 3413 var calculateBoxSize = function (target, observedBox, forceRecalculation) { 3414 var _a = calculateBoxSizes(target, forceRecalculation), borderBoxSize = _a.borderBoxSize, contentBoxSize = _a.contentBoxSize, devicePixelContentBoxSize = _a.devicePixelContentBoxSize; 3415 switch (observedBox) { 3416 case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX: 3417 return devicePixelContentBoxSize; 3418 case ResizeObserverBoxOptions.BORDER_BOX: 3419 return borderBoxSize; 3420 default: 3421 return contentBoxSize; 3422 } 3423 }; 3424 3425 var ResizeObserverEntry = (function () { 3426 function ResizeObserverEntry(target) { 3427 var boxes = calculateBoxSizes(target); 3428 this.target = target; 3429 this.contentRect = boxes.contentRect; 3430 this.borderBoxSize = freeze([boxes.borderBoxSize]); 3431 this.contentBoxSize = freeze([boxes.contentBoxSize]); 3432 this.devicePixelContentBoxSize = freeze([boxes.devicePixelContentBoxSize]); 3433 } 3434 return ResizeObserverEntry; 3435 }()); 3436 3437 var calculateDepthForNode = function (node) { 3438 if (isHidden(node)) { 3439 return Infinity; 3440 } 3441 var depth = 0; 3442 var parent = node.parentNode; 3443 while (parent) { 3444 depth += 1; 3445 parent = parent.parentNode; 3446 } 3447 return depth; 3448 }; 3449 3450 var broadcastActiveObservations = function () { 3451 var shallowestDepth = Infinity; 3452 var callbacks = [];
vendor: 4,903 bytes, lines 3453-3604
3453 resizeObservers.forEach(function processObserver(ro) { 3454 if (ro.activeTargets.length === 0) { 3455 return; 3456 } 3457 var entries = []; 3458 ro.activeTargets.forEach(function processTarget(ot) { 3459 var entry = new ResizeObserverEntry(ot.target); 3460 var targetDepth = calculateDepthForNode(ot.target); 3461 entries.push(entry); 3462 ot.lastReportedSize = calculateBoxSize(ot.target, ot.observedBox); 3463 if (targetDepth < shallowestDepth) { 3464 shallowestDepth = targetDepth; 3465 } 3466 }); 3467 callbacks.push(function resizeObserverCallback() { 3468 ro.callback.call(ro.observer, entries, ro.observer); 3469 }); 3470 ro.activeTargets.splice(0, ro.activeTargets.length); 3471 }); 3472 for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) { 3473 var callback = callbacks_1[_i]; 3474 callback(); 3475 } 3476 return shallowestDepth; 3477 }; 3478 3479 var gatherActiveObservationsAtDepth = function (depth) { 3480 resizeObservers.forEach(function processObserver(ro) { 3481 ro.activeTargets.splice(0, ro.activeTargets.length); 3482 ro.skippedTargets.splice(0, ro.skippedTargets.length); 3483 ro.observationTargets.forEach(function processTarget(ot) { 3484 if (ot.isActive()) { 3485 if (calculateDepthForNode(ot.target) > depth) { 3486 ro.activeTargets.push(ot); 3487 } 3488 else { 3489 ro.skippedTargets.push(ot); 3490 } 3491 } 3492 }); 3493 }); 3494 }; 3495 3496 var process = function () { 3497 var depth = 0; 3498 gatherActiveObservationsAtDepth(depth); 3499 while (hasActiveObservations()) { 3500 depth = broadcastActiveObservations(); 3501 gatherActiveObservationsAtDepth(depth); 3502 } 3503 if (hasSkippedObservations()) { 3504 deliverResizeLoopError(); 3505 } 3506 return depth > 0; 3507 }; 3508 3509 var trigger; 3510 var callbacks = []; 3511 var notify = function () { return callbacks.splice(0).forEach(function (cb) { return cb(); }); }; 3512 var queueMicroTask = function (callback) { 3513 if (!trigger) { 3514 var toggle_1 = 0; 3515 var el_1 = document.createTextNode(''); 3516 var config = { characterData: true }; 3517 new MutationObserver(function () { return notify(); }).observe(el_1, config); 3518 trigger = function () { el_1.textContent = "" + (toggle_1 ? toggle_1-- : toggle_1++); }; 3519 } 3520 callbacks.push(callback); 3521 trigger(); 3522 }; 3523 3524 var queueResizeObserver = function (cb) { 3525 queueMicroTask(function ResizeObserver() { 3526 requestAnimationFrame(cb); 3527 }); 3528 }; 3529 3530 var watching = 0; 3531 var isWatching = function () { return !!watching; }; 3532 var CATCH_PERIOD = 250; 3533 var observerConfig = { attributes: true, characterData: true, childList: true, subtree: true }; 3534 var events = [ 3535 'resize', 3536 'load', 3537 'transitionend', 3538 'animationend', 3539 'animationstart', 3540 'animationiteration', 3541 'keyup', 3542 'keydown', 3543 'mouseup', 3544 'mousedown', 3545 'mouseover', 3546 'mouseout', 3547 'blur', 3548 'focus' 3549 ]; 3550 var time = function (timeout) { 3551 if (timeout === void 0) { timeout = 0; } 3552 return Date.now() + timeout; 3553 }; 3554 var scheduled = false; 3555 var Scheduler = (function () { 3556 function Scheduler() { 3557 var _this = this; 3558 this.stopped = true; 3559 this.listener = function () { return _this.schedule(); }; 3560 } 3561 Scheduler.prototype.run = function (timeout) { 3562 var _this = this; 3563 if (timeout === void 0) { timeout = CATCH_PERIOD; } 3564 if (scheduled) { 3565 return; 3566 } 3567 scheduled = true; 3568 var until = time(timeout); 3569 queueResizeObserver(function () { 3570 var elementsHaveResized = false; 3571 try { 3572 elementsHaveResized = process(); 3573 } 3574 finally { 3575 scheduled = false; 3576 timeout = until - time(); 3577 if (!isWatching()) { 3578 return; 3579 } 3580 if (elementsHaveResized) { 3581 _this.run(1000); 3582 } 3583 else if (timeout > 0) { 3584 _this.run(timeout); 3585 } 3586 else { 3587 _this.start(); 3588 } 3589 } 3590 }); 3591 }; 3592 Scheduler.prototype.schedule = function () { 3593 this.stop(); 3594 this.run(); 3595 }; 3596 Scheduler.prototype.observe = function () { 3597 var _this = this; 3598 var cb = function () { return _this.observer && _this.observer.observe(document.body, observerConfig); }; 3599 document.body ? cb() : global$1.addEventListener('DOMContentLoaded', cb); 3600 }; 3601 Scheduler.prototype.start = function () { 3602 var _this = this; 3603 if (this.stopped) { 3604 this.stopped = false;
vendor: 6,434 bytes, lines 3605-3764
3605 this.observer = new MutationObserver(this.listener); 3606 this.observe(); 3607 events.forEach(function (name) { return global$1.addEventListener(name, _this.listener, true); }); 3608 } 3609 }; 3610 Scheduler.prototype.stop = function () { 3611 var _this = this; 3612 if (!this.stopped) { 3613 this.observer && this.observer.disconnect(); 3614 events.forEach(function (name) { return global$1.removeEventListener(name, _this.listener, true); }); 3615 this.stopped = true; 3616 } 3617 }; 3618 return Scheduler; 3619 }()); 3620 var scheduler = new Scheduler(); 3621 var updateCount = function (n) { 3622 !watching && n > 0 && scheduler.start(); 3623 watching += n; 3624 !watching && scheduler.stop(); 3625 }; 3626 3627 var skipNotifyOnElement = function (target) { 3628 return !isSVG(target) 3629 && !isReplacedElement(target) 3630 && getComputedStyle(target).display === 'inline'; 3631 }; 3632 var ResizeObservation = (function () { 3633 function ResizeObservation(target, observedBox) { 3634 this.target = target; 3635 this.observedBox = observedBox || ResizeObserverBoxOptions.CONTENT_BOX; 3636 this.lastReportedSize = { 3637 inlineSize: 0, 3638 blockSize: 0 3639 }; 3640 } 3641 ResizeObservation.prototype.isActive = function () { 3642 var size = calculateBoxSize(this.target, this.observedBox, true); 3643 if (skipNotifyOnElement(this.target)) { 3644 this.lastReportedSize = size; 3645 } 3646 if (this.lastReportedSize.inlineSize !== size.inlineSize 3647 || this.lastReportedSize.blockSize !== size.blockSize) { 3648 return true; 3649 } 3650 return false; 3651 }; 3652 return ResizeObservation; 3653 }()); 3654 3655 var ResizeObserverDetail = (function () { 3656 function ResizeObserverDetail(resizeObserver, callback) { 3657 this.activeTargets = []; 3658 this.skippedTargets = []; 3659 this.observationTargets = []; 3660 this.observer = resizeObserver; 3661 this.callback = callback; 3662 } 3663 return ResizeObserverDetail; 3664 }()); 3665 3666 var observerMap = new WeakMap(); 3667 var getObservationIndex = function (observationTargets, target) { 3668 for (var i = 0; i < observationTargets.length; i += 1) { 3669 if (observationTargets[i].target === target) { 3670 return i; 3671 } 3672 } 3673 return -1; 3674 }; 3675 var ResizeObserverController = (function () { 3676 function ResizeObserverController() { 3677 } 3678 ResizeObserverController.connect = function (resizeObserver, callback) { 3679 var detail = new ResizeObserverDetail(resizeObserver, callback); 3680 observerMap.set(resizeObserver, detail); 3681 }; 3682 ResizeObserverController.observe = function (resizeObserver, target, options) { 3683 var detail = observerMap.get(resizeObserver); 3684 var firstObservation = detail.observationTargets.length === 0; 3685 if (getObservationIndex(detail.observationTargets, target) < 0) { 3686 firstObservation && resizeObservers.push(detail); 3687 detail.observationTargets.push(new ResizeObservation(target, options && options.box)); 3688 updateCount(1); 3689 scheduler.schedule(); 3690 } 3691 }; 3692 ResizeObserverController.unobserve = function (resizeObserver, target) { 3693 var detail = observerMap.get(resizeObserver); 3694 var index = getObservationIndex(detail.observationTargets, target); 3695 var lastObservation = detail.observationTargets.length === 1; 3696 if (index >= 0) { 3697 lastObservation && resizeObservers.splice(resizeObservers.indexOf(detail), 1); 3698 detail.observationTargets.splice(index, 1); 3699 updateCount(-1); 3700 } 3701 }; 3702 ResizeObserverController.disconnect = function (resizeObserver) { 3703 var _this = this; 3704 var detail = observerMap.get(resizeObserver); 3705 detail.observationTargets.slice().forEach(function (ot) { return _this.unobserve(resizeObserver, ot.target); }); 3706 detail.activeTargets.splice(0, detail.activeTargets.length); 3707 }; 3708 return ResizeObserverController; 3709 }()); 3710 3711 var ResizeObserver = (function () { 3712 function ResizeObserver(callback) { 3713 if (arguments.length === 0) { 3714 throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present."); 3715 } 3716 if (typeof callback !== 'function') { 3717 throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function."); 3718 } 3719 ResizeObserverController.connect(this, callback); 3720 } 3721 ResizeObserver.prototype.observe = function (target, options) { 3722 if (arguments.length === 0) { 3723 throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present."); 3724 } 3725 if (!isElement(target)) { 3726 throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element"); 3727 } 3728 ResizeObserverController.observe(this, target, options); 3729 }; 3730 ResizeObserver.prototype.unobserve = function (target) { 3731 if (arguments.length === 0) { 3732 throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present."); 3733 } 3734 if (!isElement(target)) { 3735 throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element"); 3736 } 3737 ResizeObserverController.unobserve(this, target); 3738 }; 3739 ResizeObserver.prototype.disconnect = function () { 3740 ResizeObserverController.disconnect(this); 3741 }; 3742 ResizeObserver.toString = function () { 3743 return 'function ResizeObserver () { [polyfill code] }'; 3744 }; 3745 return ResizeObserver; 3746 }()); 3747 3748 // `Array.prototype.{ reduce, reduceRight }` methods implementation 3749 var createMethod$4 = function (IS_RIGHT) { 3750 return function (that, callbackfn, argumentsLength, memo) { 3751 aFunction$1(callbackfn); 3752 var O = toObject(that); 3753 var self = indexedObject(O); 3754 var length = toLength(O.length); 3755 var index = IS_RIGHT ? length - 1 : 0; 3756 var i = IS_RIGHT ? -1 : 1; 3757 if (argumentsLength < 2) while (true) { 3758 if (index in self) { 3759 memo = self[index]; 3760 index += i; 3761 break; 3762 } 3763 index += i; 3764 if (IS_RIGHT ? index < 0 : length <= index) {
3765 throw TypeError('Reduce of empty array with no initial value'); 3766 } 3767 } 3768 for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) { 3769 memo = callbackfn(memo, self[index], index, O); 3770 } 3771 return memo; 3772 }; 3773 }; 3774 3775 var arrayReduce = { 3776 // `Array.prototype.reduce` method 3777 // https://tc39.github.io/ecma262/#sec-array.prototype.reduce 3778 left: createMethod$4(false), 3779 // `Array.prototype.reduceRight` method 3780 // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright 3781 right: createMethod$4(true) 3782 }; 3783 3784 var $reduce = arrayReduce.left; 3785 3786 3787 // `Array.prototype.reduce` method 3788 // https://tc39.github.io/ecma262/#sec-array.prototype.reduce 3789 _export({ target: 'Array', proto: true, forced: sloppyArrayMethod('reduce') }, { 3790 reduce: function reduce(callbackfn /* , initialValue */) { 3791 return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); 3792 } 3793 }); 3794 3795 var defineProperty$1 = objectDefineProperty.f; 3796 3797 var FunctionPrototype = Function.prototype; 3798 var FunctionPrototypeToString = FunctionPrototype.toString; 3799 var nameRE = /^\s*function ([^ (]*)/; 3800 var NAME = 'name'; 3801 3802 // Function instances `.name` property 3803 // https://tc39.github.io/ecma262/#sec-function-instances-name 3804 if (descriptors && !(NAME in FunctionPrototype)) { 3805 defineProperty$1(FunctionPrototype, NAME, { 3806 configurable: true, 3807 get: function () { 3808 try { 3809 return FunctionPrototypeToString.call(this).match(nameRE)[1]; 3810 } catch (error) { 3811 return ''; 3812 } 3813 } 3814 }); 3815 } 3816 3817 // `RegExp.prototype.flags` getter implementation 3818 // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags 3819 var regexpFlags = function () { 3820 var that = anObject(this); 3821 var result = ''; 3822 if (that.global) result += 'g'; 3823 if (that.ignoreCase) result += 'i'; 3824 if (that.multiline) result += 'm'; 3825 if (that.dotAll) result += 's'; 3826 if (that.unicode) result += 'u'; 3827 if (that.sticky) result += 'y'; 3828 return result; 3829 }; 3830 3831 var nativeExec = RegExp.prototype.exec; 3832 // This always refers to the native implementation, because the 3833 // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, 3834 // which loads this file before patching the method. 3835 var nativeReplace = String.prototype.replace; 3836 3837 var patchedExec = nativeExec; 3838 3839 var UPDATES_LAST_INDEX_WRONG = (function () { 3840 var re1 = /a/; 3841 var re2 = /b*/g; 3842 nativeExec.call(re1, 'a'); 3843 nativeExec.call(re2, 'a'); 3844 return re1.lastIndex !== 0 || re2.lastIndex !== 0; 3845 })(); 3846 3847 // nonparticipating capturing group, copied from es5-shim's String#split patch. 3848 var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; 3849 3850 var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED; 3851 3852 if (PATCH) { 3853 patchedExec = function exec(str) { 3854 var re = this; 3855 var lastIndex, reCopy, match, i; 3856 3857 if (NPCG_INCLUDED) { 3858 reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re)); 3859 } 3860 if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; 3861 3862 match = nativeExec.call(re, str); 3863 3864 if (UPDATES_LAST_INDEX_WRONG && match) { 3865 re.lastIndex = re.global ? match.index + match[0].length : lastIndex; 3866 } 3867 if (NPCG_INCLUDED && match && match.length > 1) { 3868 // Fix browsers whose `exec` methods don't consistently return `undefined` 3869 // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ 3870 nativeReplace.call(match[0], reCopy, function () { 3871 for (i = 1; i < arguments.length - 2; i++) { 3872 if (arguments[i] === undefined) match[i] = undefined; 3873 } 3874 }); 3875 } 3876 3877 return match; 3878 }; 3879 } 3880 3881 var regexpExec = patchedExec; 3882 3883 _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, { 3884 exec: regexpExec 3885 }); 3886 3887 var SPECIES$2 = wellKnownSymbol('species'); 3888 3889 var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { 3890 // #replace needs built-in support for named groups. 3891 // #match works fine because it just return the exec results, even if it has 3892 // a "grops" property. 3893 var re = /./; 3894 re.exec = function () { 3895 var result = []; 3896 result.groups = { a: '7' }; 3897 return result; 3898 }; 3899 return ''.replace(re, '$<a>') !== '7'; 3900 }); 3901 3902 // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec 3903 // Weex JS has frozen built-in prototypes, so use try / catch wrapper 3904 var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () { 3905 var re = /(?:)/; 3906 var originalExec = re.exec; 3907 re.exec = function () { return originalExec.apply(this, arguments); }; 3908 var result = 'ab'.split(re); 3909 return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b'; 3910 }); 3911 3912 var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) { 3913 var SYMBOL = wellKnownSymbol(KEY); 3914 3915 var DELEGATES_TO_SYMBOL = !fails(function () { 3916 // String methods call symbol-named RegEp methods 3917 var O = {}; 3918 O[SYMBOL] = function () { return 7; }; 3919 return ''[KEY](O) != 7; 3920 }); 3921 3922 var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () { 3923 // Symbol-named RegExp methods call .exec 3924 var execCalled = false;
vendor: 5,809 bytes, lines 3925-4086
3925 var re = /a/; 3926 re.exec = function () { execCalled = true; return null; }; 3927 3928 if (KEY === 'split') { 3929 // RegExp[@@split] doesn't call the regex's exec method, but first creates 3930 // a new one. We need to return the patched regex when creating the new one. 3931 re.constructor = {}; 3932 re.constructor[SPECIES$2] = function () { return re; }; 3933 } 3934 3935 re[SYMBOL](''); 3936 return !execCalled; 3937 }); 3938 3939 if ( 3940 !DELEGATES_TO_SYMBOL || 3941 !DELEGATES_TO_EXEC || 3942 (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) || 3943 (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) 3944 ) { 3945 var nativeRegExpMethod = /./[SYMBOL]; 3946 var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { 3947 if (regexp.exec === regexpExec) { 3948 if (DELEGATES_TO_SYMBOL && !forceStringMethod) { 3949 // The native String method already delegates to @@method (this 3950 // polyfilled function), leasing to infinite recursion. 3951 // We avoid it by directly calling the native @@method method. 3952 return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) }; 3953 } 3954 return { done: true, value: nativeMethod.call(str, regexp, arg2) }; 3955 } 3956 return { done: false }; 3957 }); 3958 var stringMethod = methods[0]; 3959 var regexMethod = methods[1]; 3960 3961 redefine(String.prototype, KEY, stringMethod); 3962 redefine(RegExp.prototype, SYMBOL, length == 2 3963 // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) 3964 // 21.2.5.11 RegExp.prototype[@@split](string, limit) 3965 ? function (string, arg) { return regexMethod.call(string, this, arg); } 3966 // 21.2.5.6 RegExp.prototype[@@match](string) 3967 // 21.2.5.9 RegExp.prototype[@@search](string) 3968 : function (string) { return regexMethod.call(string, this); } 3969 ); 3970 if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true); 3971 } 3972 }; 3973 3974 var charAt$1 = stringMultibyte.charAt; 3975 3976 // `AdvanceStringIndex` abstract operation 3977 // https://tc39.github.io/ecma262/#sec-advancestringindex 3978 var advanceStringIndex = function (S, index, unicode) { 3979 return index + (unicode ? charAt$1(S, index).length : 1); 3980 }; 3981 3982 // `RegExpExec` abstract operation 3983 // https://tc39.github.io/ecma262/#sec-regexpexec 3984 var regexpExecAbstract = function (R, S) { 3985 var exec = R.exec; 3986 if (typeof exec === 'function') { 3987 var result = exec.call(R, S); 3988 if (typeof result !== 'object') { 3989 throw TypeError('RegExp exec method returned something other than an Object or null'); 3990 } 3991 return result; 3992 } 3993 3994 if (classofRaw(R) !== 'RegExp') { 3995 throw TypeError('RegExp#exec called on incompatible receiver'); 3996 } 3997 3998 return regexpExec.call(R, S); 3999 }; 4000 4001 // @@match logic 4002 fixRegexpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) { 4003 return [ 4004 // `String.prototype.match` method 4005 // https://tc39.github.io/ecma262/#sec-string.prototype.match 4006 function match(regexp) { 4007 var O = requireObjectCoercible(this); 4008 var matcher = regexp == undefined ? undefined : regexp[MATCH]; 4009 return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); 4010 }, 4011 // `RegExp.prototype[@@match]` method 4012 // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match 4013 function (regexp) { 4014 var res = maybeCallNative(nativeMatch, regexp, this); 4015 if (res.done) return res.value; 4016 4017 var rx = anObject(regexp); 4018 var S = String(this); 4019 4020 if (!rx.global) return regexpExecAbstract(rx, S); 4021 4022 var fullUnicode = rx.unicode; 4023 rx.lastIndex = 0; 4024 var A = []; 4025 var n = 0; 4026 var result; 4027 while ((result = regexpExecAbstract(rx, S)) !== null) { 4028 var matchStr = String(result[0]); 4029 A[n] = matchStr; 4030 if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); 4031 n++; 4032 } 4033 return n === 0 ? null : A; 4034 } 4035 ]; 4036 }); 4037 4038 var max$1 = Math.max; 4039 var min$2 = Math.min; 4040 var floor$1 = Math.floor; 4041 var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g; 4042 var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g; 4043 4044 var maybeToString = function (it) { 4045 return it === undefined ? it : String(it); 4046 }; 4047 4048 // @@replace logic 4049 fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative) { 4050 return [ 4051 // `String.prototype.replace` method 4052 // https://tc39.github.io/ecma262/#sec-string.prototype.replace 4053 function replace(searchValue, replaceValue) { 4054 var O = requireObjectCoercible(this); 4055 var replacer = searchValue == undefined ? undefined : searchValue[REPLACE]; 4056 return replacer !== undefined 4057 ? replacer.call(searchValue, O, replaceValue) 4058 : nativeReplace.call(String(O), searchValue, replaceValue); 4059 }, 4060 // `RegExp.prototype[@@replace]` method 4061 // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace 4062 function (regexp, replaceValue) { 4063 var res = maybeCallNative(nativeReplace, regexp, this, replaceValue); 4064 if (res.done) return res.value; 4065 4066 var rx = anObject(regexp); 4067 var S = String(this); 4068 4069 var functionalReplace = typeof replaceValue === 'function'; 4070 if (!functionalReplace) replaceValue = String(replaceValue); 4071 4072 var global = rx.global; 4073 if (global) { 4074 var fullUnicode = rx.unicode; 4075 rx.lastIndex = 0; 4076 } 4077 var results = []; 4078 while (true) { 4079 var result = regexpExecAbstract(rx, S); 4080 if (result === null) break; 4081 4082 results.push(result); 4083 if (!global) break; 4084 4085 var matchStr = String(result[0]); 4086 if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLe
4086ngth(rx.lastIndex), fullUnicode); 4087 } 4088 4089 var accumulatedResult = ''; 4090 var nextSourcePosition = 0; 4091 for (var i = 0; i < results.length; i++) { 4092 result = results[i]; 4093 4094 var matched = String(result[0]); 4095 var position = max$1(min$2(toInteger(result.index), S.length), 0); 4096 var captures = []; 4097 // NOTE: This is equivalent to 4098 // captures = result.slice(1).map(maybeToString) 4099 // but for some reason `nativeSlice.call(result, 1, result.length)` (called in 4100 // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and 4101 // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. 4102 for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); 4103 var namedCaptures = result.groups; 4104 if (functionalReplace) { 4105 var replacerArgs = [matched].concat(captures, position, S); 4106 if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); 4107 var replacement = String(replaceValue.apply(undefined, replacerArgs)); 4108 } else { 4109 replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); 4110 } 4111 if (position >= nextSourcePosition) { 4112 accumulatedResult += S.slice(nextSourcePosition, position) + replacement; 4113 nextSourcePosition = position + matched.length; 4114 } 4115 } 4116 return accumulatedResult + S.slice(nextSourcePosition); 4117 } 4118 ]; 4119 4120 // https://tc39.github.io/ecma262/#sec-getsubstitution 4121 function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { 4122 var tailPos = position + matched.length; 4123 var m = captures.length; 4124 var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; 4125 if (namedCaptures !== undefined) { 4126 namedCaptures = toObject(namedCaptures); 4127 symbols = SUBSTITUTION_SYMBOLS; 4128 } 4129 return nativeReplace.call(replacement, symbols, function (match, ch) { 4130 var capture; 4131 switch (ch.charAt(0)) { 4132 case '$': return '$'; 4133 case '&': return matched; 4134 case '`': return str.slice(0, position); 4135 case "'": return str.slice(tailPos); 4136 case '<': 4137 capture = namedCaptures[ch.slice(1, -1)]; 4138 break; 4139 default: // \d\d? 4140 var n = +ch; 4141 if (n === 0) return match; 4142 if (n > m) { 4143 var f = floor$1(n / 10); 4144 if (f === 0) return match; 4145 if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); 4146 return match; 4147 } 4148 capture = captures[n - 1]; 4149 } 4150 return capture === undefined ? '' : capture; 4151 }); 4152 } 4153 }); 4154 4155 // Helper function to retrieve options from element attributes 4156 var getOptions = function getOptions(obj) { 4157 var options = Array.prototype.reduce.call(obj, function (acc, attribute) { 4158 var option = attribute.name.match(/data-simplebar-(.+)/); 4159 4160 if (option) { 4161 var key = option[1].replace(/\W+(.)/g, function (x, chr) { 4162 return chr.toUpperCase(); 4163 }); 4164 4165 switch (attribute.value) { 4166 case 'true': 4167 acc[key] = true; 4168 break; 4169 4170 case 'false': 4171 acc[key] = false; 4172 break; 4173 4174 case undefined: 4175 acc[key] = true; 4176 break; 4177 4178 default: 4179 acc[key] = attribute.value; 4180 } 4181 } 4182 4183 return acc; 4184 }, {}); 4185 return options; 4186 }; 4187 function getElementWindow(element) { 4188 if (!element || !element.ownerDocument || !element.ownerDocument.defaultView) { 4189 return window; 4190 } 4191 4192 return element.ownerDocument.defaultView; 4193 } 4194 function getElementDocument(element) { 4195 if (!element || !element.ownerDocument) { 4196 return document; 4197 } 4198 4199 return element.ownerDocument; 4200 } 4201 4202 var cachedScrollbarWidth = null; 4203 var cachedDevicePixelRatio = null; 4204 4205 if (canUseDom) { 4206 window.addEventListener('resize', function () { 4207 if (cachedDevicePixelRatio !== window.devicePixelRatio) { 4208 cachedDevicePixelRatio = window.devicePixelRatio; 4209 cachedScrollbarWidth = null; 4210 } 4211 }); 4212 } 4213 4214 function scrollbarWidth(el) { 4215 if (cachedScrollbarWidth === null) { 4216 var document = getElementDocument(el); 4217 4218 if (typeof document === 'undefined') { 4219 cachedScrollbarWidth = 0; 4220 return cachedScrollbarWidth; 4221 } 4222 4223 var body = document.body; 4224 var box = document.createElement('div'); 4225 box.classList.add('simplebar-hide-scrollbar'); 4226 body.appendChild(box); 4227 var width = box.getBoundingClientRect().right; 4228 body.removeChild(box); 4229 cachedScrollbarWidth = width; 4230 } 4231 4232 return cachedScrollbarWidth; 4233 } 4234 4235 var SimpleBar = 4236 /*#__PURE__*/ 4237 function () { 4238 function SimpleBar(element, options) { 4239 var _this = this; 4240 4241 this.onScroll = function () { 4242 var elWindow = getElementWindow(_this.el); 4243 4244 if (!_this.scrollXTicking) { 4245 elWindow.requestAnimationFrame(_this.scrollX); 4246 _this.scrollXTicking = true; 4247 } 4248 4249 if (!_this.scrollYTicking) { 4250 elWindow.requestAnimationFrame(_this.scrollY); 4251 _this.scrollYTicking = true; 4252 } 4253 }; 4254 4255 this.scrollX = function () { 4256 if (_this.axis.x.isOverflowing) { 4257 _this.showScrollbar('x'); 4258 4259 _this.positionScrollbar('x'); 4260 } 4261 4262 _this.scrollXTicking = false;
4263 }; 4264 4265 this.scrollY = function () { 4266 if (_this.axis.y.isOverflowing) { 4267 _this.showScrollbar('y'); 4268 4269 _this.positionScrollbar('y'); 4270 } 4271 4272 _this.scrollYTicking = false; 4273 }; 4274 4275 this.onMouseEnter = function () { 4276 _this.showScrollbar('x'); 4277 4278 _this.showScrollbar('y'); 4279 }; 4280 4281 this.onMouseMove = function (e) { 4282 _this.mouseX = e.clientX; 4283 _this.mouseY = e.clientY; 4284 4285 if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) { 4286 _this.onMouseMoveForAxis('x'); 4287 } 4288 4289 if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) { 4290 _this.onMouseMoveForAxis('y'); 4291 } 4292 }; 4293 4294 this.onMouseLeave = function () { 4295 _this.onMouseMove.cancel(); 4296 4297 if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) { 4298 _this.onMouseLeaveForAxis('x'); 4299 } 4300 4301 if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) { 4302 _this.onMouseLeaveForAxis('y'); 4303 } 4304 4305 _this.mouseX = -1; 4306 _this.mouseY = -1; 4307 }; 4308 4309 this.onWindowResize = function () { 4310 // Recalculate scrollbarWidth in case it's a zoom 4311 _this.scrollbarWidth = _this.getScrollbarWidth(); 4312 4313 _this.hideNativeScrollbar(); 4314 }; 4315 4316 this.hideScrollbars = function () { 4317 _this.axis.x.track.rect = _this.axis.x.track.el.getBoundingClientRect(); 4318 _this.axis.y.track.rect = _this.axis.y.track.el.getBoundingClientRect(); 4319 4320 if (!_this.isWithinBounds(_this.axis.y.track.rect)) { 4321 _this.axis.y.scrollbar.el.classList.remove(_this.classNames.visible); 4322 4323 _this.axis.y.isVisible = false; 4324 } 4325 4326 if (!_this.isWithinBounds(_this.axis.x.track.rect)) { 4327 _this.axis.x.scrollbar.el.classList.remove(_this.classNames.visible); 4328 4329 _this.axis.x.isVisible = false; 4330 } 4331 }; 4332 4333 this.onPointerEvent = function (e) { 4334 var isWithinTrackXBounds, isWithinTrackYBounds; 4335 _this.axis.x.track.rect = _this.axis.x.track.el.getBoundingClientRect(); 4336 _this.axis.y.track.rect = _this.axis.y.track.el.getBoundingClientRect(); 4337 4338 if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) { 4339 isWithinTrackXBounds = _this.isWithinBounds(_this.axis.x.track.rect); 4340 } 4341 4342 if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) { 4343 isWithinTrackYBounds = _this.isWithinBounds(_this.axis.y.track.rect); 4344 } // If any pointer event is called on the scrollbar 4345 4346 4347 if (isWithinTrackXBounds || isWithinTrackYBounds) { 4348 // Preventing the event's default action stops text being 4349 // selectable during the drag. 4350 e.preventDefault(); // Prevent event leaking 4351 4352 e.stopPropagation(); 4353 4354 if (e.type === 'mousedown') { 4355 if (isWithinTrackXBounds) { 4356 _this.axis.x.scrollbar.rect = _this.axis.x.scrollbar.el.getBoundingClientRect(); 4357 4358 if (_this.isWithinBounds(_this.axis.x.scrollbar.rect)) { 4359 _this.onDragStart(e, 'x'); 4360 } else { 4361 _this.onTrackClick(e, 'x'); 4362 } 4363 } 4364 4365 if (isWithinTrackYBounds) { 4366 _this.axis.y.scrollbar.rect = _this.axis.y.scrollbar.el.getBoundingClientRect(); 4367 4368 if (_this.isWithinBounds(_this.axis.y.scrollbar.rect)) { 4369 _this.onDragStart(e, 'y'); 4370 } else { 4371 _this.onTrackClick(e, 'y'); 4372 } 4373 } 4374 } 4375 } 4376 }; 4377 4378 this.drag = function (e) { 4379 var eventOffset; 4380 var track = _this.axis[_this.draggedAxis].track; 4381 var trackSize = track.rect[_this.axis[_this.draggedAxis].sizeAttr]; 4382 var scrollbar = _this.axis[_this.draggedAxis].scrollbar; 4383 var contentSize = _this.contentWrapperEl[_this.axis[_this.draggedAxis].scrollSizeAttr]; 4384 var hostSize = parseInt(_this.elStyles[_this.axis[_this.draggedAxis].sizeAttr], 10); 4385 e.preventDefault(); 4386 e.stopPropagation(); 4387 4388 if (_this.draggedAxis === 'y') { 4389 eventOffset = e.pageY; 4390 } else { 4391 eventOffset = e.pageX; 4392 } // Calculate how far the user's mouse is from the top/left of the scrollbar (minus the dragOffset). 4393 4394 4395 var dragPos = eventOffset - track.rect[_this.axis[_this.draggedAxis].offsetAttr] - _this.axis[_this.draggedAxis].dragOffset; // Convert the mouse position into a percentage of the scrollbar height/width. 4396 4397 var dragPerc = dragPos / (trackSize - scrollbar.size); // Scroll the content by the same percentage. 4398 4399 var scrollPos = dragPerc * (contentSize - hostSize); // Fix browsers inconsistency on RTL 4400 4401 if (_this.draggedAxis === 'x') { 4402 scrollPos = _this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollbarInverted ? scrollPos - (trackSize + scrollbar.size) : scrollPos; 4403 scrollPos = _this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollingInverted ? -scrollPos : scrollPos; 4404 } 4405 4406 _this.contentWrapperEl[_this.axis[_this.draggedAxis].scrollOffsetAttr] = scrollPos; 4407 }; 4408 4409 this.onEndDrag = function (e) { 4410 var elDocument = getElementDocument(_this.el); 4411 var elWindow = getElementWindow(_this.el); 4412 e.preventDefault(); 4413 e.stopPropagation(); 4414 4415 _this.el.classList.remove(_this.classNames.dragging); 4416 4417 elDocument.removeEventListener('mousemove', _this.drag, true); 4418 elDocument.removeEventListener('mouseup', _this.onEndDrag, true); 4419 _this.removePreventClickId = elWindow.setTimeout(function () { 4420 // Remove these asynchronously so we still suppress click events 4421 // generated simultaneously with mouseup. 4422 elDocument.removeEventListener('click', _this.preventClick, true); 4423 elDocument.removeEventListener('dblclick', _this.preventClick, true); 4424 _this.removePreventClickId = null; 4425 }); 4426 }; 4427 4428 this.preventClick = function (e) { 4429 e.preventDefault(); 4430 e.stopPropagation(); 4431 }; 4432 4433 this.el = element; 4434 this.minScrollbarWidth = 20; 4435 this.options = Object.assign({}, SimpleBar.defaultOptions, {}, options); 4436 this.classNames = Object.assign({}, SimpleBar.defaultOptions.classNames, {}, this.options.classNames); 4437 this.axis = { 4438 x: { 4439 scrollOffsetAttr: 'scrollLeft', 4440 sizeAttr: 'width', 4441 scrollSizeAttr: 'scrollWidth', 4442 offsetSizeAttr: 'offsetWidth', 4443 offsetAttr: 'left', 4444 overflowAttr: 'overflowX', 4445 dragOffset: 0, 4446 isOverflowing: true, 4447 isVisible: false, 4448 forceVisible: false, 4449 track: {}, 4450 scrollbar: {} 4451 }, 4452 y: { 4453 scrollOffsetAttr: 'scrollTop', 4454 sizeAttr: 'height', 4455 scrollSizeAttr: 'scrollHeight', 4456 offsetSizeAttr: 'offsetHeight', 4457 offsetAttr: 'top', 4458 overflowAttr: 'overflowY', 4459 dragOffset: 0, 4460 isOverflowing: true, 4461 isVisible: false, 4462 forceVisible: false, 4463 track: {}, 4464 scrollbar: {} 4465 } 4466 }; 4467 this.removePreventClickId = null; // Don't re-instantiate over an existing one 4468 4469 if (SimpleBar.instances.has(this.el)) { 4470 return; 4471 } 4472 4473 this.recalculate = lodash_throttle(this.recalculate.bind(this), 64); 4474 this.onMouseMove = lodash_throttle(this.onMouseMove.bind(this), 64); 4475 this.hideScrollbars = lodash_debounce(this.hideScrollbars.bind(this), this.options.timeout); 4476 this.onWindowResize = lodash_debounce(this.onWindowResize.bind(this), 64, { 4477 leading: true 4478 }); 4479 SimpleBar.getRtlHelpers = lodash_memoize(SimpleBar.getRtlHelpers); 4480 this.init(); 4481 } 4482 /** 4483 * Static properties 4484 */ 4485 4486 /** 4487 * Helper to fix browsers inconsistency on RTL: 4488 * - Firefox inverts the scrollbar initial position 4489 * - IE11 inverts both scrollbar position and scrolling offset 4490 * Directly inspired by @KingSora's OverlayScrollbars https://github.com/KingSora/OverlayScrollbars/blob/master/js/OverlayScrollbars.js#L1634 4491 */ 4492 4493 4494 SimpleBar.getRtlHelpers = function getRtlHelpers() { 4495 var dummyDiv = document.createElement('div'); 4496 dummyDiv.innerHTML = '<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>'; 4497 var scrollbarDummyEl = dummyDiv.firstElementChild; 4498 document.body.appendChild(scrollbarDummyEl); 4499 var dummyContainerChild = scrollbarDummyEl.firstElementChild; 4500 scrollbarDummyEl.scrollLeft = 0; 4501 var dummyContainerOffset = SimpleBar.getOffset(scrollbarDummyEl); 4502 var dummyContainerChildOffset = SimpleBar.getOffset(dummyContainerChild); 4503 scrollbarDummyEl.scrollLeft = 999; 4504 var dummyContainerScrollOffsetAfterScroll = SimpleBar.getOffset(dummyContainerChild); 4505 return { 4506 // determines if the scrolling is responding with negative values 4507 isRtlScrollingInverted: dummyContainerOffset.left !== dummyContainerChildOffset.left && dummyContainerChildOffset.left - dummyContainerScrollOffsetAfterScroll.left !== 0, 4508 // determines if the origin scrollbar position is inverted or not (positioned on left or right) 4509 isRtlScrollbarInverted: dummyContainerOffset.left !== dummyContainerChildOffset.left 4510 }; 4511 }; 4512 4513 SimpleBar.getOffset = function getOffset(el) { 4514 var rect = el.getBoundingClientRect(); 4515 var elDocument = getElementDocument(el); 4516 var elWindow = getElementWindow(el); 4517 return { 4518 top: rect.top + (elWindow.pageYOffset || elDocument.documentElement.scrollTop), 4519 left: rect.left + (elWindow.pageXOffset || elDocument.documentElement.scrollLeft) 4520 }; 4521 }; 4522 4523 var _proto = SimpleBar.prototype; 4524
4525 _proto.init = function init() { 4526 // Save a reference to the instance, so we know this DOM node has already been instancied 4527 SimpleBar.instances.set(this.el, this); // We stop here on server-side 4528 4529 if (canUseDom) { 4530 this.initDOM(); 4531 this.setAccessibilityAttributes(); 4532 this.scrollbarWidth = this.getScrollbarWidth(); 4533 this.recalculate(); 4534 this.initListeners(); 4535 } 4536 }; 4537 4538 _proto.initDOM = function initDOM() { 4539 var _this2 = this; 4540 4541 // make sure this element doesn't have the elements yet 4542 if (Array.prototype.filter.call(this.el.children, function (child) { 4543 return child.classList.contains(_this2.classNames.wrapper); 4544 }).length) { 4545 // assume that element has his DOM already initiated 4546 this.wrapperEl = this.el.querySelector("." + this.classNames.wrapper); 4547 this.contentWrapperEl = this.options.scrollableNode || this.el.querySelector("." + this.classNames.contentWrapper); 4548 this.contentEl = this.options.contentNode || this.el.querySelector("." + this.classNames.contentEl); 4549 this.offsetEl = this.el.querySelector("." + this.classNames.offset); 4550 this.maskEl = this.el.querySelector("." + this.classNames.mask); 4551 this.placeholderEl = this.findChild(this.wrapperEl, "." + this.classNames.placeholder); 4552 this.heightAutoObserverWrapperEl = this.el.querySelector("." + this.classNames.heightAutoObserverWrapperEl); 4553 this.heightAutoObserverEl = this.el.querySelector("." + this.classNames.heightAutoObserverEl); 4554 this.axis.x.track.el = this.findChild(this.el, "." + this.classNames.track + "." + this.classNames.horizontal); 4555 this.axis.y.track.el = this.findChild(this.el, "." + this.classNames.track + "." + this.classNames.vertical); 4556 } else { 4557 // Prepare DOM 4558 this.wrapperEl = document.createElement('div'); 4559 this.contentWrapperEl = document.createElement('div'); 4560 this.offsetEl = document.createElement('div'); 4561 this.maskEl = document.createElement('div'); 4562 this.contentEl = document.createElement('div'); 4563 this.placeholderEl = document.createElement('div'); 4564 this.heightAutoObserverWrapperEl = document.createElement('div'); 4565 this.heightAutoObserverEl = document.createElement('div'); 4566 this.wrapperEl.classList.add(this.classNames.wrapper); 4567 this.contentWrapperEl.classList.add(this.classNames.contentWrapper); 4568 this.offsetEl.classList.add(this.classNames.offset); 4569 this.maskEl.classList.add(this.classNames.mask); 4570 this.contentEl.classList.add(this.classNames.contentEl); 4571 this.placeholderEl.classList.add(this.classNames.placeholder); 4572 this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl); 4573 this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl); 4574 4575 while (this.el.firstChild) { 4576 this.contentEl.appendChild(this.el.firstChild); 4577 } 4578 4579 this.contentWrapperEl.appendChild(this.contentEl); 4580 this.offsetEl.appendChild(this.contentWrapperEl); 4581 this.maskEl.appendChild(this.offsetEl); 4582 this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl); 4583 this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl); 4584 this.wrapperEl.appendChild(this.maskEl); 4585 this.wrapperEl.appendChild(this.placeholderEl); 4586 this.el.appendChild(this.wrapperEl); 4587 } 4588 4589 if (!this.axis.x.track.el || !this.axis.y.track.el) { 4590 var track = document.createElement('div'); 4591 var scrollbar = document.createElement('div'); 4592 track.classList.add(this.classNames.track); 4593 scrollbar.classList.add(this.classNames.scrollbar); 4594 track.appendChild(scrollbar); 4595 this.axis.x.track.el = track.cloneNode(true); 4596 this.axis.x.track.el.classList.add(this.classNames.horizontal); 4597 this.axis.y.track.el = track.cloneNode(true); 4598 this.axis.y.track.el.classList.add(this.classNames.vertical); 4599 this.el.appendChild(this.axis.x.track.el); 4600 this.el.appendChild(this.axis.y.track.el); 4601 } 4602 4603 this.axis.x.scrollbar.el = this.axis.x.track.el.querySelector("." + this.classNames.scrollbar); 4604 this.axis.y.scrollbar.el = this.axis.y.track.el.querySelector("." + this.classNames.scrollbar); 4605 4606 if (!this.options.autoHide) { 4607 this.axis.x.scrollbar.el.classList.add(this.classNames.visible); 4608 this.axis.y.scrollbar.el.classList.add(this.classNames.visible); 4609 } 4610 4611 this.el.setAttribute('data-simplebar', 'init'); 4612 }; 4613 4614 _proto.setAccessibilityAttributes = function setAccessibilityAttributes() { 4615 var ariaLabel = this.options.ariaLabel || 'scrollable content'; 4616 this.contentWrapperEl.setAttribute('tabindex', '0'); 4617 this.contentWrapperEl.setAttribute('role', 'region'); 4618 this.contentWrapperEl.setAttribute('aria-label', ariaLabel); 4619 }; 4620 4621 _proto.initListeners = function initListeners() { 4622 var _this3 = this; 4623 4624 var elWindow = getElementWindow(this.el); // Event listeners 4625 4626 if (this.options.autoHide) { 4627 this.el.addEventListener('mouseenter', this.onMouseEnter); 4628 } 4629 4630 ['mousedown', 'click', 'dblclick'].forEach(function (e) { 4631 _this3.el.addEventListener(e, _this3.onPointerEvent, true); 4632 }); 4633 ['touchstart', 'touchend', 'touchmove'].forEach(function (e) { 4634 _this3.el.addEventListener(e, _this3.onPointerEvent, { 4635 capture: true, 4636 passive: true 4637 }); 4638 }); 4639 this.el.addEventListener('mousemove', this.onMouseMove); 4640 this.el.addEventListener('mouseleave', this.onMouseLeave); 4641 this.contentWrapperEl.addEventListener('scroll', this.onScroll); // Browser zoom triggers a window resize 4642 4643 elWindow.addEventListener('resize', this.onWindowResize); // Hack for https://github.com/WICG/ResizeObserver/issues/38 4644 4645 var resizeObserverStarted = false;
4646 var resizeObserver = elWindow.ResizeObserver || ResizeObserver; 4647 this.resizeObserver = new resizeObserver(function () { 4648 if (!resizeObserverStarted) return; 4649 4650 _this3.recalculate(); 4651 }); 4652 this.resizeObserver.observe(this.el); 4653 this.resizeObserver.observe(this.contentEl); 4654 elWindow.requestAnimationFrame(function () { 4655 resizeObserverStarted = true; 4656 }); // This is required to detect horizontal scroll. Vertical scroll only needs the resizeObserver. 4657 4658 this.mutationObserver = new elWindow.MutationObserver(this.recalculate); 4659 this.mutationObserver.observe(this.contentEl, { 4660 childList: true, 4661 subtree: true, 4662 characterData: true 4663 }); 4664 }; 4665 4666 _proto.recalculate = function recalculate() { 4667 var elWindow = getElementWindow(this.el); 4668 this.elStyles = elWindow.getComputedStyle(this.el); 4669 this.isRtl = this.elStyles.direction === 'rtl'; 4670 var isHeightAuto = this.heightAutoObserverEl.offsetHeight <= 1; 4671 var isWidthAuto = this.heightAutoObserverEl.offsetWidth <= 1; 4672 var contentElOffsetWidth = this.contentEl.offsetWidth; 4673 var contentWrapperElOffsetWidth = this.contentWrapperEl.offsetWidth; 4674 var elOverflowX = this.elStyles.overflowX; 4675 var elOverflowY = this.elStyles.overflowY; 4676 this.contentEl.style.padding = this.elStyles.paddingTop + " " + this.elStyles.paddingRight + " " + this.elStyles.paddingBottom + " " + this.elStyles.paddingLeft; 4677 this.wrapperEl.style.margin = "-" + this.elStyles.paddingTop + " -" + this.elStyles.paddingRight + " -" + this.elStyles.paddingBottom + " -" + this.elStyles.paddingLeft; 4678 var contentElScrollHeight = this.contentEl.scrollHeight; 4679 var contentElScrollWidth = this.contentEl.scrollWidth; 4680 this.contentWrapperEl.style.height = isHeightAuto ? 'auto' : '100%'; // Determine placeholder size 4681 4682 this.placeholderEl.style.width = isWidthAuto ? contentElOffsetWidth + "px" : 'auto'; 4683 this.placeholderEl.style.height = contentElScrollHeight + "px"; 4684 var contentWrapperElOffsetHeight = this.contentWrapperEl.offsetHeight; 4685 this.axis.x.isOverflowing = contentElScrollWidth > contentElOffsetWidth; 4686 this.axis.y.isOverflowing = contentElScrollHeight > contentWrapperElOffsetHeight; // Set isOverflowing to false if user explicitely set hidden overflow 4687 4688 this.axis.x.isOverflowing = elOverflowX === 'hidden' ? false : this.axis.x.isOverflowing; 4689 this.axis.y.isOverflowing = elOverflowY === 'hidden' ? false : this.axis.y.isOverflowing; 4690 this.axis.x.forceVisible = this.options.forceVisible === 'x' || this.options.forceVisible === true; 4691 this.axis.y.forceVisible = this.options.forceVisible === 'y' || this.options.forceVisible === true; 4692 this.hideNativeScrollbar(); // Set isOverflowing to false if scrollbar is not necessary (content is shorter than offset) 4693 4694 var offsetForXScrollbar = this.axis.x.isOverflowing ? this.scrollbarWidth : 0; 4695 var offsetForYScrollbar = this.axis.y.isOverflowing ? this.scrollbarWidth : 0; 4696 this.axis.x.isOverflowing = this.axis.x.isOverflowing && contentElScrollWidth > contentWrapperElOffsetWidth - offsetForYScrollbar; 4697 this.axis.y.isOverflowing = this.axis.y.isOverflowing && contentElScrollHeight > contentWrapperElOffsetHeight - offsetForXScrollbar; 4698 this.axis.x.scrollbar.size = this.getScrollbarSize('x'); 4699 this.axis.y.scrollbar.size = this.getScrollbarSize('y'); 4700 this.axis.x.scrollbar.el.style.width = this.axis.x.scrollbar.size + "px"; 4701 this.axis.y.scrollbar.el.style.height = this.axis.y.scrollbar.size + "px"; 4702 this.positionScrollbar('x'); 4703 this.positionScrollbar('y'); 4704 this.toggleTrackVisibility('x'); 4705 this.toggleTrackVisibility('y'); 4706 } 4707 /** 4708 * Calculate scrollbar size 4709 */ 4710 ; 4711 4712 _proto.getScrollbarSize = function getScrollbarSize(axis) { 4713 if (axis === void 0) { 4714 axis = 'y'; 4715 } 4716 4717 if (!this.axis[axis].isOverflowing) { 4718 return 0; 4719 } 4720 4721 var contentSize = this.contentEl[this.axis[axis].scrollSizeAttr]; 4722 var trackSize = this.axis[axis].track.el[this.axis[axis].offsetSizeAttr]; 4723 var scrollbarSize; 4724 var scrollbarRatio = trackSize / contentSize; // Calculate new height/position of drag handle. 4725 4726 scrollbarSize = Math.max(~~(scrollbarRatio * trackSize), this.options.scrollbarMinSize); 4727 4728 if (this.options.scrollbarMaxSize) { 4729 scrollbarSize = Math.min(scrollbarSize, this.options.scrollbarMaxSize); 4730 } 4731 4732 return scrollbarSize; 4733 }; 4734 4735 _proto.positionScrollbar = function positionScrollbar(axis) { 4736 if (axis === void 0) { 4737 axis = 'y'; 4738 } 4739 4740 if (!this.axis[axis].isOverflowing) { 4741 return; 4742 } 4743 4744 var contentSize = this.contentWrapperEl[this.axis[axis].scrollSizeAttr]; 4745 var trackSize = this.axis[axis].track.el[this.axis[axis].offsetSizeAttr]; 4746 var hostSize = parseInt(this.elStyles[this.axis[axis].sizeAttr], 10); 4747 var scrollbar = this.axis[axis].scrollbar; 4748 var scrollOffset = this.contentWrapperEl[this.axis[axis].scrollOffsetAttr]; 4749 scrollOffset = axis === 'x' && this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollingInverted ? -scrollOffset : scrollOffset; 4750 var scrollPourcent = scrollOffset / (contentSize - hostSize); 4751 var handleOffset = ~~((trackSize - scrollbar.size) * scrollPourcent); 4752 handleOffset = axis === 'x' && this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollbarInverted ? handleOffset + (trackSize - scrollbar.size) : handleOffset; 4753 scrollbar.el.style.transform = axis === 'x' ? "translate3d(" + handleOffset + "px, 0, 0)" : "translate3d(0, " + handleOffset + "px, 0)"; 4754 }; 4755 4756 _proto.toggleTrackVisibility = function toggleTrackVisibility(axis) { 4757 if (axis === void 0) { 4758 axis = 'y'; 4759 } 4760 4761 var track = this.axis[axis].track.el; 4762 var scrollbar = this.axis[axis].scrollbar.el; 4763 4764 if (this.axis[axis].isOverflowing || this.axis[axis].forceVisible) { 4765 track.style.visibility = 'visible'; 4766 this.contentWrapperEl.style[this.axis[axis].overflowAttr] = 'scroll'; 4767 } else { 4768 track.style.visibility = 'hidden'; 4769 this.contentWrapperEl.style[this.axis[axis].overflowAttr] = 'hidden'; 4770 } // Even if forceVisible is enabled, scrollbar itself should be hidden 4771 4772 4773 if (this.axis[axis].isOverflowing) { 4774 scrollbar.style.display = 'block'; 4775 } else { 4776 scrollbar.style.display = 'none'; 4777 } 4778 }; 4779 4780 _proto.hideNativeScrollbar = function hideNativeScrollbar() { 4781 this.offsetEl.style[this.isRtl ? 'left' : 'right'] = this.axis.y.isOverflowing || this.axis.y.forceVisible ? "-" + this.scrollbarWidth + "px" : 0; 4782 this.offsetEl.style.bottom = this.axis.x.isOverflowing || this.axis.x.forceVisible ? "-" + this.scrollbarWidth + "px" : 0; 4783 } 4784 /** 4785 * On scroll event handling 4786 */ 4787 ; 4788 4789 _proto.onMouseMoveForAxis = function onMouseMoveForAxis(axis) { 4790 if (axis === void 0) { 4791 axis = 'y'; 4792 } 4793 4794 this.axis[axis].track.rect = this.axis[axis].track.el.getBoundingClientRect(); 4795 this.axis[axis].scrollbar.rect = this.axis[axis].scrollbar.el.getBoundingClientRect(); 4796 var isWithinScrollbarBoundsX = this.isWithinBounds(this.axis[axis].scrollbar.rect); 4797 4798 if (isWithinScrollbarBoundsX) { 4799 this.axis[axis].scrollbar.el.classList.add(this.classNames.hover); 4800 } else { 4801 this.axis[axis].scrollbar.el.classList.remove(this.classNames.hover); 4802 } 4803 4804 if (this.isWithinBounds(this.axis[axis].track.rect)) { 4805 this.showScrollbar(axis); 4806 this.axis[axis].track.el.classList.add(this.classNames.hover); 4807 } else { 4808 this.axis[axis].track.el.classList.remove(this.classNames.hover); 4809 } 4810 }; 4811 4812 _proto.onMouseLeaveForAxis = function onMouseLeaveForAxis(axis) { 4813 if (axis === void 0) { 4814 axis = 'y'; 4815 } 4816 4817 this.axis[axis].track.el.classList.remove(this.classNames.hover); 4818 this.axis[axis].scrollbar.el.classList.remove(this.classNames.hover); 4819 }; 4820 4821 /** 4822 * Show scrollbar 4823 */ 4824 _proto.showScrollbar = function showScrollbar(axis) { 4825 if (axis === void 0) { 4826 axis = 'y'; 4827 } 4828 4829 var scrollbar = this.axis[axis].scrollbar.el; 4830 4831 if (!this.axis[axis].isVisible) { 4832 scrollbar.classList.add(this.classNames.visible); 4833 this.axis[axis].isVisible = true; 4834 } 4835 4836 if (this.options.autoHide) { 4837 this.hideScrollbars(); 4838 } 4839 } 4840 /** 4841 * Hide Scrollbar 4842 */ 4843 ; 4844 4845 /** 4846 * on scrollbar handle drag movement starts 4847 */ 4848 _proto.onDragStart = function onDragStart(e, axis) { 4849 if (axis === void 0) { 4850 axis = 'y'; 4851 } 4852 4853 var elDocument = getElementDocument(this.el); 4854 var elWindow = getElementWindow(this.el); 4855 var scrollbar = this.axis[axis].scrollbar; // Measure how far the user's mouse is from the top of the scrollbar drag handle. 4856 4857 var eventOffset = axis === 'y' ? e.pageY : e.pageX; 4858 this.axis[axis].dragOffset = eventOffset - scrollbar.rect[this.axis[axis].offsetAttr]; 4859 this.draggedAxis = axis; 4860 this.el.classList.add(this.classNames.dragging); 4861 elDocument.addEventListener('mousemove', this.drag, true); 4862 elDocument.addEventListener('mouseup', this.onEndDrag, true); 4863 4864 if (this.removePreventClickId === null) { 4865 elDocument.addEventListener('click', this.preventClick, true); 4866 elDocument.addEventListener('dblclick', this.preventClick, true); 4867 } else { 4868 elWindow.clearTimeout(this.removePreventClickId); 4869 this.removePreventClickId = null; 4870 } 4871 } 4872 /** 4873 * Drag scrollbar handle 4874 */ 4875 ; 4876 4877 _proto.onTrackClick = function onTrackClick(e, axis) { 4878 var _this4 = this; 4879 4880 if (axis === void 0) { 4881 axis = 'y'; 4882 } 4883 4884 if (!this.options.clickOnTrack) return; 4885 var elWindow = getElementWindow(this.el); 4886 this.axis[axis].scrollbar.rect = this.axis[axis].scrollbar.el.getBoundingClientRect(); 4887 var scrollbar = this.axis[axis].scrollbar; 4888 var scrollbarOffset = scrollbar.rect[this.axis[axis].offsetAttr]; 4889 var hostSize = parseInt(this.elStyles[this.axis[axis].sizeAttr], 10); 4890 var scrolled = this.contentWrapperEl[this.axis[axis].scrollOffsetAttr]; 4891 var t = axis === 'y' ? this.mouseY - scrollbarOffset : this.mouseX - scrollbarOffset; 4892 var dir = t < 0 ? -1 : 1; 4893 var scrollSize = dir === -1 ? scrolled - hostSize : scrolled + hostSize; 4894 4895 var scrollTo = function scrollTo() { 4896 if (dir === -1) { 4897 if (scrolled > scrollSize) { 4898 var _this4$contentWrapper; 4899 4900 scrolled -= _this4.options.clickOnTrackSpeed; 4901 4902 _this4.contentWrapperEl.scrollTo((_this4$contentWrapper = {}, _this4$contentWrapper[_this4.axis[axis].offsetAttr] = scrolled, _this4$contentWrapper)); 4903 4904 elWindow.requestAnimationFrame(scrollTo); 4905 } 4906 } else { 4907 if (scrolled < scrollSize) { 4908 var _this4$contentWrapper2; 4909 4910 scrolled += _this4.options.clickOnTrackSpeed; 4911 4912 _this4.contentWrapperEl.scrollTo((_this4$contentWrapper2 = {}, _this4$contentWrapper2[_this4.axis[axis].offsetAttr] = scrolled, _this4$contentWrapper2)); 4913 4914 elWindow.requestAnimationFrame(scrollTo); 4915 } 4916 } 4917 }; 4918 4919 scrollTo(); 4920 } 4921 /** 4922 * Getter for content element 4923 */ 4924 ; 4925 4926 _proto.getContentElement = function getContentElement() { 4927 return this.contentEl; 4928 } 4929 /** 4930 * Getter for original scrolling element 4931 */ 4932 ; 4933 4934 _proto.getScrollElement = function getScrollElement() { 4935 return this.contentWrapperEl; 4936 }; 4937 4938 _proto.getScrollbarWidth = function getScrollbarWidth() { 4939 // Try/catch for FF 56 throwing on undefined computedStyles 4940 try { 4941 // Detect browsers supporting CSS scrollbar styling and do not calculate 4942 if (getComputedStyle(this.contentWrapperEl, '::-webkit-scrollbar').display === 'none' || 'scrollbarWidth' in document.documentElement.style || '-ms-overflow-style' in document.documentElement.style) { 4943 return 0; 4944 } else { 4945 return scrollbarWidth(this.el); 4946 } 4947 } catch (e) { 4948 return scrollbarWidth(this.el); 4949 } 4950 }; 4951 4952 _proto.removeListeners = function removeListeners() { 4953 var _this5 = this; 4954 4955 var elWindow = getElementWindow(this.el); // Event listeners 4956 4957 if (this.options.autoHide) { 4958 this.el.removeEventListener('mouseenter', this.onMouseEnter); 4959 } 4960 4961 ['mousedown', 'click', 'dblclick'].forEach(function (e) { 4962 _this5.el.removeEventListener(e, _this5.onPointerEvent, true); 4963 }); 4964 ['touchstart', 'touchend', 'touchmove'].forEach(function (e) { 4965 _this5.el.removeEventListener(e, _this5.onPointerEvent, { 4966 capture: true, 4967 passive: true 4968 }); 4969 }); 4970 this.el.removeEventListener('mousemove', this.onMouseMove); 4971 this.el.removeEventListener('mouseleave', this.onMouseLeave); 4972 4973 if (this.contentWrapperEl) { 4974 this.contentWrapperEl.removeEventListener('scroll', this.onScroll); 4975 } 4976 4977 elWindow.removeEventListener('resize', this.onWindowResize); 4978 4979 if (this.mutationObserver) { 4980 this.mutationObserver.disconnect(); 4981 } 4982 4983 if (this.resizeObserver) { 4984 this.resizeObserver.disconnect(); 4985 } // Cancel all debounced functions 4986 4987 4988 this.recalculate.cancel(); 4989 this.onMouseMove.cancel(); 4990 this.hideScrollbars.cancel(); 4991 this.onWindowResize.cancel(); 4992 } 4993 /** 4994 * UnMount mutation observer and delete SimpleBar instance from DOM element 4995 */ 4996 ; 4997 4998 _proto.unMount = function unMount() { 4999 this.removeListeners(); 5000 SimpleBar.instances.delete(this.el); 5001 } 5002 /** 5003 * Check if mouse is within bounds 5004 */ 5005 ; 5006 5007 _proto.isWithinBounds = function isWithinBounds(bbox) { 5008 return this.mouseX >= bbox.left && this.mouseX <= bbox.left + bbox.width && this.mouseY >= bbox.top && this.mouseY <= bbox.top + bbox.height; 5009 } 5010 /** 5011 * Find element children matches query 5012 */ 5013 ; 5014 5015 _proto.findChild = function findChild(el, query) { 5016 var matches = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector; 5017 return Array.prototype.filter.call(el.children, function (child) { 5018 return matches.call(child, query); 5019 })[0]; 5020 }; 5021 5022 return SimpleBar; 5023 }(); 5024 5025 SimpleBar.defaultOptions = { 5026 autoHide: true, 5027 forceVisible: false, 5028 clickOnTrack: true, 5029 clickOnTrackSpeed: 40, 5030 classNames: { 5031 contentEl: 'simplebar-content', 5032 contentWrapper: 'simplebar-content-wrapper', 5033 offset: 'simplebar-offset', 5034 mask: 'simplebar-mask', 5035 wrapper: 'simplebar-wrapper', 5036 placeholder: 'simplebar-placeholder', 5037 scrollbar: 'simplebar-scrollbar', 5038 track: 'simplebar-track', 5039 heightAutoObserverWrapperEl: 'simplebar-height-auto-observer-wrapper', 5040 heightAutoObserverEl: 'simplebar-height-auto-observer', 5041 visible: 'simplebar-visible', 5042 horizontal: 'simplebar-horizontal', 5043 vertical: 'simplebar-vertical', 5044 hover: 'simplebar-hover', 5045 dragging: 'simplebar-dragging' 5046 }, 5047 scrollbarMinSize: 25, 5048 scrollbarMaxSize: 0, 5049 timeout: 1000 5050 }; 5051 SimpleBar.instances = new WeakMap(); 5052 5053 SimpleBar.initDOMLoadedElements = function () { 5054 document.removeEventListener('DOMContentLoaded', this.initDOMLoadedElements); 5055 window.removeEventListener('load', this.initDOMLoadedElements); 5056 Array.prototype.forEach.call(document.querySelectorAll('[data-simplebar]'), function (el) { 5057 if (el.getAttribute('data-simplebar') !== 'init' && !SimpleBar.instances.has(el)) new SimpleBar(el, getOptions(el.attributes)); 5058 }); 5059 }; 5060 5061 SimpleBar.removeObserver = function () { 5062 this.globalObserver.disconnect(); 5063 }; 5064 5065 SimpleBar.initHtmlApi = function () { 5066 this.initDOMLoadedElements = this.initDOMLoadedElements.bind(this); // MutationObserver is IE11+ 5067 5068 if (typeof MutationObserver !== 'undefined') { 5069 // Mutation observer to observe dynamically added elements 5070 this.globalObserver = new MutationObserver(SimpleBar.handleMutations); 5071 this.globalObserver.observe(document, { 5072 childList: true, 5073 subtree: true 5074 }); 5075 } // Taken from jQuery `ready` function 5076 // Instantiate elements already present on the page 5077 5078 5079 if (document.readyState === 'complete' || document.readyState !== 'loading' && !document.documentElement.doScroll) { 5080 // Handle it asynchronously to allow scripts the opportunity to delay init 5081 window.setTimeout(this.initDOMLoadedElements); 5082 }
5082else { 5083 document.addEventListener('DOMContentLoaded', this.initDOMLoadedElements); 5084 window.addEventListener('load', this.initDOMLoadedElements); 5085 } 5086 }; 5087 5088 SimpleBar.handleMutations = function (mutations) { 5089 mutations.forEach(function (mutation) { 5090 Array.prototype.forEach.call(mutation.addedNodes, function (addedNode) { 5091 if (addedNode.nodeType === 1) { 5092 if (addedNode.hasAttribute('data-simplebar')) { 5093 !SimpleBar.instances.has(addedNode) && document.documentElement.contains(addedNode) && new SimpleBar(addedNode, getOptions(addedNode.attributes)); 5094 } else { 5095 Array.prototype.forEach.call(addedNode.querySelectorAll('[data-simplebar]'), function (el) { 5096 if (el.getAttribute('data-simplebar') !== 'init' && !SimpleBar.instances.has(el) && document.documentElement.contains(el)) new SimpleBar(el, getOptions(el.attributes)); 5097 }); 5098 } 5099 } 5100 }); 5101 Array.prototype.forEach.call(mutation.removedNodes, function (removedNode) { 5102 if (removedNode.nodeType === 1) { 5103 if (removedNode.getAttribute('data-simplebar') === 'init') { 5104 SimpleBar.instances.has(removedNode) && !document.documentElement.contains(removedNode) && SimpleBar.instances.get(removedNode).unMount(); 5105 } else { 5106 Array.prototype.forEach.call(removedNode.querySelectorAll('[data-simplebar="init"]'), function (el) { 5107 SimpleBar.instances.has(el) && !document.documentElement.contains(el) && SimpleBar.instances.get(el).unMount(); 5108 }); 5109 } 5110 } 5111 }); 5112 }); 5113 }; 5114 5115 SimpleBar.getOptions = getOptions; 5116 /** 5117 * HTML API 5118 * Called only in a browser env. 5119 */ 5120 5121 if (canUseDom) { 5122 SimpleBar.initHtmlApi(); 5123 } 5124 5125 return SimpleBar; 5126 5127}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.