UNPKG

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