jquery.dgtable 2.0.36 → 2.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib.umd.js CHANGED
@@ -4,6 +4,14 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.DGTableJQuery = factory(global.jQuery));
5
5
  })(this, (function (jQuery) { 'use strict';
6
6
 
7
+ function _arrayLikeToArray(r, a) {
8
+ (null == a || a > r.length) && (a = r.length);
9
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
10
+ return n;
11
+ }
12
+ function _arrayWithHoles(r) {
13
+ if (Array.isArray(r)) return r;
14
+ }
7
15
  function _defineProperty(e, r, t) {
8
16
  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
9
17
  value: t,
@@ -12,6 +20,36 @@
12
20
  writable: true
13
21
  }) : e[r] = t, e;
14
22
  }
23
+ function _iterableToArrayLimit(r, l) {
24
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
25
+ if (null != t) {
26
+ var e,
27
+ n,
28
+ i,
29
+ u,
30
+ a = [],
31
+ f = true,
32
+ o = false;
33
+ try {
34
+ if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
35
+ } catch (r) {
36
+ o = true, n = r;
37
+ } finally {
38
+ try {
39
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
40
+ } finally {
41
+ if (o) throw n;
42
+ }
43
+ }
44
+ return a;
45
+ }
46
+ }
47
+ function _nonIterableRest() {
48
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
49
+ }
50
+ function _slicedToArray(r, e) {
51
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
52
+ }
15
53
  function _toPrimitive(t, r) {
16
54
  if ("object" != typeof t || !t) return t;
17
55
  var e = t[Symbol.toPrimitive];
@@ -26,6 +64,13 @@
26
64
  var i = _toPrimitive(t, "string");
27
65
  return "symbol" == typeof i ? i : i + "";
28
66
  }
67
+ function _unsupportedIterableToArray(r, a) {
68
+ if (r) {
69
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
70
+ var t = {}.toString.call(r).slice(8, -1);
71
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
72
+ }
73
+ }
29
74
 
30
75
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
31
76
 
@@ -99,7 +144,7 @@
99
144
 
100
145
  functionBindNative = !fails(function () {
101
146
  // eslint-disable-next-line es/no-function-prototype-bind -- safe
102
- var test = (function () { /* empty */ }).bind();
147
+ var test = function () { /* empty */ }.bind();
103
148
  // eslint-disable-next-line no-prototype-builtins -- safe
104
149
  return typeof test != 'function' || test.hasOwnProperty('prototype');
105
150
  });
@@ -578,10 +623,10 @@
578
623
  var store = sharedStore.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
579
624
 
580
625
  (store.versions || (store.versions = [])).push({
581
- version: '3.48.0',
626
+ version: '3.50.0',
582
627
  mode: IS_PURE ? 'pure' : 'global',
583
628
  copyright: '© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.',
584
- license: 'https://github.com/zloirock/core-js/blob/v3.48.0/LICENSE',
629
+ license: 'https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE',
585
630
  source: 'https://github.com/zloirock/core-js'
586
631
  });
587
632
  return sharedStore.exports;
@@ -594,9 +639,11 @@
594
639
  if (hasRequiredShared) return shared;
595
640
  hasRequiredShared = 1;
596
641
  var store = requireSharedStore();
642
+ // eslint-disable-next-line es/no-object-create -- safe
643
+ var create = Object.create || Object;
597
644
 
598
645
  shared = function (key, value) {
599
- return store[key] || (store[key] = value || {});
646
+ return store[key] || (store[key] = value || create(null));
600
647
  };
601
648
  return shared;
602
649
  }
@@ -934,7 +981,7 @@
934
981
 
935
982
  var EXISTS = hasOwn(FunctionPrototype, 'name');
936
983
  // additional protection from minified / mangled / dropped function names
937
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
984
+ var PROPER = EXISTS && function something() { /* empty */ }.name === 'something';
938
985
  var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
939
986
 
940
987
  functionName = {
@@ -1642,6 +1689,7 @@
1642
1689
  var $ = require_export();
1643
1690
  var DESCRIPTORS = requireDescriptors();
1644
1691
  var globalThis = requireGlobalThis();
1692
+ var call = requireFunctionCall();
1645
1693
  var uncurryThis = requireFunctionUncurryThis();
1646
1694
  var hasOwn = requireHasOwnProperty();
1647
1695
  var isCallable = requireIsCallable();
@@ -1671,6 +1719,14 @@
1671
1719
  };
1672
1720
 
1673
1721
  copyConstructorProperties(SymbolWrapper, NativeSymbol);
1722
+ // wrap Symbol.for for correct handling of empty string descriptions
1723
+ var nativeFor = SymbolWrapper['for'];
1724
+ SymbolWrapper['for'] = { 'for': function (key) {
1725
+ var stringKey = toString(key);
1726
+ var symbol = call(nativeFor, this, stringKey);
1727
+ if (stringKey === '') EmptyStringDescriptionStore[symbol] = true;
1728
+ return symbol;
1729
+ } }['for'];
1674
1730
  SymbolWrapper.prototype = SymbolPrototype;
1675
1731
  SymbolPrototype.constructor = SymbolWrapper;
1676
1732
 
@@ -1916,7 +1972,9 @@
1916
1972
  if (y === undefined) return -1;
1917
1973
  if (x === undefined) return 1;
1918
1974
  if (comparefn !== undefined) return +comparefn(x, y) || 0;
1919
- return toString(x) > toString(y) ? 1 : -1;
1975
+ var xString = toString(x);
1976
+ var yString = toString(y);
1977
+ return xString === yString ? 0 : xString > yString ? 1 : -1;
1920
1978
  };
1921
1979
  };
1922
1980
 
@@ -2255,18 +2313,29 @@
2255
2313
 
2256
2314
  var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
2257
2315
 
2316
+ var setGroups = function (re, groups) {
2317
+ var object = re.groups = create(null);
2318
+ for (var i = 0; i < groups.length; i++) {
2319
+ var group = groups[i];
2320
+ object[group[0]] = re[group[1]];
2321
+ }
2322
+ };
2323
+
2258
2324
  if (PATCH) {
2259
2325
  patchedExec = function exec(string) {
2260
2326
  var re = this;
2261
2327
  var state = getInternalState(re);
2262
2328
  var str = toString(string);
2263
2329
  var raw = state.raw;
2264
- var result, reCopy, lastIndex, match, i, object, group;
2330
+ var result, reCopy, lastIndex;
2265
2331
 
2266
2332
  if (raw) {
2267
2333
  raw.lastIndex = re.lastIndex;
2268
2334
  result = call(patchedExec, raw, str);
2269
2335
  re.lastIndex = raw.lastIndex;
2336
+
2337
+ if (result && state.groups) setGroups(result, state.groups);
2338
+
2270
2339
  return result;
2271
2340
  }
2272
2341
 
@@ -2285,8 +2354,10 @@
2285
2354
 
2286
2355
  strCopy = stringSlice(str, re.lastIndex);
2287
2356
  // Support anchored sticky behavior.
2288
- if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) {
2289
- source = '(?: ' + source + ')';
2357
+ var prevChar = re.lastIndex > 0 && charAt(str, re.lastIndex - 1);
2358
+ if (re.lastIndex > 0 &&
2359
+ (!re.multiline || re.multiline && prevChar !== '\n' && prevChar !== '\r' && prevChar !== '\u2028' && prevChar !== '\u2029')) {
2360
+ source = '(?: (?:' + source + '))';
2290
2361
  strCopy = ' ' + strCopy;
2291
2362
  charsAdded++;
2292
2363
  }
@@ -2300,11 +2371,11 @@
2300
2371
  }
2301
2372
  if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
2302
2373
 
2303
- match = call(nativeExec, sticky ? reCopy : re, strCopy);
2374
+ var match = call(nativeExec, sticky ? reCopy : re, strCopy);
2304
2375
 
2305
2376
  if (sticky) {
2306
2377
  if (match) {
2307
- match.input = stringSlice(match.input, charsAdded);
2378
+ match.input = str;
2308
2379
  match[0] = stringSlice(match[0], charsAdded);
2309
2380
  match.index = re.lastIndex;
2310
2381
  re.lastIndex += match[0].length;
@@ -2316,19 +2387,13 @@
2316
2387
  // Fix browsers whose `exec` methods don't consistently return `undefined`
2317
2388
  // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
2318
2389
  call(nativeReplace, match[0], reCopy, function () {
2319
- for (i = 1; i < arguments.length - 2; i++) {
2390
+ for (var i = 1; i < arguments.length - 2; i++) {
2320
2391
  if (arguments[i] === undefined) match[i] = undefined;
2321
2392
  }
2322
2393
  });
2323
2394
  }
2324
2395
 
2325
- if (match && groups) {
2326
- match.groups = object = create(null);
2327
- for (i = 0; i < groups.length; i++) {
2328
- group = groups[i];
2329
- object[group[0]] = match[group[1]];
2330
- }
2331
- }
2396
+ if (match && groups) setGroups(match, groups);
2332
2397
 
2333
2398
  return match;
2334
2399
  };
@@ -2519,7 +2584,7 @@
2519
2584
  // `AdvanceStringIndex` abstract operation
2520
2585
  // https://tc39.es/ecma262/#sec-advancestringindex
2521
2586
  advanceStringIndex = function (S, index, unicode) {
2522
- return index + (unicode ? charAt(S, index).length : 1);
2587
+ return index + (unicode ? charAt(S, index).length || 1 : 1);
2523
2588
  };
2524
2589
  return advanceStringIndex;
2525
2590
  }
@@ -2768,23 +2833,24 @@
2768
2833
  var rx = anObject(this);
2769
2834
  var S = toString(string);
2770
2835
 
2836
+ var functionalReplace = isCallable(replaceValue);
2837
+ if (!functionalReplace) replaceValue = toString(replaceValue);
2838
+ var flags = toString(getRegExpFlags(rx));
2839
+
2771
2840
  if (
2772
2841
  typeof replaceValue == 'string' &&
2773
- stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
2774
- stringIndexOf(replaceValue, '$<') === -1
2842
+ !~stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) &&
2843
+ !~stringIndexOf(replaceValue, '$<') &&
2844
+ !~stringIndexOf(flags, 'y')
2775
2845
  ) {
2776
2846
  var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
2777
2847
  if (res.done) return res.value;
2778
2848
  }
2779
2849
 
2780
- var functionalReplace = isCallable(replaceValue);
2781
- if (!functionalReplace) replaceValue = toString(replaceValue);
2782
-
2783
- var flags = toString(getRegExpFlags(rx));
2784
- var global = stringIndexOf(flags, 'g') !== -1;
2850
+ var global = !!~stringIndexOf(flags, 'g');
2785
2851
  var fullUnicode;
2786
2852
  if (global) {
2787
- fullUnicode = stringIndexOf(flags, 'u') !== -1;
2853
+ fullUnicode = !!~stringIndexOf(flags, 'u') || !!~stringIndexOf(flags, 'v');
2788
2854
  rx.lastIndex = 0;
2789
2855
  }
2790
2856
 
@@ -3034,7 +3100,7 @@
3034
3100
  function requireIterators () {
3035
3101
  if (hasRequiredIterators) return iterators;
3036
3102
  hasRequiredIterators = 1;
3037
- iterators = {};
3103
+ iterators = Object.create ? Object.create(null) : {};
3038
3104
  return iterators;
3039
3105
  }
3040
3106
 
@@ -3931,48 +3997,64 @@
3931
3997
  return arraySetLength;
3932
3998
  }
3933
3999
 
3934
- var getIteratorMethod;
3935
- var hasRequiredGetIteratorMethod;
4000
+ var getIteratorMethodInternal;
4001
+ var hasRequiredGetIteratorMethodInternal;
3936
4002
 
3937
- function requireGetIteratorMethod () {
3938
- if (hasRequiredGetIteratorMethod) return getIteratorMethod;
3939
- hasRequiredGetIteratorMethod = 1;
3940
- var classof = requireClassof();
3941
- var getMethod = requireGetMethod();
4003
+ function requireGetIteratorMethodInternal () {
4004
+ if (hasRequiredGetIteratorMethodInternal) return getIteratorMethodInternal;
4005
+ hasRequiredGetIteratorMethodInternal = 1;
4006
+ var classof = requireClassofRaw();
3942
4007
  var isNullOrUndefined = requireIsNullOrUndefined();
3943
- var Iterators = requireIterators();
4008
+ var getMethod = requireGetMethod();
3944
4009
  var wellKnownSymbol = requireWellKnownSymbol();
3945
4010
 
3946
4011
  var ITERATOR = wellKnownSymbol('iterator');
4012
+ var ArrayPrototype = Array.prototype;
3947
4013
 
3948
- getIteratorMethod = function (it) {
4014
+ getIteratorMethodInternal = function (it) {
3949
4015
  if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)
3950
4016
  || getMethod(it, '@@iterator')
3951
- || Iterators[classof(it)];
4017
+ || (classof(it) === 'Arguments' ? ArrayPrototype[ITERATOR] : undefined);
3952
4018
  };
3953
- return getIteratorMethod;
4019
+ return getIteratorMethodInternal;
3954
4020
  }
3955
4021
 
3956
- var getIterator;
3957
- var hasRequiredGetIterator;
4022
+ var getIteratorInternal;
4023
+ var hasRequiredGetIteratorInternal;
3958
4024
 
3959
- function requireGetIterator () {
3960
- if (hasRequiredGetIterator) return getIterator;
3961
- hasRequiredGetIterator = 1;
4025
+ function requireGetIteratorInternal () {
4026
+ if (hasRequiredGetIteratorInternal) return getIteratorInternal;
4027
+ hasRequiredGetIteratorInternal = 1;
3962
4028
  var call = requireFunctionCall();
3963
- var aCallable = requireACallable();
4029
+ var isCallable = requireIsCallable();
3964
4030
  var anObject = requireAnObject();
3965
4031
  var tryToString = requireTryToString();
3966
- var getIteratorMethod = requireGetIteratorMethod();
4032
+ var getIteratorMethod = requireGetIteratorMethodInternal();
3967
4033
 
3968
4034
  var $TypeError = TypeError;
3969
4035
 
3970
- getIterator = function (argument, usingIterator) {
4036
+ getIteratorInternal = function (argument, usingIterator) {
3971
4037
  var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
3972
- if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
4038
+ if (isCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
3973
4039
  throw new $TypeError(tryToString(argument) + ' is not iterable');
3974
4040
  };
3975
- return getIterator;
4041
+ return getIteratorInternal;
4042
+ }
4043
+
4044
+ var doesNotExceedSafeInteger;
4045
+ var hasRequiredDoesNotExceedSafeInteger;
4046
+
4047
+ function requireDoesNotExceedSafeInteger () {
4048
+ if (hasRequiredDoesNotExceedSafeInteger) return doesNotExceedSafeInteger;
4049
+ hasRequiredDoesNotExceedSafeInteger = 1;
4050
+ var $TypeError = TypeError;
4051
+ var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
4052
+
4053
+ doesNotExceedSafeInteger = function (it) {
4054
+ if (it > MAX_SAFE_INTEGER) throw new $TypeError('Maximum allowed index exceeded');
4055
+ return it;
4056
+ };
4057
+ return doesNotExceedSafeInteger;
3976
4058
  }
3977
4059
 
3978
4060
  var arrayFrom;
@@ -3990,20 +4072,22 @@
3990
4072
  var lengthOfArrayLike = requireLengthOfArrayLike();
3991
4073
  var createProperty = requireCreateProperty();
3992
4074
  var setArrayLength = requireArraySetLength();
3993
- var getIterator = requireGetIterator();
3994
- var getIteratorMethod = requireGetIteratorMethod();
4075
+ var getIterator = requireGetIteratorInternal();
4076
+ var getIteratorMethod = requireGetIteratorMethodInternal();
4077
+ var iteratorClose = requireIteratorClose();
4078
+ var doesNotExceedSafeInteger = requireDoesNotExceedSafeInteger();
3995
4079
 
3996
4080
  var $Array = Array;
3997
4081
 
3998
4082
  // `Array.from` method implementation
3999
4083
  // https://tc39.es/ecma262/#sec-array.from
4000
4084
  arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
4001
- var O = toObject(arrayLike);
4002
4085
  var IS_CONSTRUCTOR = isConstructor(this);
4003
4086
  var argumentsLength = arguments.length;
4004
4087
  var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
4005
4088
  var mapping = mapfn !== undefined;
4006
4089
  if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
4090
+ var O = toObject(arrayLike);
4007
4091
  var iteratorMethod = getIteratorMethod(O);
4008
4092
  var index = 0;
4009
4093
  var length, result, step, iterator, next, value;
@@ -4013,8 +4097,17 @@
4013
4097
  iterator = getIterator(O, iteratorMethod);
4014
4098
  next = iterator.next;
4015
4099
  for (;!(step = call(next, iterator)).done; index++) {
4100
+ try {
4101
+ doesNotExceedSafeInteger(index);
4102
+ } catch (error) {
4103
+ iteratorClose(iterator, 'throw', error);
4104
+ }
4016
4105
  value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
4017
- createProperty(result, index, value);
4106
+ try {
4107
+ createProperty(result, index, value);
4108
+ } catch (error) {
4109
+ iteratorClose(iterator, 'throw', error);
4110
+ }
4018
4111
  }
4019
4112
  } else {
4020
4113
  length = lengthOfArrayLike(O);
@@ -4219,21 +4312,6 @@
4219
4312
  return stringPunycodeToAscii;
4220
4313
  }
4221
4314
 
4222
- var validateArgumentsLength;
4223
- var hasRequiredValidateArgumentsLength;
4224
-
4225
- function requireValidateArgumentsLength () {
4226
- if (hasRequiredValidateArgumentsLength) return validateArgumentsLength;
4227
- hasRequiredValidateArgumentsLength = 1;
4228
- var $TypeError = TypeError;
4229
-
4230
- validateArgumentsLength = function (passed, required) {
4231
- if (passed < required) throw new $TypeError('Not enough arguments');
4232
- return passed;
4233
- };
4234
- return validateArgumentsLength;
4235
- }
4236
-
4237
4315
  var es_string_fromCodePoint = {};
4238
4316
 
4239
4317
  var hasRequiredEs_string_fromCodePoint;
@@ -4264,9 +4342,9 @@
4264
4342
  var i = 0;
4265
4343
  var code;
4266
4344
  while (length > i) {
4267
- code = +arguments[i++];
4345
+ code = +arguments[i];
4268
4346
  if (toAbsoluteIndex(code, 0x10FFFF) !== code) throw new $RangeError(code + ' is not a valid code point');
4269
- elements[i] = code < 0x10000
4347
+ elements[i++] = code < 0x10000
4270
4348
  ? fromCharCode(code)
4271
4349
  : fromCharCode(((code -= 0x10000) >> 10) + 0xD800, code % 0x400 + 0xDC00);
4272
4350
  } return join(elements, '');
@@ -4275,112 +4353,31 @@
4275
4353
  return es_string_fromCodePoint;
4276
4354
  }
4277
4355
 
4278
- var safeGetBuiltIn;
4279
- var hasRequiredSafeGetBuiltIn;
4280
-
4281
- function requireSafeGetBuiltIn () {
4282
- if (hasRequiredSafeGetBuiltIn) return safeGetBuiltIn;
4283
- hasRequiredSafeGetBuiltIn = 1;
4284
- var globalThis = requireGlobalThis();
4285
- var DESCRIPTORS = requireDescriptors();
4286
-
4287
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
4288
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
4289
-
4290
- // Avoid NodeJS experimental warning
4291
- safeGetBuiltIn = function (name) {
4292
- if (!DESCRIPTORS) return globalThis[name];
4293
- var descriptor = getOwnPropertyDescriptor(globalThis, name);
4294
- return descriptor && descriptor.value;
4295
- };
4296
- return safeGetBuiltIn;
4297
- }
4298
-
4299
- var defineBuiltIns;
4300
- var hasRequiredDefineBuiltIns;
4301
-
4302
- function requireDefineBuiltIns () {
4303
- if (hasRequiredDefineBuiltIns) return defineBuiltIns;
4304
- hasRequiredDefineBuiltIns = 1;
4305
- var defineBuiltIn = requireDefineBuiltIn();
4306
-
4307
- defineBuiltIns = function (target, src, options) {
4308
- for (var key in src) defineBuiltIn(target, key, src[key], options);
4309
- return target;
4310
- };
4311
- return defineBuiltIns;
4312
- }
4313
-
4314
- var web_urlSearchParams_constructor;
4315
- var hasRequiredWeb_urlSearchParams_constructor;
4356
+ var urlPercentCoding;
4357
+ var hasRequiredUrlPercentCoding;
4316
4358
 
4317
- function requireWeb_urlSearchParams_constructor () {
4318
- if (hasRequiredWeb_urlSearchParams_constructor) return web_urlSearchParams_constructor;
4319
- hasRequiredWeb_urlSearchParams_constructor = 1;
4359
+ function requireUrlPercentCoding () {
4360
+ if (hasRequiredUrlPercentCoding) return urlPercentCoding;
4361
+ hasRequiredUrlPercentCoding = 1;
4320
4362
  // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
4321
- requireEs_array_iterator();
4322
4363
  requireEs_string_fromCodePoint();
4323
- var $ = require_export();
4324
- var globalThis = requireGlobalThis();
4325
- var safeGetBuiltIn = requireSafeGetBuiltIn();
4326
4364
  var getBuiltIn = requireGetBuiltIn();
4327
- var call = requireFunctionCall();
4328
4365
  var uncurryThis = requireFunctionUncurryThis();
4329
- var DESCRIPTORS = requireDescriptors();
4330
- var USE_NATIVE_URL = requireUrlConstructorDetection();
4331
- var defineBuiltIn = requireDefineBuiltIn();
4332
- var defineBuiltInAccessor = requireDefineBuiltInAccessor();
4333
- var defineBuiltIns = requireDefineBuiltIns();
4334
- var setToStringTag = requireSetToStringTag();
4335
- var createIteratorConstructor = requireIteratorCreateConstructor();
4336
- var InternalStateModule = requireInternalState();
4337
- var anInstance = requireAnInstance();
4338
- var isCallable = requireIsCallable();
4339
- var hasOwn = requireHasOwnProperty();
4340
- var bind = requireFunctionBindContext();
4341
- var classof = requireClassof();
4342
- var anObject = requireAnObject();
4343
- var isObject = requireIsObject();
4344
- var $toString = requireToString();
4345
- var create = requireObjectCreate();
4346
- var createPropertyDescriptor = requireCreatePropertyDescriptor();
4347
- var getIterator = requireGetIterator();
4348
- var getIteratorMethod = requireGetIteratorMethod();
4349
- var createIterResultObject = requireCreateIterResultObject();
4350
- var validateArgumentsLength = requireValidateArgumentsLength();
4351
- var wellKnownSymbol = requireWellKnownSymbol();
4352
- var arraySort = requireArraySort();
4353
-
4354
- var ITERATOR = wellKnownSymbol('iterator');
4355
- var URL_SEARCH_PARAMS = 'URLSearchParams';
4356
- var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
4357
- var setInternalState = InternalStateModule.set;
4358
- var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);
4359
- var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);
4360
4366
 
4361
- var nativeFetch = safeGetBuiltIn('fetch');
4362
- var NativeRequest = safeGetBuiltIn('Request');
4363
- var Headers = safeGetBuiltIn('Headers');
4364
- var RequestPrototype = NativeRequest && NativeRequest.prototype;
4365
- var HeadersPrototype = Headers && Headers.prototype;
4366
- var TypeError = globalThis.TypeError;
4367
- var encodeURIComponent = globalThis.encodeURIComponent;
4368
4367
  var fromCharCode = String.fromCharCode;
4369
4368
  var fromCodePoint = getBuiltIn('String', 'fromCodePoint');
4369
+ var $encodeURIComponent = encodeURIComponent;
4370
4370
  var $parseInt = parseInt;
4371
4371
  var charAt = uncurryThis(''.charAt);
4372
- var join = uncurryThis([].join);
4373
4372
  var push = uncurryThis([].push);
4374
4373
  var replace = uncurryThis(''.replace);
4375
- var shift = uncurryThis([].shift);
4376
- var splice = uncurryThis([].splice);
4377
- var split = uncurryThis(''.split);
4378
4374
  var stringSlice = uncurryThis(''.slice);
4379
4375
  var exec = uncurryThis(/./.exec);
4380
4376
 
4381
- var plus = /\+/g;
4382
4377
  var FALLBACK_REPLACER = '\uFFFD';
4383
4378
  var VALID_HEX = /^[0-9a-f]+$/i;
4379
+ // a surrogate pair is matched first, so a one-unit match is always a lone surrogate
4380
+ var SURROGATE = /[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDFFF]/g;
4384
4381
 
4385
4382
  var parseHexOctet = function (string, start) {
4386
4383
  var substr = stringSlice(string, start, start + 2);
@@ -4399,8 +4396,9 @@
4399
4396
 
4400
4397
  var utf8Decode = function (octets) {
4401
4398
  var codePoint = null;
4399
+ var length = octets.length;
4402
4400
 
4403
- switch (octets.length) {
4401
+ switch (length) {
4404
4402
  case 1:
4405
4403
  codePoint = octets[0];
4406
4404
  break;
@@ -4415,11 +4413,23 @@
4415
4413
  break;
4416
4414
  }
4417
4415
 
4418
- return codePoint > 0x10FFFF ? null : codePoint;
4416
+ // reject surrogates, overlong encodings, and out-of-range codepoints
4417
+ if (codePoint === null
4418
+ || codePoint > 0x10FFFF
4419
+ || (codePoint >= 0xD800 && codePoint <= 0xDFFF)
4420
+ || codePoint < (length > 3 ? 0x10000 : length > 2 ? 0x800 : length > 1 ? 0x80 : 0)
4421
+ ) return null;
4422
+
4423
+ return codePoint;
4424
+ };
4425
+
4426
+ var replaceLoneSurrogate = function (chunk) {
4427
+ return chunk.length === 2 ? chunk : FALLBACK_REPLACER;
4419
4428
  };
4420
4429
 
4430
+ // https://url.spec.whatwg.org/#percent-decode
4431
+ /* eslint-disable max-depth -- ok */
4421
4432
  var decode = function (input) {
4422
- input = replace(input, plus, ' ');
4423
4433
  var length = input.length;
4424
4434
  var result = '';
4425
4435
  var i = 0;
@@ -4465,11 +4475,15 @@
4465
4475
  var nextByte = parseHexOctet(input, i + 1);
4466
4476
 
4467
4477
  // eslint-disable-next-line no-self-compare -- NaN check
4468
- if (nextByte !== nextByte) {
4469
- i += 3;
4470
- break;
4478
+ if (nextByte !== nextByte || nextByte > 191 || nextByte < 128) break;
4479
+
4480
+ // https://encoding.spec.whatwg.org/#utf-8-decoder - position-specific byte ranges
4481
+ if (sequenceIndex === 1) {
4482
+ if (octet === 0xE0 && nextByte < 0xA0) break;
4483
+ if (octet === 0xED && nextByte > 0x9F) break;
4484
+ if (octet === 0xF0 && nextByte < 0x90) break;
4485
+ if (octet === 0xF4 && nextByte > 0x8F) break;
4471
4486
  }
4472
- if (nextByte > 191 || nextByte < 128) break;
4473
4487
 
4474
4488
  push(octets, nextByte);
4475
4489
  i += 2;
@@ -4483,7 +4497,9 @@
4483
4497
 
4484
4498
  var codePoint = utf8Decode(octets);
4485
4499
  if (codePoint === null) {
4486
- result += FALLBACK_REPLACER;
4500
+ for (var replacement = 0; replacement < byteSequenceLength; replacement++) result += FALLBACK_REPLACER;
4501
+ i++;
4502
+ continue;
4487
4503
  } else {
4488
4504
  decodedChar = fromCodePoint(codePoint);
4489
4505
  }
@@ -4496,78 +4512,218 @@
4496
4512
 
4497
4513
  return result;
4498
4514
  };
4515
+ /* eslint-enable max-depth -- ok */
4499
4516
 
4500
- var find = /[!'()~]|%20/g;
4501
-
4502
- var replacements = {
4503
- '!': '%21',
4504
- "'": '%27',
4505
- '(': '%28',
4506
- ')': '%29',
4507
- '~': '%7E',
4508
- '%20': '+'
4517
+ // https://url.spec.whatwg.org/#string-percent-encode-after-encoding
4518
+ // a lone surrogate is the only input `encodeURIComponent` throws on, and the UTF-8
4519
+ // encoder replaces it - so the throw selects the slow path instead of a per-call scan
4520
+ var encode = function (input) {
4521
+ try {
4522
+ return $encodeURIComponent(input);
4523
+ } catch (error) {
4524
+ return $encodeURIComponent(replace(input, SURROGATE, replaceLoneSurrogate));
4525
+ }
4509
4526
  };
4510
4527
 
4511
- var replacer = function (match) {
4512
- return replacements[match];
4528
+ urlPercentCoding = {
4529
+ decode: decode,
4530
+ encode: encode
4513
4531
  };
4532
+ return urlPercentCoding;
4533
+ }
4514
4534
 
4515
- var serialize = function (it) {
4516
- return replace(encodeURIComponent(it), find, replacer);
4535
+ var validateArgumentsLength;
4536
+ var hasRequiredValidateArgumentsLength;
4537
+
4538
+ function requireValidateArgumentsLength () {
4539
+ if (hasRequiredValidateArgumentsLength) return validateArgumentsLength;
4540
+ hasRequiredValidateArgumentsLength = 1;
4541
+ var $TypeError = TypeError;
4542
+
4543
+ validateArgumentsLength = function (passed, required) {
4544
+ if (passed < required) throw new $TypeError('Not enough arguments');
4545
+ return passed;
4517
4546
  };
4547
+ return validateArgumentsLength;
4548
+ }
4518
4549
 
4519
- var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
4520
- setInternalState(this, {
4521
- type: URL_SEARCH_PARAMS_ITERATOR,
4522
- target: getInternalParamsState(params).entries,
4523
- index: 0,
4524
- kind: kind
4525
- });
4526
- }, URL_SEARCH_PARAMS, function next() {
4527
- var state = getInternalIteratorState(this);
4528
- var target = state.target;
4529
- var index = state.index++;
4530
- if (!target || index >= target.length) {
4531
- state.target = null;
4532
- return createIterResultObject(undefined, true);
4533
- }
4534
- var entry = target[index];
4535
- switch (state.kind) {
4536
- case 'keys': return createIterResultObject(entry.key, false);
4537
- case 'values': return createIterResultObject(entry.value, false);
4538
- } return createIterResultObject([entry.key, entry.value], false);
4539
- }, true);
4550
+ var safeGetBuiltIn;
4551
+ var hasRequiredSafeGetBuiltIn;
4540
4552
 
4541
- var URLSearchParamsState = function (init) {
4542
- this.entries = [];
4543
- this.url = null;
4553
+ function requireSafeGetBuiltIn () {
4554
+ if (hasRequiredSafeGetBuiltIn) return safeGetBuiltIn;
4555
+ hasRequiredSafeGetBuiltIn = 1;
4556
+ var globalThis = requireGlobalThis();
4557
+ var DESCRIPTORS = requireDescriptors();
4544
4558
 
4545
- if (init !== undefined) {
4546
- if (isObject(init)) this.parseObject(init);
4547
- else this.parseQuery(typeof init == 'string' ? charAt(init, 0) === '?' ? stringSlice(init, 1) : init : $toString(init));
4548
- }
4559
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
4560
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
4561
+
4562
+ // Avoid NodeJS experimental warning
4563
+ safeGetBuiltIn = function (name) {
4564
+ if (!DESCRIPTORS) return globalThis[name];
4565
+ var descriptor = getOwnPropertyDescriptor(globalThis, name);
4566
+ return descriptor && descriptor.value;
4549
4567
  };
4568
+ return safeGetBuiltIn;
4569
+ }
4550
4570
 
4551
- URLSearchParamsState.prototype = {
4552
- type: URL_SEARCH_PARAMS,
4553
- bindURL: function (url) {
4554
- this.url = url;
4555
- this.update();
4556
- },
4557
- parseObject: function (object) {
4558
- var entries = this.entries;
4559
- var iteratorMethod = getIteratorMethod(object);
4560
- var iterator, next, step, entryIterator, entryNext, first, second;
4571
+ var defineBuiltIns;
4572
+ var hasRequiredDefineBuiltIns;
4561
4573
 
4562
- if (iteratorMethod) {
4563
- iterator = getIterator(object, iteratorMethod);
4564
- next = iterator.next;
4565
- while (!(step = call(next, iterator)).done) {
4566
- entryIterator = getIterator(anObject(step.value));
4567
- entryNext = entryIterator.next;
4568
- if (
4569
- (first = call(entryNext, entryIterator)).done ||
4570
- (second = call(entryNext, entryIterator)).done ||
4574
+ function requireDefineBuiltIns () {
4575
+ if (hasRequiredDefineBuiltIns) return defineBuiltIns;
4576
+ hasRequiredDefineBuiltIns = 1;
4577
+ var defineBuiltIn = requireDefineBuiltIn();
4578
+
4579
+ defineBuiltIns = function (target, src, options) {
4580
+ for (var key in src) defineBuiltIn(target, key, src[key], options);
4581
+ return target;
4582
+ };
4583
+ return defineBuiltIns;
4584
+ }
4585
+
4586
+ var web_urlSearchParams_constructor;
4587
+ var hasRequiredWeb_urlSearchParams_constructor;
4588
+
4589
+ function requireWeb_urlSearchParams_constructor () {
4590
+ if (hasRequiredWeb_urlSearchParams_constructor) return web_urlSearchParams_constructor;
4591
+ hasRequiredWeb_urlSearchParams_constructor = 1;
4592
+ // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
4593
+ requireEs_array_iterator();
4594
+ var $ = require_export();
4595
+ var globalThis = requireGlobalThis();
4596
+ var safeGetBuiltIn = requireSafeGetBuiltIn();
4597
+ var call = requireFunctionCall();
4598
+ var uncurryThis = requireFunctionUncurryThis();
4599
+ var DESCRIPTORS = requireDescriptors();
4600
+ var USE_NATIVE_URL = requireUrlConstructorDetection();
4601
+ var percentCoding = requireUrlPercentCoding();
4602
+ var defineBuiltIn = requireDefineBuiltIn();
4603
+ var defineBuiltInAccessor = requireDefineBuiltInAccessor();
4604
+ var defineBuiltIns = requireDefineBuiltIns();
4605
+ var setToStringTag = requireSetToStringTag();
4606
+ var createIteratorConstructor = requireIteratorCreateConstructor();
4607
+ var InternalStateModule = requireInternalState();
4608
+ var anInstance = requireAnInstance();
4609
+ var isCallable = requireIsCallable();
4610
+ var hasOwn = requireHasOwnProperty();
4611
+ var bind = requireFunctionBindContext();
4612
+ var classof = requireClassof();
4613
+ var anObject = requireAnObject();
4614
+ var isObject = requireIsObject();
4615
+ var $toString = requireToString();
4616
+ var create = requireObjectCreate();
4617
+ var createPropertyDescriptor = requireCreatePropertyDescriptor();
4618
+ var getIterator = requireGetIteratorInternal();
4619
+ var getIteratorMethod = requireGetIteratorMethodInternal();
4620
+ var createIterResultObject = requireCreateIterResultObject();
4621
+ var validateArgumentsLength = requireValidateArgumentsLength();
4622
+ var wellKnownSymbol = requireWellKnownSymbol();
4623
+ var arraySort = requireArraySort();
4624
+
4625
+ var ITERATOR = wellKnownSymbol('iterator');
4626
+ var URL_SEARCH_PARAMS = 'URLSearchParams';
4627
+ var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
4628
+ var setInternalState = InternalStateModule.set;
4629
+ var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);
4630
+ var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);
4631
+ var percentDecode = percentCoding.decode;
4632
+ var percentEncode = percentCoding.encode;
4633
+
4634
+ var nativeFetch = safeGetBuiltIn('fetch');
4635
+ var NativeRequest = safeGetBuiltIn('Request');
4636
+ var Headers = safeGetBuiltIn('Headers');
4637
+ var RequestPrototype = NativeRequest && NativeRequest.prototype;
4638
+ var HeadersPrototype = Headers && Headers.prototype;
4639
+ var TypeError = globalThis.TypeError;
4640
+ var charAt = uncurryThis(''.charAt);
4641
+ var join = uncurryThis([].join);
4642
+ var push = uncurryThis([].push);
4643
+ var replace = uncurryThis(''.replace);
4644
+ var shift = uncurryThis([].shift);
4645
+ var splice = uncurryThis([].splice);
4646
+ var split = uncurryThis(''.split);
4647
+ var stringSlice = uncurryThis(''.slice);
4648
+
4649
+ var plus = /\+/g;
4650
+
4651
+ // https://url.spec.whatwg.org/#urlencoded-parsing - `+` decodes to a space
4652
+ var decodeQueryComponent = function (input) {
4653
+ return percentDecode(replace(input, plus, ' '));
4654
+ };
4655
+
4656
+ var find = /[!'()~]|%20/g;
4657
+
4658
+ var replacements = {
4659
+ '!': '%21',
4660
+ "'": '%27',
4661
+ '(': '%28',
4662
+ ')': '%29',
4663
+ '~': '%7E',
4664
+ '%20': '+'
4665
+ };
4666
+
4667
+ var replacer = function (match) {
4668
+ return replacements[match];
4669
+ };
4670
+
4671
+ var serialize = function (it) {
4672
+ return replace(percentEncode(it), find, replacer);
4673
+ };
4674
+
4675
+ var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
4676
+ setInternalState(this, {
4677
+ type: URL_SEARCH_PARAMS_ITERATOR,
4678
+ target: getInternalParamsState(params).entries,
4679
+ index: 0,
4680
+ kind: kind
4681
+ });
4682
+ }, URL_SEARCH_PARAMS, function next() {
4683
+ var state = getInternalIteratorState(this);
4684
+ var target = state.target;
4685
+ var index = state.index++;
4686
+ if (!target || index >= target.length) {
4687
+ state.target = null;
4688
+ return createIterResultObject(undefined, true);
4689
+ }
4690
+ var entry = target[index];
4691
+ switch (state.kind) {
4692
+ case 'keys': return createIterResultObject(entry.key, false);
4693
+ case 'values': return createIterResultObject(entry.value, false);
4694
+ } return createIterResultObject([entry.key, entry.value], false);
4695
+ }, true);
4696
+
4697
+ var URLSearchParamsState = function (init) {
4698
+ this.entries = [];
4699
+ this.url = null;
4700
+
4701
+ if (init !== undefined) {
4702
+ if (isObject(init)) this.parseObject(init);
4703
+ else this.parseQuery(typeof init == 'string' ? charAt(init, 0) === '?' ? stringSlice(init, 1) : init : $toString(init));
4704
+ }
4705
+ };
4706
+
4707
+ URLSearchParamsState.prototype = {
4708
+ type: URL_SEARCH_PARAMS,
4709
+ bindURL: function (url) {
4710
+ this.url = url;
4711
+ this.update();
4712
+ },
4713
+ parseObject: function (object) {
4714
+ var entries = this.entries;
4715
+ var iteratorMethod = getIteratorMethod(object);
4716
+ var iterator, next, step, entryIterator, entryNext, first, second;
4717
+
4718
+ if (iteratorMethod) {
4719
+ iterator = getIterator(object, iteratorMethod);
4720
+ next = iterator.next;
4721
+ while (!(step = call(next, iterator)).done) {
4722
+ entryIterator = getIterator(anObject(step.value));
4723
+ entryNext = entryIterator.next;
4724
+ if (
4725
+ (first = call(entryNext, entryIterator)).done ||
4726
+ (second = call(entryNext, entryIterator)).done ||
4571
4727
  !call(entryNext, entryIterator).done
4572
4728
  ) throw new TypeError('Expected sequence with length 2');
4573
4729
  push(entries, { key: $toString(first.value), value: $toString(second.value) });
@@ -4587,8 +4743,8 @@
4587
4743
  if (attribute.length) {
4588
4744
  entry = split(attribute, '=');
4589
4745
  push(entries, {
4590
- key: decode(shift(entry)),
4591
- value: decode(join(entry, '='))
4746
+ key: decodeQueryComponent(shift(entry)),
4747
+ value: decodeQueryComponent(join(entry, '='))
4592
4748
  });
4593
4749
  }
4594
4750
  }
@@ -4648,7 +4804,6 @@
4648
4804
  var entry = entries[index];
4649
4805
  if (entry.key === key && (value === undefined || entry.value === value)) {
4650
4806
  splice(entries, index, 1);
4651
- if (value !== undefined) break;
4652
4807
  } else index++;
4653
4808
  }
4654
4809
  if (!DESCRIPTORS) this.size = entries.length;
@@ -4698,7 +4853,7 @@
4698
4853
  // https://url.spec.whatwg.org/#dom-urlsearchparams-set
4699
4854
  set: function set(name, value) {
4700
4855
  var state = getInternalParamsState(this);
4701
- validateArgumentsLength(arguments.length, 1);
4856
+ validateArgumentsLength(arguments.length, 2);
4702
4857
  var entries = state.entries;
4703
4858
  var found = false;
4704
4859
  var key = $toString(name);
@@ -4763,7 +4918,7 @@
4763
4918
  }, { enumerable: true });
4764
4919
 
4765
4920
  // `URLSearchParams.prototype.size` getter
4766
- // https://github.com/whatwg/url/pull/734
4921
+ // https://url.spec.whatwg.org/#dom-urlsearchparams-size
4767
4922
  if (DESCRIPTORS) defineBuiltInAccessor(URLSearchParamsPrototype, 'size', {
4768
4923
  get: function size() {
4769
4924
  return getInternalParamsState(this).entries.length;
@@ -4852,6 +5007,7 @@
4852
5007
  var arraySlice = requireArraySlice();
4853
5008
  var codeAt = requireStringMultibyte().codeAt;
4854
5009
  var toASCII = requireStringPunycodeToAscii();
5010
+ var percentCoding = requireUrlPercentCoding();
4855
5011
  var $toString = requireToString();
4856
5012
  var setToStringTag = requireSetToStringTag();
4857
5013
  var validateArgumentsLength = requireValidateArgumentsLength();
@@ -4862,12 +5018,15 @@
4862
5018
  var getInternalURLState = InternalStateModule.getterFor('URL');
4863
5019
  var URLSearchParams = URLSearchParamsModule.URLSearchParams;
4864
5020
  var getInternalSearchParamsState = URLSearchParamsModule.getState;
5021
+ var percentDecode = percentCoding.decode;
5022
+ var percentEncode = percentCoding.encode;
4865
5023
 
4866
5024
  var NativeURL = globalThis.URL;
4867
5025
  var TypeError = globalThis.TypeError;
4868
5026
  var parseInt = globalThis.parseInt;
4869
5027
  var floor = Math.floor;
4870
5028
  var pow = Math.pow;
5029
+ var fromCharCode = String.fromCharCode;
4871
5030
  var charAt = uncurryThis(''.charAt);
4872
5031
  var exec = uncurryThis(/./.exec);
4873
5032
  var join = uncurryThis([].join);
@@ -4877,6 +5036,7 @@
4877
5036
  var replace = uncurryThis(''.replace);
4878
5037
  var shift = uncurryThis([].shift);
4879
5038
  var split = uncurryThis(''.split);
5039
+ var stringIndexOf = uncurryThis(''.indexOf);
4880
5040
  var stringSlice = uncurryThis(''.slice);
4881
5041
  var toLowerCase = uncurryThis(''.toLowerCase);
4882
5042
  var unshift = uncurryThis([].unshift);
@@ -4887,24 +5047,113 @@
4887
5047
  var INVALID_PORT = 'Invalid port';
4888
5048
 
4889
5049
  var ALPHA = /[a-z]/i;
4890
- // eslint-disable-next-line regexp/no-obscure-range -- safe
4891
- var ALPHANUMERIC = /[\d+-.a-z]/i;
5050
+ var ALPHANUMERIC_PLUS_MINUS_DOT = /[\d+\-.a-z]/i;
4892
5051
  var DIGIT = /\d/;
4893
5052
  var HEX_START = /^0x/i;
4894
5053
  var OCT = /^[0-7]+$/;
4895
5054
  var DEC = /^\d+$/;
4896
5055
  var HEX = /^[\da-f]+$/i;
4897
5056
  /* eslint-disable regexp/no-control-character -- safe */
4898
- var FORBIDDEN_HOST_CODE_POINT = /[\0\t\n\r #%/:<>?@[\\\]^|]/;
4899
- var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\0\t\n\r #/:<>?@[\\\]^|]/;
5057
+ // https://url.spec.whatwg.org/#forbidden-domain-code-point
5058
+ var FORBIDDEN_DOMAIN_CODE_POINT = /[\u0000-\u0020#%/:<>?@[\\\]^|\u007F]/;
5059
+ // https://url.spec.whatwg.org/#forbidden-host-code-point
5060
+ var FORBIDDEN_HOST_CODE_POINT = /[\0\t\n\r #/:<>?@[\\\]^|]/;
4900
5061
  var LEADING_C0_CONTROL_OR_SPACE = /^[\u0000-\u0020]+/;
4901
5062
  var TRAILING_C0_CONTROL_OR_SPACE = /(^|[^\u0000-\u0020])[\u0000-\u0020]+$/;
4902
5063
  var TAB_AND_NEW_LINE = /[\t\n\r]/g;
5064
+ var NON_ASCII = /[^\u0000-\u007F]/;
4903
5065
  /* eslint-enable regexp/no-control-character -- safe */
5066
+ // UTS#46 maps these onto a string containing a forbidden domain code point, so a domain
5067
+ // holding one is rejected - listing them is far smaller than shipping the mapping table
5068
+ var MAPPED_ONTO_FORBIDDEN = '\u00A8\u00AF\u00B4\u00B8\u02D8\u02D9\u02DA\u02DB\u02DC\u02DD\u037A\u0384\u0385\u1FBD\u1FBF\u1FC0'
5069
+ + '\u1FC1\u1FCD\u1FCE\u1FCF\u1FDD\u1FDE\u1FDF\u1FED\u1FEE\u1FFD\u1FFE\u2017\u203E\u2047\u2048\u2049'
5070
+ + '\u2100\u2101\u2105\u2106\u2A74\u309B\u309C\uFC5E\uFC5F\uFC60\uFC61\uFC62\uFC63\uFDFA\uFDFB\uFE13'
5071
+ + '\uFE16\uFE47\uFE48\uFE49\uFE4A\uFE4B\uFE4C\uFE55\uFE56\uFE5F\uFE64\uFE65\uFE68\uFE6A\uFE6B\uFE70'
5072
+ + '\uFE72\uFE74\uFE76\uFE78\uFE7A\uFE7C\uFE7E\uFFE3';
4904
5073
  // eslint-disable-next-line no-unassigned-vars -- expected `undefined` value
4905
5074
  var EOF;
4906
5075
 
4907
- // https://url.spec.whatwg.org/#ipv4-number-parser
5076
+ // https://www.unicode.org/reports/tr46/#IDNA_Mapping_Table
5077
+ var isIgnoredCodePoint = function (code) {
5078
+ return code === 0xAD || code === 0x34F || code === 0x200B || code === 0x3164
5079
+ || code === 0xFEFF || code === 0xFFA0
5080
+ || (code >= 0x115F && code <= 0x1160)
5081
+ || (code >= 0x17B4 && code <= 0x17B5)
5082
+ || (code >= 0x180B && code <= 0x180F)
5083
+ || (code >= 0x2060 && code <= 0x2064) || (code >= 0x206A && code <= 0x206F)
5084
+ || (code >= 0xFE00 && code <= 0xFE0F)
5085
+ || (code >= 0xE0100 && code <= 0xE01EF);
5086
+ };
5087
+
5088
+ var isDisallowedCodePoint = function (code) {
5089
+ return code === 0xFFFD
5090
+ // lone surrogate - a matched pair is a single code point and never lands here
5091
+ || (code >= 0xD800 && code <= 0xDFFF)
5092
+ // C1 controls
5093
+ || (code >= 0x80 && code <= 0x9F)
5094
+ // line and paragraph separators, bidirectional formatting characters
5095
+ || (code >= 0x200E && code <= 0x200F) || (code >= 0x2028 && code <= 0x2029)
5096
+ || (code >= 0x202A && code <= 0x202E) || (code >= 0x2065 && code <= 0x2069)
5097
+ // noncharacters
5098
+ || (code >= 0xFDD0 && code <= 0xFDEF) || (code & 0xFFFE) === 0xFFFE
5099
+ // private use
5100
+ || (code >= 0xE000 && code <= 0xF8FF) || (code >= 0xF0000 && code <= 0x10FFFD);
5101
+ };
5102
+
5103
+ var mapCodePoint = function (code) {
5104
+ // full-width forms
5105
+ if (code >= 0xFF01 && code <= 0xFF5E) return code - 0xFEE0;
5106
+ // spaces and the listed code points collapse onto a forbidden domain code point; a space
5107
+ // stands in for the real mapping since either way the domain is rejected
5108
+ if (code === 0xA0 || code === 0x1680 || code === 0x202F || code === 0x205F || code === 0x3000) return 0x20;
5109
+ if (code >= 0x2000 && code <= 0x200A) return 0x20;
5110
+ // the list holds no supplementary code point, and `fromCharCode` would truncate one
5111
+ if (code <= 0xFFFF && stringIndexOf(MAPPED_ONTO_FORBIDDEN, fromCharCode(code)) > -1) return 0x20;
5112
+ return code;
5113
+ };
5114
+
5115
+ // https://url.spec.whatwg.org/#concept-domain-to-ascii
5116
+ // A subset of UTS#46 processing - the full mapping table is too large to ship. Covered are the
5117
+ // entries cheap to express: the ignored and disallowed code points, full-width forms, and the
5118
+ // code points mapping onto a forbidden domain code point. Not covered, so such domains are
5119
+ // punycoded rather than mapped or rejected: unassigned code points, half-width forms,
5120
+ // compatibility decompositions, NFC, CheckJoiners, CheckBidi, and labels that already arrive
5121
+ // punycoded - those are not decoded back for validation.
5122
+ var domainToASCII = function (domain) {
5123
+ // every mapped, ignored and disallowed code point is non-ASCII, so an ASCII domain
5124
+ // needs the punycode step only - this keeps the common case off the slow path
5125
+ if (!exec(NON_ASCII, domain)) return domain === '' ? null : toASCII(domain);
5126
+ var codePoints = arrayFrom(domain);
5127
+ var result = '';
5128
+ var index, code, mapped;
5129
+ for (index = 0; index < codePoints.length; index++) {
5130
+ code = codeAt(codePoints[index], 0);
5131
+ if (isDisallowedCodePoint(code)) return null;
5132
+ if (isIgnoredCodePoint(code)) continue;
5133
+ mapped = mapCodePoint(code);
5134
+ result += mapped === code ? codePoints[index] : fromCharCode(mapped);
5135
+ }
5136
+ return result === '' ? null : toASCII(result);
5137
+ };
5138
+
5139
+ // https://url.spec.whatwg.org/#ends-in-a-number-checker
5140
+ var endsInNumber = function (input) {
5141
+ var parts = split(input, '.');
5142
+ var last, hexPart;
5143
+ if (parts[parts.length - 1] === '') {
5144
+ if (parts.length === 1) return false;
5145
+ parts.length--;
5146
+ }
5147
+ last = parts[parts.length - 1];
5148
+ if (exec(DEC, last)) return true;
5149
+ if (exec(HEX_START, last)) {
5150
+ hexPart = stringSlice(last, 2);
5151
+ return hexPart === '' || !!exec(HEX, hexPart);
5152
+ }
5153
+ return false;
5154
+ };
5155
+
5156
+ // https://url.spec.whatwg.org/#concept-ipv4-parser
4908
5157
  var parseIPv4 = function (input) {
4909
5158
  var parts = split(input, '.');
4910
5159
  var partsLength, numbers, index, part, radix, number, ipv4;
@@ -4912,11 +5161,11 @@
4912
5161
  parts.length--;
4913
5162
  }
4914
5163
  partsLength = parts.length;
4915
- if (partsLength > 4) return input;
5164
+ if (partsLength > 4) return null;
4916
5165
  numbers = [];
4917
5166
  for (index = 0; index < partsLength; index++) {
4918
5167
  part = parts[index];
4919
- if (part === '') return input;
5168
+ if (part === '') return null;
4920
5169
  radix = 10;
4921
5170
  if (part.length > 1 && charAt(part, 0) === '0') {
4922
5171
  radix = exec(HEX_START, part) ? 16 : 8;
@@ -4925,7 +5174,7 @@
4925
5174
  if (part === '') {
4926
5175
  number = 0;
4927
5176
  } else {
4928
- if (!exec(radix === 10 ? DEC : radix === 8 ? OCT : HEX, part)) return input;
5177
+ if (!exec(radix === 10 ? DEC : radix === 8 ? OCT : HEX, part)) return null;
4929
5178
  number = parseInt(part, radix);
4930
5179
  }
4931
5180
  push(numbers, number);
@@ -5078,20 +5327,31 @@
5078
5327
  return host;
5079
5328
  };
5080
5329
 
5330
+ // https://url.spec.whatwg.org/#c0-control-percent-encode-set
5331
+ // empty because the set is the code points outside U+0020..U+007E, which the range
5332
+ // check below already covers; the sets extending it only add code points inside it
5081
5333
  var C0ControlPercentEncodeSet = {};
5334
+ var queryPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {
5335
+ ' ': 1, '"': 1, '#': 1, '<': 1, '>': 1
5336
+ });
5337
+ var specialQueryPercentEncodeSet = assign({}, queryPercentEncodeSet, {
5338
+ "'": 1
5339
+ });
5082
5340
  var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {
5083
5341
  ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1
5084
5342
  });
5085
5343
  var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {
5086
- '#': 1, '?': 1, '{': 1, '}': 1
5344
+ '#': 1, '?': 1, '{': 1, '}': 1, '^': 1
5087
5345
  });
5088
5346
  var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {
5089
5347
  '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1
5090
5348
  });
5091
5349
 
5092
- var percentEncode = function (chr, set) {
5350
+ // https://url.spec.whatwg.org/#string-utf-8-percent-encode
5351
+ var utf8PercentEncode = function (chr, set) {
5093
5352
  var code = codeAt(chr, 0);
5094
- return code > 0x20 && code < 0x7F && !hasOwn(set, chr) ? chr : encodeURIComponent(chr);
5353
+ // percent-encoding leaves ' alone, but it belongs to the special-query percent-encode set
5354
+ return code >= 0x20 && code < 0x7F && !hasOwn(set, chr) ? chr : chr === "'" && hasOwn(set, chr) ? '%27' : percentEncode(chr);
5095
5355
  };
5096
5356
 
5097
5357
  // https://url.spec.whatwg.org/#special-scheme
@@ -5219,13 +5479,13 @@
5219
5479
  break;
5220
5480
 
5221
5481
  case SCHEME:
5222
- if (chr && (exec(ALPHANUMERIC, chr) || chr === '+' || chr === '-' || chr === '.')) {
5482
+ if (chr && exec(ALPHANUMERIC_PLUS_MINUS_DOT, chr)) {
5223
5483
  buffer += toLowerCase(chr);
5224
5484
  } else if (chr === ':') {
5225
5485
  if (stateOverride && (
5226
5486
  (url.isSpecial() !== hasOwn(specialSchemes, buffer)) ||
5227
5487
  (buffer === 'file' && (url.includesCredentials() || url.port !== null)) ||
5228
- (url.scheme === 'file' && !url.host)
5488
+ (url.scheme === 'file' && url.host === '')
5229
5489
  )) return;
5230
5490
  url.scheme = buffer;
5231
5491
  if (stateOverride) {
@@ -5321,7 +5581,7 @@
5321
5581
  url.host = base.host;
5322
5582
  url.port = base.port;
5323
5583
  url.path = arraySlice(base.path);
5324
- url.path.length--;
5584
+ if (url.path.length) url.path.length--;
5325
5585
  state = PATH;
5326
5586
  continue;
5327
5587
  } break;
@@ -5342,7 +5602,7 @@
5342
5602
 
5343
5603
  case SPECIAL_AUTHORITY_SLASHES:
5344
5604
  state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
5345
- if (chr !== '/' || charAt(buffer, pointer + 1) !== '/') continue;
5605
+ if (chr !== '/' || codePoints[pointer + 1] !== '/') continue;
5346
5606
  pointer++;
5347
5607
  break;
5348
5608
 
@@ -5363,7 +5623,7 @@
5363
5623
  seenPasswordToken = true;
5364
5624
  continue;
5365
5625
  }
5366
- var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
5626
+ var encodedCodePoints = utf8PercentEncode(codePoint, userinfoPercentEncodeSet);
5367
5627
  if (seenPasswordToken) url.password += encodedCodePoints;
5368
5628
  else url.username += encodedCodePoints;
5369
5629
  }
@@ -5386,11 +5646,11 @@
5386
5646
  continue;
5387
5647
  } else if (chr === ':' && !seenBracket) {
5388
5648
  if (buffer === '') return INVALID_HOST;
5649
+ if (stateOverride === HOSTNAME) return;
5389
5650
  failure = url.parseHost(buffer);
5390
5651
  if (failure) return failure;
5391
5652
  buffer = '';
5392
5653
  state = PORT;
5393
- if (stateOverride === HOSTNAME) return;
5394
5654
  } else if (
5395
5655
  chr === EOF || chr === '/' || chr === '?' || chr === '#' ||
5396
5656
  (chr === '\\' && url.isSpecial())
@@ -5431,6 +5691,7 @@
5431
5691
 
5432
5692
  case FILE:
5433
5693
  url.scheme = 'file';
5694
+ url.host = '';
5434
5695
  if (chr === '/' || chr === '\\') state = FILE_SLASH;
5435
5696
  else if (base && base.scheme === 'file') {
5436
5697
  switch (chr) {
@@ -5453,8 +5714,8 @@
5453
5714
  state = FRAGMENT;
5454
5715
  break;
5455
5716
  default:
5717
+ url.host = base.host;
5456
5718
  if (!startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {
5457
- url.host = base.host;
5458
5719
  url.path = arraySlice(base.path);
5459
5720
  url.shortenPath();
5460
5721
  }
@@ -5471,9 +5732,10 @@
5471
5732
  state = FILE_HOST;
5472
5733
  break;
5473
5734
  }
5474
- if (base && base.scheme === 'file' && !startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {
5475
- if (isWindowsDriveLetter(base.path[0], true)) push(url.path, base.path[0]);
5476
- else url.host = base.host;
5735
+ if (base && base.scheme === 'file') {
5736
+ url.host = base.host;
5737
+ if (!startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))
5738
+ && isWindowsDriveLetter(base.path[0], true)) push(url.path, base.path[0]);
5477
5739
  }
5478
5740
  state = PATH;
5479
5741
  continue;
@@ -5529,7 +5791,8 @@
5529
5791
  }
5530
5792
  } else {
5531
5793
  if (url.scheme === 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
5532
- if (url.host) url.host = '';
5794
+ // eslint-disable-next-line max-depth -- ok
5795
+ if (url.host !== null && url.host !== '') url.host = '';
5533
5796
  buffer = charAt(buffer, 0) + ':'; // normalize windows drive letter
5534
5797
  }
5535
5798
  push(url.path, buffer);
@@ -5548,7 +5811,7 @@
5548
5811
  state = FRAGMENT;
5549
5812
  }
5550
5813
  } else {
5551
- buffer += percentEncode(chr, pathPercentEncodeSet);
5814
+ buffer += utf8PercentEncode(chr, pathPercentEncodeSet);
5552
5815
  } break;
5553
5816
 
5554
5817
  case CANNOT_BE_A_BASE_URL_PATH:
@@ -5559,7 +5822,11 @@
5559
5822
  url.fragment = '';
5560
5823
  state = FRAGMENT;
5561
5824
  } else if (chr !== EOF) {
5562
- url.path[0] += percentEncode(chr, C0ControlPercentEncodeSet);
5825
+ if (chr === ' ') {
5826
+ url.path[0] += codePoints[pointer + 1] === '?' || codePoints[pointer + 1] === '#' ? '%20' : ' ';
5827
+ } else {
5828
+ url.path[0] += utf8PercentEncode(chr, C0ControlPercentEncodeSet);
5829
+ }
5563
5830
  } break;
5564
5831
 
5565
5832
  case QUERY:
@@ -5567,13 +5834,11 @@
5567
5834
  url.fragment = '';
5568
5835
  state = FRAGMENT;
5569
5836
  } else if (chr !== EOF) {
5570
- if (chr === "'" && url.isSpecial()) url.query += '%27';
5571
- else if (chr === '#') url.query += '%23';
5572
- else url.query += percentEncode(chr, C0ControlPercentEncodeSet);
5837
+ url.query += utf8PercentEncode(chr, url.isSpecial() ? specialQueryPercentEncodeSet : queryPercentEncodeSet);
5573
5838
  } break;
5574
5839
 
5575
5840
  case FRAGMENT:
5576
- if (chr !== EOF) url.fragment += percentEncode(chr, fragmentPercentEncodeSet);
5841
+ if (chr !== EOF) url.fragment += utf8PercentEncode(chr, fragmentPercentEncodeSet);
5577
5842
  break;
5578
5843
  }
5579
5844
 
@@ -5590,24 +5855,28 @@
5590
5855
  this.host = result;
5591
5856
  // opaque host
5592
5857
  } else if (!this.isSpecial()) {
5593
- if (exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT, input)) return INVALID_HOST;
5858
+ if (exec(FORBIDDEN_HOST_CODE_POINT, input)) return INVALID_HOST;
5594
5859
  result = '';
5595
5860
  codePoints = arrayFrom(input);
5596
5861
  for (index = 0; index < codePoints.length; index++) {
5597
- result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);
5862
+ result += utf8PercentEncode(codePoints[index], C0ControlPercentEncodeSet);
5598
5863
  }
5599
5864
  this.host = result;
5600
5865
  } else {
5601
- input = toASCII(input);
5602
- if (exec(FORBIDDEN_HOST_CODE_POINT, input)) return INVALID_HOST;
5603
- result = parseIPv4(input);
5604
- if (result === null) return INVALID_HOST;
5605
- this.host = result;
5866
+ input = domainToASCII(percentDecode(input));
5867
+ if (input === null || exec(FORBIDDEN_DOMAIN_CODE_POINT, input)) return INVALID_HOST;
5868
+ if (endsInNumber(input)) {
5869
+ result = parseIPv4(input);
5870
+ if (result === null) return INVALID_HOST;
5871
+ this.host = result;
5872
+ } else {
5873
+ this.host = input;
5874
+ }
5606
5875
  }
5607
5876
  },
5608
5877
  // https://url.spec.whatwg.org/#cannot-have-a-username-password-port
5609
5878
  cannotHaveUsernamePasswordPort: function () {
5610
- return !this.host || this.cannotBeABaseURL || this.scheme === 'file';
5879
+ return this.host === null || this.host === '' || this.cannotBeABaseURL || this.scheme === 'file';
5611
5880
  },
5612
5881
  // https://url.spec.whatwg.org/#include-credentials
5613
5882
  includesCredentials: function () {
@@ -5645,6 +5914,7 @@
5645
5914
  output += serializeHost(host);
5646
5915
  if (port !== null) output += ':' + port;
5647
5916
  } else if (scheme === 'file') output += '//';
5917
+ if (host === null && !url.cannotBeABaseURL && path.length > 1 && path[0] === '') output += '/.';
5648
5918
  output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';
5649
5919
  if (query !== null) output += '?' + query;
5650
5920
  if (fragment !== null) output += '#' + fragment;
@@ -5661,7 +5931,7 @@
5661
5931
  var scheme = this.scheme;
5662
5932
  var port = this.port;
5663
5933
  if (scheme === 'blob') try {
5664
- return new URLConstructor(scheme.path[0]).origin;
5934
+ return new URLConstructor(this.path[0]).origin;
5665
5935
  } catch (error) {
5666
5936
  return 'null';
5667
5937
  }
@@ -5684,7 +5954,7 @@
5684
5954
  if (this.cannotHaveUsernamePasswordPort()) return;
5685
5955
  this.username = '';
5686
5956
  for (var i = 0; i < codePoints.length; i++) {
5687
- this.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);
5957
+ this.username += utf8PercentEncode(codePoints[i], userinfoPercentEncodeSet);
5688
5958
  }
5689
5959
  },
5690
5960
  // https://url.spec.whatwg.org/#dom-url-password
@@ -5696,7 +5966,7 @@
5696
5966
  if (this.cannotHaveUsernamePasswordPort()) return;
5697
5967
  this.password = '';
5698
5968
  for (var i = 0; i < codePoints.length; i++) {
5699
- this.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);
5969
+ this.password += utf8PercentEncode(codePoints[i], userinfoPercentEncodeSet);
5700
5970
  }
5701
5971
  },
5702
5972
  // https://url.spec.whatwg.org/#dom-url-host
@@ -5902,6 +6172,22 @@
5902
6172
 
5903
6173
  var web_url_toJson = {};
5904
6174
 
6175
+ var getBuiltInPrototypeMethod;
6176
+ var hasRequiredGetBuiltInPrototypeMethod;
6177
+
6178
+ function requireGetBuiltInPrototypeMethod () {
6179
+ if (hasRequiredGetBuiltInPrototypeMethod) return getBuiltInPrototypeMethod;
6180
+ hasRequiredGetBuiltInPrototypeMethod = 1;
6181
+ var globalThis = requireGlobalThis();
6182
+
6183
+ getBuiltInPrototypeMethod = function (CONSTRUCTOR, METHOD) {
6184
+ var Constructor = globalThis[CONSTRUCTOR];
6185
+ var Prototype = Constructor && Constructor.prototype;
6186
+ return Prototype && Prototype[METHOD];
6187
+ };
6188
+ return getBuiltInPrototypeMethod;
6189
+ }
6190
+
5905
6191
  var hasRequiredWeb_url_toJson;
5906
6192
 
5907
6193
  function requireWeb_url_toJson () {
@@ -5909,12 +6195,15 @@
5909
6195
  hasRequiredWeb_url_toJson = 1;
5910
6196
  var $ = require_export();
5911
6197
  var call = requireFunctionCall();
6198
+ var getBuiltInPrototypeMethod = requireGetBuiltInPrototypeMethod();
6199
+
6200
+ var toString = getBuiltInPrototypeMethod('URL', 'toString');
5912
6201
 
5913
6202
  // `URL.prototype.toJSON` method
5914
6203
  // https://url.spec.whatwg.org/#dom-url-tojson
5915
6204
  $({ target: 'URL', proto: true, enumerable: true }, {
5916
6205
  toJSON: function toJSON() {
5917
- return call(URL.prototype.toString, this);
6206
+ return call(toString, this);
5918
6207
  }
5919
6208
  });
5920
6209
  return web_url_toJson;
@@ -6082,8 +6371,8 @@
6082
6371
  * @param {Object<string, string>} props
6083
6372
  */
6084
6373
  const setCssProps = function (el, props) {
6085
- for (let [key, value] of Object.entries(props))
6086
- el.style[key] = value === undefined || value === null ? '' : String(value);
6374
+ for (let _ref of Object.entries(props)) {var _ref2 = _slicedToArray(_ref, 2);let key = _ref2[0];let value = _ref2[1];
6375
+ el.style[key] = value === undefined || value === null ? '' : String(value);}
6087
6376
  };
6088
6377
 
6089
6378
  const generateGetElementSizeFn = function (pseudo, dim, dimCased, startDim, endDim) {
@@ -6384,178 +6673,86 @@
6384
6673
  }
6385
6674
  }
6386
6675
 
6387
- /**
6388
- * @typedef {function(index: number):(number|undefined)} VirtualListHelper~ItemHeightEstimatorFunction
6389
- */
6390
-
6391
- /**
6392
- * @typedef {function():Element} VirtualListHelper~ItemElementCreatorFunction
6393
- */
6394
-
6395
- /**
6396
- * @typedef {function(itemEl: Element, index: number)} VirtualListHelper~ItemRenderFunction
6397
- */
6398
-
6399
- /**
6400
- * @typedef {function(itemEl: Element)} VirtualListHelper~ItemUnrenderFunction
6401
- */
6402
-
6403
- /**
6404
- * @typedef {Object} VirtualListHelper~Options
6405
- * @property {Element} list - the main element to operate inside of
6406
- * @property {Element?} [itemsParent] - the element to use as parent for the items (automatically created in virtual mode, uses parent by default in non-virtual mode)
6407
- * @property {boolean} [autoVirtualWrapperWidth=true] automatically set the width of the virtual wrapper
6408
- * @property {boolean} [hookScrollEvent=true] automatically hook scroll event as needed
6409
- * @property {number} [count=0] the item count
6410
- * @property {boolean} [virtual=true] is virtual mode on?
6411
- * @property {number} [estimatedItemHeight=20] estimated item height
6412
- * @property {number} [buffer=5] the amount of buffer items to keep on each end of the list
6413
- * @property {VirtualListHelper~ItemHeightEstimatorFunction} [itemHeightEstimatorFn] an optional function for providing item height estimations
6414
- * @property {VirtualListHelper~ItemElementCreatorFunction} [itemElementCreatorFn] an optional function for providing fresh item elements (default creates `<li />`s)
6415
- * @property {VirtualListHelper~ItemRenderFunction} [onItemRender] a function for rendering element content based on item index
6416
- * @property {VirtualListHelper~ItemUnrenderFunction} [onItemUnrender] a function for freeing resources in an item element
6417
- * @property {function(height: number)} [onScrollHeightChange] a function to be notified when scroll height changes
6418
- *
6419
- */
6420
-
6421
- /** */
6422
-
6423
6676
  const hasOwnProperty = Object.prototype.hasOwnProperty;
6424
-
6425
6677
  const hasInsertAdjacentElement = Element.prototype.insertAdjacentElement !== undefined;
6426
-
6427
6678
  function insertBefore(el, before, parent) {
6428
6679
  if (!before)
6429
6680
  parent.appendChild(el);else
6430
6681
  if (hasInsertAdjacentElement === false || el instanceof DocumentFragment)
6431
6682
  parent.insertBefore(el, before);else
6683
+
6432
6684
  before.insertAdjacentElement('beforebegin', el);
6433
6685
  }
6434
- /**
6435
- *
6436
- * @param {Element} itemEl
6437
- * @param {DocumentFragment|null} fragment
6438
- * @param {Node|undefined} before
6439
- * @param {Element} itemParent
6440
- * @returns {DocumentFragment|null}
6441
- */
6442
6686
  function insertBeforeWithFragment(itemEl, fragment, before, itemParent) {
6443
6687
  if (itemEl.parentNode !== itemParent) {
6444
6688
  if (!fragment)
6445
6689
  fragment = document.createDocumentFragment();
6446
6690
  fragment.appendChild(itemEl);
6447
- } else {
6691
+ } else
6692
+ {
6448
6693
  // insert fragment
6449
6694
  if (fragment && fragment.childNodes.length > 0) {
6450
6695
  insertBefore(fragment, before, itemParent);
6451
6696
  fragment = null;
6452
6697
  }
6453
-
6454
6698
  // insert element
6455
6699
  if (itemEl.nextSibling !== before) {
6456
6700
  insertBefore(itemEl, before, itemParent);
6457
6701
  }
6458
6702
  }
6459
-
6460
6703
  return fragment;
6461
6704
  }
6462
-
6463
6705
  const DestroyedSymbol = Symbol('destroyed');
6464
-
6465
6706
  class VirtualListHelper {
6466
- /**
6467
- * @param {VirtualListHelper~Options} opts
6468
- */
6469
6707
  constructor(opts) {var _opts$autoVirtualWrap;
6470
- /** @private */
6471
6708
  const p = this._p = {
6472
6709
  // these come from options:
6473
-
6474
6710
  list: opts.list || null,
6475
6711
  hookScrollEvent: opts.hookScrollEvent === undefined ? true : !!opts.hookScrollEvent,
6476
6712
  count: opts.count || 0,
6477
6713
  virtual: opts.virtual === undefined ? true : !!opts.virtual,
6478
6714
  userItemsParent: opts.itemsParent || null,
6479
- setVirtualWrapperWidth: (_opts$autoVirtualWrap = opts.autoVirtualWrapperWidth) !== null && _opts$autoVirtualWrap !== void 0 ? _opts$autoVirtualWrap : true,
6715
+ autoVirtualWrapperWidth: (_opts$autoVirtualWrap = opts.autoVirtualWrapperWidth) !== null && _opts$autoVirtualWrap !== void 0 ? _opts$autoVirtualWrap : true,
6480
6716
  estimatedItemHeight: 20,
6481
6717
  buffer: 5,
6482
-
6483
- /** @type VirtualListHelper~ItemHeightEstimatorFunction|null */
6484
6718
  itemHeightEstimatorFn: null,
6485
-
6486
- /** @type VirtualListHelper~ItemElementCreatorFunction|null */
6487
6719
  itemElementCreatorFn: defaultElementCreator,
6488
-
6489
- /** @type VirtualListHelper~ItemRenderFunction|null */
6490
6720
  onItemRender: null,
6491
-
6492
- /** @type VirtualListHelper~ItemUnrenderFunction|null */
6493
6721
  onItemUnrender: null,
6494
-
6495
- /** @type {function(height: number)|null} */
6496
6722
  onScrollHeightChange: null,
6497
-
6498
6723
  // internal:
6499
-
6500
- /** @type Element|null */
6501
6724
  virtualWrapper: null,
6502
-
6503
- /** @type Element|null */
6504
6725
  currentItemsParent: null,
6505
-
6506
- /** @type {(number|undefined)[]} */
6507
6726
  cachedItemHeights: [],
6508
-
6509
- /** @type {(number|undefined)[]} */
6510
6727
  cachedItemEstimatedHeights: [],
6511
-
6512
- /** @type {(number|undefined)[]} */
6513
6728
  cachedItemPositions: [],
6514
-
6515
- /** @type number */
6516
6729
  itemPositionsNeedsUpdate: 0,
6517
-
6518
- /** @type function */
6519
6730
  boundRender: this.render.bind(this),
6520
-
6521
- /** @type Element[] */
6522
6731
  existingEls: []
6523
6732
  };
6524
-
6525
6733
  p.currentItemsParent = p.userItemsParent || p.list;
6526
-
6527
6734
  this._hookEvents();
6528
-
6529
6735
  if (typeof opts.count === 'number')
6530
6736
  this.setCount(opts.count);
6531
-
6532
6737
  if (typeof opts.virtual === 'boolean')
6533
6738
  this.setVirtual(opts.virtual);
6534
-
6535
6739
  if (typeof opts.estimatedItemHeight === 'number')
6536
6740
  this.setEstimatedItemHeight(opts.estimatedItemHeight);
6537
-
6538
6741
  if (typeof opts.buffer === 'number')
6539
6742
  this.setBuffer(opts.buffer);
6540
-
6541
6743
  if (typeof opts.itemHeightEstimatorFn === 'function')
6542
6744
  this.setItemHeightEstimatorFn(opts.itemHeightEstimatorFn);
6543
-
6544
6745
  if (typeof opts.itemElementCreatorFn === 'function')
6545
6746
  this.setItemElementCreatorFn(opts.itemElementCreatorFn);
6546
-
6547
6747
  if (typeof opts.onItemRender === 'function')
6548
6748
  this.setOnItemRender(opts.onItemRender);
6549
-
6550
6749
  if (typeof opts.onItemUnrender === 'function')
6551
6750
  this.setOnItemUnrender(opts.onItemUnrender);
6552
-
6553
6751
  if (typeof opts.onScrollHeightChange === 'function')
6554
6752
  this.setOnScrollHeightChange(opts.onScrollHeightChange);
6555
6753
  }
6556
-
6557
- /**
6558
- * Clean up and free up all resources.
6754
+ /**
6755
+ * Clean up and free up all resources.
6559
6756
  */
6560
6757
  destroy() {
6561
6758
  if (this[DestroyedSymbol])
@@ -6563,252 +6760,178 @@
6563
6760
  this[DestroyedSymbol] = true;
6564
6761
  this._unhookEvents().invalidate()._destroyElements();
6565
6762
  }
6566
-
6567
- /**
6568
- * Sets whether 'scroll' event on the list should be hooked automatically.
6569
- * @param {boolean} enabled
6570
- * @returns {VirtualListHelper}
6763
+ /**
6764
+ * Sets whether 'scroll' event on the list should be hooked automatically.
6571
6765
  */
6572
6766
  setHookScrollEvent(enabled) {
6573
6767
  const p = this._p;
6574
6768
  enabled = enabled === undefined ? true : !!enabled;
6575
-
6576
6769
  if (p.hookScrollEvent === enabled)
6577
6770
  return this;
6578
-
6579
6771
  p.hookScrollEvent = enabled;
6580
-
6581
6772
  this._unhookEvents()._hookEvents();
6582
-
6583
6773
  return this;
6584
6774
  }
6585
-
6586
- /**
6587
- * @returns {boolean} whether 'scroll' event on the list should be hooked automatically
6588
- */
6589
6775
  isHookScrollEventEnabled() {
6590
6776
  const p = this._p;
6591
6777
  return p.hookScrollEvent;
6592
6778
  }
6593
-
6594
- /**
6595
- * Sets the list item count. <br />
6596
- * You should probably call `render()` after this.
6597
- * @param {number} count
6598
- * @returns {VirtualListHelper}
6779
+ /**
6780
+ * Sets the list item count. <br />
6781
+ * You should probably call `render()` after this.
6599
6782
  */
6600
6783
  setCount(count) {
6601
6784
  const p = this._p;
6602
6785
  p.count = count;
6603
-
6604
6786
  return this.invalidate();
6605
6787
  }
6606
-
6607
- /**
6608
- * @returns {number} current item count
6609
- */
6610
6788
  getCount() {
6611
6789
  const p = this._p;
6612
6790
  return p.count;
6613
6791
  }
6614
-
6615
- /**
6616
- * Switches between virtual and non-virtual mode. <br />
6617
- * The list is invalidated automatically. <br />
6618
- * You should call `render()` to update the view.
6619
- * @param {boolean} enabled
6620
- * @returns {VirtualListHelper}
6792
+ /**
6793
+ * Switches between virtual and non-virtual mode. <br />
6794
+ * The list is invalidated automatically. <br />
6795
+ * You should call `render()` to update the view.
6621
6796
  */
6622
6797
  setVirtual(enabled) {
6623
6798
  const p = this._p;
6624
6799
  enabled = enabled === undefined ? true : !!enabled;
6625
-
6626
6800
  if (p.virtual === enabled)
6627
6801
  return this;
6628
-
6629
6802
  p.virtual = enabled;
6630
-
6631
6803
  this._hookEvents().invalidate()._destroyElements();
6632
-
6633
6804
  return this;
6634
6805
  }
6635
-
6636
- /**
6637
- * @returns {boolean} virtual mode
6638
- */
6639
6806
  isVirtual() {
6640
6807
  const p = this._p;
6641
6808
  return p.virtual;
6642
6809
  }
6643
-
6644
- /**
6645
- * Sets estimated item height. <br />
6646
- * No need to be accurate. <br />
6647
- * The better the estimation - the better the scrollbar behavior will be. <br />
6648
- * Applicable for virtual-mode only. <br />
6649
- * You should `invalidate` if you want this to take effect on the existing rendering.
6650
- * @param {number} height - a positive number representing estimated item height.
6651
- * @returns {VirtualListHelper}
6810
+ /**
6811
+ * Sets estimated item height to a positive number. <br />
6812
+ * No need to be accurate. <br />
6813
+ * The better the estimation - the better the scrollbar behavior will be. <br />
6814
+ * Applicable for virtual-mode only. <br />
6815
+ * You should `invalidate` if you want this to take effect on the existing rendering.
6652
6816
  */
6653
6817
  setEstimatedItemHeight(height) {
6654
6818
  const p = this._p;
6655
6819
  p.estimatedItemHeight = Math.abs((typeof height === 'number' ? height : Number(height)) || 20);
6656
6820
  return this;
6657
6821
  }
6658
-
6659
- /**
6660
- * @returns {number} current item height estimation
6661
- */
6662
6822
  getEstimatedItemHeight() {
6663
6823
  const p = this._p;
6664
6824
  return p.estimatedItemHeight;
6665
6825
  }
6666
-
6667
- /**
6668
- * Sets whether the virtual wrapper width should be set automatically. <br />
6669
- * @param {boolean} enabled
6670
- * @returns {VirtualListHelper}
6826
+ /**
6827
+ * Sets whether the virtual wrapper width should be set automatically. <br />
6671
6828
  */
6672
6829
  setAutoVirtualWrapperWidth(enabled) {
6673
6830
  const p = this._p;
6674
6831
  p.autoVirtualWrapperWidth = enabled === undefined ? true : !!enabled;
6675
-
6676
6832
  if (p.virtualWrapper) {
6677
6833
  if (p.autoVirtualWrapperWidth !== p.virtualWrapperWidthWasSet) {
6678
6834
  p.virtualWrapper.style.width = p.autoVirtualWrapperWidth ? '100%' : '';
6679
6835
  p.virtualWrapperWidthWasSet = p.autoVirtualWrapperWidth;
6680
6836
  }
6681
6837
  }
6682
-
6683
6838
  return this;
6684
6839
  }
6685
-
6686
- /**
6687
- * @returns {boolean} whether the virtual wrapper width should be set automatically
6688
- */
6689
6840
  isAutoVirtualWrapperWidth() {
6690
6841
  const p = this._p;
6691
6842
  return p.autoVirtualWrapperWidth;
6692
6843
  }
6693
-
6694
- /**
6695
- * Sets the amount of buffer items to keep on each end of the list. <br />
6696
- * Applicable for virtual-mode only.
6697
- * @param {number} buffer - a positive value representing the count of buffer items for each end.
6698
- * @returns {VirtualListHelper}
6844
+ /**
6845
+ * The buffer is a positive count of items on each end.
6846
+ * Sets the amount of buffer items to keep on each end of the list. <br />
6847
+ * Applicable for virtual-mode only.
6699
6848
  */
6700
6849
  setBuffer(buffer) {
6701
6850
  const p = this._p;
6702
6851
  p.buffer = Math.abs(typeof buffer === 'number' ? buffer : Number(buffer) || 5);
6703
6852
  return this;
6704
6853
  }
6705
-
6706
- /**
6707
- * @returns {number} current buffer value
6708
- */
6709
6854
  getBuffer() {
6710
6855
  const p = this._p;
6711
6856
  return p.buffer;
6712
6857
  }
6713
-
6714
- /**
6715
- * The `itemHeightEstimatorFn` is an alternative to `estimatedItemHeight` to give better estimations for specific item. <br/>
6716
- * It's optional, and if it's present - it should return either a numeric height estimation,
6717
- * or `undefined` to fall back to the default estimation. <br />
6718
- * You should `invalidate` if you want this to take effect on the existing rendering.
6719
- * @param {VirtualListHelper~ItemHeightEstimatorFunction} fn
6720
- * @returns {VirtualListHelper}
6858
+ /**
6859
+ * The `itemHeightEstimatorFn` is an alternative to `estimatedItemHeight` to give better estimations for specific item. <br/>
6860
+ * It's optional, and if it's present - it should return either a numeric height estimation,
6861
+ * or `undefined` to fall back to the default estimation. <br />
6862
+ * You should `invalidate` if you want this to take effect on the existing rendering.
6721
6863
  */
6722
6864
  setItemHeightEstimatorFn(fn) {
6723
6865
  const p = this._p;
6724
6866
  p.itemHeightEstimatorFn = fn;
6725
6867
  return this;
6726
6868
  }
6727
-
6728
- /**
6729
- * The `itemElementCreatorFn` is a function creating a basic item element, that will be possibly reused later. <br />
6730
- * It has no association with a specific item index. <br />
6731
- * You should `invalidate` if you want this to take effect on the existing rendering.
6732
- * @param {VirtualListHelper~ItemElementCreatorFunction} fn
6733
- * @returns {VirtualListHelper}
6869
+ /**
6870
+ * The `itemElementCreatorFn` is a function creating a basic item element, that will be possibly reused later. <br />
6871
+ * It has no association with a specific item index. <br />
6872
+ * You should `invalidate` if you want this to take effect on the existing rendering.
6734
6873
  */
6735
6874
  setItemElementCreatorFn(fn) {
6736
6875
  const p = this._p;
6737
6876
  p.itemElementCreatorFn = fn || defaultElementCreator;
6738
6877
  return this;
6739
6878
  }
6740
-
6741
- /**
6742
- * The `onItemRender` is a function called for rendering the contents of an item. <br />
6743
- * It's passed an `Element` and an item index. <br />
6744
- * You should `invalidate` if you want this to take effect on the existing rendering.
6745
- * @param {VirtualListHelper~ItemRenderFunction} fn
6746
- * @returns {VirtualListHelper}
6879
+ /**
6880
+ * The `onItemRender` is a function called for rendering the contents of an item. <br />
6881
+ * It's passed an `Element` and an item index. <br />
6882
+ * You should `invalidate` if you want this to take effect on the existing rendering.
6747
6883
  */
6748
6884
  setOnItemRender(fn) {
6749
6885
  const p = this._p;
6750
6886
  p.onItemRender = fn;
6751
6887
  return this;
6752
6888
  }
6753
-
6754
- /**
6755
- * The `onItemUnrender` is a function called for freeing resources in an item element,
6756
- * if you've attached something that needs to be explicitly freed. <br />
6757
- * It's passed an `Element` only, and has no association with a specific index,
6758
- * as by the time it's called - the indexes are probably not valid anymore.
6759
- * @param {VirtualListHelper~ItemUnrenderFunction} fn
6760
- * @returns {VirtualListHelper}
6889
+ /**
6890
+ * The `onItemUnrender` is a function called for freeing resources in an item element,
6891
+ * if you've attached something that needs to be explicitly freed. <br />
6892
+ * It's passed an `Element` only, and has no association with a specific index,
6893
+ * as by the time it's called - the indexes are probably not valid anymore.
6761
6894
  */
6762
6895
  setOnItemUnrender(fn) {
6763
6896
  const p = this._p;
6764
6897
  p.onItemUnrender = fn;
6765
6898
  return this;
6766
6899
  }
6767
-
6768
- /**
6769
- * The `onScrollHeightChange` is a function called when the scroll height changes.
6770
- * @param {function(height: number)} fn
6771
- * @returns {VirtualListHelper}
6900
+ /**
6901
+ * The `onScrollHeightChange` is a function called when the scroll height changes.
6772
6902
  */
6773
6903
  setOnScrollHeightChange(fn) {
6774
6904
  const p = this._p;
6775
6905
  p.onScrollHeightChange = fn;
6776
6906
  return this;
6777
6907
  }
6778
-
6779
- /**
6780
- * Estimates the full scroll height. This gets better as more renderings occur.
6781
- * @returns {number}
6908
+ /**
6909
+ * Estimates the full scroll height. This gets better as more renderings occur.
6782
6910
  */
6783
6911
  estimateFullHeight() {
6784
6912
  const p = this._p;
6785
-
6786
6913
  if (p.count === 0)
6787
6914
  return 0;
6788
-
6789
6915
  if (p.virtual) {
6790
6916
  return this._calculateItemPosition(p.count) || 0;
6791
- } else {
6917
+ } else
6918
+ {
6792
6919
  const existingEls = p.existingEls;
6793
6920
  if (p.count === existingEls.length) {
6794
6921
  let rect1 = existingEls[0].getBoundingClientRect();
6795
6922
  let rect2 = existingEls[existingEls.length - 1].getBoundingClientRect();
6796
6923
  return rect2.top - rect1.top + rect2.height;
6797
6924
  }
6798
-
6799
6925
  return this._calculateItemPosition(p.count) || 0;
6800
6926
  }
6801
6927
  }
6802
-
6803
- /**
6804
- * States that the cached positions/heights are invalid,
6805
- * and needs to be completely re-calculated.<br />
6806
- * You should probably call `render()` after this.
6807
- * @returns {VirtualListHelper}
6928
+ /**
6929
+ * States that the cached positions/heights are invalid,
6930
+ * and needs to be completely re-calculated.<br />
6931
+ * You should probably call `render()` after this.
6808
6932
  */
6809
6933
  invalidatePositions() {
6810
6934
  const p = this._p;
6811
-
6812
6935
  p.itemPositionsNeedsUpdate = 0;
6813
6936
  p.cachedItemHeights = [];
6814
6937
  p.cachedItemEstimatedHeights = [];
@@ -6816,40 +6939,31 @@
6816
6939
  p.cachedItemHeights.length = p.count;
6817
6940
  p.cachedItemEstimatedHeights.length = p.count;
6818
6941
  p.cachedItemPositions.length = p.count;
6819
-
6820
6942
  return this;
6821
6943
  }
6822
-
6823
- /**
6824
- * States that the indexes/item count/rendered content are invalid,
6825
- * and needs to be completely re-calculated and re-rendered. <br />
6826
- * You should probably call `render()` after this.
6827
- * @returns {VirtualListHelper}
6944
+ /**
6945
+ * States that the indexes/item count/rendered content are invalid,
6946
+ * and needs to be completely re-calculated and re-rendered. <br />
6947
+ * You should probably call `render()` after this.
6828
6948
  */
6829
6949
  invalidate() {
6830
6950
  const p = this._p;
6831
-
6832
6951
  this.invalidatePositions();
6833
-
6834
6952
  if (!p.virtual) {
6835
6953
  this._destroyElements();
6836
6954
  }
6837
-
6838
6955
  for (let el of p.existingEls)
6839
6956
  delete el[ItemIndexSymbol];
6840
-
6841
6957
  return this;
6842
6958
  }
6843
-
6844
- /**
6845
- * Renders the current viewport. <br />
6846
- * Call this after making changes to the list. <br />
6847
- * In virtual mode, this is called automatically for every scroll event.
6959
+ /**
6960
+ * Renders the current viewport. <br />
6961
+ * Call this after making changes to the list. <br />
6962
+ * In virtual mode, this is called automatically for every scroll event.
6848
6963
  */
6849
6964
  render() {
6850
6965
  if (this[DestroyedSymbol])
6851
6966
  return;
6852
-
6853
6967
  const p = this._p;
6854
6968
  const list = p.list;
6855
6969
  const virtual = p.virtual;
@@ -6863,210 +6977,158 @@
6863
6977
  let onItemUnrender = p.onItemUnrender;
6864
6978
  let existingEls = p.existingEls;
6865
6979
  let existingCount = existingEls.length;
6866
-
6867
6980
  if (virtual) {
6868
6981
  const originalWidth = list.clientWidth;
6869
-
6870
6982
  if (!virtualWrapper) {
6871
6983
  virtualWrapper = p.virtualWrapper = p.userItemsParent;
6872
6984
  if (!virtualWrapper) {
6873
6985
  virtualWrapper = p.virtualWrapper = document.createElement('div');
6874
6986
  list.appendChild(virtualWrapper);
6875
6987
  }
6876
-
6877
6988
  this._resetCurrentItemsParent();
6878
6989
  itemParent = p.currentItemsParent;
6879
-
6880
6990
  if (p.autoVirtualWrapperWidth) {
6881
6991
  virtualWrapper.style.width = '100%';
6882
6992
  p.virtualWrapperWidthWasSet = true;
6883
- } else {
6993
+ } else
6994
+ {
6884
6995
  p.virtualWrapperWidthWasSet = false;
6885
6996
  }
6886
6997
  }
6887
-
6888
6998
  // Mark all of them for potential reuse
6889
6999
  for (let i = 0; i < existingCount; i++) {
6890
7000
  existingEls[i][ReuseElSymbol] = true;
6891
7001
  }
6892
-
6893
7002
  // Make sure we have at least estimated positions for all items so we can translate scroll position
6894
7003
  this._calculateItemPosition(p.count - 1);
6895
-
6896
7004
  // Find existing elements index range
6897
7005
  let existingRange = this._getExistingElsRange();
6898
-
6899
7006
  // Find first visible element
6900
7007
  let firstVisibleIndex = binarySearchPosition(p.cachedItemPositions, scrollTop);
6901
7008
  let firstRenderIndex = Math.max(0, firstVisibleIndex - buffer);
6902
-
6903
7009
  // Iterate over viewport
6904
7010
  let index = firstRenderIndex;
6905
7011
  let renderPos = this._calculateItemPosition(index);
6906
7012
  let bufferEnd = buffer;
6907
-
6908
7013
  // we want to render until viewport's bottom + buffer items
6909
7014
  let maxIndexToRender = Math.max(index, binarySearchPosition(p.cachedItemPositions, visibleBottom - 1) + 1 + buffer);
6910
-
6911
7015
  let insertedItems = [];
6912
-
6913
- /** @type DocumentFragment|null */
6914
7016
  let fragment = null;
6915
-
6916
7017
  // Find the element to insert before
6917
7018
  let before = virtualWrapper.childNodes[0];
6918
-
6919
7019
  const findElementToReuse = function (index) {
6920
7020
  // Find existing element to reuse
6921
- /** @type Element|undefined */
6922
7021
  let existingEl = undefined;
6923
-
6924
7022
  if (existingRange.firstIndex !== -1 && index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
6925
7023
  existingEl = existingEls.find((x) => x[ItemIndexSymbol] === index && x[ReuseElSymbol] === true);
6926
7024
  }
6927
-
6928
7025
  if (existingEl === undefined) {
6929
7026
  existingEl = (existingRange.firstIndex < firstRenderIndex || existingRange.firstValidArrayIndex > 0 ?
6930
- existingEls.find((x) =>
6931
- (x[ItemIndexSymbol] < firstRenderIndex || false === hasOwnProperty.call(x, ItemIndexSymbol)) &&
7027
+ existingEls.find((x) => (x[ItemIndexSymbol] < firstRenderIndex || false === hasOwnProperty.call(x, ItemIndexSymbol)) &&
6932
7028
  x[ReuseElSymbol] === true) :
6933
- undefined) ||
6934
- findLast(existingEls, (x) => x[ReuseElSymbol] === true);
7029
+ undefined) || findLast(existingEls, (x) => x[ReuseElSymbol] === true);
6935
7030
  }
6936
-
6937
7031
  if (existingEl !== undefined) {
6938
7032
  delete existingEl[ReuseElSymbol];
6939
7033
  }
6940
-
6941
7034
  return existingEl;
6942
7035
  };
6943
-
6944
7036
  // First we iterate and try to add all at once in a fragment, as much as we can.
6945
7037
  // And then reflow the at once.
6946
7038
  for (; index < count && index < maxIndexToRender; index++) {
6947
7039
  let existingEl = findElementToReuse(index);
6948
-
6949
7040
  if (before && before === existingEl)
6950
7041
  before = before.nextSibling;
6951
-
6952
7042
  // Dequeue the element by reusing or creating a new one
6953
7043
  const itemEl = this._dequeueElementForIndex(existingEl, index, before, true);
6954
7044
  insertedItems.push([itemEl, index]);
6955
-
6956
7045
  fragment = insertBeforeWithFragment(itemEl, fragment, before, itemParent);
6957
7046
  }
6958
-
6959
7047
  // Insert any remaining fragment
6960
7048
  if (fragment && fragment.childNodes.length > 0) {
6961
7049
  insertBefore(fragment, before, itemParent);
6962
7050
  }
6963
-
6964
7051
  // Iterate on inserted items and reflow them
6965
7052
  for (let item of insertedItems) {
6966
7053
  const index = item[1];
6967
7054
  this._insertItemAndFlow(item[0], index, false /* inserted already */);
6968
7055
  renderPos = p.cachedItemPositions[index] + p.cachedItemHeights[index];
6969
7056
  }
6970
-
6971
7057
  // See if we still need to insert more items
6972
7058
  if (renderPos < visibleBottom) {
6973
7059
  for (; (renderPos < visibleBottom || bufferEnd-- > 0) && index < count; index++) {
6974
7060
  let existingEl = findElementToReuse(index);
6975
-
6976
7061
  if (before && before === existingEl)
6977
7062
  before = before.nextSibling;
6978
-
6979
7063
  // Dequeue the element by reusing or creating a new one
6980
7064
  this._dequeueElementForIndex(existingEl, index, before, false);
6981
-
6982
7065
  // Increment pointers
6983
7066
  renderPos = p.cachedItemPositions[index] + p.cachedItemHeights[index];
6984
7067
  }
6985
7068
  }
6986
-
6987
7069
  // Calculate up-to-date scroll height
6988
7070
  let scrollHeight = this.estimateFullHeight();
6989
7071
  let scrollHeightPx = scrollHeight + 'px';
6990
-
6991
7072
  if (virtualWrapper.style.height !== scrollHeightPx) {var _p$onScrollHeightChan;
6992
7073
  virtualWrapper.style.height = scrollHeightPx;
6993
7074
  (_p$onScrollHeightChan = p.onScrollHeightChange) === null || _p$onScrollHeightChan === void 0 || _p$onScrollHeightChan.call(p, scrollHeight);
6994
7075
  }
6995
-
6996
7076
  if (originalWidth !== list.clientWidth)
6997
7077
  this.render();
6998
- } else {// non-virtual
7078
+ } else
7079
+ {// non-virtual
6999
7080
  if (count !== existingEls.length) {
7000
7081
  for (let i = 0; i < existingCount; i++) {
7001
7082
  existingEls[i][ReuseElSymbol] = true;
7002
7083
  }
7003
-
7004
7084
  // Find the element to insert before
7005
7085
  let before = itemParent.childNodes[0];
7006
-
7007
- /** @type DocumentFragment|null */
7008
7086
  let fragment = null;
7009
-
7010
7087
  for (let index = 0; index < count; index++) {
7011
7088
  // Find existing element to reuse
7012
7089
  let existingEl = existingEls.find((x) => x[ItemIndexSymbol] === index && x[ReuseElSymbol] === true);
7013
-
7014
7090
  if (existingEl !== undefined) {
7015
7091
  delete existingEl[ReuseElSymbol];
7016
7092
  }
7017
-
7018
7093
  if (before && before === existingEl)
7019
7094
  before = before.nextSibling;
7020
-
7021
7095
  // Dequeue the element by reusing or creating a new one
7022
7096
  const itemEl = this._dequeueElementForIndex(existingEl, index, before, true);
7023
-
7024
7097
  fragment = insertBeforeWithFragment(itemEl, fragment, before, itemParent);
7025
7098
  }
7026
-
7027
7099
  // Insert any remaining fragment
7028
7100
  if (fragment && fragment.childNodes.length > 0) {
7029
7101
  insertBefore(fragment, before, itemParent);
7030
7102
  }
7031
7103
  }
7032
7104
  }
7033
-
7034
7105
  // Cleanup extra unused elements
7035
7106
  existingCount = existingEls.length; // May have changed
7036
7107
  for (let i = 0; i < existingCount; i++) {
7037
7108
  const el = existingEls[i];
7038
- if (el[ReuseElSymbol] !== true) continue;
7039
-
7109
+ if (el[ReuseElSymbol] !== true)
7110
+ continue;
7040
7111
  let parent = el.parentNode;
7041
7112
  if (parent)
7042
7113
  parent.removeChild(el);
7043
7114
  if (onItemUnrender && el[ItemIndexSymbol] !== undefined)
7044
7115
  onItemUnrender(el);
7045
7116
  existingEls.splice(i, 1);
7046
-
7047
7117
  i--;
7048
7118
  existingCount--;
7049
7119
  }
7050
7120
  }
7051
-
7052
- /**
7053
- * States that items were added at a certain position in the list. <br />
7054
- * Virtual mode: Call `render()` to update the view after making changes.
7055
- * @param {number} count
7056
- * @param {number} [atIndex=-1]
7057
- * @returns {VirtualListHelper}
7121
+ /**
7122
+ * States that items were added at a certain position in the list. <br />
7123
+ * Virtual mode: Call `render()` to update the view after making changes.
7058
7124
  */
7059
7125
  addItemsAt(count) {let atIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;
7060
7126
  if (typeof count !== 'number' || count <= 0)
7061
7127
  return this;
7062
-
7063
7128
  const p = this._p;
7064
-
7065
7129
  if (atIndex < 0 || atIndex >= p.count)
7066
7130
  atIndex = p.count;
7067
-
7068
7131
  p.count += count;
7069
-
7070
7132
  if (p.virtual) {
7071
7133
  if (atIndex >= 0 && atIndex < p.count) {
7072
7134
  this._invalidateItemIndexesAt(atIndex, -1);
@@ -7077,54 +7139,36 @@
7077
7139
  let existingCount = existingEls.length;
7078
7140
  if (existingCount !== p.count - count)
7079
7141
  return this;
7080
-
7081
7142
  let existingRange = this._getExistingElsRange();
7082
7143
  if (existingRange.firstValidArrayIndex === -1)
7083
7144
  return this;
7084
-
7085
7145
  const itemParent = p.currentItemsParent;
7086
-
7087
7146
  let startIndex = existingRange.firstValidArrayIndex + atIndex - existingRange.firstIndex;
7088
-
7089
7147
  this._pushItemIndexesAt(atIndex, count);
7090
-
7091
- /** @type Node|undefined */
7092
7148
  let before = existingEls[startIndex - 1] ?
7093
7149
  existingEls[startIndex - 1].nextSibling :
7094
7150
  existingEls[0];
7095
-
7096
- /** @type DocumentFragment|null */
7097
7151
  let fragment = null;
7098
-
7099
7152
  for (let index = atIndex, end = atIndex + count; index < end; index++) {
7100
7153
  const itemEl = this._dequeueElementForIndex(undefined, index, before, true);
7101
7154
  fragment = insertBeforeWithFragment(itemEl, fragment, before, itemParent);
7102
7155
  }
7103
-
7104
7156
  // Insert any remaining fragment
7105
7157
  if (fragment && fragment.childNodes.length > 0) {
7106
7158
  insertBefore(fragment, before, itemParent);
7107
7159
  }
7108
7160
  }
7109
-
7110
7161
  return this;
7111
7162
  }
7112
-
7113
- /**
7114
- * States that items were removed at a certain position in the list. <br />
7115
- * Virtual mode: Call `render()` to update the view after making changes.
7116
- * @param {number} count
7117
- * @param {number} atIndex
7118
- * @returns {VirtualListHelper}
7163
+ /**
7164
+ * States that items were removed at a certain position in the list. <br />
7165
+ * Virtual mode: Call `render()` to update the view after making changes.
7119
7166
  */
7120
7167
  removeItemsAt(count, atIndex) {
7121
7168
  const p = this._p;
7122
-
7123
7169
  if (typeof count !== 'number' || typeof atIndex !== 'number' || count <= 0 || atIndex < 0 || atIndex >= p.count)
7124
7170
  return this;
7125
-
7126
7171
  p.count -= Math.min(count, p.count - atIndex);
7127
-
7128
7172
  if (p.virtual) {
7129
7173
  this._invalidateItemIndexesAt(atIndex, -1);
7130
7174
  } else
@@ -7133,19 +7177,15 @@
7133
7177
  let existingCount = existingEls.length;
7134
7178
  if (existingCount !== p.count + count)
7135
7179
  return this;
7136
-
7137
7180
  let existingRange = this._getExistingElsRange();
7138
7181
  if (existingRange.firstValidArrayIndex === -1)
7139
7182
  return this;
7140
-
7141
7183
  this._pushItemIndexesAt(atIndex + count, -count);
7142
-
7143
7184
  const onItemUnrender = p.onItemUnrender;
7144
7185
  let index = existingRange.firstValidArrayIndex + atIndex - existingRange.firstIndex;
7145
7186
  if (index < existingEls.length) {
7146
7187
  for (let i = 0; i < count; i++) {
7147
7188
  let itemEl = existingEls[index + i];
7148
-
7149
7189
  let parent = itemEl.parentNode;
7150
7190
  if (parent)
7151
7191
  parent.removeChild(itemEl);
@@ -7155,23 +7195,17 @@
7155
7195
  existingEls.splice(index, count);
7156
7196
  }
7157
7197
  }
7158
-
7159
7198
  return this;
7160
7199
  }
7161
-
7162
- /**
7163
- * Mark an element for a re-render. <br />
7164
- * Virtual mode: Call `render()` to update the view after making changes. <br />
7165
- * Non-virtual mode - the element is re-rendered immediately.
7166
- * @param {number} index - the index of the element to re-render
7167
- * @returns {VirtualListHelper}
7200
+ /**
7201
+ * Mark an element for a re-render. <br />
7202
+ * Virtual mode: Call `render()` to update the view after making changes. <br />
7203
+ * Non-virtual mode - the element is re-rendered immediately.
7168
7204
  */
7169
7205
  refreshItemAt(index) {
7170
7206
  const p = this._p;
7171
-
7172
7207
  if (typeof index !== 'number' || index < 0 || index >= p.count)
7173
7208
  return this;
7174
-
7175
7209
  if (p.virtual) {
7176
7210
  this._invalidateItemIndexesAt(index, 1);
7177
7211
  } else
@@ -7180,128 +7214,93 @@
7180
7214
  let existingCount = existingEls.length;
7181
7215
  if (existingCount !== p.count)
7182
7216
  return this;
7183
-
7184
7217
  let existingRange = this._getExistingElsRange();
7185
-
7186
7218
  if (index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
7187
7219
  let itemEl = existingEls[existingRange.firstValidArrayIndex + index - existingRange.firstIndex];
7188
7220
  delete itemEl[ItemIndexSymbol];
7189
7221
  this._dequeueElementForIndex(itemEl, index, itemEl.nextSibling, false);
7190
7222
  }
7191
7223
  }
7192
-
7193
7224
  return this;
7194
7225
  }
7195
-
7196
- /**
7197
- * Tests whether an item at the specified index is rendered.
7198
- * @param {number} index - the index to test
7199
- * @returns {boolean}
7226
+ /**
7227
+ * Tests whether an item at the specified index is rendered.
7200
7228
  */
7201
7229
  isItemRendered(index) {
7202
7230
  const p = this._p;
7203
-
7204
7231
  if (typeof index !== 'number' || index < 0 || index >= p.count)
7205
7232
  return false;
7206
-
7207
7233
  let existingRange = this._getExistingElsRange();
7208
-
7209
7234
  return index >= existingRange.firstIndex && index <= existingRange.lastIndex;
7210
7235
  }
7211
-
7212
- /**
7213
- * Retrieves DOM element for the item at the specified index - if it's currently rendered.
7214
- * @param {number} index - the index to retrieve
7215
- * @returns {Element|undefined}
7236
+ /**
7237
+ * Retrieves DOM element for the item at the specified index - if it's currently rendered.
7216
7238
  */
7217
7239
  getItemElementAt(index) {
7218
7240
  const p = this._p;
7219
-
7220
7241
  if (typeof index !== 'number' || index < 0 || index >= p.count)
7221
7242
  return undefined;
7222
-
7223
7243
  let existingEls = p.existingEls;
7224
7244
  let existingRange = this._getExistingElsRange();
7225
-
7226
7245
  if (index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
7227
7246
  return existingEls[existingRange.firstValidArrayIndex + index - existingRange.firstIndex];
7228
7247
  }
7229
-
7230
7248
  return undefined;
7231
7249
  }
7232
-
7233
- /**
7234
- * Retrieves the position for the specified index. <br />
7235
- * Can be used to scroll to a specific item.
7236
- * @param {number} index
7237
- * @returns {number|undefined}
7250
+ /**
7251
+ * Retrieves the position for the specified index. <br />
7252
+ * Can be used to scroll to a specific item.
7238
7253
  */
7239
7254
  getItemPosition(index) {
7240
7255
  const p = this._p;
7241
-
7242
7256
  if (typeof index !== 'number' || index < 0 || index >= p.count)
7243
7257
  return undefined;
7244
-
7245
7258
  if (p.virtual) {
7246
7259
  return this._calculateItemPosition(index);
7247
- } else {
7260
+ } else
7261
+ {
7248
7262
  let itemEl = this.getItemElementAt(index);
7249
7263
  if (itemEl === undefined)
7250
7264
  return undefined;
7251
-
7252
7265
  const list = p.list;
7253
7266
  return getElementOffset(itemEl).top - getElementOffset(list).top + list.scrollTop;
7254
7267
  }
7255
7268
  }
7256
-
7257
- /**
7258
- * Retrieves the item index for the specified element
7259
- * @param {Element} el
7260
- * @returns {number|undefined}
7269
+ /**
7270
+ * Retrieves the item index for the specified element
7261
7271
  */
7262
7272
  getItemIndexFromElement(el) {
7263
7273
  return el ? el[ItemIndexSymbol] : undefined;
7264
7274
  }
7265
-
7266
- /**
7267
- * Retrieves the size (or estimated size, if unknown) for the specified index. <br />
7268
- * @param {number} index
7269
- * @returns {number|undefined}
7275
+ /**
7276
+ * Retrieves the size (or estimated size, if unknown) for the specified index. <br />
7270
7277
  */
7271
7278
  getItemSize(index) {
7272
7279
  const p = this._p;
7273
-
7274
7280
  if (typeof index !== 'number' || index < 0 || index >= p.count)
7275
7281
  return undefined;
7276
-
7277
- let height = p.cachedItemHeights[index - 1]; // already calculated
7278
-
7282
+ let height = p.cachedItemHeights[index]; // already calculated
7279
7283
  if (height === undefined) {
7280
- height = p.itemHeightEstimatorFn ? p.itemHeightEstimatorFn(index - 1) : null; // estimated per item
7281
-
7284
+ height = p.itemHeightEstimatorFn ? p.itemHeightEstimatorFn(index) : null; // estimated per item
7282
7285
  if (typeof height !== 'number')
7283
7286
  height = p.estimatedItemHeight; // estimated
7284
-
7285
- p.cachedItemEstimatedHeights[index - 1] = height;
7287
+ p.cachedItemEstimatedHeights[index] = height;
7286
7288
  }
7287
-
7288
7289
  return height;
7289
7290
  }
7290
-
7291
- /**
7292
- * Retrieves the number of items that fit into the current viewport.
7293
- * @returns {number}
7291
+ /**
7292
+ * Retrieves the number of items that fit into the current viewport.
7294
7293
  */
7295
7294
  getVisibleItemCount() {
7296
7295
  const p = this._p,list = p.list;
7297
-
7298
7296
  let scrollTop = list.scrollTop;
7299
7297
  let visibleHeight = list.clientHeight;
7300
7298
  let firstVisibleIndex, lastVisibleIndex;
7301
-
7299
+ if (p.count === 0 || visibleHeight === 0)
7300
+ return 0;
7302
7301
  if (p.virtual) {
7303
- firstVisibleIndex = binarySearchPosition(p.cachedItemPositions, scrollTop);
7304
- lastVisibleIndex = binarySearchPosition(p.cachedItemPositions, scrollTop + visibleHeight, firstVisibleIndex);
7302
+ firstVisibleIndex = binarySearchPosition(p.cachedItemPositions, scrollTop, 0, p.count - 1);
7303
+ lastVisibleIndex = binarySearchPosition(p.cachedItemPositions, scrollTop + visibleHeight, firstVisibleIndex, p.count - 1);
7305
7304
  } else
7306
7305
  {
7307
7306
  const retriever = (i) => {
@@ -7310,32 +7309,28 @@
7310
7309
  pos = Infinity;
7311
7310
  return pos;
7312
7311
  };
7313
-
7314
7312
  firstVisibleIndex = binarySearchPositionByFn(p.count, retriever, scrollTop);
7315
7313
  lastVisibleIndex = binarySearchPositionByFn(p.count, retriever, scrollTop + visibleHeight, firstVisibleIndex);
7316
7314
  }
7317
-
7318
7315
  if (this.getItemPosition(lastVisibleIndex) === scrollTop + visibleHeight)
7319
7316
  lastVisibleIndex--;
7320
7317
  return lastVisibleIndex - firstVisibleIndex + 1;
7321
7318
  }
7322
-
7323
- /**
7324
- * Renders a temporary ghost item. Can be used for testings several aspects of a proposed element, i.e measurements.
7325
- * @param {*} ghostIndex - the value to pass as the index for the renderer function
7326
- * @param {boolean} append - whether to append the item element to the DOM
7327
- * @param {function(itemEl: Element)} ghostTester - the function that will receive the element, called synchronously.
7319
+ /**
7320
+ * The ghost index is passed directly to the renderer. The tester is called synchronously.
7321
+ * Appends the element to the DOM only when append is true.
7322
+ * Renders a temporary ghost item. Can be used for testings several aspects of a proposed element, i.e measurements.
7328
7323
  */
7329
7324
  createGhostItemElement(ghostIndex, append, ghostTester) {
7330
7325
  const p = this._p;
7331
-
7332
7326
  let itemEl = this._dequeueElementForIndex(null, ghostIndex, false, true);
7333
7327
  try {
7334
7328
  if (append) {
7335
7329
  p.currentItemsParent.appendChild(itemEl);
7336
7330
  }
7337
7331
  ghostTester(itemEl);
7338
- } finally {
7332
+ } finally
7333
+ {
7339
7334
  if (append) {
7340
7335
  let parent = itemEl.parentNode;
7341
7336
  if (parent)
@@ -7345,38 +7340,30 @@
7345
7340
  p.onItemUnrender(itemEl);
7346
7341
  }
7347
7342
  }
7348
-
7349
- /**
7350
- * Reset the pointer to the current items wrapper
7351
- * @private
7343
+ /**
7344
+ * Reset the pointer to the current items wrapper
7352
7345
  */
7353
7346
  _resetCurrentItemsParent() {var _ref, _p$virtualWrapper;
7354
7347
  const p = this._p;
7355
7348
  p.currentItemsParent = (_ref = (_p$virtualWrapper = p.virtualWrapper) !== null && _p$virtualWrapper !== void 0 ? _p$virtualWrapper : p.userItemsParent) !== null && _ref !== void 0 ? _ref : p.list;
7356
7349
  }
7357
-
7358
- /**
7359
- * Destroy all created elements, for cleanup
7360
- * @returns {VirtualListHelper}
7361
- * @private
7350
+ /**
7351
+ * Destroy all created elements, for cleanup
7362
7352
  */
7363
7353
  _destroyElements() {
7364
7354
  const p = this._p;
7365
7355
  const onItemUnrender = p.onItemUnrender;
7366
7356
  const existingEls = p.existingEls;
7367
-
7368
7357
  for (let i = 0; i < existingEls.length; i++) {
7369
7358
  const el = existingEls[i];
7370
-
7371
7359
  let parent = el.parentNode;
7372
7360
  if (parent)
7373
7361
  parent.removeChild(el);
7374
- if (onItemUnrender && el[ItemIndexSymbol] !== undefined)
7362
+ // Invalidation clears index metadata, but the element still owns rendered resources.
7363
+ if (onItemUnrender)
7375
7364
  onItemUnrender(el);
7376
7365
  }
7377
-
7378
7366
  existingEls.length = 0;
7379
-
7380
7367
  if (p.virtualWrapper) {
7381
7368
  if (p.virtualWrapper !== p.userItemsParent) {
7382
7369
  if (p.virtualWrapper.parentNode) {
@@ -7386,203 +7373,135 @@
7386
7373
  p.virtualWrapper = null;
7387
7374
  this._resetCurrentItemsParent();
7388
7375
  }
7389
-
7390
7376
  return this;
7391
7377
  }
7392
-
7393
- /**
7394
- * Marks (an) item(s) at specific index(es) as to be re-rendered. <br />
7395
- * Applicable for virtual mode only.
7396
- * @param {number} index
7397
- * @param {number} count
7398
- * @private
7378
+ /**
7379
+ * Marks (an) item(s) at specific index(es) as to be re-rendered. <br />
7380
+ * Applicable for virtual mode only.
7399
7381
  */
7400
7382
  _invalidateItemIndexesAt(index, count) {
7401
7383
  const p = this._p;
7402
-
7403
7384
  this._setItemPositionsNeedsUpdate(index);
7404
-
7405
7385
  let existingEls = p.existingEls;
7406
7386
  let existingCount = existingEls.length;
7407
7387
  let existingRange = this._getExistingElsRange();
7408
-
7409
7388
  if (existingRange.firstValidArrayIndex === -1)
7410
7389
  return;
7411
-
7412
7390
  if (count === -1)
7413
7391
  count = existingEls.length;
7414
-
7415
7392
  // Clean
7416
7393
  if (index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
7417
- for (let i = existingRange.firstValidArrayIndex + index - existingRange.firstIndex,
7418
- c = 0;
7419
- i < existingCount && c < count;
7420
- i++, c++)
7394
+ for (let i = existingRange.firstValidArrayIndex + index - existingRange.firstIndex, c = 0; i < existingCount && c < count; i++, c++)
7421
7395
  delete existingEls[i][ItemIndexSymbol];
7422
7396
  }
7423
7397
  }
7424
-
7425
- /**
7426
- * In/decrement the item-index marker for specific item(s). <br />
7427
- * Used for inserting/removing items in the middle of the list, without re-rendering everything. <br />
7428
- * Applicable for non-virtual mode only.
7429
- * @param {number} index
7430
- * @param {number} count
7431
- * @private
7398
+ /**
7399
+ * In/decrement the item-index marker for specific item(s). <br />
7400
+ * Used for inserting/removing items in the middle of the list, without re-rendering everything. <br />
7401
+ * Applicable for non-virtual mode only.
7432
7402
  */
7433
7403
  _pushItemIndexesAt(index, count) {
7434
7404
  const p = this._p;
7435
-
7436
7405
  let existingEls = p.existingEls;
7437
7406
  let existingCount = existingEls.length;
7438
7407
  let existingRange = this._getExistingElsRange();
7439
-
7440
7408
  if (existingRange.firstValidArrayIndex === -1)
7441
7409
  return;
7442
-
7443
7410
  // Clean
7444
7411
  if (index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
7445
- for (let i = existingRange.firstValidArrayIndex + index - existingRange.firstIndex;
7446
- i < existingCount;
7447
- i++)
7412
+ for (let i = existingRange.firstValidArrayIndex + index - existingRange.firstIndex; i < existingCount; i++)
7448
7413
  existingEls[i][ItemIndexSymbol] += count;
7449
7414
  }
7450
7415
  }
7451
-
7452
- /**
7453
- * Hook relevant events
7454
- * @returns {VirtualListHelper}
7455
- * @private
7416
+ /**
7417
+ * Hook relevant events
7456
7418
  */
7457
7419
  _hookEvents() {
7458
7420
  const p = this._p;
7459
-
7460
7421
  this._unhookEvents();
7461
-
7462
7422
  if (p.virtual && p.hookScrollEvent) {
7463
- p.list && p.list.addEventListener('scroll', /**@type Function*/p.boundRender);
7423
+ p.list && p.list.addEventListener('scroll', p.boundRender);
7464
7424
  }
7465
-
7466
7425
  return this;
7467
7426
  }
7468
-
7469
- /**
7470
- * Unhook previously hooked events
7471
- * @returns {VirtualListHelper}
7472
- * @private
7427
+ /**
7428
+ * Unhook previously hooked events
7473
7429
  */
7474
7430
  _unhookEvents() {
7475
7431
  const p = this._p;
7476
-
7477
- p.list && p.list.removeEventListener('scroll', /**@type Function*/p.boundRender);
7478
-
7432
+ p.list && p.list.removeEventListener('scroll', p.boundRender);
7479
7433
  return this;
7480
7434
  }
7481
-
7482
- /**
7483
- * Mark item index from which the positions are not considered valid anymore. <br />
7484
- * Applicable for virtual mode only.
7485
- * @param {number} value
7486
- * @private
7435
+ /**
7436
+ * Mark item index from which the positions are not considered valid anymore. <br />
7437
+ * Applicable for virtual mode only.
7487
7438
  */
7488
7439
  _setItemPositionsNeedsUpdate(value) {
7489
7440
  const p = this._p;
7490
-
7491
7441
  if (value < p.itemPositionsNeedsUpdate) {
7492
7442
  p.itemPositionsNeedsUpdate = value;
7493
7443
  }
7494
7444
  }
7495
-
7496
- /**
7497
- * Calculates an item's top position (and stores in the private `cachedItemPositions` array). <br />
7498
- * Allows calculating last+1 index too, to get the bottom-most position. <br />
7499
- * Applicable for non-virtual mode only.
7500
- * @param {number} index
7501
- * @returns {number|undefined}
7502
- * @private
7445
+ /**
7446
+ * Calculates an item's top position (and stores in the private `cachedItemPositions` array). <br />
7447
+ * Allows calculating last+1 index too, to get the bottom-most position. <br />
7448
+ * Applicable for non-virtual mode only.
7503
7449
  */
7504
7450
  _calculateItemPosition(index) {
7505
7451
  const p = this._p;
7506
-
7507
7452
  const cachedItemPositions = p.cachedItemPositions;
7508
-
7509
7453
  if (index >= p.itemPositionsNeedsUpdate) {
7510
7454
  const count = p.count;
7511
7455
  const cachedItemHeights = p.cachedItemHeights;
7512
7456
  const cachedItemEstimatedHeights = p.cachedItemEstimatedHeights;
7513
7457
  const estimatedItemHeight = p.estimatedItemHeight;
7514
7458
  const itemHeightEstimatorFn = p.itemHeightEstimatorFn;
7515
-
7516
7459
  if (cachedItemHeights.length !== count) {
7517
7460
  cachedItemHeights.length = count;
7518
7461
  cachedItemEstimatedHeights.length = count;
7519
7462
  cachedItemPositions.length = count;
7520
7463
  }
7521
-
7522
7464
  let fromIndex = p.itemPositionsNeedsUpdate;
7523
7465
  let toIndex = Math.min(index, count);
7524
-
7525
7466
  let pos = 0;
7526
-
7527
7467
  if (fromIndex > 0) {
7528
7468
  pos = cachedItemPositions[fromIndex - 1];
7529
7469
  }
7530
-
7531
7470
  for (let i = fromIndex; i <= toIndex; i++) {
7532
7471
  if (i === 0) {
7533
7472
  cachedItemPositions[i] = pos;
7534
7473
  continue;
7535
7474
  }
7536
-
7537
7475
  const prevIndex = i - 1;
7538
-
7539
7476
  let height = cachedItemHeights[prevIndex]; // already calculated
7540
-
7541
7477
  if (height === undefined) {
7542
7478
  height = itemHeightEstimatorFn ? itemHeightEstimatorFn(prevIndex) : null; // estimated per item
7543
-
7544
7479
  if (typeof height !== 'number')
7545
7480
  height = estimatedItemHeight; // estimated
7546
-
7547
7481
  cachedItemEstimatedHeights[prevIndex] = height;
7548
7482
  }
7549
-
7550
7483
  pos += height;
7551
7484
  cachedItemPositions[i] = pos;
7552
7485
  }
7553
-
7554
7486
  p.itemPositionsNeedsUpdate = toIndex + 1;
7555
7487
  }
7556
-
7557
7488
  // item after the last (calculate full height)
7558
7489
  if (index > 0 && index === p.count) {
7559
7490
  let height = p.cachedItemHeights[index - 1]; // already calculated
7560
-
7561
7491
  if (height === undefined) {
7562
7492
  height = p.itemHeightEstimatorFn ? p.itemHeightEstimatorFn(index - 1) : null; // estimated per item
7563
-
7564
7493
  if (typeof height !== 'number')
7565
7494
  height = p.estimatedItemHeight; // estimated
7566
-
7567
7495
  p.cachedItemEstimatedHeights[index - 1] = height;
7568
7496
  }
7569
-
7570
7497
  return cachedItemPositions[index - 1] + height;
7571
7498
  }
7572
-
7573
7499
  return cachedItemPositions[index];
7574
7500
  }
7575
-
7576
- /**
7577
- * Create (or reuse an existing) element for an item at the specified index,
7578
- * and insert physically at specified position. <br />
7579
- * This will also update the element's position in the `existingEls` array.
7580
- * @param {Element|undefined} itemEl
7581
- * @param {number} index
7582
- * @param {Node|boolean|undefined} insertBefore
7583
- * @param {boolean|undefined} avoidDomReflow
7584
- * @returns {Element}
7585
- * @private
7501
+ /**
7502
+ * Create (or reuse an existing) element for an item at the specified index,
7503
+ * and insert physically at specified position. <br />
7504
+ * This will also update the element's position in the `existingEls` array.
7586
7505
  */
7587
7506
  _dequeueElementForIndex(itemEl, index, insertBefore, avoidDomReflow) {
7588
7507
  const p = this._p;
@@ -7593,138 +7512,111 @@
7593
7512
  const onItemUnrender = p.onItemUnrender;
7594
7513
  const isNew = !itemEl;
7595
7514
  const shouldReRender = isNew || index !== itemEl[ItemIndexSymbol];
7596
-
7597
7515
  if (itemEl) {
7598
7516
  if (onItemUnrender && shouldReRender) {
7599
7517
  onItemUnrender(itemEl);
7600
7518
  }
7601
- } else {
7519
+ } else
7520
+ {
7602
7521
  itemEl = p.itemElementCreatorFn();
7603
-
7604
7522
  if (virtualWrapper && insertBefore !== false) {
7605
- (/**@type ElementCSSInlineStyle*/itemEl).style.position = 'absolute';
7606
- (/**@type ElementCSSInlineStyle*/itemEl).style.top = '0';
7607
- (/**@type ElementCSSInlineStyle*/itemEl).style.left = '0';
7608
- (/**@type ElementCSSInlineStyle*/itemEl).style.right = '0';
7523
+ itemEl.style.position = 'absolute';
7524
+ itemEl.style.top = '0';
7525
+ itemEl.style.left = '0';
7526
+ itemEl.style.right = '0';
7609
7527
  }
7610
7528
  }
7611
-
7612
7529
  // Render only if it's a new item element
7613
7530
  // OR the index of the existing element is not the same of the index to render
7614
7531
  if (shouldReRender) {
7615
7532
  itemEl.innerHTML = ''; // Basic cleanup
7616
-
7617
7533
  if (onItemRender)
7618
7534
  onItemRender(itemEl, index);
7619
7535
  }
7620
-
7621
7536
  if (insertBefore !== false) {
7622
7537
  if (!(insertBefore instanceof Node))
7623
7538
  insertBefore = null;
7624
-
7625
7539
  // Remove from existing list
7626
7540
  if (!isNew) {
7627
7541
  let i = existingEls.indexOf(itemEl);
7628
7542
  if (i !== -1)
7629
7543
  existingEls.splice(i, 1);
7630
7544
  }
7631
-
7632
7545
  // Insert into existing list
7633
- let beforeIndex = insertBefore ? existingEls.indexOf(/**@type Element*/insertBefore) : -1;
7546
+ let beforeIndex = insertBefore ? existingEls.indexOf(insertBefore) : -1;
7634
7547
  if (beforeIndex === -1) {
7635
7548
  existingEls.push(itemEl);
7636
- } else {
7549
+ } else
7550
+ {
7637
7551
  existingEls.splice(beforeIndex, 0, itemEl);
7638
7552
  }
7639
-
7640
7553
  if (!avoidDomReflow) {
7641
7554
  this._insertItemAndFlow(itemEl, index, insertBefore);
7642
7555
  }
7643
7556
  }
7644
-
7645
7557
  // Add index metadata to item
7646
7558
  itemEl[ItemIndexSymbol] = index;
7647
-
7648
7559
  return itemEl;
7649
7560
  }
7650
-
7651
- /**
7652
- * Insert item element into the DOM, set it's flow in the DOM, and update the item's position. <br />
7653
- * @param {Element|undefined} itemEl
7654
- * @param {number} index
7655
- * @param {Node|boolean|undefined} before
7656
- * @private
7561
+ /**
7562
+ * Insert item element into the DOM, set it's flow in the DOM, and update the item's position. <br />
7657
7563
  */
7658
7564
  _insertItemAndFlow(itemEl, index, before) {
7659
7565
  const p = this._p;
7660
7566
  const virtualWrapper = p.virtualWrapper;
7661
7567
  const itemParent = p.currentItemsParent;
7662
-
7663
7568
  if (before !== false) {
7664
7569
  if (!(before instanceof Node))
7665
7570
  before = null;
7666
-
7667
7571
  // Insert into DOM
7668
7572
  if (itemEl.parentNode !== itemParent ||
7669
7573
  itemEl.nextSibling !== before) {
7670
7574
  insertBefore(itemEl, before, itemParent);
7671
7575
  }
7672
7576
  }
7673
-
7674
7577
  if (virtualWrapper) {
7675
7578
  // Calculate height
7676
7579
  let itemHeight = itemEl.getBoundingClientRect().height;
7677
-
7678
7580
  // Put calculated height into cache, and invalidate positions if it's different
7679
7581
  let cachedItemHeight = p.cachedItemHeights[index];
7680
7582
  if (cachedItemHeight !== itemHeight) {
7681
7583
  p.cachedItemHeights[index] = itemHeight;
7682
7584
  }
7683
-
7684
7585
  if (cachedItemHeight !== undefined && itemHeight !== cachedItemHeight ||
7685
7586
  cachedItemHeight === undefined && itemHeight !== p.cachedItemEstimatedHeights[index]) {
7686
7587
  this._setItemPositionsNeedsUpdate(index + 1);
7687
7588
  }
7688
-
7689
7589
  // Set item top position
7690
7590
  let pos = this._calculateItemPosition(index);
7691
7591
  const supportedTransform = getSupportedTransform();
7692
-
7693
7592
  if (supportedTransform === false) {
7694
- (/**@type ElementCSSInlineStyle*/itemEl).style.top = "".concat(pos, "px");
7695
- } else {
7696
- (/**@type ElementCSSInlineStyle*/itemEl).style[supportedTransform] = "translateY(".concat(pos, "px)");
7593
+ itemEl.style.top = "".concat(pos, "px");
7594
+ } else
7595
+ {
7596
+ itemEl.style[supportedTransform] = "translateY(".concat(pos, "px)");
7697
7597
  }
7698
7598
  }
7699
7599
  }
7700
-
7701
- /**
7702
- * Fetches valid range of existingEls
7703
- * @returns {{firstIndex: (*|number), firstValidArrayIndex: number, lastValidArrayIndex: number, lastIndex: (*|number)}}
7704
- * @private
7600
+ /**
7601
+ * Fetches valid range of existingEls
7705
7602
  */
7706
7603
  _getExistingElsRange() {
7707
7604
  const p = this._p,existingEls = p.existingEls;
7708
-
7709
7605
  let firstValidArrayIndex = -1,lastValidArrayIndex = -1;
7710
-
7711
7606
  for (let i = 0, len = existingEls.length; i < len; i++) {
7712
7607
  if (false === hasOwnProperty.call(existingEls[i], ItemIndexSymbol))
7713
7608
  continue;
7714
7609
  firstValidArrayIndex = i;
7715
7610
  break;
7716
7611
  }
7717
-
7718
7612
  for (let i = existingEls.length - 1; i >= 0; i--) {
7719
7613
  if (false === hasOwnProperty.call(existingEls[i], ItemIndexSymbol))
7720
7614
  continue;
7721
7615
  lastValidArrayIndex = i;
7722
7616
  break;
7723
7617
  }
7724
-
7725
7618
  let firstIndex = firstValidArrayIndex !== -1 ? existingEls[firstValidArrayIndex][ItemIndexSymbol] : -1;
7726
7619
  let lastIndex = lastValidArrayIndex !== -1 ? existingEls[lastValidArrayIndex][ItemIndexSymbol] : -1;
7727
-
7728
7620
  return {
7729
7621
  firstValidArrayIndex: firstValidArrayIndex,
7730
7622
  lastValidArrayIndex: lastValidArrayIndex,
@@ -7733,95 +7625,64 @@
7733
7625
  };
7734
7626
  }
7735
7627
  }
7736
-
7737
- /** Marks the item index associated with an item element */
7738
7628
  const ItemIndexSymbol = Symbol('index');
7739
-
7740
- /** Marks an element for reuse */
7741
7629
  const ReuseElSymbol = Symbol('reuse');
7742
-
7743
- /**
7744
- * The default element creator
7745
- * @returns {HTMLLIElement}
7630
+ /**
7631
+ * The default element creator
7746
7632
  */
7747
7633
  const defaultElementCreator = () => {
7748
7634
  return document.createElement('li');
7749
7635
  };
7750
-
7751
- /**
7752
- * Will look for the index in the `positions` array closest to the specified `pos` value (<= pos).
7753
- * @param {number[]} positions
7754
- * @param {number} pos
7755
- * @param {number} [start=0]
7756
- * @param {number} [end=-1]
7757
- * @returns {number}
7636
+ /**
7637
+ * Will look for the index in the `positions` array closest to the specified `pos` value (<= pos).
7758
7638
  */
7759
7639
  const binarySearchPosition = function (positions, pos) {let start = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;let end = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;
7760
7640
  let total = positions.length;
7761
7641
  if (end < 0)
7762
7642
  end += total;
7763
- if (end <= start) return end; // 0 or 1 length array
7764
-
7643
+ if (end <= start)
7644
+ return end; // 0 or 1 length array
7765
7645
  while (start <= end) {
7766
7646
  let mid = Math.floor(start + (end - start) / 2);
7767
7647
  let midPos = positions[mid];
7768
-
7769
7648
  if (midPos === pos || midPos <= pos && mid < total && positions[mid + 1] > pos) {
7770
7649
  while (mid > 0 && positions[mid - 1] === midPos) // avoid bugs on 0-height items
7771
7650
  mid--;
7772
-
7773
7651
  return mid;
7774
7652
  }
7775
-
7776
7653
  if (midPos < pos)
7777
7654
  start = mid + 1;else
7778
7655
 
7779
7656
  end = mid - 1;
7780
7657
  }
7781
-
7782
- return end === -1 ? 0 : total - 1;
7658
+ return end === -1 ? 0 : end;
7783
7659
  };
7784
-
7785
- /**
7786
- * Will look for the index in a virtual list of positions supplied by `total` and `fn`,
7787
- * closest to the specified `pos` value (<= pos).
7788
- * @param {number} total
7789
- * @param {function(index: number):number} fn
7790
- * @param {number} pos
7791
- * @param {number} [start=0]
7792
- * @param {number} [end=-1]
7793
- * @returns {number}
7660
+ /**
7661
+ * Will look for the index in a virtual list of positions supplied by `total` and `fn`,
7662
+ * closest to the specified `pos` value (<= pos).
7794
7663
  */
7795
7664
  const binarySearchPositionByFn = function (total, fn, pos) {let start = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;let end = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : -1;
7796
7665
  if (end < 0)
7797
7666
  end += total;
7798
- if (end <= start) return end; // 0 or 1 length array
7799
-
7667
+ if (end <= start)
7668
+ return end; // 0 or 1 length array
7800
7669
  while (start <= end) {
7801
7670
  let mid = Math.floor(start + (end - start) / 2);
7802
7671
  let midPos = fn(mid);
7803
-
7804
7672
  if (midPos === pos || midPos <= pos && mid < total && fn(mid + 1) > pos) {
7805
7673
  while (mid > 0 && fn(mid - 1) === midPos) // avoid bugs on 0-height items
7806
7674
  mid--;
7807
-
7808
7675
  return mid;
7809
7676
  }
7810
-
7811
7677
  if (midPos < pos)
7812
7678
  start = mid + 1;else
7813
7679
 
7814
7680
  end = mid - 1;
7815
7681
  }
7816
-
7817
- return end === -1 ? 0 : fn(total - 1);
7682
+ return end === -1 ? 0 : end;
7818
7683
  };
7819
-
7820
- /**
7821
- * Finds the last item in the array for which `fn` returns a truthy value
7822
- * @param {Array} array
7823
- * @param {Function} fn
7824
- * @returns {undefined|*}
7684
+ /**
7685
+ * Finds the last item in the array for which `fn` returns a truthy value
7825
7686
  */
7826
7687
  const findLast = (array, fn) => {
7827
7688
  for (let i = array.length - 1; i >= 0; i--) {
@@ -7831,9 +7692,7 @@
7831
7692
  }
7832
7693
  return undefined;
7833
7694
  };
7834
-
7835
7695
  let _isTransformSupported = null;
7836
-
7837
7696
  const getSupportedTransform = () => {
7838
7697
  if (_isTransformSupported === null) {
7839
7698
  let prefixes = ['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform'];
@@ -7849,9 +7708,9 @@
7849
7708
  return _isTransformSupported;
7850
7709
  };
7851
7710
 
7852
- function u(e, t) {for (let l = 0, o = e.length; l >= 0 && l < o; l += 1) if (t(e[l], l, e)) return e[l];}function h(e) {return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/'/g, "&#39;").replace(/"/g, "&quot;").replace(/\n/g, "<br />");}const c = Symbol("safe"),m = Symbol("hover_in"),f = Symbol("hover_out"),p = Symbol("row_click"),g = Symbol("preview_cell"),C = Symbol("cell"),v = Symbol("related_touch"),b = Symbol("original_row_index"),w = Symbol("destroyed");class W extends Array {constructor(e) {var _e$sortColumn, _e$onComparatorRequir, _e$customSortingProvi;super(), _defineProperty(this, "sortColumn", void 0), _defineProperty(this, "onComparatorRequired", null), _defineProperty(this, "customSortingProvider", null), e = e || {}, this.sortColumn = (_e$sortColumn = e.sortColumn) !== null && _e$sortColumn !== void 0 ? _e$sortColumn : [], this.onComparatorRequired = (_e$onComparatorRequir = e.onComparatorRequired) !== null && _e$onComparatorRequir !== void 0 ? _e$onComparatorRequir : null, this.customSortingProvider = (_e$customSortingProvi = e.customSortingProvider) !== null && _e$customSortingProvi !== void 0 ? _e$customSortingProvi : null;}add(e, t) {if (Array.isArray(e)) {const l = e;if ("number" == typeof t) for (let e = 0, o = l.length; e < o; e++) this.splice(t++, 0, l[e]);else for (let e = 0, t = l.length; e < t; e++) this.push(l[e]);} else {const l = e;"number" == typeof t ? this.splice(t, 0, l) : this.push(l);}}reset(e) {this.length = 0, e && this.add(e);}filteredCollection(e, t) {if (e && t) {const l = new W({ sortColumn: this.sortColumn, onComparatorRequired: this.onComparatorRequired, customSortingProvider: this.customSortingProvider });for (let o = 0, i = this.length; o < i; o++) {const i = this[o];e(i, t) && (i[b] = o, l.push(i));}return l;}return null;}sort(e) {let t;if ("function" == typeof e) return super.sort(e);if (this.sortColumn.length) {const e = [];for (let t = 0; t < this.sortColumn.length; t++) {const l = y(this.sortColumn[t], this.sortColumn[t].descending);let o = null;this.onComparatorRequired && (o = this.onComparatorRequired(this.sortColumn[t].column, this.sortColumn[t].descending, l)), o || (o = l), e.push(o.bind(this));}if (1 === e.length) t = e[0];else {const l = e.length;t = (t, o) => {let i = 0;for (let r = 0; r < l; r++) if (i = e[r](t, o), 0 !== i) return i;return i;};}const l = (e) => (e.sort(t), e);if (this.customSortingProvider) {const e = this.customSortingProvider(this, l);e !== this && this.splice(0, this.length, ...e);} else l(this);}return this;}}function y(e, t) {let l = e.comparePath;"string" == typeof l && (l = l.split("."));const o = l.length,i = o > 1,r = t ? 1 : -1,n = t ? -1 : 1;return function (e, t) {let s = e[l[0]],a = t[l[0]];if (i) for (let e = 1; e < o; e++) s = s && s[l[e]], a = a && a[l[e]];return s === a ? 0 : null == s ? r : null == a ? n : s < a ? r : n;};}class R extends Array {constructor() {super();}get(e) {for (let t = 0, l = this.length; t < l; t++) if (this[t].name === e) return this[t];return null;}indexOf(e) {const t = "string" == typeof e ? e : e.name;for (let e = 0, l = this.length; e < l; e++) if (this[e].name === t) return e;return -1;}getByOrder(e) {for (let t = 0, l = this.length; t < l; t++) if (this[t].order === e) return this[t];return null;}normalizeOrder() {const e = [];for (let t = 0; t < this.length; t++) e.push(this[t]);e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0);for (let t = 0; t < e.length; t++) e[t].order = t;return this;}getColumns() {const e = [];for (let t = 0; t < this.length; t++) e.push(this[t]);return e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0), e;}getVisibleColumns() {const e = [];for (let t = 0; t < this.length; t++) {const l = this[t];l.visible && e.push(l);}return e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0), e;}getMaxOrder() {let e = 0;for (let t = 0; t < this.length; t++) {const l = this[t];l.order > e && (e = l.order);}return e;}moveColumn(e, t) {if (e && t) {const l = e.order,o = t.order;if (l < o) for (let e = l + 1; e <= o; e++) {const t = this.getByOrder(e);t && t.order--;} else for (let e = l - 1; e >= o; e--) {const t = this.getByOrder(e);t && t.order++;}e.order = o;}return this;}}function S(e, t) {const l = t.column,o = null == t.keyword ? "" : t.keyword.toString();if (!o || !l) return true;let i = e[l];if (null == i) return false;let r = i.toString(),n = o;return t.caseSensitive || (r = r.toLowerCase(), n = n.toLowerCase()), -1 !== r.indexOf(n);}const _ = { NONE: "none", AUTO: "auto", SCROLL: "scroll" };class N {static saveSelection(e) {const t = window.getSelection();if (!t || 0 === t.rangeCount) return null;const l = t.getRangeAt(0);if (e !== l.commonAncestorContainer && !function (e, t) {let l = e;for (; (l = (_l$parentNode = (_l = l) === null || _l === void 0 ? void 0 : _l.parentNode) !== null && _l$parentNode !== void 0 ? _l$parentNode : null) && l !== t;) {var _l$parentNode, _l;}return !!l;}(l.commonAncestorContainer, e)) return null;const o = l.cloneRange();o.selectNodeContents(e), o.setEnd(l.startContainer, l.startOffset);const i = o.toString().length;return { start: i, end: i + l.toString().length };}static restoreSelection(e, t) {let l = 0;const o = [e];let i,r = false,n = false;const s = document.createRange();for (s.setStart(e, 0), s.collapse(true); !n && (i = o.pop());) if (i.nodeType === Node.TEXT_NODE) {const e = l + i.length;!r && t.start >= l && t.start <= e && (s.setStart(i, t.start - l), r = true), r && t.end >= l && t.end <= e && (s.setEnd(i, t.end - l), n = true), l = e;} else {let e = i.childNodes.length;for (; e--;) o.push(i.childNodes[e]);}const a = window.getSelection();a && (a.removeAllRanges(), a.addRange(s));}}const x = Array.prototype.indexOf,k = document.createElement.bind(document);function z(e) {const t = e._p;if (t.cellPreviewCell) {var _l$rowIndex;const l = t.cellPreviewCell,o = l[C];let i;try {i = N.saveSelection(l);} catch (_unused) {}t.cellPreviewCell.remove(), o && t._unbindCellHoverOut(o), t._unbindCellHoverOut(l);try {i && o && N.restoreSelection(o, i);} catch (_unused2) {}e.emit("cellpreviewdestroy", { el: l.firstChild, name: l.columnName, rowIndex: (_l$rowIndex = l.rowIndex) !== null && _l$rowIndex !== void 0 ? _l$rowIndex : null, rowData: null == l.rowIndex ? null : t.rows[l.rowIndex], cell: o, cellEl: o === null || o === void 0 ? void 0 : o.firstChild }), o && delete o[g], delete l[C], t.cellPreviewCell = null, t.abortCellPreview = false;} else t.abortCellPreview = true;return e;}const M = document.createElement.bind(document);function T(e) {var _ref, _e$v, _t$changedTouches;const t = e;return (_ref = (_e$v = e[v]) !== null && _e$v !== void 0 ? _e$v : (_t$changedTouches = t.changedTouches) === null || _t$changedTouches === void 0 ? void 0 : _t$changedTouches[0]) !== null && _ref !== void 0 ? _ref : e;}function L(e) {var _t$lastResizeAreaClic;const t = e._p;if (null == t.columnResizeStartTimeout) return;clearTimeout(t.columnResizeStartTimeout), t.columnResizeStartTimeout = null;const n = (_t$lastResizeAreaClic = t.lastResizeAreaClick) === null || _t$lastResizeAreaClic === void 0 ? void 0 : _t$lastResizeAreaClic.columnName;t.lastResizeAreaClick = null, n && function (e, t) {const n = e._o,s = e._p,a = s.columns.get(t);if (!n.resizableColumns || !a || !a.resizable) return void A(e);const d = me(e);s.resizer = M("div"), s.resizer.className = n.resizerClassName, setCssProps(s.resizer, { position: "absolute", display: "block", zIndex: "-1", visibility: "hidden", width: "2px", background: "#000", opacity: "0.7" }), e.el.appendChild(s.resizer);const u = a.element,h = s.resizer.parentNode,c = getComputedStyle(h),m = getComputedStyle(u),f = getElementOffset(u),p = getElementOffset(h);p.left += parseFloat(c.borderLeftWidth) || 0, p.top += parseFloat(c.borderTopWidth) || 0, f.left -= p.left, f.top -= p.top, f.top -= parseFloat(m.borderTopWidth) || 0;const g = getElementWidth(s.resizer, true, true, true);d ? (f.left -= Math.ceil((parseFloat(m.borderLeftWidth) || 0) / 2), f.left -= Math.ceil(g / 2)) : (f.left += getElementWidth(u, true, true, true), f.left += Math.ceil((parseFloat(m.borderRightWidth) || 0) / 2), f.left -= Math.ceil(g / 2)), setCssProps(s.resizer, { "z-index": "10", visibility: "visible", left: f.left + "px", top: f.top + "px", height: getElementHeight(e.el, false, false, false) + "px" }), s.resizer.columnName = u.columnName;try {s.resizer.style.zIndex = "";} catch (_unused3) {}}(e, n);}function F(e, t) {const l = e._o,o = me(e);let n = t.target.closest("div.".concat(l.tableClassName, "-header-cell,div.").concat(l.cellPreviewClassName));if (!n) return null;n[C] && (n = n[C]);let s = n.previousSibling;for (; s && 1 !== s.nodeType;) s = s.previousSibling;const a = !s,d = T(t),u = (d.pageX || d.clientX || 0) - getElementOffset(n).left;if (o) {var _s$columnName, _s, _n$columnName;if (!a && getElementWidth(n, true, true, true) - u <= l.resizeAreaWidth / 2) return (_s$columnName = (_s = s) === null || _s === void 0 ? void 0 : _s.columnName) !== null && _s$columnName !== void 0 ? _s$columnName : null;if (u <= l.resizeAreaWidth / 2) return (_n$columnName = n.columnName) !== null && _n$columnName !== void 0 ? _n$columnName : null;} else {var _s$columnName2, _s2, _n$columnName2;if (!a && u <= l.resizeAreaWidth / 2) return (_s$columnName2 = (_s2 = s) === null || _s2 === void 0 ? void 0 : _s2.columnName) !== null && _s$columnName2 !== void 0 ? _s$columnName2 : null;if (getElementWidth(n, true, true, true) - u <= l.resizeAreaWidth / 2) return (_n$columnName2 = n.columnName) !== null && _n$columnName2 !== void 0 ? _n$columnName2 : null;}return null;}function A(e) {const t = e._p;return null != t.columnResizeStartTimeout && (clearTimeout(t.columnResizeStartTimeout), t.columnResizeStartTimeout = null), t.resizer && (t.resizer.remove(), t.resizer = null), t.eventsSink.remove(document, ".colresize"), e;}function P(e, t) {const l = t;if ("mousedown" === t.type && 0 !== l.button) return;const o = e._o,i = e._p,r = F(e, t);if (r) {const l = i.columns.get(r);if (!o.resizableColumns || !l || !l.resizable) return false;if (function (e, t, l) {const o = e._p,i = e._o,r = T(t),n = Date.now(),s = function (e) {return e.type.startsWith("touch") ? "touch" : "mouse";}(t),a = o.lastResizeAreaClick;if (o.lastResizeAreaClick = { columnName: l, time: n, pageX: r.pageX || r.clientX || 0, pageY: r.pageY || 0, pointerType: s }, !a || a.columnName !== l || a.pointerType !== s) return false;const d = n - a.time;return !(d < 0 || d > i.resizeAreaDoubleClickDuration) && Math.sqrt(Math.pow(o.lastResizeAreaClick.pageX - a.pageX, 2) + Math.pow(o.lastResizeAreaClick.pageY - a.pageY, 2)) <= Math.max(i.resizeAreaWidth, 12);}(e, t, l.name)) return A(e), function (e, t, l, _i$lastResizeAreaDoub) {const o = e._o,i = e._p,r = i.columns.get(l);if (!o.resizableColumns || !r || !r.resizable) return false;const n = Date.now();return ((_i$lastResizeAreaDoub = i.lastResizeAreaDoubleClick) === null || _i$lastResizeAreaDoub === void 0 ? void 0 : _i$lastResizeAreaDoub.columnName) === r.name && n - i.lastResizeAreaDoubleClick.time < 100 ? (t.preventDefault(), true) : (i.lastResizeAreaClick = null, i.lastResizeAreaDoubleClick = { columnName: r.name, time: n }, e.emit("columnresizeareadoubleclick", { name: r.name, columnName: r.name, event: t }), o.autoFitColumnOnResizeDoubleClick && e.autoFitColumn(r.name), t.preventDefault(), true);}(e, t, l.name);A(e), i.columnResizeStartTimeout = setTimeout(() => L(e), o.resizeAreaDoubleClickDuration), i.eventsSink.add(document, "mousemove.colresize", (t) => E(e, t)).add(document, "touchmove.colresize", (t) => E(e, t)).add(document, "mouseup.colresize", (t) => H(e, t)).add(document, "touchend.colresize", (t) => H(e, t)), t.preventDefault();}}function E(e, t) {const l = e._p;if (null != l.columnResizeStartTimeout && !function (e, t) {const l = e._p.lastResizeAreaClick;if (!l) return false;const o = T(t),i = o.pageX || o.clientX || 0,r = o.pageY || 0;return Math.sqrt(Math.pow(i - l.pageX, 2) + Math.pow(r - l.pageY, 2)) > 4;}(e, t)) return;if (L(e), !l.resizer) return;const o = l.columns.get(l.resizer.columnName);if (!o) return;const n = me(e),s = o.element,a = l.resizer.parentNode,d = getComputedStyle(a),u = getComputedStyle(s),h = getElementOffset(s),c = getElementOffset(a);c.left += parseFloat(d.borderLeftWidth) || 0, h.left -= c.left;const m = getElementWidth(l.resizer, true, true, true),f = "border-box" === u.boxSizing;let p = T(t).pageX - c.left,g = h.left;g -= Math.ceil(m / 2), n ? (g += getElementWidth(s, true, true, true), g -= o.ignoreMin ? 0 : e._o.minColumnWidth, f || (g -= Math.ceil((parseFloat(u.borderLeftWidth) || 0) / 2), g -= ae(s)), p > g && (p = g)) : (g += o.ignoreMin ? 0 : e._o.minColumnWidth, f || (g += Math.ceil((parseFloat(u.borderRightWidth) || 0) / 2), g += ae(s)), p < g && (p = g)), l.resizer.style.left = p + "px";}function H(e, t) {var _ref2, _t$v, _C$changedTouches;const l = e._o,o = e._p;if (null != o.columnResizeStartTimeout) return void A(e);if (!o.resizer) return;o.eventsSink.remove(document, ".colresize");const n = o.columns.get(o.resizer.columnName);if (!n) return o.resizer.remove(), void (o.resizer = null);const s = me(e),a = n.element,d = a.firstChild,u = o.resizer.parentNode,h = getComputedStyle(u),c = getComputedStyle(a),m = getElementOffset(a),f = getElementOffset(u);f.left += parseFloat(h.borderLeftWidth) || 0, m.left -= f.left;const p = getElementWidth(o.resizer, true, true, true),g = "border-box" === c.boxSizing,C = t;let b = ((_ref2 = (_t$v = t[v]) !== null && _t$v !== void 0 ? _t$v : (_C$changedTouches = C.changedTouches) === null || _C$changedTouches === void 0 ? void 0 : _C$changedTouches[0]) !== null && _ref2 !== void 0 ? _ref2 : t).pageX - f.left,w = m.left,W = 0;if (w -= Math.ceil(p / 2), s) {if (!g) {b += ae(a);const e = getComputedStyle(d || a);b += parseFloat(e.borderLeftWidth) || 0, b += parseFloat(e.borderRightWidth) || 0, b += n.arrowProposedWidth || 0;}w += getElementWidth(a, true, true, true);const t = w - (n.ignoreMin ? 0 : e._o.minColumnWidth);b > t && (b = t), W = w - b;} else {if (!g) {b -= ae(a);const e = getComputedStyle(d || a);b -= parseFloat(e.borderLeftWidth) || 0, b -= parseFloat(e.borderRightWidth) || 0, b -= n.arrowProposedWidth || 0;}const t = w + (n.ignoreMin ? 0 : e._o.minColumnWidth);b < t && (b = t), W = b - w;}o.resizer.remove(), o.resizer = null;let y = W;if (2 === n.widthMode) {let t = he(e),i = 0,r = 0;for (let e = 0; e < o.visibleColumns.length; e++) {var _l$actualWidth;const l = o.visibleColumns[e];l.name !== n.name && (2 === l.widthMode ? (i += l.width, r++) : t -= (_l$actualWidth = l.actualWidth) !== null && _l$actualWidth !== void 0 ? _l$actualWidth : 0);}if (t <= 0 && o.table && (t = o.table.clientWidth), t > Math.max(l.minColumnWidth, 1)) {if (y = W / t, r > 0) {const e = y / ((1 - y) / i);i += y, (i < 1 && l.relativeWidthGrowsToFillWidth || i > 1 && l.relativeWidthShrinksToFillWidth) && (y = e);}y *= 100, y += "%";}}e.setColumnWidth(n.name, y);}function I(e, t) {var _o$columns$get;const l = e._o,o = e._p;if (!l.resizableColumns) return;const i = F(e, t),r = t.target.closest("div.".concat(l.tableClassName, "-header-cell,div.").concat(l.cellPreviewClassName));r && (i && (_o$columns$get = o.columns.get(i)) !== null && _o$columns$get !== void 0 && _o$columns$get.resizable ? r.style.cursor = "e-resize" : r.style.cursor = "");}function O(e, t) {var _ref3, _t$v2, _n$changedTouches;const o = e._o,n = t,s = t,a = (_ref3 = (_t$v2 = t[v]) !== null && _t$v2 !== void 0 ? _t$v2 : (_n$changedTouches = n.changedTouches) === null || _n$changedTouches === void 0 ? void 0 : _n$changedTouches[0]) !== null && _ref3 !== void 0 ? _ref3 : { pageX: s.pageX, pageY: s.pageY },d = t.target.closest("div.".concat(o.tableClassName, "-header-cell,div.").concat(o.cellPreviewClassName));if (!d) return;const u = getElementOffset(d);u.width = getElementWidth(d, true, true, true), u.height = getElementHeight(d, true, true, true), e.emit("headercontextmenu", { columnName: d.columnName, pageX: a.pageX, pageY: a.pageY, bounds: u });}function D(e, t) {if (se(t)) return;if (F(e, t)) return;const l = e._o,o = e._p,i = t.target.closest("div.".concat(l.tableClassName, "-header-cell,div.").concat(l.cellPreviewClassName));if (!i) return;if (!l.sortableColumns) return;const r = o.columns.get(i.columnName),n = o.rows.sortColumn;if (r && r.sortable) {let t = true;const o = n.length ? n[n.length - 1] : null;o && o.column === r.name && (o.descending && l.allowCancelSort ? (t = false, n.splice(n.length - 1, 1)) : o.descending = !o.descending);const i = e;t ? i.sort(r.name, void 0, true).render() : i.sort();}}function B(e, t) {const l = e._p,o = l.visibleColumns.findIndex((e) => e.movable),i = l.visibleColumns.findLastIndex((e) => e.movable),r = l.visibleColumns.findIndex((e) => e === t);return t.movable || -1 !== o && r >= o && r <= i;}const $ = Array.prototype.indexOf,q = document.createElement.bind(document);function X(e) {const t = e._p;return t.headerRow && (t.headerRow = void 0), e;}function V(e) {const t = e._o,l = e._p;if (!l.tbody) return e;if (t.virtualTable && l.virtualListHelper) {const e = l.virtualListHelper.estimateFullHeight();l._lastVirtualScrollHeight = e, l.tbody.style.height = e + "px";} else l.tbody.style.height = "";return e;}function j(e, t) {const l = e._p;if (!l.table) return e;const o = l.table.offsetWidth - l.table.clientWidth;if (o !== l.scrollbarWidth || t) {var _l$notifyRendererOfCo;l.scrollbarWidth = o;for (let e = 0; e < l.columns.length; e++) l.columns[e].actualWidthConsideringScrollbarWidth = null;if (l.scrollbarWidth > 0 && l.visibleColumns.length > 0 && l.tbody && l.headerRow) {var _l$visibleColumns$e$a;const e = l.visibleColumns.length - 1;l.visibleColumns[e].actualWidthConsideringScrollbarWidth = ((_l$visibleColumns$e$a = l.visibleColumns[e].actualWidth) !== null && _l$visibleColumns$e$a !== void 0 ? _l$visibleColumns$e$a : 0) - l.scrollbarWidth;const t = l.visibleColumns[e].actualWidthConsideringScrollbarWidth + "px",o = l.tbody.childNodes;for (let l = 0, i = o.length; l < i; l++) {const i = o[l];1 === i.nodeType && (i.childNodes[e].style.width = t);}l.headerRow.childNodes[e].style.width = t;}U(e), (_l$notifyRendererOfCo = l.notifyRendererOfColumnsConfig) === null || _l$notifyRendererOfCo === void 0 ? void 0 : _l$notifyRendererOfCo.call(l);}return e;}function Y(e, t) {const l = e._o,o = e._p;if (!o.tbody || !o.table || !o.headerRow) return e;const i = ce(e);if (o.tbody.style.minWidth = i + "px", o.headerRow.style.minWidth = i + (o.scrollbarWidth || 0) + "px", o.eventsSink.remove(o.table, "scroll"), l.width === _.AUTO) setElementWidth(o.table, getElementWidth(o.tbody, true, true, true)), setElementWidth(e.el, getElementWidth(o.table, true, true, true));else if (l.width === _.SCROLL) {if (t) {const t = o.table ? o.table.scrollTop : 0,l = o.table ? o.table.scrollLeft : 0;!function (e) {const t = e.style.display;e.style.display = "none", e.offsetHeight, e.style.display = t;}(e.el), o.table.scrollTop = t, o.table.scrollLeft = l, o.header && (o.header.scrollLeft = l);}const l = () => function (e) {const t = e._p;t.header.scrollLeft = t.table.scrollLeft, G(e);}(e);o.eventsSink.add(o.table, "scroll", l);}return e;}function U(e) {var _t$scrollbarWidth;const t = e._p,l = e._o;if (!t.headerRow) return;const o = l.tableClassName + "-sticky",i = t.headerRow,r = me(e);t.lastIsRtl = r;const n = (_t$scrollbarWidth = t.scrollbarWidth) !== null && _t$scrollbarWidth !== void 0 ? _t$scrollbarWidth : 0,s = t.lastDetectedWidth,a = l.maxStickyColumnRelativeWidth,d = "number" == typeof a && s ? s * a : null;let u = 0,h = 0,c = null;const m = [],f = [];let p = null,g = [],C = null,v = 0,b = [];for (let e = i.firstElementChild; e; e = e.nextElementSibling) {var _i$actualWidth, _p;const l = e.getAttribute("data-column");if (!l) continue;const i = t.columns.get(l);if (!i) continue;i.headerScrollbarCompensation = 0;let s = "start" === i.sticky || "end" === i.sticky;if (s && null !== d && v + ((_i$actualWidth = i.actualWidth) !== null && _i$actualWidth !== void 0 ? _i$actualWidth : 0) > d && (s = false), s) {var _i$actualWidth2, _i$actualWidth3, _i$stickyPos, _i$stickyPos2, _i$stickyPos3;let l = (_i$actualWidth2 = i.actualWidth) !== null && _i$actualWidth2 !== void 0 ? _i$actualWidth2 : 0;v += 0, e.className += " " + o, e.style.position = "sticky";let s,a = null;null === c && (a = getComputedStyle(e), c = a.boxSizing), "content-box" === c && (null === a && (a = getComputedStyle(e)), l += (parseFloat(a.paddingLeft) || 0) + (parseFloat(a.paddingRight) || 0) + (parseFloat(a.borderLeftWidth) || 0) + (parseFloat(a.borderRightWidth) || 0)), "start" === i.sticky ? (s = { direction: "start", absDirection: r ? "right" : "left", offset: u }, e.style[s.absDirection] = u + "px", u += l, g.length = 0, p = [e], m.push(p)) : (C = e, s = { direction: "end", absDirection: r ? "left" : "right", offset: h }, e.style[s.absDirection] = h + n + "px", e.style.width = ((_i$actualWidth3 = i.actualWidth) !== null && _i$actualWidth3 !== void 0 ? _i$actualWidth3 : 0) + "px", h += l, f.push([e, ...g]), g.length = 0), s.direction === ((_i$stickyPos = i.stickyPos) === null || _i$stickyPos === void 0 ? void 0 : _i$stickyPos.direction) && s.offset === ((_i$stickyPos2 = i.stickyPos) === null || _i$stickyPos2 === void 0 ? void 0 : _i$stickyPos2.offset) && s.absDirection === ((_i$stickyPos3 = i.stickyPos) === null || _i$stickyPos3 === void 0 ? void 0 : _i$stickyPos3.absDirection) || b.push(t.visibleColumns.indexOf(i)), i.stickyPos = s;} else i.stickyPos && b.push(t.visibleColumns.indexOf(i)), delete i.stickyPos, (_p = p) !== null && _p !== void 0 && _p.push(e), g !== null && g !== void 0 && g.push(e), "sticky" === e.style.position && (e.classList.remove(o), e.style.position = "", e.style.left = "", e.style.right = "");}C && (C.style[r ? "left" : "right"] = "0px"), t.stickiesStart = m, t.stickiesEnd = f, b.length > 0 && e.refreshAllVirtualRows(), t.lastStickyScrollLeft = void 0, G(e);}function G(e) {const t = e._p;if (!t.table || !t.headerRow || !t.tbody) return;const l = t.stickiesStart,o = t.stickiesEnd,i = t.stickiesSetStart,r = t.stickiesSetEnd,n = t.stickiesSetStart = new Set(),s = t.stickiesSetEnd = new Set();if (l !== null && l !== void 0 && l.length || o !== null && o !== void 0 && o.length) {const e = t.table.scrollLeft;if (e === t.lastStickyScrollLeft) return;t.lastStickyScrollLeft = e;const i = t.headerRow.children,r = 1.5,a = t.lastIsRtl;let d = null;const u = (e, l, o) => {if (e && e.length) {for (const t of e) {l || (d = t);const e = t[0],n = t.slice(1),s = n[0],u = n[n.length - 1];if (!e || !e.getBoundingClientRect) continue;const h = e.getBoundingClientRect(),c = l !== a;let m = false;if (s && u) {const e = s.getBoundingClientRect(),t = u.getBoundingClientRect();m = l ? a ? h.right - r > t.left && h.left + r < e.right : h.right - r > e.left && h.left + r < t.right : a ? h.left + r < e.right && h.right - r > t.left : h.left + r < t.right && h.right - r > e.left;}e.classList.toggle(c ? "is-sticky-left" : "is-sticky-right", m), m && o.add($.call(i, e));}if (d) {var _ref4, _l$actualWidthConside, _ref5, _l$actualWidthConside2;const e = d[0],l = t.columns.get(e.getAttribute("data-column")),o = a ? "marginRight" : "marginLeft";e.style[o] = "", e.style.width = ((_ref4 = (_l$actualWidthConside = l.actualWidthConsideringScrollbarWidth) !== null && _l$actualWidthConside !== void 0 ? _l$actualWidthConside : l.actualWidth) !== null && _ref4 !== void 0 ? _ref4 : 0) + "px";let i = 0;if (t.scrollbarWidth > 0) {const l = e.getBoundingClientRect(),r = e.offsetParent.getBoundingClientRect(),n = a ? l.left - r.left : r.right - l.right;n <= t.scrollbarWidth && (i = Math.min(t.scrollbarWidth, Math.max(0, t.scrollbarWidth - n + 1)), i < t.scrollbarWidth && (e.style[o] = -i + "px"));}l.headerScrollbarCompensation = i, e.style.width = ((_ref5 = (_l$actualWidthConside2 = l.actualWidthConsideringScrollbarWidth) !== null && _l$actualWidthConside2 !== void 0 ? _l$actualWidthConside2 : l.actualWidth) !== null && _ref5 !== void 0 ? _ref5 : 0) + i + "px";}}};u(l, true, n), u(o, false, s);}const a = [],d = [];for (const e of n) (i === null || i === void 0 ? void 0 : i.has(e)) || a.push({ index: e, start: true });for (const e of s) (r === null || r === void 0 ? void 0 : r.has(e)) || a.push({ index: e, start: false });if (i) for (const e of i) n.has(e) || d.push({ index: e, start: true });if (r) for (const e of r) s.has(e) || d.push({ index: e, start: false });if (!a.length && !d.length) return;let u = t.tbody.firstElementChild;for (; u;) {const e = u.children;for (const l of d) {var _e$l$index;(_e$l$index = e[l.index]) === null || _e$l$index === void 0 || _e$l$index.classList.remove(l.start !== t.lastIsRtl ? "is-sticky-left" : "is-sticky-right");}for (const l of a) {var _e$l$index2;(_e$l$index2 = e[l.index]) === null || _e$l$index2 === void 0 || _e$l$index2.classList.add(l.start !== t.lastIsRtl ? "is-sticky-left" : "is-sticky-right");}u = u.nextElementSibling;}t.isStickyColumns = new Map();for (const e of n) t.isStickyColumns.set(e, "start");for (const e of s) t.isStickyColumns.set(e, "end");}function J(e, t) {const l = e._p,o = e._o;if (!l.headerRow || !l.tbody) return e;const i = l.headerRow.querySelectorAll("div.".concat(o.tableClassName, "-header-cell"))[t];if (!i) return e;const r = l.columns.get(i.columnName);if (r) {var _r$headerScrollbarCom, _ref6, _r$actualWidthConside;const e = (_r$headerScrollbarCom = r.headerScrollbarCompensation) !== null && _r$headerScrollbarCom !== void 0 ? _r$headerScrollbarCom : 0;i.style.width = ((_ref6 = (_r$actualWidthConside = r.actualWidthConsideringScrollbarWidth) !== null && _r$actualWidthConside !== void 0 ? _r$actualWidthConside : r.actualWidth) !== null && _ref6 !== void 0 ? _ref6 : 0) + e + "px";const o = (r.actualWidthConsideringScrollbarWidth || r.actualWidth || 0) + "px",n = l.tbody.childNodes;for (let e = 0, l = n.length; e < l; e++) {const l = n[e];1 === l.nodeType && (l.childNodes[t].style.width = o);}}return e;}function K(e) {const t = e._p,l = e._o;if (t.table && t.headerRow) {const e = l.tableClassName,o = scopedSelectorAll(t.headerRow, ">div.".concat(e, "-header-cell.sorted")),i = Array.prototype.slice.call(o, 0).map((e) => e.querySelector(":scope>div>.sort-arrow")).filter((e) => !!e);for (const e of i) {var _e$parentNode;const l = (_e$parentNode = e.parentNode) === null || _e$parentNode === void 0 ? void 0 : _e$parentNode.parentNode;if (l) {const e = t.columns.get(l.columnName);e && (e.arrowProposedWidth = 0);}e.remove();}for (const e of o) e.classList.remove("sorted", "desc");}return e;}function Q(e, t, l) {var _r$element$firstChild;const o = e._p,i = e._o,r = o.columns.get(t);if (!r) return false;const n = q("span");return n.className = "sort-arrow", r.element && (r.element.className += l ? " sorted desc" : " sorted", (_r$element$firstChild = r.element.firstChild) !== null && _r$element$firstChild !== void 0 && _r$element$firstChild.insertBefore(n, r.element.firstChild.firstChild)), 2 !== r.widthMode && i.adjustColumnWidthForSortArrow && (r.arrowProposedWidth = n.scrollWidth + (parseFloat(getComputedStyle(n).marginRight) || 0) + (parseFloat(getComputedStyle(n).marginLeft) || 0)), true;}function Z(e, t) {t.firstChild, t.addEventListener("mousedown", (t) => P(e, t)), t.addEventListener("mousemove", (t) => I(e, t)), t.addEventListener("mouseup", (t) => function (e, t) {2 === t.button && O(e, t);}(e, t)), t.addEventListener("mouseleave", (t) => function (e, t) {const l = e._o,o = t.target.closest("div.".concat(l.tableClassName, "-header-cell,div.").concat(l.cellPreviewClassName));o && (o.style.cursor = "");}(e, t)), t.addEventListener("touchstart", (t) => function (e, t) {const l = e._p;if (l.currentTouchId) return;const o = t.changedTouches[0];l.currentTouchId = o.identifier;const i = t.currentTarget,r = { x: o.pageX, y: o.pageY };let n,s = r;const a = function () {l.currentTouchId = null, l.eventsSink.remove(i, ".colheader"), clearTimeout(n);};t[v] = t.changedTouches[0], true !== P(e, t) ? (n = setTimeout(() => {a(), l.eventsSink.add(i, "touchend.colheader", (e) => {se(e) || e.preventDefault(), l.eventsSink.remove(i, ".colheader");}, { once: true }).add(i, "touchcancel.colheader", (e) => {l.eventsSink.remove(i, ".colheader");}, { once: true }), Math.sqrt(Math.pow(Math.abs(s.x - r.x), 2) + Math.pow(Math.abs(s.y - r.y), 2)) < 9 && (A(e), O(e, t));}, 500), l.eventsSink.add(i, "touchend.colheader", (t) => {const o = t,i = u(Array.from(o.changedTouches), (e) => e.identifier === l.currentTouchId);i && (a(), se(t) || t.preventDefault(), s = { x: i.pageX, y: i.pageY }, (Math.sqrt(Math.pow(Math.abs(s.x - r.x), 2) + Math.pow(Math.abs(s.y - r.y), 2)) < 9 || l.resizer) && (o[v] = i, D(e, o)));}).add(i, "touchcancel.colheader", a).add(i, "touchmove.colheader", (t) => {const o = t,i = u(Array.from(o.changedTouches), (e) => e.identifier === l.currentTouchId);i && (s = { x: i.pageX, y: i.pageY }, l.resizer && (t.preventDefault(), o[v] = i, I(e, o)));})) : l.currentTouchId = null;}(e, t)), t.addEventListener("dragstart", (t) => function (e, t) {const l = e._o,o = e._p;if (l.movableColumns) {var _t$dataTransfer;const e = t.target.closest("div.".concat(l.tableClassName, "-header-cell,div.").concat(l.cellPreviewClassName));if (!e) return void t.preventDefault();const i = o.columns.get(e.columnName);i && i.movable ? (e.style.opacity = "0.35", o.dragId = 161061273 * Math.random(), (_t$dataTransfer = t.dataTransfer) === null || _t$dataTransfer === void 0 ? void 0 : _t$dataTransfer.setData("text", JSON.stringify({ dragId: o.dragId, column: i.name }))) : t.preventDefault();} else t.preventDefault();}(e, t)), t.addEventListener("click", (t) => D(e, t)), t.addEventListener("contextmenu", (e) => e.preventDefault()), t.addEventListener("dragenter", (t) => function (e, t) {const l = e._o,o = e._p;if (l.movableColumns) {var _t$dataTransfer2;let i = null;const r = (_t$dataTransfer2 = t.dataTransfer) === null || _t$dataTransfer2 === void 0 ? void 0 : _t$dataTransfer2.getData("text");if (r) try {i = JSON.parse(r);} catch (_unused4) {i = null;}const n = t.target.closest("div.".concat(l.tableClassName, "-header-cell,div.").concat(l.cellPreviewClassName));if (!n) return;if (!i || o.dragId === i.dragId && n.columnName !== i.column) {const t = o.columns.get(n.columnName);t && B(e, t) && n.classList.add("drag-over");}}}(e, t)), t.addEventListener("dragover", (e) => {e.preventDefault();}), t.addEventListener("dragleave", (t) => function (e, t) {const l = e._o,o = t.target.closest("div.".concat(l.tableClassName, "-header-cell,div.").concat(l.cellPreviewClassName));if (!o) return;const i = t.relatedTarget;i === o || o.contains(i) || o.classList.remove("drag-over");}(e, t)), t.addEventListener("drop", (t) => function (e, t, _t$dataTransfer3) {t.preventDefault();const l = e._o,o = e._p,i = (_t$dataTransfer3 = t.dataTransfer) === null || _t$dataTransfer3 === void 0 ? void 0 : _t$dataTransfer3.getData("text");if (!i) return;let r;try {r = JSON.parse(i);} catch (_unused5) {return;}const n = t.target.closest("div.".concat(l.tableClassName, "-header-cell,div.").concat(l.cellPreviewClassName));if (n) {if (l.movableColumns && r.dragId === o.dragId) {const t = r.column,l = n.columnName,i = o.columns.get(t),s = o.columns.get(l);i && s && i.movable && B(e, s) && e.moveColumn(t, l);}n.classList.remove("drag-over");}}(e, t));}function ee(e, t) {let l = 0;if ("string" == typeof e) {const t = e.trim().toLowerCase();if ("rest" === t) return { width: 0, mode: 3 };if ("auto" === t) return { width: 0, mode: 0 };}let o = parseFloat(e);return Number.isFinite(o) || (o = 0), o = Math.max(0, o), o > 0 && ("string" == typeof e && e.trim().endsWith("%") ? (l = 2, o /= 100) : o > 0 && o < 1 ? l = 2 : (o < t && (o = t), l = 1)), { width: o, mode: l };}function te(e, t) {var _t$allowPreview;let l = ee(t.width, t.ignoreMin ? 0 : e.minColumnWidth),o = { name: t.name, label: void 0 === t.label ? t.name : t.label, width: l.width, widthMode: l.mode, resizable: void 0 === t.resizable || t.resizable, sortable: void 0 === t.sortable || t.sortable, movable: void 0 === t.movable || t.movable, visible: void 0 === t.visible || t.visible, cellClasses: void 0 === t.cellClasses ? e.cellClasses : t.cellClasses, ignoreMin: void 0 !== t.ignoreMin && !!t.ignoreMin, sticky: void 0 === t.sticky ? null : t.sticky || null, allowPreview: !!((_t$allowPreview = t.allowPreview) !== null && _t$allowPreview !== void 0 ? _t$allowPreview : 1), dataPath: [], comparePath: [], order: 0 };const i = void 0 === t.dataPath ? o.name : t.dataPath,r = void 0 === t.comparePath ? i : t.comparePath;return o.dataPath = "string" == typeof i ? i.split(".") : i, o.comparePath = "string" == typeof r ? r.split(".") : r, o;}function le(e) {const t = e._p;0 === t.visibleColumns.length && t.columns.length && (t.columns[0].visible = true, t.visibleColumns.push(t.columns[0]), e.emit("showcolumn", t.columns[0].name));}function oe(e) {const t = e._p;if (t.filteredRows && t.filterArgs) {let l = e._o.filter || S;t.filteredRows = t.rows.filteredCollection(l, t.filterArgs);}}function ie(e, t, l) {let o = l.dataPath,i = t[o[0]];for (let e = 1; e < o.length && null != i; e++) i = i && i[o[e]];const r = e.cellFormatter;let n;if (r[c]) n = r(i, l.name, t);else try {n = r(i, l.name, t);} catch (e) {n = "[ERROR]", console.error("Failed to generate content for cell " + l.name, e);}return null == n && (n = ""), n;}const re = document.createElement.bind(document);function ne(e) {["relative", "absolute", "fixed"].includes(getComputedStyle(e).position) || (e.style.position = "relative");}function se(e) {const t = e.target;return /^(?:INPUT|TEXTAREA|BUTTON|SELECT)$/.test(t.tagName);}function ae(e) {const t = getComputedStyle(e);return (parseFloat(t.paddingLeft) || 0) + (parseFloat(t.paddingRight) || 0);}function de(e) {const t = e.style;t["-webkit-touch-callout"] = "none", t["-webkit-user-select"] = "none", t["-moz-user-select"] = "none", t["-ms-user-select"] = "none", t["-o-user-select"] = "none", t["user-select"] = "none";}function ue(e, t) {let l = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;const i = e._o,n = i.tableClassName,s = re("div");s.className = e.el.className, setCssProps(s, { position: "absolute", top: "-9999px", left: "0", visibility: "hidden", width: "auto", overflow: "visible" });const a = re("div");a.className = "".concat(n, "-header");const d = re("div");d.className = "".concat(n, "-header-row");const u = re("div");u.className = "".concat(n, "-header-cell ").concat(t.cellClasses || ""), u.style.width = "auto";const h = u.cloneNode(true),c = u.cloneNode(true);u.appendChild(re("div")).innerHTML = i.headerCellFormatter(t.label, t.name), d.appendChild(h), d.appendChild(u), d.appendChild(c), a.appendChild(d), s.appendChild(a), document.body.appendChild(s);let m = getElementWidth(u, true, true, true) + i.columnAutoWidthExtraSize;if (l) {const e = re("div");e.className = "".concat(n, "-body");const o = re("div");o.className = "".concat(n, "-row");const a = re("div");a.className = "".concat(n, "-cell ").concat(t.cellClasses || ""), a.style.width = "auto";const d = a.appendChild(re("div"));o.appendChild(a), e.appendChild(o), s.appendChild(e);for (let e = 0; e < l.length; e++) d.innerHTML = ie(i, l[e], t), m = Math.max(m, getElementWidth(a, true, true, true));}return s.remove(), m += t.arrowProposedWidth || 0, !t.ignoreMin && m < i.minColumnWidth && (m = i.minColumnWidth), Math.ceil(m);}function he(e) {const t = e._o,l = e._p;let i,n = 0,s = 0;l.table && (n = l.table ? l.table.scrollTop : 0, s = l.table ? l.table.scrollLeft : 0, t.virtualTable && (i = l.table.style.display, l.table.style.display = "none"));let a = getElementWidth(e.el);l.table && (t.virtualTable && void 0 !== i && (l.table.style.display = i), l.table.scrollTop = n, l.table.scrollLeft = s, l.header && (l.header.scrollLeft = s));const d = t.tableClassName,u = re("div");u.className = e.el.className, setCssProps(u, { "z-index": "-1", position: "absolute", left: "0", top: "-9999px" });const h = re("div");h.className = "".concat(d, "-header"), u.appendChild(h);const c = re("div");c.index = null, c.vIndex = null, c.className = "".concat(d, "-header-row"), h.appendChild(c);for (let e = 0; e < l.visibleColumns.length; e++) {const t = l.visibleColumns[e],o = re("div");o.className = "".concat(d, "-header-cell ").concat(t.cellClasses || ""), o.columnName = t.name, o.appendChild(re("div")), c.appendChild(o);}document.body.appendChild(u), a -= function (e) {const t = getComputedStyle(e);return (parseFloat(t.borderLeftWidth) || 0) + (parseFloat(t.borderRightWidth) || 0);}(c);const m = c.querySelectorAll("div.".concat(d, "-header-cell"));for (const e of m) {const t = getComputedStyle(e);if ("border-box" !== t.boxSizing) {a -= (parseFloat(t.borderRightWidth) || 0) + (parseFloat(t.borderLeftWidth) || 0) + ae(e);const o = e.columnName,i = l.columns.get(o);i && (a -= i.arrowProposedWidth || 0);}}return u.remove(), Math.max(0, a);}function ce(e) {const t = e._p,l = e._o.tableClassName,i = l + "-row",n = l + "-cell",s = t.visibleColumns,a = s.length,d = re("div");d.className = i, d.style.float = "left";let u = 0;for (let e = 0; e < a; e++) {var _t$actualWidth, _t$actualWidth2;const t = s[e],l = re("div");l.className = n, l.style.width = ((_t$actualWidth = t.actualWidth) !== null && _t$actualWidth !== void 0 ? _t$actualWidth : 0) + "px", t.cellClasses && (l.className += " " + t.cellClasses), l.appendChild(re("div")), d.appendChild(l), u += (_t$actualWidth2 = t.actualWidth) !== null && _t$actualWidth2 !== void 0 ? _t$actualWidth2 : 0;}const h = re("div");h.className = e.el.className, setCssProps(h, { "z-index": "-1", position: "absolute", left: "0", top: "-9999px", float: "left", width: "1px", overflow: "hidden" });const c = re("div");c.className = l, h.appendChild(c);const m = re("div");m.className = l + "-body", m.style.width = u + 1e4 + "px", c.appendChild(m), m.appendChild(d), document.body.appendChild(h);const f = re("div");setCssProps(f, { border: "1.5px solid #000", width: "0", height: "0", position: "absolute", left: "0", top: "-9999px" }), document.body.appendChild(f);const p = parseFloat(getComputedStyle(f).borderWidth),g = Math.round(p) !== p;f.remove();let C = getElementWidth(d, true, true, true);return C -= t.scrollbarWidth || 0, g && C++, h.remove(), C;}function me(e) {const t = e._p;return !!t.table && "rtl" === getComputedStyle(t.table).direction;}function fe(e) {var _e$unconvertedWidthMo;const t = null != e.unconvertedWidth ? e.unconvertedWidth : e.width,l = null != e.unconvertedWidth ? (_e$unconvertedWidthMo = e.unconvertedWidthMode) !== null && _e$unconvertedWidthMo !== void 0 ? _e$unconvertedWidthMo : e.widthMode : e.widthMode;return 0 === l ? "auto" : 2 === l ? 100 * t + "%" : 3 === l ? "rest" : t;}const pe = Object.prototype.hasOwnProperty;document.createElement.bind(document);class ge {constructor(e) {var _e$maxColumnsSortCoun, _e$sortedColumns;_defineProperty(this, "VERSION", void 0);_defineProperty(this, "el", void 0);_defineProperty(this, "_o", void 0);_defineProperty(this, "_p", void 0);_defineProperty(this, w, void 0);this.VERSION = ge.VERSION;const t = this._o = {},n = this._p = { eventsSink: new DomEventsSink(), mitt: { all: s = s || new Map(), on: function (e, t) {var l = s.get(e);l ? l.push(t) : s.set(e, [t]);}, off: function (e, t) {var l = s.get(e);l && (t ? l.splice(l.indexOf(t) >>> 0, 1) : s.set(e, []));}, emit: function (e, t) {var l = s.get(e);l && l.slice().map(function (e) {e(t);}), (l = s.get("*")) && l.slice().map(function (l) {l(e, t);});} }, tableSkeletonNeedsRendering: true };var s;this.el = e.el && e.el instanceof HTMLElement ? e.el : document.createElement("div"), this.el !== e.el && this.el.classList.add(e.className || "dgtable-wrapper"), n.eventsSink.add(this.el, "dragend.colresize", (e) => {return t = e, void (this._p.resizer || (t.target.style.opacity = ""));var t;}), n.isWheelScrolling = false, n.eventsSink.add(this.el, "wheel", (e) => {if (n.cellPreviewCell) {let t = false,l = e.target;for (; l && l !== n.cellPreviewCell;) {const e = getComputedStyle(l),o = e.overflowY,i = e.overflowX,r = ("auto" === o || "scroll" === o) && l.scrollHeight > l.clientHeight,n = ("auto" === i || "scroll" === i) && l.scrollWidth > l.clientWidth;if (r || n) {t = true;break;}l = l.parentElement;}if (t) return;}n.isWheelScrolling = true, z(this), n.wheelScrollTimeout && clearTimeout(n.wheelScrollTimeout), n.wheelScrollTimeout = setTimeout(() => {n.isWheelScrolling = false, n.wheelScrollTimeout = void 0;}, 100);}, { passive: true }), t.virtualTable = void 0 === e.virtualTable || !!e.virtualTable, t.estimatedRowHeight = e.estimatedRowHeight || void 0, t.rowsBufferSize = e.rowsBufferSize || 3, t.minColumnWidth = Math.max(e.minColumnWidth || 35, 0), t.maxStickyColumnRelativeWidth = e.maxStickyColumnRelativeWidth || null, t.columnAutoWidthExtraSize = e.columnAutoWidthExtraSize || 0, t.resizeAreaWidth = e.resizeAreaWidth || 8, t.resizeAreaDoubleClickDuration = e.resizeAreaDoubleClickDuration || 300, t.autoFitColumnOnResizeDoubleClick = void 0 !== e.autoFitColumnOnResizeDoubleClick && !!e.autoFitColumnOnResizeDoubleClick, t.resizableColumns = void 0 === e.resizableColumns || !!e.resizableColumns, t.movableColumns = void 0 === e.movableColumns || !!e.movableColumns;const d = (_e$maxColumnsSortCoun = e.maxColumnsSortCount) !== null && _e$maxColumnsSortCoun !== void 0 ? _e$maxColumnsSortCoun : e.sortableColumns;t.sortableColumns = void 0 === d ? 1 : Number(d) || 1, t.adjustColumnWidthForSortArrow = void 0 === e.adjustColumnWidthForSortArrow || !!e.adjustColumnWidthForSortArrow, t.convertColumnWidthsToRelative = void 0 !== e.convertColumnWidthsToRelative && !!e.convertColumnWidthsToRelative, t.autoFillTableWidth = void 0 !== e.autoFillTableWidth && !!e.autoFillTableWidth, t.autoFillLastColumn = void 0 === e.autoFillLastColumn || !!e.autoFillLastColumn, t.allowCancelSort = void 0 === e.allowCancelSort || !!e.allowCancelSort, t.cellClasses = void 0 === e.cellClasses ? "" : e.cellClasses, t.resizerClassName = void 0 === e.resizerClassName ? "dgtable-resize" : e.resizerClassName, t.tableClassName = void 0 === e.tableClassName ? "dgtable" : e.tableClassName, t.allowCellPreview = void 0 === e.allowCellPreview || e.allowCellPreview, t.allowHeaderCellPreview = void 0 === e.allowHeaderCellPreview || e.allowHeaderCellPreview, t.cellPreviewClassName = void 0 === e.cellPreviewClassName ? "dgtable-cell-preview" : e.cellPreviewClassName, t.cellPreviewAutoBackground = void 0 === e.cellPreviewAutoBackground || e.cellPreviewAutoBackground, t.onComparatorRequired = void 0 === e.onComparatorRequired ? null : e.onComparatorRequired, t.customSortingProvider = void 0 === e.customSortingProvider ? null : e.customSortingProvider, t.width = void 0 === e.width ? _.NONE : e.width, t.relativeWidthGrowsToFillWidth = void 0 === e.relativeWidthGrowsToFillWidth || !!e.relativeWidthGrowsToFillWidth, t.relativeWidthShrinksToFillWidth = void 0 !== e.relativeWidthShrinksToFillWidth && !!e.relativeWidthShrinksToFillWidth, this.setCellFormatter(e.cellFormatter), this.setHeaderCellFormatter(e.headerCellFormatter), this.setFilter(e.filter), t.height = e.height, this.setColumns(e.columns || [], false);let u = [];const h = (_e$sortedColumns = e.sortedColumns) !== null && _e$sortedColumns !== void 0 ? _e$sortedColumns : e.sortColumn;if (h) {let e = Array.isArray(h) ? h : [h];for (let t = 0, l = e.length; t < l; t++) {var _l$descending;let l = e[t];"string" == typeof l && (l = { column: l, descending: false });let o = n.columns.get(l.column);o && u.push({ column: l.column, comparePath: o.comparePath || o.dataPath, descending: (_l$descending = l.descending) !== null && _l$descending !== void 0 ? _l$descending : false });}}n.rows = new W({ sortColumn: u }), n.rows.onComparatorRequired = (e, l, o) => {if (t.onComparatorRequired) return t.onComparatorRequired(e, l, o);}, n.rows.customSortingProvider = (e, l) => t.customSortingProvider ? t.customSortingProvider(e, l) : l(e), n.filteredRows = null, n.scrollbarWidth = 0, n._lastVirtualScrollHeight = 0, function (e) {const t = e._p,n = (t) => {let n = t.currentTarget,s = t.relatedTarget;s === n || n.contains(s) || n[g] && (s === n[g] || n[g].contains(s)) || function (e, t, _s$visibleColumns$x$c, _E$right) {const n = e._o,s = e._p;if (s.isWheelScrolling) return;const a = t.firstElementChild;if (!a) return;if (!(a.scrollWidth - a.clientWidth > 1 || a.scrollHeight - a.clientHeight > 1)) return;z(e), s.abortCellPreview = false;const d = t.parentElement;if (!d) return;const u = (_s$visibleColumns$x$c = s.visibleColumns[x.call(d.childNodes, t)]) === null || _s$visibleColumns$x$c === void 0 ? void 0 : _s$visibleColumns$x$c.name,h = u ? s.columns.get(u) : null;if (!h) return;const c = d.index;if (e.emit("cellhoveroverflow", { name: u, rowIndex: c !== null && c !== void 0 ? c : null, rowData: null == c ? null : s.rows[c], cell: t, cellEl: a }), false === h.allowPreview) return;const m = k("div");m.innerHTML = t.innerHTML, m.className = n.cellPreviewClassName + " " + (h.cellClasses || "");const f = t.classList.contains("".concat(n.tableClassName, "-header-cell"));f && (m.classList.add("header"), t.classList.contains("sortable") && m.classList.add("sortable"), m.draggable = true, Z(e, m));const p = getComputedStyle(t),v = getComputedStyle(a),b = "right" === p.float,w = b ? "right" : "left",W = parseFloat(p.paddingLeft) || 0,y = parseFloat(p.paddingRight) || 0,R = parseFloat(p.paddingTop) || 0,S = parseFloat(p.paddingBottom) || 0;let _ = a.scrollWidth + (t.clientWidth - a.offsetWidth);const M = "border-box" === p.boxSizing;if (M ? m.style.boxSizing = "border-box" : (_ -= W + y, m.style.marginTop = (parseFloat(p.borderTopWidth) || 0) + "px"), !s.transparentBgColor1) {const e = document.createElement("div");document.body.appendChild(e), e.style.backgroundColor = "transparent", s.transparentBgColor1 = getComputedStyle(e).backgroundColor, e.style.backgroundColor = "rgba(0,0,0,0)", s.transparentBgColor2 = getComputedStyle(e).backgroundColor, e.remove();}const T = { "box-sizing": M ? "border-box" : "content-box", width: _ + "px", "min-height": Math.max(getElementHeight(t), /%/.test(p.minHeight) ? 0 : parseFloat(p.minHeight) || 0) + "px", "padding-left": W + "px", "padding-right": y + "px", "padding-top": R + "px", "padding-bottom": S + "px", overflow: "hidden", position: "absolute", "z-index": "-1", [w]: "0", top: "0", cursor: p.cursor };let L = p.backgroundColor;L !== s.transparentBgColor1 && L !== s.transparentBgColor2 || (L = getComputedStyle(d).backgroundColor), L !== s.transparentBgColor1 && L !== s.transparentBgColor2 || (L = "#fff"), T["background-color"] = L, setCssProps(m, T), m.firstChild && setCssProps(m.firstChild, { direction: v.direction, "white-space": v.whiteSpace, "min-height": v.minHeight, "line-height": v.lineHeight, font: v.font }), e.el.appendChild(m), f && de(m), m.rowVIndex = d.vIndex, m.rowIndex = c, m.columnName = u;try {const e = N.saveSelection(t);e && N.restoreSelection(m, e);} catch (_unused6) {}if (e.emit("cellpreview", { el: m.firstElementChild, name: m.columnName, rowIndex: c !== null && c !== void 0 ? c : null, rowData: null == c ? null : s.rows[c], cell: t, cellEl: a }), s.abortCellPreview) return void m.remove();null != c && m.addEventListener("click", (t) => {e.emit("rowclick", { event: t, filteredRowIndex: d.vIndex, rowIndex: c, rowEl: d, rowData: s.rows[c] });});const F = e.el,A = F === window ? document : F,P = getComputedStyle(F),E = getElementOffset(t),H = getElementOffset(F);if (b) {const e = window.innerWidth;E.right = e - (E.left + getElementWidth(t, true, true, true)), H.right = e - (H.left + getElementWidth(F, true, true, true));}E.left -= parseFloat(P.borderLeftWidth) || 0, "right" === w && void 0 !== E.right && void 0 !== H.right && (E.right -= parseFloat(P.borderRightWidth) || 0), E.top -= parseFloat(P.borderTopWidth) || 0, "left" === w ? E.left += parseFloat(p.borderLeftWidth) || 0 : void 0 !== E.right && (E.right += parseFloat(p.borderRightWidth) || 0), E.top += parseFloat(p.borderTopWidth) || parseFloat(p.borderBottomWidth) || 0, E.left -= H.left, "right" === w && void 0 !== E.right && void 0 !== H.right && (E.right -= H.right), E.top -= H.top;const I = getElementWidth(F, false, false, false) - getElementWidth(m, true, true, true),O = "left" === w ? E.left : (_E$right = E.right) !== null && _E$right !== void 0 ? _E$right : 0,D = O < 0 ? 0 : O > I ? I : O;"left" === w ? E.left = D : E.right = D;const B = getElementHeight(t, true, true, true),$ = ("scrollTop" in A ? A.scrollTop : 0) + getElementHeight(F, true) - B;E.top > $ && (E.top = Math.max(0, $));const q = { top: E.top + "px", "z-index": 9999 };q[w] = ("left" === w ? E.left : E.right) + "px", setCssProps(m, q), m[C] = t, s.cellPreviewCell = m, t[g] = m, s._bindCellHoverOut(t), s._bindCellHoverOut(m);}(e, n);},s = (t) => {let l = t.currentTarget[C] || t.currentTarget,o = t.relatedTarget;o === e.el || l.contains(o) || l[g] && (o === l[g] || l[g].contains(o)) || function (e) {z(e);}(e);};t._bindCellHoverIn = (e) => {e[m] || e.addEventListener("mouseover", e[m] = n);}, t._unbindCellHoverIn = (e) => {e[m] && (e.removeEventListener("mouseover", e[m]), e[m] = null);}, t._bindCellHoverOut = (e) => {e[f] || e.addEventListener("mouseout", e[f] = s);}, t._unbindCellHoverOut = (e) => {e[f] && (e.removeEventListener("mouseout", e[f]), e[f] = null);};}(this);}on(e, t) {return this[w] || this._p.mitt.on(e, t), this;}once(e, t) {if (this[w]) return this;const l = (o) => {this._p.mitt.off(e, l), t(o);};return this._p.mitt.on(e, l), this;}off(e, t) {return this[w] || (e || t ? this._p.mitt.off(e, t) : this._p.mitt.all.clear()), this;}emit(e, t) {return this[w] || this._p.mitt.emit(e, t), this;}destroy() {var _e$virtualListHelper, _e$table, _e$tbody;const e = this._p,t = this.el;if (this[w] || !e) return this;if (A(this), (_e$virtualListHelper = e.virtualListHelper) !== null && _e$virtualListHelper !== void 0 && _e$virtualListHelper.destroy(), e.virtualListHelper = null, X(this), (_e$table = e.table) !== null && _e$table !== void 0 && _e$table.remove(), (_e$tbody = e.tbody) !== null && _e$tbody !== void 0 && _e$tbody.remove(), e.workerListeners) {for (let t = 0; t < e.workerListeners.length; t++) {let l = e.workerListeners[t];l.worker.removeEventListener("message", l.listener, false);}e.workerListeners.length = 0;}e.rows.length = e.columns.length = 0, e._deferredRender && clearTimeout(e._deferredRender);for (let e in this) pe.call(this, e) && (this[e] = null);return this[w] = true, t && t.remove(), this;}close() {this.destroy();}remove() {this.destroy();}render() {const i = this._o,r = this._p;if (!this.el.offsetParent) return r._deferredRender || (r._deferredRender = setTimeout(() => {r._deferredRender = null, !this[w] && this.el.offsetParent && this.render();})), this;if (true === r.tableSkeletonNeedsRendering) {var _r$filteredRows;r.tableSkeletonNeedsRendering = false, i.width === _.AUTO && K(this);let n = r.table && r.table.parentNode ? r.table.scrollTop : NaN,s = r.table && r.table.parentNode ? getScrollHorz(r.table) : NaN;!function (e, _t$virtualListHelper) {const t = e._p,o = e._o;(_t$virtualListHelper = t.virtualListHelper) !== null && _t$virtualListHelper !== void 0 && _t$virtualListHelper.destroy(), t.virtualListHelper = null, t.table && o.virtualTable && (t.table.remove(), t.table = void 0, t.tbody = void 0), X(e), t.currentTouchId = null, t.header && t.header.remove();const i = o.tableClassName,r = q("div"),n = q("div");r.className = "".concat(i, "-header"), n.className = "".concat(i, "-header-row"), t.header = r, t.headerRow = n, r.appendChild(n), e.el.prepend(r), ne(e.el), o.width === _.SCROLL ? e.el.style.overflow = "hidden" : e.el.style.overflow = "", !o.height && o.virtualTable && (o.height = getElementHeight(e.el, true));}(this), function (e) {const t = e._p,i = e._o,r = i.tableClassName;if (i.virtualTable && !t.virtualRowHeight) {const i = () => {const e = q("div"),t = e.appendChild(q("div")),l = t.appendChild(q("div"));return e.className = "".concat(r, "-row"), t.className = "".concat(r, "-cell"), l.innerHTML = "0", e.style.visibility = "hidden", e.style.position = "absolute", e;},n = q("div");n.className = e.el.className, setCssProps(n, { "z-index": "-1", position: "absolute", left: "0", top: "-9999px", width: "1px", overflow: "hidden" });const s = q("div");s.className = r, n.appendChild(s);const a = q("div");a.className = "".concat(r, "-body"), a.style.width = "99999px", s.appendChild(a), document.body.appendChild(n);const d = i(),u = i(),h = i();a.appendChild(d), a.appendChild(u), a.appendChild(h), t.virtualRowHeight = getElementHeight(u, true, true, true), n.remove();}if (!t.table) {var _i$height;const n = document.createDocumentFragment(),s = q("div");s.className = r, i.virtualTable && (s.className += " virtual");const a = getComputedStyle(s);let u = ((_i$height = i.height) !== null && _i$height !== void 0 ? _i$height : 0) - getElementHeight(t.header, true, true, true);"border-box" !== a.boxSizing && (u -= parseFloat(a.borderTopWidth) || 0, u -= parseFloat(a.borderBottomWidth) || 0, u -= parseFloat(a.paddingTop) || 0, u -= parseFloat(a.paddingBottom) || 0), setCssProps(s, { height: i.height ? u + "px" : "auto", display: "block", overflowY: "auto", overflowX: i.width === _.SCROLL ? "auto" : "hidden" }), n.appendChild(s);const h = q("div");h.className = i.tableClassName + "-body", h.style.minHeight = "1px", t.table = s, t.tbody = h, ne(h), ne(s), s.appendChild(h), e.el.appendChild(n), function (e, _t$filteredRows) {const t = e._p,l = e._o,o = l.tableClassName,i = o + "-row",r = o + "-row-alt",n = o + "-cell",s = o + "-sticky";let a = t.visibleColumns,u = a.length;t.notifyRendererOfColumnsConfig = () => {a = t.visibleColumns, u = a.length;for (let e = 0; e < u; e++) {const t = a[e];t._finalWidth = t.actualWidthConsideringScrollbarWidth || t.actualWidth;}}, t.virtualListHelper = new VirtualListHelper({ list: t.table, itemsParent: t.tbody, autoVirtualWrapperWidth: false, virtual: l.virtualTable, buffer: l.rowsBufferSize, estimatedItemHeight: l.estimatedRowHeight ? l.estimatedRowHeight : t.virtualRowHeight || 40, itemElementCreatorFn: () => q("div"), onItemRender: (o, d) => {const h = t.filteredRows || t.rows,c = !!t.filteredRows,m = t.isStickyColumns;o.className = i, d % 2 == 1 && (o.className += " " + r);const f = h[d],g = c ? f[b] : d;o.vIndex = d, o.index = g;for (let e = 0; e < u; e++) {var _i$_finalWidth;const i = a[e],r = q("div");if (r.columnName = i.name, r.setAttribute("data-column", i.name), r.className = n, r.style.width = ((_i$_finalWidth = i._finalWidth) !== null && _i$_finalWidth !== void 0 ? _i$_finalWidth : 0) + "px", i.cellClasses && (r.className += " " + i.cellClasses), i.stickyPos) {r.className += " " + s, r.style.position = "sticky", r.style[i.stickyPos.absDirection] = i.stickyPos.offset + "px";const l = m === null || m === void 0 ? void 0 : m.get(e);"start" === l && !t.lastIsRtl || "end" === l && t.lastIsRtl ? r.classList.add("is-sticky-left") : ("start" === l && t.lastIsRtl || "end" === l && !t.lastIsRtl) && r.classList.add("is-sticky-right");}t._bindCellHoverIn(r), r.appendChild(q("div")).innerHTML = ie(l, f, i), o.appendChild(r);}o.addEventListener("click", o[p] = (t) => {e.emit("rowclick", { event: t, filteredRowIndex: d, rowIndex: g, rowEl: o, rowData: f });}), e.emit("rowcreate", { filteredRowIndex: d, rowIndex: g, rowEl: o, rowData: f });}, onItemUnrender: (t) => {t[p] && t.removeEventListener("click", t[p]), function (e, t) {const l = e._p;for (let e = 0, o = t.childNodes, i = o.length; e < i; e++) l._unbindCellHoverIn(o[e]);}(e, t), e.emit("rowdestroy", t);}, onScrollHeightChange: (l) => {l > t._lastVirtualScrollHeight && !t.scrollbarWidth && j(e), t._lastVirtualScrollHeight = l;} }), t.virtualListHelper.setCount(((_t$filteredRows = t.filteredRows) !== null && _t$filteredRows !== void 0 ? _t$filteredRows : t.rows).length), t.notifyRendererOfColumnsConfig();}(e);}}(this), this.tableWidthChanged(true, false), function (e) {const t = e._p,l = e._o,o = l.tableClassName + "-header-cell",i = t.headerRow;for (let r = 0; r < t.visibleColumns.length; r++) {const n = t.visibleColumns[r];if (n.visible) {var _n$actualWidth;const s = q("div");s.draggable = true, s.className = o, s.style.width = ((_n$actualWidth = n.actualWidth) !== null && _n$actualWidth !== void 0 ? _n$actualWidth : 0) + "px", l.sortableColumns && n.sortable && (s.className += " sortable"), s.columnName = n.name, s.setAttribute("data-column", n.name);const a = q("div");a.innerHTML = l.headerCellFormatter(n.label, n.name), s.appendChild(a), t._bindCellHoverIn(s), i.appendChild(s), t.visibleColumns[r].element = s, Z(e, s), de(s);}}U(e), e.emit("headerrowcreate", i);}(this), r.virtualListHelper.setCount(((_r$filteredRows = r.filteredRows) !== null && _r$filteredRows !== void 0 ? _r$filteredRows : r.rows).length), V(this), j(this, true), Y(this, true);for (let e = 0; e < r.rows.sortColumn.length; e++) Q(this, r.rows.sortColumn[e].column, r.rows.sortColumn[e].descending);i.adjustColumnWidthForSortArrow && r.rows.sortColumn.length ? this.tableWidthChanged(true) : i.virtualTable || this.tableWidthChanged(), isNaN(n) || (r.table.scrollTop = n), isNaN(s) || (setScrollHorz(r.table, s), setScrollHorz(r.header, s)), U(this), this.emit("renderskeleton");}return r.virtualListHelper.render(), this.emit("render"), this;}clearAndRender(e) {var _t$notifyRendererOfCo;let t = this._p;return t.tableSkeletonNeedsRendering = true, (_t$notifyRendererOfCo = t.notifyRendererOfColumnsConfig) !== null && _t$notifyRendererOfCo !== void 0 && _t$notifyRendererOfCo.call(t), (void 0 === e || e) && this.render(), this;}setColumns(e, t) {const l = this._p;e = e || [];let o = new R();for (let t = 0, l = 0; t < e.length; t++) {let i = e[t],r = te(this._o, i);void 0 !== i.order ? (i.order > l && (l = i.order + 1), r.order = i.order) : r.order = l++, o.push(r);}return o.normalizeOrder(), l.columns = o, l.visibleColumns = o.getVisibleColumns(), le(this), this.clearAndRender(t), this;}addColumn(e, t, l) {const o = this._p;let i = o.columns;if (e && !i.get(e.name)) {let r = null;void 0 !== t && (r = "string" == typeof t ? i.get(t) : i.getByOrder(t));let n = te(this._o, e);n.order = r ? r.order : i.getMaxOrder() + 1;for (let e = i.getMaxOrder(), t = n.order; e >= t; e--) {let t = i.getByOrder(e);t && t.order++;}i.push(n), i.normalizeOrder(), o.visibleColumns = i.getVisibleColumns(), le(this), this.clearAndRender(l), this.emit("addcolumn", n.name);}return this;}removeColumn(e, t) {const l = this._p;let o = l.columns,i = o.indexOf(e);return i > -1 && (o.splice(i, 1), o.normalizeOrder(), l.visibleColumns = o.getVisibleColumns(), le(this), this.clearAndRender(t), this.emit("removecolumn", e)), this;}setColumnLabel(e, t) {let l = this._p.columns.get(e);if (l && (l.label = void 0 === t ? l.name : t, l.element)) for (let e = 0; e < l.element.firstChild.childNodes.length; e++) {let t = l.element.firstChild.childNodes[e];if (3 === t.nodeType) {t.textContent = l.label;break;}}return this;}moveColumn(e, t) {let l = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;const o = this._o,i = this._p;let r,n,a = i.columns,d = l ? i.visibleColumns : a.getColumns();if ("string" == typeof e ? r = a.get(e) : "number" == typeof e && (r = d[e]), "string" == typeof t ? n = a.get(t) : "number" == typeof t && (n = d[t]), r && n && e !== t) {let e = r.order,t = n.order,l = a.moveColumn(r, n).getVisibleColumns();if (i.visibleColumns.length !== l.length || i.visibleColumns.some((e, t) => e !== l[t])) if (i.visibleColumns = l, le(this), o.virtualTable) this.clearAndRender();else {var _ref7, _ref8;const l = scopedSelectorAll(i.headerRow, ">div.".concat(o.tableClassName, "-header-cell"));let r = e < t ? t + 1 : t,n = e;l[0].parentNode.insertBefore(l[n], l[r]);let a = i.visibleColumns[e],d = ((_ref7 = a.actualWidthConsideringScrollbarWidth || a.actualWidth) !== null && _ref7 !== void 0 ? _ref7 : 0) + "px",u = i.visibleColumns[t],h = ((_ref8 = u.actualWidthConsideringScrollbarWidth || u.actualWidth) !== null && _ref8 !== void 0 ? _ref8 : 0) + "px",c = i.tbody.childNodes;for (let l = 0, o = c.length; l < o; l++) {let o = c[l];1 === o.nodeType && (o.insertBefore(o.childNodes[n], o.childNodes[r]), o.childNodes[t].firstChild.style.width = h, o.childNodes[e].firstChild.style.width = d);}this.tableWidthChanged(true);}this.emit("movecolumn", { name: r.name, src: e, dest: t });}return this;}setColumnVisible(e, t) {const l = this._p;let o = l.columns.get(e);return t = !!t, o && !!o.visible !== t && (o.visible = t, l.visibleColumns = l.columns.getVisibleColumns(), this.emit(t ? "showcolumn" : "hidecolumn", e), le(this), this.clearAndRender()), this;}isColumnVisible(e) {let t = this._p.columns.get(e);return !!t && t.visible;}setMinColumnWidth(e) {let t = this._o;return e = Math.max(e, 0), t.minColumnWidth !== e && (t.minColumnWidth = e, this.tableWidthChanged(true)), this;}getMinColumnWidth() {return this._o.minColumnWidth;}setColumnAutoWidthExtraSize(e) {let t = this._o;return e = Math.max(e, 0), t.columnAutoWidthExtraSize !== e && (t.columnAutoWidthExtraSize = e, this.tableWidthChanged(true)), this;}getColumnAutoWidthExtraSize() {return this._o.columnAutoWidthExtraSize;}setResizeAreaWidth(e) {let t = this._o;return e = Math.max(e, 0), t.resizeAreaWidth !== e && (t.resizeAreaWidth = e, this.tableWidthChanged(true)), this;}getResizeAreaWidth() {return this._o.resizeAreaWidth;}setResizeAreaDoubleClickDuration(e) {let t = this._o;return e = Math.max(e, 0), t.resizeAreaDoubleClickDuration !== e && (t.resizeAreaDoubleClickDuration = e, this.tableWidthChanged(true)), this;}getResizeAreaDoubleClickDuration() {return this._o.resizeAreaDoubleClickDuration;}setMaxStickyColumnRelativeWidth(e) {let t = this._o;return e = e || null, t.maxStickyColumnRelativeWidth !== e && (t.maxStickyColumnRelativeWidth = e, this.tableWidthChanged(true)), this;}getMaxStickyColumnRelativeWidth() {return this._o.maxStickyColumnRelativeWidth;}setColumnWidth(e, t) {let l = this._p.columns.get(e);if (l) {let e = ee(t, l.ignoreMin ? 0 : this._o.minColumnWidth),o = fe(l);l.width = e.width, l.widthMode = e.mode, l.unconvertedWidth = null, l.unconvertedWidthMode = null;let i = fe(l);o !== i && this.tableWidthChanged(true), this.emit("columnwidth", { name: l.name, width: i, oldWidth: o });}return this;}autoFitColumn(e) {const t = this._p,l = t.filteredRows || t.rows,o = t.columns.get(e);if (!o || l.length < 1) return this;const i = ue(this, o, l);return i > 0 && this.setColumnWidth(e, i), this;}getColumnWidth(e) {let t = this._p.columns.get(e);return t ? fe(t) : null;}getColumnConfig(e) {let t = this._p.columns.get(e);if (t) {var _t$unconvertedWidthMo, _t$dataPath, _t$comparePath;const e = t.width,l = t.widthMode;null != t.unconvertedWidth && (t.width = t.unconvertedWidth, t.widthMode = (_t$unconvertedWidthMo = t.unconvertedWidthMode) !== null && _t$unconvertedWidthMo !== void 0 ? _t$unconvertedWidthMo : t.widthMode);const o = fe(t);return null != t.unconvertedWidth && (t.width = e, t.widthMode = l), { name: t.name, label: t.label, width: o, dataPath: (_t$dataPath = t.dataPath) === null || _t$dataPath === void 0 ? void 0 : _t$dataPath.join("."), comparePath: (_t$comparePath = t.comparePath) === null || _t$comparePath === void 0 ? void 0 : _t$comparePath.join("."), resizable: t.resizable, movable: t.movable, sortable: t.sortable, visible: t.visible, cellClasses: t.cellClasses, ignoreMin: t.ignoreMin, sticky: t.sticky, order: t.order };}return null;}getColumnsConfig() {const e = this._p;let t = {};for (let l = 0; l < e.columns.length; l++) t[e.columns[l].name] = this.getColumnConfig(e.columns[l].name);return t;}setMaxColumnSortCount(e) {const t = this._p,l = this._o;if (l.sortableColumns !== e && (l.sortableColumns = e, t.table)) {const e = scopedSelectorAll(t.headerRow, ">div.".concat(l.tableClassName, "-header-cell"));for (let o = 0, i = e.length; o < i; o++) e[o].classList[l.sortableColumns > 0 && t.visibleColumns[o].sortable ? "add" : "remove"]("sortable");}return this;}getMaxColumnSortCount() {return this._o.sortableColumns;}setSortableColumns(e) {return this.setMaxColumnSortCount(e);}getSortableColumns() {return this.getMaxColumnSortCount();}setMovableColumns(e) {let t = this._o;return e = void 0 === e || !!e, t.movableColumns !== e && (t.movableColumns = e), this;}getMovableColumns() {return this._o.movableColumns;}setResizableColumns(e) {let t = this._o;return e = void 0 === e || !!e, t.resizableColumns !== e && (t.resizableColumns = e), this;}getResizableColumns() {return this._o.resizableColumns;}getConvertColumnWidthsToRelative() {return this._o.convertColumnWidthsToRelative;}setConvertColumnWidthsToRelative(e) {let t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;let l = this._o;return e = !!e, l.convertColumnWidthsToRelative !== e && (l.convertColumnWidthsToRelative = e, t && this.tableWidthChanged(true)), this;}setOnComparatorRequired(e) {let t = this._o;return t.onComparatorRequired !== e && (t.onComparatorRequired = e), this;}setCustomSortingProvider(e) {let t = this._o;return t.customSortingProvider !== e && (t.customSortingProvider = e), this;}sort(e, t, l) {const o = this._o,i = this._p;let r = i.columns.get(e),n = i.rows.sortColumn.map((e) => ({ column: e.column, descending: e.descending }));if (r) {if (l) {for (let e = 0; e < n.length; e++) if (n[e].column === r.name) {e < n.length - 1 ? n.length = 0 : (t = n[n.length - 1].descending, n.splice(n.length - 1, 1));break;}(o.sortableColumns > 0 && n.length >= o.sortableColumns || n.length >= i.visibleColumns.length) && (n.length = 0);} else n.length = 0;t = void 0 !== t && t, n.push({ column: r.name, descending: !!t });} else n.length = 0;return this.setSortedColumns(n);}resort() {const e = this._p;let t = e.columns,l = e.rows.sortColumn;if (l.length) {var _e$virtualListHelper2;for (let e = 0; e < l.length; e++) t.get(l[e].column) || l.splice(e--, 1);e.rows.sortColumn = l, l.length && (e.rows.sort(), e.filteredRows && (e.filteredRows.sortColumn = e.rows.sortColumn, e.filteredRows.onComparatorRequired = e.rows.onComparatorRequired, e.filteredRows.customSortingProvider = e.rows.customSortingProvider, e.filteredRows.sort())), (_e$virtualListHelper2 = e.virtualListHelper) === null || _e$virtualListHelper2 === void 0 ? void 0 : _e$virtualListHelper2.invalidate();let o = [];for (let e = 0; e < l.length; e++) o.push({ column: l[e].column, descending: l[e].descending });this.emit("sort", { sorts: o, resort: true });}return this;}setSortedColumns(e) {var _o$virtualListHelper;let t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { immediate: true, render: true };const l = this._o,o = this._p;let i = o.columns,r = e.filter((e) => i.get(e.column)).map((e) => {let t = i.get(e.column);return { column: t.name, comparePath: t.comparePath || t.dataPath, descending: !!e.descending };});l.sortableColumns > 0 && r.length > l.sortableColumns && (r.length = l.sortableColumns), K(this);for (let e = 0; e < r.length; e++) Q(this, r[e].column, r[e].descending);l.adjustColumnWidthForSortArrow && !o.tableSkeletonNeedsRendering && this.tableWidthChanged(true), o.rows.sortColumn = r, r.length && t.immediate && (o.rows.sort(), o.filteredRows && (o.filteredRows.sortColumn = o.rows.sortColumn, o.filteredRows.onComparatorRequired = o.rows.onComparatorRequired, o.filteredRows.customSortingProvider = o.rows.customSortingProvider, o.filteredRows.sort()), (_o$virtualListHelper = o.virtualListHelper) !== null && _o$virtualListHelper !== void 0 && _o$virtualListHelper.invalidate(), o.virtualListHelper && t.render && o.virtualListHelper.render());let n = [];for (let e = 0; e < r.length; e++) n.push({ column: r[e].column, descending: r[e].descending });return this.emit("sort", { sorts: n }), this;}getSortedColumns() {const e = this._p;let t = [];for (let l = 0; l < e.rows.sortColumn.length; l++) {let o = e.rows.sortColumn[l];t.push({ column: o.column, descending: o.descending });}return t;}setCellFormatter(e) {if (!e) {const t = (e) => "string" == typeof e ? h(e) : e;t[c] = true, e = t;}return this._o.cellFormatter = e, this;}setHeaderCellFormatter(e) {return this._o.headerCellFormatter = e || function (e) {return "string" == typeof e ? h(e) : e;}, this;}setFilter(e) {return this._o.filter = e, this;}filter(e) {const t = this._p;let l = this._o.filter || S,o = !!t.filteredRows;return t.filteredRows && (t.filteredRows = null), t.filterArgs = null == e ? null : "object" != typeof e || Array.isArray(e) ? e : Object.assign({}, e), null !== t.filterArgs ? (t.filteredRows = t.rows.filteredCollection(l, t.filterArgs), (o || t.filteredRows) && (this.clearAndRender(), this.emit("filter", e))) : (t.filterArgs = null, t.filteredRows = null, this.clearAndRender(), this.emit("filterclear", {})), this;}clearFilter() {const e = this._p;return e.filteredRows && (e.filterArgs = null, e.filteredRows = null, this.clearAndRender(), this.emit("filterclear", {})), this;}getHtmlForRowCell(e, t) {const l = this._p;if (e < 0 || e > l.rows.length - 1) return null;let o = l.columns.get(t);if (!o) return null;let i = l.rows[e];return ie(this._o, i, o);}getHtmlForRowDataCell(e, t) {let l = this._p.columns.get(t);return l ? ie(this._o, e, l) : null;}getRowYPos(e) {return this._p.virtualListHelper.getItemPosition(e) || null;}getDataForRow(e) {const t = this._p;return e < 0 || e > t.rows.length - 1 ? null : t.rows[e];}getRowCount() {const e = this._p;return e.rows ? e.rows.length : 0;}getIndexForRow(e) {return this._p.rows.indexOf(e);}getFilteredRowCount() {const e = this._p;return (e.filteredRows || e.rows).length;}getIndexForFilteredRow(e) {const t = this._p;return (t.filteredRows || t.rows).indexOf(e);}getDataForFilteredRow(e) {const t = this._p;return e < 0 || e > (t.filteredRows || t.rows).length - 1 ? null : (t.filteredRows || t.rows)[e];}getHeaderRowElement() {return this._p.headerRow;}addRows(e, t, l, o) {let i = this._p;"boolean" == typeof t && (o = l, l = t, t = -1), "number" != typeof t && (t = -1), (t < 0 || t > i.rows.length) && (t = i.rows.length), o = void 0 === o || !!o;const r = (Array.isArray(e) ? e : [e]).length;return e && (i.rows.add(e, t), i.filteredRows || l && i.rows.sortColumn.length ? (l && i.rows.sortColumn.length ? this.resort() : oe(this), i.tableSkeletonNeedsRendering = true, o && this.render()) : o && (i.virtualListHelper.addItemsAt(r, t), this._o.virtualTable ? (V(this), j(this), this.render(), Y(this, false)) : i.tbody && (this.render(), j(this), Y(this, true))), this.emit("addrows", { count: r, clear: false })), this;}removeRows(e, t, l) {let o = this._p;return "number" != typeof t || t <= 0 || e < 0 || e > o.rows.length - 1 || (o.rows.splice(e, t), l = void 0 === l || !!l, o.filteredRows ? (oe(this), o.tableSkeletonNeedsRendering = true, l && this.render()) : l && (o.virtualListHelper.removeItemsAt(t, e), this._o.virtualTable ? (V(this), j(this), this.render(), Y(this, false)) : (this.render(), j(this), Y(this, true)))), this;}removeRow(e, t) {return this.removeRows(e, 1, t);}refreshRow(e) {let t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;let l = this._p;if (e < 0 || e > l.rows.length - 1) return this;let o = -1;return l.filteredRows && -1 === (o = l.filteredRows.indexOf(l.rows[e])) || (-1 === o && (o = e), l.virtualListHelper.refreshItemAt(o), t && l.virtualListHelper.render()), this;}getRowElement(e) {let t = this._p;if (e < 0 || e > t.rows.length - 1) return null;let l = -1;return t.filteredRows && -1 === (l = t.filteredRows.indexOf(t.rows[e])) ? null : (-1 === l && (l = e), t.virtualListHelper.getItemElementAt(l) || null);}refreshAllVirtualRows() {return this._p.virtualListHelper.invalidate().render(), this;}setRows(e, t) {let l = this._p;return l.rows.reset(e), t && l.rows.sortColumn.length ? this.resort() : oe(this), this.clearAndRender().emit("addrows", { count: e.length, clear: true }), this;}tableWidthChanged(e, t) {let l = this._o,o = this._p,i = he(this),r = i,n = 0;if (!o.table) return this;t = void 0 === t || t;let s = 0;if (o.tbody || (t = false), t && (s = parseFloat(o.tbody.style.minWidth) || 0), r !== o.lastDetectedWidth || e) {var _o$notifyRendererOfCo;o.lastDetectedWidth = i;let e = 0,a = [],d = 0,u = 0;for (let e = 0; e < o.columns.length; e++) o.columns[e].actualWidthConsideringScrollbarWidth = null;for (let t = 0; t < o.visibleColumns.length; t++) {var _i$unconvertedWidthMo;let i = o.visibleColumns[t];if (null != i.unconvertedWidth && (i.width = i.unconvertedWidth, i.widthMode = (_i$unconvertedWidthMo = i.unconvertedWidthMode) !== null && _i$unconvertedWidthMo !== void 0 ? _i$unconvertedWidthMo : i.widthMode, i.unconvertedWidth = null, i.unconvertedWidthMode = null), 1 === i.widthMode) {let o = i.width;o += i.arrowProposedWidth || 0, !i.ignoreMin && o < l.minColumnWidth && (o = l.minColumnWidth), r -= o, e += o, o !== i.actualWidth && (i.actualWidth = o, a.push(t));} else if (0 === i.widthMode) {let n = ue(this, i);i === o.visibleColumns[o.visibleColumns.length - 1] && (n += o.scrollbarWidth), r -= n, e += n, n !== i.actualWidth && (i.actualWidth = n, l.convertColumnWidthsToRelative || a.push(t));} else 2 === i.widthMode ? (d += i.width, n++) : 3 === i.widthMode && u++;}if (l.convertColumnWidthsToRelative) for (let t = 0; t < o.visibleColumns.length; t++) {let l = o.visibleColumns[t];if (0 === l.widthMode) {const t = l.width,o = l.widthMode;null == l.unconvertedWidth && (l.unconvertedWidth = t, l.unconvertedWidthMode = o), l.widthMode = 2, r += l.actualWidth, l.width = l.actualWidth / e, d += l.width, n++;}}if (n && (d < 1 && !u && l.relativeWidthGrowsToFillWidth || d > 1 && l.relativeWidthShrinksToFillWidth)) for (let e = 0; e < o.visibleColumns.length; e++) {let t = o.visibleColumns[e];2 === t.widthMode && (null == t.unconvertedWidth && (t.unconvertedWidth = t.width, t.unconvertedWidthMode = t.widthMode), t.width /= d);}let h = Math.max(0, r);0 === h && (h = o.table.clientWidth);let c = l.minColumnWidth / h;if (Number.isFinite(c) || (c = 0), c > 0) {let e,t = 0;for (let e = 0; e < o.visibleColumns.length; e++) {let l = o.visibleColumns[e];2 === l.widthMode && !l.ignoreMin && l.width < c && (t += c - l.width, l.width = c);}for (let l = 0; l < o.visibleColumns.length; l++) {let i = o.visibleColumns[l];2 === i.widthMode && !i.ignoreMin && i.width > c && t > 0 && (null == i.unconvertedWidth && (i.unconvertedWidth = i.width, i.unconvertedWidthMode = i.widthMode), e = Math.min(t, i.width - c), i.width -= e, t -= e);}}if (!u && l.autoFillTableWidth && r > 0) {let e = 0,t = r;for (let l = 0; l < o.visibleColumns.length; l++) {let i = o.visibleColumns[l];i.resizable || 1 !== i.widthMode || (e += i.width), 2 === i.widthMode && (t -= Math.round(h * i.width));}let l = (i - e) / (i - t - e) || NaN;for (let e = 0; e < o.visibleColumns.length && t > 0; e++) {let t = o.visibleColumns[e];if (t.resizable || 1 !== t.widthMode) if (2 === t.widthMode) null == t.unconvertedWidth && (t.unconvertedWidth = t.width, t.unconvertedWidthMode = t.widthMode), t.width *= l;else {let o = t.actualWidth * l;t.actualWidth !== o && (t.actualWidth = o, -1 === a.indexOf(e) && a.push(e));}}}for (let e = 0; e < o.visibleColumns.length; e++) {let t = o.visibleColumns[e];if (2 === t.widthMode) {let l = Math.round(h * t.width);r -= l, n--, 0 === n && 1 === r && (l++, r--), -1 === r && (l--, r++), l !== t.actualWidth && (t.actualWidth = l, a.push(e));}}if (u) {let e = Math.max(0, r),t = u;for (let i = 0; i < o.visibleColumns.length; i++) {let r = o.visibleColumns[i];if (3 === r.widthMode) {let o = Math.floor(e / t);!r.ignoreMin && o < l.minColumnWidth && (o = l.minColumnWidth), e -= o, t--, o !== r.actualWidth && (r.actualWidth = o, a.push(i));}}}if (l.autoFillLastColumn && o.visibleColumns.length) {var _l$actualWidth2;let e = 0;for (let t = 0; t < o.visibleColumns.length; t++) {var _o$visibleColumns$t$a;e += (_o$visibleColumns$t$a = o.visibleColumns[t].actualWidth) !== null && _o$visibleColumns$t$a !== void 0 ? _o$visibleColumns$t$a : 0;}const t = o.visibleColumns.length - 1,l = o.visibleColumns[t],r = i - e;r > 0 && (l.actualWidth = ((_l$actualWidth2 = l.actualWidth) !== null && _l$actualWidth2 !== void 0 ? _l$actualWidth2 : 0) + r, -1 === a.indexOf(t) && a.push(t));}if (o.visibleColumns.length && (o.visibleColumns[o.visibleColumns.length - 1].actualWidthConsideringScrollbarWidth = o.visibleColumns[o.visibleColumns.length - 1].actualWidth - (o.scrollbarWidth || 0)), (_o$notifyRendererOfCo = o.notifyRendererOfColumnsConfig) !== null && _o$notifyRendererOfCo !== void 0 && _o$notifyRendererOfCo.call(o), t) {let e = ce(this);s < e && Y(this, false);for (let e = 0; e < a.length; e++) J(this, a[e]);s > e && Y(this, false);}U(this);}return this;}tableHeightChanged() {let e = this._o,t = this._p;if (!t.table) return this;const o = getComputedStyle(t.table);let i = getElementHeight(this.el, true) - (parseFloat(o.borderTopWidth) || 0) - (parseFloat(o.borderBottomWidth) || 0);return i !== e.height && (e.height = i, t.tbody && (t.tbody.style.height = Math.max(e.height - getElementHeight(t.header, true, true, true), 1) + "px"), e.virtualTable && this.clearAndRender()), this;}hideCellPreview() {return z(this), this;}abortCellPreview() {return this.hideCellPreview(), this;}cancelColumnResize() {return A(this), this;}getUrlForElementContent(e) {let t,l = document.getElementById(e);if (l) {let e = l.textContent;if ("function" == typeof Blob) t = new Blob([e || ""]);else {const l = window,o = l.BlobBuilder || l.WebKitBlobBuilder || l.MozBlobBuilder || l.MSBlobBuilder;if (!o) return null;const i = new o();i.append(e || ""), t = i.getBlob();}return (window.URL || window.webkitURL).createObjectURL(t);}return null;}isWorkerSupported() {return window.Worker instanceof Function;}createWebWorker(e, t, l) {if (this.isWorkerSupported()) {let o = this._p,i = new Worker(e),r = (e) => {e.data.append ? this.addRows(e.data.rows, l) : this.setRows(e.data.rows, l);};return i.addEventListener("message", r, false), o.workerListeners || (o.workerListeners = []), o.workerListeners.push({ worker: i, listener: r }), (t || void 0 === t) && i.postMessage(null), i;}return null;}unbindWebWorker(e) {let t = this._p;if (t.workerListeners) for (let l = 0; l < t.workerListeners.length; l++) t.workerListeners[l].worker === e && (e.removeEventListener("message", t.workerListeners[l].listener, false), t.workerListeners.splice(l, 1), l--);return this;}}_defineProperty(ge, "VERSION", "@@VERSION");_defineProperty(ge, "Width", _);
7711
+ function u(e, t) {for (let l = 0, i = e.length; l >= 0 && l < i; l += 1) if (t(e[l], l, e)) return e[l];}function h(e) {return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/'/g, "&#39;").replace(/"/g, "&quot;").replace(/\n/g, "<br />");}const c = Symbol("safe"),m = Symbol("hover_in"),f = Symbol("hover_out"),p = Symbol("row_click"),g = Symbol("preview_cell"),v = Symbol("cell"),C = Symbol("related_touch"),b = Symbol("original_row_index"),w = Symbol("destroyed");class W extends Array {constructor(e) {var _e$sortColumn, _e$onComparatorRequir, _e$customSortingProvi;super(), _defineProperty(this, "sortColumn", void 0), _defineProperty(this, "onComparatorRequired", null), _defineProperty(this, "customSortingProvider", null), e = e || {}, this.sortColumn = (_e$sortColumn = e.sortColumn) !== null && _e$sortColumn !== void 0 ? _e$sortColumn : [], this.onComparatorRequired = (_e$onComparatorRequir = e.onComparatorRequired) !== null && _e$onComparatorRequir !== void 0 ? _e$onComparatorRequir : null, this.customSortingProvider = (_e$customSortingProvi = e.customSortingProvider) !== null && _e$customSortingProvi !== void 0 ? _e$customSortingProvi : null;}add(e, t) {if (Array.isArray(e)) {const l = e;if ("number" == typeof t) {const e = l.length,i = this.length;t = t < 0 ? Math.max(i + t, 0) : Math.min(t, i), this.length = i + e;for (let l = i - 1; l >= t; l--) this[l + e] = this[l];for (let i = 0; i < e; i++) this[t + i] = l[i];} else for (let e = 0, t = l.length; e < t; e++) this.push(l[e]);} else {const l = e;"number" == typeof t ? this.splice(t, 0, l) : this.push(l);}}reset(e) {this.length = 0, e && this.add(e);}filteredCollection(e, t) {if (e && t) {const l = new W({ sortColumn: this.sortColumn, onComparatorRequired: this.onComparatorRequired, customSortingProvider: this.customSortingProvider });for (let i = 0, o = this.length; i < o; i++) {const o = this[i];e(o, t) && (o[b] = i, l.push(o));}return l;}return null;}sort(e) {let t;if ("function" == typeof e) return super.sort(e);if (this.sortColumn.length) {const e = [];for (let t = 0; t < this.sortColumn.length; t++) {const l = y(this.sortColumn[t], this.sortColumn[t].descending);let i = null;this.onComparatorRequired && (i = this.onComparatorRequired(this.sortColumn[t].column, this.sortColumn[t].descending, l)), i || (i = l), e.push(i.bind(this));}if (1 === e.length) t = e[0];else {const l = e.length;t = (t, i) => {let o = 0;for (let r = 0; r < l; r++) if (o = e[r](t, i), 0 !== o) return o;return o;};}const l = (e) => (e.sort(t), e);if (this.customSortingProvider) {const e = this.customSortingProvider(this, l);if (e !== this) {this.length = e.length;for (let t = 0, l = e.length; t < l; t++) this[t] = e[t];}} else l(this);}return this;}}function y(e, t) {let l = e.comparePath;"string" == typeof l && (l = l.split("."));const i = l.length,o = i > 1,r = t ? 1 : -1,n = t ? -1 : 1;return function (e, t) {let s = e[l[0]],a = t[l[0]];if (o) for (let e = 1; e < i; e++) s = s && s[l[e]], a = a && a[l[e]];return s === a || null == s && null == a ? 0 : null == s ? r : null == a ? n : s < a ? r : n;};}class S extends Array {constructor() {super();}get(e) {for (let t = 0, l = this.length; t < l; t++) if (this[t].name === e) return this[t];return null;}indexOf(e) {const t = "string" == typeof e ? e : e.name;for (let e = 0, l = this.length; e < l; e++) if (this[e].name === t) return e;return -1;}getByOrder(e) {for (let t = 0, l = this.length; t < l; t++) if (this[t].order === e) return this[t];return null;}normalizeOrder() {const e = [];for (let t = 0; t < this.length; t++) e.push(this[t]);e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0);for (let t = 0; t < e.length; t++) e[t].order = t;return this;}getColumns() {const e = [];for (let t = 0; t < this.length; t++) e.push(this[t]);return e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0), e;}getVisibleColumns() {const e = [];for (let t = 0; t < this.length; t++) {const l = this[t];l.visible && e.push(l);}return e.sort((e, t) => e.order < t.order ? -1 : e.order > t.order ? 1 : 0), e;}getMaxOrder() {let e = 0;for (let t = 0; t < this.length; t++) {const l = this[t];l.order > e && (e = l.order);}return e;}moveColumn(e, t) {if (e && t) {const l = e.order,i = t.order;if (l < i) for (let e = l + 1; e <= i; e++) {const t = this.getByOrder(e);t && t.order--;} else for (let e = l - 1; e >= i; e--) {const t = this.getByOrder(e);t && t.order++;}e.order = i;}return this;}}function R(e, t) {const l = t.column,i = null == t.keyword ? "" : t.keyword.toString();if (!i || !l) return true;let o = e[l];if (null == o) return false;let r = o.toString(),n = i;return t.caseSensitive || (r = r.toLowerCase(), n = n.toLowerCase()), -1 !== r.indexOf(n);}const _ = { NONE: "none", AUTO: "auto", SCROLL: "scroll" };class x {static saveSelection(e) {const t = window.getSelection();if (!t || 0 === t.rangeCount) return null;const l = t.getRangeAt(0);if (e !== l.commonAncestorContainer && !function (e, t) {let l = e;for (; (l = (_l$parentNode = (_l = l) === null || _l === void 0 ? void 0 : _l.parentNode) !== null && _l$parentNode !== void 0 ? _l$parentNode : null) && l !== t;) {var _l$parentNode, _l;}return !!l;}(l.commonAncestorContainer, e)) return null;const i = l.cloneRange();i.selectNodeContents(e), i.setEnd(l.startContainer, l.startOffset);const o = i.toString().length;return { start: o, end: o + l.toString().length };}static restoreSelection(e, t) {let l = 0;const i = [e];let o,r = false,n = false;const s = document.createRange();for (s.setStart(e, 0), s.collapse(true); !n && (o = i.pop());) if (o.nodeType === Node.TEXT_NODE) {const e = l + o.length;!r && t.start >= l && t.start <= e && (s.setStart(o, t.start - l), r = true), r && t.end >= l && t.end <= e && (s.setEnd(o, t.end - l), n = true), l = e;} else {let e = o.childNodes.length;for (; e--;) i.push(o.childNodes[e]);}const a = window.getSelection();a && (a.removeAllRanges(), a.addRange(s));}}const N = Array.prototype.indexOf,k = document.createElement.bind(document);function z(e) {const t = e._p;if (t.cellPreviewCell) {var _l$rowIndex;const l = t.cellPreviewCell,i = l[v];let o;try {o = x.saveSelection(l);} catch (_unused) {}t.cellPreviewCell.remove(), i && t._unbindCellHoverOut(i), t._unbindCellHoverOut(l);try {o && i && x.restoreSelection(i, o);} catch (_unused2) {}e.emit("cellpreviewdestroy", { el: l.firstChild, name: l.columnName, rowIndex: (_l$rowIndex = l.rowIndex) !== null && _l$rowIndex !== void 0 ? _l$rowIndex : null, rowData: null == l.rowIndex ? null : t.rows[l.rowIndex], cell: i, cellEl: i === null || i === void 0 ? void 0 : i.firstChild }), i && delete i[g], delete l[v], t.cellPreviewCell = null, t.abortCellPreview = false;} else t.abortCellPreview = true;return e;}const M = document.createElement.bind(document);function T(e) {var _ref, _e$C, _t$changedTouches;const t = e;return (_ref = (_e$C = e[C]) !== null && _e$C !== void 0 ? _e$C : (_t$changedTouches = t.changedTouches) === null || _t$changedTouches === void 0 ? void 0 : _t$changedTouches[0]) !== null && _ref !== void 0 ? _ref : e;}function L(e) {var _t$lastResizeAreaClic;const t = e._p;if (null == t.columnResizeStartTimeout) return;clearTimeout(t.columnResizeStartTimeout), t.columnResizeStartTimeout = null;const n = (_t$lastResizeAreaClic = t.lastResizeAreaClick) === null || _t$lastResizeAreaClic === void 0 ? void 0 : _t$lastResizeAreaClic.columnName;t.lastResizeAreaClick = null, n && function (e, t) {const n = e._o,s = e._p,a = s.columns.get(t);if (!n.resizableColumns || !a || !a.resizable) return void A(e);const d = ve(e);s.resizer = M("div"), s.resizer.className = n.resizerClassName, setCssProps(s.resizer, { position: "absolute", display: "block", zIndex: "-1", visibility: "hidden", width: "2px", background: "#000", opacity: "0.7" }), e.el.appendChild(s.resizer);const u = a.element,h = s.resizer.parentNode,c = getComputedStyle(h),m = getComputedStyle(u),f = getElementOffset(u),p = getElementOffset(h);p.left += parseFloat(c.borderLeftWidth) || 0, p.top += parseFloat(c.borderTopWidth) || 0, f.left -= p.left, f.top -= p.top, f.top -= parseFloat(m.borderTopWidth) || 0;const g = getElementWidth(s.resizer, true, true, true);d ? (f.left -= Math.ceil((parseFloat(m.borderLeftWidth) || 0) / 2), f.left -= Math.ceil(g / 2)) : (f.left += getElementWidth(u, true, true, true), f.left += Math.ceil((parseFloat(m.borderRightWidth) || 0) / 2), f.left -= Math.ceil(g / 2)), setCssProps(s.resizer, { "z-index": "10", visibility: "visible", left: f.left + "px", top: f.top + "px", height: getElementHeight(e.el, false, false, false) + "px" }), s.resizer.columnName = u.columnName;try {s.resizer.style.zIndex = "";} catch (_unused3) {}}(e, n);}function F(e, t) {const l = e._o,i = ve(e);let n = t.target.closest("div.".concat(l.tableClassName, "-header-cell,div.").concat(l.cellPreviewClassName));if (!n) return null;n[v] && (n = n[v]);let s = n.previousSibling;for (; s && 1 !== s.nodeType;) s = s.previousSibling;const a = !s,d = T(t),u = (d.pageX || d.clientX || 0) - getElementOffset(n).left;if (i) {var _s$columnName, _s, _n$columnName;if (!a && getElementWidth(n, true, true, true) - u <= l.resizeAreaWidth / 2) return (_s$columnName = (_s = s) === null || _s === void 0 ? void 0 : _s.columnName) !== null && _s$columnName !== void 0 ? _s$columnName : null;if (u <= l.resizeAreaWidth / 2) return (_n$columnName = n.columnName) !== null && _n$columnName !== void 0 ? _n$columnName : null;} else {var _s$columnName2, _s2, _n$columnName2;if (!a && u <= l.resizeAreaWidth / 2) return (_s$columnName2 = (_s2 = s) === null || _s2 === void 0 ? void 0 : _s2.columnName) !== null && _s$columnName2 !== void 0 ? _s$columnName2 : null;if (getElementWidth(n, true, true, true) - u <= l.resizeAreaWidth / 2) return (_n$columnName2 = n.columnName) !== null && _n$columnName2 !== void 0 ? _n$columnName2 : null;}return null;}function A(e) {const t = e._p;return null != t.columnResizeStartTimeout && (clearTimeout(t.columnResizeStartTimeout), t.columnResizeStartTimeout = null), t.resizer && (t.resizer.remove(), t.resizer = null), t.eventsSink.remove(document, ".colresize"), e;}function P(e, t) {const l = t;if ("mousedown" === t.type && 0 !== l.button) return;const i = e._o,o = e._p,r = F(e, t);if (r) {const l = o.columns.get(r);return !!(i.resizableColumns && l && l.resizable) && (function (e, t, l) {const i = e._p,o = e._o,r = T(t),n = Date.now(),s = function (e) {return e.type.startsWith("touch") ? "touch" : "mouse";}(t),a = i.lastResizeAreaClick;if (i.lastResizeAreaClick = { columnName: l, time: n, pageX: r.pageX || r.clientX || 0, pageY: r.pageY || 0, pointerType: s }, !a || a.columnName !== l || a.pointerType !== s) return false;const d = n - a.time;return !(d < 0 || d > o.resizeAreaDoubleClickDuration) && Math.sqrt(Math.pow(i.lastResizeAreaClick.pageX - a.pageX, 2) + Math.pow(i.lastResizeAreaClick.pageY - a.pageY, 2)) <= Math.max(o.resizeAreaWidth, 12);}(e, t, l.name) ? (A(e), function (e, t, l, _o$lastResizeAreaDoub) {const i = e._o,o = e._p,r = o.columns.get(l);if (!i.resizableColumns || !r || !r.resizable) return false;const n = Date.now();return ((_o$lastResizeAreaDoub = o.lastResizeAreaDoubleClick) === null || _o$lastResizeAreaDoub === void 0 ? void 0 : _o$lastResizeAreaDoub.columnName) === r.name && n - o.lastResizeAreaDoubleClick.time < 100 ? (t.preventDefault(), true) : (o.lastResizeAreaClick = null, o.lastResizeAreaDoubleClick = { columnName: r.name, time: n }, e.emit("columnresizeareadoubleclick", { name: r.name, columnName: r.name, event: t }), i.autoFitColumnOnResizeDoubleClick && e.autoFitColumn(r.name), t.preventDefault(), true);}(e, t, l.name)) : (A(e), o.columnResizeStartTimeout = setTimeout(() => L(e), i.resizeAreaDoubleClickDuration), o.eventsSink.add(document, "mousemove.colresize", (t) => H(e, t)).add(document, "touchmove.colresize", (t) => H(e, t)).add(document, "mouseup.colresize", (t) => E(e, t)).add(document, "touchend.colresize", (t) => E(e, t)), t.preventDefault(), true));}}function H(e, t) {const l = e._p;if (null != l.columnResizeStartTimeout && !function (e, t) {const l = e._p.lastResizeAreaClick;if (!l) return false;const i = T(t),o = i.pageX || i.clientX || 0,r = i.pageY || 0;return Math.sqrt(Math.pow(o - l.pageX, 2) + Math.pow(r - l.pageY, 2)) > 4;}(e, t)) return;if (L(e), !l.resizer) return;const i = l.columns.get(l.resizer.columnName);if (!i) return;const n = ve(e),s = i.element,a = l.resizer.parentNode,d = getComputedStyle(a),u = getComputedStyle(s),h = getElementOffset(s),c = getElementOffset(a);c.left += parseFloat(d.borderLeftWidth) || 0, h.left -= c.left;const m = getElementWidth(l.resizer, true, true, true),f = "border-box" === u.boxSizing;let p = T(t).pageX - c.left,g = h.left;g -= Math.ceil(m / 2), n ? (g += getElementWidth(s, true, true, true), g -= i.ignoreMin ? 0 : e._o.minColumnWidth, f || (g -= Math.ceil((parseFloat(u.borderLeftWidth) || 0) / 2), g -= ce(s)), p > g && (p = g)) : (g += i.ignoreMin ? 0 : e._o.minColumnWidth, f || (g += Math.ceil((parseFloat(u.borderRightWidth) || 0) / 2), g += ce(s)), p < g && (p = g)), l.resizer.style.left = p + "px";}function E(e, t) {var _ref2, _t$C, _v$changedTouches;const l = e._o,i = e._p;if (null != i.columnResizeStartTimeout) return void A(e);if (!i.resizer) return;i.eventsSink.remove(document, ".colresize");const n = i.columns.get(i.resizer.columnName);if (!n) return i.resizer.remove(), void (i.resizer = null);const s = ve(e),a = n.element,d = a.firstChild,u = i.resizer.parentNode,h = getComputedStyle(u),c = getComputedStyle(a),m = getElementOffset(a),f = getElementOffset(u);f.left += parseFloat(h.borderLeftWidth) || 0, m.left -= f.left;const p = getElementWidth(i.resizer, true, true, true),g = "border-box" === c.boxSizing,v = t;let b = ((_ref2 = (_t$C = t[C]) !== null && _t$C !== void 0 ? _t$C : (_v$changedTouches = v.changedTouches) === null || _v$changedTouches === void 0 ? void 0 : _v$changedTouches[0]) !== null && _ref2 !== void 0 ? _ref2 : t).pageX - f.left,w = m.left,W = 0;if (s) {if (!g) {b += ce(a);const e = getComputedStyle(d || a);b += parseFloat(e.borderLeftWidth) || 0, b += parseFloat(e.borderRightWidth) || 0;}b += n.arrowProposedWidth || 0, w += Math.ceil(p / 2), w += getElementWidth(a, true, true, true);const t = w - (n.ignoreMin ? 0 : e._o.minColumnWidth);b > t && (b = t), W = w - b;} else {if (!g) {b -= ce(a);const e = getComputedStyle(d || a);b -= parseFloat(e.borderLeftWidth) || 0, b -= parseFloat(e.borderRightWidth) || 0;}b -= n.arrowProposedWidth || 0, w -= Math.ceil(p / 2);const t = w + (n.ignoreMin ? 0 : e._o.minColumnWidth);b < t && (b = t), W = b - w;}i.resizer.remove(), i.resizer = null;let y = W;if (2 === n.widthMode) {let t = pe(e),o = 0,r = 0;for (let e = 0; e < i.visibleColumns.length; e++) {var _l$actualWidth;const l = i.visibleColumns[e];l.name !== n.name && (2 === l.widthMode ? (o += l.width, r++) : t -= (_l$actualWidth = l.actualWidth) !== null && _l$actualWidth !== void 0 ? _l$actualWidth : 0);}if (t <= 0 && i.table && (t = i.table.clientWidth), t > Math.max(l.minColumnWidth, 1)) {if (y = W / t, r > 0) {const e = y / ((1 - y) / o);o += y, (o < 1 && l.relativeWidthGrowsToFillWidth || o > 1 && l.relativeWidthShrinksToFillWidth) && (y = e);}y *= 100, y += "%";}}e.setColumnWidth(n.name, y);}function O(e, t) {var _i$columns$get;const l = e._o,i = e._p;if (!l.resizableColumns) return;const o = F(e, t),r = t.target.closest("div.".concat(l.tableClassName, "-header-cell,div.").concat(l.cellPreviewClassName));r && (o && (_i$columns$get = i.columns.get(o)) !== null && _i$columns$get !== void 0 && _i$columns$get.resizable ? r.style.cursor = "e-resize" : r.style.cursor = "");}function I(e, t) {var _ref3, _t$C2, _n$changedTouches;const i = e._o,n = t,s = t,a = (_ref3 = (_t$C2 = t[C]) !== null && _t$C2 !== void 0 ? _t$C2 : (_n$changedTouches = n.changedTouches) === null || _n$changedTouches === void 0 ? void 0 : _n$changedTouches[0]) !== null && _ref3 !== void 0 ? _ref3 : { pageX: s.pageX, pageY: s.pageY },d = t.target.closest("div.".concat(i.tableClassName, "-header-cell,div.").concat(i.cellPreviewClassName));if (!d) return;const u = getElementOffset(d);u.width = getElementWidth(d, true, true, true), u.height = getElementHeight(d, true, true, true), e.emit("headercontextmenu", { columnName: d.columnName, pageX: a.pageX, pageY: a.pageY, bounds: u });}function D(e, t) {if (he(t)) return;if (F(e, t)) return;const l = e._o,i = e._p,o = t.target.closest("div.".concat(l.tableClassName, "-header-cell,div.").concat(l.cellPreviewClassName));if (!o) return;if (!l.sortableColumns) return;const r = i.columns.get(o.columnName),n = i.rows.sortColumn;if (r && r.sortable) {let t = true;const i = n.length ? n[n.length - 1] : null;i && i.column === r.name && (i.descending && l.allowCancelSort ? (t = false, n.splice(n.length - 1, 1)) : i.descending = !i.descending);const o = e;t ? o.sort(r.name, void 0, true).render() : o.setSortedColumns(n.map((e) => ({ column: e.column, descending: e.descending })));}}function B(e, t) {const l = e._p,i = l.visibleColumns.findIndex((e) => e.movable),o = l.visibleColumns.findLastIndex((e) => e.movable),r = l.visibleColumns.findIndex((e) => e === t);return t.movable || -1 !== i && r >= i && r <= o;}const $ = Array.prototype.indexOf,q = document.createElement.bind(document);function X(e, t) {const l = t[p];l && (t.removeEventListener("click", l), t[p] = null, function (e, t) {const l = e._p;for (let e = 0, i = t.childNodes, o = i.length; e < o; e++) l._unbindCellHoverIn(i[e]);}(e, t), e.emit("rowdestroy", t));}function V(e) {const t = e._p.tbody;if (t) for (let l = t.firstElementChild; l; l = l.nextElementSibling) X(e, l);}function j(e) {const t = e._p,i = e._o;if (!t.table || !t.header) return e;if (!i.height) return t.table.style.height = "auto", e;const o = getComputedStyle(t.table);let r = i.height - getElementHeight(t.header, true, true, true);return "border-box" !== o.boxSizing && (r -= parseFloat(o.borderTopWidth) || 0, r -= parseFloat(o.borderBottomWidth) || 0, r -= parseFloat(o.paddingTop) || 0, r -= parseFloat(o.paddingBottom) || 0), t.table.style.height = Math.max(r, 0) + "px", e;}function Y(e) {const t = e._p;return t.headerRow && (t.headerRow = void 0), e;}function U(e) {const t = e._o,l = e._p;if (!l.tbody) return e;if (t.virtualTable && l.virtualListHelper) {const e = l.virtualListHelper.estimateFullHeight();l._lastVirtualScrollHeight = e, l.tbody.style.height = e + "px";} else l.tbody.style.height = "";return e;}function G(e, t) {const l = e._p;if (!l.table) return e;const i = l.table.offsetWidth - l.table.clientWidth;if (i !== l.scrollbarWidth || t) {var _l$notifyRendererOfCo;l.scrollbarWidth = i;for (let e = 0; e < l.columns.length; e++) l.columns[e].actualWidthConsideringScrollbarWidth = null;if (l.visibleColumns.length > 0 && l.tbody && l.headerRow) {var _t$actualWidth, _ref4, _t$actualWidthConside;const e = l.visibleColumns.length - 1,t = l.visibleColumns[e];t.actualWidthConsideringScrollbarWidth = l.scrollbarWidth > 0 ? ((_t$actualWidth = t.actualWidth) !== null && _t$actualWidth !== void 0 ? _t$actualWidth : 0) - l.scrollbarWidth : null;const i = ((_ref4 = (_t$actualWidthConside = t.actualWidthConsideringScrollbarWidth) !== null && _t$actualWidthConside !== void 0 ? _t$actualWidthConside : t.actualWidth) !== null && _ref4 !== void 0 ? _ref4 : 0) + "px",o = l.tbody.childNodes;for (let t = 0, l = o.length; t < l; t++) {const l = o[t];1 === l.nodeType && (l.childNodes[e].style.width = i);}l.headerRow.childNodes[e].style.width = i;}K(e), (_l$notifyRendererOfCo = l.notifyRendererOfColumnsConfig) === null || _l$notifyRendererOfCo === void 0 ? void 0 : _l$notifyRendererOfCo.call(l);}return e;}function J(e, t) {const l = e._o,i = e._p;if (!i.tbody || !i.table || !i.headerRow) return e;const o = ge(e);if (i.tbody.style.minWidth = o + "px", i.headerRow.style.minWidth = o + (i.scrollbarWidth || 0) + "px", i.eventsSink.remove(i.table, "scroll"), l.width === _.AUTO) setElementWidth(i.table, getElementWidth(i.tbody, true, true, true)), setElementWidth(e.el, getElementWidth(i.table, true, true, true));else if (l.width === _.SCROLL) {if (t) {const t = i.table ? i.table.scrollTop : 0,l = i.table ? i.table.scrollLeft : 0;!function (e) {const t = e.style.display;e.style.display = "none", e.offsetHeight, e.style.display = t;}(e.el), i.table.scrollTop = t, i.table.scrollLeft = l, i.header && (i.header.scrollLeft = l);}const l = () => function (e) {const t = e._p;t.header.scrollLeft = t.table.scrollLeft, Q(e);}(e);i.eventsSink.add(i.table, "scroll", l);}return e;}function K(e) {var _t$scrollbarWidth;const t = e._p,l = e._o;if (!t.headerRow) return;const i = l.tableClassName + "-sticky",o = t.headerRow,r = ve(e);t.lastIsRtl = r;const n = (_t$scrollbarWidth = t.scrollbarWidth) !== null && _t$scrollbarWidth !== void 0 ? _t$scrollbarWidth : 0,s = t.lastDetectedWidth,a = l.maxStickyColumnRelativeWidth,d = "number" == typeof a && s ? s * a : null;let u = 0,h = 0,c = null;const m = [],f = [];let p = null,g = [],v = null,C = 0,b = [];for (let e = o.firstElementChild; e; e = e.nextElementSibling) {var _o$actualWidth, _p;const l = e.getAttribute("data-column");if (!l) continue;const o = t.columns.get(l);if (!o) continue;o.headerScrollbarCompensation = 0;let s = "start" === o.sticky || "end" === o.sticky;if (s && null !== d && C + ((_o$actualWidth = o.actualWidth) !== null && _o$actualWidth !== void 0 ? _o$actualWidth : 0) > d && (s = false), s) {var _o$actualWidth2, _o$actualWidth3, _o$stickyPos, _o$stickyPos2, _o$stickyPos3;let l = (_o$actualWidth2 = o.actualWidth) !== null && _o$actualWidth2 !== void 0 ? _o$actualWidth2 : 0;C += 0, e.className += " " + i, e.style.position = "sticky";let s,a = null;null === c && (a = getComputedStyle(e), c = a.boxSizing), "content-box" === c && (null === a && (a = getComputedStyle(e)), l += (parseFloat(a.paddingLeft) || 0) + (parseFloat(a.paddingRight) || 0) + (parseFloat(a.borderLeftWidth) || 0) + (parseFloat(a.borderRightWidth) || 0)), "start" === o.sticky ? (s = { direction: "start", absDirection: r ? "right" : "left", offset: u }, e.style[s.absDirection] = u + "px", u += l, g.length = 0, p = [e], m.push(p)) : (v = e, s = { direction: "end", absDirection: r ? "left" : "right", offset: h }, e.style[s.absDirection] = h + n + "px", e.style.width = ((_o$actualWidth3 = o.actualWidth) !== null && _o$actualWidth3 !== void 0 ? _o$actualWidth3 : 0) + "px", h += l, f.push([e, ...g]), g.length = 0), s.direction === ((_o$stickyPos = o.stickyPos) === null || _o$stickyPos === void 0 ? void 0 : _o$stickyPos.direction) && s.offset === ((_o$stickyPos2 = o.stickyPos) === null || _o$stickyPos2 === void 0 ? void 0 : _o$stickyPos2.offset) && s.absDirection === ((_o$stickyPos3 = o.stickyPos) === null || _o$stickyPos3 === void 0 ? void 0 : _o$stickyPos3.absDirection) || b.push(t.visibleColumns.indexOf(o)), o.stickyPos = s;} else o.stickyPos && b.push(t.visibleColumns.indexOf(o)), delete o.stickyPos, (_p = p) !== null && _p !== void 0 && _p.push(e), g !== null && g !== void 0 && g.push(e), "sticky" === e.style.position && (e.classList.remove(i), e.style.position = "", e.style.left = "", e.style.right = "");}v && (v.style[r ? "left" : "right"] = "0px"), t.stickiesStart = m, t.stickiesEnd = f, b.length > 0 && e.refreshAllVirtualRows(), t.lastStickyScrollLeft = void 0, Q(e);}function Q(e) {const t = e._p;if (!t.table || !t.headerRow || !t.tbody) return;const l = t.stickiesStart,i = t.stickiesEnd,o = t.stickiesSetStart,r = t.stickiesSetEnd,n = t.stickiesSetStart = new Set(),s = t.stickiesSetEnd = new Set();if (l !== null && l !== void 0 && l.length || i !== null && i !== void 0 && i.length) {const e = t.table.scrollLeft;if (e === t.lastStickyScrollLeft) return;t.lastStickyScrollLeft = e;const o = t.headerRow.children,r = 1.5,a = t.lastIsRtl;let d = null;const u = (e, l, i) => {if (e && e.length) {for (const t of e) {l || (d = t);const e = t[0],n = t.slice(1),s = n[0],u = n[n.length - 1];if (!e || !e.getBoundingClientRect) continue;const h = e.getBoundingClientRect(),c = l !== a;let m = false;if (s && u) {const e = s.getBoundingClientRect(),t = u.getBoundingClientRect();m = l ? a ? h.right - r > t.left && h.left + r < e.right : h.right - r > e.left && h.left + r < t.right : a ? h.left + r < e.right && h.right - r > t.left : h.left + r < t.right && h.right - r > e.left;}e.classList.toggle(c ? "is-sticky-left" : "is-sticky-right", m), m && i.add($.call(o, e));}if (d) {var _ref5, _l$actualWidthConside, _ref6, _l$actualWidthConside2;const e = d[0],l = t.columns.get(e.getAttribute("data-column")),i = a ? "marginRight" : "marginLeft";e.style[i] = "", e.style.width = ((_ref5 = (_l$actualWidthConside = l.actualWidthConsideringScrollbarWidth) !== null && _l$actualWidthConside !== void 0 ? _l$actualWidthConside : l.actualWidth) !== null && _ref5 !== void 0 ? _ref5 : 0) + "px";let o = 0;if (t.scrollbarWidth > 0) {const l = e.getBoundingClientRect(),r = e.offsetParent.getBoundingClientRect(),n = a ? l.left - r.left : r.right - l.right;n <= t.scrollbarWidth && (o = Math.min(t.scrollbarWidth, Math.max(0, t.scrollbarWidth - n + 1)), o < t.scrollbarWidth && (e.style[i] = -o + "px"));}l.headerScrollbarCompensation = o, e.style.width = ((_ref6 = (_l$actualWidthConside2 = l.actualWidthConsideringScrollbarWidth) !== null && _l$actualWidthConside2 !== void 0 ? _l$actualWidthConside2 : l.actualWidth) !== null && _ref6 !== void 0 ? _ref6 : 0) + o + "px";}}};u(l, true, n), u(i, false, s);}const a = [],d = [];for (const e of n) (o === null || o === void 0 ? void 0 : o.has(e)) || a.push({ index: e, start: true });for (const e of s) (r === null || r === void 0 ? void 0 : r.has(e)) || a.push({ index: e, start: false });if (o) for (const e of o) n.has(e) || d.push({ index: e, start: true });if (r) for (const e of r) s.has(e) || d.push({ index: e, start: false });if (!a.length && !d.length) return;let u = t.tbody.firstElementChild;for (; u;) {const e = u.children;for (const l of d) {var _e$l$index;(_e$l$index = e[l.index]) === null || _e$l$index === void 0 || _e$l$index.classList.remove(l.start !== t.lastIsRtl ? "is-sticky-left" : "is-sticky-right");}for (const l of a) {var _e$l$index2;(_e$l$index2 = e[l.index]) === null || _e$l$index2 === void 0 || _e$l$index2.classList.add(l.start !== t.lastIsRtl ? "is-sticky-left" : "is-sticky-right");}u = u.nextElementSibling;}t.isStickyColumns = new Map();for (const e of n) t.isStickyColumns.set(e, "start");for (const e of s) t.isStickyColumns.set(e, "end");}function Z(e, t) {const l = e._p,i = e._o;if (!l.headerRow || !l.tbody) return e;const o = l.headerRow.querySelectorAll("div.".concat(i.tableClassName, "-header-cell"))[t];if (!o) return e;const r = l.columns.get(o.columnName);if (r) {var _r$headerScrollbarCom, _ref7, _r$actualWidthConside;const e = (_r$headerScrollbarCom = r.headerScrollbarCompensation) !== null && _r$headerScrollbarCom !== void 0 ? _r$headerScrollbarCom : 0;o.style.width = ((_ref7 = (_r$actualWidthConside = r.actualWidthConsideringScrollbarWidth) !== null && _r$actualWidthConside !== void 0 ? _r$actualWidthConside : r.actualWidth) !== null && _ref7 !== void 0 ? _ref7 : 0) + e + "px";const i = (r.actualWidthConsideringScrollbarWidth || r.actualWidth || 0) + "px",n = l.tbody.childNodes;for (let e = 0, l = n.length; e < l; e++) {const l = n[e];1 === l.nodeType && (l.childNodes[t].style.width = i);}}return e;}function ee(e) {const t = e._p,l = e._o;if (t.table && t.headerRow) {const e = l.tableClassName,i = scopedSelectorAll(t.headerRow, ">div.".concat(e, "-header-cell.sorted")),o = Array.prototype.slice.call(i, 0).map((e) => e.querySelector(":scope>div>.sort-arrow")).filter((e) => !!e);for (const e of o) {var _e$parentNode;const l = (_e$parentNode = e.parentNode) === null || _e$parentNode === void 0 ? void 0 : _e$parentNode.parentNode;if (l) {const e = t.columns.get(l.columnName);e && (e.arrowProposedWidth = 0);}e.remove();}for (const e of i) e.classList.remove("sorted", "desc");}return e;}function te(e, t, l) {var _r$element$firstChild;const i = e._p,o = e._o,r = i.columns.get(t);if (!r) return false;const n = q("span");return n.className = "sort-arrow", r.element && (r.element.className += l ? " sorted desc" : " sorted", (_r$element$firstChild = r.element.firstChild) !== null && _r$element$firstChild !== void 0 && _r$element$firstChild.insertBefore(n, r.element.firstChild.firstChild)), 2 !== r.widthMode && o.adjustColumnWidthForSortArrow && (r.arrowProposedWidth = n.scrollWidth + (parseFloat(getComputedStyle(n).marginRight) || 0) + (parseFloat(getComputedStyle(n).marginLeft) || 0)), true;}function le(e, t) {t.firstChild, t.addEventListener("mousedown", (t) => P(e, t)), t.addEventListener("mousemove", (t) => O(e, t)), t.addEventListener("mouseup", (t) => function (e, t) {2 === t.button && I(e, t);}(e, t)), t.addEventListener("mouseleave", (t) => function (e, t) {const l = e._o,i = t.target.closest("div.".concat(l.tableClassName, "-header-cell,div.").concat(l.cellPreviewClassName));i && (i.style.cursor = "");}(e, t)), t.addEventListener("touchstart", (t) => function (e, t) {const l = e._p;if (l.currentTouchId) return;const i = t.changedTouches[0];l.currentTouchId = i.identifier;const o = t.currentTarget,r = { x: i.pageX, y: i.pageY };let n = r;const s = function () {l.currentTouchId = null, l.eventsSink.remove(o, ".colheader"), clearTimeout(l.tapAndHoldTimeout), l.tapAndHoldTimeout = null;};t[C] = t.changedTouches[0], true !== P(e, t) ? (l.tapAndHoldTimeout = setTimeout(() => {s(), l.eventsSink.add(o, "touchend.colheader", (e) => {he(e) || e.preventDefault(), l.eventsSink.remove(o, ".colheader");}, { once: true }).add(o, "touchcancel.colheader", (e) => {l.eventsSink.remove(o, ".colheader");}, { once: true }), Math.sqrt(Math.pow(Math.abs(n.x - r.x), 2) + Math.pow(Math.abs(n.y - r.y), 2)) < 9 && (A(e), I(e, t));}, 500), l.eventsSink.add(o, "touchend.colheader", (t) => {const i = t,o = u(Array.from(i.changedTouches), (e) => e.identifier === l.currentTouchId);o && (s(), he(t) || t.preventDefault(), n = { x: o.pageX, y: o.pageY }, (Math.sqrt(Math.pow(Math.abs(n.x - r.x), 2) + Math.pow(Math.abs(n.y - r.y), 2)) < 9 || l.resizer) && (i[C] = o, D(e, i)));}).add(o, "touchcancel.colheader", s).add(o, "touchmove.colheader", (t) => {const i = t,o = u(Array.from(i.changedTouches), (e) => e.identifier === l.currentTouchId);o && (n = { x: o.pageX, y: o.pageY }, l.resizer && (t.preventDefault(), i[C] = o, O(e, i)));})) : l.currentTouchId = null;}(e, t)), t.addEventListener("dragstart", (t) => function (e, t) {const l = e._o,i = e._p;if (l.movableColumns) {var _t$dataTransfer;const e = t.target.closest("div.".concat(l.tableClassName, "-header-cell,div.").concat(l.cellPreviewClassName));if (!e) return void t.preventDefault();const o = i.columns.get(e.columnName);o && o.movable ? (e.style.opacity = "0.35", i.dragId = 161061273 * Math.random(), (_t$dataTransfer = t.dataTransfer) === null || _t$dataTransfer === void 0 ? void 0 : _t$dataTransfer.setData("text", JSON.stringify({ dragId: i.dragId, column: o.name }))) : t.preventDefault();} else t.preventDefault();}(e, t)), t.addEventListener("click", (t) => D(e, t)), t.addEventListener("contextmenu", (e) => e.preventDefault()), t.addEventListener("dragenter", (t) => function (e, t) {const l = e._o,i = e._p;if (l.movableColumns) {var _t$dataTransfer2;let o = null;const r = (_t$dataTransfer2 = t.dataTransfer) === null || _t$dataTransfer2 === void 0 ? void 0 : _t$dataTransfer2.getData("text");if (r) try {o = JSON.parse(r);} catch (_unused4) {o = null;}const n = t.target.closest("div.".concat(l.tableClassName, "-header-cell,div.").concat(l.cellPreviewClassName));if (!n) return;if (!o || i.dragId === o.dragId && n.columnName !== o.column) {const t = i.columns.get(n.columnName);t && B(e, t) && n.classList.add("drag-over");}}}(e, t)), t.addEventListener("dragover", (e) => {e.preventDefault();}), t.addEventListener("dragleave", (t) => function (e, t) {const l = e._o,i = t.target.closest("div.".concat(l.tableClassName, "-header-cell,div.").concat(l.cellPreviewClassName));if (!i) return;const o = t.relatedTarget;o === i || i.contains(o) || i.classList.remove("drag-over");}(e, t)), t.addEventListener("drop", (t) => function (e, t, _t$dataTransfer3) {t.preventDefault();const l = e._o,i = e._p,o = (_t$dataTransfer3 = t.dataTransfer) === null || _t$dataTransfer3 === void 0 ? void 0 : _t$dataTransfer3.getData("text");if (!o) return;let r;try {r = JSON.parse(o);} catch (_unused5) {return;}const n = t.target.closest("div.".concat(l.tableClassName, "-header-cell,div.").concat(l.cellPreviewClassName));if (n) {if (l.movableColumns && r.dragId === i.dragId) {const t = r.column,l = n.columnName,o = i.columns.get(t),s = i.columns.get(l);o && s && o.movable && B(e, s) && e.moveColumn(t, l);}n.classList.remove("drag-over");}}(e, t));}function ie(e, t) {let l = 0;if ("string" == typeof e) {const t = e.trim().toLowerCase();if ("rest" === t) return { width: 0, mode: 3 };if ("auto" === t) return { width: 0, mode: 0 };}let i = parseFloat(e);return Number.isFinite(i) || (i = 0), i = Math.max(0, i), i > 0 && ("string" == typeof e && e.trim().endsWith("%") ? (l = 2, i /= 100) : i > 0 && i < 1 ? l = 2 : (i < t && (i = t), l = 1)), { width: i, mode: l };}function oe(e, t) {var _t$allowPreview;let l = ie(t.width, t.ignoreMin ? 0 : e.minColumnWidth),i = { name: t.name, label: void 0 === t.label ? t.name : t.label, width: l.width, widthMode: l.mode, resizable: void 0 === t.resizable || t.resizable, sortable: void 0 === t.sortable || t.sortable, movable: void 0 === t.movable || t.movable, visible: void 0 === t.visible || t.visible, cellClasses: void 0 === t.cellClasses ? e.cellClasses : t.cellClasses, ignoreMin: void 0 !== t.ignoreMin && !!t.ignoreMin, sticky: void 0 === t.sticky ? null : t.sticky || null, allowPreview: !!((_t$allowPreview = t.allowPreview) !== null && _t$allowPreview !== void 0 ? _t$allowPreview : true), dataPath: [], comparePath: [], order: 0 };const o = void 0 === t.dataPath ? i.name : t.dataPath,r = void 0 === t.comparePath ? o : t.comparePath;return i.dataPath = "string" == typeof o ? o.split(".") : o, i.comparePath = "string" == typeof r ? r.split(".") : r, i;}function re(e) {const t = e._p;0 === t.visibleColumns.length && t.columns.length && (t.columns[0].visible = true, t.visibleColumns.push(t.columns[0]), e.emit("showcolumn", t.columns[0].name));}function ne(e) {const t = e._p;if (t.filteredRows && t.filterArgs) {let l = e._o.filter || R;t.filteredRows = t.rows.filteredCollection(l, t.filterArgs);}}function se(e) {const t = e._p;if (!t.filteredRows) return;const l = new Set(t.filteredRows),i = new W({ sortColumn: t.rows.sortColumn, onComparatorRequired: t.rows.onComparatorRequired, customSortingProvider: t.rows.customSortingProvider });for (let e = 0, o = t.rows.length; e < o; e++) {const o = t.rows[e];l.has(o) && (o[b] = e, i.push(o));}t.filteredRows = i;}function ae(e, t, l) {let i = l.dataPath,o = t[i[0]];for (let e = 1; e < i.length && null != o; e++) o = o && o[i[e]];const r = e.cellFormatter;let n;if (r[c]) n = r(o, l.name, t);else try {n = r(o, l.name, t);} catch (e) {n = "[ERROR]", console.error("Failed to generate content for cell " + l.name, e);}return null == n && (n = ""), n;}const de = document.createElement.bind(document);function ue(e) {["relative", "absolute", "fixed"].includes(getComputedStyle(e).position) || (e.style.position = "relative");}function he(e) {const t = e.target;return /^(?:INPUT|TEXTAREA|BUTTON|SELECT)$/.test(t.tagName);}function ce(e) {const t = getComputedStyle(e);return (parseFloat(t.paddingLeft) || 0) + (parseFloat(t.paddingRight) || 0);}function me(e) {const t = e.style;t["-webkit-touch-callout"] = "none", t["-webkit-user-select"] = "none", t["-moz-user-select"] = "none", t["-ms-user-select"] = "none", t["-o-user-select"] = "none", t["user-select"] = "none";}function fe(e, t) {let l = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;const o = e._o,n = o.tableClassName,s = de("div");s.className = e.el.className, setCssProps(s, { position: "absolute", top: "-9999px", left: "0", visibility: "hidden", width: "auto", overflow: "visible" });const a = de("div");a.className = "".concat(n, "-header");const d = de("div");d.className = "".concat(n, "-header-row");const u = de("div");u.className = "".concat(n, "-header-cell ").concat(t.cellClasses || ""), u.style.width = "auto";const h = u.cloneNode(true),c = u.cloneNode(true);u.appendChild(de("div")).innerHTML = o.headerCellFormatter(t.label, t.name), d.appendChild(h), d.appendChild(u), d.appendChild(c), a.appendChild(d), s.appendChild(a), document.body.appendChild(s);let m = getElementWidth(u, true, true, true) + o.columnAutoWidthExtraSize;if (l) {const e = de("div");e.className = "".concat(n, "-body");const i = de("div");i.className = "".concat(n, "-row");const a = de("div");a.className = "".concat(n, "-cell ").concat(t.cellClasses || ""), a.style.width = "auto";const d = a.appendChild(de("div"));i.appendChild(a), e.appendChild(i), s.appendChild(e);for (let e = 0; e < l.length; e++) d.innerHTML = ae(o, l[e], t), m = Math.max(m, getElementWidth(a, true, true, true));}return s.remove(), m += t.arrowProposedWidth || 0, !t.ignoreMin && m < o.minColumnWidth && (m = o.minColumnWidth), Math.ceil(m);}function pe(e) {const t = e._o,l = e._p;let o,n = 0,s = 0;l.table && (n = l.table ? l.table.scrollTop : 0, s = l.table ? l.table.scrollLeft : 0, t.virtualTable && (o = l.table.style.display, l.table.style.display = "none"));let a = getElementWidth(e.el);l.table && (t.virtualTable && void 0 !== o && (l.table.style.display = o), l.table.scrollTop = n, l.table.scrollLeft = s, l.header && (l.header.scrollLeft = s));const d = t.tableClassName,u = de("div");u.className = e.el.className, setCssProps(u, { "z-index": "-1", position: "absolute", left: "0", top: "-9999px" });const h = de("div");h.className = "".concat(d, "-header"), u.appendChild(h);const c = de("div");c.index = null, c.vIndex = null, c.className = "".concat(d, "-header-row"), h.appendChild(c);for (let e = 0; e < l.visibleColumns.length; e++) {const t = l.visibleColumns[e],i = de("div");i.className = "".concat(d, "-header-cell ").concat(t.cellClasses || ""), i.columnName = t.name, i.appendChild(de("div")), c.appendChild(i);}document.body.appendChild(u), a -= function (e) {const t = getComputedStyle(e);return (parseFloat(t.borderLeftWidth) || 0) + (parseFloat(t.borderRightWidth) || 0);}(c);const m = c.querySelectorAll("div.".concat(d, "-header-cell"));for (const e of m) {const t = getComputedStyle(e);if ("border-box" !== t.boxSizing) {a -= (parseFloat(t.borderRightWidth) || 0) + (parseFloat(t.borderLeftWidth) || 0) + ce(e);const i = e.columnName,o = l.columns.get(i);o && (a -= o.arrowProposedWidth || 0);}}return u.remove(), Math.max(0, a);}function ge(e) {const t = e._p,l = e._o.tableClassName,o = l + "-row",n = l + "-cell",s = t.visibleColumns,a = s.length,d = de("div");d.className = o, d.style.float = "left";let u = 0;for (let e = 0; e < a; e++) {var _t$actualWidth2, _t$actualWidth3;const t = s[e],l = de("div");l.className = n, l.style.width = ((_t$actualWidth2 = t.actualWidth) !== null && _t$actualWidth2 !== void 0 ? _t$actualWidth2 : 0) + "px", t.cellClasses && (l.className += " " + t.cellClasses), l.appendChild(de("div")), d.appendChild(l), u += (_t$actualWidth3 = t.actualWidth) !== null && _t$actualWidth3 !== void 0 ? _t$actualWidth3 : 0;}const h = de("div");h.className = e.el.className, setCssProps(h, { "z-index": "-1", position: "absolute", left: "0", top: "-9999px", float: "left", width: "1px", overflow: "hidden" });const c = de("div");c.className = l, h.appendChild(c);const m = de("div");m.className = l + "-body", m.style.width = u + 1e4 + "px", c.appendChild(m), m.appendChild(d), document.body.appendChild(h);const f = de("div");setCssProps(f, { border: "1.5px solid #000", width: "0", height: "0", position: "absolute", left: "0", top: "-9999px" }), document.body.appendChild(f);const p = parseFloat(getComputedStyle(f).borderWidth),g = Math.round(p) !== p;f.remove();let v = getElementWidth(d, true, true, true);return v -= t.scrollbarWidth || 0, g && v++, h.remove(), v;}function ve(e) {const t = e._p;return !!t.table && "rtl" === getComputedStyle(t.table).direction;}function Ce(e) {var _e$unconvertedWidthMo;const t = null != e.unconvertedWidth ? e.unconvertedWidth : e.width,l = null != e.unconvertedWidth ? (_e$unconvertedWidthMo = e.unconvertedWidthMode) !== null && _e$unconvertedWidthMo !== void 0 ? _e$unconvertedWidthMo : e.widthMode : e.widthMode;return 0 === l ? "auto" : 2 === l ? parseFloat((100 * t).toPrecision(12)) + "%" : 3 === l ? "rest" : t;}const be = Object.prototype.hasOwnProperty,we = Symbol("once_original_handler");document.createElement.bind(document);class We {constructor(e) {var _e$rowsBufferSize, _e$minColumnWidth, _e$resizeAreaWidth, _e$resizeAreaDoubleCl, _e$maxColumnsSortCoun, _e$sortedColumns;_defineProperty(this, "VERSION", void 0);_defineProperty(this, "el", void 0);_defineProperty(this, "_o", void 0);_defineProperty(this, "_p", void 0);_defineProperty(this, w, void 0);e = e || {}, this.VERSION = We.VERSION;const t = this._o = {},n = this._p = { eventsSink: new DomEventsSink(), mitt: { all: s = s || new Map(), on: function (e, t) {var l = s.get(e);l ? l.push(t) : s.set(e, [t]);}, off: function (e, t) {var l = s.get(e);l && (t ? l.splice(l.indexOf(t) >>> 0, 1) : s.set(e, []));}, emit: function (e, t) {var l = s.get(e);l && l.slice().map(function (e) {e(t);}), (l = s.get("*")) && l.slice().map(function (l) {l(e, t);});} }, tableSkeletonNeedsRendering: true };var s;if (this.el = e.el && e.el instanceof HTMLElement ? e.el : document.createElement("div"), this.el !== e.el) {const t = (e.className || "dgtable-wrapper").split(/\s+/).filter(Boolean);this.el.classList.add(...t);}n.eventsSink.add(this.el, "dragend.colresize", (e) => {return t = e, void (this._p.resizer || (t.target.style.opacity = ""));var t;}), n.isWheelScrolling = false, n.eventsSink.add(this.el, "wheel", (e) => {if (n.cellPreviewCell) {let t = false,l = e.target;for (; l && l !== n.cellPreviewCell;) {const e = getComputedStyle(l),i = e.overflowY,o = e.overflowX,r = ("auto" === i || "scroll" === i) && l.scrollHeight > l.clientHeight,n = ("auto" === o || "scroll" === o) && l.scrollWidth > l.clientWidth;if (r || n) {t = true;break;}l = l.parentElement;}if (t) return;}n.isWheelScrolling = true, z(this), n.wheelScrollTimeout && clearTimeout(n.wheelScrollTimeout), n.wheelScrollTimeout = setTimeout(() => {n.isWheelScrolling = false, n.wheelScrollTimeout = void 0;}, 100);}, { passive: true }), t.virtualTable = void 0 === e.virtualTable || !!e.virtualTable, t.estimatedRowHeight = e.estimatedRowHeight || void 0, t.rowsBufferSize = Math.max((_e$rowsBufferSize = e.rowsBufferSize) !== null && _e$rowsBufferSize !== void 0 ? _e$rowsBufferSize : 3, 0), t.minColumnWidth = Math.max((_e$minColumnWidth = e.minColumnWidth) !== null && _e$minColumnWidth !== void 0 ? _e$minColumnWidth : 35, 0), t.maxStickyColumnRelativeWidth = e.maxStickyColumnRelativeWidth || null, t.columnAutoWidthExtraSize = e.columnAutoWidthExtraSize || 0, t.resizeAreaWidth = Math.max((_e$resizeAreaWidth = e.resizeAreaWidth) !== null && _e$resizeAreaWidth !== void 0 ? _e$resizeAreaWidth : 8, 0), t.resizeAreaDoubleClickDuration = Math.max((_e$resizeAreaDoubleCl = e.resizeAreaDoubleClickDuration) !== null && _e$resizeAreaDoubleCl !== void 0 ? _e$resizeAreaDoubleCl : 300, 0), t.autoFitColumnOnResizeDoubleClick = void 0 !== e.autoFitColumnOnResizeDoubleClick && !!e.autoFitColumnOnResizeDoubleClick, t.resizableColumns = void 0 === e.resizableColumns || !!e.resizableColumns, t.movableColumns = void 0 === e.movableColumns || !!e.movableColumns;const d = (_e$maxColumnsSortCoun = e.maxColumnsSortCount) !== null && _e$maxColumnsSortCoun !== void 0 ? _e$maxColumnsSortCoun : e.sortableColumns,u = Number(d !== null && d !== void 0 ? d : 1);t.sortableColumns = Number.isFinite(u) ? Math.max(u, 0) : 1, t.adjustColumnWidthForSortArrow = void 0 === e.adjustColumnWidthForSortArrow || !!e.adjustColumnWidthForSortArrow, t.convertColumnWidthsToRelative = void 0 !== e.convertColumnWidthsToRelative && !!e.convertColumnWidthsToRelative, t.autoFillTableWidth = void 0 !== e.autoFillTableWidth && !!e.autoFillTableWidth, t.autoFillLastColumn = void 0 === e.autoFillLastColumn || !!e.autoFillLastColumn, t.allowCancelSort = void 0 === e.allowCancelSort || !!e.allowCancelSort, t.cellClasses = void 0 === e.cellClasses ? "" : e.cellClasses, t.resizerClassName = void 0 === e.resizerClassName ? "dgtable-resize" : e.resizerClassName, t.tableClassName = void 0 === e.tableClassName ? "dgtable" : e.tableClassName, t.allowCellPreview = void 0 === e.allowCellPreview || e.allowCellPreview, t.allowHeaderCellPreview = void 0 === e.allowHeaderCellPreview || e.allowHeaderCellPreview, t.cellPreviewClassName = void 0 === e.cellPreviewClassName ? "dgtable-cell-preview" : e.cellPreviewClassName, t.cellPreviewAutoBackground = void 0 === e.cellPreviewAutoBackground || e.cellPreviewAutoBackground, t.onComparatorRequired = void 0 === e.onComparatorRequired ? null : e.onComparatorRequired, t.customSortingProvider = void 0 === e.customSortingProvider ? null : e.customSortingProvider, t.width = void 0 === e.width ? _.NONE : e.width, t.relativeWidthGrowsToFillWidth = void 0 === e.relativeWidthGrowsToFillWidth || !!e.relativeWidthGrowsToFillWidth, t.relativeWidthShrinksToFillWidth = void 0 !== e.relativeWidthShrinksToFillWidth && !!e.relativeWidthShrinksToFillWidth, this.setCellFormatter(e.cellFormatter), this.setHeaderCellFormatter(e.headerCellFormatter), this.setFilter(e.filter), t.height = e.height, this.setColumns(e.columns || [], false);let h = [];const c = (_e$sortedColumns = e.sortedColumns) !== null && _e$sortedColumns !== void 0 ? _e$sortedColumns : e.sortColumn;if (c) {let e = Array.isArray(c) ? c : [c];for (let t = 0, l = e.length; t < l; t++) {var _l$descending;let l = e[t];"string" == typeof l && (l = { column: l, descending: false });let i = n.columns.get(l.column);i && h.push({ column: l.column, comparePath: i.comparePath || i.dataPath, descending: (_l$descending = l.descending) !== null && _l$descending !== void 0 ? _l$descending : false });}}n.rows = new W({ sortColumn: h }), n.rows.onComparatorRequired = (e, l, i) => {if (t.onComparatorRequired) return t.onComparatorRequired(e, l, i);}, n.rows.customSortingProvider = (e, l) => t.customSortingProvider ? t.customSortingProvider(e, l) : l(e), n.filteredRows = null, n.scrollbarWidth = 0, n._lastVirtualScrollHeight = 0, function (e) {const t = e._p,n = (t) => {let n = t.currentTarget,s = t.relatedTarget;s === n || n.contains(s) || n[g] && (s === n[g] || n[g].contains(s)) || function (e, t, _s$visibleColumns$N$c, _P$right) {const n = e._o,s = e._p;if (s.isWheelScrolling) return;const a = t.firstElementChild;if (!a) return;if (!(a.scrollWidth - a.clientWidth > 1 || a.scrollHeight - a.clientHeight > 1)) return;z(e), s.abortCellPreview = false;const d = t.parentElement;if (!d) return;const u = (_s$visibleColumns$N$c = s.visibleColumns[N.call(d.childNodes, t)]) === null || _s$visibleColumns$N$c === void 0 ? void 0 : _s$visibleColumns$N$c.name,h = u ? s.columns.get(u) : null;if (!h) return;const c = d.index;if (e.emit("cellhoveroverflow", { name: u, rowIndex: c !== null && c !== void 0 ? c : null, rowData: null == c ? null : s.rows[c], cell: t, cellEl: a }), false === h.allowPreview) return;const m = t.classList.contains("".concat(n.tableClassName, "-header-cell"));if (m ? !n.allowHeaderCellPreview : !n.allowCellPreview) return;const f = k("div");f.innerHTML = t.innerHTML, f.className = n.cellPreviewClassName + " " + (h.cellClasses || ""), m && (f.classList.add("header"), t.classList.contains("sortable") && f.classList.add("sortable"), f.draggable = true, le(e, f));const p = getComputedStyle(t),C = getComputedStyle(a),b = "right" === p.float,w = b ? "right" : "left",W = parseFloat(p.paddingLeft) || 0,y = parseFloat(p.paddingRight) || 0,S = parseFloat(p.paddingTop) || 0,R = parseFloat(p.paddingBottom) || 0;let _ = a.scrollWidth + (t.clientWidth - a.offsetWidth);const M = "border-box" === p.boxSizing;if (M ? f.style.boxSizing = "border-box" : (_ -= W + y, f.style.marginTop = (parseFloat(p.borderTopWidth) || 0) + "px"), !s.transparentBgColor1) {const e = document.createElement("div");document.body.appendChild(e), e.style.backgroundColor = "transparent", s.transparentBgColor1 = getComputedStyle(e).backgroundColor, e.style.backgroundColor = "rgba(0,0,0,0)", s.transparentBgColor2 = getComputedStyle(e).backgroundColor, e.remove();}const T = { "box-sizing": M ? "border-box" : "content-box", width: _ + "px", "min-height": Math.max(getElementHeight(t), /%/.test(p.minHeight) ? 0 : parseFloat(p.minHeight) || 0) + "px", "padding-left": W + "px", "padding-right": y + "px", "padding-top": S + "px", "padding-bottom": R + "px", overflow: "hidden", position: "absolute", "z-index": "-1", [w]: "0", top: "0", cursor: p.cursor };if (n.cellPreviewAutoBackground) {let e = p.backgroundColor;e !== s.transparentBgColor1 && e !== s.transparentBgColor2 || (e = getComputedStyle(d).backgroundColor), e !== s.transparentBgColor1 && e !== s.transparentBgColor2 || (e = "#fff"), T["background-color"] = e;}setCssProps(f, T), f.firstChild && setCssProps(f.firstChild, { direction: C.direction, "white-space": C.whiteSpace, "min-height": C.minHeight, "line-height": C.lineHeight, font: C.font }), e.el.appendChild(f), m && me(f), f.rowVIndex = d.vIndex, f.rowIndex = c, f.columnName = u;try {const e = x.saveSelection(t);e && x.restoreSelection(f, e);} catch (_unused6) {}if (e.emit("cellpreview", { el: f.firstElementChild, name: f.columnName, rowIndex: c !== null && c !== void 0 ? c : null, rowData: null == c ? null : s.rows[c], cell: t, cellEl: a }), s.abortCellPreview) return void f.remove();null != c && f.addEventListener("click", (t) => {e.emit("rowclick", { event: t, filteredRowIndex: d.vIndex, rowIndex: c, rowEl: d, rowData: s.rows[c] });});const L = e.el,F = L === window ? document : L,A = getComputedStyle(L),P = getElementOffset(t),H = getElementOffset(L);if (b) {const e = window.innerWidth;P.right = e - (P.left + getElementWidth(t, true, true, true)), H.right = e - (H.left + getElementWidth(L, true, true, true));}P.left -= parseFloat(A.borderLeftWidth) || 0, "right" === w && void 0 !== P.right && void 0 !== H.right && (P.right -= parseFloat(A.borderRightWidth) || 0), P.top -= parseFloat(A.borderTopWidth) || 0, "left" === w ? P.left += parseFloat(p.borderLeftWidth) || 0 : void 0 !== P.right && (P.right += parseFloat(p.borderRightWidth) || 0), P.top += parseFloat(p.borderTopWidth) || parseFloat(p.borderBottomWidth) || 0, P.left -= H.left, "right" === w && void 0 !== P.right && void 0 !== H.right && (P.right -= H.right), P.top -= H.top;const E = getElementWidth(L, false, false, false) - getElementWidth(f, true, true, true),O = "left" === w ? P.left : (_P$right = P.right) !== null && _P$right !== void 0 ? _P$right : 0,I = Math.max(0, Math.min(E, O));"left" === w ? P.left = I : P.right = I;const D = getElementHeight(t, true, true, true),B = ("scrollTop" in F ? F.scrollTop : 0) + getElementHeight(L, true) - D;P.top > B && (P.top = Math.max(0, B));const $ = { top: P.top + "px", "z-index": 9999 };$[w] = ("left" === w ? P.left : P.right) + "px", setCssProps(f, $), f[v] = t, s.cellPreviewCell = f, t[g] = f, s._bindCellHoverOut(t), s._bindCellHoverOut(f);}(e, n);},s = (t) => {let l = t.currentTarget[v] || t.currentTarget,i = t.relatedTarget;i === e.el || l.contains(i) || l[g] && (i === l[g] || l[g].contains(i)) || function (e) {z(e);}(e);};t._bindCellHoverIn = (e) => {e[m] || e.addEventListener("mouseover", e[m] = n);}, t._unbindCellHoverIn = (e) => {e[m] && (e.removeEventListener("mouseover", e[m]), e[m] = null);}, t._bindCellHoverOut = (e) => {e[f] || e.addEventListener("mouseout", e[f] = s);}, t._unbindCellHoverOut = (e) => {e[f] && (e.removeEventListener("mouseout", e[f]), e[f] = null);};}(this);}on(e, t) {return this[w] || this._p.mitt.on(e, t), this;}once(e, t) {if (this[w]) return this;const l = (i) => {this._p.mitt.off(e, l), t(i);};return l[we] = t, this._p.mitt.on(e, l), this;}off(e, t) {if (this[w]) return this;if (e || t) {if (this._p.mitt.off(e, t), t) {var _this$_p$mitt$all$get;const l = (_this$_p$mitt$all$get = this._p.mitt.all.get(e)) !== null && _this$_p$mitt$all$get !== void 0 ? _this$_p$mitt$all$get : [];for (const i of l.slice()) i[we] === t && this._p.mitt.off(e, i);}} else this._p.mitt.all.clear();return this;}emit(e, t) {return this[w] || this._p.mitt.emit(e, t), this;}destroy() {var _e$virtualListHelper, _e$table, _e$tbody;const e = this._p,t = this.el;if (this[w] || !e) return this;if (A(this), V(this), (_e$virtualListHelper = e.virtualListHelper) !== null && _e$virtualListHelper !== void 0 && _e$virtualListHelper.destroy(), e.virtualListHelper = null, Y(this), (_e$table = e.table) !== null && _e$table !== void 0 && _e$table.remove(), (_e$tbody = e.tbody) !== null && _e$tbody !== void 0 && _e$tbody.remove(), e.workerListeners) {for (let t = 0; t < e.workerListeners.length; t++) {let l = e.workerListeners[t];l.worker.removeEventListener("message", l.listener, false);}e.workerListeners.length = 0;}e.rows.length = e.columns.length = 0, e._deferredRender && clearTimeout(e._deferredRender), e.wheelScrollTimeout && clearTimeout(e.wheelScrollTimeout), e.tapAndHoldTimeout && clearTimeout(e.tapAndHoldTimeout), e.eventsSink.remove();for (let e in this) be.call(this, e) && (this[e] = null);return this[w] = true, t && t.remove(), this;}close() {this.destroy();}remove() {this.destroy();}render() {const o = this._o,r = this._p;if (!this.el.offsetParent) return r._deferredRender || (r._deferredRender = setTimeout(() => {r._deferredRender = null, !this[w] && this.el.offsetParent && this.render();})), this;if (true === r.tableSkeletonNeedsRendering) {var _r$filteredRows;r.tableSkeletonNeedsRendering = false, o.width === _.AUTO && ee(this);let n = r.table && r.table.parentNode ? r.table.scrollTop : NaN,s = r.table && r.table.parentNode ? getScrollHorz(r.table) : NaN;!function (e, _t$virtualListHelper) {const t = e._p,i = e._o;V(e), (_t$virtualListHelper = t.virtualListHelper) !== null && _t$virtualListHelper !== void 0 && _t$virtualListHelper.destroy(), t.virtualListHelper = null, t.table && i.virtualTable && (t.table.remove(), t.table = void 0, t.tbody = void 0), Y(e), t.currentTouchId = null, t.header && t.header.remove();const o = i.tableClassName,r = q("div"),n = q("div");r.className = "".concat(o, "-header"), n.className = "".concat(o, "-header-row"), t.header = r, t.headerRow = n, r.appendChild(n), e.el.prepend(r), ue(e.el), i.width === _.SCROLL ? e.el.style.overflow = "hidden" : e.el.style.overflow = "", !i.height && i.virtualTable && (i.height = getElementHeight(e.el, true));}(this), function (e) {const t = e._p,o = e._o,r = o.tableClassName;if (o.virtualTable && !t.virtualRowHeight) {const o = () => {const e = q("div"),t = e.appendChild(q("div")),l = t.appendChild(q("div"));return e.className = "".concat(r, "-row"), t.className = "".concat(r, "-cell"), l.innerHTML = "0", e.style.visibility = "hidden", e.style.position = "absolute", e;},n = q("div");n.className = e.el.className, setCssProps(n, { "z-index": "-1", position: "absolute", left: "0", top: "-9999px", width: "1px", overflow: "hidden" });const s = q("div");s.className = r, n.appendChild(s);const a = q("div");a.className = "".concat(r, "-body"), a.style.width = "99999px", s.appendChild(a), document.body.appendChild(n);const d = o(),u = o(),h = o();a.appendChild(d), a.appendChild(u), a.appendChild(h), t.virtualRowHeight = getElementHeight(u, true, true, true), n.remove();}if (!t.table) {var _o$height;const n = document.createDocumentFragment(),s = q("div");s.className = r, o.virtualTable && (s.className += " virtual");const a = getComputedStyle(s);let d = ((_o$height = o.height) !== null && _o$height !== void 0 ? _o$height : 0) - getElementHeight(t.header, true, true, true);"border-box" !== a.boxSizing && (d -= parseFloat(a.borderTopWidth) || 0, d -= parseFloat(a.borderBottomWidth) || 0, d -= parseFloat(a.paddingTop) || 0, d -= parseFloat(a.paddingBottom) || 0), setCssProps(s, { height: o.height ? d + "px" : "auto", display: "block", overflowY: "auto", overflowX: o.width === _.SCROLL ? "auto" : "hidden" }), n.appendChild(s);const u = q("div");u.className = o.tableClassName + "-body", u.style.minHeight = "1px", t.table = s, t.tbody = u, ue(u), ue(s), s.appendChild(u), e.el.appendChild(n);}t.virtualListHelper || function (e, _t$filteredRows) {const t = e._p,l = e._o,i = l.tableClassName,o = i + "-row",r = i + "-row-alt",n = i + "-cell",s = i + "-sticky";let a = t.visibleColumns,u = a.length;t.notifyRendererOfColumnsConfig = () => {a = t.visibleColumns, u = a.length;for (let e = 0; e < u; e++) {const t = a[e];t._finalWidth = t.actualWidthConsideringScrollbarWidth || t.actualWidth;}}, t.virtualListHelper = new VirtualListHelper({ list: t.table, itemsParent: t.tbody, autoVirtualWrapperWidth: false, virtual: l.virtualTable, buffer: l.rowsBufferSize, estimatedItemHeight: l.estimatedRowHeight ? l.estimatedRowHeight : t.virtualRowHeight || 40, itemElementCreatorFn: () => q("div"), onItemRender: (i, d) => {const h = i,c = t.filteredRows || t.rows,m = !!t.filteredRows,f = t.isStickyColumns;h.className = o, d % 2 == 1 && (h.className += " " + r);const g = c[d],v = m ? g[b] : d;h.vIndex = d, h.index = v;for (let e = 0; e < u; e++) {var _i$_finalWidth;const i = a[e],o = q("div");if (o.columnName = i.name, o.setAttribute("data-column", i.name), o.className = n, o.style.width = ((_i$_finalWidth = i._finalWidth) !== null && _i$_finalWidth !== void 0 ? _i$_finalWidth : 0) + "px", i.cellClasses && (o.className += " " + i.cellClasses), i.stickyPos) {o.className += " " + s, o.style.position = "sticky", o.style[i.stickyPos.absDirection] = i.stickyPos.offset + "px";const l = f === null || f === void 0 ? void 0 : f.get(e);"start" === l && !t.lastIsRtl || "end" === l && t.lastIsRtl ? o.classList.add("is-sticky-left") : ("start" === l && t.lastIsRtl || "end" === l && !t.lastIsRtl) && o.classList.add("is-sticky-right");}t._bindCellHoverIn(o), o.appendChild(q("div")).innerHTML = ae(l, g, i), h.appendChild(o);}h.addEventListener("click", h[p] = (t) => {e.emit("rowclick", { event: t, filteredRowIndex: d, rowIndex: v, rowEl: h, rowData: g });}), e.emit("rowcreate", { filteredRowIndex: d, rowIndex: v, rowEl: h, rowData: g });}, onItemUnrender: (t) => X(e, t), onScrollHeightChange: (l) => {l > t._lastVirtualScrollHeight && !t.scrollbarWidth && G(e), t._lastVirtualScrollHeight = l;} }), t.virtualListHelper.setCount(((_t$filteredRows = t.filteredRows) !== null && _t$filteredRows !== void 0 ? _t$filteredRows : t.rows).length), t.notifyRendererOfColumnsConfig();}(e);}(this), this.tableWidthChanged(true, false), function (e) {const t = e._p,l = e._o,i = l.tableClassName + "-header-cell",o = t.headerRow;for (let r = 0; r < t.visibleColumns.length; r++) {const n = t.visibleColumns[r];if (n.visible) {var _n$actualWidth;const s = q("div");s.draggable = true, s.className = i, s.style.width = ((_n$actualWidth = n.actualWidth) !== null && _n$actualWidth !== void 0 ? _n$actualWidth : 0) + "px", l.sortableColumns && n.sortable && (s.className += " sortable"), s.columnName = n.name, s.setAttribute("data-column", n.name);const a = q("div");a.innerHTML = l.headerCellFormatter(n.label, n.name), s.appendChild(a), t._bindCellHoverIn(s), o.appendChild(s), t.visibleColumns[r].element = s, le(e, s), me(s);}}K(e), e.emit("headerrowcreate", o);}(this), r.virtualListHelper.setCount(((_r$filteredRows = r.filteredRows) !== null && _r$filteredRows !== void 0 ? _r$filteredRows : r.rows).length), U(this), G(this, true), J(this, true), j(this), G(this);for (let e = 0; e < r.rows.sortColumn.length; e++) te(this, r.rows.sortColumn[e].column, r.rows.sortColumn[e].descending);o.adjustColumnWidthForSortArrow && r.rows.sortColumn.length ? this.tableWidthChanged(true) : o.virtualTable || this.tableWidthChanged(), isNaN(n) || (r.table.scrollTop = n), isNaN(s) || (setScrollHorz(r.table, s), setScrollHorz(r.header, s)), K(this), this.emit("renderskeleton");}r.virtualListHelper.render();const n = r.scrollbarWidth;return G(this), r.scrollbarWidth !== n && J(this, false), this.emit("render"), this;}clearAndRender(e) {var _t$notifyRendererOfCo;let t = this._p;return t.tableSkeletonNeedsRendering = true, (_t$notifyRendererOfCo = t.notifyRendererOfColumnsConfig) !== null && _t$notifyRendererOfCo !== void 0 && _t$notifyRendererOfCo.call(t), (void 0 === e || e) && this.render(), this;}setColumns(e, t) {const l = this._p;e = e || [];let i = new S();for (let t = 0, l = 0; t < e.length; t++) {let o = e[t],r = oe(this._o, o);void 0 !== o.order ? (o.order > l && (l = o.order + 1), r.order = o.order) : r.order = l++, i.push(r);}return i.normalizeOrder(), l.columns = i, l.visibleColumns = i.getVisibleColumns(), re(this), this.clearAndRender(t), this;}addColumn(e, t, l) {const i = this._p;let o = i.columns;if (e && !o.get(e.name)) {let r = null;void 0 !== t && (r = "string" == typeof t ? o.get(t) : o.getByOrder(t));let n = oe(this._o, e);n.order = r ? r.order : o.getMaxOrder() + 1;for (let e = o.getMaxOrder(), t = n.order; e >= t; e--) {let t = o.getByOrder(e);t && t.order++;}o.push(n), o.normalizeOrder(), i.visibleColumns = o.getVisibleColumns(), re(this), this.clearAndRender(l), this.emit("addcolumn", n.name);}return this;}removeColumn(e, t) {const l = this._p;let i = l.columns,o = i.indexOf(e);return o > -1 && (i.splice(o, 1), i.normalizeOrder(), l.visibleColumns = i.getVisibleColumns(), re(this), this.clearAndRender(t), this.emit("removecolumn", e)), this;}setColumnLabel(e, t) {let l = this._p.columns.get(e);if (l && (l.label = void 0 === t ? l.name : t, l.element)) {const e = l.element.firstChild,t = e.querySelector(":scope > .sort-arrow");e.innerHTML = this._o.headerCellFormatter(l.label, l.name), t && e.insertBefore(t, e.firstChild);}return this;}moveColumn(e, t) {let l = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;const i = this._o,o = this._p;let r,n,a = o.columns,d = l ? o.visibleColumns : a.getColumns();if ("string" == typeof e ? r = a.get(e) : "number" == typeof e && (r = d[e]), "string" == typeof t ? n = a.get(t) : "number" == typeof t && (n = d[t]), r && n && e !== t) {let e = r.order,t = n.order,l = a.moveColumn(r, n).getVisibleColumns();if (o.visibleColumns.length !== l.length || o.visibleColumns.some((e, t) => e !== l[t])) {const e = o.visibleColumns.indexOf(r),t = o.visibleColumns.indexOf(n);if (o.visibleColumns = l, re(this), !i.virtualTable && -1 !== e && -1 !== t && o.headerRow && o.tbody) {var _ref8, _ref9;const l = scopedSelectorAll(o.headerRow, ">div.".concat(i.tableClassName, "-header-cell")),r = e < t ? t + 1 : t;l[0].parentNode.insertBefore(l[e], l[r]);const n = o.visibleColumns[t],a = ((_ref8 = n.actualWidthConsideringScrollbarWidth || n.actualWidth) !== null && _ref8 !== void 0 ? _ref8 : 0) + "px",d = o.visibleColumns[e],u = ((_ref9 = d.actualWidthConsideringScrollbarWidth || d.actualWidth) !== null && _ref9 !== void 0 ? _ref9 : 0) + "px",h = o.tbody.childNodes;for (let l = 0, i = h.length; l < i; l++) {const i = h[l];1 === i.nodeType && (i.insertBefore(i.childNodes[e], i.childNodes[r]), i.childNodes[t].firstChild.style.width = a, i.childNodes[e].firstChild.style.width = u);}this.tableWidthChanged(true);} else this.clearAndRender();}this.emit("movecolumn", { name: r.name, src: e, dest: t });}return this;}setColumnVisible(e, t) {const l = this._p;let i = l.columns.get(e);return t = !!t, i && !!i.visible !== t && (i.visible = t, l.visibleColumns = l.columns.getVisibleColumns(), this.emit(t ? "showcolumn" : "hidecolumn", e), re(this), this.clearAndRender()), this;}isColumnVisible(e) {let t = this._p.columns.get(e);return !!t && t.visible;}setMinColumnWidth(e) {let t = this._o;return e = Math.max(e, 0), t.minColumnWidth !== e && (t.minColumnWidth = e, this.tableWidthChanged(true)), this;}getMinColumnWidth() {return this._o.minColumnWidth;}setColumnAutoWidthExtraSize(e) {let t = this._o;return e = Math.max(e, 0), t.columnAutoWidthExtraSize !== e && (t.columnAutoWidthExtraSize = e, this.tableWidthChanged(true)), this;}getColumnAutoWidthExtraSize() {return this._o.columnAutoWidthExtraSize;}setResizeAreaWidth(e) {let t = this._o;return e = Math.max(e, 0), t.resizeAreaWidth !== e && (t.resizeAreaWidth = e, this.tableWidthChanged(true)), this;}getResizeAreaWidth() {return this._o.resizeAreaWidth;}setResizeAreaDoubleClickDuration(e) {let t = this._o;return e = Math.max(e, 0), t.resizeAreaDoubleClickDuration !== e && (t.resizeAreaDoubleClickDuration = e, this.tableWidthChanged(true)), this;}getResizeAreaDoubleClickDuration() {return this._o.resizeAreaDoubleClickDuration;}setMaxStickyColumnRelativeWidth(e) {let t = this._o;return e = e || null, t.maxStickyColumnRelativeWidth !== e && (t.maxStickyColumnRelativeWidth = e, this.tableWidthChanged(true)), this;}getMaxStickyColumnRelativeWidth() {return this._o.maxStickyColumnRelativeWidth;}setColumnWidth(e, t) {let l = this._p.columns.get(e);if (l) {let e = ie(t, l.ignoreMin ? 0 : this._o.minColumnWidth),i = Ce(l);l.width = e.width, l.widthMode = e.mode, l.unconvertedWidth = null, l.unconvertedWidthMode = null;let o = Ce(l);i !== o && this.tableWidthChanged(true), this.emit("columnwidth", { name: l.name, width: o, oldWidth: i });}return this;}autoFitColumn(e) {const t = this._p,l = t.filteredRows || t.rows,i = t.columns.get(e);if (!i || l.length < 1) return this;const o = fe(this, i, l);return o > 0 && this.setColumnWidth(e, o), this;}getColumnWidth(e) {let t = this._p.columns.get(e);return t ? Ce(t) : null;}getColumnConfig(e) {let t = this._p.columns.get(e);if (t) {var _t$unconvertedWidthMo, _t$dataPath, _t$comparePath;const e = t.width,l = t.widthMode;null != t.unconvertedWidth && (t.width = t.unconvertedWidth, t.widthMode = (_t$unconvertedWidthMo = t.unconvertedWidthMode) !== null && _t$unconvertedWidthMo !== void 0 ? _t$unconvertedWidthMo : t.widthMode);const i = Ce(t);return null != t.unconvertedWidth && (t.width = e, t.widthMode = l), { name: t.name, label: t.label, width: i, dataPath: (_t$dataPath = t.dataPath) === null || _t$dataPath === void 0 ? void 0 : _t$dataPath.join("."), comparePath: (_t$comparePath = t.comparePath) === null || _t$comparePath === void 0 ? void 0 : _t$comparePath.join("."), resizable: t.resizable, movable: t.movable, sortable: t.sortable, visible: t.visible, cellClasses: t.cellClasses, ignoreMin: t.ignoreMin, sticky: t.sticky, order: t.order, allowPreview: t.allowPreview };}return null;}getColumnsConfig() {const e = this._p;let t = {};for (let l = 0; l < e.columns.length; l++) t[e.columns[l].name] = this.getColumnConfig(e.columns[l].name);return t;}setMaxColumnSortCount(e) {const t = this._p,l = this._o;if (l.sortableColumns !== e && (l.sortableColumns = e, t.table)) {const e = scopedSelectorAll(t.headerRow, ">div.".concat(l.tableClassName, "-header-cell"));for (let i = 0, o = e.length; i < o; i++) e[i].classList[l.sortableColumns > 0 && t.visibleColumns[i].sortable ? "add" : "remove"]("sortable");}return this;}getMaxColumnSortCount() {return this._o.sortableColumns;}setSortableColumns(e) {return this.setMaxColumnSortCount(e);}getSortableColumns() {return this.getMaxColumnSortCount();}setMovableColumns(e) {let t = this._o;return e = void 0 === e || !!e, t.movableColumns !== e && (t.movableColumns = e), this;}getMovableColumns() {return this._o.movableColumns;}setResizableColumns(e) {let t = this._o;return e = void 0 === e || !!e, t.resizableColumns !== e && (t.resizableColumns = e), this;}getResizableColumns() {return this._o.resizableColumns;}getConvertColumnWidthsToRelative() {return this._o.convertColumnWidthsToRelative;}setConvertColumnWidthsToRelative(e) {let t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;let l = this._o;return e = !!e, l.convertColumnWidthsToRelative !== e && (l.convertColumnWidthsToRelative = e, t && this.tableWidthChanged(true)), this;}setOnComparatorRequired(e) {let t = this._o;return t.onComparatorRequired !== e && (t.onComparatorRequired = e), this;}setCustomSortingProvider(e) {let t = this._o;return t.customSortingProvider !== e && (t.customSortingProvider = e), this;}sort(e, t, l) {const i = this._o,o = this._p;let r = o.columns.get(e),n = o.rows.sortColumn.map((e) => ({ column: e.column, descending: e.descending }));if (r) {if (l) {for (let e = 0; e < n.length; e++) if (n[e].column === r.name) {e < n.length - 1 ? n.length = 0 : (t = n[n.length - 1].descending, n.splice(n.length - 1, 1));break;}(i.sortableColumns > 0 && n.length >= i.sortableColumns || n.length >= o.visibleColumns.length) && (n.length = 0);} else n.length = 0;t = void 0 !== t && t, n.push({ column: r.name, descending: !!t });} else n.length = 0;return this.setSortedColumns(n);}resort() {const e = this._p;let t = e.columns,l = e.rows.sortColumn;if (l.length) {var _e$virtualListHelper2;for (let e = 0; e < l.length; e++) t.get(l[e].column) || l.splice(e--, 1);e.rows.sortColumn = l, l.length && (e.rows.sort(), se(this)), (_e$virtualListHelper2 = e.virtualListHelper) === null || _e$virtualListHelper2 === void 0 ? void 0 : _e$virtualListHelper2.invalidate();let i = [];for (let e = 0; e < l.length; e++) i.push({ column: l[e].column, descending: l[e].descending });this.emit("sort", { sorts: i, resort: true });}return this;}setSortedColumns(e) {var _i$virtualListHelper;let t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { immediate: true, render: true };const l = this._o,i = this._p;let o = i.columns,r = e.filter((e) => o.get(e.column)).map((e) => {let t = o.get(e.column);return { column: t.name, comparePath: t.comparePath || t.dataPath, descending: !!e.descending };});l.sortableColumns > 0 && r.length > l.sortableColumns && (r.length = l.sortableColumns), ee(this);for (let e = 0; e < r.length; e++) te(this, r[e].column, r[e].descending);l.adjustColumnWidthForSortArrow && !i.tableSkeletonNeedsRendering && this.tableWidthChanged(true), i.rows.sortColumn = r, r.length && t.immediate && (i.rows.sort(), se(this), (_i$virtualListHelper = i.virtualListHelper) !== null && _i$virtualListHelper !== void 0 && _i$virtualListHelper.invalidate(), i.virtualListHelper && t.render && i.virtualListHelper.render());let n = [];for (let e = 0; e < r.length; e++) n.push({ column: r[e].column, descending: r[e].descending });return this.emit("sort", { sorts: n }), this;}getSortedColumns() {const e = this._p;let t = [];for (let l = 0; l < e.rows.sortColumn.length; l++) {let i = e.rows.sortColumn[l];t.push({ column: i.column, descending: i.descending });}return t;}setCellFormatter(e) {if (!e) {const t = (e) => "string" == typeof e ? h(e) : e;t[c] = true, e = t;}return this._o.cellFormatter = e, this;}setHeaderCellFormatter(e) {return this._o.headerCellFormatter = e || function (e) {return "string" == typeof e ? h(e) : e;}, this;}setFilter(e) {return this._o.filter = e, this;}filter(e) {const t = this._p;let l = this._o.filter || R,i = !!t.filteredRows;return t.filteredRows && (t.filteredRows = null), t.filterArgs = null == e ? null : "object" != typeof e || Array.isArray(e) ? e : Object.assign({}, e), null !== t.filterArgs ? (t.filteredRows = t.rows.filteredCollection(l, t.filterArgs), (i || t.filteredRows) && (this.clearAndRender(), this.emit("filter", e))) : (t.filterArgs = null, t.filteredRows = null, this.clearAndRender(), this.emit("filterclear", {})), this;}clearFilter() {const e = this._p;return e.filteredRows && (e.filterArgs = null, e.filteredRows = null, this.clearAndRender(), this.emit("filterclear", {})), this;}getHtmlForRowCell(e, t) {const l = this._p;if (e < 0 || e > l.rows.length - 1) return null;let i = l.columns.get(t);if (!i) return null;let o = l.rows[e];return ae(this._o, o, i);}getHtmlForRowDataCell(e, t) {let l = this._p.columns.get(t);return l ? ae(this._o, e, l) : null;}getRowYPos(e) {var _t$virtualListHelper$, _t$virtualListHelper2;const t = this._p;if (e < 0 || e > t.rows.length - 1) return null;let l = e;return t.filteredRows && -1 === (l = t.filteredRows.indexOf(t.rows[e])) ? null : (_t$virtualListHelper$ = (_t$virtualListHelper2 = t.virtualListHelper) === null || _t$virtualListHelper2 === void 0 ? void 0 : _t$virtualListHelper2.getItemPosition(l)) !== null && _t$virtualListHelper$ !== void 0 ? _t$virtualListHelper$ : null;}getDataForRow(e) {const t = this._p;return e < 0 || e > t.rows.length - 1 ? null : t.rows[e];}getRowCount() {const e = this._p;return e.rows ? e.rows.length : 0;}getIndexForRow(e) {return this._p.rows.indexOf(e);}getFilteredRowCount() {const e = this._p;return (e.filteredRows || e.rows).length;}getIndexForFilteredRow(e) {const t = this._p;return (t.filteredRows || t.rows).indexOf(e);}getDataForFilteredRow(e) {const t = this._p;return e < 0 || e > (t.filteredRows || t.rows).length - 1 ? null : (t.filteredRows || t.rows)[e];}getHeaderRowElement() {return this._p.headerRow;}addRows(e, t, l, i) {let o = this._p;"boolean" == typeof t && (i = l, l = t, t = -1), "number" != typeof t && (t = -1), (t < 0 || t > o.rows.length) && (t = o.rows.length), i = void 0 === i || !!i;const r = (Array.isArray(e) ? e : [e]).length;if (e) {if (o.rows.add(e, t), o.filteredRows || l && o.rows.sortColumn.length) ne(this), l && o.rows.sortColumn.length && this.resort(), o.tableSkeletonNeedsRendering = true, i && this.render();else if (i && o.virtualListHelper) {if (o.virtualListHelper.addItemsAt(r, t), this._o.virtualTable) U(this), G(this), this.render(), J(this, false);else if (o.tbody) {for (let e = t + r, l = o.virtualListHelper.getCount(); e < l; e++) o.virtualListHelper.refreshItemAt(e);this.render(), G(this), J(this, true);}} else o.tableSkeletonNeedsRendering = true;this.emit("addrows", { count: r, clear: false });}return this;}removeRows(e, t, l) {let i = this._p;if ("number" != typeof t || t <= 0) return this;if (e < 0 || e > i.rows.length - 1) return this;if (i.rows.splice(e, t), l = void 0 === l || !!l, i.filteredRows) ne(this), i.tableSkeletonNeedsRendering = true, l && this.render();else if (l && i.virtualListHelper) {if (i.virtualListHelper.removeItemsAt(t, e), this._o.virtualTable) U(this), G(this), this.render(), J(this, false);else {for (let t = e, l = i.virtualListHelper.getCount(); t < l; t++) i.virtualListHelper.refreshItemAt(t);this.render(), G(this), J(this, true);}} else i.tableSkeletonNeedsRendering = true;return this;}removeRow(e, t) {return this.removeRows(e, 1, t);}refreshRow(e) {let t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;let l = this._p;if (e < 0 || e > l.rows.length - 1) return this;let i = -1;return l.filteredRows && -1 === (i = l.filteredRows.indexOf(l.rows[e])) ? this : (-1 === i && (i = e), l.virtualListHelper ? (l.virtualListHelper.refreshItemAt(i), t && l.virtualListHelper.render(), this) : this);}getRowElement(e) {var _t$virtualListHelper3;let t = this._p;if (e < 0 || e > t.rows.length - 1) return null;let l = -1;return t.filteredRows && -1 === (l = t.filteredRows.indexOf(t.rows[e])) ? null : (-1 === l && (l = e), ((_t$virtualListHelper3 = t.virtualListHelper) === null || _t$virtualListHelper3 === void 0 ? void 0 : _t$virtualListHelper3.getItemElementAt(l)) || null);}refreshAllVirtualRows() {var _e$virtualListHelper3;const e = this._p;return (_e$virtualListHelper3 = e.virtualListHelper) !== null && _e$virtualListHelper3 !== void 0 && _e$virtualListHelper3.invalidate().render(), this;}setRows(e, t) {let l = this._p;return l.rows.reset(e), ne(this), t && l.rows.sortColumn.length && this.resort(), this.clearAndRender().emit("addrows", { count: e.length, clear: true }), this;}tableWidthChanged(e, t) {let l = this._o,i = this._p,o = pe(this),r = o,n = 0;if (!i.table) return this;t = void 0 === t || t;let s = 0;if (i.tbody || (t = false), t && (s = parseFloat(i.tbody.style.minWidth) || 0), r !== i.lastDetectedWidth || e) {var _i$notifyRendererOfCo;i.lastDetectedWidth = o;let e = 0,a = [],d = 0,u = 0;for (let e = 0; e < i.columns.length; e++) i.columns[e].actualWidthConsideringScrollbarWidth = null;for (let t = 0; t < i.visibleColumns.length; t++) {var _o$unconvertedWidthMo;let o = i.visibleColumns[t];if (null != o.unconvertedWidth && (o.width = o.unconvertedWidth, o.widthMode = (_o$unconvertedWidthMo = o.unconvertedWidthMode) !== null && _o$unconvertedWidthMo !== void 0 ? _o$unconvertedWidthMo : o.widthMode, o.unconvertedWidth = null, o.unconvertedWidthMode = null), 1 === o.widthMode) {let i = o.width;i += o.arrowProposedWidth || 0, !o.ignoreMin && i < l.minColumnWidth && (i = l.minColumnWidth), r -= i, e += i, i !== o.actualWidth && (o.actualWidth = i, a.push(t));} else if (0 === o.widthMode) {let n = fe(this, o);o === i.visibleColumns[i.visibleColumns.length - 1] && (n += i.scrollbarWidth), r -= n, e += n, n !== o.actualWidth && (o.actualWidth = n, l.convertColumnWidthsToRelative || a.push(t));} else 2 === o.widthMode ? (d += o.width, n++) : 3 === o.widthMode && u++;}if (l.convertColumnWidthsToRelative) for (let t = 0; t < i.visibleColumns.length; t++) {let l = i.visibleColumns[t];if (0 === l.widthMode) {const t = l.width,i = l.widthMode;null == l.unconvertedWidth && (l.unconvertedWidth = t, l.unconvertedWidthMode = i), l.widthMode = 2, r += l.actualWidth, l.width = l.actualWidth / e, d += l.width, n++;}}if (n && (d < 1 && !u && l.relativeWidthGrowsToFillWidth || d > 1 && l.relativeWidthShrinksToFillWidth)) for (let e = 0; e < i.visibleColumns.length; e++) {let t = i.visibleColumns[e];2 === t.widthMode && (null == t.unconvertedWidth && (t.unconvertedWidth = t.width, t.unconvertedWidthMode = t.widthMode), t.width /= d);}let h = Math.max(0, r);0 === h && (h = i.table.clientWidth);let c = l.minColumnWidth / h;if (Number.isFinite(c) || (c = 0), c > 0) {let e,t = 0;for (let e = 0; e < i.visibleColumns.length; e++) {let l = i.visibleColumns[e];2 === l.widthMode && !l.ignoreMin && l.width < c && (t += c - l.width, l.width = c);}for (let l = 0; l < i.visibleColumns.length; l++) {let o = i.visibleColumns[l];2 === o.widthMode && !o.ignoreMin && o.width > c && t > 0 && (null == o.unconvertedWidth && (o.unconvertedWidth = o.width, o.unconvertedWidthMode = o.widthMode), e = Math.min(t, o.width - c), o.width -= e, t -= e);}}if (!u && l.autoFillTableWidth && r > 0) {let e = 0,t = r;for (let l = 0; l < i.visibleColumns.length; l++) {let o = i.visibleColumns[l];o.resizable || 1 !== o.widthMode || (e += o.width), 2 === o.widthMode && (t -= Math.round(h * o.width));}let l = (o - e) / (o - t - e) || NaN;for (let e = 0; e < i.visibleColumns.length && t > 0; e++) {let t = i.visibleColumns[e];if (t.resizable || 1 !== t.widthMode) if (2 === t.widthMode) null == t.unconvertedWidth && (t.unconvertedWidth = t.width, t.unconvertedWidthMode = t.widthMode), t.width *= l;else {let i = t.actualWidth * l;t.actualWidth !== i && (t.actualWidth = i, -1 === a.indexOf(e) && a.push(e));}}}for (let e = 0; e < i.visibleColumns.length; e++) {let t = i.visibleColumns[e];if (2 === t.widthMode) {let l = Math.round(h * t.width);r -= l, n--, 0 === n && 1 === r && (l++, r--), -1 === r && (l--, r++), l !== t.actualWidth && (t.actualWidth = l, a.push(e));}}if (u) {let e = Math.max(0, r),t = u;for (let o = 0; o < i.visibleColumns.length; o++) {let r = i.visibleColumns[o];if (3 === r.widthMode) {let i = Math.max(0, Math.floor(e / t));!r.ignoreMin && i < l.minColumnWidth && (i = l.minColumnWidth), e -= i, t--, i !== r.actualWidth && (r.actualWidth = i, a.push(o));}}}if (l.autoFillLastColumn && i.visibleColumns.length) {var _l$actualWidth2;let e = 0;for (let t = 0; t < i.visibleColumns.length; t++) {var _i$visibleColumns$t$a;e += (_i$visibleColumns$t$a = i.visibleColumns[t].actualWidth) !== null && _i$visibleColumns$t$a !== void 0 ? _i$visibleColumns$t$a : 0;}const t = i.visibleColumns.length - 1,l = i.visibleColumns[t],r = o - e;r > 0 && (l.actualWidth = ((_l$actualWidth2 = l.actualWidth) !== null && _l$actualWidth2 !== void 0 ? _l$actualWidth2 : 0) + r, -1 === a.indexOf(t) && a.push(t));}if (i.visibleColumns.length && (i.visibleColumns[i.visibleColumns.length - 1].actualWidthConsideringScrollbarWidth = i.visibleColumns[i.visibleColumns.length - 1].actualWidth - (i.scrollbarWidth || 0)), (_i$notifyRendererOfCo = i.notifyRendererOfColumnsConfig) !== null && _i$notifyRendererOfCo !== void 0 && _i$notifyRendererOfCo.call(i), t) {let e = ge(this);s < e && J(this, false);for (let e = 0; e < a.length; e++) Z(this, a[e]);s > e && J(this, false);}K(this);}return this;}tableHeightChanged() {let e = this._o;if (!this._p.table) return this;let t = getElementHeight(this.el, true);return t !== e.height && (e.height = t, j(this), e.virtualTable && this.clearAndRender()), this;}hideCellPreview() {return z(this), this;}abortCellPreview() {return this.hideCellPreview(), this;}cancelColumnResize() {return A(this), this;}getUrlForElementContent(e) {let t,l = document.getElementById(e);if (l) {let e = l.textContent;if ("function" == typeof Blob) t = new Blob([e || ""]);else {const l = window,i = l.BlobBuilder || l.WebKitBlobBuilder || l.MozBlobBuilder || l.MSBlobBuilder;if (!i) return null;const o = new i();o.append(e || ""), t = o.getBlob();}return (window.URL || window.webkitURL).createObjectURL(t);}return null;}isWorkerSupported() {return window.Worker instanceof Function;}createWebWorker(e, t, l) {if (this.isWorkerSupported()) {let i = this._p,o = new Worker(e),r = (e) => {e.data.append ? this.addRows(e.data.rows, l) : this.setRows(e.data.rows, l);};return o.addEventListener("message", r, false), i.workerListeners || (i.workerListeners = []), i.workerListeners.push({ worker: o, listener: r }), (t || void 0 === t) && o.postMessage(null), o;}return null;}unbindWebWorker(e) {let t = this._p;if (t.workerListeners) for (let l = 0; l < t.workerListeners.length; l++) t.workerListeners[l].worker === e && (e.removeEventListener("message", t.workerListeners[l].listener, false), t.workerListeners.splice(l, 1), l--);return this;}}_defineProperty(We, "VERSION", "2.0.38");_defineProperty(We, "Width", _);
7853
7712
 
7854
- class DGTableJQuery extends ge {
7713
+ class DGTableJQuery extends We {
7855
7714
  constructor(options) {
7856
7715
  super(options);
7857
7716