UNPKG

321 kBJavaScriptView Raw
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 = typeof globalThis !== 'undefined' ? globalThis : global || self, global.BootstrapTable = factory(global.jQuery));
5})(this, (function ($$n) { 'use strict';
6
7 function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
9 var $__default = /*#__PURE__*/_interopDefaultLegacy($$n);
10
11 function _typeof(obj) {
12 "@babel/helpers - typeof";
13
14 return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
15 return typeof obj;
16 } : function (obj) {
17 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
18 }, _typeof(obj);
19 }
20
21 function _classCallCheck(instance, Constructor) {
22 if (!(instance instanceof Constructor)) {
23 throw new TypeError("Cannot call a class as a function");
24 }
25 }
26
27 function _defineProperties(target, props) {
28 for (var i = 0; i < props.length; i++) {
29 var descriptor = props[i];
30 descriptor.enumerable = descriptor.enumerable || false;
31 descriptor.configurable = true;
32 if ("value" in descriptor) descriptor.writable = true;
33 Object.defineProperty(target, descriptor.key, descriptor);
34 }
35 }
36
37 function _createClass(Constructor, protoProps, staticProps) {
38 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
39 if (staticProps) _defineProperties(Constructor, staticProps);
40 Object.defineProperty(Constructor, "prototype", {
41 writable: false
42 });
43 return Constructor;
44 }
45
46 function _slicedToArray(arr, i) {
47 return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
48 }
49
50 function _toConsumableArray(arr) {
51 return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
52 }
53
54 function _arrayWithoutHoles(arr) {
55 if (Array.isArray(arr)) return _arrayLikeToArray(arr);
56 }
57
58 function _arrayWithHoles(arr) {
59 if (Array.isArray(arr)) return arr;
60 }
61
62 function _iterableToArray(iter) {
63 if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
64 }
65
66 function _iterableToArrayLimit(arr, i) {
67 var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
68
69 if (_i == null) return;
70 var _arr = [];
71 var _n = true;
72 var _d = false;
73
74 var _s, _e;
75
76 try {
77 for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
78 _arr.push(_s.value);
79
80 if (i && _arr.length === i) break;
81 }
82 } catch (err) {
83 _d = true;
84 _e = err;
85 } finally {
86 try {
87 if (!_n && _i["return"] != null) _i["return"]();
88 } finally {
89 if (_d) throw _e;
90 }
91 }
92
93 return _arr;
94 }
95
96 function _unsupportedIterableToArray(o, minLen) {
97 if (!o) return;
98 if (typeof o === "string") return _arrayLikeToArray(o, minLen);
99 var n = Object.prototype.toString.call(o).slice(8, -1);
100 if (n === "Object" && o.constructor) n = o.constructor.name;
101 if (n === "Map" || n === "Set") return Array.from(o);
102 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
103 }
104
105 function _arrayLikeToArray(arr, len) {
106 if (len == null || len > arr.length) len = arr.length;
107
108 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
109
110 return arr2;
111 }
112
113 function _nonIterableSpread() {
114 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
115 }
116
117 function _nonIterableRest() {
118 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
119 }
120
121 function _createForOfIteratorHelper(o, allowArrayLike) {
122 var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
123
124 if (!it) {
125 if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
126 if (it) o = it;
127 var i = 0;
128
129 var F = function () {};
130
131 return {
132 s: F,
133 n: function () {
134 if (i >= o.length) return {
135 done: true
136 };
137 return {
138 done: false,
139 value: o[i++]
140 };
141 },
142 e: function (e) {
143 throw e;
144 },
145 f: F
146 };
147 }
148
149 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
150 }
151
152 var normalCompletion = true,
153 didErr = false,
154 err;
155 return {
156 s: function () {
157 it = it.call(o);
158 },
159 n: function () {
160 var step = it.next();
161 normalCompletion = step.done;
162 return step;
163 },
164 e: function (e) {
165 didErr = true;
166 err = e;
167 },
168 f: function () {
169 try {
170 if (!normalCompletion && it.return != null) it.return();
171 } finally {
172 if (didErr) throw err;
173 }
174 }
175 };
176 }
177
178 var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
179
180 var check = function (it) {
181 return it && it.Math == Math && it;
182 };
183
184 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
185 var global$G =
186 // eslint-disable-next-line es-x/no-global-this -- safe
187 check(typeof globalThis == 'object' && globalThis) ||
188 check(typeof window == 'object' && window) ||
189 // eslint-disable-next-line no-restricted-globals -- safe
190 check(typeof self == 'object' && self) ||
191 check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
192 // eslint-disable-next-line no-new-func -- fallback
193 (function () { return this; })() || Function('return this')();
194
195 var objectGetOwnPropertyDescriptor = {};
196
197 var fails$u = function (exec) {
198 try {
199 return !!exec();
200 } catch (error) {
201 return true;
202 }
203 };
204
205 var fails$t = fails$u;
206
207 // Detect IE8's incomplete defineProperty implementation
208 var descriptors = !fails$t(function () {
209 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
210 return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
211 });
212
213 var fails$s = fails$u;
214
215 var functionBindNative = !fails$s(function () {
216 // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
217 var test = (function () { /* empty */ }).bind();
218 // eslint-disable-next-line no-prototype-builtins -- safe
219 return typeof test != 'function' || test.hasOwnProperty('prototype');
220 });
221
222 var NATIVE_BIND$3 = functionBindNative;
223
224 var call$e = Function.prototype.call;
225
226 var functionCall = NATIVE_BIND$3 ? call$e.bind(call$e) : function () {
227 return call$e.apply(call$e, arguments);
228 };
229
230 var objectPropertyIsEnumerable = {};
231
232 var $propertyIsEnumerable$1 = {}.propertyIsEnumerable;
233 // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
234 var getOwnPropertyDescriptor$4 = Object.getOwnPropertyDescriptor;
235
236 // Nashorn ~ JDK8 bug
237 var NASHORN_BUG = getOwnPropertyDescriptor$4 && !$propertyIsEnumerable$1.call({ 1: 2 }, 1);
238
239 // `Object.prototype.propertyIsEnumerable` method implementation
240 // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
241 objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
242 var descriptor = getOwnPropertyDescriptor$4(this, V);
243 return !!descriptor && descriptor.enumerable;
244 } : $propertyIsEnumerable$1;
245
246 var createPropertyDescriptor$4 = function (bitmap, value) {
247 return {
248 enumerable: !(bitmap & 1),
249 configurable: !(bitmap & 2),
250 writable: !(bitmap & 4),
251 value: value
252 };
253 };
254
255 var NATIVE_BIND$2 = functionBindNative;
256
257 var FunctionPrototype$2 = Function.prototype;
258 var bind$2 = FunctionPrototype$2.bind;
259 var call$d = FunctionPrototype$2.call;
260 var uncurryThis$z = NATIVE_BIND$2 && bind$2.bind(call$d, call$d);
261
262 var functionUncurryThis = NATIVE_BIND$2 ? function (fn) {
263 return fn && uncurryThis$z(fn);
264 } : function (fn) {
265 return fn && function () {
266 return call$d.apply(fn, arguments);
267 };
268 };
269
270 var uncurryThis$y = functionUncurryThis;
271
272 var toString$h = uncurryThis$y({}.toString);
273 var stringSlice$7 = uncurryThis$y(''.slice);
274
275 var classofRaw$1 = function (it) {
276 return stringSlice$7(toString$h(it), 8, -1);
277 };
278
279 var global$F = global$G;
280 var uncurryThis$x = functionUncurryThis;
281 var fails$r = fails$u;
282 var classof$7 = classofRaw$1;
283
284 var Object$5 = global$F.Object;
285 var split = uncurryThis$x(''.split);
286
287 // fallback for non-array-like ES3 and non-enumerable old V8 strings
288 var indexedObject = fails$r(function () {
289 // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
290 // eslint-disable-next-line no-prototype-builtins -- safe
291 return !Object$5('z').propertyIsEnumerable(0);
292 }) ? function (it) {
293 return classof$7(it) == 'String' ? split(it, '') : Object$5(it);
294 } : Object$5;
295
296 var global$E = global$G;
297
298 var TypeError$e = global$E.TypeError;
299
300 // `RequireObjectCoercible` abstract operation
301 // https://tc39.es/ecma262/#sec-requireobjectcoercible
302 var requireObjectCoercible$b = function (it) {
303 if (it == undefined) throw TypeError$e("Can't call method on " + it);
304 return it;
305 };
306
307 // toObject with fallback for non-array-like ES3 strings
308 var IndexedObject$3 = indexedObject;
309 var requireObjectCoercible$a = requireObjectCoercible$b;
310
311 var toIndexedObject$8 = function (it) {
312 return IndexedObject$3(requireObjectCoercible$a(it));
313 };
314
315 // `IsCallable` abstract operation
316 // https://tc39.es/ecma262/#sec-iscallable
317 var isCallable$j = function (argument) {
318 return typeof argument == 'function';
319 };
320
321 var isCallable$i = isCallable$j;
322
323 var isObject$a = function (it) {
324 return typeof it == 'object' ? it !== null : isCallable$i(it);
325 };
326
327 var global$D = global$G;
328 var isCallable$h = isCallable$j;
329
330 var aFunction = function (argument) {
331 return isCallable$h(argument) ? argument : undefined;
332 };
333
334 var getBuiltIn$6 = function (namespace, method) {
335 return arguments.length < 2 ? aFunction(global$D[namespace]) : global$D[namespace] && global$D[namespace][method];
336 };
337
338 var uncurryThis$w = functionUncurryThis;
339
340 var objectIsPrototypeOf = uncurryThis$w({}.isPrototypeOf);
341
342 var getBuiltIn$5 = getBuiltIn$6;
343
344 var engineUserAgent = getBuiltIn$5('navigator', 'userAgent') || '';
345
346 var global$C = global$G;
347 var userAgent$2 = engineUserAgent;
348
349 var process = global$C.process;
350 var Deno = global$C.Deno;
351 var versions = process && process.versions || Deno && Deno.version;
352 var v8 = versions && versions.v8;
353 var match, version;
354
355 if (v8) {
356 match = v8.split('.');
357 // in old Chrome, versions of V8 isn't V8 = Chrome / 10
358 // but their correct versions are not interesting for us
359 version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
360 }
361
362 // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
363 // so check `userAgent` even if `.v8` exists, but 0
364 if (!version && userAgent$2) {
365 match = userAgent$2.match(/Edge\/(\d+)/);
366 if (!match || match[1] >= 74) {
367 match = userAgent$2.match(/Chrome\/(\d+)/);
368 if (match) version = +match[1];
369 }
370 }
371
372 var engineV8Version = version;
373
374 /* eslint-disable es-x/no-symbol -- required for testing */
375
376 var V8_VERSION$2 = engineV8Version;
377 var fails$q = fails$u;
378
379 // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
380 var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$q(function () {
381 var symbol = Symbol();
382 // Chrome 38 Symbol has incorrect toString conversion
383 // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
384 return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
385 // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
386 !Symbol.sham && V8_VERSION$2 && V8_VERSION$2 < 41;
387 });
388
389 /* eslint-disable es-x/no-symbol -- required for testing */
390
391 var NATIVE_SYMBOL$1 = nativeSymbol;
392
393 var useSymbolAsUid = NATIVE_SYMBOL$1
394 && !Symbol.sham
395 && typeof Symbol.iterator == 'symbol';
396
397 var global$B = global$G;
398 var getBuiltIn$4 = getBuiltIn$6;
399 var isCallable$g = isCallable$j;
400 var isPrototypeOf$3 = objectIsPrototypeOf;
401 var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
402
403 var Object$4 = global$B.Object;
404
405 var isSymbol$3 = USE_SYMBOL_AS_UID$1 ? function (it) {
406 return typeof it == 'symbol';
407 } : function (it) {
408 var $Symbol = getBuiltIn$4('Symbol');
409 return isCallable$g($Symbol) && isPrototypeOf$3($Symbol.prototype, Object$4(it));
410 };
411
412 var global$A = global$G;
413
414 var String$4 = global$A.String;
415
416 var tryToString$2 = function (argument) {
417 try {
418 return String$4(argument);
419 } catch (error) {
420 return 'Object';
421 }
422 };
423
424 var global$z = global$G;
425 var isCallable$f = isCallable$j;
426 var tryToString$1 = tryToString$2;
427
428 var TypeError$d = global$z.TypeError;
429
430 // `Assert: IsCallable(argument) is true`
431 var aCallable$3 = function (argument) {
432 if (isCallable$f(argument)) return argument;
433 throw TypeError$d(tryToString$1(argument) + ' is not a function');
434 };
435
436 var aCallable$2 = aCallable$3;
437
438 // `GetMethod` abstract operation
439 // https://tc39.es/ecma262/#sec-getmethod
440 var getMethod$5 = function (V, P) {
441 var func = V[P];
442 return func == null ? undefined : aCallable$2(func);
443 };
444
445 var global$y = global$G;
446 var call$c = functionCall;
447 var isCallable$e = isCallable$j;
448 var isObject$9 = isObject$a;
449
450 var TypeError$c = global$y.TypeError;
451
452 // `OrdinaryToPrimitive` abstract operation
453 // https://tc39.es/ecma262/#sec-ordinarytoprimitive
454 var ordinaryToPrimitive$1 = function (input, pref) {
455 var fn, val;
456 if (pref === 'string' && isCallable$e(fn = input.toString) && !isObject$9(val = call$c(fn, input))) return val;
457 if (isCallable$e(fn = input.valueOf) && !isObject$9(val = call$c(fn, input))) return val;
458 if (pref !== 'string' && isCallable$e(fn = input.toString) && !isObject$9(val = call$c(fn, input))) return val;
459 throw TypeError$c("Can't convert object to primitive value");
460 };
461
462 var shared$4 = {exports: {}};
463
464 var global$x = global$G;
465
466 // eslint-disable-next-line es-x/no-object-defineproperty -- safe
467 var defineProperty$6 = Object.defineProperty;
468
469 var setGlobal$3 = function (key, value) {
470 try {
471 defineProperty$6(global$x, key, { value: value, configurable: true, writable: true });
472 } catch (error) {
473 global$x[key] = value;
474 } return value;
475 };
476
477 var global$w = global$G;
478 var setGlobal$2 = setGlobal$3;
479
480 var SHARED = '__core-js_shared__';
481 var store$3 = global$w[SHARED] || setGlobal$2(SHARED, {});
482
483 var sharedStore = store$3;
484
485 var store$2 = sharedStore;
486
487 (shared$4.exports = function (key, value) {
488 return store$2[key] || (store$2[key] = value !== undefined ? value : {});
489 })('versions', []).push({
490 version: '3.22.5',
491 mode: 'global',
492 copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
493 license: 'https://github.com/zloirock/core-js/blob/v3.22.5/LICENSE',
494 source: 'https://github.com/zloirock/core-js'
495 });
496
497 var global$v = global$G;
498 var requireObjectCoercible$9 = requireObjectCoercible$b;
499
500 var Object$3 = global$v.Object;
501
502 // `ToObject` abstract operation
503 // https://tc39.es/ecma262/#sec-toobject
504 var toObject$9 = function (argument) {
505 return Object$3(requireObjectCoercible$9(argument));
506 };
507
508 var uncurryThis$v = functionUncurryThis;
509 var toObject$8 = toObject$9;
510
511 var hasOwnProperty = uncurryThis$v({}.hasOwnProperty);
512
513 // `HasOwnProperty` abstract operation
514 // https://tc39.es/ecma262/#sec-hasownproperty
515 // eslint-disable-next-line es-x/no-object-hasown -- safe
516 var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
517 return hasOwnProperty(toObject$8(it), key);
518 };
519
520 var uncurryThis$u = functionUncurryThis;
521
522 var id = 0;
523 var postfix = Math.random();
524 var toString$g = uncurryThis$u(1.0.toString);
525
526 var uid$2 = function (key) {
527 return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$g(++id + postfix, 36);
528 };
529
530 var global$u = global$G;
531 var shared$3 = shared$4.exports;
532 var hasOwn$b = hasOwnProperty_1;
533 var uid$1 = uid$2;
534 var NATIVE_SYMBOL = nativeSymbol;
535 var USE_SYMBOL_AS_UID = useSymbolAsUid;
536
537 var WellKnownSymbolsStore = shared$3('wks');
538 var Symbol$3 = global$u.Symbol;
539 var symbolFor = Symbol$3 && Symbol$3['for'];
540 var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid$1;
541
542 var wellKnownSymbol$j = function (name) {
543 if (!hasOwn$b(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
544 var description = 'Symbol.' + name;
545 if (NATIVE_SYMBOL && hasOwn$b(Symbol$3, name)) {
546 WellKnownSymbolsStore[name] = Symbol$3[name];
547 } else if (USE_SYMBOL_AS_UID && symbolFor) {
548 WellKnownSymbolsStore[name] = symbolFor(description);
549 } else {
550 WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
551 }
552 } return WellKnownSymbolsStore[name];
553 };
554
555 var global$t = global$G;
556 var call$b = functionCall;
557 var isObject$8 = isObject$a;
558 var isSymbol$2 = isSymbol$3;
559 var getMethod$4 = getMethod$5;
560 var ordinaryToPrimitive = ordinaryToPrimitive$1;
561 var wellKnownSymbol$i = wellKnownSymbol$j;
562
563 var TypeError$b = global$t.TypeError;
564 var TO_PRIMITIVE = wellKnownSymbol$i('toPrimitive');
565
566 // `ToPrimitive` abstract operation
567 // https://tc39.es/ecma262/#sec-toprimitive
568 var toPrimitive$2 = function (input, pref) {
569 if (!isObject$8(input) || isSymbol$2(input)) return input;
570 var exoticToPrim = getMethod$4(input, TO_PRIMITIVE);
571 var result;
572 if (exoticToPrim) {
573 if (pref === undefined) pref = 'default';
574 result = call$b(exoticToPrim, input, pref);
575 if (!isObject$8(result) || isSymbol$2(result)) return result;
576 throw TypeError$b("Can't convert object to primitive value");
577 }
578 if (pref === undefined) pref = 'number';
579 return ordinaryToPrimitive(input, pref);
580 };
581
582 var toPrimitive$1 = toPrimitive$2;
583 var isSymbol$1 = isSymbol$3;
584
585 // `ToPropertyKey` abstract operation
586 // https://tc39.es/ecma262/#sec-topropertykey
587 var toPropertyKey$3 = function (argument) {
588 var key = toPrimitive$1(argument, 'string');
589 return isSymbol$1(key) ? key : key + '';
590 };
591
592 var global$s = global$G;
593 var isObject$7 = isObject$a;
594
595 var document$1 = global$s.document;
596 // typeof document.createElement is 'object' in old IE
597 var EXISTS$1 = isObject$7(document$1) && isObject$7(document$1.createElement);
598
599 var documentCreateElement$2 = function (it) {
600 return EXISTS$1 ? document$1.createElement(it) : {};
601 };
602
603 var DESCRIPTORS$d = descriptors;
604 var fails$p = fails$u;
605 var createElement = documentCreateElement$2;
606
607 // Thanks to IE8 for its funny defineProperty
608 var ie8DomDefine = !DESCRIPTORS$d && !fails$p(function () {
609 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
610 return Object.defineProperty(createElement('div'), 'a', {
611 get: function () { return 7; }
612 }).a != 7;
613 });
614
615 var DESCRIPTORS$c = descriptors;
616 var call$a = functionCall;
617 var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
618 var createPropertyDescriptor$3 = createPropertyDescriptor$4;
619 var toIndexedObject$7 = toIndexedObject$8;
620 var toPropertyKey$2 = toPropertyKey$3;
621 var hasOwn$a = hasOwnProperty_1;
622 var IE8_DOM_DEFINE$1 = ie8DomDefine;
623
624 // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
625 var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
626
627 // `Object.getOwnPropertyDescriptor` method
628 // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
629 objectGetOwnPropertyDescriptor.f = DESCRIPTORS$c ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
630 O = toIndexedObject$7(O);
631 P = toPropertyKey$2(P);
632 if (IE8_DOM_DEFINE$1) try {
633 return $getOwnPropertyDescriptor$1(O, P);
634 } catch (error) { /* empty */ }
635 if (hasOwn$a(O, P)) return createPropertyDescriptor$3(!call$a(propertyIsEnumerableModule$1.f, O, P), O[P]);
636 };
637
638 var objectDefineProperty = {};
639
640 var DESCRIPTORS$b = descriptors;
641 var fails$o = fails$u;
642
643 // V8 ~ Chrome 36-
644 // https://bugs.chromium.org/p/v8/issues/detail?id=3334
645 var v8PrototypeDefineBug = DESCRIPTORS$b && fails$o(function () {
646 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
647 return Object.defineProperty(function () { /* empty */ }, 'prototype', {
648 value: 42,
649 writable: false
650 }).prototype != 42;
651 });
652
653 var global$r = global$G;
654 var isObject$6 = isObject$a;
655
656 var String$3 = global$r.String;
657 var TypeError$a = global$r.TypeError;
658
659 // `Assert: Type(argument) is Object`
660 var anObject$d = function (argument) {
661 if (isObject$6(argument)) return argument;
662 throw TypeError$a(String$3(argument) + ' is not an object');
663 };
664
665 var global$q = global$G;
666 var DESCRIPTORS$a = descriptors;
667 var IE8_DOM_DEFINE = ie8DomDefine;
668 var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
669 var anObject$c = anObject$d;
670 var toPropertyKey$1 = toPropertyKey$3;
671
672 var TypeError$9 = global$q.TypeError;
673 // eslint-disable-next-line es-x/no-object-defineproperty -- safe
674 var $defineProperty = Object.defineProperty;
675 // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
676 var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
677 var ENUMERABLE = 'enumerable';
678 var CONFIGURABLE$1 = 'configurable';
679 var WRITABLE = 'writable';
680
681 // `Object.defineProperty` method
682 // https://tc39.es/ecma262/#sec-object.defineproperty
683 objectDefineProperty.f = DESCRIPTORS$a ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
684 anObject$c(O);
685 P = toPropertyKey$1(P);
686 anObject$c(Attributes);
687 if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
688 var current = $getOwnPropertyDescriptor(O, P);
689 if (current && current[WRITABLE]) {
690 O[P] = Attributes.value;
691 Attributes = {
692 configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
693 enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
694 writable: false
695 };
696 }
697 } return $defineProperty(O, P, Attributes);
698 } : $defineProperty : function defineProperty(O, P, Attributes) {
699 anObject$c(O);
700 P = toPropertyKey$1(P);
701 anObject$c(Attributes);
702 if (IE8_DOM_DEFINE) try {
703 return $defineProperty(O, P, Attributes);
704 } catch (error) { /* empty */ }
705 if ('get' in Attributes || 'set' in Attributes) throw TypeError$9('Accessors not supported');
706 if ('value' in Attributes) O[P] = Attributes.value;
707 return O;
708 };
709
710 var DESCRIPTORS$9 = descriptors;
711 var definePropertyModule$5 = objectDefineProperty;
712 var createPropertyDescriptor$2 = createPropertyDescriptor$4;
713
714 var createNonEnumerableProperty$8 = DESCRIPTORS$9 ? function (object, key, value) {
715 return definePropertyModule$5.f(object, key, createPropertyDescriptor$2(1, value));
716 } : function (object, key, value) {
717 object[key] = value;
718 return object;
719 };
720
721 var makeBuiltIn$2 = {exports: {}};
722
723 var DESCRIPTORS$8 = descriptors;
724 var hasOwn$9 = hasOwnProperty_1;
725
726 var FunctionPrototype$1 = Function.prototype;
727 // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
728 var getDescriptor = DESCRIPTORS$8 && Object.getOwnPropertyDescriptor;
729
730 var EXISTS = hasOwn$9(FunctionPrototype$1, 'name');
731 // additional protection from minified / mangled / dropped function names
732 var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
733 var CONFIGURABLE = EXISTS && (!DESCRIPTORS$8 || (DESCRIPTORS$8 && getDescriptor(FunctionPrototype$1, 'name').configurable));
734
735 var functionName = {
736 EXISTS: EXISTS,
737 PROPER: PROPER,
738 CONFIGURABLE: CONFIGURABLE
739 };
740
741 var uncurryThis$t = functionUncurryThis;
742 var isCallable$d = isCallable$j;
743 var store$1 = sharedStore;
744
745 var functionToString = uncurryThis$t(Function.toString);
746
747 // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
748 if (!isCallable$d(store$1.inspectSource)) {
749 store$1.inspectSource = function (it) {
750 return functionToString(it);
751 };
752 }
753
754 var inspectSource$3 = store$1.inspectSource;
755
756 var global$p = global$G;
757 var isCallable$c = isCallable$j;
758 var inspectSource$2 = inspectSource$3;
759
760 var WeakMap$1 = global$p.WeakMap;
761
762 var nativeWeakMap = isCallable$c(WeakMap$1) && /native code/.test(inspectSource$2(WeakMap$1));
763
764 var shared$2 = shared$4.exports;
765 var uid = uid$2;
766
767 var keys$2 = shared$2('keys');
768
769 var sharedKey$3 = function (key) {
770 return keys$2[key] || (keys$2[key] = uid(key));
771 };
772
773 var hiddenKeys$4 = {};
774
775 var NATIVE_WEAK_MAP = nativeWeakMap;
776 var global$o = global$G;
777 var uncurryThis$s = functionUncurryThis;
778 var isObject$5 = isObject$a;
779 var createNonEnumerableProperty$7 = createNonEnumerableProperty$8;
780 var hasOwn$8 = hasOwnProperty_1;
781 var shared$1 = sharedStore;
782 var sharedKey$2 = sharedKey$3;
783 var hiddenKeys$3 = hiddenKeys$4;
784
785 var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
786 var TypeError$8 = global$o.TypeError;
787 var WeakMap = global$o.WeakMap;
788 var set, get, has;
789
790 var enforce = function (it) {
791 return has(it) ? get(it) : set(it, {});
792 };
793
794 var getterFor = function (TYPE) {
795 return function (it) {
796 var state;
797 if (!isObject$5(it) || (state = get(it)).type !== TYPE) {
798 throw TypeError$8('Incompatible receiver, ' + TYPE + ' required');
799 } return state;
800 };
801 };
802
803 if (NATIVE_WEAK_MAP || shared$1.state) {
804 var store = shared$1.state || (shared$1.state = new WeakMap());
805 var wmget = uncurryThis$s(store.get);
806 var wmhas = uncurryThis$s(store.has);
807 var wmset = uncurryThis$s(store.set);
808 set = function (it, metadata) {
809 if (wmhas(store, it)) throw new TypeError$8(OBJECT_ALREADY_INITIALIZED);
810 metadata.facade = it;
811 wmset(store, it, metadata);
812 return metadata;
813 };
814 get = function (it) {
815 return wmget(store, it) || {};
816 };
817 has = function (it) {
818 return wmhas(store, it);
819 };
820 } else {
821 var STATE = sharedKey$2('state');
822 hiddenKeys$3[STATE] = true;
823 set = function (it, metadata) {
824 if (hasOwn$8(it, STATE)) throw new TypeError$8(OBJECT_ALREADY_INITIALIZED);
825 metadata.facade = it;
826 createNonEnumerableProperty$7(it, STATE, metadata);
827 return metadata;
828 };
829 get = function (it) {
830 return hasOwn$8(it, STATE) ? it[STATE] : {};
831 };
832 has = function (it) {
833 return hasOwn$8(it, STATE);
834 };
835 }
836
837 var internalState = {
838 set: set,
839 get: get,
840 has: has,
841 enforce: enforce,
842 getterFor: getterFor
843 };
844
845 var fails$n = fails$u;
846 var isCallable$b = isCallable$j;
847 var hasOwn$7 = hasOwnProperty_1;
848 var DESCRIPTORS$7 = descriptors;
849 var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
850 var inspectSource$1 = inspectSource$3;
851 var InternalStateModule$1 = internalState;
852
853 var enforceInternalState$1 = InternalStateModule$1.enforce;
854 var getInternalState$2 = InternalStateModule$1.get;
855 // eslint-disable-next-line es-x/no-object-defineproperty -- safe
856 var defineProperty$5 = Object.defineProperty;
857
858 var CONFIGURABLE_LENGTH = DESCRIPTORS$7 && !fails$n(function () {
859 return defineProperty$5(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
860 });
861
862 var TEMPLATE = String(String).split('String');
863
864 var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
865 if (String(name).slice(0, 7) === 'Symbol(') {
866 name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
867 }
868 if (options && options.getter) name = 'get ' + name;
869 if (options && options.setter) name = 'set ' + name;
870 if (!hasOwn$7(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
871 defineProperty$5(value, 'name', { value: name, configurable: true });
872 }
873 if (CONFIGURABLE_LENGTH && options && hasOwn$7(options, 'arity') && value.length !== options.arity) {
874 defineProperty$5(value, 'length', { value: options.arity });
875 }
876 if (options && hasOwn$7(options, 'constructor') && options.constructor) {
877 if (DESCRIPTORS$7) try {
878 defineProperty$5(value, 'prototype', { writable: false });
879 } catch (error) { /* empty */ }
880 } else value.prototype = undefined;
881 var state = enforceInternalState$1(value);
882 if (!hasOwn$7(state, 'source')) {
883 state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
884 } return value;
885 };
886
887 // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
888 // eslint-disable-next-line no-extend-native -- required
889 Function.prototype.toString = makeBuiltIn$1(function toString() {
890 return isCallable$b(this) && getInternalState$2(this).source || inspectSource$1(this);
891 }, 'toString');
892
893 var global$n = global$G;
894 var isCallable$a = isCallable$j;
895 var createNonEnumerableProperty$6 = createNonEnumerableProperty$8;
896 var makeBuiltIn = makeBuiltIn$2.exports;
897 var setGlobal$1 = setGlobal$3;
898
899 var defineBuiltIn$8 = function (O, key, value, options) {
900 var unsafe = options ? !!options.unsafe : false;
901 var simple = options ? !!options.enumerable : false;
902 var noTargetGet = options ? !!options.noTargetGet : false;
903 var name = options && options.name !== undefined ? options.name : key;
904 if (isCallable$a(value)) makeBuiltIn(value, name, options);
905 if (O === global$n) {
906 if (simple) O[key] = value;
907 else setGlobal$1(key, value);
908 return O;
909 } else if (!unsafe) {
910 delete O[key];
911 } else if (!noTargetGet && O[key]) {
912 simple = true;
913 }
914 if (simple) O[key] = value;
915 else createNonEnumerableProperty$6(O, key, value);
916 return O;
917 };
918
919 var objectGetOwnPropertyNames = {};
920
921 var ceil = Math.ceil;
922 var floor$2 = Math.floor;
923
924 // `ToIntegerOrInfinity` abstract operation
925 // https://tc39.es/ecma262/#sec-tointegerorinfinity
926 var toIntegerOrInfinity$5 = function (argument) {
927 var number = +argument;
928 // eslint-disable-next-line no-self-compare -- safe
929 return number !== number || number === 0 ? 0 : (number > 0 ? floor$2 : ceil)(number);
930 };
931
932 var toIntegerOrInfinity$4 = toIntegerOrInfinity$5;
933
934 var max$4 = Math.max;
935 var min$6 = Math.min;
936
937 // Helper for a popular repeating case of the spec:
938 // Let integer be ? ToInteger(index).
939 // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
940 var toAbsoluteIndex$4 = function (index, length) {
941 var integer = toIntegerOrInfinity$4(index);
942 return integer < 0 ? max$4(integer + length, 0) : min$6(integer, length);
943 };
944
945 var toIntegerOrInfinity$3 = toIntegerOrInfinity$5;
946
947 var min$5 = Math.min;
948
949 // `ToLength` abstract operation
950 // https://tc39.es/ecma262/#sec-tolength
951 var toLength$6 = function (argument) {
952 return argument > 0 ? min$5(toIntegerOrInfinity$3(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
953 };
954
955 var toLength$5 = toLength$6;
956
957 // `LengthOfArrayLike` abstract operation
958 // https://tc39.es/ecma262/#sec-lengthofarraylike
959 var lengthOfArrayLike$7 = function (obj) {
960 return toLength$5(obj.length);
961 };
962
963 var toIndexedObject$6 = toIndexedObject$8;
964 var toAbsoluteIndex$3 = toAbsoluteIndex$4;
965 var lengthOfArrayLike$6 = lengthOfArrayLike$7;
966
967 // `Array.prototype.{ indexOf, includes }` methods implementation
968 var createMethod$4 = function (IS_INCLUDES) {
969 return function ($this, el, fromIndex) {
970 var O = toIndexedObject$6($this);
971 var length = lengthOfArrayLike$6(O);
972 var index = toAbsoluteIndex$3(fromIndex, length);
973 var value;
974 // Array#includes uses SameValueZero equality algorithm
975 // eslint-disable-next-line no-self-compare -- NaN check
976 if (IS_INCLUDES && el != el) while (length > index) {
977 value = O[index++];
978 // eslint-disable-next-line no-self-compare -- NaN check
979 if (value != value) return true;
980 // Array#indexOf ignores holes, Array#includes - not
981 } else for (;length > index; index++) {
982 if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
983 } return !IS_INCLUDES && -1;
984 };
985 };
986
987 var arrayIncludes = {
988 // `Array.prototype.includes` method
989 // https://tc39.es/ecma262/#sec-array.prototype.includes
990 includes: createMethod$4(true),
991 // `Array.prototype.indexOf` method
992 // https://tc39.es/ecma262/#sec-array.prototype.indexof
993 indexOf: createMethod$4(false)
994 };
995
996 var uncurryThis$r = functionUncurryThis;
997 var hasOwn$6 = hasOwnProperty_1;
998 var toIndexedObject$5 = toIndexedObject$8;
999 var indexOf$1 = arrayIncludes.indexOf;
1000 var hiddenKeys$2 = hiddenKeys$4;
1001
1002 var push$5 = uncurryThis$r([].push);
1003
1004 var objectKeysInternal = function (object, names) {
1005 var O = toIndexedObject$5(object);
1006 var i = 0;
1007 var result = [];
1008 var key;
1009 for (key in O) !hasOwn$6(hiddenKeys$2, key) && hasOwn$6(O, key) && push$5(result, key);
1010 // Don't enum bug & hidden keys
1011 while (names.length > i) if (hasOwn$6(O, key = names[i++])) {
1012 ~indexOf$1(result, key) || push$5(result, key);
1013 }
1014 return result;
1015 };
1016
1017 // IE8- don't enum bug keys
1018 var enumBugKeys$3 = [
1019 'constructor',
1020 'hasOwnProperty',
1021 'isPrototypeOf',
1022 'propertyIsEnumerable',
1023 'toLocaleString',
1024 'toString',
1025 'valueOf'
1026 ];
1027
1028 var internalObjectKeys$1 = objectKeysInternal;
1029 var enumBugKeys$2 = enumBugKeys$3;
1030
1031 var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
1032
1033 // `Object.getOwnPropertyNames` method
1034 // https://tc39.es/ecma262/#sec-object.getownpropertynames
1035 // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
1036 objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
1037 return internalObjectKeys$1(O, hiddenKeys$1);
1038 };
1039
1040 var objectGetOwnPropertySymbols = {};
1041
1042 // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
1043 objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
1044
1045 var getBuiltIn$3 = getBuiltIn$6;
1046 var uncurryThis$q = functionUncurryThis;
1047 var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
1048 var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
1049 var anObject$b = anObject$d;
1050
1051 var concat$2 = uncurryThis$q([].concat);
1052
1053 // all object keys, includes non-enumerable and symbols
1054 var ownKeys$1 = getBuiltIn$3('Reflect', 'ownKeys') || function ownKeys(it) {
1055 var keys = getOwnPropertyNamesModule.f(anObject$b(it));
1056 var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
1057 return getOwnPropertySymbols ? concat$2(keys, getOwnPropertySymbols(it)) : keys;
1058 };
1059
1060 var hasOwn$5 = hasOwnProperty_1;
1061 var ownKeys = ownKeys$1;
1062 var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
1063 var definePropertyModule$4 = objectDefineProperty;
1064
1065 var copyConstructorProperties$1 = function (target, source, exceptions) {
1066 var keys = ownKeys(source);
1067 var defineProperty = definePropertyModule$4.f;
1068 var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
1069 for (var i = 0; i < keys.length; i++) {
1070 var key = keys[i];
1071 if (!hasOwn$5(target, key) && !(exceptions && hasOwn$5(exceptions, key))) {
1072 defineProperty(target, key, getOwnPropertyDescriptor(source, key));
1073 }
1074 }
1075 };
1076
1077 var fails$m = fails$u;
1078 var isCallable$9 = isCallable$j;
1079
1080 var replacement = /#|\.prototype\./;
1081
1082 var isForced$3 = function (feature, detection) {
1083 var value = data[normalize(feature)];
1084 return value == POLYFILL ? true
1085 : value == NATIVE ? false
1086 : isCallable$9(detection) ? fails$m(detection)
1087 : !!detection;
1088 };
1089
1090 var normalize = isForced$3.normalize = function (string) {
1091 return String(string).replace(replacement, '.').toLowerCase();
1092 };
1093
1094 var data = isForced$3.data = {};
1095 var NATIVE = isForced$3.NATIVE = 'N';
1096 var POLYFILL = isForced$3.POLYFILL = 'P';
1097
1098 var isForced_1 = isForced$3;
1099
1100 var global$m = global$G;
1101 var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f;
1102 var createNonEnumerableProperty$5 = createNonEnumerableProperty$8;
1103 var defineBuiltIn$7 = defineBuiltIn$8;
1104 var setGlobal = setGlobal$3;
1105 var copyConstructorProperties = copyConstructorProperties$1;
1106 var isForced$2 = isForced_1;
1107
1108 /*
1109 options.target - name of the target object
1110 options.global - target is the global object
1111 options.stat - export as static methods of target
1112 options.proto - export as prototype methods of target
1113 options.real - real prototype method for the `pure` version
1114 options.forced - export even if the native feature is available
1115 options.bind - bind methods to the target, required for the `pure` version
1116 options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
1117 options.unsafe - use the simple assignment of property instead of delete + defineProperty
1118 options.sham - add a flag to not completely full polyfills
1119 options.enumerable - export as enumerable property
1120 options.noTargetGet - prevent calling a getter on target
1121 options.name - the .name of the function if it does not match the key
1122 */
1123 var _export = function (options, source) {
1124 var TARGET = options.target;
1125 var GLOBAL = options.global;
1126 var STATIC = options.stat;
1127 var FORCED, target, key, targetProperty, sourceProperty, descriptor;
1128 if (GLOBAL) {
1129 target = global$m;
1130 } else if (STATIC) {
1131 target = global$m[TARGET] || setGlobal(TARGET, {});
1132 } else {
1133 target = (global$m[TARGET] || {}).prototype;
1134 }
1135 if (target) for (key in source) {
1136 sourceProperty = source[key];
1137 if (options.noTargetGet) {
1138 descriptor = getOwnPropertyDescriptor$3(target, key);
1139 targetProperty = descriptor && descriptor.value;
1140 } else targetProperty = target[key];
1141 FORCED = isForced$2(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1142 // contained in target
1143 if (!FORCED && targetProperty !== undefined) {
1144 if (typeof sourceProperty == typeof targetProperty) continue;
1145 copyConstructorProperties(sourceProperty, targetProperty);
1146 }
1147 // add a flag to not completely full polyfills
1148 if (options.sham || (targetProperty && targetProperty.sham)) {
1149 createNonEnumerableProperty$5(sourceProperty, 'sham', true);
1150 }
1151 defineBuiltIn$7(target, key, sourceProperty, options);
1152 }
1153 };
1154
1155 var internalObjectKeys = objectKeysInternal;
1156 var enumBugKeys$1 = enumBugKeys$3;
1157
1158 // `Object.keys` method
1159 // https://tc39.es/ecma262/#sec-object.keys
1160 // eslint-disable-next-line es-x/no-object-keys -- safe
1161 var objectKeys$3 = Object.keys || function keys(O) {
1162 return internalObjectKeys(O, enumBugKeys$1);
1163 };
1164
1165 var DESCRIPTORS$6 = descriptors;
1166 var uncurryThis$p = functionUncurryThis;
1167 var call$9 = functionCall;
1168 var fails$l = fails$u;
1169 var objectKeys$2 = objectKeys$3;
1170 var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1171 var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1172 var toObject$7 = toObject$9;
1173 var IndexedObject$2 = indexedObject;
1174
1175 // eslint-disable-next-line es-x/no-object-assign -- safe
1176 var $assign = Object.assign;
1177 // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
1178 var defineProperty$4 = Object.defineProperty;
1179 var concat$1 = uncurryThis$p([].concat);
1180
1181 // `Object.assign` method
1182 // https://tc39.es/ecma262/#sec-object.assign
1183 var objectAssign = !$assign || fails$l(function () {
1184 // should have correct order of operations (Edge bug)
1185 if (DESCRIPTORS$6 && $assign({ b: 1 }, $assign(defineProperty$4({}, 'a', {
1186 enumerable: true,
1187 get: function () {
1188 defineProperty$4(this, 'b', {
1189 value: 3,
1190 enumerable: false
1191 });
1192 }
1193 }), { b: 2 })).b !== 1) return true;
1194 // should work with symbols and should have deterministic property order (V8 bug)
1195 var A = {};
1196 var B = {};
1197 // eslint-disable-next-line es-x/no-symbol -- safe
1198 var symbol = Symbol();
1199 var alphabet = 'abcdefghijklmnopqrst';
1200 A[symbol] = 7;
1201 alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1202 return $assign({}, A)[symbol] != 7 || objectKeys$2($assign({}, B)).join('') != alphabet;
1203 }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1204 var T = toObject$7(target);
1205 var argumentsLength = arguments.length;
1206 var index = 1;
1207 var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1208 var propertyIsEnumerable = propertyIsEnumerableModule.f;
1209 while (argumentsLength > index) {
1210 var S = IndexedObject$2(arguments[index++]);
1211 var keys = getOwnPropertySymbols ? concat$1(objectKeys$2(S), getOwnPropertySymbols(S)) : objectKeys$2(S);
1212 var length = keys.length;
1213 var j = 0;
1214 var key;
1215 while (length > j) {
1216 key = keys[j++];
1217 if (!DESCRIPTORS$6 || call$9(propertyIsEnumerable, S, key)) T[key] = S[key];
1218 }
1219 } return T;
1220 } : $assign;
1221
1222 var $$m = _export;
1223 var assign = objectAssign;
1224
1225 // `Object.assign` method
1226 // https://tc39.es/ecma262/#sec-object.assign
1227 // eslint-disable-next-line es-x/no-object-assign -- required for testing
1228 $$m({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1229 assign: assign
1230 });
1231
1232 var wellKnownSymbol$h = wellKnownSymbol$j;
1233
1234 var TO_STRING_TAG$3 = wellKnownSymbol$h('toStringTag');
1235 var test$2 = {};
1236
1237 test$2[TO_STRING_TAG$3] = 'z';
1238
1239 var toStringTagSupport = String(test$2) === '[object z]';
1240
1241 var global$l = global$G;
1242 var TO_STRING_TAG_SUPPORT$2 = toStringTagSupport;
1243 var isCallable$8 = isCallable$j;
1244 var classofRaw = classofRaw$1;
1245 var wellKnownSymbol$g = wellKnownSymbol$j;
1246
1247 var TO_STRING_TAG$2 = wellKnownSymbol$g('toStringTag');
1248 var Object$2 = global$l.Object;
1249
1250 // ES3 wrong here
1251 var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1252
1253 // fallback for IE11 Script Access Denied error
1254 var tryGet = function (it, key) {
1255 try {
1256 return it[key];
1257 } catch (error) { /* empty */ }
1258 };
1259
1260 // getting tag from ES6+ `Object.prototype.toString`
1261 var classof$6 = TO_STRING_TAG_SUPPORT$2 ? classofRaw : function (it) {
1262 var O, tag, result;
1263 return it === undefined ? 'Undefined' : it === null ? 'Null'
1264 // @@toStringTag case
1265 : typeof (tag = tryGet(O = Object$2(it), TO_STRING_TAG$2)) == 'string' ? tag
1266 // builtinTag case
1267 : CORRECT_ARGUMENTS ? classofRaw(O)
1268 // ES3 arguments fallback
1269 : (result = classofRaw(O)) == 'Object' && isCallable$8(O.callee) ? 'Arguments' : result;
1270 };
1271
1272 var global$k = global$G;
1273 var classof$5 = classof$6;
1274
1275 var String$2 = global$k.String;
1276
1277 var toString$f = function (argument) {
1278 if (classof$5(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1279 return String$2(argument);
1280 };
1281
1282 // a string of all valid unicode whitespaces
1283 var whitespaces$4 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
1284 '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1285
1286 var uncurryThis$o = functionUncurryThis;
1287 var requireObjectCoercible$8 = requireObjectCoercible$b;
1288 var toString$e = toString$f;
1289 var whitespaces$3 = whitespaces$4;
1290
1291 var replace$3 = uncurryThis$o(''.replace);
1292 var whitespace = '[' + whitespaces$3 + ']';
1293 var ltrim = RegExp('^' + whitespace + whitespace + '*');
1294 var rtrim = RegExp(whitespace + whitespace + '*$');
1295
1296 // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1297 var createMethod$3 = function (TYPE) {
1298 return function ($this) {
1299 var string = toString$e(requireObjectCoercible$8($this));
1300 if (TYPE & 1) string = replace$3(string, ltrim, '');
1301 if (TYPE & 2) string = replace$3(string, rtrim, '');
1302 return string;
1303 };
1304 };
1305
1306 var stringTrim = {
1307 // `String.prototype.{ trimLeft, trimStart }` methods
1308 // https://tc39.es/ecma262/#sec-string.prototype.trimstart
1309 start: createMethod$3(1),
1310 // `String.prototype.{ trimRight, trimEnd }` methods
1311 // https://tc39.es/ecma262/#sec-string.prototype.trimend
1312 end: createMethod$3(2),
1313 // `String.prototype.trim` method
1314 // https://tc39.es/ecma262/#sec-string.prototype.trim
1315 trim: createMethod$3(3)
1316 };
1317
1318 var PROPER_FUNCTION_NAME$2 = functionName.PROPER;
1319 var fails$k = fails$u;
1320 var whitespaces$2 = whitespaces$4;
1321
1322 var non = '\u200B\u0085\u180E';
1323
1324 // check that a method works with the correct list
1325 // of whitespaces and has a correct name
1326 var stringTrimForced = function (METHOD_NAME) {
1327 return fails$k(function () {
1328 return !!whitespaces$2[METHOD_NAME]()
1329 || non[METHOD_NAME]() !== non
1330 || (PROPER_FUNCTION_NAME$2 && whitespaces$2[METHOD_NAME].name !== METHOD_NAME);
1331 });
1332 };
1333
1334 var $$l = _export;
1335 var $trim = stringTrim.trim;
1336 var forcedStringTrimMethod = stringTrimForced;
1337
1338 // `String.prototype.trim` method
1339 // https://tc39.es/ecma262/#sec-string.prototype.trim
1340 $$l({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
1341 trim: function trim() {
1342 return $trim(this);
1343 }
1344 });
1345
1346 var fails$j = fails$u;
1347
1348 var arrayMethodIsStrict$4 = function (METHOD_NAME, argument) {
1349 var method = [][METHOD_NAME];
1350 return !!method && fails$j(function () {
1351 // eslint-disable-next-line no-useless-call -- required for testing
1352 method.call(null, argument || function () { return 1; }, 1);
1353 });
1354 };
1355
1356 var $$k = _export;
1357 var uncurryThis$n = functionUncurryThis;
1358 var IndexedObject$1 = indexedObject;
1359 var toIndexedObject$4 = toIndexedObject$8;
1360 var arrayMethodIsStrict$3 = arrayMethodIsStrict$4;
1361
1362 var un$Join = uncurryThis$n([].join);
1363
1364 var ES3_STRINGS = IndexedObject$1 != Object;
1365 var STRICT_METHOD$3 = arrayMethodIsStrict$3('join', ',');
1366
1367 // `Array.prototype.join` method
1368 // https://tc39.es/ecma262/#sec-array.prototype.join
1369 $$k({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$3 }, {
1370 join: function join(separator) {
1371 return un$Join(toIndexedObject$4(this), separator === undefined ? ',' : separator);
1372 }
1373 });
1374
1375 var anObject$a = anObject$d;
1376
1377 // `RegExp.prototype.flags` getter implementation
1378 // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
1379 var regexpFlags$1 = function () {
1380 var that = anObject$a(this);
1381 var result = '';
1382 if (that.hasIndices) result += 'd';
1383 if (that.global) result += 'g';
1384 if (that.ignoreCase) result += 'i';
1385 if (that.multiline) result += 'm';
1386 if (that.dotAll) result += 's';
1387 if (that.unicode) result += 'u';
1388 if (that.sticky) result += 'y';
1389 return result;
1390 };
1391
1392 var fails$i = fails$u;
1393 var global$j = global$G;
1394
1395 // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
1396 var $RegExp$2 = global$j.RegExp;
1397
1398 var UNSUPPORTED_Y$3 = fails$i(function () {
1399 var re = $RegExp$2('a', 'y');
1400 re.lastIndex = 2;
1401 return re.exec('abcd') != null;
1402 });
1403
1404 // UC Browser bug
1405 // https://github.com/zloirock/core-js/issues/1008
1406 var MISSED_STICKY$1 = UNSUPPORTED_Y$3 || fails$i(function () {
1407 return !$RegExp$2('a', 'y').sticky;
1408 });
1409
1410 var BROKEN_CARET = UNSUPPORTED_Y$3 || fails$i(function () {
1411 // https://bugzilla.mozilla.org/show_bug.cgi?id=773687
1412 var re = $RegExp$2('^r', 'gy');
1413 re.lastIndex = 2;
1414 return re.exec('str') != null;
1415 });
1416
1417 var regexpStickyHelpers = {
1418 BROKEN_CARET: BROKEN_CARET,
1419 MISSED_STICKY: MISSED_STICKY$1,
1420 UNSUPPORTED_Y: UNSUPPORTED_Y$3
1421 };
1422
1423 var objectDefineProperties = {};
1424
1425 var DESCRIPTORS$5 = descriptors;
1426 var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1427 var definePropertyModule$3 = objectDefineProperty;
1428 var anObject$9 = anObject$d;
1429 var toIndexedObject$3 = toIndexedObject$8;
1430 var objectKeys$1 = objectKeys$3;
1431
1432 // `Object.defineProperties` method
1433 // https://tc39.es/ecma262/#sec-object.defineproperties
1434 // eslint-disable-next-line es-x/no-object-defineproperties -- safe
1435 objectDefineProperties.f = DESCRIPTORS$5 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1436 anObject$9(O);
1437 var props = toIndexedObject$3(Properties);
1438 var keys = objectKeys$1(Properties);
1439 var length = keys.length;
1440 var index = 0;
1441 var key;
1442 while (length > index) definePropertyModule$3.f(O, key = keys[index++], props[key]);
1443 return O;
1444 };
1445
1446 var getBuiltIn$2 = getBuiltIn$6;
1447
1448 var html$1 = getBuiltIn$2('document', 'documentElement');
1449
1450 /* global ActiveXObject -- old IE, WSH */
1451
1452 var anObject$8 = anObject$d;
1453 var definePropertiesModule = objectDefineProperties;
1454 var enumBugKeys = enumBugKeys$3;
1455 var hiddenKeys = hiddenKeys$4;
1456 var html = html$1;
1457 var documentCreateElement$1 = documentCreateElement$2;
1458 var sharedKey$1 = sharedKey$3;
1459
1460 var GT = '>';
1461 var LT = '<';
1462 var PROTOTYPE = 'prototype';
1463 var SCRIPT = 'script';
1464 var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1465
1466 var EmptyConstructor = function () { /* empty */ };
1467
1468 var scriptTag = function (content) {
1469 return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1470 };
1471
1472 // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1473 var NullProtoObjectViaActiveX = function (activeXDocument) {
1474 activeXDocument.write(scriptTag(''));
1475 activeXDocument.close();
1476 var temp = activeXDocument.parentWindow.Object;
1477 activeXDocument = null; // avoid memory leak
1478 return temp;
1479 };
1480
1481 // Create object with fake `null` prototype: use iframe Object with cleared prototype
1482 var NullProtoObjectViaIFrame = function () {
1483 // Thrash, waste and sodomy: IE GC bug
1484 var iframe = documentCreateElement$1('iframe');
1485 var JS = 'java' + SCRIPT + ':';
1486 var iframeDocument;
1487 iframe.style.display = 'none';
1488 html.appendChild(iframe);
1489 // https://github.com/zloirock/core-js/issues/475
1490 iframe.src = String(JS);
1491 iframeDocument = iframe.contentWindow.document;
1492 iframeDocument.open();
1493 iframeDocument.write(scriptTag('document.F=Object'));
1494 iframeDocument.close();
1495 return iframeDocument.F;
1496 };
1497
1498 // Check for document.domain and active x support
1499 // No need to use active x approach when document.domain is not set
1500 // see https://github.com/es-shims/es5-shim/issues/150
1501 // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1502 // avoid IE GC bug
1503 var activeXDocument;
1504 var NullProtoObject = function () {
1505 try {
1506 activeXDocument = new ActiveXObject('htmlfile');
1507 } catch (error) { /* ignore */ }
1508 NullProtoObject = typeof document != 'undefined'
1509 ? document.domain && activeXDocument
1510 ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1511 : NullProtoObjectViaIFrame()
1512 : NullProtoObjectViaActiveX(activeXDocument); // WSH
1513 var length = enumBugKeys.length;
1514 while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1515 return NullProtoObject();
1516 };
1517
1518 hiddenKeys[IE_PROTO$1] = true;
1519
1520 // `Object.create` method
1521 // https://tc39.es/ecma262/#sec-object.create
1522 // eslint-disable-next-line es-x/no-object-create -- safe
1523 var objectCreate = Object.create || function create(O, Properties) {
1524 var result;
1525 if (O !== null) {
1526 EmptyConstructor[PROTOTYPE] = anObject$8(O);
1527 result = new EmptyConstructor();
1528 EmptyConstructor[PROTOTYPE] = null;
1529 // add "__proto__" for Object.getPrototypeOf polyfill
1530 result[IE_PROTO$1] = O;
1531 } else result = NullProtoObject();
1532 return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1533 };
1534
1535 var fails$h = fails$u;
1536 var global$i = global$G;
1537
1538 // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
1539 var $RegExp$1 = global$i.RegExp;
1540
1541 var regexpUnsupportedDotAll = fails$h(function () {
1542 var re = $RegExp$1('.', 's');
1543 return !(re.dotAll && re.exec('\n') && re.flags === 's');
1544 });
1545
1546 var fails$g = fails$u;
1547 var global$h = global$G;
1548
1549 // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
1550 var $RegExp = global$h.RegExp;
1551
1552 var regexpUnsupportedNcg = fails$g(function () {
1553 var re = $RegExp('(?<a>b)', 'g');
1554 return re.exec('b').groups.a !== 'b' ||
1555 'b'.replace(re, '$<a>c') !== 'bc';
1556 });
1557
1558 /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
1559 /* eslint-disable regexp/no-useless-quantifier -- testing */
1560 var call$8 = functionCall;
1561 var uncurryThis$m = functionUncurryThis;
1562 var toString$d = toString$f;
1563 var regexpFlags = regexpFlags$1;
1564 var stickyHelpers$2 = regexpStickyHelpers;
1565 var shared = shared$4.exports;
1566 var create$2 = objectCreate;
1567 var getInternalState$1 = internalState.get;
1568 var UNSUPPORTED_DOT_ALL$1 = regexpUnsupportedDotAll;
1569 var UNSUPPORTED_NCG$1 = regexpUnsupportedNcg;
1570
1571 var nativeReplace = shared('native-string-replace', String.prototype.replace);
1572 var nativeExec = RegExp.prototype.exec;
1573 var patchedExec = nativeExec;
1574 var charAt$5 = uncurryThis$m(''.charAt);
1575 var indexOf = uncurryThis$m(''.indexOf);
1576 var replace$2 = uncurryThis$m(''.replace);
1577 var stringSlice$6 = uncurryThis$m(''.slice);
1578
1579 var UPDATES_LAST_INDEX_WRONG = (function () {
1580 var re1 = /a/;
1581 var re2 = /b*/g;
1582 call$8(nativeExec, re1, 'a');
1583 call$8(nativeExec, re2, 'a');
1584 return re1.lastIndex !== 0 || re2.lastIndex !== 0;
1585 })();
1586
1587 var UNSUPPORTED_Y$2 = stickyHelpers$2.BROKEN_CARET;
1588
1589 // nonparticipating capturing group, copied from es5-shim's String#split patch.
1590 var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
1591
1592 var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$2 || UNSUPPORTED_DOT_ALL$1 || UNSUPPORTED_NCG$1;
1593
1594 if (PATCH) {
1595 patchedExec = function exec(string) {
1596 var re = this;
1597 var state = getInternalState$1(re);
1598 var str = toString$d(string);
1599 var raw = state.raw;
1600 var result, reCopy, lastIndex, match, i, object, group;
1601
1602 if (raw) {
1603 raw.lastIndex = re.lastIndex;
1604 result = call$8(patchedExec, raw, str);
1605 re.lastIndex = raw.lastIndex;
1606 return result;
1607 }
1608
1609 var groups = state.groups;
1610 var sticky = UNSUPPORTED_Y$2 && re.sticky;
1611 var flags = call$8(regexpFlags, re);
1612 var source = re.source;
1613 var charsAdded = 0;
1614 var strCopy = str;
1615
1616 if (sticky) {
1617 flags = replace$2(flags, 'y', '');
1618 if (indexOf(flags, 'g') === -1) {
1619 flags += 'g';
1620 }
1621
1622 strCopy = stringSlice$6(str, re.lastIndex);
1623 // Support anchored sticky behavior.
1624 if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$5(str, re.lastIndex - 1) !== '\n')) {
1625 source = '(?: ' + source + ')';
1626 strCopy = ' ' + strCopy;
1627 charsAdded++;
1628 }
1629 // ^(? + rx + ) is needed, in combination with some str slicing, to
1630 // simulate the 'y' flag.
1631 reCopy = new RegExp('^(?:' + source + ')', flags);
1632 }
1633
1634 if (NPCG_INCLUDED) {
1635 reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
1636 }
1637 if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
1638
1639 match = call$8(nativeExec, sticky ? reCopy : re, strCopy);
1640
1641 if (sticky) {
1642 if (match) {
1643 match.input = stringSlice$6(match.input, charsAdded);
1644 match[0] = stringSlice$6(match[0], charsAdded);
1645 match.index = re.lastIndex;
1646 re.lastIndex += match[0].length;
1647 } else re.lastIndex = 0;
1648 } else if (UPDATES_LAST_INDEX_WRONG && match) {
1649 re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
1650 }
1651 if (NPCG_INCLUDED && match && match.length > 1) {
1652 // Fix browsers whose `exec` methods don't consistently return `undefined`
1653 // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
1654 call$8(nativeReplace, match[0], reCopy, function () {
1655 for (i = 1; i < arguments.length - 2; i++) {
1656 if (arguments[i] === undefined) match[i] = undefined;
1657 }
1658 });
1659 }
1660
1661 if (match && groups) {
1662 match.groups = object = create$2(null);
1663 for (i = 0; i < groups.length; i++) {
1664 group = groups[i];
1665 object[group[0]] = match[group[1]];
1666 }
1667 }
1668
1669 return match;
1670 };
1671 }
1672
1673 var regexpExec$3 = patchedExec;
1674
1675 var $$j = _export;
1676 var exec$4 = regexpExec$3;
1677
1678 // `RegExp.prototype.exec` method
1679 // https://tc39.es/ecma262/#sec-regexp.prototype.exec
1680 $$j({ target: 'RegExp', proto: true, forced: /./.exec !== exec$4 }, {
1681 exec: exec$4
1682 });
1683
1684 var NATIVE_BIND$1 = functionBindNative;
1685
1686 var FunctionPrototype = Function.prototype;
1687 var apply$2 = FunctionPrototype.apply;
1688 var call$7 = FunctionPrototype.call;
1689
1690 // eslint-disable-next-line es-x/no-reflect -- safe
1691 var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$7.bind(apply$2) : function () {
1692 return call$7.apply(apply$2, arguments);
1693 });
1694
1695 // TODO: Remove from `core-js@4` since it's moved to entry points
1696
1697 var uncurryThis$l = functionUncurryThis;
1698 var defineBuiltIn$6 = defineBuiltIn$8;
1699 var regexpExec$2 = regexpExec$3;
1700 var fails$f = fails$u;
1701 var wellKnownSymbol$f = wellKnownSymbol$j;
1702 var createNonEnumerableProperty$4 = createNonEnumerableProperty$8;
1703
1704 var SPECIES$5 = wellKnownSymbol$f('species');
1705 var RegExpPrototype$3 = RegExp.prototype;
1706
1707 var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
1708 var SYMBOL = wellKnownSymbol$f(KEY);
1709
1710 var DELEGATES_TO_SYMBOL = !fails$f(function () {
1711 // String methods call symbol-named RegEp methods
1712 var O = {};
1713 O[SYMBOL] = function () { return 7; };
1714 return ''[KEY](O) != 7;
1715 });
1716
1717 var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$f(function () {
1718 // Symbol-named RegExp methods call .exec
1719 var execCalled = false;
1720 var re = /a/;
1721
1722 if (KEY === 'split') {
1723 // We can't use real regex here since it causes deoptimization
1724 // and serious performance degradation in V8
1725 // https://github.com/zloirock/core-js/issues/306
1726 re = {};
1727 // RegExp[@@split] doesn't call the regex's exec method, but first creates
1728 // a new one. We need to return the patched regex when creating the new one.
1729 re.constructor = {};
1730 re.constructor[SPECIES$5] = function () { return re; };
1731 re.flags = '';
1732 re[SYMBOL] = /./[SYMBOL];
1733 }
1734
1735 re.exec = function () { execCalled = true; return null; };
1736
1737 re[SYMBOL]('');
1738 return !execCalled;
1739 });
1740
1741 if (
1742 !DELEGATES_TO_SYMBOL ||
1743 !DELEGATES_TO_EXEC ||
1744 FORCED
1745 ) {
1746 var uncurriedNativeRegExpMethod = uncurryThis$l(/./[SYMBOL]);
1747 var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
1748 var uncurriedNativeMethod = uncurryThis$l(nativeMethod);
1749 var $exec = regexp.exec;
1750 if ($exec === regexpExec$2 || $exec === RegExpPrototype$3.exec) {
1751 if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
1752 // The native String method already delegates to @@method (this
1753 // polyfilled function), leasing to infinite recursion.
1754 // We avoid it by directly calling the native @@method method.
1755 return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
1756 }
1757 return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
1758 }
1759 return { done: false };
1760 });
1761
1762 defineBuiltIn$6(String.prototype, KEY, methods[0]);
1763 defineBuiltIn$6(RegExpPrototype$3, SYMBOL, methods[1]);
1764 }
1765
1766 if (SHAM) createNonEnumerableProperty$4(RegExpPrototype$3[SYMBOL], 'sham', true);
1767 };
1768
1769 var isObject$4 = isObject$a;
1770 var classof$4 = classofRaw$1;
1771 var wellKnownSymbol$e = wellKnownSymbol$j;
1772
1773 var MATCH$2 = wellKnownSymbol$e('match');
1774
1775 // `IsRegExp` abstract operation
1776 // https://tc39.es/ecma262/#sec-isregexp
1777 var isRegexp = function (it) {
1778 var isRegExp;
1779 return isObject$4(it) && ((isRegExp = it[MATCH$2]) !== undefined ? !!isRegExp : classof$4(it) == 'RegExp');
1780 };
1781
1782 var uncurryThis$k = functionUncurryThis;
1783 var fails$e = fails$u;
1784 var isCallable$7 = isCallable$j;
1785 var classof$3 = classof$6;
1786 var getBuiltIn$1 = getBuiltIn$6;
1787 var inspectSource = inspectSource$3;
1788
1789 var noop = function () { /* empty */ };
1790 var empty = [];
1791 var construct = getBuiltIn$1('Reflect', 'construct');
1792 var constructorRegExp = /^\s*(?:class|function)\b/;
1793 var exec$3 = uncurryThis$k(constructorRegExp.exec);
1794 var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1795
1796 var isConstructorModern = function isConstructor(argument) {
1797 if (!isCallable$7(argument)) return false;
1798 try {
1799 construct(noop, empty, argument);
1800 return true;
1801 } catch (error) {
1802 return false;
1803 }
1804 };
1805
1806 var isConstructorLegacy = function isConstructor(argument) {
1807 if (!isCallable$7(argument)) return false;
1808 switch (classof$3(argument)) {
1809 case 'AsyncFunction':
1810 case 'GeneratorFunction':
1811 case 'AsyncGeneratorFunction': return false;
1812 }
1813 try {
1814 // we can't check .prototype since constructors produced by .bind haven't it
1815 // `Function#toString` throws on some built-it function in some legacy engines
1816 // (for example, `DOMQuad` and similar in FF41-)
1817 return INCORRECT_TO_STRING || !!exec$3(constructorRegExp, inspectSource(argument));
1818 } catch (error) {
1819 return true;
1820 }
1821 };
1822
1823 isConstructorLegacy.sham = true;
1824
1825 // `IsConstructor` abstract operation
1826 // https://tc39.es/ecma262/#sec-isconstructor
1827 var isConstructor$3 = !construct || fails$e(function () {
1828 var called;
1829 return isConstructorModern(isConstructorModern.call)
1830 || !isConstructorModern(Object)
1831 || !isConstructorModern(function () { called = true; })
1832 || called;
1833 }) ? isConstructorLegacy : isConstructorModern;
1834
1835 var global$g = global$G;
1836 var isConstructor$2 = isConstructor$3;
1837 var tryToString = tryToString$2;
1838
1839 var TypeError$7 = global$g.TypeError;
1840
1841 // `Assert: IsConstructor(argument) is true`
1842 var aConstructor$1 = function (argument) {
1843 if (isConstructor$2(argument)) return argument;
1844 throw TypeError$7(tryToString(argument) + ' is not a constructor');
1845 };
1846
1847 var anObject$7 = anObject$d;
1848 var aConstructor = aConstructor$1;
1849 var wellKnownSymbol$d = wellKnownSymbol$j;
1850
1851 var SPECIES$4 = wellKnownSymbol$d('species');
1852
1853 // `SpeciesConstructor` abstract operation
1854 // https://tc39.es/ecma262/#sec-speciesconstructor
1855 var speciesConstructor$1 = function (O, defaultConstructor) {
1856 var C = anObject$7(O).constructor;
1857 var S;
1858 return C === undefined || (S = anObject$7(C)[SPECIES$4]) == undefined ? defaultConstructor : aConstructor(S);
1859 };
1860
1861 var uncurryThis$j = functionUncurryThis;
1862 var toIntegerOrInfinity$2 = toIntegerOrInfinity$5;
1863 var toString$c = toString$f;
1864 var requireObjectCoercible$7 = requireObjectCoercible$b;
1865
1866 var charAt$4 = uncurryThis$j(''.charAt);
1867 var charCodeAt$1 = uncurryThis$j(''.charCodeAt);
1868 var stringSlice$5 = uncurryThis$j(''.slice);
1869
1870 var createMethod$2 = function (CONVERT_TO_STRING) {
1871 return function ($this, pos) {
1872 var S = toString$c(requireObjectCoercible$7($this));
1873 var position = toIntegerOrInfinity$2(pos);
1874 var size = S.length;
1875 var first, second;
1876 if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
1877 first = charCodeAt$1(S, position);
1878 return first < 0xD800 || first > 0xDBFF || position + 1 === size
1879 || (second = charCodeAt$1(S, position + 1)) < 0xDC00 || second > 0xDFFF
1880 ? CONVERT_TO_STRING
1881 ? charAt$4(S, position)
1882 : first
1883 : CONVERT_TO_STRING
1884 ? stringSlice$5(S, position, position + 2)
1885 : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
1886 };
1887 };
1888
1889 var stringMultibyte = {
1890 // `String.prototype.codePointAt` method
1891 // https://tc39.es/ecma262/#sec-string.prototype.codepointat
1892 codeAt: createMethod$2(false),
1893 // `String.prototype.at` method
1894 // https://github.com/mathiasbynens/String.prototype.at
1895 charAt: createMethod$2(true)
1896 };
1897
1898 var charAt$3 = stringMultibyte.charAt;
1899
1900 // `AdvanceStringIndex` abstract operation
1901 // https://tc39.es/ecma262/#sec-advancestringindex
1902 var advanceStringIndex$3 = function (S, index, unicode) {
1903 return index + (unicode ? charAt$3(S, index).length : 1);
1904 };
1905
1906 var toPropertyKey = toPropertyKey$3;
1907 var definePropertyModule$2 = objectDefineProperty;
1908 var createPropertyDescriptor$1 = createPropertyDescriptor$4;
1909
1910 var createProperty$4 = function (object, key, value) {
1911 var propertyKey = toPropertyKey(key);
1912 if (propertyKey in object) definePropertyModule$2.f(object, propertyKey, createPropertyDescriptor$1(0, value));
1913 else object[propertyKey] = value;
1914 };
1915
1916 var global$f = global$G;
1917 var toAbsoluteIndex$2 = toAbsoluteIndex$4;
1918 var lengthOfArrayLike$5 = lengthOfArrayLike$7;
1919 var createProperty$3 = createProperty$4;
1920
1921 var Array$3 = global$f.Array;
1922 var max$3 = Math.max;
1923
1924 var arraySliceSimple = function (O, start, end) {
1925 var length = lengthOfArrayLike$5(O);
1926 var k = toAbsoluteIndex$2(start, length);
1927 var fin = toAbsoluteIndex$2(end === undefined ? length : end, length);
1928 var result = Array$3(max$3(fin - k, 0));
1929 for (var n = 0; k < fin; k++, n++) createProperty$3(result, n, O[k]);
1930 result.length = n;
1931 return result;
1932 };
1933
1934 var global$e = global$G;
1935 var call$6 = functionCall;
1936 var anObject$6 = anObject$d;
1937 var isCallable$6 = isCallable$j;
1938 var classof$2 = classofRaw$1;
1939 var regexpExec$1 = regexpExec$3;
1940
1941 var TypeError$6 = global$e.TypeError;
1942
1943 // `RegExpExec` abstract operation
1944 // https://tc39.es/ecma262/#sec-regexpexec
1945 var regexpExecAbstract = function (R, S) {
1946 var exec = R.exec;
1947 if (isCallable$6(exec)) {
1948 var result = call$6(exec, R, S);
1949 if (result !== null) anObject$6(result);
1950 return result;
1951 }
1952 if (classof$2(R) === 'RegExp') return call$6(regexpExec$1, R, S);
1953 throw TypeError$6('RegExp#exec called on incompatible receiver');
1954 };
1955
1956 var apply$1 = functionApply;
1957 var call$5 = functionCall;
1958 var uncurryThis$i = functionUncurryThis;
1959 var fixRegExpWellKnownSymbolLogic$3 = fixRegexpWellKnownSymbolLogic;
1960 var isRegExp$2 = isRegexp;
1961 var anObject$5 = anObject$d;
1962 var requireObjectCoercible$6 = requireObjectCoercible$b;
1963 var speciesConstructor = speciesConstructor$1;
1964 var advanceStringIndex$2 = advanceStringIndex$3;
1965 var toLength$4 = toLength$6;
1966 var toString$b = toString$f;
1967 var getMethod$3 = getMethod$5;
1968 var arraySlice$3 = arraySliceSimple;
1969 var callRegExpExec = regexpExecAbstract;
1970 var regexpExec = regexpExec$3;
1971 var stickyHelpers$1 = regexpStickyHelpers;
1972 var fails$d = fails$u;
1973
1974 var UNSUPPORTED_Y$1 = stickyHelpers$1.UNSUPPORTED_Y;
1975 var MAX_UINT32 = 0xFFFFFFFF;
1976 var min$4 = Math.min;
1977 var $push = [].push;
1978 var exec$2 = uncurryThis$i(/./.exec);
1979 var push$4 = uncurryThis$i($push);
1980 var stringSlice$4 = uncurryThis$i(''.slice);
1981
1982 // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
1983 // Weex JS has frozen built-in prototypes, so use try / catch wrapper
1984 var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$d(function () {
1985 // eslint-disable-next-line regexp/no-empty-group -- required for testing
1986 var re = /(?:)/;
1987 var originalExec = re.exec;
1988 re.exec = function () { return originalExec.apply(this, arguments); };
1989 var result = 'ab'.split(re);
1990 return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
1991 });
1992
1993 // @@split logic
1994 fixRegExpWellKnownSymbolLogic$3('split', function (SPLIT, nativeSplit, maybeCallNative) {
1995 var internalSplit;
1996 if (
1997 'abbc'.split(/(b)*/)[1] == 'c' ||
1998 // eslint-disable-next-line regexp/no-empty-group -- required for testing
1999 'test'.split(/(?:)/, -1).length != 4 ||
2000 'ab'.split(/(?:ab)*/).length != 2 ||
2001 '.'.split(/(.?)(.?)/).length != 4 ||
2002 // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
2003 '.'.split(/()()/).length > 1 ||
2004 ''.split(/.?/).length
2005 ) {
2006 // based on es5-shim implementation, need to rework it
2007 internalSplit = function (separator, limit) {
2008 var string = toString$b(requireObjectCoercible$6(this));
2009 var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
2010 if (lim === 0) return [];
2011 if (separator === undefined) return [string];
2012 // If `separator` is not a regex, use native split
2013 if (!isRegExp$2(separator)) {
2014 return call$5(nativeSplit, string, separator, lim);
2015 }
2016 var output = [];
2017 var flags = (separator.ignoreCase ? 'i' : '') +
2018 (separator.multiline ? 'm' : '') +
2019 (separator.unicode ? 'u' : '') +
2020 (separator.sticky ? 'y' : '');
2021 var lastLastIndex = 0;
2022 // Make `global` and avoid `lastIndex` issues by working with a copy
2023 var separatorCopy = new RegExp(separator.source, flags + 'g');
2024 var match, lastIndex, lastLength;
2025 while (match = call$5(regexpExec, separatorCopy, string)) {
2026 lastIndex = separatorCopy.lastIndex;
2027 if (lastIndex > lastLastIndex) {
2028 push$4(output, stringSlice$4(string, lastLastIndex, match.index));
2029 if (match.length > 1 && match.index < string.length) apply$1($push, output, arraySlice$3(match, 1));
2030 lastLength = match[0].length;
2031 lastLastIndex = lastIndex;
2032 if (output.length >= lim) break;
2033 }
2034 if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop
2035 }
2036 if (lastLastIndex === string.length) {
2037 if (lastLength || !exec$2(separatorCopy, '')) push$4(output, '');
2038 } else push$4(output, stringSlice$4(string, lastLastIndex));
2039 return output.length > lim ? arraySlice$3(output, 0, lim) : output;
2040 };
2041 // Chakra, V8
2042 } else if ('0'.split(undefined, 0).length) {
2043 internalSplit = function (separator, limit) {
2044 return separator === undefined && limit === 0 ? [] : call$5(nativeSplit, this, separator, limit);
2045 };
2046 } else internalSplit = nativeSplit;
2047
2048 return [
2049 // `String.prototype.split` method
2050 // https://tc39.es/ecma262/#sec-string.prototype.split
2051 function split(separator, limit) {
2052 var O = requireObjectCoercible$6(this);
2053 var splitter = separator == undefined ? undefined : getMethod$3(separator, SPLIT);
2054 return splitter
2055 ? call$5(splitter, separator, O, limit)
2056 : call$5(internalSplit, toString$b(O), separator, limit);
2057 },
2058 // `RegExp.prototype[@@split]` method
2059 // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
2060 //
2061 // NOTE: This cannot be properly polyfilled in engines that don't support
2062 // the 'y' flag.
2063 function (string, limit) {
2064 var rx = anObject$5(this);
2065 var S = toString$b(string);
2066 var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
2067
2068 if (res.done) return res.value;
2069
2070 var C = speciesConstructor(rx, RegExp);
2071
2072 var unicodeMatching = rx.unicode;
2073 var flags = (rx.ignoreCase ? 'i' : '') +
2074 (rx.multiline ? 'm' : '') +
2075 (rx.unicode ? 'u' : '') +
2076 (UNSUPPORTED_Y$1 ? 'g' : 'y');
2077
2078 // ^(? + rx + ) is needed, in combination with some S slicing, to
2079 // simulate the 'y' flag.
2080 var splitter = new C(UNSUPPORTED_Y$1 ? '^(?:' + rx.source + ')' : rx, flags);
2081 var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
2082 if (lim === 0) return [];
2083 if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
2084 var p = 0;
2085 var q = 0;
2086 var A = [];
2087 while (q < S.length) {
2088 splitter.lastIndex = UNSUPPORTED_Y$1 ? 0 : q;
2089 var z = callRegExpExec(splitter, UNSUPPORTED_Y$1 ? stringSlice$4(S, q) : S);
2090 var e;
2091 if (
2092 z === null ||
2093 (e = min$4(toLength$4(splitter.lastIndex + (UNSUPPORTED_Y$1 ? q : 0)), S.length)) === p
2094 ) {
2095 q = advanceStringIndex$2(S, q, unicodeMatching);
2096 } else {
2097 push$4(A, stringSlice$4(S, p, q));
2098 if (A.length === lim) return A;
2099 for (var i = 1; i <= z.length - 1; i++) {
2100 push$4(A, z[i]);
2101 if (A.length === lim) return A;
2102 }
2103 q = p = e;
2104 }
2105 }
2106 push$4(A, stringSlice$4(S, p));
2107 return A;
2108 }
2109 ];
2110 }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y$1);
2111
2112 var DESCRIPTORS$4 = descriptors;
2113 var uncurryThis$h = functionUncurryThis;
2114 var objectKeys = objectKeys$3;
2115 var toIndexedObject$2 = toIndexedObject$8;
2116 var $propertyIsEnumerable = objectPropertyIsEnumerable.f;
2117
2118 var propertyIsEnumerable = uncurryThis$h($propertyIsEnumerable);
2119 var push$3 = uncurryThis$h([].push);
2120
2121 // `Object.{ entries, values }` methods implementation
2122 var createMethod$1 = function (TO_ENTRIES) {
2123 return function (it) {
2124 var O = toIndexedObject$2(it);
2125 var keys = objectKeys(O);
2126 var length = keys.length;
2127 var i = 0;
2128 var result = [];
2129 var key;
2130 while (length > i) {
2131 key = keys[i++];
2132 if (!DESCRIPTORS$4 || propertyIsEnumerable(O, key)) {
2133 push$3(result, TO_ENTRIES ? [key, O[key]] : O[key]);
2134 }
2135 }
2136 return result;
2137 };
2138 };
2139
2140 var objectToArray = {
2141 // `Object.entries` method
2142 // https://tc39.es/ecma262/#sec-object.entries
2143 entries: createMethod$1(true),
2144 // `Object.values` method
2145 // https://tc39.es/ecma262/#sec-object.values
2146 values: createMethod$1(false)
2147 };
2148
2149 var $$i = _export;
2150 var $entries = objectToArray.entries;
2151
2152 // `Object.entries` method
2153 // https://tc39.es/ecma262/#sec-object.entries
2154 $$i({ target: 'Object', stat: true }, {
2155 entries: function entries(O) {
2156 return $entries(O);
2157 }
2158 });
2159
2160 var wellKnownSymbol$c = wellKnownSymbol$j;
2161 var create$1 = objectCreate;
2162 var definePropertyModule$1 = objectDefineProperty;
2163
2164 var UNSCOPABLES = wellKnownSymbol$c('unscopables');
2165 var ArrayPrototype = Array.prototype;
2166
2167 // Array.prototype[@@unscopables]
2168 // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2169 if (ArrayPrototype[UNSCOPABLES] == undefined) {
2170 definePropertyModule$1.f(ArrayPrototype, UNSCOPABLES, {
2171 configurable: true,
2172 value: create$1(null)
2173 });
2174 }
2175
2176 // add a key to Array.prototype[@@unscopables]
2177 var addToUnscopables$4 = function (key) {
2178 ArrayPrototype[UNSCOPABLES][key] = true;
2179 };
2180
2181 var $$h = _export;
2182 var $includes = arrayIncludes.includes;
2183 var fails$c = fails$u;
2184 var addToUnscopables$3 = addToUnscopables$4;
2185
2186 // FF99+ bug
2187 var BROKEN_ON_SPARSE = fails$c(function () {
2188 return !Array(1).includes();
2189 });
2190
2191 // `Array.prototype.includes` method
2192 // https://tc39.es/ecma262/#sec-array.prototype.includes
2193 $$h({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2194 includes: function includes(el /* , fromIndex = 0 */) {
2195 return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
2196 }
2197 });
2198
2199 // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2200 addToUnscopables$3('includes');
2201
2202 var classof$1 = classofRaw$1;
2203
2204 // `IsArray` abstract operation
2205 // https://tc39.es/ecma262/#sec-isarray
2206 // eslint-disable-next-line es-x/no-array-isarray -- safe
2207 var isArray$4 = Array.isArray || function isArray(argument) {
2208 return classof$1(argument) == 'Array';
2209 };
2210
2211 var global$d = global$G;
2212 var isArray$3 = isArray$4;
2213 var isConstructor$1 = isConstructor$3;
2214 var isObject$3 = isObject$a;
2215 var wellKnownSymbol$b = wellKnownSymbol$j;
2216
2217 var SPECIES$3 = wellKnownSymbol$b('species');
2218 var Array$2 = global$d.Array;
2219
2220 // a part of `ArraySpeciesCreate` abstract operation
2221 // https://tc39.es/ecma262/#sec-arrayspeciescreate
2222 var arraySpeciesConstructor$1 = function (originalArray) {
2223 var C;
2224 if (isArray$3(originalArray)) {
2225 C = originalArray.constructor;
2226 // cross-realm fallback
2227 if (isConstructor$1(C) && (C === Array$2 || isArray$3(C.prototype))) C = undefined;
2228 else if (isObject$3(C)) {
2229 C = C[SPECIES$3];
2230 if (C === null) C = undefined;
2231 }
2232 } return C === undefined ? Array$2 : C;
2233 };
2234
2235 var arraySpeciesConstructor = arraySpeciesConstructor$1;
2236
2237 // `ArraySpeciesCreate` abstract operation
2238 // https://tc39.es/ecma262/#sec-arrayspeciescreate
2239 var arraySpeciesCreate$3 = function (originalArray, length) {
2240 return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
2241 };
2242
2243 var fails$b = fails$u;
2244 var wellKnownSymbol$a = wellKnownSymbol$j;
2245 var V8_VERSION$1 = engineV8Version;
2246
2247 var SPECIES$2 = wellKnownSymbol$a('species');
2248
2249 var arrayMethodHasSpeciesSupport$5 = function (METHOD_NAME) {
2250 // We can't use this feature detection in V8 since it causes
2251 // deoptimization and serious performance degradation
2252 // https://github.com/zloirock/core-js/issues/677
2253 return V8_VERSION$1 >= 51 || !fails$b(function () {
2254 var array = [];
2255 var constructor = array.constructor = {};
2256 constructor[SPECIES$2] = function () {
2257 return { foo: 1 };
2258 };
2259 return array[METHOD_NAME](Boolean).foo !== 1;
2260 });
2261 };
2262
2263 var $$g = _export;
2264 var global$c = global$G;
2265 var fails$a = fails$u;
2266 var isArray$2 = isArray$4;
2267 var isObject$2 = isObject$a;
2268 var toObject$6 = toObject$9;
2269 var lengthOfArrayLike$4 = lengthOfArrayLike$7;
2270 var createProperty$2 = createProperty$4;
2271 var arraySpeciesCreate$2 = arraySpeciesCreate$3;
2272 var arrayMethodHasSpeciesSupport$4 = arrayMethodHasSpeciesSupport$5;
2273 var wellKnownSymbol$9 = wellKnownSymbol$j;
2274 var V8_VERSION = engineV8Version;
2275
2276 var IS_CONCAT_SPREADABLE = wellKnownSymbol$9('isConcatSpreadable');
2277 var MAX_SAFE_INTEGER$1 = 0x1FFFFFFFFFFFFF;
2278 var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
2279 var TypeError$5 = global$c.TypeError;
2280
2281 // We can't use this feature detection in V8 since it causes
2282 // deoptimization and serious performance degradation
2283 // https://github.com/zloirock/core-js/issues/679
2284 var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails$a(function () {
2285 var array = [];
2286 array[IS_CONCAT_SPREADABLE] = false;
2287 return array.concat()[0] !== array;
2288 });
2289
2290 var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport$4('concat');
2291
2292 var isConcatSpreadable = function (O) {
2293 if (!isObject$2(O)) return false;
2294 var spreadable = O[IS_CONCAT_SPREADABLE];
2295 return spreadable !== undefined ? !!spreadable : isArray$2(O);
2296 };
2297
2298 var FORCED$3 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
2299
2300 // `Array.prototype.concat` method
2301 // https://tc39.es/ecma262/#sec-array.prototype.concat
2302 // with adding support of @@isConcatSpreadable and @@species
2303 $$g({ target: 'Array', proto: true, arity: 1, forced: FORCED$3 }, {
2304 // eslint-disable-next-line no-unused-vars -- required for `.length`
2305 concat: function concat(arg) {
2306 var O = toObject$6(this);
2307 var A = arraySpeciesCreate$2(O, 0);
2308 var n = 0;
2309 var i, k, length, len, E;
2310 for (i = -1, length = arguments.length; i < length; i++) {
2311 E = i === -1 ? O : arguments[i];
2312 if (isConcatSpreadable(E)) {
2313 len = lengthOfArrayLike$4(E);
2314 if (n + len > MAX_SAFE_INTEGER$1) throw TypeError$5(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
2315 for (k = 0; k < len; k++, n++) if (k in E) createProperty$2(A, n, E[k]);
2316 } else {
2317 if (n >= MAX_SAFE_INTEGER$1) throw TypeError$5(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
2318 createProperty$2(A, n++, E);
2319 }
2320 }
2321 A.length = n;
2322 return A;
2323 }
2324 });
2325
2326 var uncurryThis$g = functionUncurryThis;
2327 var aCallable$1 = aCallable$3;
2328 var NATIVE_BIND = functionBindNative;
2329
2330 var bind$1 = uncurryThis$g(uncurryThis$g.bind);
2331
2332 // optional / simple context binding
2333 var functionBindContext = function (fn, that) {
2334 aCallable$1(fn);
2335 return that === undefined ? fn : NATIVE_BIND ? bind$1(fn, that) : function (/* ...args */) {
2336 return fn.apply(that, arguments);
2337 };
2338 };
2339
2340 var bind = functionBindContext;
2341 var uncurryThis$f = functionUncurryThis;
2342 var IndexedObject = indexedObject;
2343 var toObject$5 = toObject$9;
2344 var lengthOfArrayLike$3 = lengthOfArrayLike$7;
2345 var arraySpeciesCreate$1 = arraySpeciesCreate$3;
2346
2347 var push$2 = uncurryThis$f([].push);
2348
2349 // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
2350 var createMethod = function (TYPE) {
2351 var IS_MAP = TYPE == 1;
2352 var IS_FILTER = TYPE == 2;
2353 var IS_SOME = TYPE == 3;
2354 var IS_EVERY = TYPE == 4;
2355 var IS_FIND_INDEX = TYPE == 6;
2356 var IS_FILTER_REJECT = TYPE == 7;
2357 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
2358 return function ($this, callbackfn, that, specificCreate) {
2359 var O = toObject$5($this);
2360 var self = IndexedObject(O);
2361 var boundFunction = bind(callbackfn, that);
2362 var length = lengthOfArrayLike$3(self);
2363 var index = 0;
2364 var create = specificCreate || arraySpeciesCreate$1;
2365 var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
2366 var value, result;
2367 for (;length > index; index++) if (NO_HOLES || index in self) {
2368 value = self[index];
2369 result = boundFunction(value, index, O);
2370 if (TYPE) {
2371 if (IS_MAP) target[index] = result; // map
2372 else if (result) switch (TYPE) {
2373 case 3: return true; // some
2374 case 5: return value; // find
2375 case 6: return index; // findIndex
2376 case 2: push$2(target, value); // filter
2377 } else switch (TYPE) {
2378 case 4: return false; // every
2379 case 7: push$2(target, value); // filterReject
2380 }
2381 }
2382 }
2383 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
2384 };
2385 };
2386
2387 var arrayIteration = {
2388 // `Array.prototype.forEach` method
2389 // https://tc39.es/ecma262/#sec-array.prototype.foreach
2390 forEach: createMethod(0),
2391 // `Array.prototype.map` method
2392 // https://tc39.es/ecma262/#sec-array.prototype.map
2393 map: createMethod(1),
2394 // `Array.prototype.filter` method
2395 // https://tc39.es/ecma262/#sec-array.prototype.filter
2396 filter: createMethod(2),
2397 // `Array.prototype.some` method
2398 // https://tc39.es/ecma262/#sec-array.prototype.some
2399 some: createMethod(3),
2400 // `Array.prototype.every` method
2401 // https://tc39.es/ecma262/#sec-array.prototype.every
2402 every: createMethod(4),
2403 // `Array.prototype.find` method
2404 // https://tc39.es/ecma262/#sec-array.prototype.find
2405 find: createMethod(5),
2406 // `Array.prototype.findIndex` method
2407 // https://tc39.es/ecma262/#sec-array.prototype.findIndex
2408 findIndex: createMethod(6),
2409 // `Array.prototype.filterReject` method
2410 // https://github.com/tc39/proposal-array-filtering
2411 filterReject: createMethod(7)
2412 };
2413
2414 var $$f = _export;
2415 var $find = arrayIteration.find;
2416 var addToUnscopables$2 = addToUnscopables$4;
2417
2418 var FIND = 'find';
2419 var SKIPS_HOLES$1 = true;
2420
2421 // Shouldn't skip holes
2422 if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES$1 = false; });
2423
2424 // `Array.prototype.find` method
2425 // https://tc39.es/ecma262/#sec-array.prototype.find
2426 $$f({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, {
2427 find: function find(callbackfn /* , that = undefined */) {
2428 return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
2429 }
2430 });
2431
2432 // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2433 addToUnscopables$2(FIND);
2434
2435 var TO_STRING_TAG_SUPPORT$1 = toStringTagSupport;
2436 var classof = classof$6;
2437
2438 // `Object.prototype.toString` method implementation
2439 // https://tc39.es/ecma262/#sec-object.prototype.tostring
2440 var objectToString = TO_STRING_TAG_SUPPORT$1 ? {}.toString : function toString() {
2441 return '[object ' + classof(this) + ']';
2442 };
2443
2444 var TO_STRING_TAG_SUPPORT = toStringTagSupport;
2445 var defineBuiltIn$5 = defineBuiltIn$8;
2446 var toString$a = objectToString;
2447
2448 // `Object.prototype.toString` method
2449 // https://tc39.es/ecma262/#sec-object.prototype.tostring
2450 if (!TO_STRING_TAG_SUPPORT) {
2451 defineBuiltIn$5(Object.prototype, 'toString', toString$a, { unsafe: true });
2452 }
2453
2454 var global$b = global$G;
2455 var isRegExp$1 = isRegexp;
2456
2457 var TypeError$4 = global$b.TypeError;
2458
2459 var notARegexp = function (it) {
2460 if (isRegExp$1(it)) {
2461 throw TypeError$4("The method doesn't accept regular expressions");
2462 } return it;
2463 };
2464
2465 var wellKnownSymbol$8 = wellKnownSymbol$j;
2466
2467 var MATCH$1 = wellKnownSymbol$8('match');
2468
2469 var correctIsRegexpLogic = function (METHOD_NAME) {
2470 var regexp = /./;
2471 try {
2472 '/./'[METHOD_NAME](regexp);
2473 } catch (error1) {
2474 try {
2475 regexp[MATCH$1] = false;
2476 return '/./'[METHOD_NAME](regexp);
2477 } catch (error2) { /* empty */ }
2478 } return false;
2479 };
2480
2481 var $$e = _export;
2482 var uncurryThis$e = functionUncurryThis;
2483 var notARegExp$2 = notARegexp;
2484 var requireObjectCoercible$5 = requireObjectCoercible$b;
2485 var toString$9 = toString$f;
2486 var correctIsRegExpLogic$2 = correctIsRegexpLogic;
2487
2488 var stringIndexOf$2 = uncurryThis$e(''.indexOf);
2489
2490 // `String.prototype.includes` method
2491 // https://tc39.es/ecma262/#sec-string.prototype.includes
2492 $$e({ target: 'String', proto: true, forced: !correctIsRegExpLogic$2('includes') }, {
2493 includes: function includes(searchString /* , position = 0 */) {
2494 return !!~stringIndexOf$2(
2495 toString$9(requireObjectCoercible$5(this)),
2496 toString$9(notARegExp$2(searchString)),
2497 arguments.length > 1 ? arguments[1] : undefined
2498 );
2499 }
2500 });
2501
2502 // iterable DOM collections
2503 // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
2504 var domIterables = {
2505 CSSRuleList: 0,
2506 CSSStyleDeclaration: 0,
2507 CSSValueList: 0,
2508 ClientRectList: 0,
2509 DOMRectList: 0,
2510 DOMStringList: 0,
2511 DOMTokenList: 1,
2512 DataTransferItemList: 0,
2513 FileList: 0,
2514 HTMLAllCollection: 0,
2515 HTMLCollection: 0,
2516 HTMLFormElement: 0,
2517 HTMLSelectElement: 0,
2518 MediaList: 0,
2519 MimeTypeArray: 0,
2520 NamedNodeMap: 0,
2521 NodeList: 1,
2522 PaintRequestList: 0,
2523 Plugin: 0,
2524 PluginArray: 0,
2525 SVGLengthList: 0,
2526 SVGNumberList: 0,
2527 SVGPathSegList: 0,
2528 SVGPointList: 0,
2529 SVGStringList: 0,
2530 SVGTransformList: 0,
2531 SourceBufferList: 0,
2532 StyleSheetList: 0,
2533 TextTrackCueList: 0,
2534 TextTrackList: 0,
2535 TouchList: 0
2536 };
2537
2538 // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
2539 var documentCreateElement = documentCreateElement$2;
2540
2541 var classList = documentCreateElement('span').classList;
2542 var DOMTokenListPrototype$2 = classList && classList.constructor && classList.constructor.prototype;
2543
2544 var domTokenListPrototype = DOMTokenListPrototype$2 === Object.prototype ? undefined : DOMTokenListPrototype$2;
2545
2546 var $forEach = arrayIteration.forEach;
2547 var arrayMethodIsStrict$2 = arrayMethodIsStrict$4;
2548
2549 var STRICT_METHOD$2 = arrayMethodIsStrict$2('forEach');
2550
2551 // `Array.prototype.forEach` method implementation
2552 // https://tc39.es/ecma262/#sec-array.prototype.foreach
2553 var arrayForEach = !STRICT_METHOD$2 ? function forEach(callbackfn /* , thisArg */) {
2554 return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
2555 // eslint-disable-next-line es-x/no-array-prototype-foreach -- safe
2556 } : [].forEach;
2557
2558 var global$a = global$G;
2559 var DOMIterables$1 = domIterables;
2560 var DOMTokenListPrototype$1 = domTokenListPrototype;
2561 var forEach = arrayForEach;
2562 var createNonEnumerableProperty$3 = createNonEnumerableProperty$8;
2563
2564 var handlePrototype$1 = function (CollectionPrototype) {
2565 // some Chrome versions have non-configurable methods on DOMTokenList
2566 if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
2567 createNonEnumerableProperty$3(CollectionPrototype, 'forEach', forEach);
2568 } catch (error) {
2569 CollectionPrototype.forEach = forEach;
2570 }
2571 };
2572
2573 for (var COLLECTION_NAME$1 in DOMIterables$1) {
2574 if (DOMIterables$1[COLLECTION_NAME$1]) {
2575 handlePrototype$1(global$a[COLLECTION_NAME$1] && global$a[COLLECTION_NAME$1].prototype);
2576 }
2577 }
2578
2579 handlePrototype$1(DOMTokenListPrototype$1);
2580
2581 var global$9 = global$G;
2582 var fails$9 = fails$u;
2583 var uncurryThis$d = functionUncurryThis;
2584 var toString$8 = toString$f;
2585 var trim$2 = stringTrim.trim;
2586 var whitespaces$1 = whitespaces$4;
2587
2588 var charAt$2 = uncurryThis$d(''.charAt);
2589 var n$ParseFloat = global$9.parseFloat;
2590 var Symbol$2 = global$9.Symbol;
2591 var ITERATOR$4 = Symbol$2 && Symbol$2.iterator;
2592 var FORCED$2 = 1 / n$ParseFloat(whitespaces$1 + '-0') !== -Infinity
2593 // MS Edge 18- broken with boxed symbols
2594 || (ITERATOR$4 && !fails$9(function () { n$ParseFloat(Object(ITERATOR$4)); }));
2595
2596 // `parseFloat` method
2597 // https://tc39.es/ecma262/#sec-parsefloat-string
2598 var numberParseFloat = FORCED$2 ? function parseFloat(string) {
2599 var trimmedString = trim$2(toString$8(string));
2600 var result = n$ParseFloat(trimmedString);
2601 return result === 0 && charAt$2(trimmedString, 0) == '-' ? -0 : result;
2602 } : n$ParseFloat;
2603
2604 var $$d = _export;
2605 var $parseFloat = numberParseFloat;
2606
2607 // `parseFloat` method
2608 // https://tc39.es/ecma262/#sec-parsefloat-string
2609 $$d({ global: true, forced: parseFloat != $parseFloat }, {
2610 parseFloat: $parseFloat
2611 });
2612
2613 /* eslint-disable es-x/no-array-prototype-indexof -- required for testing */
2614 var $$c = _export;
2615 var uncurryThis$c = functionUncurryThis;
2616 var $IndexOf = arrayIncludes.indexOf;
2617 var arrayMethodIsStrict$1 = arrayMethodIsStrict$4;
2618
2619 var un$IndexOf = uncurryThis$c([].indexOf);
2620
2621 var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
2622 var STRICT_METHOD$1 = arrayMethodIsStrict$1('indexOf');
2623
2624 // `Array.prototype.indexOf` method
2625 // https://tc39.es/ecma262/#sec-array.prototype.indexof
2626 $$c({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD$1 }, {
2627 indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
2628 var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
2629 return NEGATIVE_ZERO
2630 // convert -0 to +0
2631 ? un$IndexOf(this, searchElement, fromIndex) || 0
2632 : $IndexOf(this, searchElement, fromIndex);
2633 }
2634 });
2635
2636 var arraySlice$2 = arraySliceSimple;
2637
2638 var floor$1 = Math.floor;
2639
2640 var mergeSort = function (array, comparefn) {
2641 var length = array.length;
2642 var middle = floor$1(length / 2);
2643 return length < 8 ? insertionSort(array, comparefn) : merge(
2644 array,
2645 mergeSort(arraySlice$2(array, 0, middle), comparefn),
2646 mergeSort(arraySlice$2(array, middle), comparefn),
2647 comparefn
2648 );
2649 };
2650
2651 var insertionSort = function (array, comparefn) {
2652 var length = array.length;
2653 var i = 1;
2654 var element, j;
2655
2656 while (i < length) {
2657 j = i;
2658 element = array[i];
2659 while (j && comparefn(array[j - 1], element) > 0) {
2660 array[j] = array[--j];
2661 }
2662 if (j !== i++) array[j] = element;
2663 } return array;
2664 };
2665
2666 var merge = function (array, left, right, comparefn) {
2667 var llength = left.length;
2668 var rlength = right.length;
2669 var lindex = 0;
2670 var rindex = 0;
2671
2672 while (lindex < llength || rindex < rlength) {
2673 array[lindex + rindex] = (lindex < llength && rindex < rlength)
2674 ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
2675 : lindex < llength ? left[lindex++] : right[rindex++];
2676 } return array;
2677 };
2678
2679 var arraySort = mergeSort;
2680
2681 var userAgent$1 = engineUserAgent;
2682
2683 var firefox = userAgent$1.match(/firefox\/(\d+)/i);
2684
2685 var engineFfVersion = !!firefox && +firefox[1];
2686
2687 var UA = engineUserAgent;
2688
2689 var engineIsIeOrEdge = /MSIE|Trident/.test(UA);
2690
2691 var userAgent = engineUserAgent;
2692
2693 var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
2694
2695 var engineWebkitVersion = !!webkit && +webkit[1];
2696
2697 var $$b = _export;
2698 var uncurryThis$b = functionUncurryThis;
2699 var aCallable = aCallable$3;
2700 var toObject$4 = toObject$9;
2701 var lengthOfArrayLike$2 = lengthOfArrayLike$7;
2702 var toString$7 = toString$f;
2703 var fails$8 = fails$u;
2704 var internalSort = arraySort;
2705 var arrayMethodIsStrict = arrayMethodIsStrict$4;
2706 var FF = engineFfVersion;
2707 var IE_OR_EDGE = engineIsIeOrEdge;
2708 var V8 = engineV8Version;
2709 var WEBKIT = engineWebkitVersion;
2710
2711 var test$1 = [];
2712 var un$Sort = uncurryThis$b(test$1.sort);
2713 var push$1 = uncurryThis$b(test$1.push);
2714
2715 // IE8-
2716 var FAILS_ON_UNDEFINED = fails$8(function () {
2717 test$1.sort(undefined);
2718 });
2719 // V8 bug
2720 var FAILS_ON_NULL = fails$8(function () {
2721 test$1.sort(null);
2722 });
2723 // Old WebKit
2724 var STRICT_METHOD = arrayMethodIsStrict('sort');
2725
2726 var STABLE_SORT = !fails$8(function () {
2727 // feature detection can be too slow, so check engines versions
2728 if (V8) return V8 < 70;
2729 if (FF && FF > 3) return;
2730 if (IE_OR_EDGE) return true;
2731 if (WEBKIT) return WEBKIT < 603;
2732
2733 var result = '';
2734 var code, chr, value, index;
2735
2736 // generate an array with more 512 elements (Chakra and old V8 fails only in this case)
2737 for (code = 65; code < 76; code++) {
2738 chr = String.fromCharCode(code);
2739
2740 switch (code) {
2741 case 66: case 69: case 70: case 72: value = 3; break;
2742 case 68: case 71: value = 4; break;
2743 default: value = 2;
2744 }
2745
2746 for (index = 0; index < 47; index++) {
2747 test$1.push({ k: chr + index, v: value });
2748 }
2749 }
2750
2751 test$1.sort(function (a, b) { return b.v - a.v; });
2752
2753 for (index = 0; index < test$1.length; index++) {
2754 chr = test$1[index].k.charAt(0);
2755 if (result.charAt(result.length - 1) !== chr) result += chr;
2756 }
2757
2758 return result !== 'DGBEFHACIJK';
2759 });
2760
2761 var FORCED$1 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
2762
2763 var getSortCompare = function (comparefn) {
2764 return function (x, y) {
2765 if (y === undefined) return -1;
2766 if (x === undefined) return 1;
2767 if (comparefn !== undefined) return +comparefn(x, y) || 0;
2768 return toString$7(x) > toString$7(y) ? 1 : -1;
2769 };
2770 };
2771
2772 // `Array.prototype.sort` method
2773 // https://tc39.es/ecma262/#sec-array.prototype.sort
2774 $$b({ target: 'Array', proto: true, forced: FORCED$1 }, {
2775 sort: function sort(comparefn) {
2776 if (comparefn !== undefined) aCallable(comparefn);
2777
2778 var array = toObject$4(this);
2779
2780 if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn);
2781
2782 var items = [];
2783 var arrayLength = lengthOfArrayLike$2(array);
2784 var itemsLength, index;
2785
2786 for (index = 0; index < arrayLength; index++) {
2787 if (index in array) push$1(items, array[index]);
2788 }
2789
2790 internalSort(items, getSortCompare(comparefn));
2791
2792 itemsLength = items.length;
2793 index = 0;
2794
2795 while (index < itemsLength) array[index] = items[index++];
2796 while (index < arrayLength) delete array[index++];
2797
2798 return array;
2799 }
2800 });
2801
2802 var uncurryThis$a = functionUncurryThis;
2803 var toObject$3 = toObject$9;
2804
2805 var floor = Math.floor;
2806 var charAt$1 = uncurryThis$a(''.charAt);
2807 var replace$1 = uncurryThis$a(''.replace);
2808 var stringSlice$3 = uncurryThis$a(''.slice);
2809 var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
2810 var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
2811
2812 // `GetSubstitution` abstract operation
2813 // https://tc39.es/ecma262/#sec-getsubstitution
2814 var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
2815 var tailPos = position + matched.length;
2816 var m = captures.length;
2817 var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
2818 if (namedCaptures !== undefined) {
2819 namedCaptures = toObject$3(namedCaptures);
2820 symbols = SUBSTITUTION_SYMBOLS;
2821 }
2822 return replace$1(replacement, symbols, function (match, ch) {
2823 var capture;
2824 switch (charAt$1(ch, 0)) {
2825 case '$': return '$';
2826 case '&': return matched;
2827 case '`': return stringSlice$3(str, 0, position);
2828 case "'": return stringSlice$3(str, tailPos);
2829 case '<':
2830 capture = namedCaptures[stringSlice$3(ch, 1, -1)];
2831 break;
2832 default: // \d\d?
2833 var n = +ch;
2834 if (n === 0) return match;
2835 if (n > m) {
2836 var f = floor(n / 10);
2837 if (f === 0) return match;
2838 if (f <= m) return captures[f - 1] === undefined ? charAt$1(ch, 1) : captures[f - 1] + charAt$1(ch, 1);
2839 return match;
2840 }
2841 capture = captures[n - 1];
2842 }
2843 return capture === undefined ? '' : capture;
2844 });
2845 };
2846
2847 var apply = functionApply;
2848 var call$4 = functionCall;
2849 var uncurryThis$9 = functionUncurryThis;
2850 var fixRegExpWellKnownSymbolLogic$2 = fixRegexpWellKnownSymbolLogic;
2851 var fails$7 = fails$u;
2852 var anObject$4 = anObject$d;
2853 var isCallable$5 = isCallable$j;
2854 var toIntegerOrInfinity$1 = toIntegerOrInfinity$5;
2855 var toLength$3 = toLength$6;
2856 var toString$6 = toString$f;
2857 var requireObjectCoercible$4 = requireObjectCoercible$b;
2858 var advanceStringIndex$1 = advanceStringIndex$3;
2859 var getMethod$2 = getMethod$5;
2860 var getSubstitution = getSubstitution$1;
2861 var regExpExec$2 = regexpExecAbstract;
2862 var wellKnownSymbol$7 = wellKnownSymbol$j;
2863
2864 var REPLACE = wellKnownSymbol$7('replace');
2865 var max$2 = Math.max;
2866 var min$3 = Math.min;
2867 var concat = uncurryThis$9([].concat);
2868 var push = uncurryThis$9([].push);
2869 var stringIndexOf$1 = uncurryThis$9(''.indexOf);
2870 var stringSlice$2 = uncurryThis$9(''.slice);
2871
2872 var maybeToString = function (it) {
2873 return it === undefined ? it : String(it);
2874 };
2875
2876 // IE <= 11 replaces $0 with the whole match, as if it was $&
2877 // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
2878 var REPLACE_KEEPS_$0 = (function () {
2879 // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
2880 return 'a'.replace(/./, '$0') === '$0';
2881 })();
2882
2883 // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
2884 var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
2885 if (/./[REPLACE]) {
2886 return /./[REPLACE]('a', '$0') === '';
2887 }
2888 return false;
2889 })();
2890
2891 var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$7(function () {
2892 var re = /./;
2893 re.exec = function () {
2894 var result = [];
2895 result.groups = { a: '7' };
2896 return result;
2897 };
2898 // eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
2899 return ''.replace(re, '$<a>') !== '7';
2900 });
2901
2902 // @@replace logic
2903 fixRegExpWellKnownSymbolLogic$2('replace', function (_, nativeReplace, maybeCallNative) {
2904 var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
2905
2906 return [
2907 // `String.prototype.replace` method
2908 // https://tc39.es/ecma262/#sec-string.prototype.replace
2909 function replace(searchValue, replaceValue) {
2910 var O = requireObjectCoercible$4(this);
2911 var replacer = searchValue == undefined ? undefined : getMethod$2(searchValue, REPLACE);
2912 return replacer
2913 ? call$4(replacer, searchValue, O, replaceValue)
2914 : call$4(nativeReplace, toString$6(O), searchValue, replaceValue);
2915 },
2916 // `RegExp.prototype[@@replace]` method
2917 // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
2918 function (string, replaceValue) {
2919 var rx = anObject$4(this);
2920 var S = toString$6(string);
2921
2922 if (
2923 typeof replaceValue == 'string' &&
2924 stringIndexOf$1(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
2925 stringIndexOf$1(replaceValue, '$<') === -1
2926 ) {
2927 var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
2928 if (res.done) return res.value;
2929 }
2930
2931 var functionalReplace = isCallable$5(replaceValue);
2932 if (!functionalReplace) replaceValue = toString$6(replaceValue);
2933
2934 var global = rx.global;
2935 if (global) {
2936 var fullUnicode = rx.unicode;
2937 rx.lastIndex = 0;
2938 }
2939 var results = [];
2940 while (true) {
2941 var result = regExpExec$2(rx, S);
2942 if (result === null) break;
2943
2944 push(results, result);
2945 if (!global) break;
2946
2947 var matchStr = toString$6(result[0]);
2948 if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$3(rx.lastIndex), fullUnicode);
2949 }
2950
2951 var accumulatedResult = '';
2952 var nextSourcePosition = 0;
2953 for (var i = 0; i < results.length; i++) {
2954 result = results[i];
2955
2956 var matched = toString$6(result[0]);
2957 var position = max$2(min$3(toIntegerOrInfinity$1(result.index), S.length), 0);
2958 var captures = [];
2959 // NOTE: This is equivalent to
2960 // captures = result.slice(1).map(maybeToString)
2961 // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
2962 // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
2963 // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
2964 for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
2965 var namedCaptures = result.groups;
2966 if (functionalReplace) {
2967 var replacerArgs = concat([matched], captures, position, S);
2968 if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
2969 var replacement = toString$6(apply(replaceValue, undefined, replacerArgs));
2970 } else {
2971 replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
2972 }
2973 if (position >= nextSourcePosition) {
2974 accumulatedResult += stringSlice$2(S, nextSourcePosition, position) + replacement;
2975 nextSourcePosition = position + matched.length;
2976 }
2977 }
2978 return accumulatedResult + stringSlice$2(S, nextSourcePosition);
2979 }
2980 ];
2981 }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
2982
2983 var $$a = _export;
2984 var $filter = arrayIteration.filter;
2985 var arrayMethodHasSpeciesSupport$3 = arrayMethodHasSpeciesSupport$5;
2986
2987 var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport$3('filter');
2988
2989 // `Array.prototype.filter` method
2990 // https://tc39.es/ecma262/#sec-array.prototype.filter
2991 // with adding support of @@species
2992 $$a({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, {
2993 filter: function filter(callbackfn /* , thisArg */) {
2994 return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
2995 }
2996 });
2997
2998 // `SameValue` abstract operation
2999 // https://tc39.es/ecma262/#sec-samevalue
3000 // eslint-disable-next-line es-x/no-object-is -- safe
3001 var sameValue$1 = Object.is || function is(x, y) {
3002 // eslint-disable-next-line no-self-compare -- NaN check
3003 return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
3004 };
3005
3006 var call$3 = functionCall;
3007 var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
3008 var anObject$3 = anObject$d;
3009 var requireObjectCoercible$3 = requireObjectCoercible$b;
3010 var sameValue = sameValue$1;
3011 var toString$5 = toString$f;
3012 var getMethod$1 = getMethod$5;
3013 var regExpExec$1 = regexpExecAbstract;
3014
3015 // @@search logic
3016 fixRegExpWellKnownSymbolLogic$1('search', function (SEARCH, nativeSearch, maybeCallNative) {
3017 return [
3018 // `String.prototype.search` method
3019 // https://tc39.es/ecma262/#sec-string.prototype.search
3020 function search(regexp) {
3021 var O = requireObjectCoercible$3(this);
3022 var searcher = regexp == undefined ? undefined : getMethod$1(regexp, SEARCH);
3023 return searcher ? call$3(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString$5(O));
3024 },
3025 // `RegExp.prototype[@@search]` method
3026 // https://tc39.es/ecma262/#sec-regexp.prototype-@@search
3027 function (string) {
3028 var rx = anObject$3(this);
3029 var S = toString$5(string);
3030 var res = maybeCallNative(nativeSearch, rx, S);
3031
3032 if (res.done) return res.value;
3033
3034 var previousLastIndex = rx.lastIndex;
3035 if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
3036 var result = regExpExec$1(rx, S);
3037 if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
3038 return result === null ? -1 : result.index;
3039 }
3040 ];
3041 });
3042
3043 var global$8 = global$G;
3044 var fails$6 = fails$u;
3045 var uncurryThis$8 = functionUncurryThis;
3046 var toString$4 = toString$f;
3047 var trim$1 = stringTrim.trim;
3048 var whitespaces = whitespaces$4;
3049
3050 var $parseInt$1 = global$8.parseInt;
3051 var Symbol$1 = global$8.Symbol;
3052 var ITERATOR$3 = Symbol$1 && Symbol$1.iterator;
3053 var hex = /^[+-]?0x/i;
3054 var exec$1 = uncurryThis$8(hex.exec);
3055 var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
3056 // MS Edge 18- broken with boxed symbols
3057 || (ITERATOR$3 && !fails$6(function () { $parseInt$1(Object(ITERATOR$3)); }));
3058
3059 // `parseInt` method
3060 // https://tc39.es/ecma262/#sec-parseint-string-radix
3061 var numberParseInt = FORCED ? function parseInt(string, radix) {
3062 var S = trim$1(toString$4(string));
3063 return $parseInt$1(S, (radix >>> 0) || (exec$1(hex, S) ? 16 : 10));
3064 } : $parseInt$1;
3065
3066 var $$9 = _export;
3067 var $parseInt = numberParseInt;
3068
3069 // `parseInt` method
3070 // https://tc39.es/ecma262/#sec-parseint-string-radix
3071 $$9({ global: true, forced: parseInt != $parseInt }, {
3072 parseInt: $parseInt
3073 });
3074
3075 var $$8 = _export;
3076 var $map = arrayIteration.map;
3077 var arrayMethodHasSpeciesSupport$2 = arrayMethodHasSpeciesSupport$5;
3078
3079 var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport$2('map');
3080
3081 // `Array.prototype.map` method
3082 // https://tc39.es/ecma262/#sec-array.prototype.map
3083 // with adding support of @@species
3084 $$8({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, {
3085 map: function map(callbackfn /* , thisArg */) {
3086 return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
3087 }
3088 });
3089
3090 var $$7 = _export;
3091 var $findIndex = arrayIteration.findIndex;
3092 var addToUnscopables$1 = addToUnscopables$4;
3093
3094 var FIND_INDEX = 'findIndex';
3095 var SKIPS_HOLES = true;
3096
3097 // Shouldn't skip holes
3098 if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; });
3099
3100 // `Array.prototype.findIndex` method
3101 // https://tc39.es/ecma262/#sec-array.prototype.findindex
3102 $$7({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
3103 findIndex: function findIndex(callbackfn /* , that = undefined */) {
3104 return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
3105 }
3106 });
3107
3108 // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
3109 addToUnscopables$1(FIND_INDEX);
3110
3111 var global$7 = global$G;
3112 var isCallable$4 = isCallable$j;
3113
3114 var String$1 = global$7.String;
3115 var TypeError$3 = global$7.TypeError;
3116
3117 var aPossiblePrototype$1 = function (argument) {
3118 if (typeof argument == 'object' || isCallable$4(argument)) return argument;
3119 throw TypeError$3("Can't set " + String$1(argument) + ' as a prototype');
3120 };
3121
3122 /* eslint-disable no-proto -- safe */
3123
3124 var uncurryThis$7 = functionUncurryThis;
3125 var anObject$2 = anObject$d;
3126 var aPossiblePrototype = aPossiblePrototype$1;
3127
3128 // `Object.setPrototypeOf` method
3129 // https://tc39.es/ecma262/#sec-object.setprototypeof
3130 // Works with __proto__ only. Old v8 can't work with null proto objects.
3131 // eslint-disable-next-line es-x/no-object-setprototypeof -- safe
3132 var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
3133 var CORRECT_SETTER = false;
3134 var test = {};
3135 var setter;
3136 try {
3137 // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
3138 setter = uncurryThis$7(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
3139 setter(test, []);
3140 CORRECT_SETTER = test instanceof Array;
3141 } catch (error) { /* empty */ }
3142 return function setPrototypeOf(O, proto) {
3143 anObject$2(O);
3144 aPossiblePrototype(proto);
3145 if (CORRECT_SETTER) setter(O, proto);
3146 else O.__proto__ = proto;
3147 return O;
3148 };
3149 }() : undefined);
3150
3151 var isCallable$3 = isCallable$j;
3152 var isObject$1 = isObject$a;
3153 var setPrototypeOf$1 = objectSetPrototypeOf;
3154
3155 // makes subclassing work correct for wrapped built-ins
3156 var inheritIfRequired$2 = function ($this, dummy, Wrapper) {
3157 var NewTarget, NewTargetPrototype;
3158 if (
3159 // it can work only with native `setPrototypeOf`
3160 setPrototypeOf$1 &&
3161 // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
3162 isCallable$3(NewTarget = dummy.constructor) &&
3163 NewTarget !== Wrapper &&
3164 isObject$1(NewTargetPrototype = NewTarget.prototype) &&
3165 NewTargetPrototype !== Wrapper.prototype
3166 ) setPrototypeOf$1($this, NewTargetPrototype);
3167 return $this;
3168 };
3169
3170 var call$2 = functionCall;
3171 var hasOwn$4 = hasOwnProperty_1;
3172 var isPrototypeOf$2 = objectIsPrototypeOf;
3173 var regExpFlags = regexpFlags$1;
3174
3175 var RegExpPrototype$2 = RegExp.prototype;
3176
3177 var regexpGetFlags = function (R) {
3178 var flags = R.flags;
3179 return flags === undefined && !('flags' in RegExpPrototype$2) && !hasOwn$4(R, 'flags') && isPrototypeOf$2(RegExpPrototype$2, R)
3180 ? call$2(regExpFlags, R) : flags;
3181 };
3182
3183 var defineProperty$3 = objectDefineProperty.f;
3184
3185 var proxyAccessor$1 = function (Target, Source, key) {
3186 key in Target || defineProperty$3(Target, key, {
3187 configurable: true,
3188 get: function () { return Source[key]; },
3189 set: function (it) { Source[key] = it; }
3190 });
3191 };
3192
3193 var getBuiltIn = getBuiltIn$6;
3194 var definePropertyModule = objectDefineProperty;
3195 var wellKnownSymbol$6 = wellKnownSymbol$j;
3196 var DESCRIPTORS$3 = descriptors;
3197
3198 var SPECIES$1 = wellKnownSymbol$6('species');
3199
3200 var setSpecies$1 = function (CONSTRUCTOR_NAME) {
3201 var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
3202 var defineProperty = definePropertyModule.f;
3203
3204 if (DESCRIPTORS$3 && Constructor && !Constructor[SPECIES$1]) {
3205 defineProperty(Constructor, SPECIES$1, {
3206 configurable: true,
3207 get: function () { return this; }
3208 });
3209 }
3210 };
3211
3212 var DESCRIPTORS$2 = descriptors;
3213 var global$6 = global$G;
3214 var uncurryThis$6 = functionUncurryThis;
3215 var isForced$1 = isForced_1;
3216 var inheritIfRequired$1 = inheritIfRequired$2;
3217 var createNonEnumerableProperty$2 = createNonEnumerableProperty$8;
3218 var getOwnPropertyNames$1 = objectGetOwnPropertyNames.f;
3219 var isPrototypeOf$1 = objectIsPrototypeOf;
3220 var isRegExp = isRegexp;
3221 var toString$3 = toString$f;
3222 var getRegExpFlags$1 = regexpGetFlags;
3223 var stickyHelpers = regexpStickyHelpers;
3224 var proxyAccessor = proxyAccessor$1;
3225 var defineBuiltIn$4 = defineBuiltIn$8;
3226 var fails$5 = fails$u;
3227 var hasOwn$3 = hasOwnProperty_1;
3228 var enforceInternalState = internalState.enforce;
3229 var setSpecies = setSpecies$1;
3230 var wellKnownSymbol$5 = wellKnownSymbol$j;
3231 var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
3232 var UNSUPPORTED_NCG = regexpUnsupportedNcg;
3233
3234 var MATCH = wellKnownSymbol$5('match');
3235 var NativeRegExp = global$6.RegExp;
3236 var RegExpPrototype$1 = NativeRegExp.prototype;
3237 var SyntaxError = global$6.SyntaxError;
3238 var exec = uncurryThis$6(RegExpPrototype$1.exec);
3239 var charAt = uncurryThis$6(''.charAt);
3240 var replace = uncurryThis$6(''.replace);
3241 var stringIndexOf = uncurryThis$6(''.indexOf);
3242 var stringSlice$1 = uncurryThis$6(''.slice);
3243 // TODO: Use only propper RegExpIdentifierName
3244 var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/;
3245 var re1 = /a/g;
3246 var re2 = /a/g;
3247
3248 // "new" should create a new object, old webkit bug
3249 var CORRECT_NEW = new NativeRegExp(re1) !== re1;
3250
3251 var MISSED_STICKY = stickyHelpers.MISSED_STICKY;
3252 var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
3253
3254 var BASE_FORCED = DESCRIPTORS$2 &&
3255 (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails$5(function () {
3256 re2[MATCH] = false;
3257 // RegExp constructor can alter flags and IsRegExp works correct with @@match
3258 return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
3259 }));
3260
3261 var handleDotAll = function (string) {
3262 var length = string.length;
3263 var index = 0;
3264 var result = '';
3265 var brackets = false;
3266 var chr;
3267 for (; index <= length; index++) {
3268 chr = charAt(string, index);
3269 if (chr === '\\') {
3270 result += chr + charAt(string, ++index);
3271 continue;
3272 }
3273 if (!brackets && chr === '.') {
3274 result += '[\\s\\S]';
3275 } else {
3276 if (chr === '[') {
3277 brackets = true;
3278 } else if (chr === ']') {
3279 brackets = false;
3280 } result += chr;
3281 }
3282 } return result;
3283 };
3284
3285 var handleNCG = function (string) {
3286 var length = string.length;
3287 var index = 0;
3288 var result = '';
3289 var named = [];
3290 var names = {};
3291 var brackets = false;
3292 var ncg = false;
3293 var groupid = 0;
3294 var groupname = '';
3295 var chr;
3296 for (; index <= length; index++) {
3297 chr = charAt(string, index);
3298 if (chr === '\\') {
3299 chr = chr + charAt(string, ++index);
3300 } else if (chr === ']') {
3301 brackets = false;
3302 } else if (!brackets) switch (true) {
3303 case chr === '[':
3304 brackets = true;
3305 break;
3306 case chr === '(':
3307 if (exec(IS_NCG, stringSlice$1(string, index + 1))) {
3308 index += 2;
3309 ncg = true;
3310 }
3311 result += chr;
3312 groupid++;
3313 continue;
3314 case chr === '>' && ncg:
3315 if (groupname === '' || hasOwn$3(names, groupname)) {
3316 throw new SyntaxError('Invalid capture group name');
3317 }
3318 names[groupname] = true;
3319 named[named.length] = [groupname, groupid];
3320 ncg = false;
3321 groupname = '';
3322 continue;
3323 }
3324 if (ncg) groupname += chr;
3325 else result += chr;
3326 } return [result, named];
3327 };
3328
3329 // `RegExp` constructor
3330 // https://tc39.es/ecma262/#sec-regexp-constructor
3331 if (isForced$1('RegExp', BASE_FORCED)) {
3332 var RegExpWrapper = function RegExp(pattern, flags) {
3333 var thisIsRegExp = isPrototypeOf$1(RegExpPrototype$1, this);
3334 var patternIsRegExp = isRegExp(pattern);
3335 var flagsAreUndefined = flags === undefined;
3336 var groups = [];
3337 var rawPattern = pattern;
3338 var rawFlags, dotAll, sticky, handled, result, state;
3339
3340 if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) {
3341 return pattern;
3342 }
3343
3344 if (patternIsRegExp || isPrototypeOf$1(RegExpPrototype$1, pattern)) {
3345 pattern = pattern.source;
3346 if (flagsAreUndefined) flags = getRegExpFlags$1(rawPattern);
3347 }
3348
3349 pattern = pattern === undefined ? '' : toString$3(pattern);
3350 flags = flags === undefined ? '' : toString$3(flags);
3351 rawPattern = pattern;
3352
3353 if (UNSUPPORTED_DOT_ALL && 'dotAll' in re1) {
3354 dotAll = !!flags && stringIndexOf(flags, 's') > -1;
3355 if (dotAll) flags = replace(flags, /s/g, '');
3356 }
3357
3358 rawFlags = flags;
3359
3360 if (MISSED_STICKY && 'sticky' in re1) {
3361 sticky = !!flags && stringIndexOf(flags, 'y') > -1;
3362 if (sticky && UNSUPPORTED_Y) flags = replace(flags, /y/g, '');
3363 }
3364
3365 if (UNSUPPORTED_NCG) {
3366 handled = handleNCG(pattern);
3367 pattern = handled[0];
3368 groups = handled[1];
3369 }
3370
3371 result = inheritIfRequired$1(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype$1, RegExpWrapper);
3372
3373 if (dotAll || sticky || groups.length) {
3374 state = enforceInternalState(result);
3375 if (dotAll) {
3376 state.dotAll = true;
3377 state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags);
3378 }
3379 if (sticky) state.sticky = true;
3380 if (groups.length) state.groups = groups;
3381 }
3382
3383 if (pattern !== rawPattern) try {
3384 // fails in old engines, but we have no alternatives for unsupported regex syntax
3385 createNonEnumerableProperty$2(result, 'source', rawPattern === '' ? '(?:)' : rawPattern);
3386 } catch (error) { /* empty */ }
3387
3388 return result;
3389 };
3390
3391 for (var keys$1 = getOwnPropertyNames$1(NativeRegExp), index = 0; keys$1.length > index;) {
3392 proxyAccessor(RegExpWrapper, NativeRegExp, keys$1[index++]);
3393 }
3394
3395 RegExpPrototype$1.constructor = RegExpWrapper;
3396 RegExpWrapper.prototype = RegExpPrototype$1;
3397 defineBuiltIn$4(global$6, 'RegExp', RegExpWrapper, { constructor: true });
3398 }
3399
3400 // https://tc39.es/ecma262/#sec-get-regexp-@@species
3401 setSpecies('RegExp');
3402
3403 var PROPER_FUNCTION_NAME$1 = functionName.PROPER;
3404 var defineBuiltIn$3 = defineBuiltIn$8;
3405 var anObject$1 = anObject$d;
3406 var $toString = toString$f;
3407 var fails$4 = fails$u;
3408 var getRegExpFlags = regexpGetFlags;
3409
3410 var TO_STRING = 'toString';
3411 var RegExpPrototype = RegExp.prototype;
3412 var n$ToString = RegExpPrototype[TO_STRING];
3413
3414 var NOT_GENERIC = fails$4(function () { return n$ToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
3415 // FF44- RegExp#toString has a wrong name
3416 var INCORRECT_NAME = PROPER_FUNCTION_NAME$1 && n$ToString.name != TO_STRING;
3417
3418 // `RegExp.prototype.toString` method
3419 // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
3420 if (NOT_GENERIC || INCORRECT_NAME) {
3421 defineBuiltIn$3(RegExp.prototype, TO_STRING, function toString() {
3422 var R = anObject$1(this);
3423 var pattern = $toString(R.source);
3424 var flags = $toString(getRegExpFlags(R));
3425 return '/' + pattern + '/' + flags;
3426 }, { unsafe: true });
3427 }
3428
3429 var uncurryThis$5 = functionUncurryThis;
3430
3431 var arraySlice$1 = uncurryThis$5([].slice);
3432
3433 var $$6 = _export;
3434 var global$5 = global$G;
3435 var isArray$1 = isArray$4;
3436 var isConstructor = isConstructor$3;
3437 var isObject = isObject$a;
3438 var toAbsoluteIndex$1 = toAbsoluteIndex$4;
3439 var lengthOfArrayLike$1 = lengthOfArrayLike$7;
3440 var toIndexedObject$1 = toIndexedObject$8;
3441 var createProperty$1 = createProperty$4;
3442 var wellKnownSymbol$4 = wellKnownSymbol$j;
3443 var arrayMethodHasSpeciesSupport$1 = arrayMethodHasSpeciesSupport$5;
3444 var un$Slice = arraySlice$1;
3445
3446 var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport$1('slice');
3447
3448 var SPECIES = wellKnownSymbol$4('species');
3449 var Array$1 = global$5.Array;
3450 var max$1 = Math.max;
3451
3452 // `Array.prototype.slice` method
3453 // https://tc39.es/ecma262/#sec-array.prototype.slice
3454 // fallback for not array-like ES3 strings and DOM objects
3455 $$6({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
3456 slice: function slice(start, end) {
3457 var O = toIndexedObject$1(this);
3458 var length = lengthOfArrayLike$1(O);
3459 var k = toAbsoluteIndex$1(start, length);
3460 var fin = toAbsoluteIndex$1(end === undefined ? length : end, length);
3461 // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
3462 var Constructor, result, n;
3463 if (isArray$1(O)) {
3464 Constructor = O.constructor;
3465 // cross-realm fallback
3466 if (isConstructor(Constructor) && (Constructor === Array$1 || isArray$1(Constructor.prototype))) {
3467 Constructor = undefined;
3468 } else if (isObject(Constructor)) {
3469 Constructor = Constructor[SPECIES];
3470 if (Constructor === null) Constructor = undefined;
3471 }
3472 if (Constructor === Array$1 || Constructor === undefined) {
3473 return un$Slice(O, k, fin);
3474 }
3475 }
3476 result = new (Constructor === undefined ? Array$1 : Constructor)(max$1(fin - k, 0));
3477 for (n = 0; k < fin; k++, n++) if (k in O) createProperty$1(result, n, O[k]);
3478 result.length = n;
3479 return result;
3480 }
3481 });
3482
3483 var iterators = {};
3484
3485 var fails$3 = fails$u;
3486
3487 var correctPrototypeGetter = !fails$3(function () {
3488 function F() { /* empty */ }
3489 F.prototype.constructor = null;
3490 // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
3491 return Object.getPrototypeOf(new F()) !== F.prototype;
3492 });
3493
3494 var global$4 = global$G;
3495 var hasOwn$2 = hasOwnProperty_1;
3496 var isCallable$2 = isCallable$j;
3497 var toObject$2 = toObject$9;
3498 var sharedKey = sharedKey$3;
3499 var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
3500
3501 var IE_PROTO = sharedKey('IE_PROTO');
3502 var Object$1 = global$4.Object;
3503 var ObjectPrototype = Object$1.prototype;
3504
3505 // `Object.getPrototypeOf` method
3506 // https://tc39.es/ecma262/#sec-object.getprototypeof
3507 var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? Object$1.getPrototypeOf : function (O) {
3508 var object = toObject$2(O);
3509 if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
3510 var constructor = object.constructor;
3511 if (isCallable$2(constructor) && object instanceof constructor) {
3512 return constructor.prototype;
3513 } return object instanceof Object$1 ? ObjectPrototype : null;
3514 };
3515
3516 var fails$2 = fails$u;
3517 var isCallable$1 = isCallable$j;
3518 var getPrototypeOf$1 = objectGetPrototypeOf;
3519 var defineBuiltIn$2 = defineBuiltIn$8;
3520 var wellKnownSymbol$3 = wellKnownSymbol$j;
3521
3522 var ITERATOR$2 = wellKnownSymbol$3('iterator');
3523 var BUGGY_SAFARI_ITERATORS$1 = false;
3524
3525 // `%IteratorPrototype%` object
3526 // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
3527 var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
3528
3529 /* eslint-disable es-x/no-array-prototype-keys -- safe */
3530 if ([].keys) {
3531 arrayIterator = [].keys();
3532 // Safari 8 has buggy iterators w/o `next`
3533 if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
3534 else {
3535 PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
3536 if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
3537 }
3538 }
3539
3540 var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails$2(function () {
3541 var test = {};
3542 // FF44- legacy iterators case
3543 return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
3544 });
3545
3546 if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
3547
3548 // `%IteratorPrototype%[@@iterator]()` method
3549 // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
3550 if (!isCallable$1(IteratorPrototype$2[ITERATOR$2])) {
3551 defineBuiltIn$2(IteratorPrototype$2, ITERATOR$2, function () {
3552 return this;
3553 });
3554 }
3555
3556 var iteratorsCore = {
3557 IteratorPrototype: IteratorPrototype$2,
3558 BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
3559 };
3560
3561 var defineProperty$2 = objectDefineProperty.f;
3562 var hasOwn$1 = hasOwnProperty_1;
3563 var wellKnownSymbol$2 = wellKnownSymbol$j;
3564
3565 var TO_STRING_TAG$1 = wellKnownSymbol$2('toStringTag');
3566
3567 var setToStringTag$2 = function (target, TAG, STATIC) {
3568 if (target && !STATIC) target = target.prototype;
3569 if (target && !hasOwn$1(target, TO_STRING_TAG$1)) {
3570 defineProperty$2(target, TO_STRING_TAG$1, { configurable: true, value: TAG });
3571 }
3572 };
3573
3574 var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
3575 var create = objectCreate;
3576 var createPropertyDescriptor = createPropertyDescriptor$4;
3577 var setToStringTag$1 = setToStringTag$2;
3578 var Iterators$2 = iterators;
3579
3580 var returnThis$1 = function () { return this; };
3581
3582 var createIteratorConstructor$1 = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
3583 var TO_STRING_TAG = NAME + ' Iterator';
3584 IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
3585 setToStringTag$1(IteratorConstructor, TO_STRING_TAG, false);
3586 Iterators$2[TO_STRING_TAG] = returnThis$1;
3587 return IteratorConstructor;
3588 };
3589
3590 var $$5 = _export;
3591 var call$1 = functionCall;
3592 var FunctionName = functionName;
3593 var isCallable = isCallable$j;
3594 var createIteratorConstructor = createIteratorConstructor$1;
3595 var getPrototypeOf = objectGetPrototypeOf;
3596 var setPrototypeOf = objectSetPrototypeOf;
3597 var setToStringTag = setToStringTag$2;
3598 var createNonEnumerableProperty$1 = createNonEnumerableProperty$8;
3599 var defineBuiltIn$1 = defineBuiltIn$8;
3600 var wellKnownSymbol$1 = wellKnownSymbol$j;
3601 var Iterators$1 = iterators;
3602 var IteratorsCore = iteratorsCore;
3603
3604 var PROPER_FUNCTION_NAME = FunctionName.PROPER;
3605 var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
3606 var IteratorPrototype = IteratorsCore.IteratorPrototype;
3607 var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
3608 var ITERATOR$1 = wellKnownSymbol$1('iterator');
3609 var KEYS = 'keys';
3610 var VALUES = 'values';
3611 var ENTRIES = 'entries';
3612
3613 var returnThis = function () { return this; };
3614
3615 var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
3616 createIteratorConstructor(IteratorConstructor, NAME, next);
3617
3618 var getIterationMethod = function (KIND) {
3619 if (KIND === DEFAULT && defaultIterator) return defaultIterator;
3620 if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
3621 switch (KIND) {
3622 case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
3623 case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
3624 case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
3625 } return function () { return new IteratorConstructor(this); };
3626 };
3627
3628 var TO_STRING_TAG = NAME + ' Iterator';
3629 var INCORRECT_VALUES_NAME = false;
3630 var IterablePrototype = Iterable.prototype;
3631 var nativeIterator = IterablePrototype[ITERATOR$1]
3632 || IterablePrototype['@@iterator']
3633 || DEFAULT && IterablePrototype[DEFAULT];
3634 var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
3635 var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
3636 var CurrentIteratorPrototype, methods, KEY;
3637
3638 // fix native
3639 if (anyNativeIterator) {
3640 CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
3641 if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
3642 if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
3643 if (setPrototypeOf) {
3644 setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
3645 } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
3646 defineBuiltIn$1(CurrentIteratorPrototype, ITERATOR$1, returnThis);
3647 }
3648 }
3649 // Set @@toStringTag to native iterators
3650 setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
3651 }
3652 }
3653
3654 // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
3655 if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
3656 if (CONFIGURABLE_FUNCTION_NAME) {
3657 createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
3658 } else {
3659 INCORRECT_VALUES_NAME = true;
3660 defaultIterator = function values() { return call$1(nativeIterator, this); };
3661 }
3662 }
3663
3664 // export additional methods
3665 if (DEFAULT) {
3666 methods = {
3667 values: getIterationMethod(VALUES),
3668 keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
3669 entries: getIterationMethod(ENTRIES)
3670 };
3671 if (FORCED) for (KEY in methods) {
3672 if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
3673 defineBuiltIn$1(IterablePrototype, KEY, methods[KEY]);
3674 }
3675 } else $$5({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
3676 }
3677
3678 // define iterator
3679 if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
3680 defineBuiltIn$1(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
3681 }
3682 Iterators$1[NAME] = defaultIterator;
3683
3684 return methods;
3685 };
3686
3687 var toIndexedObject = toIndexedObject$8;
3688 var addToUnscopables = addToUnscopables$4;
3689 var Iterators = iterators;
3690 var InternalStateModule = internalState;
3691 var defineProperty$1 = objectDefineProperty.f;
3692 var defineIterator = defineIterator$1;
3693 var DESCRIPTORS$1 = descriptors;
3694
3695 var ARRAY_ITERATOR = 'Array Iterator';
3696 var setInternalState = InternalStateModule.set;
3697 var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
3698
3699 // `Array.prototype.entries` method
3700 // https://tc39.es/ecma262/#sec-array.prototype.entries
3701 // `Array.prototype.keys` method
3702 // https://tc39.es/ecma262/#sec-array.prototype.keys
3703 // `Array.prototype.values` method
3704 // https://tc39.es/ecma262/#sec-array.prototype.values
3705 // `Array.prototype[@@iterator]` method
3706 // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
3707 // `CreateArrayIterator` internal method
3708 // https://tc39.es/ecma262/#sec-createarrayiterator
3709 var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
3710 setInternalState(this, {
3711 type: ARRAY_ITERATOR,
3712 target: toIndexedObject(iterated), // target
3713 index: 0, // next index
3714 kind: kind // kind
3715 });
3716 // `%ArrayIteratorPrototype%.next` method
3717 // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
3718 }, function () {
3719 var state = getInternalState(this);
3720 var target = state.target;
3721 var kind = state.kind;
3722 var index = state.index++;
3723 if (!target || index >= target.length) {
3724 state.target = undefined;
3725 return { value: undefined, done: true };
3726 }
3727 if (kind == 'keys') return { value: index, done: false };
3728 if (kind == 'values') return { value: target[index], done: false };
3729 return { value: [index, target[index]], done: false };
3730 }, 'values');
3731
3732 // argumentsList[@@iterator] is %ArrayProto_values%
3733 // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
3734 // https://tc39.es/ecma262/#sec-createmappedargumentsobject
3735 var values = Iterators.Arguments = Iterators.Array;
3736
3737 // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
3738 addToUnscopables('keys');
3739 addToUnscopables('values');
3740 addToUnscopables('entries');
3741
3742 // V8 ~ Chrome 45- bug
3743 if (DESCRIPTORS$1 && values.name !== 'values') try {
3744 defineProperty$1(values, 'name', { value: 'values' });
3745 } catch (error) { /* empty */ }
3746
3747 var global$3 = global$G;
3748 var DOMIterables = domIterables;
3749 var DOMTokenListPrototype = domTokenListPrototype;
3750 var ArrayIteratorMethods = es_array_iterator;
3751 var createNonEnumerableProperty = createNonEnumerableProperty$8;
3752 var wellKnownSymbol = wellKnownSymbol$j;
3753
3754 var ITERATOR = wellKnownSymbol('iterator');
3755 var TO_STRING_TAG = wellKnownSymbol('toStringTag');
3756 var ArrayValues = ArrayIteratorMethods.values;
3757
3758 var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
3759 if (CollectionPrototype) {
3760 // some Chrome versions have non-configurable methods on DOMTokenList
3761 if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
3762 createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
3763 } catch (error) {
3764 CollectionPrototype[ITERATOR] = ArrayValues;
3765 }
3766 if (!CollectionPrototype[TO_STRING_TAG]) {
3767 createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
3768 }
3769 if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
3770 // some Chrome versions have non-configurable methods on DOMTokenList
3771 if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
3772 createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
3773 } catch (error) {
3774 CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
3775 }
3776 }
3777 }
3778 };
3779
3780 for (var COLLECTION_NAME in DOMIterables) {
3781 handlePrototype(global$3[COLLECTION_NAME] && global$3[COLLECTION_NAME].prototype, COLLECTION_NAME);
3782 }
3783
3784 handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
3785
3786 var $$4 = _export;
3787 var global$2 = global$G;
3788 var toAbsoluteIndex = toAbsoluteIndex$4;
3789 var toIntegerOrInfinity = toIntegerOrInfinity$5;
3790 var lengthOfArrayLike = lengthOfArrayLike$7;
3791 var toObject$1 = toObject$9;
3792 var arraySpeciesCreate = arraySpeciesCreate$3;
3793 var createProperty = createProperty$4;
3794 var arrayMethodHasSpeciesSupport = arrayMethodHasSpeciesSupport$5;
3795
3796 var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
3797
3798 var TypeError$2 = global$2.TypeError;
3799 var max = Math.max;
3800 var min$2 = Math.min;
3801 var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
3802 var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
3803
3804 // `Array.prototype.splice` method
3805 // https://tc39.es/ecma262/#sec-array.prototype.splice
3806 // with adding support of @@species
3807 $$4({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
3808 splice: function splice(start, deleteCount /* , ...items */) {
3809 var O = toObject$1(this);
3810 var len = lengthOfArrayLike(O);
3811 var actualStart = toAbsoluteIndex(start, len);
3812 var argumentsLength = arguments.length;
3813 var insertCount, actualDeleteCount, A, k, from, to;
3814 if (argumentsLength === 0) {
3815 insertCount = actualDeleteCount = 0;
3816 } else if (argumentsLength === 1) {
3817 insertCount = 0;
3818 actualDeleteCount = len - actualStart;
3819 } else {
3820 insertCount = argumentsLength - 2;
3821 actualDeleteCount = min$2(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
3822 }
3823 if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
3824 throw TypeError$2(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
3825 }
3826 A = arraySpeciesCreate(O, actualDeleteCount);
3827 for (k = 0; k < actualDeleteCount; k++) {
3828 from = actualStart + k;
3829 if (from in O) createProperty(A, k, O[from]);
3830 }
3831 A.length = actualDeleteCount;
3832 if (insertCount < actualDeleteCount) {
3833 for (k = actualStart; k < len - actualDeleteCount; k++) {
3834 from = k + actualDeleteCount;
3835 to = k + insertCount;
3836 if (from in O) O[to] = O[from];
3837 else delete O[to];
3838 }
3839 for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
3840 } else if (insertCount > actualDeleteCount) {
3841 for (k = len - actualDeleteCount; k > actualStart; k--) {
3842 from = k + actualDeleteCount - 1;
3843 to = k + insertCount - 1;
3844 if (from in O) O[to] = O[from];
3845 else delete O[to];
3846 }
3847 }
3848 for (k = 0; k < insertCount; k++) {
3849 O[k + actualStart] = arguments[k + 2];
3850 }
3851 O.length = len - actualDeleteCount + insertCount;
3852 return A;
3853 }
3854 });
3855
3856 var uncurryThis$4 = functionUncurryThis;
3857
3858 // `thisNumberValue` abstract operation
3859 // https://tc39.es/ecma262/#sec-thisnumbervalue
3860 var thisNumberValue$1 = uncurryThis$4(1.0.valueOf);
3861
3862 var DESCRIPTORS = descriptors;
3863 var global$1 = global$G;
3864 var uncurryThis$3 = functionUncurryThis;
3865 var isForced = isForced_1;
3866 var defineBuiltIn = defineBuiltIn$8;
3867 var hasOwn = hasOwnProperty_1;
3868 var inheritIfRequired = inheritIfRequired$2;
3869 var isPrototypeOf = objectIsPrototypeOf;
3870 var isSymbol = isSymbol$3;
3871 var toPrimitive = toPrimitive$2;
3872 var fails$1 = fails$u;
3873 var getOwnPropertyNames = objectGetOwnPropertyNames.f;
3874 var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
3875 var defineProperty = objectDefineProperty.f;
3876 var thisNumberValue = thisNumberValue$1;
3877 var trim = stringTrim.trim;
3878
3879 var NUMBER = 'Number';
3880 var NativeNumber = global$1[NUMBER];
3881 var NumberPrototype = NativeNumber.prototype;
3882 var TypeError$1 = global$1.TypeError;
3883 var arraySlice = uncurryThis$3(''.slice);
3884 var charCodeAt = uncurryThis$3(''.charCodeAt);
3885
3886 // `ToNumeric` abstract operation
3887 // https://tc39.es/ecma262/#sec-tonumeric
3888 var toNumeric = function (value) {
3889 var primValue = toPrimitive(value, 'number');
3890 return typeof primValue == 'bigint' ? primValue : toNumber(primValue);
3891 };
3892
3893 // `ToNumber` abstract operation
3894 // https://tc39.es/ecma262/#sec-tonumber
3895 var toNumber = function (argument) {
3896 var it = toPrimitive(argument, 'number');
3897 var first, third, radix, maxCode, digits, length, index, code;
3898 if (isSymbol(it)) throw TypeError$1('Cannot convert a Symbol value to a number');
3899 if (typeof it == 'string' && it.length > 2) {
3900 it = trim(it);
3901 first = charCodeAt(it, 0);
3902 if (first === 43 || first === 45) {
3903 third = charCodeAt(it, 2);
3904 if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
3905 } else if (first === 48) {
3906 switch (charCodeAt(it, 1)) {
3907 case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i
3908 case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i
3909 default: return +it;
3910 }
3911 digits = arraySlice(it, 2);
3912 length = digits.length;
3913 for (index = 0; index < length; index++) {
3914 code = charCodeAt(digits, index);
3915 // parseInt parses a string to a first unavailable symbol
3916 // but ToNumber should return NaN if a string contains unavailable symbols
3917 if (code < 48 || code > maxCode) return NaN;
3918 } return parseInt(digits, radix);
3919 }
3920 } return +it;
3921 };
3922
3923 // `Number` constructor
3924 // https://tc39.es/ecma262/#sec-number-constructor
3925 if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {
3926 var NumberWrapper = function Number(value) {
3927 var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value));
3928 var dummy = this;
3929 // check on 1..constructor(foo) case
3930 return isPrototypeOf(NumberPrototype, dummy) && fails$1(function () { thisNumberValue(dummy); })
3931 ? inheritIfRequired(Object(n), dummy, NumberWrapper) : n;
3932 };
3933 for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (
3934 // ES3:
3935 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
3936 // ES2015 (in case, if modules with ES2015 Number statics required before):
3937 'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' +
3938 // ESNext
3939 'fromString,range'
3940 ).split(','), j = 0, key; keys.length > j; j++) {
3941 if (hasOwn(NativeNumber, key = keys[j]) && !hasOwn(NumberWrapper, key)) {
3942 defineProperty(NumberWrapper, key, getOwnPropertyDescriptor$2(NativeNumber, key));
3943 }
3944 }
3945 NumberWrapper.prototype = NumberPrototype;
3946 NumberPrototype.constructor = NumberWrapper;
3947 defineBuiltIn(global$1, NUMBER, NumberWrapper, { constructor: true });
3948 }
3949
3950 var $$3 = _export;
3951 var uncurryThis$2 = functionUncurryThis;
3952 var isArray = isArray$4;
3953
3954 var un$Reverse = uncurryThis$2([].reverse);
3955 var test = [1, 2];
3956
3957 // `Array.prototype.reverse` method
3958 // https://tc39.es/ecma262/#sec-array.prototype.reverse
3959 // fix for Safari 12.0 bug
3960 // https://bugs.webkit.org/show_bug.cgi?id=188794
3961 $$3({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
3962 reverse: function reverse() {
3963 // eslint-disable-next-line no-self-assign -- dirty hack
3964 if (isArray(this)) this.length = this.length;
3965 return un$Reverse(this);
3966 }
3967 });
3968
3969 var $$2 = _export;
3970 var toObject = toObject$9;
3971 var nativeKeys = objectKeys$3;
3972 var fails = fails$u;
3973
3974 var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
3975
3976 // `Object.keys` method
3977 // https://tc39.es/ecma262/#sec-object.keys
3978 $$2({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
3979 keys: function keys(it) {
3980 return nativeKeys(toObject(it));
3981 }
3982 });
3983
3984 var call = functionCall;
3985 var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
3986 var anObject = anObject$d;
3987 var toLength$2 = toLength$6;
3988 var toString$2 = toString$f;
3989 var requireObjectCoercible$2 = requireObjectCoercible$b;
3990 var getMethod = getMethod$5;
3991 var advanceStringIndex = advanceStringIndex$3;
3992 var regExpExec = regexpExecAbstract;
3993
3994 // @@match logic
3995 fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
3996 return [
3997 // `String.prototype.match` method
3998 // https://tc39.es/ecma262/#sec-string.prototype.match
3999 function match(regexp) {
4000 var O = requireObjectCoercible$2(this);
4001 var matcher = regexp == undefined ? undefined : getMethod(regexp, MATCH);
4002 return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$2(O));
4003 },
4004 // `RegExp.prototype[@@match]` method
4005 // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
4006 function (string) {
4007 var rx = anObject(this);
4008 var S = toString$2(string);
4009 var res = maybeCallNative(nativeMatch, rx, S);
4010
4011 if (res.done) return res.value;
4012
4013 if (!rx.global) return regExpExec(rx, S);
4014
4015 var fullUnicode = rx.unicode;
4016 rx.lastIndex = 0;
4017 var A = [];
4018 var n = 0;
4019 var result;
4020 while ((result = regExpExec(rx, S)) !== null) {
4021 var matchStr = toString$2(result[0]);
4022 A[n] = matchStr;
4023 if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength$2(rx.lastIndex), fullUnicode);
4024 n++;
4025 }
4026 return n === 0 ? null : A;
4027 }
4028 ];
4029 });
4030
4031 var $$1 = _export;
4032 var uncurryThis$1 = functionUncurryThis;
4033 var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
4034 var toLength$1 = toLength$6;
4035 var toString$1 = toString$f;
4036 var notARegExp$1 = notARegexp;
4037 var requireObjectCoercible$1 = requireObjectCoercible$b;
4038 var correctIsRegExpLogic$1 = correctIsRegexpLogic;
4039
4040 // eslint-disable-next-line es-x/no-string-prototype-startswith -- safe
4041 var un$StartsWith = uncurryThis$1(''.startsWith);
4042 var stringSlice = uncurryThis$1(''.slice);
4043 var min$1 = Math.min;
4044
4045 var CORRECT_IS_REGEXP_LOGIC$1 = correctIsRegExpLogic$1('startsWith');
4046 // https://github.com/zloirock/core-js/pull/702
4047 var MDN_POLYFILL_BUG$1 = !CORRECT_IS_REGEXP_LOGIC$1 && !!function () {
4048 var descriptor = getOwnPropertyDescriptor$1(String.prototype, 'startsWith');
4049 return descriptor && !descriptor.writable;
4050 }();
4051
4052 // `String.prototype.startsWith` method
4053 // https://tc39.es/ecma262/#sec-string.prototype.startswith
4054 $$1({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG$1 && !CORRECT_IS_REGEXP_LOGIC$1 }, {
4055 startsWith: function startsWith(searchString /* , position = 0 */) {
4056 var that = toString$1(requireObjectCoercible$1(this));
4057 notARegExp$1(searchString);
4058 var index = toLength$1(min$1(arguments.length > 1 ? arguments[1] : undefined, that.length));
4059 var search = toString$1(searchString);
4060 return un$StartsWith
4061 ? un$StartsWith(that, search, index)
4062 : stringSlice(that, index, index + search.length) === search;
4063 }
4064 });
4065
4066 var $ = _export;
4067 var uncurryThis = functionUncurryThis;
4068 var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
4069 var toLength = toLength$6;
4070 var toString = toString$f;
4071 var notARegExp = notARegexp;
4072 var requireObjectCoercible = requireObjectCoercible$b;
4073 var correctIsRegExpLogic = correctIsRegexpLogic;
4074
4075 // eslint-disable-next-line es-x/no-string-prototype-endswith -- safe
4076 var un$EndsWith = uncurryThis(''.endsWith);
4077 var slice = uncurryThis(''.slice);
4078 var min = Math.min;
4079
4080 var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith');
4081 // https://github.com/zloirock/core-js/pull/702
4082 var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
4083 var descriptor = getOwnPropertyDescriptor(String.prototype, 'endsWith');
4084 return descriptor && !descriptor.writable;
4085 }();
4086
4087 // `String.prototype.endsWith` method
4088 // https://tc39.es/ecma262/#sec-string.prototype.endswith
4089 $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
4090 endsWith: function endsWith(searchString /* , endPosition = @length */) {
4091 var that = toString(requireObjectCoercible(this));
4092 notARegExp(searchString);
4093 var endPosition = arguments.length > 1 ? arguments[1] : undefined;
4094 var len = that.length;
4095 var end = endPosition === undefined ? len : min(toLength(endPosition), len);
4096 var search = toString(searchString);
4097 return un$EndsWith
4098 ? un$EndsWith(that, search, end)
4099 : slice(that, end - search.length, end) === search;
4100 }
4101 });
4102
4103 var Utils = {
4104 getBootstrapVersion: function getBootstrapVersion() {
4105 var bootstrapVersion = 5;
4106
4107 try {
4108 var rawVersion = $__default["default"].fn.dropdown.Constructor.VERSION; // Only try to parse VERSION if it is defined.
4109 // It is undefined in older versions of Bootstrap (tested with 3.1.1).
4110
4111 if (rawVersion !== undefined) {
4112 bootstrapVersion = parseInt(rawVersion, 10);
4113 }
4114 } catch (e) {// ignore
4115 }
4116
4117 try {
4118 // eslint-disable-next-line no-undef
4119 var _rawVersion = bootstrap.Tooltip.VERSION;
4120
4121 if (_rawVersion !== undefined) {
4122 bootstrapVersion = parseInt(_rawVersion, 10);
4123 }
4124 } catch (e) {// ignore
4125 }
4126
4127 return bootstrapVersion;
4128 },
4129 getIconsPrefix: function getIconsPrefix(theme) {
4130 return {
4131 bootstrap3: 'glyphicon',
4132 bootstrap4: 'fa',
4133 bootstrap5: 'bi',
4134 'bootstrap-table': 'icon',
4135 bulma: 'fa',
4136 foundation: 'fa',
4137 materialize: 'material-icons',
4138 semantic: 'fa'
4139 }[theme] || 'fa';
4140 },
4141 getIcons: function getIcons(prefix) {
4142 return {
4143 glyphicon: {
4144 paginationSwitchDown: 'glyphicon-collapse-down icon-chevron-down',
4145 paginationSwitchUp: 'glyphicon-collapse-up icon-chevron-up',
4146 refresh: 'glyphicon-refresh icon-refresh',
4147 toggleOff: 'glyphicon-list-alt icon-list-alt',
4148 toggleOn: 'glyphicon-list-alt icon-list-alt',
4149 columns: 'glyphicon-th icon-th',
4150 detailOpen: 'glyphicon-plus icon-plus',
4151 detailClose: 'glyphicon-minus icon-minus',
4152 fullscreen: 'glyphicon-fullscreen',
4153 search: 'glyphicon-search',
4154 clearSearch: 'glyphicon-trash'
4155 },
4156 fa: {
4157 paginationSwitchDown: 'fa-caret-square-down',
4158 paginationSwitchUp: 'fa-caret-square-up',
4159 refresh: 'fa-sync',
4160 toggleOff: 'fa-toggle-off',
4161 toggleOn: 'fa-toggle-on',
4162 columns: 'fa-th-list',
4163 detailOpen: 'fa-plus',
4164 detailClose: 'fa-minus',
4165 fullscreen: 'fa-arrows-alt',
4166 search: 'fa-search',
4167 clearSearch: 'fa-trash'
4168 },
4169 bi: {
4170 paginationSwitchDown: 'bi-caret-down-square',
4171 paginationSwitchUp: 'bi-caret-up-square',
4172 refresh: 'bi-arrow-clockwise',
4173 toggleOff: 'bi-toggle-off',
4174 toggleOn: 'bi-toggle-on',
4175 columns: 'bi-list-ul',
4176 detailOpen: 'bi-plus',
4177 detailClose: 'bi-dash',
4178 fullscreen: 'bi-arrows-move',
4179 search: 'bi-search',
4180 clearSearch: 'bi-trash'
4181 },
4182 icon: {
4183 paginationSwitchDown: 'icon-arrow-up-circle',
4184 paginationSwitchUp: 'icon-arrow-down-circle',
4185 refresh: 'icon-refresh-cw',
4186 toggleOff: 'icon-toggle-right',
4187 toggleOn: 'icon-toggle-right',
4188 columns: 'icon-list',
4189 detailOpen: 'icon-plus',
4190 detailClose: 'icon-minus',
4191 fullscreen: 'icon-maximize',
4192 search: 'icon-search',
4193 clearSearch: 'icon-trash-2'
4194 },
4195 'material-icons': {
4196 paginationSwitchDown: 'grid_on',
4197 paginationSwitchUp: 'grid_off',
4198 refresh: 'refresh',
4199 toggleOff: 'tablet',
4200 toggleOn: 'tablet_android',
4201 columns: 'view_list',
4202 detailOpen: 'add',
4203 detailClose: 'remove',
4204 fullscreen: 'fullscreen',
4205 sort: 'sort',
4206 search: 'search',
4207 clearSearch: 'delete'
4208 }
4209 }[prefix];
4210 },
4211 getSearchInput: function getSearchInput(that) {
4212 if (typeof that.options.searchSelector === 'string') {
4213 return $__default["default"](that.options.searchSelector);
4214 }
4215
4216 return that.$toolbar.find('.search input');
4217 },
4218 // it only does '%s', and return '' when arguments are undefined
4219 sprintf: function sprintf(_str) {
4220 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
4221 args[_key - 1] = arguments[_key];
4222 }
4223
4224 var flag = true;
4225 var i = 0;
4226
4227 var str = _str.replace(/%s/g, function () {
4228 var arg = args[i++];
4229
4230 if (typeof arg === 'undefined') {
4231 flag = false;
4232 return '';
4233 }
4234
4235 return arg;
4236 });
4237
4238 return flag ? str : '';
4239 },
4240 isObject: function isObject(val) {
4241 return val instanceof Object && !Array.isArray(val);
4242 },
4243 isEmptyObject: function isEmptyObject() {
4244 var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4245 return Object.entries(obj).length === 0 && obj.constructor === Object;
4246 },
4247 isNumeric: function isNumeric(n) {
4248 return !isNaN(parseFloat(n)) && isFinite(n);
4249 },
4250 getFieldTitle: function getFieldTitle(list, value) {
4251 var _iterator = _createForOfIteratorHelper(list),
4252 _step;
4253
4254 try {
4255 for (_iterator.s(); !(_step = _iterator.n()).done;) {
4256 var item = _step.value;
4257
4258 if (item.field === value) {
4259 return item.title;
4260 }
4261 }
4262 } catch (err) {
4263 _iterator.e(err);
4264 } finally {
4265 _iterator.f();
4266 }
4267
4268 return '';
4269 },
4270 setFieldIndex: function setFieldIndex(columns) {
4271 var totalCol = 0;
4272 var flag = [];
4273
4274 var _iterator2 = _createForOfIteratorHelper(columns[0]),
4275 _step2;
4276
4277 try {
4278 for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
4279 var column = _step2.value;
4280 totalCol += column.colspan || 1;
4281 }
4282 } catch (err) {
4283 _iterator2.e(err);
4284 } finally {
4285 _iterator2.f();
4286 }
4287
4288 for (var i = 0; i < columns.length; i++) {
4289 flag[i] = [];
4290
4291 for (var j = 0; j < totalCol; j++) {
4292 flag[i][j] = false;
4293 }
4294 }
4295
4296 for (var _i = 0; _i < columns.length; _i++) {
4297 var _iterator3 = _createForOfIteratorHelper(columns[_i]),
4298 _step3;
4299
4300 try {
4301 for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
4302 var r = _step3.value;
4303 var rowspan = r.rowspan || 1;
4304 var colspan = r.colspan || 1;
4305
4306 var index = flag[_i].indexOf(false);
4307
4308 r.colspanIndex = index;
4309
4310 if (colspan === 1) {
4311 r.fieldIndex = index; // when field is undefined, use index instead
4312
4313 if (typeof r.field === 'undefined') {
4314 r.field = index;
4315 }
4316 } else {
4317 r.colspanGroup = r.colspan;
4318 }
4319
4320 for (var _j = 0; _j < rowspan; _j++) {
4321 for (var k = 0; k < colspan; k++) {
4322 flag[_i + _j][index + k] = true;
4323 }
4324 }
4325 }
4326 } catch (err) {
4327 _iterator3.e(err);
4328 } finally {
4329 _iterator3.f();
4330 }
4331 }
4332 },
4333 normalizeAccent: function normalizeAccent(value) {
4334 if (typeof value !== 'string') {
4335 return value;
4336 }
4337
4338 return value.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
4339 },
4340 updateFieldGroup: function updateFieldGroup(columns, fieldColumns) {
4341 var _ref;
4342
4343 var allColumns = (_ref = []).concat.apply(_ref, _toConsumableArray(columns));
4344
4345 var _iterator4 = _createForOfIteratorHelper(columns),
4346 _step4;
4347
4348 try {
4349 for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
4350 var c = _step4.value;
4351
4352 var _iterator6 = _createForOfIteratorHelper(c),
4353 _step6;
4354
4355 try {
4356 for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
4357 var r = _step6.value;
4358
4359 if (r.colspanGroup > 1) {
4360 var colspan = 0;
4361
4362 var _loop = function _loop(i) {
4363 var column = allColumns.find(function (col) {
4364 return col.fieldIndex === i;
4365 });
4366
4367 if (column.visible) {
4368 colspan++;
4369 }
4370 };
4371
4372 for (var i = r.colspanIndex; i < r.colspanIndex + r.colspanGroup; i++) {
4373 _loop(i);
4374 }
4375
4376 r.colspan = colspan;
4377 r.visible = colspan > 0;
4378 }
4379 }
4380 } catch (err) {
4381 _iterator6.e(err);
4382 } finally {
4383 _iterator6.f();
4384 }
4385 }
4386 } catch (err) {
4387 _iterator4.e(err);
4388 } finally {
4389 _iterator4.f();
4390 }
4391
4392 if (columns.length < 2) {
4393 return;
4394 }
4395
4396 var _iterator5 = _createForOfIteratorHelper(fieldColumns),
4397 _step5;
4398
4399 try {
4400 var _loop2 = function _loop2() {
4401 var column = _step5.value;
4402 var sameColumns = allColumns.filter(function (col) {
4403 return col.fieldIndex === column.fieldIndex;
4404 });
4405
4406 if (sameColumns.length > 1) {
4407 var _iterator7 = _createForOfIteratorHelper(sameColumns),
4408 _step7;
4409
4410 try {
4411 for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
4412 var _c = _step7.value;
4413 _c.visible = column.visible;
4414 }
4415 } catch (err) {
4416 _iterator7.e(err);
4417 } finally {
4418 _iterator7.f();
4419 }
4420 }
4421 };
4422
4423 for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
4424 _loop2();
4425 }
4426 } catch (err) {
4427 _iterator5.e(err);
4428 } finally {
4429 _iterator5.f();
4430 }
4431 },
4432 getScrollBarWidth: function getScrollBarWidth() {
4433 if (this.cachedWidth === undefined) {
4434 var $inner = $__default["default"]('<div/>').addClass('fixed-table-scroll-inner');
4435 var $outer = $__default["default"]('<div/>').addClass('fixed-table-scroll-outer');
4436 $outer.append($inner);
4437 $__default["default"]('body').append($outer);
4438 var w1 = $inner[0].offsetWidth;
4439 $outer.css('overflow', 'scroll');
4440 var w2 = $inner[0].offsetWidth;
4441
4442 if (w1 === w2) {
4443 w2 = $outer[0].clientWidth;
4444 }
4445
4446 $outer.remove();
4447 this.cachedWidth = w1 - w2;
4448 }
4449
4450 return this.cachedWidth;
4451 },
4452 calculateObjectValue: function calculateObjectValue(self, name, args, defaultValue) {
4453 var func = name;
4454
4455 if (typeof name === 'string') {
4456 // support obj.func1.func2
4457 var names = name.split('.');
4458
4459 if (names.length > 1) {
4460 func = window;
4461
4462 var _iterator8 = _createForOfIteratorHelper(names),
4463 _step8;
4464
4465 try {
4466 for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
4467 var f = _step8.value;
4468 func = func[f];
4469 }
4470 } catch (err) {
4471 _iterator8.e(err);
4472 } finally {
4473 _iterator8.f();
4474 }
4475 } else {
4476 func = window[name];
4477 }
4478 }
4479
4480 if (func !== null && _typeof(func) === 'object') {
4481 return func;
4482 }
4483
4484 if (typeof func === 'function') {
4485 return func.apply(self, args || []);
4486 }
4487
4488 if (!func && typeof name === 'string' && args && this.sprintf.apply(this, [name].concat(_toConsumableArray(args)))) {
4489 return this.sprintf.apply(this, [name].concat(_toConsumableArray(args)));
4490 }
4491
4492 return defaultValue;
4493 },
4494 compareObjects: function compareObjects(objectA, objectB, compareLength) {
4495 var aKeys = Object.keys(objectA);
4496 var bKeys = Object.keys(objectB);
4497
4498 if (compareLength && aKeys.length !== bKeys.length) {
4499 return false;
4500 }
4501
4502 for (var _i2 = 0, _aKeys = aKeys; _i2 < _aKeys.length; _i2++) {
4503 var key = _aKeys[_i2];
4504
4505 if (bKeys.includes(key) && objectA[key] !== objectB[key]) {
4506 return false;
4507 }
4508 }
4509
4510 return true;
4511 },
4512 regexCompare: function regexCompare(value, search) {
4513 try {
4514 var regexpParts = search.match(/^\/(.*?)\/([gim]*)$/);
4515
4516 if (value.toString().search(regexpParts ? new RegExp(regexpParts[1], regexpParts[2]) : new RegExp(search, 'gim')) !== -1) {
4517 return true;
4518 }
4519 } catch (e) {
4520 return false;
4521 }
4522 },
4523 escapeHTML: function escapeHTML(text) {
4524 if (!text) {
4525 return text;
4526 }
4527
4528 return text.toString().replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#39;');
4529 },
4530 unescapeHTML: function unescapeHTML(text) {
4531 if (typeof text !== 'string' || !text) {
4532 return text;
4533 }
4534
4535 return text.toString().replace(/&amp;/g, '&').replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&#39;/g, '\'');
4536 },
4537 removeHTML: function removeHTML(text) {
4538 if (!text) {
4539 return text;
4540 }
4541
4542 return text.toString().replace(/(<([^>]+)>)/ig, '').replace(/&[#A-Za-z0-9]+;/gi, '').trim();
4543 },
4544 getRealDataAttr: function getRealDataAttr(dataAttr) {
4545 for (var _i3 = 0, _Object$entries = Object.entries(dataAttr); _i3 < _Object$entries.length; _i3++) {
4546 var _Object$entries$_i = _slicedToArray(_Object$entries[_i3], 2),
4547 attr = _Object$entries$_i[0],
4548 value = _Object$entries$_i[1];
4549
4550 var auxAttr = attr.split(/(?=[A-Z])/).join('-').toLowerCase();
4551
4552 if (auxAttr !== attr) {
4553 dataAttr[auxAttr] = value;
4554 delete dataAttr[attr];
4555 }
4556 }
4557
4558 return dataAttr;
4559 },
4560 getItemField: function getItemField(item, field, escape) {
4561 var columnEscape = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
4562 var value = item; // use column escape if it is defined
4563
4564 if (typeof columnEscape !== 'undefined') {
4565 escape = columnEscape;
4566 }
4567
4568 if (typeof field !== 'string' || item.hasOwnProperty(field)) {
4569 return escape ? this.escapeHTML(item[field]) : item[field];
4570 }
4571
4572 var props = field.split('.');
4573
4574 var _iterator9 = _createForOfIteratorHelper(props),
4575 _step9;
4576
4577 try {
4578 for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
4579 var p = _step9.value;
4580 value = value && value[p];
4581 }
4582 } catch (err) {
4583 _iterator9.e(err);
4584 } finally {
4585 _iterator9.f();
4586 }
4587
4588 return escape ? this.escapeHTML(value) : value;
4589 },
4590 isIEBrowser: function isIEBrowser() {
4591 return navigator.userAgent.includes('MSIE ') || /Trident.*rv:11\./.test(navigator.userAgent);
4592 },
4593 findIndex: function findIndex(items, item) {
4594 var _iterator10 = _createForOfIteratorHelper(items),
4595 _step10;
4596
4597 try {
4598 for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
4599 var it = _step10.value;
4600
4601 if (JSON.stringify(it) === JSON.stringify(item)) {
4602 return items.indexOf(it);
4603 }
4604 }
4605 } catch (err) {
4606 _iterator10.e(err);
4607 } finally {
4608 _iterator10.f();
4609 }
4610
4611 return -1;
4612 },
4613 trToData: function trToData(columns, $els) {
4614 var _this = this;
4615
4616 var data = [];
4617 var m = [];
4618 $els.each(function (y, el) {
4619 var $el = $__default["default"](el);
4620 var row = {}; // save tr's id, class and data-* attributes
4621
4622 row._id = $el.attr('id');
4623 row._class = $el.attr('class');
4624 row._data = _this.getRealDataAttr($el.data());
4625 row._style = $el.attr('style');
4626 $el.find('>td,>th').each(function (_x, el) {
4627 var $el = $__default["default"](el);
4628 var cspan = +$el.attr('colspan') || 1;
4629 var rspan = +$el.attr('rowspan') || 1;
4630 var x = _x; // skip already occupied cells in current row
4631
4632 for (; m[y] && m[y][x]; x++) {// ignore
4633 } // mark matrix elements occupied by current cell with true
4634
4635
4636 for (var tx = x; tx < x + cspan; tx++) {
4637 for (var ty = y; ty < y + rspan; ty++) {
4638 if (!m[ty]) {
4639 // fill missing rows
4640 m[ty] = [];
4641 }
4642
4643 m[ty][tx] = true;
4644 }
4645 }
4646
4647 var field = columns[x].field;
4648 row[field] = $el.html().trim(); // save td's id, class and data-* attributes
4649
4650 row["_".concat(field, "_id")] = $el.attr('id');
4651 row["_".concat(field, "_class")] = $el.attr('class');
4652 row["_".concat(field, "_rowspan")] = $el.attr('rowspan');
4653 row["_".concat(field, "_colspan")] = $el.attr('colspan');
4654 row["_".concat(field, "_title")] = $el.attr('title');
4655 row["_".concat(field, "_data")] = _this.getRealDataAttr($el.data());
4656 row["_".concat(field, "_style")] = $el.attr('style');
4657 });
4658 data.push(row);
4659 });
4660 return data;
4661 },
4662 sort: function sort(a, b, order, sortStable, aPosition, bPosition) {
4663 if (a === undefined || a === null) {
4664 a = '';
4665 }
4666
4667 if (b === undefined || b === null) {
4668 b = '';
4669 }
4670
4671 if (sortStable && a === b) {
4672 a = aPosition;
4673 b = bPosition;
4674 } // If both values are numeric, do a numeric comparison
4675
4676
4677 if (this.isNumeric(a) && this.isNumeric(b)) {
4678 // Convert numerical values form string to float.
4679 a = parseFloat(a);
4680 b = parseFloat(b);
4681
4682 if (a < b) {
4683 return order * -1;
4684 }
4685
4686 if (a > b) {
4687 return order;
4688 }
4689
4690 return 0;
4691 }
4692
4693 if (a === b) {
4694 return 0;
4695 } // If value is not a string, convert to string
4696
4697
4698 if (typeof a !== 'string') {
4699 a = a.toString();
4700 }
4701
4702 if (a.localeCompare(b) === -1) {
4703 return order * -1;
4704 }
4705
4706 return order;
4707 },
4708 getEventName: function getEventName(eventPrefix) {
4709 var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
4710 id = id || "".concat(+new Date()).concat(~~(Math.random() * 1000000));
4711 return "".concat(eventPrefix, "-").concat(id);
4712 },
4713 hasDetailViewIcon: function hasDetailViewIcon(options) {
4714 return options.detailView && options.detailViewIcon && !options.cardView;
4715 },
4716 getDetailViewIndexOffset: function getDetailViewIndexOffset(options) {
4717 return this.hasDetailViewIcon(options) && options.detailViewAlign !== 'right' ? 1 : 0;
4718 },
4719 checkAutoMergeCells: function checkAutoMergeCells(data) {
4720 var _iterator11 = _createForOfIteratorHelper(data),
4721 _step11;
4722
4723 try {
4724 for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
4725 var row = _step11.value;
4726
4727 for (var _i4 = 0, _Object$keys = Object.keys(row); _i4 < _Object$keys.length; _i4++) {
4728 var key = _Object$keys[_i4];
4729
4730 if (key.startsWith('_') && (key.endsWith('_rowspan') || key.endsWith('_colspan'))) {
4731 return true;
4732 }
4733 }
4734 }
4735 } catch (err) {
4736 _iterator11.e(err);
4737 } finally {
4738 _iterator11.f();
4739 }
4740
4741 return false;
4742 },
4743 deepCopy: function deepCopy(arg) {
4744 if (arg === undefined) {
4745 return arg;
4746 }
4747
4748 return $__default["default"].extend(true, Array.isArray(arg) ? [] : {}, arg);
4749 },
4750 debounce: function debounce(func, wait, immediate) {
4751 var timeout;
4752 return function executedFunction() {
4753 var context = this;
4754 var args = arguments;
4755
4756 var later = function later() {
4757 timeout = null;
4758 if (!immediate) func.apply(context, args);
4759 };
4760
4761 var callNow = immediate && !timeout;
4762 clearTimeout(timeout);
4763 timeout = setTimeout(later, wait);
4764 if (callNow) func.apply(context, args);
4765 };
4766 }
4767 };
4768
4769 var VERSION = '1.20.2';
4770 var bootstrapVersion = Utils.getBootstrapVersion();
4771 var CONSTANTS = {
4772 3: {
4773 classes: {
4774 buttonsPrefix: 'btn',
4775 buttons: 'default',
4776 buttonsGroup: 'btn-group',
4777 buttonsDropdown: 'btn-group',
4778 pull: 'pull',
4779 inputGroup: 'input-group',
4780 inputPrefix: 'input-',
4781 input: 'form-control',
4782 select: 'form-control',
4783 paginationDropdown: 'btn-group dropdown',
4784 dropup: 'dropup',
4785 dropdownActive: 'active',
4786 paginationActive: 'active',
4787 buttonActive: 'active'
4788 },
4789 html: {
4790 toolbarDropdown: ['<ul class="dropdown-menu" role="menu">', '</ul>'],
4791 toolbarDropdownItem: '<li class="dropdown-item-marker" role="menuitem"><label>%s</label></li>',
4792 toolbarDropdownSeparator: '<li class="divider"></li>',
4793 pageDropdown: ['<ul class="dropdown-menu" role="menu">', '</ul>'],
4794 pageDropdownItem: '<li role="menuitem" class="%s"><a href="#">%s</a></li>',
4795 dropdownCaret: '<span class="caret"></span>',
4796 pagination: ['<ul class="pagination%s">', '</ul>'],
4797 paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
4798 icon: '<i class="%s %s"></i>',
4799 inputGroup: '<div class="input-group">%s<span class="input-group-btn">%s</span></div>',
4800 searchInput: '<input class="%s%s" type="text" placeholder="%s">',
4801 searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
4802 searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
4803 }
4804 },
4805 4: {
4806 classes: {
4807 buttonsPrefix: 'btn',
4808 buttons: 'secondary',
4809 buttonsGroup: 'btn-group',
4810 buttonsDropdown: 'btn-group',
4811 pull: 'float',
4812 inputGroup: 'btn-group',
4813 inputPrefix: 'form-control-',
4814 input: 'form-control',
4815 select: 'form-control',
4816 paginationDropdown: 'btn-group dropdown',
4817 dropup: 'dropup',
4818 dropdownActive: 'active',
4819 paginationActive: 'active',
4820 buttonActive: 'active'
4821 },
4822 html: {
4823 toolbarDropdown: ['<div class="dropdown-menu dropdown-menu-right">', '</div>'],
4824 toolbarDropdownItem: '<label class="dropdown-item dropdown-item-marker">%s</label>',
4825 pageDropdown: ['<div class="dropdown-menu">', '</div>'],
4826 pageDropdownItem: '<a class="dropdown-item %s" href="#">%s</a>',
4827 toolbarDropdownSeparator: '<div class="dropdown-divider"></div>',
4828 dropdownCaret: '<span class="caret"></span>',
4829 pagination: ['<ul class="pagination%s">', '</ul>'],
4830 paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
4831 icon: '<i class="%s %s"></i>',
4832 inputGroup: '<div class="input-group">%s<div class="input-group-append">%s</div></div>',
4833 searchInput: '<input class="%s%s" type="text" placeholder="%s">',
4834 searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
4835 searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
4836 }
4837 },
4838 5: {
4839 classes: {
4840 buttonsPrefix: 'btn',
4841 buttons: 'secondary',
4842 buttonsGroup: 'btn-group',
4843 buttonsDropdown: 'btn-group',
4844 pull: 'float',
4845 inputGroup: 'btn-group',
4846 inputPrefix: 'form-control-',
4847 input: 'form-control',
4848 select: 'form-select',
4849 paginationDropdown: 'btn-group dropdown',
4850 dropup: 'dropup',
4851 dropdownActive: 'active',
4852 paginationActive: 'active',
4853 buttonActive: 'active'
4854 },
4855 html: {
4856 dataToggle: 'data-bs-toggle',
4857 toolbarDropdown: ['<div class="dropdown-menu dropdown-menu-right">', '</div>'],
4858 toolbarDropdownItem: '<label class="dropdown-item dropdown-item-marker">%s</label>',
4859 pageDropdown: ['<div class="dropdown-menu">', '</div>'],
4860 pageDropdownItem: '<a class="dropdown-item %s" href="#">%s</a>',
4861 toolbarDropdownSeparator: '<div class="dropdown-divider"></div>',
4862 dropdownCaret: '<span class="caret"></span>',
4863 pagination: ['<ul class="pagination%s">', '</ul>'],
4864 paginationItem: '<li class="page-item%s"><a class="page-link" aria-label="%s" href="javascript:void(0)">%s</a></li>',
4865 icon: '<i class="%s %s"></i>',
4866 inputGroup: '<div class="input-group">%s%s</div>',
4867 searchInput: '<input class="%s%s" type="text" placeholder="%s">',
4868 searchButton: '<button class="%s" type="button" name="search" title="%s">%s %s</button>',
4869 searchClearButton: '<button class="%s" type="button" name="clearSearch" title="%s">%s %s</button>'
4870 }
4871 }
4872 }[bootstrapVersion];
4873 var DEFAULTS = {
4874 height: undefined,
4875 classes: 'table table-bordered table-hover',
4876 buttons: {},
4877 theadClasses: '',
4878 headerStyle: function headerStyle(column) {
4879 return {};
4880 },
4881 rowStyle: function rowStyle(row, index) {
4882 return {};
4883 },
4884 rowAttributes: function rowAttributes(row, index) {
4885 return {};
4886 },
4887 undefinedText: '-',
4888 locale: undefined,
4889 virtualScroll: false,
4890 virtualScrollItemHeight: undefined,
4891 sortable: true,
4892 sortClass: undefined,
4893 silentSort: true,
4894 sortName: undefined,
4895 sortOrder: undefined,
4896 sortReset: false,
4897 sortStable: false,
4898 rememberOrder: false,
4899 serverSort: true,
4900 customSort: undefined,
4901 columns: [[]],
4902 data: [],
4903 url: undefined,
4904 method: 'get',
4905 cache: true,
4906 contentType: 'application/json',
4907 dataType: 'json',
4908 ajax: undefined,
4909 ajaxOptions: {},
4910 queryParams: function queryParams(params) {
4911 return params;
4912 },
4913 queryParamsType: 'limit',
4914 // 'limit', undefined
4915 responseHandler: function responseHandler(res) {
4916 return res;
4917 },
4918 totalField: 'total',
4919 totalNotFilteredField: 'totalNotFiltered',
4920 dataField: 'rows',
4921 footerField: 'footer',
4922 pagination: false,
4923 paginationParts: ['pageInfo', 'pageSize', 'pageList'],
4924 showExtendedPagination: false,
4925 paginationLoop: true,
4926 sidePagination: 'client',
4927 // client or server
4928 totalRows: 0,
4929 totalNotFiltered: 0,
4930 pageNumber: 1,
4931 pageSize: 10,
4932 pageList: [10, 25, 50, 100],
4933 paginationHAlign: 'right',
4934 // right, left
4935 paginationVAlign: 'bottom',
4936 // bottom, top, both
4937 paginationDetailHAlign: 'left',
4938 // right, left
4939 paginationPreText: '&lsaquo;',
4940 paginationNextText: '&rsaquo;',
4941 paginationSuccessivelySize: 5,
4942 // Maximum successively number of pages in a row
4943 paginationPagesBySide: 1,
4944 // Number of pages on each side (right, left) of the current page.
4945 paginationUseIntermediate: false,
4946 // Calculate intermediate pages for quick access
4947 search: false,
4948 searchHighlight: false,
4949 searchOnEnterKey: false,
4950 strictSearch: false,
4951 regexSearch: false,
4952 searchSelector: false,
4953 visibleSearch: false,
4954 showButtonIcons: true,
4955 showButtonText: false,
4956 showSearchButton: false,
4957 showSearchClearButton: false,
4958 trimOnSearch: true,
4959 searchAlign: 'right',
4960 searchTimeOut: 500,
4961 searchText: '',
4962 customSearch: undefined,
4963 showHeader: true,
4964 showFooter: false,
4965 footerStyle: function footerStyle(column) {
4966 return {};
4967 },
4968 searchAccentNeutralise: false,
4969 showColumns: false,
4970 showColumnsToggleAll: false,
4971 showColumnsSearch: false,
4972 minimumCountColumns: 1,
4973 showPaginationSwitch: false,
4974 showRefresh: false,
4975 showToggle: false,
4976 showFullscreen: false,
4977 smartDisplay: true,
4978 escape: false,
4979 filterOptions: {
4980 filterAlgorithm: 'and'
4981 },
4982 idField: undefined,
4983 selectItemName: 'btSelectItem',
4984 clickToSelect: false,
4985 ignoreClickToSelectOn: function ignoreClickToSelectOn(_ref) {
4986 var tagName = _ref.tagName;
4987 return ['A', 'BUTTON'].includes(tagName);
4988 },
4989 singleSelect: false,
4990 checkboxHeader: true,
4991 maintainMetaData: false,
4992 multipleSelectRow: false,
4993 uniqueId: undefined,
4994 cardView: false,
4995 detailView: false,
4996 detailViewIcon: true,
4997 detailViewByClick: false,
4998 detailViewAlign: 'left',
4999 detailFormatter: function detailFormatter(index, row) {
5000 return '';
5001 },
5002 detailFilter: function detailFilter(index, row) {
5003 return true;
5004 },
5005 toolbar: undefined,
5006 toolbarAlign: 'left',
5007 buttonsToolbar: undefined,
5008 buttonsAlign: 'right',
5009 buttonsOrder: ['paginationSwitch', 'refresh', 'toggle', 'fullscreen', 'columns'],
5010 buttonsPrefix: CONSTANTS.classes.buttonsPrefix,
5011 buttonsClass: CONSTANTS.classes.buttons,
5012 iconsPrefix: undefined,
5013 // init in initConstants
5014 icons: {},
5015 // init in initConstants
5016 iconSize: undefined,
5017 loadingFontSize: 'auto',
5018 loadingTemplate: function loadingTemplate(loadingMessage) {
5019 return "<span class=\"loading-wrap\">\n <span class=\"loading-text\">".concat(loadingMessage, "</span>\n <span class=\"animation-wrap\"><span class=\"animation-dot\"></span></span>\n </span>\n ");
5020 },
5021 onAll: function onAll(name, args) {
5022 return false;
5023 },
5024 onClickCell: function onClickCell(field, value, row, $element) {
5025 return false;
5026 },
5027 onDblClickCell: function onDblClickCell(field, value, row, $element) {
5028 return false;
5029 },
5030 onClickRow: function onClickRow(item, $element) {
5031 return false;
5032 },
5033 onDblClickRow: function onDblClickRow(item, $element) {
5034 return false;
5035 },
5036 onSort: function onSort(name, order) {
5037 return false;
5038 },
5039 onCheck: function onCheck(row) {
5040 return false;
5041 },
5042 onUncheck: function onUncheck(row) {
5043 return false;
5044 },
5045 onCheckAll: function onCheckAll(rows) {
5046 return false;
5047 },
5048 onUncheckAll: function onUncheckAll(rows) {
5049 return false;
5050 },
5051 onCheckSome: function onCheckSome(rows) {
5052 return false;
5053 },
5054 onUncheckSome: function onUncheckSome(rows) {
5055 return false;
5056 },
5057 onLoadSuccess: function onLoadSuccess(data) {
5058 return false;
5059 },
5060 onLoadError: function onLoadError(status) {
5061 return false;
5062 },
5063 onColumnSwitch: function onColumnSwitch(field, checked) {
5064 return false;
5065 },
5066 onColumnSwitchAll: function onColumnSwitchAll(checked) {
5067 return false;
5068 },
5069 onPageChange: function onPageChange(number, size) {
5070 return false;
5071 },
5072 onSearch: function onSearch(text) {
5073 return false;
5074 },
5075 onToggle: function onToggle(cardView) {
5076 return false;
5077 },
5078 onPreBody: function onPreBody(data) {
5079 return false;
5080 },
5081 onPostBody: function onPostBody() {
5082 return false;
5083 },
5084 onPostHeader: function onPostHeader() {
5085 return false;
5086 },
5087 onPostFooter: function onPostFooter() {
5088 return false;
5089 },
5090 onExpandRow: function onExpandRow(index, row, $detail) {
5091 return false;
5092 },
5093 onCollapseRow: function onCollapseRow(index, row) {
5094 return false;
5095 },
5096 onRefreshOptions: function onRefreshOptions(options) {
5097 return false;
5098 },
5099 onRefresh: function onRefresh(params) {
5100 return false;
5101 },
5102 onResetView: function onResetView() {
5103 return false;
5104 },
5105 onScrollBody: function onScrollBody() {
5106 return false;
5107 },
5108 onTogglePagination: function onTogglePagination(newState) {
5109 return false;
5110 },
5111 onVirtualScroll: function onVirtualScroll(startIndex, endIndex) {
5112 return false;
5113 }
5114 };
5115 var EN = {
5116 formatLoadingMessage: function formatLoadingMessage() {
5117 return 'Loading, please wait';
5118 },
5119 formatRecordsPerPage: function formatRecordsPerPage(pageNumber) {
5120 return "".concat(pageNumber, " rows per page");
5121 },
5122 formatShowingRows: function formatShowingRows(pageFrom, pageTo, totalRows, totalNotFiltered) {
5123 if (totalNotFiltered !== undefined && totalNotFiltered > 0 && totalNotFiltered > totalRows) {
5124 return "Showing ".concat(pageFrom, " to ").concat(pageTo, " of ").concat(totalRows, " rows (filtered from ").concat(totalNotFiltered, " total rows)");
5125 }
5126
5127 return "Showing ".concat(pageFrom, " to ").concat(pageTo, " of ").concat(totalRows, " rows");
5128 },
5129 formatSRPaginationPreText: function formatSRPaginationPreText() {
5130 return 'previous page';
5131 },
5132 formatSRPaginationPageText: function formatSRPaginationPageText(page) {
5133 return "to page ".concat(page);
5134 },
5135 formatSRPaginationNextText: function formatSRPaginationNextText() {
5136 return 'next page';
5137 },
5138 formatDetailPagination: function formatDetailPagination(totalRows) {
5139 return "Showing ".concat(totalRows, " rows");
5140 },
5141 formatSearch: function formatSearch() {
5142 return 'Search';
5143 },
5144 formatClearSearch: function formatClearSearch() {
5145 return 'Clear Search';
5146 },
5147 formatNoMatches: function formatNoMatches() {
5148 return 'No matching records found';
5149 },
5150 formatPaginationSwitch: function formatPaginationSwitch() {
5151 return 'Hide/Show pagination';
5152 },
5153 formatPaginationSwitchDown: function formatPaginationSwitchDown() {
5154 return 'Show pagination';
5155 },
5156 formatPaginationSwitchUp: function formatPaginationSwitchUp() {
5157 return 'Hide pagination';
5158 },
5159 formatRefresh: function formatRefresh() {
5160 return 'Refresh';
5161 },
5162 formatToggle: function formatToggle() {
5163 return 'Toggle';
5164 },
5165 formatToggleOn: function formatToggleOn() {
5166 return 'Show card view';
5167 },
5168 formatToggleOff: function formatToggleOff() {
5169 return 'Hide card view';
5170 },
5171 formatColumns: function formatColumns() {
5172 return 'Columns';
5173 },
5174 formatColumnsToggleAll: function formatColumnsToggleAll() {
5175 return 'Toggle all';
5176 },
5177 formatFullscreen: function formatFullscreen() {
5178 return 'Fullscreen';
5179 },
5180 formatAllRows: function formatAllRows() {
5181 return 'All';
5182 }
5183 };
5184 var COLUMN_DEFAULTS = {
5185 field: undefined,
5186 title: undefined,
5187 titleTooltip: undefined,
5188 class: undefined,
5189 width: undefined,
5190 widthUnit: 'px',
5191 rowspan: undefined,
5192 colspan: undefined,
5193 align: undefined,
5194 // left, right, center
5195 halign: undefined,
5196 // left, right, center
5197 falign: undefined,
5198 // left, right, center
5199 valign: undefined,
5200 // top, middle, bottom
5201 cellStyle: undefined,
5202 radio: false,
5203 checkbox: false,
5204 checkboxEnabled: true,
5205 clickToSelect: true,
5206 showSelectTitle: false,
5207 sortable: false,
5208 sortName: undefined,
5209 order: 'asc',
5210 // asc, desc
5211 sorter: undefined,
5212 visible: true,
5213 switchable: true,
5214 cardVisible: true,
5215 searchable: true,
5216 formatter: undefined,
5217 footerFormatter: undefined,
5218 detailFormatter: undefined,
5219 searchFormatter: true,
5220 searchHighlightFormatter: false,
5221 escape: undefined,
5222 events: undefined
5223 };
5224 var METHODS = ['getOptions', 'refreshOptions', 'getData', 'getSelections', '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', 'expandRowByUniqueId', 'collapseRowByUniqueId', 'expandAllRows', 'collapseAllRows', 'updateColumnTitle', 'updateFormatText'];
5225 var EVENTS = {
5226 'all.bs.table': 'onAll',
5227 'click-row.bs.table': 'onClickRow',
5228 'dbl-click-row.bs.table': 'onDblClickRow',
5229 'click-cell.bs.table': 'onClickCell',
5230 'dbl-click-cell.bs.table': 'onDblClickCell',
5231 'sort.bs.table': 'onSort',
5232 'check.bs.table': 'onCheck',
5233 'uncheck.bs.table': 'onUncheck',
5234 'check-all.bs.table': 'onCheckAll',
5235 'uncheck-all.bs.table': 'onUncheckAll',
5236 'check-some.bs.table': 'onCheckSome',
5237 'uncheck-some.bs.table': 'onUncheckSome',
5238 'load-success.bs.table': 'onLoadSuccess',
5239 'load-error.bs.table': 'onLoadError',
5240 'column-switch.bs.table': 'onColumnSwitch',
5241 'column-switch-all.bs.table': 'onColumnSwitchAll',
5242 'page-change.bs.table': 'onPageChange',
5243 'search.bs.table': 'onSearch',
5244 'toggle.bs.table': 'onToggle',
5245 'pre-body.bs.table': 'onPreBody',
5246 'post-body.bs.table': 'onPostBody',
5247 'post-header.bs.table': 'onPostHeader',
5248 'post-footer.bs.table': 'onPostFooter',
5249 'expand-row.bs.table': 'onExpandRow',
5250 'collapse-row.bs.table': 'onCollapseRow',
5251 'refresh-options.bs.table': 'onRefreshOptions',
5252 'reset-view.bs.table': 'onResetView',
5253 'refresh.bs.table': 'onRefresh',
5254 'scroll-body.bs.table': 'onScrollBody',
5255 'toggle-pagination.bs.table': 'onTogglePagination',
5256 'virtual-scroll.bs.table': 'onVirtualScroll'
5257 };
5258 Object.assign(DEFAULTS, EN);
5259 var Constants = {
5260 VERSION: VERSION,
5261 THEME: "bootstrap".concat(bootstrapVersion),
5262 CONSTANTS: CONSTANTS,
5263 DEFAULTS: DEFAULTS,
5264 COLUMN_DEFAULTS: COLUMN_DEFAULTS,
5265 METHODS: METHODS,
5266 EVENTS: EVENTS,
5267 LOCALES: {
5268 en: EN,
5269 'en-US': EN
5270 }
5271 };
5272
5273 var BLOCK_ROWS = 50;
5274 var CLUSTER_BLOCKS = 4;
5275
5276 var VirtualScroll = /*#__PURE__*/function () {
5277 function VirtualScroll(options) {
5278 var _this = this;
5279
5280 _classCallCheck(this, VirtualScroll);
5281
5282 this.rows = options.rows;
5283 this.scrollEl = options.scrollEl;
5284 this.contentEl = options.contentEl;
5285 this.callback = options.callback;
5286 this.itemHeight = options.itemHeight;
5287 this.cache = {};
5288 this.scrollTop = this.scrollEl.scrollTop;
5289 this.initDOM(this.rows, options.fixedScroll);
5290 this.scrollEl.scrollTop = this.scrollTop;
5291 this.lastCluster = 0;
5292
5293 var onScroll = function onScroll() {
5294 if (_this.lastCluster !== (_this.lastCluster = _this.getNum())) {
5295 _this.initDOM(_this.rows);
5296
5297 _this.callback(_this.startIndex, _this.endIndex);
5298 }
5299 };
5300
5301 this.scrollEl.addEventListener('scroll', onScroll, false);
5302
5303 this.destroy = function () {
5304 _this.contentEl.innerHtml = '';
5305
5306 _this.scrollEl.removeEventListener('scroll', onScroll, false);
5307 };
5308 }
5309
5310 _createClass(VirtualScroll, [{
5311 key: "initDOM",
5312 value: function initDOM(rows, fixedScroll) {
5313 if (typeof this.clusterHeight === 'undefined') {
5314 this.cache.scrollTop = this.scrollEl.scrollTop;
5315 this.cache.data = this.contentEl.innerHTML = rows[0] + rows[0] + rows[0];
5316 this.getRowsHeight(rows);
5317 }
5318
5319 var data = this.initData(rows, this.getNum(fixedScroll));
5320 var thisRows = data.rows.join('');
5321 var dataChanged = this.checkChanges('data', thisRows);
5322 var topOffsetChanged = this.checkChanges('top', data.topOffset);
5323 var bottomOffsetChanged = this.checkChanges('bottom', data.bottomOffset);
5324 var html = [];
5325
5326 if (dataChanged && topOffsetChanged) {
5327 if (data.topOffset) {
5328 html.push(this.getExtra('top', data.topOffset));
5329 }
5330
5331 html.push(thisRows);
5332
5333 if (data.bottomOffset) {
5334 html.push(this.getExtra('bottom', data.bottomOffset));
5335 }
5336
5337 this.startIndex = data.start;
5338 this.endIndex = data.end;
5339 this.contentEl.innerHTML = html.join('');
5340
5341 if (fixedScroll) {
5342 this.contentEl.scrollTop = this.cache.scrollTop;
5343 }
5344 } else if (bottomOffsetChanged) {
5345 this.contentEl.lastChild.style.height = "".concat(data.bottomOffset, "px");
5346 }
5347 }
5348 }, {
5349 key: "getRowsHeight",
5350 value: function getRowsHeight() {
5351 if (typeof this.itemHeight === 'undefined') {
5352 var nodes = this.contentEl.children;
5353 var node = nodes[Math.floor(nodes.length / 2)];
5354 this.itemHeight = node.offsetHeight;
5355 }
5356
5357 this.blockHeight = this.itemHeight * BLOCK_ROWS;
5358 this.clusterRows = BLOCK_ROWS * CLUSTER_BLOCKS;
5359 this.clusterHeight = this.blockHeight * CLUSTER_BLOCKS;
5360 }
5361 }, {
5362 key: "getNum",
5363 value: function getNum(fixedScroll) {
5364 this.scrollTop = fixedScroll ? this.cache.scrollTop : this.scrollEl.scrollTop;
5365 return Math.floor(this.scrollTop / (this.clusterHeight - this.blockHeight)) || 0;
5366 }
5367 }, {
5368 key: "initData",
5369 value: function initData(rows, num) {
5370 if (rows.length < BLOCK_ROWS) {
5371 return {
5372 topOffset: 0,
5373 bottomOffset: 0,
5374 rowsAbove: 0,
5375 rows: rows
5376 };
5377 }
5378
5379 var start = Math.max((this.clusterRows - BLOCK_ROWS) * num, 0);
5380 var end = start + this.clusterRows;
5381 var topOffset = Math.max(start * this.itemHeight, 0);
5382 var bottomOffset = Math.max((rows.length - end) * this.itemHeight, 0);
5383 var thisRows = [];
5384 var rowsAbove = start;
5385
5386 if (topOffset < 1) {
5387 rowsAbove++;
5388 }
5389
5390 for (var i = start; i < end; i++) {
5391 rows[i] && thisRows.push(rows[i]);
5392 }
5393
5394 return {
5395 start: start,
5396 end: end,
5397 topOffset: topOffset,
5398 bottomOffset: bottomOffset,
5399 rowsAbove: rowsAbove,
5400 rows: thisRows
5401 };
5402 }
5403 }, {
5404 key: "checkChanges",
5405 value: function checkChanges(type, value) {
5406 var changed = value !== this.cache[type];
5407 this.cache[type] = value;
5408 return changed;
5409 }
5410 }, {
5411 key: "getExtra",
5412 value: function getExtra(className, height) {
5413 var tag = document.createElement('tr');
5414 tag.className = "virtual-scroll-".concat(className);
5415
5416 if (height) {
5417 tag.style.height = "".concat(height, "px");
5418 }
5419
5420 return tag.outerHTML;
5421 }
5422 }]);
5423
5424 return VirtualScroll;
5425 }();
5426
5427 var BootstrapTable = /*#__PURE__*/function () {
5428 function BootstrapTable(el, options) {
5429 _classCallCheck(this, BootstrapTable);
5430
5431 this.options = options;
5432 this.$el = $__default["default"](el);
5433 this.$el_ = this.$el.clone();
5434 this.timeoutId_ = 0;
5435 this.timeoutFooter_ = 0;
5436 }
5437
5438 _createClass(BootstrapTable, [{
5439 key: "init",
5440 value: function init() {
5441 this.initConstants();
5442 this.initLocale();
5443 this.initContainer();
5444 this.initTable();
5445 this.initHeader();
5446 this.initData();
5447 this.initHiddenRows();
5448 this.initToolbar();
5449 this.initPagination();
5450 this.initBody();
5451 this.initSearchText();
5452 this.initServer();
5453 }
5454 }, {
5455 key: "initConstants",
5456 value: function initConstants() {
5457 var opts = this.options;
5458 this.constants = Constants.CONSTANTS;
5459 this.constants.theme = $__default["default"].fn.bootstrapTable.theme;
5460 this.constants.dataToggle = this.constants.html.dataToggle || 'data-toggle'; // init iconsPrefix and icons
5461
5462 var iconsPrefix = Utils.getIconsPrefix($__default["default"].fn.bootstrapTable.theme);
5463 var icons = Utils.getIcons(iconsPrefix);
5464
5465 if (typeof opts.icons === 'string') {
5466 opts.icons = Utils.calculateObjectValue(null, opts.icons);
5467 }
5468
5469 opts.iconsPrefix = opts.iconsPrefix || $__default["default"].fn.bootstrapTable.defaults.iconsPrefix || iconsPrefix;
5470 opts.icons = Object.assign(icons, $__default["default"].fn.bootstrapTable.defaults.icons, opts.icons); // init buttons class
5471
5472 var buttonsPrefix = opts.buttonsPrefix ? "".concat(opts.buttonsPrefix, "-") : '';
5473 this.constants.buttonsClass = [opts.buttonsPrefix, buttonsPrefix + opts.buttonsClass, Utils.sprintf("".concat(buttonsPrefix, "%s"), opts.iconSize)].join(' ').trim();
5474 this.buttons = Utils.calculateObjectValue(this, opts.buttons, [], {});
5475
5476 if (_typeof(this.buttons) !== 'object') {
5477 this.buttons = {};
5478 }
5479 }
5480 }, {
5481 key: "initLocale",
5482 value: function initLocale() {
5483 if (this.options.locale) {
5484 var locales = $__default["default"].fn.bootstrapTable.locales;
5485 var parts = this.options.locale.split(/-|_/);
5486 parts[0] = parts[0].toLowerCase();
5487
5488 if (parts[1]) {
5489 parts[1] = parts[1].toUpperCase();
5490 }
5491
5492 var localesToExtend = {};
5493
5494 if (locales[this.options.locale]) {
5495 localesToExtend = locales[this.options.locale];
5496 } else if (locales[parts.join('-')]) {
5497 localesToExtend = locales[parts.join('-')];
5498 } else if (locales[parts[0]]) {
5499 localesToExtend = locales[parts[0]];
5500 }
5501
5502 for (var _i = 0, _Object$entries = Object.entries(localesToExtend); _i < _Object$entries.length; _i++) {
5503 var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
5504 formatName = _Object$entries$_i[0],
5505 func = _Object$entries$_i[1];
5506
5507 if (this.options[formatName] !== BootstrapTable.DEFAULTS[formatName]) {
5508 continue;
5509 }
5510
5511 this.options[formatName] = func;
5512 }
5513 }
5514 }
5515 }, {
5516 key: "initContainer",
5517 value: function initContainer() {
5518 var topPagination = ['top', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination clearfix"></div>' : '';
5519 var bottomPagination = ['bottom', 'both'].includes(this.options.paginationVAlign) ? '<div class="fixed-table-pagination"></div>' : '';
5520 var loadingTemplate = Utils.calculateObjectValue(this.options, this.options.loadingTemplate, [this.options.formatLoadingMessage()]);
5521 this.$container = $__default["default"]("\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 ").concat(loadingTemplate, "\n </div>\n </div>\n <div class=\"fixed-table-footer\"></div>\n </div>\n ").concat(bottomPagination, "\n </div>\n "));
5522 this.$container.insertAfter(this.$el);
5523 this.$tableContainer = this.$container.find('.fixed-table-container');
5524 this.$tableHeader = this.$container.find('.fixed-table-header');
5525 this.$tableBody = this.$container.find('.fixed-table-body');
5526 this.$tableLoading = this.$container.find('.fixed-table-loading');
5527 this.$tableFooter = this.$el.find('tfoot'); // checking if custom table-toolbar exists or not
5528
5529 if (this.options.buttonsToolbar) {
5530 this.$toolbar = $__default["default"]('body').find(this.options.buttonsToolbar);
5531 } else {
5532 this.$toolbar = this.$container.find('.fixed-table-toolbar');
5533 }
5534
5535 this.$pagination = this.$container.find('.fixed-table-pagination');
5536 this.$tableBody.append(this.$el);
5537 this.$container.after('<div class="clearfix"></div>');
5538 this.$el.addClass(this.options.classes);
5539 this.$tableLoading.addClass(this.options.classes);
5540
5541 if (this.options.height) {
5542 this.$tableContainer.addClass('fixed-height');
5543
5544 if (this.options.showFooter) {
5545 this.$tableContainer.addClass('has-footer');
5546 }
5547
5548 if (this.options.classes.split(' ').includes('table-bordered')) {
5549 this.$tableBody.append('<div class="fixed-table-border"></div>');
5550 this.$tableBorder = this.$tableBody.find('.fixed-table-border');
5551 this.$tableLoading.addClass('fixed-table-border');
5552 }
5553
5554 this.$tableFooter = this.$container.find('.fixed-table-footer');
5555 }
5556 }
5557 }, {
5558 key: "initTable",
5559 value: function initTable() {
5560 var _this = this;
5561
5562 var columns = [];
5563 this.$header = this.$el.find('>thead');
5564
5565 if (!this.$header.length) {
5566 this.$header = $__default["default"]("<thead class=\"".concat(this.options.theadClasses, "\"></thead>")).appendTo(this.$el);
5567 } else if (this.options.theadClasses) {
5568 this.$header.addClass(this.options.theadClasses);
5569 }
5570
5571 this._headerTrClasses = [];
5572 this._headerTrStyles = [];
5573 this.$header.find('tr').each(function (i, el) {
5574 var $tr = $__default["default"](el);
5575 var column = [];
5576 $tr.find('th').each(function (i, el) {
5577 var $th = $__default["default"](el); // #2014: getFieldIndex and elsewhere assume this is string, causes issues if not
5578
5579 if (typeof $th.data('field') !== 'undefined') {
5580 $th.data('field', "".concat($th.data('field')));
5581 }
5582
5583 column.push($__default["default"].extend({}, {
5584 title: $th.html(),
5585 class: $th.attr('class'),
5586 titleTooltip: $th.attr('title'),
5587 rowspan: $th.attr('rowspan') ? +$th.attr('rowspan') : undefined,
5588 colspan: $th.attr('colspan') ? +$th.attr('colspan') : undefined
5589 }, $th.data()));
5590 });
5591 columns.push(column);
5592
5593 if ($tr.attr('class')) {
5594 _this._headerTrClasses.push($tr.attr('class'));
5595 }
5596
5597 if ($tr.attr('style')) {
5598 _this._headerTrStyles.push($tr.attr('style'));
5599 }
5600 });
5601
5602 if (!Array.isArray(this.options.columns[0])) {
5603 this.options.columns = [this.options.columns];
5604 }
5605
5606 this.options.columns = $__default["default"].extend(true, [], columns, this.options.columns);
5607 this.columns = [];
5608 this.fieldsColumnsIndex = [];
5609 Utils.setFieldIndex(this.options.columns);
5610 this.options.columns.forEach(function (columns, i) {
5611 columns.forEach(function (_column, j) {
5612 var column = $__default["default"].extend({}, BootstrapTable.COLUMN_DEFAULTS, _column);
5613
5614 if (typeof column.fieldIndex !== 'undefined') {
5615 _this.columns[column.fieldIndex] = column;
5616 _this.fieldsColumnsIndex[column.field] = column.fieldIndex;
5617 }
5618
5619 _this.options.columns[i][j] = column;
5620 });
5621 }); // if options.data is setting, do not process tbody and tfoot data
5622
5623 if (!this.options.data.length) {
5624 var htmlData = Utils.trToData(this.columns, this.$el.find('>tbody>tr'));
5625
5626 if (htmlData.length) {
5627 this.options.data = htmlData;
5628 this.fromHtml = true;
5629 }
5630 }
5631
5632 if (!(this.options.pagination && this.options.sidePagination !== 'server')) {
5633 this.footerData = Utils.trToData(this.columns, this.$el.find('>tfoot>tr'));
5634 }
5635
5636 if (this.footerData) {
5637 this.$el.find('tfoot').html('<tr></tr>');
5638 }
5639
5640 if (!this.options.showFooter || this.options.cardView) {
5641 this.$tableFooter.hide();
5642 } else {
5643 this.$tableFooter.show();
5644 }
5645 }
5646 }, {
5647 key: "initHeader",
5648 value: function initHeader() {
5649 var _this2 = this;
5650
5651 var visibleColumns = {};
5652 var headerHtml = [];
5653 this.header = {
5654 fields: [],
5655 styles: [],
5656 classes: [],
5657 formatters: [],
5658 detailFormatters: [],
5659 events: [],
5660 sorters: [],
5661 sortNames: [],
5662 cellStyles: [],
5663 searchables: []
5664 };
5665 Utils.updateFieldGroup(this.options.columns, this.columns);
5666 this.options.columns.forEach(function (columns, i) {
5667 var html = [];
5668 html.push("<tr".concat(Utils.sprintf(' class="%s"', _this2._headerTrClasses[i]), " ").concat(Utils.sprintf(' style="%s"', _this2._headerTrStyles[i]), ">"));
5669 var detailViewTemplate = '';
5670
5671 if (i === 0 && Utils.hasDetailViewIcon(_this2.options)) {
5672 var rowspan = _this2.options.columns.length > 1 ? " rowspan=\"".concat(_this2.options.columns.length, "\"") : '';
5673 detailViewTemplate = "<th class=\"detail\"".concat(rowspan, ">\n <div class=\"fht-cell\"></div>\n </th>");
5674 }
5675
5676 if (detailViewTemplate && _this2.options.detailViewAlign !== 'right') {
5677 html.push(detailViewTemplate);
5678 }
5679
5680 columns.forEach(function (column, j) {
5681 var class_ = Utils.sprintf(' class="%s"', column['class']);
5682 var unitWidth = column.widthUnit;
5683 var width = parseFloat(column.width);
5684 var halign = Utils.sprintf('text-align: %s; ', column.halign ? column.halign : column.align);
5685 var align = Utils.sprintf('text-align: %s; ', column.align);
5686 var style = Utils.sprintf('vertical-align: %s; ', column.valign);
5687 style += Utils.sprintf('width: %s; ', (column.checkbox || column.radio) && !width ? !column.showSelectTitle ? '36px' : undefined : width ? width + unitWidth : undefined);
5688
5689 if (typeof column.fieldIndex === 'undefined' && !column.visible) {
5690 return;
5691 }
5692
5693 var headerStyle = Utils.calculateObjectValue(null, _this2.options.headerStyle, [column]);
5694 var csses = [];
5695 var classes = '';
5696
5697 if (headerStyle && headerStyle.css) {
5698 for (var _i2 = 0, _Object$entries2 = Object.entries(headerStyle.css); _i2 < _Object$entries2.length; _i2++) {
5699 var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
5700 key = _Object$entries2$_i[0],
5701 value = _Object$entries2$_i[1];
5702
5703 csses.push("".concat(key, ": ").concat(value));
5704 }
5705 }
5706
5707 if (headerStyle && headerStyle.classes) {
5708 classes = Utils.sprintf(' class="%s"', column['class'] ? [column['class'], headerStyle.classes].join(' ') : headerStyle.classes);
5709 }
5710
5711 if (typeof column.fieldIndex !== 'undefined') {
5712 _this2.header.fields[column.fieldIndex] = column.field;
5713 _this2.header.styles[column.fieldIndex] = align + style;
5714 _this2.header.classes[column.fieldIndex] = class_;
5715 _this2.header.formatters[column.fieldIndex] = column.formatter;
5716 _this2.header.detailFormatters[column.fieldIndex] = column.detailFormatter;
5717 _this2.header.events[column.fieldIndex] = column.events;
5718 _this2.header.sorters[column.fieldIndex] = column.sorter;
5719 _this2.header.sortNames[column.fieldIndex] = column.sortName;
5720 _this2.header.cellStyles[column.fieldIndex] = column.cellStyle;
5721 _this2.header.searchables[column.fieldIndex] = column.searchable;
5722
5723 if (!column.visible) {
5724 return;
5725 }
5726
5727 if (_this2.options.cardView && !column.cardVisible) {
5728 return;
5729 }
5730
5731 visibleColumns[column.field] = column;
5732 }
5733
5734 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.
5735 j === 0 && i > 0 ? ' data-not-first-th' : '', '>');
5736 html.push(Utils.sprintf('<div class="th-inner %s">', _this2.options.sortable && column.sortable ? 'sortable both' : ''));
5737 var text = _this2.options.escape ? Utils.escapeHTML(column.title) : column.title;
5738 var title = text;
5739
5740 if (column.checkbox) {
5741 text = '';
5742
5743 if (!_this2.options.singleSelect && _this2.options.checkboxHeader) {
5744 text = '<label><input name="btSelectAll" type="checkbox" /><span></span></label>';
5745 }
5746
5747 _this2.header.stateField = column.field;
5748 }
5749
5750 if (column.radio) {
5751 text = '';
5752 _this2.header.stateField = column.field;
5753 }
5754
5755 if (!text && column.showSelectTitle) {
5756 text += title;
5757 }
5758
5759 html.push(text);
5760 html.push('</div>');
5761 html.push('<div class="fht-cell"></div>');
5762 html.push('</div>');
5763 html.push('</th>');
5764 });
5765
5766 if (detailViewTemplate && _this2.options.detailViewAlign === 'right') {
5767 html.push(detailViewTemplate);
5768 }
5769
5770 html.push('</tr>');
5771
5772 if (html.length > 3) {
5773 headerHtml.push(html.join(''));
5774 }
5775 });
5776 this.$header.html(headerHtml.join(''));
5777 this.$header.find('th[data-field]').each(function (i, el) {
5778 $__default["default"](el).data(visibleColumns[$__default["default"](el).data('field')]);
5779 });
5780 this.$container.off('click', '.th-inner').on('click', '.th-inner', function (e) {
5781 var $this = $__default["default"](e.currentTarget);
5782
5783 if (_this2.options.detailView && !$this.parent().hasClass('bs-checkbox')) {
5784 if ($this.closest('.bootstrap-table')[0] !== _this2.$container[0]) {
5785 return false;
5786 }
5787 }
5788
5789 if (_this2.options.sortable && $this.parent().data().sortable) {
5790 _this2.onSort(e);
5791 }
5792 });
5793 var resizeEvent = Utils.getEventName('resize.bootstrap-table', this.$el.attr('id'));
5794 $__default["default"](window).off(resizeEvent);
5795
5796 if (!this.options.showHeader || this.options.cardView) {
5797 this.$header.hide();
5798 this.$tableHeader.hide();
5799 this.$tableLoading.css('top', 0);
5800 } else {
5801 this.$header.show();
5802 this.$tableHeader.show();
5803 this.$tableLoading.css('top', this.$header.outerHeight() + 1); // Assign the correct sortable arrow
5804
5805 this.getCaret();
5806 $__default["default"](window).on(resizeEvent, function () {
5807 return _this2.resetView();
5808 });
5809 }
5810
5811 this.$selectAll = this.$header.find('[name="btSelectAll"]');
5812 this.$selectAll.off('click').on('click', function (e) {
5813 e.stopPropagation();
5814 var checked = $__default["default"](e.currentTarget).prop('checked');
5815
5816 _this2[checked ? 'checkAll' : 'uncheckAll']();
5817
5818 _this2.updateSelected();
5819 });
5820 }
5821 }, {
5822 key: "initData",
5823 value: function initData(data, type) {
5824 if (type === 'append') {
5825 this.options.data = this.options.data.concat(data);
5826 } else if (type === 'prepend') {
5827 this.options.data = [].concat(data).concat(this.options.data);
5828 } else {
5829 data = data || Utils.deepCopy(this.options.data);
5830 this.options.data = Array.isArray(data) ? data : data[this.options.dataField];
5831 }
5832
5833 this.data = _toConsumableArray(this.options.data);
5834
5835 if (this.options.sortReset) {
5836 this.unsortedData = _toConsumableArray(this.data);
5837 }
5838
5839 if (this.options.sidePagination === 'server') {
5840 return;
5841 }
5842
5843 this.initSort();
5844 }
5845 }, {
5846 key: "initSort",
5847 value: function initSort() {
5848 var _this3 = this;
5849
5850 var name = this.options.sortName;
5851 var order = this.options.sortOrder === 'desc' ? -1 : 1;
5852 var index = this.header.fields.indexOf(this.options.sortName);
5853 var timeoutId = 0;
5854
5855 if (index !== -1) {
5856 if (this.options.sortStable) {
5857 this.data.forEach(function (row, i) {
5858 if (!row.hasOwnProperty('_position')) {
5859 row._position = i;
5860 }
5861 });
5862 }
5863
5864 if (this.options.customSort) {
5865 Utils.calculateObjectValue(this.options, this.options.customSort, [this.options.sortName, this.options.sortOrder, this.data]);
5866 } else {
5867 this.data.sort(function (a, b) {
5868 if (_this3.header.sortNames[index]) {
5869 name = _this3.header.sortNames[index];
5870 }
5871
5872 var aa = Utils.getItemField(a, name, _this3.options.escape);
5873 var bb = Utils.getItemField(b, name, _this3.options.escape);
5874 var value = Utils.calculateObjectValue(_this3.header, _this3.header.sorters[index], [aa, bb, a, b]);
5875
5876 if (value !== undefined) {
5877 if (_this3.options.sortStable && value === 0) {
5878 return order * (a._position - b._position);
5879 }
5880
5881 return order * value;
5882 }
5883
5884 return Utils.sort(aa, bb, order, _this3.options.sortStable, a._position, b._position);
5885 });
5886 }
5887
5888 if (this.options.sortClass !== undefined) {
5889 clearTimeout(timeoutId);
5890 timeoutId = setTimeout(function () {
5891 _this3.$el.removeClass(_this3.options.sortClass);
5892
5893 var index = _this3.$header.find("[data-field=\"".concat(_this3.options.sortName, "\"]")).index();
5894
5895 _this3.$el.find("tr td:nth-child(".concat(index + 1, ")")).addClass(_this3.options.sortClass);
5896 }, 250);
5897 }
5898 } else if (this.options.sortReset) {
5899 this.data = _toConsumableArray(this.unsortedData);
5900 }
5901 }
5902 }, {
5903 key: "onSort",
5904 value: function onSort(_ref) {
5905 var type = _ref.type,
5906 currentTarget = _ref.currentTarget;
5907 var $this = type === 'keypress' ? $__default["default"](currentTarget) : $__default["default"](currentTarget).parent();
5908 var $this_ = this.$header.find('th').eq($this.index());
5909 this.$header.add(this.$header_).find('span.order').remove();
5910
5911 if (this.options.sortName === $this.data('field')) {
5912 var currentSortOrder = this.options.sortOrder;
5913
5914 if (currentSortOrder === undefined) {
5915 this.options.sortOrder = 'asc';
5916 } else if (currentSortOrder === 'asc') {
5917 this.options.sortOrder = 'desc';
5918 } else if (this.options.sortOrder === 'desc') {
5919 this.options.sortOrder = this.options.sortReset ? undefined : 'asc';
5920 }
5921
5922 if (this.options.sortOrder === undefined) {
5923 this.options.sortName = undefined;
5924 }
5925 } else {
5926 this.options.sortName = $this.data('field');
5927
5928 if (this.options.rememberOrder) {
5929 this.options.sortOrder = $this.data('order') === 'asc' ? 'desc' : 'asc';
5930 } else {
5931 this.options.sortOrder = this.columns[this.fieldsColumnsIndex[$this.data('field')]].sortOrder || this.columns[this.fieldsColumnsIndex[$this.data('field')]].order;
5932 }
5933 }
5934
5935 this.trigger('sort', this.options.sortName, this.options.sortOrder);
5936 $this.add($this_).data('order', this.options.sortOrder); // Assign the correct sortable arrow
5937
5938 this.getCaret();
5939
5940 if (this.options.sidePagination === 'server' && this.options.serverSort) {
5941 this.options.pageNumber = 1;
5942 this.initServer(this.options.silentSort);
5943 return;
5944 }
5945
5946 this.initSort();
5947 this.initBody();
5948 }
5949 }, {
5950 key: "initToolbar",
5951 value: function initToolbar() {
5952 var _this4 = this;
5953
5954 var opts = this.options;
5955 var html = [];
5956 var timeoutId = 0;
5957 var $keepOpen;
5958 var switchableCount = 0;
5959
5960 if (this.$toolbar.find('.bs-bars').children().length) {
5961 $__default["default"]('body').append($__default["default"](opts.toolbar));
5962 }
5963
5964 this.$toolbar.html('');
5965
5966 if (typeof opts.toolbar === 'string' || _typeof(opts.toolbar) === 'object') {
5967 $__default["default"](Utils.sprintf('<div class="bs-bars %s-%s"></div>', this.constants.classes.pull, opts.toolbarAlign)).appendTo(this.$toolbar).append($__default["default"](opts.toolbar));
5968 } // showColumns, showToggle, showRefresh
5969
5970
5971 html = ["<div class=\"".concat(['columns', "columns-".concat(opts.buttonsAlign), this.constants.classes.buttonsGroup, "".concat(this.constants.classes.pull, "-").concat(opts.buttonsAlign)].join(' '), "\">")];
5972
5973 if (typeof opts.buttonsOrder === 'string') {
5974 opts.buttonsOrder = opts.buttonsOrder.replace(/\[|\]| |'/g, '').split(',');
5975 }
5976
5977 this.buttons = Object.assign(this.buttons, {
5978 paginationSwitch: {
5979 text: opts.pagination ? opts.formatPaginationSwitchUp() : opts.formatPaginationSwitchDown(),
5980 icon: opts.pagination ? opts.icons.paginationSwitchDown : opts.icons.paginationSwitchUp,
5981 render: false,
5982 event: this.togglePagination,
5983 attributes: {
5984 'aria-label': opts.formatPaginationSwitch(),
5985 title: opts.formatPaginationSwitch()
5986 }
5987 },
5988 refresh: {
5989 text: opts.formatRefresh(),
5990 icon: opts.icons.refresh,
5991 render: false,
5992 event: this.refresh,
5993 attributes: {
5994 'aria-label': opts.formatRefresh(),
5995 title: opts.formatRefresh()
5996 }
5997 },
5998 toggle: {
5999 text: opts.formatToggle(),
6000 icon: opts.icons.toggleOff,
6001 render: false,
6002 event: this.toggleView,
6003 attributes: {
6004 'aria-label': opts.formatToggleOn(),
6005 title: opts.formatToggleOn()
6006 }
6007 },
6008 fullscreen: {
6009 text: opts.formatFullscreen(),
6010 icon: opts.icons.fullscreen,
6011 render: false,
6012 event: this.toggleFullscreen,
6013 attributes: {
6014 'aria-label': opts.formatFullscreen(),
6015 title: opts.formatFullscreen()
6016 }
6017 },
6018 columns: {
6019 render: false,
6020 html: function html() {
6021 var html = [];
6022 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\" ").concat(_this4.constants.dataToggle, "=\"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]));
6023
6024 if (opts.showColumnsSearch) {
6025 html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="text" class="%s" name="columnsSearch" placeholder="%s" autocomplete="off">', _this4.constants.classes.input, opts.formatSearch())));
6026 html.push(_this4.constants.html.toolbarDropdownSeparator);
6027 }
6028
6029 if (opts.showColumnsToggleAll) {
6030 var allFieldsVisible = _this4.getVisibleColumns().length === _this4.columns.filter(function (column) {
6031 return !_this4.isSelectionColumn(column);
6032 }).length;
6033
6034 html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="checkbox" class="toggle-all" %s> <span>%s</span>', allFieldsVisible ? 'checked="checked"' : '', opts.formatColumnsToggleAll())));
6035 html.push(_this4.constants.html.toolbarDropdownSeparator);
6036 }
6037
6038 var visibleColumns = 0;
6039
6040 _this4.columns.forEach(function (column) {
6041 if (column.visible) {
6042 visibleColumns++;
6043 }
6044 });
6045
6046 _this4.columns.forEach(function (column, i) {
6047 if (_this4.isSelectionColumn(column)) {
6048 return;
6049 }
6050
6051 if (opts.cardView && !column.cardVisible) {
6052 return;
6053 }
6054
6055 var checked = column.visible ? ' checked="checked"' : '';
6056 var disabled = visibleColumns <= opts.minimumCountColumns && checked ? ' disabled="disabled"' : '';
6057
6058 if (column.switchable) {
6059 html.push(Utils.sprintf(_this4.constants.html.toolbarDropdownItem, Utils.sprintf('<input type="checkbox" data-field="%s" value="%s"%s%s> <span>%s</span>', column.field, i, checked, disabled, column.title)));
6060 switchableCount++;
6061 }
6062 });
6063
6064 html.push(_this4.constants.html.toolbarDropdown[1], '</div>');
6065 return html.join('');
6066 }
6067 }
6068 });
6069 var buttonsHtml = {};
6070
6071 for (var _i3 = 0, _Object$entries3 = Object.entries(this.buttons); _i3 < _Object$entries3.length; _i3++) {
6072 var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),
6073 buttonName = _Object$entries3$_i[0],
6074 buttonConfig = _Object$entries3$_i[1];
6075
6076 var buttonHtml = void 0;
6077
6078 if (buttonConfig.hasOwnProperty('html')) {
6079 if (typeof buttonConfig.html === 'function') {
6080 buttonHtml = buttonConfig.html();
6081 } else if (typeof buttonConfig.html === 'string') {
6082 buttonHtml = buttonConfig.html;
6083 }
6084 } else {
6085 buttonHtml = "<button class=\"".concat(this.constants.buttonsClass, "\" type=\"button\" name=\"").concat(buttonName, "\"");
6086
6087 if (buttonConfig.hasOwnProperty('attributes')) {
6088 for (var _i4 = 0, _Object$entries4 = Object.entries(buttonConfig.attributes); _i4 < _Object$entries4.length; _i4++) {
6089 var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i4], 2),
6090 attributeName = _Object$entries4$_i[0],
6091 value = _Object$entries4$_i[1];
6092
6093 buttonHtml += " ".concat(attributeName, "=\"").concat(value, "\"");
6094 }
6095 }
6096
6097 buttonHtml += '>';
6098
6099 if (opts.showButtonIcons && buttonConfig.hasOwnProperty('icon')) {
6100 buttonHtml += "".concat(Utils.sprintf(this.constants.html.icon, opts.iconsPrefix, buttonConfig.icon), " ");
6101 }
6102
6103 if (opts.showButtonText && buttonConfig.hasOwnProperty('text')) {
6104 buttonHtml += buttonConfig.text;
6105 }
6106
6107 buttonHtml += '</button>';
6108 }
6109
6110 buttonsHtml[buttonName] = buttonHtml;
6111 var optionName = "show".concat(buttonName.charAt(0).toUpperCase()).concat(buttonName.substring(1));
6112 var showOption = opts[optionName];
6113
6114 if ((!buttonConfig.hasOwnProperty('render') || buttonConfig.hasOwnProperty('render') && buttonConfig.render) && (showOption === undefined || showOption === true)) {
6115 opts[optionName] = true;
6116 }
6117
6118 if (!opts.buttonsOrder.includes(buttonName)) {
6119 opts.buttonsOrder.push(buttonName);
6120 }
6121 } // Adding the button html to the final toolbar html when the showOption is true
6122
6123
6124 var _iterator = _createForOfIteratorHelper(opts.buttonsOrder),
6125 _step;
6126
6127 try {
6128 for (_iterator.s(); !(_step = _iterator.n()).done;) {
6129 var button = _step.value;
6130 var _showOption = opts["show".concat(button.charAt(0).toUpperCase()).concat(button.substring(1))];
6131
6132 if (_showOption) {
6133 html.push(buttonsHtml[button]);
6134 }
6135 }
6136 } catch (err) {
6137 _iterator.e(err);
6138 } finally {
6139 _iterator.f();
6140 }
6141
6142 html.push('</div>'); // Fix #188: this.showToolbar is for extensions
6143
6144 if (this.showToolbar || html.length > 2) {
6145 this.$toolbar.append(html.join(''));
6146 }
6147
6148 for (var _i5 = 0, _Object$entries5 = Object.entries(this.buttons); _i5 < _Object$entries5.length; _i5++) {
6149 var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i5], 2),
6150 _buttonName = _Object$entries5$_i[0],
6151 _buttonConfig = _Object$entries5$_i[1];
6152
6153 if (_buttonConfig.hasOwnProperty('event')) {
6154 if (typeof _buttonConfig.event === 'function' || typeof _buttonConfig.event === 'string') {
6155 var _ret = function () {
6156 var event = typeof _buttonConfig.event === 'string' ? window[_buttonConfig.event] : _buttonConfig.event;
6157
6158 _this4.$toolbar.find("button[name=\"".concat(_buttonName, "\"]")).off('click').on('click', function () {
6159 return event.call(_this4);
6160 });
6161
6162 return "continue";
6163 }();
6164
6165 if (_ret === "continue") continue;
6166 }
6167
6168 var _loop = function _loop() {
6169 var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i6], 2),
6170 eventType = _Object$entries6$_i[0],
6171 eventFunction = _Object$entries6$_i[1];
6172
6173 var event = typeof eventFunction === 'string' ? window[eventFunction] : eventFunction;
6174
6175 _this4.$toolbar.find("button[name=\"".concat(_buttonName, "\"]")).off(eventType).on(eventType, function () {
6176 return event.call(_this4);
6177 });
6178 };
6179
6180 for (var _i6 = 0, _Object$entries6 = Object.entries(_buttonConfig.event); _i6 < _Object$entries6.length; _i6++) {
6181 _loop();
6182 }
6183 }
6184 }
6185
6186 if (opts.showColumns) {
6187 $keepOpen = this.$toolbar.find('.keep-open');
6188 var $checkboxes = $keepOpen.find('input[type="checkbox"]:not(".toggle-all")');
6189 var $toggleAll = $keepOpen.find('input[type="checkbox"].toggle-all');
6190
6191 if (switchableCount <= opts.minimumCountColumns) {
6192 $keepOpen.find('input').prop('disabled', true);
6193 }
6194
6195 $keepOpen.find('li, label').off('click').on('click', function (e) {
6196 e.stopImmediatePropagation();
6197 });
6198 $checkboxes.off('click').on('click', function (_ref2) {
6199 var currentTarget = _ref2.currentTarget;
6200 var $this = $__default["default"](currentTarget);
6201
6202 _this4._toggleColumn($this.val(), $this.prop('checked'), false);
6203
6204 _this4.trigger('column-switch', $this.data('field'), $this.prop('checked'));
6205
6206 $toggleAll.prop('checked', $checkboxes.filter(':checked').length === _this4.columns.filter(function (column) {
6207 return !_this4.isSelectionColumn(column);
6208 }).length);
6209 });
6210 $toggleAll.off('click').on('click', function (_ref3) {
6211 var currentTarget = _ref3.currentTarget;
6212
6213 _this4._toggleAllColumns($__default["default"](currentTarget).prop('checked'));
6214
6215 _this4.trigger('column-switch-all', $__default["default"](currentTarget).prop('checked'));
6216 });
6217
6218 if (opts.showColumnsSearch) {
6219 var $columnsSearch = $keepOpen.find('[name="columnsSearch"]');
6220 var $listItems = $keepOpen.find('.dropdown-item-marker');
6221 $columnsSearch.on('keyup paste change', function (_ref4) {
6222 var currentTarget = _ref4.currentTarget;
6223 var $this = $__default["default"](currentTarget);
6224 var searchValue = $this.val().toLowerCase();
6225 $listItems.show();
6226 $checkboxes.each(function (i, el) {
6227 var $checkbox = $__default["default"](el);
6228 var $listItem = $checkbox.parents('.dropdown-item-marker');
6229 var text = $listItem.text().toLowerCase();
6230
6231 if (!text.includes(searchValue)) {
6232 $listItem.hide();
6233 }
6234 });
6235 });
6236 }
6237 }
6238
6239 var handleInputEvent = function handleInputEvent($searchInput) {
6240 var eventTriggers = 'keyup drop blur mouseup';
6241 $searchInput.off(eventTriggers).on(eventTriggers, function (event) {
6242 if (opts.searchOnEnterKey && event.keyCode !== 13) {
6243 return;
6244 }
6245
6246 if ([37, 38, 39, 40].includes(event.keyCode)) {
6247 return;
6248 }
6249
6250 clearTimeout(timeoutId); // doesn't matter if it's 0
6251
6252 timeoutId = setTimeout(function () {
6253 _this4.onSearch({
6254 currentTarget: event.currentTarget
6255 });
6256 }, opts.searchTimeOut);
6257 });
6258 }; // Fix #4516: this.showSearchClearButton is for extensions
6259
6260
6261 if ((opts.search || this.showSearchClearButton) && typeof opts.searchSelector !== 'string') {
6262 html = [];
6263 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() : '');
6264 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() : '');
6265 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=\"search\" placeholder=\"").concat(opts.formatSearch(), "\" autocomplete=\"off\">");
6266 var searchInputFinalHtml = searchInputHtml;
6267
6268 if (opts.showSearchButton || opts.showSearchClearButton) {
6269 var _buttonsHtml = (opts.showSearchButton ? showSearchButton : '') + (opts.showSearchClearButton ? showSearchClearButton : '');
6270
6271 searchInputFinalHtml = opts.search ? Utils.sprintf(this.constants.html.inputGroup, searchInputHtml, _buttonsHtml) : _buttonsHtml;
6272 }
6273
6274 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));
6275 this.$toolbar.append(html.join(''));
6276 var $searchInput = Utils.getSearchInput(this);
6277
6278 if (opts.showSearchButton) {
6279 this.$toolbar.find('.search button[name=search]').off('click').on('click', function () {
6280 clearTimeout(timeoutId); // doesn't matter if it's 0
6281
6282 timeoutId = setTimeout(function () {
6283 _this4.onSearch({
6284 currentTarget: $searchInput
6285 });
6286 }, opts.searchTimeOut);
6287 });
6288
6289 if (opts.searchOnEnterKey) {
6290 handleInputEvent($searchInput);
6291 }
6292 } else {
6293 handleInputEvent($searchInput);
6294 }
6295
6296 if (opts.showSearchClearButton) {
6297 this.$toolbar.find('.search button[name=clearSearch]').click(function () {
6298 _this4.resetSearch();
6299 });
6300 }
6301 } else if (typeof opts.searchSelector === 'string') {
6302 var _$searchInput = Utils.getSearchInput(this);
6303
6304 handleInputEvent(_$searchInput);
6305 }
6306 }
6307 }, {
6308 key: "onSearch",
6309 value: function onSearch() {
6310 var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
6311 currentTarget = _ref5.currentTarget,
6312 firedByInitSearchText = _ref5.firedByInitSearchText;
6313
6314 var overwriteSearchText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
6315
6316 if (currentTarget !== undefined && $__default["default"](currentTarget).length && overwriteSearchText) {
6317 var text = $__default["default"](currentTarget).val().trim();
6318
6319 if (this.options.trimOnSearch && $__default["default"](currentTarget).val() !== text) {
6320 $__default["default"](currentTarget).val(text);
6321 }
6322
6323 if (this.searchText === text) {
6324 return;
6325 }
6326
6327 var $searchInput = Utils.getSearchInput(this);
6328 var $currentTarget = currentTarget instanceof jQuery ? currentTarget : $__default["default"](currentTarget);
6329
6330 if ($currentTarget.is($searchInput) || $currentTarget.hasClass('search-input')) {
6331 this.searchText = text;
6332 this.options.searchText = text;
6333 }
6334 }
6335
6336 if (!firedByInitSearchText && !this.options.cookie) {
6337 this.options.pageNumber = 1;
6338 }
6339
6340 this.initSearch();
6341
6342 if (firedByInitSearchText) {
6343 if (this.options.sidePagination === 'client') {
6344 this.updatePagination();
6345 }
6346 } else {
6347 this.updatePagination();
6348 }
6349
6350 this.trigger('search', this.searchText);
6351 }
6352 }, {
6353 key: "initSearch",
6354 value: function initSearch() {
6355 var _this5 = this;
6356
6357 this.filterOptions = this.filterOptions || this.options.filterOptions;
6358
6359 if (this.options.sidePagination !== 'server') {
6360 if (this.options.customSearch) {
6361 this.data = Utils.calculateObjectValue(this.options, this.options.customSearch, [this.options.data, this.searchText, this.filterColumns]);
6362
6363 if (this.options.sortReset) {
6364 this.unsortedData = _toConsumableArray(this.data);
6365 }
6366
6367 return;
6368 }
6369
6370 var rawSearchText = this.searchText && (this.fromHtml ? Utils.escapeHTML(this.searchText) : this.searchText);
6371 var searchText = rawSearchText ? rawSearchText.toLowerCase() : '';
6372 var f = Utils.isEmptyObject(this.filterColumns) ? null : this.filterColumns;
6373
6374 if (this.options.searchAccentNeutralise) {
6375 searchText = Utils.normalizeAccent(searchText);
6376 } // Check filter
6377
6378
6379 if (typeof this.filterOptions.filterAlgorithm === 'function') {
6380 this.data = this.options.data.filter(function (item) {
6381 return _this5.filterOptions.filterAlgorithm.apply(null, [item, f]);
6382 });
6383 } else if (typeof this.filterOptions.filterAlgorithm === 'string') {
6384 this.data = f ? this.options.data.filter(function (item) {
6385 var filterAlgorithm = _this5.filterOptions.filterAlgorithm;
6386
6387 if (filterAlgorithm === 'and') {
6388 for (var key in f) {
6389 if (Array.isArray(f[key]) && !f[key].includes(item[key]) || !Array.isArray(f[key]) && item[key] !== f[key]) {
6390 return false;
6391 }
6392 }
6393 } else if (filterAlgorithm === 'or') {
6394 var match = false;
6395
6396 for (var _key in f) {
6397 if (Array.isArray(f[_key]) && f[_key].includes(item[_key]) || !Array.isArray(f[_key]) && item[_key] === f[_key]) {
6398 match = true;
6399 }
6400 }
6401
6402 return match;
6403 }
6404
6405 return true;
6406 }) : _toConsumableArray(this.options.data);
6407 }
6408
6409 var visibleFields = this.getVisibleFields();
6410 this.data = searchText ? this.data.filter(function (item, i) {
6411 for (var j = 0; j < _this5.header.fields.length; j++) {
6412 if (!_this5.header.searchables[j] || _this5.options.visibleSearch && visibleFields.indexOf(_this5.header.fields[j]) === -1) {
6413 continue;
6414 }
6415
6416 var key = Utils.isNumeric(_this5.header.fields[j]) ? parseInt(_this5.header.fields[j], 10) : _this5.header.fields[j];
6417 var column = _this5.columns[_this5.fieldsColumnsIndex[key]];
6418 var value = void 0;
6419
6420 if (typeof key === 'string') {
6421 value = item;
6422 var props = key.split('.');
6423
6424 for (var _i7 = 0; _i7 < props.length; _i7++) {
6425 if (value[props[_i7]] !== null) {
6426 value = value[props[_i7]];
6427 }
6428 }
6429 } else {
6430 value = item[key];
6431 }
6432
6433 if (_this5.options.searchAccentNeutralise) {
6434 value = Utils.normalizeAccent(value);
6435 } // Fix #142: respect searchFormatter boolean
6436
6437
6438 if (column && column.searchFormatter) {
6439 value = Utils.calculateObjectValue(column, _this5.header.formatters[j], [value, item, i, column.field], value);
6440 }
6441
6442 if (typeof value === 'string' || typeof value === 'number') {
6443 if (_this5.options.strictSearch && "".concat(value).toLowerCase() === searchText || _this5.options.regexSearch && Utils.regexCompare(value, rawSearchText)) {
6444 return true;
6445 }
6446
6447 var largerSmallerEqualsRegex = /(?:(<=|=>|=<|>=|>|<)(?:\s+)?(-?\d+)?|(-?\d+)?(\s+)?(<=|=>|=<|>=|>|<))/gm;
6448 var matches = largerSmallerEqualsRegex.exec(_this5.searchText);
6449 var comparisonCheck = false;
6450
6451 if (matches) {
6452 var operator = matches[1] || "".concat(matches[5], "l");
6453 var comparisonValue = matches[2] || matches[3];
6454 var int = parseInt(value, 10);
6455 var comparisonInt = parseInt(comparisonValue, 10);
6456
6457 switch (operator) {
6458 case '>':
6459 case '<l':
6460 comparisonCheck = int > comparisonInt;
6461 break;
6462
6463 case '<':
6464 case '>l':
6465 comparisonCheck = int < comparisonInt;
6466 break;
6467
6468 case '<=':
6469 case '=<':
6470 case '>=l':
6471 case '=>l':
6472 comparisonCheck = int <= comparisonInt;
6473 break;
6474
6475 case '>=':
6476 case '=>':
6477 case '<=l':
6478 case '=<l':
6479 comparisonCheck = int >= comparisonInt;
6480 break;
6481 }
6482 }
6483
6484 if (comparisonCheck || "".concat(value).toLowerCase().includes(searchText)) {
6485 return true;
6486 }
6487 }
6488 }
6489
6490 return false;
6491 }) : this.data;
6492
6493 if (this.options.sortReset) {
6494 this.unsortedData = _toConsumableArray(this.data);
6495 }
6496
6497 this.initSort();
6498 }
6499 }
6500 }, {
6501 key: "initPagination",
6502 value: function initPagination() {
6503 var _this6 = this;
6504
6505 var opts = this.options;
6506
6507 if (!opts.pagination) {
6508 this.$pagination.hide();
6509 return;
6510 }
6511
6512 this.$pagination.show();
6513 var html = [];
6514 var allSelected = false;
6515 var i;
6516 var from;
6517 var to;
6518 var $pageList;
6519 var $pre;
6520 var $next;
6521 var $number;
6522 var data = this.getData({
6523 includeHiddenRows: false
6524 });
6525 var pageList = opts.pageList;
6526
6527 if (typeof pageList === 'string') {
6528 pageList = pageList.replace(/\[|\]| /g, '').toLowerCase().split(',');
6529 }
6530
6531 pageList = pageList.map(function (value) {
6532 if (typeof value === 'string') {
6533 return value.toLowerCase() === opts.formatAllRows().toLowerCase() || ['all', 'unlimited'].includes(value.toLowerCase()) ? opts.formatAllRows() : +value;
6534 }
6535
6536 return value;
6537 });
6538 this.paginationParts = opts.paginationParts;
6539
6540 if (typeof this.paginationParts === 'string') {
6541 this.paginationParts = this.paginationParts.replace(/\[|\]| |'/g, '').split(',');
6542 }
6543
6544 if (opts.sidePagination !== 'server') {
6545 opts.totalRows = data.length;
6546 }
6547
6548 this.totalPages = 0;
6549
6550 if (opts.totalRows) {
6551 if (opts.pageSize === opts.formatAllRows()) {
6552 opts.pageSize = opts.totalRows;
6553 allSelected = true;
6554 }
6555
6556 this.totalPages = ~~((opts.totalRows - 1) / opts.pageSize) + 1;
6557 opts.totalPages = this.totalPages;
6558 }
6559
6560 if (this.totalPages > 0 && opts.pageNumber > this.totalPages) {
6561 opts.pageNumber = this.totalPages;
6562 }
6563
6564 this.pageFrom = (opts.pageNumber - 1) * opts.pageSize + 1;
6565 this.pageTo = opts.pageNumber * opts.pageSize;
6566
6567 if (this.pageTo > opts.totalRows) {
6568 this.pageTo = opts.totalRows;
6569 }
6570
6571 if (this.options.pagination && this.options.sidePagination !== 'server') {
6572 this.options.totalNotFiltered = this.options.data.length;
6573 }
6574
6575 if (!this.options.showExtendedPagination) {
6576 this.options.totalNotFiltered = undefined;
6577 }
6578
6579 if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort') || this.paginationParts.includes('pageSize')) {
6580 html.push("<div class=\"".concat(this.constants.classes.pull, "-").concat(opts.paginationDetailHAlign, " pagination-detail\">"));
6581 }
6582
6583 if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort')) {
6584 var paginationInfo = this.paginationParts.includes('pageInfoShort') ? opts.formatDetailPagination(opts.totalRows) : opts.formatShowingRows(this.pageFrom, this.pageTo, opts.totalRows, opts.totalNotFiltered);
6585 html.push("<span class=\"pagination-info\">\n ".concat(paginationInfo, "\n </span>"));
6586 }
6587
6588 if (this.paginationParts.includes('pageSize')) {
6589 html.push('<div class="page-list">');
6590 var pageNumber = ["<div class=\"".concat(this.constants.classes.paginationDropdown, "\">\n <button class=\"").concat(this.constants.buttonsClass, " dropdown-toggle\" type=\"button\" ").concat(this.constants.dataToggle, "=\"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])];
6591 pageList.forEach(function (page, i) {
6592 if (!opts.smartDisplay || i === 0 || pageList[i - 1] < opts.totalRows || page === opts.formatAllRows()) {
6593 var active;
6594
6595 if (allSelected) {
6596 active = page === opts.formatAllRows() ? _this6.constants.classes.dropdownActive : '';
6597 } else {
6598 active = page === opts.pageSize ? _this6.constants.classes.dropdownActive : '';
6599 }
6600
6601 pageNumber.push(Utils.sprintf(_this6.constants.html.pageDropdownItem, active, page));
6602 }
6603 });
6604 pageNumber.push("".concat(this.constants.html.pageDropdown[1], "</div>"));
6605 html.push(opts.formatRecordsPerPage(pageNumber.join('')));
6606 }
6607
6608 if (this.paginationParts.includes('pageInfo') || this.paginationParts.includes('pageInfoShort') || this.paginationParts.includes('pageSize')) {
6609 html.push('</div></div>');
6610 }
6611
6612 if (this.paginationParts.includes('pageList')) {
6613 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));
6614
6615 if (this.totalPages < opts.paginationSuccessivelySize) {
6616 from = 1;
6617 to = this.totalPages;
6618 } else {
6619 from = opts.pageNumber - opts.paginationPagesBySide;
6620 to = from + opts.paginationPagesBySide * 2;
6621 }
6622
6623 if (opts.pageNumber < opts.paginationSuccessivelySize - 1) {
6624 to = opts.paginationSuccessivelySize;
6625 }
6626
6627 if (opts.paginationSuccessivelySize > this.totalPages - from) {
6628 from = from - (opts.paginationSuccessivelySize - (this.totalPages - from)) + 1;
6629 }
6630
6631 if (from < 1) {
6632 from = 1;
6633 }
6634
6635 if (to > this.totalPages) {
6636 to = this.totalPages;
6637 }
6638
6639 var middleSize = Math.round(opts.paginationPagesBySide / 2);
6640
6641 var pageItem = function pageItem(i) {
6642 var classes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
6643 return Utils.sprintf(_this6.constants.html.paginationItem, classes + (i === opts.pageNumber ? " ".concat(_this6.constants.classes.paginationActive) : ''), opts.formatSRPaginationPageText(i), i);
6644 };
6645
6646 if (from > 1) {
6647 var max = opts.paginationPagesBySide;
6648 if (max >= from) max = from - 1;
6649
6650 for (i = 1; i <= max; i++) {
6651 html.push(pageItem(i));
6652 }
6653
6654 if (from - 1 === max + 1) {
6655 i = from - 1;
6656 html.push(pageItem(i));
6657 } else if (from - 1 > max) {
6658 if (from - opts.paginationPagesBySide * 2 > opts.paginationPagesBySide && opts.paginationUseIntermediate) {
6659 i = Math.round((from - middleSize) / 2 + middleSize);
6660 html.push(pageItem(i, ' page-intermediate'));
6661 } else {
6662 html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-first-separator disabled', '', '...'));
6663 }
6664 }
6665 }
6666
6667 for (i = from; i <= to; i++) {
6668 html.push(pageItem(i));
6669 }
6670
6671 if (this.totalPages > to) {
6672 var min = this.totalPages - (opts.paginationPagesBySide - 1);
6673 if (to >= min) min = to + 1;
6674
6675 if (to + 1 === min - 1) {
6676 i = to + 1;
6677 html.push(pageItem(i));
6678 } else if (min > to + 1) {
6679 if (this.totalPages - to > opts.paginationPagesBySide * 2 && opts.paginationUseIntermediate) {
6680 i = Math.round((this.totalPages - middleSize - to) / 2 + to);
6681 html.push(pageItem(i, ' page-intermediate'));
6682 } else {
6683 html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-last-separator disabled', '', '...'));
6684 }
6685 }
6686
6687 for (i = min; i <= this.totalPages; i++) {
6688 html.push(pageItem(i));
6689 }
6690 }
6691
6692 html.push(Utils.sprintf(this.constants.html.paginationItem, ' page-next', opts.formatSRPaginationNextText(), opts.paginationNextText));
6693 html.push(this.constants.html.pagination[1], '</div>');
6694 }
6695
6696 this.$pagination.html(html.join(''));
6697 var dropupClass = ['bottom', 'both'].includes(opts.paginationVAlign) ? " ".concat(this.constants.classes.dropup) : '';
6698 this.$pagination.last().find('.page-list > div').addClass(dropupClass);
6699
6700 if (!opts.onlyInfoPagination) {
6701 $pageList = this.$pagination.find('.page-list a');
6702 $pre = this.$pagination.find('.page-pre');
6703 $next = this.$pagination.find('.page-next');
6704 $number = this.$pagination.find('.page-item').not('.page-next, .page-pre, .page-last-separator, .page-first-separator');
6705
6706 if (this.totalPages <= 1) {
6707 this.$pagination.find('div.pagination').hide();
6708 }
6709
6710 if (opts.smartDisplay) {
6711 if (pageList.length < 2 || opts.totalRows <= pageList[0]) {
6712 this.$pagination.find('div.page-list').hide();
6713 }
6714 } // when data is empty, hide the pagination
6715
6716
6717 this.$pagination[this.getData().length ? 'show' : 'hide']();
6718
6719 if (!opts.paginationLoop) {
6720 if (opts.pageNumber === 1) {
6721 $pre.addClass('disabled');
6722 }
6723
6724 if (opts.pageNumber === this.totalPages) {
6725 $next.addClass('disabled');
6726 }
6727 }
6728
6729 if (allSelected) {
6730 opts.pageSize = opts.formatAllRows();
6731 } // removed the events for last and first, onPageNumber executeds the same logic
6732
6733
6734 $pageList.off('click').on('click', function (e) {
6735 return _this6.onPageListChange(e);
6736 });
6737 $pre.off('click').on('click', function (e) {
6738 return _this6.onPagePre(e);
6739 });
6740 $next.off('click').on('click', function (e) {
6741 return _this6.onPageNext(e);
6742 });
6743 $number.off('click').on('click', function (e) {
6744 return _this6.onPageNumber(e);
6745 });
6746 }
6747 }
6748 }, {
6749 key: "updatePagination",
6750 value: function updatePagination(event) {
6751 // Fix #171: IE disabled button can be clicked bug.
6752 if (event && $__default["default"](event.currentTarget).hasClass('disabled')) {
6753 return;
6754 }
6755
6756 if (!this.options.maintainMetaData) {
6757 this.resetRows();
6758 }
6759
6760 this.initPagination();
6761 this.trigger('page-change', this.options.pageNumber, this.options.pageSize);
6762
6763 if (this.options.sidePagination === 'server') {
6764 this.initServer();
6765 } else {
6766 this.initBody();
6767 }
6768 }
6769 }, {
6770 key: "onPageListChange",
6771 value: function onPageListChange(event) {
6772 event.preventDefault();
6773 var $this = $__default["default"](event.currentTarget);
6774 $this.parent().addClass(this.constants.classes.dropdownActive).siblings().removeClass(this.constants.classes.dropdownActive);
6775 this.options.pageSize = $this.text().toUpperCase() === this.options.formatAllRows().toUpperCase() ? this.options.formatAllRows() : +$this.text();
6776 this.$toolbar.find('.page-size').text(this.options.pageSize);
6777 this.updatePagination(event);
6778 return false;
6779 }
6780 }, {
6781 key: "onPagePre",
6782 value: function onPagePre(event) {
6783 if ($__default["default"](event.target).hasClass('disabled')) {
6784 return;
6785 }
6786
6787 event.preventDefault();
6788
6789 if (this.options.pageNumber - 1 === 0) {
6790 this.options.pageNumber = this.options.totalPages;
6791 } else {
6792 this.options.pageNumber--;
6793 }
6794
6795 this.updatePagination(event);
6796 return false;
6797 }
6798 }, {
6799 key: "onPageNext",
6800 value: function onPageNext(event) {
6801 if ($__default["default"](event.target).hasClass('disabled')) {
6802 return;
6803 }
6804
6805 event.preventDefault();
6806
6807 if (this.options.pageNumber + 1 > this.options.totalPages) {
6808 this.options.pageNumber = 1;
6809 } else {
6810 this.options.pageNumber++;
6811 }
6812
6813 this.updatePagination(event);
6814 return false;
6815 }
6816 }, {
6817 key: "onPageNumber",
6818 value: function onPageNumber(event) {
6819 event.preventDefault();
6820
6821 if (this.options.pageNumber === +$__default["default"](event.currentTarget).text()) {
6822 return;
6823 }
6824
6825 this.options.pageNumber = +$__default["default"](event.currentTarget).text();
6826 this.updatePagination(event);
6827 return false;
6828 } // eslint-disable-next-line no-unused-vars
6829
6830 }, {
6831 key: "initRow",
6832 value: function initRow(item, i, data, trFragments) {
6833 var _this7 = this;
6834
6835 var html = [];
6836 var style = {};
6837 var csses = [];
6838 var data_ = '';
6839 var attributes = {};
6840 var htmlAttributes = [];
6841
6842 if (Utils.findIndex(this.hiddenRows, item) > -1) {
6843 return;
6844 }
6845
6846 style = Utils.calculateObjectValue(this.options, this.options.rowStyle, [item, i], style);
6847
6848 if (style && style.css) {
6849 for (var _i8 = 0, _Object$entries7 = Object.entries(style.css); _i8 < _Object$entries7.length; _i8++) {
6850 var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i8], 2),
6851 key = _Object$entries7$_i[0],
6852 value = _Object$entries7$_i[1];
6853
6854 csses.push("".concat(key, ": ").concat(value));
6855 }
6856 }
6857
6858 attributes = Utils.calculateObjectValue(this.options, this.options.rowAttributes, [item, i], attributes);
6859
6860 if (attributes) {
6861 for (var _i9 = 0, _Object$entries8 = Object.entries(attributes); _i9 < _Object$entries8.length; _i9++) {
6862 var _Object$entries8$_i = _slicedToArray(_Object$entries8[_i9], 2),
6863 _key2 = _Object$entries8$_i[0],
6864 _value = _Object$entries8$_i[1];
6865
6866 htmlAttributes.push("".concat(_key2, "=\"").concat(Utils.escapeHTML(_value), "\""));
6867 }
6868 }
6869
6870 if (item._data && !Utils.isEmptyObject(item._data)) {
6871 for (var _i10 = 0, _Object$entries9 = Object.entries(item._data); _i10 < _Object$entries9.length; _i10++) {
6872 var _Object$entries9$_i = _slicedToArray(_Object$entries9[_i10], 2),
6873 k = _Object$entries9$_i[0],
6874 v = _Object$entries9$_i[1];
6875
6876 // ignore data-index
6877 if (k === 'index') {
6878 return;
6879 }
6880
6881 data_ += " data-".concat(k, "='").concat(_typeof(v) === 'object' ? JSON.stringify(v) : v, "'");
6882 }
6883 }
6884
6885 html.push('<tr', Utils.sprintf(' %s', htmlAttributes.length ? htmlAttributes.join(' ') : undefined), Utils.sprintf(' id="%s"', Array.isArray(item) ? undefined : item._id), Utils.sprintf(' class="%s"', style.classes || (Array.isArray(item) ? undefined : item._class)), Utils.sprintf(' style="%s"', Array.isArray(item) ? undefined : item._style), " data-index=\"".concat(i, "\""), Utils.sprintf(' data-uniqueid="%s"', Utils.getItemField(item, this.options.uniqueId, false)), Utils.sprintf(' data-has-detail-view="%s"', this.options.detailView && Utils.calculateObjectValue(null, this.options.detailFilter, [i, item]) ? 'true' : undefined), Utils.sprintf('%s', data_), '>');
6886
6887 if (this.options.cardView) {
6888 html.push("<td colspan=\"".concat(this.header.fields.length, "\"><div class=\"card-views\">"));
6889 }
6890
6891 var detailViewTemplate = '';
6892
6893 if (Utils.hasDetailViewIcon(this.options)) {
6894 detailViewTemplate = '<td>';
6895
6896 if (Utils.calculateObjectValue(null, this.options.detailFilter, [i, item])) {
6897 detailViewTemplate += "\n <a class=\"detail-icon\" href=\"#\">\n ".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailOpen), "\n </a>\n ");
6898 }
6899
6900 detailViewTemplate += '</td>';
6901 }
6902
6903 if (detailViewTemplate && this.options.detailViewAlign !== 'right') {
6904 html.push(detailViewTemplate);
6905 }
6906
6907 this.header.fields.forEach(function (field, j) {
6908 var column = _this7.columns[j];
6909 var text = '';
6910 var value_ = Utils.getItemField(item, field, _this7.options.escape, column.escape);
6911 var value = '';
6912 var type = '';
6913 var cellStyle = {};
6914 var id_ = '';
6915 var class_ = _this7.header.classes[j];
6916 var style_ = '';
6917 var styleToAdd_ = '';
6918 var data_ = '';
6919 var rowspan_ = '';
6920 var colspan_ = '';
6921 var title_ = '';
6922
6923 if ((_this7.fromHtml || _this7.autoMergeCells) && typeof value_ === 'undefined') {
6924 if (!column.checkbox && !column.radio) {
6925 return;
6926 }
6927 }
6928
6929 if (!column.visible) {
6930 return;
6931 }
6932
6933 if (_this7.options.cardView && !column.cardVisible) {
6934 return;
6935 }
6936
6937 if (column.escape) {
6938 value_ = Utils.escapeHTML(value_);
6939 } // Style concat
6940
6941
6942 if (csses.concat([_this7.header.styles[j]]).length) {
6943 styleToAdd_ += "".concat(csses.concat([_this7.header.styles[j]]).join('; '));
6944 }
6945
6946 if (item["_".concat(field, "_style")]) {
6947 styleToAdd_ += "".concat(item["_".concat(field, "_style")]);
6948 }
6949
6950 if (styleToAdd_) {
6951 style_ = " style=\"".concat(styleToAdd_, "\"");
6952 } // Style concat
6953 // handle id and class of td
6954
6955
6956 if (item["_".concat(field, "_id")]) {
6957 id_ = Utils.sprintf(' id="%s"', item["_".concat(field, "_id")]);
6958 }
6959
6960 if (item["_".concat(field, "_class")]) {
6961 class_ = Utils.sprintf(' class="%s"', item["_".concat(field, "_class")]);
6962 }
6963
6964 if (item["_".concat(field, "_rowspan")]) {
6965 rowspan_ = Utils.sprintf(' rowspan="%s"', item["_".concat(field, "_rowspan")]);
6966 }
6967
6968 if (item["_".concat(field, "_colspan")]) {
6969 colspan_ = Utils.sprintf(' colspan="%s"', item["_".concat(field, "_colspan")]);
6970 }
6971
6972 if (item["_".concat(field, "_title")]) {
6973 title_ = Utils.sprintf(' title="%s"', item["_".concat(field, "_title")]);
6974 }
6975
6976 cellStyle = Utils.calculateObjectValue(_this7.header, _this7.header.cellStyles[j], [value_, item, i, field], cellStyle);
6977
6978 if (cellStyle.classes) {
6979 class_ = " class=\"".concat(cellStyle.classes, "\"");
6980 }
6981
6982 if (cellStyle.css) {
6983 var csses_ = [];
6984
6985 for (var _i11 = 0, _Object$entries10 = Object.entries(cellStyle.css); _i11 < _Object$entries10.length; _i11++) {
6986 var _Object$entries10$_i = _slicedToArray(_Object$entries10[_i11], 2),
6987 _key3 = _Object$entries10$_i[0],
6988 _value2 = _Object$entries10$_i[1];
6989
6990 csses_.push("".concat(_key3, ": ").concat(_value2));
6991 }
6992
6993 style_ = " style=\"".concat(csses_.concat(_this7.header.styles[j]).join('; '), "\"");
6994 }
6995
6996 value = Utils.calculateObjectValue(column, _this7.header.formatters[j], [value_, item, i, field], value_);
6997
6998 if (!(column.checkbox || column.radio)) {
6999 value = typeof value === 'undefined' || value === null ? _this7.options.undefinedText : value;
7000 }
7001
7002 if (column.searchable && _this7.searchText && _this7.options.searchHighlight && !(column.checkbox || column.radio)) {
7003 var defValue = '';
7004 var regExp = new RegExp("(".concat(_this7.searchText.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), ")"), 'gim');
7005 var marker = '<mark>$1</mark>';
7006 var isHTML = value && /<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i.test(value);
7007
7008 if (isHTML) {
7009 // value can contains a HTML tags
7010 var textContent = new DOMParser().parseFromString(value.toString(), 'text/html').documentElement.textContent;
7011 var textReplaced = textContent.replace(regExp, marker);
7012 textContent = textContent.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
7013 defValue = value.replace(new RegExp("(>\\s*)(".concat(textContent, ")(\\s*)"), 'gm'), "$1".concat(textReplaced, "$3"));
7014 } else {
7015 // but usually not
7016 defValue = value.toString().replace(regExp, marker);
7017 }
7018
7019 value = Utils.calculateObjectValue(column, column.searchHighlightFormatter, [value, _this7.searchText], defValue);
7020 }
7021
7022 if (item["_".concat(field, "_data")] && !Utils.isEmptyObject(item["_".concat(field, "_data")])) {
7023 for (var _i12 = 0, _Object$entries11 = Object.entries(item["_".concat(field, "_data")]); _i12 < _Object$entries11.length; _i12++) {
7024 var _Object$entries11$_i = _slicedToArray(_Object$entries11[_i12], 2),
7025 _k = _Object$entries11$_i[0],
7026 _v = _Object$entries11$_i[1];
7027
7028 // ignore data-index
7029 if (_k === 'index') {
7030 return;
7031 }
7032
7033 data_ += " data-".concat(_k, "=\"").concat(_v, "\"");
7034 }
7035 }
7036
7037 if (column.checkbox || column.radio) {
7038 type = column.checkbox ? 'checkbox' : type;
7039 type = column.radio ? 'radio' : type;
7040 var c = column['class'] || '';
7041 var isChecked = Utils.isObject(value) && value.hasOwnProperty('checked') ? value.checked : (value === true || value_) && value !== false;
7042 var isDisabled = !column.checkboxEnabled || value && value.disabled;
7043 text = [_this7.options.cardView ? "<div class=\"card-view ".concat(c, "\">") : "<td class=\"bs-checkbox ".concat(c, "\"").concat(class_).concat(style_, ">"), "<label>\n <input\n data-index=\"".concat(i, "\"\n name=\"").concat(_this7.options.selectItemName, "\"\n type=\"").concat(type, "\"\n ").concat(Utils.sprintf('value="%s"', item[_this7.options.idField]), "\n ").concat(Utils.sprintf('checked="%s"', isChecked ? 'checked' : undefined), "\n ").concat(Utils.sprintf('disabled="%s"', isDisabled ? 'disabled' : undefined), " />\n <span></span>\n </label>"), _this7.header.formatters[j] && typeof value === 'string' ? value : '', _this7.options.cardView ? '</div>' : '</td>'].join('');
7044 item[_this7.header.stateField] = value === true || !!value_ || value && value.checked;
7045 } else if (_this7.options.cardView) {
7046 var cardTitle = _this7.options.showHeader ? "<span class=\"card-view-title ".concat(cellStyle.classes || '', "\"").concat(style_, ">").concat(Utils.getFieldTitle(_this7.columns, field), "</span>") : '';
7047 text = "<div class=\"card-view\">".concat(cardTitle, "<span class=\"card-view-value ").concat(cellStyle.classes || '', "\"").concat(style_, ">").concat(value, "</span></div>");
7048
7049 if (_this7.options.smartDisplay && value === '') {
7050 text = '<div class="card-view"></div>';
7051 }
7052 } else {
7053 text = "<td".concat(id_).concat(class_).concat(style_).concat(data_).concat(rowspan_).concat(colspan_).concat(title_, ">").concat(value, "</td>");
7054 }
7055
7056 html.push(text);
7057 });
7058
7059 if (detailViewTemplate && this.options.detailViewAlign === 'right') {
7060 html.push(detailViewTemplate);
7061 }
7062
7063 if (this.options.cardView) {
7064 html.push('</div></td>');
7065 }
7066
7067 html.push('</tr>');
7068 return html.join('');
7069 }
7070 }, {
7071 key: "initBody",
7072 value: function initBody(fixedScroll, updatedUid) {
7073 var _this8 = this;
7074
7075 var data = this.getData();
7076 this.trigger('pre-body', data);
7077 this.$body = this.$el.find('>tbody');
7078
7079 if (!this.$body.length) {
7080 this.$body = $__default["default"]('<tbody></tbody>').appendTo(this.$el);
7081 } // Fix #389 Bootstrap-table-flatJSON is not working
7082
7083
7084 if (!this.options.pagination || this.options.sidePagination === 'server') {
7085 this.pageFrom = 1;
7086 this.pageTo = data.length;
7087 }
7088
7089 var rows = [];
7090 var trFragments = $__default["default"](document.createDocumentFragment());
7091 var hasTr = false;
7092 var toExpand = [];
7093 this.autoMergeCells = Utils.checkAutoMergeCells(data.slice(this.pageFrom - 1, this.pageTo));
7094
7095 for (var i = this.pageFrom - 1; i < this.pageTo; i++) {
7096 var item = data[i];
7097 var tr = this.initRow(item, i, data, trFragments);
7098 hasTr = hasTr || !!tr;
7099
7100 if (tr && typeof tr === 'string') {
7101 var uniqueId = this.options.uniqueId;
7102
7103 if (uniqueId && item.hasOwnProperty(uniqueId)) {
7104 var itemUniqueId = item[uniqueId];
7105 var oldTr = this.$body.find(Utils.sprintf('> tr[data-uniqueid="%s"][data-has-detail-view]', itemUniqueId));
7106 var oldTrNext = oldTr.next();
7107
7108 if (oldTrNext.is('tr.detail-view')) {
7109 toExpand.push(i);
7110
7111 if (!updatedUid || itemUniqueId !== updatedUid) {
7112 tr += oldTrNext[0].outerHTML;
7113 }
7114 }
7115 }
7116
7117 if (!this.options.virtualScroll) {
7118 trFragments.append(tr);
7119 } else {
7120 rows.push(tr);
7121 }
7122 }
7123 } // show no records
7124
7125
7126 if (!hasTr) {
7127 this.$body.html("<tr class=\"no-records-found\">".concat(Utils.sprintf('<td colspan="%s">%s</td>', this.getVisibleFields().length + Utils.getDetailViewIndexOffset(this.options), this.options.formatNoMatches()), "</tr>"));
7128 } else if (!this.options.virtualScroll) {
7129 this.$body.html(trFragments);
7130 } else {
7131 if (this.virtualScroll) {
7132 this.virtualScroll.destroy();
7133 }
7134
7135 this.virtualScroll = new VirtualScroll({
7136 rows: rows,
7137 fixedScroll: fixedScroll,
7138 scrollEl: this.$tableBody[0],
7139 contentEl: this.$body[0],
7140 itemHeight: this.options.virtualScrollItemHeight,
7141 callback: function callback(startIndex, endIndex) {
7142 _this8.fitHeader();
7143
7144 _this8.initBodyEvent();
7145
7146 _this8.trigger('virtual-scroll', startIndex, endIndex);
7147 }
7148 });
7149 }
7150
7151 toExpand.forEach(function (index) {
7152 _this8.expandRow(index);
7153 });
7154
7155 if (!fixedScroll) {
7156 this.scrollTo(0);
7157 }
7158
7159 this.initBodyEvent();
7160 this.initFooter();
7161 this.resetView();
7162 this.updateSelected();
7163
7164 if (this.options.sidePagination !== 'server') {
7165 this.options.totalRows = data.length;
7166 }
7167
7168 this.trigger('post-body', data);
7169 }
7170 }, {
7171 key: "initBodyEvent",
7172 value: function initBodyEvent() {
7173 var _this9 = this;
7174
7175 // click to select by column
7176 this.$body.find('> tr[data-index] > td').off('click dblclick').on('click dblclick', function (e) {
7177 var $td = $__default["default"](e.currentTarget);
7178
7179 if ($td.find('.detail-icon').length) {
7180 return;
7181 }
7182
7183 var $tr = $td.parent();
7184 var $cardViewArr = $__default["default"](e.target).parents('.card-views').children();
7185 var $cardViewTarget = $__default["default"](e.target).parents('.card-view');
7186 var rowIndex = $tr.data('index');
7187 var item = _this9.data[rowIndex];
7188 var index = _this9.options.cardView ? $cardViewArr.index($cardViewTarget) : $td[0].cellIndex;
7189
7190 var fields = _this9.getVisibleFields();
7191
7192 var field = fields[index - Utils.getDetailViewIndexOffset(_this9.options)];
7193 var column = _this9.columns[_this9.fieldsColumnsIndex[field]];
7194 var value = Utils.getItemField(item, field, _this9.options.escape, column.escape);
7195
7196 _this9.trigger(e.type === 'click' ? 'click-cell' : 'dbl-click-cell', field, value, item, $td);
7197
7198 _this9.trigger(e.type === 'click' ? 'click-row' : 'dbl-click-row', item, $tr, field); // if click to select - then trigger the checkbox/radio click
7199
7200
7201 if (e.type === 'click' && _this9.options.clickToSelect && column.clickToSelect && !Utils.calculateObjectValue(_this9.options, _this9.options.ignoreClickToSelectOn, [e.target])) {
7202 var $selectItem = $tr.find(Utils.sprintf('[name="%s"]', _this9.options.selectItemName));
7203
7204 if ($selectItem.length) {
7205 $selectItem[0].click();
7206 }
7207 }
7208
7209 if (e.type === 'click' && _this9.options.detailViewByClick) {
7210 _this9.toggleDetailView(rowIndex, _this9.header.detailFormatters[_this9.fieldsColumnsIndex[field]]);
7211 }
7212 }).off('mousedown').on('mousedown', function (e) {
7213 // https://github.com/jquery/jquery/issues/1741
7214 _this9.multipleSelectRowCtrlKey = e.ctrlKey || e.metaKey;
7215 _this9.multipleSelectRowShiftKey = e.shiftKey;
7216 });
7217 this.$body.find('> tr[data-index] > td > .detail-icon').off('click').on('click', function (e) {
7218 e.preventDefault();
7219
7220 _this9.toggleDetailView($__default["default"](e.currentTarget).parent().parent().data('index'));
7221
7222 return false;
7223 });
7224 this.$selectItem = this.$body.find(Utils.sprintf('[name="%s"]', this.options.selectItemName));
7225 this.$selectItem.off('click').on('click', function (e) {
7226 e.stopImmediatePropagation();
7227 var $this = $__default["default"](e.currentTarget);
7228
7229 _this9._toggleCheck($this.prop('checked'), $this.data('index'));
7230 });
7231 this.header.events.forEach(function (_events, i) {
7232 var events = _events;
7233
7234 if (!events) {
7235 return;
7236 } // fix bug, if events is defined with namespace
7237
7238
7239 if (typeof events === 'string') {
7240 events = Utils.calculateObjectValue(null, events);
7241 }
7242
7243 if (!events) {
7244 throw new Error("Unknown event in the scope: ".concat(_events));
7245 }
7246
7247 var field = _this9.header.fields[i];
7248
7249 var fieldIndex = _this9.getVisibleFields().indexOf(field);
7250
7251 if (fieldIndex === -1) {
7252 return;
7253 }
7254
7255 fieldIndex += Utils.getDetailViewIndexOffset(_this9.options);
7256
7257 var _loop2 = function _loop2(key) {
7258 if (!events.hasOwnProperty(key)) {
7259 return "continue";
7260 }
7261
7262 var event = events[key];
7263
7264 _this9.$body.find('>tr:not(.no-records-found)').each(function (i, tr) {
7265 var $tr = $__default["default"](tr);
7266 var $td = $tr.find(_this9.options.cardView ? '.card-views>.card-view' : '>td').eq(fieldIndex);
7267 var index = key.indexOf(' ');
7268 var name = key.substring(0, index);
7269 var el = key.substring(index + 1);
7270 $td.find(el).off(name).on(name, function (e) {
7271 var index = $tr.data('index');
7272 var row = _this9.data[index];
7273 var value = row[field];
7274 event.apply(_this9, [e, value, row, index]);
7275 });
7276 });
7277 };
7278
7279 for (var key in events) {
7280 var _ret2 = _loop2(key);
7281
7282 if (_ret2 === "continue") continue;
7283 }
7284 });
7285 }
7286 }, {
7287 key: "initServer",
7288 value: function initServer(silent, query, url) {
7289 var _this10 = this;
7290
7291 var data = {};
7292 var index = this.header.fields.indexOf(this.options.sortName);
7293 var params = {
7294 searchText: this.searchText,
7295 sortName: this.options.sortName,
7296 sortOrder: this.options.sortOrder
7297 };
7298
7299 if (this.header.sortNames[index]) {
7300 params.sortName = this.header.sortNames[index];
7301 }
7302
7303 if (this.options.pagination && this.options.sidePagination === 'server') {
7304 params.pageSize = this.options.pageSize === this.options.formatAllRows() ? this.options.totalRows : this.options.pageSize;
7305 params.pageNumber = this.options.pageNumber;
7306 }
7307
7308 if (!(url || this.options.url) && !this.options.ajax) {
7309 return;
7310 }
7311
7312 if (this.options.queryParamsType === 'limit') {
7313 params = {
7314 search: params.searchText,
7315 sort: params.sortName,
7316 order: params.sortOrder
7317 };
7318
7319 if (this.options.pagination && this.options.sidePagination === 'server') {
7320 params.offset = this.options.pageSize === this.options.formatAllRows() ? 0 : this.options.pageSize * (this.options.pageNumber - 1);
7321 params.limit = this.options.pageSize;
7322
7323 if (params.limit === 0 || this.options.pageSize === this.options.formatAllRows()) {
7324 delete params.limit;
7325 }
7326 }
7327 }
7328
7329 if (this.options.search && this.options.sidePagination === 'server' && this.columns.filter(function (column) {
7330 return !column.searchable;
7331 }).length) {
7332 params.searchable = [];
7333
7334 var _iterator2 = _createForOfIteratorHelper(this.columns),
7335 _step2;
7336
7337 try {
7338 for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
7339 var column = _step2.value;
7340
7341 if (!column.checkbox && column.searchable && (this.options.visibleSearch && column.visible || !this.options.visibleSearch)) {
7342 params.searchable.push(column.field);
7343 }
7344 }
7345 } catch (err) {
7346 _iterator2.e(err);
7347 } finally {
7348 _iterator2.f();
7349 }
7350 }
7351
7352 if (!Utils.isEmptyObject(this.filterColumnsPartial)) {
7353 params.filter = JSON.stringify(this.filterColumnsPartial, null);
7354 }
7355
7356 $__default["default"].extend(params, query || {});
7357 data = Utils.calculateObjectValue(this.options, this.options.queryParams, [params], data); // false to stop request
7358
7359 if (data === false) {
7360 return;
7361 }
7362
7363 if (!silent) {
7364 this.showLoading();
7365 }
7366
7367 var request = $__default["default"].extend({}, Utils.calculateObjectValue(null, this.options.ajaxOptions), {
7368 type: this.options.method,
7369 url: url || this.options.url,
7370 data: this.options.contentType === 'application/json' && this.options.method === 'post' ? JSON.stringify(data) : data,
7371 cache: this.options.cache,
7372 contentType: this.options.contentType,
7373 dataType: this.options.dataType,
7374 success: function success(_res, textStatus, jqXHR) {
7375 var res = Utils.calculateObjectValue(_this10.options, _this10.options.responseHandler, [_res, jqXHR], _res);
7376
7377 _this10.load(res);
7378
7379 _this10.trigger('load-success', res, jqXHR && jqXHR.status, jqXHR);
7380
7381 if (!silent) {
7382 _this10.hideLoading();
7383 }
7384
7385 if (_this10.options.sidePagination === 'server' && _this10.options.pageNumber > 1 && res[_this10.options.totalField] > 0 && !res[_this10.options.dataField].length) {
7386 _this10.updatePagination();
7387 }
7388 },
7389 error: function error(jqXHR) {
7390 // abort ajax by multiple request
7391 if (jqXHR && jqXHR.status === 0 && _this10._xhrAbort) {
7392 _this10._xhrAbort = false;
7393 return;
7394 }
7395
7396 var data = [];
7397
7398 if (_this10.options.sidePagination === 'server') {
7399 data = {};
7400 data[_this10.options.totalField] = 0;
7401 data[_this10.options.dataField] = [];
7402 }
7403
7404 _this10.load(data);
7405
7406 _this10.trigger('load-error', jqXHR && jqXHR.status, jqXHR);
7407
7408 if (!silent) {
7409 _this10.hideLoading();
7410 }
7411 }
7412 });
7413
7414 if (this.options.ajax) {
7415 Utils.calculateObjectValue(this, this.options.ajax, [request], null);
7416 } else {
7417 if (this._xhr && this._xhr.readyState !== 4) {
7418 this._xhrAbort = true;
7419
7420 this._xhr.abort();
7421 }
7422
7423 this._xhr = $__default["default"].ajax(request);
7424 }
7425
7426 return data;
7427 }
7428 }, {
7429 key: "initSearchText",
7430 value: function initSearchText() {
7431 if (this.options.search) {
7432 this.searchText = '';
7433
7434 if (this.options.searchText !== '') {
7435 var $search = Utils.getSearchInput(this);
7436 $search.val(this.options.searchText);
7437 this.onSearch({
7438 currentTarget: $search,
7439 firedByInitSearchText: true
7440 });
7441 }
7442 }
7443 }
7444 }, {
7445 key: "getCaret",
7446 value: function getCaret() {
7447 var _this11 = this;
7448
7449 this.$header.find('th').each(function (i, th) {
7450 $__default["default"](th).find('.sortable').removeClass('desc asc').addClass($__default["default"](th).data('field') === _this11.options.sortName ? _this11.options.sortOrder : 'both');
7451 });
7452 }
7453 }, {
7454 key: "updateSelected",
7455 value: function updateSelected() {
7456 var checkAll = this.$selectItem.filter(':enabled').length && this.$selectItem.filter(':enabled').length === this.$selectItem.filter(':enabled').filter(':checked').length;
7457 this.$selectAll.add(this.$selectAll_).prop('checked', checkAll);
7458 this.$selectItem.each(function (i, el) {
7459 $__default["default"](el).closest('tr')[$__default["default"](el).prop('checked') ? 'addClass' : 'removeClass']('selected');
7460 });
7461 }
7462 }, {
7463 key: "updateRows",
7464 value: function updateRows() {
7465 var _this12 = this;
7466
7467 this.$selectItem.each(function (i, el) {
7468 _this12.data[$__default["default"](el).data('index')][_this12.header.stateField] = $__default["default"](el).prop('checked');
7469 });
7470 }
7471 }, {
7472 key: "resetRows",
7473 value: function resetRows() {
7474 var _iterator3 = _createForOfIteratorHelper(this.data),
7475 _step3;
7476
7477 try {
7478 for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
7479 var row = _step3.value;
7480 this.$selectAll.prop('checked', false);
7481 this.$selectItem.prop('checked', false);
7482
7483 if (this.header.stateField) {
7484 row[this.header.stateField] = false;
7485 }
7486 }
7487 } catch (err) {
7488 _iterator3.e(err);
7489 } finally {
7490 _iterator3.f();
7491 }
7492
7493 this.initHiddenRows();
7494 }
7495 }, {
7496 key: "trigger",
7497 value: function trigger(_name) {
7498 var _this$options, _this$options2;
7499
7500 var name = "".concat(_name, ".bs.table");
7501
7502 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key4 = 1; _key4 < _len; _key4++) {
7503 args[_key4 - 1] = arguments[_key4];
7504 }
7505
7506 (_this$options = this.options)[BootstrapTable.EVENTS[name]].apply(_this$options, [].concat(args, [this]));
7507
7508 this.$el.trigger($__default["default"].Event(name, {
7509 sender: this
7510 }), args);
7511
7512 (_this$options2 = this.options).onAll.apply(_this$options2, [name].concat([].concat(args, [this])));
7513
7514 this.$el.trigger($__default["default"].Event('all.bs.table', {
7515 sender: this
7516 }), [name, args]);
7517 }
7518 }, {
7519 key: "resetHeader",
7520 value: function resetHeader() {
7521 var _this13 = this;
7522
7523 // fix #61: the hidden table reset header bug.
7524 // fix bug: get $el.css('width') error sometime (height = 500)
7525 clearTimeout(this.timeoutId_);
7526 this.timeoutId_ = setTimeout(function () {
7527 return _this13.fitHeader();
7528 }, this.$el.is(':hidden') ? 100 : 0);
7529 }
7530 }, {
7531 key: "fitHeader",
7532 value: function fitHeader() {
7533 var _this14 = this;
7534
7535 if (this.$el.is(':hidden')) {
7536 this.timeoutId_ = setTimeout(function () {
7537 return _this14.fitHeader();
7538 }, 100);
7539 return;
7540 }
7541
7542 var fixedBody = this.$tableBody.get(0);
7543 var scrollWidth = this.hasScrollBar && fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ? Utils.getScrollBarWidth() : 0;
7544 this.$el.css('margin-top', -this.$header.outerHeight());
7545 var focused = $__default["default"](':focus');
7546
7547 if (focused.length > 0) {
7548 var $th = focused.parents('th');
7549
7550 if ($th.length > 0) {
7551 var dataField = $th.attr('data-field');
7552
7553 if (dataField !== undefined) {
7554 var $headerTh = this.$header.find("[data-field='".concat(dataField, "']"));
7555
7556 if ($headerTh.length > 0) {
7557 $headerTh.find(':input').addClass('focus-temp');
7558 }
7559 }
7560 }
7561 }
7562
7563 this.$header_ = this.$header.clone(true, true);
7564 this.$selectAll_ = this.$header_.find('[name="btSelectAll"]');
7565 this.$tableHeader.css('margin-right', scrollWidth).find('table').css('width', this.$el.outerWidth()).html('').attr('class', this.$el.attr('class')).append(this.$header_);
7566 this.$tableLoading.css('width', this.$el.outerWidth());
7567 var focusedTemp = $__default["default"]('.focus-temp:visible:eq(0)');
7568
7569 if (focusedTemp.length > 0) {
7570 focusedTemp.focus();
7571 this.$header.find('.focus-temp').removeClass('focus-temp');
7572 } // fix bug: $.data() is not working as expected after $.append()
7573
7574
7575 this.$header.find('th[data-field]').each(function (i, el) {
7576 _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', $__default["default"](el).data('field'))).data($__default["default"](el).data());
7577 });
7578 var visibleFields = this.getVisibleFields();
7579 var $ths = this.$header_.find('th');
7580 var $tr = this.$body.find('>tr:not(.no-records-found,.virtual-scroll-top)').eq(0);
7581
7582 while ($tr.length && $tr.find('>td[colspan]:not([colspan="1"])').length) {
7583 $tr = $tr.next();
7584 }
7585
7586 var trLength = $tr.find('> *').length;
7587 $tr.find('> *').each(function (i, el) {
7588 var $this = $__default["default"](el);
7589
7590 if (Utils.hasDetailViewIcon(_this14.options)) {
7591 if (i === 0 && _this14.options.detailViewAlign !== 'right' || i === trLength - 1 && _this14.options.detailViewAlign === 'right') {
7592 var $thDetail = $ths.filter('.detail');
7593
7594 var _zoomWidth = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();
7595
7596 $thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth);
7597 return;
7598 }
7599 }
7600
7601 var index = i - Utils.getDetailViewIndexOffset(_this14.options);
7602
7603 var $th = _this14.$header_.find(Utils.sprintf('th[data-field="%s"]', visibleFields[index]));
7604
7605 if ($th.length > 1) {
7606 $th = $__default["default"]($ths[$this[0].cellIndex]);
7607 }
7608
7609 var zoomWidth = $th.innerWidth() - $th.find('.fht-cell').width();
7610 $th.find('.fht-cell').width($this.innerWidth() - zoomWidth);
7611 });
7612 this.horizontalScroll();
7613 this.trigger('post-header');
7614 }
7615 }, {
7616 key: "initFooter",
7617 value: function initFooter() {
7618 if (!this.options.showFooter || this.options.cardView) {
7619 // do nothing
7620 return;
7621 }
7622
7623 var data = this.getData();
7624 var html = [];
7625 var detailTemplate = '';
7626
7627 if (Utils.hasDetailViewIcon(this.options)) {
7628 detailTemplate = '<th class="detail"><div class="th-inner"></div><div class="fht-cell"></div></th>';
7629 }
7630
7631 if (detailTemplate && this.options.detailViewAlign !== 'right') {
7632 html.push(detailTemplate);
7633 }
7634
7635 var _iterator4 = _createForOfIteratorHelper(this.columns),
7636 _step4;
7637
7638 try {
7639 for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
7640 var column = _step4.value;
7641 var falign = '';
7642 var valign = '';
7643 var csses = [];
7644 var style = {};
7645 var class_ = Utils.sprintf(' class="%s"', column['class']);
7646
7647 if (!column.visible || this.footerData && this.footerData.length > 0 && !(column.field in this.footerData[0])) {
7648 continue;
7649 }
7650
7651 if (this.options.cardView && !column.cardVisible) {
7652 return;
7653 }
7654
7655 falign = Utils.sprintf('text-align: %s; ', column.falign ? column.falign : column.align);
7656 valign = Utils.sprintf('vertical-align: %s; ', column.valign);
7657 style = Utils.calculateObjectValue(null, this.options.footerStyle, [column]);
7658
7659 if (style && style.css) {
7660 for (var _i13 = 0, _Object$entries12 = Object.entries(style.css); _i13 < _Object$entries12.length; _i13++) {
7661 var _Object$entries12$_i = _slicedToArray(_Object$entries12[_i13], 2),
7662 key = _Object$entries12$_i[0],
7663 _value3 = _Object$entries12$_i[1];
7664
7665 csses.push("".concat(key, ": ").concat(_value3));
7666 }
7667 }
7668
7669 if (style && style.classes) {
7670 class_ = Utils.sprintf(' class="%s"', column['class'] ? [column['class'], style.classes].join(' ') : style.classes);
7671 }
7672
7673 html.push('<th', class_, Utils.sprintf(' style="%s"', falign + valign + csses.concat().join('; ')));
7674 var colspan = 0;
7675
7676 if (this.footerData && this.footerData.length > 0) {
7677 colspan = this.footerData[0]["_".concat(column.field, "_colspan")] || 0;
7678 }
7679
7680 if (colspan) {
7681 html.push(" colspan=\"".concat(colspan, "\" "));
7682 }
7683
7684 html.push('>');
7685 html.push('<div class="th-inner">');
7686 var value = '';
7687
7688 if (this.footerData && this.footerData.length > 0) {
7689 value = this.footerData[0][column.field] || '';
7690 }
7691
7692 html.push(Utils.calculateObjectValue(column, column.footerFormatter, [data, value], value));
7693 html.push('</div>');
7694 html.push('<div class="fht-cell"></div>');
7695 html.push('</div>');
7696 html.push('</th>');
7697 }
7698 } catch (err) {
7699 _iterator4.e(err);
7700 } finally {
7701 _iterator4.f();
7702 }
7703
7704 if (detailTemplate && this.options.detailViewAlign === 'right') {
7705 html.push(detailTemplate);
7706 }
7707
7708 if (!this.options.height && !this.$tableFooter.length) {
7709 this.$el.append('<tfoot><tr></tr></tfoot>');
7710 this.$tableFooter = this.$el.find('tfoot');
7711 }
7712
7713 if (!this.$tableFooter.find('tr').length) {
7714 this.$tableFooter.html('<table><thead><tr></tr></thead></table>');
7715 }
7716
7717 this.$tableFooter.find('tr').html(html.join(''));
7718 this.trigger('post-footer', this.$tableFooter);
7719 }
7720 }, {
7721 key: "fitFooter",
7722 value: function fitFooter() {
7723 var _this15 = this;
7724
7725 if (this.$el.is(':hidden')) {
7726 setTimeout(function () {
7727 return _this15.fitFooter();
7728 }, 100);
7729 return;
7730 }
7731
7732 var fixedBody = this.$tableBody.get(0);
7733 var scrollWidth = this.hasScrollBar && fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.outerHeight() ? Utils.getScrollBarWidth() : 0;
7734 this.$tableFooter.css('margin-right', scrollWidth).find('table').css('width', this.$el.outerWidth()).attr('class', this.$el.attr('class'));
7735 var $ths = this.$tableFooter.find('th');
7736 var $tr = this.$body.find('>tr:first-child:not(.no-records-found)');
7737 $ths.find('.fht-cell').width('auto');
7738
7739 while ($tr.length && $tr.find('>td[colspan]:not([colspan="1"])').length) {
7740 $tr = $tr.next();
7741 }
7742
7743 var trLength = $tr.find('> *').length;
7744 $tr.find('> *').each(function (i, el) {
7745 var $this = $__default["default"](el);
7746
7747 if (Utils.hasDetailViewIcon(_this15.options)) {
7748 if (i === 0 && _this15.options.detailViewAlign === 'left' || i === trLength - 1 && _this15.options.detailViewAlign === 'right') {
7749 var $thDetail = $ths.filter('.detail');
7750
7751 var _zoomWidth2 = $thDetail.innerWidth() - $thDetail.find('.fht-cell').width();
7752
7753 $thDetail.find('.fht-cell').width($this.innerWidth() - _zoomWidth2);
7754 return;
7755 }
7756 }
7757
7758 var $th = $ths.eq(i);
7759 var zoomWidth = $th.innerWidth() - $th.find('.fht-cell').width();
7760 $th.find('.fht-cell').width($this.innerWidth() - zoomWidth);
7761 });
7762 this.horizontalScroll();
7763 }
7764 }, {
7765 key: "horizontalScroll",
7766 value: function horizontalScroll() {
7767 var _this16 = this;
7768
7769 // horizontal scroll event
7770 // TODO: it's probably better improving the layout than binding to scroll event
7771 this.$tableBody.off('scroll').on('scroll', function () {
7772 var scrollLeft = _this16.$tableBody.scrollLeft();
7773
7774 if (_this16.options.showHeader && _this16.options.height) {
7775 _this16.$tableHeader.scrollLeft(scrollLeft);
7776 }
7777
7778 if (_this16.options.showFooter && !_this16.options.cardView) {
7779 _this16.$tableFooter.scrollLeft(scrollLeft);
7780 }
7781
7782 _this16.trigger('scroll-body', _this16.$tableBody);
7783 });
7784 }
7785 }, {
7786 key: "getVisibleFields",
7787 value: function getVisibleFields() {
7788 var visibleFields = [];
7789
7790 var _iterator5 = _createForOfIteratorHelper(this.header.fields),
7791 _step5;
7792
7793 try {
7794 for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
7795 var field = _step5.value;
7796 var column = this.columns[this.fieldsColumnsIndex[field]];
7797
7798 if (!column || !column.visible || this.options.cardView && !column.cardVisible) {
7799 continue;
7800 }
7801
7802 visibleFields.push(field);
7803 }
7804 } catch (err) {
7805 _iterator5.e(err);
7806 } finally {
7807 _iterator5.f();
7808 }
7809
7810 return visibleFields;
7811 }
7812 }, {
7813 key: "initHiddenRows",
7814 value: function initHiddenRows() {
7815 this.hiddenRows = [];
7816 } // PUBLIC FUNCTION DEFINITION
7817 // =======================
7818
7819 }, {
7820 key: "getOptions",
7821 value: function getOptions() {
7822 // deep copy and remove data
7823 var options = $__default["default"].extend({}, this.options);
7824 delete options.data;
7825 return $__default["default"].extend(true, {}, options);
7826 }
7827 }, {
7828 key: "refreshOptions",
7829 value: function refreshOptions(options) {
7830 // If the objects are equivalent then avoid the call of destroy / init methods
7831 if (Utils.compareObjects(this.options, options, true)) {
7832 return;
7833 }
7834
7835 this.options = $__default["default"].extend(this.options, options);
7836 this.trigger('refresh-options', this.options);
7837 this.destroy();
7838 this.init();
7839 }
7840 }, {
7841 key: "getData",
7842 value: function getData(params) {
7843 var _this17 = this;
7844
7845 var data = this.options.data;
7846
7847 if ((this.searchText || this.options.customSearch || this.options.sortName !== undefined || this.enableCustomSort || // Fix #4616: this.enableCustomSort is for extensions
7848 !Utils.isEmptyObject(this.filterColumns) || typeof this.options.filterOptions.filterAlgorithm === 'function' || !Utils.isEmptyObject(this.filterColumnsPartial)) && (!params || !params.unfiltered)) {
7849 data = this.data;
7850 }
7851
7852 if (params && params.useCurrentPage) {
7853 data = data.slice(this.pageFrom - 1, this.pageTo);
7854 }
7855
7856 if (params && !params.includeHiddenRows) {
7857 var hiddenRows = this.getHiddenRows();
7858 data = data.filter(function (row) {
7859 return Utils.findIndex(hiddenRows, row) === -1;
7860 });
7861 }
7862
7863 if (params && params.formatted) {
7864 data.forEach(function (row) {
7865 for (var _i14 = 0, _Object$entries13 = Object.entries(row); _i14 < _Object$entries13.length; _i14++) {
7866 var _Object$entries13$_i = _slicedToArray(_Object$entries13[_i14], 2),
7867 key = _Object$entries13$_i[0],
7868 value = _Object$entries13$_i[1];
7869
7870 var column = _this17.columns[_this17.fieldsColumnsIndex[key]];
7871
7872 if (!column) {
7873 return;
7874 }
7875
7876 row[key] = Utils.calculateObjectValue(column, _this17.header.formatters[column.fieldIndex], [value, row, row.index, column.field], value);
7877 }
7878 });
7879 }
7880
7881 return data;
7882 }
7883 }, {
7884 key: "getSelections",
7885 value: function getSelections() {
7886 var _this18 = this;
7887
7888 return (this.options.maintainMetaData ? this.options.data : this.data).filter(function (row) {
7889 return row[_this18.header.stateField] === true;
7890 });
7891 }
7892 }, {
7893 key: "load",
7894 value: function load(_data) {
7895 var fixedScroll = false;
7896 var data = _data; // #431: support pagination
7897
7898 if (this.options.pagination && this.options.sidePagination === 'server') {
7899 this.options.totalRows = data[this.options.totalField];
7900 this.options.totalNotFiltered = data[this.options.totalNotFilteredField];
7901 this.footerData = data[this.options.footerField] ? [data[this.options.footerField]] : undefined;
7902 }
7903
7904 fixedScroll = data.fixedScroll;
7905 data = Array.isArray(data) ? data : data[this.options.dataField];
7906 this.initData(data);
7907 this.initSearch();
7908 this.initPagination();
7909 this.initBody(fixedScroll);
7910 }
7911 }, {
7912 key: "append",
7913 value: function append(data) {
7914 this.initData(data, 'append');
7915 this.initSearch();
7916 this.initPagination();
7917 this.initSort();
7918 this.initBody(true);
7919 }
7920 }, {
7921 key: "prepend",
7922 value: function prepend(data) {
7923 this.initData(data, 'prepend');
7924 this.initSearch();
7925 this.initPagination();
7926 this.initSort();
7927 this.initBody(true);
7928 }
7929 }, {
7930 key: "remove",
7931 value: function remove(params) {
7932 var removed = 0;
7933
7934 for (var i = this.options.data.length - 1; i >= 0; i--) {
7935 var row = this.options.data[i];
7936
7937 if (!row.hasOwnProperty(params.field) && params.field !== '$index') {
7938 continue;
7939 }
7940
7941 if (!row.hasOwnProperty(params.field) && params.field === '$index' && params.values.includes(i) || params.values.includes(row[params.field])) {
7942 removed++;
7943 this.options.data.splice(i, 1);
7944 }
7945 }
7946
7947 if (!removed) {
7948 return;
7949 }
7950
7951 if (this.options.sidePagination === 'server') {
7952 this.options.totalRows -= removed;
7953 this.data = _toConsumableArray(this.options.data);
7954 }
7955
7956 this.initSearch();
7957 this.initPagination();
7958 this.initSort();
7959 this.initBody(true);
7960 }
7961 }, {
7962 key: "removeAll",
7963 value: function removeAll() {
7964 if (this.options.data.length > 0) {
7965 this.options.data.splice(0, this.options.data.length);
7966 this.initSearch();
7967 this.initPagination();
7968 this.initBody(true);
7969 }
7970 }
7971 }, {
7972 key: "insertRow",
7973 value: function insertRow(params) {
7974 if (!params.hasOwnProperty('index') || !params.hasOwnProperty('row')) {
7975 return;
7976 }
7977
7978 this.options.data.splice(params.index, 0, params.row);
7979 this.initSearch();
7980 this.initPagination();
7981 this.initSort();
7982 this.initBody(true);
7983 }
7984 }, {
7985 key: "updateRow",
7986 value: function updateRow(params) {
7987 var allParams = Array.isArray(params) ? params : [params];
7988
7989 var _iterator6 = _createForOfIteratorHelper(allParams),
7990 _step6;
7991
7992 try {
7993 for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
7994 var _params = _step6.value;
7995
7996 if (!_params.hasOwnProperty('index') || !_params.hasOwnProperty('row')) {
7997 continue;
7998 }
7999
8000 if (_params.hasOwnProperty('replace') && _params.replace) {
8001 this.options.data[_params.index] = _params.row;
8002 } else {
8003 $__default["default"].extend(this.options.data[_params.index], _params.row);
8004 }
8005 }
8006 } catch (err) {
8007 _iterator6.e(err);
8008 } finally {
8009 _iterator6.f();
8010 }
8011
8012 this.initSearch();
8013 this.initPagination();
8014 this.initSort();
8015 this.initBody(true);
8016 }
8017 }, {
8018 key: "getRowByUniqueId",
8019 value: function getRowByUniqueId(_id) {
8020 var uniqueId = this.options.uniqueId;
8021 var len = this.options.data.length;
8022 var id = _id;
8023 var dataRow = null;
8024 var i;
8025 var row;
8026 var rowUniqueId;
8027
8028 for (i = len - 1; i >= 0; i--) {
8029 row = this.options.data[i];
8030
8031 if (row.hasOwnProperty(uniqueId)) {
8032 // uniqueId is a column
8033 rowUniqueId = row[uniqueId];
8034 } else if (row._data && row._data.hasOwnProperty(uniqueId)) {
8035 // uniqueId is a row data property
8036 rowUniqueId = row._data[uniqueId];
8037 } else {
8038 continue;
8039 }
8040
8041 if (typeof rowUniqueId === 'string') {
8042 id = id.toString();
8043 } else if (typeof rowUniqueId === 'number') {
8044 if (Number(rowUniqueId) === rowUniqueId && rowUniqueId % 1 === 0) {
8045 id = parseInt(id, 10);
8046 } else if (rowUniqueId === Number(rowUniqueId) && rowUniqueId !== 0) {
8047 id = parseFloat(id);
8048 }
8049 }
8050
8051 if (rowUniqueId === id) {
8052 dataRow = row;
8053 break;
8054 }
8055 }
8056
8057 return dataRow;
8058 }
8059 }, {
8060 key: "updateByUniqueId",
8061 value: function updateByUniqueId(params) {
8062 var allParams = Array.isArray(params) ? params : [params];
8063 var updatedUid = null;
8064
8065 var _iterator7 = _createForOfIteratorHelper(allParams),
8066 _step7;
8067
8068 try {
8069 for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
8070 var _params2 = _step7.value;
8071
8072 if (!_params2.hasOwnProperty('id') || !_params2.hasOwnProperty('row')) {
8073 continue;
8074 }
8075
8076 var rowId = this.options.data.indexOf(this.getRowByUniqueId(_params2.id));
8077
8078 if (rowId === -1) {
8079 continue;
8080 }
8081
8082 if (_params2.hasOwnProperty('replace') && _params2.replace) {
8083 this.options.data[rowId] = _params2.row;
8084 } else {
8085 $__default["default"].extend(this.options.data[rowId], _params2.row);
8086 }
8087
8088 updatedUid = _params2.id;
8089 }
8090 } catch (err) {
8091 _iterator7.e(err);
8092 } finally {
8093 _iterator7.f();
8094 }
8095
8096 this.initSearch();
8097 this.initPagination();
8098 this.initSort();
8099 this.initBody(true, updatedUid);
8100 }
8101 }, {
8102 key: "removeByUniqueId",
8103 value: function removeByUniqueId(id) {
8104 var len = this.options.data.length;
8105 var row = this.getRowByUniqueId(id);
8106
8107 if (row) {
8108 this.options.data.splice(this.options.data.indexOf(row), 1);
8109 }
8110
8111 if (len === this.options.data.length) {
8112 return;
8113 }
8114
8115 if (this.options.sidePagination === 'server') {
8116 this.options.totalRows -= 1;
8117 this.data = _toConsumableArray(this.options.data);
8118 }
8119
8120 this.initSearch();
8121 this.initPagination();
8122 this.initBody(true);
8123 }
8124 }, {
8125 key: "updateCell",
8126 value: function updateCell(params) {
8127 if (!params.hasOwnProperty('index') || !params.hasOwnProperty('field') || !params.hasOwnProperty('value')) {
8128 return;
8129 }
8130
8131 this.data[params.index][params.field] = params.value;
8132
8133 if (params.reinit === false) {
8134 return;
8135 }
8136
8137 this.initSort();
8138 this.initBody(true);
8139 }
8140 }, {
8141 key: "updateCellByUniqueId",
8142 value: function updateCellByUniqueId(params) {
8143 var _this19 = this;
8144
8145 var allParams = Array.isArray(params) ? params : [params];
8146 allParams.forEach(function (_ref6) {
8147 var id = _ref6.id,
8148 field = _ref6.field,
8149 value = _ref6.value;
8150
8151 var rowId = _this19.options.data.indexOf(_this19.getRowByUniqueId(id));
8152
8153 if (rowId === -1) {
8154 return;
8155 }
8156
8157 _this19.options.data[rowId][field] = value;
8158 });
8159
8160 if (params.reinit === false) {
8161 return;
8162 }
8163
8164 this.initSort();
8165 this.initBody(true);
8166 }
8167 }, {
8168 key: "showRow",
8169 value: function showRow(params) {
8170 this._toggleRow(params, true);
8171 }
8172 }, {
8173 key: "hideRow",
8174 value: function hideRow(params) {
8175 this._toggleRow(params, false);
8176 }
8177 }, {
8178 key: "_toggleRow",
8179 value: function _toggleRow(params, visible) {
8180 var row;
8181
8182 if (params.hasOwnProperty('index')) {
8183 row = this.getData()[params.index];
8184 } else if (params.hasOwnProperty('uniqueId')) {
8185 row = this.getRowByUniqueId(params.uniqueId);
8186 }
8187
8188 if (!row) {
8189 return;
8190 }
8191
8192 var index = Utils.findIndex(this.hiddenRows, row);
8193
8194 if (!visible && index === -1) {
8195 this.hiddenRows.push(row);
8196 } else if (visible && index > -1) {
8197 this.hiddenRows.splice(index, 1);
8198 }
8199
8200 this.initBody(true);
8201 this.initPagination();
8202 }
8203 }, {
8204 key: "getHiddenRows",
8205 value: function getHiddenRows(show) {
8206 if (show) {
8207 this.initHiddenRows();
8208 this.initBody(true);
8209 this.initPagination();
8210 return;
8211 }
8212
8213 var data = this.getData();
8214 var rows = [];
8215
8216 var _iterator8 = _createForOfIteratorHelper(data),
8217 _step8;
8218
8219 try {
8220 for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
8221 var row = _step8.value;
8222
8223 if (this.hiddenRows.includes(row)) {
8224 rows.push(row);
8225 }
8226 }
8227 } catch (err) {
8228 _iterator8.e(err);
8229 } finally {
8230 _iterator8.f();
8231 }
8232
8233 this.hiddenRows = rows;
8234 return rows;
8235 }
8236 }, {
8237 key: "showColumn",
8238 value: function showColumn(field) {
8239 var _this20 = this;
8240
8241 var fields = Array.isArray(field) ? field : [field];
8242 fields.forEach(function (field) {
8243 _this20._toggleColumn(_this20.fieldsColumnsIndex[field], true, true);
8244 });
8245 }
8246 }, {
8247 key: "hideColumn",
8248 value: function hideColumn(field) {
8249 var _this21 = this;
8250
8251 var fields = Array.isArray(field) ? field : [field];
8252 fields.forEach(function (field) {
8253 _this21._toggleColumn(_this21.fieldsColumnsIndex[field], false, true);
8254 });
8255 }
8256 }, {
8257 key: "_toggleColumn",
8258 value: function _toggleColumn(index, checked, needUpdate) {
8259 if (index === -1 || this.columns[index].visible === checked) {
8260 return;
8261 }
8262
8263 this.columns[index].visible = checked;
8264 this.initHeader();
8265 this.initSearch();
8266 this.initPagination();
8267 this.initBody();
8268
8269 if (this.options.showColumns) {
8270 var $items = this.$toolbar.find('.keep-open input:not(".toggle-all")').prop('disabled', false);
8271
8272 if (needUpdate) {
8273 $items.filter(Utils.sprintf('[value="%s"]', index)).prop('checked', checked);
8274 }
8275
8276 if ($items.filter(':checked').length <= this.options.minimumCountColumns) {
8277 $items.filter(':checked').prop('disabled', true);
8278 }
8279 }
8280 }
8281 }, {
8282 key: "getVisibleColumns",
8283 value: function getVisibleColumns() {
8284 var _this22 = this;
8285
8286 return this.columns.filter(function (column) {
8287 return column.visible && !_this22.isSelectionColumn(column);
8288 });
8289 }
8290 }, {
8291 key: "getHiddenColumns",
8292 value: function getHiddenColumns() {
8293 return this.columns.filter(function (_ref7) {
8294 var visible = _ref7.visible;
8295 return !visible;
8296 });
8297 }
8298 }, {
8299 key: "isSelectionColumn",
8300 value: function isSelectionColumn(column) {
8301 return column.radio || column.checkbox;
8302 }
8303 }, {
8304 key: "showAllColumns",
8305 value: function showAllColumns() {
8306 this._toggleAllColumns(true);
8307 }
8308 }, {
8309 key: "hideAllColumns",
8310 value: function hideAllColumns() {
8311 this._toggleAllColumns(false);
8312 }
8313 }, {
8314 key: "_toggleAllColumns",
8315 value: function _toggleAllColumns(visible) {
8316 var _this23 = this;
8317
8318 var _iterator9 = _createForOfIteratorHelper(this.columns.slice().reverse()),
8319 _step9;
8320
8321 try {
8322 for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
8323 var column = _step9.value;
8324
8325 if (column.switchable) {
8326 if (!visible && this.options.showColumns && this.getVisibleColumns().filter(function (it) {
8327 return it.switchable;
8328 }).length === this.options.minimumCountColumns) {
8329 continue;
8330 }
8331
8332 column.visible = visible;
8333 }
8334 }
8335 } catch (err) {
8336 _iterator9.e(err);
8337 } finally {
8338 _iterator9.f();
8339 }
8340
8341 this.initHeader();
8342 this.initSearch();
8343 this.initPagination();
8344 this.initBody();
8345
8346 if (this.options.showColumns) {
8347 var $items = this.$toolbar.find('.keep-open input[type="checkbox"]:not(".toggle-all")').prop('disabled', false);
8348
8349 if (visible) {
8350 $items.prop('checked', visible);
8351 } else {
8352 $items.get().reverse().forEach(function (item) {
8353 if ($items.filter(':checked').length > _this23.options.minimumCountColumns) {
8354 $__default["default"](item).prop('checked', visible);
8355 }
8356 });
8357 }
8358
8359 if ($items.filter(':checked').length <= this.options.minimumCountColumns) {
8360 $items.filter(':checked').prop('disabled', true);
8361 }
8362 }
8363 }
8364 }, {
8365 key: "mergeCells",
8366 value: function mergeCells(options) {
8367 var row = options.index;
8368 var col = this.getVisibleFields().indexOf(options.field);
8369 var rowspan = options.rowspan || 1;
8370 var colspan = options.colspan || 1;
8371 var i;
8372 var j;
8373 var $tr = this.$body.find('>tr[data-index]');
8374 col += Utils.getDetailViewIndexOffset(this.options);
8375 var $td = $tr.eq(row).find('>td').eq(col);
8376
8377 if (row < 0 || col < 0 || row >= this.data.length) {
8378 return;
8379 }
8380
8381 for (i = row; i < row + rowspan; i++) {
8382 for (j = col; j < col + colspan; j++) {
8383 $tr.eq(i).find('>td').eq(j).hide();
8384 }
8385 }
8386
8387 $td.attr('rowspan', rowspan).attr('colspan', colspan).show();
8388 }
8389 }, {
8390 key: "checkAll",
8391 value: function checkAll() {
8392 this._toggleCheckAll(true);
8393 }
8394 }, {
8395 key: "uncheckAll",
8396 value: function uncheckAll() {
8397 this._toggleCheckAll(false);
8398 }
8399 }, {
8400 key: "_toggleCheckAll",
8401 value: function _toggleCheckAll(checked) {
8402 var rowsBefore = this.getSelections();
8403 this.$selectAll.add(this.$selectAll_).prop('checked', checked);
8404 this.$selectItem.filter(':enabled').prop('checked', checked);
8405 this.updateRows();
8406 this.updateSelected();
8407 var rowsAfter = this.getSelections();
8408
8409 if (checked) {
8410 this.trigger('check-all', rowsAfter, rowsBefore);
8411 return;
8412 }
8413
8414 this.trigger('uncheck-all', rowsAfter, rowsBefore);
8415 }
8416 }, {
8417 key: "checkInvert",
8418 value: function checkInvert() {
8419 var $items = this.$selectItem.filter(':enabled');
8420 var checked = $items.filter(':checked');
8421 $items.each(function (i, el) {
8422 $__default["default"](el).prop('checked', !$__default["default"](el).prop('checked'));
8423 });
8424 this.updateRows();
8425 this.updateSelected();
8426 this.trigger('uncheck-some', checked);
8427 checked = this.getSelections();
8428 this.trigger('check-some', checked);
8429 }
8430 }, {
8431 key: "check",
8432 value: function check(index) {
8433 this._toggleCheck(true, index);
8434 }
8435 }, {
8436 key: "uncheck",
8437 value: function uncheck(index) {
8438 this._toggleCheck(false, index);
8439 }
8440 }, {
8441 key: "_toggleCheck",
8442 value: function _toggleCheck(checked, index) {
8443 var $el = this.$selectItem.filter("[data-index=\"".concat(index, "\"]"));
8444 var row = this.data[index];
8445
8446 if ($el.is(':radio') || this.options.singleSelect || this.options.multipleSelectRow && !this.multipleSelectRowCtrlKey && !this.multipleSelectRowShiftKey) {
8447 var _iterator10 = _createForOfIteratorHelper(this.options.data),
8448 _step10;
8449
8450 try {
8451 for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
8452 var r = _step10.value;
8453 r[this.header.stateField] = false;
8454 }
8455 } catch (err) {
8456 _iterator10.e(err);
8457 } finally {
8458 _iterator10.f();
8459 }
8460
8461 this.$selectItem.filter(':checked').not($el).prop('checked', false);
8462 }
8463
8464 row[this.header.stateField] = checked;
8465
8466 if (this.options.multipleSelectRow) {
8467 if (this.multipleSelectRowShiftKey && this.multipleSelectRowLastSelectedIndex >= 0) {
8468 var _ref8 = this.multipleSelectRowLastSelectedIndex < index ? [this.multipleSelectRowLastSelectedIndex, index] : [index, this.multipleSelectRowLastSelectedIndex],
8469 _ref9 = _slicedToArray(_ref8, 2),
8470 fromIndex = _ref9[0],
8471 toIndex = _ref9[1];
8472
8473 for (var i = fromIndex + 1; i < toIndex; i++) {
8474 this.data[i][this.header.stateField] = true;
8475 this.$selectItem.filter("[data-index=\"".concat(i, "\"]")).prop('checked', true);
8476 }
8477 }
8478
8479 this.multipleSelectRowCtrlKey = false;
8480 this.multipleSelectRowShiftKey = false;
8481 this.multipleSelectRowLastSelectedIndex = checked ? index : -1;
8482 }
8483
8484 $el.prop('checked', checked);
8485 this.updateSelected();
8486 this.trigger(checked ? 'check' : 'uncheck', this.data[index], $el);
8487 }
8488 }, {
8489 key: "checkBy",
8490 value: function checkBy(obj) {
8491 this._toggleCheckBy(true, obj);
8492 }
8493 }, {
8494 key: "uncheckBy",
8495 value: function uncheckBy(obj) {
8496 this._toggleCheckBy(false, obj);
8497 }
8498 }, {
8499 key: "_toggleCheckBy",
8500 value: function _toggleCheckBy(checked, obj) {
8501 var _this24 = this;
8502
8503 if (!obj.hasOwnProperty('field') || !obj.hasOwnProperty('values')) {
8504 return;
8505 }
8506
8507 var rows = [];
8508 this.data.forEach(function (row, i) {
8509 if (!row.hasOwnProperty(obj.field)) {
8510 return false;
8511 }
8512
8513 if (obj.values.includes(row[obj.field])) {
8514 var $el = _this24.$selectItem.filter(':enabled').filter(Utils.sprintf('[data-index="%s"]', i));
8515
8516 var onlyCurrentPage = obj.hasOwnProperty('onlyCurrentPage') ? obj.onlyCurrentPage : false;
8517 $el = checked ? $el.not(':checked') : $el.filter(':checked');
8518
8519 if (!$el.length && onlyCurrentPage) {
8520 return;
8521 }
8522
8523 $el.prop('checked', checked);
8524 row[_this24.header.stateField] = checked;
8525 rows.push(row);
8526
8527 _this24.trigger(checked ? 'check' : 'uncheck', row, $el);
8528 }
8529 });
8530 this.updateSelected();
8531 this.trigger(checked ? 'check-some' : 'uncheck-some', rows);
8532 }
8533 }, {
8534 key: "refresh",
8535 value: function refresh(params) {
8536 if (params && params.url) {
8537 this.options.url = params.url;
8538 }
8539
8540 if (params && params.pageNumber) {
8541 this.options.pageNumber = params.pageNumber;
8542 }
8543
8544 if (params && params.pageSize) {
8545 this.options.pageSize = params.pageSize;
8546 }
8547
8548 this.trigger('refresh', this.initServer(params && params.silent, params && params.query, params && params.url));
8549 }
8550 }, {
8551 key: "destroy",
8552 value: function destroy() {
8553 this.$el.insertBefore(this.$container);
8554 $__default["default"](this.options.toolbar).insertBefore(this.$el);
8555 this.$container.next().remove();
8556 this.$container.remove();
8557 this.$el.html(this.$el_.html()).css('margin-top', '0').attr('class', this.$el_.attr('class') || ''); // reset the class
8558
8559 var resizeEvent = Utils.getEventName('resize.bootstrap-table', this.$el.attr('id'));
8560 $__default["default"](window).off(resizeEvent);
8561 }
8562 }, {
8563 key: "resetView",
8564 value: function resetView(params) {
8565 var padding = 0;
8566
8567 if (params && params.height) {
8568 this.options.height = params.height;
8569 }
8570
8571 this.$tableContainer.toggleClass('has-card-view', this.options.cardView);
8572
8573 if (this.options.height) {
8574 var fixedBody = this.$tableBody.get(0);
8575 this.hasScrollBar = fixedBody.scrollWidth > fixedBody.clientWidth;
8576 }
8577
8578 if (!this.options.cardView && this.options.showHeader && this.options.height) {
8579 this.$tableHeader.show();
8580 this.resetHeader();
8581 padding += this.$header.outerHeight(true) + 1;
8582 } else {
8583 this.$tableHeader.hide();
8584 this.trigger('post-header');
8585 }
8586
8587 if (!this.options.cardView && this.options.showFooter) {
8588 this.$tableFooter.show();
8589 this.fitFooter();
8590
8591 if (this.options.height) {
8592 padding += this.$tableFooter.outerHeight(true);
8593 }
8594 }
8595
8596 if (this.$container.hasClass('fullscreen')) {
8597 this.$tableContainer.css('height', '');
8598 this.$tableContainer.css('width', '');
8599 } else if (this.options.height) {
8600 if (this.$tableBorder) {
8601 this.$tableBorder.css('width', '');
8602 this.$tableBorder.css('height', '');
8603 }
8604
8605 var toolbarHeight = this.$toolbar.outerHeight(true);
8606 var paginationHeight = this.$pagination.outerHeight(true);
8607 var height = this.options.height - toolbarHeight - paginationHeight;
8608 var $bodyTable = this.$tableBody.find('>table');
8609 var tableHeight = $bodyTable.outerHeight();
8610 this.$tableContainer.css('height', "".concat(height, "px"));
8611
8612 if (this.$tableBorder && $bodyTable.is(':visible')) {
8613 var tableBorderHeight = height - tableHeight - 2;
8614
8615 if (this.hasScrollBar) {
8616 tableBorderHeight -= Utils.getScrollBarWidth();
8617 }
8618
8619 this.$tableBorder.css('width', "".concat($bodyTable.outerWidth(), "px"));
8620 this.$tableBorder.css('height', "".concat(tableBorderHeight, "px"));
8621 }
8622 }
8623
8624 if (this.options.cardView) {
8625 // remove the element css
8626 this.$el.css('margin-top', '0');
8627 this.$tableContainer.css('padding-bottom', '0');
8628 this.$tableFooter.hide();
8629 } else {
8630 // Assign the correct sortable arrow
8631 this.getCaret();
8632 this.$tableContainer.css('padding-bottom', "".concat(padding, "px"));
8633 }
8634
8635 this.trigger('reset-view');
8636 }
8637 }, {
8638 key: "showLoading",
8639 value: function showLoading() {
8640 this.$tableLoading.toggleClass('open', true);
8641 var fontSize = this.options.loadingFontSize;
8642
8643 if (this.options.loadingFontSize === 'auto') {
8644 fontSize = this.$tableLoading.width() * 0.04;
8645 fontSize = Math.max(12, fontSize);
8646 fontSize = Math.min(32, fontSize);
8647 fontSize = "".concat(fontSize, "px");
8648 }
8649
8650 this.$tableLoading.find('.loading-text').css('font-size', fontSize);
8651 }
8652 }, {
8653 key: "hideLoading",
8654 value: function hideLoading() {
8655 this.$tableLoading.toggleClass('open', false);
8656 }
8657 }, {
8658 key: "togglePagination",
8659 value: function togglePagination() {
8660 this.options.pagination = !this.options.pagination;
8661 var icon = this.options.showButtonIcons ? this.options.pagination ? this.options.icons.paginationSwitchDown : this.options.icons.paginationSwitchUp : '';
8662 var text = this.options.showButtonText ? this.options.pagination ? this.options.formatPaginationSwitchUp() : this.options.formatPaginationSwitchDown() : '';
8663 this.$toolbar.find('button[name="paginationSwitch"]').html("".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon), " ").concat(text));
8664 this.updatePagination();
8665 this.trigger('toggle-pagination', this.options.pagination);
8666 }
8667 }, {
8668 key: "toggleFullscreen",
8669 value: function toggleFullscreen() {
8670 this.$el.closest('.bootstrap-table').toggleClass('fullscreen');
8671 this.resetView();
8672 }
8673 }, {
8674 key: "toggleView",
8675 value: function toggleView() {
8676 this.options.cardView = !this.options.cardView;
8677 this.initHeader();
8678 var icon = this.options.showButtonIcons ? this.options.cardView ? this.options.icons.toggleOn : this.options.icons.toggleOff : '';
8679 var text = this.options.showButtonText ? this.options.cardView ? this.options.formatToggleOff() : this.options.formatToggleOn() : '';
8680 this.$toolbar.find('button[name="toggle"]').html("".concat(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, icon), " ").concat(text));
8681 this.initBody();
8682 this.trigger('toggle', this.options.cardView);
8683 }
8684 }, {
8685 key: "resetSearch",
8686 value: function resetSearch(text) {
8687 var $search = Utils.getSearchInput(this);
8688 var textToUse = text || '';
8689 $search.val(textToUse);
8690 this.searchText = textToUse;
8691 this.onSearch({
8692 currentTarget: $search
8693 }, false);
8694 }
8695 }, {
8696 key: "filterBy",
8697 value: function filterBy(columns, options) {
8698 this.filterOptions = Utils.isEmptyObject(options) ? this.options.filterOptions : $__default["default"].extend(this.options.filterOptions, options);
8699 this.filterColumns = Utils.isEmptyObject(columns) ? {} : columns;
8700 this.options.pageNumber = 1;
8701 this.initSearch();
8702 this.updatePagination();
8703 }
8704 }, {
8705 key: "scrollTo",
8706 value: function scrollTo(params) {
8707 var options = {
8708 unit: 'px',
8709 value: 0
8710 };
8711
8712 if (_typeof(params) === 'object') {
8713 options = Object.assign(options, params);
8714 } else if (typeof params === 'string' && params === 'bottom') {
8715 options.value = this.$tableBody[0].scrollHeight;
8716 } else if (typeof params === 'string' || typeof params === 'number') {
8717 options.value = params;
8718 }
8719
8720 var scrollTo = options.value;
8721
8722 if (options.unit === 'rows') {
8723 scrollTo = 0;
8724 this.$body.find("> tr:lt(".concat(options.value, ")")).each(function (i, el) {
8725 scrollTo += $__default["default"](el).outerHeight(true);
8726 });
8727 }
8728
8729 this.$tableBody.scrollTop(scrollTo);
8730 }
8731 }, {
8732 key: "getScrollPosition",
8733 value: function getScrollPosition() {
8734 return this.$tableBody.scrollTop();
8735 }
8736 }, {
8737 key: "selectPage",
8738 value: function selectPage(page) {
8739 if (page > 0 && page <= this.options.totalPages) {
8740 this.options.pageNumber = page;
8741 this.updatePagination();
8742 }
8743 }
8744 }, {
8745 key: "prevPage",
8746 value: function prevPage() {
8747 if (this.options.pageNumber > 1) {
8748 this.options.pageNumber--;
8749 this.updatePagination();
8750 }
8751 }
8752 }, {
8753 key: "nextPage",
8754 value: function nextPage() {
8755 if (this.options.pageNumber < this.options.totalPages) {
8756 this.options.pageNumber++;
8757 this.updatePagination();
8758 }
8759 }
8760 }, {
8761 key: "toggleDetailView",
8762 value: function toggleDetailView(index, _columnDetailFormatter) {
8763 var $tr = this.$body.find(Utils.sprintf('> tr[data-index="%s"]', index));
8764
8765 if ($tr.next().is('tr.detail-view')) {
8766 this.collapseRow(index);
8767 } else {
8768 this.expandRow(index, _columnDetailFormatter);
8769 }
8770
8771 this.resetView();
8772 }
8773 }, {
8774 key: "expandRow",
8775 value: function expandRow(index, _columnDetailFormatter) {
8776 var row = this.data[index];
8777 var $tr = this.$body.find(Utils.sprintf('> tr[data-index="%s"][data-has-detail-view]', index));
8778
8779 if (this.options.detailViewIcon) {
8780 $tr.find('a.detail-icon').html(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailClose));
8781 }
8782
8783 if ($tr.next().is('tr.detail-view')) {
8784 return;
8785 }
8786
8787 $tr.after(Utils.sprintf('<tr class="detail-view"><td colspan="%s"></td></tr>', $tr.children('td').length));
8788 var $element = $tr.next().find('td');
8789 var detailFormatter = _columnDetailFormatter || this.options.detailFormatter;
8790 var content = Utils.calculateObjectValue(this.options, detailFormatter, [index, row, $element], '');
8791
8792 if ($element.length === 1) {
8793 $element.append(content);
8794 }
8795
8796 this.trigger('expand-row', index, row, $element);
8797 }
8798 }, {
8799 key: "expandRowByUniqueId",
8800 value: function expandRowByUniqueId(uniqueId) {
8801 var row = this.getRowByUniqueId(uniqueId);
8802
8803 if (!row) {
8804 return;
8805 }
8806
8807 this.expandRow(this.data.indexOf(row));
8808 }
8809 }, {
8810 key: "collapseRow",
8811 value: function collapseRow(index) {
8812 var row = this.data[index];
8813 var $tr = this.$body.find(Utils.sprintf('> tr[data-index="%s"][data-has-detail-view]', index));
8814
8815 if (!$tr.next().is('tr.detail-view')) {
8816 return;
8817 }
8818
8819 if (this.options.detailViewIcon) {
8820 $tr.find('a.detail-icon').html(Utils.sprintf(this.constants.html.icon, this.options.iconsPrefix, this.options.icons.detailOpen));
8821 }
8822
8823 this.trigger('collapse-row', index, row, $tr.next());
8824 $tr.next().remove();
8825 }
8826 }, {
8827 key: "collapseRowByUniqueId",
8828 value: function collapseRowByUniqueId(uniqueId) {
8829 var row = this.getRowByUniqueId(uniqueId);
8830
8831 if (!row) {
8832 return;
8833 }
8834
8835 this.collapseRow(this.data.indexOf(row));
8836 }
8837 }, {
8838 key: "expandAllRows",
8839 value: function expandAllRows() {
8840 var trs = this.$body.find('> tr[data-index][data-has-detail-view]');
8841
8842 for (var i = 0; i < trs.length; i++) {
8843 this.expandRow($__default["default"](trs[i]).data('index'));
8844 }
8845 }
8846 }, {
8847 key: "collapseAllRows",
8848 value: function collapseAllRows() {
8849 var trs = this.$body.find('> tr[data-index][data-has-detail-view]');
8850
8851 for (var i = 0; i < trs.length; i++) {
8852 this.collapseRow($__default["default"](trs[i]).data('index'));
8853 }
8854 }
8855 }, {
8856 key: "updateColumnTitle",
8857 value: function updateColumnTitle(params) {
8858 if (!params.hasOwnProperty('field') || !params.hasOwnProperty('title')) {
8859 return;
8860 }
8861
8862 this.columns[this.fieldsColumnsIndex[params.field]].title = this.options.escape ? Utils.escapeHTML(params.title) : params.title;
8863
8864 if (this.columns[this.fieldsColumnsIndex[params.field]].visible) {
8865 this.$header.find('th[data-field]').each(function (i, el) {
8866 if ($__default["default"](el).data('field') === params.field) {
8867 $__default["default"]($__default["default"](el).find('.th-inner')[0]).text(params.title);
8868 return false;
8869 }
8870 });
8871 this.resetView();
8872 }
8873 }
8874 }, {
8875 key: "updateFormatText",
8876 value: function updateFormatText(formatName, text) {
8877 if (!/^format/.test(formatName) || !this.options[formatName]) {
8878 return;
8879 }
8880
8881 if (typeof text === 'string') {
8882 this.options[formatName] = function () {
8883 return text;
8884 };
8885 } else if (typeof text === 'function') {
8886 this.options[formatName] = text;
8887 }
8888
8889 this.initToolbar();
8890 this.initPagination();
8891 this.initBody();
8892 }
8893 }]);
8894
8895 return BootstrapTable;
8896 }();
8897
8898 BootstrapTable.VERSION = Constants.VERSION;
8899 BootstrapTable.DEFAULTS = Constants.DEFAULTS;
8900 BootstrapTable.LOCALES = Constants.LOCALES;
8901 BootstrapTable.COLUMN_DEFAULTS = Constants.COLUMN_DEFAULTS;
8902 BootstrapTable.METHODS = Constants.METHODS;
8903 BootstrapTable.EVENTS = Constants.EVENTS; // BOOTSTRAP TABLE PLUGIN DEFINITION
8904 // =======================
8905
8906 $__default["default"].BootstrapTable = BootstrapTable;
8907
8908 $__default["default"].fn.bootstrapTable = function (option) {
8909 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key5 = 1; _key5 < _len2; _key5++) {
8910 args[_key5 - 1] = arguments[_key5];
8911 }
8912
8913 var value;
8914 this.each(function (i, el) {
8915 var data = $__default["default"](el).data('bootstrap.table');
8916 var options = $__default["default"].extend({}, BootstrapTable.DEFAULTS, $__default["default"](el).data(), _typeof(option) === 'object' && option);
8917
8918 if (typeof option === 'string') {
8919 var _data2;
8920
8921 if (!Constants.METHODS.includes(option)) {
8922 throw new Error("Unknown method: ".concat(option));
8923 }
8924
8925 if (!data) {
8926 return;
8927 }
8928
8929 value = (_data2 = data)[option].apply(_data2, args);
8930
8931 if (option === 'destroy') {
8932 $__default["default"](el).removeData('bootstrap.table');
8933 }
8934 }
8935
8936 if (!data) {
8937 data = new $__default["default"].BootstrapTable(el, options);
8938 $__default["default"](el).data('bootstrap.table', data);
8939 data.init();
8940 }
8941 });
8942 return typeof value === 'undefined' ? this : value;
8943 };
8944
8945 $__default["default"].fn.bootstrapTable.Constructor = BootstrapTable;
8946 $__default["default"].fn.bootstrapTable.theme = Constants.THEME;
8947 $__default["default"].fn.bootstrapTable.VERSION = Constants.VERSION;
8948 $__default["default"].fn.bootstrapTable.defaults = BootstrapTable.DEFAULTS;
8949 $__default["default"].fn.bootstrapTable.columnDefaults = BootstrapTable.COLUMN_DEFAULTS;
8950 $__default["default"].fn.bootstrapTable.events = BootstrapTable.EVENTS;
8951 $__default["default"].fn.bootstrapTable.locales = BootstrapTable.LOCALES;
8952 $__default["default"].fn.bootstrapTable.methods = BootstrapTable.METHODS;
8953 $__default["default"].fn.bootstrapTable.utils = Utils; // BOOTSTRAP TABLE INIT
8954 // =======================
8955
8956 $__default["default"](function () {
8957 $__default["default"]('[data-toggle="table"]').bootstrapTable();
8958 });
8959
8960 return BootstrapTable;
8961
8962}));