|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(function (global, factory) { |
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : |
|
typeof define === 'function' && define.amd ? define(factory) : |
|
(global = global || self, global.SimpleBar = factory()); |
|
}(this, function () { 'use strict'; |
|
|
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; |
|
|
|
function createCommonjsModule(fn, module) { |
|
return module = { exports: {} }, fn(module, module.exports), module.exports; |
|
} |
|
|
|
var O = 'object'; |
|
var check = function (it) { |
|
return it && it.Math == Math && it; |
|
}; |
|
|
|
|
|
var global_1 = |
|
|
|
check(typeof globalThis == O && globalThis) || |
|
check(typeof window == O && window) || |
|
check(typeof self == O && self) || |
|
check(typeof commonjsGlobal == O && commonjsGlobal) || |
|
|
|
Function('return this')(); |
|
|
|
var fails = function (exec) { |
|
try { |
|
return !!exec(); |
|
} catch (error) { |
|
return true; |
|
} |
|
}; |
|
|
|
|
|
var descriptors = !fails(function () { |
|
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; |
|
}); |
|
|
|
var nativePropertyIsEnumerable = {}.propertyIsEnumerable; |
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; |
|
|
|
|
|
var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1); |
|
|
|
|
|
|
|
var f = NASHORN_BUG ? function propertyIsEnumerable(V) { |
|
var descriptor = getOwnPropertyDescriptor(this, V); |
|
return !!descriptor && descriptor.enumerable; |
|
} : nativePropertyIsEnumerable; |
|
|
|
var objectPropertyIsEnumerable = { |
|
f: f |
|
}; |
|
|
|
var createPropertyDescriptor = function (bitmap, value) { |
|
return { |
|
enumerable: !(bitmap & 1), |
|
configurable: !(bitmap & 2), |
|
writable: !(bitmap & 4), |
|
value: value |
|
}; |
|
}; |
|
|
|
var toString = {}.toString; |
|
|
|
var classofRaw = function (it) { |
|
return toString.call(it).slice(8, -1); |
|
}; |
|
|
|
var split = ''.split; |
|
|
|
|
|
var indexedObject = fails(function () { |
|
|
|
|
|
return !Object('z').propertyIsEnumerable(0); |
|
}) ? function (it) { |
|
return classofRaw(it) == 'String' ? split.call(it, '') : Object(it); |
|
} : Object; |
|
|
|
|
|
|
|
var requireObjectCoercible = function (it) { |
|
if (it == undefined) throw TypeError("Can't call method on " + it); |
|
return it; |
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var toIndexedObject = function (it) { |
|
return indexedObject(requireObjectCoercible(it)); |
|
}; |
|
|
|
var isObject = function (it) { |
|
return typeof it === 'object' ? it !== null : typeof it === 'function'; |
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var toPrimitive = function (input, PREFERRED_STRING) { |
|
if (!isObject(input)) return input; |
|
var fn, val; |
|
if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; |
|
if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val; |
|
if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; |
|
throw TypeError("Can't convert object to primitive value"); |
|
}; |
|
|
|
var hasOwnProperty = {}.hasOwnProperty; |
|
|
|
var has = function (it, key) { |
|
return hasOwnProperty.call(it, key); |
|
}; |
|
|
|
var document$1 = global_1.document; |
|
|
|
var EXISTS = isObject(document$1) && isObject(document$1.createElement); |
|
|
|
var documentCreateElement = function (it) { |
|
return EXISTS ? document$1.createElement(it) : {}; |
|
}; |
|
|
|
|
|
var ie8DomDefine = !descriptors && !fails(function () { |
|
return Object.defineProperty(documentCreateElement('div'), 'a', { |
|
get: function () { return 7; } |
|
}).a != 7; |
|
}); |
|
|
|
var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; |
|
|
|
|
|
|
|
var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { |
|
O = toIndexedObject(O); |
|
P = toPrimitive(P, true); |
|
if (ie8DomDefine) try { |
|
return nativeGetOwnPropertyDescriptor(O, P); |
|
} catch (error) { } |
|
if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]); |
|
}; |
|
|
|
var objectGetOwnPropertyDescriptor = { |
|
f: f$1 |
|
}; |
|
|
|
var anObject = function (it) { |
|
if (!isObject(it)) { |
|
throw TypeError(String(it) + ' is not an object'); |
|
} return it; |
|
}; |
|
|
|
var nativeDefineProperty = Object.defineProperty; |
|
|
|
|
|
|
|
var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) { |
|
anObject(O); |
|
P = toPrimitive(P, true); |
|
anObject(Attributes); |
|
if (ie8DomDefine) try { |
|
return nativeDefineProperty(O, P, Attributes); |
|
} catch (error) { } |
|
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported'); |
|
if ('value' in Attributes) O[P] = Attributes.value; |
|
return O; |
|
}; |
|
|
|
var objectDefineProperty = { |
|
f: f$2 |
|
}; |
|
|
|
var hide = descriptors ? function (object, key, value) { |
|
return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value)); |
|
} : function (object, key, value) { |
|
object[key] = value; |
|
return object; |
|
}; |
|
|
|
var setGlobal = function (key, value) { |
|
try { |
|
hide(global_1, key, value); |
|
} catch (error) { |
|
global_1[key] = value; |
|
} return value; |
|
}; |
|
|
|
var shared = createCommonjsModule(function (module) { |
|
var SHARED = '__core-js_shared__'; |
|
var store = global_1[SHARED] || setGlobal(SHARED, {}); |
|
|
|
(module.exports = function (key, value) { |
|
return store[key] || (store[key] = value !== undefined ? value : {}); |
|
})('versions', []).push({ |
|
version: '3.2.1', |
|
mode: 'global', |
|
copyright: '© 2019 Denis Pushkarev (zloirock.ru)' |
|
}); |
|
}); |
|
|
|
var functionToString = shared('native-function-to-string', Function.toString); |
|
|
|
var WeakMap$1 = global_1.WeakMap; |
|
|
|
var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(functionToString.call(WeakMap$1)); |
|
|
|
var id = 0; |
|
var postfix = Math.random(); |
|
|
|
var uid = function (key) { |
|
return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36); |
|
}; |
|
|
|
var keys = shared('keys'); |
|
|
|
var sharedKey = function (key) { |
|
return keys[key] || (keys[key] = uid(key)); |
|
}; |
|
|
|
var hiddenKeys = {}; |
|
|
|
var WeakMap$2 = global_1.WeakMap; |
|
var set, get, has$1; |
|
|
|
var enforce = function (it) { |
|
return has$1(it) ? get(it) : set(it, {}); |
|
}; |
|
|
|
var getterFor = function (TYPE) { |
|
return function (it) { |
|
var state; |
|
if (!isObject(it) || (state = get(it)).type !== TYPE) { |
|
throw TypeError('Incompatible receiver, ' + TYPE + ' required'); |
|
} return state; |
|
}; |
|
}; |
|
|
|
if (nativeWeakMap) { |
|
var store = new WeakMap$2(); |
|
var wmget = store.get; |
|
var wmhas = store.has; |
|
var wmset = store.set; |
|
set = function (it, metadata) { |
|
wmset.call(store, it, metadata); |
|
return metadata; |
|
}; |
|
get = function (it) { |
|
return wmget.call(store, it) || {}; |
|
}; |
|
has$1 = function (it) { |
|
return wmhas.call(store, it); |
|
}; |
|
} else { |
|
var STATE = sharedKey('state'); |
|
hiddenKeys[STATE] = true; |
|
set = function (it, metadata) { |
|
hide(it, STATE, metadata); |
|
return metadata; |
|
}; |
|
get = function (it) { |
|
return has(it, STATE) ? it[STATE] : {}; |
|
}; |
|
has$1 = function (it) { |
|
return has(it, STATE); |
|
}; |
|
} |
|
|
|
var internalState = { |
|
set: set, |
|
get: get, |
|
has: has$1, |
|
enforce: enforce, |
|
getterFor: getterFor |
|
}; |
|
|
|
var redefine = createCommonjsModule(function (module) { |
|
var getInternalState = internalState.get; |
|
var enforceInternalState = internalState.enforce; |
|
var TEMPLATE = String(functionToString).split('toString'); |
|
|
|
shared('inspectSource', function (it) { |
|
return functionToString.call(it); |
|
}); |
|
|
|
(module.exports = function (O, key, value, options) { |
|
var unsafe = options ? !!options.unsafe : false; |
|
var simple = options ? !!options.enumerable : false; |
|
var noTargetGet = options ? !!options.noTargetGet : false; |
|
if (typeof value == 'function') { |
|
if (typeof key == 'string' && !has(value, 'name')) hide(value, 'name', key); |
|
enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : ''); |
|
} |
|
if (O === global_1) { |
|
if (simple) O[key] = value; |
|
else setGlobal(key, value); |
|
return; |
|
} else if (!unsafe) { |
|
delete O[key]; |
|
} else if (!noTargetGet && O[key]) { |
|
simple = true; |
|
} |
|
if (simple) O[key] = value; |
|
else hide(O, key, value); |
|
|
|
})(Function.prototype, 'toString', function toString() { |
|
return typeof this == 'function' && getInternalState(this).source || functionToString.call(this); |
|
}); |
|
}); |
|
|
|
var path = global_1; |
|
|
|
var aFunction = function (variable) { |
|
return typeof variable == 'function' ? variable : undefined; |
|
}; |
|
|
|
var getBuiltIn = function (namespace, method) { |
|
return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace]) |
|
: path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method]; |
|
}; |
|
|
|
var ceil = Math.ceil; |
|
var floor = Math.floor; |
|
|
|
|
|
|
|
var toInteger = function (argument) { |
|
return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument); |
|
}; |
|
|
|
var min = Math.min; |
|
|
|
|
|
|
|
var toLength = function (argument) { |
|
return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; |
|
}; |
|
|
|
var max = Math.max; |
|
var min$1 = Math.min; |
|
|
|
|
|
|
|
|
|
var toAbsoluteIndex = function (index, length) { |
|
var integer = toInteger(index); |
|
return integer < 0 ? max(integer + length, 0) : min$1(integer, length); |
|
}; |
|
|
|
|
|
var createMethod = function (IS_INCLUDES) { |
|
return function ($this, el, fromIndex) { |
|
var O = toIndexedObject($this); |
|
var length = toLength(O.length); |
|
var index = toAbsoluteIndex(fromIndex, length); |
|
var value; |
|
|
|
|
|
if (IS_INCLUDES && el != el) while (length > index) { |
|
value = O[index++]; |
|
|
|
if (value != value) return true; |
|
|
|
} else for (;length > index; index++) { |
|
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; |
|
} return !IS_INCLUDES && -1; |
|
}; |
|
}; |
|
|
|
var arrayIncludes = { |
|
|
|
|
|
includes: createMethod(true), |
|
|
|
|
|
indexOf: createMethod(false) |
|
}; |
|
|
|
var indexOf = arrayIncludes.indexOf; |
|
|
|
|
|
var objectKeysInternal = function (object, names) { |
|
var O = toIndexedObject(object); |
|
var i = 0; |
|
var result = []; |
|
var key; |
|
for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key); |
|
|
|
while (names.length > i) if (has(O, key = names[i++])) { |
|
~indexOf(result, key) || result.push(key); |
|
} |
|
return result; |
|
}; |
|
|
|
|
|
var enumBugKeys = [ |
|
'constructor', |
|
'hasOwnProperty', |
|
'isPrototypeOf', |
|
'propertyIsEnumerable', |
|
'toLocaleString', |
|
'toString', |
|
'valueOf' |
|
]; |
|
|
|
var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype'); |
|
|
|
|
|
|
|
var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { |
|
return objectKeysInternal(O, hiddenKeys$1); |
|
}; |
|
|
|
var objectGetOwnPropertyNames = { |
|
f: f$3 |
|
}; |
|
|
|
var f$4 = Object.getOwnPropertySymbols; |
|
|
|
var objectGetOwnPropertySymbols = { |
|
f: f$4 |
|
}; |
|
|
|
|
|
var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { |
|
var keys = objectGetOwnPropertyNames.f(anObject(it)); |
|
var getOwnPropertySymbols = objectGetOwnPropertySymbols.f; |
|
return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; |
|
}; |
|
|
|
var copyConstructorProperties = function (target, source) { |
|
var keys = ownKeys(source); |
|
var defineProperty = objectDefineProperty.f; |
|
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f; |
|
for (var i = 0; i < keys.length; i++) { |
|
var key = keys[i]; |
|
if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key)); |
|
} |
|
}; |
|
|
|
var replacement = /#|\.prototype\./; |
|
|
|
var isForced = function (feature, detection) { |
|
var value = data[normalize(feature)]; |
|
return value == POLYFILL ? true |
|
: value == NATIVE ? false |
|
: typeof detection == 'function' ? fails(detection) |
|
: !!detection; |
|
}; |
|
|
|
var normalize = isForced.normalize = function (string) { |
|
return String(string).replace(replacement, '.').toLowerCase(); |
|
}; |
|
|
|
var data = isForced.data = {}; |
|
var NATIVE = isForced.NATIVE = 'N'; |
|
var POLYFILL = isForced.POLYFILL = 'P'; |
|
|
|
var isForced_1 = isForced; |
|
|
|
var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _export = function (options, source) { |
|
var TARGET = options.target; |
|
var GLOBAL = options.global; |
|
var STATIC = options.stat; |
|
var FORCED, target, key, targetProperty, sourceProperty, descriptor; |
|
if (GLOBAL) { |
|
target = global_1; |
|
} else if (STATIC) { |
|
target = global_1[TARGET] || setGlobal(TARGET, {}); |
|
} else { |
|
target = (global_1[TARGET] || {}).prototype; |
|
} |
|
if (target) for (key in source) { |
|
sourceProperty = source[key]; |
|
if (options.noTargetGet) { |
|
descriptor = getOwnPropertyDescriptor$1(target, key); |
|
targetProperty = descriptor && descriptor.value; |
|
} else targetProperty = target[key]; |
|
FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); |
|
|
|
if (!FORCED && targetProperty !== undefined) { |
|
if (typeof sourceProperty === typeof targetProperty) continue; |
|
copyConstructorProperties(sourceProperty, targetProperty); |
|
} |
|
|
|
if (options.sham || (targetProperty && targetProperty.sham)) { |
|
hide(sourceProperty, 'sham', true); |
|
} |
|
|
|
redefine(target, key, sourceProperty, options); |
|
} |
|
}; |
|
|
|
var aFunction$1 = function (it) { |
|
if (typeof it != 'function') { |
|
throw TypeError(String(it) + ' is not a function'); |
|
} return it; |
|
}; |
|
|
|
|
|
var bindContext = function (fn, that, length) { |
|
aFunction$1(fn); |
|
if (that === undefined) return fn; |
|
switch (length) { |
|
case 0: return function () { |
|
return fn.call(that); |
|
}; |
|
case 1: return function (a) { |
|
return fn.call(that, a); |
|
}; |
|
case 2: return function (a, b) { |
|
return fn.call(that, a, b); |
|
}; |
|
case 3: return function (a, b, c) { |
|
return fn.call(that, a, b, c); |
|
}; |
|
} |
|
return function () { |
|
return fn.apply(that, arguments); |
|
}; |
|
}; |
|
|
|
|
|
|
|
var toObject = function (argument) { |
|
return Object(requireObjectCoercible(argument)); |
|
}; |
|
|
|
|
|
|
|
var isArray = Array.isArray || function isArray(arg) { |
|
return classofRaw(arg) == 'Array'; |
|
}; |
|
|
|
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () { |
|
|
|
|
|
return !String(Symbol()); |
|
}); |
|
|
|
var Symbol$1 = global_1.Symbol; |
|
var store$1 = shared('wks'); |
|
|
|
var wellKnownSymbol = function (name) { |
|
return store$1[name] || (store$1[name] = nativeSymbol && Symbol$1[name] |
|
|| (nativeSymbol ? Symbol$1 : uid)('Symbol.' + name)); |
|
}; |
|
|
|
var SPECIES = wellKnownSymbol('species'); |
|
|
|
|
|
|
|
var arraySpeciesCreate = function (originalArray, length) { |
|
var C; |
|
if (isArray(originalArray)) { |
|
C = originalArray.constructor; |
|
|
|
if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; |
|
else if (isObject(C)) { |
|
C = C[SPECIES]; |
|
if (C === null) C = undefined; |
|
} |
|
} return new (C === undefined ? Array : C)(length === 0 ? 0 : length); |
|
}; |
|
|
|
var push = [].push; |
|
|
|
|
|
var createMethod$1 = function (TYPE) { |
|
var IS_MAP = TYPE == 1; |
|
var IS_FILTER = TYPE == 2; |
|
var IS_SOME = TYPE == 3; |
|
var IS_EVERY = TYPE == 4; |
|
var IS_FIND_INDEX = TYPE == 6; |
|
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; |
|
return function ($this, callbackfn, that, specificCreate) { |
|
var O = toObject($this); |
|
var self = indexedObject(O); |
|
var boundFunction = bindContext(callbackfn, that, 3); |
|
var length = toLength(self.length); |
|
var index = 0; |
|
var create = specificCreate || arraySpeciesCreate; |
|
var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; |
|
var value, result; |
|
for (;length > index; index++) if (NO_HOLES || index in self) { |
|
value = self[index]; |
|
result = boundFunction(value, index, O); |
|
if (TYPE) { |
|
if (IS_MAP) target[index] = result; |
|
else if (result) switch (TYPE) { |
|
case 3: return true; |
|
case 5: return value; |
|
case 6: return index; |
|
case 2: push.call(target, value); |
|
} else if (IS_EVERY) return false; |
|
} |
|
} |
|
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; |
|
}; |
|
}; |
|
|
|
var arrayIteration = { |
|
|
|
|
|
forEach: createMethod$1(0), |
|
|
|
|
|
map: createMethod$1(1), |
|
|
|
|
|
filter: createMethod$1(2), |
|
|
|
|
|
some: createMethod$1(3), |
|
|
|
|
|
every: createMethod$1(4), |
|
|
|
|
|
find: createMethod$1(5), |
|
|
|
|
|
findIndex: createMethod$1(6) |
|
}; |
|
|
|
var sloppyArrayMethod = function (METHOD_NAME, argument) { |
|
var method = [][METHOD_NAME]; |
|
return !method || !fails(function () { |
|
|
|
method.call(null, argument || function () { throw 1; }, 1); |
|
}); |
|
}; |
|
|
|
var $forEach = arrayIteration.forEach; |
|
|
|
|
|
|
|
|
|
var arrayForEach = sloppyArrayMethod('forEach') ? function forEach(callbackfn ) { |
|
return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); |
|
} : [].forEach; |
|
|
|
|
|
|
|
_export({ target: 'Array', proto: true, forced: [].forEach != arrayForEach }, { |
|
forEach: arrayForEach |
|
}); |
|
|
|
|
|
|
|
var domIterables = { |
|
CSSRuleList: 0, |
|
CSSStyleDeclaration: 0, |
|
CSSValueList: 0, |
|
ClientRectList: 0, |
|
DOMRectList: 0, |
|
DOMStringList: 0, |
|
DOMTokenList: 1, |
|
DataTransferItemList: 0, |
|
FileList: 0, |
|
HTMLAllCollection: 0, |
|
HTMLCollection: 0, |
|
HTMLFormElement: 0, |
|
HTMLSelectElement: 0, |
|
MediaList: 0, |
|
MimeTypeArray: 0, |
|
NamedNodeMap: 0, |
|
NodeList: 1, |
|
PaintRequestList: 0, |
|
Plugin: 0, |
|
PluginArray: 0, |
|
SVGLengthList: 0, |
|
SVGNumberList: 0, |
|
SVGPathSegList: 0, |
|
SVGPointList: 0, |
|
SVGStringList: 0, |
|
SVGTransformList: 0, |
|
SourceBufferList: 0, |
|
StyleSheetList: 0, |
|
TextTrackCueList: 0, |
|
TextTrackList: 0, |
|
TouchList: 0 |
|
}; |
|
|
|
for (var COLLECTION_NAME in domIterables) { |
|
var Collection = global_1[COLLECTION_NAME]; |
|
var CollectionPrototype = Collection && Collection.prototype; |
|
|
|
if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try { |
|
hide(CollectionPrototype, 'forEach', arrayForEach); |
|
} catch (error) { |
|
CollectionPrototype.forEach = arrayForEach; |
|
} |
|
} |
|
|
|
var canUseDOM = !!( |
|
typeof window !== 'undefined' && |
|
window.document && |
|
window.document.createElement |
|
); |
|
|
|
var canUseDom = canUseDOM; |
|
|
|
var SPECIES$1 = wellKnownSymbol('species'); |
|
|
|
var arrayMethodHasSpeciesSupport = function (METHOD_NAME) { |
|
return !fails(function () { |
|
var array = []; |
|
var constructor = array.constructor = {}; |
|
constructor[SPECIES$1] = function () { |
|
return { foo: 1 }; |
|
}; |
|
return array[METHOD_NAME](Boolean).foo !== 1; |
|
}); |
|
}; |
|
|
|
var $filter = arrayIteration.filter; |
|
|
|
|
|
|
|
|
|
|
|
_export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('filter') }, { |
|
filter: function filter(callbackfn ) { |
|
return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); |
|
} |
|
}); |
|
|
|
|
|
|
|
var objectKeys = Object.keys || function keys(O) { |
|
return objectKeysInternal(O, enumBugKeys); |
|
}; |
|
|
|
|
|
|
|
var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) { |
|
anObject(O); |
|
var keys = objectKeys(Properties); |
|
var length = keys.length; |
|
var index = 0; |
|
var key; |
|
while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]); |
|
return O; |
|
}; |
|
|
|
var html = getBuiltIn('document', 'documentElement'); |
|
|
|
var IE_PROTO = sharedKey('IE_PROTO'); |
|
|
|
var PROTOTYPE = 'prototype'; |
|
var Empty = function () { }; |
|
|
|
|
|
var createDict = function () { |
|
|
|
var iframe = documentCreateElement('iframe'); |
|
var length = enumBugKeys.length; |
|
var lt = '<'; |
|
var script = 'script'; |
|
var gt = '>'; |
|
var js = 'java' + script + ':'; |
|
var iframeDocument; |
|
iframe.style.display = 'none'; |
|
html.appendChild(iframe); |
|
iframe.src = String(js); |
|
iframeDocument = iframe.contentWindow.document; |
|
iframeDocument.open(); |
|
iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt); |
|
iframeDocument.close(); |
|
createDict = iframeDocument.F; |
|
while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]]; |
|
return createDict(); |
|
}; |
|
|
|
|
|
|
|
var objectCreate = Object.create || function create(O, Properties) { |
|
var result; |
|
if (O !== null) { |
|
Empty[PROTOTYPE] = anObject(O); |
|
result = new Empty(); |
|
Empty[PROTOTYPE] = null; |
|
|
|
result[IE_PROTO] = O; |
|
} else result = createDict(); |
|
return Properties === undefined ? result : objectDefineProperties(result, Properties); |
|
}; |
|
|
|
hiddenKeys[IE_PROTO] = true; |
|
|
|
var UNSCOPABLES = wellKnownSymbol('unscopables'); |
|
var ArrayPrototype = Array.prototype; |
|
|
|
|
|
|
|
if (ArrayPrototype[UNSCOPABLES] == undefined) { |
|
hide(ArrayPrototype, UNSCOPABLES, objectCreate(null)); |
|
} |
|
|
|
|
|
var addToUnscopables = function (key) { |
|
ArrayPrototype[UNSCOPABLES][key] = true; |
|
}; |
|
|
|
var iterators = {}; |
|
|
|
var correctPrototypeGetter = !fails(function () { |
|
function F() { } |
|
F.prototype.constructor = null; |
|
return Object.getPrototypeOf(new F()) !== F.prototype; |
|
}); |
|
|
|
var IE_PROTO$1 = sharedKey('IE_PROTO'); |
|
var ObjectPrototype = Object.prototype; |
|
|
|
|
|
|
|
var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) { |
|
O = toObject(O); |
|
if (has(O, IE_PROTO$1)) return O[IE_PROTO$1]; |
|
if (typeof O.constructor == 'function' && O instanceof O.constructor) { |
|
return O.constructor.prototype; |
|
} return O instanceof Object ? ObjectPrototype : null; |
|
}; |
|
|
|
var ITERATOR = wellKnownSymbol('iterator'); |
|
var BUGGY_SAFARI_ITERATORS = false; |
|
|
|
var returnThis = function () { return this; }; |
|
|
|
|
|
|
|
var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; |
|
|
|
if ([].keys) { |
|
arrayIterator = [].keys(); |
|
|
|
if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; |
|
else { |
|
PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator)); |
|
if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; |
|
} |
|
} |
|
|
|
if (IteratorPrototype == undefined) IteratorPrototype = {}; |
|
|
|
|
|
if ( !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis); |
|
|
|
var iteratorsCore = { |
|
IteratorPrototype: IteratorPrototype, |
|
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS |
|
}; |
|
|
|
var defineProperty = objectDefineProperty.f; |
|
|
|
|
|
|
|
var TO_STRING_TAG = wellKnownSymbol('toStringTag'); |
|
|
|
var setToStringTag = function (it, TAG, STATIC) { |
|
if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) { |
|
defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG }); |
|
} |
|
}; |
|
|
|
var IteratorPrototype$1 = iteratorsCore.IteratorPrototype; |
|
|
|
|
|
|
|
|
|
|
|
var returnThis$1 = function () { return this; }; |
|
|
|
var createIteratorConstructor = function (IteratorConstructor, NAME, next) { |
|
var TO_STRING_TAG = NAME + ' Iterator'; |
|
IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(1, next) }); |
|
setToStringTag(IteratorConstructor, TO_STRING_TAG, false); |
|
iterators[TO_STRING_TAG] = returnThis$1; |
|
return IteratorConstructor; |
|
}; |
|
|
|
var aPossiblePrototype = function (it) { |
|
if (!isObject(it) && it !== null) { |
|
throw TypeError("Can't set " + String(it) + ' as a prototype'); |
|
} return it; |
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () { |
|
var CORRECT_SETTER = false; |
|
var test = {}; |
|
var setter; |
|
try { |
|
setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set; |
|
setter.call(test, []); |
|
CORRECT_SETTER = test instanceof Array; |
|
} catch (error) { } |
|
return function setPrototypeOf(O, proto) { |
|
anObject(O); |
|
aPossiblePrototype(proto); |
|
if (CORRECT_SETTER) setter.call(O, proto); |
|
else O.__proto__ = proto; |
|
return O; |
|
}; |
|
}() : undefined); |
|
|
|
var IteratorPrototype$2 = iteratorsCore.IteratorPrototype; |
|
var BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS; |
|
var ITERATOR$1 = wellKnownSymbol('iterator'); |
|
var KEYS = 'keys'; |
|
var VALUES = 'values'; |
|
var ENTRIES = 'entries'; |
|
|
|
var returnThis$2 = function () { return this; }; |
|
|
|
var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { |
|
createIteratorConstructor(IteratorConstructor, NAME, next); |
|
|
|
var getIterationMethod = function (KIND) { |
|
if (KIND === DEFAULT && defaultIterator) return defaultIterator; |
|
if (!BUGGY_SAFARI_ITERATORS$1 && KIND in IterablePrototype) return IterablePrototype[KIND]; |
|
switch (KIND) { |
|
case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; |
|
case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; |
|
case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; |
|
} return function () { return new IteratorConstructor(this); }; |
|
}; |
|
|
|
var TO_STRING_TAG = NAME + ' Iterator'; |
|
var INCORRECT_VALUES_NAME = false; |
|
var IterablePrototype = Iterable.prototype; |
|
var nativeIterator = IterablePrototype[ITERATOR$1] |
|
|| IterablePrototype['@@iterator'] |
|
|| DEFAULT && IterablePrototype[DEFAULT]; |
|
var defaultIterator = !BUGGY_SAFARI_ITERATORS$1 && nativeIterator || getIterationMethod(DEFAULT); |
|
var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; |
|
var CurrentIteratorPrototype, methods, KEY; |
|
|
|
|
|
if (anyNativeIterator) { |
|
CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable())); |
|
if (IteratorPrototype$2 !== Object.prototype && CurrentIteratorPrototype.next) { |
|
if ( objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype$2) { |
|
if (objectSetPrototypeOf) { |
|
objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$2); |
|
} else if (typeof CurrentIteratorPrototype[ITERATOR$1] != 'function') { |
|
hide(CurrentIteratorPrototype, ITERATOR$1, returnThis$2); |
|
} |
|
} |
|
|
|
setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true); |
|
} |
|
} |
|
|
|
|
|
if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { |
|
INCORRECT_VALUES_NAME = true; |
|
defaultIterator = function values() { return nativeIterator.call(this); }; |
|
} |
|
|
|
|
|
if ( IterablePrototype[ITERATOR$1] !== defaultIterator) { |
|
hide(IterablePrototype, ITERATOR$1, defaultIterator); |
|
} |
|
iterators[NAME] = defaultIterator; |
|
|
|
|
|
if (DEFAULT) { |
|
methods = { |
|
values: getIterationMethod(VALUES), |
|
keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), |
|
entries: getIterationMethod(ENTRIES) |
|
}; |
|
if (FORCED) for (KEY in methods) { |
|
if (BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { |
|
redefine(IterablePrototype, KEY, methods[KEY]); |
|
} |
|
} else _export({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME }, methods); |
|
} |
|
|
|
return methods; |
|
}; |
|
|
|
var ARRAY_ITERATOR = 'Array Iterator'; |
|
var setInternalState = internalState.set; |
|
var getInternalState = internalState.getterFor(ARRAY_ITERATOR); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) { |
|
setInternalState(this, { |
|
type: ARRAY_ITERATOR, |
|
target: toIndexedObject(iterated), |
|
index: 0, |
|
kind: kind |
|
}); |
|
|
|
|
|
}, function () { |
|
var state = getInternalState(this); |
|
var target = state.target; |
|
var kind = state.kind; |
|
var index = state.index++; |
|
if (!target || index >= target.length) { |
|
state.target = undefined; |
|
return { value: undefined, done: true }; |
|
} |
|
if (kind == 'keys') return { value: index, done: false }; |
|
if (kind == 'values') return { value: target[index], done: false }; |
|
return { value: [index, target[index]], done: false }; |
|
}, 'values'); |
|
|
|
|
|
|
|
|
|
iterators.Arguments = iterators.Array; |
|
|
|
|
|
addToUnscopables('keys'); |
|
addToUnscopables('values'); |
|
addToUnscopables('entries'); |
|
|
|
var nativeAssign = Object.assign; |
|
|
|
|
|
|
|
|
|
var objectAssign = !nativeAssign || fails(function () { |
|
var A = {}; |
|
var B = {}; |
|
|
|
var symbol = Symbol(); |
|
var alphabet = 'abcdefghijklmnopqrst'; |
|
A[symbol] = 7; |
|
alphabet.split('').forEach(function (chr) { B[chr] = chr; }); |
|
return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet; |
|
}) ? function assign(target, source) { |
|
var T = toObject(target); |
|
var argumentsLength = arguments.length; |
|
var index = 1; |
|
var getOwnPropertySymbols = objectGetOwnPropertySymbols.f; |
|
var propertyIsEnumerable = objectPropertyIsEnumerable.f; |
|
while (argumentsLength > index) { |
|
var S = indexedObject(arguments[index++]); |
|
var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S); |
|
var length = keys.length; |
|
var j = 0; |
|
var key; |
|
while (length > j) { |
|
key = keys[j++]; |
|
if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key]; |
|
} |
|
} return T; |
|
} : nativeAssign; |
|
|
|
|
|
|
|
_export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, { |
|
assign: objectAssign |
|
}); |
|
|
|
var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag'); |
|
|
|
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments'; |
|
|
|
|
|
var tryGet = function (it, key) { |
|
try { |
|
return it[key]; |
|
} catch (error) { } |
|
}; |
|
|
|
|
|
var classof = function (it) { |
|
var O, tag, result; |
|
return it === undefined ? 'Undefined' : it === null ? 'Null' |
|
|
|
: typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$1)) == 'string' ? tag |
|
|
|
: CORRECT_ARGUMENTS ? classofRaw(O) |
|
|
|
: (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result; |
|
}; |
|
|
|
var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag'); |
|
var test = {}; |
|
|
|
test[TO_STRING_TAG$2] = 'z'; |
|
|
|
|
|
|
|
var objectToString = String(test) !== '[object z]' ? function toString() { |
|
return '[object ' + classof(this) + ']'; |
|
} : test.toString; |
|
|
|
var ObjectPrototype$1 = Object.prototype; |
|
|
|
|
|
|
|
if (objectToString !== ObjectPrototype$1.toString) { |
|
redefine(ObjectPrototype$1, 'toString', objectToString, { unsafe: true }); |
|
} |
|
|
|
|
|
|
|
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'; |
|
|
|
var whitespace = '[' + whitespaces + ']'; |
|
var ltrim = RegExp('^' + whitespace + whitespace + '*'); |
|
var rtrim = RegExp(whitespace + whitespace + '*$'); |
|
|
|
|
|
var createMethod$2 = function (TYPE) { |
|
return function ($this) { |
|
var string = String(requireObjectCoercible($this)); |
|
if (TYPE & 1) string = string.replace(ltrim, ''); |
|
if (TYPE & 2) string = string.replace(rtrim, ''); |
|
return string; |
|
}; |
|
}; |
|
|
|
var stringTrim = { |
|
|
|
|
|
start: createMethod$2(1), |
|
|
|
|
|
end: createMethod$2(2), |
|
|
|
|
|
trim: createMethod$2(3) |
|
}; |
|
|
|
var trim = stringTrim.trim; |
|
|
|
|
|
var nativeParseInt = global_1.parseInt; |
|
var hex = /^[+-]?0[Xx]/; |
|
var FORCED = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22; |
|
|
|
|
|
|
|
var _parseInt = FORCED ? function parseInt(string, radix) { |
|
var S = trim(String(string)); |
|
return nativeParseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10)); |
|
} : nativeParseInt; |
|
|
|
|
|
|
|
_export({ global: true, forced: parseInt != _parseInt }, { |
|
parseInt: _parseInt |
|
}); |
|
|
|
|
|
var createMethod$3 = function (CONVERT_TO_STRING) { |
|
return function ($this, pos) { |
|
var S = String(requireObjectCoercible($this)); |
|
var position = toInteger(pos); |
|
var size = S.length; |
|
var first, second; |
|
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; |
|
first = S.charCodeAt(position); |
|
return first < 0xD800 || first > 0xDBFF || position + 1 === size |
|
|| (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF |
|
? CONVERT_TO_STRING ? S.charAt(position) : first |
|
: CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; |
|
}; |
|
}; |
|
|
|
var stringMultibyte = { |
|
|
|
|
|
codeAt: createMethod$3(false), |
|
|
|
|
|
charAt: createMethod$3(true) |
|
}; |
|
|
|
var charAt = stringMultibyte.charAt; |
|
|
|
|
|
|
|
var STRING_ITERATOR = 'String Iterator'; |
|
var setInternalState$1 = internalState.set; |
|
var getInternalState$1 = internalState.getterFor(STRING_ITERATOR); |
|
|
|
|
|
|
|
defineIterator(String, 'String', function (iterated) { |
|
setInternalState$1(this, { |
|
type: STRING_ITERATOR, |
|
string: String(iterated), |
|
index: 0 |
|
}); |
|
|
|
|
|
}, function next() { |
|
var state = getInternalState$1(this); |
|
var string = state.string; |
|
var index = state.index; |
|
var point; |
|
if (index >= string.length) return { value: undefined, done: true }; |
|
point = charAt(string, index); |
|
state.index += point.length; |
|
return { value: point, done: false }; |
|
}); |
|
|
|
var redefineAll = function (target, src, options) { |
|
for (var key in src) redefine(target, key, src[key], options); |
|
return target; |
|
}; |
|
|
|
var freezing = !fails(function () { |
|
return Object.isExtensible(Object.preventExtensions({})); |
|
}); |
|
|
|
var internalMetadata = createCommonjsModule(function (module) { |
|
var defineProperty = objectDefineProperty.f; |
|
|
|
|
|
|
|
var METADATA = uid('meta'); |
|
var id = 0; |
|
|
|
var isExtensible = Object.isExtensible || function () { |
|
return true; |
|
}; |
|
|
|
var setMetadata = function (it) { |
|
defineProperty(it, METADATA, { value: { |
|
objectID: 'O' + ++id, |
|
weakData: {} |
|
} }); |
|
}; |
|
|
|
var fastKey = function (it, create) { |
|
|
|
if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; |
|
if (!has(it, METADATA)) { |
|
|
|
if (!isExtensible(it)) return 'F'; |
|
|
|
if (!create) return 'E'; |
|
|
|
setMetadata(it); |
|
|
|
} return it[METADATA].objectID; |
|
}; |
|
|
|
var getWeakData = function (it, create) { |
|
if (!has(it, METADATA)) { |
|
|
|
if (!isExtensible(it)) return true; |
|
|
|
if (!create) return false; |
|
|
|
setMetadata(it); |
|
|
|
} return it[METADATA].weakData; |
|
}; |
|
|
|
|
|
var onFreeze = function (it) { |
|
if (freezing && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it); |
|
return it; |
|
}; |
|
|
|
var meta = module.exports = { |
|
REQUIRED: false, |
|
fastKey: fastKey, |
|
getWeakData: getWeakData, |
|
onFreeze: onFreeze |
|
}; |
|
|
|
hiddenKeys[METADATA] = true; |
|
}); |
|
var internalMetadata_1 = internalMetadata.REQUIRED; |
|
var internalMetadata_2 = internalMetadata.fastKey; |
|
var internalMetadata_3 = internalMetadata.getWeakData; |
|
var internalMetadata_4 = internalMetadata.onFreeze; |
|
|
|
var ITERATOR$2 = wellKnownSymbol('iterator'); |
|
var ArrayPrototype$1 = Array.prototype; |
|
|
|
|
|
var isArrayIteratorMethod = function (it) { |
|
return it !== undefined && (iterators.Array === it || ArrayPrototype$1[ITERATOR$2] === it); |
|
}; |
|
|
|
var ITERATOR$3 = wellKnownSymbol('iterator'); |
|
|
|
var getIteratorMethod = function (it) { |
|
if (it != undefined) return it[ITERATOR$3] |
|
|| it['@@iterator'] |
|
|| iterators[classof(it)]; |
|
}; |
|
|
|
|
|
var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) { |
|
try { |
|
return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); |
|
|
|
} catch (error) { |
|
var returnMethod = iterator['return']; |
|
if (returnMethod !== undefined) anObject(returnMethod.call(iterator)); |
|
throw error; |
|
} |
|
}; |
|
|
|
var iterate_1 = createCommonjsModule(function (module) { |
|
var Result = function (stopped, result) { |
|
this.stopped = stopped; |
|
this.result = result; |
|
}; |
|
|
|
var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) { |
|
var boundFunction = bindContext(fn, that, AS_ENTRIES ? 2 : 1); |
|
var iterator, iterFn, index, length, result, step; |
|
|
|
if (IS_ITERATOR) { |
|
iterator = iterable; |
|
} else { |
|
iterFn = getIteratorMethod(iterable); |
|
if (typeof iterFn != 'function') throw TypeError('Target is not iterable'); |
|
|
|
if (isArrayIteratorMethod(iterFn)) { |
|
for (index = 0, length = toLength(iterable.length); length > index; index++) { |
|
result = AS_ENTRIES |
|
? boundFunction(anObject(step = iterable[index])[0], step[1]) |
|
: boundFunction(iterable[index]); |
|
if (result && result instanceof Result) return result; |
|
} return new Result(false); |
|
} |
|
iterator = iterFn.call(iterable); |
|
} |
|
|
|
while (!(step = iterator.next()).done) { |
|
result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES); |
|
if (result && result instanceof Result) return result; |
|
} return new Result(false); |
|
}; |
|
|
|
iterate.stop = function (result) { |
|
return new Result(true, result); |
|
}; |
|
}); |
|
|
|
var anInstance = function (it, Constructor, name) { |
|
if (!(it instanceof Constructor)) { |
|
throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation'); |
|
} return it; |
|
}; |
|
|
|
var ITERATOR$4 = wellKnownSymbol('iterator'); |
|
var SAFE_CLOSING = false; |
|
|
|
try { |
|
var called = 0; |
|
var iteratorWithReturn = { |
|
next: function () { |
|
return { done: !!called++ }; |
|
}, |
|
'return': function () { |
|
SAFE_CLOSING = true; |
|
} |
|
}; |
|
iteratorWithReturn[ITERATOR$4] = function () { |
|
return this; |
|
}; |
|
|
|
Array.from(iteratorWithReturn, function () { throw 2; }); |
|
} catch (error) { } |
|
|
|
var checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) { |
|
if (!SKIP_CLOSING && !SAFE_CLOSING) return false; |
|
var ITERATION_SUPPORT = false; |
|
try { |
|
var object = {}; |
|
object[ITERATOR$4] = function () { |
|
return { |
|
next: function () { |
|
return { done: ITERATION_SUPPORT = true }; |
|
} |
|
}; |
|
}; |
|
exec(object); |
|
} catch (error) { } |
|
return ITERATION_SUPPORT; |
|
}; |
|
|
|
|
|
var inheritIfRequired = function ($this, dummy, Wrapper) { |
|
var NewTarget, NewTargetPrototype; |
|
if ( |
|
|
|
objectSetPrototypeOf && |
|
|
|
typeof (NewTarget = dummy.constructor) == 'function' && |
|
NewTarget !== Wrapper && |
|
isObject(NewTargetPrototype = NewTarget.prototype) && |
|
NewTargetPrototype !== Wrapper.prototype |
|
) objectSetPrototypeOf($this, NewTargetPrototype); |
|
return $this; |
|
}; |
|
|
|
var collection = function (CONSTRUCTOR_NAME, wrapper, common, IS_MAP, IS_WEAK) { |
|
var NativeConstructor = global_1[CONSTRUCTOR_NAME]; |
|
var NativePrototype = NativeConstructor && NativeConstructor.prototype; |
|
var Constructor = NativeConstructor; |
|
var ADDER = IS_MAP ? 'set' : 'add'; |
|
var exported = {}; |
|
|
|
var fixMethod = function (KEY) { |
|
var nativeMethod = NativePrototype[KEY]; |
|
redefine(NativePrototype, KEY, |
|
KEY == 'add' ? function add(value) { |
|
nativeMethod.call(this, value === 0 ? 0 : value); |
|
return this; |
|
} : KEY == 'delete' ? function (key) { |
|
return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key); |
|
} : KEY == 'get' ? function get(key) { |
|
return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key); |
|
} : KEY == 'has' ? function has(key) { |
|
return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key); |
|
} : function set(key, value) { |
|
nativeMethod.call(this, key === 0 ? 0 : key, value); |
|
return this; |
|
} |
|
); |
|
}; |
|
|
|
|
|
if (isForced_1(CONSTRUCTOR_NAME, typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () { |
|
new NativeConstructor().entries().next(); |
|
})))) { |
|
|
|
Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER); |
|
internalMetadata.REQUIRED = true; |
|
} else if (isForced_1(CONSTRUCTOR_NAME, true)) { |
|
var instance = new Constructor(); |
|
|
|
var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; |
|
|
|
var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); |
|
|
|
|
|
var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); }); |
|
|
|
var BUGGY_ZERO = !IS_WEAK && fails(function () { |
|
|
|
var $instance = new NativeConstructor(); |
|
var index = 5; |
|
while (index--) $instance[ADDER](index, index); |
|
return !$instance.has(-0); |
|
}); |
|
|
|
if (!ACCEPT_ITERABLES) { |
|
Constructor = wrapper(function (dummy, iterable) { |
|
anInstance(dummy, Constructor, CONSTRUCTOR_NAME); |
|
var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor); |
|
if (iterable != undefined) iterate_1(iterable, that[ADDER], that, IS_MAP); |
|
return that; |
|
}); |
|
Constructor.prototype = NativePrototype; |
|
NativePrototype.constructor = Constructor; |
|
} |
|
|
|
if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { |
|
fixMethod('delete'); |
|
fixMethod('has'); |
|
IS_MAP && fixMethod('get'); |
|
} |
|
|
|
if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); |
|
|
|
|
|
if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear; |
|
} |
|
|
|
exported[CONSTRUCTOR_NAME] = Constructor; |
|
_export({ global: true, forced: Constructor != NativeConstructor }, exported); |
|
|
|
setToStringTag(Constructor, CONSTRUCTOR_NAME); |
|
|
|
if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP); |
|
|
|
return Constructor; |
|
}; |
|
|
|
var getWeakData = internalMetadata.getWeakData; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var setInternalState$2 = internalState.set; |
|
var internalStateGetterFor = internalState.getterFor; |
|
var find = arrayIteration.find; |
|
var findIndex = arrayIteration.findIndex; |
|
var id$1 = 0; |
|
|
|
|
|
var uncaughtFrozenStore = function (store) { |
|
return store.frozen || (store.frozen = new UncaughtFrozenStore()); |
|
}; |
|
|
|
var UncaughtFrozenStore = function () { |
|
this.entries = []; |
|
}; |
|
|
|
var findUncaughtFrozen = function (store, key) { |
|
return find(store.entries, function (it) { |
|
return it[0] === key; |
|
}); |
|
}; |
|
|
|
UncaughtFrozenStore.prototype = { |
|
get: function (key) { |
|
var entry = findUncaughtFrozen(this, key); |
|
if (entry) return entry[1]; |
|
}, |
|
has: function (key) { |
|
return !!findUncaughtFrozen(this, key); |
|
}, |
|
set: function (key, value) { |
|
var entry = findUncaughtFrozen(this, key); |
|
if (entry) entry[1] = value; |
|
else this.entries.push([key, value]); |
|
}, |
|
'delete': function (key) { |
|
var index = findIndex(this.entries, function (it) { |
|
return it[0] === key; |
|
}); |
|
if (~index) this.entries.splice(index, 1); |
|
return !!~index; |
|
} |
|
}; |
|
|
|
var collectionWeak = { |
|
getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { |
|
var C = wrapper(function (that, iterable) { |
|
anInstance(that, C, CONSTRUCTOR_NAME); |
|
setInternalState$2(that, { |
|
type: CONSTRUCTOR_NAME, |
|
id: id$1++, |
|
frozen: undefined |
|
}); |
|
if (iterable != undefined) iterate_1(iterable, that[ADDER], that, IS_MAP); |
|
}); |
|
|
|
var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); |
|
|
|
var define = function (that, key, value) { |
|
var state = getInternalState(that); |
|
var data = getWeakData(anObject(key), true); |
|
if (data === true) uncaughtFrozenStore(state).set(key, value); |
|
else data[state.id] = value; |
|
return that; |
|
}; |
|
|
|
redefineAll(C.prototype, { |
|
|
|
|
|
'delete': function (key) { |
|
var state = getInternalState(this); |
|
if (!isObject(key)) return false; |
|
var data = getWeakData(key); |
|
if (data === true) return uncaughtFrozenStore(state)['delete'](key); |
|
return data && has(data, state.id) && delete data[state.id]; |
|
}, |
|
|
|
|
|
has: function has$1(key) { |
|
var state = getInternalState(this); |
|
if (!isObject(key)) return false; |
|
var data = getWeakData(key); |
|
if (data === true) return uncaughtFrozenStore(state).has(key); |
|
return data && has(data, state.id); |
|
} |
|
}); |
|
|
|
redefineAll(C.prototype, IS_MAP ? { |
|
|
|
get: function get(key) { |
|
var state = getInternalState(this); |
|
if (isObject(key)) { |
|
var data = getWeakData(key); |
|
if (data === true) return uncaughtFrozenStore(state).get(key); |
|
return data ? data[state.id] : undefined; |
|
} |
|
}, |
|
|
|
set: function set(key, value) { |
|
return define(this, key, value); |
|
} |
|
} : { |
|
|
|
add: function add(value) { |
|
return define(this, value, true); |
|
} |
|
}); |
|
|
|
return C; |
|
} |
|
}; |
|
|
|
var es_weakMap = createCommonjsModule(function (module) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
var enforceIternalState = internalState.enforce; |
|
|
|
|
|
var IS_IE11 = !global_1.ActiveXObject && 'ActiveXObject' in global_1; |
|
var isExtensible = Object.isExtensible; |
|
var InternalWeakMap; |
|
|
|
var wrapper = function (get) { |
|
return function WeakMap() { |
|
return get(this, arguments.length ? arguments[0] : undefined); |
|
}; |
|
}; |
|
|
|
|
|
|
|
var $WeakMap = module.exports = collection('WeakMap', wrapper, collectionWeak, true, true); |
|
|
|
|
|
|
|
|
|
if (nativeWeakMap && IS_IE11) { |
|
InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true); |
|
internalMetadata.REQUIRED = true; |
|
var WeakMapPrototype = $WeakMap.prototype; |
|
var nativeDelete = WeakMapPrototype['delete']; |
|
var nativeHas = WeakMapPrototype.has; |
|
var nativeGet = WeakMapPrototype.get; |
|
var nativeSet = WeakMapPrototype.set; |
|
redefineAll(WeakMapPrototype, { |
|
'delete': function (key) { |
|
if (isObject(key) && !isExtensible(key)) { |
|
var state = enforceIternalState(this); |
|
if (!state.frozen) state.frozen = new InternalWeakMap(); |
|
return nativeDelete.call(this, key) || state.frozen['delete'](key); |
|
} return nativeDelete.call(this, key); |
|
}, |
|
has: function has(key) { |
|
if (isObject(key) && !isExtensible(key)) { |
|
var state = enforceIternalState(this); |
|
if (!state.frozen) state.frozen = new InternalWeakMap(); |
|
return nativeHas.call(this, key) || state.frozen.has(key); |
|
} return nativeHas.call(this, key); |
|
}, |
|
get: function get(key) { |
|
if (isObject(key) && !isExtensible(key)) { |
|
var state = enforceIternalState(this); |
|
if (!state.frozen) state.frozen = new InternalWeakMap(); |
|
return nativeHas.call(this, key) ? nativeGet.call(this, key) : state.frozen.get(key); |
|
} return nativeGet.call(this, key); |
|
}, |
|
set: function set(key, value) { |
|
if (isObject(key) && !isExtensible(key)) { |
|
var state = enforceIternalState(this); |
|
if (!state.frozen) state.frozen = new InternalWeakMap(); |
|
nativeHas.call(this, key) ? nativeSet.call(this, key, value) : state.frozen.set(key, value); |
|
} else nativeSet.call(this, key, value); |
|
return this; |
|
} |
|
}); |
|
} |
|
}); |
|
|
|
var ITERATOR$5 = wellKnownSymbol('iterator'); |
|
var TO_STRING_TAG$3 = wellKnownSymbol('toStringTag'); |
|
var ArrayValues = es_array_iterator.values; |
|
|
|
for (var COLLECTION_NAME$1 in domIterables) { |
|
var Collection$1 = global_1[COLLECTION_NAME$1]; |
|
var CollectionPrototype$1 = Collection$1 && Collection$1.prototype; |
|
if (CollectionPrototype$1) { |
|
|
|
if (CollectionPrototype$1[ITERATOR$5] !== ArrayValues) try { |
|
hide(CollectionPrototype$1, ITERATOR$5, ArrayValues); |
|
} catch (error) { |
|
CollectionPrototype$1[ITERATOR$5] = ArrayValues; |
|
} |
|
if (!CollectionPrototype$1[TO_STRING_TAG$3]) hide(CollectionPrototype$1, TO_STRING_TAG$3, COLLECTION_NAME$1); |
|
if (domIterables[COLLECTION_NAME$1]) for (var METHOD_NAME in es_array_iterator) { |
|
|
|
if (CollectionPrototype$1[METHOD_NAME] !== es_array_iterator[METHOD_NAME]) try { |
|
hide(CollectionPrototype$1, METHOD_NAME, es_array_iterator[METHOD_NAME]); |
|
} catch (error) { |
|
CollectionPrototype$1[METHOD_NAME] = es_array_iterator[METHOD_NAME]; |
|
} |
|
} |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var FUNC_ERROR_TEXT = 'Expected a function'; |
|
|
|
|
|
var NAN = 0 / 0; |
|
|
|
|
|
var symbolTag = '[object Symbol]'; |
|
|
|
|
|
var reTrim = /^\s+|\s+$/g; |
|
|
|
|
|
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; |
|
|
|
|
|
var reIsBinary = /^0b[01]+$/i; |
|
|
|
|
|
var reIsOctal = /^0o[0-7]+$/i; |
|
|
|
|
|
var freeParseInt = parseInt; |
|
|
|
|
|
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; |
|
|
|
|
|
var freeSelf = typeof self == 'object' && self && self.Object === Object && self; |
|
|
|
|
|
var root = freeGlobal || freeSelf || Function('return this')(); |
|
|
|
|
|
var objectProto = Object.prototype; |
|
|
|
|
|
|
|
|
|
|
|
|
|
var objectToString$1 = objectProto.toString; |
|
|
|
|
|
var nativeMax = Math.max, |
|
nativeMin = Math.min; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var now = function() { |
|
return root.Date.now(); |
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function debounce(func, wait, options) { |
|
var lastArgs, |
|
lastThis, |
|
maxWait, |
|
result, |
|
timerId, |
|
lastCallTime, |
|
lastInvokeTime = 0, |
|
leading = false, |
|
maxing = false, |
|
trailing = true; |
|
|
|
if (typeof func != 'function') { |
|
throw new TypeError(FUNC_ERROR_TEXT); |
|
} |
|
wait = toNumber(wait) || 0; |
|
if (isObject$1(options)) { |
|
leading = !!options.leading; |
|
maxing = 'maxWait' in options; |
|
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; |
|
trailing = 'trailing' in options ? !!options.trailing : trailing; |
|
} |
|
|
|
function invokeFunc(time) { |
|
var args = lastArgs, |
|
thisArg = lastThis; |
|
|
|
lastArgs = lastThis = undefined; |
|
lastInvokeTime = time; |
|
result = func.apply(thisArg, args); |
|
return result; |
|
} |
|
|
|
function leadingEdge(time) { |
|
|
|
lastInvokeTime = time; |
|
|
|
timerId = setTimeout(timerExpired, wait); |
|
|
|
return leading ? invokeFunc(time) : result; |
|
} |
|
|
|
function remainingWait(time) { |
|
var timeSinceLastCall = time - lastCallTime, |
|
timeSinceLastInvoke = time - lastInvokeTime, |
|
result = wait - timeSinceLastCall; |
|
|
|
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; |
|
} |
|
|
|
function shouldInvoke(time) { |
|
var timeSinceLastCall = time - lastCallTime, |
|
timeSinceLastInvoke = time - lastInvokeTime; |
|
|
|
|
|
|
|
|
|
return (lastCallTime === undefined || (timeSinceLastCall >= wait) || |
|
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); |
|
} |
|
|
|
function timerExpired() { |
|
var time = now(); |
|
if (shouldInvoke(time)) { |
|
return trailingEdge(time); |
|
} |
|
|
|
timerId = setTimeout(timerExpired, remainingWait(time)); |
|
} |
|
|
|
function trailingEdge(time) { |
|
timerId = undefined; |
|
|
|
|
|
|
|
if (trailing && lastArgs) { |
|
return invokeFunc(time); |
|
} |
|
lastArgs = lastThis = undefined; |
|
return result; |
|
} |
|
|
|
function cancel() { |
|
if (timerId !== undefined) { |
|
clearTimeout(timerId); |
|
} |
|
lastInvokeTime = 0; |
|
lastArgs = lastCallTime = lastThis = timerId = undefined; |
|
} |
|
|
|
function flush() { |
|
return timerId === undefined ? result : trailingEdge(now()); |
|
} |
|
|
|
function debounced() { |
|
var time = now(), |
|
isInvoking = shouldInvoke(time); |
|
|
|
lastArgs = arguments; |
|
lastThis = this; |
|
lastCallTime = time; |
|
|
|
if (isInvoking) { |
|
if (timerId === undefined) { |
|
return leadingEdge(lastCallTime); |
|
} |
|
if (maxing) { |
|
|
|
timerId = setTimeout(timerExpired, wait); |
|
return invokeFunc(lastCallTime); |
|
} |
|
} |
|
if (timerId === undefined) { |
|
timerId = setTimeout(timerExpired, wait); |
|
} |
|
return result; |
|
} |
|
debounced.cancel = cancel; |
|
debounced.flush = flush; |
|
return debounced; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function throttle(func, wait, options) { |
|
var leading = true, |
|
trailing = true; |
|
|
|
if (typeof func != 'function') { |
|
throw new TypeError(FUNC_ERROR_TEXT); |
|
} |
|
if (isObject$1(options)) { |
|
leading = 'leading' in options ? !!options.leading : leading; |
|
trailing = 'trailing' in options ? !!options.trailing : trailing; |
|
} |
|
return debounce(func, wait, { |
|
'leading': leading, |
|
'maxWait': wait, |
|
'trailing': trailing |
|
}); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isObject$1(value) { |
|
var type = typeof value; |
|
return !!value && (type == 'object' || type == 'function'); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isObjectLike(value) { |
|
return !!value && typeof value == 'object'; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isSymbol(value) { |
|
return typeof value == 'symbol' || |
|
(isObjectLike(value) && objectToString$1.call(value) == symbolTag); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function toNumber(value) { |
|
if (typeof value == 'number') { |
|
return value; |
|
} |
|
if (isSymbol(value)) { |
|
return NAN; |
|
} |
|
if (isObject$1(value)) { |
|
var other = typeof value.valueOf == 'function' ? value.valueOf() : value; |
|
value = isObject$1(other) ? (other + '') : other; |
|
} |
|
if (typeof value != 'string') { |
|
return value === 0 ? value : +value; |
|
} |
|
value = value.replace(reTrim, ''); |
|
var isBinary = reIsBinary.test(value); |
|
return (isBinary || reIsOctal.test(value)) |
|
? freeParseInt(value.slice(2), isBinary ? 2 : 8) |
|
: (reIsBadHex.test(value) ? NAN : +value); |
|
} |
|
|
|
var lodash_throttle = throttle; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var FUNC_ERROR_TEXT$1 = 'Expected a function'; |
|
|
|
|
|
var NAN$1 = 0 / 0; |
|
|
|
|
|
var symbolTag$1 = '[object Symbol]'; |
|
|
|
|
|
var reTrim$1 = /^\s+|\s+$/g; |
|
|
|
|
|
var reIsBadHex$1 = /^[-+]0x[0-9a-f]+$/i; |
|
|
|
|
|
var reIsBinary$1 = /^0b[01]+$/i; |
|
|
|
|
|
var reIsOctal$1 = /^0o[0-7]+$/i; |
|
|
|
|
|
var freeParseInt$1 = parseInt; |
|
|
|
|
|
var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; |
|
|
|
|
|
var freeSelf$1 = typeof self == 'object' && self && self.Object === Object && self; |
|
|
|
|
|
var root$1 = freeGlobal$1 || freeSelf$1 || Function('return this')(); |
|
|
|
|
|
var objectProto$1 = Object.prototype; |
|
|
|
|
|
|
|
|
|
|
|
|
|
var objectToString$2 = objectProto$1.toString; |
|
|
|
|
|
var nativeMax$1 = Math.max, |
|
nativeMin$1 = Math.min; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var now$1 = function() { |
|
return root$1.Date.now(); |
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function debounce$1(func, wait, options) { |
|
var lastArgs, |
|
lastThis, |
|
maxWait, |
|
result, |
|
timerId, |
|
lastCallTime, |
|
lastInvokeTime = 0, |
|
leading = false, |
|
maxing = false, |
|
trailing = true; |
|
|
|
if (typeof func != 'function') { |
|
throw new TypeError(FUNC_ERROR_TEXT$1); |
|
} |
|
wait = toNumber$1(wait) || 0; |
|
if (isObject$2(options)) { |
|
leading = !!options.leading; |
|
maxing = 'maxWait' in options; |
|
maxWait = maxing ? nativeMax$1(toNumber$1(options.maxWait) || 0, wait) : maxWait; |
|
trailing = 'trailing' in options ? !!options.trailing : trailing; |
|
} |
|
|
|
function invokeFunc(time) { |
|
var args = lastArgs, |
|
thisArg = lastThis; |
|
|
|
lastArgs = lastThis = undefined; |
|
lastInvokeTime = time; |
|
result = func.apply(thisArg, args); |
|
return result; |
|
} |
|
|
|
function leadingEdge(time) { |
|
|
|
lastInvokeTime = time; |
|
|
|
timerId = setTimeout(timerExpired, wait); |
|
|
|
return leading ? invokeFunc(time) : result; |
|
} |
|
|
|
function remainingWait(time) { |
|
var timeSinceLastCall = time - lastCallTime, |
|
timeSinceLastInvoke = time - lastInvokeTime, |
|
result = wait - timeSinceLastCall; |
|
|
|
return maxing ? nativeMin$1(result, maxWait - timeSinceLastInvoke) : result; |
|
} |
|
|
|
function shouldInvoke(time) { |
|
var timeSinceLastCall = time - lastCallTime, |
|
timeSinceLastInvoke = time - lastInvokeTime; |
|
|
|
|
|
|
|
|
|
return (lastCallTime === undefined || (timeSinceLastCall >= wait) || |
|
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); |
|
} |
|
|
|
function timerExpired() { |
|
var time = now$1(); |
|
if (shouldInvoke(time)) { |
|
return trailingEdge(time); |
|
} |
|
|
|
timerId = setTimeout(timerExpired, remainingWait(time)); |
|
} |
|
|
|
function trailingEdge(time) { |
|
timerId = undefined; |
|
|
|
|
|
|
|
if (trailing && lastArgs) { |
|
return invokeFunc(time); |
|
} |
|
lastArgs = lastThis = undefined; |
|
return result; |
|
} |
|
|
|
function cancel() { |
|
if (timerId !== undefined) { |
|
clearTimeout(timerId); |
|
} |
|
lastInvokeTime = 0; |
|
lastArgs = lastCallTime = lastThis = timerId = undefined; |
|
} |
|
|
|
function flush() { |
|
return timerId === undefined ? result : trailingEdge(now$1()); |
|
} |
|
|
|
function debounced() { |
|
var time = now$1(), |
|
isInvoking = shouldInvoke(time); |
|
|
|
lastArgs = arguments; |
|
lastThis = this; |
|
lastCallTime = time; |
|
|
|
if (isInvoking) { |
|
if (timerId === undefined) { |
|
return leadingEdge(lastCallTime); |
|
} |
|
if (maxing) { |
|
|
|
timerId = setTimeout(timerExpired, wait); |
|
return invokeFunc(lastCallTime); |
|
} |
|
} |
|
if (timerId === undefined) { |
|
timerId = setTimeout(timerExpired, wait); |
|
} |
|
return result; |
|
} |
|
debounced.cancel = cancel; |
|
debounced.flush = flush; |
|
return debounced; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isObject$2(value) { |
|
var type = typeof value; |
|
return !!value && (type == 'object' || type == 'function'); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isObjectLike$1(value) { |
|
return !!value && typeof value == 'object'; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isSymbol$1(value) { |
|
return typeof value == 'symbol' || |
|
(isObjectLike$1(value) && objectToString$2.call(value) == symbolTag$1); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function toNumber$1(value) { |
|
if (typeof value == 'number') { |
|
return value; |
|
} |
|
if (isSymbol$1(value)) { |
|
return NAN$1; |
|
} |
|
if (isObject$2(value)) { |
|
var other = typeof value.valueOf == 'function' ? value.valueOf() : value; |
|
value = isObject$2(other) ? (other + '') : other; |
|
} |
|
if (typeof value != 'string') { |
|
return value === 0 ? value : +value; |
|
} |
|
value = value.replace(reTrim$1, ''); |
|
var isBinary = reIsBinary$1.test(value); |
|
return (isBinary || reIsOctal$1.test(value)) |
|
? freeParseInt$1(value.slice(2), isBinary ? 2 : 8) |
|
: (reIsBadHex$1.test(value) ? NAN$1 : +value); |
|
} |
|
|
|
var lodash_debounce = debounce$1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var FUNC_ERROR_TEXT$2 = 'Expected a function'; |
|
|
|
|
|
var HASH_UNDEFINED = '__lodash_hash_undefined__'; |
|
|
|
|
|
var funcTag = '[object Function]', |
|
genTag = '[object GeneratorFunction]'; |
|
|
|
|
|
|
|
|
|
|
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; |
|
|
|
|
|
var reIsHostCtor = /^\[object .+?Constructor\]$/; |
|
|
|
|
|
var freeGlobal$2 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; |
|
|
|
|
|
var freeSelf$2 = typeof self == 'object' && self && self.Object === Object && self; |
|
|
|
|
|
var root$2 = freeGlobal$2 || freeSelf$2 || Function('return this')(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getValue(object, key) { |
|
return object == null ? undefined : object[key]; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isHostObject(value) { |
|
|
|
|
|
var result = false; |
|
if (value != null && typeof value.toString != 'function') { |
|
try { |
|
result = !!(value + ''); |
|
} catch (e) {} |
|
} |
|
return result; |
|
} |
|
|
|
|
|
var arrayProto = Array.prototype, |
|
funcProto = Function.prototype, |
|
objectProto$2 = Object.prototype; |
|
|
|
|
|
var coreJsData = root$2['__core-js_shared__']; |
|
|
|
|
|
var maskSrcKey = (function() { |
|
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); |
|
return uid ? ('Symbol(src)_1.' + uid) : ''; |
|
}()); |
|
|
|
|
|
var funcToString = funcProto.toString; |
|
|
|
|
|
var hasOwnProperty$1 = objectProto$2.hasOwnProperty; |
|
|
|
|
|
|
|
|
|
|
|
|
|
var objectToString$3 = objectProto$2.toString; |
|
|
|
|
|
var reIsNative = RegExp('^' + |
|
funcToString.call(hasOwnProperty$1).replace(reRegExpChar, '\\$&') |
|
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' |
|
); |
|
|
|
|
|
var splice = arrayProto.splice; |
|
|
|
|
|
var Map = getNative(root$2, 'Map'), |
|
nativeCreate = getNative(Object, 'create'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function Hash(entries) { |
|
var index = -1, |
|
length = entries ? entries.length : 0; |
|
|
|
this.clear(); |
|
while (++index < length) { |
|
var entry = entries[index]; |
|
this.set(entry[0], entry[1]); |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function hashClear() { |
|
this.__data__ = nativeCreate ? nativeCreate(null) : {}; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function hashDelete(key) { |
|
return this.has(key) && delete this.__data__[key]; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function hashGet(key) { |
|
var data = this.__data__; |
|
if (nativeCreate) { |
|
var result = data[key]; |
|
return result === HASH_UNDEFINED ? undefined : result; |
|
} |
|
return hasOwnProperty$1.call(data, key) ? data[key] : undefined; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function hashHas(key) { |
|
var data = this.__data__; |
|
return nativeCreate ? data[key] !== undefined : hasOwnProperty$1.call(data, key); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function hashSet(key, value) { |
|
var data = this.__data__; |
|
data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; |
|
return this; |
|
} |
|
|
|
|
|
Hash.prototype.clear = hashClear; |
|
Hash.prototype['delete'] = hashDelete; |
|
Hash.prototype.get = hashGet; |
|
Hash.prototype.has = hashHas; |
|
Hash.prototype.set = hashSet; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function ListCache(entries) { |
|
var index = -1, |
|
length = entries ? entries.length : 0; |
|
|
|
this.clear(); |
|
while (++index < length) { |
|
var entry = entries[index]; |
|
this.set(entry[0], entry[1]); |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function listCacheClear() { |
|
this.__data__ = []; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function listCacheDelete(key) { |
|
var data = this.__data__, |
|
index = assocIndexOf(data, key); |
|
|
|
if (index < 0) { |
|
return false; |
|
} |
|
var lastIndex = data.length - 1; |
|
if (index == lastIndex) { |
|
data.pop(); |
|
} else { |
|
splice.call(data, index, 1); |
|
} |
|
return true; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function listCacheGet(key) { |
|
var data = this.__data__, |
|
index = assocIndexOf(data, key); |
|
|
|
return index < 0 ? undefined : data[index][1]; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function listCacheHas(key) { |
|
return assocIndexOf(this.__data__, key) > -1; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function listCacheSet(key, value) { |
|
var data = this.__data__, |
|
index = assocIndexOf(data, key); |
|
|
|
if (index < 0) { |
|
data.push([key, value]); |
|
} else { |
|
data[index][1] = value; |
|
} |
|
return this; |
|
} |
|
|
|
|
|
ListCache.prototype.clear = listCacheClear; |
|
ListCache.prototype['delete'] = listCacheDelete; |
|
ListCache.prototype.get = listCacheGet; |
|
ListCache.prototype.has = listCacheHas; |
|
ListCache.prototype.set = listCacheSet; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function MapCache(entries) { |
|
var index = -1, |
|
length = entries ? entries.length : 0; |
|
|
|
this.clear(); |
|
while (++index < length) { |
|
var entry = entries[index]; |
|
this.set(entry[0], entry[1]); |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function mapCacheClear() { |
|
this.__data__ = { |
|
'hash': new Hash, |
|
'map': new (Map || ListCache), |
|
'string': new Hash |
|
}; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function mapCacheDelete(key) { |
|
return getMapData(this, key)['delete'](key); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function mapCacheGet(key) { |
|
return getMapData(this, key).get(key); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function mapCacheHas(key) { |
|
return getMapData(this, key).has(key); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function mapCacheSet(key, value) { |
|
getMapData(this, key).set(key, value); |
|
return this; |
|
} |
|
|
|
|
|
MapCache.prototype.clear = mapCacheClear; |
|
MapCache.prototype['delete'] = mapCacheDelete; |
|
MapCache.prototype.get = mapCacheGet; |
|
MapCache.prototype.has = mapCacheHas; |
|
MapCache.prototype.set = mapCacheSet; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function assocIndexOf(array, key) { |
|
var length = array.length; |
|
while (length--) { |
|
if (eq(array[length][0], key)) { |
|
return length; |
|
} |
|
} |
|
return -1; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function baseIsNative(value) { |
|
if (!isObject$3(value) || isMasked(value)) { |
|
return false; |
|
} |
|
var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; |
|
return pattern.test(toSource(value)); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getMapData(map, key) { |
|
var data = map.__data__; |
|
return isKeyable(key) |
|
? data[typeof key == 'string' ? 'string' : 'hash'] |
|
: data.map; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getNative(object, key) { |
|
var value = getValue(object, key); |
|
return baseIsNative(value) ? value : undefined; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isKeyable(value) { |
|
var type = typeof value; |
|
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') |
|
? (value !== '__proto__') |
|
: (value === null); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isMasked(func) { |
|
return !!maskSrcKey && (maskSrcKey in func); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function toSource(func) { |
|
if (func != null) { |
|
try { |
|
return funcToString.call(func); |
|
} catch (e) {} |
|
try { |
|
return (func + ''); |
|
} catch (e) {} |
|
} |
|
return ''; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function memoize(func, resolver) { |
|
if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { |
|
throw new TypeError(FUNC_ERROR_TEXT$2); |
|
} |
|
var memoized = function() { |
|
var args = arguments, |
|
key = resolver ? resolver.apply(this, args) : args[0], |
|
cache = memoized.cache; |
|
|
|
if (cache.has(key)) { |
|
return cache.get(key); |
|
} |
|
var result = func.apply(this, args); |
|
memoized.cache = cache.set(key, result); |
|
return result; |
|
}; |
|
memoized.cache = new (memoize.Cache || MapCache); |
|
return memoized; |
|
} |
|
|
|
|
|
memoize.Cache = MapCache; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function eq(value, other) { |
|
return value === other || (value !== value && other !== other); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isFunction(value) { |
|
|
|
|
|
var tag = isObject$3(value) ? objectToString$3.call(value) : ''; |
|
return tag == funcTag || tag == genTag; |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function isObject$3(value) { |
|
var type = typeof value; |
|
return !!value && (type == 'object' || type == 'function'); |
|
} |
|
|
|
var lodash_memoize = memoize; |
|
|
|
var resizeObservers = []; |
|
|
|
var hasActiveObservations = function () { |
|
return resizeObservers.some(function (ro) { return ro.activeTargets.length > 0; }); |
|
}; |
|
|
|
var hasSkippedObservations = function () { |
|
return resizeObservers.some(function (ro) { return ro.skippedTargets.length > 0; }); |
|
}; |
|
|
|
var msg = 'ResizeObserver loop completed with undelivered notifications.'; |
|
var deliverResizeLoopError = function () { |
|
var event; |
|
if (typeof ErrorEvent === 'function') { |
|
event = new ErrorEvent('error', { |
|
message: msg |
|
}); |
|
} |
|
else { |
|
event = document.createEvent('Event'); |
|
event.initEvent('error', false, false); |
|
event.message = msg; |
|
} |
|
window.dispatchEvent(event); |
|
}; |
|
|
|
var ResizeObserverBoxOptions; |
|
(function (ResizeObserverBoxOptions) { |
|
ResizeObserverBoxOptions["BORDER_BOX"] = "border-box"; |
|
ResizeObserverBoxOptions["CONTENT_BOX"] = "content-box"; |
|
ResizeObserverBoxOptions["DEVICE_PIXEL_CONTENT_BOX"] = "device-pixel-content-box"; |
|
})(ResizeObserverBoxOptions || (ResizeObserverBoxOptions = {})); |
|
|
|
var freeze = function (obj) { return Object.freeze(obj); }; |
|
|
|
var ResizeObserverSize = (function () { |
|
function ResizeObserverSize(inlineSize, blockSize) { |
|
this.inlineSize = inlineSize; |
|
this.blockSize = blockSize; |
|
freeze(this); |
|
} |
|
return ResizeObserverSize; |
|
}()); |
|
|
|
var DOMRectReadOnly = (function () { |
|
function DOMRectReadOnly(x, y, width, height) { |
|
this.x = x; |
|
this.y = y; |
|
this.width = width; |
|
this.height = height; |
|
this.top = this.y; |
|
this.left = this.x; |
|
this.bottom = this.top + this.height; |
|
this.right = this.left + this.width; |
|
return freeze(this); |
|
} |
|
DOMRectReadOnly.prototype.toJSON = function () { |
|
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; |
|
return { x: x, y: y, top: top, right: right, bottom: bottom, left: left, width: width, height: height }; |
|
}; |
|
DOMRectReadOnly.fromRect = function (rectangle) { |
|
return new DOMRectReadOnly(rectangle.x, rectangle.y, rectangle.width, rectangle.height); |
|
}; |
|
return DOMRectReadOnly; |
|
}()); |
|
|
|
var isSVG = function (target) { return target instanceof SVGElement && 'getBBox' in target; }; |
|
var isHidden = function (target) { |
|
if (isSVG(target)) { |
|
var _a = target.getBBox(), width = _a.width, height = _a.height; |
|
return !width && !height; |
|
} |
|
var _b = target, offsetWidth = _b.offsetWidth, offsetHeight = _b.offsetHeight; |
|
return !(offsetWidth || offsetHeight || target.getClientRects().length); |
|
}; |
|
var isElement = function (obj) { |
|
var _a, _b; |
|
if (obj instanceof Element) { |
|
return true; |
|
} |
|
var scope = (_b = (_a = obj) === null || _a === void 0 ? void 0 : _a.ownerDocument) === null || _b === void 0 ? void 0 : _b.defaultView; |
|
return !!(scope && obj instanceof scope.Element); |
|
}; |
|
var isReplacedElement = function (target) { |
|
switch (target.tagName) { |
|
case 'INPUT': |
|
if (target.type !== 'image') { |
|
break; |
|
} |
|
case 'VIDEO': |
|
case 'AUDIO': |
|
case 'EMBED': |
|
case 'OBJECT': |
|
case 'CANVAS': |
|
case 'IFRAME': |
|
case 'IMG': |
|
return true; |
|
} |
|
return false; |
|
}; |
|
|
|
var global$1 = typeof window !== 'undefined' ? window : {}; |
|
|
|
var cache = new WeakMap(); |
|
var scrollRegexp = /auto|scroll/; |
|
var verticalRegexp = /^tb|vertical/; |
|
var IE = (/msie|trident/i).test(global$1.navigator && global$1.navigator.userAgent); |
|
var parseDimension = function (pixel) { return parseFloat(pixel || '0'); }; |
|
var size = function (inlineSize, blockSize, switchSizes) { |
|
if (inlineSize === void 0) { inlineSize = 0; } |
|
if (blockSize === void 0) { blockSize = 0; } |
|
if (switchSizes === void 0) { switchSizes = false; } |
|
return new ResizeObserverSize((switchSizes ? blockSize : inlineSize) || 0, (switchSizes ? inlineSize : blockSize) || 0); |
|
}; |
|
var zeroBoxes = freeze({ |
|
devicePixelContentBoxSize: size(), |
|
borderBoxSize: size(), |
|
contentBoxSize: size(), |
|
contentRect: new DOMRectReadOnly(0, 0, 0, 0) |
|
}); |
|
var calculateBoxSizes = function (target, forceRecalculation) { |
|
if (forceRecalculation === void 0) { forceRecalculation = false; } |
|
if (cache.has(target) && !forceRecalculation) { |
|
return cache.get(target); |
|
} |
|
if (isHidden(target)) { |
|
cache.set(target, zeroBoxes); |
|
return zeroBoxes; |
|
} |
|
var cs = getComputedStyle(target); |
|
var svg = isSVG(target) && target.ownerSVGElement && target.getBBox(); |
|
var removePadding = !IE && cs.boxSizing === 'border-box'; |
|
var switchSizes = verticalRegexp.test(cs.writingMode || ''); |
|
var canScrollVertically = !svg && scrollRegexp.test(cs.overflowY || ''); |
|
var canScrollHorizontally = !svg && scrollRegexp.test(cs.overflowX || ''); |
|
var paddingTop = svg ? 0 : parseDimension(cs.paddingTop); |
|
var paddingRight = svg ? 0 : parseDimension(cs.paddingRight); |
|
var paddingBottom = svg ? 0 : parseDimension(cs.paddingBottom); |
|
var paddingLeft = svg ? 0 : parseDimension(cs.paddingLeft); |
|
var borderTop = svg ? 0 : parseDimension(cs.borderTopWidth); |
|
var borderRight = svg ? 0 : parseDimension(cs.borderRightWidth); |
|
var borderBottom = svg ? 0 : parseDimension(cs.borderBottomWidth); |
|
var borderLeft = svg ? 0 : parseDimension(cs.borderLeftWidth); |
|
var horizontalPadding = paddingLeft + paddingRight; |
|
var verticalPadding = paddingTop + paddingBottom; |
|
var horizontalBorderArea = borderLeft + borderRight; |
|
var verticalBorderArea = borderTop + borderBottom; |
|
var horizontalScrollbarThickness = !canScrollHorizontally ? 0 : target.offsetHeight - verticalBorderArea - target.clientHeight; |
|
var verticalScrollbarThickness = !canScrollVertically ? 0 : target.offsetWidth - horizontalBorderArea - target.clientWidth; |
|
var widthReduction = removePadding ? horizontalPadding + horizontalBorderArea : 0; |
|
var heightReduction = removePadding ? verticalPadding + verticalBorderArea : 0; |
|
var contentWidth = svg ? svg.width : parseDimension(cs.width) - widthReduction - verticalScrollbarThickness; |
|
var contentHeight = svg ? svg.height : parseDimension(cs.height) - heightReduction - horizontalScrollbarThickness; |
|
var borderBoxWidth = contentWidth + horizontalPadding + verticalScrollbarThickness + horizontalBorderArea; |
|
var borderBoxHeight = contentHeight + verticalPadding + horizontalScrollbarThickness + verticalBorderArea; |
|
var boxes = freeze({ |
|
devicePixelContentBoxSize: size(Math.round(contentWidth * devicePixelRatio), Math.round(contentHeight * devicePixelRatio), switchSizes), |
|
borderBoxSize: size(borderBoxWidth, borderBoxHeight, switchSizes), |
|
contentBoxSize: size(contentWidth, contentHeight, switchSizes), |
|
contentRect: new DOMRectReadOnly(paddingLeft, paddingTop, contentWidth, contentHeight) |
|
}); |
|
cache.set(target, boxes); |
|
return boxes; |
|
}; |
|
var calculateBoxSize = function (target, observedBox, forceRecalculation) { |
|
var _a = calculateBoxSizes(target, forceRecalculation), borderBoxSize = _a.borderBoxSize, contentBoxSize = _a.contentBoxSize, devicePixelContentBoxSize = _a.devicePixelContentBoxSize; |
|
switch (observedBox) { |
|
case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX: |
|
return devicePixelContentBoxSize; |
|
case ResizeObserverBoxOptions.BORDER_BOX: |
|
return borderBoxSize; |
|
default: |
|
return contentBoxSize; |
|
} |
|
}; |
|
|
|
var ResizeObserverEntry = (function () { |
|
function ResizeObserverEntry(target) { |
|
var boxes = calculateBoxSizes(target); |
|
this.target = target; |
|
this.contentRect = boxes.contentRect; |
|
this.borderBoxSize = freeze([boxes.borderBoxSize]); |
|
this.contentBoxSize = freeze([boxes.contentBoxSize]); |
|
this.devicePixelContentBoxSize = freeze([boxes.devicePixelContentBoxSize]); |
|
} |
|
return ResizeObserverEntry; |
|
}()); |
|
|
|
var calculateDepthForNode = function (node) { |
|
if (isHidden(node)) { |
|
return Infinity; |
|
} |
|
var depth = 0; |
|
var parent = node.parentNode; |
|
while (parent) { |
|
depth += 1; |
|
parent = parent.parentNode; |
|
} |
|
return depth; |
|
}; |
|
|
|
var broadcastActiveObservations = function () { |
|
var shallowestDepth = Infinity; |
|
var callbacks = []; |
|
resizeObservers.forEach(function processObserver(ro) { |
|
if (ro.activeTargets.length === 0) { |
|
return; |
|
} |
|
var entries = []; |
|
ro.activeTargets.forEach(function processTarget(ot) { |
|
var entry = new ResizeObserverEntry(ot.target); |
|
var targetDepth = calculateDepthForNode(ot.target); |
|
entries.push(entry); |
|
ot.lastReportedSize = calculateBoxSize(ot.target, ot.observedBox); |
|
if (targetDepth < shallowestDepth) { |
|
shallowestDepth = targetDepth; |
|
} |
|
}); |
|
callbacks.push(function resizeObserverCallback() { |
|
ro.callback.call(ro.observer, entries, ro.observer); |
|
}); |
|
ro.activeTargets.splice(0, ro.activeTargets.length); |
|
}); |
|
for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) { |
|
var callback = callbacks_1[_i]; |
|
callback(); |
|
} |
|
return shallowestDepth; |
|
}; |
|
|
|
var gatherActiveObservationsAtDepth = function (depth) { |
|
resizeObservers.forEach(function processObserver(ro) { |
|
ro.activeTargets.splice(0, ro.activeTargets.length); |
|
ro.skippedTargets.splice(0, ro.skippedTargets.length); |
|
ro.observationTargets.forEach(function processTarget(ot) { |
|
if (ot.isActive()) { |
|
if (calculateDepthForNode(ot.target) > depth) { |
|
ro.activeTargets.push(ot); |
|
} |
|
else { |
|
ro.skippedTargets.push(ot); |
|
} |
|
} |
|
}); |
|
}); |
|
}; |
|
|
|
var process = function () { |
|
var depth = 0; |
|
gatherActiveObservationsAtDepth(depth); |
|
while (hasActiveObservations()) { |
|
depth = broadcastActiveObservations(); |
|
gatherActiveObservationsAtDepth(depth); |
|
} |
|
if (hasSkippedObservations()) { |
|
deliverResizeLoopError(); |
|
} |
|
return depth > 0; |
|
}; |
|
|
|
var trigger; |
|
var callbacks = []; |
|
var notify = function () { return callbacks.splice(0).forEach(function (cb) { return cb(); }); }; |
|
var queueMicroTask = function (callback) { |
|
if (!trigger) { |
|
var toggle_1 = 0; |
|
var el_1 = document.createTextNode(''); |
|
var config = { characterData: true }; |
|
new MutationObserver(function () { return notify(); }).observe(el_1, config); |
|
trigger = function () { el_1.textContent = "" + (toggle_1 ? toggle_1-- : toggle_1++); }; |
|
} |
|
callbacks.push(callback); |
|
trigger(); |
|
}; |
|
|
|
var queueResizeObserver = function (cb) { |
|
queueMicroTask(function ResizeObserver() { |
|
requestAnimationFrame(cb); |
|
}); |
|
}; |
|
|
|
var watching = 0; |
|
var isWatching = function () { return !!watching; }; |
|
var CATCH_PERIOD = 250; |
|
var observerConfig = { attributes: true, characterData: true, childList: true, subtree: true }; |
|
var events = [ |
|
'resize', |
|
'load', |
|
'transitionend', |
|
'animationend', |
|
'animationstart', |
|
'animationiteration', |
|
'keyup', |
|
'keydown', |
|
'mouseup', |
|
'mousedown', |
|
'mouseover', |
|
'mouseout', |
|
'blur', |
|
'focus' |
|
]; |
|
var time = function (timeout) { |
|
if (timeout === void 0) { timeout = 0; } |
|
return Date.now() + timeout; |
|
}; |
|
var scheduled = false; |
|
var Scheduler = (function () { |
|
function Scheduler() { |
|
var _this = this; |
|
this.stopped = true; |
|
this.listener = function () { return _this.schedule(); }; |
|
} |
|
Scheduler.prototype.run = function (timeout) { |
|
var _this = this; |
|
if (timeout === void 0) { timeout = CATCH_PERIOD; } |
|
if (scheduled) { |
|
return; |
|
} |
|
scheduled = true; |
|
var until = time(timeout); |
|
queueResizeObserver(function () { |
|
var elementsHaveResized = false; |
|
try { |
|
elementsHaveResized = process(); |
|
} |
|
finally { |
|
scheduled = false; |
|
timeout = until - time(); |
|
if (!isWatching()) { |
|
return; |
|
} |
|
if (elementsHaveResized) { |
|
_this.run(1000); |
|
} |
|
else if (timeout > 0) { |
|
_this.run(timeout); |
|
} |
|
else { |
|
_this.start(); |
|
} |
|
} |
|
}); |
|
}; |
|
Scheduler.prototype.schedule = function () { |
|
this.stop(); |
|
this.run(); |
|
}; |
|
Scheduler.prototype.observe = function () { |
|
var _this = this; |
|
var cb = function () { return _this.observer && _this.observer.observe(document.body, observerConfig); }; |
|
document.body ? cb() : global$1.addEventListener('DOMContentLoaded', cb); |
|
}; |
|
Scheduler.prototype.start = function () { |
|
var _this = this; |
|
if (this.stopped) { |
|
this.stopped = false; |
|
this.observer = new MutationObserver(this.listener); |
|
this.observe(); |
|
events.forEach(function (name) { return global$1.addEventListener(name, _this.listener, true); }); |
|
} |
|
}; |
|
Scheduler.prototype.stop = function () { |
|
var _this = this; |
|
if (!this.stopped) { |
|
this.observer && this.observer.disconnect(); |
|
events.forEach(function (name) { return global$1.removeEventListener(name, _this.listener, true); }); |
|
this.stopped = true; |
|
} |
|
}; |
|
return Scheduler; |
|
}()); |
|
var scheduler = new Scheduler(); |
|
var updateCount = function (n) { |
|
!watching && n > 0 && scheduler.start(); |
|
watching += n; |
|
!watching && scheduler.stop(); |
|
}; |
|
|
|
var skipNotifyOnElement = function (target) { |
|
return !isSVG(target) |
|
&& !isReplacedElement(target) |
|
&& getComputedStyle(target).display === 'inline'; |
|
}; |
|
var ResizeObservation = (function () { |
|
function ResizeObservation(target, observedBox) { |
|
this.target = target; |
|
this.observedBox = observedBox || ResizeObserverBoxOptions.CONTENT_BOX; |
|
this.lastReportedSize = { |
|
inlineSize: 0, |
|
blockSize: 0 |
|
}; |
|
} |
|
ResizeObservation.prototype.isActive = function () { |
|
var size = calculateBoxSize(this.target, this.observedBox, true); |
|
if (skipNotifyOnElement(this.target)) { |
|
this.lastReportedSize = size; |
|
} |
|
if (this.lastReportedSize.inlineSize !== size.inlineSize |
|
|| this.lastReportedSize.blockSize !== size.blockSize) { |
|
return true; |
|
} |
|
return false; |
|
}; |
|
return ResizeObservation; |
|
}()); |
|
|
|
var ResizeObserverDetail = (function () { |
|
function ResizeObserverDetail(resizeObserver, callback) { |
|
this.activeTargets = []; |
|
this.skippedTargets = []; |
|
this.observationTargets = []; |
|
this.observer = resizeObserver; |
|
this.callback = callback; |
|
} |
|
return ResizeObserverDetail; |
|
}()); |
|
|
|
var observerMap = new WeakMap(); |
|
var getObservationIndex = function (observationTargets, target) { |
|
for (var i = 0; i < observationTargets.length; i += 1) { |
|
if (observationTargets[i].target === target) { |
|
return i; |
|
} |
|
} |
|
return -1; |
|
}; |
|
var ResizeObserverController = (function () { |
|
function ResizeObserverController() { |
|
} |
|
ResizeObserverController.connect = function (resizeObserver, callback) { |
|
var detail = new ResizeObserverDetail(resizeObserver, callback); |
|
observerMap.set(resizeObserver, detail); |
|
}; |
|
ResizeObserverController.observe = function (resizeObserver, target, options) { |
|
var detail = observerMap.get(resizeObserver); |
|
var firstObservation = detail.observationTargets.length === 0; |
|
if (getObservationIndex(detail.observationTargets, target) < 0) { |
|
firstObservation && resizeObservers.push(detail); |
|
detail.observationTargets.push(new ResizeObservation(target, options && options.box)); |
|
updateCount(1); |
|
scheduler.schedule(); |
|
} |
|
}; |
|
ResizeObserverController.unobserve = function (resizeObserver, target) { |
|
var detail = observerMap.get(resizeObserver); |
|
var index = getObservationIndex(detail.observationTargets, target); |
|
var lastObservation = detail.observationTargets.length === 1; |
|
if (index >= 0) { |
|
lastObservation && resizeObservers.splice(resizeObservers.indexOf(detail), 1); |
|
detail.observationTargets.splice(index, 1); |
|
updateCount(-1); |
|
} |
|
}; |
|
ResizeObserverController.disconnect = function (resizeObserver) { |
|
var _this = this; |
|
var detail = observerMap.get(resizeObserver); |
|
detail.observationTargets.slice().forEach(function (ot) { return _this.unobserve(resizeObserver, ot.target); }); |
|
detail.activeTargets.splice(0, detail.activeTargets.length); |
|
}; |
|
return ResizeObserverController; |
|
}()); |
|
|
|
var ResizeObserver = (function () { |
|
function ResizeObserver(callback) { |
|
if (arguments.length === 0) { |
|
throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present."); |
|
} |
|
if (typeof callback !== 'function') { |
|
throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function."); |
|
} |
|
ResizeObserverController.connect(this, callback); |
|
} |
|
ResizeObserver.prototype.observe = function (target, options) { |
|
if (arguments.length === 0) { |
|
throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present."); |
|
} |
|
if (!isElement(target)) { |
|
throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element"); |
|
} |
|
ResizeObserverController.observe(this, target, options); |
|
}; |
|
ResizeObserver.prototype.unobserve = function (target) { |
|
if (arguments.length === 0) { |
|
throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present."); |
|
} |
|
if (!isElement(target)) { |
|
throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element"); |
|
} |
|
ResizeObserverController.unobserve(this, target); |
|
}; |
|
ResizeObserver.prototype.disconnect = function () { |
|
ResizeObserverController.disconnect(this); |
|
}; |
|
ResizeObserver.toString = function () { |
|
return 'function ResizeObserver () { [polyfill code] }'; |
|
}; |
|
return ResizeObserver; |
|
}()); |
|
|
|
|
|
var createMethod$4 = function (IS_RIGHT) { |
|
return function (that, callbackfn, argumentsLength, memo) { |
|
aFunction$1(callbackfn); |
|
var O = toObject(that); |
|
var self = indexedObject(O); |
|
var length = toLength(O.length); |
|
var index = IS_RIGHT ? length - 1 : 0; |
|
var i = IS_RIGHT ? -1 : 1; |
|
if (argumentsLength < 2) while (true) { |
|
if (index in self) { |
|
memo = self[index]; |
|
index += i; |
|
break; |
|
} |
|
index += i; |
|
if (IS_RIGHT ? index < 0 : length <= index) { |
|
throw TypeError('Reduce of empty array with no initial value'); |
|
} |
|
} |
|
for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) { |
|
memo = callbackfn(memo, self[index], index, O); |
|
} |
|
return memo; |
|
}; |
|
}; |
|
|
|
var arrayReduce = { |
|
|
|
|
|
left: createMethod$4(false), |
|
|
|
|
|
right: createMethod$4(true) |
|
}; |
|
|
|
var $reduce = arrayReduce.left; |
|
|
|
|
|
|
|
|
|
_export({ target: 'Array', proto: true, forced: sloppyArrayMethod('reduce') }, { |
|
reduce: function reduce(callbackfn ) { |
|
return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); |
|
} |
|
}); |
|
|
|
var defineProperty$1 = objectDefineProperty.f; |
|
|
|
var FunctionPrototype = Function.prototype; |
|
var FunctionPrototypeToString = FunctionPrototype.toString; |
|
var nameRE = /^\s*function ([^ (]*)/; |
|
var NAME = 'name'; |
|
|
|
|
|
|
|
if (descriptors && !(NAME in FunctionPrototype)) { |
|
defineProperty$1(FunctionPrototype, NAME, { |
|
configurable: true, |
|
get: function () { |
|
try { |
|
return FunctionPrototypeToString.call(this).match(nameRE)[1]; |
|
} catch (error) { |
|
return ''; |
|
} |
|
} |
|
}); |
|
} |
|
|
|
|
|
|
|
var regexpFlags = function () { |
|
var that = anObject(this); |
|
var result = ''; |
|
if (that.global) result += 'g'; |
|
if (that.ignoreCase) result += 'i'; |
|
if (that.multiline) result += 'm'; |
|
if (that.dotAll) result += 's'; |
|
if (that.unicode) result += 'u'; |
|
if (that.sticky) result += 'y'; |
|
return result; |
|
}; |
|
|
|
var nativeExec = RegExp.prototype.exec; |
|
|
|
|
|
|
|
var nativeReplace = String.prototype.replace; |
|
|
|
var patchedExec = nativeExec; |
|
|
|
var UPDATES_LAST_INDEX_WRONG = (function () { |
|
var re1 = /a/; |
|
var re2 = /b*/g; |
|
nativeExec.call(re1, 'a'); |
|
nativeExec.call(re2, 'a'); |
|
return re1.lastIndex !== 0 || re2.lastIndex !== 0; |
|
})(); |
|
|
|
|
|
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; |
|
|
|
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED; |
|
|
|
if (PATCH) { |
|
patchedExec = function exec(str) { |
|
var re = this; |
|
var lastIndex, reCopy, match, i; |
|
|
|
if (NPCG_INCLUDED) { |
|
reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re)); |
|
} |
|
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; |
|
|
|
match = nativeExec.call(re, str); |
|
|
|
if (UPDATES_LAST_INDEX_WRONG && match) { |
|
re.lastIndex = re.global ? match.index + match[0].length : lastIndex; |
|
} |
|
if (NPCG_INCLUDED && match && match.length > 1) { |
|
|
|
|
|
nativeReplace.call(match[0], reCopy, function () { |
|
for (i = 1; i < arguments.length - 2; i++) { |
|
if (arguments[i] === undefined) match[i] = undefined; |
|
} |
|
}); |
|
} |
|
|
|
return match; |
|
}; |
|
} |
|
|
|
var regexpExec = patchedExec; |
|
|
|
_export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, { |
|
exec: regexpExec |
|
}); |
|
|
|
var SPECIES$2 = wellKnownSymbol('species'); |
|
|
|
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { |
|
|
|
|
|
|
|
var re = /./; |
|
re.exec = function () { |
|
var result = []; |
|
result.groups = { a: '7' }; |
|
return result; |
|
}; |
|
return ''.replace(re, '$<a>') !== '7'; |
|
}); |
|
|
|
|
|
|
|
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () { |
|
var re = /(?:)/; |
|
var originalExec = re.exec; |
|
re.exec = function () { return originalExec.apply(this, arguments); }; |
|
var result = 'ab'.split(re); |
|
return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b'; |
|
}); |
|
|
|
var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) { |
|
var SYMBOL = wellKnownSymbol(KEY); |
|
|
|
var DELEGATES_TO_SYMBOL = !fails(function () { |
|
|
|
var O = {}; |
|
O[SYMBOL] = function () { return 7; }; |
|
return ''[KEY](O) != 7; |
|
}); |
|
|
|
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () { |
|
|
|
var execCalled = false; |
|
var re = /a/; |
|
re.exec = function () { execCalled = true; return null; }; |
|
|
|
if (KEY === 'split') { |
|
|
|
|
|
re.constructor = {}; |
|
re.constructor[SPECIES$2] = function () { return re; }; |
|
} |
|
|
|
re[SYMBOL](''); |
|
return !execCalled; |
|
}); |
|
|
|
if ( |
|
!DELEGATES_TO_SYMBOL || |
|
!DELEGATES_TO_EXEC || |
|
(KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) || |
|
(KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) |
|
) { |
|
var nativeRegExpMethod = /./[SYMBOL]; |
|
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { |
|
if (regexp.exec === regexpExec) { |
|
if (DELEGATES_TO_SYMBOL && !forceStringMethod) { |
|
|
|
|
|
|
|
return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) }; |
|
} |
|
return { done: true, value: nativeMethod.call(str, regexp, arg2) }; |
|
} |
|
return { done: false }; |
|
}); |
|
var stringMethod = methods[0]; |
|
var regexMethod = methods[1]; |
|
|
|
redefine(String.prototype, KEY, stringMethod); |
|
redefine(RegExp.prototype, SYMBOL, length == 2 |
|
|
|
|
|
? function (string, arg) { return regexMethod.call(string, this, arg); } |
|
|
|
|
|
: function (string) { return regexMethod.call(string, this); } |
|
); |
|
if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true); |
|
} |
|
}; |
|
|
|
var charAt$1 = stringMultibyte.charAt; |
|
|
|
|
|
|
|
var advanceStringIndex = function (S, index, unicode) { |
|
return index + (unicode ? charAt$1(S, index).length : 1); |
|
}; |
|
|
|
|
|
|
|
var regexpExecAbstract = function (R, S) { |
|
var exec = R.exec; |
|
if (typeof exec === 'function') { |
|
var result = exec.call(R, S); |
|
if (typeof result !== 'object') { |
|
throw TypeError('RegExp exec method returned something other than an Object or null'); |
|
} |
|
return result; |
|
} |
|
|
|
if (classofRaw(R) !== 'RegExp') { |
|
throw TypeError('RegExp#exec called on incompatible receiver'); |
|
} |
|
|
|
return regexpExec.call(R, S); |
|
}; |
|
|
|
|
|
fixRegexpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) { |
|
return [ |
|
|
|
|
|
function match(regexp) { |
|
var O = requireObjectCoercible(this); |
|
var matcher = regexp == undefined ? undefined : regexp[MATCH]; |
|
return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); |
|
}, |
|
|
|
|
|
function (regexp) { |
|
var res = maybeCallNative(nativeMatch, regexp, this); |
|
if (res.done) return res.value; |
|
|
|
var rx = anObject(regexp); |
|
var S = String(this); |
|
|
|
if (!rx.global) return regexpExecAbstract(rx, S); |
|
|
|
var fullUnicode = rx.unicode; |
|
rx.lastIndex = 0; |
|
var A = []; |
|
var n = 0; |
|
var result; |
|
while ((result = regexpExecAbstract(rx, S)) !== null) { |
|
var matchStr = String(result[0]); |
|
A[n] = matchStr; |
|
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); |
|
n++; |
|
} |
|
return n === 0 ? null : A; |
|
} |
|
]; |
|
}); |
|
|
|
var max$1 = Math.max; |
|
var min$2 = Math.min; |
|
var floor$1 = Math.floor; |
|
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g; |
|
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g; |
|
|
|
var maybeToString = function (it) { |
|
return it === undefined ? it : String(it); |
|
}; |
|
|
|
|
|
fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative) { |
|
return [ |
|
|
|
|
|
function replace(searchValue, replaceValue) { |
|
var O = requireObjectCoercible(this); |
|
var replacer = searchValue == undefined ? undefined : searchValue[REPLACE]; |
|
return replacer !== undefined |
|
? replacer.call(searchValue, O, replaceValue) |
|
: nativeReplace.call(String(O), searchValue, replaceValue); |
|
}, |
|
|
|
|
|
function (regexp, replaceValue) { |
|
var res = maybeCallNative(nativeReplace, regexp, this, replaceValue); |
|
if (res.done) return res.value; |
|
|
|
var rx = anObject(regexp); |
|
var S = String(this); |
|
|
|
var functionalReplace = typeof replaceValue === 'function'; |
|
if (!functionalReplace) replaceValue = String(replaceValue); |
|
|
|
var global = rx.global; |
|
if (global) { |
|
var fullUnicode = rx.unicode; |
|
rx.lastIndex = 0; |
|
} |
|
var results = []; |
|
while (true) { |
|
var result = regexpExecAbstract(rx, S); |
|
if (result === null) break; |
|
|
|
results.push(result); |
|
if (!global) break; |
|
|
|
var matchStr = String(result[0]); |
|
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); |
|
} |
|
|
|
var accumulatedResult = ''; |
|
var nextSourcePosition = 0; |
|
for (var i = 0; i < results.length; i++) { |
|
result = results[i]; |
|
|
|
var matched = String(result[0]); |
|
var position = max$1(min$2(toInteger(result.index), S.length), 0); |
|
var captures = []; |
|
|
|
|
|
|
|
|
|
|
|
for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); |
|
var namedCaptures = result.groups; |
|
if (functionalReplace) { |
|
var replacerArgs = [matched].concat(captures, position, S); |
|
if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); |
|
var replacement = String(replaceValue.apply(undefined, replacerArgs)); |
|
} else { |
|
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); |
|
} |
|
if (position >= nextSourcePosition) { |
|
accumulatedResult += S.slice(nextSourcePosition, position) + replacement; |
|
nextSourcePosition = position + matched.length; |
|
} |
|
} |
|
return accumulatedResult + S.slice(nextSourcePosition); |
|
} |
|
]; |
|
|
|
|
|
function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { |
|
var tailPos = position + matched.length; |
|
var m = captures.length; |
|
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; |
|
if (namedCaptures !== undefined) { |
|
namedCaptures = toObject(namedCaptures); |
|
symbols = SUBSTITUTION_SYMBOLS; |
|
} |
|
return nativeReplace.call(replacement, symbols, function (match, ch) { |
|
var capture; |
|
switch (ch.charAt(0)) { |
|
case '$': return '$'; |
|
case '&': return matched; |
|
case '`': return str.slice(0, position); |
|
case "'": return str.slice(tailPos); |
|
case '<': |
|
capture = namedCaptures[ch.slice(1, -1)]; |
|
break; |
|
default: |
|
var n = +ch; |
|
if (n === 0) return match; |
|
if (n > m) { |
|
var f = floor$1(n / 10); |
|
if (f === 0) return match; |
|
if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); |
|
return match; |
|
} |
|
capture = captures[n - 1]; |
|
} |
|
return capture === undefined ? '' : capture; |
|
}); |
|
} |
|
}); |
|
|
|
|
|
var getOptions = function getOptions(obj) { |
|
var options = Array.prototype.reduce.call(obj, function (acc, attribute) { |
|
var option = attribute.name.match(/data-simplebar-(.+)/); |
|
|
|
if (option) { |
|
var key = option[1].replace(/\W+(.)/g, function (x, chr) { |
|
return chr.toUpperCase(); |
|
}); |
|
|
|
switch (attribute.value) { |
|
case 'true': |
|
acc[key] = true; |
|
break; |
|
|
|
case 'false': |
|
acc[key] = false; |
|
break; |
|
|
|
case undefined: |
|
acc[key] = true; |
|
break; |
|
|
|
default: |
|
acc[key] = attribute.value; |
|
} |
|
} |
|
|
|
return acc; |
|
}, {}); |
|
return options; |
|
}; |
|
function getElementWindow(element) { |
|
if (!element || !element.ownerDocument || !element.ownerDocument.defaultView) { |
|
return window; |
|
} |
|
|
|
return element.ownerDocument.defaultView; |
|
} |
|
function getElementDocument(element) { |
|
if (!element || !element.ownerDocument) { |
|
return document; |
|
} |
|
|
|
return element.ownerDocument; |
|
} |
|
|
|
var cachedScrollbarWidth = null; |
|
var cachedDevicePixelRatio = null; |
|
|
|
if (canUseDom) { |
|
window.addEventListener('resize', function () { |
|
if (cachedDevicePixelRatio !== window.devicePixelRatio) { |
|
cachedDevicePixelRatio = window.devicePixelRatio; |
|
cachedScrollbarWidth = null; |
|
} |
|
}); |
|
} |
|
|
|
function scrollbarWidth(el) { |
|
if (cachedScrollbarWidth === null) { |
|
var document = getElementDocument(el); |
|
|
|
if (typeof document === 'undefined') { |
|
cachedScrollbarWidth = 0; |
|
return cachedScrollbarWidth; |
|
} |
|
|
|
var body = document.body; |
|
var box = document.createElement('div'); |
|
box.classList.add('simplebar-hide-scrollbar'); |
|
body.appendChild(box); |
|
var width = box.getBoundingClientRect().right; |
|
body.removeChild(box); |
|
cachedScrollbarWidth = width; |
|
} |
|
|
|
return cachedScrollbarWidth; |
|
} |
|
|
|
var SimpleBar = |
|
|
|
function () { |
|
function SimpleBar(element, options) { |
|
var _this = this; |
|
|
|
this.onScroll = function () { |
|
var elWindow = getElementWindow(_this.el); |
|
|
|
if (!_this.scrollXTicking) { |
|
elWindow.requestAnimationFrame(_this.scrollX); |
|
_this.scrollXTicking = true; |
|
} |
|
|
|
if (!_this.scrollYTicking) { |
|
elWindow.requestAnimationFrame(_this.scrollY); |
|
_this.scrollYTicking = true; |
|
} |
|
}; |
|
|
|
this.scrollX = function () { |
|
if (_this.axis.x.isOverflowing) { |
|
_this.showScrollbar('x'); |
|
|
|
_this.positionScrollbar('x'); |
|
} |
|
|
|
_this.scrollXTicking = false; |
|
}; |
|
|
|
this.scrollY = function () { |
|
if (_this.axis.y.isOverflowing) { |
|
_this.showScrollbar('y'); |
|
|
|
_this.positionScrollbar('y'); |
|
} |
|
|
|
_this.scrollYTicking = false; |
|
}; |
|
|
|
this.onMouseEnter = function () { |
|
_this.showScrollbar('x'); |
|
|
|
_this.showScrollbar('y'); |
|
}; |
|
|
|
this.onMouseMove = function (e) { |
|
_this.mouseX = e.clientX; |
|
_this.mouseY = e.clientY; |
|
|
|
if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) { |
|
_this.onMouseMoveForAxis('x'); |
|
} |
|
|
|
if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) { |
|
_this.onMouseMoveForAxis('y'); |
|
} |
|
}; |
|
|
|
this.onMouseLeave = function () { |
|
_this.onMouseMove.cancel(); |
|
|
|
if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) { |
|
_this.onMouseLeaveForAxis('x'); |
|
} |
|
|
|
if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) { |
|
_this.onMouseLeaveForAxis('y'); |
|
} |
|
|
|
_this.mouseX = -1; |
|
_this.mouseY = -1; |
|
}; |
|
|
|
this.onWindowResize = function () { |
|
|
|
_this.scrollbarWidth = _this.getScrollbarWidth(); |
|
|
|
_this.hideNativeScrollbar(); |
|
}; |
|
|
|
this.hideScrollbars = function () { |
|
_this.axis.x.track.rect = _this.axis.x.track.el.getBoundingClientRect(); |
|
_this.axis.y.track.rect = _this.axis.y.track.el.getBoundingClientRect(); |
|
|
|
if (!_this.isWithinBounds(_this.axis.y.track.rect)) { |
|
_this.axis.y.scrollbar.el.classList.remove(_this.classNames.visible); |
|
|
|
_this.axis.y.isVisible = false; |
|
} |
|
|
|
if (!_this.isWithinBounds(_this.axis.x.track.rect)) { |
|
_this.axis.x.scrollbar.el.classList.remove(_this.classNames.visible); |
|
|
|
_this.axis.x.isVisible = false; |
|
} |
|
}; |
|
|
|
this.onPointerEvent = function (e) { |
|
var isWithinTrackXBounds, isWithinTrackYBounds; |
|
_this.axis.x.track.rect = _this.axis.x.track.el.getBoundingClientRect(); |
|
_this.axis.y.track.rect = _this.axis.y.track.el.getBoundingClientRect(); |
|
|
|
if (_this.axis.x.isOverflowing || _this.axis.x.forceVisible) { |
|
isWithinTrackXBounds = _this.isWithinBounds(_this.axis.x.track.rect); |
|
} |
|
|
|
if (_this.axis.y.isOverflowing || _this.axis.y.forceVisible) { |
|
isWithinTrackYBounds = _this.isWithinBounds(_this.axis.y.track.rect); |
|
} |
|
|
|
|
|
if (isWithinTrackXBounds || isWithinTrackYBounds) { |
|
|
|
|
|
e.preventDefault(); |
|
|
|
e.stopPropagation(); |
|
|
|
if (e.type === 'mousedown') { |
|
if (isWithinTrackXBounds) { |
|
_this.axis.x.scrollbar.rect = _this.axis.x.scrollbar.el.getBoundingClientRect(); |
|
|
|
if (_this.isWithinBounds(_this.axis.x.scrollbar.rect)) { |
|
_this.onDragStart(e, 'x'); |
|
} else { |
|
_this.onTrackClick(e, 'x'); |
|
} |
|
} |
|
|
|
if (isWithinTrackYBounds) { |
|
_this.axis.y.scrollbar.rect = _this.axis.y.scrollbar.el.getBoundingClientRect(); |
|
|
|
if (_this.isWithinBounds(_this.axis.y.scrollbar.rect)) { |
|
_this.onDragStart(e, 'y'); |
|
} else { |
|
_this.onTrackClick(e, 'y'); |
|
} |
|
} |
|
} |
|
} |
|
}; |
|
|
|
this.drag = function (e) { |
|
var eventOffset; |
|
var track = _this.axis[_this.draggedAxis].track; |
|
var trackSize = track.rect[_this.axis[_this.draggedAxis].sizeAttr]; |
|
var scrollbar = _this.axis[_this.draggedAxis].scrollbar; |
|
var contentSize = _this.contentWrapperEl[_this.axis[_this.draggedAxis].scrollSizeAttr]; |
|
var hostSize = parseInt(_this.elStyles[_this.axis[_this.draggedAxis].sizeAttr], 10); |
|
e.preventDefault(); |
|
e.stopPropagation(); |
|
|
|
if (_this.draggedAxis === 'y') { |
|
eventOffset = e.pageY; |
|
} else { |
|
eventOffset = e.pageX; |
|
} |
|
|
|
|
|
var dragPos = eventOffset - track.rect[_this.axis[_this.draggedAxis].offsetAttr] - _this.axis[_this.draggedAxis].dragOffset; |
|
|
|
var dragPerc = dragPos / (trackSize - scrollbar.size); |
|
|
|
var scrollPos = dragPerc * (contentSize - hostSize); |
|
|
|
if (_this.draggedAxis === 'x') { |
|
scrollPos = _this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollbarInverted ? scrollPos - (trackSize + scrollbar.size) : scrollPos; |
|
scrollPos = _this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollingInverted ? -scrollPos : scrollPos; |
|
} |
|
|
|
_this.contentWrapperEl[_this.axis[_this.draggedAxis].scrollOffsetAttr] = scrollPos; |
|
}; |
|
|
|
this.onEndDrag = function (e) { |
|
var elDocument = getElementDocument(_this.el); |
|
var elWindow = getElementWindow(_this.el); |
|
e.preventDefault(); |
|
e.stopPropagation(); |
|
|
|
_this.el.classList.remove(_this.classNames.dragging); |
|
|
|
elDocument.removeEventListener('mousemove', _this.drag, true); |
|
elDocument.removeEventListener('mouseup', _this.onEndDrag, true); |
|
_this.removePreventClickId = elWindow.setTimeout(function () { |
|
|
|
|
|
elDocument.removeEventListener('click', _this.preventClick, true); |
|
elDocument.removeEventListener('dblclick', _this.preventClick, true); |
|
_this.removePreventClickId = null; |
|
}); |
|
}; |
|
|
|
this.preventClick = function (e) { |
|
e.preventDefault(); |
|
e.stopPropagation(); |
|
}; |
|
|
|
this.el = element; |
|
this.minScrollbarWidth = 20; |
|
this.options = Object.assign({}, SimpleBar.defaultOptions, {}, options); |
|
this.classNames = Object.assign({}, SimpleBar.defaultOptions.classNames, {}, this.options.classNames); |
|
this.axis = { |
|
x: { |
|
scrollOffsetAttr: 'scrollLeft', |
|
sizeAttr: 'width', |
|
scrollSizeAttr: 'scrollWidth', |
|
offsetSizeAttr: 'offsetWidth', |
|
offsetAttr: 'left', |
|
overflowAttr: 'overflowX', |
|
dragOffset: 0, |
|
isOverflowing: true, |
|
isVisible: false, |
|
forceVisible: false, |
|
track: {}, |
|
scrollbar: {} |
|
}, |
|
y: { |
|
scrollOffsetAttr: 'scrollTop', |
|
sizeAttr: 'height', |
|
scrollSizeAttr: 'scrollHeight', |
|
offsetSizeAttr: 'offsetHeight', |
|
offsetAttr: 'top', |
|
overflowAttr: 'overflowY', |
|
dragOffset: 0, |
|
isOverflowing: true, |
|
isVisible: false, |
|
forceVisible: false, |
|
track: {}, |
|
scrollbar: {} |
|
} |
|
}; |
|
this.removePreventClickId = null; |
|
|
|
if (SimpleBar.instances.has(this.el)) { |
|
return; |
|
} |
|
|
|
this.recalculate = lodash_throttle(this.recalculate.bind(this), 64); |
|
this.onMouseMove = lodash_throttle(this.onMouseMove.bind(this), 64); |
|
this.hideScrollbars = lodash_debounce(this.hideScrollbars.bind(this), this.options.timeout); |
|
this.onWindowResize = lodash_debounce(this.onWindowResize.bind(this), 64, { |
|
leading: true |
|
}); |
|
SimpleBar.getRtlHelpers = lodash_memoize(SimpleBar.getRtlHelpers); |
|
this.init(); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SimpleBar.getRtlHelpers = function getRtlHelpers() { |
|
var dummyDiv = document.createElement('div'); |
|
dummyDiv.innerHTML = '<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>'; |
|
var scrollbarDummyEl = dummyDiv.firstElementChild; |
|
document.body.appendChild(scrollbarDummyEl); |
|
var dummyContainerChild = scrollbarDummyEl.firstElementChild; |
|
scrollbarDummyEl.scrollLeft = 0; |
|
var dummyContainerOffset = SimpleBar.getOffset(scrollbarDummyEl); |
|
var dummyContainerChildOffset = SimpleBar.getOffset(dummyContainerChild); |
|
scrollbarDummyEl.scrollLeft = 999; |
|
var dummyContainerScrollOffsetAfterScroll = SimpleBar.getOffset(dummyContainerChild); |
|
return { |
|
|
|
isRtlScrollingInverted: dummyContainerOffset.left !== dummyContainerChildOffset.left && dummyContainerChildOffset.left - dummyContainerScrollOffsetAfterScroll.left !== 0, |
|
|
|
isRtlScrollbarInverted: dummyContainerOffset.left !== dummyContainerChildOffset.left |
|
}; |
|
}; |
|
|
|
SimpleBar.getOffset = function getOffset(el) { |
|
var rect = el.getBoundingClientRect(); |
|
var elDocument = getElementDocument(el); |
|
var elWindow = getElementWindow(el); |
|
return { |
|
top: rect.top + (elWindow.pageYOffset || elDocument.documentElement.scrollTop), |
|
left: rect.left + (elWindow.pageXOffset || elDocument.documentElement.scrollLeft) |
|
}; |
|
}; |
|
|
|
var _proto = SimpleBar.prototype; |
|
|
|
_proto.init = function init() { |
|
|
|
SimpleBar.instances.set(this.el, this); |
|
|
|
if (canUseDom) { |
|
this.initDOM(); |
|
this.setAccessibilityAttributes(); |
|
this.scrollbarWidth = this.getScrollbarWidth(); |
|
this.recalculate(); |
|
this.initListeners(); |
|
} |
|
}; |
|
|
|
_proto.initDOM = function initDOM() { |
|
var _this2 = this; |
|
|
|
|
|
if (Array.prototype.filter.call(this.el.children, function (child) { |
|
return child.classList.contains(_this2.classNames.wrapper); |
|
}).length) { |
|
|
|
this.wrapperEl = this.el.querySelector("." + this.classNames.wrapper); |
|
this.contentWrapperEl = this.options.scrollableNode || this.el.querySelector("." + this.classNames.contentWrapper); |
|
this.contentEl = this.options.contentNode || this.el.querySelector("." + this.classNames.contentEl); |
|
this.offsetEl = this.el.querySelector("." + this.classNames.offset); |
|
this.maskEl = this.el.querySelector("." + this.classNames.mask); |
|
this.placeholderEl = this.findChild(this.wrapperEl, "." + this.classNames.placeholder); |
|
this.heightAutoObserverWrapperEl = this.el.querySelector("." + this.classNames.heightAutoObserverWrapperEl); |
|
this.heightAutoObserverEl = this.el.querySelector("." + this.classNames.heightAutoObserverEl); |
|
this.axis.x.track.el = this.findChild(this.el, "." + this.classNames.track + "." + this.classNames.horizontal); |
|
this.axis.y.track.el = this.findChild(this.el, "." + this.classNames.track + "." + this.classNames.vertical); |
|
} else { |
|
|
|
this.wrapperEl = document.createElement('div'); |
|
this.contentWrapperEl = document.createElement('div'); |
|
this.offsetEl = document.createElement('div'); |
|
this.maskEl = document.createElement('div'); |
|
this.contentEl = document.createElement('div'); |
|
this.placeholderEl = document.createElement('div'); |
|
this.heightAutoObserverWrapperEl = document.createElement('div'); |
|
this.heightAutoObserverEl = document.createElement('div'); |
|
this.wrapperEl.classList.add(this.classNames.wrapper); |
|
this.contentWrapperEl.classList.add(this.classNames.contentWrapper); |
|
this.offsetEl.classList.add(this.classNames.offset); |
|
this.maskEl.classList.add(this.classNames.mask); |
|
this.contentEl.classList.add(this.classNames.contentEl); |
|
this.placeholderEl.classList.add(this.classNames.placeholder); |
|
this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl); |
|
this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl); |
|
|
|
while (this.el.firstChild) { |
|
this.contentEl.appendChild(this.el.firstChild); |
|
} |
|
|
|
this.contentWrapperEl.appendChild(this.contentEl); |
|
this.offsetEl.appendChild(this.contentWrapperEl); |
|
this.maskEl.appendChild(this.offsetEl); |
|
this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl); |
|
this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl); |
|
this.wrapperEl.appendChild(this.maskEl); |
|
this.wrapperEl.appendChild(this.placeholderEl); |
|
this.el.appendChild(this.wrapperEl); |
|
} |
|
|
|
if (!this.axis.x.track.el || !this.axis.y.track.el) { |
|
var track = document.createElement('div'); |
|
var scrollbar = document.createElement('div'); |
|
track.classList.add(this.classNames.track); |
|
scrollbar.classList.add(this.classNames.scrollbar); |
|
track.appendChild(scrollbar); |
|
this.axis.x.track.el = track.cloneNode(true); |
|
this.axis.x.track.el.classList.add(this.classNames.horizontal); |
|
this.axis.y.track.el = track.cloneNode(true); |
|
this.axis.y.track.el.classList.add(this.classNames.vertical); |
|
this.el.appendChild(this.axis.x.track.el); |
|
this.el.appendChild(this.axis.y.track.el); |
|
} |
|
|
|
this.axis.x.scrollbar.el = this.axis.x.track.el.querySelector("." + this.classNames.scrollbar); |
|
this.axis.y.scrollbar.el = this.axis.y.track.el.querySelector("." + this.classNames.scrollbar); |
|
|
|
if (!this.options.autoHide) { |
|
this.axis.x.scrollbar.el.classList.add(this.classNames.visible); |
|
this.axis.y.scrollbar.el.classList.add(this.classNames.visible); |
|
} |
|
|
|
this.el.setAttribute('data-simplebar', 'init'); |
|
}; |
|
|
|
_proto.setAccessibilityAttributes = function setAccessibilityAttributes() { |
|
var ariaLabel = this.options.ariaLabel || 'scrollable content'; |
|
this.contentWrapperEl.setAttribute('tabindex', '0'); |
|
this.contentWrapperEl.setAttribute('role', 'region'); |
|
this.contentWrapperEl.setAttribute('aria-label', ariaLabel); |
|
}; |
|
|
|
_proto.initListeners = function initListeners() { |
|
var _this3 = this; |
|
|
|
var elWindow = getElementWindow(this.el); |
|
|
|
if (this.options.autoHide) { |
|
this.el.addEventListener('mouseenter', this.onMouseEnter); |
|
} |
|
|
|
['mousedown', 'click', 'dblclick'].forEach(function (e) { |
|
_this3.el.addEventListener(e, _this3.onPointerEvent, true); |
|
}); |
|
['touchstart', 'touchend', 'touchmove'].forEach(function (e) { |
|
_this3.el.addEventListener(e, _this3.onPointerEvent, { |
|
capture: true, |
|
passive: true |
|
}); |
|
}); |
|
this.el.addEventListener('mousemove', this.onMouseMove); |
|
this.el.addEventListener('mouseleave', this.onMouseLeave); |
|
this.contentWrapperEl.addEventListener('scroll', this.onScroll); |
|
|
|
elWindow.addEventListener('resize', this.onWindowResize); |
|
|
|
var resizeObserverStarted = false; |
|
var resizeObserver = elWindow.ResizeObserver || ResizeObserver; |
|
this.resizeObserver = new resizeObserver(function () { |
|
if (!resizeObserverStarted) return; |
|
|
|
_this3.recalculate(); |
|
}); |
|
this.resizeObserver.observe(this.el); |
|
this.resizeObserver.observe(this.contentEl); |
|
elWindow.requestAnimationFrame(function () { |
|
resizeObserverStarted = true; |
|
}); |
|
|
|
this.mutationObserver = new elWindow.MutationObserver(this.recalculate); |
|
this.mutationObserver.observe(this.contentEl, { |
|
childList: true, |
|
subtree: true, |
|
characterData: true |
|
}); |
|
}; |
|
|
|
_proto.recalculate = function recalculate() { |
|
var elWindow = getElementWindow(this.el); |
|
this.elStyles = elWindow.getComputedStyle(this.el); |
|
this.isRtl = this.elStyles.direction === 'rtl'; |
|
var isHeightAuto = this.heightAutoObserverEl.offsetHeight <= 1; |
|
var isWidthAuto = this.heightAutoObserverEl.offsetWidth <= 1; |
|
var contentElOffsetWidth = this.contentEl.offsetWidth; |
|
var contentWrapperElOffsetWidth = this.contentWrapperEl.offsetWidth; |
|
var elOverflowX = this.elStyles.overflowX; |
|
var elOverflowY = this.elStyles.overflowY; |
|
this.contentEl.style.padding = this.elStyles.paddingTop + " " + this.elStyles.paddingRight + " " + this.elStyles.paddingBottom + " " + this.elStyles.paddingLeft; |
|
this.wrapperEl.style.margin = "-" + this.elStyles.paddingTop + " -" + this.elStyles.paddingRight + " -" + this.elStyles.paddingBottom + " -" + this.elStyles.paddingLeft; |
|
var contentElScrollHeight = this.contentEl.scrollHeight; |
|
var contentElScrollWidth = this.contentEl.scrollWidth; |
|
this.contentWrapperEl.style.height = isHeightAuto ? 'auto' : '100%'; |
|
|
|
this.placeholderEl.style.width = isWidthAuto ? contentElOffsetWidth + "px" : 'auto'; |
|
this.placeholderEl.style.height = contentElScrollHeight + "px"; |
|
var contentWrapperElOffsetHeight = this.contentWrapperEl.offsetHeight; |
|
this.axis.x.isOverflowing = contentElScrollWidth > contentElOffsetWidth; |
|
this.axis.y.isOverflowing = contentElScrollHeight > contentWrapperElOffsetHeight; |
|
|
|
this.axis.x.isOverflowing = elOverflowX === 'hidden' ? false : this.axis.x.isOverflowing; |
|
this.axis.y.isOverflowing = elOverflowY === 'hidden' ? false : this.axis.y.isOverflowing; |
|
this.axis.x.forceVisible = this.options.forceVisible === 'x' || this.options.forceVisible === true; |
|
this.axis.y.forceVisible = this.options.forceVisible === 'y' || this.options.forceVisible === true; |
|
this.hideNativeScrollbar(); |
|
|
|
var offsetForXScrollbar = this.axis.x.isOverflowing ? this.scrollbarWidth : 0; |
|
var offsetForYScrollbar = this.axis.y.isOverflowing ? this.scrollbarWidth : 0; |
|
this.axis.x.isOverflowing = this.axis.x.isOverflowing && contentElScrollWidth > contentWrapperElOffsetWidth - offsetForYScrollbar; |
|
this.axis.y.isOverflowing = this.axis.y.isOverflowing && contentElScrollHeight > contentWrapperElOffsetHeight - offsetForXScrollbar; |
|
this.axis.x.scrollbar.size = this.getScrollbarSize('x'); |
|
this.axis.y.scrollbar.size = this.getScrollbarSize('y'); |
|
this.axis.x.scrollbar.el.style.width = this.axis.x.scrollbar.size + "px"; |
|
this.axis.y.scrollbar.el.style.height = this.axis.y.scrollbar.size + "px"; |
|
this.positionScrollbar('x'); |
|
this.positionScrollbar('y'); |
|
this.toggleTrackVisibility('x'); |
|
this.toggleTrackVisibility('y'); |
|
} |
|
|
|
|
|
|
|
; |
|
|
|
_proto.getScrollbarSize = function getScrollbarSize(axis) { |
|
if (axis === void 0) { |
|
axis = 'y'; |
|
} |
|
|
|
if (!this.axis[axis].isOverflowing) { |
|
return 0; |
|
} |
|
|
|
var contentSize = this.contentEl[this.axis[axis].scrollSizeAttr]; |
|
var trackSize = this.axis[axis].track.el[this.axis[axis].offsetSizeAttr]; |
|
var scrollbarSize; |
|
var scrollbarRatio = trackSize / contentSize; |
|
|
|
scrollbarSize = Math.max(~~(scrollbarRatio * trackSize), this.options.scrollbarMinSize); |
|
|
|
if (this.options.scrollbarMaxSize) { |
|
scrollbarSize = Math.min(scrollbarSize, this.options.scrollbarMaxSize); |
|
} |
|
|
|
return scrollbarSize; |
|
}; |
|
|
|
_proto.positionScrollbar = function positionScrollbar(axis) { |
|
if (axis === void 0) { |
|
axis = 'y'; |
|
} |
|
|
|
if (!this.axis[axis].isOverflowing) { |
|
return; |
|
} |
|
|
|
var contentSize = this.contentWrapperEl[this.axis[axis].scrollSizeAttr]; |
|
var trackSize = this.axis[axis].track.el[this.axis[axis].offsetSizeAttr]; |
|
var hostSize = parseInt(this.elStyles[this.axis[axis].sizeAttr], 10); |
|
var scrollbar = this.axis[axis].scrollbar; |
|
var scrollOffset = this.contentWrapperEl[this.axis[axis].scrollOffsetAttr]; |
|
scrollOffset = axis === 'x' && this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollingInverted ? -scrollOffset : scrollOffset; |
|
var scrollPourcent = scrollOffset / (contentSize - hostSize); |
|
var handleOffset = ~~((trackSize - scrollbar.size) * scrollPourcent); |
|
handleOffset = axis === 'x' && this.isRtl && SimpleBar.getRtlHelpers().isRtlScrollbarInverted ? handleOffset + (trackSize - scrollbar.size) : handleOffset; |
|
scrollbar.el.style.transform = axis === 'x' ? "translate3d(" + handleOffset + "px, 0, 0)" : "translate3d(0, " + handleOffset + "px, 0)"; |
|
}; |
|
|
|
_proto.toggleTrackVisibility = function toggleTrackVisibility(axis) { |
|
if (axis === void 0) { |
|
axis = 'y'; |
|
} |
|
|
|
var track = this.axis[axis].track.el; |
|
var scrollbar = this.axis[axis].scrollbar.el; |
|
|
|
if (this.axis[axis].isOverflowing || this.axis[axis].forceVisible) { |
|
track.style.visibility = 'visible'; |
|
this.contentWrapperEl.style[this.axis[axis].overflowAttr] = 'scroll'; |
|
} else { |
|
track.style.visibility = 'hidden'; |
|
this.contentWrapperEl.style[this.axis[axis].overflowAttr] = 'hidden'; |
|
} |
|
|
|
|
|
if (this.axis[axis].isOverflowing) { |
|
scrollbar.style.display = 'block'; |
|
} else { |
|
scrollbar.style.display = 'none'; |
|
} |
|
}; |
|
|
|
_proto.hideNativeScrollbar = function hideNativeScrollbar() { |
|
this.offsetEl.style[this.isRtl ? 'left' : 'right'] = this.axis.y.isOverflowing || this.axis.y.forceVisible ? "-" + this.scrollbarWidth + "px" : 0; |
|
this.offsetEl.style.bottom = this.axis.x.isOverflowing || this.axis.x.forceVisible ? "-" + this.scrollbarWidth + "px" : 0; |
|
} |
|
|
|
|
|
|
|
; |
|
|
|
_proto.onMouseMoveForAxis = function onMouseMoveForAxis(axis) { |
|
if (axis === void 0) { |
|
axis = 'y'; |
|
} |
|
|
|
this.axis[axis].track.rect = this.axis[axis].track.el.getBoundingClientRect(); |
|
this.axis[axis].scrollbar.rect = this.axis[axis].scrollbar.el.getBoundingClientRect(); |
|
var isWithinScrollbarBoundsX = this.isWithinBounds(this.axis[axis].scrollbar.rect); |
|
|
|
if (isWithinScrollbarBoundsX) { |
|
this.axis[axis].scrollbar.el.classList.add(this.classNames.hover); |
|
} else { |
|
this.axis[axis].scrollbar.el.classList.remove(this.classNames.hover); |
|
} |
|
|
|
if (this.isWithinBounds(this.axis[axis].track.rect)) { |
|
this.showScrollbar(axis); |
|
this.axis[axis].track.el.classList.add(this.classNames.hover); |
|
} else { |
|
this.axis[axis].track.el.classList.remove(this.classNames.hover); |
|
} |
|
}; |
|
|
|
_proto.onMouseLeaveForAxis = function onMouseLeaveForAxis(axis) { |
|
if (axis === void 0) { |
|
axis = 'y'; |
|
} |
|
|
|
this.axis[axis].track.el.classList.remove(this.classNames.hover); |
|
this.axis[axis].scrollbar.el.classList.remove(this.classNames.hover); |
|
}; |
|
|
|
|
|
|
|
|
|
_proto.showScrollbar = function showScrollbar(axis) { |
|
if (axis === void 0) { |
|
axis = 'y'; |
|
} |
|
|
|
var scrollbar = this.axis[axis].scrollbar.el; |
|
|
|
if (!this.axis[axis].isVisible) { |
|
scrollbar.classList.add(this.classNames.visible); |
|
this.axis[axis].isVisible = true; |
|
} |
|
|
|
if (this.options.autoHide) { |
|
this.hideScrollbars(); |
|
} |
|
} |
|
|
|
|
|
|
|
; |
|
|
|
|
|
|
|
|
|
_proto.onDragStart = function onDragStart(e, axis) { |
|
if (axis === void 0) { |
|
axis = 'y'; |
|
} |
|
|
|
var elDocument = getElementDocument(this.el); |
|
var elWindow = getElementWindow(this.el); |
|
var scrollbar = this.axis[axis].scrollbar; |
|
|
|
var eventOffset = axis === 'y' ? e.pageY : e.pageX; |
|
this.axis[axis].dragOffset = eventOffset - scrollbar.rect[this.axis[axis].offsetAttr]; |
|
this.draggedAxis = axis; |
|
this.el.classList.add(this.classNames.dragging); |
|
elDocument.addEventListener('mousemove', this.drag, true); |
|
elDocument.addEventListener('mouseup', this.onEndDrag, true); |
|
|
|
if (this.removePreventClickId === null) { |
|
elDocument.addEventListener('click', this.preventClick, true); |
|
elDocument.addEventListener('dblclick', this.preventClick, true); |
|
} else { |
|
elWindow.clearTimeout(this.removePreventClickId); |
|
this.removePreventClickId = null; |
|
} |
|
} |
|
|
|
|
|
|
|
; |
|
|
|
_proto.onTrackClick = function onTrackClick(e, axis) { |
|
var _this4 = this; |
|
|
|
if (axis === void 0) { |
|
axis = 'y'; |
|
} |
|
|
|
if (!this.options.clickOnTrack) return; |
|
var elWindow = getElementWindow(this.el); |
|
this.axis[axis].scrollbar.rect = this.axis[axis].scrollbar.el.getBoundingClientRect(); |
|
var scrollbar = this.axis[axis].scrollbar; |
|
var scrollbarOffset = scrollbar.rect[this.axis[axis].offsetAttr]; |
|
var hostSize = parseInt(this.elStyles[this.axis[axis].sizeAttr], 10); |
|
var scrolled = this.contentWrapperEl[this.axis[axis].scrollOffsetAttr]; |
|
var t = axis === 'y' ? this.mouseY - scrollbarOffset : this.mouseX - scrollbarOffset; |
|
var dir = t < 0 ? -1 : 1; |
|
var scrollSize = dir === -1 ? scrolled - hostSize : scrolled + hostSize; |
|
|
|
var scrollTo = function scrollTo() { |
|
if (dir === -1) { |
|
if (scrolled > scrollSize) { |
|
var _this4$contentWrapper; |
|
|
|
scrolled -= _this4.options.clickOnTrackSpeed; |
|
|
|
_this4.contentWrapperEl.scrollTo((_this4$contentWrapper = {}, _this4$contentWrapper[_this4.axis[axis].offsetAttr] = scrolled, _this4$contentWrapper)); |
|
|
|
elWindow.requestAnimationFrame(scrollTo); |
|
} |
|
} else { |
|
if (scrolled < scrollSize) { |
|
var _this4$contentWrapper2; |
|
|
|
scrolled += _this4.options.clickOnTrackSpeed; |
|
|
|
_this4.contentWrapperEl.scrollTo((_this4$contentWrapper2 = {}, _this4$contentWrapper2[_this4.axis[axis].offsetAttr] = scrolled, _this4$contentWrapper2)); |
|
|
|
elWindow.requestAnimationFrame(scrollTo); |
|
} |
|
} |
|
}; |
|
|
|
scrollTo(); |
|
} |
|
|
|
|
|
|
|
; |
|
|
|
_proto.getContentElement = function getContentElement() { |
|
return this.contentEl; |
|
} |
|
|
|
|
|
|
|
; |
|
|
|
_proto.getScrollElement = function getScrollElement() { |
|
return this.contentWrapperEl; |
|
}; |
|
|
|
_proto.getScrollbarWidth = function getScrollbarWidth() { |
|
|
|
try { |
|
|
|
if (getComputedStyle(this.contentWrapperEl, '::-webkit-scrollbar').display === 'none' || 'scrollbarWidth' in document.documentElement.style || '-ms-overflow-style' in document.documentElement.style) { |
|
return 0; |
|
} else { |
|
return scrollbarWidth(this.el); |
|
} |
|
} catch (e) { |
|
return scrollbarWidth(this.el); |
|
} |
|
}; |
|
|
|
_proto.removeListeners = function removeListeners() { |
|
var _this5 = this; |
|
|
|
var elWindow = getElementWindow(this.el); |
|
|
|
if (this.options.autoHide) { |
|
this.el.removeEventListener('mouseenter', this.onMouseEnter); |
|
} |
|
|
|
['mousedown', 'click', 'dblclick'].forEach(function (e) { |
|
_this5.el.removeEventListener(e, _this5.onPointerEvent, true); |
|
}); |
|
['touchstart', 'touchend', 'touchmove'].forEach(function (e) { |
|
_this5.el.removeEventListener(e, _this5.onPointerEvent, { |
|
capture: true, |
|
passive: true |
|
}); |
|
}); |
|
this.el.removeEventListener('mousemove', this.onMouseMove); |
|
this.el.removeEventListener('mouseleave', this.onMouseLeave); |
|
|
|
if (this.contentWrapperEl) { |
|
this.contentWrapperEl.removeEventListener('scroll', this.onScroll); |
|
} |
|
|
|
elWindow.removeEventListener('resize', this.onWindowResize); |
|
|
|
if (this.mutationObserver) { |
|
this.mutationObserver.disconnect(); |
|
} |
|
|
|
if (this.resizeObserver) { |
|
this.resizeObserver.disconnect(); |
|
} |
|
|
|
|
|
this.recalculate.cancel(); |
|
this.onMouseMove.cancel(); |
|
this.hideScrollbars.cancel(); |
|
this.onWindowResize.cancel(); |
|
} |
|
|
|
|
|
|
|
; |
|
|
|
_proto.unMount = function unMount() { |
|
this.removeListeners(); |
|
SimpleBar.instances.delete(this.el); |
|
} |
|
|
|
|
|
|
|
; |
|
|
|
_proto.isWithinBounds = function isWithinBounds(bbox) { |
|
return this.mouseX >= bbox.left && this.mouseX <= bbox.left + bbox.width && this.mouseY >= bbox.top && this.mouseY <= bbox.top + bbox.height; |
|
} |
|
|
|
|
|
|
|
; |
|
|
|
_proto.findChild = function findChild(el, query) { |
|
var matches = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector; |
|
return Array.prototype.filter.call(el.children, function (child) { |
|
return matches.call(child, query); |
|
})[0]; |
|
}; |
|
|
|
return SimpleBar; |
|
}(); |
|
|
|
SimpleBar.defaultOptions = { |
|
autoHide: true, |
|
forceVisible: false, |
|
clickOnTrack: true, |
|
clickOnTrackSpeed: 40, |
|
classNames: { |
|
contentEl: 'simplebar-content', |
|
contentWrapper: 'simplebar-content-wrapper', |
|
offset: 'simplebar-offset', |
|
mask: 'simplebar-mask', |
|
wrapper: 'simplebar-wrapper', |
|
placeholder: 'simplebar-placeholder', |
|
scrollbar: 'simplebar-scrollbar', |
|
track: 'simplebar-track', |
|
heightAutoObserverWrapperEl: 'simplebar-height-auto-observer-wrapper', |
|
heightAutoObserverEl: 'simplebar-height-auto-observer', |
|
visible: 'simplebar-visible', |
|
horizontal: 'simplebar-horizontal', |
|
vertical: 'simplebar-vertical', |
|
hover: 'simplebar-hover', |
|
dragging: 'simplebar-dragging' |
|
}, |
|
scrollbarMinSize: 25, |
|
scrollbarMaxSize: 0, |
|
timeout: 1000 |
|
}; |
|
SimpleBar.instances = new WeakMap(); |
|
|
|
SimpleBar.initDOMLoadedElements = function () { |
|
document.removeEventListener('DOMContentLoaded', this.initDOMLoadedElements); |
|
window.removeEventListener('load', this.initDOMLoadedElements); |
|
Array.prototype.forEach.call(document.querySelectorAll('[data-simplebar]'), function (el) { |
|
if (el.getAttribute('data-simplebar') !== 'init' && !SimpleBar.instances.has(el)) new SimpleBar(el, getOptions(el.attributes)); |
|
}); |
|
}; |
|
|
|
SimpleBar.removeObserver = function () { |
|
this.globalObserver.disconnect(); |
|
}; |
|
|
|
SimpleBar.initHtmlApi = function () { |
|
this.initDOMLoadedElements = this.initDOMLoadedElements.bind(this); |
|
|
|
if (typeof MutationObserver !== 'undefined') { |
|
|
|
this.globalObserver = new MutationObserver(SimpleBar.handleMutations); |
|
this.globalObserver.observe(document, { |
|
childList: true, |
|
subtree: true |
|
}); |
|
} |
|
|
|
|
|
|
|
if (document.readyState === 'complete' || document.readyState !== 'loading' && !document.documentElement.doScroll) { |
|
|
|
window.setTimeout(this.initDOMLoadedElements); |
|
} else { |
|
document.addEventListener('DOMContentLoaded', this.initDOMLoadedElements); |
|
window.addEventListener('load', this.initDOMLoadedElements); |
|
} |
|
}; |
|
|
|
SimpleBar.handleMutations = function (mutations) { |
|
mutations.forEach(function (mutation) { |
|
Array.prototype.forEach.call(mutation.addedNodes, function (addedNode) { |
|
if (addedNode.nodeType === 1) { |
|
if (addedNode.hasAttribute('data-simplebar')) { |
|
!SimpleBar.instances.has(addedNode) && document.documentElement.contains(addedNode) && new SimpleBar(addedNode, getOptions(addedNode.attributes)); |
|
} else { |
|
Array.prototype.forEach.call(addedNode.querySelectorAll('[data-simplebar]'), function (el) { |
|
if (el.getAttribute('data-simplebar') !== 'init' && !SimpleBar.instances.has(el) && document.documentElement.contains(el)) new SimpleBar(el, getOptions(el.attributes)); |
|
}); |
|
} |
|
} |
|
}); |
|
Array.prototype.forEach.call(mutation.removedNodes, function (removedNode) { |
|
if (removedNode.nodeType === 1) { |
|
if (removedNode.getAttribute('data-simplebar') === 'init') { |
|
SimpleBar.instances.has(removedNode) && !document.documentElement.contains(removedNode) && SimpleBar.instances.get(removedNode).unMount(); |
|
} else { |
|
Array.prototype.forEach.call(removedNode.querySelectorAll('[data-simplebar="init"]'), function (el) { |
|
SimpleBar.instances.has(el) && !document.documentElement.contains(el) && SimpleBar.instances.get(el).unMount(); |
|
}); |
|
} |
|
} |
|
}); |
|
}); |
|
}; |
|
|
|
SimpleBar.getOptions = getOptions; |
|
|
|
|
|
|
|
|
|
|
|
if (canUseDom) { |
|
SimpleBar.initHtmlApi(); |
|
} |
|
|
|
return SimpleBar; |
|
|
|
})); |
|
|