仰望星辰工作室

better-staridc-MNBT

better-staridc-MNBT/ imsetes/js/bootstrap-table/bootstrap-table.js 247.4 KB · 7,217 行 原始文件
Z zfhsh first commit 2 天前
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
3 typeof define === 'function' && define.amd ? define(['jquery'], factory) :
4 (global = global || self, global.BootstrapTable = factory(global.jQuery));
5}(this, (function ($) { 'use strict';
6
7 $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
8
9 var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
10
11 function createCommonjsModule(fn, module) {
12 return module = { exports: {} }, fn(module, module.exports), module.exports;
13 }
14
15 var check = function (it) {
16 return it && it.Math == Math && it;
17 };
18
19 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
20 var global_1 =
21 // eslint-disable-next-line no-undef
22 check(typeof globalThis == 'object' && globalThis) ||
23 check(typeof window == 'object' && window) ||
24 check(typeof self == 'object' && self) ||
25 check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
26 // eslint-disable-next-line no-new-func
27 Function('return this')();
28
29 var fails = function (exec) {
30 try {
31 return !!exec();
32 } catch (error) {
33 return true;
34 }
35 };
36
37 // Thank's IE8 for his funny defineProperty
38 var descriptors = !fails(function () {
39 return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
40 });
41
42 var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
43 var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
44
45 // Nashorn ~ JDK8 bug
46 var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
47
48 // `Object.prototype.propertyIsEnumerable` method implementation
49 // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable
50 var f = NASHORN_BUG ? function propertyIsEnumerable(V) {
51 var descriptor = getOwnPropertyDescriptor(this, V);
52 return !!descriptor && descriptor.enumerable;
53 } : nativePropertyIsEnumerable;
54
55 var objectPropertyIsEnumerable = {
56 f: f
57 };
58
59 var createPropertyDescriptor = function (bitmap, value) {
60 return {
61 enumerable: !(bitmap & 1),
62 configurable: !(bitmap & 2),
63 writable: !(bitmap & 4),
64 value: value
65 };
66 };
67
68 var toString = {}.toString;
69
70 var classofRaw = function (it) {
71 return toString.call(it).slice(8, -1);
72 };
73
74 var split = ''.split;
75
76 // fallback for non-array-like ES3 and non-enumerable old V8 strings
77 var indexedObject = fails(function () {
78 // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
79 // eslint-disable-next-line no-prototype-builtins
80 return !Object('z').propertyIsEnumerable(0);
81 }) ? function (it) {
82 return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);
83 } : Object;
84
85 // `RequireObjectCoercible` abstract operation
86 // https://tc39.github.io/ecma262/#sec-requireobjectcoercible
87 var requireObjectCoercible = function (it) {
88 if (it == undefined) throw TypeError("Can't call method on " + it);
89 return it;
90 };
91
92 // toObject with fallback for non-array-like ES3 strings
93
94
95
96 var toIndexedObject = function (it) {
97 return indexedObject(requireObjectCoercible(it));
98 };
99
100 var isObject = function (it) {
101 return typeof it === 'object' ? it !== null : typeof it === 'function';
102 };
103
104 // `ToPrimitive` abstract operation
105 // https://tc39.github.io/ecma262/#sec-toprimitive
106 // instead of the ES6 spec version, we didn't implement @@toPrimitive case
107 // and the second argument - flag - preferred type is a string
108 var toPrimitive = function (input, PREFERRED_STRING) {
109 if (!isObject(input)) return input;
110 var fn, val;
111 if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
112 if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
113 if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
114 throw TypeError("Can't convert object to primitive value");
115 };
116
117 var hasOwnProperty = {}.hasOwnProperty;
118
119 var has = function (it, key) {
120 return hasOwnProperty.call(it, key);
121 };
122
123 var document$1 = global_1.document;
124 // typeof document.createElement is 'object' in old IE
125 var EXISTS = isObject(document$1) && isObject(document$1.createElement);
126
127 var documentCreateElement = function (it) {
128 return EXISTS ? document$1.createElement(it) : {};
129 };
130
131 // Thank's IE8 for his funny defineProperty
132 var ie8DomDefine = !descriptors && !fails(function () {
133 return Object.defineProperty(documentCreateElement('div'), 'a', {
134 get: function () { return 7; }
135 }).a != 7;
136 });
137
138 var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
139
140 // `Object.getOwnPropertyDescriptor` method
141 // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor
142 var f$1 = descriptors ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
143 O = toIndexedObject(O);
144 P = toPrimitive(P, true);
145 if (ie8DomDefine) try {
146 return nativeGetOwnPropertyDescriptor(O, P);
147 } catch (error) { /* empty */ }
148 if (has(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);
149 };
150
151 var objectGetOwnPropertyDescriptor = {
152 f: f$1
153 };
154
155 var anObject = function (it) {
156 if (!isObject(it)) {
157 throw TypeError(String(it) + ' is not an object');
158 } return it;
159 };
160
161 var nativeDefineProperty = Object.defineProperty;
162
163 // `Object.defineProperty` method
164 // https://tc39.github.io/ecma262/#sec-object.defineproperty
165 var f$2 = descriptors ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
166 anObject(O);
167 P = toPrimitive(P, true);
168 anObject(Attributes);
169 if (ie8DomDefine) try {
170 return nativeDefineProperty(O, P, Attributes);
171 } catch (error) { /* empty */ }
172 if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
173 if ('value' in Attributes) O[P] = Attributes.value;
174 return O;
175 };
176
177 var objectDefineProperty = {
178 f: f$2
179 };
180
181 var createNonEnumerableProperty = descriptors ? function (object, key, value) {
182 return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));
183 } : function (object, key, value) {
184 object[key] = value;
185 return object;
186 };
187
188 var setGlobal = function (key, value) {
189 try {
190 createNonEnumerableProperty(global_1, key, value);
191 } catch (error) {
192 global_1[key] = value;
193 } return value;
194 };
195
196 var SHARED = '__core-js_shared__';
197 var store = global_1[SHARED] || setGlobal(SHARED, {});
198
199 var sharedStore = store;
200
201 var functionToString = Function.toString;
202
203 // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
204 if (typeof sharedStore.inspectSource != 'function') {
205 sharedStore.inspectSource = function (it) {
206 return functionToString.call(it);
207 };
208 }
209
210 var inspectSource = sharedStore.inspectSource;
211
212 var WeakMap = global_1.WeakMap;
213
214 var nativeWeakMap = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
215
216 var shared = createCommonjsModule(function (module) {
217 (module.exports = function (key, value) {
218 return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
219 })('versions', []).push({
220 version: '3.6.0',
221 mode: 'global',
222 copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
223 });
224 });
225
226 var id = 0;
227 var postfix = Math.random();
228
229 var uid = function (key) {
230 return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
231 };
232
233 var keys = shared('keys');
234
235 var sharedKey = function (key) {
236 return keys[key] || (keys[key] = uid(key));
237 };
238
239 var hiddenKeys = {};
240
241 var WeakMap$1 = global_1.WeakMap;
242 var set, get, has$1;
243
244 var enforce = function (it) {
245 return has$1(it) ? get(it) : set(it, {});
246 };
247
248 var getterFor = function (TYPE) {
249 return function (it) {
250 var state;
251 if (!isObject(it) || (state = get(it)).type !== TYPE) {
252 throw TypeError('Incompatible receiver, ' + TYPE + ' required');
253 } return state;
254 };
255 };
256
257 if (nativeWeakMap) {
258 var store$1 = new WeakMap$1();
259 var wmget = store$1.get;
260 var wmhas = store$1.has;
261 var wmset = store$1.set;
262 set = function (it, metadata) {
263 wmset.call(store$1, it, metadata);
264 return metadata;
265 };
266 get = function (it) {
267 return wmget.call(store$1, it) || {};
268 };
269 has$1 = function (it) {
270 return wmhas.call(store$1, it);
271 };
272 } else {
273 var STATE = sharedKey('state');
274 hiddenKeys[STATE] = true;
275 set = function (it, metadata) {
276 createNonEnumerableProperty(it, STATE, metadata);
277 return metadata;
278 };
279 get = function (it) {
280 return has(it, STATE) ? it[STATE] : {};
281 };
282 has$1 = function (it) {
283 return has(it, STATE);
284 };
285 }
286
287 var internalState = {
288 set: set,
289 get: get,
290 has: has$1,
291 enforce: enforce,
292 getterFor: getterFor
293 };
294
295 var redefine = createCommonjsModule(function (module) {
296 var getInternalState = internalState.get;
297 var enforceInternalState = internalState.enforce;
298 var TEMPLATE = String(String).split('String');
299
300 (module.exports = function (O, key, value, options) {
301 var unsafe = options ? !!options.unsafe : false;
302 var simple = options ? !!options.enumerable : false;
303 var noTargetGet = options ? !!options.noTargetGet : false;
304 if (typeof value == 'function') {
305 if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
306 enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
307 }
308 if (O === global_1) {
309 if (simple) O[key] = value;
310 else setGlobal(key, value);
311 return;
312 } else if (!unsafe) {
313 delete O[key];
314 } else if (!noTargetGet && O[key]) {
315 simple = true;
316 }
317 if (simple) O[key] = value;
318 else createNonEnumerableProperty(O, key, value);
319 // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
320 })(Function.prototype, 'toString', function toString() {
321 return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
322 });
323 });
324
325 var path = global_1;
326
327 var aFunction = function (variable) {
328 return typeof variable == 'function' ? variable : undefined;
329 };
330
331 var getBuiltIn = function (namespace, method) {
332 return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global_1[namespace])
333 : path[namespace] && path[namespace][method] || global_1[namespace] && global_1[namespace][method];
334 };
335
336 var ceil = Math.ceil;
337 var floor = Math.floor;
338
339 // `ToInteger` abstract operation
340 // https://tc39.github.io/ecma262/#sec-tointeger
341 var toInteger = function (argument) {
342 return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
343 };
344
345 var min = Math.min;
346
347 // `ToLength` abstract operation
348 // https://tc39.github.io/ecma262/#sec-tolength
349 var toLength = function (argument) {
350 return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
351 };
352
353 var max = Math.max;
354 var min$1 = Math.min;
355
356 // Helper for a popular repeating case of the spec:
357 // Let integer be ? ToInteger(index).
358 // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
359 var toAbsoluteIndex = function (index, length) {
360 var integer = toInteger(index);
361 return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
362 };
363
364 // `Array.prototype.{ indexOf, includes }` methods implementation
365 var createMethod = function (IS_INCLUDES) {
366 return function ($this, el, fromIndex) {
367 var O = toIndexedObject($this);
368 var length = toLength(O.length);
369 var index = toAbsoluteIndex(fromIndex, length);
370 var value;
371 // Array#includes uses SameValueZero equality algorithm
372 // eslint-disable-next-line no-self-compare
373 if (IS_INCLUDES && el != el) while (length > index) {
374 value = O[index++];
375 // eslint-disable-next-line no-self-compare
376 if (value != value) return true;
377 // Array#indexOf ignores holes, Array#includes - not
378 } else for (;length > index; index++) {
379 if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
380 } return !IS_INCLUDES && -1;
381 };
382 };
383
384 var arrayIncludes = {
385 // `Array.prototype.includes` method
386 // https://tc39.github.io/ecma262/#sec-array.prototype.includes
387 includes: createMethod(true),
388 // `Array.prototype.indexOf` method
389 // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
390 indexOf: createMethod(false)
391 };
392
393 var indexOf = arrayIncludes.indexOf;
394
395
396 var objectKeysInternal = function (object, names) {
397 var O = toIndexedObject(object);
398 var i = 0;
399 var result = [];
400 var key;
401 for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
402 // Don't enum bug & hidden keys
403 while (names.length > i) if (has(O, key = names[i++])) {
404 ~indexOf(result, key) || result.push(key);
405 }
406 return result;
407 };
408
409 // IE8- don't enum bug keys
410 var enumBugKeys = [
411 'constructor',
412 'hasOwnProperty',
413 'isPrototypeOf',
414 'propertyIsEnumerable',
415 'toLocaleString',
416 'toString',
417 'valueOf'
418 ];
419
420 var hiddenKeys$1 = enumBugKeys.concat('length', 'prototype');
421
422 // `Object.getOwnPropertyNames` method
423 // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
424 var f$3 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
425 return objectKeysInternal(O, hiddenKeys$1);
426 };
427
428 var objectGetOwnPropertyNames = {
429 f: f$3
430 };
431
432 var f$4 = Object.getOwnPropertySymbols;
433
434 var objectGetOwnPropertySymbols = {
435 f: f$4
436 };
437
438 // all object keys, includes non-enumerable and symbols
439 var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
440 var keys = objectGetOwnPropertyNames.f(anObject(it));
441 var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
442 return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
443 };
444
445 var copyConstructorProperties = function (target, source) {
446 var keys = ownKeys(source);
447 var defineProperty = objectDefineProperty.f;
448 var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
449 for (var i = 0; i < keys.length; i++) {
450 var key = keys[i];
451 if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
452 }
453 };
454
455 var replacement = /#|\.prototype\./;
456
457 var isForced = function (feature, detection) {
458 var value = data[normalize(feature)];
459 return value == POLYFILL ? true
460 : value == NATIVE ? false
461 : typeof detection == 'function' ? fails(detection)
462 : !!detection;
463 };
464
465 var normalize = isForced.normalize = function (string) {
466 return String(string).replace(replacement, '.').toLowerCase();
467 };
468
469 var data = isForced.data = {};
470 var NATIVE = isForced.NATIVE = 'N';
471 var POLYFILL = isForced.POLYFILL = 'P';
472
473 var isForced_1 = isForced;
474
475 var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
476
477
478
479
480
481
482 /*
483 options.target - name of the target object
484 options.global - target is the global object
485 options.stat - export as static methods of target
486 options.proto - export as prototype methods of target
487 options.real - real prototype method for the `pure` version
488 options.forced - export even if the native feature is available
489 options.bind - bind methods to the target, required for the `pure` version
490 options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
491 options.unsafe - use the simple assignment of property instead of delete + defineProperty
492 options.sham - add a flag to not completely full polyfills
493 options.enumerable - export as enumerable property
494 options.noTargetGet - prevent calling a getter on target
495 */
496 var _export = function (options, source) {
497 var TARGET = options.target;
498 var GLOBAL = options.global;
499 var STATIC = options.stat;
500 var FORCED, target, key, targetProperty, sourceProperty, descriptor;
501 if (GLOBAL) {
502 target = global_1;
503 } else if (STATIC) {
504 target = global_1[TARGET] || setGlobal(TARGET, {});
505 } else {
506 target = (global_1[TARGET] || {}).prototype;
507 }
508 if (target) for (key in source) {
509 sourceProperty = source[key];
510 if (options.noTargetGet) {
511 descriptor = getOwnPropertyDescriptor$1(target, key);
512 targetProperty = descriptor && descriptor.value;
513 } else targetProperty = target[key];
514 FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
515 // contained in target
516 if (!FORCED && targetProperty !== undefined) {
517 if (typeof sourceProperty === typeof targetProperty) continue;
518 copyConstructorProperties(sourceProperty, targetProperty);
519 }
520 // add a flag to not completely full polyfills
521 if (options.sham || (targetProperty && targetProperty.sham)) {
522 createNonEnumerableProperty(sourceProperty, 'sham', true);
523 }
524 // extend global
525 redefine(target, key, sourceProperty, options);
526 }
527 };
528
529 var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
530 // Chrome 38 Symbol has incorrect toString conversion
531 // eslint-disable-next-line no-undef
532 return !String(Symbol());
533 });
534
535 var useSymbolAsUid = nativeSymbol
536 // eslint-disable-next-line no-undef
537 && !Symbol.sham
538 // eslint-disable-next-line no-undef
539 && typeof Symbol() == 'symbol';
540
541 // `IsArray` abstract operation
542 // https://tc39.github.io/ecma262/#sec-isarray
543 var isArray = Array.isArray || function isArray(arg) {
544 return classofRaw(arg) == 'Array';
545 };
546
547 // `ToObject` abstract operation
548 // https://tc39.github.io/ecma262/#sec-toobject
549 var toObject = function (argument) {
550 return Object(requireObjectCoercible(argument));
551 };
552
553 // `Object.keys` method
554 // https://tc39.github.io/ecma262/#sec-object.keys
555 var objectKeys = Object.keys || function keys(O) {
556 return objectKeysInternal(O, enumBugKeys);
557 };
558
559 // `Object.defineProperties` method
560 // https://tc39.github.io/ecma262/#sec-object.defineproperties
561 var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
562 anObject(O);
563 var keys = objectKeys(Properties);
564 var length = keys.length;
565 var index = 0;
566 var key;
567 while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);
568 return O;
569 };
570
571 var html = getBuiltIn('document', 'documentElement');
572
573 var GT = '>';
574 var LT = '<';
575 var PROTOTYPE = 'prototype';
576 var SCRIPT = 'script';
577 var IE_PROTO = sharedKey('IE_PROTO');
578
579 var EmptyConstructor = function () { /* empty */ };
580
581 var scriptTag = function (content) {
582 return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
583 };
584
585 // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
586 var NullProtoObjectViaActiveX = function (activeXDocument) {
587 activeXDocument.write(scriptTag(''));
588 activeXDocument.close();
589 var temp = activeXDocument.parentWindow.Object;
590 activeXDocument = null; // avoid memory leak
591 return temp;
592 };
593
594 // Create object with fake `null` prototype: use iframe Object with cleared prototype
595 var NullProtoObjectViaIFrame = function () {
596 // Thrash, waste and sodomy: IE GC bug
597 var iframe = documentCreateElement('iframe');
598 var JS = 'java' + SCRIPT + ':';
599 var iframeDocument;
600 iframe.style.display = 'none';
601 html.appendChild(iframe);
602 // https://github.com/zloirock/core-js/issues/475
603 iframe.src = String(JS);
604 iframeDocument = iframe.contentWindow.document;
605 iframeDocument.open();
606 iframeDocument.write(scriptTag('document.F=Object'));
607 iframeDocument.close();
608 return iframeDocument.F;
609 };
610
611 // Check for document.domain and active x support
612 // No need to use active x approach when document.domain is not set
613 // see https://github.com/es-shims/es5-shim/issues/150
614 // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
615 // avoid IE GC bug
616 var activeXDocument;
617 var NullProtoObject = function () {
618 try {
619 /* global ActiveXObject */
620 activeXDocument = document.domain && new ActiveXObject('htmlfile');
621 } catch (error) { /* ignore */ }
622 NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
623 var length = enumBugKeys.length;
624 while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
625 return NullProtoObject();
626 };
627
628 hiddenKeys[IE_PROTO] = true;
629
630 // `Object.create` method
631 // https://tc39.github.io/ecma262/#sec-object.create
632 var objectCreate = Object.create || function create(O, Properties) {
633 var result;
634 if (O !== null) {
635 EmptyConstructor[PROTOTYPE] = anObject(O);
636 result = new EmptyConstructor();
637 EmptyConstructor[PROTOTYPE] = null;
638 // add "__proto__" for Object.getPrototypeOf polyfill
639 result[IE_PROTO] = O;
640 } else result = NullProtoObject();
641 return Properties === undefined ? result : objectDefineProperties(result, Properties);
642 };
643
644 var nativeGetOwnPropertyNames = objectGetOwnPropertyNames.f;
645
646 var toString$1 = {}.toString;
647
648 var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
649 ? Object.getOwnPropertyNames(window) : [];
650
651 var getWindowNames = function (it) {
652 try {
653 return nativeGetOwnPropertyNames(it);
654 } catch (error) {
655 return windowNames.slice();
656 }
657 };
658
659 // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
660 var f$5 = function getOwnPropertyNames(it) {
661 return windowNames && toString$1.call(it) == '[object Window]'
662 ? getWindowNames(it)
663 : nativeGetOwnPropertyNames(toIndexedObject(it));
664 };
665
666 var objectGetOwnPropertyNamesExternal = {
667 f: f$5
668 };
669
670 var WellKnownSymbolsStore = shared('wks');
671 var Symbol$1 = global_1.Symbol;
672 var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : uid;
673
674 var wellKnownSymbol = function (name) {
675 if (!has(WellKnownSymbolsStore, name)) {
676 if (nativeSymbol && has(Symbol$1, name)) WellKnownSymbolsStore[name] = Symbol$1[name];
677 else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
678 } return WellKnownSymbolsStore[name];
679 };
680
681 var f$6 = wellKnownSymbol;
682
683 var wrappedWellKnownSymbol = {
684 f: f$6
685 };
686
687 var defineProperty = objectDefineProperty.f;
688
689 var defineWellKnownSymbol = function (NAME) {
690 var Symbol = path.Symbol || (path.Symbol = {});
691 if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, {
692 value: wrappedWellKnownSymbol.f(NAME)
693 });
694 };
695
696 var defineProperty$1 = objectDefineProperty.f;
697
698
699
700 var TO_STRING_TAG = wellKnownSymbol('toStringTag');
701
702 var setToStringTag = function (it, TAG, STATIC) {
703 if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
704 defineProperty$1(it, TO_STRING_TAG, { configurable: true, value: TAG });
705 }
706 };
707
708 var aFunction$1 = function (it) {
709 if (typeof it != 'function') {
710 throw TypeError(String(it) + ' is not a function');
711 } return it;
712 };
713
714 // optional / simple context binding
715 var bindContext = function (fn, that, length) {
716 aFunction$1(fn);
717 if (that === undefined) return fn;
718 switch (length) {
719 case 0: return function () {
720 return fn.call(that);
721 };
722 case 1: return function (a) {
723 return fn.call(that, a);
724 };
725 case 2: return function (a, b) {
726 return fn.call(that, a, b);
727 };
728 case 3: return function (a, b, c) {
729 return fn.call(that, a, b, c);
730 };
731 }
732 return function (/* ...args */) {
733 return fn.apply(that, arguments);
734 };
735 };
736
737 var SPECIES = wellKnownSymbol('species');
738
739 // `ArraySpeciesCreate` abstract operation
740 // https://tc39.github.io/ecma262/#sec-arrayspeciescreate
741 var arraySpeciesCreate = function (originalArray, length) {
742 var C;
743 if (isArray(originalArray)) {
744 C = originalArray.constructor;
745 // cross-realm fallback
746 if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
747 else if (isObject(C)) {
748 C = C[SPECIES];
749 if (C === null) C = undefined;
750 }
751 } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
752 };
753
754 var push = [].push;
755
756 // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation
757 var createMethod$1 = function (TYPE) {
758 var IS_MAP = TYPE == 1;
759 var IS_FILTER = TYPE == 2;
760 var IS_SOME = TYPE == 3;
761 var IS_EVERY = TYPE == 4;
762 var IS_FIND_INDEX = TYPE == 6;
763 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
764 return function ($this, callbackfn, that, specificCreate) {
765 var O = toObject($this);
766 var self = indexedObject(O);
767 var boundFunction = bindContext(callbackfn, that, 3);
768 var length = toLength(self.length);
769 var index = 0;
770 var create = specificCreate || arraySpeciesCreate;
771 var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
772 var value, result;
773 for (;length > index; index++) if (NO_HOLES || index in self) {
774 value = self[index];
775 result = boundFunction(value, index, O);
776 if (TYPE) {
777 if (IS_MAP) target[index] = result; // map
778 else if (result) switch (TYPE) {
779 case 3: return true; // some
780 case 5: return value; // find
781 case 6: return index; // findIndex
782 case 2: push.call(target, value); // filter
783 } else if (IS_EVERY) return false; // every
784 }
785 }
786 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
787 };
788 };
789
790 var arrayIteration = {
791 // `Array.prototype.forEach` method
792 // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
793 forEach: createMethod$1(0),
794 // `Array.prototype.map` method
795 // https://tc39.github.io/ecma262/#sec-array.prototype.map
796 map: createMethod$1(1),
797 // `Array.prototype.filter` method
798 // https://tc39.github.io/ecma262/#sec-array.prototype.filter
799 filter: createMethod$1(2),
800 // `Array.prototype.some` method
801 // https://tc39.github.io/ecma262/#sec-array.prototype.some
802 some: createMethod$1(3),
803 // `Array.prototype.every` method
804 // https://tc39.github.io/ecma262/#sec-array.prototype.every
805 every: createMethod$1(4),
806 // `Array.prototype.find` method
807 // https://tc39.github.io/ecma262/#sec-array.prototype.find
808 find: createMethod$1(5),
809 // `Array.prototype.findIndex` method
810 // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
811 findIndex: createMethod$1(6)
812 };
813
814 var $forEach = arrayIteration.forEach;
815
816 var HIDDEN = sharedKey('hidden');
817 var SYMBOL = 'Symbol';
818 var PROTOTYPE$1 = 'prototype';
819 var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
820 var setInternalState = internalState.set;
821 var getInternalState = internalState.getterFor(SYMBOL);
822 var ObjectPrototype = Object[PROTOTYPE$1];
823 var $Symbol = global_1.Symbol;
824 var $stringify = getBuiltIn('JSON', 'stringify');
825 var nativeGetOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
826 var nativeDefineProperty$1 = objectDefineProperty.f;
827 var nativeGetOwnPropertyNames$1 = objectGetOwnPropertyNamesExternal.f;
828 var nativePropertyIsEnumerable$1 = objectPropertyIsEnumerable.f;
829 var AllSymbols = shared('symbols');
830 var ObjectPrototypeSymbols = shared('op-symbols');
831 var StringToSymbolRegistry = shared('string-to-symbol-registry');
832 var SymbolToStringRegistry = shared('symbol-to-string-registry');
833 var WellKnownSymbolsStore$1 = shared('wks');
834 var QObject = global_1.QObject;
835 // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
836 var USE_SETTER = !QObject || !QObject[PROTOTYPE$1] || !QObject[PROTOTYPE$1].findChild;
837
838 // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
839 var setSymbolDescriptor = descriptors && fails(function () {
840 return objectCreate(nativeDefineProperty$1({}, 'a', {
841 get: function () { return nativeDefineProperty$1(this, 'a', { value: 7 }).a; }
842 })).a != 7;
843 }) ? function (O, P, Attributes) {
844 var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$1(ObjectPrototype, P);
845 if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
846 nativeDefineProperty$1(O, P, Attributes);
847 if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
848 nativeDefineProperty$1(ObjectPrototype, P, ObjectPrototypeDescriptor);
849 }
850 } : nativeDefineProperty$1;
851
852 var wrap = function (tag, description) {
853 var symbol = AllSymbols[tag] = objectCreate($Symbol[PROTOTYPE$1]);
854 setInternalState(symbol, {
855 type: SYMBOL,
856 tag: tag,
857 description: description
858 });
859 if (!descriptors) symbol.description = description;
860 return symbol;
861 };
862
863 var isSymbol = nativeSymbol && typeof $Symbol.iterator == 'symbol' ? function (it) {
864 return typeof it == 'symbol';
865 } : function (it) {
866 return Object(it) instanceof $Symbol;
867 };
868
869 var $defineProperty = function defineProperty(O, P, Attributes) {
870 if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
871 anObject(O);
872 var key = toPrimitive(P, true);
873 anObject(Attributes);
874 if (has(AllSymbols, key)) {
875 if (!Attributes.enumerable) {
876 if (!has(O, HIDDEN)) nativeDefineProperty$1(O, HIDDEN, createPropertyDescriptor(1, {}));
877 O[HIDDEN][key] = true;
878 } else {
879 if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
880 Attributes = objectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
881 } return setSymbolDescriptor(O, key, Attributes);
882 } return nativeDefineProperty$1(O, key, Attributes);
883 };
884
885 var $defineProperties = function defineProperties(O, Properties) {
886 anObject(O);
887 var properties = toIndexedObject(Properties);
888 var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
889 $forEach(keys, function (key) {
890 if (!descriptors || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);
891 });
892 return O;
893 };
894
895 var $create = function create(O, Properties) {
896 return Properties === undefined ? objectCreate(O) : $defineProperties(objectCreate(O), Properties);
897 };
898
899 var $propertyIsEnumerable = function propertyIsEnumerable(V) {
900 var P = toPrimitive(V, true);
901 var enumerable = nativePropertyIsEnumerable$1.call(this, P);
902 if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;
903 return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
904 };
905
906 var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
907 var it = toIndexedObject(O);
908 var key = toPrimitive(P, true);
909 if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;
910 var descriptor = nativeGetOwnPropertyDescriptor$1(it, key);
911 if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {
912 descriptor.enumerable = true;
913 }
914 return descriptor;
915 };
916
917 var $getOwnPropertyNames = function getOwnPropertyNames(O) {
918 var names = nativeGetOwnPropertyNames$1(toIndexedObject(O));
919 var result = [];
920 $forEach(names, function (key) {
921 if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);
922 });
923 return result;
924 };
925
926 var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
927 var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
928 var names = nativeGetOwnPropertyNames$1(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
929 var result = [];
930 $forEach(names, function (key) {
931 if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {
932 result.push(AllSymbols[key]);
933 }
934 });
935 return result;
936 };
937
938 // `Symbol` constructor
939 // https://tc39.github.io/ecma262/#sec-symbol-constructor
940 if (!nativeSymbol) {
941 $Symbol = function Symbol() {
942 if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
943 var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);
944 var tag = uid(description);
945 var setter = function (value) {
946 if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);
947 if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
948 setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
949 };
950 if (descriptors && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
951 return wrap(tag, description);
952 };
953
954 redefine($Symbol[PROTOTYPE$1], 'toString', function toString() {
955 return getInternalState(this).tag;
956 });
957
958 objectPropertyIsEnumerable.f = $propertyIsEnumerable;
959 objectDefineProperty.f = $defineProperty;
960 objectGetOwnPropertyDescriptor.f = $getOwnPropertyDescriptor;
961 objectGetOwnPropertyNames.f = objectGetOwnPropertyNamesExternal.f = $getOwnPropertyNames;
962 objectGetOwnPropertySymbols.f = $getOwnPropertySymbols;
963
964 if (descriptors) {
965 // https://github.com/tc39/proposal-Symbol-description
966 nativeDefineProperty$1($Symbol[PROTOTYPE$1], 'description', {
967 configurable: true,
968 get: function description() {
969 return getInternalState(this).description;
970 }
971 });
972 {
973 redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
974 }
975 }
976 }
977
978 if (!useSymbolAsUid) {
979 wrappedWellKnownSymbol.f = function (name) {
980 return wrap(wellKnownSymbol(name), name);
981 };
982 }
983
984 _export({ global: true, wrap: true, forced: !nativeSymbol, sham: !nativeSymbol }, {
985 Symbol: $Symbol
986 });
987
988 $forEach(objectKeys(WellKnownSymbolsStore$1), function (name) {
989 defineWellKnownSymbol(name);
990 });
991
992 _export({ target: SYMBOL, stat: true, forced: !nativeSymbol }, {
993 // `Symbol.for` method
994 // https://tc39.github.io/ecma262/#sec-symbol.for
995 'for': function (key) {
996 var string = String(key);
997 if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
998 var symbol = $Symbol(string);
999 StringToSymbolRegistry[string] = symbol;
1000 SymbolToStringRegistry[symbol] = string;
1001 return symbol;
1002 },
1003 // `Symbol.keyFor` method
1004 // https://tc39.github.io/ecma262/#sec-symbol.keyfor
1005 keyFor: function keyFor(sym) {
1006 if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
1007 if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
1008 },
1009 useSetter: function () { USE_SETTER = true; },
1010 useSimple: function () { USE_SETTER = false; }
1011 });
1012
1013 _export({ target: 'Object', stat: true, forced: !nativeSymbol, sham: !descriptors }, {
1014 // `Object.create` method
1015 // https://tc39.github.io/ecma262/#sec-object.create
1016 create: $create,
1017 // `Object.defineProperty` method
1018 // https://tc39.github.io/ecma262/#sec-object.defineproperty
1019 defineProperty: $defineProperty,
1020 // `Object.defineProperties` method
1021 // https://tc39.github.io/ecma262/#sec-object.defineproperties
1022 defineProperties: $defineProperties,
1023 // `Object.getOwnPropertyDescriptor` method
1024 // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
1025 getOwnPropertyDescriptor: $getOwnPropertyDescriptor
1026 });
1027
1028 _export({ target: 'Object', stat: true, forced: !nativeSymbol }, {
1029 // `Object.getOwnPropertyNames` method
1030 // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
1031 getOwnPropertyNames: $getOwnPropertyNames,
1032 // `Object.getOwnPropertySymbols` method
1033 // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols
1034 getOwnPropertySymbols: $getOwnPropertySymbols
1035 });
1036
1037 // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
1038 // https://bugs.chromium.org/p/v8/issues/detail?id=3443
1039 _export({ target: 'Object', stat: true, forced: fails(function () { objectGetOwnPropertySymbols.f(1); }) }, {
1040 getOwnPropertySymbols: function getOwnPropertySymbols(it) {
1041 return objectGetOwnPropertySymbols.f(toObject(it));
1042 }
1043 });
1044
1045 // `JSON.stringify` method behavior with symbols
1046 // https://tc39.github.io/ecma262/#sec-json.stringify
1047 if ($stringify) {
1048 var FORCED_JSON_STRINGIFY = !nativeSymbol || fails(function () {
1049 var symbol = $Symbol();
1050 // MS Edge converts symbol values to JSON as {}
1051 return $stringify([symbol]) != '[null]'
1052 // WebKit converts symbol values to JSON as null
1053 || $stringify({ a: symbol }) != '{}'
1054 // V8 throws on boxed symbols
1055 || $stringify(Object(symbol)) != '{}';
1056 });
1057
1058 _export({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
1059 // eslint-disable-next-line no-unused-vars
1060 stringify: function stringify(it, replacer, space) {
1061 var args = [it];
1062 var index = 1;
1063 var $replacer;
1064 while (arguments.length > index) args.push(arguments[index++]);
1065 $replacer = replacer;
1066 if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
1067 if (!isArray(replacer)) replacer = function (key, value) {
1068 if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
1069 if (!isSymbol(value)) return value;
1070 };
1071 args[1] = replacer;
1072 return $stringify.apply(null, args);
1073 }
1074 });
1075 }
1076
1077 // `Symbol.prototype[@@toPrimitive]` method
1078 // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive
1079 if (!$Symbol[PROTOTYPE$1][TO_PRIMITIVE]) {
1080 createNonEnumerableProperty($Symbol[PROTOTYPE$1], TO_PRIMITIVE, $Symbol[PROTOTYPE$1].valueOf);
1081 }
1082 // `Symbol.prototype[@@toStringTag]` property
1083 // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag
1084 setToStringTag($Symbol, SYMBOL);
1085
1086 hiddenKeys[HIDDEN] = true;
1087
1088 var defineProperty$2 = objectDefineProperty.f;
1089
1090
1091 var NativeSymbol = global_1.Symbol;
1092
1093 if (descriptors && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) ||
1094 // Safari 12 bug
1095 NativeSymbol().description !== undefined
1096 )) {
1097 var EmptyStringDescriptionStore = {};
1098 // wrap Symbol constructor for correct work with undefined description
1099 var SymbolWrapper = function Symbol() {
1100 var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]);
1101 var result = this instanceof SymbolWrapper
1102 ? new NativeSymbol(description)
1103 // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
1104 : description === undefined ? NativeSymbol() : NativeSymbol(description);
1105 if (description === '') EmptyStringDescriptionStore[result] = true;
1106 return result;
1107 };
1108 copyConstructorProperties(SymbolWrapper, NativeSymbol);
1109 var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype;
1110 symbolPrototype.constructor = SymbolWrapper;
1111
1112 var symbolToString = symbolPrototype.toString;
1113 var native = String(NativeSymbol('test')) == 'Symbol(test)';
1114 var regexp = /^Symbol\((.*)\)[^)]+$/;
1115 defineProperty$2(symbolPrototype, 'description', {
1116 configurable: true,
1117 get: function description() {
1118 var symbol = isObject(this) ? this.valueOf() : this;
1119 var string = symbolToString.call(symbol);
1120 if (has(EmptyStringDescriptionStore, symbol)) return '';
1121 var desc = native ? string.slice(7, -1) : string.replace(regexp, '$1');
1122 return desc === '' ? undefined : desc;
1123 }
1124 });
1125
1126 _export({ global: true, forced: true }, {
1127 Symbol: SymbolWrapper
1128 });
1129 }
1130
1131 // `Symbol.iterator` well-known symbol
1132 // https://tc39.github.io/ecma262/#sec-symbol.iterator
1133 defineWellKnownSymbol('iterator');
1134
1135 var createProperty = function (object, key, value) {
1136 var propertyKey = toPrimitive(key);
1137 if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
1138 else object[propertyKey] = value;
1139 };
1140
1141 var userAgent = getBuiltIn('navigator', 'userAgent') || '';
1142
1143 var process = global_1.process;
1144 var versions = process && process.versions;
1145 var v8 = versions && versions.v8;
1146 var match, version;
1147
1148 if (v8) {
1149 match = v8.split('.');
1150 version = match[0] + match[1];
1151 } else if (userAgent) {
1152 match = userAgent.match(/Edge\/(\d+)/);
1153 if (!match || match[1] >= 74) {
1154 match = userAgent.match(/Chrome\/(\d+)/);
1155 if (match) version = match[1];
1156 }
1157 }
1158
1159 var v8Version = version && +version;
1160
1161 var SPECIES$1 = wellKnownSymbol('species');
1162
1163 var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {
1164 // We can't use this feature detection in V8 since it causes
1165 // deoptimization and serious performance degradation
1166 // https://github.com/zloirock/core-js/issues/677
1167 return v8Version >= 51 || !fails(function () {
1168 var array = [];
1169 var constructor = array.constructor = {};
1170 constructor[SPECIES$1] = function () {
1171 return { foo: 1 };
1172 };
1173 return array[METHOD_NAME](Boolean).foo !== 1;
1174 });
1175 };
1176
1177 var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
1178 var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
1179 var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
1180
1181 // We can't use this feature detection in V8 since it causes
1182 // deoptimization and serious performance degradation
1183 // https://github.com/zloirock/core-js/issues/679
1184 var IS_CONCAT_SPREADABLE_SUPPORT = v8Version >= 51 || !fails(function () {
1185 var array = [];
1186 array[IS_CONCAT_SPREADABLE] = false;
1187 return array.concat()[0] !== array;
1188 });
1189
1190 var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
1191
1192 var isConcatSpreadable = function (O) {
1193 if (!isObject(O)) return false;
1194 var spreadable = O[IS_CONCAT_SPREADABLE];
1195 return spreadable !== undefined ? !!spreadable : isArray(O);
1196 };
1197
1198 var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
1199
1200 // `Array.prototype.concat` method
1201 // https://tc39.github.io/ecma262/#sec-array.prototype.concat
1202 // with adding support of @@isConcatSpreadable and @@species
1203 _export({ target: 'Array', proto: true, forced: FORCED }, {
1204 concat: function concat(arg) { // eslint-disable-line no-unused-vars
1205 var O = toObject(this);
1206 var A = arraySpeciesCreate(O, 0);
1207 var n = 0;
1208 var i, k, length, len, E;
1209 for (i = -1, length = arguments.length; i < length; i++) {
1210 E = i === -1 ? O : arguments[i];
1211 if (isConcatSpreadable(E)) {
1212 len = toLength(E.length);
1213 if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
1214 for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
1215 } else {
1216 if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
1217 createProperty(A, n++, E);
1218 }
1219 }
1220 A.length = n;
1221 return A;
1222 }
1223 });
1224
1225 var $filter = arrayIteration.filter;
1226
1227
1228
1229 var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
1230 // Edge 14- issue
1231 var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () {
1232 [].filter.call({ length: -1, 0: 1 }, function (it) { throw it; });
1233 });
1234
1235 // `Array.prototype.filter` method
1236 // https://tc39.github.io/ecma262/#sec-array.prototype.filter
1237 // with adding support of @@species
1238 _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
1239 filter: function filter(callbackfn /* , thisArg */) {
1240 return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1241 }
1242 });
1243
1244 var UNSCOPABLES = wellKnownSymbol('unscopables');
1245 var ArrayPrototype = Array.prototype;
1246
1247 // Array.prototype[@@unscopables]
1248 // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
1249 if (ArrayPrototype[UNSCOPABLES] == undefined) {
1250 objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {
1251 configurable: true,
1252 value: objectCreate(null)
1253 });
1254 }
1255
1256 // add a key to Array.prototype[@@unscopables]
1257 var addToUnscopables = function (key) {
1258 ArrayPrototype[UNSCOPABLES][key] = true;
1259 };
1260
1261 var $find = arrayIteration.find;
1262
1263
1264 var FIND = 'find';
1265 var SKIPS_HOLES = true;
1266
1267 // Shouldn't skip holes
1268 if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
1269
1270 // `Array.prototype.find` method
1271 // https://tc39.github.io/ecma262/#sec-array.prototype.find
1272 _export({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
1273 find: function find(callbackfn /* , that = undefined */) {
1274 return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1275 }
1276 });
1277
1278 // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
1279 addToUnscopables(FIND);
1280
1281 var $findIndex = arrayIteration.findIndex;
1282
1283
1284 var FIND_INDEX = 'findIndex';
1285 var SKIPS_HOLES$1 = true;
1286
1287 // Shouldn't skip holes
1288 if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES$1 = false; });
1289
1290 // `Array.prototype.findIndex` method
1291 // https://tc39.github.io/ecma262/#sec-array.prototype.findindex
1292 _export({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, {
1293 findIndex: function findIndex(callbackfn /* , that = undefined */) {
1294 return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1295 }
1296 });
1297
1298 // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
1299 addToUnscopables(FIND_INDEX);
1300
1301 var $includes = arrayIncludes.includes;
1302
1303
1304 // `Array.prototype.includes` method
1305 // https://tc39.github.io/ecma262/#sec-array.prototype.includes
1306 _export({ target: 'Array', proto: true }, {
1307 includes: function includes(el /* , fromIndex = 0 */) {
1308 return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
1309 }
1310 });
1311
1312 // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
1313 addToUnscopables('includes');
1314
1315 var sloppyArrayMethod = function (METHOD_NAME, argument) {
1316 var method = [][METHOD_NAME];
1317 return !method || !fails(function () {
1318 // eslint-disable-next-line no-useless-call,no-throw-literal
1319 method.call(null, argument || function () { throw 1; }, 1);
1320 });
1321 };
1322
1323 var $indexOf = arrayIncludes.indexOf;
1324
1325
1326 var nativeIndexOf = [].indexOf;
1327
1328 var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
1329 var SLOPPY_METHOD = sloppyArrayMethod('indexOf');
1330
1331 // `Array.prototype.indexOf` method
1332 // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
1333 _export({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || SLOPPY_METHOD }, {
1334 indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
1335 return NEGATIVE_ZERO
1336 // convert -0 to +0
1337 ? nativeIndexOf.apply(this, arguments) || 0
1338 : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
1339 }
1340 });
1341
1342 var correctPrototypeGetter = !fails(function () {
1343 function F() { /* empty */ }
1344 F.prototype.constructor = null;
1345 return Object.getPrototypeOf(new F()) !== F.prototype;
1346 });
1347
1348 var IE_PROTO$1 = sharedKey('IE_PROTO');
1349 var ObjectPrototype$1 = Object.prototype;
1350
1351 // `Object.getPrototypeOf` method
1352 // https://tc39.github.io/ecma262/#sec-object.getprototypeof
1353 var objectGetPrototypeOf = correctPrototypeGetter ? Object.getPrototypeOf : function (O) {
1354 O = toObject(O);
1355 if (has(O, IE_PROTO$1)) return O[IE_PROTO$1];
1356 if (typeof O.constructor == 'function' && O instanceof O.constructor) {
1357 return O.constructor.prototype;
1358 } return O instanceof Object ? ObjectPrototype$1 : null;
1359 };
1360
1361 var ITERATOR = wellKnownSymbol('iterator');
1362 var BUGGY_SAFARI_ITERATORS = false;
1363
1364 var returnThis = function () { return this; };
1365
1366 // `%IteratorPrototype%` object
1367 // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object
1368 var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
1369
1370 if ([].keys) {
1371 arrayIterator = [].keys();
1372 // Safari 8 has buggy iterators w/o `next`
1373 if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
1374 else {
1375 PrototypeOfArrayIteratorPrototype = objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator));
1376 if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
1377 }
1378 }
1379
1380 if (IteratorPrototype == undefined) IteratorPrototype = {};
1381
1382 // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
1383 if ( !has(IteratorPrototype, ITERATOR)) {
1384 createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
1385 }
1386
1387 var iteratorsCore = {
1388 IteratorPrototype: IteratorPrototype,
1389 BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
1390 };
1391
1392 var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1393
1394 var createIteratorConstructor = function (IteratorConstructor, NAME, next) {
1395 var TO_STRING_TAG = NAME + ' Iterator';
1396 IteratorConstructor.prototype = objectCreate(IteratorPrototype$1, { next: createPropertyDescriptor(1, next) });
1397 setToStringTag(IteratorConstructor, TO_STRING_TAG, false);
1398 return IteratorConstructor;
1399 };
1400
1401 var aPossiblePrototype = function (it) {
1402 if (!isObject(it) && it !== null) {
1403 throw TypeError("Can't set " + String(it) + ' as a prototype');
1404 } return it;
1405 };
1406
1407 // `Object.setPrototypeOf` method
1408 // https://tc39.github.io/ecma262/#sec-object.setprototypeof
1409 // Works with __proto__ only. Old v8 can't work with null proto objects.
1410 /* eslint-disable no-proto */
1411 var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1412 var CORRECT_SETTER = false;
1413 var test = {};
1414 var setter;
1415 try {
1416 setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
1417 setter.call(test, []);
1418 CORRECT_SETTER = test instanceof Array;
1419 } catch (error) { /* empty */ }
1420 return function setPrototypeOf(O, proto) {
1421 anObject(O);
1422 aPossiblePrototype(proto);
1423 if (CORRECT_SETTER) setter.call(O, proto);
1424 else O.__proto__ = proto;
1425 return O;
1426 };
1427 }() : undefined);
1428
1429 var IteratorPrototype$2 = iteratorsCore.IteratorPrototype;
1430 var BUGGY_SAFARI_ITERATORS$1 = iteratorsCore.BUGGY_SAFARI_ITERATORS;
1431 var ITERATOR$1 = wellKnownSymbol('iterator');
1432 var KEYS = 'keys';
1433 var VALUES = 'values';
1434 var ENTRIES = 'entries';
1435
1436 var returnThis$1 = function () { return this; };
1437
1438 var defineIterator = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1439 createIteratorConstructor(IteratorConstructor, NAME, next);
1440
1441 var getIterationMethod = function (KIND) {
1442 if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1443 if (!BUGGY_SAFARI_ITERATORS$1 && KIND in IterablePrototype) return IterablePrototype[KIND];
1444 switch (KIND) {
1445 case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1446 case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1447 case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1448 } return function () { return new IteratorConstructor(this); };
1449 };
1450
1451 var TO_STRING_TAG = NAME + ' Iterator';
1452 var INCORRECT_VALUES_NAME = false;
1453 var IterablePrototype = Iterable.prototype;
1454 var nativeIterator = IterablePrototype[ITERATOR$1]
1455 || IterablePrototype['@@iterator']
1456 || DEFAULT && IterablePrototype[DEFAULT];
1457 var defaultIterator = !BUGGY_SAFARI_ITERATORS$1 && nativeIterator || getIterationMethod(DEFAULT);
1458 var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1459 var CurrentIteratorPrototype, methods, KEY;
1460
1461 // fix native
1462 if (anyNativeIterator) {
1463 CurrentIteratorPrototype = objectGetPrototypeOf(anyNativeIterator.call(new Iterable()));
1464 if (IteratorPrototype$2 !== Object.prototype && CurrentIteratorPrototype.next) {
1465 if ( objectGetPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype$2) {
1466 if (objectSetPrototypeOf) {
1467 objectSetPrototypeOf(CurrentIteratorPrototype, IteratorPrototype$2);
1468 } else if (typeof CurrentIteratorPrototype[ITERATOR$1] != 'function') {
1469 createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR$1, returnThis$1);
1470 }
1471 }
1472 // Set @@toStringTag to native iterators
1473 setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
1474 }
1475 }
1476
1477 // fix Array#{values, @@iterator}.name in V8 / FF
1478 if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1479 INCORRECT_VALUES_NAME = true;
1480 defaultIterator = function values() { return nativeIterator.call(this); };
1481 }
1482
1483 // define iterator
1484 if ( IterablePrototype[ITERATOR$1] !== defaultIterator) {
1485 createNonEnumerableProperty(IterablePrototype, ITERATOR$1, defaultIterator);
1486 }
1487
1488 // export additional methods
1489 if (DEFAULT) {
1490 methods = {
1491 values: getIterationMethod(VALUES),
1492 keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1493 entries: getIterationMethod(ENTRIES)
1494 };
1495 if (FORCED) for (KEY in methods) {
1496 if (BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1497 redefine(IterablePrototype, KEY, methods[KEY]);
1498 }
1499 } else _export({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS$1 || INCORRECT_VALUES_NAME }, methods);
1500 }
1501
1502 return methods;
1503 };
1504
1505 var ARRAY_ITERATOR = 'Array Iterator';
1506 var setInternalState$1 = internalState.set;
1507 var getInternalState$1 = internalState.getterFor(ARRAY_ITERATOR);
1508
1509 // `Array.prototype.entries` method
1510 // https://tc39.github.io/ecma262/#sec-array.prototype.entries
1511 // `Array.prototype.keys` method
1512 // https://tc39.github.io/ecma262/#sec-array.prototype.keys
1513 // `Array.prototype.values` method
1514 // https://tc39.github.io/ecma262/#sec-array.prototype.values
1515 // `Array.prototype[@@iterator]` method
1516 // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator
1517 // `CreateArrayIterator` internal method
1518 // https://tc39.github.io/ecma262/#sec-createarrayiterator
1519 var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1520 setInternalState$1(this, {
1521 type: ARRAY_ITERATOR,
1522 target: toIndexedObject(iterated), // target
1523 index: 0, // next index
1524 kind: kind // kind
1525 });
1526 // `%ArrayIteratorPrototype%.next` method
1527 // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next
1528 }, function () {
1529 var state = getInternalState$1(this);
1530 var target = state.target;
1531 var kind = state.kind;
1532 var index = state.index++;
1533 if (!target || index >= target.length) {
1534 state.target = undefined;
1535 return { value: undefined, done: true };
1536 }
1537 if (kind == 'keys') return { value: index, done: false };
1538 if (kind == 'values') return { value: target[index], done: false };
1539 return { value: [index, target[index]], done: false };
1540 }, 'values');
1541
1542 // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
1543 addToUnscopables('keys');
1544 addToUnscopables('values');
1545 addToUnscopables('entries');
1546
1547 var nativeJoin = [].join;
1548
1549 var ES3_STRINGS = indexedObject != Object;
1550 var SLOPPY_METHOD$1 = sloppyArrayMethod('join', ',');
1551
1552 // `Array.prototype.join` method
1553 // https://tc39.github.io/ecma262/#sec-array.prototype.join
1554 _export({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD$1 }, {
1555 join: function join(separator) {
1556 return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
1557 }
1558 });
1559
1560 var $map = arrayIteration.map;
1561
1562
1563
1564 var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('map');
1565 // FF49- issue
1566 var USES_TO_LENGTH$1 = HAS_SPECIES_SUPPORT$1 && !fails(function () {
1567 [].map.call({ length: -1, 0: 1 }, function (it) { throw it; });
1568 });
1569
1570 // `Array.prototype.map` method
1571 // https://tc39.github.io/ecma262/#sec-array.prototype.map
1572 // with adding support of @@species
1573 _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 || !USES_TO_LENGTH$1 }, {
1574 map: function map(callbackfn /* , thisArg */) {
1575 return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1576 }
1577 });
1578
1579 var nativeReverse = [].reverse;
1580 var test = [1, 2];
1581
1582 // `Array.prototype.reverse` method
1583 // https://tc39.github.io/ecma262/#sec-array.prototype.reverse
1584 // fix for Safari 12.0 bug
1585 // https://bugs.webkit.org/show_bug.cgi?id=188794
1586 _export({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
1587 reverse: function reverse() {
1588 // eslint-disable-next-line no-self-assign
1589 if (isArray(this)) this.length = this.length;
1590 return nativeReverse.call(this);
1591 }
1592 });
1593
1594 var SPECIES$2 = wellKnownSymbol('species');
1595 var nativeSlice = [].slice;
1596 var max$1 = Math.max;
1597
1598 // `Array.prototype.slice` method
1599 // https://tc39.github.io/ecma262/#sec-array.prototype.slice
1600 // fallback for not array-like ES3 strings and DOM objects
1601 _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('slice') }, {
1602 slice: function slice(start, end) {
1603 var O = toIndexedObject(this);
1604 var length = toLength(O.length);
1605 var k = toAbsoluteIndex(start, length);
1606 var fin = toAbsoluteIndex(end === undefined ? length : end, length);
1607 // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
1608 var Constructor, result, n;
1609 if (isArray(O)) {
1610 Constructor = O.constructor;
1611 // cross-realm fallback
1612 if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
1613 Constructor = undefined;
1614 } else if (isObject(Constructor)) {
1615 Constructor = Constructor[SPECIES$2];
1616 if (Constructor === null) Constructor = undefined;
1617 }
1618 if (Constructor === Array || Constructor === undefined) {
1619 return nativeSlice.call(O, k, fin);
1620 }
1621 }
1622 result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0));
1623 for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
1624 result.length = n;
1625 return result;
1626 }
1627 });
1628
1629 var test$1 = [];
1630 var nativeSort = test$1.sort;
1631
1632 // IE8-
1633 var FAILS_ON_UNDEFINED = fails(function () {
1634 test$1.sort(undefined);
1635 });
1636 // V8 bug
1637 var FAILS_ON_NULL = fails(function () {
1638 test$1.sort(null);
1639 });
1640 // Old WebKit
1641 var SLOPPY_METHOD$2 = sloppyArrayMethod('sort');
1642
1643 var FORCED$1 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD$2;
1644
1645 // `Array.prototype.sort` method
1646 // https://tc39.github.io/ecma262/#sec-array.prototype.sort
1647 _export({ target: 'Array', proto: true, forced: FORCED$1 }, {
1648 sort: function sort(comparefn) {
1649 return comparefn === undefined
1650 ? nativeSort.call(toObject(this))
1651 : nativeSort.call(toObject(this), aFunction$1(comparefn));
1652 }
1653 });
1654
1655 var max$2 = Math.max;
1656 var min$2 = Math.min;
1657 var MAX_SAFE_INTEGER$1 = 0x1FFFFFFFFFFFFF;
1658 var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
1659
1660 // `Array.prototype.splice` method
1661 // https://tc39.github.io/ecma262/#sec-array.prototype.splice
1662 // with adding support of @@species
1663 _export({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('splice') }, {
1664 splice: function splice(start, deleteCount /* , ...items */) {
1665 var O = toObject(this);
1666 var len = toLength(O.length);
1667 var actualStart = toAbsoluteIndex(start, len);
1668 var argumentsLength = arguments.length;
1669 var insertCount, actualDeleteCount, A, k, from, to;
1670 if (argumentsLength === 0) {
1671 insertCount = actualDeleteCount = 0;
1672 } else if (argumentsLength === 1) {
1673 insertCount = 0;
1674 actualDeleteCount = len - actualStart;
1675 } else {
1676 insertCount = argumentsLength - 2;
1677 actualDeleteCount = min$2(max$2(toInteger(deleteCount), 0), len - actualStart);
1678 }
1679 if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER$1) {
1680 throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
1681 }
1682 A = arraySpeciesCreate(O, actualDeleteCount);
1683 for (k = 0; k < actualDeleteCount; k++) {
1684 from = actualStart + k;
1685 if (from in O) createProperty(A, k, O[from]);
1686 }
1687 A.length = actualDeleteCount;
1688 if (insertCount < actualDeleteCount) {
1689 for (k = actualStart; k < len - actualDeleteCount; k++) {
1690 from = k + actualDeleteCount;
1691 to = k + insertCount;
1692 if (from in O) O[to] = O[from];
1693 else delete O[to];
1694 }
1695 for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
1696 } else if (insertCount > actualDeleteCount) {
1697 for (k = len - actualDeleteCount; k > actualStart; k--) {
1698 from = k + actualDeleteCount - 1;
1699 to = k + insertCount - 1;
1700 if (from in O) O[to] = O[from];
1701 else delete O[to];
1702 }
1703 }
1704 for (k = 0; k < insertCount; k++) {
1705 O[k + actualStart] = arguments[k + 2];
1706 }
1707 O.length = len - actualDeleteCount + insertCount;
1708 return A;
1709 }
1710 });
1711
1712 // makes subclassing work correct for wrapped built-ins
1713 var inheritIfRequired = function ($this, dummy, Wrapper) {
1714 var NewTarget, NewTargetPrototype;
1715 if (
1716 // it can work only with native `setPrototypeOf`
1717 objectSetPrototypeOf &&
1718 // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
1719 typeof (NewTarget = dummy.constructor) == 'function' &&
1720 NewTarget !== Wrapper &&
1721 isObject(NewTargetPrototype = NewTarget.prototype) &&
1722 NewTargetPrototype !== Wrapper.prototype
1723 ) objectSetPrototypeOf($this, NewTargetPrototype);
1724 return $this;
1725 };
1726
1727 // a string of all valid unicode whitespaces
1728 // eslint-disable-next-line max-len
1729 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';
1730
1731 var whitespace = '[' + whitespaces + ']';
1732 var ltrim = RegExp('^' + whitespace + whitespace + '*');
1733 var rtrim = RegExp(whitespace + whitespace + '*$');
1734
1735 // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1736 var createMethod$2 = function (TYPE) {
1737 return function ($this) {
1738 var string = String(requireObjectCoercible($this));
1739 if (TYPE & 1) string = string.replace(ltrim, '');
1740 if (TYPE & 2) string = string.replace(rtrim, '');
1741 return string;
1742 };
1743 };
1744
1745 var stringTrim = {
1746 // `String.prototype.{ trimLeft, trimStart }` methods
1747 // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart
1748 start: createMethod$2(1),
1749 // `String.prototype.{ trimRight, trimEnd }` methods
1750 // https://tc39.github.io/ecma262/#sec-string.prototype.trimend
1751 end: createMethod$2(2),
1752 // `String.prototype.trim` method
1753 // https://tc39.github.io/ecma262/#sec-string.prototype.trim
1754 trim: createMethod$2(3)
1755 };
1756
1757 var getOwnPropertyNames = objectGetOwnPropertyNames.f;
1758 var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
1759 var defineProperty$3 = objectDefineProperty.f;
1760 var trim = stringTrim.trim;
1761
1762 var NUMBER = 'Number';
1763 var NativeNumber = global_1[NUMBER];
1764 var NumberPrototype = NativeNumber.prototype;
1765
1766 // Opera ~12 has broken Object#toString
1767 var BROKEN_CLASSOF = classofRaw(objectCreate(NumberPrototype)) == NUMBER;
1768
1769 // `ToNumber` abstract operation
1770 // https://tc39.github.io/ecma262/#sec-tonumber
1771 var toNumber = function (argument) {
1772 var it = toPrimitive(argument, false);
1773 var first, third, radix, maxCode, digits, length, index, code;
1774 if (typeof it == 'string' && it.length > 2) {
1775 it = trim(it);
1776 first = it.charCodeAt(0);
1777 if (first === 43 || first === 45) {
1778 third = it.charCodeAt(2);
1779 if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
1780 } else if (first === 48) {
1781 switch (it.charCodeAt(1)) {
1782 case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i
1783 case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i
1784 default: return +it;
1785 }
1786 digits = it.slice(2);
1787 length = digits.length;
1788 for (index = 0; index < length; index++) {
1789 code = digits.charCodeAt(index);
1790 // parseInt parses a string to a first unavailable symbol
1791 // but ToNumber should return NaN if a string contains unavailable symbols
1792 if (code < 48 || code > maxCode) return NaN;
1793 } return parseInt(digits, radix);
1794 }
1795 } return +it;
1796 };
1797
1798 // `Number` constructor
1799 // https://tc39.github.io/ecma262/#sec-number-constructor
1800 if (isForced_1(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {
1801 var NumberWrapper = function Number(value) {
1802 var it = arguments.length < 1 ? 0 : value;
1803 var dummy = this;
1804 return dummy instanceof NumberWrapper
1805 // check on 1..constructor(foo) case
1806 && (BROKEN_CLASSOF ? fails(function () { NumberPrototype.valueOf.call(dummy); }) : classofRaw(dummy) != NUMBER)
1807 ? inheritIfRequired(new NativeNumber(toNumber(it)), dummy, NumberWrapper) : toNumber(it);
1808 };
1809 for (var keys$1 = descriptors ? getOwnPropertyNames(NativeNumber) : (
1810 // ES3:
1811 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
1812 // ES2015 (in case, if modules with ES2015 Number statics required before):
1813 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
1814 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
1815 ).split(','), j = 0, key; keys$1.length > j; j++) {
1816 if (has(NativeNumber, key = keys$1[j]) && !has(NumberWrapper, key)) {
1817 defineProperty$3(NumberWrapper, key, getOwnPropertyDescriptor$2(NativeNumber, key));
1818 }
1819 }
1820 NumberWrapper.prototype = NumberPrototype;
1821 NumberPrototype.constructor = NumberWrapper;
1822 redefine(global_1, NUMBER, NumberWrapper);
1823 }
1824
1825 var nativeAssign = Object.assign;
1826 var defineProperty$4 = Object.defineProperty;
1827
1828 // `Object.assign` method
1829 // https://tc39.github.io/ecma262/#sec-object.assign
1830 var objectAssign = !nativeAssign || fails(function () {
1831 // should have correct order of operations (Edge bug)
1832 if (descriptors && nativeAssign({ b: 1 }, nativeAssign(defineProperty$4({}, 'a', {
1833 enumerable: true,
1834 get: function () {
1835 defineProperty$4(this, 'b', {
1836 value: 3,
1837 enumerable: false
1838 });
1839 }
1840 }), { b: 2 })).b !== 1) return true;
1841 // should work with symbols and should have deterministic property order (V8 bug)
1842 var A = {};
1843 var B = {};
1844 // eslint-disable-next-line no-undef
1845 var symbol = Symbol();
1846 var alphabet = 'abcdefghijklmnopqrst';
1847 A[symbol] = 7;
1848 alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1849 return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
1850 }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
1851 var T = toObject(target);
1852 var argumentsLength = arguments.length;
1853 var index = 1;
1854 var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;
1855 var propertyIsEnumerable = objectPropertyIsEnumerable.f;
1856 while (argumentsLength > index) {
1857 var S = indexedObject(arguments[index++]);
1858 var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
1859 var length = keys.length;
1860 var j = 0;
1861 var key;
1862 while (length > j) {
1863 key = keys[j++];
1864 if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];
1865 }
1866 } return T;
1867 } : nativeAssign;
1868
1869 // `Object.assign` method
1870 // https://tc39.github.io/ecma262/#sec-object.assign
1871 _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {
1872 assign: objectAssign
1873 });
1874
1875 var propertyIsEnumerable = objectPropertyIsEnumerable.f;
1876
1877 // `Object.{ entries, values }` methods implementation
1878 var createMethod$3 = function (TO_ENTRIES) {
1879 return function (it) {
1880 var O = toIndexedObject(it);
1881 var keys = objectKeys(O);
1882 var length = keys.length;
1883 var i = 0;
1884 var result = [];
1885 var key;
1886 while (length > i) {
1887 key = keys[i++];
1888 if (!descriptors || propertyIsEnumerable.call(O, key)) {
1889 result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
1890 }
1891 }
1892 return result;
1893 };
1894 };
1895
1896 var objectToArray = {
1897 // `Object.entries` method
1898 // https://tc39.github.io/ecma262/#sec-object.entries
1899 entries: createMethod$3(true),
1900 // `Object.values` method
1901 // https://tc39.github.io/ecma262/#sec-object.values
1902 values: createMethod$3(false)
1903 };
1904
1905 var $entries = objectToArray.entries;
1906
1907 // `Object.entries` method
1908 // https://tc39.github.io/ecma262/#sec-object.entries
1909 _export({ target: 'Object', stat: true }, {
1910 entries: function entries(O) {
1911 return $entries(O);
1912 }
1913 });
1914
1915 var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');
1916 var test$2 = {};
1917
1918 test$2[TO_STRING_TAG$1] = 'z';
1919
1920 var toStringTagSupport = String(test$2) === '[object z]';
1921
1922 var TO_STRING_TAG$2 = wellKnownSymbol('toStringTag');
1923 // ES3 wrong here
1924 var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1925
1926 // fallback for IE11 Script Access Denied error
1927 var tryGet = function (it, key) {
1928 try {
1929 return it[key];
1930 } catch (error) { /* empty */ }
1931 };
1932
1933 // getting tag from ES6+ `Object.prototype.toString`
1934 var classof = toStringTagSupport ? classofRaw : function (it) {
1935 var O, tag, result;
1936 return it === undefined ? 'Undefined' : it === null ? 'Null'
1937 // @@toStringTag case
1938 : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG$2)) == 'string' ? tag
1939 // builtinTag case
1940 : CORRECT_ARGUMENTS ? classofRaw(O)
1941 // ES3 arguments fallback
1942 : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
1943 };
1944
1945 // `Object.prototype.toString` method implementation
1946 // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
1947 var objectToString = toStringTagSupport ? {}.toString : function toString() {
1948 return '[object ' + classof(this) + ']';
1949 };
1950
1951 // `Object.prototype.toString` method
1952 // https://tc39.github.io/ecma262/#sec-object.prototype.tostring
1953 if (!toStringTagSupport) {
1954 redefine(Object.prototype, 'toString', objectToString, { unsafe: true });
1955 }
1956
1957 var trim$1 = stringTrim.trim;
1958
1959
1960 var nativeParseFloat = global_1.parseFloat;
1961 var FORCED$2 = 1 / nativeParseFloat(whitespaces + '-0') !== -Infinity;
1962
1963 // `parseFloat` method
1964 // https://tc39.github.io/ecma262/#sec-parsefloat-string
1965 var _parseFloat = FORCED$2 ? function parseFloat(string) {
1966 var trimmedString = trim$1(String(string));
1967 var result = nativeParseFloat(trimmedString);
1968 return result === 0 && trimmedString.charAt(0) == '-' ? -0 : result;
1969 } : nativeParseFloat;
1970
1971 // `parseFloat` method
1972 // https://tc39.github.io/ecma262/#sec-parsefloat-string
1973 _export({ global: true, forced: parseFloat != _parseFloat }, {
1974 parseFloat: _parseFloat
1975 });
1976
1977 var trim$2 = stringTrim.trim;
1978
1979
1980 var nativeParseInt = global_1.parseInt;
1981 var hex = /^[+-]?0[Xx]/;
1982 var FORCED$3 = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22;
1983
1984 // `parseInt` method
1985 // https://tc39.github.io/ecma262/#sec-parseint-string-radix
1986 var _parseInt = FORCED$3 ? function parseInt(string, radix) {
1987 var S = trim$2(String(string));
1988 return nativeParseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
1989 } : nativeParseInt;
1990
1991 // `parseInt` method
1992 // https://tc39.github.io/ecma262/#sec-parseint-string-radix
1993 _export({ global: true, forced: parseInt != _parseInt }, {
1994 parseInt: _parseInt
1995 });
1996
1997 // `RegExp.prototype.flags` getter implementation
1998 // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags
1999 var regexpFlags = function () {
2000 var that = anObject(this);
2001 var result = '';
2002 if (that.global) result += 'g';
2003 if (that.ignoreCase) result += 'i';
2004 if (that.multiline) result += 'm';
2005 if (that.dotAll) result += 's';
2006 if (that.unicode) result += 'u';
2007 if (that.sticky) result += 'y';
2008 return result;
2009 };
2010
2011 // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
2012 // so we use an intermediate function.
2013 function RE(s, f) {
2014 return RegExp(s, f);
2015 }
2016
2017 var UNSUPPORTED_Y = fails(function () {
2018 // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
2019 var re = RE('a', 'y');
2020 re.lastIndex = 2;
2021 return re.exec('abcd') != null;
2022 });
2023
2024 var BROKEN_CARET = fails(function () {
2025 // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
2026 var re = RE('^r', 'gy');
2027 re.lastIndex = 2;
2028 return re.exec('str') != null;
2029 });
2030
2031 var regexpStickyHelpers = {
2032 UNSUPPORTED_Y: UNSUPPORTED_Y,
2033 BROKEN_CARET: BROKEN_CARET
2034 };
2035
2036 var nativeExec = RegExp.prototype.exec;
2037 // This always refers to the native implementation, because the
2038 // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
2039 // which loads this file before patching the method.
2040 var nativeReplace = String.prototype.replace;
2041
2042 var patchedExec = nativeExec;
2043
2044 var UPDATES_LAST_INDEX_WRONG = (function () {
2045 var re1 = /a/;
2046 var re2 = /b*/g;
2047 nativeExec.call(re1, 'a');
2048 nativeExec.call(re2, 'a');
2049 return re1.lastIndex !== 0 || re2.lastIndex !== 0;
2050 })();
2051
2052 var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;
2053
2054 // nonparticipating capturing group, copied from es5-shim's String#split patch.
2055 var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
2056
2057 var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1;
2058
2059 if (PATCH) {
2060 patchedExec = function exec(str) {
2061 var re = this;
2062 var lastIndex, reCopy, match, i;
2063 var sticky = UNSUPPORTED_Y$1 && re.sticky;
2064 var flags = regexpFlags.call(re);
2065 var source = re.source;
2066 var charsAdded = 0;
2067 var strCopy = str;
2068
2069 if (sticky) {
2070 flags = flags.replace('y', '');
2071 if (flags.indexOf('g') === -1) {
2072 flags += 'g';
2073 }
2074
2075 strCopy = String(str).slice(re.lastIndex);
2076 // Support anchored sticky behavior.
2077 if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
2078 source = '(?: ' + source + ')';
2079 strCopy = ' ' + strCopy;
2080 charsAdded++;
2081 }
2082 // ^(? + rx + ) is needed, in combination with some str slicing, to
2083 // simulate the 'y' flag.
2084 reCopy = new RegExp('^(?:' + source + ')', flags);
2085 }
2086
2087 if (NPCG_INCLUDED) {
2088 reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
2089 }
2090 if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
2091
2092 match = nativeExec.call(sticky ? reCopy : re, strCopy);
2093
2094 if (sticky) {
2095 if (match) {
2096 match.input = match.input.slice(charsAdded);
2097 match[0] = match[0].slice(charsAdded);
2098 match.index = re.lastIndex;
2099 re.lastIndex += match[0].length;
2100 } else re.lastIndex = 0;
2101 } else if (UPDATES_LAST_INDEX_WRONG && match) {
2102 re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
2103 }
2104 if (NPCG_INCLUDED && match && match.length > 1) {
2105 // Fix browsers whose `exec` methods don't consistently return `undefined`
2106 // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
2107 nativeReplace.call(match[0], reCopy, function () {
2108 for (i = 1; i < arguments.length - 2; i++) {
2109 if (arguments[i] === undefined) match[i] = undefined;
2110 }
2111 });
2112 }
2113
2114 return match;
2115 };
2116 }
2117
2118 var regexpExec = patchedExec;
2119
2120 _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {
2121 exec: regexpExec
2122 });
2123
2124 var TO_STRING = 'toString';
2125 var RegExpPrototype = RegExp.prototype;
2126 var nativeToString = RegExpPrototype[TO_STRING];
2127
2128 var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
2129 // FF44- RegExp#toString has a wrong name
2130 var INCORRECT_NAME = nativeToString.name != TO_STRING;
2131
2132 // `RegExp.prototype.toString` method
2133 // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring
2134 if (NOT_GENERIC || INCORRECT_NAME) {
2135 redefine(RegExp.prototype, TO_STRING, function toString() {
2136 var R = anObject(this);
2137 var p = String(R.source);
2138 var rf = R.flags;
2139 var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? regexpFlags.call(R) : rf);
2140 return '/' + p + '/' + f;
2141 }, { unsafe: true });
2142 }
2143
2144 var MATCH = wellKnownSymbol('match');
2145
2146 // `IsRegExp` abstract operation
2147 // https://tc39.github.io/ecma262/#sec-isregexp
2148 var isRegexp = function (it) {
2149 var isRegExp;
2150 return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');
2151 };
2152
2153 var notARegexp = function (it) {
2154 if (isRegexp(it)) {
2155 throw TypeError("The method doesn't accept regular expressions");
2156 } return it;
2157 };
2158
2159 var MATCH$1 = wellKnownSymbol('match');
2160
2161 var correctIsRegexpLogic = function (METHOD_NAME) {
2162 var regexp = /./;
2163 try {
2164 '/./'[METHOD_NAME](regexp);
2165 } catch (e) {
2166 try {
2167 regexp[MATCH$1] = false;
2168 return '/./'[METHOD_NAME](regexp);
2169 } catch (f) { /* empty */ }
2170 } return false;
2171 };
2172
2173 // `String.prototype.includes` method
2174 // https://tc39.github.io/ecma262/#sec-string.prototype.includes
2175 _export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, {
2176 includes: function includes(searchString /* , position = 0 */) {
2177 return !!~String(requireObjectCoercible(this))
2178 .indexOf(notARegexp(searchString), arguments.length > 1 ? arguments[1] : undefined);
2179 }
2180 });
2181
2182 // `String.prototype.{ codePointAt, at }` methods implementation
2183 var createMethod$4 = function (CONVERT_TO_STRING) {
2184 return function ($this, pos) {
2185 var S = String(requireObjectCoercible($this));
2186 var position = toInteger(pos);
2187 var size = S.length;
2188 var first, second;
2189 if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
2190 first = S.charCodeAt(position);
2191 return first < 0xD800 || first > 0xDBFF || position + 1 === size
2192 || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
2193 ? CONVERT_TO_STRING ? S.charAt(position) : first
2194 : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
2195 };
2196 };
2197
2198 var stringMultibyte = {
2199 // `String.prototype.codePointAt` method
2200 // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
2201 codeAt: createMethod$4(false),
2202 // `String.prototype.at` method
2203 // https://github.com/mathiasbynens/String.prototype.at
2204 charAt: createMethod$4(true)
2205 };
2206
2207 var charAt = stringMultibyte.charAt;
2208
2209
2210
2211 var STRING_ITERATOR = 'String Iterator';
2212 var setInternalState$2 = internalState.set;
2213 var getInternalState$2 = internalState.getterFor(STRING_ITERATOR);
2214
2215 // `String.prototype[@@iterator]` method
2216 // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator
2217 defineIterator(String, 'String', function (iterated) {
2218 setInternalState$2(this, {
2219 type: STRING_ITERATOR,
2220 string: String(iterated),
2221 index: 0
2222 });
2223 // `%StringIteratorPrototype%.next` method
2224 // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next
2225 }, function next() {
2226 var state = getInternalState$2(this);
2227 var string = state.string;
2228 var index = state.index;
2229 var point;
2230 if (index >= string.length) return { value: undefined, done: true };
2231 point = charAt(string, index);
2232 state.index += point.length;
2233 return { value: point, done: false };
2234 });
2235
2236 var SPECIES$3 = wellKnownSymbol('species');
2237
2238 var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
2239 // #replace needs built-in support for named groups.
2240 // #match works fine because it just return the exec results, even if it has
2241 // a "grops" property.
2242 var re = /./;
2243 re.exec = function () {
2244 var result = [];
2245 result.groups = { a: '7' };
2246 return result;
2247 };
2248 return ''.replace(re, '$<a>') !== '7';
2249 });
2250
2251 // IE <= 11 replaces $0 with the whole match, as if it was $&
2252 // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
2253 var REPLACE_KEEPS_$0 = (function () {
2254 return 'a'.replace(/./, '$0') === '$0';
2255 })();
2256
2257 // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
2258 // Weex JS has frozen built-in prototypes, so use try / catch wrapper
2259 var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
2260 var re = /(?:)/;
2261 var originalExec = re.exec;
2262 re.exec = function () { return originalExec.apply(this, arguments); };
2263 var result = 'ab'.split(re);
2264 return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
2265 });
2266
2267 var fixRegexpWellKnownSymbolLogic = function (KEY, length, exec, sham) {
2268 var SYMBOL = wellKnownSymbol(KEY);
2269
2270 var DELEGATES_TO_SYMBOL = !fails(function () {
2271 // String methods call symbol-named RegEp methods
2272 var O = {};
2273 O[SYMBOL] = function () { return 7; };
2274 return ''[KEY](O) != 7;
2275 });
2276
2277 var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
2278 // Symbol-named RegExp methods call .exec
2279 var execCalled = false;
2280 var re = /a/;
2281
2282 if (KEY === 'split') {
2283 // We can't use real regex here since it causes deoptimization
2284 // and serious performance degradation in V8
2285 // https://github.com/zloirock/core-js/issues/306
2286 re = {};
2287 // RegExp[@@split] doesn't call the regex's exec method, but first creates
2288 // a new one. We need to return the patched regex when creating the new one.
2289 re.constructor = {};
2290 re.constructor[SPECIES$3] = function () { return re; };
2291 re.flags = '';
2292 re[SYMBOL] = /./[SYMBOL];
2293 }
2294
2295 re.exec = function () { execCalled = true; return null; };
2296
2297 re[SYMBOL]('');
2298 return !execCalled;
2299 });
2300
2301 if (
2302 !DELEGATES_TO_SYMBOL ||
2303 !DELEGATES_TO_EXEC ||
2304 (KEY === 'replace' && !(REPLACE_SUPPORTS_NAMED_GROUPS && REPLACE_KEEPS_$0)) ||
2305 (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
2306 ) {
2307 var nativeRegExpMethod = /./[SYMBOL];
2308 var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
2309 if (regexp.exec === regexpExec) {
2310 if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
2311 // The native String method already delegates to @@method (this
2312 // polyfilled function), leasing to infinite recursion.
2313 // We avoid it by directly calling the native @@method method.
2314 return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
2315 }
2316 return { done: true, value: nativeMethod.call(str, regexp, arg2) };
2317 }
2318 return { done: false };
2319 }, { REPLACE_KEEPS_$0: REPLACE_KEEPS_$0 });
2320 var stringMethod = methods[0];
2321 var regexMethod = methods[1];
2322
2323 redefine(String.prototype, KEY, stringMethod);
2324 redefine(RegExp.prototype, SYMBOL, length == 2
2325 // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
2326 // 21.2.5.11 RegExp.prototype[@@split](string, limit)
2327 ? function (string, arg) { return regexMethod.call(string, this, arg); }
2328 // 21.2.5.6 RegExp.prototype[@@match](string)
2329 // 21.2.5.9 RegExp.prototype[@@search](string)
2330 : function (string) { return regexMethod.call(string, this); }
2331 );
2332 }
2333
2334 if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
2335 };
2336
2337 var charAt$1 = stringMultibyte.charAt;
2338
2339 // `AdvanceStringIndex` abstract operation
2340 // https://tc39.github.io/ecma262/#sec-advancestringindex
2341 var advanceStringIndex = function (S, index, unicode) {
2342 return index + (unicode ? charAt$1(S, index).length : 1);
2343 };
2344
2345 // `RegExpExec` abstract operation
2346 // https://tc39.github.io/ecma262/#sec-regexpexec
2347 var regexpExecAbstract = function (R, S) {
2348 var exec = R.exec;
2349 if (typeof exec === 'function') {
2350 var result = exec.call(R, S);
2351 if (typeof result !== 'object') {
2352 throw TypeError('RegExp exec method returned something other than an Object or null');
2353 }
2354 return result;
2355 }
2356
2357 if (classofRaw(R) !== 'RegExp') {
2358 throw TypeError('RegExp#exec called on incompatible receiver');
2359 }
2360
2361 return regexpExec.call(R, S);
2362 };
2363
2364 var max$3 = Math.max;
2365 var min$3 = Math.min;
2366 var floor$1 = Math.floor;
2367 var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
2368 var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
2369
2370 var maybeToString = function (it) {
2371 return it === undefined ? it : String(it);
2372 };
2373
2374 // @@replace logic
2375 fixRegexpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
2376 return [
2377 // `String.prototype.replace` method
2378 // https://tc39.github.io/ecma262/#sec-string.prototype.replace
2379 function replace(searchValue, replaceValue) {
2380 var O = requireObjectCoercible(this);
2381 var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
2382 return replacer !== undefined
2383 ? replacer.call(searchValue, O, replaceValue)
2384 : nativeReplace.call(String(O), searchValue, replaceValue);
2385 },
2386 // `RegExp.prototype[@@replace]` method
2387 // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
2388 function (regexp, replaceValue) {
2389 if (reason.REPLACE_KEEPS_$0 || (typeof replaceValue === 'string' && replaceValue.indexOf('$0') === -1)) {
2390 var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
2391 if (res.done) return res.value;
2392 }
2393
2394 var rx = anObject(regexp);
2395 var S = String(this);
2396
2397 var functionalReplace = typeof replaceValue === 'function';
2398 if (!functionalReplace) replaceValue = String(replaceValue);
2399
2400 var global = rx.global;
2401 if (global) {
2402 var fullUnicode = rx.unicode;
2403 rx.lastIndex = 0;
2404 }
2405 var results = [];
2406 while (true) {
2407 var result = regexpExecAbstract(rx, S);
2408 if (result === null) break;
2409
2410 results.push(result);
2411 if (!global) break;
2412
2413 var matchStr = String(result[0]);
2414 if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
2415 }
2416
2417 var accumulatedResult = '';
2418 var nextSourcePosition = 0;
2419 for (var i = 0; i < results.length; i++) {
2420 result = results[i];
2421
2422 var matched = String(result[0]);
2423 var position = max$3(min$3(toInteger(result.index), S.length), 0);
2424 var captures = [];
2425 // NOTE: This is equivalent to
2426 // captures = result.slice(1).map(maybeToString)
2427 // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
2428 // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
2429 // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
2430 for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
2431 var namedCaptures = result.groups;
2432 if (functionalReplace) {
2433 var replacerArgs = [matched].concat(captures, position, S);
2434 if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
2435 var replacement = String(replaceValue.apply(undefined, replacerArgs));
2436 } else {
2437 replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
2438 }
2439 if (position >= nextSourcePosition) {
2440 accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
2441 nextSourcePosition = position + matched.length;
2442 }
2443 }
2444 return accumulatedResult + S.slice(nextSourcePosition);
2445 }
2446 ];
2447
2448 // https://tc39.github.io/ecma262/#sec-getsubstitution
2449 function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
2450 var tailPos = position + matched.length;
2451 var m = captures.length;
2452 var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
2453 if (namedCaptures !== undefined) {
2454 namedCaptures = toObject(namedCaptures);
2455 symbols = SUBSTITUTION_SYMBOLS;
2456 }
2457 return nativeReplace.call(replacement, symbols, function (match, ch) {
2458 var capture;
2459 switch (ch.charAt(0)) {
2460 case '$': return '$';
2461 case '&': return matched;
2462 case '`': return str.slice(0, position);
2463 case "'": return str.slice(tailPos);
2464 case '<':
2465 capture = namedCaptures[ch.slice(1, -1)];
2466 break;
2467 default: // \d\d?
2468 var n = +ch;
2469 if (n === 0) return match;
2470 if (n > m) {
2471 var f = floor$1(n / 10);
2472 if (f === 0) return match;
2473 if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
2474 return match;
2475 }
2476 capture = captures[n - 1];
2477 }
2478 return capture === undefined ? '' : capture;
2479 });
2480 }
2481 });
2482
2483 // `SameValue` abstract operation
2484 // https://tc39.github.io/ecma262/#sec-samevalue
2485 var sameValue = Object.is || function is(x, y) {
2486 // eslint-disable-next-line no-self-compare
2487 return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
2488 };
2489
2490 // @@search logic
2491 fixRegexpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
2492 return [
2493 // `String.prototype.search` method
2494 // https://tc39.github.io/ecma262/#sec-string.prototype.search
2495 function search(regexp) {
2496 var O = requireObjectCoercible(this);
2497 var searcher = regexp == undefined ? undefined : regexp[SEARCH];
2498 return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
2499 },
2500 // `RegExp.prototype[@@search]` method
2501 // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
2502 function (regexp) {
2503 var res = maybeCallNative(nativeSearch, regexp, this);
2504 if (res.done) return res.value;
2505
2506 var rx = anObject(regexp);
2507 var S = String(this);
2508
2509 var previousLastIndex = rx.lastIndex;
2510 if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
2511 var result = regexpExecAbstract(rx, S);
2512 if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
2513 return result === null ? -1 : result.index;
2514 }
2515 ];
2516 });
2517
2518 var SPECIES$4 = wellKnownSymbol('species');
2519
2520 // `SpeciesConstructor` abstract operation
2521 // https://tc39.github.io/ecma262/#sec-speciesconstructor
2522 var speciesConstructor = function (O, defaultConstructor) {
2523 var C = anObject(O).constructor;
2524 var S;
2525 return C === undefined || (S = anObject(C)[SPECIES$4]) == undefined ? defaultConstructor : aFunction$1(S);
2526 };
2527
2528 var arrayPush = [].push;
2529 var min$4 = Math.min;
2530 var MAX_UINT32 = 0xFFFFFFFF;
2531
2532 // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
2533 var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
2534
2535 // @@split logic
2536 fixRegexpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
2537 var internalSplit;
2538 if (
2539 'abbc'.split(/(b)*/)[1] == 'c' ||
2540 'test'.split(/(?:)/, -1).length != 4 ||
2541 'ab'.split(/(?:ab)*/).length != 2 ||
2542 '.'.split(/(.?)(.?)/).length != 4 ||
2543 '.'.split(/()()/).length > 1 ||
2544 ''.split(/.?/).length
2545 ) {
2546 // based on es5-shim implementation, need to rework it
2547 internalSplit = function (separator, limit) {
2548 var string = String(requireObjectCoercible(this));
2549 var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
2550 if (lim === 0) return [];
2551 if (separator === undefined) return [string];
2552 // If `separator` is not a regex, use native split
2553 if (!isRegexp(separator)) {
2554 return nativeSplit.call(string, separator, lim);
2555 }
2556 var output = [];
2557 var flags = (separator.ignoreCase ? 'i' : '') +
2558 (separator.multiline ? 'm' : '') +
2559 (separator.unicode ? 'u' : '') +
2560 (separator.sticky ? 'y' : '');
2561 var lastLastIndex = 0;
2562 // Make `global` and avoid `lastIndex` issues by working with a copy
2563 var separatorCopy = new RegExp(separator.source, flags + 'g');
2564 var match, lastIndex, lastLength;
2565 while (match = regexpExec.call(separatorCopy, string)) {
2566 lastIndex = separatorCopy.lastIndex;
2567 if (lastIndex > lastLastIndex) {
2568 output.push(string.slice(lastLastIndex, match.index));
2569 if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
2570 lastLength = match[0].length;
2571 lastLastIndex = lastIndex;
2572 if (output.length >= lim) break;
2573 }
2574 if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
2575 }
2576 if (lastLastIndex === string.length) {
2577 if (lastLength || !separatorCopy.test('')) output.push('');
2578 } else output.push(string.slice(lastLastIndex));
2579 return output.length > lim ? output.slice(0, lim) : output;
2580 };
2581 // Chakra, V8
2582 } else if ('0'.split(undefined, 0).length) {
2583 internalSplit = function (separator, limit) {
2584 return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
2585 };
2586 } else internalSplit = nativeSplit;
2587
2588 return [
2589 // `String.prototype.split` method
2590 // https://tc39.github.io/ecma262/#sec-string.prototype.split
2591 function split(separator, limit) {
2592 var O = requireObjectCoercible(this);
2593 var splitter = separator == undefined ? undefined : separator[SPLIT];
2594 return splitter !== undefined
2595 ? splitter.call(separator, O, limit)
2596 : internalSplit.call(String(O), separator, limit);
2597 },
2598 // `RegExp.prototype[@@split]` method
2599 // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
2600 //
2601 // NOTE: This cannot be properly polyfilled in engines that don't support
2602 // the 'y' flag.
2603 function (regexp, limit) {
2604 var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
2605 if (res.done) return res.value;
2606
2607 var rx = anObject(regexp);
2608 var S = String(this);
2609 var C = speciesConstructor(rx, RegExp);
2610
2611 var unicodeMatching = rx.unicode;
2612 var flags = (rx.ignoreCase ? 'i' : '') +
2613 (rx.multiline ? 'm' : '') +
2614 (rx.unicode ? 'u' : '') +
2615 (SUPPORTS_Y ? 'y' : 'g');
2616
2617 // ^(? + rx + ) is needed, in combination with some S slicing, to
2618 // simulate the 'y' flag.
2619 var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
2620 var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
2621 if (lim === 0) return [];
2622 if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];
2623 var p = 0;
2624 var q = 0;
2625 var A = [];
2626 while (q < S.length) {
2627 splitter.lastIndex = SUPPORTS_Y ? q : 0;
2628 var z = regexpExecAbstract(splitter, SUPPORTS_Y ? S : S.slice(q));
2629 var e;
2630 if (
2631 z === null ||
2632 (e = min$4(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
2633 ) {
2634 q = advanceStringIndex(S, q, unicodeMatching);
2635 } else {
2636 A.push(S.slice(p, q));
2637 if (A.length === lim) return A;
2638 for (var i = 1; i <= z.length - 1; i++) {
2639 A.push(z[i]);
2640 if (A.length === lim) return A;
2641 }
2642 q = p = e;
2643 }
2644 }
2645 A.push(S.slice(p));
2646 return A;
2647 }
2648 ];
2649 }, !SUPPORTS_Y);
2650
2651 var non = '\u200B\u0085\u180E';
2652
2653 // check that a method works with the correct list
2654 // of whitespaces and has a correct name
2655 var forcedStringTrimMethod = function (METHOD_NAME) {
2656 return fails(function () {
2657 return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
2658 });
2659 };
2660
2661 var $trim = stringTrim.trim;
2662
2663
2664 // `String.prototype.trim` method
2665 // https://tc39.github.io/ecma262/#sec-string.prototype.trim
2666 _export({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
2667 trim: function trim() {
2668 return $trim(this);
2669 }
2670 });
2671
2672 // iterable DOM collections
2673 // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
2674 var domIterables = {
2675 CSSRuleList: 0,
2676 CSSStyleDeclaration: 0,
2677 CSSValueList: 0,
2678 ClientRectList: 0,
2679 DOMRectList: 0,
2680 DOMStringList: 0,
2681 DOMTokenList: 1,
2682 DataTransferItemList: 0,
2683 FileList: 0,
2684 HTMLAllCollection: 0,
2685 HTMLCollection: 0,
2686 HTMLFormElement: 0,
2687 HTMLSelectElement: 0,
2688 MediaList: 0,
2689 MimeTypeArray: 0,
2690 NamedNodeMap: 0,
2691 NodeList: 1,
2692 PaintRequestList: 0,
2693 Plugin: 0,
2694 PluginArray: 0,
2695 SVGLengthList: 0,
2696 SVGNumberList: 0,
2697 SVGPathSegList: 0,
2698 SVGPointList: 0,
2699 SVGStringList: 0,
2700 SVGTransformList: 0,
2701 SourceBufferList: 0,
2702 StyleSheetList: 0,
2703 TextTrackCueList: 0,
2704 TextTrackList: 0,
2705 TouchList: 0
2706 };
2707
2708 var $forEach$1 = arrayIteration.forEach;
2709
2710
2711 // `Array.prototype.forEach` method implementation
2712 // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
2713 var arrayForEach = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) {
2714 return $forEach$1(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
2715 } : [].forEach;
2716
2717 for (var COLLECTION_NAME in domIterables) {
2718 var Collection = global_1[COLLECTION_NAME];
2719 var CollectionPrototype = Collection && Collection.prototype;
2720 // some Chrome versions have non-configurable methods on DOMTokenList
2721 if (CollectionPrototype && CollectionPrototype.forEach !== arrayForEach) try {
2722 createNonEnumerableProperty(CollectionPrototype, 'forEach', arrayForEach);
2723 } catch (error) {
2724 CollectionPrototype.forEach = arrayForEach;
2725 }
2726 }
2727
2728 var ITERATOR$2 = wellKnownSymbol('iterator');
2729 var TO_STRING_TAG$3 = wellKnownSymbol('toStringTag');
2730 var ArrayValues = es_array_iterator.values;
2731
2732 for (var COLLECTION_NAME$1 in domIterables) {
2733 var Collection$1 = global_1[COLLECTION_NAME$1];
2734 var CollectionPrototype$1 = Collection$1 && Collection$1.prototype;
2735 if (CollectionPrototype$1) {
2736 // some Chrome versions have non-configurable methods on DOMTokenList
2737 if (CollectionPrototype$1[ITERATOR$2] !== ArrayValues) try {
2738 createNonEnumerableProperty(CollectionPrototype$1, ITERATOR$2, ArrayValues);
2739 } catch (error) {
2740 CollectionPrototype$1[ITERATOR$2] = ArrayValues;
2741 }
2742 if (!CollectionPrototype$1[TO_STRING_TAG$3]) {
2743 createNonEnumerableProperty(CollectionPrototype$1, TO_STRING_TAG$3, COLLECTION_NAME$1);
2744 }
2745 if (domIterables[COLLECTION_NAME$1]) for (var METHOD_NAME in es_array_iterator) {
2746 // some Chrome versions have non-configurable methods on DOMTokenList
2747 if (CollectionPrototype$1[METHOD_NAME] !== es_array_iterator[METHOD_NAME]) try {
2748 createNonEnumerableProperty(CollectionPrototype$1, METHOD_NAME, es_array_iterator[METHOD_NAME]);
2749 } catch (error) {
2750 CollectionPrototype$1[METHOD_NAME] = es_array_iterator[METHOD_NAME];
2751 }
2752 }
2753 }
2754 }
2755
2756 function _typeof(obj) {
2757 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
2758 _typeof = function (obj) {
2759 return typeof obj;
2760 };
2761 } else {
2762 _typeof = function (obj) {
2763 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
2764 };
2765 }
2766
2767 return _typeof(obj);
2768 }
2769
2770 function _classCallCheck(instance, Constructor) {
2771 if (!(instance instanceof Constructor)) {
2772 throw new TypeError("Cannot call a class as a function");
2773 }
2774 }
2775
2776 function _defineProperties(target, props) {
2777 for (var i = 0; i < props.length; i++) {
2778 var descriptor = props[i];
2779 descriptor.enumerable = descriptor.enumerable || false;
2780 descriptor.configurable = true;
2781 if ("value" in descriptor) descriptor.writable = true;
2782 Object.defineProperty(target, descriptor.key, descriptor);
2783 }
2784 }
2785
2786 function _createClass(Constructor, protoProps, staticProps) {
2787 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
2788 if (staticProps) _defineProperties(Constructor, staticProps);
2789 return Constructor;
2790 }
2791
2792 function _slicedToArray(arr, i) {
2793 return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
2794 }
2795
2796 function _toConsumableArray(arr) {
2797 return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
2798 }
2799
2800 function _arrayWithoutHoles(arr) {
2801 if (Array.isArray(arr)) {
2802 for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
2803
2804 return arr2;
2805 }
2806 }
2807
2808 function _arrayWithHoles(arr) {
2809 if (Array.isArray(arr)) return arr;
2810 }
2811
2812 function _iterableToArray(iter) {
2813 if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
2814 }
2815
2816 function _iterableToArrayLimit(arr, i) {
2817 if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
2818 return;
2819 }
2820
2821 var _arr = [];
2822 var _n = true;
2823 var _d = false;
2824 var _e = undefined;
2825
2826 try {
2827 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
2828 _arr.push(_s.value);
2829
2830 if (i && _arr.length === i) break;
2831 }
2832 } catch (err) {
2833 _d = true;
2834 _e = err;
2835 } finally {
2836 try {
2837 if (!_n && _i["return"] != null) _i["return"]();
2838 } finally {
2839 if (_d) throw _e;
2840 }
2841 }
2842
2843 return _arr;
2844 }
2845
2846 function _nonIterableSpread() {
2847 throw new TypeError("Invalid attempt to spread non-iterable instance");
2848 }
2849
2850 function _nonIterableRest() {
2851 throw new TypeError("Invalid attempt to destructure non-iterable instance");
2852 }
2853
2854 var VERSION = '1.16.0';
2855 var bootstrapVersion = 4;
2856
2857 try {
2858 var rawVersion = $.fn.dropdown.Constructor.VERSION; // Only try to parse VERSION if it is defined.
2859 // It is undefined in older versions of Bootstrap (tested with 3.1.1).
2860
2861 if (rawVersion !== undefined) {
2862 bootstrapVersion = parseInt(rawVersion, 10);
2863 }
2864 } catch (e) {// ignore
2865 }
2866
2867 var CONSTANTS = {
2868 3: {
2869 iconsPrefix: 'glyphicon',
2870 icons: {
2871 paginationSwitchDown: 'glyphicon-collapse-down icon-chevron-down',
2872 paginationSwitchUp: 'glyphicon-collapse-up icon-chevron-up',
2873 refresh: 'glyphicon-refresh icon-refresh',
2874 toggleOff: 'glyphicon-list-alt icon-list-alt',
2875 toggleOn: 'glyphicon-list-alt icon-list-alt',
2876 columns: 'glyphicon-th icon-th',
2877 detailOpen: 'glyphicon-plus icon-plus',
2878 detailClose: 'glyphicon-minus icon-minus',
2879 fullscreen: 'glyphicon-fullscreen',
2880 search: 'glyphicon-search',
2881 clearSearch: 'glyphicon-trash'
2882 },
2883 classes: {
2884 buttonsPrefix: 'btn',
2885 buttons: 'default',
2886 buttonsGroup: 'btn-group',
2887 buttonsDropdown: 'btn-group',
2888 pull: 'pull',
2889 inputGroup: 'input-group',
2890 inputPrefix: 'input-',
2891 input: 'form-control',
2892 paginationDropdown: 'btn-group dropdown',
2893 dropup: 'dropup',
2894 dropdownActive: 'active',
2895 paginationActive: 'active',
2896 buttonActive: 'active'
2897 },
2898 html: {
2899 toolbarDropdown: ['<ul class="dropdown-menu" role="menu">', '</ul>'],
2900 toolbarDropdownItem: '<li class="dropdown-item-marker" role="menuitem"><label>%s</label></li>',
2901 toolbarDropdownSeparator: '<li class="divider"></li>',
2902 pageDropdown: ['<ul class="dropdown-menu" role="menu">', '</ul>'],
2903 pageDropdownItem: '<li role="menuitem" class="%s"><a href="#">%s</a></li>',
2904 dropdownCaret: '<span class="caret"></span>',
2905 pagination: ['<ul class="pagination%s">', '</ul>'],
2906 paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
2907 icon: '<i class="%s %s"></i>',
2908 inputGroup: '<div class="input-group">%s<span class="input-group-btn">%s</span></div>',
2909 searchInput: '<input class="%s%s" type="text" placeholder="%s">',
2910 searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
2911 searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
2912 }
2913 },
2914 4: {
2915 iconsPrefix: 'mdi',
2916 icons: {
2917 paginationSwitchDown: 'mdi-arrow-down-drop-circle-outline',
2918 paginationSwitchUp: 'mdi-arrow-up-drop-circle-outline',
2919 refresh: 'mdi-refresh',
2920 toggleOff: 'mdi-playlist-check',
2921 toggleOn: 'mdi-playlist-remove',
2922 columns: 'mdi-table-column-remove',
2923 detailOpen: 'mdi-plus',
2924 detailClose: 'mdi-minus',
2925 fullscreen: 'mdi-fullscreen',
2926 search: 'mdi-table-search',
2927 clearSearch: 'mdi-trash-can-outline'
2928 },
2929 classes: {
2930 buttonsPrefix: 'btn',
2931 buttons: 'default',
2932 buttonsGroup: 'btn-group',
2933 buttonsDropdown: 'btn-group',
2934 pull: 'float',
2935 inputGroup: 'btn-group',
2936 inputPrefix: 'form-control-',
2937 input: 'form-control',
2938 paginationDropdown: 'btn-group dropdown',
2939 dropup: 'dropup',
2940 dropdownActive: 'active',
2941 paginationActive: 'active',
2942 buttonActive: 'active'
2943 },
2944 html: {
2945 toolbarDropdown: ['<div class="dropdown-menu dropdown-menu-right">', '</div>'],
2946 toolbarDropdownItem: '<div class="dropdown-item dropdown-item-marker">%s</div>',
2947 pageDropdown: ['<div class="dropdown-menu">', '</div>'],
2948 pageDropdownItem: '<a class="dropdown-item %s" href="#">%s</a>',
2949 toolbarDropdownSeparator: '<div class="dropdown-divider"></div>',
2950 dropdownCaret: '<span class="caret"></span>',
2951 pagination: ['<ul class="pagination%s">', '</ul>'],
2952 paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
2953 icon: '<i class="%s %s"></i>',
2954 inputGroup: '<div class="input-group">%s<div class="input-group-append">%s</div></div>',
2955 searchInput: '<input class="%s%s" type="text" placeholder="%s">',
2956 searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
2957 searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
2958 }
2959 }
2960 }[bootstrapVersion];
2961 var DEFAULTS = {
2962 height: undefined,
2963 classes: 'table table-bordered table-hover',
2964 theadClasses: '',
2965 headerStyle: function headerStyle(column) {
2966 return {};
2967 },
2968 rowStyle: function rowStyle(row, index) {
2969 return {};
2970 },
2971 rowAttributes: function rowAttributes(row, index) {
2972 return {};
2973 },
2974 undefinedText: '-',
2975 locale: undefined,
2976 virtualScroll: false,
2977 virtualScrollItemHeight: undefined,
2978 sortable: true,
2979 sortClass: undefined,
2980 silentSort: true,
2981 sortName: undefined,
2982 sortOrder: 'asc',
2983 sortStable: false,
2984 rememberOrder: false,
2985 serverSort: true,
2986 customSort: undefined,
2987 columns: [[]],
2988 data: [],
2989 url: undefined,
2990 method: 'get',
2991 cache: true,
2992 contentType: 'application/json',
2993 dataType: 'json',
2994 ajax: undefined,
2995 ajaxOptions: {},
2996 queryParams: function queryParams(params) {
2997 return params;
2998 },
2999 queryParamsType: 'limit',
3000 // 'limit', undefined
3001 responseHandler: function responseHandler(res) {
3002 return res;
3003 },
3004 totalField: 'total',
3005 totalNotFilteredField: 'totalNotFiltered',
3006 dataField: 'rows',
3007 pagination: false,
3008 onlyInfoPagination: false,
3009 showExtendedPagination: false,
3010 paginationLoop: true,
3011 sidePagination: 'client',
3012 // client or server
3013 totalRows: 0,
3014 totalNotFiltered: 0,
3015 pageNumber: 1,
3016 pageSize: 10,
3017 pageList: [10, 25, 50, 100],
3018 paginationHAlign: 'right',
3019 // right, left
3020 paginationVAlign: 'bottom',
3021 // bottom, top, both
3022 paginationDetailHAlign: 'left',
3023 // right, left
3024 paginationPreText: '&lsaquo;',
3025 paginationNextText: '&rsaquo;',
3026 paginationSuccessivelySize: 5,
3027 // Maximum successively number of pages in a row
3028 paginationPagesBySide: 1,
3029 // Number of pages on each side (right, left) of the current page.
3030 paginationUseIntermediate: false,
3031 // Calculate intermediate pages for quick access
3032 search: false,
3033 searchOnEnterKey: false,
3034 strictSearch: false,
3035 visibleSearch: false,
3036 showButtonIcons: true,
3037 showButtonText: false,
3038 showSearchButton: false,
3039 showSearchClearButton: false,
3040 trimOnSearch: true,
3041 searchAlign: 'right',
3042 searchTimeOut: 500,
3043 searchText: '',
3044 customSearch: undefined,
3045 showHeader: true,
3046 showFooter: false,
3047 footerStyle: function footerStyle(column) {
3048 return {};
3049 },
3050 showColumns: false,
3051 showColumnsToggleAll: false,
3052 showColumnsSearch: false,
3053 minimumCountColumns: 1,
3054 showPaginationSwitch: false,
3055 showRefresh: false,
3056 showToggle: false,
3057 showFullscreen: false,
3058 smartDisplay: true,
3059 escape: false,
3060 filterOptions: {
3061 filterAlgorithm: 'and'
3062 },
3063 idField: undefined,
3064 selectItemName: 'btSelectItem',
3065 clickToSelect: false,
3066 ignoreClickToSelectOn: function ignoreClickToSelectOn(_ref) {
3067 var tagName = _ref.tagName;
3068 return ['A', 'BUTTON'].includes(tagName);
3069 },
3070 singleSelect: false,
3071 checkboxHeader: true,
3072 maintainMetaData: false,
3073 multipleSelectRow: false,
3074 uniqueId: undefined,
3075 cardView: false,
3076 detailView: false,
3077 detailViewIcon: true,
3078 detailViewByClick: false,
3079 detailFormatter: function detailFormatter(index, row) {
3080 return '';
3081 },
3082 detailFilter: function detailFilter(index, row) {
3083 return true;
3084 },
3085 toolbar: undefined,
3086 toolbarAlign: 'left',
3087 buttonsToolbar: undefined,
3088 buttonsAlign: 'right',
3089 buttonsOrder: ['paginationSwitch', 'refresh', 'toggle', 'fullscreen', 'columns'],
3090 buttonsPrefix: CONSTANTS.classes.buttonsPrefix,
3091 buttonsClass: CONSTANTS.classes.buttons,
3092 icons: CONSTANTS.icons,
3093 html: CONSTANTS.html,
3094 iconSize: undefined,
3095 iconsPrefix: CONSTANTS.iconsPrefix,
3096 // glyphicon or fa(font-awesome)
3097 onAll: function onAll(name, args) {
3098 return false;
3099 },
3100 onClickCell: function onClickCell(field, value, row, $element) {
3101 return false;
3102 },
3103 onDblClickCell: function onDblClickCell(field, value, row, $element) {
3104 return false;
3105 },
3106 onClickRow: function onClickRow(item, $element) {
3107 return false;
3108 },
3109 onDblClickRow: function onDblClickRow(item, $element) {
3110 return false;
3111 },
3112 onSort: function onSort(name, order) {
3113 return false;
3114 },
3115 onCheck: function onCheck(row) {
3116 return false;
3117 },
3118 onUncheck: function onUncheck(row) {
3119 return false;
3120 },
3121 onCheckAll: function onCheckAll(rows) {
3122 return false;
3123 },
3124 onUncheckAll: function onUncheckAll(rows) {
3125 return false;
3126 },
3127 onCheckSome: function onCheckSome(rows) {
3128 return false;
3129 },
3130 onUncheckSome: function onUncheckSome(rows) {
3131 return false;
3132 },
3133 onLoadSuccess: function onLoadSuccess(data) {
3134 return false;
3135 },
3136 onLoadError: function onLoadError(status) {
3137 return false;
3138 },
3139 onColumnSwitch: function onColumnSwitch(field, checked) {
3140 return false;
3141 },
3142 onPageChange: function onPageChange(number, size) {
3143 return false;
3144 },
3145 onSearch: function onSearch(text) {
3146 return false;
3147 },
3148 onToggle: function onToggle(cardView) {
3149 return false;
3150 },
3151 onPreBody: function onPreBody(data) {
3152 return false;
3153 },
3154 onPostBody: function onPostBody() {
3155 return false;
3156 },
3157 onPostHeader: function onPostHeader() {
3158 return false;
3159 },
3160 onPostFooter: function onPostFooter() {
3161 return false;
3162 },
3163 onExpandRow: function onExpandRow(index, row, $detail) {
3164 return false;
3165 },
3166 onCollapseRow: function onCollapseRow(index, row) {
3167 return false;
3168 },
3169 onRefreshOptions: function onRefreshOptions(options) {
3170 return false;
3171 },
3172 onRefresh: function onRefresh(params) {
3173 return false;
3174 },
3175 onResetView: function onResetView() {
3176 return false;
3177 },
3178 onScrollBody: function onScrollBody() {
3179 return false;
3180 }
3181 };
3182 var EN = {
3183 formatLoadingMessage: function formatLoadingMessage() {
3184 return 'Loading, please wait';
3185 },
3186 formatRecordsPerPage: function formatRecordsPerPage(pageNumber) {
3187 return "".concat(pageNumber, " rows per page");
3188 },
3189 formatShowingRows: function formatShowingRows(pageFrom, pageTo, totalRows, totalNotFiltered) {
3190 if (totalNotFiltered !== undefined && totalNotFiltered > 0 && totalNotFiltered > totalRows) {
3191 return "Showing ".concat(pageFrom, " to ").concat(pageTo, " of ").concat(totalRows, " rows (filtered from ").concat(totalNotFiltered, " total rows)");
3192 }
3193
3194 return "Showing ".concat(pageFrom, " to ").concat(pageTo, " of ").concat(totalRows, " rows");
3195 },
3196 formatSRPaginationPreText: function formatSRPaginationPreText() {
3197 return 'previous page';
3198 },
3199 formatSRPaginationPageText: function formatSRPaginationPageText(page) {
3200 return "to page ".concat(page);
3201 },
3202 formatSRPaginationNextText: function formatSRPaginationNextText() {
3203 return 'next page';
3204 },
3205 formatDetailPagination: function formatDetailPagination(totalRows) {
3206 return "Showing ".concat(totalRows, " rows");
3207 },
3208 formatSearch: function formatSearch() {
3209 return 'Search';
3210 },
3211 formatClearSearch: function formatClearSearch() {
3212 return 'Clear Search';
3213 },
3214 formatNoMatches: function formatNoMatches() {
3215 return 'No matching records found';
3216 },
3217 formatPaginationSwitch: function formatPaginationSwitch() {
3218 return 'Hide/Show pagination';
3219 },
3220 formatPaginationSwitchDown: function formatPaginationSwitchDown() {
3221 return 'Show pagination';
3222 },
3223 formatPaginationSwitchUp: function formatPaginationSwitchUp() {
3224 return 'Hide pagination';
3225 },
3226 formatRefresh: function formatRefresh() {
3227 return 'Refresh';
3228 },
3229 formatToggle: function formatToggle() {
3230 return 'Toggle';
3231 },
3232 formatToggleOn: function formatToggleOn() {
3233 return 'Show card view';
3234 },
3235 formatToggleOff: function formatToggleOff() {
3236 return 'Hide card view';
3237 },
3238 formatColumns: function formatColumns() {
3239 return 'Columns';
3240 },
3241 formatColumnsToggleAll: function formatColumnsToggleAll() {
3242 return 'Toggle all';
3243 },
3244 formatFullscreen: function formatFullscreen() {
3245 return 'Fullscreen';
3246 },
3247 formatAllRows: function formatAllRows() {
3248 return 'All';
3249 }
3250 };
3251 var COLUMN_DEFAULTS = {
3252 field: undefined,
3253 title: undefined,
3254 titleTooltip: undefined,
3255 'class': undefined,
3256 width: undefined,
3257 widthUnit: 'px',
3258 rowspan: undefined,
3259 colspan: undefined,
3260 align: undefined,
3261 // left, right, center
3262 halign: undefined,
3263 // left, right, center
3264 falign: undefined,
3265 // left, right, center
3266 valign: undefined,
3267 // top, middle, bottom
3268 cellStyle: undefined,
3269 radio: false,
3270 checkbox: false,
3271 checkboxEnabled: true,
3272 clickToSelect: true,
3273 showSelectTitle: false,
3274 sortable: false,
3275 sortName: undefined,
3276 order: 'asc',
3277 // asc, desc
3278 sorter: undefined,
3279 visible: true,
3280 switchable: true,
3281 cardVisible: true,
3282 searchable: true,
3283 formatter: undefined,
3284 footerFormatter: undefined,
3285 detailFormatter: undefined,
3286 searchFormatter: true,
3287 escape: false,
3288 events: undefined
3289 };
3290 var METHODS = ['getOptions', 'refreshOptions', 'getData', 'getSelections', 'getAllSelections', 'load', 'append', 'prepend', 'remove', 'removeAll', 'insertRow', 'updateRow', 'getRowByUniqueId', 'updateByUniqueId', 'removeByUniqueId', 'updateCell', 'updateCellByUniqueId', 'showRow', 'hideRow', 'getHiddenRows', 'showColumn', 'hideColumn', 'getVisibleColumns', 'getHiddenColumns', 'showAllColumns', 'hideAllColumns', 'mergeCells', 'checkAll', 'uncheckAll', 'checkInvert', 'check', 'uncheck', 'checkBy', 'uncheckBy', 'refresh', 'destroy', 'resetView', 'showLoading', 'hideLoading', 'togglePagination', 'toggleFullscreen', 'toggleView', 'resetSearch', 'filterBy', 'scrollTo', 'getScrollPosition', 'selectPage', 'prevPage', 'nextPage', 'toggleDetailView', 'expandRow', 'collapseRow', 'expandAllRows', 'collapseAllRows', 'updateColumnTitle', 'updateFormatText'];
3291 var EVENTS = {
3292 'all.bs.table': 'onAll',
3293 'click-row.bs.table': 'onClickRow',
3294 'dbl-click-row.bs.table': 'onDblClickRow',
3295 'click-cell.bs.table': 'onClickCell',
3296 'dbl-click-cell.bs.table': 'onDblClickCell',
3297 'sort.bs.table': 'onSort',
3298 'check.bs.table': 'onCheck',
3299 'uncheck.bs.table': 'onUncheck',
3300 'check-all.bs.table': 'onCheckAll',
3301 'uncheck-all.bs.table': 'onUncheckAll',
3302 'check-some.bs.table': 'onCheckSome',
3303 'uncheck-some.bs.table': 'onUncheckSome',
3304 'load-success.bs.table': 'onLoadSuccess',
3305 'load-error.bs.table': 'onLoadError',
3306 'column-switch.bs.table': 'onColumnSwitch',
3307 'page-change.bs.table': 'onPageChange',
3308 'search.bs.table': 'onSearch',
3309 'toggle.bs.table': 'onToggle',
3310 'pre-body.bs.table': 'onPreBody',
3311 'post-body.bs.table': 'onPostBody',
3312 'post-header.bs.table': 'onPostHeader',
3313 'post-footer.bs.table': 'onPostFooter',
3314 'expand-row.bs.table': 'onExpandRow',
3315 'collapse-row.bs.table': 'onCollapseRow',
3316 'refresh-options.bs.table': 'onRefreshOptions',
3317 'reset-view.bs.table': 'onResetView',
3318 'refresh.bs.table': 'onRefresh',
3319 'scroll-body.bs.table': 'onScrollBody'
3320 };
3321 Object.assign(DEFAULTS, EN);
3322 var Constants = {
3323 VERSION: VERSION,
3324 THEME: "bootstrap".concat(bootstrapVersion),
3325 CONSTANTS: CONSTANTS,
3326 DEFAULTS: DEFAULTS,
3327 COLUMN_DEFAULTS: COLUMN_DEFAULTS,
3328 METHODS: METHODS,
3329 EVENTS: EVENTS,
3330 LOCALES: {
3331 en: EN,
3332 'en-US': EN
3333 }
3334 };
3335
3336 var FAILS_ON_PRIMITIVES = fails(function () { objectKeys(1); });
3337
3338 // `Object.keys` method
3339 // https://tc39.github.io/ecma262/#sec-object.keys
3340 _export({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
3341 keys: function keys(it) {
3342 return objectKeys(toObject(it));
3343 }
3344 });
3345
3346 var Utils = {
3347 // it only does '%s', and return '' when arguments are undefined
3348 sprintf: function sprintf(_str) {
3349 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
3350 args[_key - 1] = arguments[_key];
3351 }
3352
3353 var flag = true;
3354 var i = 0;
3355
3356 var str = _str.replace(/%s/g, function () {
3357 var arg = args[i++];
3358
3359 if (typeof arg === 'undefined') {
3360 flag = false;
3361 return '';
3362 }
3363
3364 return arg;
3365 });
3366
3367 return flag ? str : '';
3368 },
3369 isEmptyObject: function isEmptyObject() {
3370 var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3371 return Object.entries(obj).length === 0 && obj.constructor === Object;
3372 },
3373 isNumeric: function isNumeric(n) {
3374 return !isNaN(parseFloat(n)) && isFinite(n);
3375 },
3376 getFieldTitle: function getFieldTitle(list, value) {
3377 var _iteratorNormalCompletion = true;
3378 var _didIteratorError = false;
3379 var _iteratorError = undefined;
3380
3381 try {
3382 for (var _iterator = list[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
3383 var item = _step.value;
3384
3385 if (item.field === value) {
3386 return item.title;
3387 }
3388 }
3389 } catch (err) {
3390 _didIteratorError = true;
3391 _iteratorError = err;
3392 } finally {
3393 try {
3394 if (!_iteratorNormalCompletion && _iterator.return != null) {
3395 _iterator.return();
3396 }
3397 } finally {
3398 if (_didIteratorError) {
3399 throw _iteratorError;
3400 }
3401 }
3402 }
3403
3404 return '';
3405 },
3406 setFieldIndex: function setFieldIndex(columns) {
3407 var totalCol = 0;
3408 var flag = [];
3409 var _iteratorNormalCompletion2 = true;
3410 var _didIteratorError2 = false;
3411 var _iteratorError2 = undefined;
3412
3413 try {
3414 for (var _iterator2 = columns[0][Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
3415 var column = _step2.value;
3416 totalCol += column.colspan || 1;
3417 }
3418 } catch (err) {
3419 _didIteratorError2 = true;
3420 _iteratorError2 = err;
3421 } finally {
3422 try {
3423 if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
3424 _iterator2.return();
3425 }
3426 } finally {
3427 if (_didIteratorError2) {
3428 throw _iteratorError2;
3429 }
3430 }
3431 }
3432
3433 for (var i = 0; i < columns.length; i++) {
3434 flag[i] = [];
3435
3436 for (var j = 0; j < totalCol; j++) {
3437 flag[i][j] = false;
3438 }
3439 }
3440
3441 for (var _i = 0; _i < columns.length; _i++) {
3442 var _iteratorNormalCompletion3 = true;
3443 var _didIteratorError3 = false;
3444 var _iteratorError3 = undefined;
3445
3446 try {
3447 for (var _iterator3 = columns[_i][Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
3448 var r = _step3.value;
3449 var rowspan = r.rowspan || 1;
3450 var colspan = r.colspan || 1;
3451
3452 var index = flag[_i].indexOf(false);
3453
3454 r.colspanIndex = index;
3455
3456 if (colspan === 1) {
3457 r.fieldIndex = index; // when field is undefined, use index instead
3458
3459 if (typeof r.field === 'undefined') {
3460 r.field = index;
3461 }
3462 } else {
3463 r.colspanGroup = r.colspan;
3464 }
3465
3466 for (var k = 0; k < rowspan; k++) {
3467 flag[_i + k][index] = true;
3468 }
3469
3470 for (var _k = 0; _k < colspan; _k++) {
3471 flag[_i][index + _k] = true;
3472 }
3473 }
3474 } catch (err) {
3475 _didIteratorError3 = true;
3476 _iteratorError3 = err;
3477 } finally {
3478 try {
3479 if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
3480 _iterator3.return();
3481 }
3482 } finally {
3483 if (_didIteratorError3) {
3484 throw _iteratorError3;
3485 }
3486 }
3487 }
3488 }
3489 },
3490 updateFieldGroup: function updateFieldGroup(columns) {
3491 var _ref;
3492
3493 var allColumns = (_ref = []).concat.apply(_ref, _toConsumableArray(columns));
3494
3495 var _iteratorNormalCompletion4 = true;
3496 var _didIteratorError4 = false;
3497 var _iteratorError4 = undefined;
3498
3499 try {
3500 for (var _iterator4 = columns[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
3501 var c = _step4.value;
3502 var _iteratorNormalCompletion5 = true;
3503 var _didIteratorError5 = false;
3504 var _iteratorError5 = undefined;
3505
3506 try {
3507 for (var _iterator5 = c[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
3508 var r = _step5.value;
3509
3510 if (r.colspanGroup > 1) {
3511 var colspan = 0;
3512
3513 var _loop = function _loop(i) {
3514 var column = allColumns.find(function (col) {
3515 return col.fieldIndex === i;
3516 });
3517
3518 if (column.visible) {
3519 colspan++;
3520 }
3521 };
3522
3523 for (var i = r.colspanIndex; i < r.colspanIndex + r.colspanGroup; i++) {
3524 _loop(i);
3525 }
3526
3527 r.colspan = colspan;
3528 r.visible = colspan > 0;
3529 }
3530 }
3531 } catch (err) {
3532 _didIteratorError5 = true;
3533 _iteratorError5 = err;
3534 } finally {
3535 try {
3536 if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
3537 _iterator5.return();
3538 }
3539 } finally {
3540 if (_didIteratorError5) {
3541 throw _iteratorError5;
3542 }
3543 }
3544 }
3545 }
3546 } catch (err) {
3547 _didIteratorError4 = true;
3548 _iteratorError4 = err;
3549 } finally {
3550 try {
3551 if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
3552 _iterator4.return();
3553 }
3554 } finally {
3555 if (_didIteratorError4) {
3556 throw _iteratorError4;
3557 }
3558 }
3559 }
3560 },
3561 getScrollBarWidth: function getScrollBarWidth() {
3562 if (this.cachedWidth === undefined) {
3563 var $inner = $('<div/>').addClass('fixed-table-scroll-inner');
3564 var $outer = $('<div/>').addClass('fixed-table-scroll-outer');
3565 $outer.append($inner);
3566 $('body').append($outer);
3567 var w1 = $inner[0].offsetWidth;
3568 $outer.css('overflow', 'scroll');
3569 var w2 = $inner[0].offsetWidth;
3570
3571 if (w1 === w2) {
3572 w2 = $outer[0].clientWidth;
3573 }
3574
3575 $outer.remove();
3576 this.cachedWidth = w1 - w2;
3577 }
3578
3579 return this.cachedWidth;
3580 },
3581 calculateObjectValue: function calculateObjectValue(self, name, args, defaultValue) {
3582 var func = name;
3583
3584 if (typeof name === 'string') {
3585 // support obj.func1.func2
3586 var names = name.split('.');
3587
3588 if (names.length > 1) {
3589 func = window;
3590 var _iteratorNormalCompletion6 = true;
3591 var _didIteratorError6 = false;
3592 var _iteratorError6 = undefined;
3593
3594 try {
3595 for (var _iterator6 = names[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {
3596 var f = _step6.value;
3597 func = func[f];
3598 }
3599 } catch (err) {
3600 _didIteratorError6 = true;
3601 _iteratorError6 = err;
3602 } finally {
3603 try {
3604 if (!_iteratorNormalCompletion6 && _iterator6.return != null) {
3605 _iterator6.return();
3606 }
3607 } finally {
3608 if (_didIteratorError6) {
3609 throw _iteratorError6;
3610 }
3611 }
3612 }
3613 } else {
3614 func = window[name];
3615 }
3616 }
3617
3618 if (func !== null && _typeof(func) === 'object') {
3619 return func;
3620 }
3621
3622 if (typeof func === 'function') {
3623 return func.apply(self, args || []);
3624 }
3625
3626 if (!func && typeof name === 'string' && this.sprintf.apply(this, [name].concat(_toConsumableArray(args)))) {
3627 return this.sprintf.apply(this, [name].concat(_toConsumableArray(args)));
3628 }
3629
3630 return defaultValue;
3631 },
3632 compareObjects: function compareObjects(objectA, objectB, compareLength) {
3633 var aKeys = Object.keys(objectA);
3634 var bKeys = Object.keys(objectB);
3635
3636 if (compareLength && aKeys.length !== bKeys.length) {
3637 return false;
3638 }
3639
3640 for (var _i2 = 0, _aKeys = aKeys; _i2 < _aKeys.length; _i2++) {
3641 var key = _aKeys[_i2];
3642
3643 if (bKeys.includes(key) && objectA[key] !== objectB[key]) {
3644 return false;
3645 }
3646 }
3647
3648 return true;
3649 },
3650 escapeHTML: function escapeHTML(text) {
3651 if (typeof text === 'string') {
3652 return text.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#039;').replace(/`/g, '&#x60;');
3653 }
3654
3655 return text;
3656 },
3657 getRealDataAttr: function getRealDataAttr(dataAttr) {
3658 for (var _i3 = 0, _Object$entries = Object.entries(dataAttr); _i3 < _Object$entries.length; _i3++) {
3659 var _Object$entries$_i = _slicedToArray(_Object$entries[_i3], 2),
3660 attr = _Object$entries$_i[0],
3661 value = _Object$entries$_i[1];
3662
3663 var auxAttr = attr.split(/(?=[A-Z])/).join('-').toLowerCase();
3664
3665 if (auxAttr !== attr) {
3666 dataAttr[auxAttr] = value;
3667 delete dataAttr[attr];
3668 }
3669 }
3670
3671 return dataAttr;
3672 },
3673 getItemField: function getItemField(item, field, escape) {
3674 var value = item;
3675
3676 if (typeof field !== 'string' || item.hasOwnProperty(field)) {
3677 return escape ? this.escapeHTML(item[field]) : item[field];
3678 }
3679
3680 var props = field.split('.');
3681 var _iteratorNormalCompletion7 = true;
3682 var _didIteratorError7 = false;
3683 var _iteratorError7 = undefined;
3684
3685 try {
3686 for (var _iterator7 = props[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {
3687 var p = _step7.value;
3688 value = value && value[p];
3689 }
3690 } catch (err) {
3691 _didIteratorError7 = true;
3692 _iteratorError7 = err;
3693 } finally {
3694 try {
3695 if (!_iteratorNormalCompletion7 && _iterator7.return != null) {
3696 _iterator7.return();
3697 }
3698 } finally {
3699 if (_didIteratorError7) {
3700 throw _iteratorError7;
3701 }
3702 }
3703 }
3704
3705 return escape ? this.escapeHTML(value) : value;
3706 },
3707 isIEBrowser: function isIEBrowser() {
3708 return navigator.userAgent.includes('MSIE ') || /Trident.*rv:11\./.test(navigator.userAgent);
3709 },
3710 findIndex: function findIndex(items, item) {
3711 var _iteratorNormalCompletion8 = true;
3712 var _didIteratorError8 = false;
3713 var _iteratorError8 = undefined;
3714
3715 try {
3716 for (var _iterator8 = items[Symbol.iterator](), _step8; !(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done); _iteratorNormalCompletion8 = true) {
3717 var it = _step8.value;
3718
3719 if (JSON.stringify(it) === JSON.stringify(item)) {
3720 return items.indexOf(it);
3721 }
3722 }
3723 } catch (err) {
3724 _didIteratorError8 = true;
3725 _iteratorError8 = err;
3726 } finally {
3727 try {
3728 if (!_iteratorNormalCompletion8 && _iterator8.return != null) {
3729 _iterator8.return();
3730 }
3731 } finally {
3732 if (_didIteratorError8) {
3733 throw _iteratorError8;
3734 }
3735 }
3736 }
3737
3738 return -1;
3739 },
3740 trToData: function trToData(columns, $els) {
3741 var _this = this;
3742
3743 var data = [];
3744 var m = [];
3745 $els.each(function (y, el) {
3746 var row = {}; // save tr's id, class and data-* attributes
3747
3748 row._id = $(el).attr('id');
3749 row._class = $(el).attr('class');
3750 row._data = _this.getRealDataAttr($(el).data());
3751 $(el).find('>td,>th').each(function (_x, el) {
3752 var cspan = +$(el).attr('colspan') || 1;
3753 var rspan = +$(el).attr('rowspan') || 1;
3754 var x = _x; // skip already occupied cells in current row
3755
3756 for (; m[y] && m[y][x]; x++) {} // ignore
3757 // mark matrix elements occupied by current cell with true
3758
3759
3760 for (var tx = x; tx < x + cspan; tx++) {
3761 for (var ty = y; ty < y + rspan; ty++) {
3762 if (!m[ty]) {
3763 // fill missing rows
3764 m[ty] = [];
3765 }
3766
3767 m[ty][tx] = true;
3768 }
3769 }
3770
3771 var field = columns[x].field;
3772 row[field] = $(el).html().trim(); // save td's id, class and data-* attributes
3773
3774 row["_".concat(field, "_id")] = $(el).attr('id');
3775 row["_".concat(field, "_class")] = $(el).attr('class');
3776 row["_".concat(field, "_rowspan")] = $(el).attr('rowspan');
3777 row["_".concat(field, "_colspan")] = $(el).attr('colspan');
3778 row["_".concat(field, "_title")] = $(el).attr('title');
3779 row["_".concat(field, "_data")] = _this.getRealDataAttr($(el).data());
3780 });
3781 data.push(row);
3782 });
3783 return data;
3784 },
3785 sort: function sort(a, b, order, sortStable, aPosition, bPosition) {
3786 if (a === undefined || a === null) {
3787 a = '';
3788 }
3789
3790 if (b === undefined || b === null) {
3791 b = '';
3792 }
3793
3794 if (sortStable && a === b) {
3795 a = aPosition;
3796 b = bPosition;
3797 } // If both values are numeric, do a numeric comparison
3798
3799
3800 if (this.isNumeric(a) && this.isNumeric(b)) {
3801 // Convert numerical values form string to float.
3802 a = parseFloat(a);
3803 b = parseFloat(b);
3804
3805 if (a < b) {
3806 return order * -1;
3807 }
3808
3809 if (a > b) {
3810 return order;
3811 }
3812
3813 return 0;
3814 }
3815
3816 if (a === b) {
3817 return 0;
3818 } // If value is not a string, convert to string
3819
3820
3821 if (typeof a !== 'string') {
3822 a = a.toString();
3823 }
3824
3825 if (a.localeCompare(b) === -1) {
3826 return order * -1;
3827 }
3828
3829 return order;
3830 },
3831 getResizeEventName: function getResizeEventName() {
3832 var id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3833 id = id || "".concat(+new Date()).concat(~~(Math.random() * 1000000));
3834 return "resize.bootstrap-table-".concat(id);
3835 }
3836 };
3837
3838 var BLOCK_ROWS = 50;
3839 var CLUSTER_BLOCKS = 4;
3840
3841 var VirtualScroll =
3842 /*#__PURE__*/
3843 function () {
3844 function VirtualScroll(options) {
3845 var _this = this;
3846
3847 _classCallCheck(this, VirtualScroll);
3848
3849 this.rows = options.rows;
3850 this.scrollEl = options.scrollEl;
3851 this.contentEl = options.contentEl;
3852 this.callback = options.callback;
3853 this.itemHeight = options.itemHeight;
3854 this.cache = {};
3855 this.scrollTop = this.scrollEl.scrollTop;
3856 this.initDOM(this.rows, options.fixedScroll);
3857 this.scrollEl.scrollTop = this.scrollTop;
3858 this.lastCluster = 0;
3859
3860 var onScroll = function onScroll() {
3861 if (_this.lastCluster !== (_this.lastCluster = _this.getNum())) {
3862 _this.initDOM(_this.rows);
3863
3864 _this.callback();
3865 }
3866 };
3867
3868 this.scrollEl.addEventListener('scroll', onScroll, false);
3869
3870 this.destroy = function () {
3871 _this.contentEl.innerHtml = '';
3872
3873 _this.scrollEl.removeEventListener('scroll', onScroll, false);
3874 };
3875 }
3876
3877 _createClass(VirtualScroll, [{
3878 key: "initDOM",
3879 value: function initDOM(rows, fixedScroll) {
3880 if (typeof this.clusterHeight === 'undefined') {
3881 this.cache.scrollTop = this.scrollEl.scrollTop;
3882 this.cache.data = this.contentEl.innerHTML = rows[0] + rows[0] + rows[0];
3883 this.getRowsHeight(rows);
3884 }
3885
3886 var data = this.initData(rows, this.getNum(fixedScroll));
3887 var thisRows = data.rows.join('');
3888 var dataChanged = this.checkChanges('data', thisRows);
3889 var topOffsetChanged = this.checkChanges('top', data.topOffset);
3890 var bottomOffsetChanged = this.checkChanges('bottom', data.bottomOffset);
3891 var html = [];
3892
3893 if (dataChanged && topOffsetChanged) {
3894 if (data.topOffset) {
3895 html.push(this.getExtra('top', data.topOffset));
3896 }
3897
3898 html.push(thisRows);
3899
3900 if (data.bottomOffset) {
3901 html.push(this.getExtra('bottom', data.bottomOffset));
3902 }
3903
3904 this.contentEl.innerHTML = html.join('');
3905
3906 if (fixedScroll) {
3907 this.contentEl.scrollTop = this.cache.scrollTop;
3908 }
3909 } else if (bottomOffsetChanged) {
3910 this.contentEl.lastChild.style.height = "".concat(data.bottomOffset, "px");
3911 }
3912 }
3913 }, {
3914 key: "getRowsHeight",
3915 value: function getRowsHeight() {
3916 if (typeof this.itemHeight === 'undefined') {
3917 var nodes = this.contentEl.children;
3918 var node = nodes[Math.floor(nodes.length / 2)];
3919 this.itemHeight = node.offsetHeight;
3920 }
3921
3922 this.blockHeight = this.itemHeight * BLOCK_ROWS;
3923 this.clusterRows = BLOCK_ROWS * CLUSTER_BLOCKS;
3924 this.clusterHeight = this.blockHeight * CLUSTER_BLOCKS;
3925 }
3926 }, {
3927 key: "getNum",
3928 value: function getNum(fixedScroll) {
3929 this.scrollTop = fixedScroll ? this.cache.scrollTop : this.scrollEl.scrollTop;
3930 return Math.floor(this.scrollTop / (this.clusterHeight - this.blockHeight)) || 0;
3931 }
3932 }, {
3933 key: "initData",
3934 value: function initData(rows, num) {
3935 if (rows.length < BLOCK_ROWS) {
3936 return {
3937 topOffset: 0,
3938 bottomOffset: 0,
3939 rowsAbove: 0,
3940 rows: rows
3941 };
3942 }
3943
3944 var start = Math.max((this.clusterRows - BLOCK_ROWS) * num, 0);
3945 var end = start + this.clusterRows;
3946 var topOffset = Math.max(start * this.itemHeight, 0);
3947 var bottomOffset = Math.max((rows.length - end) * this.itemHeight, 0);
3948 var thisRows = [];
3949 var rowsAbove = start;
3950
3951 if (topOffset < 1) {
3952 rowsAbove++;
3953 }
3954
3955 for (var i = start; i < end; i++) {
3956 rows[i] && thisRows.push(rows[i]);
3957 }
3958
3959 return {
3960 topOffset: topOffset,
3961 bottomOffset: bottomOffset,
3962 rowsAbove: rowsAbove,
3963 rows: thisRows
3964 };
3965 }
3966 }, {
3967 key: "checkChanges",
3968 value: function checkChanges(type, value) {
3969 var changed = value !== this.cache[type];
3970 this.cache[type] = value;
3971 return changed;
3972 }
3973 }, {
3974 key: "getExtra",
3975 value: function getExtra(className, height) {
3976 var tag = document.createElement('tr');
3977 tag.className = "virtual-scroll-".concat(className);
3978
3979 if (height) {
3980 tag.style.height = "".concat(height, "px");
3981 }
3982
3983 return tag.outerHTML;
3984 }
3985 }]);
3986
3987 return VirtualScroll;
3988 }();
3989
3990 var BootstrapTable =
3991 /*#__PURE__*/
3992 function () {
3993 function BootstrapTable(el, options) {
3994 _classCallCheck(this, BootstrapTable);
3995
3996 this.options = options;
3997 this.$el = $(el);
3998 this.$el_ = this.$el.clone();
3999 this.timeoutId_ = 0;
4000 this.timeoutFooter_ = 0;
4001 this.init();
4002 }
4003
4004 _createClass(BootstrapTable, [{
4005 key: "init",
4006 value: function init() {
4007 this.initConstants();
4008 this.initLocale();
4009 this.initContainer();
4010 this.initTable();
4011 this.initHeader();
4012 this.initData();
4013 this.initHiddenRows();
4014 this.initToolbar();
4015 this.initPagination();
4016 this.initBody();
4017 this.initSearchText();
4018 this.initServer();
4019 }
4020 }, {
4021 key: "initConstants",
4022 value: function initConstants() {
4023 var opts = this.options;
4024 this.constants = Constants.CONSTANTS;
4025 this.constants.theme = $.fn.bootstrapTable.theme;
4026 var buttonsPrefix = opts.buttonsPrefix ? "".concat(opts.buttonsPrefix, "-") : '';
4027 this.constants.buttonsClass = [opts.buttonsPrefix, buttonsPrefix + opts.buttonsClass, Utils.sprintf("".concat(buttonsPrefix, "%s"), opts.iconSize)].join(' ').trim();
4028 }
4029 }, {
4030 key: "initLocale",
4031 value: function initLocale() {
4032 if (this.options.locale) {
4033 var locales = $.fn.bootstrapTable.locales;
4034 var parts = this.options.locale.split(/-|_/);
4035 parts[0] = parts[0].toLowerCase();
4036
4037 if (parts[1]) {
4038 parts[1] = parts[1].toUpperCase();
4039 }
4040
4041 if (locales[this.options.locale]) {
4042 $.extend(this.options, locales[this.options.locale]);
4043 } else if (locales[parts.join('-')]) {
4044 $.extend(this.options, locales[parts.join('-')]);
4045 } else if (locales[parts[0]]) {
4046 $.extend(this.options, locales[parts[0]]);
4047 }
4048 }
4049 }
4050 }, {
4051 key: "initContainer",
4052 value: function initContainer() {
4053 var topPagination = ['top', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination clearfix"></div>' : '';
4054 var bottomPagination = ['bottom', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination"></div>' : '';
4055 this.$container = $("\n <div class=\"bootstrap-table ".concat(this.constants.theme, "\">\n <div class=\"fixed-table-toolbar\"></div>\n ").concat(topPagination, "\n <div class=\"fixed-table-container\">\n <div class=\"fixed-table-header\"><table></table></div>\n <div class=\"fixed-table-body\">\n <div class=\"fixed-table-loading\">\n <span class=\"loading-wrap\">\n <span class=\"loading-text\">").concat(this.options.formatLoadingMessage(), "</span>\n <span class=\"animation-wrap\"><span class=\"animation-dot\"></span></span>\n </span>\n </div>\n </div>\n <div class=\"fixed-table-footer\"><table><thead><tr></tr></thead></table></div>\n </div>\n ").concat(bottomPagination, "\n </div>\n "));
4056 this.$container.insertAfter(this.$el);
4057 this.$tableContainer = this.$container.find('.fixed-table-container');
4058 this.$tableHeader = this.$container.find('.fixed-table-header');
4059 this.$tableBody = this.$container.find('.fixed-table-body');
4060 this.$tableLoading = this.$container.find('.fixed-table-loading');
4061 this.$tableFooter = this.$el.find('tfoot'); // checking if custom table-toolbar exists or not
4062
4063 if (this.options.buttonsToolbar) {
4064 this.$toolbar = $('body').find(this.options.buttonsToolbar);
4065 } else {
4066 this.$toolbar = this.$container.find('.fixed-table-toolbar');
4067 }
4068
4069 this.$pagination = this.$container.find('.fixed-table-pagination');
4070 this.$tableBody.append(this.$el);
4071 this.$container.after('<div class="clearfix"></div>');
4072 this.$el.addClass(this.options.classes);
4073 this.$tableLoading.addClass(this.options.classes);
4074
4075 if (this.options.height) {
4076 this.$tableContainer.addClass('fixed-height');
4077
4078 if (this.options.showFooter) {
4079 this.$tableContainer.addClass('has-footer');
4080 }
4081
4082 if (this.options.classes.split(' ').includes('table-bordered')) {
4083 this.$tableBody.append('<div class="fixed-table-border"></div>');
4084 this.$tableBorder = this.$tableBody.find('.fixed-table-border');
4085 this.$tableLoading.addClass('fixed-table-border');
4086 }
4087
4088 this.$tableFooter = this.$container.find('.fixed-table-footer');
4089 }
4090 }
4091 }, {
4092 key: "initTable",
4093 value: function initTable() {
4094 var _this = this;
4095
4096 var columns = [];
4097 this.$header = this.$el.find('>thead');
4098
4099 if (!this.$header.length) {
4100 this.$header = $("<thead class=\"".concat(this.options.theadClasses, "\"></thead>")).appendTo(this.$el);
4101 } else if (this.options.theadClasses) {
4102 this.$header.addClass(this.options.theadClasses);
4103 }
4104
4105 this.$header.find('tr').each(function (i, el) {
4106 var column = [];
4107 $(el).find('th').each(function (i, el) {
4108 // #2014: getFieldIndex and elsewhere assume this is string, causes issues if not
4109 if (typeof $(el).data('field') !== 'undefined') {
4110 $(el).data('field', "".concat($(el).data('field')));
4111 }
4112
4113 column.push($.extend({}, {
4114 title: $(el).html(),
4115 'class': $(el).attr('class'),
4116 titleTooltip: $(el).attr('title'),
4117 rowspan: $(el).attr('rowspan') ? +$(el).attr('rowspan') : undefined,
4118 colspan: $(el).attr('colspan') ? +$(el).attr('colspan') : undefined
4119 }, $(el).data()));
4120 });
4121 columns.push(column);
4122 });
4123
4124 if (!Array.isArray(this.options.columns[0])) {
4125 this.options.columns = [this.options.columns];
4126 }
4127
4128 this.options.columns = $.extend(true, [], columns, this.options.columns);
4129 this.columns = [];
4130 this.fieldsColumnsIndex = [];
4131 Utils.setFieldIndex(this.options.columns);
4132 this.options.columns.forEach(function (columns, i) {
4133 columns.forEach(function (_column, j) {
4134 var column = $.extend({}, BootstrapTable.COLUMN_DEFAULTS, _column);
4135
4136 if (typeof column.fieldIndex !== 'undefined') {
4137 _this.columns[column.fieldIndex] = column;
4138 _this.fieldsColumnsIndex[column.field] = column.fieldIndex;
4139 }
4140
4141 _this.options.columns[i][j] = column;
4142 });
4143 }); // if options.data is setting, do not process tbody and tfoot data
4144
4145 if (!this.options.data.length) {
4146 this.options.data = Utils.trToData(this.columns, this.$el.find('>tbody>tr'));
4147
4148 if (this.options.data.length) {
4149 this.fromHtml = true;
4150 }
4151 }
4152
4153 this.footerData = Utils.trToData(this.columns, this.$el.find('>tfoot>tr'));
4154
4155 if (this.footerData) {
4156 this.$el.find('tfoot').html('<tr></tr>');
4157 }
4158
4159 if (!this.options.showFooter || this.options.cardView) {
4160 this.$tableFooter.hide();
4161 } else {
4162 this.$tableFooter.show();
4163 }
4164 }
4165 }, {
4166 key: "initHeader",
4167 value: function initHeader() {
4168 var _this2 = this;
4169
4170 var visibleColumns = {};
4171 var html = [];
4172 this.header = {
4173 fields: [],
4174 styles: [],
4175 classes: [],
4176 formatters: [],
4177 detailFormatters: [],
4178 events: [],
4179 sorters: [],
4180 sortNames: [],
4181 cellStyles: [],
4182 searchables: []
4183 };
4184 Utils.updateFieldGroup(this.options.columns);
4185 this.options.columns.forEach(function (columns, i) {
4186 html.push('<tr>');
4187
4188 if (i === 0 && !_this2.options.cardView && _this2.options.detailView && _this2.options.detailViewIcon) {
4189 html.push("<th class=\"detail\" rowspan=\"".concat(_this2.options.columns.length, "\">\n <div class=\"fht-cell\"></div>\n </th>\n "));
4190 }
4191
4192 columns.forEach(function (column, j) {
4193 var class_ = Utils.sprintf(' class="%s"', column['class']);
4194 var unitWidth = column.widthUnit;
4195 var width = parseFloat(column.width);
4196 var halign = Utils.sprintf('text-align: %s; ', column.halign ? column.halign : column.align);
4197 var align = Utils.sprintf('text-align: %s; ', column.align);
4198 var style = Utils.sprintf('vertical-align: %s; ', column.valign);
4199 style += Utils.sprintf('width: %s; ', (column.checkbox || column.radio) && !width ? !column.showSelectTitle ? '36px' : undefined : width ? width + unitWidth : undefined);
4200
4201 if (typeof column.fieldIndex === 'undefined' && !column.visible) {
4202 return;
4203 }
4204
4205 var headerStyle = Utils.calculateObjectValue(null, _this2.options.headerStyle, [column]);
4206 var csses = [];
4207 var classes = '';
4208
4209 if (headerStyle && headerStyle.css) {
4210 for (var _i = 0, _Object$entries = Object.entries(headerStyle.css); _i < _Object$entries.length; _i++) {
4211 var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
4212 key = _Object$entries$_i[0],
4213 value = _Object$entries$_i[1];
4214
4215 csses.push("".concat(key, ": ").concat(value));
4216 }
4217 }
4218
4219 if (headerStyle && headerStyle.classes) {
4220 classes = Utils.sprintf(' class="%s"', column['class'] ? [column['class'], headerStyle.classes].join(' ') : headerStyle.classes);
4221 }
4222
4223 if (typeof column.fieldIndex !== 'undefined') {
4224 _this2.header.fields[column.fieldIndex] = column.field;
4225 _this2.header.styles[column.fieldIndex] = align + style;
4226 _this2.header.classes[column.fieldIndex] = class_;
4227 _this2.header.formatters[column.fieldIndex] = column.formatter;
4228 _this2.header.detailFormatters[column.fieldIndex] = column.detailFormatter;
4229 _this2.header.events[column.fieldIndex] = column.events;
4230 _this2.header.sorters[column.fieldIndex] = column.sorter;
4231 _this2.header.sortNames[column.fieldIndex] = column.sortName;
4232 _this2.header.cellStyles[column.fieldIndex] = column.cellStyle;
4233 _this2.header.searchables[column.fieldIndex] = column.searchable;
4234
4235 if (!column.visible) {
4236 return;
4237 }
4238
4239 if (_this2.options.cardView && !column.cardVisible) {
4240 return;
4241 }
4242
4243 visibleColumns[column.field] = column;
4244 }
4245
4246 html.push("<th".concat(Utils.sprintf(' title="%s"', column.titleTooltip)), column.checkbox || column.radio ? Utils.sprintf(' class="bs-checkbox %s"', column['class'] || '') : classes || class_, Utils.sprintf(' style="%s"', halign + style + csses.join('; ')), Utils.sprintf(' rowspan="%s"', column.rowspan), Utils.sprintf(' colspan="%s"', column.colspan), Utils.sprintf(' data-field="%s"', column.field), // If `column` is not the first element of `this.options.columns[0]`, then className 'data-not-first-th' should be added.
4247 j === 0 && i > 0 ? ' data-not-first-th' : '', '>');
4248 html.push(Utils.sprintf('<div class="th-inner %s">', _this2.options.sortable && column.sortable ? 'sortable both' : ''));
4249 var text = _this2.options.escape ? Utils.escapeHTML(column.title) : column.title;
4250 var title = text;
4251
4252 if (column.checkbox) {
4253 text = '';
4254 var cf = column.field ? column.field : 'btSelectAll';
4255 if (!_this2.options.singleSelect && _this2.options.checkboxHeader) {
4256 text = '<div class="custom-control custom-checkbox">' +
4257 ' <input type="checkbox" class="custom-control-input" name="btSelectAll" id="'+cf+'">' +
4258 ' <label class="custom-control-label" for="'+cf+'"></label>' +
4259 '</div>';
4260 }
4261
4262 _this2.header.stateField = column.field;
4263 }
4264
4265 if (column.radio) {
4266 text = '';
4267 _this2.header.stateField = column.field;
4268 }
4269
4270 if (!text && column.showSelectTitle) {
4271 text += title;
4272 }
4273
4274 html.push(text);
4275 html.push('</div>');
4276 html.push('<div class="fht-cell"></div>');
4277 html.push('</div>');
4278 html.push('</th>');
4279 });
4280 html.push('</tr>');
4281 });
4282 this.$header.html(html.join(''));
4283 this.$header.find('th[data-field]').each(function (i, el) {
4284 $(el).data(visibleColumns[$(el).data('field')]);
4285 });
4286 this.$container.off('click', '.th-inner').on('click', '.th-inner', function (e) {
4287 var $this = $(e.currentTarget);
4288
4289 if (_this2.options.detailView && !$this.parent().hasClass('bs-checkbox')) {
4290 if ($this.closest('.bootstrap-table')[0] !== _this2.$container[0]) {
4291 return false;
4292 }
4293 }
4294
4295 if (_this2.options.sortable && $this.parent().data().sortable) {
4296 _this2.onSort(e);
4297 }
4298 });
4299 this.$header.children().children().off('keypress').on('keypress', function (e) {
4300 if (_this2.options.sortable && $(e.currentTarget).data().sortable) {
4301 var code = e.keyCode || e.which;
4302
4303 if (code === 13) {
4304 // Enter keycode
4305 _this2.onSort(e);
4306 }
4307 }
4308 });
4309 var resizeEvent = Utils.getResizeEventName(this.$el.attr('id'));
4310 $(window).off(resizeEvent);
4311
4312 if (!this.options.showHeader || this.options.cardView) {
4313 this.$header.hide();
4314 this.$tableHeader.hide();
4315 this.$tableLoading.css('top', 0);
4316 } else {
4317 this.$header.show();
4318 this.$tableHeader.show();
4319 this.$tableLoading.css('top', this.$header.outerHeight() + 1); // Assign the correct sortable arrow
4320
4321 this.getCaret();
4322 $(window).on(resizeEvent, function () {
4323 return _this2.resetView();
4324 });
4325 }
4326
4327 this.$selectAll = this.$header.find('[name="btSelectAll"]');
4328 this.$selectAll.off('click').on('click', function (e) {
4329 e.stopPropagation();
4330 var checked = $(e.currentTarget).prop('checked');
4331
4332 _this2[checked ? 'checkAll' : 'uncheckAll']();
4333
4334 _this2.updateSelected();
4335 });
4336 }
4337 }, {
4338 key: "initData",
4339 value: function initData(data, type) {
4340 if (type === 'append') {
4341 this.options.data = this.options.data.concat(data);
4342 } else if (type === 'prepend') {
4343 this.options.data = [].concat(data).concat(this.options.data);
4344 } else {
4345 this.options.data = data || this.options.data;
4346 }
4347
4348 this.data = this.options.data;
4349
4350 if (this.options.sidePagination === 'server') {
4351 return;
4352 }
4353
4354 this.initSort();
4355 }
4356 }, {
4357 key: "initSort",
4358 value: function initSort() {
4359 var _this3 = this;
4360
4361 var name = this.options.sortName;
4362 var order = this.options.sortOrder === 'desc' ? -1 : 1;
4363 var index = this.header.fields.indexOf(this.options.sortName);
4364 var timeoutId = 0;
4365
4366 if (index !== -1) {
4367 if (this.options.sortStable) {
4368 this.data.forEach(function (row, i) {
4369 if (!row.hasOwnProperty('_position')) {
4370 row._position = i;
4371 }
4372 });
4373 }
4374
4375 if (this.options.customSort) {
4376 Utils.calculateObjectValue(this.options, this.options.customSort, [this.options.sortName, this.options.sortOrder, this.data]);
4377 } else {
4378 this.data.sort(function (a, b) {
4379 if (_this3.header.sortNames[index]) {
4380 name = _this3.header.sortNames[index];
4381 }
4382
4383 var aa = Utils.getItemField(a, name, _this3.options.escape);
4384 var bb = Utils.getItemField(b, name, _this3.options.escape);
4385 var value = Utils.calculateObjectValue(_this3.header, _this3.header.sorters[index], [aa, bb, a, b]);
4386
4387 if (value !== undefined) {
4388 if (_this3.options.sortStable && value === 0) {
4389 return order * (a._position - b._position);
4390 }
4391
4392 return order * value;
4393 }
4394
4395 return Utils.sort(aa, bb, order, _this3.options.sortStable, a._position, b._position);
4396 });
4397 }
4398
4399 if (this.options.sortClass !== undefined) {
4400 clearTimeout(timeoutId);
4401 timeoutId = setTimeout(function () {
4402 _this3.$el.removeClass(_this3.options.sortClass);
4403
4404 var index = _this3.$header.find("[data-field=\"".concat(_this3.options.sortName, "\"]")).index();
4405
4406 _this3.$el.find("tr td:nth-child(".concat(index + 1, ")")).addClass(_this3.options.sortClass);
4407 }, 250);
4408 }
4409 }
4410 }
4411 }, {
4412 key: "onSort",
4413 value: function onSort(_ref) {
4414 var type = _ref.type,
4415 currentTarget = _ref.currentTarget;
4416 var $this = type === 'keypress' ? $(currentTarget) : $(currentTarget).parent();
4417 var $this_ = this.$header.find('th').eq($this.index());
4418 this.$header.add(this.$header_).find('span.order').remove();
4419
4420 if (this.options.sortName === $this.data('field')) {
4421 this.options.sortOrder = this.options.sortOrder === 'asc' ? 'desc' : 'asc';
4422 } else {
4423 this.options.sortName = $this.data('field');
4424
4425 if (this.options.rememberOrder) {
4426 this.options.sortOrder = $this.data('order') === 'asc' ? 'desc' : 'asc';
4427 } else {
4428 this.options.sortOrder = this.columns[this.fieldsColumnsIndex[$this.data('field')]].sortOrder || this.columns[this.fieldsColumnsIndex[$this.data('field')]].order;
4429 }
4430 }
4431
4432 this.trigger('sort', this.options.sortName, this.options.sortOrder);
4433 $this.add($this_).data('order', this.options.sortOrder); // Assign the correct sortable arrow
4434
4435 this.getCaret();
4436
4437 if (this.options.sidePagination === 'server' && this.options.serverSort) {
4438 this.options.pageNumber = 1;
4439 this.initServer(this.options.silentSort);
4440 return;
4441 }
4442
4443 this.initSort();
4444 this.initBody();
4445 }
4446 }, {
4447 key: "initToolbar",
4448 value: function initToolbar() {
4449 var _this4 = this;
4450
4451 var opts = this.options;
4452 var html = [];
4453 var timeoutId = 0;
4454 var $keepOpen;
4455 var switchableCount = 0;
4456
4457 if (this.$toolbar.find('.bs-bars').children().length) {
4458 $('body').append($(opts.toolbar));
4459 }
4460
4461 this.$toolbar.html('');
4462
4463 if (typeof opts.toolbar === 'string' || _typeof(opts.toolbar) === 'object') {
4464 $(Utils.sprintf('<div class="bs-bars %s-%s"></div>', this.constants.classes.pull, opts.toolbarAlign)).appendTo(this.$toolbar).append($(opts.toolbar));
4465 } // showColumns, showToggle, showRefresh
4466
4467
4468 html = ["<div class=\"".concat(['columns', "columns-".concat(opts.buttonsAlign), this.constants.classes.buttonsGroup, "".concat(this.constants.classes.pull, "-").concat(opts.buttonsAlign)].join(' '), "\">")];
4469
4470 if (typeof opts.icons === 'string') {
4471 opts.icons = Utils.calculateObjectValue(null, opts.icons);
4472 }
4473
4474 var buttonsHtml = {
4475 paginationSwitch: "<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"paginationSwitch\"\n aria-label=\"Pagination Switch\" title=\"").concat(opts.formatPaginationSwitch(), "\">\n ").concat(opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.paginationSwitchDown) : '', "\n ").concat(opts.showButtonText ? opts.formatPaginationSwitchUp() : '', "\n </button>"),
4476 refresh: "<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"refresh\"\n aria-label=\"Refresh\" title=\"").concat(opts.formatRefresh(), "\">\n ").concat(opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.refresh) : '', "\n ").concat(opts.showButtonText ? opts.formatRefresh() : '', "\n </button>"),
4477 toggle: "<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"toggle\"\n aria-label=\"Toggle\" title=\"").concat(opts.formatToggle(), "\">\n ").concat(opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.toggleOff) : '', "\n ").concat(opts.showButtonText ? opts.formatToggleOn() : '', "\n </button>"),
4478 fullscreen: "<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"fullscreen\"\n aria-label=\"Fullscreen\" title=\"").concat(opts.formatFullscreen(), "\">\n ").concat(opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.fullscreen) : '', "\n ").concat(opts.showButtonText ? opts.formatFullscreen() : '', "\n </button>"),
4479 columns: function () {
4480 var html = [];
4481 html.push("<div class=\"keep-open ".concat(_this4.constants.classes.buttonsDropdown, "\" title=\"").concat(opts.formatColumns(), "\">\n <button class=\"").concat(_this4.constants.buttonsClass, " dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\"\n aria-label=\"Columns\" title=\"").concat(opts.formatColumns(), "\">\n ").concat(opts.showButtonIcons ? Utils.sprintf(_this4.constants.html.icon, opts.iconsPrefix, opts.icons.columns) : '', "\n ").concat(opts.showButtonText ? opts.formatColumns() : '', "\n ").concat(_this4.constants.html.dropdownCaret, "\n </button>\n ").concat(_this4.constants.html.toolbarDropdown[0]));
4482
4483 if (opts.showColumnsSearch) {
4484 html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="text" class="%s" id="columnsSearch" placeholder="%s" autocomplete="off">', _this4.constants.classes.input, opts.formatSearch())));
4485 html.push(_this4.constants.html.toolbarDropdownSeparator);
4486 }
4487
4488 if (opts.showColumnsToggleAll) {
4489 var allFieldsVisible = _this4.getVisibleColumns().length === _this4.columns.filter(function (column) {
4490 return !_this4.isSelectionColumn(column);
4491 }).length;
4492
4493 html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<div class="custom-control custom-checkbox"><input type="checkbox" class="toggle-all custom-control-input" id="toggle-all" %s> <label class="custom-control-label" for="toggle-all">%s</label></div>', allFieldsVisible ? 'checked="checked"' : '', opts.formatColumnsToggleAll())));
4494
4495 html.push(_this4.constants.html.toolbarDropdownSeparator);
4496 }
4497
4498 var visibleColumns = 0;
4499
4500 _this4.columns.forEach(function (column, i) {
4501 if (column.visible) {
4502 visibleColumns++;
4503 }
4504 });
4505
4506 _this4.columns.forEach(function (column, i) {
4507 if (_this4.isSelectionColumn(column)) {
4508 return;
4509 }
4510
4511 if (opts.cardView && !column.cardVisible) {
4512 return;
4513 }
4514
4515 var checked = column.visible ? ' checked="checked"' : '';
4516 var disabled = visibleColumns <= _this4.options.minimumCountColumns && checked ? ' disabled="disabled"' : '';
4517
4518 if (column.switchable) {
4519 html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<div class="custom-control custom-checkbox"><input type="checkbox" class="custom-control-input" data-field="%s" id="%s" value="%s"%s%s> <label class="custom-control-label" for="%s">%s</label></div>', column.field, column.field, i, checked, disabled, column.field, column.title)));
4520 switchableCount++;
4521 }
4522 });
4523
4524 html.push(_this4.constants.html.toolbarDropdown[1], '</div>');
4525 return html.join('');
4526 }()
4527 };
4528
4529 if (typeof opts.buttonsOrder === 'string') {
4530 opts.buttonsOrder = opts.buttonsOrder.replace(/\[|\]| |'/g, '').toLowerCase().split(',');
4531 }
4532
4533 var _iteratorNormalCompletion = true;
4534 var _didIteratorError = false;
4535 var _iteratorError = undefined;
4536
4537 try {
4538 for (var _iterator = opts.buttonsOrder[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
4539 var button = _step.value;
4540
4541 if (opts['show' + button.charAt(0).toUpperCase() + button.substring(1)]) {
4542 html.push(buttonsHtml[button]);
4543 }
4544 }
4545 } catch (err) {
4546 _didIteratorError = true;
4547 _iteratorError = err;
4548 } finally {
4549 try {
4550 if (!_iteratorNormalCompletion && _iterator.return != null) {
4551 _iterator.return();
4552 }
4553 } finally {
4554 if (_didIteratorError) {
4555 throw _iteratorError;
4556 }
4557 }
4558 }
4559
4560 html.push('</div>'); // Fix #188: this.showToolbar is for extensions
4561
4562 if (this.showToolbar || html.length > 2) {
4563 this.$toolbar.append(html.join(''));
4564 }
4565
4566 if (opts.showPaginationSwitch) {
4567 this.$toolbar.find('button[name="paginationSwitch"]').off('click').on('click', function () {
4568 return _this4.togglePagination();
4569 });
4570 }
4571
4572 if (opts.showFullscreen) {
4573 this.$toolbar.find('button[name="fullscreen"]').off('click').on('click', function () {
4574 return _this4.toggleFullscreen();
4575 });
4576 }
4577
4578 if (opts.showRefresh) {
4579 this.$toolbar.find('button[name="refresh"]').off('click').on('click', function () {
4580 return _this4.refresh();
4581 });
4582 }
4583
4584 if (opts.showToggle) {
4585 this.$toolbar.find('button[name="toggle"]').off('click').on('click', function () {
4586 _this4.toggleView();
4587 });
4588 }
4589
4590 if (opts.showColumns) {
4591 $keepOpen = this.$toolbar.find('.keep-open');
4592 var $checkboxes = $keepOpen.find('input[type="checkbox"]:not(".toggle-all")');
4593 var $toggleAll = $keepOpen.find('input[type="checkbox"].toggle-all');
4594
4595 if (switchableCount <= opts.minimumCountColumns) {
4596 $keepOpen.find('input').prop('disabled', true);
4597 }
4598
4599 $keepOpen.find('li, label').off('click').on('click', function (e) {
4600 e.stopImmediatePropagation();
4601 });
4602 $checkboxes.off('click').on('click', function (_ref2) {
4603 var currentTarget = _ref2.currentTarget;
4604 var $this = $(currentTarget);
4605
4606 _this4._toggleColumn($this.val(), $this.prop('checked'), false);
4607
4608 _this4.trigger('column-switch', $this.data('field'), $this.prop('checked'));
4609
4610 $toggleAll.prop('checked', $checkboxes.filter(':checked').length === _this4.columns.filter(function (column) {
4611 return !_this4.isSelectionColumn(column);
4612 }).length);
4613 });
4614 $toggleAll.off('click').on('click', function (_ref3) {
4615 var currentTarget = _ref3.currentTarget;
4616
4617 _this4._toggleAllColumns($(currentTarget).prop('checked'));
4618 });
4619
4620 if (opts.showColumnsSearch) {
4621 var $columnsSearch = $keepOpen.find('#columnsSearch');
4622 var $listItems = $keepOpen.find('.dropdown-item-marker');
4623 $columnsSearch.on('keyup paste change', function (_ref4) {
4624 var currentTarget = _ref4.currentTarget;
4625 var $this = $(currentTarget);
4626 var searchValue = $this.val().toLowerCase();
4627 $listItems.show();
4628 $checkboxes.each(function (i, el) {
4629 var $checkbox = $(el);
4630 var $listItem = $checkbox.parents('.dropdown-item-marker');
4631 var text = $listItem.text().toLowerCase();
4632
4633 if (!text.includes(searchValue)) {
4634 $listItem.hide();
4635 }
4636 });
4637 });
4638 }
4639 } // Fix #4516: this.showSearchClearButton is for extensions
4640
4641
4642 if (opts.search || this.showSearchClearButton) {
4643 html = [];
4644 var showSearchButton = Utils.sprintf(this.constants.html.searchButton, this.constants.buttonsClass, opts.formatSearch(), opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.search) : '', opts.showButtonText ? opts.formatSearch() : '');
4645 var showSearchClearButton = Utils.sprintf(this.constants.html.searchClearButton, this.constants.buttonsClass, opts.formatClearSearch(), opts.showButtonIcons ? Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, opts.icons.clearSearch) : '', opts.showButtonText ? opts.formatClearSearch() : '');
4646 var searchInputHtml = "<input class=\"".concat(this.constants.classes.input, "\n ").concat(Utils.sprintf(' %s%s', this.constants.classes.inputPrefix, opts.iconSize), "\n search-input\" type=\"text\" placeholder=\"").concat(opts.formatSearch(), "\" autocomplete=\"off\">");
4647 var searchInputFinalHtml = searchInputHtml;
4648
4649 if (opts.showSearchButton || opts.showSearchClearButton) {
4650 var _buttonsHtml = (opts.showSearchButton ? showSearchButton : '') + (opts.showSearchClearButton ? showSearchClearButton : '');
4651
4652 searchInputFinalHtml = opts.search ? Utils.sprintf(this.constants.html.inputGroup, searchInputHtml, _buttonsHtml) : _buttonsHtml;
4653 }
4654
4655 html.push(Utils.sprintf("\n <div class=\"".concat(this.constants.classes.pull, "-").concat(opts.searchAlign, " search ").concat(this.constants.classes.inputGroup, "\">\n %s\n </div>\n "), searchInputFinalHtml));
4656 this.$toolbar.append(html.join(''));
4657 var $searchInput = this.$toolbar.find('.search input');
4658
4659 var handleInputEvent = function handleInputEvent() {
4660 var eventTriggers = "keyup drop blur ".concat(Utils.isIEBrowser() ? 'mouseup' : '');
4661 $searchInput.off(eventTriggers).on(eventTriggers, function (event) {
4662 if (opts.searchOnEnterKey && event.keyCode !== 13) {
4663 return;
4664 }
4665
4666 if ([37, 38, 39, 40].includes(event.keyCode)) {
4667 return;
4668 }
4669
4670 clearTimeout(timeoutId); // doesn't matter if it's 0
4671
4672 timeoutId = setTimeout(function () {
4673 _this4.onSearch({
4674 currentTarget: event.currentTarget
4675 });
4676 }, opts.searchTimeOut);
4677 });
4678 };
4679
4680 if (opts.showSearchButton) {
4681 this.$toolbar.find('.search button[name=search]').off('click').on('click', function (event) {
4682 clearTimeout(timeoutId); // doesn't matter if it's 0
4683
4684 timeoutId = setTimeout(function () {
4685 _this4.onSearch({
4686 currentTarget: $searchInput
4687 });
4688 }, opts.searchTimeOut);
4689 });
4690
4691 if (opts.searchOnEnterKey) {
4692 handleInputEvent();
4693 }
4694 } else {
4695 handleInputEvent();
4696 }
4697
4698 if (opts.showSearchClearButton) {
4699 this.$toolbar.find('.search button[name=clearSearch]').click(function () {
4700 _this4.resetSearch();
4701 });
4702 }
4703 }
4704 }
4705 }, {
4706 key: "onSearch",
4707 value: function onSearch() {
4708 var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
4709 currentTarget = _ref5.currentTarget,
4710 firedByInitSearchText = _ref5.firedByInitSearchText;
4711
4712 var overwriteSearchText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
4713
4714 if (currentTarget !== undefined && $(currentTarget).length && overwriteSearchText) {
4715 var text = $(currentTarget).val().trim();
4716
4717 if (this.options.trimOnSearch && $(currentTarget).val() !== text) {
4718 $(currentTarget).val(text);
4719 }
4720
4721 if (this.searchText === text && text.length > 0) {
4722 return;
4723 }
4724
4725 if ($(currentTarget).hasClass('search-input')) {
4726 this.searchText = text;
4727 this.options.searchText = text;
4728 }
4729 }
4730
4731 if (!firedByInitSearchText) {
4732 this.options.pageNumber = 1;
4733 }
4734
4735 this.initSearch();
4736
4737 if (firedByInitSearchText) {
4738 if (this.options.sidePagination === 'client') {
4739 this.updatePagination();
4740 }
4741 } else {
4742 this.updatePagination();
4743 }
4744
4745 this.trigger('search', this.searchText);
4746 }
4747 }, {
4748 key: "initSearch",
4749 value: function initSearch() {
4750 var _this5 = this;
4751
4752 this.filterOptions = this.filterOptions || this.options.filterOptions;
4753
4754 if (this.options.sidePagination !== 'server') {
4755 if (this.options.customSearch) {
4756 this.data = Utils.calculateObjectValue(this.options, this.options.customSearch, [this.options.data, this.searchText, this.filterColumns]);
4757 return;
4758 }
4759
4760 var s = this.searchText && (this.fromHtml ? Utils.escapeHTML(this.searchText) : this.searchText).toLowerCase();
4761 var f = Utils.isEmptyObject(this.filterColumns) ? null : this.filterColumns; // Check filter
4762
4763 if (typeof this.filterOptions.filterAlgorithm === 'function') {
4764 this.data = this.options.data.filter(function (item, i) {
4765 return _this5.filterOptions.filterAlgorithm.apply(null, [item, f]);
4766 });
4767 } else if (typeof this.filterOptions.filterAlgorithm === 'string') {
4768 this.data = f ? this.options.data.filter(function (item, i) {
4769 var filterAlgorithm = _this5.filterOptions.filterAlgorithm;
4770
4771 if (filterAlgorithm === 'and') {
4772 for (var key in f) {
4773 if (Array.isArray(f[key]) && !f[key].includes(item[key]) || !Array.isArray(f[key]) && item[key] !== f[key]) {
4774 return false;
4775 }
4776 }
4777 } else if (filterAlgorithm === 'or') {
4778 var match = false;
4779
4780 for (var _key in f) {
4781 if (Array.isArray(f[_key]) && f[_key].includes(item[_key]) || !Array.isArray(f[_key]) && item[_key] === f[_key]) {
4782 match = true;
4783 }
4784 }
4785
4786 return match;
4787 }
4788
4789 return true;
4790 }) : this.options.data;
4791 }
4792
4793 var visibleFields = this.getVisibleFields();
4794 this.data = s ? this.data.filter(function (item, i) {
4795 for (var j = 0; j < _this5.header.fields.length; j++) {
4796 if (!_this5.header.searchables[j] || _this5.options.visibleSearch && visibleFields.indexOf(_this5.header.fields[j]) === -1) {
4797 continue;
4798 }
4799
4800 var key = Utils.isNumeric(_this5.header.fields[j]) ? parseInt(_this5.header.fields[j], 10) : _this5.header.fields[j];
4801 var column = _this5.columns[_this5.fieldsColumnsIndex[key]];
4802 var value = void 0;
4803
4804 if (typeof key === 'string') {
4805 value = item;
4806 var props = key.split('.');
4807
4808 for (var _i2 = 0; _i2 < props.length; _i2++) {
4809 if (value[props[_i2]] !== null) {
4810 value = value[props[_i2]];
4811 }
4812 }
4813 } else {
4814 value = item[key];
4815 } // Fix #142: respect searchFormatter boolean
4816
4817
4818 if (column && column.searchFormatter) {
4819 value = Utils.calculateObjectValue(column, _this5.header.formatters[j], [value, item, i, column.field], value);
4820 }
4821
4822 if (typeof value === 'string' || typeof value === 'number') {
4823 if (_this5.options.strictSearch) {
4824 if ("".concat(value).toLowerCase() === s) {
4825 return true;
4826 }
4827 } else {
4828 var largerSmallerEqualsRegex = /(?:(<=|=>|=<|>=|>|<)(?:\s+)?(\d+)?|(\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm;
4829 var matches = largerSmallerEqualsRegex.exec(s);
4830 var comparisonCheck = false;
4831
4832 if (matches) {
4833 var operator = matches[1] || "".concat(matches[5], "l");
4834 var comparisonValue = matches[2] || matches[3];
4835 var int = parseInt(value, 10);
4836 var comparisonInt = parseInt(comparisonValue, 10);
4837
4838 switch (operator) {
4839 case '>':
4840 case '<l':
4841 comparisonCheck = int > comparisonInt;
4842 break;
4843
4844 case '<':
4845 case '>l':
4846 comparisonCheck = int < comparisonInt;
4847 break;
4848
4849 case '<=':
4850 case '=<':
4851 case '>=l':
4852 case '=>l':
4853 comparisonCheck = int <= comparisonInt;
4854 break;
4855
4856 case '>=':
4857 case '=>':
4858 case '<=l':
4859 case '=<l':
4860 comparisonCheck = int >= comparisonInt;
4861 break;
4862 }
4863 }
4864
4865 if (comparisonCheck || "".concat(value).toLowerCase().includes(s)) {
4866 return true;
4867 }
4868 }
4869 }
4870 }
4871
4872 return false;
4873 }) : this.data;
4874 }
4875
4876 this.initSort();
4877 }
4878 }, {
4879 key: "initPagination",
4880 value: function initPagination() {
4881 var _this6 = this;
4882
4883 var opts = this.options;
4884
4885 if (!opts.pagination) {
4886 this.$pagination.hide();
4887 return;
4888 }
4889
4890 this.$pagination.show();
4891 var html = [];
4892 var allSelected = false;
4893 var i;
4894 var from;
4895 var to;
4896 var $pageList;
4897 var $pre;
4898 var $next;
4899 var $number;
4900 var data = this.getData({
4901 includeHiddenRows: false
4902 });
4903 var pageList = opts.pageList;
4904
4905 if (typeof pageList === 'string') {
4906 pageList = pageList.replace(/\[|\]| /g, '').toLowerCase().split(',');
4907 }
4908
4909 pageList = pageList.map(function (value) {
4910 if (typeof value === 'string') {
4911 return value.toLowerCase() === opts.formatAllRows().toLowerCase() || ['all', 'unlimited'].includes(value.toLowerCase()) ? opts.formatAllRows() : +value;
4912 }
4913
4914 return value;
4915 });
4916
4917 if (opts.sidePagination !== 'server') {
4918 opts.totalRows = data.length;
4919 }
4920
4921 this.totalPages = 0;
4922
4923 if (opts.totalRows) {
4924 if (opts.pageSize === opts.formatAllRows()) {
4925 opts.pageSize = opts.totalRows;
4926 allSelected = true;
4927 }
4928
4929 this.totalPages = ~~((opts.totalRows - 1) / opts.pageSize) + 1;
4930 opts.totalPages = this.totalPages;
4931 }
4932
4933 if (this.totalPages > 0 && opts.pageNumber > this.totalPages) {
4934 opts.pageNumber = this.totalPages;
4935 }
4936
4937 this.pageFrom = (opts.pageNumber - 1) * opts.pageSize + 1;
4938 this.pageTo = opts.pageNumber * opts.pageSize;
4939
4940 if (this.pageTo > opts.totalRows) {
4941 this.pageTo = opts.totalRows;
4942 }
4943
4944 if (this.options.pagination && this.options.sidePagination !== 'server') {
4945 this.options.totalNotFiltered = this.options.data.length;
4946 }
4947
4948 if (!this.options.showExtendedPagination) {
4949 this.options.totalNotFiltered = undefined;
4950 }
4951
4952 var paginationInfo = opts.onlyInfoPagination ? opts.formatDetailPagination(opts.totalRows) : opts.formatShowingRows(this.pageFrom, this.pageTo, opts.totalRows, opts.totalNotFiltered);
4953 html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(opts.paginationDetailHAlign, " pagination-detail\">\n <span class=\"pagination-info\">\n ").concat(paginationInfo, "\n </span>"));
4954
4955 if (!opts.onlyInfoPagination) {
4956 html.push('<span class="page-list">');
4957 var pageNumber = ["<span class=\"".concat(this.constants.classes.paginationDropdown, "\">\n <button class=\"").concat(this.constants.buttonsClass, " dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\">\n <span class=\"page-size\">\n ").concat(allSelected ? opts.formatAllRows() : opts.pageSize, "\n </span>\n ").concat(this.constants.html.dropdownCaret, "\n </button>\n ").concat(this.constants.html.pageDropdown[0])];
4958 pageList.forEach(function (page, i) {
4959 if (!opts.smartDisplay || i === 0 || pageList[i - 1] < opts.totalRows) {
4960 var active;
4961
4962 if (allSelected) {
4963 active = page === opts.formatAllRows() ? _this6.constants.classes.dropdownActive : '';
4964 } else {
4965 active = page === opts.pageSize ? _this6.constants.classes.dropdownActive : '';
4966 }
4967
4968 pageNumber.push(Utils.sprintf(_this6.constants.html.pageDropdownItem, active, page));
4969 }
4970 });
4971 pageNumber.push("".concat(this.constants.html.pageDropdown[1], "</span>"));
4972 html.push(opts.formatRecordsPerPage(pageNumber.join('')));
4973 html.push('</span></div>');
4974 html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(opts.paginationHAlign, " pagination\">"), Utils.sprintf(this.constants.html.pagination[0], Utils.sprintf(' pagination-%s', opts.iconSize)), Utils.sprintf(this.constants.html.paginationItem, ' page-pre', opts.formatSRPaginationPreText(), opts.paginationPreText));
4975
4976 if (this.totalPages < opts.paginationSuccessivelySize) {
4977 from = 1;
4978 to = this.totalPages;
4979 } else {
4980 from = opts.pageNumber - opts.paginationPagesBySide;
4981 to = from + opts.paginationPagesBySide * 2;
4982 }
4983
4984 if (opts.pageNumber < opts.paginationSuccessivelySize - 1) {
4985 to = opts.paginationSuccessivelySize;
4986 }
4987
4988 if (opts.paginationSuccessivelySize > this.totalPages - from) {
4989 from = from - (opts.paginationSuccessivelySize - (this.totalPages - from)) + 1;
4990 }
4991
4992 if (from < 1) {
4993 from = 1;
4994 }
4995
4996 if (to > this.totalPages) {
4997 to = this.totalPages;
4998 }
4999
5000 var middleSize = Math.round(opts.paginationPagesBySide / 2);
…文件过长,仅显示前 5000 行