jquery.dgtable 2.0.36 → 2.0.39

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.es6.js CHANGED
@@ -95,7 +95,7 @@ function requireFunctionBindNative () {
95
95
 
96
96
  functionBindNative = !fails(function () {
97
97
  // eslint-disable-next-line es/no-function-prototype-bind -- safe
98
- var test = (function () { /* empty */ }).bind();
98
+ var test = function () { /* empty */ }.bind();
99
99
  // eslint-disable-next-line no-prototype-builtins -- safe
100
100
  return typeof test != 'function' || test.hasOwnProperty('prototype');
101
101
  });
@@ -574,10 +574,10 @@ function requireSharedStore () {
574
574
  var store = sharedStore.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
575
575
 
576
576
  (store.versions || (store.versions = [])).push({
577
- version: '3.48.0',
577
+ version: '3.50.0',
578
578
  mode: IS_PURE ? 'pure' : 'global',
579
579
  copyright: '© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.',
580
- license: 'https://github.com/zloirock/core-js/blob/v3.48.0/LICENSE',
580
+ license: 'https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE',
581
581
  source: 'https://github.com/zloirock/core-js'
582
582
  });
583
583
  return sharedStore.exports;
@@ -590,9 +590,11 @@ function requireShared () {
590
590
  if (hasRequiredShared) return shared;
591
591
  hasRequiredShared = 1;
592
592
  var store = requireSharedStore();
593
+ // eslint-disable-next-line es/no-object-create -- safe
594
+ var create = Object.create || Object;
593
595
 
594
596
  shared = function (key, value) {
595
- return store[key] || (store[key] = value || {});
597
+ return store[key] || (store[key] = value || create(null));
596
598
  };
597
599
  return shared;
598
600
  }
@@ -930,7 +932,7 @@ function requireFunctionName () {
930
932
 
931
933
  var EXISTS = hasOwn(FunctionPrototype, 'name');
932
934
  // additional protection from minified / mangled / dropped function names
933
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
935
+ var PROPER = EXISTS && function something() { /* empty */ }.name === 'something';
934
936
  var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
935
937
 
936
938
  functionName = {
@@ -1638,6 +1640,7 @@ function requireEs_symbol_description () {
1638
1640
  var $ = require_export();
1639
1641
  var DESCRIPTORS = requireDescriptors();
1640
1642
  var globalThis = requireGlobalThis();
1643
+ var call = requireFunctionCall();
1641
1644
  var uncurryThis = requireFunctionUncurryThis();
1642
1645
  var hasOwn = requireHasOwnProperty();
1643
1646
  var isCallable = requireIsCallable();
@@ -1667,6 +1670,14 @@ function requireEs_symbol_description () {
1667
1670
  };
1668
1671
 
1669
1672
  copyConstructorProperties(SymbolWrapper, NativeSymbol);
1673
+ // wrap Symbol.for for correct handling of empty string descriptions
1674
+ var nativeFor = SymbolWrapper['for'];
1675
+ SymbolWrapper['for'] = { 'for': function (key) {
1676
+ var stringKey = toString(key);
1677
+ var symbol = call(nativeFor, this, stringKey);
1678
+ if (stringKey === '') EmptyStringDescriptionStore[symbol] = true;
1679
+ return symbol;
1680
+ } }['for'];
1670
1681
  SymbolWrapper.prototype = SymbolPrototype;
1671
1682
  SymbolPrototype.constructor = SymbolWrapper;
1672
1683
 
@@ -1912,7 +1923,9 @@ function requireEs_array_sort () {
1912
1923
  if (y === undefined) return -1;
1913
1924
  if (x === undefined) return 1;
1914
1925
  if (comparefn !== undefined) return +comparefn(x, y) || 0;
1915
- return toString(x) > toString(y) ? 1 : -1;
1926
+ var xString = toString(x);
1927
+ var yString = toString(y);
1928
+ return xString === yString ? 0 : xString > yString ? 1 : -1;
1916
1929
  };
1917
1930
  };
1918
1931
 
@@ -2409,178 +2422,86 @@ class DomEventsSink {
2409
2422
  }
2410
2423
  }
2411
2424
 
2412
- /**
2413
- * @typedef {function(index: number):(number|undefined)} VirtualListHelper~ItemHeightEstimatorFunction
2414
- */
2415
-
2416
- /**
2417
- * @typedef {function():Element} VirtualListHelper~ItemElementCreatorFunction
2418
- */
2419
-
2420
- /**
2421
- * @typedef {function(itemEl: Element, index: number)} VirtualListHelper~ItemRenderFunction
2422
- */
2423
-
2424
- /**
2425
- * @typedef {function(itemEl: Element)} VirtualListHelper~ItemUnrenderFunction
2426
- */
2427
-
2428
- /**
2429
- * @typedef {Object} VirtualListHelper~Options
2430
- * @property {Element} list - the main element to operate inside of
2431
- * @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)
2432
- * @property {boolean} [autoVirtualWrapperWidth=true] automatically set the width of the virtual wrapper
2433
- * @property {boolean} [hookScrollEvent=true] automatically hook scroll event as needed
2434
- * @property {number} [count=0] the item count
2435
- * @property {boolean} [virtual=true] is virtual mode on?
2436
- * @property {number} [estimatedItemHeight=20] estimated item height
2437
- * @property {number} [buffer=5] the amount of buffer items to keep on each end of the list
2438
- * @property {VirtualListHelper~ItemHeightEstimatorFunction} [itemHeightEstimatorFn] an optional function for providing item height estimations
2439
- * @property {VirtualListHelper~ItemElementCreatorFunction} [itemElementCreatorFn] an optional function for providing fresh item elements (default creates `<li />`s)
2440
- * @property {VirtualListHelper~ItemRenderFunction} [onItemRender] a function for rendering element content based on item index
2441
- * @property {VirtualListHelper~ItemUnrenderFunction} [onItemUnrender] a function for freeing resources in an item element
2442
- * @property {function(height: number)} [onScrollHeightChange] a function to be notified when scroll height changes
2443
- *
2444
- */
2445
-
2446
- /** */
2447
-
2448
2425
  const hasOwnProperty = Object.prototype.hasOwnProperty;
2449
-
2450
2426
  const hasInsertAdjacentElement = Element.prototype.insertAdjacentElement !== undefined;
2451
-
2452
2427
  function insertBefore(el, before, parent) {
2453
2428
  if (!before)
2454
2429
  parent.appendChild(el);else
2455
2430
  if (hasInsertAdjacentElement === false || el instanceof DocumentFragment)
2456
2431
  parent.insertBefore(el, before);else
2432
+
2457
2433
  before.insertAdjacentElement('beforebegin', el);
2458
2434
  }
2459
- /**
2460
- *
2461
- * @param {Element} itemEl
2462
- * @param {DocumentFragment|null} fragment
2463
- * @param {Node|undefined} before
2464
- * @param {Element} itemParent
2465
- * @returns {DocumentFragment|null}
2466
- */
2467
2435
  function insertBeforeWithFragment(itemEl, fragment, before, itemParent) {
2468
2436
  if (itemEl.parentNode !== itemParent) {
2469
2437
  if (!fragment)
2470
2438
  fragment = document.createDocumentFragment();
2471
2439
  fragment.appendChild(itemEl);
2472
- } else {
2440
+ } else
2441
+ {
2473
2442
  // insert fragment
2474
2443
  if (fragment && fragment.childNodes.length > 0) {
2475
2444
  insertBefore(fragment, before, itemParent);
2476
2445
  fragment = null;
2477
2446
  }
2478
-
2479
2447
  // insert element
2480
2448
  if (itemEl.nextSibling !== before) {
2481
2449
  insertBefore(itemEl, before, itemParent);
2482
2450
  }
2483
2451
  }
2484
-
2485
2452
  return fragment;
2486
2453
  }
2487
-
2488
2454
  const DestroyedSymbol = Symbol('destroyed');
2489
-
2490
2455
  class VirtualListHelper {
2491
- /**
2492
- * @param {VirtualListHelper~Options} opts
2493
- */
2494
2456
  constructor(opts) {var _opts$autoVirtualWrap;
2495
- /** @private */
2496
2457
  const p = this._p = {
2497
2458
  // these come from options:
2498
-
2499
2459
  list: opts.list || null,
2500
2460
  hookScrollEvent: opts.hookScrollEvent === undefined ? true : !!opts.hookScrollEvent,
2501
2461
  count: opts.count || 0,
2502
2462
  virtual: opts.virtual === undefined ? true : !!opts.virtual,
2503
2463
  userItemsParent: opts.itemsParent || null,
2504
- setVirtualWrapperWidth: (_opts$autoVirtualWrap = opts.autoVirtualWrapperWidth) !== null && _opts$autoVirtualWrap !== void 0 ? _opts$autoVirtualWrap : true,
2464
+ autoVirtualWrapperWidth: (_opts$autoVirtualWrap = opts.autoVirtualWrapperWidth) !== null && _opts$autoVirtualWrap !== void 0 ? _opts$autoVirtualWrap : true,
2505
2465
  estimatedItemHeight: 20,
2506
2466
  buffer: 5,
2507
-
2508
- /** @type VirtualListHelper~ItemHeightEstimatorFunction|null */
2509
2467
  itemHeightEstimatorFn: null,
2510
-
2511
- /** @type VirtualListHelper~ItemElementCreatorFunction|null */
2512
2468
  itemElementCreatorFn: defaultElementCreator,
2513
-
2514
- /** @type VirtualListHelper~ItemRenderFunction|null */
2515
2469
  onItemRender: null,
2516
-
2517
- /** @type VirtualListHelper~ItemUnrenderFunction|null */
2518
2470
  onItemUnrender: null,
2519
-
2520
- /** @type {function(height: number)|null} */
2521
2471
  onScrollHeightChange: null,
2522
-
2523
2472
  // internal:
2524
-
2525
- /** @type Element|null */
2526
2473
  virtualWrapper: null,
2527
-
2528
- /** @type Element|null */
2529
2474
  currentItemsParent: null,
2530
-
2531
- /** @type {(number|undefined)[]} */
2532
2475
  cachedItemHeights: [],
2533
-
2534
- /** @type {(number|undefined)[]} */
2535
2476
  cachedItemEstimatedHeights: [],
2536
-
2537
- /** @type {(number|undefined)[]} */
2538
2477
  cachedItemPositions: [],
2539
-
2540
- /** @type number */
2541
2478
  itemPositionsNeedsUpdate: 0,
2542
-
2543
- /** @type function */
2544
2479
  boundRender: this.render.bind(this),
2545
-
2546
- /** @type Element[] */
2547
2480
  existingEls: []
2548
2481
  };
2549
-
2550
2482
  p.currentItemsParent = p.userItemsParent || p.list;
2551
-
2552
2483
  this._hookEvents();
2553
-
2554
2484
  if (typeof opts.count === 'number')
2555
2485
  this.setCount(opts.count);
2556
-
2557
2486
  if (typeof opts.virtual === 'boolean')
2558
2487
  this.setVirtual(opts.virtual);
2559
-
2560
2488
  if (typeof opts.estimatedItemHeight === 'number')
2561
2489
  this.setEstimatedItemHeight(opts.estimatedItemHeight);
2562
-
2563
2490
  if (typeof opts.buffer === 'number')
2564
2491
  this.setBuffer(opts.buffer);
2565
-
2566
2492
  if (typeof opts.itemHeightEstimatorFn === 'function')
2567
2493
  this.setItemHeightEstimatorFn(opts.itemHeightEstimatorFn);
2568
-
2569
2494
  if (typeof opts.itemElementCreatorFn === 'function')
2570
2495
  this.setItemElementCreatorFn(opts.itemElementCreatorFn);
2571
-
2572
2496
  if (typeof opts.onItemRender === 'function')
2573
2497
  this.setOnItemRender(opts.onItemRender);
2574
-
2575
2498
  if (typeof opts.onItemUnrender === 'function')
2576
2499
  this.setOnItemUnrender(opts.onItemUnrender);
2577
-
2578
2500
  if (typeof opts.onScrollHeightChange === 'function')
2579
2501
  this.setOnScrollHeightChange(opts.onScrollHeightChange);
2580
2502
  }
2581
-
2582
- /**
2583
- * Clean up and free up all resources.
2503
+ /**
2504
+ * Clean up and free up all resources.
2584
2505
  */
2585
2506
  destroy() {
2586
2507
  if (this[DestroyedSymbol])
@@ -2588,252 +2509,178 @@ class VirtualListHelper {
2588
2509
  this[DestroyedSymbol] = true;
2589
2510
  this._unhookEvents().invalidate()._destroyElements();
2590
2511
  }
2591
-
2592
- /**
2593
- * Sets whether 'scroll' event on the list should be hooked automatically.
2594
- * @param {boolean} enabled
2595
- * @returns {VirtualListHelper}
2512
+ /**
2513
+ * Sets whether 'scroll' event on the list should be hooked automatically.
2596
2514
  */
2597
2515
  setHookScrollEvent(enabled) {
2598
2516
  const p = this._p;
2599
2517
  enabled = enabled === undefined ? true : !!enabled;
2600
-
2601
2518
  if (p.hookScrollEvent === enabled)
2602
2519
  return this;
2603
-
2604
2520
  p.hookScrollEvent = enabled;
2605
-
2606
2521
  this._unhookEvents()._hookEvents();
2607
-
2608
2522
  return this;
2609
2523
  }
2610
-
2611
- /**
2612
- * @returns {boolean} whether 'scroll' event on the list should be hooked automatically
2613
- */
2614
2524
  isHookScrollEventEnabled() {
2615
2525
  const p = this._p;
2616
2526
  return p.hookScrollEvent;
2617
2527
  }
2618
-
2619
- /**
2620
- * Sets the list item count. <br />
2621
- * You should probably call `render()` after this.
2622
- * @param {number} count
2623
- * @returns {VirtualListHelper}
2528
+ /**
2529
+ * Sets the list item count. <br />
2530
+ * You should probably call `render()` after this.
2624
2531
  */
2625
2532
  setCount(count) {
2626
2533
  const p = this._p;
2627
2534
  p.count = count;
2628
-
2629
2535
  return this.invalidate();
2630
2536
  }
2631
-
2632
- /**
2633
- * @returns {number} current item count
2634
- */
2635
2537
  getCount() {
2636
2538
  const p = this._p;
2637
2539
  return p.count;
2638
2540
  }
2639
-
2640
- /**
2641
- * Switches between virtual and non-virtual mode. <br />
2642
- * The list is invalidated automatically. <br />
2643
- * You should call `render()` to update the view.
2644
- * @param {boolean} enabled
2645
- * @returns {VirtualListHelper}
2541
+ /**
2542
+ * Switches between virtual and non-virtual mode. <br />
2543
+ * The list is invalidated automatically. <br />
2544
+ * You should call `render()` to update the view.
2646
2545
  */
2647
2546
  setVirtual(enabled) {
2648
2547
  const p = this._p;
2649
2548
  enabled = enabled === undefined ? true : !!enabled;
2650
-
2651
2549
  if (p.virtual === enabled)
2652
2550
  return this;
2653
-
2654
2551
  p.virtual = enabled;
2655
-
2656
2552
  this._hookEvents().invalidate()._destroyElements();
2657
-
2658
2553
  return this;
2659
2554
  }
2660
-
2661
- /**
2662
- * @returns {boolean} virtual mode
2663
- */
2664
2555
  isVirtual() {
2665
2556
  const p = this._p;
2666
2557
  return p.virtual;
2667
2558
  }
2668
-
2669
- /**
2670
- * Sets estimated item height. <br />
2671
- * No need to be accurate. <br />
2672
- * The better the estimation - the better the scrollbar behavior will be. <br />
2673
- * Applicable for virtual-mode only. <br />
2674
- * You should `invalidate` if you want this to take effect on the existing rendering.
2675
- * @param {number} height - a positive number representing estimated item height.
2676
- * @returns {VirtualListHelper}
2559
+ /**
2560
+ * Sets estimated item height to a positive number. <br />
2561
+ * No need to be accurate. <br />
2562
+ * The better the estimation - the better the scrollbar behavior will be. <br />
2563
+ * Applicable for virtual-mode only. <br />
2564
+ * You should `invalidate` if you want this to take effect on the existing rendering.
2677
2565
  */
2678
2566
  setEstimatedItemHeight(height) {
2679
2567
  const p = this._p;
2680
2568
  p.estimatedItemHeight = Math.abs((typeof height === 'number' ? height : Number(height)) || 20);
2681
2569
  return this;
2682
2570
  }
2683
-
2684
- /**
2685
- * @returns {number} current item height estimation
2686
- */
2687
2571
  getEstimatedItemHeight() {
2688
2572
  const p = this._p;
2689
2573
  return p.estimatedItemHeight;
2690
2574
  }
2691
-
2692
- /**
2693
- * Sets whether the virtual wrapper width should be set automatically. <br />
2694
- * @param {boolean} enabled
2695
- * @returns {VirtualListHelper}
2575
+ /**
2576
+ * Sets whether the virtual wrapper width should be set automatically. <br />
2696
2577
  */
2697
2578
  setAutoVirtualWrapperWidth(enabled) {
2698
2579
  const p = this._p;
2699
2580
  p.autoVirtualWrapperWidth = enabled === undefined ? true : !!enabled;
2700
-
2701
2581
  if (p.virtualWrapper) {
2702
2582
  if (p.autoVirtualWrapperWidth !== p.virtualWrapperWidthWasSet) {
2703
2583
  p.virtualWrapper.style.width = p.autoVirtualWrapperWidth ? '100%' : '';
2704
2584
  p.virtualWrapperWidthWasSet = p.autoVirtualWrapperWidth;
2705
2585
  }
2706
2586
  }
2707
-
2708
2587
  return this;
2709
2588
  }
2710
-
2711
- /**
2712
- * @returns {boolean} whether the virtual wrapper width should be set automatically
2713
- */
2714
2589
  isAutoVirtualWrapperWidth() {
2715
2590
  const p = this._p;
2716
2591
  return p.autoVirtualWrapperWidth;
2717
2592
  }
2718
-
2719
- /**
2720
- * Sets the amount of buffer items to keep on each end of the list. <br />
2721
- * Applicable for virtual-mode only.
2722
- * @param {number} buffer - a positive value representing the count of buffer items for each end.
2723
- * @returns {VirtualListHelper}
2593
+ /**
2594
+ * The buffer is a positive count of items on each end.
2595
+ * Sets the amount of buffer items to keep on each end of the list. <br />
2596
+ * Applicable for virtual-mode only.
2724
2597
  */
2725
2598
  setBuffer(buffer) {
2726
2599
  const p = this._p;
2727
2600
  p.buffer = Math.abs(typeof buffer === 'number' ? buffer : Number(buffer) || 5);
2728
2601
  return this;
2729
2602
  }
2730
-
2731
- /**
2732
- * @returns {number} current buffer value
2733
- */
2734
2603
  getBuffer() {
2735
2604
  const p = this._p;
2736
2605
  return p.buffer;
2737
2606
  }
2738
-
2739
- /**
2740
- * The `itemHeightEstimatorFn` is an alternative to `estimatedItemHeight` to give better estimations for specific item. <br/>
2741
- * It's optional, and if it's present - it should return either a numeric height estimation,
2742
- * or `undefined` to fall back to the default estimation. <br />
2743
- * You should `invalidate` if you want this to take effect on the existing rendering.
2744
- * @param {VirtualListHelper~ItemHeightEstimatorFunction} fn
2745
- * @returns {VirtualListHelper}
2607
+ /**
2608
+ * The `itemHeightEstimatorFn` is an alternative to `estimatedItemHeight` to give better estimations for specific item. <br/>
2609
+ * It's optional, and if it's present - it should return either a numeric height estimation,
2610
+ * or `undefined` to fall back to the default estimation. <br />
2611
+ * You should `invalidate` if you want this to take effect on the existing rendering.
2746
2612
  */
2747
2613
  setItemHeightEstimatorFn(fn) {
2748
2614
  const p = this._p;
2749
2615
  p.itemHeightEstimatorFn = fn;
2750
2616
  return this;
2751
2617
  }
2752
-
2753
- /**
2754
- * The `itemElementCreatorFn` is a function creating a basic item element, that will be possibly reused later. <br />
2755
- * It has no association with a specific item index. <br />
2756
- * You should `invalidate` if you want this to take effect on the existing rendering.
2757
- * @param {VirtualListHelper~ItemElementCreatorFunction} fn
2758
- * @returns {VirtualListHelper}
2618
+ /**
2619
+ * The `itemElementCreatorFn` is a function creating a basic item element, that will be possibly reused later. <br />
2620
+ * It has no association with a specific item index. <br />
2621
+ * You should `invalidate` if you want this to take effect on the existing rendering.
2759
2622
  */
2760
2623
  setItemElementCreatorFn(fn) {
2761
2624
  const p = this._p;
2762
2625
  p.itemElementCreatorFn = fn || defaultElementCreator;
2763
2626
  return this;
2764
2627
  }
2765
-
2766
- /**
2767
- * The `onItemRender` is a function called for rendering the contents of an item. <br />
2768
- * It's passed an `Element` and an item index. <br />
2769
- * You should `invalidate` if you want this to take effect on the existing rendering.
2770
- * @param {VirtualListHelper~ItemRenderFunction} fn
2771
- * @returns {VirtualListHelper}
2628
+ /**
2629
+ * The `onItemRender` is a function called for rendering the contents of an item. <br />
2630
+ * It's passed an `Element` and an item index. <br />
2631
+ * You should `invalidate` if you want this to take effect on the existing rendering.
2772
2632
  */
2773
2633
  setOnItemRender(fn) {
2774
2634
  const p = this._p;
2775
2635
  p.onItemRender = fn;
2776
2636
  return this;
2777
2637
  }
2778
-
2779
- /**
2780
- * The `onItemUnrender` is a function called for freeing resources in an item element,
2781
- * if you've attached something that needs to be explicitly freed. <br />
2782
- * It's passed an `Element` only, and has no association with a specific index,
2783
- * as by the time it's called - the indexes are probably not valid anymore.
2784
- * @param {VirtualListHelper~ItemUnrenderFunction} fn
2785
- * @returns {VirtualListHelper}
2638
+ /**
2639
+ * The `onItemUnrender` is a function called for freeing resources in an item element,
2640
+ * if you've attached something that needs to be explicitly freed. <br />
2641
+ * It's passed an `Element` only, and has no association with a specific index,
2642
+ * as by the time it's called - the indexes are probably not valid anymore.
2786
2643
  */
2787
2644
  setOnItemUnrender(fn) {
2788
2645
  const p = this._p;
2789
2646
  p.onItemUnrender = fn;
2790
2647
  return this;
2791
2648
  }
2792
-
2793
- /**
2794
- * The `onScrollHeightChange` is a function called when the scroll height changes.
2795
- * @param {function(height: number)} fn
2796
- * @returns {VirtualListHelper}
2649
+ /**
2650
+ * The `onScrollHeightChange` is a function called when the scroll height changes.
2797
2651
  */
2798
2652
  setOnScrollHeightChange(fn) {
2799
2653
  const p = this._p;
2800
2654
  p.onScrollHeightChange = fn;
2801
2655
  return this;
2802
2656
  }
2803
-
2804
- /**
2805
- * Estimates the full scroll height. This gets better as more renderings occur.
2806
- * @returns {number}
2657
+ /**
2658
+ * Estimates the full scroll height. This gets better as more renderings occur.
2807
2659
  */
2808
2660
  estimateFullHeight() {
2809
2661
  const p = this._p;
2810
-
2811
2662
  if (p.count === 0)
2812
2663
  return 0;
2813
-
2814
2664
  if (p.virtual) {
2815
2665
  return this._calculateItemPosition(p.count) || 0;
2816
- } else {
2666
+ } else
2667
+ {
2817
2668
  const existingEls = p.existingEls;
2818
2669
  if (p.count === existingEls.length) {
2819
2670
  let rect1 = existingEls[0].getBoundingClientRect();
2820
2671
  let rect2 = existingEls[existingEls.length - 1].getBoundingClientRect();
2821
2672
  return rect2.top - rect1.top + rect2.height;
2822
2673
  }
2823
-
2824
2674
  return this._calculateItemPosition(p.count) || 0;
2825
2675
  }
2826
2676
  }
2827
-
2828
- /**
2829
- * States that the cached positions/heights are invalid,
2830
- * and needs to be completely re-calculated.<br />
2831
- * You should probably call `render()` after this.
2832
- * @returns {VirtualListHelper}
2677
+ /**
2678
+ * States that the cached positions/heights are invalid,
2679
+ * and needs to be completely re-calculated.<br />
2680
+ * You should probably call `render()` after this.
2833
2681
  */
2834
2682
  invalidatePositions() {
2835
2683
  const p = this._p;
2836
-
2837
2684
  p.itemPositionsNeedsUpdate = 0;
2838
2685
  p.cachedItemHeights = [];
2839
2686
  p.cachedItemEstimatedHeights = [];
@@ -2841,40 +2688,31 @@ class VirtualListHelper {
2841
2688
  p.cachedItemHeights.length = p.count;
2842
2689
  p.cachedItemEstimatedHeights.length = p.count;
2843
2690
  p.cachedItemPositions.length = p.count;
2844
-
2845
2691
  return this;
2846
2692
  }
2847
-
2848
- /**
2849
- * States that the indexes/item count/rendered content are invalid,
2850
- * and needs to be completely re-calculated and re-rendered. <br />
2851
- * You should probably call `render()` after this.
2852
- * @returns {VirtualListHelper}
2693
+ /**
2694
+ * States that the indexes/item count/rendered content are invalid,
2695
+ * and needs to be completely re-calculated and re-rendered. <br />
2696
+ * You should probably call `render()` after this.
2853
2697
  */
2854
2698
  invalidate() {
2855
2699
  const p = this._p;
2856
-
2857
2700
  this.invalidatePositions();
2858
-
2859
2701
  if (!p.virtual) {
2860
2702
  this._destroyElements();
2861
2703
  }
2862
-
2863
2704
  for (let el of p.existingEls)
2864
2705
  delete el[ItemIndexSymbol];
2865
-
2866
2706
  return this;
2867
2707
  }
2868
-
2869
- /**
2870
- * Renders the current viewport. <br />
2871
- * Call this after making changes to the list. <br />
2872
- * In virtual mode, this is called automatically for every scroll event.
2708
+ /**
2709
+ * Renders the current viewport. <br />
2710
+ * Call this after making changes to the list. <br />
2711
+ * In virtual mode, this is called automatically for every scroll event.
2873
2712
  */
2874
2713
  render() {
2875
2714
  if (this[DestroyedSymbol])
2876
2715
  return;
2877
-
2878
2716
  const p = this._p;
2879
2717
  const list = p.list;
2880
2718
  const virtual = p.virtual;
@@ -2888,210 +2726,158 @@ class VirtualListHelper {
2888
2726
  let onItemUnrender = p.onItemUnrender;
2889
2727
  let existingEls = p.existingEls;
2890
2728
  let existingCount = existingEls.length;
2891
-
2892
2729
  if (virtual) {
2893
2730
  const originalWidth = list.clientWidth;
2894
-
2895
2731
  if (!virtualWrapper) {
2896
2732
  virtualWrapper = p.virtualWrapper = p.userItemsParent;
2897
2733
  if (!virtualWrapper) {
2898
2734
  virtualWrapper = p.virtualWrapper = document.createElement('div');
2899
2735
  list.appendChild(virtualWrapper);
2900
2736
  }
2901
-
2902
2737
  this._resetCurrentItemsParent();
2903
2738
  itemParent = p.currentItemsParent;
2904
-
2905
2739
  if (p.autoVirtualWrapperWidth) {
2906
2740
  virtualWrapper.style.width = '100%';
2907
2741
  p.virtualWrapperWidthWasSet = true;
2908
- } else {
2742
+ } else
2743
+ {
2909
2744
  p.virtualWrapperWidthWasSet = false;
2910
2745
  }
2911
2746
  }
2912
-
2913
2747
  // Mark all of them for potential reuse
2914
2748
  for (let i = 0; i < existingCount; i++) {
2915
2749
  existingEls[i][ReuseElSymbol] = true;
2916
2750
  }
2917
-
2918
2751
  // Make sure we have at least estimated positions for all items so we can translate scroll position
2919
2752
  this._calculateItemPosition(p.count - 1);
2920
-
2921
2753
  // Find existing elements index range
2922
2754
  let existingRange = this._getExistingElsRange();
2923
-
2924
2755
  // Find first visible element
2925
2756
  let firstVisibleIndex = binarySearchPosition(p.cachedItemPositions, scrollTop);
2926
2757
  let firstRenderIndex = Math.max(0, firstVisibleIndex - buffer);
2927
-
2928
2758
  // Iterate over viewport
2929
2759
  let index = firstRenderIndex;
2930
2760
  let renderPos = this._calculateItemPosition(index);
2931
2761
  let bufferEnd = buffer;
2932
-
2933
2762
  // we want to render until viewport's bottom + buffer items
2934
2763
  let maxIndexToRender = Math.max(index, binarySearchPosition(p.cachedItemPositions, visibleBottom - 1) + 1 + buffer);
2935
-
2936
2764
  let insertedItems = [];
2937
-
2938
- /** @type DocumentFragment|null */
2939
2765
  let fragment = null;
2940
-
2941
2766
  // Find the element to insert before
2942
2767
  let before = virtualWrapper.childNodes[0];
2943
-
2944
2768
  const findElementToReuse = function (index) {
2945
2769
  // Find existing element to reuse
2946
- /** @type Element|undefined */
2947
2770
  let existingEl = undefined;
2948
-
2949
2771
  if (existingRange.firstIndex !== -1 && index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
2950
2772
  existingEl = existingEls.find((x) => x[ItemIndexSymbol] === index && x[ReuseElSymbol] === true);
2951
2773
  }
2952
-
2953
2774
  if (existingEl === undefined) {
2954
2775
  existingEl = (existingRange.firstIndex < firstRenderIndex || existingRange.firstValidArrayIndex > 0 ?
2955
- existingEls.find((x) =>
2956
- (x[ItemIndexSymbol] < firstRenderIndex || false === hasOwnProperty.call(x, ItemIndexSymbol)) &&
2776
+ existingEls.find((x) => (x[ItemIndexSymbol] < firstRenderIndex || false === hasOwnProperty.call(x, ItemIndexSymbol)) &&
2957
2777
  x[ReuseElSymbol] === true) :
2958
- undefined) ||
2959
- findLast(existingEls, (x) => x[ReuseElSymbol] === true);
2778
+ undefined) || findLast(existingEls, (x) => x[ReuseElSymbol] === true);
2960
2779
  }
2961
-
2962
2780
  if (existingEl !== undefined) {
2963
2781
  delete existingEl[ReuseElSymbol];
2964
2782
  }
2965
-
2966
2783
  return existingEl;
2967
2784
  };
2968
-
2969
2785
  // First we iterate and try to add all at once in a fragment, as much as we can.
2970
2786
  // And then reflow the at once.
2971
2787
  for (; index < count && index < maxIndexToRender; index++) {
2972
2788
  let existingEl = findElementToReuse(index);
2973
-
2974
2789
  if (before && before === existingEl)
2975
2790
  before = before.nextSibling;
2976
-
2977
2791
  // Dequeue the element by reusing or creating a new one
2978
2792
  const itemEl = this._dequeueElementForIndex(existingEl, index, before, true);
2979
2793
  insertedItems.push([itemEl, index]);
2980
-
2981
2794
  fragment = insertBeforeWithFragment(itemEl, fragment, before, itemParent);
2982
2795
  }
2983
-
2984
2796
  // Insert any remaining fragment
2985
2797
  if (fragment && fragment.childNodes.length > 0) {
2986
2798
  insertBefore(fragment, before, itemParent);
2987
2799
  }
2988
-
2989
2800
  // Iterate on inserted items and reflow them
2990
2801
  for (let item of insertedItems) {
2991
2802
  const index = item[1];
2992
2803
  this._insertItemAndFlow(item[0], index, false /* inserted already */);
2993
2804
  renderPos = p.cachedItemPositions[index] + p.cachedItemHeights[index];
2994
2805
  }
2995
-
2996
2806
  // See if we still need to insert more items
2997
2807
  if (renderPos < visibleBottom) {
2998
2808
  for (; (renderPos < visibleBottom || bufferEnd-- > 0) && index < count; index++) {
2999
2809
  let existingEl = findElementToReuse(index);
3000
-
3001
2810
  if (before && before === existingEl)
3002
2811
  before = before.nextSibling;
3003
-
3004
2812
  // Dequeue the element by reusing or creating a new one
3005
2813
  this._dequeueElementForIndex(existingEl, index, before, false);
3006
-
3007
2814
  // Increment pointers
3008
2815
  renderPos = p.cachedItemPositions[index] + p.cachedItemHeights[index];
3009
2816
  }
3010
2817
  }
3011
-
3012
2818
  // Calculate up-to-date scroll height
3013
2819
  let scrollHeight = this.estimateFullHeight();
3014
2820
  let scrollHeightPx = scrollHeight + 'px';
3015
-
3016
2821
  if (virtualWrapper.style.height !== scrollHeightPx) {var _p$onScrollHeightChan;
3017
2822
  virtualWrapper.style.height = scrollHeightPx;
3018
2823
  (_p$onScrollHeightChan = p.onScrollHeightChange) === null || _p$onScrollHeightChan === void 0 || _p$onScrollHeightChan.call(p, scrollHeight);
3019
2824
  }
3020
-
3021
2825
  if (originalWidth !== list.clientWidth)
3022
2826
  this.render();
3023
- } else {// non-virtual
2827
+ } else
2828
+ {// non-virtual
3024
2829
  if (count !== existingEls.length) {
3025
2830
  for (let i = 0; i < existingCount; i++) {
3026
2831
  existingEls[i][ReuseElSymbol] = true;
3027
2832
  }
3028
-
3029
2833
  // Find the element to insert before
3030
2834
  let before = itemParent.childNodes[0];
3031
-
3032
- /** @type DocumentFragment|null */
3033
2835
  let fragment = null;
3034
-
3035
2836
  for (let index = 0; index < count; index++) {
3036
2837
  // Find existing element to reuse
3037
2838
  let existingEl = existingEls.find((x) => x[ItemIndexSymbol] === index && x[ReuseElSymbol] === true);
3038
-
3039
2839
  if (existingEl !== undefined) {
3040
2840
  delete existingEl[ReuseElSymbol];
3041
2841
  }
3042
-
3043
2842
  if (before && before === existingEl)
3044
2843
  before = before.nextSibling;
3045
-
3046
2844
  // Dequeue the element by reusing or creating a new one
3047
2845
  const itemEl = this._dequeueElementForIndex(existingEl, index, before, true);
3048
-
3049
2846
  fragment = insertBeforeWithFragment(itemEl, fragment, before, itemParent);
3050
2847
  }
3051
-
3052
2848
  // Insert any remaining fragment
3053
2849
  if (fragment && fragment.childNodes.length > 0) {
3054
2850
  insertBefore(fragment, before, itemParent);
3055
2851
  }
3056
2852
  }
3057
2853
  }
3058
-
3059
2854
  // Cleanup extra unused elements
3060
2855
  existingCount = existingEls.length; // May have changed
3061
2856
  for (let i = 0; i < existingCount; i++) {
3062
2857
  const el = existingEls[i];
3063
- if (el[ReuseElSymbol] !== true) continue;
3064
-
2858
+ if (el[ReuseElSymbol] !== true)
2859
+ continue;
3065
2860
  let parent = el.parentNode;
3066
2861
  if (parent)
3067
2862
  parent.removeChild(el);
3068
2863
  if (onItemUnrender && el[ItemIndexSymbol] !== undefined)
3069
2864
  onItemUnrender(el);
3070
2865
  existingEls.splice(i, 1);
3071
-
3072
2866
  i--;
3073
2867
  existingCount--;
3074
2868
  }
3075
2869
  }
3076
-
3077
- /**
3078
- * States that items were added at a certain position in the list. <br />
3079
- * Virtual mode: Call `render()` to update the view after making changes.
3080
- * @param {number} count
3081
- * @param {number} [atIndex=-1]
3082
- * @returns {VirtualListHelper}
2870
+ /**
2871
+ * States that items were added at a certain position in the list. <br />
2872
+ * Virtual mode: Call `render()` to update the view after making changes.
3083
2873
  */
3084
2874
  addItemsAt(count, atIndex = -1) {
3085
2875
  if (typeof count !== 'number' || count <= 0)
3086
2876
  return this;
3087
-
3088
2877
  const p = this._p;
3089
-
3090
2878
  if (atIndex < 0 || atIndex >= p.count)
3091
2879
  atIndex = p.count;
3092
-
3093
2880
  p.count += count;
3094
-
3095
2881
  if (p.virtual) {
3096
2882
  if (atIndex >= 0 && atIndex < p.count) {
3097
2883
  this._invalidateItemIndexesAt(atIndex, -1);
@@ -3102,54 +2888,36 @@ class VirtualListHelper {
3102
2888
  let existingCount = existingEls.length;
3103
2889
  if (existingCount !== p.count - count)
3104
2890
  return this;
3105
-
3106
2891
  let existingRange = this._getExistingElsRange();
3107
2892
  if (existingRange.firstValidArrayIndex === -1)
3108
2893
  return this;
3109
-
3110
2894
  const itemParent = p.currentItemsParent;
3111
-
3112
2895
  let startIndex = existingRange.firstValidArrayIndex + atIndex - existingRange.firstIndex;
3113
-
3114
2896
  this._pushItemIndexesAt(atIndex, count);
3115
-
3116
- /** @type Node|undefined */
3117
2897
  let before = existingEls[startIndex - 1] ?
3118
2898
  existingEls[startIndex - 1].nextSibling :
3119
2899
  existingEls[0];
3120
-
3121
- /** @type DocumentFragment|null */
3122
2900
  let fragment = null;
3123
-
3124
2901
  for (let index = atIndex, end = atIndex + count; index < end; index++) {
3125
2902
  const itemEl = this._dequeueElementForIndex(undefined, index, before, true);
3126
2903
  fragment = insertBeforeWithFragment(itemEl, fragment, before, itemParent);
3127
2904
  }
3128
-
3129
2905
  // Insert any remaining fragment
3130
2906
  if (fragment && fragment.childNodes.length > 0) {
3131
2907
  insertBefore(fragment, before, itemParent);
3132
2908
  }
3133
2909
  }
3134
-
3135
2910
  return this;
3136
2911
  }
3137
-
3138
- /**
3139
- * States that items were removed at a certain position in the list. <br />
3140
- * Virtual mode: Call `render()` to update the view after making changes.
3141
- * @param {number} count
3142
- * @param {number} atIndex
3143
- * @returns {VirtualListHelper}
2912
+ /**
2913
+ * States that items were removed at a certain position in the list. <br />
2914
+ * Virtual mode: Call `render()` to update the view after making changes.
3144
2915
  */
3145
2916
  removeItemsAt(count, atIndex) {
3146
2917
  const p = this._p;
3147
-
3148
2918
  if (typeof count !== 'number' || typeof atIndex !== 'number' || count <= 0 || atIndex < 0 || atIndex >= p.count)
3149
2919
  return this;
3150
-
3151
2920
  p.count -= Math.min(count, p.count - atIndex);
3152
-
3153
2921
  if (p.virtual) {
3154
2922
  this._invalidateItemIndexesAt(atIndex, -1);
3155
2923
  } else
@@ -3158,19 +2926,15 @@ class VirtualListHelper {
3158
2926
  let existingCount = existingEls.length;
3159
2927
  if (existingCount !== p.count + count)
3160
2928
  return this;
3161
-
3162
2929
  let existingRange = this._getExistingElsRange();
3163
2930
  if (existingRange.firstValidArrayIndex === -1)
3164
2931
  return this;
3165
-
3166
2932
  this._pushItemIndexesAt(atIndex + count, -count);
3167
-
3168
2933
  const onItemUnrender = p.onItemUnrender;
3169
2934
  let index = existingRange.firstValidArrayIndex + atIndex - existingRange.firstIndex;
3170
2935
  if (index < existingEls.length) {
3171
2936
  for (let i = 0; i < count; i++) {
3172
2937
  let itemEl = existingEls[index + i];
3173
-
3174
2938
  let parent = itemEl.parentNode;
3175
2939
  if (parent)
3176
2940
  parent.removeChild(itemEl);
@@ -3180,23 +2944,17 @@ class VirtualListHelper {
3180
2944
  existingEls.splice(index, count);
3181
2945
  }
3182
2946
  }
3183
-
3184
2947
  return this;
3185
2948
  }
3186
-
3187
- /**
3188
- * Mark an element for a re-render. <br />
3189
- * Virtual mode: Call `render()` to update the view after making changes. <br />
3190
- * Non-virtual mode - the element is re-rendered immediately.
3191
- * @param {number} index - the index of the element to re-render
3192
- * @returns {VirtualListHelper}
2949
+ /**
2950
+ * Mark an element for a re-render. <br />
2951
+ * Virtual mode: Call `render()` to update the view after making changes. <br />
2952
+ * Non-virtual mode - the element is re-rendered immediately.
3193
2953
  */
3194
2954
  refreshItemAt(index) {
3195
2955
  const p = this._p;
3196
-
3197
2956
  if (typeof index !== 'number' || index < 0 || index >= p.count)
3198
2957
  return this;
3199
-
3200
2958
  if (p.virtual) {
3201
2959
  this._invalidateItemIndexesAt(index, 1);
3202
2960
  } else
@@ -3205,128 +2963,93 @@ class VirtualListHelper {
3205
2963
  let existingCount = existingEls.length;
3206
2964
  if (existingCount !== p.count)
3207
2965
  return this;
3208
-
3209
2966
  let existingRange = this._getExistingElsRange();
3210
-
3211
2967
  if (index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
3212
2968
  let itemEl = existingEls[existingRange.firstValidArrayIndex + index - existingRange.firstIndex];
3213
2969
  delete itemEl[ItemIndexSymbol];
3214
2970
  this._dequeueElementForIndex(itemEl, index, itemEl.nextSibling, false);
3215
2971
  }
3216
2972
  }
3217
-
3218
2973
  return this;
3219
2974
  }
3220
-
3221
- /**
3222
- * Tests whether an item at the specified index is rendered.
3223
- * @param {number} index - the index to test
3224
- * @returns {boolean}
2975
+ /**
2976
+ * Tests whether an item at the specified index is rendered.
3225
2977
  */
3226
2978
  isItemRendered(index) {
3227
2979
  const p = this._p;
3228
-
3229
2980
  if (typeof index !== 'number' || index < 0 || index >= p.count)
3230
2981
  return false;
3231
-
3232
2982
  let existingRange = this._getExistingElsRange();
3233
-
3234
2983
  return index >= existingRange.firstIndex && index <= existingRange.lastIndex;
3235
2984
  }
3236
-
3237
- /**
3238
- * Retrieves DOM element for the item at the specified index - if it's currently rendered.
3239
- * @param {number} index - the index to retrieve
3240
- * @returns {Element|undefined}
2985
+ /**
2986
+ * Retrieves DOM element for the item at the specified index - if it's currently rendered.
3241
2987
  */
3242
2988
  getItemElementAt(index) {
3243
2989
  const p = this._p;
3244
-
3245
2990
  if (typeof index !== 'number' || index < 0 || index >= p.count)
3246
2991
  return undefined;
3247
-
3248
2992
  let existingEls = p.existingEls;
3249
2993
  let existingRange = this._getExistingElsRange();
3250
-
3251
2994
  if (index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
3252
2995
  return existingEls[existingRange.firstValidArrayIndex + index - existingRange.firstIndex];
3253
2996
  }
3254
-
3255
2997
  return undefined;
3256
2998
  }
3257
-
3258
- /**
3259
- * Retrieves the position for the specified index. <br />
3260
- * Can be used to scroll to a specific item.
3261
- * @param {number} index
3262
- * @returns {number|undefined}
2999
+ /**
3000
+ * Retrieves the position for the specified index. <br />
3001
+ * Can be used to scroll to a specific item.
3263
3002
  */
3264
3003
  getItemPosition(index) {
3265
3004
  const p = this._p;
3266
-
3267
3005
  if (typeof index !== 'number' || index < 0 || index >= p.count)
3268
3006
  return undefined;
3269
-
3270
3007
  if (p.virtual) {
3271
3008
  return this._calculateItemPosition(index);
3272
- } else {
3009
+ } else
3010
+ {
3273
3011
  let itemEl = this.getItemElementAt(index);
3274
3012
  if (itemEl === undefined)
3275
3013
  return undefined;
3276
-
3277
3014
  const list = p.list;
3278
3015
  return getElementOffset(itemEl).top - getElementOffset(list).top + list.scrollTop;
3279
3016
  }
3280
3017
  }
3281
-
3282
- /**
3283
- * Retrieves the item index for the specified element
3284
- * @param {Element} el
3285
- * @returns {number|undefined}
3018
+ /**
3019
+ * Retrieves the item index for the specified element
3286
3020
  */
3287
3021
  getItemIndexFromElement(el) {
3288
3022
  return el ? el[ItemIndexSymbol] : undefined;
3289
3023
  }
3290
-
3291
- /**
3292
- * Retrieves the size (or estimated size, if unknown) for the specified index. <br />
3293
- * @param {number} index
3294
- * @returns {number|undefined}
3024
+ /**
3025
+ * Retrieves the size (or estimated size, if unknown) for the specified index. <br />
3295
3026
  */
3296
3027
  getItemSize(index) {
3297
3028
  const p = this._p;
3298
-
3299
3029
  if (typeof index !== 'number' || index < 0 || index >= p.count)
3300
3030
  return undefined;
3301
-
3302
- let height = p.cachedItemHeights[index - 1]; // already calculated
3303
-
3031
+ let height = p.cachedItemHeights[index]; // already calculated
3304
3032
  if (height === undefined) {
3305
- height = p.itemHeightEstimatorFn ? p.itemHeightEstimatorFn(index - 1) : null; // estimated per item
3306
-
3033
+ height = p.itemHeightEstimatorFn ? p.itemHeightEstimatorFn(index) : null; // estimated per item
3307
3034
  if (typeof height !== 'number')
3308
3035
  height = p.estimatedItemHeight; // estimated
3309
-
3310
- p.cachedItemEstimatedHeights[index - 1] = height;
3036
+ p.cachedItemEstimatedHeights[index] = height;
3311
3037
  }
3312
-
3313
3038
  return height;
3314
3039
  }
3315
-
3316
- /**
3317
- * Retrieves the number of items that fit into the current viewport.
3318
- * @returns {number}
3040
+ /**
3041
+ * Retrieves the number of items that fit into the current viewport.
3319
3042
  */
3320
3043
  getVisibleItemCount() {
3321
3044
  const p = this._p,list = p.list;
3322
-
3323
3045
  let scrollTop = list.scrollTop;
3324
3046
  let visibleHeight = list.clientHeight;
3325
3047
  let firstVisibleIndex, lastVisibleIndex;
3326
-
3048
+ if (p.count === 0 || visibleHeight === 0)
3049
+ return 0;
3327
3050
  if (p.virtual) {
3328
- firstVisibleIndex = binarySearchPosition(p.cachedItemPositions, scrollTop);
3329
- lastVisibleIndex = binarySearchPosition(p.cachedItemPositions, scrollTop + visibleHeight, firstVisibleIndex);
3051
+ firstVisibleIndex = binarySearchPosition(p.cachedItemPositions, scrollTop, 0, p.count - 1);
3052
+ lastVisibleIndex = binarySearchPosition(p.cachedItemPositions, scrollTop + visibleHeight, firstVisibleIndex, p.count - 1);
3330
3053
  } else
3331
3054
  {
3332
3055
  const retriever = (i) => {
@@ -3335,32 +3058,28 @@ class VirtualListHelper {
3335
3058
  pos = Infinity;
3336
3059
  return pos;
3337
3060
  };
3338
-
3339
3061
  firstVisibleIndex = binarySearchPositionByFn(p.count, retriever, scrollTop);
3340
3062
  lastVisibleIndex = binarySearchPositionByFn(p.count, retriever, scrollTop + visibleHeight, firstVisibleIndex);
3341
3063
  }
3342
-
3343
3064
  if (this.getItemPosition(lastVisibleIndex) === scrollTop + visibleHeight)
3344
3065
  lastVisibleIndex--;
3345
3066
  return lastVisibleIndex - firstVisibleIndex + 1;
3346
3067
  }
3347
-
3348
- /**
3349
- * Renders a temporary ghost item. Can be used for testings several aspects of a proposed element, i.e measurements.
3350
- * @param {*} ghostIndex - the value to pass as the index for the renderer function
3351
- * @param {boolean} append - whether to append the item element to the DOM
3352
- * @param {function(itemEl: Element)} ghostTester - the function that will receive the element, called synchronously.
3068
+ /**
3069
+ * The ghost index is passed directly to the renderer. The tester is called synchronously.
3070
+ * Appends the element to the DOM only when append is true.
3071
+ * Renders a temporary ghost item. Can be used for testings several aspects of a proposed element, i.e measurements.
3353
3072
  */
3354
3073
  createGhostItemElement(ghostIndex, append, ghostTester) {
3355
3074
  const p = this._p;
3356
-
3357
3075
  let itemEl = this._dequeueElementForIndex(null, ghostIndex, false, true);
3358
3076
  try {
3359
3077
  if (append) {
3360
3078
  p.currentItemsParent.appendChild(itemEl);
3361
3079
  }
3362
3080
  ghostTester(itemEl);
3363
- } finally {
3081
+ } finally
3082
+ {
3364
3083
  if (append) {
3365
3084
  let parent = itemEl.parentNode;
3366
3085
  if (parent)
@@ -3370,38 +3089,30 @@ class VirtualListHelper {
3370
3089
  p.onItemUnrender(itemEl);
3371
3090
  }
3372
3091
  }
3373
-
3374
- /**
3375
- * Reset the pointer to the current items wrapper
3376
- * @private
3092
+ /**
3093
+ * Reset the pointer to the current items wrapper
3377
3094
  */
3378
3095
  _resetCurrentItemsParent() {var _ref, _p$virtualWrapper;
3379
3096
  const p = this._p;
3380
3097
  p.currentItemsParent = (_ref = (_p$virtualWrapper = p.virtualWrapper) !== null && _p$virtualWrapper !== void 0 ? _p$virtualWrapper : p.userItemsParent) !== null && _ref !== void 0 ? _ref : p.list;
3381
3098
  }
3382
-
3383
- /**
3384
- * Destroy all created elements, for cleanup
3385
- * @returns {VirtualListHelper}
3386
- * @private
3099
+ /**
3100
+ * Destroy all created elements, for cleanup
3387
3101
  */
3388
3102
  _destroyElements() {
3389
3103
  const p = this._p;
3390
3104
  const onItemUnrender = p.onItemUnrender;
3391
3105
  const existingEls = p.existingEls;
3392
-
3393
3106
  for (let i = 0; i < existingEls.length; i++) {
3394
3107
  const el = existingEls[i];
3395
-
3396
3108
  let parent = el.parentNode;
3397
3109
  if (parent)
3398
3110
  parent.removeChild(el);
3399
- if (onItemUnrender && el[ItemIndexSymbol] !== undefined)
3111
+ // Invalidation clears index metadata, but the element still owns rendered resources.
3112
+ if (onItemUnrender)
3400
3113
  onItemUnrender(el);
3401
3114
  }
3402
-
3403
3115
  existingEls.length = 0;
3404
-
3405
3116
  if (p.virtualWrapper) {
3406
3117
  if (p.virtualWrapper !== p.userItemsParent) {
3407
3118
  if (p.virtualWrapper.parentNode) {
@@ -3411,203 +3122,135 @@ class VirtualListHelper {
3411
3122
  p.virtualWrapper = null;
3412
3123
  this._resetCurrentItemsParent();
3413
3124
  }
3414
-
3415
3125
  return this;
3416
3126
  }
3417
-
3418
- /**
3419
- * Marks (an) item(s) at specific index(es) as to be re-rendered. <br />
3420
- * Applicable for virtual mode only.
3421
- * @param {number} index
3422
- * @param {number} count
3423
- * @private
3127
+ /**
3128
+ * Marks (an) item(s) at specific index(es) as to be re-rendered. <br />
3129
+ * Applicable for virtual mode only.
3424
3130
  */
3425
3131
  _invalidateItemIndexesAt(index, count) {
3426
3132
  const p = this._p;
3427
-
3428
3133
  this._setItemPositionsNeedsUpdate(index);
3429
-
3430
3134
  let existingEls = p.existingEls;
3431
3135
  let existingCount = existingEls.length;
3432
3136
  let existingRange = this._getExistingElsRange();
3433
-
3434
3137
  if (existingRange.firstValidArrayIndex === -1)
3435
3138
  return;
3436
-
3437
3139
  if (count === -1)
3438
3140
  count = existingEls.length;
3439
-
3440
3141
  // Clean
3441
3142
  if (index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
3442
- for (let i = existingRange.firstValidArrayIndex + index - existingRange.firstIndex,
3443
- c = 0;
3444
- i < existingCount && c < count;
3445
- i++, c++)
3143
+ for (let i = existingRange.firstValidArrayIndex + index - existingRange.firstIndex, c = 0; i < existingCount && c < count; i++, c++)
3446
3144
  delete existingEls[i][ItemIndexSymbol];
3447
3145
  }
3448
3146
  }
3449
-
3450
- /**
3451
- * In/decrement the item-index marker for specific item(s). <br />
3452
- * Used for inserting/removing items in the middle of the list, without re-rendering everything. <br />
3453
- * Applicable for non-virtual mode only.
3454
- * @param {number} index
3455
- * @param {number} count
3456
- * @private
3147
+ /**
3148
+ * In/decrement the item-index marker for specific item(s). <br />
3149
+ * Used for inserting/removing items in the middle of the list, without re-rendering everything. <br />
3150
+ * Applicable for non-virtual mode only.
3457
3151
  */
3458
3152
  _pushItemIndexesAt(index, count) {
3459
3153
  const p = this._p;
3460
-
3461
3154
  let existingEls = p.existingEls;
3462
3155
  let existingCount = existingEls.length;
3463
3156
  let existingRange = this._getExistingElsRange();
3464
-
3465
3157
  if (existingRange.firstValidArrayIndex === -1)
3466
3158
  return;
3467
-
3468
3159
  // Clean
3469
3160
  if (index >= existingRange.firstIndex && index <= existingRange.lastIndex) {
3470
- for (let i = existingRange.firstValidArrayIndex + index - existingRange.firstIndex;
3471
- i < existingCount;
3472
- i++)
3161
+ for (let i = existingRange.firstValidArrayIndex + index - existingRange.firstIndex; i < existingCount; i++)
3473
3162
  existingEls[i][ItemIndexSymbol] += count;
3474
3163
  }
3475
3164
  }
3476
-
3477
- /**
3478
- * Hook relevant events
3479
- * @returns {VirtualListHelper}
3480
- * @private
3165
+ /**
3166
+ * Hook relevant events
3481
3167
  */
3482
3168
  _hookEvents() {
3483
3169
  const p = this._p;
3484
-
3485
3170
  this._unhookEvents();
3486
-
3487
3171
  if (p.virtual && p.hookScrollEvent) {
3488
- p.list && p.list.addEventListener('scroll', /**@type Function*/p.boundRender);
3172
+ p.list && p.list.addEventListener('scroll', p.boundRender);
3489
3173
  }
3490
-
3491
3174
  return this;
3492
3175
  }
3493
-
3494
- /**
3495
- * Unhook previously hooked events
3496
- * @returns {VirtualListHelper}
3497
- * @private
3176
+ /**
3177
+ * Unhook previously hooked events
3498
3178
  */
3499
3179
  _unhookEvents() {
3500
3180
  const p = this._p;
3501
-
3502
- p.list && p.list.removeEventListener('scroll', /**@type Function*/p.boundRender);
3503
-
3181
+ p.list && p.list.removeEventListener('scroll', p.boundRender);
3504
3182
  return this;
3505
3183
  }
3506
-
3507
- /**
3508
- * Mark item index from which the positions are not considered valid anymore. <br />
3509
- * Applicable for virtual mode only.
3510
- * @param {number} value
3511
- * @private
3184
+ /**
3185
+ * Mark item index from which the positions are not considered valid anymore. <br />
3186
+ * Applicable for virtual mode only.
3512
3187
  */
3513
3188
  _setItemPositionsNeedsUpdate(value) {
3514
3189
  const p = this._p;
3515
-
3516
3190
  if (value < p.itemPositionsNeedsUpdate) {
3517
3191
  p.itemPositionsNeedsUpdate = value;
3518
3192
  }
3519
3193
  }
3520
-
3521
- /**
3522
- * Calculates an item's top position (and stores in the private `cachedItemPositions` array). <br />
3523
- * Allows calculating last+1 index too, to get the bottom-most position. <br />
3524
- * Applicable for non-virtual mode only.
3525
- * @param {number} index
3526
- * @returns {number|undefined}
3527
- * @private
3194
+ /**
3195
+ * Calculates an item's top position (and stores in the private `cachedItemPositions` array). <br />
3196
+ * Allows calculating last+1 index too, to get the bottom-most position. <br />
3197
+ * Applicable for non-virtual mode only.
3528
3198
  */
3529
3199
  _calculateItemPosition(index) {
3530
3200
  const p = this._p;
3531
-
3532
3201
  const cachedItemPositions = p.cachedItemPositions;
3533
-
3534
3202
  if (index >= p.itemPositionsNeedsUpdate) {
3535
3203
  const count = p.count;
3536
3204
  const cachedItemHeights = p.cachedItemHeights;
3537
3205
  const cachedItemEstimatedHeights = p.cachedItemEstimatedHeights;
3538
3206
  const estimatedItemHeight = p.estimatedItemHeight;
3539
3207
  const itemHeightEstimatorFn = p.itemHeightEstimatorFn;
3540
-
3541
3208
  if (cachedItemHeights.length !== count) {
3542
3209
  cachedItemHeights.length = count;
3543
3210
  cachedItemEstimatedHeights.length = count;
3544
3211
  cachedItemPositions.length = count;
3545
3212
  }
3546
-
3547
3213
  let fromIndex = p.itemPositionsNeedsUpdate;
3548
3214
  let toIndex = Math.min(index, count);
3549
-
3550
3215
  let pos = 0;
3551
-
3552
3216
  if (fromIndex > 0) {
3553
3217
  pos = cachedItemPositions[fromIndex - 1];
3554
3218
  }
3555
-
3556
3219
  for (let i = fromIndex; i <= toIndex; i++) {
3557
3220
  if (i === 0) {
3558
3221
  cachedItemPositions[i] = pos;
3559
3222
  continue;
3560
3223
  }
3561
-
3562
3224
  const prevIndex = i - 1;
3563
-
3564
3225
  let height = cachedItemHeights[prevIndex]; // already calculated
3565
-
3566
3226
  if (height === undefined) {
3567
3227
  height = itemHeightEstimatorFn ? itemHeightEstimatorFn(prevIndex) : null; // estimated per item
3568
-
3569
3228
  if (typeof height !== 'number')
3570
3229
  height = estimatedItemHeight; // estimated
3571
-
3572
3230
  cachedItemEstimatedHeights[prevIndex] = height;
3573
3231
  }
3574
-
3575
3232
  pos += height;
3576
3233
  cachedItemPositions[i] = pos;
3577
3234
  }
3578
-
3579
3235
  p.itemPositionsNeedsUpdate = toIndex + 1;
3580
3236
  }
3581
-
3582
3237
  // item after the last (calculate full height)
3583
3238
  if (index > 0 && index === p.count) {
3584
3239
  let height = p.cachedItemHeights[index - 1]; // already calculated
3585
-
3586
3240
  if (height === undefined) {
3587
3241
  height = p.itemHeightEstimatorFn ? p.itemHeightEstimatorFn(index - 1) : null; // estimated per item
3588
-
3589
3242
  if (typeof height !== 'number')
3590
3243
  height = p.estimatedItemHeight; // estimated
3591
-
3592
3244
  p.cachedItemEstimatedHeights[index - 1] = height;
3593
3245
  }
3594
-
3595
3246
  return cachedItemPositions[index - 1] + height;
3596
3247
  }
3597
-
3598
3248
  return cachedItemPositions[index];
3599
3249
  }
3600
-
3601
- /**
3602
- * Create (or reuse an existing) element for an item at the specified index,
3603
- * and insert physically at specified position. <br />
3604
- * This will also update the element's position in the `existingEls` array.
3605
- * @param {Element|undefined} itemEl
3606
- * @param {number} index
3607
- * @param {Node|boolean|undefined} insertBefore
3608
- * @param {boolean|undefined} avoidDomReflow
3609
- * @returns {Element}
3610
- * @private
3250
+ /**
3251
+ * Create (or reuse an existing) element for an item at the specified index,
3252
+ * and insert physically at specified position. <br />
3253
+ * This will also update the element's position in the `existingEls` array.
3611
3254
  */
3612
3255
  _dequeueElementForIndex(itemEl, index, insertBefore, avoidDomReflow) {
3613
3256
  const p = this._p;
@@ -3618,138 +3261,111 @@ class VirtualListHelper {
3618
3261
  const onItemUnrender = p.onItemUnrender;
3619
3262
  const isNew = !itemEl;
3620
3263
  const shouldReRender = isNew || index !== itemEl[ItemIndexSymbol];
3621
-
3622
3264
  if (itemEl) {
3623
3265
  if (onItemUnrender && shouldReRender) {
3624
3266
  onItemUnrender(itemEl);
3625
3267
  }
3626
- } else {
3268
+ } else
3269
+ {
3627
3270
  itemEl = p.itemElementCreatorFn();
3628
-
3629
3271
  if (virtualWrapper && insertBefore !== false) {
3630
- (/**@type ElementCSSInlineStyle*/itemEl).style.position = 'absolute';
3631
- (/**@type ElementCSSInlineStyle*/itemEl).style.top = '0';
3632
- (/**@type ElementCSSInlineStyle*/itemEl).style.left = '0';
3633
- (/**@type ElementCSSInlineStyle*/itemEl).style.right = '0';
3272
+ itemEl.style.position = 'absolute';
3273
+ itemEl.style.top = '0';
3274
+ itemEl.style.left = '0';
3275
+ itemEl.style.right = '0';
3634
3276
  }
3635
3277
  }
3636
-
3637
3278
  // Render only if it's a new item element
3638
3279
  // OR the index of the existing element is not the same of the index to render
3639
3280
  if (shouldReRender) {
3640
3281
  itemEl.innerHTML = ''; // Basic cleanup
3641
-
3642
3282
  if (onItemRender)
3643
3283
  onItemRender(itemEl, index);
3644
3284
  }
3645
-
3646
3285
  if (insertBefore !== false) {
3647
3286
  if (!(insertBefore instanceof Node))
3648
3287
  insertBefore = null;
3649
-
3650
3288
  // Remove from existing list
3651
3289
  if (!isNew) {
3652
3290
  let i = existingEls.indexOf(itemEl);
3653
3291
  if (i !== -1)
3654
3292
  existingEls.splice(i, 1);
3655
3293
  }
3656
-
3657
3294
  // Insert into existing list
3658
- let beforeIndex = insertBefore ? existingEls.indexOf(/**@type Element*/insertBefore) : -1;
3295
+ let beforeIndex = insertBefore ? existingEls.indexOf(insertBefore) : -1;
3659
3296
  if (beforeIndex === -1) {
3660
3297
  existingEls.push(itemEl);
3661
- } else {
3298
+ } else
3299
+ {
3662
3300
  existingEls.splice(beforeIndex, 0, itemEl);
3663
3301
  }
3664
-
3665
3302
  if (!avoidDomReflow) {
3666
3303
  this._insertItemAndFlow(itemEl, index, insertBefore);
3667
3304
  }
3668
3305
  }
3669
-
3670
3306
  // Add index metadata to item
3671
3307
  itemEl[ItemIndexSymbol] = index;
3672
-
3673
3308
  return itemEl;
3674
3309
  }
3675
-
3676
- /**
3677
- * Insert item element into the DOM, set it's flow in the DOM, and update the item's position. <br />
3678
- * @param {Element|undefined} itemEl
3679
- * @param {number} index
3680
- * @param {Node|boolean|undefined} before
3681
- * @private
3310
+ /**
3311
+ * Insert item element into the DOM, set it's flow in the DOM, and update the item's position. <br />
3682
3312
  */
3683
3313
  _insertItemAndFlow(itemEl, index, before) {
3684
3314
  const p = this._p;
3685
3315
  const virtualWrapper = p.virtualWrapper;
3686
3316
  const itemParent = p.currentItemsParent;
3687
-
3688
3317
  if (before !== false) {
3689
3318
  if (!(before instanceof Node))
3690
3319
  before = null;
3691
-
3692
3320
  // Insert into DOM
3693
3321
  if (itemEl.parentNode !== itemParent ||
3694
3322
  itemEl.nextSibling !== before) {
3695
3323
  insertBefore(itemEl, before, itemParent);
3696
3324
  }
3697
3325
  }
3698
-
3699
3326
  if (virtualWrapper) {
3700
3327
  // Calculate height
3701
3328
  let itemHeight = itemEl.getBoundingClientRect().height;
3702
-
3703
3329
  // Put calculated height into cache, and invalidate positions if it's different
3704
3330
  let cachedItemHeight = p.cachedItemHeights[index];
3705
3331
  if (cachedItemHeight !== itemHeight) {
3706
3332
  p.cachedItemHeights[index] = itemHeight;
3707
3333
  }
3708
-
3709
3334
  if (cachedItemHeight !== undefined && itemHeight !== cachedItemHeight ||
3710
3335
  cachedItemHeight === undefined && itemHeight !== p.cachedItemEstimatedHeights[index]) {
3711
3336
  this._setItemPositionsNeedsUpdate(index + 1);
3712
3337
  }
3713
-
3714
3338
  // Set item top position
3715
3339
  let pos = this._calculateItemPosition(index);
3716
3340
  const supportedTransform = getSupportedTransform();
3717
-
3718
3341
  if (supportedTransform === false) {
3719
- (/**@type ElementCSSInlineStyle*/itemEl).style.top = `${pos}px`;
3720
- } else {
3721
- (/**@type ElementCSSInlineStyle*/itemEl).style[supportedTransform] = `translateY(${pos}px)`;
3342
+ itemEl.style.top = `${pos}px`;
3343
+ } else
3344
+ {
3345
+ itemEl.style[supportedTransform] = `translateY(${pos}px)`;
3722
3346
  }
3723
3347
  }
3724
3348
  }
3725
-
3726
- /**
3727
- * Fetches valid range of existingEls
3728
- * @returns {{firstIndex: (*|number), firstValidArrayIndex: number, lastValidArrayIndex: number, lastIndex: (*|number)}}
3729
- * @private
3349
+ /**
3350
+ * Fetches valid range of existingEls
3730
3351
  */
3731
3352
  _getExistingElsRange() {
3732
3353
  const p = this._p,existingEls = p.existingEls;
3733
-
3734
3354
  let firstValidArrayIndex = -1,lastValidArrayIndex = -1;
3735
-
3736
3355
  for (let i = 0, len = existingEls.length; i < len; i++) {
3737
3356
  if (false === hasOwnProperty.call(existingEls[i], ItemIndexSymbol))
3738
3357
  continue;
3739
3358
  firstValidArrayIndex = i;
3740
3359
  break;
3741
3360
  }
3742
-
3743
3361
  for (let i = existingEls.length - 1; i >= 0; i--) {
3744
3362
  if (false === hasOwnProperty.call(existingEls[i], ItemIndexSymbol))
3745
3363
  continue;
3746
3364
  lastValidArrayIndex = i;
3747
3365
  break;
3748
3366
  }
3749
-
3750
3367
  let firstIndex = firstValidArrayIndex !== -1 ? existingEls[firstValidArrayIndex][ItemIndexSymbol] : -1;
3751
3368
  let lastIndex = lastValidArrayIndex !== -1 ? existingEls[lastValidArrayIndex][ItemIndexSymbol] : -1;
3752
-
3753
3369
  return {
3754
3370
  firstValidArrayIndex: firstValidArrayIndex,
3755
3371
  lastValidArrayIndex: lastValidArrayIndex,
@@ -3758,95 +3374,64 @@ class VirtualListHelper {
3758
3374
  };
3759
3375
  }
3760
3376
  }
3761
-
3762
- /** Marks the item index associated with an item element */
3763
3377
  const ItemIndexSymbol = Symbol('index');
3764
-
3765
- /** Marks an element for reuse */
3766
3378
  const ReuseElSymbol = Symbol('reuse');
3767
-
3768
- /**
3769
- * The default element creator
3770
- * @returns {HTMLLIElement}
3379
+ /**
3380
+ * The default element creator
3771
3381
  */
3772
3382
  const defaultElementCreator = () => {
3773
3383
  return document.createElement('li');
3774
3384
  };
3775
-
3776
- /**
3777
- * Will look for the index in the `positions` array closest to the specified `pos` value (<= pos).
3778
- * @param {number[]} positions
3779
- * @param {number} pos
3780
- * @param {number} [start=0]
3781
- * @param {number} [end=-1]
3782
- * @returns {number}
3385
+ /**
3386
+ * Will look for the index in the `positions` array closest to the specified `pos` value (<= pos).
3783
3387
  */
3784
3388
  const binarySearchPosition = (positions, pos, start = 0, end = -1) => {
3785
3389
  let total = positions.length;
3786
3390
  if (end < 0)
3787
3391
  end += total;
3788
- if (end <= start) return end; // 0 or 1 length array
3789
-
3392
+ if (end <= start)
3393
+ return end; // 0 or 1 length array
3790
3394
  while (start <= end) {
3791
3395
  let mid = Math.floor(start + (end - start) / 2);
3792
3396
  let midPos = positions[mid];
3793
-
3794
3397
  if (midPos === pos || midPos <= pos && mid < total && positions[mid + 1] > pos) {
3795
3398
  while (mid > 0 && positions[mid - 1] === midPos) // avoid bugs on 0-height items
3796
3399
  mid--;
3797
-
3798
3400
  return mid;
3799
3401
  }
3800
-
3801
3402
  if (midPos < pos)
3802
3403
  start = mid + 1;else
3803
3404
 
3804
3405
  end = mid - 1;
3805
3406
  }
3806
-
3807
- return end === -1 ? 0 : total - 1;
3407
+ return end === -1 ? 0 : end;
3808
3408
  };
3809
-
3810
- /**
3811
- * Will look for the index in a virtual list of positions supplied by `total` and `fn`,
3812
- * closest to the specified `pos` value (<= pos).
3813
- * @param {number} total
3814
- * @param {function(index: number):number} fn
3815
- * @param {number} pos
3816
- * @param {number} [start=0]
3817
- * @param {number} [end=-1]
3818
- * @returns {number}
3409
+ /**
3410
+ * Will look for the index in a virtual list of positions supplied by `total` and `fn`,
3411
+ * closest to the specified `pos` value (<= pos).
3819
3412
  */
3820
3413
  const binarySearchPositionByFn = (total, fn, pos, start = 0, end = -1) => {
3821
3414
  if (end < 0)
3822
3415
  end += total;
3823
- if (end <= start) return end; // 0 or 1 length array
3824
-
3416
+ if (end <= start)
3417
+ return end; // 0 or 1 length array
3825
3418
  while (start <= end) {
3826
3419
  let mid = Math.floor(start + (end - start) / 2);
3827
3420
  let midPos = fn(mid);
3828
-
3829
3421
  if (midPos === pos || midPos <= pos && mid < total && fn(mid + 1) > pos) {
3830
3422
  while (mid > 0 && fn(mid - 1) === midPos) // avoid bugs on 0-height items
3831
3423
  mid--;
3832
-
3833
3424
  return mid;
3834
3425
  }
3835
-
3836
3426
  if (midPos < pos)
3837
3427
  start = mid + 1;else
3838
3428
 
3839
3429
  end = mid - 1;
3840
3430
  }
3841
-
3842
- return end === -1 ? 0 : fn(total - 1);
3431
+ return end === -1 ? 0 : end;
3843
3432
  };
3844
-
3845
- /**
3846
- * Finds the last item in the array for which `fn` returns a truthy value
3847
- * @param {Array} array
3848
- * @param {Function} fn
3849
- * @returns {undefined|*}
3433
+ /**
3434
+ * Finds the last item in the array for which `fn` returns a truthy value
3850
3435
  */
3851
3436
  const findLast = (array, fn) => {
3852
3437
  for (let i = array.length - 1; i >= 0; i--) {
@@ -3856,9 +3441,7 @@ const findLast = (array, fn) => {
3856
3441
  }
3857
3442
  return undefined;
3858
3443
  };
3859
-
3860
3444
  let _isTransformSupported = null;
3861
-
3862
3445
  const getSupportedTransform = () => {
3863
3446
  if (_isTransformSupported === null) {
3864
3447
  let prefixes = ['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform'];
@@ -3874,9 +3457,9 @@ const getSupportedTransform = () => {
3874
3457
  return _isTransformSupported;
3875
3458
  };
3876
3459
 
3877
- 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 {}t.cellPreviewCell.remove(), o && t._unbindCellHoverOut(o), t._unbindCellHoverOut(l);try {i && o && N.restoreSelection(o, i);} catch {}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 {}}(e, n);}function F(e, t) {const l = e._o,o = me(e);let n = t.target.closest(`div.${l.tableClassName}-header-cell,div.${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.${l.tableClassName}-header-cell,div.${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.${o.tableClassName}-header-cell,div.${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.${l.tableClassName}-header-cell,div.${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.${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.${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.${l.tableClassName}-header-cell,div.${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.${l.tableClassName}-header-cell,div.${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 {i = null;}const n = t.target.closest(`div.${l.tableClassName}-header-cell,div.${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.${l.tableClassName}-header-cell,div.${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 {return;}const n = t.target.closest(`div.${l.tableClassName}-header-cell,div.${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, l = 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 = `${n}-header`;const d = re("div");d.className = `${n}-header-row`;const u = re("div");u.className = `${n}-header-cell ${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 = `${n}-body`;const o = re("div");o.className = `${n}-row`;const a = re("div");a.className = `${n}-cell ${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 = `${d}-header`, u.appendChild(h);const c = re("div");c.index = null, c.vIndex = null, c.className = `${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 = `${d}-header-cell ${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.${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(`${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 {}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 = `${i}-header`, n.className = `${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 = `${r}-row`, t.className = `${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 = `${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, l = 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.${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.${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, t = 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, t = { immediate: true, render: true }) {var _o$virtualListHelper;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, t = 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", _);
3460
+ 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 {}t.cellPreviewCell.remove(), i && t._unbindCellHoverOut(i), t._unbindCellHoverOut(l);try {o && i && x.restoreSelection(i, o);} catch {}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 {}}(e, n);}function F(e, t) {const l = e._o,i = ve(e);let n = t.target.closest(`div.${l.tableClassName}-header-cell,div.${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.${l.tableClassName}-header-cell,div.${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.${i.tableClassName}-header-cell,div.${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.${l.tableClassName}-header-cell,div.${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.${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.${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.${l.tableClassName}-header-cell,div.${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.${l.tableClassName}-header-cell,div.${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 {o = null;}const n = t.target.closest(`div.${l.tableClassName}-header-cell,div.${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.${l.tableClassName}-header-cell,div.${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 {return;}const n = t.target.closest(`div.${l.tableClassName}-header-cell,div.${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, l = 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 = `${n}-header`;const d = de("div");d.className = `${n}-header-row`;const u = de("div");u.className = `${n}-header-cell ${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 = `${n}-body`;const i = de("div");i.className = `${n}-row`;const a = de("div");a.className = `${n}-cell ${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 = `${d}-header`, u.appendChild(h);const c = de("div");c.index = null, c.vIndex = null, c.className = `${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 = `${d}-header-cell ${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.${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(`${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 {}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 = `${o}-header`, n.className = `${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 = `${r}-row`, t.className = `${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 = `${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, l = 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.${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.${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, t = 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, t = { immediate: true, render: true }) {var _i$virtualListHelper;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, t = 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.39");_defineProperty(We, "Width", _);
3878
3461
 
3879
- class DGTableJQuery extends ge {
3462
+ class DGTableJQuery extends We {
3880
3463
  constructor(options) {
3881
3464
  super(options);
3882
3465