@refinitiv-ui/efx-grid 6.0.1 → 6.0.2
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/lib/column-selection-dialog/lib/column-selection-dialog.js +80 -18
- package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +1 -1
- package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +1 -1
- package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +1 -1
- package/lib/core/dist/core.css +1 -1
- package/lib/core/dist/core.js +12961 -10749
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/data/DataView.d.ts +22 -7
- package/lib/core/es6/data/DataView.js +176 -49
- package/lib/core/es6/data/WrappedView.d.ts +289 -0
- package/lib/core/es6/data/WrappedView.js +1319 -0
- package/lib/core/es6/grid/Core.d.ts +13 -0
- package/lib/core/es6/grid/Core.js +393 -155
- package/lib/core/es6/grid/ILayoutGrid.d.ts +8 -0
- package/lib/core/es6/grid/ILayoutGrid.js +45 -2
- package/lib/core/es6/grid/LayoutGrid.d.ts +10 -1
- package/lib/core/es6/grid/LayoutGrid.js +257 -82
- package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +10 -1
- package/lib/core/es6/grid/VirtualizedLayoutGrid.js +314 -27
- package/lib/core/es6/grid/components/Column.js +8 -2
- package/lib/core/es6/grid/components/HScrollbar.d.ts +4 -0
- package/lib/core/es6/grid/components/HScrollbar.js +20 -4
- package/lib/core/es6/grid/util/TrackLayout.d.ts +1 -1
- package/lib/core/es6/grid/util/TrackLayout.js +2 -3
- package/lib/core/es6/tr-grid-theme.js +1 -1
- package/lib/filter-dialog/lib/filter-dialog.js +8 -6
- package/lib/grid/lib/efx-grid.d.ts +14 -7
- package/lib/grid/lib/efx-grid.js +113 -114
- package/lib/grid/themes/base.less +4 -2
- package/lib/grid/themes/halo/dark/efx-grid.js +1 -1
- package/lib/grid/themes/halo/dark/es5/all-elements.js +1 -1
- package/lib/grid/themes/halo/efx-grid.less +69 -32
- package/lib/grid/themes/halo/light/efx-grid.js +1 -1
- package/lib/grid/themes/halo/light/es5/all-elements.js +1 -1
- package/lib/grid/themes/solar/charcoal/efx-grid.js +1 -1
- package/lib/grid/themes/solar/charcoal/es5/all-elements.js +1 -1
- package/lib/grid/themes/solar/pearl/efx-grid.js +1 -1
- package/lib/grid/themes/solar/pearl/es5/all-elements.js +1 -1
- package/lib/row-segmenting/es6/RowSegmenting.d.ts +1 -0
- package/lib/row-segmenting/es6/RowSegmenting.js +40 -11
- package/lib/rt-grid/dist/rt-grid.js +10290 -7864
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/ColumnDefinition.d.ts +4 -1
- package/lib/rt-grid/es6/ColumnDefinition.js +3 -0
- package/lib/rt-grid/es6/Grid.d.ts +14 -7
- package/lib/rt-grid/es6/Grid.js +241 -74
- package/lib/rt-grid/es6/RowDefinition.d.ts +4 -1
- package/lib/rt-grid/es6/RowDefinition.js +52 -2
- package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +1 -1
- package/lib/tr-grid-cell-selection/es6/CellSelection.js +53 -40
- package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +2 -0
- package/lib/tr-grid-checkbox/es6/Checkbox.js +29 -14
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +1 -0
- package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +10 -0
- package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +5 -1
- package/lib/tr-grid-column-selection/es6/ColumnSelection.js +226 -4
- package/lib/tr-grid-column-stack/es6/ColumnStack.js +3 -0
- package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +1 -0
- package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +4 -2
- package/lib/tr-grid-filter-input/es6/FilterInput.js +73 -10
- package/lib/tr-grid-row-dragging/es6/RowDragging.js +102 -12
- package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +2 -0
- package/lib/tr-grid-row-filtering/es6/RowFiltering.js +88 -33
- package/lib/tr-grid-row-grouping/es6/RowGrouping.js +41 -31
- package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +5 -1
- package/lib/tr-grid-row-selection/es6/RowSelection.js +188 -7
- package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +2 -0
- package/lib/tr-grid-rowcoloring/es6/RowColoring.js +36 -0
- package/lib/tr-grid-util/es6/CellPainter.d.ts +8 -8
- package/lib/tr-grid-util/es6/Conflator.d.ts +2 -2
- package/lib/tr-grid-util/es6/CoralItems.d.ts +1 -1
- package/lib/tr-grid-util/es6/DateTime.d.ts +4 -4
- package/lib/tr-grid-util/es6/Delay.d.ts +1 -1
- package/lib/tr-grid-util/es6/Dom.d.ts +4 -4
- package/lib/tr-grid-util/es6/ElementWrapper.d.ts +1 -1
- package/lib/tr-grid-util/es6/ElfDate.d.ts +3 -3
- package/lib/tr-grid-util/es6/ElfUtil.d.ts +4 -4
- package/lib/tr-grid-util/es6/EventDispatcher.d.ts +1 -1
- package/lib/tr-grid-util/es6/FieldFormatter.d.ts +1 -1
- package/lib/tr-grid-util/es6/FilterBuilder.d.ts +5 -5
- package/lib/tr-grid-util/es6/GridPlugin.d.ts +3 -3
- package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +1 -1
- package/lib/tr-grid-util/es6/MultiTableManager.d.ts +2 -2
- package/lib/tr-grid-util/es6/PercentBar.d.ts +1 -1
- package/lib/tr-grid-util/es6/Perf.d.ts +4 -4
- package/lib/tr-grid-util/es6/Popup.d.ts +2 -2
- package/lib/tr-grid-util/es6/RequestQueue.d.ts +1 -1
- package/lib/tr-grid-util/es6/RowPainter.d.ts +3 -0
- package/lib/tr-grid-util/es6/RowPainter.js +66 -12
- package/lib/tr-grid-util/es6/SubTable.d.ts +9 -9
- package/lib/tr-grid-util/es6/Table.d.ts +13 -13
- package/lib/tr-grid-util/es6/TextHighlighter.d.ts +3 -3
- package/lib/tr-grid-util/es6/TickCodes.d.ts +2 -2
- package/lib/tr-grid-util/es6/TouchProxy.d.ts +1 -1
- package/lib/tr-grid-util/es6/Util.d.ts +6 -6
- package/lib/tr-grid-util/es6/formula/Engine.d.ts +5 -5
- package/lib/tr-grid-util/es6/formula/Formula.d.ts +3 -3
- package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +2 -2
- package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +4 -4
- package/lib/tr-grid-util/es6/jet/MockArchive.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/MockJET.d.ts +4 -4
- package/lib/tr-grid-util/es6/jet/MockQuotes.d.ts +11 -11
- package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +7 -7
- package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +1 -1
- package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +1 -1
- package/lib/types/es6/CellSelection.d.ts +1 -1
- package/lib/types/es6/Checkbox.d.ts +2 -0
- package/lib/types/es6/ColumnGrouping.d.ts +1 -0
- package/lib/types/es6/ColumnSelection.d.ts +5 -1
- package/lib/types/es6/Core/data/DataView.d.ts +22 -7
- package/lib/types/es6/Core/data/WrappedView.d.ts +289 -0
- package/lib/types/es6/Core/grid/Core.d.ts +13 -0
- package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +8 -0
- package/lib/types/es6/Core/grid/LayoutGrid.d.ts +10 -1
- package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +10 -1
- package/lib/types/es6/Core/grid/components/HScrollbar.d.ts +4 -0
- package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +1 -1
- package/lib/types/es6/FilterInput.d.ts +4 -2
- package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +4 -1
- package/lib/types/es6/RealtimeGrid/Grid.d.ts +15 -8
- package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +4 -1
- package/lib/types/es6/RowColoring.d.ts +2 -0
- package/lib/types/es6/RowFiltering.d.ts +2 -0
- package/lib/types/es6/RowSegmenting.d.ts +1 -0
- package/lib/types/es6/RowSelection.d.ts +5 -1
- package/lib/types/es6/Zoom.d.ts +2 -1
- package/lib/types/es6/index.d.ts +2 -0
- package/lib/versions.json +17 -17
- package/lib/zoom/es6/Zoom.d.ts +2 -1
- package/lib/zoom/es6/Zoom.js +11 -4
- package/package.json +7 -7
@@ -1 +1 @@
|
|
1
|
-
(()=>{"use strict";var t,e={};e.isIE=e.isIE||(t=window.navigator.userAgent).indexOf("MSIE ")>0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0,e.isTouchDevice=e.isTouchDevice||!!(navigator.maxTouchPoints&&navigator.maxTouchPoints<256||navigator.msMaxTouchPoints&&navigator.msMaxTouchPoints<256),e.getElement=function(t){return e.isElement(t)?t:t&&e.isFunction(t.getElement)?t.getElement():null},e.isElement=function(t){return!!t&&1===t.nodeType},e.isEmpty=function(t,i){return null==t||void 0===t||!i&&""===t||e.isArray(t)&&0===t.length},e.isNumber=function(t){return"number"==typeof t&&isFinite(t)},e.isString=function(t){return"string"==typeof t},e.isArray=Array.isArray,e.isFunction=function(t){return"function"==typeof t},e.getClientPosition=function(t,e){var i=e||{};if(t.getBoundingClientRect){var o=t.getBoundingClientRect();i.x=o.left,i.y=o.top}else i.x=t.clientX,i.y=t.clientY;return i},e.getRelativePosition=function(t,i,o){o=e.getClientPosition(t,o);var n=e.getClientPosition(i);return o.x-=n.x,o.y-=n.y,o},e.moveArrayItem=function(t,e,i){if(!t)return null;var o=t.length;if(e>=o&&i>=o)return t;var n=t.splice(e,1)[0];return i<o?t.splice(i,0,n):t[i]=n,t},e.insertArrayItem=function(t,e,i){t&&(e<0||(e<t.length?t.splice(e,0,i):t[e]=i))},e.removeArrayItem=function(t,e){return t&&e>=0&&e<t.length?t.splice(e,1)[0]:null},e.pushArrayItems=function(t,e){var i=e?e.length:0;if(i>0)if(i<1e5)i>1?Array.prototype.push.apply(t,e):t.push(e[0]);else for(var o=0,n=0;o<i;)n+=1e5,Array.prototype.push.apply(t,e.slice(o,n)),o=n;return t},e.insertEmptyItems=function(t,i,o){if(o>0)if(o>1){var n=t.slice(i);t.length=i,t.length+=o,e.pushArrayItems(t,n)}else t.splice(i,0,null)},e.cycleArray=function(t,e){if(e>0&&t&&e<t.length){var i=t.splice(0,e);return t.concat(i)}return t||null},e.moveIndex=function(t,i,o){return e.isNumber(t)?t===i?e.isNumber(o)?o:-1:(null!==i&&t>i&&--t,null!==o&&t>=o&&++t,t):-1},e.lowerBound=function(t,i,o,n,r){(null==o||o<0)&&(o=0),(null==n||n<0||n>t.length)&&(n=t.length),o>n&&(o=n),null==r&&(r=e._defaultLessComparator);for(var s=0;n>o;)r(t[s=o+n>>1],i)?o=s+1:n=s;return o},e.upperBound=function(t,i,o,n,r){for(var s=e.lowerBound(t,i,o,n,r);t[s]===i;)++s;return s},e.stringFormat=function(t){var e=Array.prototype.slice.call(arguments,1);return t.replace(/{(\d+)}/g,(function(t,i){return null!=e[i]?e[i]:t}))},e._defaultLessComparator=function(t,e){return t<e},e._numericSorter=function(t,e){return t-e},e._preventDefault=function(t){t.preventDefault(),t.stopPropagation()},e._deprecatedFunction=function(){console.warn("Calling deprecated method")},e.calculatePercent=function(t,e,i){if(!t&&0!==t||!e&&0!==e||!i&&0!==i)return NaN;if(i===t)return 50;var o=(e-t)/(i-t);return o<0?0:o>1?100:100*o},e.closestElement=function(t,e){for(var i=t;i&&i.classList;){if(i.classList.contains(e))return i;i=i.parentNode}return null},e.isMobile=e.isMobile||/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);const i=e;var o=function(t){this.dispatch=this.dispatch.bind(this),this._listeners=[],this.setSender(t)};o.prototype.listen=function(t,e){if(t&&i.isFunction(t)&&this._listeners.indexOf(t)<0)if(null==e)this._listeners.push(t);else{t._priority=e;var n=i.lowerBound(this._listeners,t,0,this._listeners.length,o.listenerComparer);this._listeners.splice(n,0,t)}},o.prototype.unlisten=function(t){if(t){var e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}},o.prototype.unlistenAll=function(){this._listeners.length=0},o.prototype.getListenerCount=function(){return this._listeners.length},o.prototype.hasListener=function(){return this._listeners.length>0},o.prototype.dispatch=function(t){if(this._enabled&&!(this._listeners.length<=0)){this._dispatching&&window.console.log("WARNING: There is an error in one of your binding methods."),this._dispatching=!0,null==t&&(t={}),null!==this._sender&&(t.sender=this._sender),null!==this._extender&&this._extender(t);for(var e=0;e<this._listeners.length;e++)this._listeners[e](t);this._dispatching=!1}},o.prototype.isDispatching=function(){return this._dispatching},o.prototype.isEnabled=function(){return this._enabled},o.prototype.enable=function(t){this._enabled=!1!==t},o.prototype.disable=function(t){this._enabled=!1===t},o.prototype.setSender=function(t){this._sender=t||null},o.prototype.setEventArgExtender=function(t){this._extender=null!=t?t:null},o.listenerComparer=function(t,e){return null==e._priority||t._priority>=e._priority},o.prototype._listeners=null,o.prototype._sender=null,o.prototype._extender=null,o.prototype._enabled=!0,o.prototype._dispatching=!1,o._proto=o.prototype;const n=o;var r=function(){};r.prototype._customEvents=null,r.prototype.listen=function(t,e,i){this._customEvents&&this._customEvents[t]&&this._customEvents[t].listen(e,i)},r.prototype.unlisten=function(t,e){this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlisten(e)},r.prototype.unlistenAll=function(t){if(t)this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(var e in this._customEvents)this._customEvents[e].unlistenAll()},r.prototype._addEvent=function(t){t&&(this._customEvents||(this._customEvents={}),this._customEvents[t]||(this._customEvents[t]=new n(this)))},r.prototype._addEvents=function(t){for(var e=Array.isArray(t)?t:arguments,i=e.length,o=0;o<i;++o)this._addEvent(e[o])},r.prototype._isEventDispatching=function(t){var e=this._customEvents[t];return!!e&&e.isDispatching()},r.prototype._disableEvent=function(t,e){var i=this._customEvents[t];i&&i.disable(e)},r.prototype._hasListener=function(t){return!(!this._customEvents||!this._customEvents[t])&&this._customEvents[t].hasListener()},r.prototype._dispatch=function(t,e){this._customEvents[t].dispatch(e)},r._proto=r.prototype;const s=r;var l={_isElfv3:!1,setElfv3:function(){l._isElfv3=!0},isElfv3:function(){return l._isElfv3},createIcon:function(t){var e;return l._isElfv3?(e=document.createElement("ef-icon")).setAttribute("icon",t):(e=document.createElement("span")).classList.add("icon-"+t),e},createIconButton:function(t){var e;return l._isElfv3?(e=document.createElement("ef-button")).setAttribute("icon",t):(e=document.createElement("button")).classList.add("icon-"+t),e},createRangeBar:function(){var t,e=document.createElement("div");return l._isElfv3?(e.className="tr-range-bar-wrapper",(t=document.createElement("sapphire-led-gauge")).setAttribute("neutral-color",""),t.setAttribute("top-value","0.00")):(e.className="tr-range-bar-scale",(t=document.createElement("div")).className="tr-range-bar-slider"),t.classList.add("tr-range-slider"),e.appendChild(t),e._calculateScaleParams=function(t,e,o){var n,r=null;return t===o?{sliderValue:n=e===o?0:e>o?100:-100,rangeValue:"[-100,100]"}:t===e?{sliderValue:-100,rangeValue:r}:e===o?{sliderValue:100,rangeValue:r}:t>o?(e>t?(n=-100,r="[-100,"+(2*i.calculatePercent(o,e-t,t)-100)+"]"):e<o?(n=100,r="["+(2*i.calculatePercent(o,t-e,t)-100)+",100]"):n=2*i.calculatePercent(o,e,t)-100,{sliderValue:n,rangeValue:r}):e>o?{sliderValue:100,rangeValue:"["+(2*i.calculatePercent(t,2*o-e,o)-100)+",100]"}:e<t?{sliderValue:-100,rangeValue:"[-100,"+(2*i.calculatePercent(t,2*t-e,o)-100)+"]"}:{sliderValue:2*i.calculatePercent(t,e,o)-100,rangeValue:r}},e._getSliderInstance=function(){return t},e.updateScale=function(t,i,o,n){var r,s=e._getSliderInstance();l._isElfv3?(r=e._calculateScaleParams(i,o,n),s.setAttribute("top-value",r.sliderValue.toString()),r.rangeValue?s.setAttribute("range",r.rangeValue):s.removeAttribute("range")):s.style.left=t+"%"},e.setSliderWidth=function(t){var i=t>0?t:1;l._isElfv3||(e.style.width="calc(100% - "+i+"px)",e._getSliderInstance().style.width=i+"px")},e}};const a=l;const h={inherits:function(t,e){function i(){}i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t,t.base=function(t,i,o){i||(i="constructor");for(var n=arguments.length,r=new Array(n),s=2;s<n;s++)r[s-2]=arguments[s];return e.prototype[i].apply(t,r)}}};var u=function(t){this._element=t||document.createElement("div")};h.inherits(u,s),u.prototype._element=null,u.prototype._content=null,u.prototype._textSpan=null,u.prototype._nativeEvents=null,u._passiveEvents=null,u.prototype.getContent=function(t){return t?this._element.children:this._element.lastChild},u.prototype.setContent=function(t,e){if(null==t||t!=t?t=null:1!==t.nodeType&&11!==t.nodeType&&(null==t.getElement?(i.isString(t)||(t+=""),null==this._textSpan&&(this._textSpan=document.createElement("span")),this._textSpan.textContent=t,t=this._textSpan):t=t.getElement()),t!==this._content){for(this._content=t;null!==this._element.firstChild;)this._element.removeChild(this._element.firstChild);null!==this._content&&this._element.appendChild(this._content)}return e&&t&&t.setAttribute("title",e),this._content},u.prototype.addContent=function(t){return null==(t=i.getElement(t))?null:(this._content=this._element.children,this._element.appendChild(t),t)},u.prototype.removeContent=function(t){return null!=(t=i.getElement(t))&&(this._content=this._element.children,this._element.removeChild(t),!0)},u.prototype.listen=function(t,e,i){if(this._customEvents&&this._customEvents[t])this._customEvents[t].listen(e,i);else{this._nativeEvents||(this._nativeEvents={});var o=this._nativeEvents[t];if(!o){if(o=new n,this._nativeEvents[t]=o,o.dispatch=o.dispatch.bind(o),!u._passiveEvents){var r=!1;try{var s=Object.defineProperty({},"passive",{get:function(){return r=!0,!1}});window.addEventListener("testPassive",null,s),window.removeEventListener("testPassive",null,s)}catch(t){}if(r){var l={passive:!0};u._passiveEvents={touchstart:l,touchmove:l}}else u._passiveEvents={}}this._element.addEventListener(t,o.dispatch,u._passiveEvents[t]||!1)}o.listen(e,i)}},u.prototype.unlisten=function(t,e){if(this._customEvents&&this._customEvents[t])this._customEvents[t].unlisten(e);else if(this._nativeEvents){var i=this._nativeEvents[t];i&&i.unlisten(e)}},u.prototype.unlistenAll=function(t){if(this._customEvents)if(t)this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(var e in this._customEvents)this._customEvents[e].unlistenAll();if(this._nativeEvents)if(t)this._nativeEvents[t]&&(this._unlistenAll(t),delete this._nativeEvents[t]);else{for(var i in this._nativeEvents)this._unlistenAll(i);this._nativeEvents=null}},u.prototype._unlistenAll=function(t){var e=this._nativeEvents[t];this._element.removeEventListener(t,e.dispatch,!1),e.unlistenAll()},u.prototype.dispose=function(){this._dispose()},u.prototype._dispose=function(){this.setParent(null),this.unlistenAll(),this._element=this._content=this._textSpan=null,this._customEvents=this._nativeEvents=null},u.prototype.setEventArgExtender=function(t,e){if(this._customEvents){var i=this._customEvents[t];i&&i.setEventArgExtender(e)}},u.prototype.getElement=function(){return this._element},u.prototype.getNextSibling=function(){return this._element.nextSibling},u.prototype.getParent=function(){return this._element.parentNode},u.prototype.setParent=function(t,e){this._setParent(t,e)},u.prototype._setParent=function(t,e){null!==(t=i.getElement(t))?e?t.insertBefore(this._element,t.firstChild):t.appendChild(this._element):null!==this._element.parentNode&&this._element.parentNode.removeChild(this._element)},u.prototype.insertBefore=function(t){this._insertBefore(t)},u.prototype._insertBefore=function(t){if(null!=(t=i.getElement(t))){var e=t.parentNode;null!=e&&e.insertBefore(this._element,t)}else this.setParent(this.getParent())},u.prototype.insertAfter=function(t){(t=i.getElement(t))?t.nextSibling?this.insertBefore(t.nextSibling):this.setParent(t.parentNode):this.setParent(this.getParent(),!0)},u.prototype.hasClass=function(t){return!!this._element&&this._element.classList.contains(t)},u.prototype.addClass=function(t){this._element&&this._element.classList.add(t)},u.prototype.removeClass=function(t){this._element&&this._element.classList.remove(t)},u.prototype.toggleClass=function(t,e){var i=this._element;i&&(null==e&&(e=!i.classList.contains(t)),e?i.classList.add(t):i.classList.remove(t))},u.prototype.enableClass=function(t,e){!1!==e?this.addClass(t):this.removeClass(t)},u.prototype.getClass=function(){return this._element.className},u.prototype.setClass=function(t){this._element.className=t},u.prototype.getAttribute=function(t){return this._element.getAttribute(t)},u.prototype.setAttribute=function(t,e){this._element.setAttribute(t,e)},u.prototype.setAttributes=function(t){for(var e in t)this._element.setAttribute(e,t[e])},u.prototype.removeAttribute=function(t){this._element.removeAttribute(t)},u.prototype.getStyle=function(t){return this._element.style[t]},u.prototype.setStyle=function(t,e){this._element.style[t]=e},u.prototype.setStyles=function(t){var e=this._element.style;for(var i in t)e[i]=t[i]},u.prototype.getId=function(){return this._element.id},u.prototype.setId=function(t){this._element.id=t},u.prototype.toString=function(){var t=this._element.outerHTML;return t.replace(this._element.innerHTML,"")},u.prototype.getTextContent=function(){return this._element.textContent},u.prototype.setTextContent=function(t){this._element.textContent=t},u.prototype.getLeft=function(){return this._element.offsetLeft},u.prototype.setLeft=function(t){return this._element.style.left=t+"px",!0},u.prototype.getTop=function(){return this._element.offsetTop},u.prototype.setTop=function(t){return this._element.style.top=t+"px",!0},u.prototype.getWidth=function(){return this._element.offsetWidth},u.prototype.setWidth=function(t){return this._element.style.width=t+"px",!0},u.prototype.getHeight=function(){return this._element.offsetHeight},u.prototype.setHeight=function(t){return t<0&&(t=0),this._element.style.height=t+"px",!0},u.prototype.getBoundingClientRect=function(){return this._element.getBoundingClientRect()},u.prototype.fillParentWidth=function(t){return null==t&&(t=100),this._element.style.width=t+"%",!0},u.prototype.fillParentHeight=function(t){return null==t&&(t=100),this._element.style.height=t+"%",!0},u.prototype.getTooltip=function(){return this.getAttribute("title")},u.prototype.setTooltip=function(t){t?this.setAttribute("title",t):this.removeAttribute("title")},u.prototype.show=function(t){this._element.style.display=!1!==t?"":"none"},u.prototype.hide=function(t){this.show(!1===t)},u.prototype.isVisible=function(){return"none"!==this._element.style.display},u.prototype.enable=function(t){(t=!1!==t)?this.removeAttribute("disabled"):(this.setAttribute("disabled","disabled"),this._element.disabled=!t)},u.prototype.disable=function(t){this.enable(!1===t)},u.prototype.isEnabled=function(){return!this._element.hasAttribute("disabled")},u.prototype.getScrollLeft=function(){return this._element.scrollLeft},u.prototype.getScrollTop=function(){return this._element.scrollTop},u.prototype.isEndOfHorizontalScroll=function(){return this._element.scrollLeft>=this._element.scrollWidth-this.getWidth()},u.prototype.isEndOfVerticalScroll=function(){return this._element.scrollTop>=this._element.scrollHeight-this.getHeight()},u._proto=u.prototype;const p=u;var _=function(){this._items=[],this._element=null};h.inherits(_,p),_.prototype._items=[],_.prototype.hasItem=function(){return!!this._items.length},_.prototype.insertItem=function(t,e){var i=this._items;i.indexOf(t)>-1||(i.push(t),e&&(t._order=e),i.length&&i.sort(_._iconComparer),this._updatePanelItems())},_.prototype.removeItem=function(t){var e=this._items,i=-1;if(t)for(var o=e.length;--o>=0;){var n=e[o];if("string"==typeof t){if(n.classList.contains(t)){i=o;break}}else if(n===t){i=o;break}}else i=e.length-1;var r=null;return i>-1&&(r=e.splice(i,1)[0]),this._updatePanelItems(),r},_.prototype.clearItems=function(){var t=this._items;t.length&&(t.length=0,this._updatePanelItems())},_._iconComparer=function(t,e){return t._order?e._order?t._order-e._order:1:e._order?-1:0},_.prototype._updatePanelItems=function(){var t=this._items,e=this._element;if(t.length){for(this._element||(e=this._element=document.createElement("div"));e.lastChild;)e.removeChild(e.lastChild);for(var i=0;i<t.length;i++)e.appendChild(t[i])}};const c=_;var d=function(t,e){this._onFocus=this._onFocus.bind(this),this._id=d._runningId++,this._element=document.createElement("div"),this._element.className="cell",e&&(this._section=e)};h.inherits(d,p),d.prototype._aligner=null,d._runningId=0,d.prototype._id=0,d.prototype._width=-1,d.prototype._height=-1,d.prototype._visible=!0,d.prototype._rawContent,d.prototype._section=null,d.prototype._contentLocked=!1,d.prototype._collapsedState=0,d.prototype._floatingPanel=null,d.prototype._frontIcon=null,d.prototype.getContent=function(t){return t&&this._element?this._element.children:this._content||null},d.prototype.setContent=function(t,e){if(this._contentLocked)return null;if(null==t||t!=t?t=null:1!==t.nodeType&&11!==t.nodeType&&(null==t.getElement?"string"!=typeof t&&(t+=""):t=t.getElement()),this._aligner){var i=this._aligner.firstChild;i!==this._content&&(this._rawContent=i,this._content=i)}var o=this._setRawContent(t);return null!=e&&this._content&&this._content.setAttribute("title",e),o},d.prototype.setTextContent=function(t){null==t&&(t=""),this._rawContent!==t&&("string"==typeof this._rawContent?(this._rawContent=t,this._textSpan.textContent=t):null!=this._rawContent||this._textSpan?this.setContent(t):(this.initialize(),this._rawContent=t,this._textSpan=document.createElement("span"),this._textSpan.className="text",this._textSpan.textContent=t,this._content=this._textSpan,this._aligner.className="valigner",this._aligner.appendChild(this._textSpan)))},d.prototype.dispose=function(){this.removeParent(),this.unlistenAll(),this._element=this._section=this._aligner=null,this._textSpan=this._rawContent=this._content=null,this._frontIcon=this._floatingPanel=null},d.prototype.getNextSibling=function(){return null!==this._element?this._element.nextSibling:null},d.prototype.getParent=function(){return null!==this._element?this._element.parentNode:null},d.prototype.setParent=function(t,e){var o=i.getElement(t);if(o){if(this.initialize(),1===this._collapsedState)return;var n;!0===e&&(n=o.firstChild),n?o.insertBefore(this._element,n):o.appendChild(this._element)}else this.removeParent()},d.prototype.removeParent=function(){var t=this._element;t&&t.parentNode&&t.parentNode.removeChild(t)},d.prototype.insertBefore=function(t){var e=i.getElement(t);if(null!=e){var o=e.parentNode;null!=o&&(this.initialize(),o.insertBefore(this._element,e))}else this.setParent(this.getParent())},d.prototype.getTextContent=function(){return this._rawContent?"string"==typeof this._rawContent?this._rawContent:this._rawContent.textContent:""},d.prototype.getTextElement=function(){return this._textSpan},d.prototype.getWidth=function(){return this._width>=0?this._width:this._element.offsetWidth},d.prototype.setWidth=function(t){return t<0&&(t=-1),this._width!==t&&(this._width=t,this._element.style.width=t>=0?t+"px":"",this._updateDisplay(),!0)},d.prototype.getHeight=function(){return this._height>=0?this._height:this._element.offsetHeight},d.prototype.setHeight=function(t){return t<0&&(t=-1),this._height!==t&&(this._height=t,this._element.style.height=t>=0?t+"px":"",this._updateDisplay(),!0)},d.prototype.fillParentWidth=function(t){return!1},d.prototype.fillParentHeight=function(t){return!1},d.prototype.show=function(t){var e=!1!==t;e!==this._visible&&(this._visible=e,this._updateDisplay())},d.prototype.isVisible=function(){return this._visible},d.prototype.getScrollLeft=function(){return 0},d.prototype.getScrollTop=function(){return 0},d.prototype.isEndOfHorizontalScroll=function(){return!0},d.prototype.isEndOfVerticalScroll=function(){return!0},d.prototype.hasElement=function(){return null!==this._element},d.prototype.getSection=function(){return this._section},d.prototype.initialize=function(){return null==this._aligner&&(i.isIE?this._aligner=document.createElement("div"):(this._aligner=document.createElement("button"),this._aligner.addEventListener("focus",this._onFocus)),this._aligner.className="valigner",this._frontIcon&&this._element.appendChild(this._frontIcon.getElement()),this._element.appendChild(this._aligner),this._floatingPanel&&this._element.appendChild(this._floatingPanel.getElement())),this._element},d.prototype.updateIcon=function(t){if(t){var e=this._frontIcon;e&&e.clearItems(),this.insertFrontIcon(t,0)}},d.prototype.removeIcon=function(){var t=this._frontIcon;t&&(t.clearItems(),this._element.removeChild(t.getElement()),t=this._frontIcon=null)},d.prototype.isFrozen=i._deprecatedFunction,d.prototype.freezeLayout=i._deprecatedFunction,d.prototype.setAutoContentClipping=i._deprecatedFunction,d.prototype.setContentTooltip=function(t){return!(null==t||!this._content||(this._content.setAttribute("title",t),0))},d.prototype.lockContent=function(t){this._contentLocked=!1!==t},d.prototype.reset=function(){if(this._element){var t=this._element.style.width,e=this._element.style.height;this.removeAttribute("style"),t&&(this._element.style.width=t),e&&(this._element.style.height=e),this.resetClass();var i=this.blinkState;i&&(i.timerId>=0&&clearInterval(i.timerId),delete this.blinkState),delete this.trendState;var o=this.blinking;o&&(o.blinking>=0&&clearTimeout(o.blinking),o.cell=null,o.styles=null,delete this.blinking),this.removeIcon(),this.setContent(null),this._textSpan&&(this._textSpan.className="text",this._textSpan.textContent="")}},d.prototype.resetClass=function(){var t="cell";this.hasClass("spanned")&&(t+=" spanned"),this.hasClass("selected-row")&&(t+=" selected-row"),this.hasClass("highlighted-row")&&(t+=" highlighted-row"),this.setClass(t)},d.prototype.resetToInitialState=function(){this._element&&(this.setParent(null),this.unlistenAll(),this._element.className="cell",this.removeIcon(),this.setContent(null),this._contentLocked=!1,this._collapsedState=0)},d.prototype.insertFloatingIcon=function(t,e){if(t){var i=this._floatingPanel;i||(i=this._floatingPanel=new c),i.insertItem(t,e),i.addClass("floating-panel");var o=this._element;o.contains(i.getElement())||o.appendChild(i.getElement())}},d.prototype.removeFloatingIcon=function(t){var e=this._floatingPanel;if(!e)return null;var i=e.removeItem(t);return e.hasItem()||(this._element.removeChild(e.getElement()),this._floatingPanel=null),i},d.prototype.insertFrontIcon=function(t,e){if(t){var i=this._frontIcon;i||(i=this._frontIcon=new c),i.insertItem(t,e),i.addClass("front-panel");var o=this._element;o.contains(i.getElement())||o.insertBefore(i.getElement(),o.firstChild)}},d.prototype.removeFrontIcon=function(t){var e=this._frontIcon;if(!e)return null;var i=e.removeItem(t);return e.hasItem()||(i=e.getElement(),this._element.removeChild(i),this._frontIcon=null),i},d.prototype.getCellId=function(){return this._id},d.prototype.updatePadding=function(){},d.prototype.collapse=function(t,e){var i,o=!1!==t;return i=o?e?2:1:0,this._collapsedState!==i&&(o?e?this.addClass("spanned"):this.setParent(null):2===this._collapsedState&&this.removeClass("spanned"),this._collapsedState=i,!0)},d.prototype.isCollapsed=function(){return 0!==this._collapsedState},d.prototype.isKeptInDoc=function(){return 1!==this._collapsedState},d.prototype.getClientWidth=function(){return this._element?this._element.clientWidth:this.getWidth()},d.prototype.getClientHeight=function(){return this._element?this._element.clientHeight:this.getHeight()},d.prototype._setRawContent=function(t){if(this._rawContent!==t){this._rawContent=t;var e=this._rawContent;if("string"==typeof this._rawContent&&(this._textSpan||(this._textSpan=document.createElement("span"),this._textSpan.className="text"),this._textSpan.textContent=this._rawContent,e=this._textSpan),this._content!==e){this._content=e,this.initialize();for(var i=this._aligner;i.lastChild;)i.removeChild(i.lastChild);this._content&&i.appendChild(this._content)}}return this._content},d.prototype._updateDisplay=function(){var t=!1;this.isVisible()&&this._width&&this._height&&(t=!0),this._element.style.display=t?"":"none"},d.prototype._onFocus=function(t){this._section&&this._section._getContext().getElement().focus({preventScroll:!0})},d._proto=d.prototype;const g=d;var f=function(){this._ends=[],this._cols=[]};f.prototype._laneCount=0,f.prototype._defaultSize=10,f.prototype._defaultScalability=!0,f.prototype._homogeneous=!0,f.prototype._visibility=!0,f.prototype._ends,f.prototype._cols,f.prototype._bits=[1,2,4,8],f.prototype.hitTest=function(t){if(t<0)return-1;if(t>=this.getTrackSize())return~this._laneCount;var e=-1,o=0;if(this._homogeneous){var n=this._defaultSize;o=((e=Math.floor(t/n))+1)*n}else e=i.upperBound(this._ends,t),o=this._ends[e];return(e>=this._laneCount||t>=o)&&(e=~e),e},f.prototype.isAtDefaultSize=function(t){if(this._homogeneous)return!0;if(null!=t){if(!this._isAtDefaultSize(t))return!1}else{for(var e=this._cols.length;--e>=0;)if(!this._isAtDefaultSize(e))return!1;this._homogeneous=!0}return!0},f.prototype._isAtDefaultSize=function(t){var e=this._cols[t];if(e){if(e.actualSize!==this._defaultSize)return!1;if(null!=e.customSize)return!1;if(e.invisibility)return!1}return!0},f.prototype.isHomogeneous=function(){return this._homogeneous},f.prototype.isAtMinimumSize=function(t){var e=this._getMinimumScalingSize(t);return(null!=t?this.getLaneSize(t):this.getTrackSize())<=e},f.prototype.isFixedSize=function(){for(var t=0;t<this._laneCount;++t)if(this.getLaneScalability(t))return!1;return!0},f.prototype.clearLaneCustomizations=function(){this._ends.length=0,this._cols.length=0,this._homogeneous=!0},f.prototype.getLaneCount=function(){return this._laneCount},f.prototype.setLaneCount=function(t){t<0&&(t=0),t!==this._laneCount&&(this._markDirtyIndex(t),this._cols.length=t,this._laneCount=t,0===t&&(this._homogeneous=!0))},f.prototype.getDefaultLaneSize=function(){return this._defaultSize},f.prototype.setDefaultLaneSize=function(t){return t<0&&(t=0),this._defaultSize!==t&&(this._defaultSize=t,this._markDirtyIndex(0),!0)},f.prototype.getLaneDefaultSize=function(t){if(t<0||t>=this._laneCount)return-1;var e=this._newColumn(t);return e.defaultSize?e.defaultSize:-1},f.prototype.setLaneDefaultSize=function(t,e){t<0||t>=this._laneCount||e>=0&&(this._newColumn(t).defaultSize=e)},f.prototype.resetLaneToDefaultSize=function(){for(var t=!1,e=0;e<this._laneCount;++e){var i=this._cols[e];i&&(i.invisibility||(null!=i.defaultSize?(t|=this.setLaneScalability(e,!1),t|=this.setLaneSize(e,i.defaultSize)):(t|=this.setLaneScalability(e,!0),t|=this.setLaneSize(e,1))))}return!!t},f.prototype.getDefaultScalability=function(){return this._defaultScalability},f.prototype.setDefaultScalability=function(t){return this._defaultScalability!==t&&(this._defaultScalability=t,!0)},f.prototype.getTrackSize=function(){return!this._visibility||this._laneCount<=0?0:this._homogeneous?this._laneCount*this._defaultSize:(this._updateEndPoints(),this._ends[this._laneCount-1])},f.prototype.setTrackSize=function(t,e){var i=0,o=0,n=[];for(i=0;i<this._laneCount;++i){var r=this._cols[i];r?r.invisibility||(!1!==this._getLaneScalability(r)?n.push(i):o+=this._getFixedSize(r)):n.push(i)}if(n.length<=0)return null;var s=this._distributeLaneSize(t-o-e,n),l=!1,a=[];for(i=s.length;--i>=0;){a[i]=0;var h=s[i];if(null!=h){var u=this.getLaneSize(i);this._newColumn(i),this._setCalculatedLaneSize(i,h)&&(a[i]=h-u,l=!0)}}return l?a:null},f.prototype.getLaneStart=function(t){if(t<=0)return 0;if(this._homogeneous)return t*this._defaultSize;this._updateEndPoints();var e=t-this._laneCount,i=0;return e>0&&(t-=e,i=e*this._defaultSize),this._ends[t-1]+i},f.prototype.getLaneEnd=function(t){return this._laneCount<=0?NaN:(t<0?t=0:t>=this._laneCount&&(t=this._laneCount-1),this._homogeneous?(t+1)*this._defaultSize:(this._updateEndPoints(),this._ends[t]))},f.prototype.getLaneSize=function(t){if(this._visibility){var e=this._cols[t];return e?e.actualSize:this._defaultSize}return 0},f.prototype.getCustomLaneSize=function(t){var e=this._cols[t];return e&&null!=e.customSize?e.customSize:this._defaultSize},f.prototype.setLaneSize=function(t,e){if(t<0||t>=this._laneCount)return!1;if(e<0||e!=e)return!1;var i=this._cols[t];return(null==i||i.customSize!==e)&&((i=this._newColumn(t)).customSize=e,this._setCalculatedLaneSize(t,e))},f.prototype.getMinimumLaneSize=function(t){var e=this._cols[t];return e&&null!=e.minSize?e.minSize:0},f.prototype.setMinimumLaneSize=function(t,e,i){if(t<0||t>=this._laneCount)return!1;if(e<0&&(e=0),this.getMinimumLaneSize(t)!==e){var o=this._newColumn(t);return o.minSize=e,i&&this.getLaneScalability(t)&&(o.customSize=e),this._setCalculatedLaneSize(t)}return!1},f.prototype.isLaneVisible=function(t){var e=this._cols[t];return!e||!e.invisibility},f.prototype.showLane=function(t,e){return this.hideLane(t,!1===e)},f.prototype.hideLane=function(t,e,i){if(t<0||t>=this._laneCount)return!1;var o=this._newColumn(t),n=!o.invisibility,r=null!=i?this._bits[i]:1;return!1!==e?o.invisibility|=r:o.invisibility&=~r,n!==!o.invisibility&&this._setCalculatedLaneSize(t)},f.prototype.show=function(t){if(t=!1!==t,this._visibility!==t)if(this._visibility=t,t)for(var e=0;e<this._laneCount;++e)this._newColumn(e),this._setCalculatedLaneSize(e);else this._markDirtyIndex(0)},f.prototype.getLaneScalability=function(t){var e=this._cols[t];return e&&null!=e.scalability?e.scalability:this._defaultScalability},f.prototype.setLaneScalability=function(t,e){if(t<0||t>=this._laneCount)return!1;var i=this._cols[t];return!(i&&i.scalability===e||((i=this._newColumn(t)).scalability=e,0))},f.prototype.removeLaneAt=function(t,e){if(null==e&&(e=1),t<0)return null;if(t+e>this._laneCount&&(e=this._laneCount-t),e<1)return null;this._markDirtyIndex(t);var i=this.serializeLane(t);return this._cols.splice(t,e),this._laneCount-=e,i},f.prototype.insertLane=function(t,e){t<0&&(t=0);var o=1;if(i.isNumber(e)){if(e<=0)return;o=e,e=null}if(t>=this._laneCount&&(t=this._laneCount,!e))this.setLaneCount(this._laneCount+o);else if(this._laneCount+=o,this._markDirtyIndex(t),i.insertEmptyItems(this._cols,t,o),e)for(var n=t+o,r=t;r<n;++r)this.deserializeLane(r,e)},f.prototype.moveLane=function(t,e){if(t<0?t=0:t>this._laneCount&&(t=this._laneCount),e<0?e=0:e>this._laneCount&&(e=this._laneCount),t!==e){var o=t<e?t:e;this._markDirtyIndex(o),i.moveArrayItem(this._cols,t,e)}},f.prototype.serializeLane=function(t){if(t<0||t>=this._laneCount)return null;var e={};e.index=t;var i=this._cols[t];return i?(e.size=i.customSize,e.minSize=i.minSize,e.visible=!i.invisibility,e.scalable=i.scalability,e):e},f.prototype.deserializeLane=function(t,e){if(e&&!(t<0||t>=this._laneCount)){var i=e.size;null!=i&&this.setLaneSize(t,i),null!=(i=e.minSize)&&this.setMinimumLaneSize(t,i),null!=(i=e.visible)&&this.showLane(t,i),null!=(i=e.scalable)&&this.setLaneScalability(t,i)}},f.prototype._updateEndPoints=function(){var t=this._ends.length;if(!(t>=this._laneCount)){this._ends.length=this._laneCount;var e=0,i=t>0?this._ends[t-1]:0;for(e=t;e<this._laneCount;++e)i+=this.getLaneSize(e),this._ends[e]=i}},f.prototype._setCalculatedLaneSize=function(t,e){var i=this._cols[t];if(this._visibility&&!i.invisibility){if(null==e&&(e=null!=i.customSize?i.customSize:this._defaultSize),!i.scalability){var o=null!=i.minSize?i.minSize:0;e<o&&(e=o)}}else e=0;return i.actualSize!==e&&(i.actualSize=e,this._homogeneous=!1,this._markDirtyIndex(t),!0)},f.prototype._getMinimumScalingSize=function(t){var e=0;if(null!=t){var i=this._cols[t];if(!i.invisibility&&null!=i.minSize)return!1===this._getLaneScalability(i)&&null!=i.customSize&&i.customSize>i.minSize?i.customSize:i.minSize}else for(var o=this._laneCount;--o>=0;)e+=this._getMinimumScalingSize(o);return e},f.prototype._getFixedSize=function(t){return null!=t.customSize?null!=t.minSize?t.customSize>t.minSize?t.customSize:t.minSize:t.customSize:null!=t.minSize?t.minSize:this._defaultSize},f.prototype._getLaneScalability=function(t){return null==t.scalability?this._defaultScalability:t.scalability},f.prototype._distributeLaneSize=function(t,e){if(e.length<=0)return[];t<0&&(t=0);var i=0,o=0,n=0,r=0,s=[],l=[],a=[];for(i=e.length;--i>=0;)s[n=e[i]]=this.getMinimumLaneSize(n),l[n]=this.getCustomLaneSize(n),o+=l[n];for(var h=!0;h;)for(h=!1,i=e.length;--i>=0;){var u=s[n=e[i]],p=l[n];(r=t*p/o)<=u&&(h=!0,a[n]=u,t-=u,o-=p,e.splice(i,1))}var _=e.length-1,c=0,d=0;for(i=_;--i>=0;){r=t*l[n=e[i]]/o;var g=Math.floor(r);(d+=r-g)>=1&&(++g,--d),a[n]=g,c+=g}return a[e[_]]=Math.floor(t-c),a},f.prototype._markDirtyIndex=function(t){t<this._ends.length&&(this._ends.length=t)},f.prototype._newColumn=function(t){var e=this._cols[t];return e||(this._cols[t]=e={},e.invisibility=0),e},f.prototype.copyFrom=function(t,e){if(!this._homogeneous||!t._homogeneous||this._defaultSize!==t._defaultSize){e||(e=0);var i=t.getLaneCount(),o=this.getLaneCount(),n=e+i;n>o&&(n=o);for(var r=0,s=e;s<n;++s){var l=t.getLaneSize(r++),a=this._newColumn(s);a.customSize!==l&&(a.customSize=l,a.actualSize!==l&&(a.actualSize=l,this._homogeneous=!1,this._markDirtyIndex(s)))}}};const y=f;var m=function(){};m.prototype.hitTest=function(t,e,i){},m.prototype.hitTestX=function(t){},m.prototype.hitTestY=function(t){},m.prototype.getDefaultColumnWidth=function(){},m.prototype.setDefaultColumnWidth=function(t){},m.prototype.getDefaultRowHeight=function(){},m.prototype.setDefaultRowHeight=function(t){},m.prototype.getColumnWidth=function(t){},m.prototype.setColumnWidth=function(t,e){},m.prototype.getRowHeight=function(t){},m.prototype.setRowHeight=function(t,e){},m.prototype.isColumnVisible=function(t){},m.prototype.hideColumn=function(t,e){},m.prototype.isRowVisible=function(t){},m.prototype.hideRow=function(t,e){},m.prototype.getMinimumColumnWidth=function(t){},m.prototype.setMinimumColumnWidth=function(t,e){},m.prototype.getMinimumRowHeight=function(t){},m.prototype.setMinimumRowHeight=function(t,e){},m.prototype.getCellLeft=function(t){},m.prototype.getCellTop=function(t){},m.prototype.getCellWidth=function(t,e){},m.prototype.getCellHeight=function(t,e){},m.prototype.hasCellSpan=function(){},m.prototype.getCellRowSpan=function(t,e){},m.prototype.setCellRowSpan=function(t,e,i){},m.prototype.getCellColSpan=function(t,e){},m.prototype.setCellColSpan=function(t,e,i){},m.prototype.clearCellSpans=function(){},m.prototype.clearColumnSpans=function(t){},m.prototype.clearColumnCustomizations=function(){},m.prototype.clearRowCustomizations=function(){},m.prototype.getColumnScalability=function(t){},m.prototype.setColumnScalability=function(t,e){},m.prototype.getRowScalability=function(t){},m.prototype.setRowScalability=function(t,e){},m.prototype.getCell=function(t,e,i){},m.prototype.getCellContent=function(t,e){},m.prototype.setCellContent=function(t,e,i){},m.prototype.getColumn=function(t){},m.prototype.getColumnCount=function(){},m.prototype.setColumnCount=function(t){},m.prototype.getRowCount=function(){},m.prototype.setRowCount=function(t,e){},m.prototype.getVisibleRowCount=function(){},m.prototype.addRow=function(t){},m.prototype.removeRow=function(t){},m.prototype.setBorders=function(t,e,i,o){},m.prototype.getColumnStyle=function(t,e){},m.prototype.setColumnStyle=function(t,e,i){},m.prototype.enableColumnClass=function(t,e,i){},m.prototype.hasColumnClass=function(t,e){},m.prototype.enableRowClass=function(t,e,i){},m.prototype.setRowStyle=function(t,e,i,o){},m.prototype.getRelativePosition=function(t){},m.prototype.getContentWidth=function(){},m.prototype.getContentHeight=function(){},m.prototype.getCellsByRowIndex=function(t){},m.prototype.disableHorizontalGridLine=function(t){},m.prototype.disableVerticalGridLine=function(t){},m.prototype.enableShading=function(t){},m.prototype.setTransposedShading=function(t){},m.prototype.enableRowHighlighting=function(t){},m.prototype.getRowHighlight=function(){},m.prototype.setRowHighlight=function(t){},m.prototype.getSelectedRows=function(){},m.prototype.getSelectedRowCount=function(){},m.prototype.isSelectedRow=function(t){},m.prototype.getRowAnchor=function(){},m.prototype.setRowAnchor=function(t){},m.prototype.setSelectedRow=function(t,e){},m.prototype.selectSingleRow=function(t){},m.prototype.selectRowRange=function(t,e){},m.prototype.clearSelectedRows=function(){},m.prototype.getFirstSelectedRow=function(){},m.prototype.getLastSelectedRow=function(){},m.prototype.activateColumn=function(t,e){},m.prototype.activateRows=function(t,e,i){},m.prototype.moveRowsToTop=function(t){},m.prototype.getFirstIndexInView=function(){},m.prototype.getLastIndexInView=function(){},m.prototype.isInCurrentView=function(t){},m.prototype.getFrozenLayout=function(){},m.prototype.setFrozenLayout=function(t){},m.prototype.insertColumn=function(t,e){},m.prototype.removeColumnAt=function(t){},m.prototype.moveColumn=function(t,e){},m.prototype.enableRowVirtualization=function(t){},m.prototype.enableColumnVirtualization=function(t){},m.prototype.getColumnIndex=function(t){},m.prototype.getCellIndex=function(t,e){},m.prototype.getIndex=function(){},m.prototype.setIndex=function(t){},m.prototype.getRowOffset=function(){},m.prototype.setRowOffset=function(t){},m.prototype.updateLayout=function(){},m.prototype.stretchCell=function(t,e,i,o){},m.prototype.unstretchCell=function(t,e){},m.prototype.unstretchAllCells=function(){},m.prototype.getStretchedCell=function(t,e){},m.prototype.getStretchedCells=function(){},m.prototype.updateStretchedCells=function(){},m.prototype.getColumnHost=function(){},m.prototype.setHidingMethod=function(t){},m.prototype.getHidingMethod=function(){},m.prototype.setColumnVisibility=function(t,e,i){},m.prototype.getRowLayout=function(){},m.prototype.reserveRightSpace=function(t){},m.prototype.getReservedSpace=function(){},m.prototype.getComputedStyle=function(){},m.prototype.isColumnActive=function(t){},m.prototype.setRowAttributes=function(t,e){},m.prototype.getContextRow=function(t){};const v=m;var C=function(t){(this._element=document.createElement("div")).className="column",this._cells=[],this._section=t};h.inherits(C,p),C.prototype._nextSibling=null,C.prototype._parent=null,C.prototype._section=null,C.prototype._cells=null,C.prototype._cellStart=0,C.prototype._cellEnd=0,C.prototype._autoStyleUpdating=!1,C.prototype._deactivation=!1,C.prototype._sizeClasses=null,C.prototype._colLeft=0,C.prototype._absolute=!1,C.prototype._scrollFrame=null,C.prototype._invisibility=0,C.prototype._bits=[1,2,4,8],C.prototype._pinned=!0,C.prototype.clearContent=function(){for(var t=this._cells.length;--t>=0;)this._cells[t].setContent(null)},C.prototype.setLeft=function(t){return this._colLeft=t,this._absolute&&(this._element.style.left=t+"px"),!0},C.prototype.enableAbsolutePosition=function(t){(t=!1!==t)!==this._absolute&&(this._absolute=t,this._element.style.left=t?this._colLeft+"px":"")},C.prototype.dispose=function(){this._dispose();for(var t=this._cells.length;--t>=0;)this._cells[t].dispose();this._scrollFrame=this._nextSibling=this._parent=this._cells=this._section=null},C.prototype.setStyle=function(t,e){var i=this._element;i.style[t]=e,i.style.backgroundColor?i.classList.contains("no-shading")||i.classList.add("no-shading"):i.classList.contains("no-shading")&&i.classList.remove("no-shading")},C.prototype.setStyles=function(t){var e=this._element,i=e.style;for(var o in t)i[o]=t[o];e.style.backgroundColor?e.classList.contains("no-shading")||e.classList.add("no-shading"):e.classList.contains("no-shading")&&e.classList.remove("no-shading")},C.prototype.show=function(t){this.setVisibility(0,!1!==t)},C.prototype.setWidth=function(t){this._element.style.width=t+"px";var e,i=t>0&&t<=60?3-Math.floor((t-.01)/20):0;(i<0||i>3)&&(i=3);var o=this._sizeClasses;if(o){if(o.length>i){for(e=o.length;--e>=i;)this.removeClass(o[e]);o.length=i}i||(this._sizeClasses=null)}if(i)for(o||(o=[],this._sizeClasses=o),e=o.length;e<i;++e)o[e]=C._sizeClasses[e],this.addClass(o[e]);return this.setVisibility(1,t>0),!0},C._sizeClasses=["small-col","very-small-col","tiny-col"],C.prototype.setHeight=function(t){return this._element.style.height=t+"px",this.setVisibility(2,t>0),!0},C.prototype.getParent=function(){return this._parent},C.prototype.setParent=function(t,e){if(this._element){this._parent=i.getElement(t);var o=this._section?this._section.getHidingMethod():"";this._invisibility&&!o||this._setParent(this._parent,e)}},C.prototype.insertBefore=function(t){this._parent?this._scrollFrame?t&&this._parent===t.getParent()?this._insertBefore(t):this._insertBefore(this._scrollFrame):t?this._parent===t.getParent()&&this._insertBefore(t):this._setParent(this._parent):(this._insertBefore(t),this._parent=t.getParent())},C.prototype.enableAutoStyleUpdating=function(t){t=!1!==t,this._autoStyleUpdating!==t&&(this._autoStyleUpdating=t)},C.prototype.setNextSibling=function(t){this._nextSibling=t},C.prototype.isActive=function(){return!(this._invisibility&this._bits[3])},C.prototype.disableDeactivation=function(t){this._deactivation=!1!==t,this._deactivation&&(this.isActive()||this.activate())},C.prototype.activate=function(t){return t=this._pinned||this._deactivation||!1!==t,this.isActive()!==t&&(this.setVisibility(3,t),!0)},C.prototype.deactivate=function(t){this.activate(!1===t)},C.prototype.setCellCount=function(t){var e;for(e=this._cells.length;e<t;++e)this._cells.push(new g(null,this._section));for(e=this._cells.length;--e>=t;)this._cells[e].dispose();this._cells.length=t,this._cellStart>t?this._cellStart=this._cellEnd=t:this._cellEnd>t&&(this._cellEnd=t)},C.prototype.getCell=function(t){return this._cells[t]||null},C.prototype.collapseCells=function(t,e,i,o,n){if(!(e<=0)){var r=!1,s=this._cells[t];s&&!o&&(r|=s.collapse(i,n));for(var l=1;l<e&&(s=this._cells[t+l]);++l)r|=s.collapse(i,n);r&&(i?e>1&&(this._hasCollapsedCells=!0):this.updateCellOrders())}},C.prototype.uncollapseAllCells=i._deprecatedFunction,C.prototype.activateCells=function(t,e){var i,o=this._element;if(this._hasCollapsedCells)t=this._cellEnd,e>this._cellEnd&&(this._cellEnd=e);else if(this._cellStart===t){var n=this._cellEnd-e;if(n>0){for(i=this._cellEnd;--i>=e;)this._cells[i].removeParent();return void(this._cellEnd=e)}if(!(n<0))return;t=this._cellEnd,this._cellEnd=e}else{for(i=this._cellEnd;--i>=this._cellStart;)this._cells[i].removeParent();this._cellStart=t,this._cellEnd=e}for(i=t;i<e;++i){var r=this._cells[i];r.isKeptInDoc()&&(r.initialize(),o.appendChild(r.getElement()))}},C.prototype.moveCellsToTop=function(t){if(this.isActive()){for(var e=this._element,o=0;o<t;++o){var n=this._cells[o];n.isKeptInDoc()&&e.appendChild(n.getElement())}this._cells=i.cycleArray(this._cells,t)}},C.prototype.updateCellOrders=function(){this._hasCollapsedCells=!1;for(var t=this._element,e=this._cellStart;e<this._cellEnd;++e){var i=this._cells[e];i.isKeptInDoc()?t.appendChild(i.getElement()):this._hasCollapsedCells=!0}},C.prototype.hasCollapsedCells=function(){return this._hasCollapsedCells},C.prototype.getCellIndex=function(t){if(!t)return-1;for(var e=this._cellStart;e<this._cellEnd;++e)if(this._cells[e].getElement()===t)return e;return-1},C.prototype.getSection=function(){return this._section},C.prototype.log=function(){for(var t=[],e=this._cells.length,i=0;i<e;++i)t.push(this._cells[i].getTextContent());return t},C.prototype.getVisibility=function(){return!this._invisibility},C.prototype.setVisibility=function(t,e){var i=!this._invisibility,o=this._bits[t]||1;e?this._invisibility&=~o:this._invisibility|=o;var n=!this._invisibility;if(i!==n)if(this._section&&this._section.getHidingMethod())this.enableClass("hidden",!n);else if(n){var r=this._parent;if(!r)return;for(var s=this._nextSibling;s;){if(s._parent!==r){s=null;break}if(!s._invisibility)break;s=s._nextSibling}this.insertBefore(s)}else this._setParent(null)},C.prototype.updateLayout=function(){},C.prototype.setScrollState=function(t,e,i){this._scrollFrame=t,this.enableAbsolutePosition(i),this.setParent(e||this._section.getColumnHost()),e||this.activate(),this._pinned=!e},C._proto=C.prototype;const S=C;var w=function(){this._items=[]};w.prototype._items=null,w.prototype.dispose=function(){this._items=null},w.prototype.setItemCount=function(t){var e=this._items,i=e.length;if(i!==t)for(e.length=t;i<t;)e[i++]={}},w.prototype.getItem=function(t){return this._items[t]||null},w.prototype.moveItemsToTop=function(t){this._items=i.cycleArray(this._items,t)};const b=w;var R=function(t,e,i){t.setTop(e.getLaneStart(i)),t.setHeight(e.getLaneSize(i))},I=function(t,e,i,o){if(i){var n=e.getLaneStart(i);t.setLeft(n),t.setWidth(o-n)}else t.setStyle("left",""),t.setWidth(o)},x=function(t,e,i){this._trackX=t,this._trackY=e,this._section=i,this._cells=[]};x.prototype._trackX,x.prototype._trackY,x.prototype._section,x.prototype._cells,x.prototype._activeCount=0,x.prototype._stretchSize=0,x.prototype.dispose=function(){var t=this._cells;if(this._activeCount){this._activeCount=0;for(var e=t.length;--e>=0;){var i=t[e];i&&i.dispose()}}t.length=0},x.prototype.setStretchSize=function(t){this._stretchSize=t},x.prototype.getStretchSize=function(){return this._stretchSize},x.prototype.setCellCount=function(t){var e=this._cells,i=e.length;if(i<t)for(e.length=t;i<t;)e[i++]=null;else if(i>t){for(;--i>=t;){var o=e[i];o&&o.dispose()}e.length=t}},x.prototype.getCell=function(t){return this._cells[t]||null},x.prototype.getCells=function(){var t=[];if(this._activeCount){for(var e=this._cells,i=e.length,o=0;o<i;++o){var n=e[o];n&&n.getParent()&&t.push(n)}this._activeCount=t.length}return t},x.prototype.getColumnIndex=function(t){if(t){if(!t.getElement)return t._colIndex||0;var e=t.getElement();if(e)return e._colIndex||0}return-1},x.prototype.getRowIndex=function(t){if(t){if(t.getElement)return this._cells.indexOf(t);for(var e=this._cells,i=e.length,o=0;o<i;++o){var n=e[o];if(n&&n.getElement()===t)return o}}return-1},x.prototype.stretchCell=function(t,e){++this._activeCount,(!e||e<0)&&(e=0);var i=this._cells[t]||null;i||((i=new g(null,this._section)).addClass("tr-stretched"),i.stretched=!0,this._cells[t]=i);var o=i.getElement();o.stretched=!0,o._colIndex=e;var n=this._stretchSize||this._trackX.getTrackSize();return I(i,this._trackX,e,n),R(i,this._trackY,t),i},x.prototype.unstretchCell=function(t){var e=this._cells[t]||null;return e&&e.setParent(null),e},x.prototype.unstretchAllCells=function(){if(this._activeCount){this._activeCount=0;for(var t=this._cells,e=t.length;--e>=0;){var i=t[e];i&&i.setParent(null)}}},x.prototype.updateCells=function(){if(this._activeCount){for(var t=0,e=this._cells,i=e.length,o=this._trackX,n=this._trackY,r=this._stretchSize||o.getTrackSize(),s=0;s<i;++s){var l=e[s];l&&l.getParent()&&(++t,I(l,o,l.getElement()._colIndex,r),R(l,n,s))}this._activeCount=t}},x.prototype.updateXAxis=function(){if(this._activeCount){for(var t=0,e=this._cells,i=e.length,o=this._trackX,n=this._stretchSize||o.getTrackSize(),r=0;r<i;++r){var s=e[r];s&&s.getParent()&&(++t,I(s,o,s.getElement()._colIndex,n))}this._activeCount=t}},x.prototype.updateYAxis=function(){if(this._activeCount){for(var t=0,e=this._cells,i=e.length,o=this._trackY,n=0;n<i;++n){var r=e[n];r&&r.getParent()&&(++t,R(r,o,n))}this._activeCount=t}},x.prototype.moveCellsToTop=function(t){this._activeCount&&(this._cells=i.cycleArray(this._cells,t),this.updateYAxis())};const D=x;var L=function(t,e){this.indexX=t,this.indexY=e};L.prototype.isSpanIndices=function(t,e){return t===this.indexX&&e===this.indexY},L.prototype.isOccupiedIndices=function(t,e){return t!==this.indexX||e!==this.indexY},L.prototype.register=function(t,e){this._register(t,e,!0)},L.prototype.unregister=function(t,e){this._register(t,e,!1)},L.prototype._register=function(t,e,i){var o=t.indexOf(this);i?o<0&&t.push(this):o>=0&&t.splice(o,1);for(var n=i?this:null,r=this.indexX+this.colSpan,s=this.indexY+this.rowSpan,l=this.indexX;l<r;++l)for(var a=this.indexY;a<s;++a)e[l+","+a]=n},L.prototype.indexX,L.prototype.indexY,L.prototype.colSpan=1,L.prototype.rowSpan=1,L.prototype.prevColSpan=1,L.prototype.prevRowSpan=1,L.prototype.retVal=0;const A=L;var z=function(){this._spans=[],this._occupiedMap={}};z.prototype.removeColumn=function(t){var e=!1;return this.removeSpanByColIndex(t)&&(e=!0),this.shiftColumn(t,-1)&&(e=!0),e},z.prototype.shiftColumn=function(t,e){if(this._spans.length<=0||0===e)return!1;for(var i=!1,o=this._spans.length;--o>=0;){var n=this._spans[o];n.indexX>=t&&(i=!0,n.indexX+=e)}if(!i)return!1;var r=this._spans;for(this._spans=[],this._occupiedMap={},o=r.length;--o>=0;)(n=r[o]).indexX>=0&&n.register(this._spans,this._occupiedMap);return!0},z.prototype.removeSpan=function(t,e){if(this._spans.length<=0)return null;var i=t+","+e,o=this._occupiedMap[i];return!o||o.isOccupiedIndices(t,e)?null:(o.unregister(this._spans,this._occupiedMap),o)},z.prototype.removeSpanByColIndex=function(t,e){var i,o=this._spans.length;if(o<=0)return null;for(var n=e||[],r=0,s=0;s<o;++s)(i=this._spans[s])&&i.indexX===t&&(n.push(i),r++);if(r<=0)return null;for(o=n.length,s=0;s<r;++s)n[o-s-1].unregister(this._spans,this._occupiedMap);return n},z.prototype.removeSpanStartedFromRowIndex=function(t,e){var i,o=this._spans.length;if(o<=0)return null;for(var n=e||[],r=0,s=0;s<o;++s)(i=this._spans[s])&&i.indexY>=t&&(n.push(i),r++);if(r<=0)return null;for(o=n.length,s=0;s<r;++s)n[o-s-1].unregister(this._spans,this._occupiedMap);return n},z.prototype.clearAllSpans=function(){if(this._spans.length<=0)return null;var t=this._spans;return this._spans=[],this._occupiedMap={},t},z.prototype.hasSpan=function(){return this._spans.length>0},z.prototype.getSpan=function(t,e){var i=this.getOccupyingSpan(t,e);return i&&i.isSpanIndices(t,e)?i:null},z.prototype.getOccupyingSpan=function(t,e){return this._spans.length<=0?null:this._occupiedMap[t+","+e]||null},z.prototype.getAllSpans=function(){return this._spans},z.prototype.getColSpan=function(t,e){var i=this._occupiedMap[t+","+e];return null==i?1:i.isOccupiedIndices(t,e)?i.indexX-t:i.colSpan},z.prototype.getRowSpan=function(t,e){var i=this._occupiedMap[t+","+e];return null==i?1:i.isOccupiedIndices(t,e)?i.indexY-e:i.rowSpan},z.prototype.setColSpan=function(t,e,i){return this._updateSpan(t,e,!0,i)},z.prototype.setRowSpan=function(t,e,i){return this._updateSpan(t,e,!1,i)},z.prototype._updateSpan=function(t,e,i,o){o<1&&(o=1);var n=this.getSpan(t,e);n&&(n.retVal=0);var r,s,l,a,h,u,p=t,_=e,c=n?n.colSpan:1,d=n?n.rowSpan:1,g=!0;if(i){if(c===o)return n;if(c>o)p=t+o,r=t+c,g=!1;else{if((l=this._occupiedMap[t+","+e])&&l!==n)return n;p=t+c,r=t+o}s=e+d}else{if(d===o)return n;if(d>o)_=e+o,s=e+d,g=!1;else{if((l=this._occupiedMap[t+","+e])&&l!==n)return n;_=e+d,s=e+o}r=t+c}if(g){var f=[];for(h=p;h<r;++h)for(u=_;u<s;++u){if(a=h+","+u,this._occupiedMap[a])return n;f.push(a)}for(null==n&&(n=new A(t,e),a=t+","+e,this._spans.push(n),this._occupiedMap[a]=n),h=f.length;--h>=0;)this._occupiedMap[f[h]]=n}else{if(i?o+d<=2:o+c<=2){a=t+","+e;var y=this._spans.indexOf(n);this._spans.splice(y,1),this._occupiedMap[a]=null}for(h=p;h<r;++h)for(u=_;u<s;++u)this._occupiedMap[h+","+u]=null}return i?(n.prevColSpan=n.colSpan,n.colSpan=o):(n.prevRowSpan=n.rowSpan,n.rowSpan=o),n.retVal=g?1:-1,n},z.prototype._spans,z.prototype._occupiedMap;const V=z;var E=function(){this._selections=[]};E.prototype.clone=function(){var t=new E;return t._selections=this._selections.concat(),t._count=this._count,t._anchor=this._anchor,t._firstIndex=this._firstIndex,t._lastIndex=this._lastIndex,t},E.prototype.toString=function(){return this._selections.join(", ")},E.prototype.select=function(t){return!(t<0||!this._select(t)||(this._anchor=t,(this._firstIndex<0||t<this._firstIndex)&&(this._firstIndex=t),(this._lastIndex<0||t>this._lastIndex)&&(this._lastIndex=t),0))},E.prototype.deselect=function(t){return!!this._selections[t]&&(this._selections[t]=!1,--this._count,this._anchor===t&&(this._anchor=-1),this._firstIndex===t&&(this._firstIndex=this._findNextSelection(t)),this._lastIndex===t&&(this._lastIndex=this._findPrevSelection(t)),!0)},E.prototype.toggleSelection=function(t){this._selections[t]?this.deselect(t):this.select(t)},E.prototype.singularlySelect=function(t){return 1!==this._count||t<0?(this.clearAllSelections(),this.select(t),!0):this._firstIndex!==t&&(this._selections[this._anchor]=!1,this._selections[t]=!0,this._anchor=t,this._firstIndex=t,this._lastIndex=t,!0)},E.prototype.selectRange=function(t,e){if(0!==e)if(t<0&&(t=0),1!==e&&-1!==e){var i=t,o=i+e;if(e<0&&(i=(o=i+1)+e),!(i>=o)){this._anchor=t,(this._firstIndex<0||i<this._firstIndex)&&(this._firstIndex=i),(this._lastIndex<0||o>=this._lastIndex)&&(this._lastIndex=o-1);for(var n=i;n<o;++n)this._select(n)}}else this.select(t)},E.prototype.deselectRange=function(t,e){if(!(this._count<=0))if(t<0&&(t=0),1!==e&&-1!==e){var i=t+e;if(e<0&&(t=(i=t+1)+e),this._firstIndex>=t&&this._lastIndex<i)this.clearAllSelections();else{this._anchor>=t&&this._anchor<i&&(this._anchor=-1),this._firstIndex>=t&&this._firstIndex<i&&(this._firstIndex=this._findNextSelection(i-1)),this._lastIndex>=t&&this._lastIndex<i&&(this._lastIndex=this._findPrevSelection(t));var o=0;for(o=t;o<i;++o)this._selections[o]&&(this._selections[o]=!1,--this._count)}}else this.deselect(t)},E.prototype.hasSelection=function(t,e){if(this._count<=0)return!1;var i=t+e;if(e<0&&(t=(i=t+1)+e),i<this._firstIndex||t>this._lastIndex)return!1;for(var o=t;o<i;++o)if(this._selections[o])return!0;return!1},E.prototype.getSelection=function(t){return!0===this._selections[t]},E.prototype.setSelection=function(t,e){return!1!==e?this.select(t):this.deselect(t)},E.prototype.getSelectionAnchor=function(){return this._anchor},E.prototype.setSelectionAnchor=function(t){this._anchor=t},E.prototype.getSelectionCount=function(){return this._count},E.prototype.getFirstSelectedIndex=function(){return this._firstIndex},E.prototype.getLastSelectedIndex=function(){return this._lastIndex},E.prototype.getAllSelections=function(){if(this._count>0){for(var t=new Array(this._count),e=0,i=this._firstIndex;i<=this._lastIndex;++i)this._selections[i]&&(t[e++]=i);return t}return[]},E.prototype.getSelectionMap=function(){return this._selections},E.prototype.clearAllSelections=function(){return this._count>0?(this._selections.length=0,this._count=0,this._anchor=-1,this._firstIndex=-1,this._lastIndex=-1,0):0},E.prototype.copyFrom=function(t,e,i,o){if(!(o<=0)){var n=e+i;if(null!=t)if(!1!==t.hasSelection(e,o)){for(var r=0;r<o;++r)t._selections[e+r]?this.select(n+r):this.deselect(n+r);this._anchor=-1,t._anchor>=0&&t._anchor>=e&&t._anchor<e+o&&(this._anchor=t._anchor+i)}else this.deselectRange(n,o);else this.deselectRange(n,o)}},E.prototype._select=function(t){return!this._selections[t]&&(this._selections[t]=!0,++this._count,!0)},E.prototype._findNextSelection=function(t){if(this._lastIndex>=0)for(;++t<=this._lastIndex;)if(this._selections[t])return t;return-1},E.prototype._findPrevSelection=function(t){if(this._firstIndex>=0)for(;--t>=this._firstIndex;)if(this._selections[t])return t;return-1},E.prototype._selections=null,E.prototype._count=0,E.prototype._anchor=-1,E.prototype._firstIndex=-1,E.prototype._lastIndex=-1;const T=E;var M=function(t,e){var i=this;i._onMouseMove=i._onMouseMove.bind(i),i._onMouseOut=i._onMouseOut.bind(i),i._trackX=new y,i._trackY=new y,i._trackX.setDefaultLaneSize(100),i._trackY.setDefaultLaneSize(32),i._cellSpans=new V,i._element=t||document.createElement("div"),i._element.className="tr-lg tr-even-shading",i._ctxRows=new b,i._columns=[],i._cells=[],i._highlightedCells=[],i._stretchedCells=new D(i._trackX,i._trackY,i),i._selectionList=new T,e&&(i._virOwner=e.owner||null),i._addEvent("rowHighlighted"),i._addEvent("rowCountChanged"),i._addEvent("rowHeightChanged"),i._addEvent("rowAvailable")};h.inherits(M,p),M.prototype._index=-1,M.prototype._indexOffset=0,M.prototype._availableRowCount=0,M.prototype._activeRow=0,M.prototype._activeRowEnd=0,M.prototype._colCount=0,M.prototype._rowCount=0,M.prototype._hiddenRowCount=0,M.prototype._trackX,M.prototype._trackY,M.prototype._cellSpans,M.prototype._columns,M.prototype._firstColumn,M.prototype._lastColumn,M.prototype._rightSpace,M.prototype._frozenLayout=!1,M.prototype._rowHighlightEnabled=!1,M.prototype._rowHighlightIndex=-1,M.prototype._highlightedCells,M.prototype._coverLayer=null,M.prototype._stretchedCells=null,M.prototype._ctx=null,M.prototype._selectionList,M.prototype._colVir=!1,M.prototype._initialized=!1,M.prototype._hidingMethod="",M.prototype._virOwner=null,M.prototype._transformIETimer=0,M.prototype._ctxRows,M.prototype.dispose=function(){this.setRowCount(0),this.unlistenAll(),this._ctxRows.dispose(),this._stretchedCells.dispose();for(var t=this._columns.length;--t>=0;)this._columns[t].dispose();this._colCount=this._rowCount=this._activeRowEnd=this._availableRowCount=0,this._highlightedCells.length=0,this._ctx=null,this._dispose()},M.prototype.getWidth=function(){return!1===this.isVisible()?0:this.getContentWidth()},M.prototype.setWidth=function(t){if(t<0)return!1;var e=this._rightSpace?this._rightSpace.offsetWidth:0;return null!=this._trackX.setTrackSize(t,e)&&(this._syncLayoutToColumns(0),!0)},M.prototype.getHeight=function(){return this.isVisible()?this.getContentHeight():0},M.prototype.setHeight=function(t){return!(t<0||(null==this._trackY.setTrackSize(t,0)||this._syncLayoutToRows(0,this._rowCount),0))},M.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._trackY.show(t),this.setFrozenLayout(!1===t),this._dispatchRowHeightChangedEvent(0,this._rowCount)},M.prototype.hitTest=function(t,e,i){if(t<0)return null;if(e<0)return null;if(t>=this.getWidth())return null;if(e>=this.getHeight())return null;var o=this._trackX.hitTest(t);if(o<0)return null;var n=this._trackY.hitTest(e);if(n<0)return null;var r={};if(r.colIndex=o,r.rowIndex=n,!0!==i){var s=this._cellSpans.getOccupyingSpan(o,n);s&&(r.colIndex=s.indexX,r.rowIndex=s.indexY)}return r},M.prototype.hitTestX=function(t){return t<0?-1:t>=this.getWidth()?~this._colCount:this._trackX.hitTest(t)},M.prototype.hitTestY=function(t){return t<0?-1:t>=this.getHeight()?~this._rowCount:this._trackY.hitTest(t)},M.prototype.getDefaultColumnWidth=function(){return this._trackX.getDefaultLaneSize()},M.prototype.setDefaultColumnWidth=function(t){this._trackX.getDefaultLaneSize()!==t&&(this._trackX.setDefaultLaneSize(t),this._syncLayoutToColumns(0))},M.prototype.getDefaultRowHeight=function(){return this._trackY.getDefaultLaneSize()},M.prototype.setDefaultRowHeight=function(t){if(this._trackY.getDefaultLaneSize()!==t){this._trackY.setDefaultLaneSize(t);for(var e=0;e<this._colCount;++e)this._columns[e].setHeight(t);this._syncLayoutToRows(0,this._rowCount),this._dispatchRowHeightChangedEvent(0,this._rowCount)}},M.prototype.getColumnWidth=function(t){return this._trackX.getLaneSize(t)},M.prototype.setColumnWidth=function(t,e){return!!this._setColumnWidth(t,e)&&(this._syncLayoutToColumns(t),!0)},M.prototype._setColumnWidth=function(t,e){return this._trackX.setLaneSize(t,e)},M.prototype._updateColumnLayout=function(){this._syncLayoutToColumns(0)},M.prototype.getRowHeight=function(t){return this._trackY.getLaneSize(t)},M.prototype.setRowHeight=function(t,e){if(t<0||t>=this._rowCount)return!1;var i=this._trackY.setLaneSize(t,e);return this._syncLayoutToRows(t,t+1),i&&this._dispatchRowHeightChangedEvent(t,t+1),this._resetTransformIETimer(),i},M.prototype._updateRowHeights=function(t,e){for(var i=0,o=0;o<this._rowCount;++o){var n=t.getLaneSize(e);i|=this._trackY.setLaneSize(o,n),++e}return this._syncLayoutToRows(0,this._rowCount),i},M.prototype.isColumnVisible=function(t){return this._trackX.isLaneVisible(t)},M.prototype.hideColumn=function(t,e){return this.setColumnVisibility(t,!1===e,0)},M.prototype.isRowVisible=function(t){return this._trackY.isLaneVisible(t)},M.prototype.hideRow=function(t,e){return!!this._trackY.hideLane(t,e)&&(null!=e&&!e||this.isRowVisible(t)?this.isRowVisible(t)&&this._hiddenRowCount--:this._hiddenRowCount++,this._syncLayoutToRows(t,this._rowCount),this._dispatchRowHeightChangedEvent(t,t+1),!0)},M.prototype.getMinimumColumnWidth=function(t){return this._trackX.getMinimumLaneSize(t)},M.prototype.setMinimumColumnWidth=function(t,e){return!!this._trackX.setMinimumLaneSize(t,e)&&(this._syncLayoutToColumns(t),!0)},M.prototype.getMinimumRowHeight=function(t){return this._trackY.getMinimumLaneSize(t)},M.prototype.setMinimumRowHeight=function(t,e){return!!this._trackY.setMinimumLaneSize(t,e)&&(this._syncLayoutToRows(t,this._rowCount),this._dispatchRowHeightChangedEvent(t,t+1),!0)},M.prototype.getCellLeft=function(t){return this._trackX.getLaneStart(t)},M.prototype.getCellTop=function(t){return this._trackY.getLaneStart(t)},M.prototype.getCellWidth=function(t,e){var i=this._cellSpans.getOccupyingSpan(t,e);if(i){var o=this._trackX.getLaneStart(i.indexX);return this._trackX.getLaneEnd(i.indexX+i.colSpan-1)-o}return this.getColumnWidth(t)},M.prototype.getCellHeight=function(t,e){var i=this._cellSpans.getOccupyingSpan(t,e);if(i){var o=this._trackY.getLaneStart(i.indexY);return this._trackY.getLaneEnd(i.indexY+i.rowSpan-1)-o}return this.getRowHeight(e)},M.prototype.hasCellSpan=function(){return this._cellSpans.hasSpan()},M.prototype.getCellRowSpan=function(t,e){return this._cellSpans.getRowSpan(t,e)},M.prototype.setCellRowSpan=function(t,e,i){var o=this._cellSpans.setRowSpan(t,e,i);if(this._updateCellSpanSize(t,e,o),o)return o.retVal>=0?this._updateCellSpanClass(t,e,o.colSpan,o.rowSpan,!0):o.colSpan>1?(this._updateCellSpanClass(t,e,o.colSpan,o.prevRowSpan,!1),this._updateCellSpanClass(t,e,o.colSpan,o.rowSpan,!0)):this._updateCellSpanClass(t,e,o.colSpan,o.prevRowSpan,!1),0!==o.retVal;var n=this._getCell(t,e);return n&&n._rowSpan>1&&this._updateCellSpanClass(t,e,n._colSpan,n._rowSpan,!1),!1},M.prototype.getCellColSpan=function(t,e){return this._cellSpans.getColSpan(t,e)},M.prototype.setCellColSpan=function(t,e,i){var o=this._cellSpans.setColSpan(t,e,i);if(this._updateCellSpanSize(t,e,o),o)return o.retVal>=0?this._updateCellSpanClass(t,e,o.colSpan,o.rowSpan,!0):o.colSpan>1?(this._updateCellSpanClass(t,e,o.prevColSpan,o.rowSpan,!1),this._updateCellSpanClass(t,e,o.colSpan,o.rowSpan,!0)):this._updateCellSpanClass(t,e,o.prevColSpan,o.rowSpan,!1),0!==o.retVal;var n=this._getCell(t,e);return n&&n._colSpan>1&&this._updateCellSpanClass(t,e,n._colSpan,n._rowSpan,!1),!1},M.prototype.clearCellSpans=function(){var t=this._cellSpans.clearAllSpans();if(null==t)return!1;for(var e=t.length;--e>=0;){var i=t[e];this._updateCellSpan(i.indexX,i.indexY,i,!1)}return!0},M.prototype.clearColumnSpans=function(t){var e=this._cellSpans.removeSpanByColIndex(t);if(null==e)return!1;for(var i=e.length;--i>=0;){var o=e[i];this._updateCellSpan(o.indexX,o.indexY,o,!1)}return!0},M.prototype.clearColumnCustomizations=function(){this._trackX.clearLaneCustomizations(),this._syncLayoutToColumns(0)},M.prototype.clearRowCustomizations=function(){this._trackY.clearLaneCustomizations(),this._syncLayoutToRows(0,this._rowCount)},M.prototype.getColumnScalability=function(t){return this._trackX.getLaneScalability(t)},M.prototype.setColumnScalability=function(t,e){return this._trackX.setLaneScalability(t,e)},M.prototype.getRowScalability=function(t){return this._trackY.getLaneScalability(t)},M.prototype.setRowScalability=function(t,e){return this._trackY.setLaneScalability(t,e)},M.prototype.getCell=function(t,e,i){if(i&&this._cellSpans.hasSpan()){var o=this._cellSpans.getColSpan(t,e),n=this._cellSpans.getRowSpan(t,e);o<0&&(t+=o),n<0&&(e+=n)}return this._getCell(t,e)},M.prototype.getCellContent=function(t,e){var i=this.getCell(t,e);return null!==i?i.getContent():null},M.prototype.setCellContent=function(t,e,i){var o=this.getCell(t,e);return null==o?(window.console.log("Error: Accessing nonexistent cell in Grid's Table"),null):o.setContent(i)},M.prototype.getColumnCount=function(){return this._colCount},M.prototype.setColumnCount=function(t){if(t<0&&(t=0),this._colCount!==t){var e=this._colCount;this._trackX.setLaneCount(t),this._colCount=this._trackX.getLaneCount();var i=0,o=null;if(e>t)for(i=e;--i>=t;)(o=this._columns.pop()).dispose(),o===this._firstColumn&&(this._firstColumn=null),o===this._lastColumn&&(this._lastColumn=null);else for(i=e;i<t;++i)o=this._newColumn(i);for(this._updateColumnIndices(),i=e;i<t;++i)this._columns[i].activate(!this._colVir);t<=0&&this._selectionList.clearAllSelections()}},M.prototype.getRowCount=function(){return this._rowCount},M.prototype.setRowCount=function(t,e){if(t<0&&(t=0),this._rowCount!==t){var i,o=this._rowCount;for(this._trackY.setLaneCount(t),this._rowCount=this._trackY.getLaneCount(),this._ctxRows.setItemCount(t),this._stretchedCells.setCellCount(t),i=0;i<this._colCount;++i)this._columns[i].setCellCount(t);if(o>t)if(t<this._rowHighlightIndex&&this.setRowHighlight(-1),t<this._activeRowEnd&&(this._activeRowEnd=t),t<this._availableRowCount&&(this._availableRowCount=t),this._cellSpans.removeSpanStartedFromRowIndex(t),this._updateViewHeight(),t>0)for(var n=t;n<o;++n)this._selectionList.deselect(n);else this._selectionList.clearAllSelections();else this._syncLayoutToRows(o,t);var r={};r.prevCount=o,r.rowCount=this._rowCount,this._dispatch("rowCountChanged",r),o<t&&this._insertCells(0,this._rowCount)}},M.prototype.getVisibleRowCount=function(){return this._rowCount-this._hiddenRowCount},M.prototype.addRow=function(t){t<=0||(this._colCount<=0?window.console.log("WARNING: Row cannot be added, unless at least one column is added"):this.setRowCount(this._rowCount+t))},M.prototype.removeRow=function(t){t<=0||(t>this._rowCount&&(t=this._rowCount),this.setRowCount(this._rowCount-t))},M.prototype.setBorders=function(t,e,i,o){},M.prototype.getColumnStyle=function(t,e){var i=this._columns[t];return i?i.getStyle(e):null},M.prototype.setColumnStyle=function(t,e,i){var o=this._columns[t];o&&o.setStyle(e,i)},M.prototype.enableColumnClass=function(t,e,i){var o=this._columns[t];o&&o.enableClass(e,i)},M.prototype.hasColumnClass=function(t,e){var i=this._columns[t];return!!i&&i.hasClass(e)},M.prototype.enableRowClass=function(t,e,i){if(t>=0&&t<this._rowCount)for(var o=0;o<this._colCount;++o)this._columns[o].getCell(t).enableClass(e,i)},M.prototype.setRowStyle=function(t,e,i,o){if(t>=0&&t<this._rowCount){i&&(null==o||o)||(i="");for(var n=0;n<this._colCount;++n)this._columns[n].getCell(t).setStyle(e,i)}},M.prototype.getRelativePosition=function(t){return i.getRelativePosition(t,this._element)},M.prototype.getContentWidth=function(){return this._trackX.getTrackSize()},M.prototype.getContentHeight=function(){var t=this._trackY.getTrackSize();if(t<=0&&this._colCount*this.getVisibleRowCount()>0){var e=this._columns[0],i=e.getCell(this._rowCount-1);return i.getTop()+i.getHeight()-e.getCell(0).getTop()}return t},M.prototype.getCellsByRowIndex=function(t){if(t<0||t>=this._rowCount)return null;for(var e=new Array(this._colCount),i=0;i<this._colCount;++i)e[i]=this._columns[i].getCell(t);return e},M.prototype.disableHorizontalGridLine=function(t){this.enableClass("no-horizontal-grid-line",!1!==t)},M.prototype.disableVerticalGridLine=function(t){this.enableClass("no-vertical-grid-line",!1!==t)},M.prototype.enableShading=function(t){!1!==t?this.addClass("tr-even-shading"):(this.removeClass("tr-even-shading"),this.removeClass("tr-odd-shading"))},M.prototype.setTransposedShading=function(t){this.enableClass("transposed-shading",!1!==t)},M.prototype.enableRowHighlighting=function(t){null==t&&(t=!0),this._rowHighlightEnabled!==t&&(this._rowHighlightEnabled=t,this._rowHighlightEnabled?(this.listen("mousemove",this._onMouseMove),this.listen("mouseout",this._onMouseOut)):(this.setRowHighlight(-1),this.unlisten("mousemove",this._onMouseMove),this.unlisten("mouseout",this._onMouseOut)))},M.prototype.getRowHighlight=function(){return this._rowHighlightIndex},M.prototype.setRowHighlight=function(t){if((!this._rowHighlightEnabled||t<-1||t>=this._rowCount)&&(t=-1),this._rowHighlightIndex!==t){var e=this._rowHighlightIndex;this._rowHighlightIndex=t;for(var i=this._highlightedCells.length;--i>=0;)this._highlightedCells[i].removeClass("highlighted-row");if(t>=0&&t<this._rowCount){this._highlightedCells.length=this._colCount;for(var o=this._colCount;--o>=0;){var n=this._columns[o].getCell(t);this._highlightedCells[o]=n,n.addClass("highlighted-row")}}else this._highlightedCells.length=0;if(this._hasListener("rowHighlighted")){var r={};r.prevRowIndex=e,r.rowIndex=t,this._dispatch("rowHighlighted",r)}}},M.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},M.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},M.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},M.prototype.setSelectedRow=function(t,e){t<0||t>=this._rowCount||(this._selectionList.setSelection(t,e),this._updateSelectionUI(t))},M.prototype.selectSingleRow=function(t){t<0||t>=this._rowCount||(this.clearSelectedRows(),this._selectionList.select(t),this._addSelectionUI(t))},M.prototype.selectRowRange=function(t,e){if(!(t<0||t>=this._rowCount)){t+e>this._rowCount&&(e=this._rowCount-t),this._selectionList.selectRange(t,e);for(var i=0;i<e;++i)this._addSelectionUI(i+t)}},M.prototype.clearSelectedRows=function(){var t=this._selectionList.getSelectionCount();if(t){var e=this._selectionList.getAllSelections();this._selectionList.clearAllSelections();for(var i=0;i<t;++i)this._removeSelectionUI(e[i]);return t}return 0},M.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},M.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},M.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},M.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},M.prototype.activateColumn=function(t,e){var i=this._columns[t];if(i){var o=i.activate(e);if(e&&o&&this._rightSpace){var n=this._rightSpace.parentNode;n&&n.appendChild(this._rightSpace)}}},M.prototype.activateRows=function(){this._onEnterDocument()},M.prototype.moveRowsToTop=function(t){this._ctxRows.moveItemsToTop(t),this._stretchedCells.moveCellsToTop(t);for(var e=0;e<this._colCount;++e)this._columns[e].moveCellsToTop(t)},M.prototype.getFirstIndexInView=function(){return 0},M.prototype.getLastIndexInView=function(){return this._availableRowCount-1},M.prototype.isInCurrentView=function(t){return 0!==this._rowCount&&t>=0&&t<this._rowCount},M.prototype.getFrozenLayout=function(){return this._frozenLayout},M.prototype.setFrozenLayout=function(t){this.isVisible()||(t=!0),this._frozenLayout!==t&&(this._frozenLayout=t,this._frozenLayout||(this._syncLayoutToColumns(0),this._syncLayoutToRows(0,this._rowCount),this._dispatchRowHeightChangedEvent(0,this._rowCount)))},M.prototype.getColumn=function(t){return this._columns[t]||null},M.prototype.insertColumn=function(t,e){t<0?t=0:t>this._colCount&&(t=this._colCount);var i=t<this._colCount,o=this._cellSpans.getAllSpans();this._updateCellSpans(o,!1),this._trackX.insertLane(t,e),this._colCount=this._trackX.getLaneCount();var n=this._newColumn(t);if(this._updateColumnIndices(),this._cellSpans.shiftColumn(t,1)&&(o=this._cellSpans.getAllSpans()),this._updateCellSpans(o,!0),this._calculateStretchSize(!0),this._stretchedCells.updateXAxis(),this._selectionList.getSelectionCount())for(var r=this._selectionList.getAllSelections(),s=r.length;--s>=0;){var l=n.getCell(r[s]);l&&l.addClass("selected-row")}return n.activate(i||!this._colVir),n},M.prototype.removeColumnAt=function(t){var e=this._trackX.removeLaneAt(t);if(null==e)return null;var i=this._cellSpans.getAllSpans();this._updateCellSpans(i,!1),this._colCount=this._trackX.getLaneCount();var o=this._columns.splice(t,1)[0];return o.dispose(),e.control=o,this._updateColumnIndices(),this._cellSpans.removeColumn(t)&&(i=this._cellSpans.getAllSpans()),this._updateCellSpans(i,!0),this._syncLayoutToColumns(t),t>=this._colCount&&this._updateViewWidth(),e},M.prototype.moveColumn=function(t,e){if(t<0)t=0;else if(t>=this._colCount)return;if(e<0?e=0:e>=this._colCount&&(e=this._colCount-1),t!==e){var o=this._cellSpans.getAllSpans();this._updateCellSpans(o,!1),this._trackX.moveLane(t,e);var n=this._columns[t];i.moveArrayItem(this._columns,t,e);var r=this._columns[e+1]||null;if(n.insertBefore(r),this._rightSpace){var s=this._rightSpace.parentNode;s&&s.appendChild(this._rightSpace)}this._updateColumnIndices(),this._updateCellSpans(o,!0);var l=t<e?t:e;this._syncLayoutToColumns(l)}},M.prototype.enableRowVirtualization=function(){console.log("WARNING: This function is deprecated")},M.prototype.enableColumnVirtualization=function(t){this._colVir=!1!==t},M.prototype.getColumnIndex=function(t){if(t){if(t.stretched)return this._stretchedCells.getColumnIndex(t);for(var e=this._columns.length,i=0;i<e;++i)if(this._columns[i].getElement()===t)return i}return-1},M.prototype.getCellIndex=function(t,e){if(e){if(e.stretched)return this._stretchedCells.getRowIndex(e);var i=this._columns[t];if(i)return i.getCellIndex(e)}return-1},M.prototype.getIndex=function(){return this._index},M.prototype.setIndex=function(t){this._index=t},M.prototype.getRowOffset=function(){return this._rowOffset},M.prototype.setRowOffset=function(t){this._rowOffset=t},M.prototype.updateLayout=function(){},M.prototype.stretchCell=function(t,e,i,o){var n=-1;if("number"==typeof t?(n=t,null==e&&(e=0)):t&&(t.stretched?(n=this._stretchedCells.getColumnIndex(t),null==e&&(e=this._stretchedCells.getRowIndex(t))):t.getParent&&(n=this.getColumnIndex(t.getParent()))),n<0||e<0||null==e)return null;var r=null;if(!1!==i){var s=this._coverLayer;s||((s=this._coverLayer=document.createElement("div")).className="cover-layer",this._updateLayers()),this._calculateStretchSize(),(r=this._stretchedCells.stretchCell(e,o?n:0)).setParent(s)}else r=this._stretchedCells.unstretchCell(e);return r},M.prototype.unstretchCell=function(t,e){return this.stretchCell(t,e,!1)},M.prototype.unstretchAllCells=function(){this._stretchedCells.unstretchAllCells()},M.prototype.getStretchedCell=function(t,e){return null==e&&(e="number"==typeof t?t:this._stretchedCells.getRowIndex(t)),"number"==typeof e?this._stretchedCells.getCell(e):null},M.prototype.getStretchedCells=function(){return this._stretchedCells.getCells()},M.prototype.updateStretchedCells=function(){this._updateLayers();var t=this._coverLayer?this._coverLayer.children.length:0;return!(t<=0||(this._calculateStretchSize(!0),this._stretchedCells.updateCells(),!t))},M.prototype._calculateStretchSize=function(t){var e=this._ctx,i=t?0:this._stretchedCells.getStretchSize();if(!i&&e&&e.getWidth){i=e.getWidth();var o=this.getContentWidth();o<i&&(i=o),this._stretchedCells.setStretchSize(i)}},M.prototype.getColumnHost=function(){return this._element},M.prototype.setHidingMethod=function(t){this._hidingMethod=t},M.prototype.getHidingMethod=function(){return this._hidingMethod},M.prototype.setColumnVisibility=function(t,e,i){return!!this._trackX.hideLane(t,!e,i)&&(this._syncLayoutToColumns(t),!0)},M.prototype.getRowLayout=function(){return this._trackY},M.prototype.reserveRightSpace=function(t){if(t&&t>0){if(!this._rightSpace){var e=this._rightSpace=document.createElement("div");e.className="tr-reserved-space",e.style.height=this.getContentHeight()+"px",this._updateLayers()}this._rightSpace.style.width=t+"px",this._updateViewWidth()}else if(this._rightSpace){var i=this._rightSpace.parentNode;i&&i.removeChild(this._rightSpace),this._rightSpace=null,this._updateViewWidth()}return this._rightSpace},M.prototype._updateRightSpaceStyle=function(t){var e=this._rightSpace;t?(e.style.top=this._trackY.getLaneStart(this._activeRow)+"px",e.style.left=this._trackX.getLaneStart(this._colCount)+"px",e.style.position="",e.style.display=""):(e.style.position="static",e.style.display="inline-block")},M.prototype._updateLayers=function(){if(this._rightSpace){var t=this._rightSpace.parentNode;t?t.appendChild(this._rightSpace):this._element.appendChild(this._rightSpace)}this._coverLayer&&this._element.appendChild(this._coverLayer)},M.prototype.getReservedSpace=function(){return this._rightSpace},M.prototype.getComputedStyle=function(){var t=this._element;return t.offsetParent?getComputedStyle(t):null},M.prototype.isColumnActive=function(t){var e=this._columns[t];return!!e&&e.isActive()},M.prototype.setRowAttributes=function(t,e){if(!(t<0||t>=this._rowCount))for(var i=0;i<this._colCount;++i)for(var o=e(i),n=o.length;--n>=0;){var r=o[n],s=this._columns[i].getCell(t);s&&(r.remove?s.removeAttribute(r.attribute):s.setAttribute(r.attribute,r.value))}},M.prototype.getContextRow=function(t){return this._ctxRows.getItem(t)},M.prototype._getCell=function(t,e){var i=this._columns[t];return i?i.getCell(e):null},M.prototype._insertCells=function(t,e){this._activeRow=t,this._activeRowEnd=e;for(var i=this._trackY.getLaneStart(t),o=0;o<this._colCount;++o){var n=this._columns[o];n.hasCollapsedCells()||n.setTop(i),n.activateCells(t,e)}if(this._rightSpace&&(this._rightSpace.style.top=i+"px"),e>this._availableRowCount){var r={};r.prevRowIndex=this._availableRowCount,r.rowIndex=e,this._availableRowCount=e,this._dispatch("rowAvailable",r)}},M.prototype._newColumn=function(t){var e=new S(this._virOwner||this);e.setHeight(this._trackY.getDefaultLaneSize()),e.setCellCount(this._rowCount),e.setTop(this._trackY.getLaneStart(this._activeRow)),e.activateCells(this._activeRow,this._activeRowEnd);for(var i=0;i<this._rowCount;++i)this._trackY.isAtDefaultSize(i)||e.getCell(i).setHeight(this._trackY.getLaneSize(i));if(t>=this._columns.length)this._columns.push(e),e.setParent(this._element);else{this._columns.splice(t,0,e);var o=this._columns[t+1];e.insertBefore(o)}if(this._rightSpace){var n=this._rightSpace.parentNode;n&&n.appendChild(this._rightSpace)}return e},M.prototype._updateViewWidth=function(){if(!this._frozenLayout){this._calculateStretchSize(!0),this._stretchedCells.updateXAxis();var t=this.getContentWidth();this._rightSpace&&(t+=this._rightSpace.offsetWidth),this._element.style.width=t+"px"}},M.prototype._updateViewHeight=function(){if(!this._frozenLayout){var t=this.getContentHeight();this._element.style.height=t+"px",this._rightSpace&&(this._rightSpace.style.height=t+"px")}},M.prototype._updateColumnIndices=function(){var t=this._columns.length,e=this._columns[0];e!==this._firstColumn&&(this._firstColumn&&this._firstColumn.removeClass("first"),this._firstColumn=e,this._firstColumn&&this._firstColumn.addClass("first"));var i=this._columns[t-1];i!==this._lastColumn&&(this._lastColumn&&this._lastColumn.removeClass("last"),this._lastColumn=i,this._lastColumn&&this._lastColumn.addClass("last"));for(var o=null,n=this._columns.length;--n>=0;){var r=this._columns[n];r.setNextSibling(o),o=r}},M.prototype._syncLayoutToColumns=function(t){if(this._frozenLayout)return!1;if(this._rightSpace&&(this._rightSpace.style.left=this._trackX.getLaneStart(this._colCount)+"px"),t>=this._colCount)return!1;for(var e=t;e<this._colCount;++e){var i=this._columns[e];i.setLeft(this._trackX.getLaneStart(e)),i.setWidth(this._trackX.getLaneSize(e))}return this._updateCellSpanLayout(this._cellSpans.getAllSpans()),this._updateViewWidth(),!0},M.prototype._syncLayoutToRows=function(t,e){if(!this._frozenLayout){for(var i=t;i<e;++i)for(var o=this._trackY.isAtDefaultSize(i)?-1:this._trackY.getLaneSize(i),n=0;n<this._colCount;++n)this._columns[n].getCell(i).setHeight(o);this._stretchedCells.updateYAxis(),t?this._updateCellSpanLayout(this._cellSpans.getAllSpans()):this._updateCellSpans(this._cellSpans.getAllSpans(),!0),this._updateViewHeight()}},M.prototype._dispatchRowHeightChangedEvent=function(t,e){if(this._hasListener("rowHeightChanged")&&!(t>=e)){var i={};i.rowIndex=t,i.changeLength=e-t,this._dispatch("rowHeightChanged",i)}},M.prototype._updateCellSpanSize=function(t,e,i){var o=this._getCell(t,e);if(null!=o)if(i&&i.colSpan>1?(o.setWidth(this.getCellWidth(t,e)),this._columns[t].disableDeactivation()):o.setWidth(-1),i&&i.rowSpan>1)o.setHeight(this.getCellHeight(t,e));else{var n=this._trackY.isAtDefaultSize(e)?-1:this._trackY.getLaneSize(e);o.setHeight(n)}},M.prototype._updateCellSpanLayout=function(t){if(null!=t)for(var e=t.length;--e>=0;){var i=t[e];this._updateCellSpanSize(i.indexX,i.indexY,i)}},M.prototype._updateCellSpan=function(t,e,i,o){this._updateCellSpanSize(t,e,o?i:null),this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,o)},M.prototype._updateCellSpanClass=function(t,e,i,o,n){for(var r,s=0;s<i&&(r=this._columns[t+s]);++s)r.collapseCells(e,o,n,0===s,s>0);var l=this._getCell(t,e);l&&(l._colSpan=n?i:1,l._rowSpan=n?o:1)},M.prototype._updateCellSpans=function(t,e){if(null!=t)for(var i=t.length;--i>=0;){var o=t[i];this._updateCellSpan(o.indexX,o.indexY,o,e)}},M.prototype._onMouseMove=function(t){var e=t.target,o=i.closestElement(e,"column"),n=this.getColumnIndex(o),r=n>=0?i.closestElement(e,"cell"):null;this.setRowHighlight(this.getCellIndex(n,r))},M.prototype._onMouseOut=function(t){var e=t.relatedTarget;if(e)for(var i=this._element;null!==e.parentNode;)if((e=e.parentNode)===i)return;this.setRowHighlight(-1)},M.prototype._updateSelectionUI=function(t){for(var e=this._selectionList.getSelection(t),i=0;i<this._colCount;++i){var o=this._columns[i].getCell(t);o&&o.enableClass("selected-row",e)}},M.prototype._addSelectionUI=function(t){for(var e=0;e<this._colCount;++e){var i=this._columns[e].getCell(t);i&&i.addClass("selected-row")}},M.prototype._removeSelectionUI=function(t){for(var e=0;e<this._colCount;++e){var i=this._columns[e].getCell(t);i&&i.removeClass("selected-row")}},M.prototype._onEnterDocument=function(){if(!this._initialized&&this.getParent()){for(var t=0;t<this._colCount;++t)this._columns[t].enableAutoStyleUpdating();this._syncLayoutToColumns(0),this._initialized=!0}},M.prototype._setContext=function(t){this._ctx=t},M.prototype._getContext=function(){return this._ctx},M.prototype._resetTransformIETimer=function(){i.isIE&&(this._transformIETimer||(this.enableClass("reset-transform"),this._transformIETimer=setTimeout(this._onResetTransformIE.bind(this),20)))},M.prototype._onResetTransformIE=function(){this._transformIETimer=0,this.enableClass("reset-transform",!1)},M._proto=M.prototype;const P=M;var F=function(){var t=this;t._rows={},t._subs={},t._staticFields={},t._onInsert=t._onInsert.bind(t),t._onUpdate=t._onUpdate.bind(t),t._onDelete=t._onDelete.bind(t),t._onBatchRequestADCData=t._onBatchRequestADCData.bind(t),t._onADCUpdate=t._onADCUpdate.bind(t),t._onADCError=t._onADCError.bind(t),t._onQ2DataChanged=t._onQ2DataChanged.bind(t),t._onQ2SubAdded=t._onQ2SubAdded.bind(t),t._onQ2SubRemoved=t._onQ2SubRemoved.bind(t),t._addEvent("dataComposed"),t._addEvent("dataChanged")};h.inherits(F,s),F.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._quotes2=null},F.prototype.setSubscriptions=function(t){this._quotes2&&(this._quotes2.removeEventListener("dataChanged",this._onQ2DataChanged),this._quotes2.removeEventListener("subscriptionAdded",this._onQ2SubAdded),this._quotes2.removeEventListener("subscriptionRemoved",this._onQ2SubRemoved)),this._quotes2=t,this._quotes2&&(this._quotes2.addEventListener("dataChanged",this._onQ2DataChanged),this._quotes2.addEventListener("subscriptionAdded",this._onQ2SubAdded),this._quotes2.addEventListener("subscriptionRemoved",this._onQ2SubRemoved))},F.prototype.getSubscriptions=function(){return this._quotes2},F.prototype.addSubscription=function(t,e,i){if(!this.getSubscription(t.id)){var o={s:t,rics:{}};this._subs[t.id]=o,this._quotes2||(t.onNewRow(this._onInsert),t.onUpdate(this._onUpdate),t.onRemoveRow(this._onDelete)),e&&(o.primary=e,i||(i={}),this._onInsert(t,e,i))}},F.prototype.removeSubscription=function(t){var e=t.id;if(t&&this._subs[e]){this._quotes2||t.stop();var i=this._subs[e].rics;for(var o in i)this.setRowData(e+o,null);delete this._subs[e]}},F.prototype.startAllSubscriptions=function(){if(this._quotes2)this._quotes2.start();else for(var t in this._subs)this._subs[t].s.start()},F.prototype.stopAllSubscriptions=function(){if(this._quotes2)this._quotes2.stop();else for(var t in this._subs)this._subs[t].s.stop()},F.prototype.getSubscription=function(t){return this._subs[t]?this._subs[t].s:null},F.prototype.getPrimaryRic=function(t){var e=this._subs[t];return e?e.primary:""},F.prototype.clearAllData=function(t){this._quotes2?this._quotes2.removeAllSubscriptions():this.stopAllSubscriptions(),this._subs={},this._rows={},this._adcTimerId>=0&&(clearTimeout(this._adcTimerId),this._adcTimerId=-1),this._adcRicMap=null,t||this._dispatchDataChange({globalChange:!0})},F.prototype.clearColumnData=function(t,e){for(var i="string"==typeof t?[t]:t,o=i.length;--o>=0;){var n=i[o];if(n)for(var r in this._rows)delete this._rows[r][n]}e||this._dispatchDataChange({globalChange:!0})},F.prototype.getData=function(t,e){var i=this.getRowData(t);return i?i[e]:null},F.prototype.getAllRics=function(){var t={};for(var e in this._subs){var i=this._subs[e].rics;for(var o in i)t[o]||(t[o]=[]),t[o].push(e)}return t},F.prototype.getAllRowIds=function(){var t=[];for(var e in this._rows)t.push(e);return t},F.prototype.hasRowId=function(t){return!!this._rows[t]},F.prototype.getColumnData=function(t){var e=[];for(var i in this._rows)e.push(this._rows[i][t]);return e},F.prototype.getRowData=function(t){return this._rows[t]||null},F.prototype.getMultipleRowData=function(t,e,i){var o=t.length;null==i&&(i=o),i>o&&(i=o),e>0||(e=0);for(var n=new Array(o),r=this._rows,s=e;s<i;++s)n[s]=r[t[s]]||null;return n},F.prototype.getAllRowData=function(){var t=[],e=this._rows;for(var i in e)t.push(e[i]);return t},F.prototype.setData=function(t,e,i){var o={};return o[e]=i,this.setRowData(t,o)},F.prototype.hasDataCloudData=function(t){if(!this._adcFields)return!1;var e=this.getRowData(t);if(!e)return!1;for(var i=this._adcFields.length;--i>=0;)if(null!=e[this._adcFields[i]])return!0;return!1},F.prototype.setRowData=function(t,e,i){var o=this.getRowData(t),n=!1,r=null;if(e)if(o){for(var s in e)o[s]=e[s],n=!0;r=e}else o=e,this._rows[t]=o,n=!0;else o&&(delete this._rows[t],n=!0);if(n&&!this._composing){var l=i||{};l.rid=t,r&&(l.changes=r),l.rowData=o,this._dispatchDataChange(l)}return n},F.prototype.cloneRowData=function(t){var e=this._rows[t];if(!e)return null;var i={};for(var o in e)0!==o.indexOf("FREE_TEXT")&&(i[o]=e[o]);return i},F.prototype.addStaticFields=function(t){if(Array.isArray(t))for(var e in t)this._staticFields[t[e]]?this._staticFields[t[e]]++:this._staticFields[t[e]]=1},F.prototype.removeStaticFields=function(t){if(Array.isArray(t))for(var e in t)this._staticFields[t[e]]&&(this._staticFields[t[e]]--,0===this._staticFields[t[e]]&&delete this._staticFields[t[e]])},F.prototype.resetStaticFields=function(){this._staticFields={}},F.prototype.getStaticFields=function(){return this._staticFields},F.prototype.dump=function(t){return F.constructTable(this.getAllRowData(),t,Object.keys(this._rows))},F.prototype.log=function(t){console.table(this.dump(t))},F.prototype.setDataCloudSettings=function(t,e,i,o){null!=t&&(this._userId=t),null!=e&&(this._productId=e),null!=i&&(this._adcUrl=i),o&&(this._lang=o)},F.prototype.getDataCloudFields=function(){return this._adcFields},F.prototype.addDataCloudFields=function(t){this._adcFields||(this._adcFields=[],this._adcRefMap={});var e=[];if(t instanceof Array)for(var i=t.length;--i>=0;)this._addDataCloudField(t[i],e);else this._addDataCloudField(t,e);if(e.length<=0)return!1;var o=this.getAllRics();return this._batchRequestDataCloud(o,e),!0},F.prototype.removeDataCloudField=function(t){if(!this._adcFields)return!1;if(!this._adcRefMap[t])return!1;if(--this._adcRefMap[t],!this._adcRefMap[t]){var e=this._adcFields.indexOf(t);this._adcFields.splice(e,1),this.clearColumnData(t)}return!0},F.prototype._dispatchDataChange=function(t){this._composing||(this._composing=!0,this._dispatch("dataComposed",t),this._composing=!1,this._dispatch("dataChanged",t))},F._defaultPropertyGetter=function(t,e,i){var o=e[i];return o?o[t]:null},F._defaultGetter=function(t,e){return t[e]},F.constructTable=function(t,e,i){var o=0,n=t.length,r=n,s=null,l=i||null,a=F._defaultGetter,h=!1;if(e){if(e.rowCount&&(r=e.rowCount,h=!0),e.colNames){s={};for(var u=e.colNames.length,p=0;p<u;++p)s[e.colNames[p]]=!0;h=!0}e.getter&&(a="string"==typeof e.getter?F._defaultPropertyGetter.bind(null,e.getter):e.getter,h=!0),e.startIndex&&(o=e.startIndex,h=!0),!1===e.withRowIds&&(l=null)}if(!h&&!l)return t;for(var _=[],c=o;c<n&&!(_.length>=r);++c){var d,g=t[c],f=l?{rid:l[c]}:{};if(g)if(s)for(d in s)null!=g[d]&&(f[d]=a(g,d));else for(d in g)f[d]=a(g,d);_.push(f)}return _},F.prototype._insertRic=function(t,e,i){var o=t+(e=e.replace("0#",""));if(this._onADCForNewRic(t,e),!this.getRowData(o)){var n=i;for(var r in i={},n)i[r]=n[r];i.SUB_ID=t,i.RIC=e}this.setRowData(o,i)},F.prototype._onQ2DataChanged=function(t){var e=t.subId,i=t.ric,o=t.values;o?this._insertRic(e,i,o):(delete this._subs[e].rics[i],this.setRowData(e+i,null))},F.prototype._onQ2SubAdded=function(t){for(var e=t.subs,i=t.duplicateSubIds,o=e.length,n=0;n<o;++n){var r=e[n],s=r.ric;if(this.addSubscription(r,s),i){var l=i[n];l&&window.setTimeout(this._onDuplicateRic.bind(this,r.id,this.getRowData(l+s)),10)}}},F.prototype._onQ2SubRemoved=function(t){for(var e=t.subs,i=e.length,o=0;o<i;++o){var n=e[o];this.removeSubscription(n)}},F.prototype._onADCForNewRic=function(t,e){var i=this._subs[t];i&&(this._adcFields&&(i.rics[e]||(this._adcTimerId<0&&(this._adcRicMap={},this._adcTimerId=setTimeout(this._onBatchRequestADCData,100)),this._adcRicMap[e]||(this._adcRicMap[e]=[]),this._adcRicMap[e].push(t))),i.rics[e]=!0)},F.prototype._onDuplicateRic=function(t,e){var i=this._subs[t];if(i){var o=(i=i.s).ric,n=e.SUB_ID,r=this._cloneRowData(e,o,t);if(r){this._onInsert(i,o,r);var s=i.children;if(s)for(var l=s.length,a=0;a<l;++a)o=s[a],r=this._cloneRowData(n,o,t),this._onInsert(i,o,r)}}},F.prototype._onInsert=function(t,e,i){var o=t.id;this._quotes2?this._insertRic(o,e,i):(this._onADCForNewRic(o,e),this.setRowData(o+e,i,{subscription:t,ric:e}))},F.prototype._onUpdate=F.prototype._onInsert,F.prototype._onDelete=function(t,e,i){delete this._subs[t.id].rics[e],this.setRowData(t.id+e,null,{subscription:t,ric:e})},F.prototype._addDataCloudField=function(t,e){this._adcRefMap[t]?++this._adcRefMap[t]:(this._adcFields.push(t),e.push(t),this._adcRefMap[t]=1)},F.prototype._onADCUpdate=function(t){var e=t.currentTarget,i=null;try{i=JSON.parse(e.responseText)}catch(t){return}if("Ok"===i.status){for(var o=i.cols,n=i.rows,r=n[0],s=-1,l={},a=0;a<o;++a){var h=r[a];"instrument"===h.i?s=a:h.r&&(l[h.r]=a)}for(var u=n.length,p=1;p<u;++p){var _=n[p],c=_[s],d={};for(var g in l){var f=_[l[g]];null!=f&&null!==f&&null==f.f&&(this._quotes2?(d[g]=f,d[g+"_FORMATTED"]=f):d[g]={formatted:f+"",raw:f})}var y=e.ricMap[c];if(y)for(a=y.length;--a>=0;){var m=y[a];this._subs[m]&&this.setRowData(m+c,d)}}}},F.prototype._onADCError=function(t){window.console.log(t)},F.prototype._onBatchRequestADCData=function(t){this._adcTimerId<=0||(this._adcTimerId=-1,this._batchRequestDataCloud(this._adcRicMap,this._adcFields),this._adcRicMap=null)},F.prototype._batchRequestDataCloud=function(t,e){if(!this._adcUrl)return null;var i=[];for(var o in t)i.push(o);for(;i.length>30;)this._requestDataCloud(t,e,i.splice(0,30));return this._requestDataCloud(t,e,i)},F.prototype._requestDataCloud=function(t,e,i){if(!i||i.length<=0)return null;if(!e||e.length<=0)return null;var o=new XMLHttpRequest;o.onload=this._onADCUpdate,o.onerror=this._onADCError,o.ricMap=t,o.open("POST",this._adcUrl,!0),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded");var n="formula="+e+"&identifiers="+i;return this._productId&&(n+="&productid="+this._productId),this._userId&&(n+="&uuid="+this._userId),this._lang&&(n+="&lang="+this._lang),o.send(n),o},F.prototype._cloneRowData=function(t,e,i){var o="string"==typeof t?t:t.SUB_ID,n=this._rows[o+e];if(!n){if("object"!=typeof t)return null;n=t}var r={};for(var s in n)null==this._staticFields[s]&&(r[s]=n[s]);return r.SUB_ID=i,r},F.prototype._rows,F.prototype._subs,F.prototype._quotes2=null,F.prototype._staticFields=null,F.prototype._adcFields=null,F.prototype._adcRefMap=null,F.prototype._adcTimerId=-1,F.prototype._adcRicMap=null,F.prototype._adcUrl="/datacloud/rest/select",F.prototype._userId="",F.prototype._productId="",F.prototype._composing=!1,F.prototype._lang="",F._proto=F.prototype;const H=F;var k=function(t){this._rid=t,this._children={}};k.prototype._rid,k.prototype._children,k.prototype._childCount=0,k.prototype._collapsed=!1,k.prototype._value=0,k.prototype.getId=function(){return this._rid},k.prototype.addChild=function(t,e){return!(!t||this._children[t]||(e&&(e[t]=this._rid),this._children[t]=1,++this._childCount,0))},k.prototype.addChildren=function(t,e){for(var i=Array.isArray(t)?t:[t],o=i.length,n=0,r=0;r<o;++r)n|=this.addChild(i[r],e);return!!n},k.prototype.containsChild=function(t){return!!this._children[t]},k.prototype.removeChild=function(t,e){return!(!this._childCount||!this._children[t]||(e&&delete e[t],delete this._children[t],--this._childCount,0))},k.prototype.removeChildren=function(t,e){if(!this._childCount)return!1;for(var i=Array.isArray(t)?t:[t],o=i.length,n=0,r=0;r<o;++r)n|=this.removeChild(i[r],e);return!!n},k.prototype.removeAllChildren=function(t){if(this._childCount){if(t){var e=this._children;for(var i in e)t[i]&&delete t[i]}return this._children={},this._childCount=0,!0}return!1},k.prototype.getChildIds=function(){return this._childCount?Object.keys(this._children):[]},k.prototype.collapse=function(t){return t=!1!==t,this._collapsed!==t&&(this._collapsed=t,!0)},k.prototype.expand=function(t){return this.collapse(!1===t)},k.prototype.isCollapsed=function(){return this._collapsed},k.prototype.getCollapsingStates=function(t){if(t||(t={}),this._childCount){var e=this._children,i=this._collapsed;for(var o in e)t[o]=i}return t},k.prototype.getValue=function(){return this._value},k.prototype.setValue=function(t){this._value=t};const N=k;var O=function(){this._segments={},this._childToSegmentId={}};O.prototype._segments,O.prototype._segmentCount=0,O.prototype._collapsedRids=null,O.prototype._dirtyCollapsingState=!1,O.prototype._childToSegmentId,O.prototype.addSegment=function(t){return!(!t||this._segments[t]||(this._childToSegmentId[t]&&console.log("child of a segment cannot be set as a segment separator"),this._segments[t]=new N(t),++this._segmentCount,0))},O.prototype.addSegments=function(t){for(var e=Array.isArray(t)?t:[t],i=e.length,o=0,n=0;n<i;++n)o|=this.addSegment(e[n]);return!!o},O.prototype.containsSegment=function(t){return!!this._segments[t]},O.prototype.getParentRowId=function(t){return this._childToSegmentId[t]||""},O.prototype.removeSegment=function(t){var e=this._segments[t];return!!e&&(e.isCollapsed()&&(this._dirtyCollapsingState=!0),e.removeAllChildren(this._childToSegmentId),delete this._segments[t],--this._segmentCount,!0)},O.prototype.removeAllSegments=function(){return!!this._segmentCount&&(this._segments={},this._childToSegmentId={},this._segmentCount=0,this._dirtyCollapsingState=!0,!0)},O.prototype.getSegmentCount=function(){return this._segmentCount},O.prototype.getSegment=function(t){return this._segments[t]||null},O.prototype.getSegments=function(){return this._segmentCount?this._segments:null},O.prototype.getSegmentIds=function(){return Object.keys(this._segments)},O.prototype.collapseSegment=function(t,e){var i=this._segments[t];return!(!i||!i.collapse(e))&&(this._dirtyCollapsingState=!0,!0)},O.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},O.prototype.expandAllSegments=function(){if(this._segmentCount){var t=this._segments,e=0;for(var i in t)e|=t[i].expand();if(e)return this._dirtyCollapsingState=!0,!0}return!1},O.prototype.isCollapsedSegment=function(t){var e=this._segments[t];return!!e&&e.isCollapsed()},O.prototype.getCollapsedRows=function(){if(this._dirtyCollapsingState){this._dirtyCollapsingState=!1;var t=null,e=0;if(this._segmentCount){var i=this._segments;for(var o in t={},i)i[o].isCollapsed()&&(i[o].getCollapsingStates(t),++e)}this._collapsedRids=e?t:null}return this._collapsedRids},O.prototype.addSegmentChild=function(t,e){var i=this._segments[t];return!(!i||!i.addChild(e,this._childToSegmentId))&&(i.isCollapsed()&&(this._dirtyCollapsingState=!0),!0)},O.prototype.addSegmentChildren=function(t,e){var i=this._segments[t];return!(!i||!i.addChildren(e,this._childToSegmentId))&&(i.isCollapsed()&&(this._dirtyCollapsingState=!0),!0)},O.prototype.containsSegmentChild=function(t,e){var i=this._segments[t];return!!i&&i.containsChild(e)},O.prototype.removeSegmentChild=function(t,e){var i=this._segments[t];return!(!i||!i.removeChild(e,this._childToSegmentId))&&(i.isCollapsed()&&(this._dirtyCollapsingState=!0),!0)},O.prototype.removeSegmentChildren=function(t,e){var i=this._segments[t];return!(!i||!i.removeChildren(e,this._childToSegmentId))&&(i.isCollapsed()&&(this._dirtyCollapsingState=!0),!0)},O.prototype.removeAllSegmentChildren=function(){this._childToSegmentId={};var t=this._segments,e=this._dirtyCollapsingState,i=!1;for(var o in t){var n=this._segments[o];n.removeAllChildren()&&(i=!0,!e&&n.isCollapsed()&&(e=this._dirtyCollapsingState=!0))}return i},O.prototype.fillSegment=function(t,e){var i=Array.isArray(e)?e.length:0;if(i){var o=this._segments,n=this._childToSegmentId,r=o[t];if(r){var s=e.indexOf(t);if(s>=0){r.isCollapsed()&&(this._dirtyCollapsingState=!0),r.removeAllChildren(n);for(var l=s+1;l<i;++l){var a=e[l];if(o[a])break;r.addChild(a,n)}}}}},O.prototype.fillSegments=function(t){var e=Array.isArray(t)?t.length:0;this._childToSegmentId={};for(var i=this._segments,o=this._childToSegmentId,n=null,r=!1,s=0;s<e;++s){var l=t[s],a=i[l];a?((n=a).isCollapsed()&&(this._dirtyCollapsingState=!0),n.removeAllChildren()):n&&(n.addChild(l,o),r=!0)}return r},O.prototype.getSegmentValues=function(t){var e=t?t.length:0;if(!e)return null;for(var i=this._segments,o=this._childToSegmentId,n=null,r=new Array(e),s=0,l=0,a=0,h={};a<e;){var u=t[a];if(i[u]){if(++s,n=i[u],l+=100,r[a]=l,n.setValue(l),s>=this._segmentCount){++a;break}}else r[a]=s?l+10:0,o[u]&&(h[u]=a);++a}if(s){for(;a<e;)u=t[a],r[a]=l+10,o[u]&&(h[u]=a),++a;for(var p in h)n=i[o[p]],r[h[p]]=n.getValue()+1}return s?r:null};const G=O;var W=function(){W.base(this,"constructor"),this._removeRows=this._removeRows.bind(this),this._bySegmentSeparator=this._bySegmentSeparator.bind(this),this._prevData={},this._rids=[],this._compMap={}};h.inherits(W,H),W.prototype._prevData=null,W.prototype._rids,W.prototype._frozen=!1,W.prototype._runningId=0,W.prototype._compMap=null,W.prototype._segments=null,W.prototype._autoSegmentFilling=!1,W.prototype._removedRows=null,W.prototype._userSegmentComparer=null,W.SortLogic,W.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._compMap=null,this._segments=null},W.prototype.getColumnData=function(t){for(var e=new Array(this._rids.length),i=this._rids.length;--i>=0;)e[i]=this._rows[this._rids[i]][t];return e},W.prototype.getRowId=function(t){return this._rids[t]||""},W.prototype.getAllRowIds=function(t){return t?this._rids:this._rids.slice(0)},W.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},W.prototype.getRowCount=function(){return this._rids.length},W.prototype.getDataAt=function(t,e){return this.getData(this._rids[t],e)},W.prototype.getRowDataAt=function(t){return this.getRowData(this._rids[t])},W.prototype.getPreviousData=function(t,e){var i=this._prevData[t]||null;return i?i[e]:null},W.prototype.setData=function(t,e,i){if(!this._needFiring())return this._setData(t,e,i);var o={};return o[e]=i,this.setRowData(t,o)},W.prototype.setRowData=function(t,e,i){if(!t)return!1;var o=this.getRowData(t),n=!1,r="updated",s=!1;if(e){if(o){var l=this._prevData[t];for(var a in e)l[a]=o[a],o[a]=e[a]}else if(r="inserted",o=e,this._rows[t]=o,this._prevData[t]={},i){var h=i.nextRid,u=null!=h?this.getRowIndex(h):-1;u<0&&(u=i.fallback),null==u||u<0||u>=this._rids.length?this._rids.push(t):(this._rids.splice(u,0,t),s=!this._isLastSegment(u))}else this._rids.push(t);n=!0}else if(o){r="removed",this._prevData[t]=this._rows[t],delete this._rows[t],this._segments&&(s=this._segments.containsSegment(t));for(var p=this._rids.length;--p>=0;)if(this._rids[p]===t){this._rids.splice(p,1);break}n=!0}if(n&&this._needFiring())if(this._autoFillSegments())this.dispatchGlobalChange();else{var _=i||{};_.rid=t,_.changes=e,_.rowData=o,_.type=r,s&&(_.segmentChanged=!0),this._dispatchDataChange(_)}return n},W.prototype.setColumnData=function(t,e,i){var o=e?e.length:0;if(!(o<0)){var n=this._frozen;this.freeze();for(var r=this._generateRids(o,i),s=0;s<o;++s)this._setData(r[s],t,e[s]);this.freeze(n)}},W.prototype.setDataFromObjectMap=function(t){if(t)if(Array.isArray(t))this.addRows(t);else{var e=this._frozen;for(var i in this.freeze(),t)this.setRowData(i,t[i]);this.freeze(e)}},W.prototype.setDataFrom2DArray=function(t,e,i){var o=t?t.length:0;if(!(o<0)){var n=this._frozen;this.freeze();for(var r=0,s=this._generateRids(o,i),l=0;l<o;++l){var a=t[l],h=s[l];if(e)for(r=a.length;--r>=0;)this._setData(h,e[r],a[r]);else for(r=a.length;--r>=0;)this._setData(h,""+r,a[r])}this.freeze(n)}},W.prototype.setDataAt=function(t,e,i){var o=this.getRowId(t);return!!o&&this.setData(o,e,i)},W.prototype.setRowDataAt=function(t,e,i){var o=this.getRowId(t);return!!o&&this.setRowData(o,e,i)},W.prototype.addRow=function(t,e){return t||(t={}),e=this._generateUniqueRid(t,e),this.setRowData(e,t),e},W.prototype.addRows=function(t,e){if(Array.isArray(t)){var i=t.length;if(i)if(1!==i){e||(e=[]);var o=this._frozen;this.freeze();for(var n=0;n<i;++n)this.addRow(t[n],e[n]);this.freeze(o)}else this.addRow(t[0],e?e[0]:null)}},W.prototype.unshiftRow=function(t,e){return this.insertRow(0,t,e)},W.prototype.insertRow=function(t,e,i){var o={};return"number"==typeof t?(o.nextRid=this._rids[t],o.fallback=t):o.nextRid=t,e||(e={}),i=this._generateUniqueRid(e,i),this.setRowData(i,e,o),i},W.prototype.insertAfter=function(t,e,i){var o="string"==typeof t?this.getRowIndex(t):t;return!(o>=0)||o>=this._rids.length-1?this.addRow(e,i):this.insertRow(o+1,e,i)},W.prototype.removeRow=function(t){"number"==typeof t?this.setRowData(this.getRowId(t),null):this.setRowData(t,null)},W.prototype.removeRows=function(t){if(1!==t.length){var e,i=!1;for(this._removedRows={},e=t.length;--e>=0;)"number"==typeof(o=t[e])&&(o=this.getRowId(o)),this.getRowData(o)&&(this._prevData[o]=this._rows[o],this._removedRows[o]=1,delete this._rows[o],i=!0);i?(this._rids=this._rids.filter(this._removeRows),this._removedRows=null,this.dispatchGlobalChange()):this._removedRows=null}else{var o=t[0];"number"==typeof o?this.removeRow(o):this.setRowData(o,null)}},W.prototype._removeRows=function(t){return!this._removedRows[t]},W.prototype.clearAllData=function(t){W.base(this,"clearAllData",!0),this._prevData={},this._rids.length&&(this._rids.length=0,this.dispatchGlobalChange(t))},W.prototype.removeAllRows=W.prototype.clearAllData,W._ascendingOrder=function(t,e){return t-e},W.prototype.moveRow=function(t,e,i){var o=null,n="";if(e>=0&&e<this._rids.length||(e=this._rids.length),Array.isArray(t)){var r=t;r.sort(W._ascendingOrder);for(var s=[],l=r.length;--l>=0;){var a=r[l];(n=this._rids[a])&&(s.unshift(n),this._rids.splice(a,1),a<e&&--e)}s.length&&(this._rids.splice.apply(this._rids,[e,0].concat(s)),o=s)}else t<0&&(t=0),t!==e&&t+1!==e&&(n=this._rids.splice(t,1)[0])&&(t<e&&--e,this._rids.splice(e,0,n),o=n);return o&&(this._segments&&this._sort(null),this._dispatchPositionChange(i)),o},W.prototype._moveRow=function(t,e,i){var o=t.length;if(!o)return null;for(var n=new Array(o),r=0;r<o;++r)n[r]=this.getRowIndex(t[r]);var s=e?this.getRowIndex(e):this._rids.length;return o>1?this.moveRow(n,s,i):this.moveRow(n[0],s,i)},W.prototype.moveRows=function(t,e,i,o){"string"==typeof t&&(t=this.getRowIndex(t)),"string"==typeof e&&(e=this.getRowIndex(e)),t<0&&(t=0),e<0&&(e=this._rids.length),i||(i=1);var n=t+i-1,r=e;if(e>=t&&(r=e<=n?t:e-i),i>0&&n<=this._rids.length){r>this._rids.length&&(r=this._rids.length);var s=this._rids.splice(t,i),l=[r,0].concat(s);return Array.prototype.splice.apply(this._rids,l),this._segments&&this._sort(null),this._dispatchPositionChange(o),s}return null},W.prototype.swapRow=function(t,e){var i=this._rids.length;if(!(t<0||t>=i||e<0||e>=i)){var o=this._rids[t];this._rids[t]=this._rids[e],this._rids[e]=o}},W.prototype.clearRowData=W.prototype.removeRow,W.prototype.clearColumnData=function(t,e){for(var i="string"==typeof t?[t]:t,o=i.length;--o>=0;){var n=i[o];if(n)for(var r in this._rows)delete this._rows[r][n],delete this._prevData[r][n]}this.dispatchGlobalChange(e)},W.prototype.getDataSource=function(){return null},W.prototype.setDataSource=function(t){},W.prototype.getSortingLogics=function(){return this._compMap},W.prototype.sortOnce=function(t,e,i,o){var n=W._buildSortContext([],t,e,i||this._compMap,o);return!!this._sort(n)&&(this._dispatchPositionChange(),!0)},W.prototype.setSortingLogic=function(t){this._compMap._default=t},W.prototype.setColumnSortingLogic=function(t,e){this._compMap[t]=e},W.prototype.freeze=function(t){t=!1!==t;var e=this._frozen;return e!==t&&(this._frozen=t,this._autoFillSegments(),this.dispatchGlobalChange()),e},W.prototype.unfreeze=function(t){return this.freeze(!1===t)},W.prototype.isFrozen=function(){return this._frozen},W.prototype.setSegmentSeparator=function(t,e){var i=!1;if("string"==typeof t&&(!1!==e?(this._segments||(this._segments=new G),this._segments.addSegment(t)&&(i=!0)):this._segments&&this._segments.removeSegment(t)&&(i=!0,this._segments.getSegmentCount()||(this._segments=null))),i&&this._needFiring())if(this._autoFillSegments())this.dispatchGlobalChange();else{var o=this._rows[t]||null;o&&this._dispatchDataChange({rid:t,changes:{},rowData:o,type:"updated",segmentChanged:!0})}return i},W.prototype.unsetAllSegmentSeparators=function(){return!!this._segments&&(this._segments=null,this.dispatchGlobalChange(),!0)},W.prototype.hasSegmentation=function(){return!!this._segments},W.prototype.isSegmentSeparator=function(t){return!!this._segments&&this._segments.containsSegment(t)},W.prototype.getSegmentParentRowId=function(t){return this._segments?this._segments.getParentRowId(t):""},W.prototype.getSegmentValues=function(t){return this._segments?this._segments.getSegmentValues(t||this._rids):null},W.prototype._isLastSegment=function(t){var e=this._segments;if(e)for(var i=this._rids,o=i.length,n=t+1;n<o;++n)if(e.containsSegment(i[n]))return!1;return!0},W.prototype._getSegmentSeparators=function(){return this._segments},W.prototype.enableAutoSegmentFilling=function(t){this._autoSegmentFilling=0!=t,this._autoFillSegments()},W.prototype._autoFillSegments=function(){return!!this._autoSegmentFilling&&this.fillSegments()},W.prototype.fillSegment=function(t){this._segments&&this._segments.fillSegment(t,this._rids)},W.prototype.fillSegments=function(){return!!this._segments&&this._segments.fillSegments(this._rids)},W.prototype.addSegmentChild=function(t,e){return!(!this._segments||!this._segments.addSegmentChild(t,e))&&(this._sort(null)&&this._dispatchPositionChange(),!0)},W.prototype.addSegmentChildren=function(t,e){return!(!this._segments||!this._segments.addSegmentChildren(t,e))&&(this._sort(null)&&this._dispatchPositionChange(),!0)},W.prototype.removeSegmentChild=function(t,e){return!!this._segments&&this._segments.removeSegmentChild(t,e)},W.prototype.removeSegmentChildren=function(t,e){return!!this._segments&&this._segments.removeSegmentChildren(t,e)},W.prototype.removeAllSegmentChildren=function(){return!!this._segments&&this._segments.removeAllSegmentChildren()},W.prototype.getSegmentIds=function(){return this._segments?this._segments.getSegmentIds():null},W.prototype.getSegmentChildIds=function(t){if(this._segments){var e=this._segments.getSegment(t);if(e){var i=e.getChildIds();return i.length?i:null}}return null},W.prototype.sortSegments=function(t){if(this._segments&&"function"==typeof t){var e,i=this._rids,o=this._segments,n=o.getSegmentCount(),r=[],s=[],l=0,a=i.length,h="",u=null;for(e=0;e<a&&(h=i[e],!((u=o.getSegment(h))&&(s.push(e),r.push(u),++l>=n)));++e);this._userSegmentComparer=t,r.sort(this._bySegmentSeparator),this._userSegmentComparer=null;var p=!1;for(e=0;e<l;++e){var _=s[e];h=i[_];var c=(u=r[e]).getId();h!==c&&(i[_]=c,p=!0)}p&&(this._sort(null),this._dispatchPositionChange())}},W.prototype._bySegmentSeparator=function(t,e){return this._userSegmentComparer(this.getRowData(t.getId()),this.getRowData(e.getId()))},W.prototype._sort=function(t){var e=this._rids,i=this.getMultipleRowData(e),o=this.getSegmentValues(e),n=W._performMultiLevelSorting(i,t,o);return!!n&&(this._rids=W._reorderItems(e,n),!0)},W.prototype.dispatchGlobalChange=function(t){!t&&this._needFiring()&&this._dispatchDataChange(W._globalChangeArg)},W.prototype._dispatchPositionChange=function(t){!t&&this._needFiring()&&this._dispatch("dataChanged",W._positionChangeArg)},W.prototype.dump=function(t){return H.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},W.prototype._setData=function(t,e,i){var o=this.getRowData(t);return o||(o={},this._rows[t]=o,this._prevData[t]={},this._rids.push(t)),this._prevData[t][e]=o[e],o[e]=i,!0},W.prototype._generateRids=function(t,e){var i,o=0;if(e)i=e;else{i=[];for(var n=this._rids.length;o<n&&o<t;)i.push(this._rids[o++])}for(o=i.length;o<t;)i.push(""+o++);return i},W.prototype._generateUniqueRid=function(t,e){if(!e){if(t.ROW_ID)return t.ROW_ID;for(e="_"+this._runningId++;this._rows[e];)e="_"+this._runningId++}return e},W.prototype._needFiring=function(){return!this._frozen&&!this._composing},W.getSortingDefinitions=i._deprecatedFunction,W._globalChangeArg={globalChange:!0},W._positionChangeArg={globalChange:!0,positionChangeOnly:!0},W._buildSortContext=function(t,e,i,o,n){var r,s;Array.isArray(e)?(r=e,s=i):(r=[e],s=e?[i]:[0]);var l=null,a=null;"function"==typeof o?l=o:a=o;var h=r.length;t.length=h;for(var u=h;--u>=0;){Array.isArray(a)&&(l=a[u]);var p=t[u];p||(p=t[u]=new Array(5));var _=r[u];p[0]=_,p[1]=null,p[2]=l||a[_]||a._default,p[2]||(p[2]=W._defaultComparer),p[3]=W._getSortOrder(s[u]),p[4]=n}return t},W._multiColumnCompareLogic=function(t,e,i,o){for(var n=o.length,r=0,s=0;s<n;++s){var l=o[s];if(r=W._singleColumnCompareLogic(t,e,l[3],l))return r}return r},W._singleColumnCompareLogic=function(t,e,i,o){var n=o[1];return o[2](n[t],n[e],i,o[4])},W._performMultiLevelSorting=function(t,e,i){var o=t?t.length:0,n=e?e.length:0;if(!o)return null;for(var r=0;r<n;++r){var s=e[r],l=s[0],a=s[1];a?a.length=o:a=s[1]=new Array(o);for(var h=0;h<o;++h)a[h]=t[h][l]}if(i){var u=["ROW_SEGMENT",i,W._segmentComparer,1,null];e?(e=e.slice()).unshift(u):e=[u],++n}if(!n)return null;var p,_,c=0;return n>1?(p=W._multiColumnCompareLogic,_=e,c=1):(p=W._singleColumnCompareLogic,c=(_=e[0])[3]),W._mergeSort(o,c,p,_)},W._mergeSort=function(t,e,i,o){for(var n,r,s,l,a,h=!1,u=1,p=W._createIndexArray(t),_=p.slice();u<=t;){for(n=a=0;n<t;)if((a=(s=l=(r=a)+u)+u)>t&&(a=t),s<a){for(;;)if(i(p[r],p[s],e,o)<=0){if(_[n++]=p[r],++r>=l){for(;s<a;)_[n++]=p[s],++s;break}}else if(h=!0,_[n++]=p[s],++s>=a){for(;r<l;)_[n++]=p[r],++r;break}}else for(;n<t;)_[n]=p[n],++n;var c=p;p=_,_=c,u<<=1}return h?p:null},W._reorderItems=function(t,e){if(e){for(var i=t.length;--i>=0;)e[i]=t[e[i]];return e}return t},W._createIndexArray=function(t){var e=W._idxAryMap[t];if(!e){W._idxAryCount>50&&(W._idxAryMap={},W._idxAryCount=0),e=W._idxAryMap[t]=new Array(t),W._idxAryCount++;for(var i=0;i<t;++i)e[i]=i}return e.slice()},W._idxAryMap={},W._idxAryCount=0,W._segmentComparer=function(t,e){return t===e?0:t<e?-1:1},W._defaultComparer=function(t,e,i){return null==t||t!=t?null==e||e!=e?0:1:null==e||e!=e?-1:t<e?-i:e<t?i:0},W._getSortOrder=function(t){if("number"==typeof t)return t;if(t&&"string"==typeof t){if("a"===(t=t.charAt(0).toLowerCase()))return 1;if("d"===t)return-1}return 0},W._proto=W.prototype;const B=W;var Y=function(t,e){this._onDataChanged=this._onDataChanged.bind(this),this._refs=[],t&&(this._dt=t,this._dt.listen("dataChanged",this._onDataChanged,0)),e&&(this._field=e)};Y.prototype.dispose=function(){this._dt&&(this._dt.unlisten("dataChanged",this._onDataChanged),this._dt=null)},Y.prototype.setDataSource=function(t){this._dt!==t&&(this._dt&&this._dt.unlisten("dataChanged",this._onDataChanged),this._dt=t,this._dt&&this._dt.listen("dataChanged",this._onDataChanged,0),this._requestRecalculation())},Y.prototype.setField=function(t){this._field!==t&&(this._field=t,this._requestRecalculation())},Y.prototype.disableOnDemandMode=function(t){var e=!1===t;this._onDemandMode!==e&&(this._onDemandMode=e,this._requestRecalculation())},Y.prototype.setColumnDataGetter=function(t){this._colDataGetter!==t&&(this._colDataGetter=t,this._requestRecalculation())},Y.prototype.getColumnDataGetter=function(){return this._colDataGetter},Y.prototype.getSum=function(){return this._updateStats(),this._sum},Y.prototype.getDataCount=function(){return this._updateStats(),this._count},Y.prototype.getMin=function(){return this._updateStats(),this._min},Y.prototype.getMax=function(){return this._updateStats(),this._max},Y.prototype.getAbsoluteMax=function(){this._updateStats();var t=this._max>=0?this._max:-this._max,e=this._min>=0?this._min:-this._min;return t>=e?t:e},Y.prototype.getAverage=function(){return this._updateStats(),this._sum/this._count},Y.prototype.getMean=Y.prototype.getAverage,Y.prototype.getMidRange=function(){return this._updateStats(),.5*(this._max+this._min)},Y.prototype.getCachedColumnData=function(){return this._dirty?this._recalculate():this._cacheData||(this._cacheData=this._getColData()),this._cacheData},Y.prototype.markDirty=function(){return!!this._onDemandMode&&(this._dirty=!0,this._dirty)},Y.prototype._getColData=function(){return this._colDataGetter?this._colDataGetter(this._field,this._dt):this._dt.getColumnData(this._field)},Y.prototype._requestRecalculation=function(){this.markDirty()||this._recalculate()},Y.prototype._updateStats=function(){this._dirty&&this._recalculate()},Y.prototype._recalculate=function(){if(this._dirty=!1,this._cacheData=null,this._sum=0,this._min=NaN,this._max=NaN,this._count=0,this._dt&&this._field){var t=this._cacheData=this._getColData(),e=t.length;if(e){for(var i,o=Y._isDataNumeric,n=0;n<e;)if(o(i=+t[n++])){this._sum=this._min=this._max=i,++this._count;break}for(;n<e;)o(i=+t[n])&&(this._sum+=i,i<this._min?this._min=i:i>this._max&&(this._max=i),++this._count),++n}}},Y.prototype._onDataChanged=function(t){if(t.rid){if(!this._colDataGetter&&t.changes&&null==t.changes[this._field])return;if(this.markDirty())return;this._updateRowData(t.rid)}else if(t.rids){if(this.markDirty())return;var e=t.rids;1===e.length?this._updateRowData(e[0]):this._recalculate()}else if(t.globalChange){if(t.positionChangeOnly)return void(this._cacheData=null);this._requestRecalculation()}},Y.prototype._updateRowData=function(t){var e=this._dt.getPreviousData(t,this._field),i=this._dt.getData(t,this._field);if(e!==i){var o=Y._isDataNumeric(i);if(Y._isDataNumeric(e)){if(this._min===e&&(!o||i>this._min))return void this._recalculate();if(this._max===e&&(!o||i<this._max))return void this._recalculate();this._sum-=e,--this._count}o&&(this._sum+=i,i>=this._min||(this._min=i),i<=this._max||(this._max=i),++this._count)}},Y._isDataNumeric=function(t){return"number"==typeof t&&t==t},Y.prototype.addRef=function(t){return t&&this._refs.indexOf(t)<0&&this._refs.push(t),this._refs.length},Y.prototype.deRef=function(t){if(t){var e=this._refs.indexOf(t);e>=0&&this._refs.splice(e,1)}return this._refs.length},Y.prototype.getRefCount=function(){return this._refs.length},Y.prototype._dt=null,Y.prototype._field="",Y.prototype._onDemandMode=!0,Y.prototype._dirty=!0,Y.prototype._cacheData=null,Y.prototype._sum=0,Y.prototype._min=NaN,Y.prototype._max=NaN,Y.prototype._count=0,Y.prototype._colDataGetter=null,Y.prototype._refs;const X=Y;var q=function(t,e,i){this._onConflated=this._onConflated.bind(this),this._data=[],"function"==typeof t?this.setFunction(t,i):"function"==typeof e&&this.setFunction(e,i),"number"==typeof e?this.setConflatingTime(e):"number"==typeof t&&this.setConflatingTime(t)};q.prototype._data,q.prototype._func=null,q.prototype._delay=0,q.prototype._timerId=0,q.prototype._conflated=!1,q.prototype._disabled=!1,q.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},q.prototype.popAllData=function(){if(this._data.length){var t=this._data;return this._data=[],t}return null},q.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},q.prototype.conflate=function(t){return!this._disabled&&(null!=t&&this._data.push(t),!this._conflated&&(this._timerId||(this._timerId=setTimeout(this._onConflated,this._delay)),!0))},q.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},q.prototype._onConflated=function(){this._conflated=!0;try{this._func()}catch(t){console.error(t.message||t)}this._timerId=0,this._data.length=0,this._conflated=!1},q.prototype.getData=function(){return this._data},q.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},q.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},q.prototype.getConflatingTime=function(){return this._delay},q.prototype.disable=function(t){this._disabled=!1!==t},q.prototype.isEnabled=function(){return!this._disabled},q.prototype.enable=function(t){this._disabled=!1===t};var U=function(t){var e=this;e._groupFilterLogic=e._groupFilterLogic.bind(e),e._internalGroupSortingLogic=e._internalGroupSortingLogic.bind(e),e._onDataChanged=e._onDataChanged.bind(e),e._onGroupAdded=e._onGroupAdded.bind(e),e._onBeforeGroupAdded=e._onBeforeGroupAdded.bind(e),e._onRefreshTimeout=e._onRefreshTimeout.bind(e),e._rids=[],e._sortingDefs=[],e._columnStats={},e._shared={},e._conflator=new q(this._onDataChanged,0),e._conflator.disable(),e._addEvents("dataChanged","preDisposed","pageIndexChanged","pageCountChanged","groupAdded","beforeGroupAdded","groupCriteriaChanged","beforeFiltering"),e.setDataSource(t)};h.inherits(U,s),U.prototype._rids,U.prototype._groupView=null,U.prototype._pageView=null,U.prototype._expansionView=null,U.prototype._hiddenRids=null,U.prototype._collapsedRids=null,U.prototype._expansionMap=null,U.prototype._expansionChildren=null,U.prototype._expansionCount=0,U.prototype._dt=null,U.prototype._parent=null,U.prototype._shared=null,U.prototype._sortingDefs=null,U.prototype._userFilter=null,U.prototype._filteringOut=!1,U.prototype._refreshTimerId=0,U.prototype._groupSortingLogic=null,U.prototype._pageCorrection=!0,U.prototype._pageSize=0,U.prototype._pageIndex=1,U.prototype._lastPageIndex=0,U.prototype._groupCriteria=null,U.prototype._preDefGroups=null,U.prototype._preDefGroupsDirty=!1,U.prototype._groupMembers=null,U.prototype._groupList=null,U.prototype._groupRows=null,U.prototype._groupId="",U.prototype._groupValue,U.prototype._groupRowId="",U.prototype._footerRowIds=null,U.prototype._groupLevel=0,U.prototype._groupViewDirty=!1,U.prototype._columnStats,U.prototype._hidden=!1,U.prototype._hiddenHeaderRow=!1,U.prototype._collapsed=!1,U.prototype._showOnlyFirstMember=!1,U.prototype._beingAdded=!1,U.prototype._conflator=null,U.prototype.dispose=function(){if(this._dispatch("preDisposed",{}),this.unlistenAll(),this.setDataSource(null),this.groupBy(null),this._conflator.dispose(),this._sortingDefs=null,this._shared=null,this._userFilter=this._groupSortingLogic=null,this._refreshTimerId&&(clearTimeout(this._refreshTimerId),this._refreshTimerId=0),this._columnStats){for(var t in this._columnStats)this._columnStats[t].dispose();this._columnStats=null}},U.prototype.getData=function(t,e){return this._dt.getData(t,e)},U.prototype.getRowData=function(t){return this._dt.getRowData(t)},U.prototype.getColumnData=function(t,e){for(var i=this.getAllRowIds(!0,e),o=[],n=i.length,r=0;r<n;++r){var s=this._dt.getRowData(i[r]);s?o.push(s[t]):e&&o.push(null)}return o},U.prototype.getRowId=function(t){return this._rebuildRowIdsFromChildren(),this._getRids()[t]||""},U.prototype._toRowId=function(t){return"number"==typeof t?(this._rebuildRowIdsFromChildren(),this._getRids()[t]||""):t||""},U.prototype._toRowIds=function(t){for(var e=Array.isArray(t)?t.length:0,i=new Array(e),o=this._getRids(),n=0;n<e;++n){var r=t[n];"number"==typeof r?(this._rebuildRowIdsFromChildren(),i[n]=o[r]||""):i[n]=r||""}return i},U.prototype.getAllRowIds=function(t,e){this._rebuildRowIdsFromChildren();var i=e?this._getRids():this._pageView||this._rids;return t?i:i.slice(0)},U.prototype.getSortedRowIds=function(t){return this._rebuildRowIdsFromChildren(),t?this._rids:this._rids.slice(0)},U.prototype.getRowIndex=function(t){return this._rebuildRowIdsFromChildren(),this._getRids().indexOf(t)},U.prototype.getRowCount=function(){return this._getRids().length},U.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},U.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},U.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},U.prototype.getMultipleRowData=function(t,e,i){return this._dt.getMultipleRowData(t,e,i)},U.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},U.prototype.setData=function(t,e,i){return!!this._dt&&this._dt.setData(t,e,i)},U.prototype.setRowData=function(t,e,i){return!(!t||!this._dt||this.isRowExpansion(t))&&this._dt.setRowData(t,e,i)},U.prototype.setColumnData=function(t,e,i){this._dt&&this._dt.setColumnData(t,e,i)},U.prototype.setDataAt=function(t,e,i){var o=this.getRowId(t);return!(!o||!this._dt)&&this._dt.setData(o,e,i)},U.prototype.setRowDataAt=function(t,e,i){var o=this.getRowId(t);return this.setRowData(o,e,i)},U.prototype.insertRow=function(t,e,i){this._rebuildRowIdsFromChildren();var o=this._toRowId(t);return this._dt?this._dt.insertRow(o,e,i):""},U.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},U.prototype.removeRows=function(t){if(this._dt){for(var e=t.length;--e>=0;){var i=t[e];"number"==typeof i&&(t[e]=this.getRowId(i))}this._dt.removeRows(t)}},U.prototype.moveRow=function(t,e){this._rebuildRowIdsFromChildren();for(var i=this._getRids(),o=e>=0&&e<i.length?i[e]:"",n=Array.isArray(t)?t:[t],r=n.length,s=new Array(r),l=0;l<r;++l)s[l]=i[n[l]];return this._dt.hasSegmentation()&&this.synchronizeRowOrder(),this._dt._moveRow(s,o)},U.prototype.swapRow=i._deprecatedFunction,U.prototype.getDataTable=function(){return this._dt},U.prototype.getDataSource=function(){return this._parent},U.prototype.setDataSource=function(t){if(t){if(this._groupLevel>0)return;this._setParent(t),this._onDataChanged(B._globalChangeArg),this._parent.listen("dataChanged",this._onDataChanged)}else this._parent&&(this._parent.unlisten("dataChanged",this._onDataChanged),this._resetAllViews(),this._groupViewDirty=!1),this._parent=this._dt=null,this._shared={}},U.prototype.setConflationRate=function(t){this._conflator.disable(!t),this._conflator.setConflatingTime(t)},U.prototype.getConflationRate=function(){return this._conflator.getConflatingTime()},U.prototype._resetAllViews=function(){this._rids.length=0,this._groupView&&this._groupView.length&&(this._groupView.length=0),this._pageView&&this._pageView.length&&(this._pageView.length=0),this._expansionView&&this._expansionView.length&&(this._expansionView.length=0)},U.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},U.prototype.sort=function(t,e,i,o){if(this._groupLevel>0)window.console.log("ERROR: Sub-group cannot be sorted individually");else{var n=this.getSortingLogics(),r=this._sortingDefs,s=r.length;if(Array.isArray(i))for(var l=i.length;--l>=0;)if("function"!=typeof i[l]){var a=Array.isArray(t)?t[l]:t;i[l]=n[a]||n._default}if(B._buildSortContext(r,t,e,i||n),1===r.length&&0===r[0][3]&&(r.length=0),!(s<=0&&r.length<=0||this._shared.stalledRids)){var h=!1;this._groupMembers||r.length<=0||o?(h=!0,this._updateRowIds()):h=this._sort(),h&&this._dispatchDataChange(B._positionChangeArg)}}},U.prototype.sortOnce=function(t,e){this.sort(t,e),this._sortingDefs.length=0},U.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},U.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},U.prototype.isSorting=function(){return this._sortingDefs.length>0},U.prototype.hideRow=function(t,e){this.showRows([t],!1===e)},U.prototype.hideRows=function(t,e){this.showRows(t,!1===e)},U.prototype.showRows=function(t,e){var i=!1===e;if(i)this._hiddenRids||(this._hiddenRids={});else if(!this._hiddenRids)return;for(var o=this._toRowIds(t),n=o.length;--n>=0;){var r=o[n];r&&(this._hiddenRids[r]=i)}this._refreshAndNotify()},U.prototype.unhideAllRows=function(){this._hiddenRids&&(this._hiddenRids=null,this._refreshAndNotify())},U.prototype.hasHiddenRow=function(){return!!this._hiddenRids},U.prototype.filterIn=function(t,e,i){var o=this._getFilterLogic(t,e),n=!0===i;return!!(this._userFilter!==o||"function"==typeof t||o&&n!==this._filteringOut)&&(this._shared.filterLogic=o,this._userFilter=o,this._filteringOut=n,this._refreshAndNotify(),!0)},U.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},U.prototype.filterInOnce=function(t,e,i){var o=this._getFilterLogic(t,e);if(o){for(var n=!0===i,r=this._rids,s=this._dt,l={},a=0,h=r.length;--h>=0;){var u=r[h],p=s.getRowData(u);p&&o(u,p)!==n||(l[u]=!0,++a)}if(!(a<=0)){var _=this._removeRowIds(l);this._updatePageCount()||this._transformView(_)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(Object.keys(l))}}},U.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},U.prototype._removeRowIds=function(t){var e=this._removeArrayItems(this._rids,t);if(this._groupView&&(e=this._removeArrayItems(this._groupView,t)),this._groupMembers)for(var i=this._groupList.length,o=0;o<i;++o){var n=this._groupList[o];this._groupMembers[n]._removeRowIds(t)}return e},U.prototype.clearFilter=function(){this._userFilter&&(this._userFilter=null,this._shared.filterLogic=null,this._refreshAndNotify())},U.prototype.disablePageCorrection=function(t){this._pageCorrection=!1===t},U.prototype.setPage=function(t){var e=this._setPage(t);return e&&this._dispatchGlobalChange(),e},U.prototype.gotoPage=U.prototype.setPage,U.prototype.nextPage=function(){return this.gotoPage(this._pageIndex+1)},U.prototype.previousPage=function(){return this.gotoPage(this._pageIndex-1)},U.prototype.prevPage=U.prototype.previousPage,U.prototype.lastPage=function(){return this.gotoPage(this._lastPageIndex-1)},U.prototype.firstPage=function(){return this.gotoPage(0)},U.prototype.getCurrentPage=function(){return this._pageIndex},U.prototype.getPageIndex=U.prototype.getCurrentPage,U.prototype.isOnLastPage=function(){return this._pageIndex===this._lastPageIndex},U.prototype.isOnFirstPage=function(){return 1===this._pageIndex},U.prototype.getPageSize=function(){return this._pageSize},U.prototype.getPageCount=function(){return this._lastPageIndex},U.prototype.getTotalPages=U.prototype.getPageCount,U.prototype.setPageSize=function(t){t>=0||(t=0),this._pageSize!==t&&(this._pageSize=t,this._updatePageCount(),t>0?this._pageView||(this._pageView=[]):this._pageView&&(this._pageView=null),this._pageView&&0!==t?this._transformView():this._updateRowIds(),this._dispatchGlobalChange())},U.prototype.groupBy=function(t,e){if(this._shared.multiGroupRow=!1,this._groupCriteria){if(this._groupList&&this._groupList.length>0){for(var i in this._groupMembers)this._groupMembers[i].dispose();this._groupMembers={},this._groupList.length=0}this._groupCriteria=null}var o,n,r;if(null!=e&&this._setPredefinedGroups(e),t&&0===this._groupLevel)for(this._groupCriteria=[],n=(r=Array.isArray(t)?t:[t]).length,o=0;o<n;++o){var s=r[o];"string"==typeof s?this._groupCriteria.push(this._defaultGroupCriteria.bind(this,s)):s&&this._groupCriteria.push(s)}if(this._groupCriteria)this._groupMembers||(this._groupMembers={},this._groupList=[],this._groupRows={}),this._groupView||(this._groupView=[]);else{if(this._groupMembers=null,this._groupList=null,this._groupView=null,this._groupRows){if(this._groupLevel<=0)this._footerRowIds=null;else if(this._groupRowId&&delete this._groupRows[this._groupRowId],this._footerRowIds){for(n=this._footerRowIds.length,o=0;o<n;++o)delete this._groupRows[this._footerRowIds[o]];this._footerRowIds=null}this._groupRows=null}this._groupValue=null}this._groupLevel=0,this._updateRowIds(),this._dispatch("groupCriteriaChanged",{}),this._dispatchGlobalChange()},U.prototype.addGroup=function(t){if(this._groupMembers)if(isArray(t))for(var e=t,i=e.length,o=0;o<i;++o)this._addGroup(e[o]);else this._addGroup(t)},U.prototype.sortGroups=function(t){if(this._groupMembers&&(this._groupSortingLogic=null==t?U._defaultGroupSortingLogic:t||null,this._groupSortingLogic)){this._groupList.sort(this._internalGroupSortingLogic);for(var e=this._groupList.length;--e>=0;){var i=this._groupList[e];this._groupMembers[i].sortGroups(this._groupSortingLogic)}this._groupViewDirty=!0,this._groupLevel<=0&&this._dispatchGlobalChange()}},U.prototype.moveGroup=function(t,e){var i=this.getGroup(t);if(i){var o=i.getDataSource(),n=i.getGroupId(),r=o._groupList.indexOf(n);r!==e&&r+1!==e&&(o._groupList.splice(r,1),r<e&&--e,o._groupList.splice(e,0,n),this._requestRebuildingRowIds(!1))}},U.prototype.setPredefinedGroups=function(t){this._setPredefinedGroups(t),this._groupMembers&&this._refreshAndNotify()},U.prototype._setPredefinedGroups=function(t){if(this._preDefGroups!==t){this._preDefGroups&&(this._preDefGroups.length=0);var e=!1;if(t)for(var i=t.length;--i>=0;)if(Array.isArray(t[i])){e=!0;break}e?this._preDefGroups=t:Array.isArray(t)?this._preDefGroups=[t]:this._preDefGroups=null,this._preDefGroupsDirty=!0}},U.prototype.addFooter=function(t){if(this._groupLevel<=0)console.log("WARNING: Only group can have a footer");else if(null==t&&(t=1),!(t<=0)){this._footerRowIds||(this._footerRowIds=[]);for(var e=0;e<t;++e){var i=this._groupRowId+"_footer"+(this._footerRowIds.length||"");this._footerRowIds.push(i),this._groupRows[i]=this}this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},U.prototype.removeFooter=function(){if(this._footerRowIds){for(var t=this._footerRowIds.length,e=0;e<t;++e)delete this._groupRows[this._footerRowIds[e]];this._footerRowIds=null,this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},U.prototype.enableMultiGroup=function(t){this._shared.multiGroupRow=!1!==t},U.prototype.getGroupByRowId=function(t){return this._groupRows&&this._groupRows[t]||null},U.prototype.getGroup=function(t){if(!this._groupMembers)return null;var e;if("number"==typeof t){if(!(e=this._groupList[t]))return null}else e=t+"";var i=this._groupMembers[e];if(i)return i;var o=e;return(i=this._groupRows[o])||this._getGroupByContentRowId(o)},U.prototype._getGroupByContentRowId=function(t){if(this._groupMembers)for(var e=0;e<this._groupList.length;e++){var i=this._groupList[e],o=this._groupMembers[i]._getGroupByContentRowId(t);if(o)return o}else if(-1!==this._rids.indexOf(t))return this;return null},U.prototype.getAllGroups=function(t){if(t||(t=[]),this._groupMembers)for(var e=this._groupList.length,i=0;i<e;++i){var o=this._groupList[i],n=this._groupMembers[o];t.push(n),n.getAllGroups(t)}return t},U.prototype.getGroupList=function(){return this._groupList},U.prototype.getGroupId=function(){return this._groupId},U.prototype.getGroupValue=function(){return this._groupValue},U.prototype.getGroupRowId=function(){return this._groupRowId},U.prototype.getFooterRowIndex=function(t){if(this._footerRowIds)for(var e=this._footerRowIds.length;--e>=0;)if(this._footerRowIds[e]===t)return e;return-1},U.prototype.getFooterRowIds=function(){return this._footerRowIds},U.prototype.hasGroup=function(){return!!this._groupMembers},U.prototype.getGroupRows=function(){return null},U.prototype.getGroupLevel=function(t){if(null!=t&&this._groupRows){if("number"!=typeof t){var e=this.getGroup(t);return e?e._groupLevel:-1}this._rebuildRowIdsFromChildren();for(var i=this._getRids(),o=i[t];o;){var n=this._groupRows[o];if(n)return n._groupLevel;o=i[--t]}}return this._groupLevel},U.prototype.enableColumnStats=function(t,e,i){if(!t)return null;var o=!1!==e,n=this._columnStats[t];if(o?(n||(n=new X(this,t),this._columnStats[t]=n),n.addRef(i)):n&&(n.deRef(i)||(n.dispose(),delete this._columnStats[t])),this._groupMembers)for(var r=this._groupList.length;--r>=0;){var s=this._groupList[r];this._groupMembers[s].enableColumnStats(t,e,i)}return n||null},U.prototype.getColumnStats=function(t){return this._columnStats[t]||null},U.prototype.hide=function(t){var e=!1!==t;return this._hidden!==e&&(this._hidden=e,this._refreshAndNotify(),!0)},U.prototype.isHidden=function(){return this._hidden},U.prototype._isHeaderRowShown=function(){return!(this._hiddenHeaderRow||this._shared.filterLogic&&0===this._rids.length||this._shared.autoGroupHiding&&null==this._groupValue)},U.prototype._setCollapse=function(t){if(this._shared.contentAsHeader){if(this._hiddenHeaderRow&&this._showOnlyFirstMember!==t)return this._showOnlyFirstMember=t,!0}else if(this._isHeaderRowShown()&&this._collapsed!==t)return this._collapsed=t,!0;return!1},U.prototype.collapse=function(t){this._setCollapse(!1!==t)&&(this._shared.contentAsHeader?this._hiddenHeaderRow&&this._requestRebuildingRowIds(this._showOnlyFirstMember):this._groupLevel>0&&this._requestRebuildingRowIds(this._collapsed))},U.prototype.collapseAllGroups=function(t){var e=this.getAllGroups(),i=e.length;if(i){for(var o=!1!==t,n=0;n<i;++n)e[n]._setCollapse(o);this._requestRebuildingRowIds(!1)}},U.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},U.prototype.isCollapsed=function(){return this._collapsed||this._showOnlyFirstMember},U.prototype.enableContentAsHeader=function(t){this._shared.contentAsHeader=!1!==t},U.prototype._getFirstHiddenRids=function(){if(this._shared.contentAsHeader&&this._showOnlyFirstMember){var t=this._rids;if(Array.isArray(t)&&t.length)return[t[0]]}return null},U.prototype.getVisibleRowIds=function(t){return this.getAllRowIds(t,!0)},U.prototype.getVisibleRowCount=function(){return this._collapsed?0:(this._rebuildRowIdsFromChildren(),this._getRids().length)},U.prototype.isRowDataInGroup=function(t,e){var i=this._groupCriteria,o=this._groupLevel;if(!e||e===this.getGroupId())return this._isAllowedInGroup(null,t);for(var n=o;n<i.length;n++)if(i[n](t).indexOf(e)>=0)return!0;return!1},U.prototype.isRowIdInGroup=function(t,e){var i=this.getRowData(t);return!!i&&this.isRowDataInGroup(i,e)},U._getDataViewExpansionId=function(t,e){return t+"_ex"+e},U.prototype.addRowExpansion=function(t,e){if(!(this._groupLevel>0)){if(!e||e<0){if(null!=e)return;e=1}var i=this._rids.indexOf(t);if(!(i<0)){var o=0;this._expansionMap?o=this._expansionMap[t]||0:(this._expansionMap={},this._expansionChildren={});var n=o+e;this._expansionMap[t]=n;for(var r=o;r<n;r++)this._expansionChildren[U._getDataViewExpansionId(t,r)]=t;if(o||this._expansionCount++,!this._groupViewDirty&&this._updateExpansionView()){var s={};s.rid=t,s.type="inserted",s.nextRid=this._rids[i+1],s.fallback=i,this._dispatchDataChange(s)}}}},U.prototype.removeRowExpansion=function(t){if(this._expansionMap){var e=this._expansionMap[t];if(e){for(var i=new Array(e),o=0;o<e;++o)i[o]=U._getDataViewExpansionId(t,o),delete this._expansionChildren[i[o]];delete this._expansionMap[t],this._expansionCount--,this._groupViewDirty||this._updateExpansionView()&&(1===e?this._dispatchRowRemoved(i[0]):this._dispatchMultiRowRemoved(i))}}},U.prototype.toggleRowExpansion=function(t,e,i){var o=this._toRowId(t);(e=null!=e?!0===e:!this.hasRowExpansion(o))?this.addRowExpansion(o,i):this.removeRowExpansion(o)},U.prototype.removeAllRowExpansions=function(){this._expansionMap&&(this._expansionMap=null,this._expansionCount=0,this._expansionView=null,this._expansionChildren=null,this._refreshAndNotify())},U.prototype.getRowsWithExpansion=function(t,e){if(!this._expansionMap)return[];var i=this._expansionView,o=i.length;(null==e||e>o)&&(e=o),t>0||(t=0);for(var n=this._expansionCount,r=new Array(o),s=t;s<e;++s){var l=i[s];if(this._expansionMap[l]&&(r[s]=l,--n<=0))break}return r},U.prototype.getExpansionParents=function(t,e){var i=[];if(this._expansionMap){var o=this._expansionView,n=o.length;(null==e||e>n)&&(e=n),(!t||t<0)&&(t=0);for(var r=t;r<e;++r)i[r]=this._expansionChildren[o[r]]||""}return i},U.prototype.isRowExpansion=function(t){return!!this._expansionChildren&&!!this._expansionChildren[t]},U.prototype.hasRowExpansion=function(t){return!!this._expansionMap&&!!this._expansionMap[t]},U.prototype.getRowExpansionId=function(t,e){return this._expansionMap&&(e||(e=0),e<(this._expansionMap[t]||0))?U._getDataViewExpansionId(t,e):""},U.prototype.getRowExpansionIndex=function(t){if(t){var e=t.match(/_ex(\d+)$/);if(e)return+e[1]}return-1},U.prototype._updateExpansionView=function(){var t=this._expansionMap;if(t){if(!this._expansionCount||this._expansionCount<0)return this._expansionCount=0,this._expansionMap=null,this._expansionView=null,this._expansionChildren=null,!0;var e=this._pageView||this._groupView||this._rids,i=e.length,o=this._expansionView?this._expansionView.length:0;this._expansionView?this._expansionView.length=i:this._expansionView=new Array(i);for(var n=this._expansionCount,r=0,s=0;r<i;++r){var l=e[r];if(this._expansionView[s++]=l,n){var a=t[l]||0;if(a){for(var h=0;h<a;++h)this._expansionView[s++]=U._getDataViewExpansionId(l,h);--n}}}return o!==this._expansionView.length}return!1},U.prototype._transformView=function(t){var e=this._updatePaginationView(t);return!!(e|=this._updateExpansionView())},U.prototype.searchAll=function(t,e){e||(e=[]),this._rebuildRowIdsFromChildren();for(var i=this._getRids(),o=i.length,n=0;n<o;++n){var r=i[n],s=this._dt.getRowData(r);s&&t(s)&&e.push(r)}return e},U.prototype.searchPrev=function(t,e){this._rebuildRowIdsFromChildren();var i=this._getRids(),o=-1;"number"==typeof t?this._dt.getRowData(i[t])&&(o=t):o=i.indexOf(t);var n=-1,r=i.length;return o>0&&(n=this._searchRow(i,e,o-1,-1,-1))>=0||o>=0&&(n=this._searchRow(i,e,r-1,o,-1))>=0?n:-1},U.prototype.searchNext=function(t,e){this._rebuildRowIdsFromChildren();var i=this._getRids(),o=-1;if("number"==typeof t?this._dt.getRowData(i[t])&&(o=t):o=i.indexOf(t),o<0)return-1;var n=-1,r=i.length;return o<r-1&&(n=this._searchRow(i,e,o+1,r,1))>=0||o>0&&(n=this._searchRow(i,e,0,o,1))>=0?n:-1},U.prototype._searchRow=function(t,e,i,o,n){for(;i!==o;){var r=t[i],s=this._dt.getRowData(r);if(s&&e(s))return i;i+=n}return-1},U.prototype.stall=function(t){var e=!1!==t;if(!!this._shared.stalledRids===e)return!1;if(e){var i={};this._shared.stalledRids=i;for(var o=this._getRids(),n=o.length;--n>=0;)i[o[n]]=1}else this._shared.stalledRids=null,this._refreshAndNotify();return!0},U.prototype.enableAutoGroupRemoval=function(t){return t=!1!==t,!!this._shared.autoGroupRemoval!==t&&(this._shared.autoGroupRemoval=t,this._triggerGroupRefreshing(),!0)},U.prototype.enableAutoGroupHiding=function(t){return t=!1!==t,!!this._shared.autoGroupHiding!==t&&(this._shared.autoGroupHiding=t,this._triggerGroupRefreshing(),!0)},U.prototype.synchronizeRowOrder=function(){this.isSorting()&&this._dt._sort(this._sortingDefs)},U.prototype.setSegmentSeparator=function(t,e){var i="";return"number"==typeof t?i=this.getRowId(t):"string"==typeof t&&(i=t),!!i&&((e=!1!==e)&&this.synchronizeRowOrder(),this._dt.setSegmentSeparator(i,e))},U.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},U.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},U.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},U.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},U.prototype.collapseSegment=function(t,e){e=!1!==e;var i=this._dt._getSegmentSeparators();if(i){var o=this._toRowId(t);if(i.collapseSegment(o,e))return this._refreshAndNotify(),!0}return!1},U.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},U.prototype.expandAllSegments=function(){var t=this._dt._getSegmentSeparators();return!(!t||!t.expandAllSegments()||(this._refreshAndNotify(),0))},U.prototype.setSegmentCollapsingLogic=function(){},U.prototype.isSegmentCollapsed=function(t){var e=this._dt._getSegmentSeparators();return!!e&&e.isCollapsedSegment(this._toRowId(t))},U.prototype.fillSegment=function(t){this._dt.fillSegment(this._toRowId(t))},U.prototype.fillSegments=function(){this._dt.fillSegments()},U.prototype.addSegmentChild=function(t,e){if(this._dt._getSegmentSeparators()){var i=this._toRowId(t),o=this._toRowId(e);return this._dt.addSegmentChild(i,o)}return!1},U.prototype.addSegmentChildren=function(t,e){if(this._dt._getSegmentSeparators()){var i=this._toRowId(t),o=this._toRowIds(e);return this._dt.addSegmentChildren(i,o)}return!1},U.prototype.removeSegmentChild=function(t,e){if(this._dt._getSegmentSeparators()){var i=this._toRowId(t),o=this._toRowId(e);return this._dt.removeSegmentChild(i,o)}return!1},U.prototype.removeSegmentChildren=function(t,e){if(this._dt._getSegmentSeparators()){var i=this._toRowId(t),o=this._toRowIds(e);return this._dt.removeSegmentChildren(i,o)}return!1},U.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},U.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},U.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},U.prototype.sortSegments=function(t){this._dt.sortSegments(t)},U.prototype.dump=function(t){this._rebuildRowIdsFromChildren();var e=this._getRids();return H.constructTable(this.getMultipleRowData(e),t,e)},U.prototype.log=function(t){console.table(this.dump(t))},U.prototype._getRids=function(){return this._expansionView||this._pageView||this._groupView||this._rids},U.prototype._updateRowIds=function(t){if(this._groupViewDirty=!1,this._parent&&!this._hidden){if(!this._shared.stalledRids){this._rids=t||this._parent.getAllRowIds(),this._hiddenRids&&this._removeArrayItems(this._rids,this._hiddenRids);var e=this._dt._getSegmentSeparators();this._collapsedRids=null;var i=null;if(e){i=e.getSegments();var o=this._collapsedRids=e.getCollapsedRows();o&&this._removeArrayItems(this._rids,o)}if(this._dispatch("beforeFiltering",{}),this._quickFilter(this._userFilter,this._filteringOut,i),this._groupLevel>0&&!t&&this._quickFilter(this._groupFilterLogic,!1),this._groupMembers)this._populateGroups();else{var n=this._updatePageCount();this._sort()||n||this._transformView()}}}else this._resetAllViews()},U.prototype._onDataChanged=function(t){if(!this._conflator.conflate(t)){var e=this._conflator.popAllData()||[t],i=e.length;if(1===i){var o=e[0];if(o.globalChange)return this._updateRowIds(),void this._dispatchDataChange(t);var n=o.type;"inserted"===n?this._onRowInserted(o):"removed"===n?this._onRowRemoved(o):this._onRowUpdated(o)}else{this._updateRowIds();for(var r=!0,s=0;s<i;s++)if(!e[s].positionChangeOnly){r=!1;break}this._dispatchDataChange({globalChange:!0,positionChangeOnly:r,events:e})}}},U.prototype._onRowInserted=function(t){if(this._shared.stalledRids)return 0;if(this.isRowFiltered(t.rid,t.rowData))return 0;var e=0;if(this._groupMembers){var i,o=this._resolveGroupId(t.rowData),n=o.length;n>1&&(this._shared.multiGroupRow=!0);for(var r=0;r<n;r++)if(i=o[r],this._groupMembers[i])e=this._groupMembers[i]._onRowInserted(t);else{var s=this._addGroup(i);s&&(t.globalChange=!0,s._onRowInserted(t),e=1)}t.globalChange&&(this._groupViewDirty=!0)}if(this._hidden)return e;var l=t.rid,a=t.rowData;if(!this._isAllowedInGroup(l,a))return e;var h,u=t.nextRid;h=this.isSorting()&&!t.segmentChanged?this._addDataRow(l):this._addDataRow(l,u,t.fallback);var p=this._updatePageCount(),_=this._sort();return _&&(t.globalChange=!0),t.globalChange?_||p||this._transformView():(t={rid:l,rowData:a,type:"inserted"},null!=u&&(t.nextRid=u,t.fallback=h),this._transformView(h)&&(t.globalChange=!0)),this._dispatchDataChange(t),1},U.prototype._onRowRemoved=function(t){if(this._shared.stalledRids)return 0;if(t.segmentChanged&&this.isSorting())return this._refreshAndNotify(),1;var e,i=0,o=t.rids;if(this._groupMembers){var n,r,s=t.rowData;if(!o&&s){for(n=this._resolveGroupId(s),e=0;e<n.length;e++)r=n[e],this._groupMembers[r]&&(i+=this._groupMembers[r]._onRowRemoved(t));i>1&&(this._groupViewDirty=!0)}else{var l=this._groupList.length;for(e=0;e<l;++e)r=this._groupList[e],i+=this._groupMembers[r]._onRowRemoved(t)}}var a,h,u=NaN,p=null;if(i=0,o){for(p=[],e=o.length;--e>=0;)a=o[e],(h=this._removeDataRow(a))>=0&&(p.push(a),h>=u||(u=h));i=p.length}else a=t.rid,(h=this._removeDataRow(a))>=0&&(p=[a],u=h,i=1);return i>0&&(this._updatePageCount()||this._transformView(u)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(p),this._shared.autoGroupRemoval&&this._groupRows&&this._rids.length<=0&&this._triggerGroupRefreshing(),this._hiddenHeaderRow&&this._requestRebuildingRowIds(!0)),i},U.prototype._onRowUpdated=function(t){var e,i,o=t.rid,n=t.rowData;if(this.isRowFiltered(o,n))return this._onRowRemoved(t)?1:0;if(this._groupMembers){var r=[],s=this._groupList.length;for(e=0;e<s;++e)i=this._groupList[e],r[this._groupMembers[i]._onRowUpdated(t)]=!0;t.globalChange&&(this._groupViewDirty=!0);var l=0;if(r[2]?l=2:r[1]?this._isAllowedInGroup(o,n)||(l=1):r[4]&&(l=4),this._groupLevel>0)1===l?(this._removeArrayItem(this._rids,o)>=0&&this._groupView&&this._removeArrayItem(this._groupView,o),this._shared.multiGroupRow&&(this._groupViewDirty=!0)):2===l&&(this._hidden||(this._rids.indexOf(o)<0&&this._rids.push(o),this._groupViewDirty=!0,this._resolveGroupId(n).length>1&&(this._shared.multiGroupRow=!0)));else{var a=r[1]&&r[2]||r[4];if(this._shared.multiGroupRow||!a){var h=this._resolveGroupId(n);for(e=0;e<h.length;e++){i=h[e];var u=this._addGroup(i);u&&(u._onRowInserted(t),l=1)}}!a&&!this._hidden&&this._rids.indexOf(o)<0&&this._addDataRow(o),4===l?this._shared.multiGroupRow?this._dispatchGlobalChange():this._dispatchDataChange(t):(this._groupViewDirty=!0,this._dispatchGlobalChange())}return l}return this._isAllowedInGroup(o,n)?this._rids.indexOf(o)<0?(this._onRowInserted(t),2):(this._shared.stalledRids||this._sort()&&(t.globalChange=!0),this._dispatchDataChange(t),4):this._onRowRemoved(t)?1:0},U.prototype._onGroupAdded=function(t){if(!this._hidden){var e=t.newGroup,o=e.getGroupRowId();this._groupView.push(o),this._groupViewDirty=!0,this._dispatch("groupAdded",t),i.pushArrayItems(this._groupView,e.getFooterRowIds())}},U.prototype._onBeforeGroupAdded=function(t){this._dispatch("beforeGroupAdded",t)},U.prototype._requestRebuildingRowIds=function(t){this._groupMembers&&(this._groupViewDirty=!0),this._groupLevel>0?this._parent._requestRebuildingRowIds(t):(t?this._rebuildRowIdsFromChildren():this._updateRowIds(),this._dispatchGlobalChange())},U.prototype._refreshAndNotify=function(){this._updateRowIds(),this._dispatchGlobalChange()},U.prototype._onRefreshTimeout=function(){this._refreshTimerId=0,this._refreshAndNotify()},U.prototype._addDataRow=function(t,e,i){var o=this._getRowIndex(this._rids,e,i);return this._insertItems(this._rids,o,t),this._groupView?this._groupMembers?(this._groupViewDirty=!0,this._insertItems(this._groupView,-1,t)):o<0?this._insertItems(this._groupView,-1,t):(o=this._getRowIndex(this._groupView,e,i),this._insertItems(this._groupView,o,t)):o>=0?o:this._rids.length-1},U.prototype._insertItems=function(t,e,i){return e<0?(e=t.length,t.push(i)):t.splice(e,0,i),e},U.prototype._getRowIndex=function(t,e,i){if(null==e)return-1;var o=this._rids.indexOf(e);return o>=0?o:null==i||i>=t.length?-1:i},U.prototype._removeDataRow=function(t){var e=this._removeArrayItem(this._rids,t);return this._groupView&&e>=0&&(e=this._removeArrayItem(this._groupView,t)),e},U.prototype._removeArrayItem=function(t,e){for(var i=t.length,o=0;o<i;++o)if(t[o]===e)return t.splice(o,1),o;return-1},U.prototype._removeArrayItems=function(t,e){for(var i=NaN,o=0,n=t.length;--n>=0;)e[t[n]]?++o:o&&(i=n+1,t.splice(i,o),o=0);return o&&(t.splice(0,o),i=0),i},U.prototype._isAllowedInGroup=function(t,e){if(this._groupLevel>0)for(var i=this,o=this._groupLevel;--o>=0;){if(!i._groupFilterLogic(t,e))return!1;i=i.getDataSource()}return!0},U.prototype.isRowFiltered=function(t,e){return this._shared.stalledRids?!this._shared.stalledRids[t]:!((!this._hiddenRids||!this._hiddenRids[t])&&(this.isSegmentSeparator(t)||(!this._collapsedRids||!this._collapsedRids[t])&&(!this._userFilter||this._userFilter(t,e)!==this._filteringOut)))},U.prototype._sort=function(){if(this._groupMembers)return!1;if(this._dt._getSegmentSeparators()||this.isSorting()){var t=this._rids,e=this._dt.getMultipleRowData(t),i=this._dt.getSegmentValues(t),o=B._performMultiLevelSorting(e,this._sortingDefs,i);if(o)return this._rids=B._reorderItems(t,o),this._transformView(),!0}return!1},U.prototype._quickFilter=function(t,e,i){if(t){for(var o=this._rids,n=o.length,r=this._dt,s=0,l=n;--l>=0;){var a=o[l],h=!1;if(!i||!i[a]){var u=r.getRowData(a);h=!u||t(a,u)===e}h?++s:s>0&&(o.splice(l+1,s),s=0)}s>0&&o.splice(0,s)}},U.prototype._getFilterLogic=function(t,e){return null!=t?"function"==typeof t?t:"string"==typeof t?U._defaultFilterLogic.bind(null,t,e):U._defaultFilterLogic.bind(null,t+"",e):null},U.prototype._setPage=function(t){return t>this._lastPageIndex&&this._pageCorrection&&(t=this._lastPageIndex),t<1&&(t=1),t!=this._pageIndex&&(this._pageIndex=t,this._transformView(),this._dispatch("pageIndexChanged",{pageIndex:this._pageIndex}),!0)},U.prototype._updatePaginationView=function(t){var e=!1;if(this._pageView){t||(t=0);var i=this._pageSize*(this._pageIndex-1),o=this._pageSize+i;if(t<o){var n=this._groupView||this._rids;o>n.length&&(o=n.length);var r=o-i;this._pageView.length=r>=0?r:0;for(var s=i;s<o;++s)this._pageView[s-i]=n[s];e=!0}}return e},U.prototype._updatePageCount=function(){var t=1;if(this._pageSize>0){var e=this._groupView||this._rids,i=e.length>0?e.length:0;t=Math.ceil(i/this._pageSize)}return!!(this._lastPageIndex!==t&&(this._lastPageIndex=t,this._dispatch("pageCountChanged",{pageCount:this._lastPageIndex}),this._lastPageIndex<this._pageIndex&&this._pageCorrection))&&this._setPage(this._lastPageIndex)},U.prototype._dispatchRowRemoved=function(t){t&&this._dispatchDataChange({type:"removed",rid:t})},U.prototype._dispatchMultiRowRemoved=function(t){if(t){var e=t.length;1===e?this._dispatchRowRemoved(t[0]):e>1&&this._dispatchDataChange({type:"removed",rids:t})}},U.prototype._dispatchGlobalChange=function(){this._dispatchDataChange(B._globalChangeArg)},U.prototype._dispatchDataChange=function(t){this._dispatch("dataChanged",t)},U.prototype._setParent=function(t){this._parent=t,this._dt=t;do{(t=t.getDataSource())&&(this._dt=t)}while(t);if(this._parent&&this._dt!==this._parent){this._shared=this._parent._shared;var e=this._parent._columnStats;if(e)for(var i in e){var o=this.enableColumnStats(i),n=this._parent.getColumnStats(i);o&&n&&o.setColumnDataGetter(n.getColumnDataGetter())}}},U.prototype._populateGroups=function(){var t,e,i,o,n,r,s=this._rids;this._rids=[];var l={},a=[];for(e=s.length,t=0;t<e;++t){var h=s[t],u=this._dt.getRowData(h);if(u){(r=(n=this._resolveGroupId(u)).length)>1&&(this._shared.multiGroupRow=!0);for(var p=0;p<r;p++){var _=l[o=n[p]];_?_.push(h):(_=[h],l[o]=_,a.push(o))}}}if(this._shared.autoGroupRemoval)for(t=e=this._groupList.length;--t>=0;)l[o=this._groupList[t]]||(i=this._groupMembers[o])&&!i._predefinedGroup&&this._removeGroupMember(t,o);var c=null;if(this._preDefGroups&&this._groupLevel<this._preDefGroups.length&&(c=this._preDefGroups[this._groupLevel]),e=this._groupList.length,this._preDefGroupsDirty)for(this._preDefGroupsDirty=!1,t=e;--t>=0;)o=this._groupList[t],(i=this._groupMembers[o])&&i._predefinedGroup&&(c?c.indexOf(i._groupId)<0&&this._removeGroupMember(t,o):this._removeGroupMember(t,o));if(c)for(e=c.length,t=0;t<e;++t){var d=this._addGroup(c[t]);d&&(d._predefinedGroup=!0)}for(e=a.length,t=0;t<e;++t)this._addGroup(a[t]);for(e=this._groupList.length,t=0;t<e;++t)o=this._groupList[t],(i=this._groupMembers[o])._updateRowIds(l[o]),i._markColumnStatsDirty();this._groupViewDirty=!0,this._rebuildRowIdsFromChildren()},U.prototype._removeGroupMember=function(t,e){var i=this._groupMembers[e];i&&(this._groupList.splice(t,1),delete this._groupMembers[e],i.dispose())},U.prototype._defaultGroupCriteria=function(t,e){var i=e[t];return Array.isArray(i)?i.map((function(t){return t+""})):[i+""]},U.prototype._groupFilterLogic=function(t,e){return this._groupCriteria[this._groupLevel-1](e).indexOf(this._groupId)>=0},U.prototype._internalGroupSortingLogic=function(t,e){var i=this._groupMembers[t],o=this._groupMembers[e];return this._groupSortingLogic(t,e,i,o)},U.prototype._addGroup=function(t){var e=t+"";if(!e)return null;var i=this._groupMembers[e];if(i)return null;var o,n=(this._groupRowId||"_grp")+"_"+e;return this._hasListener("beforeGroupAdded")&&(o={dataView:this,newGroupId:e,newGroupValue:t,newGroupRowId:n,newGroupLevel:this._groupLevel+1},this._dispatch("beforeGroupAdded",o),o.cancel)?null:((i=new U)._groupId=e,"string"==typeof t?"null"==t?i._groupValue=null:"undefined"!=t&&(i._groupValue=t):i._groupValue=t,o&&!0===o.hideHeaderRow&&(i._hiddenHeaderRow=!0),i._groupRowId=n,i._groupLevel=this._groupLevel+1,i._groupCriteria=this._groupCriteria,i._preDefGroups=this._preDefGroups,i._groupLevel<i._groupCriteria.length&&(i._groupMembers={},i._groupList=[],i._groupView=[]),i._groupRows=this._groupRows,i._setParent(this),i._sortingDefs=this._sortingDefs,this._groupMembers[e]=i,this._groupList.push(e),this._groupRows[i._groupRowId]=i,this._hidden||(i._isHeaderRowShown()&&this._groupView.push(i._groupRowId),this._groupViewDirty=!0,i._beingAdded=!0,this._dispatch("groupAdded",{dataView:this,newGroup:i}),i._beingAdded=!1),i.listen("groupAdded",this._onGroupAdded),this._hasListener("beforeGroupAdded")&&i.listen("beforeGroupAdded",this._onBeforeGroupAdded),i)},U.prototype._triggerGroupRefreshing=function(){this._groupLevel>0?this._parent&&this._parent._triggerGroupRefreshing():this._groupRows&&!this._refreshTimerId&&(this._refreshTimerId=setTimeout(this._onRefreshTimeout,100))},U.prototype._rebuildRowIdsFromChildren=function(){if(this._groupViewDirty){if(this._rids.length=0,this._groupView&&(this._groupView.length=0),!this._hidden)for(var t=this._groupList.length,e=0;e<t;++e){var o=this._groupList[e],n=this._groupMembers[o];if(n._rebuildRowIdsFromChildren(),i.pushArrayItems(this._rids,n._rids),!this._collapsed&&this._groupView&&(n._isHeaderRowShown()&&this._groupView.push(n._groupRowId),!n._collapsed)){var r=n._getFirstHiddenRids()||n._groupView||n._rids;i.pushArrayItems(this._groupView,r),i.pushArrayItems(this._groupView,n._footerRowIds)}}this._groupViewDirty=!1,this._updatePageCount()||this._transformView()}},U.prototype._resolveGroupId=function(t){return this._groupCriteria[this._groupLevel](t)},U.prototype._markColumnStatsDirty=function(){for(var t in this._columnStats)this._columnStats[t].markDirty()},U._defaultFilterLogic=function(t,e,i,o){return o[t]===e},U._defaultGroupSortingLogic=function(t,e){return t==e?0:t<e?-1:1},U._proto=U.prototype;const K=U;var Q=function(t,e,i){this._onConflated=this._onConflated.bind(this),this._data=[],"function"==typeof t?this.setFunction(t,i):"function"==typeof e&&this.setFunction(e,i),"number"==typeof e?this.setConflatingTime(e):"number"==typeof t&&this.setConflatingTime(t)};Q.prototype._data,Q.prototype._func=null,Q.prototype._delay=0,Q.prototype._timerId=0,Q.prototype._conflated=!1,Q.prototype._disabled=!1,Q.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},Q.prototype.popAllData=function(){if(this._data.length){var t=this._data;return this._data=[],t}return null},Q.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},Q.prototype.conflate=function(t){return!this._disabled&&(null!=t&&this._data.push(t),!this._conflated&&(this._timerId||(this._timerId=setTimeout(this._onConflated,this._delay)),!0))},Q.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},Q.prototype._onConflated=function(){this._conflated=!0;try{this._func()}catch(t){console.error(t.message||t)}this._timerId=0,this._data.length=0,this._conflated=!1},Q.prototype.getData=function(){return this._data},Q.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},Q.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},Q.prototype.disable=function(t){this._disabled=!1!==t},Q.prototype.isEnabled=function(){return!this._disabled},Q.prototype.enable=function(t){this._disabled=!1===t},Q._proto=Q.prototype;const j=Q;var J=function(t){var e=this;e._onDataChanged=e._onDataChanged.bind(e),e.extendEventArg=e.extendEventArg.bind(e),e._dataChangedConflator=new j(100,e._onDataChanged),e._grid=t,e._grid.setEventArgExtender("rowCountChanged",e.extendEventArg),e._grid.setEventArgExtender("rowHeightChanged",e.extendEventArg),e._grid.setEventArgExtender("rowAvailable",e.extendEventArg),e._grid.listen("rowAvailable",e._dispatch.bind(this,"rowAvailable")),e._addEvent("dataChanged"),e._addEvent("rowAvailable")};h.inherits(J,s),J._runningId=0,J.prototype._id="",J.prototype._type="",J.prototype._grid=null,J.prototype._snapshot=null,J.prototype._dataView=null,J.prototype._dataArg=null,J.prototype._autoSyncRowCount,J.prototype._bindingEnabled=!0,J.prototype._parent=null,J.prototype._children=null,J.prototype._dataChangedConflator,J.prototype.getId=function(){return this._id},J.prototype.setId=function(t){return this._id=t||"section"+J._runningId++,this._grid.setAttribute("id",this._id),this._id},J.prototype.getSection=function(){return this._snapshot||this._grid},J.prototype.getSectionName=function(){return this._grid.getId()},J.prototype.getIndex=function(){return this._grid.getIndex()},J.prototype.getType=function(){return this._type},J.prototype.setType=function(t){this._type!==t&&(this._type&&this._grid.removeClass(this._type),this._type=t||"",t&&this._grid.addClass(t))},J.prototype.getDataSource=function(){return this._dataView},J.prototype.setDataSource=function(t){var e=this;e.getAutoSyncRowCount()&&e._dataView!==t&&(e._dataView&&e._dataView.unlisten("dataChanged",this._onDataChanged),e._dataChangedConflator.reset(),e._dataArg=null,e._dataView=t,null!==e._dataView&&e._dataView.listen("dataChanged",e._onDataChanged),e._dispatchDataChanged(0,NaN))},J.prototype.getRootDataSource=function(){if(!this._dataView)return null;var t=this._dataView.getDataSource();if(!t)return null;for(;t.getDataSource();)t=t.getDataSource();return t},J.prototype.getData=function(t,e){return this._dataView?(e=this._getRowId(e),this._dataView.getData(e,t)):null},J.prototype.setData=function(t,e,i){return!!this._dataView&&(e=this._getRowId(e),this._dataView.setData(e,t,i),!0)},J.prototype.getRowData=function(t){return this._dataView?(t=this._getRowId(t),this._dataView.getRowData(t)):null},J.prototype.removeRowData=function(t){if(!this._dataView)return!1;var e=this.getRootDataSource();if(!e)return!1;t=this._getRowId(t);var i=e.getRowIndex(t);return!(i<0||(e.removeRow(i),0))},J.prototype.activateColumns=function(t,e,i){if("content"===this._type)for(var o=i+1;--o>=e;){var n=t[o];null!=n&&this._grid.activateColumn(o,n)}},J.prototype.getChildren=function(){return this._children},J.prototype.setParent=function(t){if(this._parent){var e=this._parent._children.indexOf(this);e>=0&&(this._parent._children.splice(e,1),this._parent._children.length<=0&&(this._parent._children=null)),this._parent=null}this._parent=t,this._parent&&(this._parent._children||(this._parent._children=[]),this._parent._children.push(this))},J.prototype.getParent=function(){return this._parent},J.prototype.getDataChangedConflator=function(){return this._dataChangedConflator},J.prototype.disableConflation=function(t){this._dataChangedConflator.disable(t)},J.prototype.disableDataBinding=function(t){this._bindingEnabled=!1===t},J.prototype.getAutoSyncRowCount=function(){return null!=this._autoSyncRowCount?this._autoSyncRowCount:"content"===this._type},J.prototype.setAutoSyncRowCount=function(t){if(this._autoSyncRowCount=t,this.getAutoSyncRowCount()){var e=this._dataView?this._dataView.getVisibleRowCount():0;this._grid.setRowCount(e)}},J.prototype.isDataBindable=function(){return!(!this._bindingEnabled||!this._dataView)},J.prototype.dispose=function(){var t=this;t._dataChangedConflator.reset(),t._dataArg=null,t._grid&&t._grid.dispose(),t._dataView&&t._dataView.unlisten("dataChanged",t._onDataChanged),t.unlistenAll(),t.setParent(null),t._grid=null,t._dataView=null},J.prototype.extendEventArg=function(t){return t||(t={}),t.sectionSettings!==this&&(t.sectionSettings=this,t.section=this._snapshot||this._grid,t.sectionName=this._grid.getId(),t.sectionIndex=this._grid.getIndex(),t.sectionType=this._type,t.dataSource=this._dataView,this._snapshot?t.print=!0:t.print&&(t.print=!1)),t},J.prototype.extendRenderEventArg=function(t,e,i){return t=this.extendEventArg(t),e>=0||(this._snapshot?(e=0,i=this._grid.getRowCount()):(e=this._grid.getFirstIndexInView(),i=this._grid.getLastIndexInView()+1)),t.fromRowIndex=e,t.toRowIndex=i,t},J.prototype.extendDataEventArg=function(t,e,i){var o,n;if(t||(t={}),t.firstUpdate=e,t.lastUpdate=i,this._snapshot?(o=0,n=this._grid.getRowCount()):(o=this._grid.getFirstIndexInView(),n=this._grid.getLastIndexInView()+1),t.fromRowIndex=e>o?e:o,this._dataView){var r=this._dataView.getVisibleRowCount();t.dataRowCount=r,n>r&&(n=r)}return t.toRowIndex=i+1<n?i+1:n,this.extendEventArg(t),t},J.prototype.setIndex=function(t){this._grid.setIndex(t)},J.prototype.getRowOffset=function(){return this._grid.getRowOffset()},J.prototype.setRowOffset=function(t){this._grid.setRowOffset(t)},J.prototype.enableColumnVirtualization=function(t){t=!1!==t,"content"===this._type&&this._grid.enableColumnVirtualization(t)},J.prototype.isBinding=function(){return this._isEventDispatching("dataChanged")},J.prototype._onDataChanged=function(t){if(!this.isBinding()){if(this._bindingEnabled){if(t)this._mergeEvent(t);else if(!this._dataArg)return}else if(!this.getAutoSyncRowCount())return;this._dataChangedConflator.conflate()||(this._calculateChangeIndices(),this._dataArg?this._dispatchDataChanged(this._dataArg.firstUpdate,this._dataArg.lastUpdate):this._dispatchDataChanged(0,NaN))}},J.prototype._dispatchDataChanged=function(t,e){var i=this.getAutoSyncRowCount(),o=this._dataView?this._dataView.getVisibleRowCount():0,n=this._grid.getRowCount();i?o!==n&&this._grid.setRowCount(o,!0):o>n&&(e=n-1),this.updateRowData(t,e,this._dataArg),this._dataArg=null},J.prototype.updateRowData=function(t,e,i){this.isDataBindable()&&(i=this.extendDataEventArg(i,t,e)).fromRowIndex<i.toRowIndex&&this._dispatch("dataChanged",i)},J.prototype.rerender=function(){this.isDataBindable()?this.updateRowData():this._dispatch("rowAvailable",this.extendEventArg())},J.prototype.snapshot=function(t){if(t){this._snapshot=t;try{t.setColumnCount(this._grid.getColumnCount()),t.setRowCount(this._grid.getRowCount()),this._dispatch("rowAvailable",this.extendEventArg())}catch(t){console.warn("Unable to take a snapshot: "+t.message)}this._snapshot=null,this._dispatch("rowAvailable",this.extendEventArg())}},J.prototype._getRowId=function(t){return i.isNumber(t)?this._dataView.getRowId(t):t},J.prototype._mergeEvent=function(t){var e=this._dataArg;if(e||((e=this._dataArg={}).actualUpdate=!0,e.positionChangeOnly=!0,e.events=[],e.firstUpdate=NaN,e.lastUpdate=NaN,e.updatedRids={}),t.positionChangeOnly||(e.positionChangeOnly=!1),t.events?e.events=e.events.concat(t.events):e.events.push(t),!e.globalChange){if(t.globalChange)return e.globalChange=!0,e.firstUpdate=0,void(e.lastUpdate=NaN);var i=t.rids;if(i)for(var o=i.length;--o>=0;)e.updatedRids[i[o]]=!0;else t.rid&&(e.updatedRids[t.rid]=!0);"updated"!==t.type&&(e.indexShifted=!0,"removed"===t.type&&(e.dataRemoved=!0))}},J.prototype._calculateChangeIndices=function(){var t,e;if(this.isDataBindable()&&!this._dataArg.globalChange)if(this._dataArg.indexShifted){if(this._dataArg.dataRemoved)this._dataArg.firstUpdate=0;else for(t in this._dataArg.updatedRids)(e=this._dataView.getRowIndex(t))>=0&&(this._dataArg.firstUpdate<=e||(this._dataArg.firstUpdate=e));this._dataArg.lastUpdate=this._dataView.getVisibleRowCount()}else for(t in this._dataArg.updatedRids)(e=this._dataView.getRowIndex(t))>=0&&(this._dataArg.firstUpdate<=e||(this._dataArg.firstUpdate=e),this._dataArg.lastUpdate>=e||(this._dataArg.lastUpdate=e))},J._proto=J.prototype;const $=J;var Z=function(t){this._layout=t,this._arg={},this._addEvent("indexChanged")};h.inherits(Z,s),Z.prototype._layout,Z.prototype._viewSize=0,Z.prototype._viewOffset=0,Z.prototype._startOffsetCount=0,Z.prototype._endOffsetCount=0,Z.prototype._bufferSize=0,Z.prototype._arg=null,Z.prototype._enabled=!0,Z.prototype._active=!0,Z.prototype._virtualizable=!1,Z.prototype._getMinIndex=function(){return this._startOffsetCount},Z.prototype._getMaxIndex=function(){var t=this._layout.getLaneCount()-this._endOffsetCount;return t>this._startOffsetCount?t:this._startOffsetCount},Z.prototype.getContentStart=function(t){return this._layout.getLaneStart(t)},Z.prototype.getContentInViewCount=function(){var t=this.getFirstIndexInView(),e=this.getLastIndexInView();return t>=0&&t<e?e-t+1:0},Z.prototype._getContentSizeInBounds=function(){var t=this._getMinIndex(),e=this._getMaxIndex();return this._layout.getLaneStart(e)-this._layout.getLaneStart(t)},Z.prototype.getViewSize=function(){return this._viewSize},Z.prototype.getViewOffset=function(){var t=this._getMinIndex();return this._viewOffset+this._layout.getLaneStart(t)},Z.prototype.getIndexOffset=function(){return this._startOffsetCount},Z.prototype.isVirtualizable=function(){return this._virtualizable},Z.prototype.getFirstIndexInView=function(){if(!this._virtualizable)return 0;var t=this.getViewOffset(),e=this._layout.getTrackSize();return t>=e&&(t=e-this._viewSize),t<0?0:this._layout.hitTest(t)},Z.prototype.getLastIndexInView=function(){if(this._virtualizable){var t=this.getViewOffset()+this._viewSize,e=this._getMaxIndex();return t>=this._layout.getLaneStart(e)?e-1:this._layout.hitTest(t)}return this._layout.getLaneCount()-1},Z.prototype.getPrevFirstIndexInView=function(){return null!=this._arg.prevFirstIndex?this._arg.prevFirstIndex:-1},Z.prototype.getPrevLastIndexInView=function(){return null!=this._arg.prevLastIndex?this._arg.prevLastIndex:-1},Z.prototype.update=function(t){if(!(!0===t||this._enabled&&this._active))return!1;if(this._isEventDispatching("indexChanged"))return!1;var e=this.getFirstIndexInView(),i=this.getLastIndexInView(),o=this._arg.prevFirstIndex!==e||this._arg.prevLastIndex!==i;return(t||o)&&(this._arg.firstIndex=e,this._arg.lastIndex=i,this._dispatch("indexChanged",this._arg),this._arg.prevFirstIndex=e,this._arg.prevLastIndex=i),o},Z.prototype.isEnabled=function(){return this._enabled},Z.prototype.enable=function(t){t=!1!==t,this._enabled!==t&&(this._enabled=t,this.validateVirtualization(),this.update(!0))},Z.prototype.disable=function(t){this.enable(!1===t)},Z.prototype.isActive=function(){return this._active},Z.prototype.activate=function(t){t=!1!==t,this._active!==t&&(this._active=t,this.validateVirtualization(),this.update(!0))},Z.prototype.deactivate=function(t){this.activate(!1===t)},Z.prototype.getBufferSize=function(){return this._bufferSize},Z.prototype.setContentLayout=function(t){this._layout!==t&&(this._layout=t,this.validateVirtualization())},Z.prototype.setViewSize=function(t){t<0&&(t=0),this._viewSize!==t&&(this._viewSize=t,this.validateVirtualization())},Z.prototype.setViewOffset=function(t){this._viewOffset=t>0?t:0,this.update()},Z.prototype.setViewBounds=function(t,e){this._startOffsetCount=t>0?t:0,this._endOffsetCount=e>0?e:0,this.validateVirtualization()},Z.prototype.setBufferSize=function(t){t<0&&(t=0),this._bufferSize!==t&&(this._bufferSize=t,this.validateVirtualization())},Z.prototype.validateVirtualization=function(){this._virtualizable=!1,this._enabled&&this._active&&this._viewSize>0&&this._getContentSizeInBounds()>this._viewSize&&(this._virtualizable=!0)},Z._proto=Z.prototype;const tt=Z;var et=function(t,e){this._onInterval=this._onInterval.bind(this),"function"==typeof t?this._func=t:"function"==typeof e&&(this._func=e),"number"==typeof e?this._delay=e:"number"==typeof t&&(this._delay=t)};et.prototype._func=null,et.prototype._delay=0,et.prototype._timerId=0,et.prototype._pending=!1,et.prototype.start=function(){this._func&&(this._timerId?this._pending=!0:this._timerId=setInterval(this._onInterval,this._delay))},et.prototype.dispose=function(){this._timerId&&(clearInterval(this._timerId),this._timerId=0),this._func=null},et.prototype._onInterval=function(){this._pending?this._pending=!1:(this._func(),clearInterval(this._timerId),this._timerId=0)},et._proto=et.prototype;const it=et;var ot=function(){var t=this;t._addEvents("scroll","activated","deactivated","scrollStart","scrollEnd","thicknessChanged","layoutChanged","enabled","disabled"),t._onTrackScroll=t._onTrackScroll.bind(t),t._onKeyDown=t._onKeyDown.bind(t),t._onStartFading=t._onStartFading.bind(t),t._onMouseWheel=t._onMouseWheel.bind(t),t._flash=t._flash.bind(t),t._onTouchStart=t._onTouchStart.bind(t),t._onTouchMove=t._onTouchMove.bind(t),t._onTouchEnd=t._onTouchEnd.bind(t),t._smoothScroll=t._smoothScroll.bind(t),t._updateEffectiveArea=t._updateEffectiveArea.bind(t),t._onRestingPosition=t._onRestingPosition.bind(t),t._element=document.createElement("div"),t._element.className="grid-scrollbar",t._trackContent=document.createElement("div"),t._panes=[],t._paneSliders=[],t._startPos={},t._endPos={},t._reverter=new it(t._onRestingPosition,300),t._element.addEventListener("scroll",t._onTrackScroll),t._element.addEventListener("mouseover",t._flash),t._element.appendChild(t._trackContent),t.disableKeyboardInput(!1),ot._queryNativeTrackThickness(t._dispatch.bind(t,"thicknessChanged")),t._updateEffectiveArea()||t.listen("thicknessChanged",t._updateEffectiveArea)};h.inherits(ot,p),ot.prototype._vertical=!0,ot.prototype._step=0,ot.prototype._parentNode=null,ot.prototype._hostClassName="",ot.prototype._trackContent=null,ot.prototype._panes=null,ot.prototype._paneSliders=null,ot.prototype._enabled=!0,ot.prototype._active=!1,ot.prototype._isFrozen=!1,ot.prototype._otherScrollbar=null,ot.prototype._autoHideScrollbar=!0,ot.prototype._trackSize=120,ot.prototype._tContentSize=0,ot.prototype._tScrollVal=0,ot.prototype._tPercentVal=0,ot.prototype._paneSize=0,ot.prototype._pContentSize=0,ot.prototype._pScrollVal=0,ot.prototype._footerCount=0,ot.prototype._fadingId=0,ot.prototype._postponeFading=!1,ot.prototype._layoutChanged=!1,ot.prototype._contentDirty=!0,ot.prototype._layoutDirty=!0,ot.prototype._touchInput=!0,ot.prototype._swiping=!1,ot.prototype._touchDrag=!1,ot.prototype._startPos,ot.prototype._endPos,ot.prototype._smoothing=!0,ot.prototype._smoothingId=0,ot.prototype._smoothingSpeed=0,ot.prototype._wheelScrolling="",ot.prototype._mouseWheelLogic=null,ot._trackThickness=0,ot._queryTimeout=0,ot._queryStarted=!1,ot._outerDummy=null,ot._innerDummy=null,ot._listeners=null,ot.prototype._updateEffectiveArea=function(){var t=this.getTrackThickness();if(t){var e=this._vertical?"width":"height";this._element.style[e]=t+1+"px"}return!!t},ot._queryNativeTrackThickness=function(t){if(ot._queryStarted||ot._repeatQuery(),t&&ot._trackThickness<=0){var e=ot._listeners;e||(e=ot._listeners=[]),e.push(t)}},ot._repeatQuery=function(){ot._queryStarted=!0,ot._retrieveNativeTrackThinkness()||(ot._queryTimeout+=100,ot._queryTimeout<3e3?setTimeout(ot._repeatQuery,ot._queryTimeout):(ot._trackThickness=13,ot._clearStaticResources()))},ot._retrieveNativeTrackThinkness=function(){if(ot._trackThickness>0)return!0;var t=ot._innerDummy,e=ot._outerDummy;t||((t=ot._innerDummy=document.createElement("p")).style.width="100%",t.style.height="200px",(e=ot._outerDummy=document.createElement("div")).style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.appendChild(t)),e.style.overflow="hidden",document.body.appendChild(e);var i=t.offsetWidth;e.style.overflow="scroll";var o=t.offsetWidth;return i==o&&(o=e.clientWidth),document.body.removeChild(e),(ot._trackThickness=i-o)>0&&(ot._clearStaticResources(),!0)},ot._clearStaticResources=function(){ot._innerDummy=ot._outerDummy=null;var t=ot._listeners;if(t){ot._listeners=null;for(var e={},i=t.length;--i>=0;)t[i](e)}},ot.updateTrackThickness=function(){ot._trackThickness=0,ot._queryTimeout=0,ot._queryStarted=!1,ot._queryNativeTrackThickness()},ot.prototype.dispose=function(){this.unlistenAll(),this._smoothingId&&(clearInterval(this._smoothingId),this._smoothingId=0),this._active=this._layoutChanged=!1,this._dispose();for(var t=this._panes.length;--t>=0;)this._panes[t].dispose(),this._paneSliders[t].dispose();this._reverter.dispose()},ot.prototype.getContent=function(t){return this._paneSliders[0].getContent(t)},ot.prototype.getParent=function(){return this._parentNode},ot.prototype.setParent=function(t,e){var o=i.getElement(t),n=this._parentNode!==o;n&&this._parentNode&&(this.removeWheelListener(this._parentNode),this._parentNode.classList.remove(this._hostClassName)),this.isActive()?(this._setParent(o,e),this._parentNode=this._element.parentNode,this._parentNode&&this._parentNode.classList.add(this._hostClassName)):this._parentNode=o,n&&this.addWheelListener(this._parentNode)},ot.prototype.attachToExternalElement=function(t){this.setParent(t);var e=this.getElement();e.style.right="0",this._vertical?e.style.overflowX="hidden":e.style.overflowY="hidden",e.style.boxSizing="border-box",e.style.position="absolute",e.style.outline="none"},ot.prototype._onActiveStateChange=function(){var t,e=this;if(e._scrollTo(0,!0),e._active){for(e._parentNode&&(e._layoutDirty=!0,e._setParent(e._parentNode),e._parentNode.classList.add(e._hostClassName)),e._flash(),t=e._panes.length;--t>=0;)e._panes[t].removeClass("scroll-disabled");e._dispatch("activated",{})}else{e._setParent(null),e._parentNode&&e._parentNode.classList.remove(e._hostClassName);var i=e._vertical?"height":"width";for(t=e._panes.length;--t>=0;)e._panes[t].addClass("scroll-disabled"),e._panes[t].setStyle(i,"");e._dispatch("deactivated",{})}e._vertical&&e._otherScrollbar&&e._otherScrollbar.isActive()&&e._otherScrollbar.invalidate()},ot.prototype._onEnablingStateChange=function(){var t=this;t._enabled?t._dispatch("enabled",{}):t._dispatch("disabled",{})},ot.prototype.isActive=function(){return this._active},ot.prototype.isEnabled=function(){return this._enabled},ot.prototype.enable=function(t){t=!1!==t,this._enabled!=t&&(this._enabled=t,this._updateLayout(),this._onEnablingStateChange())},ot.prototype.disable=function(t){this.enable(!1===t)},ot.prototype.getTrackSize=function(){return this._trackSize},ot.prototype.getPaneSize=function(){return this._paneSize},ot.prototype.getContentSize=function(){return this._pContentSize},ot.prototype.getTrackThickness=function(){return ot._trackThickness},ot.prototype.getScrollGap=function(){return this._pContentSize-this.getPaneSize()},ot.prototype.setTrackSize=function(t,e){this._trackSize=t>0?t:0,this._paneSize=e>0?e:0},ot.prototype.calculateContentSize=function(){return 0},ot.prototype.update=function(){if(this._contentDirty){this._contentDirty=!1;var t=this.calculateContentSize();(!t||t<0)&&(t=0),this._pContentSize!==t&&(this._pContentSize=t,this._layoutDirty=!0)}return!!this._layoutDirty&&(this._layoutDirty=!1,this._updateLayout(),!0)},ot.prototype.invalidate=function(t,e){this._contentDirty=!0,this._layoutDirty=!0,null!=e&&(this._pScrollVal=e),t&&this.update()},ot.prototype.invalidateContent=function(){this._contentDirty=!0},ot.prototype.isScrollPosValid=function(t){var e=t-this.getPaneSize(),i=this._pScrollVal;return 0===i||i>0&&e>0&&i<e},ot.prototype.flash=function(){this.update(),this._flash()},ot.prototype._scroll=function(t){this._scrollTo(this._pScrollVal+t)},ot.prototype._scrollTo=function(t,e){if(this._active||e){t=this._calcProperScrollValue(t);var i=!1;this._pScrollVal!==t&&(this._pScrollVal=t,i=!0),this._setTrackScrollVal(t),i?(e&&(this._layoutChanged=!0),this._dispatchScrollEvent(null)):e&&this._dispatch("layoutChanged",{})}},ot.prototype._calcProperScrollValue=function(t){if(!t||t-.5<0)return 0;if(this._tPercentVal>=1&&Math.abs(this._pScrollVal-t)<=2)return this._pScrollVal;var e=this.getScrollGap();if(e<=0)return 0;if(t+.5>=e)return e;var i=this._step;if(i){if((t=Math.round(t/i)*i)-i/2<=0)return 0;if(t+i/2>=e)return e}return Math.round(t)},ot.prototype._convertTrackToPane=function(t){t=Math.round(t);var e=this._getTrackGap();this._tPercentVal>=1&&Math.abs(this._tScrollVal-t)<=5&&(t=e),this._tScrollVal=t,this._tPercentVal=e?t/e:0;var i=this.getScrollGap();return e===i?t:this._tPercentVal*i},ot.prototype._setTrackScrollVal=function(t){var e=this._getTrackGap(),i=0;if(e>0){if(t>0){var o=this.getScrollGap();i=e===o?t:t/o*e,i=Math.round(i)}i>=e&&(i=e)}if(i!==this._tScrollVal){this._tScrollVal=i,this._tPercentVal=e?i/e:0;var n=this._element;return this._vertical?n.scrollTop=i:n.scrollLeft=i,!0}return!1},ot.prototype._getTrackGap=function(){var t=this._tContentSize-this.getTrackSize();return t>0?t:0},ot.prototype._getScrollValue=function(){return this._pScrollVal},ot.prototype._isEndOfScroll=function(){return!this._active||this._pScrollVal>=this.getScrollGap()},ot.prototype._isStartOfScroll=function(){return!this._pScrollVal},ot.prototype._isOnEdge=function(t){return t<0&&this._isStartOfScroll()||t>0&&this._isEndOfScroll()},ot.prototype._flash=function(){this._active&&this._autoHideScrollbar&&(this._fadingId?this._postponeFading=!0:(this._element._fading&&(this._element.classList.remove("grid-scroll-fadeout"),this._element._fading=!1),this._fadingId=setTimeout(this._onStartFading,1e3)))},ot.prototype._clearAllPanes=function(){for(var t=this._panes.length;--t>=0;){this._panes[t].setParent(null);var e=this._paneSliders[t];e._content=e._columns=null;for(var i=e.getElement();null!==i.firstChild;)i.removeChild(i.firstChild)}},ot.prototype.disableKeyboardInput=function(t){!1===t?(this._element.setAttribute("tabindex","0"),this._element.addEventListener("keydown",this._onKeyDown,!1)):(this._element.removeAttribute("tabindex"),this._element.removeEventListener("keydown",this._onKeyDown,!1))},ot.prototype.disableTouchInput=function(t){this._touchInput=!1===t},ot.prototype.setAutoHide=function(t){this._autoHideScrollbar=t,t||(this._element._fading&&(this._element.classList.remove("grid-scroll-fadeout"),this._element._fading=!1),this._fadingId&&(clearTimeout(this._fadingId),this._fadingId=0))},ot.prototype.getAutoHide=function(){return this._autoHideScrollbar},ot.prototype.setOtherScrollbar=function(t){this._otherScrollbar=t},ot.prototype.setFooterCount=function(t){this._footerCount=t},ot.prototype._calcActiveState=function(){if(this._enabled&&this.getTrackSize()>20){var t=this.getPaneSize();if(t>0)return this._pContentSize-t>0}return!1},ot.prototype._updateLayout=function(){var t=this._calcActiveState();if(t!==this._active&&(this._active=t,this._onActiveStateChange()),this._active){var e=this.getTrackSize(),i=this.getPaneSize();if(this._tContentSize=this._pContentSize/i*e,this._vertical)this._trackContent.style.height=this._tContentSize+"px",this._element.style.height=e+"px",this._panes[0].setHeight(i);else{this._trackContent.style.width=this._tContentSize+"px",this._element.style.width=e+"px";for(var o=this._panes.length;--o>=0;)this._panes[o].setWidth(i)}this._scrollTo(this._pScrollVal,!0)}},ot.prototype.resetPaneSize=function(){for(var t=this._vertical?"height":"width",e=this._panes.length;--e>=0;)this._panes[e].setStyle(t,"")},ot._preventVScrolling=function(t){t.currentTarget.scrollTop=0},ot._preventHScrolling=function(t){t.currentTarget.scrollLeft=0},ot.prototype._addPaneAt=function(t){null==t&&(t=this._panes.length);var e=this._panes[t];if(!e){if((e=new p(document.createElement("div"))).setClass("grid-pane"),this._vertical?(e.addClass("sections"),e.listen("scroll",ot._preventVScrolling)):(e.addClass("columns"),e.listen("scroll",ot._preventHScrolling)),this._active||e.addClass("scroll-disabled"),this._paneSize&&this._active){var i=this.getPaneSize();this._vertical?e.setHeight(i):e.setWidth(i)}e.listen("touchstart",this._onTouchStart),e.listen("touchmove",this._onTouchMove),e.listen("touchend",this._onTouchEnd),e.listen("touchcancel",this._onTouchEnd);var o=new p(document.createElement("div"));o.setClass("grid-pane-slider"),o.setParent(e),this._panes[t]=e,this._paneSliders[t]=o}return e},ot.prototype._onStartFading=function(t){this._fadingId=0,this._active&&(this._postponeFading?(this._postponeFading=!1,this._flash()):this._element._fading||(this._element.classList.add("grid-scroll-fadeout"),this._element._fading=!0))},ot.prototype._onTrackScroll=function(t){var e=this._vertical?t.target.scrollTop:t.target.scrollLeft,i=this._convertTrackToPane(e);(i=this._calcProperScrollValue(i))!==this._pScrollVal&&(this._pScrollVal=i,this._dispatchScrollEvent(t))},ot.prototype._onRestingPosition=function(){this._setSliderPosition(-this._pScrollVal,!0)},ot.prototype._setSliderPosition=function(t,e){var i="",o="",n=this._vertical?"top":"left";t&&(e?o=t+"px":(i=this._vertical?"translateY":"translateX",i+="("+t+"px)",this._reverter.start()));for(var r=this._paneSliders.length;--r>=0;){var s=this._paneSliders[r],l=s.getElement().style;s._titleSection?l[n]=t+"px":(l.transform=i,l[n]=o)}e?this._dispatch("scrollEnd",{}):this._dispatch("scrollStart",{})},ot.prototype._dispatchScrollEvent=function(t){if(this._setSliderPosition(-this._pScrollVal,!1),this._flash(),!this._isEventDispatching("scroll")){if(!t){var e=this._element;t={currentTarget:e,srcElement:e,target:e}}t.layoutChanged=this._layoutChanged,this._vertical?t.scrollTop=this._pScrollVal:t.scrollLeft=this._pScrollVal,this._dispatch("scroll",t)}},ot.prototype._onKeyDown=function(t){if(this._isFrozen)i._preventDefault(t);else if(this._active&&(this._vertical?38===t.keyCode||40===t.keyCode:37===t.keyCode||39===t.keyCode)){var e=this.getScrollGap(),o=Math.round(.07*e);o<10?o=10:o>100&&(o=100),37!==t.keyCode&&38!==t.keyCode||(o*=-1),this._scroll(o),i._preventDefault(t)}},ot.prototype._onTouchStart=function(t){this._isFrozen?i._preventDefault(t):!this._swiping&&this._touchInput&&(this._vertical&&this.update(),this._flash(),this._smoothingId&&(clearInterval(this._smoothingId),this._smoothingId=0),this._swiping=!0,this._getTouchInfo(t,this._startPos))},ot.prototype._onTouchMove=function(t){var e=this;if(e._isFrozen)i._preventDefault(t);else if(e._swiping&&e._active&&e._touchInput&&!(t.touches&&t.touches.length>1)){var o=e._startPos,n=e._endPos;e._getTouchInfo(t,n);var r=this._vertical?o.y-n.y:o.x-n.x;r>-5&&r<5||e._isOnEdge(r)||(e._touchDrag?e._scrollTo(o.scrollValue+r):n.timeStamp-o.timeStamp>30&&(e._touchDrag=!0),t.cancelable&&t.preventDefault())}},ot.prototype._onTouchEnd=function(t){if(this._isFrozen)i._preventDefault(t);else if(this._swiping=!1,this._touchDrag&&(this._touchDrag=!1,t.cancelable&&t.preventDefault(),this._smoothing&&!this._smoothingId)){var e=this._startPos,o=this._getTouchInfo(t,this._endPos),n=o.timeStamp-e.timeStamp,r=this._vertical?e.y-o.y:e.x-o.x;this._smoothingSpeed=30*r/n,(this._smoothingSpeed>10||this._smoothingSpeed<-10)&&(this._smoothingId=setInterval(this._smoothScroll,25))}},ot.prototype._getTouchInfo=function(t,e){var i=t.changedTouches[0];return e||(e={}),e.x=i.pageX,e.y=i.pageY,e.timeStamp=t.timeStamp,e.scrollValue=this._getScrollValue(),e},ot.prototype._smoothScroll=function(){var t=this._smoothingSpeed;t=.9*t|0,this._smoothingSpeed=t,t>1||t<-1?this._scroll(t):(clearInterval(this._smoothingId),this._smoothingId=0)},ot.prototype.disableMouseWheel=function(t){!1===t?this.setMouseWheelLogic(this._mouseWheelLogic||this._onMouseWheel):this.setMouseWheelLogic(null)},ot.prototype.setMouseWheelLogic=function(t){this.removeWheelListener(this._parentNode),this._mouseWheelLogic=t,this._mouseWheelLogic&&this.addWheelListener(this._parentNode)},ot.prototype.addWheelListener=function(t){t&&this._mouseWheelLogic&&t.addEventListener("wheel",this._mouseWheelLogic,!1)},ot.prototype.removeWheelListener=function(t){t&&this._mouseWheelLogic&&t.removeEventListener("wheel",this._mouseWheelLogic,!1)},ot.prototype.setMouseWheelSpeed=function(t){this._wheelScrolling="string"==typeof t?t:""},ot.prototype.getMouseWheelSpeed=function(){return this._wheelScrolling},ot.prototype.getDefaultMouseWheelLogic=function(){return this._onMouseWheel},ot.prototype._onMouseWheel=function(t){if(this._isFrozen)i._preventDefault(t);else if(!(t.ctrlKey||t.altKey||t.shiftKey)&&this.isActive()){var e=this._vertical?t.deltaY:t.deltaX;if(e&&!this._isOnEdge(e)){if(i._preventDefault(t),t.deltaMode&&(e=e>0?100:-100),"linear"!=this._wheelScrolling){var o=this.getContentSize();o>=4e3&&(e*=1+o/4e3|0)}this.update(),this._scroll(e)}}},ot.prototype.setScrollingStep=function(t){this._step=t>0?t:0},ot.prototype.freezeScrolling=function(t){var e=this._isFrozen;return this._isFrozen=!1!==t,e},ot._proto=ot.prototype;const nt=ot;var rt=function(){var t=this;t._vertical=!1,t._onDeactivated=t._onDeactivated.bind(t),t._onActivated=t._onActivated.bind(t),t._hostClassName="hscrollbar-host",rt.base(this,"constructor"),t._element.classList.add("grid-hscroll"),t._trackContent.style.height="1px",t.disableMouseWheel(!1),t.listen("activated",t._onActivated),t.listen("deactivated",t._onDeactivated)};h.inherits(rt,nt),rt.prototype._pinnedRightColumnCount=0,rt.prototype.setScrollContent=function(t,e,i,o){this._clearAllPanes();var n=e.length;if(!(n<=0)){this._pinnedRightColumnCount=o>0?o:0;var r=e[0],s=r.getColumnCount(),l=s-o;(!l||l<0)&&(l=s);for(var a=0;a<n;++a){r=e[a];var h,u,p=this._addPaneAt(a),_=this._paneSliders[a],c=p.getElement(),d=_.getElement();for(c.classList.toggle("right-pinning",!!this._pinnedRightColumnCount),h=0;h<i;++h)(u=r.getColumn(h)).setScrollState(c,null,!1);p.setParent(r.getColumnHost());var g=[],f=[];for(h=i;h<l;++h)(u=r.getColumn(h)).setScrollState(null,d,this.isActive()),g.push(u),f.push(u.getElement());for(h=l;h<s;++h)(u=r.getColumn(h)).setScrollState(null,null,!1);var y=r.getReservedSpace();y&&(this._pinnedRightColumnCount||(_.addContent(y),f.push(y)),r._updateRightSpaceStyle(this.isActive()&&!this._pinnedRightColumnCount)),r._updateLayers(),_._titleSection=r.getElement().classList.contains("title"),_._columns=g,_._content=f}this.invalidateContent()}},rt.prototype.setWidth=function(t){return this.setTrackSize(t,t),!0},rt.prototype.getWidth=function(){return this.getPaneSize()},rt.prototype.getScrollLeft=function(){return this._getScrollValue()},rt.prototype.setScrollLeft=function(t){this.update(),this._scrollTo(t)},rt.prototype.setPaneLeft=function(t){for(var e=t&&this.isActive()?-t+"px":"",i=this._panes.length;--i>=0;)this._paneSliders[i].setStyle("marginLeft",e)},rt.prototype.isEndOfHorizontalScroll=function(){return this._isEndOfScroll()},rt.prototype.getContentWidth=function(){var t=this._paneSliders[0],e=0;if(t)for(var i=t._content,o=i.length;--o>=0;){var n=i[o],r=n?n.style.width:0;r&&(e+=parseFloat(r))}return e},rt.prototype.calculateContentSize=function(){return this.getContentWidth()},rt.prototype.getTrackSize=function(){return this._footerCount<=0&&this._otherScrollbar&&this._otherScrollbar.isActive()&&!this._pinnedRightColumnCount?this._trackSize-this.getTrackThickness():this._trackSize},rt.prototype._onActivated=function(t){this._updateActivation(!0)},rt.prototype._onDeactivated=function(t){this._updateActivation(!1)},rt.prototype._updateActivation=function(t){for(var e=this._paneSliders.length,i=0;i<e;++i)for(var o=this._paneSliders[i]._columns,n=o?o.length:0,r=0;r<n;++r){var s=o[r];s.getElement()&&s.enableAbsolutePosition(t)}},rt._proto=rt.prototype;const st=rt;var lt=function(){var t=this;t._vertical=!0,t._hostClassName="vscrollbar-host",lt.base(this,"constructor"),t._onScroll=t._onScroll.bind(t),t._addPaneAt(),t._element.classList.add("grid-vscroll"),t._trackContent.style.width="1px",t.disableMouseWheel(!1),t.listen("scroll",t._onScroll),t._addEvent("contentScrolled")};h.inherits(lt,nt),lt.prototype.setScrollContent=function(t,e,i){this._clearAllPanes();var o=e.length;if(!(o<=0)){for(var n=this._panes[0],r=this._paneSliders[0],s=0;s<i;)e[s++].setParent(t);n.setParent(t);for(var l=o-this._footerCount;s<l;)e[s++].setParent(r);for(;s<o;)e[s++].setParent(t);this.invalidateContent()}},lt.prototype.setHeight=function(t){return this.setTrackSize(t,t),!0},lt.prototype.getHeight=function(){return this.getPaneSize()},lt.prototype.getScrollTop=function(){return this._getScrollValue()},lt.prototype.setScrollTop=function(t){this.update(),this._scrollTo(t)},lt.prototype.isEndOfVerticalScroll=function(){return this._isEndOfScroll()},lt.prototype.getContentHeight=function(){for(var t=this._paneSliders[0].getContent(!0),e=0,i=t.length;--i>=0;)e+=t[i].offsetHeight;return e},lt.prototype.calculateContentSize=function(){return this.getContentHeight()},lt.prototype.getPane=function(){return this._panes[0]},lt.prototype._onScroll=function(t){this._dispatch("contentScrolled",t)},lt._proto=lt.prototype;const at=lt;var ht=function(t,e){var i=this;i._onRestingPosition=i._onRestingPosition.bind(i),i._element=t||document.createElement("div"),i._element.className="tr-vlg",e&&i.enableClass(e,!0),i._grid=new P(null,{owner:this}),i._grid.setParent(i._element),i._layoutY=new y,i._selectionList=new T,i._reverter=new it(i._onRestingPosition,200),i._addEvent("rowHighlighted"),i._addEvent("rowCountChanged"),i._addEvent("rowHeightChanged"),i._addEvent("rowAvailable")};h.inherits(ht,p),ht.prototype._index=-1,ht.prototype._indexOffset=0,ht.prototype._firstIndex=0,ht.prototype._grid,ht.prototype._layoutY,ht.prototype._selectionList=null,ht.prototype._reverter=null,ht.prototype.getWidth=function(){return this.isVisible()?this._grid.getWidth():0},ht.prototype.getHeight=function(){return this.isVisible()?this._element.offsetHeight:0},ht.prototype.dispose=function(){this.setRowCount(0),this.unlistenAll(),this._grid.dispose(),this._dispose(),this._reverter.dispose()},ht.prototype.setWidth=function(t){return this._grid.setWidth(t)},ht.prototype.setHeight=function(t){return console.log("unsupported"),!1},ht.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._dispatchRowHeightChangedEvent(0,this._layoutY.getLaneCount())},ht.prototype.hitTest=function(t,e){var i=[];return i.colIndex=this._grid.hitTestX(t),i.rowIndex=this._layoutY.hitTest(e),i},ht.prototype.hitTestX=function(t){return this._grid.hitTestX(t)},ht.prototype.hitTestY=function(t){return this._layoutY.hitTest(t)},ht.prototype.getDefaultColumnWidth=function(){return this._grid.getDefaultColumnWidth()},ht.prototype.setDefaultColumnWidth=function(t){this._grid.setDefaultColumnWidth(t)},ht.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},ht.prototype.setDefaultRowHeight=function(t){this._layoutY.getDefaultLaneSize()!==t&&(this._layoutY.setDefaultLaneSize(t),this._element.style.height=this._layoutY.getTrackSize()+"px",this._grid.setDefaultRowHeight(t),this._dispatchRowHeightChangedEvent(0,this._layoutY.getLaneCount()))},ht.prototype.getColumnWidth=function(t){return this._grid.getColumnWidth(t)},ht.prototype.setColumnWidth=function(t,e){return this._grid.setColumnWidth(t,e)},ht.prototype._setColumnWidth=function(t,e){return this._grid._setColumnWidth(t,e)},ht.prototype._updateColumnLayout=function(){this._grid._updateColumnLayout()},ht.prototype.getRowHeight=function(t){return this._layoutY.getLaneSize(t)},ht.prototype.setRowHeight=function(t,e){return!!this._layoutY.setLaneSize(t,e)&&(this._grid.setRowHeight(t-this._firstIndex,e),this._element.style.height=this._layoutY.getTrackSize()+"px",this._dispatchRowHeightChangedEvent(t,t+1))},ht.prototype.isColumnVisible=function(t){return this._grid.isColumnVisible(t)},ht.prototype.hideColumn=function(t,e){return this._grid.hideColumn(t,e)},ht.prototype.isRowVisible=function(t){return this._grid.isRowVisible(t-this._firstIndex)},ht.prototype.hideRow=function(t,e){return this._grid.hideRow(t-this._firstIndex,e)},ht.prototype.getMinimumColumnWidth=function(t){return this._grid.getMinimumColumnWidth(t)},ht.prototype.setMinimumColumnWidth=function(t,e){return this._grid.setMinimumColumnWidth(t,e)},ht.prototype.getMinimumRowHeight=function(t){return this._layoutY.getMinimumLaneSize(t)},ht.prototype.setMinimumRowHeight=function(t,e){return console.log("unsupported"),!1},ht.prototype.getCellLeft=function(t){return this._grid.getCellLeft(t)},ht.prototype.getCellTop=function(t){return this._layoutY.getLaneStart(t)},ht.prototype.getCellWidth=function(t,e){return this._grid.getCellWidth(t,0)},ht.prototype.getCellHeight=function(t,e){return this._layoutY.getLaneSize(e)},ht.prototype.hasCellSpan=function(){return this._grid.hasCellSpan()},ht.prototype.getCellRowSpan=function(t,e){return this._grid.getCellRowSpan(t,e-this._firstIndex)},ht.prototype.setCellRowSpan=function(t,e,i){return this._grid.setCellRowSpan(t,e-this._firstIndex,i)},ht.prototype.getCellColSpan=function(t,e){return this._grid.getCellColSpan(t,e-this._firstIndex)},ht.prototype.setCellColSpan=function(t,e,i){return this._grid.setCellColSpan(t,e-this._firstIndex,i)},ht.prototype.clearCellSpans=function(){return this._grid.clearCellSpans()},ht.prototype.clearColumnSpans=function(t){return this._grid.clearColumnSpans(t)},ht.prototype.clearColumnCustomizations=function(){this._grid.clearColumnCustomizations()},ht.prototype.clearRowCustomizations=function(){this._layoutY.clearLaneCustomizations(),this._grid.clearRowCustomizations()},ht.prototype.getColumnScalability=function(t){return this._grid.getColumnScalability(t)},ht.prototype.setColumnScalability=function(t,e){return this._grid.setColumnScalability(t,e)},ht.prototype.getRowScalability=function(t){return this._layoutY.getLaneScalability(t)},ht.prototype.setRowScalability=function(t,e){return console.log("unsupported"),!1},ht.prototype.getCell=function(t,e,i){return this._grid.getCell(t,e-this._firstIndex,i)},ht.prototype.getCellContent=function(t,e){return this._grid.getCellContent(t,e-this._firstIndex)},ht.prototype.setCellContent=function(t,e,i){return this._grid.setCellContent(t,e-this._firstIndex,i)},ht.prototype.getColumnCount=function(){return this._grid.getColumnCount()},ht.prototype.setColumnCount=function(t){this._grid.setColumnCount(t)},ht.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},ht.prototype.setRowCount=function(t,e){var i=this._layoutY.getLaneCount();i!==t&&(this._layoutY.setLaneCount(t),this._element.style.height=this._layoutY.getTrackSize()+"px",this._dispatch("rowCountChanged",{rowCount:t,prevCount:i,noBinding:e}))},ht.prototype.getVisibleRowCount=function(){return this.getRowCount()},ht.prototype.addRow=function(t){t<=0||(this._grid.getColumnCount()<=0?console.log("WARNING: Row cannot be added, unless at least one column is added"):this.setRowCount(this._layoutY.getLaneCount()+t))},ht.prototype.removeRow=function(t){if(!(t<=0)){var e=this._layoutY.getLaneCount();t>e&&(t=e),this.setRowCount(e-t)}},ht.prototype.setBorders=function(t,e,i,o){this._grid.setBorders(t,e,i,o)},ht.prototype.getColumnStyle=function(t,e){return this._grid.getColumnStyle(t,e)},ht.prototype.setColumnStyle=function(t,e,i){this._grid.setColumnStyle(t,e,i)},ht.prototype.enableColumnClass=function(t,e,i){this._grid.enableColumnClass(t,e,i)},ht.prototype.hasColumnClass=function(t,e){return this._grid.hasColumnClass(t,e)},ht.prototype.enableRowClass=function(t,e,i){this._grid.enableRowClass(t-this._firstIndex,e,i)},ht.prototype.setRowStyle=function(t,e,i,o){this._grid.setRowStyle(t-this._firstIndex,e,i,o)},ht.prototype.getContentWidth=function(){return this._grid.getContentWidth()},ht.prototype.getContentHeight=function(){return this._layoutY.getTrackSize()},ht.prototype.getCellsByRowIndex=function(t){return this._grid.getCellsByRowIndex(t-this._firstIndex)},ht.prototype.disableHorizontalGridLine=function(t){this._grid.disableHorizontalGridLine(t)},ht.prototype.disableVerticalGridLine=function(t){this._grid.disableVerticalGridLine(t)},ht.prototype.enableShading=function(t){this._grid.enableShading(t)},ht.prototype.setTransposedShading=function(t){this._grid.setTransposedShading(t)},ht.prototype.enableRowHighlighting=function(t){this._grid.enableRowHighlighting(t)},ht.prototype.getRowHighlight=function(){var t=this._grid.getRowHighlight();return t>=0&&(t+=this._firstIndex),t},ht.prototype.setRowHighlight=function(t){var e=this._grid.getRowHighlight();if(e>=0&&(e+=this._firstIndex),this._grid.setRowHighlight(t-this._firstIndex),(t=this._grid.getRowHighlight())>=0&&(t+=this._firstIndex),this._hasListener("rowHighlighted")){var i={};i.prevRowIndex=e,i.rowIndex=t,this._dispatch("rowHighlighted",i)}},ht.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},ht.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},ht.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},ht.prototype.setSelectedRow=function(t,e){this._selectionList.setSelection(t,e);var i=t-this._firstIndex;this._grid.setSelectedRow(i,this._selectionList.getSelection(t))},ht.prototype.selectSingleRow=function(t){this.clearSelectedRows(),this.setSelectedRow(t)},ht.prototype.selectRowRange=function(t,e){this._selectionList.selectRange(t,e),this._updateRowSelection()},ht.prototype.clearSelectedRows=function(){var t=this._selectionList.clearAllSelections();return this._grid.clearSelectedRows(),t},ht.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},ht.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},ht.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},ht.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},ht.prototype.activateColumn=function(t,e){this._grid.activateColumn(t,e)},ht.prototype.activateRows=function(t,e,i){var o=this._layoutY.getLaneCount();t||(t=this._rowOffset),e||0===e||(e=t+o),(t-=this._rowOffset)<0&&(t=0),(e-=this._rowOffset)<0&&(e=0);var n=this._getInnerRowCount(),r=this._firstIndex,s=0;(s=t-(1&t))<0?s=0:s>o&&(s=o);var l=e+(1&e)-s;l+2===n&&(l=n),l<0?l=0:l+s>o&&(l=o-s),this._firstIndex=s;var a=s+l,h=this._layoutY.getLaneStart(s),u=this._grid.getElement();u&&(u.style.transform=h?"translateY("+h+"px)":"",u.style.top="",this._reverter.start()),this._grid._onEnterDocument();var p=!1;if(l!==n){if(this._grid.setRowCount(l),l>n){var _={};_.prevRowIndex=s+n,_.rowIndex=s+l,i&&(_.noDataUpdate=!0),this._dispatch("rowAvailable",_)}p=!0}if(i){if(!p){this._grid.clearSelectedRows();var c=r+n;s<r&&r<a&&c>=a?(this.moveRowsToTop(a-r),i[0]=s,i[1]=r):r<s&&s<c&&a>=c?(this.moveRowsToTop(s-r),i[0]=c,i[1]=a):s===r&&a===c?(i[0]=0,i[1]=0):p=!0}p&&(i[0]=s,i[1]=a)}this._layoutY.isHomogeneous()||this._grid._updateRowHeights(this._layoutY,s),this._updateRowSelection()},ht.prototype.moveRowsToTop=function(t){this._grid.moveRowsToTop(t)},ht.prototype.getFirstIndexInView=function(){return this._firstIndex},ht.prototype.getLastIndexInView=function(){return this._firstIndex+this._getInnerRowCount()-1},ht.prototype.isInCurrentView=function(t){return this._firstIndex<=t&&t<this._firstIndex+this._getInnerRowCount()},ht.prototype.getFrozenLayout=function(){return this._grid.getFrozenLayout()},ht.prototype.setFrozenLayout=function(t){this._grid.setFrozenLayout(t)},ht.prototype.getColumn=function(t){return this._grid.getColumn(t)},ht.prototype.insertColumn=function(t,e){return this._grid.insertColumn(t,e)},ht.prototype.removeColumnAt=function(t){return this._grid.removeColumnAt(t)},ht.prototype.moveColumn=function(t,e){this._grid.moveColumn(t,e)},ht.prototype.enableRowVirtualization=function(t){},ht.prototype.enableColumnVirtualization=function(t){this._grid.enableColumnVirtualization(t)},ht.prototype.getColumnIndex=function(t){return this._grid.getColumnIndex(t)},ht.prototype.getCellIndex=function(t,e){var i=this._grid.getCellIndex(t,e);return i<0?-1:i+this._firstIndex},ht.prototype.getIndex=function(){return this._index},ht.prototype.setIndex=function(t){this._index=t},ht.prototype.setRowOffset=function(t){this._rowOffset=t},ht.prototype.getRowOffset=function(){return this._rowOffset},ht.prototype.updateLayout=function(){},ht.prototype.stretchCell=function(t,e,i,o){return this._grid.stretchCell(t,null!=e?e-this._firstIndex:null,i,o)},ht.prototype.unstretchCell=function(t,e){return this._grid.unstretchCell(t,null!=e?e-this._firstIndex:null)},ht.prototype.unstretchAllCells=function(t,e){return this._grid.unstretchAllCells()},ht.prototype.getStretchedCell=function(t,e){return this._grid.getStretchedCell(t,null!=e?e-this._firstIndex:null)},ht.prototype.getStretchedCells=function(){return this._grid.getStretchedCells()},ht.prototype.updateStretchedCells=function(){return this._grid.updateStretchedCells()},ht.prototype.getColumnHost=function(){return this._grid.getElement()},ht.prototype.setHidingMethod=function(t){this._grid.setHidingMethod(t)},ht.prototype.getHidingMethod=function(){return this._grid.getHidingMethod()},ht.prototype.setColumnVisibility=function(t,e,i){return this._grid.setColumnVisibility(t,e,i)},ht.prototype.getRowLayout=function(){return this._layoutY},ht.prototype.reserveRightSpace=function(t){return this._grid.reserveRightSpace(t)},ht.prototype.getReservedSpace=function(){return this._grid.getReservedSpace()},ht.prototype.getComputedStyle=function(){return this._grid.getComputedStyle()},ht.prototype.isColumnActive=function(t){return this._grid.isColumnActive(t)},ht.prototype.setRowAttributes=function(t,e){return this._grid.setRowAttributes(t,e)},ht.prototype.getContextRow=function(t){return this._grid.getContextRow(t-this._firstIndex)},ht.prototype._getInnerRowCount=function(){return this._grid.getRowCount()},ht.prototype._updateRowSelection=function(){this._grid.clearSelectedRows();var t=this._selectionList,e=t.getSelectionCount();if(!(e<=0)){var i,o=this._firstIndex,n=o+this._getInnerRowCount();if(1===e)o<=(i=t.getFirstSelectedIndex())&&i<n&&this._grid.setSelectedRow(i-o,!0);else if(e>=n-o)for(i=o;i<n;++i)t.getSelection(i)&&this._grid.setSelectedRow(i-o,!0);else for(var r=t.getAllSelections(),s=0;s<e;++s)o<=(i=r[s])&&i<n&&this._grid.setSelectedRow(i-o,!0)}},ht.prototype._dispatchRowHeightChangedEvent=function(t,e){if(t>=e)return!1;var i={};return i.rowIndex=t,i.changeLength=e-t,this._dispatch("rowHeightChanged",i),!0},ht.prototype._onRestingPosition=function(){var t=this._grid.getElement();if(t){var e=this._layoutY.getLaneStart(this._firstIndex);t.style.transform="",t.style.top=e?e+"px":""}},ht.prototype._updateRightSpaceStyle=function(t){this._grid._updateRightSpaceStyle(t)},ht.prototype._updateLayers=function(){this._grid._updateLayers()},ht.prototype._setContext=function(t){this._grid._setContext(t)},ht.prototype._getContext=function(){return this._grid._getContext()},ht._proto=ht.prototype;const ut=ht;var pt=function(t){pt._sectionType||(pt._sectionType={},pt._sectionType.title=!0,pt._sectionType.header=!0,pt._sectionType.content=!0,pt._sectionType.footer=!0);var e=this;if(e._onMouseMove=e._onMouseMove.bind(e),e._onRowHightlighted=e._onRowHightlighted.bind(e),e._onWindowResize=e._onWindowResize.bind(e),e._onSectionDataChanged=e._onSectionDataChanged.bind(e),e._onRowCountChanged=e._onRowCountChanged.bind(e),e._onRowHeightChanged=e._onRowHeightChanged.bind(e),e._onRowAvailable=e._onRowAvailable.bind(e),e._onVScroll=e._onVScroll.bind(e),e._onHScroll=e._onHScroll.bind(e),e._onSyncVScroll=e._onSyncVScroll.bind(e),e.updateLayout=e.updateLayout.bind(e),e._onRowRefresh=e._onRowRefresh.bind(e),e._onVScrollEnabled=e._onVScrollEnabled.bind(e),e._onVScrollDisabled=e._onVScrollDisabled.bind(e),e._onRowInViewChanged=e._onRowInViewChanged.bind(e),e._onColInViewChanged=e._onColInViewChanged.bind(e),e._updateVScrollbar=e._updateVScrollbar.bind(e),t)for(var o=t.childNodes.length;--o>=0;)i.isElement(t.childNodes[o])||t.removeChild(t.childNodes[o]);e._element=t||document.createElement("div"),e._element.classList.add("tr-grid"),e._layoutX=new y,e._layoutY=new y,e._layoutX.setDefaultLaneSize(100),e._layoutY.setDefaultLaneSize(32),e._settings=[],e._plugins={},e._columnDefs=[],e._sectionStarts=[],e._rowHeightException="title",e._rowVirtualizer=new tt(e._layoutY),e._rowVirtualizer.deactivate(),e._rowVirtualizer.setViewSize(360),e._colVirtualizer=new tt(e._layoutX),e._colVirtualizer.enable(!1),e._colVirtualizer.deactivate(),e._colVirtualizer.setViewSize(400),e._vscrollbar=new at,e._vscrollbar.disable(),e._vscrollbar.setParent(this.getParent()||this.getElement()),e._vscrollbar.listen("scroll",e._onVScroll),e._vscrollbar.listen("layoutChanged",e._onVScroll),e._vscrollbar.listen("activated",e.updateLayout),e._vscrollbar.listen("deactivated",e.updateLayout),e._vscrollbar.listen("thicknessChanged",e.updateLayout),e._vscrollbar.listen("enabled",e._onVScrollEnabled),e._vscrollbar.listen("disabled",e._onVScrollDisabled),e._hscrollbar=new st,e._hscrollbar.disable(),e._hscrollbar.setParent(this.getParent()||this.getElement()),e._hscrollbar.listen("scroll",this._onHScroll),e._hscrollbar.listen("layoutChanged",this._onHScroll),e._hscrollbar.listen("activated",this.updateLayout),e._hscrollbar.listen("deactivated",this.updateLayout),e._hscrollbar.setOtherScrollbar(e._vscrollbar),e._vscrollbar.setOtherScrollbar(e._hscrollbar),i.isMobile?e._element.addEventListener("touchmove",this._onMouseMove,!1):e._element.addEventListener("mousemove",this._onMouseMove,!1),window.addEventListener("resize",e._onWindowResize,!1),e._rowVirtualizer.listen("indexChanged",e._onRowInViewChanged),e._colVirtualizer.listen("indexChanged",e._onColInViewChanged),e._rowHeightConflator=new j(e._onRowHeightChanged,50),e._vScrollbarConflator=new j(e._updateVScrollbar,200),e._addEvents("sectionAdded","columnAdded","columnRemoved","columnMoved","columnVisibilityChanged","columnAlignmentChanged","widthChanged","dataSourceChanged","postDataSourceChanged","preSectionRender","postSectionRender","preSectionDataBinding","postSectionDataBinding","rowExpansionBinding","rowHighlighted","preForcedUpdate","rowAdded","rowRemoved");var n=pt.map;n||(n={},pt.map=n);var r=e._element;r._control=e;var s=r.id||r.name;s&&!n[s]||(s="_grid"+pt._runningGridId),e._id=s,n[s]=e,pt._runningGridId++;var l=document.createElement("input");l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.padding="0",l.style.border="0",l.value="0",e._hiddenInput=l,r.insertBefore(l,r.firstChild),Object.defineProperty(e,"zoomFactor",{set:function(t){!t||t<0||this._zoomFactor!==t&&(this._zoomFactor=t,e._updateLayout())},get:function(){return this._zoomFactor}})};h.inherits(pt,p),pt.SectionReference,pt.MouseInfo,pt.CellReference,pt.ColumnOptions,pt._runningGridId=0,pt._runningColumnId=0,pt._sectionType,pt.prototype._plugins,pt.prototype._dataSource=null,pt.prototype._layoutX,pt.prototype._layoutY,pt.prototype._vscrollbar,pt.prototype._hscrollbar,pt.prototype._tempFrozenSectionRef="",pt.prototype._startVScrollbarIndex=-1,pt.prototype._startHScrollbarIndex=0,pt.prototype._pinnedRightColumnCount=0,pt.prototype._frozenFooterCount=0,pt.prototype._fixFrozenTopSections=!1,pt.prototype._fixFrozenBottomSection=!1,pt.prototype._sectionStarts,pt.prototype._settings,pt.prototype._firstSettings,pt.prototype._lastSettings,pt.prototype._fitContentWidth=!1,pt.prototype._columnDefs,pt.prototype._rowVirtualizer,pt.prototype._colVirtualizer,pt.prototype._autoSetDataSource=!0,pt.prototype._renderingHandler=null,pt.prototype._dataBindingHandler=null,pt.prototype._frozenLayout=!1,pt.prototype._noBinding=!1,pt.prototype._rowHeightSync=!0,pt.prototype._rowHighlighting=!1,pt.prototype._dispatchingDataChanged=!1,pt.prototype._rowHeightException="",pt.prototype._rowScrollingStep=0,pt.prototype._zoomFactor=1,pt.prototype._reservedSpace=0,pt.prototype._hidingMethod="",pt.prototype._rowHeightConflator=null,pt.prototype._rowRefreshTimer=0,pt.prototype._layoutUpdating=!1,pt.prototype._hiddenInput,pt.prototype._bottomPadding=6,pt.prototype._bottomPaddingSect=null,pt.prototype._preserveProportion=!1,pt.prototype._preserveGridSize=!1,pt.getVersion=function(){return"5.0.38"},pt.prototype.dispose=function(){var t=this._id,e=pt.map;if(e[t]){e[t]=null,this._disposed=!0,this._rowRefreshTimer&&(clearTimeout(this._rowRefreshTimer),this._rowRefreshTimer=0),this.unlistenAll(),window.removeEventListener("resize",this._onWindowResize,!1);for(var i=this._columnDefs.length;--i>=0;){var o=this._getColumnDef(i);o.renderingHandler=o.dataBindingHandler=null}for(var n in this._plugins){var r=this._plugins[n];r.unload&&r.unload(this)}this.removeAllSections();var s=this._vscrollbar._mainScrollbar;s&&(s.unlisten("scroll",this._onSyncVScroll),this._vscrollbar._mainScrollbar=null),this._vscrollbar.dispose(),this._hscrollbar.dispose(),this._rowHeightConflator.dispose();var l=this._element;null!==l&&(l._control&&delete l._control,l.removeChild(this._hiddenInput)),this._dispose(),this._columnDefs.length=0,delete this._plugins}else console.log("WARNING: Core grid is disposed twice")},pt.prototype.isDisposed=function(){return this._disposed},pt.prototype.setParent=function(t,e){this._setParent(t,e),this._onParentChange()},pt.prototype.insertBefore=function(t){this._insertBefore(t),this._onParentChange()},pt.prototype._onParentChange=function(){var t=this.getParent()||this.getElement();this._vscrollbar._mainScrollbar||this._vscrollbar.setParent(t),this._hscrollbar.setParent(t),this._updateLayout()},pt.prototype.getConfigObject=function(t){var e=t||{},i=this.getColumnCount();e.columns||(e.columns=[]);for(var o=0;o<i;o++){var n=e.columns[o];n||(n=e.columns[o]={});var r=this._getColumnDef(o);r.styles&&(n.styles=r.styles),null!=r.stationary&&(n.stationary=r.stationary)}this._rowHighlighting&&(e.rowHighlighting=!0),this._pinnedRightColumnCount&&(e.pinnedRightColumns=this._pinnedRightColumnCount),e.columnVirtualization=this._colVirtualizer.isEnabled(),this._fixFrozenTopSections&&(e.topFreezingCount=this._startVScrollbarIndex>=0&&this._startVScrollbarIndex+1),this._fixFrozenBottomSection&&(e.bottomFreezingCount=this._frozenFooterCount),this._rowScrollingStep&&(e.stepScroll=1===this._rowScrollingStep||this._rowScrollingStep),e.autoHideScrollbar=this._vscrollbar.getAutoHide();var s=this._vscrollbar.getMouseWheelSpeed();s&&(e.linearWheelScrolling=s),this.hasClass("no-borders")&&(e.borders=!1),this.hasClass("no-gridlines")&&(e.gridlines=!1),this.hasClass("no-vertical-grid-line")&&(e.verticalLines=!1),this.hasClass("no-horizontal-grid-line")&&(e.horizontalLines=!1),this._bottomPaddingSect&&(e.contentBottomPadding=this._bottomPadding),this._reservedSpace>0&&(e.contentRightPadding=this._reservedSpace);var l=this.getDataConflationRate();for(var a in l&&(e.dataConflationRate=l),this._plugins){var h=this._plugins[a];"function"==typeof h.getConfigObject&&h.getConfigObject(e)}return e},pt.prototype.fillParentWidth=function(t){if(this._fitContentWidth)return!1;if(this._layoutX.isFixedSize())return!1;var e=this._element,i=(0|e.getBoundingClientRect().width)-e.clientLeft;return null!==this._layoutX.setTrackSize(i,this._reservedSpace)},pt.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",!1!==t&&this.updateLayout()},pt.prototype.getContentWidth=function(){return this._layoutX.getTrackSize()},pt.prototype.getSectionCount=function(){return this._settings.length},pt.prototype._updateFrozenTopSections=function(){if(!this._fixFrozenTopSections){var t=this._getTopSectionCount();this._freezeTopSectionAt(t-1)}},pt.prototype._updateFrozenBottomSections=function(){if(!this._fixFrozenBottomSection){var t=this._getBottomSectionCount();this._setFrozenFooter(t)}},pt.prototype._getTopSectionCount=function(){for(var t=this._settings,e=t.length,i=0,o=0;o<e;o++){var n=t[o].getType();if("header"!==n&&"title"!==n)break;i++}return i},pt.prototype._getBottomSectionCount=function(){for(var t=this._settings,e=0,i=t.length-1;i>=0&&"footer"===t[i].getType();i--)e++;return e},pt.prototype.addSection=function(t,e){return this.addSectionAt(this.getSectionCount(),t,e)},pt.prototype.addSectionAt=function(t,e,i){var o=this._settings.length;t<0&&(t=0),t>o&&(t=o);var n=this._toSectionType(e),r="bottomPadding"===i,s=this._newSection(r?"footer":n,i);if(!s)return null;var l=s.getSection();if(r&&(s.setAutoSyncRowCount(!1),this._bottomPaddingSect=l),t>=o?(this._putToLast(l),this._settings.push(s)):(this._settings.splice(t,0,s),l.insertBefore(this._settings[t+1].getSection())),this._updateSectionIndices(t),"footer"===(n=s.getType())?this._updateFrozenBottomSections():"header"!==n&&"title"!==n||this._updateFrozenTopSections(),this._onColumnCountChanged(),this._onSectionCountChanged(!0),this._colVirtualizer.isEnabled()){var a=this._getColActivationList(),h=this.getColumnCount();s.activateColumns(a,0,h-1)}if(this._hasListener("sectionAdded")){var u=s.extendEventArg();this._dispatch("sectionAdded",u)}return l},pt.prototype.removeSection=function(t){var e=this.getSection(t);return null!==e?this.removeSectionAt(e.getIndex()):null},pt.prototype.removeSectionAt=function(t){var e=this._settings.length;if(t>=0&&t<e){var i=this._settings[t],o=i.getIndex(),n=i.getSection(),r=i.getType();return n.setRowCount(0),this._settings.splice(t,1),this._updateSectionIndices(o),"footer"===r?(this._updateFrozenBottomSections(),this._onColumnCountChanged()):"header"!==r&&"title"!==r||this._updateFrozenTopSections(),this._onSectionCountChanged(),i.dispose(),n}return null},pt.prototype.removeLastSection=function(){return this.removeSectionAt(this._settings.length-1)},pt.prototype.removeAllSections=function(){for(var t=this._settings.length,e=0;e<t;++e)this._settings[e].dispose();this._bottomPaddingSect=null,this._firstSettings=this._lastSettings=null,this._settings.length=0,this._updateSectionIndices(0),this._onSectionCountChanged()},pt.prototype.setBottomPaddingSection=function(t){var e=this._bottomPaddingSect;t?("number"==typeof t&&(this._bottomPadding=t),e||(e=this.addSection("content","bottomPadding")),e&&(e.setDefaultRowHeight(this._bottomPadding),e.getRowCount()||e.addRow(1))):e&&this.removeSection(e)},pt.prototype._updatePaddingBottomSect=function(){var t=this._bottomPaddingSect;if(t){var e=this._settings.length-1;if(e>0){var i=this._settings[e];if(i.getSection()!==t){for(var o=null,n=e;--n>=0;){var r=this._settings[n];if(r.getSection()===t){o=r;break}}if(n>=0)return this._putToLast(t),this._settings.splice(n,1),this._settings.push(o),o.setType("footer"===i.getType()?"footer":"content"),!0;this._bottomPaddingSect=null}else{var s=this._settings[e-1];s&&i.setType("footer"===s.getType()?"footer":"content")}}}return!1},pt.prototype.moveSection=function(t,e){var o=this.getSectionCount();if(t<0)t=0;else if(t>=o)return;if(e<0?e=0:e>=o&&(e=o-1),t!==e){var n=this._settings[t],r=this._settings[e];i.moveArrayItem(this._settings,t,e),r?n.getSection().insertBefore(r.getSection()):this._putToLast(n.getSection()),this._updateSectionIndices(t<=e?t:e),this._syncRowHeights(),this._onSectionCountChanged(),this._frozenLayout||this._rowVirtualizer.update(!0)}},pt.prototype.getSection=function(t){var e=this.getSectionSettings(t);return null!==e?e.getSection():null},pt.prototype.getSectionSettings=function(t){if(i.isString(t)){if(pt._sectionType[t])return this._getNextSection(1,null,t);for(var e=this._settings.length;--e>=0;)if(this._settings[e].getId()===t)return this._settings[e]}else if(null!=t){var o=-1;if(null!=t.getIndex?o=t.getIndex():i.isNumber(t)&&(o=t),o>=0&&o<this._settings.length)return this._settings[o]}return null},pt.prototype.getAllSections=function(t){if(null==t)return this._getAllSections();for(var e=this.getAllSectionSettings(t),i=e,o=i.length;--o>=0;)i[o]=e[o].getSection();return i},pt.prototype.getAllSectionSettings=function(t){if(!t)return this._settings;var e=this._settings.length,i=[];t=this._toSectionType(t);for(var o=0;o<e;++o){var n=this._settings[o];t===n.getType()&&i.push(n)}return i},pt.prototype.getSectionIndex=function(t){if(i.isNumber(t))return t;if(t instanceof MouseEvent){var e=i.getRelativePosition(t,this._element),o={};return this._hitTestY(e.y,o),o.sectionIndex}var n=this.getSection(t);return null==n?-1:n.getIndex()},pt.prototype.getSectionTop=function(t){var e=this.getSection(t);if(null==e)return 0;var i=this._layoutY.getLaneStart(e.getRowOffset());return this._startVScrollbarIndex>=0&&e.getIndex()>=this._startVScrollbarIndex&&(i-=this._vscrollbar.getScrollTop()),i},pt.prototype.getPreviousSection=function(t,e){null==t&&(t=this._settings.length);var i=this._getNextSection(-1,t,e);return null!==i?i.getSection():null},pt.prototype.getNextSection=function(t,e){var i=this._getNextSection(1,t,e);return null!==i?i.getSection():null},pt.prototype.getLastSection=function(){return this.getSection(this._settings.length-1)},pt.prototype.getCell=function(t,e,i,o){var n=this.getSection(t);return n?n.getCell(e,i,o):null},pt.prototype.getCellInfo=function(t){if(!t)return null;var e=t.colIndex,i=t.rowIndex,o=t.sectionName,n=null;if(null==e||null==i)(n=this.getRelativePosition(t)).hit||(n=null);else{o||(o="content");var r=this.getSectionSettings(o);r&&r.getSection().getCell(e,i)&&((n={}).colIndex=e,n.rowIndex=i,r.extendEventArg(n))}return n},pt.prototype.getNextCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?e:1)},pt.prototype.getPrevCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?-e:-1)},pt.prototype._getNextCellInRow=function(t,e){var i=this.getCellInfo(t);if(i){var o=i.colIndex+e,n=i.rowIndex,r=i.section;i.colIndex=o,i.cell=r.getCell(o,n)}return i},pt.prototype.getNextCell=function(t){var e=this.getNextCellInRow(t);if(e&&!e.cell){var i=e.section,o=e.colIndex=0,n=e.rowIndex;e.rowIndex=++n,e.cell=i.getCell(o,n)}return e},pt.prototype.getPrevCell=function(t){var e=this.getPrevCellInRow(t);if(e&&!e.cell){var i=e.section,o=e.colIndex=i.getColumnCount()-1,n=e.rowIndex;e.rowIndex=--n,e.cell=i.getCell(o,n)}return e},pt.prototype.getColumnCount=function(){return this._layoutX.getLaneCount()},pt.prototype.setColumnCount=function(t){var e=this._layoutX.getLaneCount();if(t>=e){this._layoutX.setLaneCount(t);for(var i=this._settings.length;--i>=0;)this._settings[i].getSection().setColumnCount(t);this._onColumnCountChanged(),this._syncLayoutToColumns(e,t),this._dispatchColumnAddedEvent(e,t-e,!1)}else this._removeColumn(e-t)},pt.prototype.insertColumn=function(t,e){var i=this.getColumnCount();t<i||(t=i),this._layoutX.insertLane(t);for(var o=this._settings.length;--o>=0;)this._settings[o].getSection().insertColumn(t);var n=this._countPinnedRightColumns();if(this._columnDefs.splice(t,0,null),i>0){var r=this._countPinnedLeftColumns();t<r&&r<i+1?this.freezeColumn(r,n):t>i-n&&this.freezeColumn(r-1,n+1)}this._onColumnCountChanged(),this._deserializeColumn(t,e),this._syncLayoutToColumns(t,t+1),this._dispatchColumnAddedEvent(t,1,t<i,e)},pt.prototype.insertColumns=function(t,e){var i=this.getColumnCount();t<i||(t=i);var o,n=0;if(Array.isArray(e)){if(1===(n=e.length))return void this.insertColumn(t,e[0]);o=e}else{if("number"!=typeof e)return void this.insertColumn(t,e);if(1===(n=e))return void this.insertColumn(t,null)}if(!(n<=0)){var r=this._countPinnedLeftColumns(),s=this._countPinnedRightColumns(),l=this.freezeLayout(),a=[t,0].concat(new Array(n));Array.prototype.splice.apply(this._columnDefs,a);for(var h=0;h<n;h++){var u=t+h;this._layoutX.insertLane(u);for(var p=this._settings.length;--p>=0;)this._settings[p].getSection().insertColumn(u);var _=o&&o[h];this._deserializeColumn(u,_)}i>0?t<r?this.freezeColumn(r+n-1,s):t>i-s&&this.freezeColumn(r-1,s+n):r+this._pinnedRightColumnCount<n&&this.freezeColumn(r-1,this._pinnedRightColumnCount),this._dispatchColumnAddedEvent(t,n,t<i,o),this.freezeLayout(l)}},pt.prototype.removeColumnAt=function(t){var e=this.getColumnCount();if(t<0||t>=e)return null;var i=-1;this._colVirtualizer.isVirtualizable()&&(i=this._colVirtualizer.getLastIndexInView());for(var o=this._layoutX.removeLaneAt(t),n=this._settings.length,r=0;r<n;++r)this._settings[r].getSection().removeColumnAt(t);var s=this._countPinnedLeftColumns(),l=this._countPinnedRightColumns(),a=this._columnDefs.splice(t,1)[0];if(t<s?this.freezeColumn(s-2,l):t>=e-l&&this.freezeColumn(s-1,l-1),this._onColumnCountChanged(),this._syncLayoutToColumns(t,e-1,!0),a||(a={}),a.layout=o,this._hasListener("columnRemoved")){var h={atTheMiddle:!0};h.colIndex=t,h.columns="deprecated",h.columnData=a.columnData,h.colId=a.id||"",this._dispatch("columnRemoved",h)}return t<=i&&i===this._colVirtualizer.getLastIndexInView()&&this._colVirtualizer.update(),a},pt.prototype.removeAllColumns=function(){this.getColumnCount()>0&&(this._startHScrollbarIndex=0,this._pinnedRightColumnCount=0,this.setColumnCount(0))},pt.prototype.getStationaryColumnIndex=function(){for(var t=this.getColumnCount()-1;t>=0;t--)if(this._getColumnDef(t).stationary)return t;return-1},pt.prototype.isColumnMoveAllowed=function(t,e){if(Array.isArray(t)||(t=[t]),0===t.length||null==e)return!1;var i=this.getStationaryColumnIndex();if(i>-1){if(e<=i)return!1;for(var o=0;o<t.length;o++)if(t[o]<=i)return!1}return!0},pt.prototype.moveColumn=function(t,e){var o=this.getColumnCount();if(t<0?t=0:t>=o&&(t=o-1),e<0?e=0:e>=o&&(e=o-1),t===e)return!1;if(!this.isColumnMoveAllowed(t,e))return!1;var n=-1;this._colVirtualizer.isVirtualizable()&&(n=this._colVirtualizer.getLastIndexInView());var r=this._getColumnId(t);this._layoutX.moveLane(t,e);for(var s=this._settings.length,l=0;l<s;++l)this._settings[l].getSection().moveColumn(t,e);var a=this._columnDefs[t],h=this._countPinnedRightColumns();if(i.moveArrayItem(this._columnDefs,t,e),t<this._startHScrollbarIndex?e>=o-h?this.freezeColumn(this._startHScrollbarIndex-2,h+1):e>=this._startHScrollbarIndex&&this.freezeColumn(this._startHScrollbarIndex-2,h):a.rightPinned?e<this._startHScrollbarIndex?this.freezeColumn(this._startHScrollbarIndex,h-1):e<o-h&&this.freezeColumn(this._startHScrollbarIndex-1,h-1):e<this._startHScrollbarIndex?this.freezeColumn(this._startHScrollbarIndex,h):e>=o-h&&this.freezeColumn(this._startHScrollbarIndex-1,h+1),this._hasListener("columnMoved")){var u={};u.fromColIndex=t,u.toColIndex=e,u.colId=r,this._dispatch("columnMoved",u)}return n===this._colVirtualizer.getLastIndexInView()&&(t<=n&&e>n||e<=n&&t>n)&&this._colVirtualizer.update(),!0},pt.prototype.getColumnLayout=function(){return this._layoutX},pt.prototype.updateColumnLayout=function(){this._syncLayoutToColumns(0,this.getColumnCount())},pt.prototype._deserializeColumn=function(t,e){if(e){var i,o=e.layout||e,n=e.width;null!=n&&(o.size=n),null!=(n=e.scalable)&&(o.scalable=n),null!=(n=e.minWidth)&&(o.minSize=n),null==o.scalable&&(o.scalable=null==o.size),this._layoutX.deserializeLane(t,o);var r=e.styles;for(i in r)this.setColumnStyle(t,i,r[i]);var s=e.classes;for(i in s)this.enableColumnClass(t,i,s[i]);var l=this._getColumnDef(t),a=e.dataColumnName;null!=a&&(l.dataColumnName=dataColumnName),null!=(a=e.stationary)&&(l.stationary=a),this.setColumnRenderingHandler(t,e.renderingHandler),this.setColumnDataBindingHandler(t,e.dataBindingHandler),(a=e.columnData)&&this.setColumnData(t,a);var h=e.formatter||e.binding;if(Array.isArray(h)&&(h=h[0]),h&&"function"!=typeof h){var u=h.init;"function"==typeof u&&u(e,this)}}},pt.prototype.addRow=function(t){if(null==t)t=1;else if(t<=0)return;this.getColumnCount()<=0&&this.setColumnCount(1);var e=this.getLastSection();null==e&&(e=this.addSection()),e.addRow(t)},pt.prototype.removeRow=function(t){var e=this.getLastSection();null!=e&&(null==t&&(t=1),e.removeRow(t))},pt.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},pt.prototype.setSectionRowCount=function(t,e){var i=this.getSection(t);null!=i&&i.setRowCount(e)},pt.prototype.getRowIndex=function(t,e){return this._sectionStarts[t]+e},pt.prototype.getRelativeIndex=i._deprecatedFunction,pt.prototype.removeAllRows=function(){for(var t=this._settings.length,e=0;e<t;++e)this._settings[e].getSection().setRowCount(0),this._sectionStarts[e]=0;this._sectionStarts[t]=0},pt.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},pt.prototype.setDefaultRowHeight=function(t,e){if(this._layoutY.setDefaultLaneSize(t)){this._rowHeightSync=!1;var i=this._layoutY.getDefaultLaneSize();this._rowHeightException=e?"":"title";for(var o=this._settings.length,n=0;n<o;++n){var r=this._settings[n];r.getType()!==this._rowHeightException&&"bottomPadding"!==r.getId()&&r.getSection().setDefaultRowHeight(i)}this._syncRowHeights(),this._rowHeightSync=!0,this.setRowScrollingStep(this._rowScrollingStep)}},pt.prototype.getDataSource=function(){return this._dataSource},pt.prototype.setDataConflationRate=function(t){this._dataSource.setConflationRate(t)},pt.prototype.getDataConflationRate=function(){return this._dataSource.getConflationRate()},pt.prototype.setDataSource=function(t){t&&t instanceof B&&(t=new K(t));var e={};if(e.prevDataSource=this._dataSource,this._dataSource=t||null,e.dataSource=this._dataSource,this._dispatch("dataSourceChanged",e),this._autoSetDataSource)for(var i=this._settings.length,o=0;o<i;++o)this._settings[o].setDataSource(t);return this._dispatch("postDataSourceChanged",e),this._dataSource},pt.prototype.setColumnTemplate=i._deprecatedFunction,pt.prototype.getColumnTemplate=i._deprecatedFunction,pt.prototype.getColumnRenderEvent=i._deprecatedFunction,pt.prototype.getColumnDataBindingEvent=function(t){console.log("getColumnDataBindingEvent() is deprecated. Use setColumnDataBindingHandler() instead");var e=this;return{listen:function(i){e.setColumnDataBindingHandler(t,i)},unlisten:function(){e.setColumnDataBindingHandler(t,null)}}},pt.prototype.setColumnStyle=function(t,e,o,n){if(e){var r;i.isNumber(t)||(t=0,console.log("WARNING: the first parameter for setColumnStyle must be column index")),null==n?r=this._getNestedColumnDef(t,"styles"):(n=this._toSectionType(n),r=this._getNestedColumnDef(t,n,"styles")),r[e]=o;for(var s=this._settings.length;--s>=0;){var l=this._settings[s];null!=n&&n!==l.getType()||l.getSection().setColumnStyle(t,e,o)}}},pt.prototype.enableColumnClass=function(t,e,i,o){var n;"number"!=typeof t&&(t=0),null==o?n=this._getNestedColumnDef(t,"classes"):(o=this._toSectionType(o),n=this._getNestedColumnDef(t,o,"classes"));var r=!1;if((i=!1!==i)?n[e]||(r=n[e]=!0):n[e]&&(delete n[e],r=!0),r)for(var s=this._settings.length;--s>=0;){var l=this._settings[s];null!=o&&o!==l.getType()||l.getSection().enableColumnClass(t,e,i)}return r},pt.prototype.hasColumnClass=function(t,e,i){var o;return null==i?o=this._getNestedColumnDef(t,"classes"):(i=this._toSectionType(i),o=this._getNestedColumnDef(t,i,"classes")),!(!o||!o[e])},pt.prototype.setColumnAlignment=function(t,e){var i=e?e.charAt(0).toLowerCase():"",o=0;o|=this.enableColumnClass(t,"tr-align-left","l"===i),o|=this.enableColumnClass(t,"tr-align-right","r"===i),(o|=this.enableColumnClass(t,"tr-align-center","c"===i))&&this._dispatch("columnAlignmentChanged",{colIndex:t,alignment:i})},pt.prototype.getColumnAlignment=function(t){return this.hasColumnClass(t,"tr-align-right")?"right":this.hasColumnClass(t,"tr-align-center")?"center":this.hasColumnClass(t,"tr-align-left")?"left":"default"},pt.prototype.getColumnLeft=function(t){var e=this._columnDefs[t];if(e&&e.rightPinned){for(var i=this.getElement().clientWidth,o=this._layoutX.getTrackSize(),n=o<i?o:i,r=this.getColumnCount()-1;r>=t;--r)n-=this._layoutX.getLaneSize(r);return n}return this._startHScrollbarIndex>=0&&t>=this._startHScrollbarIndex?this._layoutX.getLaneStart(t)-this._hscrollbar.getScrollLeft():this._layoutX.getLaneStart(t)},pt.prototype.getColumnRight=function(t){return this.getColumnLeft(t)+this._layoutX.getLaneSize(t)},pt.prototype.getColumnWidth=function(t){return this._layoutX.getLaneSize(t)},pt.prototype.getColumnCustomLaneSize=function(t){return this._layoutX.getCustomLaneSize(t)},pt.prototype._calculateColumnWidths=function(t,e){if(!this._preserveGridSize)return e;var i,o=0,n={},r=t.length,s=new Array(r);for(i=0;i<r;i++)n[t[i]]=!0,s[i]=e[i],o+=e[i];var l=0,a=0,h=this.getColumnCount(),u=this._layoutX;for(i=0;i<h;i++)n[i]||u.isLaneVisible(i)&&(u.getLaneScalability(i)?(l+=u.getMinimumLaneSize(i),a++):l+=u.getLaneSize(i));var p=this.getContentWidth(),_=o+l-p;if(a<1||_>0){for(u.resetLaneToDefaultSize(),u.setTrackSize(p,this._reservedSpace),l=0,i=0;i<h;i++)n[i]||u.isLaneVisible(i)&&(u.getLaneScalability(i)?l+=u.getMinimumLaneSize(i):l+=u.getLaneSize(i));if((_=o+l-p)>0)for(_/=r,i=0;i<r;i++)s[i]-=_}return s},pt.prototype.setColumnWidth=function(t,e,i){var o=this._calculateColumnWidths([t],[e]),n=this._setColumnWidth(t,o[0],i);return n&&this._syncLayoutToColumns(t,t+1),n},pt.prototype.setColumnWidths=function(t,e){var i,o=0,n=[],r=[],s=[];for(i=t.length;--i>=0;){var l=t[i];null!=l&&(n.push(i),r.push(l));var a=Array.isArray(e)?e[i]:e;s.push(a)}var h=this._calculateColumnWidths(n,r);for(i=0;i<h.length;i++)o|=this._setColumnWidth(n[i],h[i],s[i]);return o&&this._syncLayoutToColumns(0,t.length),!!o},pt.prototype.isColumnVisible=function(t){return this._layoutX.isLaneVisible(t)},pt.prototype.hideColumn=function(t,e){var i=!1===e;this.setColumnVisibility(t,i,0)},pt.prototype.hideColumns=function(t,e){var i=Array.isArray(t)?t.length:0,o=[],n=this.getColumnCount();e=!1!==e;for(var r=0;r<i;++r){var s=t[r];s>=0&&s<n&&this._layoutX.hideLane(s,e,0)&&o.push(s)}if(o.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){var l={};l.colIndices=o,l.hidden=e,this._dispatch("columnVisibilityChanged",l)}},pt.prototype.showAllColumns=function(){for(var t=[],e=this.getColumnCount(),i=0;i<e;++i)this._layoutX.hideLane(i,!1,0)&&t.push(i);if(t.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){var o={};o.colIndices=t,o.hidden=!1,this._dispatch("columnVisibilityChanged",o)}},pt.prototype.getMinimumColumnWidth=function(t){return this._layoutX.getMinimumLaneSize(t)},pt.prototype.setMinimumColumnWidth=function(t,e){this._layoutX.setMinimumLaneSize(t,e)&&this._syncLayoutToColumns(t,t+1)},pt.prototype.setMinimumColumnWidths=function(t,e){for(var i=0,o=NaN,n=NaN,r=t.length;--r>=0;){var s=t[r];null!=s&&(n||(n=r),o=r,i|=this._layoutX.setMinimumLaneSize(r,s,e))}return i&&this._syncLayoutToColumns(o,n+1),!!i},pt.prototype.getColumnScalability=function(t){return this._layoutX.getLaneScalability(t)},pt.prototype.setColumnScalability=function(t,e){var o=!1;return i.isNumber(t)?(e=!1!==e,(o=this._layoutX.setLaneScalability(t,e))&&this._syncLayoutToColumns(t,t+1)):this.setDefaultColumnScalable(t),o},pt.prototype.setDefaultColumnScalable=function(t){this._layoutX.setDefaultScalability(!!t)},pt.prototype.resetColumnWidths=function(){var t=this._layoutX.resetLaneToDefaultSize();return t&&this._syncLayoutToColumns(0,this.getColumnCount()),t},pt.prototype.setColumnDefaultWidth=function(t,e){this._layoutX.setLaneDefaultSize(t,e)},pt.prototype.preserveProportion=function(t){this._preserveProportion=!0===t},pt.prototype.isProportionPreserved=function(){return this._preserveProportion},pt.prototype.preserveGridSize=function(t){this._preserveGridSize=!0===t},pt.prototype.getColumnData=function(t){return this._getColumnDef(t).columnData||null},pt.prototype.setColumnData=function(t,e){return this._getColumnDef(t).columnData=e,e},pt.prototype.newColumnData=function(t){return this.getColumnData(t)||{}},pt.prototype.setAlwaysRenderColumn=function(t,e){this.getColumnData(t).alwaysRender=!1!==e},pt.prototype._isAlwaysRenderColumn=function(t){var e=this.getColumnData(t);return!!e&&!0===e.alwaysRender},pt.prototype.getFitContentWidth=function(){return this._fitContentWidth},pt.prototype.setFitContentWidth=function(t){this._fitContentWidth!==t&&(this._fitContentWidth=t,this.enableClass("fit-width",this._fitContentWidth))},pt.prototype.loadPlugin=function(t,e){var i=null;if("string"==typeof t){var o=window.tr,n=o?o.grid:null;if(!n)return null;if(n[t])i=new n[t];else{if(!n[t+"Plugin"])return null;i=new n[t+"Plugin"]}}else i=t;if(!i||!i.getName)return null;var r=i.getName();if(!r)return null;var s=this._plugins[r];if(s){if(s===i)return s;console.log("WARNING: Two of the same "+r+"s cannot be loaded on a single grid. The existing plugin is replaced."),this.unloadPlugin(r)}return i.initialize&&i.initialize(this,e),this._plugins[r]=i,i},pt.prototype.unloadPlugin=function(t){var e;if(t){var i="";"string"==typeof t?i=t:t.getName&&(i=t.getName()),(e=this._plugins[i])||(i+="Plugin",e=this._plugins[i]),e&&(e.unload&&e.unload(this),delete this._plugins[i])}return e||null},pt.prototype.getPlugin=function(t){var e=this._plugins[t];return e||(e=this._plugins[t+"Plugin"]),e||null},pt.prototype.getPlugins=function(){var t=[];for(var e in this._plugins)t.push(this._plugins[e]);return t},pt.prototype.getPluginList=function(){var t=[];for(var e in this._plugins)t.push(e);return t},pt.prototype.freezeSection=function(t){this._fixFrozenTopSections=!0,this._freezeTopSectionAt(t)},pt.prototype._freezeTopSectionAt=function(t){if("number"==typeof t){var e=t+1;if(e===this._startVScrollbarIndex)return;this._startVScrollbarIndex=e}else this._startVScrollbarIndex=-1,"string"==typeof t&&(this._tempFrozenSectionRef=t);this._onSectionCountChanged()},pt.prototype.freezeFooter=function(t){this._fixFrozenBottomSection=!0,this._frozenFooterCount!==t&&(this._setFrozenFooter(t),this._onSectionCountChanged())},pt.prototype._setFrozenFooter=function(t){this._frozenFooterCount!==t&&(this._frozenFooterCount=t,this._vscrollbar.setFooterCount(t),this._hscrollbar.setFooterCount(t))},pt.prototype.getFooterCount=function(){return this._frozenFooterCount},pt.prototype.freezeColumn=function(t,e){t||0===t?this._startHScrollbarIndex=t>=0?t+1:0:null==t?this._startHScrollbarIndex=0:(this._startHScrollbarIndex=-1,this._hscrollbar.setScrollContent(this,this._getAllSections(),this.getColumnCount(),this._countPinnedRightColumns())),null!=e&&this._pinRightColumns(e>0?e:0),this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0)},pt.prototype._pinRightColumns=function(t){this._pinnedRightColumnCount=t;for(var e=this.getColumnCount();--e>=0;){var i=this._getColumnDef(e);--t>=0?i.rightPinned=!0:i.rightPinned&&(i.rightPinned=!1)}},pt.prototype._countPinnedLeftColumns=function(){return this._startHScrollbarIndex>=0?this._startHScrollbarIndex:0},pt.prototype._countPinnedRightColumns=function(){for(var t=0,e=this._columnDefs.length;--e>=0;){var i=this._columnDefs[e];if(!i||!i.rightPinned)break;++t}return t},pt.prototype.isPinnedColumn=function(t){return t<this.getFrozenColumnCount()||t>=this.getFirstPinnedRightIndex()},pt.prototype.getFrozenColumnCount=function(){var t=this._startHScrollbarIndex;return t<0&&(t=0),t},pt.prototype.getPinnedLeftColumnCount=pt.prototype.getFrozenColumnCount,pt.prototype.getPinnedRightColumnCount=function(){return this._pinnedRightColumnCount},pt.prototype.getFirstPinnedRightIndex=function(){return this.getColumnCount()-this._pinnedRightColumnCount},pt.prototype.updateLayout=function(){this._disposed||this._layoutUpdating||(this._layoutUpdating=!0,this._dispatch("preForcedUpdate",{}),this._updateLayout(),this._colVirtualizer.isEnabled()&&this._activateColumns(),this._layoutUpdating=!1)},pt.prototype.updateScrollbars=function(t,e){e&&this._updateScrollbarWidth(!0,!1),t&&this._updateScrollbarHeight(!0,!1)},pt.prototype.freezeLayout=function(t){t=!1!==t;var e=this._frozenLayout;if(e!==t){var i;this._frozenLayout=t,this._frozenLayout||(this._disableEvent("widthChanged"),this._onSectionCountChanged(),this._onColumnCountChanged(),this._colVirtualizer.isEnabled()&&this._activateColumns()),this._rowHeightSync=!1;var o=this._settings.length;for(i=0;i<o;i++)this._settings[i].getSection().setFrozenLayout(this._frozenLayout);this._frozenLayout||(this._syncLayoutToColumns(0,this.getColumnCount()),this._disableEvent("widthChanged",!1),this._dispatch("widthChanged",{}),this._syncRowHeights()||this._rowVirtualizer.update(!0)),this._rowHeightSync=!0}return e},pt.prototype.unfreezeLayout=function(t){this.freezeLayout(!1===t)},pt.prototype.isLayoutFrozen=function(){return this._frozenLayout},pt.prototype.showBorders=i._deprecatedFunction,pt.prototype.hideBorders=i._deprecatedFunction,pt.prototype.toggleBorders=function(t){this.toggleClass("no-borders",null!=t?!t:null)},pt.prototype.toggleGridlines=function(t){this.toggleClass("no-gridlines",null!=t?!t:null)},pt.prototype.toggleVerticalLines=function(t){this.toggleClass("no-vertical-grid-line",null!=t?!t:null)},pt.prototype.toggleHorizontalLines=function(t){this.toggleClass("no-horizontal-grid-line",null!=t?!t:null)},pt.prototype.getDataColumnMap=function(){for(var t=[],e=this.getColumnCount();--e>=0;)t[e]=this.getDataColumnName(e);return t},pt.prototype.setDataColumnMap=function(t){var e,i;if(t)for(e=t.length;--e>=0;)(i=this._getColumnDef(e)).dataColumnName=t[e];else for(e=this._columnDefs.length;--e>=0;)(i=this._columnDefs[e])&&null!=i.dataColumnName&&(i.dataColumnName=null)},pt.prototype.getDataColumnName=function(t){return this._getColumnDef(t).dataColumnName||""},pt.prototype.setDataColumnName=function(t,e){this._getColumnDef(t).dataColumnName=e},pt.prototype.setDefaultRenderingHandler=function(t){this._renderingHandler="function"==typeof t?t:null},pt.prototype.setDefaultDataBindingHandler=function(t){this._dataBindingHandler="function"==typeof t?t:null},pt.prototype.setColumnRenderingHandler=function(t,e){this._getColumnDef(t).renderingHandler="function"==typeof e?e:null},pt.prototype.setColumnDataBindingHandler=function(t,e){this._getColumnDef(t).dataBindingHandler="function"==typeof e?e:null},pt.prototype.getColumnRenderingHandler=function(t){return this._getColumnDef(t).renderingHandler||null},pt.prototype.getColumnDataBindingHandler=function(t){return this._getColumnDef(t).dataBindingHandler||null},pt.prototype.enableRowHighlighting=function(t){if(null==t&&(t=!0),this._rowHighlighting!==t){this._rowHighlighting=t;for(var e=this.getAllSections("content"),i=e.length;--i>=0;)e[i].enableRowHighlighting(this._rowHighlighting)}},pt.prototype._getTarget=function(t){var e=t.target;if(e){var o=null;return this._element.contains(e)||(o=t.composedPath?t.composedPath():t.path),o?o[0]||null:e}return t.getElement?t.getElement():i.isElement(t)?t:null},pt.prototype.getRelativePosition=function(t,e){if(!t)return{};var o=e||{},n=this._getTarget(t);t.target?i.getRelativePosition(t,this.getElement(),o):n&&i.getRelativePosition(n,this.getElement(),o),1!==this._zoomFactor&&(o.x/=this._zoomFactor,o.y/=this._zoomFactor),o.hit=!1,o.grid=this,o.clientX=t.clientX,o.clientY=t.clientY,o.zoomFactor=this._zoomFactor;var r=i.closestElement(n,"cell");if(!r)return o;o.cellElement=r;var s=i.closestElement(r,"column");o.columnElement=s;var l;if(!(l=s?i.closestElement(s,"tr-lg"):i.closestElement(r,"tr-lg")))return o;o.sectionName=l.id||i.closestElement(l,"tr-vlg").id;var a=this.getSectionSettings(o.sectionName);if(!a)return o;a.extendEventArg(o);var h=a.getSection(),u=h.getColumnIndex(s||r);return u<0||(o.colIndex=u,!1===this._hitTestY(-1,o)||(r.stretched?o.cell=h.getStretchedCell(u,o.rowIndex):o.cell=h.getCell(u,o.rowIndex),o.hit=!0)),o},pt.prototype.getColumnIndex=function(t){for(var e=this.getColumnCount();--e>=0;)if(t===this.getDataColumnName(e))return e;return-1},pt.prototype.getVScrollbar=function(){return this._vscrollbar},pt.prototype.getHScrollbar=function(){return this._hscrollbar},pt.prototype.autoHideScrollbars=function(t){t=null==t||t,this._vscrollbar.setAutoHide(t),this._hscrollbar.setAutoHide(t)},pt.prototype.getVScrollStartIndex=function(){return this._startVScrollbarIndex},pt.prototype.getHScrollStartIndex=function(){return this._startHScrollbarIndex},pt.prototype.scrollToColumn=function(t,e){if(!this._updateScrollbar(this._hscrollbar))return!1;var i=this._layoutX.getLaneCount();if(t<=0?t=0:t>=i&&(t=i-1),this.isPinnedColumn(t))return!1;var o=this._startHScrollbarIndex>0?this._layoutX.getLaneStart(this._startHScrollbarIndex):0,n=this._hscrollbar.getScrollLeft(),r=n+o,s=this._hscrollbar.getWidth(),l=this._layoutX.hitTest(r),a=this._layoutX.getLaneStart(t),h=this._layoutX.getLaneSize(t);if(e||h>=s||t<=l){var u=a-o;if(n!==u)return this._hscrollbar.setScrollLeft(u),!0}else{var p=r+s;if(t>=this._layoutX.hitTest(p-.1)){var _=n+(a+h)-p;return this._hscrollbar.setScrollLeft(_),!0}}return!1},pt.prototype.getScrollLeft=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getScrollLeft():0},pt.prototype.setScrollLeft=function(t){this._updateScrollbar(this._hscrollbar)&&this._hscrollbar.setScrollLeft(t)},pt.prototype.scrollRight=function(t){this.setScrollLeft(this._hscrollbar.getScrollLeft()+t)},pt.prototype.getScrollWidth=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getContentWidth():0},pt.prototype.getYScrollVal=function(t,e,i){if(!this._updateScrollbar(this._vscrollbar))return null;var o=null;t&&(o=this.getSection(t));var n=this._layoutY.getLaneCount(),r=o?o.getRowOffset():this._sectionStarts[this._startVScrollbarIndex];r&&(e+=r),e<=0?e=0:e>=n&&(e=n-1);var s=this._layoutY.getLaneStart(r),l=this._vscrollbar.getScrollTop()+s,a=o?o.getFirstIndexInView():this._layoutY.hitTest(l),h=-1;if(i)h=e;else if(e<=a)(h=e-3)<0&&(h=0);else{var u=l+this._vscrollbar.getHeight(),p=o?o.getLastIndexInView():this._layoutY.hitTest(u-.1);e>=p&&(h=e-(p-a)+3)<0&&(h=0)}return h>=0?this._layoutY.getLaneStart(h)-s:null},pt.prototype.scrollToRow=function(t,e,i){var o=this.getYScrollVal(t,e,i);null!==o&&this._vscrollbar.setScrollTop(o)},pt.prototype.getVScrollView=function(){if(!this._updateScrollbar(this._vscrollbar))return null;var t=this._layoutY.getLaneCount();if(0===t)return null;var e=this._sectionStarts[this._startVScrollbarIndex],i=this._layoutY.getLaneStart(e),o=this._vscrollbar.getScrollTop()+i,n=this._vscrollbar.getHeight(),r=o+n,s=this._layoutY.hitTest(o),l=this._layoutY.hitTest(r-.1),a=this._layoutY.getLaneStart(s),h=this._layoutY.getLaneEnd(l),u=o-n,p=u<=i?e:this._layoutY.hitTest(u)+1,_=r+n,c=_>=this._layoutY.getTrackSize()?t-1:this._layoutY.hitTest(_-.1)-1;s-=e,l-=e;var d={};return d.viewTop=o-i,d.viewBottom=r-i,d.topRowIndex=s,d.bottomRowIndex=l,d.firstFullRow=a<o?s+1:s,d.lastFullRow=h>r?l-1:l,d.prevPageRowIndex=p-e,d.nextPageRowIndex=c-e,d},pt.prototype.getScrollTop=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getScrollTop():0},pt.prototype.setScrollTop=function(t){this._updateScrollbar(this._vscrollbar)&&this._vscrollbar.setScrollTop(t)},pt.prototype.scrollDown=function(t){this.setScrollTop(this._vscrollbar.getScrollTop()+t)},pt.prototype.getScrollHeight=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getContentHeight():0},pt.prototype.enableAutoSetDataSource=function(t){this._autoSetDataSource=t},pt.prototype.getRowVirtualizer=function(){return this._rowVirtualizer},pt.prototype.getColumnVirtualizer=function(){return this._colVirtualizer},pt.prototype.enableRowVirtualization=function(t){this._rowVirtualizer.enable(t),this._rowVirtualizer.isEnabled()&&this._vscrollbar.isEnabled()?this._rowVirtualizer.activate():this._rowVirtualizer.deactivate()},pt.prototype.enableColumnVirtualization=function(t){this._colVirtualizer.enable(t);for(var e=this._colVirtualizer.isEnabled(),i=this._settings.length;--i>=0;)this._settings[i].enableColumnVirtualization(e)},pt.prototype.setRowScrollingStep=function(t){this._rowScrollingStep=t>0?t:0,this._vscrollbar.setScrollingStep(this._layoutY.getDefaultLaneSize()*this._rowScrollingStep)},pt.prototype.getVMouseWheelHandler=function(){return this._vscrollbar.getDefaultMouseWheelLogic()},pt.prototype.synchronizeVScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);var e=t.getVScrollbar();e._mainScrollbar=this._vscrollbar,e.setStyle("visibility","hidden"),e.setStyle("pointerEvents","none"),e.disableMouseWheel(),e.attachToExternalElement(this._vscrollbar.getParent()),this._vscrollbar.listen("scroll",t._onSyncVScroll)},pt.prototype.updateRowData=function(t,e,i,o){var n=this.getSectionSettings(t||"content");n&&n.updateRowData(e,i,o)},pt.prototype.rerender=function(){for(var t=this._settings.length,e=0;e<t;e++)this._settings[e].rerender()},pt.prototype.requestRowRefresh=function(){this._rowRefreshTimer||(this._rowRefreshTimer=setTimeout(this._onRowRefresh,100))},pt.prototype.deactivateRendering=function(t){if((t=!1!==t)!=this._noBinding){this._noBinding=t;var e=this.getSectionSettings("content");e&&(e.disableDataBinding(t),t||this.requestRowRefresh())}},pt.prototype._onRowRefresh=function(){this._rowRefreshTimer=0,this.updateRowData()},pt.prototype.disableLazyRendering=function(t){console.log("WARNING: This function is deprecated.")},pt.prototype.getData=function(t,e,i){var o=this.getSectionSettings(t);if(!o)return null;var n=this._toDataColumnName(e);return o.getData(n,i)},pt.prototype.setData=function(t,e,i,o){var n=this.getSectionSettings(t);if(n&&n.isDataBindable()){var r=this._toDataColumnName(e);return n.setData(r,i,o)}return!1},pt.prototype.removeRowData=function(t,e){var i=this.getSectionSettings(t);return!(!i||!i.isDataBindable())&&i.removeRowData(e)},pt.prototype.setHidingMethod=function(t){if(t||(t=""),this._hidingMethod!==t){this._hidingMethod=t;for(var e=this.getAllSections(),i=e.length;--i>=0;)e[i].setHidingMethod(t)}},pt.prototype.getHorizontalLayout=function(){return this._layoutX},pt.prototype.setColumnVisibility=function(t,e,i){if(this._layoutX.hideLane(t,!e,i)){if(this._syncLayoutToColumns(t,t+1),e&&this.requestRowRefresh(),this._hasListener("columnVisibilityChanged")){var o={};o.colIndex=t,o.hidden=!e,this._dispatch("columnVisibilityChanged",o)}return!0}return!1},pt.prototype.reserveRightSpace=function(t){if(this._reservedSpace!==t){this._reservedSpace=t;for(var e=this._settings.length;--e>=0;)this._settings[e].getSection().reserveRightSpace(t);return this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),!0}return!1},pt.prototype.getHiddenInput=function(){return this._hiddenInput},pt.prototype.focus=function(){var t=this._element,e=document.activeElement;if(t&&t!==e){var i=window.pageXOffset,o=window.pageYOffset;if(t.setActive)try{t.setActive()}catch(e){t.focus({preventScroll:!0})}else t.focus({preventScroll:!0});o===window.pageYOffset&&i===window.pageXOffset||window.scrollTo(i,o)}},pt.prototype.isBinding=function(){return this._dispatchingDataChanged},pt.prototype.hideRow=function(t,e){this._dataSource.hideRow(t,e)},pt.prototype.hideRows=function(t,e){Array.isArray(t)?this._dataSource.hideRows(t,e):this._dataSource.hideRow(t,e)},pt.prototype.showRows=function(t,e){Array.isArray(t)?this._dataSource.showRows(t,e):this._dataSource.showRows([t],e)},pt.prototype.unhideAllRows=function(){this._dataSource.unhideAllRows()},pt.prototype.hasHiddenRow=function(){return this._dataSource.hasHiddenRow()},pt.prototype.initSimpleTable=function(t){var e=0;t||this.getColumnCount()||(t=["Default"]),t&&(e=t.length,this.setColumnCount(e),this.setDataColumnMap(t));var i=this.addSection("title");if(i.addRow(1),!this._renderingHandler)for(var o=0;o<e;++o)i.setCellContent(o,0,t[o]);this.addSection("content");var n=this.getSectionSettings("title");n.disableDataBinding();var r=this.getSectionSettings("content");r.setAutoSyncRowCount(!0),r.setParent(n),this._dataBindingHandler||this.setDefaultDataBindingHandler(pt._defaultDataBinding)},pt._defaultDataBinding=function(t){t.cell.setContent(t.dataValue)},pt.prototype._getAllSections=function(){for(var t=[],e=this._settings.length,i=0;i<e;i++)t.push(this._settings[i].getSection());return t},pt.prototype._getNextSection=function(t,e,i){var o=this.getSectionIndex(e)+t;if(null==i)return this.getSectionSettings(o);i=this._toSectionType(i);for(var n=this._settings.length;o>=0&&o<n;){var r=this._settings[o];if(i===r.getType())return r;o+=t}return null},pt.prototype._toSectionType=function(t){if(pt._sectionType[t])return t;if(i.isString(t))switch(t.charAt(0).toLowerCase()){case"t":return"title";case"h":case"s":return"header";case"f":return"footer"}return"content"},pt.prototype._newSection=function(t,e){if(e)for(var i=this._settings.length;--i>=0;)if(this._settings[i].getId()===e)return null;var o="content"===(t=this._toSectionType(t))?new ut:new P;o._setContext(this);var n=new $(o);n.setId(e),n.setType(t),n.listen("dataChanged",this._onSectionDataChanged),n.listen("rowAvailable",this._onRowAvailable);var r="content"===t&&this._rowHighlighting;return o.enableRowHighlighting(r),o.enableShading(!1),o.setHidingMethod(this._hidingMethod),n.enableColumnVirtualization(this._colVirtualizer.isEnabled()),o.setColumnCount(this._layoutX.getLaneCount()),o.reserveRightSpace(this._reservedSpace),this._syncLayoutToSectionColumns(o),this._syncStyleToSectionColumns(o,t),t!==this._rowHeightException&&o.setDefaultRowHeight(this._layoutY.getDefaultLaneSize()),o.listen("rowHighlighted",this._onRowHightlighted),o.listen("rowCountChanged",this._onRowCountChanged),o.listen("rowHeightChanged",this._onRowHeightChanged),this._autoSetDataSource&&n.setDataSource(this._dataSource),n},pt.prototype._putToLast=function(t){if(0===this._settings.length)t.setParent(this._element,!0);else{var e=this.getLastSection().getElement().nextSibling;null!==e?t.insertBefore(e):t.setParent(this._element)}},pt.prototype._syncStyleToSectionColumns=function(t,e){for(var i,o=this._columnDefs.length;--o>=0;){var n=this._getColumnDef(o),r=n.styles;for(i in r)t.setColumnStyle(o,i,r[i]);var s=n.classes;for(i in s)t.enableColumnClass(o,i,!0);var l=n[e];if(l){for(i in r=l.styles)t.setColumnStyle(o,i,r[i]);for(i in s=l.classes)t.enableColumnClass(o,i,!0)}}},pt.prototype._syncRowHeights=function(){for(var t=this._settings.length,e=0;e<t;++e)this._syncSectionRowHeights(this._settings[e].getSection());return!this._frozenLayout&&this._updateScrollbarHeight(!0,!0)},pt.prototype._syncSectionRowHeights=function(t){this._layoutY.copyFrom(t.getRowLayout(),this._sectionStarts[t.getIndex()])},pt.prototype._setColumnWidth=function(t,e,i){var o=!1,n=this._layoutX;if(null!=i)o=n.setLaneScalability(t,!!i);else{var r=n.getLaneScalability(t);if(this._preserveProportion){if(r){for(var s=this.getColumnCount(),l=0,a=0,h=0;h<s;++h)if(n.getLaneScalability(h)){var u=n.getLaneSize(h);l+=n.getCustomLaneSize(h),a+=u}(!(e=(e*l-e*n.getCustomLaneSize(t))/(a-e))||e<0)&&(e=l)}}else o=n.setLaneScalability(t,!1)}return n.setLaneSize(t,e)||o},pt.prototype._dispatchColumnAddedEvent=function(t,e,i,o){if(this._hasListener("columnAdded")){var n={};if(n.atTheMiddle=i,1===e)n.colIndex=t,n.context=o,this._dispatch("columnAdded",n);else for(var r=Array.isArray(o)?o:[],s=0;s<e;++s)n.colIndex=t+s,n.context=r[s],this._dispatch("columnAdded",n)}this._dispatchColumnRenderEvent({},t,t+e,0,this._settings.length,NaN,NaN)},pt.prototype._dispatchColumnRenderEvent=function(t,e,i,o,n,r,s){if(o<n){var l;if(t.sender=this,t.fromColIndex=e,t.toColIndex=i,this._hasListener("preSectionRender"))for(l=o;l<n;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("preSectionRender",t);for(var a=e;a<i;++a){var h=this.getColumnRenderingHandler(a)||this._renderingHandler;if(h)for(t.colIndex=a,t.dataColumnName=this.getDataColumnName(a),l=o;l<n;++l){var u=this._settings[l];u.extendRenderEventArg(t,r,s);for(var p=u.getSection(),_=t.fromRowIndex,c=t.toRowIndex,d=_;d<c;++d)t.rowIndex=d,t.cell=p.getCell(a,d,!1),h(t)}}if(this._hasListener("postSectionRender"))for(l=o;l<n;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("postSectionRender",t);if(!t.noDataUpdate&&!this._noBinding)for(l=o;l<n;++l)this.updateRowData(this._settings[l],r,s-1)}},pt.prototype._dispatchRowExpansionBinding=function(t){if(this._hasListener("rowExpansionBinding")){var e=t.dataSource;if(e&&e.getDataSource()){var i=t.fromRowIndex,o=t.toRowIndex,n=e.getExpansionParents(i,o),r=e.getVisibleRowIds(!0),s=t.section;t.rowData=null,t.cell=null;for(var l=i;l<o;++l){var a=n[l],h=s.getContextRow(l);if(a)t.originalRowData=e.getRowData(a),t.originalRowId=a,t.rowExpansion=h.rowExpansion=!0;else{if(!h.rowExpansion)continue;t.originalRowData=null,t.originalRowId=null,t.rowExpansion=h.rowExpansion=!1}t.rowId=r[l],t.rowIndex=l,this._dispatch("rowExpansionBinding",t)}t.originalRowData=null,t.originalRowId=null,t.rowExpansion=!1}}},pt.prototype._removeColumn=function(t){var e=this._layoutX.getLaneCount();if(t>e&&(t=e),!(t<=0)){var i=e-t;this._layoutX.setLaneCount(i);for(var o=this._settings.length;--o>=0;)this._settings[o].getSection().setColumnCount(i);var n=this._columnDefs.slice(i);if(this._columnDefs.length=i,this._onColumnCountChanged(),this._syncLayoutToColumns(i,0,!0),this._hasListener("columnRemoved"))for(var r={},s=e;--s>=i;){var l=n[s-i];r.colIndex=s,r.columnData=l?l.columnData:null,this._dispatch("columnRemoved",r)}}},pt.prototype._onSectionDataChanged=function(t){if(!this._dispatchingDataChanged){this._dispatchingDataChanged=!0;var e,i,o=t.fromRowIndex,n=t.toRowIndex,r=t.section,s=t.dataSource,l=s&&s.getDataSource()?1:0;l&&(e=s.getVisibleRowIds(!0),i=s.getMultipleRowData(e,o,n),t.dataRows=i),this._dispatch("preSectionDataBinding",t);for(var a=this._layoutX.getLaneCount(),h=this.getDataColumnMap(),u=0;u<a;++u)if(r.isColumnActive(u)&&(this.isColumnVisible(u)||this._isAlwaysRenderColumn(u))){var p=this.getColumnDataBindingHandler(u)||this._dataBindingHandler;if(p){var _=h[u];t.dataColumnName=_,t.colIndex=u;for(var c=o;c<n;++c){if(l){var d=i[c];if(!d)continue;t.rowData=d,t.rowId=e[c],t.dataValue=d[_]}t.rowIndex=c,t.cell=r.getCell(u,c,!1),p(t)}}}this._dispatch("postSectionDataBinding",t),this._dispatchRowExpansionBinding(t),this._dispatchingDataChanged=!1}},pt.prototype._updateScrollbar=function(t){return!!t&&(t.isEnabled()&&t.update(),t.isActive())},pt.prototype._onVScroll=function(t){this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop())},pt.prototype._onHScroll=function(t){this._colVirtualizer.setViewOffset(this._hscrollbar.getScrollLeft())},pt.prototype._onVScrollEnabled=function(){this._updateScrollbarHeight(!0,!1),this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.activate(),this._vscrollbar.getAutoHide()||this._updateVScrollbar()},pt.prototype._onVScrollDisabled=function(){this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.deactivate()},pt.prototype._onRowInViewChanged=function(t){for(var e=t.firstIndex,i=t.lastIndex+1,o=this._settings.length,n=[0,0],r=0;r<o;++r){var s=this._settings[r],l=s.getSection();l&&!l.getFrozenLayout()&&(l.activateRows(e,i,n),this.updateRowData(s,n[0],n[1]-1))}},pt.prototype._onColInViewChanged=function(t){var e=t.prevFirstIndex,i=t.prevLastIndex,o=t.firstIndex,n=t.lastIndex,r=e<o?e:o,s=i>n?i:n;this._activateColumns(o,n,r,s);for(var l=this._rowVirtualizer.getFirstIndexInView(),a=this._rowVirtualizer.getLastIndexInView(),h=this.getSectionCount(),u=0;u<h;++u){var p=this._settings[u],_=p.getRowOffset();this.updateRowData(p,l-_,a-_)}},pt.prototype._activateColumns=function(t,e,i,o){null==i&&(i=0),null==o&&(o=this.getColumnCount()-1);for(var n=this._getColActivationList(t,e,i,o),r=this.getSectionCount();--r>=0;)this._settings[r].activateColumns(n,i,o)},pt.prototype._getColActivationList=function(t,e,i,o){null==i&&(i=0);var n=this.getColumnCount();null==o&&(o=n-1),null==t&&(t=this._colVirtualizer.getFirstIndexInView()),null==e&&(e=this._colVirtualizer.getLastIndexInView());for(var r=this._startHScrollbarIndex,s=this.getFirstPinnedRightIndex(),l=new Array(o+1),a=i;a<=o;++a)l[a]=a<r||a>=t&&a<=e||a>=s;return l},pt.prototype._getColumnDef=function(t){if(t>=0){var e=this._columnDefs[t];return e||(e=this._columnDefs[t]={id:""+pt._runningColumnId++,columnData:{}}),e}return{}},pt.prototype._getNestedColumnDef=function(t,e,i){var o=this._getColumnDef(t);if(e){var n=o;(o=n[e])||(o=n[e]={}),i&&((o=(n=o)[i])||(o=n[i]={}))}return o},pt.prototype._getColumnId=function(t){return this._getColumnDef(t).id},pt.prototype._onWindowResize=function(){this._updateLayout(),this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop())},pt.prototype._onMouseMove=function(){this._vscrollbar.flash(),this._hscrollbar.flash()},pt.prototype._onRowHightlighted=function(t){if(this._hasListener("rowHighlighted")){var e=t.sender,i=this.getSectionSettings(e.getId());if(null!=i){i.extendEventArg(t);var o=i.getDataSource();null!==o&&(t.rowId=o.getRowId(t.rowIndex),t.dataRow=o.getRowData(t.rowId)),this._dispatch("rowHighlighted",t)}}},pt.prototype._onRowCountChanged=function(t){if(!this._disposed){var e=t.sender,i=t.prevCount,o=t.rowCount,n=e.getIndex(),r=this._updateSectionIndices(n),s=0;if(i>o)this._layoutY.removeLaneAt(r,i-o),this._layoutY.isHomogeneous()||this._syncSectionRowHeights(e);else{var l=this._layoutY.getDefaultLaneSize(),a=e.getDefaultRowHeight();if(this._layoutY.insertLane(r+i,o-i),a!==l)for(s=i;s<o;++s)this._layoutY.setLaneSize(r+s,a)}var h=n<=this._startVScrollbarIndex||n>=this._getFooterStartIndex(),u=this._frozenFooterCount>0,p=this._updateScrollbarHeight(h,u,t.noBinding);this._frozenLayout||p||(this._rowVirtualizer.isVirtualizable()?e.activateRows(this._rowVirtualizer.getFirstIndexInView(),this._rowVirtualizer.getLastIndexInView()):e.activateRows()),u||this._updateVScrollbar(),i<o?this._dispatch("rowAdded",t):i>o&&this._dispatch("rowRemoved",t)}},pt.prototype._onRowHeightChanged=function(t){if(this._rowHeightSync&&!this._disposed&&!this._rowHeightConflator.conflate(t)){for(var e=this._rowHeightConflator.popAllData(),i=e.length,o=NaN,n=0;n<i;++n){var r=e[n],s=r.sender;if(this._containsSection(s))for(var l=s.getIndex(),a=r.rowIndex,h=this.getRowIndex(l,a),u=r.changeLength,p=0;p<u;++p)this._layoutY.setLaneSize(h+p,s.getRowHeight(a+p))&&(l>=o||(o=l))}this._rowHeightConflator._needScrollbarUpdate?(this._rowHeightConflator._needScrollbarUpdate=!1,this._updateScrollbarHeight(!0,!0)):o>=0&&this._updateScrollbarHeight(o<this._startVScrollbarIndex,o>=this._startVScrollbarIndex)}},pt.prototype._containsSection=function(t){for(var e=this._settings.length;--e>=0;)if(this._settings[e].getSection()===t)return!0;return!1},pt.prototype._onRowAvailable=function(t){var e=t.sectionIndex;this._dispatchColumnRenderEvent(t,0,this.getColumnCount(),e,e+1,t.prevRowIndex,t.rowIndex)},pt.prototype._onSectionCountChanged=function(t){if(!this._frozenLayout){if(this._tempFrozenSectionRef){var e=this.getNextSection(this._tempFrozenSectionRef);null!==e&&(this._startVScrollbarIndex=e.getIndex(),this._tempFrozenSectionRef="")}this._startVScrollbarIndex>=0&&this._startVScrollbarIndex<this._getFooterStartIndex()?(this._vscrollbar.enable(),this._vscrollbar.setScrollContent(this,this._getAllSections(),this._startVScrollbarIndex),t||this._updateScrollbarHeight(!0,!0),this._syncLayoutToColumns()):this._vscrollbar.disable()}},pt.prototype._onColumnCountChanged=function(){if(!this._frozenLayout){var t=this.getColumnCount(),e=this._countPinnedRightColumns();(this._startHScrollbarIndex>=0?this._startHScrollbarIndex:t)+e<t?(this._hscrollbar.enable(),this._colVirtualizer.activate(),this._hscrollbar.setScrollContent(this,this._getAllSections(),this._startHScrollbarIndex,e)):(this._hscrollbar.disable(),this._colVirtualizer.deactivate())}},pt.prototype._onSyncVScroll=function(t){this._vscrollbar.setScrollTop(t.scrollTop)},pt.prototype._getFooterStartIndex=function(){return this.getSectionCount()-this._frozenFooterCount},pt.prototype._getVScrollStart=function(){return this._getSectionSize(0,this._startVScrollbarIndex)},pt.prototype._getFooterSize=function(){return this._frozenFooterCount>0?this._getSectionSize(this._getFooterStartIndex()):0},pt.prototype._getSectionSize=function(t,e){if(t){if(t<0)return 0}else t=0;null==e&&(e=this.getSectionCount()-t);var i=this._layoutY.getLaneStart(this._sectionStarts[t]),o=t+e;return(e>0?this._layoutY.getLaneStart(this._sectionStarts[o]):0)-i},pt.prototype._updateScrollbarHeight=function(t,e,i){if(!this._vscrollbar.isEnabled())return!1;var o=e,n=t&&this._startVScrollbarIndex>=0,r=this._rowHeightConflator.isConflating();if(r&&(this._rowHeightConflator._needScrollbarUpdate=!0,o=!1),n&&!r){var s=this.getElement();if(!s)return!1;var l=this.getParent(),a=this._vscrollbar.getParent();a?a!==l&&a.firstElementChild&&(a=a.firstElementChild):(a=s,this._vscrollbar.setParent(a));var h=this._getVScrollStart(),u=this._getFooterSize();a!==s&&(h+=s.clientTop),this._vscrollbar.resetPaneSize();var p=a.clientHeight-(h+u)*this._zoomFactor;this._vscrollbar.setTop(h*this._zoomFactor),this._vscrollbar.setTrackSize(p,p/this._zoomFactor);var _=this._layoutY.getDefaultLaneSize(),c=12*_;p>c&&(c=(Math.ceil(p/_)+4)*_),this._rowVirtualizer.setViewSize(c/this._zoomFactor),this._rowVirtualizer.setViewBounds(this._startVScrollbarIndex,this.getFooterCount())}else this._rowVirtualizer.validateVirtualization();var d=!1;return i||(d=this._rowVirtualizer.update()),this._vscrollbar.invalidate(o),d},pt.prototype._updateScrollbarWidth=function(t,e){if(t&&this._startHScrollbarIndex>=0){var i=this.getElement(),o=this._hscrollbar.getParent();o||(o=this.getParent()||i,this._hscrollbar.setParent(o));var n=this._layoutX.getLaneStart(this._startHScrollbarIndex),r=this._layoutX.getLaneCount(),s=0,l=this._countPinnedRightColumns();l&&(s=this._layoutX.getLaneStart(r)-this._layoutX.getLaneStart(r-l));var a=o!==i?i.clientLeft:0,h=o.clientWidth-(n+a+s)*this._zoomFactor;l>0&&(h-=this._reservedSpace),this._hscrollbar.setPaneLeft(n),this._hscrollbar.setLeft((n+a)*this._zoomFactor),this._hscrollbar.setTrackSize(h,h/this._zoomFactor);var u=4*this._layoutX.getDefaultLaneSize();h>u&&(u=h),this._colVirtualizer.setViewSize(u/this._zoomFactor),this._colVirtualizer.setViewBounds(this._startHScrollbarIndex,l)}else this._colVirtualizer.validateVirtualization();this._colVirtualizer.update(),this._hscrollbar.invalidate(e)},pt.prototype._hitTestY=function(t,e){var o;if(e.sectionSettings)o=e.sectionSettings;else{var n,r=(n="number"==e.rowIndex?e.rowIndex:this._layoutY.hitTest(t))>=0?n:~n,s=i.upperBound(this._sectionStarts,r)-1;if(e.sectionIndex=s,!(o=this._settings[s]))return!1;o.extendEventArg(e)}var l=o.getSection();return null!=e.colIndex&&e.cellElement?e.rowIndex=l.getCellIndex(e.colIndex,e.cellElement):e.rowIndex=n+l.getRowOffset(),!0},pt.prototype._syncLayoutToColumns=function(t,e,i){if(!this._frozenLayout){var o=this._layoutX.getLaneCount(),n=this.fillParentWidth(100);(n||null==t||null==e)&&(t=0,e=o,n=!0);var r=this._settings.length;if(!(r<=0)){var s=!1;if(t<e)for(var l=0;l<r;++l)s=this._syncLayoutToSectionColumns(this._settings[l].getSection(),t,e)||s;var a=n||t<this._startHScrollbarIndex||e>this.getFirstPinnedRightIndex();this._updateScrollbarWidth(a,!0),(s||i)&&this._dispatch("widthChanged",{from:t,to:e,colChanged:t})}}},pt.prototype._syncLayoutToSectionColumns=function(t,e,i){null==e&&(e=0),null==i&&(i=this._layoutX.getLaneCount());for(var o=0,n=e;n<i;++n)o|=t._setColumnWidth(n,this._layoutX.getLaneSize(n));return!(!o||this._frozenLayout||(t._updateColumnLayout(),0))},pt.prototype._toDataColumnName=function(t){return i.isNumber(t)?this.getDataColumnName(t):t},pt.prototype._updateSectionIndices=function(t){this._updatePaddingBottomSect()&&--t,t<0&&(t=0);var e=this._settings.length,i=this._settings[0]||null;i!==this._firstSettings&&(this._firstSettings&&this._firstSettings.getSection().removeClass("first"),this._firstSettings=i,this._firstSettings&&this._firstSettings.getSection().addClass("first"));var o=this._settings[e-1]||null;o!==this._lastSettings&&(this._lastSettings&&this._lastSettings.getSection().removeClass("last"),this._lastSettings=o,this._lastSettings&&this._lastSettings.getSection().addClass("last")),this._sectionStarts.length=e+1,this._sectionStarts[0]=0;for(var n=t;n<e;++n){var r=this._settings[n].getSection();r.setIndex(n),r.setRowOffset(this._sectionStarts[n]),this._sectionStarts[n+1]=this._sectionStarts[n]+r.getRowCount()}return this._sectionStarts[t]},pt.prototype._updateLayout=function(){if(!this._disposed){this._syncLayoutToColumns(),this._updateScrollbarHeight(!0,!0),this._updateScrollbarWidth(!0,!0);for(var t=this.getSectionCount(),e=0;e<t;++e){var i=this._settings[e],o=i.getSection();"title"==i.getType()&&o.updateLayout(),o.getReservedSpace()&&o._updateRightSpaceStyle(this._hscrollbar.isActive()&&!this._pinnedRightColumnCount)}}},pt.prototype._updateVScrollbar=function(){!this._disposed&&this._vscrollbar.isEnabled()&&(this._vScrollbarConflator.conflate()||this._vscrollbar.update())},pt._proto=pt.prototype;const _t=pt;var ct=function(){};h.inherits(ct,s),ct.prototype.getName=function(){return"Plugin"},ct.prototype.initialize=function(t){this._host=t},ct.prototype.unload=function(t){this._host=null,this.unlistenAll()},ct.prototype.getRelativeGrid=function(t){var e;if(t.target){var o=(e=t.target).api;if(o&&o.getCoreGrid)return o.getCoreGrid()}else t.getElement?e=t.getElement():i.isElement(t)&&(e=t);var n=e?i.closestElement(e,"tr-grid"):null;if(n)if(this._host){if(this._host.getElement()===n)return this._host}else for(var r=this._hosts?this._hosts.length:0,s=0;s<r;s++){var l=this._hosts[s];if(l.getElement()===n)return l}return null},ct.prototype.getGridElementFromPoint=function(t,e){for(var o=document.elementFromPoint(t,e),n=i.closestElement(o,"tr-grid"),r=[],s=[];!n&&o&&"HTML"!=o.tagName;)r.push(o),s.push(o.style.visibility),o.style.visibility="hidden",o=document.elementFromPoint(t,e),n=i.closestElement(o,"tr-grid");for(var l=0;l<r.length;l++)r[l].style.visibility=s[l];return n},ct.prototype._getDataColumnMap=function(){return this._dataMap?this._dataMap:this._host?this._host.getDataColumnMap():this._hosts&&this._hosts[0]?this._hosts[0].getDataColumnMap():null},ct.prototype._getDataColumnName=function(t){var e=this._getDataColumnMap();return e&&e[t]||""},ct.prototype._isNotFirstHost=function(t){return!!this._hosts&&t.sender!==this._hosts[0]},ct.prototype._onColumnAdded=function(t){if(!this._isNotFirstHost(t)&&t.atTheMiddle){var e=t.colIndex;i.insertArrayItem(this._colData,e,null),i.insertArrayItem(this._dataMap,e,null)}},ct.prototype._onColumnMoved=function(t){if(!this._isNotFirstHost(t)){var e=t.fromColIndex,o=t.toColIndex;i.moveArrayItem(this._colData,e,o),i.moveArrayItem(this._dataMap,e,o)}},ct.prototype._onColumnRemoved=function(t){if(!this._isNotFirstHost(t)&&t.atTheMiddle){var e=t.colIndex;this._colData&&this._colData.splice(e,1),this._dataMap&&this._dataMap.splice(e,1)}},ct.prototype._getColumnCount=function(){var t=this._host||this._hosts[0];return t?t.getColumnCount():0},ct.prototype._getPlugin=function(t){var e=this._host||this._hosts[0];return e?e.getPlugin(t):null},ct.prototype._scrollDown=function(t){(this._host||this._hosts[0]).scrollDown(t)},ct.prototype._scrollToRow=function(t){(this._host||this._hosts[0]).scrollToRow(null,t)},ct.prototype._scrollRight=function(t){if(this._host)this._host.scrollRight(t);else if(this._hosts)for(var e=this._hosts.length,i=0;i<e;++i)this._hosts[i].scrollRight(t)},ct.prototype._host=null,ct.prototype._hosts=null,ct.prototype._dataMap=null,ct.prototype._colData=null,ct._proto=ct.prototype;const dt=ct;var gt=function(){var t=this;t._onColumnAdded=t._onColumnAdded.bind(t),t._onColumnMoved=t._onColumnMoved.bind(t),t._onColumnRemoved=t._onColumnRemoved.bind(t),t._onMouseUp=t._onMouseUp.bind(t),t._onMouseDown=t._onMouseDown.bind(t),t._onDrag=t._onDrag.bind(t),t._onDragStart=t._onDragStart.bind(t),t._onDragEnd=t._onDragEnd.bind(t),t._onDragPulse=t._onDragPulse.bind(t),t._hosts=[],t._guideline=document.createElement("svg"),t._guideline.className="tr-guideline",t._dragbox=document.createElement("svg"),t._dragbox.className="tr-dragbox",t._addEvent("dragged"),t._addEvent("dragStart"),t._addEvent("dragInterval"),t._addEvent("preColumnMoved"),t._addEvent("columnMoved")};h.inherits(gt,dt),gt.prototype._clickedGrid,gt.prototype._clickedSection=null,gt.prototype._clickedRow=-1,gt.prototype._guideline,gt.prototype._dragbox,gt.prototype._timerId=0,gt.prototype._dragPulseId=0,gt.prototype._pos=null,gt.prototype._cacheLeft=0,gt.prototype._cacheWidth=0,gt.prototype._startColumn=-1,gt.prototype._endColumn=-1,gt.prototype._destColumn=-1,gt.prototype._leftMovableBorder=-1,gt.prototype._rightMovableBorder=-1,gt.prototype._isDragging=!1,gt.prototype._lockFrozen=!1,gt.prototype._disabled=!1,gt.prototype._noColumnMoving=!1,gt.prototype._noDragBox=!1,gt.prototype.getName=function(){return"DragAndDropTitlePlugin"},gt.prototype.initialize=function(t){this._hosts.indexOf(t)>=0||(this._hosts.push(t),t.listen("mousedown",this._onMouseDown),t.listen("columnAdded",this._onColumnAdded),t.listen("columnMoved",this._onColumnMoved),t.listen("columnRemoved",this._onColumnRemoved),t.listen("dragstart",i._preventDefault))},gt.prototype.unload=function(t){var e=this._hosts.indexOf(t);e<0||(this._hosts.splice(e,1),t.unlisten("mousedown",this._onMouseDown),t.unlisten("columnAdded",this._onColumnAdded),t.unlisten("columnMoved",this._onColumnMoved),t.unlisten("columnRemoved",this._onColumnRemoved))},gt.prototype.getMarker=function(){return null},gt.prototype.lockFrozenColumn=function(t){this._lockFrozen=t},gt.prototype.disable=function(t){this._disabled=!1!==t},gt.prototype.disableMoving=function(t){this._noColumnMoving=!1!==t},gt.prototype.disableDragBox=function(t){this._noDragBox=!1!==t},gt.prototype._isAllowed=function(t){var e=this._clickedGrid||this._hosts[0];if(e){var i=e.getStationaryColumnIndex();if(i<0)return!0;if(t<=i)return!1}return!0},gt.prototype._onMouseDown=function(t){if(!this._disabled&&!(t.shiftKey||t.ctrlKey||t.altKey||t.button||this._timerId)){var e=this.getRelativeGrid(t);if(e&&(this._pos=e.getRelativePosition(t),!1!==this._pos.hit)){var i=this._pos.section;if(i&&"title"===this._pos.sectionType){var o=this._pos.colIndex;if(this._isAllowed(o)&&(!this._lockFrozen||!e.isPinnedColumn(o))){var n=this._pos.rowIndex,r=this._findMoveableBorder(o,n-1,i),s=this._getSpan(o,n,i);this._clickedGrid=e,this._clickedSection=i,this._clickedRow=n,this._startColumn=s.left,this._endColumn=s.right,this._leftMovableBorder=r.left,this._rightMovableBorder=r.right,this._destColumn=this._startColumn,this._timerId=setTimeout(this._onDragStart,300),window.addEventListener("mouseup",this._onMouseUp,!1)}}}}},gt.prototype._onMouseUp=function(t){this._timerId&&(window.clearTimeout(this._timerId),window.removeEventListener("mouseup",this._onMouseUp,!1),this._timerId=0,this._clearCache())},gt.prototype._onDragStart=function(){if(!this._disabled&&!this._isDragging&&(this._hasListener("dragStart")&&this._dispatch("dragStart",this._pos),!this._pos.cancel&&(this._timerId=0,window.removeEventListener("mouseup",this._onMouseUp,!1),this._clickedGrid))){this._isDragging=!0,document.body.classList.add("tr-dragging"),window.addEventListener("mousemove",this._onDrag,!1),window.addEventListener("mouseup",this._onDragEnd,!0);var t=this._clickedGrid,e=t.getHeight(),i=this._clickedSection.getBoundingClientRect(),o=this._clickedSection.getCell(this._startColumn,this._clickedRow).getBoundingClientRect(),n=t.getElement();this._guideline.style.top=o.top-i.top+"px",this._guideline.style.height=e-1+"px",this._dragbox.style.height=e-33+"px",this._dragbox.style.width=this._clickedSection.getColumnWidth(this._startColumn)+"px",n.appendChild(this._guideline),this._dimCol(!0),this._renderGuideline(),this._scrollStep=Math.floor(t.getScrollWidth()/25),this._scrollStep<40?this._scrollStep=40:this._scrollStep>400&&(this._scrollStep=400);var r=t.getHScrollbar();this._cacheLeft=r.getLeft()+20,this._cacheWidth=r.getLeft()+r.getWidth()-20,this._dragPulseId=window.setInterval(this._onDragPulse,150)}},gt.prototype._onDrag=function(t){if(this._isDragging){i._preventDefault(t),this._pos=this._clickedGrid.getRelativePosition(t);var e=this.getRelativeGrid(t);if(e&&e===this._clickedGrid){var o=this._pos.colIndex;!(o>=this._leftMovableBorder&&o<=this._rightMovableBorder&&this._isAllowed(o))||this._lockFrozen&&e.isPinnedColumn(o)||(this._renderGuideline(),this._dispatch("dragged",t)),this._renderDragBox(t)}}},gt.prototype._onDragEnd=function(t){if(this._isDragging){this._isDragging=!1,document.body.classList.remove("tr-dragging"),this._dimCol(!1);var e=this._guideline.parentNode;if(e&&e.removeChild(this._guideline),(e=this._dragbox.parentNode)&&e.removeChild(this._dragbox),window.removeEventListener("mousemove",this._onDrag,!1),window.removeEventListener("mouseup",this._onDragEnd,!0),this._dragPulseId&&(window.clearInterval(this._dragPulseId),this._dragPulseId=0),this._pos=null,i._preventDefault(t),this._destColumn>this._startColumn&&--this._destColumn,!this._destColumn&&0!==this._destColumn||this._destColumn<0||!this._isAllowed(this._destColumn)||this._destColumn>=this._startColumn&&this._destColumn<=this._endColumn)this._clearCache();else{var o={startColumnIndex:this._startColumn,destColumnIndex:this._destColumn};if(this._hasListener("preColumnMoved")&&this._dispatch("preColumnMoved",o),!o.cancel){if(!this._noColumnMoving){var n=-1,r=-1;this._startColumn>this._destColumn?(n=this._destColumn,this._startColumn,r=-1*(this._startColumn-this._destColumn)):this._startColumn<this._destColumn&&(n=this._endColumn+1,r=this._destColumn-n+1);for(var s=this._hosts.length;--s>=0;){var l,a=this._hosts[s];if(r>0)for(l=this._startColumn;l<=this._endColumn;l++)a.moveColumn(this._startColumn,this._destColumn);else for(l=this._startColumn;l<=this._endColumn;l++)a.moveColumn(this._startColumn+(l-this._startColumn),this._destColumn+(l-this._startColumn))}}this._hasListener("columnMoved")&&this._dispatch("columnMoved",{startColumnIndex:this._startColumn,endColumnIndex:this._endColumn,destColumnIndex:this._destColumn,clickedRow:this._clickedRow}),this._clearCache()}}}},gt.prototype._onDragPulse=function(){if(this._isDragging&&this._pos){this._dispatch("dragInterval",this._pos);var t=this._clickedGrid;if(t&&t.getHScrollbar().isActive()){var e=this._pos.x,i=0;e<this._cacheLeft?i=-Math.floor(this._scrollStep*(.8+Math.random())):e>this._cacheWidth&&(i=Math.floor(this._scrollStep*(.8+Math.random()))),this._scrollRight(i)}}},gt.prototype._clearCache=function(){this._startColumn=this._endColumn=this._destColumn=-1,this._leftMovableBorder=this._rightMovableBorder=-1,this._clickedRow=-1,this._clickedSection=this._clickedGrid=null},gt.prototype._getSpan=function(t,e,i){var o=i.getCellColSpan(t,e);return o<=0&&(t+=o,o=i.getCellColSpan(t,e)),{left:t,right:t+o-1}},gt.prototype._findMoveableBorder=function(t,e,i){if(e<0||!e&&0!==e)return{left:0,right:i.getColumnCount()-1};var o=this._getSpan(t,e,i);return o.right>=o.left?o:this._findMoveableBorder(t,e-1,i)},gt.prototype._renderGuideline=function(){var t=this._pos.colIndex;if(!(null==t||t<0)){for(var e=this._getSpan(t,this._clickedRow,this._clickedSection),i=e.left,o=e.right,n=this._clickedGrid.getColumnLeft(i),r=0,s=i;s<=o;++s)r+=this._clickedGrid.getColumnWidth(s);var l=this._pos.x>n+r/2,a=l?o+1:i;n=this._clickedGrid.getColumnLeft(this._destColumn),a<this._leftMovableBorder?a=this._leftMovableBorder:a>this._rightMovableBorder&&(a=this._rightMovableBorder+1,l&&(n-=4)),this._destColumn=a,this._guideline.style.left=n+"px"}},gt.prototype._renderDragBox=function(t){if(!this._noDragBox){var e=this._clickedGrid.getElement();this._dragbox.parentNode||e.appendChild(this._dragbox);var i=e.getBoundingClientRect(),o=this._clickedGrid.zoomFactor,n=i.width,r=t.clientX-i.left,s=(t.pageY-i.top)/o-window.scrollY,l=parseFloat((r/n).toFixed(2)),a=i.width*l/o-this._dragbox.offsetWidth*l;this._dragbox.style.left=a+"px",this._dragbox.style.top=s+10+"px"}},gt.prototype._dimCol=function(t){for(var e=this._startColumn;e<=this._endColumn;e++)this._clickedGrid.enableColumnClass(e,"drag-fadeout",t)},gt._proto=gt.prototype;const ft=gt;var yt=function(t){var e=this;e._onSectionAdded=e._onSectionAdded.bind(e),e._onMouseDown=e._onMouseDown.bind(e),e._onUIUpdated=e._onUIUpdated.bind(e),e._onColumnAdded=e._onColumnAdded.bind(e),e._onColumnRemoved=e._onColumnRemoved.bind(e),e._onItemSortingClicked=e._onItemSortingClicked.bind(e),e.refresh=e.refresh.bind(e),e._hosts=[],e._sortLogic={},e._addEvents("preClicked","clicked","preDataSorting","columnSorted"),e._sortStates=[],e._sortingSequence=["a","d"],t&&e.config({sorting:t})};h.inherits(yt,dt),yt.prototype._sortStates,yt.prototype._maxCount=1,yt.prototype._dataSorting=!0,yt.prototype._isDisableDoubleClickToSort=!0,yt.prototype._clickTimer=0,yt.prototype._delayInterval=0,yt.prototype._lastMouseDown=0,yt.prototype._initialSort=null,yt.prototype._mode="",yt.prototype._sortableColumns=!0,yt.prototype._sortableIndicator=!1,yt.prototype._solarTheme=!1,yt.prototype._sortLogic,yt.prototype._userManagedLogic=!1,yt.prototype._disabled=!1,yt.prototype._rowDefMode=!1,yt._icons={},yt.prototype._sortingSequence,yt.prototype._sortingSequenceMap=null,yt.prototype.getName=function(){return"SortableTitlePlugin"},yt.prototype.initialize=function(t,e){this._hosts.indexOf(t)>=0||(this._hosts.push(t),1===this._hosts.length&&(t.listen("columnAdded",this._onColumnAdded),t.listen("columnRemoved",this._onColumnRemoved)),t.listen("sectionAdded",this._onSectionAdded),t.listen("postSectionRender",this._onUIUpdated),t.listen("dataSourceChanged",this.refresh),this.config(e))},yt.prototype.unload=function(t){var e=this._hosts.indexOf(t);e<0||(this._hosts.splice(e,1),t.unlisten("sectionAdded",this._onSectionAdded),t.unlisten("postSectionRender",this._onUIUpdated),t.unlisten("dataSourceChanged",this.refresh),t.unlisten("columnAdded",this._onColumnAdded),t.unlisten("columnRemoved",this._onColumnRemoved),this._hosts.length<=0&&this._clickTimer&&(clearTimeout(this._clickTimer),this._clickTimer=0))},yt.prototype.afterInit=function(){var t=this;if(t.setSortLogics(t._sortLogic),null!=t._initialSort){var e=t._initialSort;Array.isArray(e)||(e=[e]),1===t._maxCount&&(e=e.slice(0,1)),t.sortColumns(e)}},yt.prototype.config=function(t){if(t){var e=this,i=t.icons;null!=i&&i.sorting&&(yt._icons=i.sorting);var o=t.themeName;!o||o.indexOf("solar")>=0?e._solarTheme=!0:e._solarTheme=!1,e._initialSort=e._initialSortByColumnField(t);var n=t.sorting;if(n){n.ROW_DEF&&(this._rowDefMode=!0),n.userManagedLogic&&(e._userManagedLogic=!0);var r=n.multiColumn||n.multicolumn;if(null!=r&&(!0===r&&(r=-1),!1===r&&(r=1),e.setSortableColumnCount("number"==typeof r&&r>0?r:-1)),null!=(r=n.sortableIndicator)&&(e._sortableIndicator=r),null!=(r=n.disabled)&&(e._disabled=!!r),null!=(r=n.threeStatesSorting)&&e.disableTwoStateSorting(r),null!=(r=n.sortingSequence)&&Array.isArray(r)&&(e._sortingSequence=r),null!=(r=n.mode)&&(e._mode=r,"manual"===r&&e.disableDataSorting()),null!=(r=n.indicatorOnly)&&e.disableDataSorting(r),null!=(r=n.disableDoubleClickToSort)&&e.disableDoubleClickToSort(r),"function"==typeof(r=n.columnSorted)&&e.listen("columnSorted",r),"function"==typeof(r=n.preClicked)&&e.listen("preClicked",r),"function"==typeof(r=n.clicked)&&e.listen("clicked",r),"function"==typeof(r=n.preDataSorting)&&e.listen("preDataSorting",r),null!=(r=n.sortableColumns)&&(e._sortableColumns=r),"object"==typeof(r=n.initialSort)&&(e._initialSort=r),"object"==typeof(r=n.sortLogic))for(var s in r)"function"==typeof r[s]&&(e._sortLogic[s]=r[s])}}},yt.prototype.getConfigObject=function(t){var e=t||{},i=e.columns;i||(i=e.columns=[]);var o=this._hosts[0];if(!o)return e;for(var n,r,s,l=o.getColumnCount(),a=0;a<l;++a)(n=i[a])||(n=i[a]={}),(r=this._getSortOptions(a))&&(this._sortableColumns?r.disabled&&(n.sortable=!1):r.disabled||(n.sortable=!0),(s=r.field)&&(n.sortBy=s,this._sortingSequenceMap&&this._sortingSequenceMap[s]&&(n.sortingSequence=this._sortingSequenceMap[s])));var h=e.sorting;h||(h=e.sorting={}),h.initialSort=this.getSortedColumns(),h.sortableIndicator=this._sortableIndicator,1!==this._maxCount&&(h.multiColumn=-1===this._maxCount||this._maxCount),h.disableDoubleClickToSort=this._isDisableDoubleClickToSort,h.sortableColumns=this._sortableColumns,h.indicatorOnly=!this._dataSorting,this._disabled&&(h.disabled=!0);var u=this._sortingSequence,p=!0;return 2===u.length&&"a"===u[0]&&"d"===u[1]&&(p=!1),p&&(h.sortingSequence=u.slice()),e},yt.prototype.getColumnMenu=function(t,e){e||(e={});var i=e.menus;i||(i=e.menus=[]);var o=i[0];o||(o=i[0]={menuItems:[]});var n=this.getSortOrder(t),r={indexScore:100,label:"Sort Column",icon:"sort-a-to-z",group:"FREQUENTLY_USED",subMenu:{menuItems:[{indexScore:3,label:"Ascending",radioMode:!0,value:{colIndex:t,order:"a"},selected:"a"===n,click:this._onItemSortingClicked},{indexScore:2,label:"Descending",radioMode:!0,value:{colIndex:t,order:"d"},selected:"d"===n,click:this._onItemSortingClicked},{indexScore:1,label:"Un-Sort",radioMode:!0,value:{colIndex:t,order:"n"},selected:"n"===n,click:this._onItemSortingClicked}]}};return o.menuItems.push(r),e},yt.prototype._onItemSortingClicked=function(t){this._hosts[0].getPlugin("ColumnMenuPlugin").hide();var e=t.currentTarget.value,i=e.colIndex,o=e.sortOrder;this.sortColumn(i,o)},yt.prototype.getIcons=function(){return yt._icons},yt.prototype.setSortLogics=function(t){if(null!=t){var e=this._hosts[0];if(e){var i=e.getDataSource();for(var o in t)this._setSortLogic(i,o,t[o])}}},yt.prototype.setSortLogic=function(t,e){if("string"==typeof t){var i=this._hosts[0];if(i){var o=i.getDataSource();this._setSortLogic(o,t,e)}}},yt.prototype._setSortLogic=function(t,e,i){t&&"string"==typeof e&&("*"===e?t.setSortingLogic(i):t.setColumnSortingLogic(e,i))},yt.prototype.getSortOrder=function(t){var e=null!=t?this.getSortPriority(t):0,i=this._sortStates[e];return(i?i.sortOrder:"")||"n"},yt.prototype.getSortedColumnIndex=function(t){var e=this._sortStates[t||0];if(e)for(var i=this._hosts[0],o=i?i.getColumnCount():0,n=0;n<o;++n)if(this._getSortOptions(n)===e)return n;return-1},yt.prototype.getSortPriority=function(t){var e=this._getSortOptions(t);if(e&&e.sortOrder)for(var i=this._sortStates.length,o=0;o<i;++o)if(this._sortStates[o]===e)return o;return-1},yt.prototype.isColumnSorted=function(t){return this.getSortPriority(t)>=0},yt.prototype.getSortedColumns=function(){var t=this._sortStates.length;if(t<=0)return null;for(var e=new Array(t),i=0;i<t;++i){var o=this.getSortedColumnIndex(i);e[i]={colIndex:o,sortOrder:this._sortStates[i].sortOrder||"n"}}return e},yt.prototype.sortColumn=function(t,e,i){if(t>=0){var o=this._preSortColumn(t,e);o&&this._sortColumn([o],i)}},yt.prototype.sortColumns=function(t,e){if(Array.isArray(t)){for(var i=[],o=0;o<t.length;o++){var n=t[o],r=this._preSortColumn(n.colIndex,n.sortOrder||n.order);r&&(i[o]=r)}this._sortColumn(i,e)}},yt.prototype.clearSortState=function(t){this._popSortState(0,t),this.updateSortSymbols()},yt.prototype.refresh=function(){this._sortStates.length&&(this._sortDataView(),this.updateSortSymbols())},yt.prototype.restoreUserActions=yt.prototype.refresh,yt.prototype.setSortableColumnCount=function(t){this._maxCount=t||1,this._popSortState(this._maxCount)},yt.prototype.getSortingStates=function(){return this._sortStates},yt.prototype.updateSortSymbols=function(){if(!this._disabled)for(var t=this._hosts.length;--t>=0;)this._updateSortableIndicator(t)},yt.prototype.getDataColumnMap=function(){var t=this._hosts[0],e=[];if(t)for(var i=t.getColumnCount(),o=0;o<i;++o)e[o]=this.getColumnSortingField(o);return e},yt.prototype.getDataColumnNames=yt.prototype.getDataColumnMap,yt.prototype.setDataColumnMap=function(t){if(Array.isArray(t))for(var e=t.length;--e>=0;)this.setColumnSortingField(e,t[e])},yt.prototype.setDataColumnNames=yt.prototype.setDataColumnMap,yt.prototype.getColumnSortingField=function(t){var e=this._getSortOptions(t),i=e?e.field:null;if(null==i&&!this._rowDefMode){var o=this._hosts[0];o&&(i=o.getDataColumnName(t))}return i||""},yt.prototype.setColumnSortingField=function(t,e,i){if("number"==typeof t&&null!=e){var o=this._newSortOptions(t);e||(e=""),o.field!==e&&(o.field=e),null==i||this._userManagedLogic||o.sortLogic!==i&&(o.sortLogic=i||null)}},yt.prototype.getColumnSortingFields=function(){for(var t=[],e=this._hosts[0],i=e?e.getColumnCount():0,o=0;o<i;++o){var n=this._getSortOptions(o);if(n&&n.sortOrder){var r=this._sortStates.indexOf(n);r>=0&&(t[r]=this.getColumnSortingField(o))}}return t},yt.prototype.setFirstSortOrder=function(t,e){"a"!==(e=e?yt._toSortOrder(e):"a")&&"d"!==e&&(e="a");for(var i,o=(i=Array.isArray(t)?t:[t]).length,n=0;n<o;++n){var r=i[n],s=this.getSortingSequence(r).slice(),l=s.indexOf(e);l>=0&&s.splice(l,1),s.unshift(e),this.setSortingSequence(s,r)}},yt.prototype.disableTwoStateSorting=function(t){var e=this._sortingSequence.indexOf("n");!1===t?e>=0&&this._sortingSequence.splice(e,1):e<0&&this._sortingSequence.push("n")},yt.prototype.disableSortSymbols=function(t){},yt.prototype.disableDataSorting=function(t){this._dataSorting=!1===t},yt.prototype.disableDoubleClickToSort=function(t){this._isDisableDoubleClickToSort=!!t},yt.prototype.disableCellClick=function(t,e){t&&t.enableClass("no-sort",!1!==e)},yt.prototype.disableColumnSorting=function(t,e){if(e=!1!==e,"number"==typeof t)this._disableColumnSorting(t,e);else if(Array.isArray(t))for(var i=t.length,o=0;o<i;++o)this._disableColumnSorting(t[o]||0,e)},yt.prototype._disableColumnSorting=function(t,e){var i=this._newSortOptions(t);i.disabled!==e&&(i.disabled=e)},yt.prototype.setClickDelayInterval=function(t){this._delayInterval=null!=t?t:500},yt.prototype._prepareColumnOptions=function(t,e){var i=e||{},o={colIndex:t,field:i.field,sortable:!!this._sortableColumns};return null!=i.sortBy&&(o.sortable=!!i.sortBy,o.sortBy=i.sortBy),null!=i.sortable&&(o.sortable=!!i.sortable),o.sortLogic=i.sortLogic||i.sortingLogic||i.sorter,o.sort=i.defaultSort||i.sort,o},yt.prototype._initialSortByColumnField=function(t){for(var e=t.columns||[],i=null,o=0;o<e.length;o++){var n=this._prepareColumnOptions(o,e[o]),r=n.sort;r&&(i={colIndex:n.colIndex,sortOrder:r})}return i},yt.prototype._onSectionAdded=function(t){if("title"===t.sectionType){var e=t.section;0===e.getIndex()&&(e.listen("mousedown",this._onMouseDown),e.listen("click",this._onClickTitle.bind(this,t.sender),0))}},yt.prototype._onUIUpdated=function(t){"title"===t.sectionType&&this.updateSortSymbols()},yt.prototype._canClickToSort=function(t){if(this._disabled)return!1;var e=t.grid;if(!e||!e.getElement())return!1;var i=this._getPlugin("CellEditingPlugin");if(i&&i.isEditing())return!1;if(this._dispatch("preClicked",t),t.cancel)return!1;var o=t.colIndex,n=t.section,r=t.rowIndex;return!!this._isCellSortable(n,o,r)},yt.prototype._proceedSorting=function(t){if(this._clickTimer=0,this._canClickToSort(t)){var e=t.colIndex,i=this._preSortColumn(e);if(i&&this._sortColumn([i],{isUserAction:!0}),this._hasListener("clicked")){var o={};o.colIndex=e,o.sortOrder=this.getSortOrder(e),o.dataColumnName=this.getColumnSortingField(e),this._dispatch("clicked",o)}}},yt.prototype._onMouseDown=function(t){t.button||(this._lastMouseDown=t.timeStamp)},yt.prototype._onClickTitle=function(t,e){if(!this._disabled)if(2===e.detail&&this._isDisableDoubleClickToSort)this._clickTimer&&(clearTimeout(this._clickTimer),this._clickTimer=0);else if(!(e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)&&e.timeStamp-this._lastMouseDown<500){var i=t.getRelativePosition(e);if(i.hit){var o=this._getPlugin("ColumnSelectionPlugin");if(o&&o.isEnabled()){var n=i.colIndex;if(!o.isSelectedColumn(n))return}i.target=e.target,this._delayInterval>0?this._clickTimer||(this._clickTimer=setTimeout(this._proceedSorting.bind(this,i),this._delayInterval)):this._proceedSorting(i)}}},yt.prototype._popSortState=function(t,e){if(t<0||this._sortStates.length<=t)return!1;for(var i=!1,o=this._sortStates.length;--o>=t;)this._clearSortSymbols(this._sortStates[o]),i=!0;return this._sortStates.length=t,this._sortDataView(e),i},yt._toSortOrder=function(t){return!t||"string"!=typeof t||"d"!==(t=t.charAt(0).toLowerCase())&&"a"!==t?"n":t},yt.prototype.getSortingSequence=function(t){return this._sortingSequenceMap&&(t||0===t)&&("string"!=typeof t&&(t=this.getColumnSortingField(t)),this._sortingSequenceMap[t])?this._sortingSequenceMap[t]:this._sortingSequence},yt.prototype.setSortingSequence=function(t,e){if(Array.isArray(t))t.length||(t=null);else if(t)return;var i;if(null!=e&&("string"==typeof e?i=e:"number"==typeof e&&(i=this.getColumnSortingField(e))),t){var o=t.map(yt._toSortOrder);i?(this._sortingSequenceMap||(this._sortingSequenceMap={}),this._sortingSequenceMap[i]=o):this._sortingSequence=o}else i?this._sortingSequenceMap&&delete this._sortingSequenceMap[i]:this._sortingSequence=this._sortingSequence.length>2?["a","d","n"]:["a","d"]},yt.prototype.clearAllColumnSortingSequences=function(){this._sortingSequenceMap=null},yt.prototype._preSortColumn=function(t,e){if(!this._maxCount)return null;var i=this.getSortPriority(t),o=i>=0?this._sortStates[i]:null,n=o?o.sortOrder:"n",r="n",s=this.getColumnSortingField(t);if(null==e){var l=this.getSortingSequence(s),a=l.indexOf(n);r=l[a=a<0?0:(a+1)%l.length]}else r=yt._toSortOrder(e);if(o){if(n===r)return this.updateSortSymbols(),null;this._sortStates.splice(i,1),this._clearSortSymbols(o)}"a"!==r&&"d"!==r||(o||(o=this._newSortOptions(t)),this._sortStates.push(o)),o&&("n"!==n?o.prevOrder=n:delete o.prevOrder,o.order=r,o.sortOrder=r);var h=[];if(this._maxCount>0)for(;this._sortStates.length>this._maxCount;){var u=this._clearSortSymbols(this._sortStates.shift());null!==u&&h.push(u)}return{colIndex:t,sortedField:s,sortOrder:r||"n",prevOrder:n,clearedSortColIndexes:h}},yt.prototype._sortColumn=function(t,e){this._sortDataView(e),this.updateSortSymbols();var i=t[0]||{},o=t.length;if(o>1){i.colIndices=new Array(o),i.sortedFields=new Array(o),i.sortOrders=new Array(o),i.prevOrders=new Array(o);for(var n=0;n<o;n++){var r=t[n];i.colIndices[n]=r.colIndex,i.sortedFields[n]=r.sortedField,i.sortOrders[n]=r.sortOrder,i.prevOrders[n]=r.prevOrder}}this._dispatch("columnSorted",i)},yt.prototype._onColumnAdded=function(t){var e=this,i=t.colIndex,o=t.context,n=e._prepareColumnOptions(i,o),r=n.sortBy||n.field,s=n.sortLogic||e._sortLogic[r],l=o?o.sortingSequence:null;null!=l&&r&&e.setSortingSequence(l,r),n.sortable?e.setColumnSortingField(i,r,"function"==typeof s?s:null):e.disableColumnSorting(i,!0)},yt.prototype._onColumnRemoved=function(t){if(t.atTheMiddle&&this._sortStates.length){var e=t.columnData,i=e?e.sortableTitle:null;if(i&&i.sortOrder){var o=this._sortStates.indexOf(i);o>=0&&this._sortStates.splice(o,1),this._clearSortSymbols(i),this._sortDataView()}}},yt._toRowDefField=function(t){return"ROW_DEF"},yt.prototype._sortDataView=function(t){if(t=t||{},this._dispatch("preDataSorting",t),this._dataSorting){var e=this._sortStates.length,i=null,o=null,n=null;if(e){i=new Array(e),o=new Array(e);for(var r=0;r<e;++r)i[r]=this._sortStates[r].sortOrder,o[r]=this._sortStates[r].sortLogic;n=this._rowDefMode?this._sortStates.map(yt._toRowDefField):this.getColumnSortingFields()}for(var s=this._hosts.length;--s>=0;){var l=this._hosts[s].getDataSource();if(l){var a=1==t.isUserAction;l.sort(n,i,o,a)}}}},yt.prototype._clearSortSymbols=function(t){var e=t.targetCells;if(!e)return null;for(var i=null,o=e.length;--o>=0;){var n,r=e[o];r.removeClass("sorting"),r.removeClass("sortable"),r.removeFloatingIcon("sort-symbol"),r.removeFloatingIcon("priority-symbol"),null==i&&(n=r.getSection())&&(i=n.getColumnIndex(r.getParent()))}return e.length=0,i},yt.prototype._updateSortableIndicator=function(t){var e=this,i=e._hosts[t];if(i){var o=i.getSection("title");if(null!=o)for(var n=o.getColumnCount();--n>=0;)for(var r=o.getRowCount(),s=0;s<r;s++){var l=o.getCell(n,s,!0);if(l&&(l.removeClass("sorting"),l.removeClass("sortable"),l.removeClass("asc"),l.removeClass("desc"),l.removeClass("edge-indicator"),l.removeFloatingIcon("sort-symbol"),l.removeFloatingIcon("priority-symbol"),l.removeFloatingIcon("sortable-indicator"),s===r-1&&e._isCellSortable(o,n,s))){l.addClass("sortable");var a,h,u,p=e._getColumnSortingStatePriority(n),_=e._sortStates[p];_&&"n"!==_.sortOrder?(_.targetCells||(_.targetCells=[]),_.targetCells[t]=l,"a"===_.sortOrder?l.addClass("asc"):l.addClass("desc"),l.addClass("sorting"),e._solarTheme?("a"===_.sortOrder?(u="▲",h=yt._icons.ascending):(u="▼",h=yt._icons.descending),(a=e._createIconElem(h,u)).className="sort-symbol",l.insertFloatingIcon(a,0),e._sortStates.length>1&&((a=document.createElement("span")).className="priority-symbol",a.textContent=p+1,l.insertFloatingIcon(a,1))):l.addClass("edge-indicator")):e._sortableIndicator&&(h=yt._icons.sortable,(a=e._createIconElem(h,"◊")).className="sortable-indicator",l.insertFloatingIcon(a,0))}}}},yt.prototype._createIconElem=function(t,e){var i;return t&&"string"==typeof t?(i=document.createElement("ef-icon")).setAttribute("icon",t):(i=document.createElement("span")).textContent=e,i},yt.prototype._getColumnSortingStatePriority=function(t){for(var e=this._sortStates.length;--e>=0;)if(this.getSortedColumnIndex(e)===t)return e;return-1},yt.prototype._getSortOptions=function(t){var e=this._hosts[0];if(e){var i=e.getColumnData(t);if(i)return i.sortableTitle}return null},yt.prototype._newSortOptions=function(t){var e=this._hosts[0],i=null;if(e&&t>=0){var o=e.getColumnData(t);o||(o=e.setColumnData(t,{})),(i=o.sortableTitle)||(i=o.sortableTitle={})}return i||{}},yt.prototype._isCellSortable=function(t,e,i){var o=this._getSortOptions(e);if(o){if(o.disabled)return!1;var n=o.field;if(null!=n&&!n)return!1}var r=t.getCell(e,i,!0);return!r.hasClass("no-sort")&&r===t.getCell(e,t.getRowCount()-1,!0)},yt._proto=yt.prototype;const mt=yt;var vt=window.tr;vt||(vt=window.tr={});var Ct=vt.grid;Ct||(Ct=vt.grid={}),Object.assign(vt,i),vt.EventDispatcher=s,vt.ElementWrapper=p,vt.ElementFrameWork=a,vt.ILayoutGrid=v,vt.LayoutGrid=P,vt.Grid=_t,vt.ColumnStats=X,vt.DataCache=H,vt.DataTable=B,vt.DataView=K,Ct.CellFloatingPanel=c,Ct.Cell=g,Ct.CellSpan=A,Ct.CellSpans=V,Ct.Column=S,Ct.Scrollbar=nt,Ct.HScrollbar=st,Ct.VScrollbar=at,Ct.VirtualizedLayoutGrid=ut,Ct.Conflator=j,Ct.Reverter=it,Ct.TrackLayout=y,Ct.Virtualizer=tt,Ct.SelectionList=T,Ct.SectionSettings=$,Ct.Plugin=dt,Ct.DragAndDropTitlePlugin=ft,Ct.SortableTitlePlugin=mt})();
|
1
|
+
(()=>{"use strict";var t,e={};e.isIE=e.isIE||(t=window.navigator.userAgent).indexOf("MSIE ")>0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0,e.isTouchDevice=e.isTouchDevice||!!(navigator.maxTouchPoints&&navigator.maxTouchPoints<256||navigator.msMaxTouchPoints&&navigator.msMaxTouchPoints<256),e.getElement=function(t){return e.isElement(t)?t:t&&e.isFunction(t.getElement)?t.getElement():null},e.isElement=function(t){return!!t&&1===t.nodeType},e.isEmpty=function(t,i){return null==t||void 0===t||!i&&""===t||e.isArray(t)&&0===t.length},e.isNumber=function(t){return"number"==typeof t&&isFinite(t)},e.isString=function(t){return"string"==typeof t},e.isArray=Array.isArray,e.isFunction=function(t){return"function"==typeof t},e.getClientPosition=function(t,e){var i=e||{};if(t.getBoundingClientRect){var o=t.getBoundingClientRect();i.x=o.left,i.y=o.top}else i.x=t.clientX,i.y=t.clientY;return i},e.getRelativePosition=function(t,i,o){o=e.getClientPosition(t,o);var n=e.getClientPosition(i);return o.x-=n.x,o.y-=n.y,o},e.moveArrayItem=function(t,e,i){if(!t)return null;var o=t.length;if(e>=o&&i>=o)return t;var n=t.splice(e,1)[0];return i<o?t.splice(i,0,n):t[i]=n,t},e.insertArrayItem=function(t,e,i){t&&(e<0||(e<t.length?t.splice(e,0,i):t[e]=i))},e.removeArrayItem=function(t,e){return t&&e>=0&&e<t.length?t.splice(e,1)[0]:null},e.pushArrayItems=function(t,e){var i=e?e.length:0;if(i>0)if(i<1e5)i>1?Array.prototype.push.apply(t,e):t.push(e[0]);else for(var o=0,n=0;o<i;)n+=1e5,Array.prototype.push.apply(t,e.slice(o,n)),o=n;return t},e.insertEmptyItems=function(t,i,o){if(o>0)if(o>1){var n=t.slice(i);t.length=i,t.length+=o,e.pushArrayItems(t,n)}else t.splice(i,0,null)},e.cycleArray=function(t,e){if(e>0&&t&&e<t.length){var i=t.splice(0,e);return t.concat(i)}return t||null},e.moveIndex=function(t,i,o){return e.isNumber(t)?t===i?e.isNumber(o)?o:-1:(null!==i&&t>i&&--t,null!==o&&t>=o&&++t,t):-1},e.lowerBound=function(t,i,o,n,r){(null==o||o<0)&&(o=0),(null==n||n<0||n>t.length)&&(n=t.length),o>n&&(o=n),null==r&&(r=e._defaultLessComparator);for(var s=0;n>o;)r(t[s=o+n>>1],i)?o=s+1:n=s;return o},e.upperBound=function(t,i,o,n,r){for(var s=e.lowerBound(t,i,o,n,r);t[s]===i;)++s;return s},e.stringFormat=function(t){var e=Array.prototype.slice.call(arguments,1);return t.replace(/{(\d+)}/g,(function(t,i){return null!=e[i]?e[i]:t}))},e._defaultLessComparator=function(t,e){return t<e},e._numericSorter=function(t,e){return t-e},e._preventDefault=function(t){t.preventDefault(),t.stopPropagation()},e._deprecatedFunction=function(){console.warn("Calling deprecated method")},e.calculatePercent=function(t,e,i){if(!t&&0!==t||!e&&0!==e||!i&&0!==i)return NaN;if(i===t)return 50;var o=(e-t)/(i-t);return o<0?0:o>1?100:100*o},e.closestElement=function(t,e){for(var i=t;i&&i.classList;){if(i.classList.contains(e))return i;i=i.parentNode}return null},e.isMobile=e.isMobile||/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);const i=e;var o=function(t){this.dispatch=this.dispatch.bind(this),this._listeners=[],this.setSender(t)};o.prototype.listen=function(t,e){if(t&&i.isFunction(t)&&this._listeners.indexOf(t)<0)if(null==e)this._listeners.push(t);else{t._priority=e;var n=i.lowerBound(this._listeners,t,0,this._listeners.length,o.listenerComparer);this._listeners.splice(n,0,t)}},o.prototype.unlisten=function(t){if(t){var e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}},o.prototype.unlistenAll=function(){this._listeners.length=0},o.prototype.getListenerCount=function(){return this._listeners.length},o.prototype.hasListener=function(){return this._listeners.length>0},o.prototype.dispatch=function(t){if(this._enabled&&!(this._listeners.length<=0)){this._dispatching&&window.console.log("WARNING: There is an error in one of your binding methods."),this._dispatching=!0,null==t&&(t={}),null!==this._sender&&(t.sender=this._sender),null!==this._extender&&this._extender(t);for(var e=0;e<this._listeners.length;e++)this._listeners[e](t);this._dispatching=!1}},o.prototype.isDispatching=function(){return this._dispatching},o.prototype.isEnabled=function(){return this._enabled},o.prototype.enable=function(t){this._enabled=!1!==t},o.prototype.disable=function(t){this._enabled=!1===t},o.prototype.setSender=function(t){this._sender=t||null},o.prototype.setEventArgExtender=function(t){this._extender=null!=t?t:null},o.listenerComparer=function(t,e){return null==e._priority||t._priority>=e._priority},o.prototype._listeners=null,o.prototype._sender=null,o.prototype._extender=null,o.prototype._enabled=!0,o.prototype._dispatching=!1,o._proto=o.prototype;const n=o;var r=function(){};r.prototype._customEvents=null,r.prototype.listen=function(t,e,i){this._customEvents&&this._customEvents[t]&&this._customEvents[t].listen(e,i)},r.prototype.unlisten=function(t,e){this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlisten(e)},r.prototype.unlistenAll=function(t){if(t)this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(var e in this._customEvents)this._customEvents[e].unlistenAll()},r.prototype._addEvent=function(t){t&&(this._customEvents||(this._customEvents={}),this._customEvents[t]||(this._customEvents[t]=new n(this)))},r.prototype._addEvents=function(t){for(var e=Array.isArray(t)?t:arguments,i=e.length,o=0;o<i;++o)this._addEvent(e[o])},r.prototype._isEventDispatching=function(t){var e=this._customEvents[t];return!!e&&e.isDispatching()},r.prototype._disableEvent=function(t,e){var i=this._customEvents[t];i&&i.disable(e)},r.prototype._hasListener=function(t){return!(!this._customEvents||!this._customEvents[t])&&this._customEvents[t].hasListener()},r.prototype._dispatch=function(t,e){this._customEvents[t].dispatch(e)},r._proto=r.prototype;const s=r;var l={_isElfv3:!1,setElfv3:function(){l._isElfv3=!0},isElfv3:function(){return l._isElfv3},createIcon:function(t){var e;return l._isElfv3?(e=document.createElement("ef-icon")).setAttribute("icon",t):(e=document.createElement("span")).classList.add("icon-"+t),e},createIconButton:function(t){var e;return l._isElfv3?(e=document.createElement("ef-button")).setAttribute("icon",t):(e=document.createElement("button")).classList.add("icon-"+t),e},createRangeBar:function(){var t,e=document.createElement("div");return l._isElfv3?(e.className="tr-range-bar-wrapper",(t=document.createElement("sapphire-led-gauge")).setAttribute("neutral-color",""),t.setAttribute("top-value","0.00")):(e.className="tr-range-bar-scale",(t=document.createElement("div")).className="tr-range-bar-slider"),t.classList.add("tr-range-slider"),e.appendChild(t),e._calculateScaleParams=function(t,e,o){var n,r=null;return t===o?{sliderValue:n=e===o?0:e>o?100:-100,rangeValue:"[-100,100]"}:t===e?{sliderValue:-100,rangeValue:r}:e===o?{sliderValue:100,rangeValue:r}:t>o?(e>t?(n=-100,r="[-100,"+(2*i.calculatePercent(o,e-t,t)-100)+"]"):e<o?(n=100,r="["+(2*i.calculatePercent(o,t-e,t)-100)+",100]"):n=2*i.calculatePercent(o,e,t)-100,{sliderValue:n,rangeValue:r}):e>o?{sliderValue:100,rangeValue:"["+(2*i.calculatePercent(t,2*o-e,o)-100)+",100]"}:e<t?{sliderValue:-100,rangeValue:"[-100,"+(2*i.calculatePercent(t,2*t-e,o)-100)+"]"}:{sliderValue:2*i.calculatePercent(t,e,o)-100,rangeValue:r}},e._getSliderInstance=function(){return t},e.updateScale=function(t,i,o,n){var r,s=e._getSliderInstance();l._isElfv3?(r=e._calculateScaleParams(i,o,n),s.setAttribute("top-value",r.sliderValue.toString()),r.rangeValue?s.setAttribute("range",r.rangeValue):s.removeAttribute("range")):s.style.left=t+"%"},e.setSliderWidth=function(t){var i=t>0?t:1;l._isElfv3||(e.style.width="calc(100% - "+i+"px)",e._getSliderInstance().style.width=i+"px")},e}};const a=l;const h={inherits:function(t,e){function i(){}i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t,t.base=function(t,i,o){i||(i="constructor");for(var n=arguments.length,r=new Array(n),s=2;s<n;s++)r[s-2]=arguments[s];return e.prototype[i].apply(t,r)}}};var u=function(t){this._element=t||document.createElement("div")};h.inherits(u,s),u.prototype._element=null,u.prototype._content=null,u.prototype._textSpan=null,u.prototype._nativeEvents=null,u._passiveEvents=null,u.prototype.getContent=function(t){return t?this._element.children:this._element.lastChild},u.prototype.setContent=function(t,e){if(null==t||t!=t?t=null:1!==t.nodeType&&11!==t.nodeType&&(null==t.getElement?(i.isString(t)||(t+=""),null==this._textSpan&&(this._textSpan=document.createElement("span")),this._textSpan.textContent=t,t=this._textSpan):t=t.getElement()),t!==this._content){for(this._content=t;null!==this._element.firstChild;)this._element.removeChild(this._element.firstChild);null!==this._content&&this._element.appendChild(this._content)}return e&&t&&t.setAttribute("title",e),this._content},u.prototype.addContent=function(t){return null==(t=i.getElement(t))?null:(this._content=this._element.children,this._element.appendChild(t),t)},u.prototype.removeContent=function(t){return null!=(t=i.getElement(t))&&(this._content=this._element.children,this._element.removeChild(t),!0)},u.prototype.listen=function(t,e,i){if(this._customEvents&&this._customEvents[t])this._customEvents[t].listen(e,i);else{this._nativeEvents||(this._nativeEvents={});var o=this._nativeEvents[t];if(!o){if(o=new n,this._nativeEvents[t]=o,o.dispatch=o.dispatch.bind(o),!u._passiveEvents){var r=!1;try{var s=Object.defineProperty({},"passive",{get:function(){return r=!0,!1}});window.addEventListener("testPassive",null,s),window.removeEventListener("testPassive",null,s)}catch(t){}if(r){var l={passive:!0};u._passiveEvents={touchstart:l,touchmove:l}}else u._passiveEvents={}}this._element.addEventListener(t,o.dispatch,u._passiveEvents[t]||!1)}o.listen(e,i)}},u.prototype.unlisten=function(t,e){if(this._customEvents&&this._customEvents[t])this._customEvents[t].unlisten(e);else if(this._nativeEvents){var i=this._nativeEvents[t];i&&i.unlisten(e)}},u.prototype.unlistenAll=function(t){if(this._customEvents)if(t)this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(var e in this._customEvents)this._customEvents[e].unlistenAll();if(this._nativeEvents)if(t)this._nativeEvents[t]&&(this._unlistenAll(t),delete this._nativeEvents[t]);else{for(var i in this._nativeEvents)this._unlistenAll(i);this._nativeEvents=null}},u.prototype._unlistenAll=function(t){var e=this._nativeEvents[t];this._element.removeEventListener(t,e.dispatch,!1),e.unlistenAll()},u.prototype.dispose=function(){this._dispose()},u.prototype._dispose=function(){this.setParent(null),this.unlistenAll(),this._element=this._content=this._textSpan=null,this._customEvents=this._nativeEvents=null},u.prototype.setEventArgExtender=function(t,e){if(this._customEvents){var i=this._customEvents[t];i&&i.setEventArgExtender(e)}},u.prototype.getElement=function(){return this._element},u.prototype.getNextSibling=function(){return this._element.nextSibling},u.prototype.getParent=function(){return this._element.parentNode},u.prototype.setParent=function(t,e){this._setParent(t,e)},u.prototype._setParent=function(t,e){null!==(t=i.getElement(t))?e?t.insertBefore(this._element,t.firstChild):t.appendChild(this._element):null!==this._element.parentNode&&this._element.parentNode.removeChild(this._element)},u.prototype.insertBefore=function(t){this._insertBefore(t)},u.prototype._insertBefore=function(t){if(null!=(t=i.getElement(t))){var e=t.parentNode;null!=e&&e.insertBefore(this._element,t)}else this.setParent(this.getParent())},u.prototype.insertAfter=function(t){(t=i.getElement(t))?t.nextSibling?this.insertBefore(t.nextSibling):this.setParent(t.parentNode):this.setParent(this.getParent(),!0)},u.prototype.hasClass=function(t){return!!this._element&&this._element.classList.contains(t)},u.prototype.addClass=function(t){this._element&&this._element.classList.add(t)},u.prototype.removeClass=function(t){this._element&&this._element.classList.remove(t)},u.prototype.toggleClass=function(t,e){var i=this._element;i&&(null==e&&(e=!i.classList.contains(t)),e?i.classList.add(t):i.classList.remove(t))},u.prototype.enableClass=function(t,e){!1!==e?this.addClass(t):this.removeClass(t)},u.prototype.getClass=function(){return this._element.className},u.prototype.setClass=function(t){this._element.className=t},u.prototype.getAttribute=function(t){return this._element.getAttribute(t)},u.prototype.setAttribute=function(t,e){this._element.setAttribute(t,e)},u.prototype.setAttributes=function(t){for(var e in t)this._element.setAttribute(e,t[e])},u.prototype.removeAttribute=function(t){this._element.removeAttribute(t)},u.prototype.getStyle=function(t){return this._element.style[t]},u.prototype.setStyle=function(t,e){this._element.style[t]=e},u.prototype.setStyles=function(t){var e=this._element.style;for(var i in t)e[i]=t[i]},u.prototype.getId=function(){return this._element.id},u.prototype.setId=function(t){this._element.id=t},u.prototype.toString=function(){var t=this._element.outerHTML;return t.replace(this._element.innerHTML,"")},u.prototype.getTextContent=function(){return this._element.textContent},u.prototype.setTextContent=function(t){this._element.textContent=t},u.prototype.getLeft=function(){return this._element.offsetLeft},u.prototype.setLeft=function(t){return this._element.style.left=t+"px",!0},u.prototype.getTop=function(){return this._element.offsetTop},u.prototype.setTop=function(t){return this._element.style.top=t+"px",!0},u.prototype.getWidth=function(){return this._element.offsetWidth},u.prototype.setWidth=function(t){return this._element.style.width=t+"px",!0},u.prototype.getHeight=function(){return this._element.offsetHeight},u.prototype.setHeight=function(t){return t<0&&(t=0),this._element.style.height=t+"px",!0},u.prototype.getBoundingClientRect=function(){return this._element.getBoundingClientRect()},u.prototype.fillParentWidth=function(t){return null==t&&(t=100),this._element.style.width=t+"%",!0},u.prototype.fillParentHeight=function(t){return null==t&&(t=100),this._element.style.height=t+"%",!0},u.prototype.getTooltip=function(){return this.getAttribute("title")},u.prototype.setTooltip=function(t){t?this.setAttribute("title",t):this.removeAttribute("title")},u.prototype.show=function(t){this._element.style.display=!1!==t?"":"none"},u.prototype.hide=function(t){this.show(!1===t)},u.prototype.isVisible=function(){return"none"!==this._element.style.display},u.prototype.enable=function(t){(t=!1!==t)?this.removeAttribute("disabled"):(this.setAttribute("disabled","disabled"),this._element.disabled=!t)},u.prototype.disable=function(t){this.enable(!1===t)},u.prototype.isEnabled=function(){return!this._element.hasAttribute("disabled")},u.prototype.getScrollLeft=function(){return this._element.scrollLeft},u.prototype.getScrollTop=function(){return this._element.scrollTop},u.prototype.isEndOfHorizontalScroll=function(){return this._element.scrollLeft>=this._element.scrollWidth-this.getWidth()},u.prototype.isEndOfVerticalScroll=function(){return this._element.scrollTop>=this._element.scrollHeight-this.getHeight()},u._proto=u.prototype;const p=u;var _=function(){this._items=[],this._element=null};h.inherits(_,p),_.prototype._items=[],_.prototype.hasItem=function(){return!!this._items.length},_.prototype.insertItem=function(t,e){var i=this._items;i.indexOf(t)>-1||(i.push(t),e&&(t._order=e),i.length&&i.sort(_._iconComparer),this._updatePanelItems())},_.prototype.removeItem=function(t){var e=this._items,i=-1;if(t)for(var o=e.length;--o>=0;){var n=e[o];if("string"==typeof t){if(n.classList.contains(t)){i=o;break}}else if(n===t){i=o;break}}else i=e.length-1;var r=null;return i>-1&&(r=e.splice(i,1)[0]),this._updatePanelItems(),r},_.prototype.clearItems=function(){var t=this._items;t.length&&(t.length=0,this._updatePanelItems())},_._iconComparer=function(t,e){return t._order?e._order?t._order-e._order:1:e._order?-1:0},_.prototype._updatePanelItems=function(){var t=this._items,e=this._element;if(t.length){for(this._element||(e=this._element=document.createElement("div"));e.lastChild;)e.removeChild(e.lastChild);for(var i=0;i<t.length;i++)e.appendChild(t[i])}};const d=_;var c=function(t,e){this._onFocus=this._onFocus.bind(this),this._id=c._runningId++,this._element=document.createElement("div"),this._element.className="cell",e&&(this._section=e)};h.inherits(c,p),c.prototype._aligner=null,c._runningId=0,c.prototype._id=0,c.prototype._width=-1,c.prototype._height=-1,c.prototype._visible=!0,c.prototype._rawContent,c.prototype._section=null,c.prototype._contentLocked=!1,c.prototype._collapsedState=0,c.prototype._floatingPanel=null,c.prototype._frontIcon=null,c.prototype.getContent=function(t){return t&&this._element?this._element.children:this._content||null},c.prototype.setContent=function(t,e){if(this._contentLocked)return null;if(null==t||t!=t?t=null:1!==t.nodeType&&11!==t.nodeType&&(null==t.getElement?"string"!=typeof t&&(t+=""):t=t.getElement()),this._aligner){var i=this._aligner.firstChild;i!==this._content&&(this._rawContent=i,this._content=i)}var o=this._setRawContent(t);return null!=e&&this._content&&this._content.setAttribute("title",e),o},c.prototype.setTextContent=function(t){null==t&&(t=""),this._rawContent!==t&&("string"==typeof this._rawContent?(this._rawContent=t,this._textSpan.textContent=t):null!=this._rawContent||this._textSpan?this.setContent(t):(this.initialize(),this._rawContent=t,this._textSpan=document.createElement("span"),this._textSpan.className="text",this._textSpan.textContent=t,this._content=this._textSpan,this._aligner.className="valigner",this._aligner.appendChild(this._textSpan)))},c.prototype.dispose=function(){this.removeParent(),this.unlistenAll(),this._element=this._section=this._aligner=null,this._textSpan=this._rawContent=this._content=null,this._frontIcon=this._floatingPanel=null},c.prototype.getNextSibling=function(){return null!==this._element?this._element.nextSibling:null},c.prototype.getParent=function(){return null!==this._element?this._element.parentNode:null},c.prototype.setParent=function(t,e){var o=i.getElement(t);if(o){if(this.initialize(),1===this._collapsedState)return;var n;!0===e&&(n=o.firstChild),n?o.insertBefore(this._element,n):o.appendChild(this._element)}else this.removeParent()},c.prototype.removeParent=function(){var t=this._element;t&&t.parentNode&&t.parentNode.removeChild(t)},c.prototype.insertBefore=function(t){var e=i.getElement(t);if(null!=e){var o=e.parentNode;null!=o&&(this.initialize(),o.insertBefore(this._element,e))}else this.setParent(this.getParent())},c.prototype.getTextContent=function(){return this._rawContent?"string"==typeof this._rawContent?this._rawContent:this._rawContent.textContent:""},c.prototype.getTextElement=function(){return this._textSpan},c.prototype.getWidth=function(){return this._width>=0?this._width:this._element.offsetWidth},c.prototype.setWidth=function(t){return t<0&&(t=-1),this._width!==t&&(this._width=t,this._element.style.width=t>=0?t+"px":"",this._updateDisplay(),!0)},c.prototype.getHeight=function(){return this._height>=0?this._height:this._element.offsetHeight},c.prototype.setHeight=function(t){return t<0&&(t=-1),this._height!==t&&(this._height=t,this._element.style.height=t>=0?t+"px":"",this._updateDisplay(),!0)},c.prototype.fillParentWidth=function(t){return!1},c.prototype.fillParentHeight=function(t){return!1},c.prototype.show=function(t){var e=!1!==t;e!==this._visible&&(this._visible=e,this._updateDisplay())},c.prototype.isVisible=function(){return this._visible},c.prototype.getScrollLeft=function(){return 0},c.prototype.getScrollTop=function(){return 0},c.prototype.isEndOfHorizontalScroll=function(){return!0},c.prototype.isEndOfVerticalScroll=function(){return!0},c.prototype.hasElement=function(){return null!==this._element},c.prototype.getSection=function(){return this._section},c.prototype.initialize=function(){return null==this._aligner&&(i.isIE?this._aligner=document.createElement("div"):(this._aligner=document.createElement("button"),this._aligner.addEventListener("focus",this._onFocus)),this._aligner.className="valigner",this._frontIcon&&this._element.appendChild(this._frontIcon.getElement()),this._element.appendChild(this._aligner),this._floatingPanel&&this._element.appendChild(this._floatingPanel.getElement())),this._element},c.prototype.updateIcon=function(t){if(t){var e=this._frontIcon;e&&e.clearItems(),this.insertFrontIcon(t,0)}},c.prototype.removeIcon=function(){var t=this._frontIcon;t&&(t.clearItems(),this._element.removeChild(t.getElement()),t=this._frontIcon=null)},c.prototype.isFrozen=i._deprecatedFunction,c.prototype.freezeLayout=i._deprecatedFunction,c.prototype.setAutoContentClipping=i._deprecatedFunction,c.prototype.setContentTooltip=function(t){return!(null==t||!this._content||(this._content.setAttribute("title",t),0))},c.prototype.lockContent=function(t){this._contentLocked=!1!==t},c.prototype.reset=function(){if(this._element){var t=this._element.style.width,e=this._element.style.height;this.removeAttribute("style"),t&&(this._element.style.width=t),e&&(this._element.style.height=e),this.resetClass();var i=this.blinkState;i&&(i.timerId>=0&&clearInterval(i.timerId),delete this.blinkState),delete this.trendState;var o=this.blinking;o&&(o.blinking>=0&&clearTimeout(o.blinking),o.cell=null,o.styles=null,delete this.blinking),this.removeIcon(),this.setContent(null),this._textSpan&&(this._textSpan.className="text",this._textSpan.textContent="")}},c.prototype.resetClass=function(){var t="cell";this.hasClass("spanned")&&(t+=" spanned"),this.hasClass("selected-row")&&(t+=" selected-row"),this.hasClass("highlighted-row")&&(t+=" highlighted-row"),this.setClass(t)},c.prototype.resetToInitialState=function(){this._element&&(this.setParent(null),this.unlistenAll(),this._element.className="cell",this.removeIcon(),this.setContent(null),this._contentLocked=!1,this._collapsedState=0)},c.prototype.insertFloatingIcon=function(t,e){if(t){var i=this._floatingPanel;i||(i=this._floatingPanel=new d),i.insertItem(t,e),i.addClass("floating-panel");var o=this._element;o.contains(i.getElement())||o.appendChild(i.getElement())}},c.prototype.removeFloatingIcon=function(t){var e=this._floatingPanel;if(!e)return null;var i=e.removeItem(t);return e.hasItem()||(this._element.removeChild(e.getElement()),this._floatingPanel=null),i},c.prototype.insertFrontIcon=function(t,e){if(t){var i=this._frontIcon;i||(i=this._frontIcon=new d),i.insertItem(t,e),i.addClass("front-panel");var o=this._element;o.contains(i.getElement())||o.insertBefore(i.getElement(),o.firstChild)}},c.prototype.removeFrontIcon=function(t){var e=this._frontIcon;if(!e)return null;var i=e.removeItem(t);return e.hasItem()||(i=e.getElement(),this._element.removeChild(i),this._frontIcon=null),i},c.prototype.getCellId=function(){return this._id},c.prototype.updatePadding=function(){},c.prototype.collapse=function(t,e){var i,o=!1!==t;return i=o?e?2:1:0,this._collapsedState!==i&&(o?e?this.addClass("spanned"):this.setParent(null):2===this._collapsedState&&this.removeClass("spanned"),this._collapsedState=i,!0)},c.prototype.isCollapsed=function(){return 0!==this._collapsedState},c.prototype.isKeptInDoc=function(){return 1!==this._collapsedState},c.prototype.getClientWidth=function(){return this._element?this._element.clientWidth:this.getWidth()},c.prototype.getClientHeight=function(){return this._element?this._element.clientHeight:this.getHeight()},c.prototype._setRawContent=function(t){if(this._rawContent!==t){this._rawContent=t;var e=this._rawContent;if("string"==typeof this._rawContent&&(this._textSpan||(this._textSpan=document.createElement("span"),this._textSpan.className="text"),this._textSpan.textContent=this._rawContent,e=this._textSpan),this._content!==e){this._content=e,this.initialize();for(var i=this._aligner;i.lastChild;)i.removeChild(i.lastChild);this._content&&i.appendChild(this._content)}}return this._content},c.prototype._updateDisplay=function(){var t=!1;this.isVisible()&&this._width&&this._height&&(t=!0),this._element.style.display=t?"":"none"},c.prototype._onFocus=function(t){this._section&&this._section._getContext().getElement().focus({preventScroll:!0})},c._proto=c.prototype;const g=c;var f=function(){this._ends=[],this._cols=[]};f.prototype._laneCount=0,f.prototype._defaultSize=10,f.prototype._defaultScalability=!0,f.prototype._homogeneous=!0,f.prototype._visibility=!0,f.prototype._ends,f.prototype._cols,f.prototype._bits=[1,2,4,8],f.prototype.hitTest=function(t){if(t<0)return-1;if(t>=this.getTrackSize())return~this._laneCount;var e=-1,o=0;if(this._homogeneous){var n=this._defaultSize;o=((e=Math.floor(t/n))+1)*n}else e=i.upperBound(this._ends,t),o=this._ends[e];return(e>=this._laneCount||t>=o)&&(e=~e),e},f.prototype.isAtDefaultSize=function(t){if(this._homogeneous)return!0;if(null!=t){if(!this._isAtDefaultSize(t))return!1}else{for(var e=this._cols.length;--e>=0;)if(!this._isAtDefaultSize(e))return!1;this._homogeneous=!0}return!0},f.prototype._isAtDefaultSize=function(t){var e=this._cols[t];if(e){if(e.actualSize!==this._defaultSize)return!1;if(null!=e.customSize)return!1;if(e.invisibility)return!1}return!0},f.prototype.isHomogeneous=function(){return this._homogeneous},f.prototype.isAtMinimumSize=function(t){var e=this._getMinimumScalingSize(t);return(null!=t?this.getLaneSize(t):this.getTrackSize())<=e},f.prototype.isFixedSize=function(){for(var t=0;t<this._laneCount;++t)if(this.getLaneScalability(t))return!1;return!0},f.prototype.clearLaneCustomizations=function(){this._ends.length=0,this._cols.length=0,this._homogeneous=!0},f.prototype.getLaneCount=function(){return this._laneCount},f.prototype.setLaneCount=function(t){t<0&&(t=0),t!==this._laneCount&&(this._markDirtyIndex(t),this._cols.length=t,this._laneCount=t,0===t&&(this._homogeneous=!0))},f.prototype.getDefaultLaneSize=function(){return this._defaultSize},f.prototype.setDefaultLaneSize=function(t){return t<0&&(t=0),this._defaultSize!==t&&(this._defaultSize=t,this._markDirtyIndex(0),!0)},f.prototype.getLaneDefaultSize=function(t){if(t<0||t>=this._laneCount)return-1;var e=this._newColumn(t);return e.defaultSize?e.defaultSize:-1},f.prototype.setLaneDefaultSize=function(t,e){t<0||t>=this._laneCount||e>=0&&(this._newColumn(t).defaultSize=e)},f.prototype.resetLaneToDefaultSize=function(){for(var t=!1,e=0;e<this._laneCount;++e){var i=this._cols[e];i&&(i.invisibility||(null!=i.defaultSize?(t|=this.setLaneScalability(e,!1),t|=this.setLaneSize(e,i.defaultSize)):(t|=this.setLaneScalability(e,!0),t|=this.setLaneSize(e,1))))}return!!t},f.prototype.getDefaultScalability=function(){return this._defaultScalability},f.prototype.setDefaultScalability=function(t){return this._defaultScalability!==t&&(this._defaultScalability=t,!0)},f.prototype.getTrackSize=function(){return!this._visibility||this._laneCount<=0?0:this._homogeneous?this._laneCount*this._defaultSize:(this._updateEndPoints(),this._ends[this._laneCount-1])},f.prototype.setTrackSize=function(t){var e=0,i=0,o=[];for(e=0;e<this._laneCount;++e){var n=this._cols[e];n?n.invisibility||(!1!==this._getLaneScalability(n)?o.push(e):i+=this._getFixedSize(n)):o.push(e)}if(o.length<=0)return null;var r=this._distributeLaneSize(t-i,o),s=!1,l=[];for(e=r.length;--e>=0;){l[e]=0;var a=r[e];if(null!=a){var h=this.getLaneSize(e);this._newColumn(e),this._setCalculatedLaneSize(e,a)&&(l[e]=a-h,s=!0)}}return s?l:null},f.prototype.getLaneStart=function(t){if(t<=0)return 0;if(this._homogeneous)return t*this._defaultSize;this._updateEndPoints();var e=t-this._laneCount,i=0;return e>0&&(t-=e,i=e*this._defaultSize),this._ends[t-1]+i},f.prototype.getLaneEnd=function(t){return this._laneCount<=0?NaN:(t<0?t=0:t>=this._laneCount&&(t=this._laneCount-1),this._homogeneous?(t+1)*this._defaultSize:(this._updateEndPoints(),this._ends[t]))},f.prototype.getLaneSize=function(t){if(this._visibility){var e=this._cols[t];return e?e.actualSize:this._defaultSize}return 0},f.prototype.getCustomLaneSize=function(t){var e=this._cols[t];return e&&null!=e.customSize?e.customSize:this._defaultSize},f.prototype.setLaneSize=function(t,e){if(t<0||t>=this._laneCount)return!1;if(e<0||e!=e)return!1;var i=this._cols[t];return(null==i||i.customSize!==e)&&((i=this._newColumn(t)).customSize=e,this._setCalculatedLaneSize(t,e))},f.prototype.getMinimumLaneSize=function(t){var e=this._cols[t];return e&&null!=e.minSize?e.minSize:0},f.prototype.setMinimumLaneSize=function(t,e,i){if(t<0||t>=this._laneCount)return!1;if(e<0&&(e=0),this.getMinimumLaneSize(t)!==e){var o=this._newColumn(t);return o.minSize=e,i&&this.getLaneScalability(t)&&(o.customSize=e),this._setCalculatedLaneSize(t)}return!1},f.prototype.isLaneVisible=function(t){var e=this._cols[t];return!e||!e.invisibility},f.prototype.showLane=function(t,e){return this.hideLane(t,!1===e)},f.prototype.hideLane=function(t,e,i){if(t<0||t>=this._laneCount)return!1;var o=this._newColumn(t),n=!o.invisibility,r=null!=i?this._bits[i]:1;return!1!==e?o.invisibility|=r:o.invisibility&=~r,n!==!o.invisibility&&this._setCalculatedLaneSize(t)},f.prototype.show=function(t){if(t=!1!==t,this._visibility!==t)if(this._visibility=t,t)for(var e=0;e<this._laneCount;++e)this._newColumn(e),this._setCalculatedLaneSize(e);else this._markDirtyIndex(0)},f.prototype.getLaneScalability=function(t){var e=this._cols[t];return e&&null!=e.scalability?e.scalability:this._defaultScalability},f.prototype.setLaneScalability=function(t,e){if(t<0||t>=this._laneCount)return!1;var i=this._cols[t];return!(i&&i.scalability===e||((i=this._newColumn(t)).scalability=e,0))},f.prototype.removeLaneAt=function(t,e){if(null==e&&(e=1),t<0)return null;if(t+e>this._laneCount&&(e=this._laneCount-t),e<1)return null;this._markDirtyIndex(t);var i=this.serializeLane(t);return this._cols.splice(t,e),this._laneCount-=e,i},f.prototype.insertLane=function(t,e){t<0&&(t=0);var o=1;if(i.isNumber(e)){if(e<=0)return;o=e,e=null}if(t>=this._laneCount&&(t=this._laneCount,!e))this.setLaneCount(this._laneCount+o);else if(this._laneCount+=o,this._markDirtyIndex(t),i.insertEmptyItems(this._cols,t,o),e)for(var n=t+o,r=t;r<n;++r)this.deserializeLane(r,e)},f.prototype.moveLane=function(t,e){if(t<0?t=0:t>this._laneCount&&(t=this._laneCount),e<0?e=0:e>this._laneCount&&(e=this._laneCount),t!==e){var o=t<e?t:e;this._markDirtyIndex(o),i.moveArrayItem(this._cols,t,e)}},f.prototype.serializeLane=function(t){if(t<0||t>=this._laneCount)return null;var e={};e.index=t;var i=this._cols[t];return i?(e.size=i.customSize,e.minSize=i.minSize,e.visible=!i.invisibility,e.scalable=i.scalability,e):e},f.prototype.deserializeLane=function(t,e){if(e&&!(t<0||t>=this._laneCount)){var i=e.size;null!=i&&this.setLaneSize(t,i),null!=(i=e.minSize)&&this.setMinimumLaneSize(t,i),null!=(i=e.visible)&&this.showLane(t,i),null!=(i=e.scalable)&&this.setLaneScalability(t,i)}},f.prototype._updateEndPoints=function(){var t=this._ends.length;if(!(t>=this._laneCount)){this._ends.length=this._laneCount;var e=0,i=t>0?this._ends[t-1]:0;for(e=t;e<this._laneCount;++e)i+=this.getLaneSize(e),this._ends[e]=i}},f.prototype._setCalculatedLaneSize=function(t,e){var i=this._cols[t];if(this._visibility&&!i.invisibility){if(null==e&&(e=null!=i.customSize?i.customSize:this._defaultSize),!i.scalability){var o=null!=i.minSize?i.minSize:0;e<o&&(e=o)}}else e=0;return i.actualSize!==e&&(i.actualSize=e,this._homogeneous=!1,this._markDirtyIndex(t),!0)},f.prototype._getMinimumScalingSize=function(t){var e=0;if(null!=t){var i=this._cols[t];if(!i.invisibility&&null!=i.minSize)return!1===this._getLaneScalability(i)&&null!=i.customSize&&i.customSize>i.minSize?i.customSize:i.minSize}else for(var o=this._laneCount;--o>=0;)e+=this._getMinimumScalingSize(o);return e},f.prototype._getFixedSize=function(t){return null!=t.customSize?null!=t.minSize?t.customSize>t.minSize?t.customSize:t.minSize:t.customSize:null!=t.minSize?t.minSize:this._defaultSize},f.prototype._getLaneScalability=function(t){return null==t.scalability?this._defaultScalability:t.scalability},f.prototype._distributeLaneSize=function(t,e){if(e.length<=0)return[];t<0&&(t=0);var i=0,o=0,n=0,r=0,s=[],l=[],a=[];for(i=e.length;--i>=0;)s[n=e[i]]=this.getMinimumLaneSize(n),l[n]=this.getCustomLaneSize(n),o+=l[n];for(var h=!0;h;)for(h=!1,i=e.length;--i>=0;){var u=s[n=e[i]],p=l[n];(r=t*p/o)<=u&&(h=!0,a[n]=u,t-=u,o-=p,e.splice(i,1))}var _=e.length-1,d=0,c=0;for(i=_;--i>=0;){r=t*l[n=e[i]]/o;var g=Math.floor(r);(c+=r-g)>=1&&(++g,--c),a[n]=g,d+=g}return a[e[_]]=Math.floor(t-d),a},f.prototype._markDirtyIndex=function(t){t<this._ends.length&&(this._ends.length=t)},f.prototype._newColumn=function(t){var e=this._cols[t];return e||(this._cols[t]=e={},e.invisibility=0),e},f.prototype.copyFrom=function(t,e){if(!this._homogeneous||!t._homogeneous||this._defaultSize!==t._defaultSize){e||(e=0);var i=t.getLaneCount(),o=this.getLaneCount(),n=e+i;n>o&&(n=o);for(var r=0,s=e;s<n;++s){var l=t.getLaneSize(r++),a=this._newColumn(s);a.customSize!==l&&(a.customSize=l,a.actualSize!==l&&(a.actualSize=l,this._homogeneous=!1,this._markDirtyIndex(s)))}}};const y=f;var m=function(){};m.prototype.hitTest=function(t,e,i){},m.prototype.hitTestX=function(t){},m.prototype.hitTestY=function(t){},m.prototype.getDefaultColumnWidth=function(){},m.prototype.setDefaultColumnWidth=function(t){},m.prototype.getDefaultRowHeight=function(){},m.prototype.setDefaultRowHeight=function(t){},m.prototype.getColumnWidth=function(t){},m.prototype.setColumnWidth=function(t,e){},m.prototype.getRowHeight=function(t){},m.prototype.setRowHeight=function(t,e){},m.prototype.isColumnVisible=function(t){},m.prototype.hideColumn=function(t,e){},m.prototype.isRowVisible=function(t){},m.prototype.hideRow=function(t,e){},m.prototype.getMinimumColumnWidth=function(t){},m.prototype.setMinimumColumnWidth=function(t,e){},m.prototype.getMinimumRowHeight=function(t){},m.prototype.setMinimumRowHeight=function(t,e){},m.prototype.getCellLeft=function(t){},m.prototype.getCellTop=function(t){},m.prototype.getCellWidth=function(t,e){},m.prototype.getCellHeight=function(t,e){},m.prototype.hasCellSpan=function(){},m.prototype.getCellRowSpan=function(t,e){},m.prototype.setCellRowSpan=function(t,e,i){},m.prototype.getCellColSpan=function(t,e){},m.prototype.setCellColSpan=function(t,e,i){},m.prototype.clearCellSpans=function(){},m.prototype.clearColumnSpans=function(t){},m.prototype.clearColumnCustomizations=function(){},m.prototype.clearRowCustomizations=function(){},m.prototype.getColumnScalability=function(t){},m.prototype.setColumnScalability=function(t,e){},m.prototype.getRowScalability=function(t){},m.prototype.setRowScalability=function(t,e){},m.prototype.getCell=function(t,e,i){},m.prototype.getCellContent=function(t,e){},m.prototype.setCellContent=function(t,e,i){},m.prototype.getColumn=function(t){},m.prototype.getColumnCount=function(){},m.prototype.setColumnCount=function(t){},m.prototype.getRowCount=function(){},m.prototype.setRowCount=function(t,e){},m.prototype.getVisibleRowCount=function(){},m.prototype.addRow=function(t){},m.prototype.removeRow=function(t){},m.prototype.setBorders=function(t,e,i,o){},m.prototype.getColumnStyle=function(t,e){},m.prototype.setColumnStyle=function(t,e,i){},m.prototype.enableColumnClass=function(t,e,i){},m.prototype.hasColumnClass=function(t,e){},m.prototype.enableRowClass=function(t,e,i){},m.prototype.setRowStyle=function(t,e,i,o){},m.prototype.getRelativePosition=function(t){},m.prototype.getContentWidth=function(){},m.prototype.getContentHeight=function(){},m.prototype.getCellsByRowIndex=function(t){},m.prototype.disableHorizontalGridLine=function(t){},m.prototype.disableVerticalGridLine=function(t){},m.prototype.enableShading=function(t){},m.prototype.setTransposedShading=function(t){},m.prototype.enableRowHighlighting=function(t){},m.prototype.getRowHighlight=function(){},m.prototype.setRowHighlight=function(t){},m.prototype.getSelectedRows=function(){},m.prototype.getSelectedRowCount=function(){},m.prototype.isSelectedRow=function(t){},m.prototype.getRowAnchor=function(){},m.prototype.setRowAnchor=function(t){},m.prototype.setSelectedRow=function(t,e){},m.prototype.selectSingleRow=function(t){},m.prototype.selectRowRange=function(t,e){},m.prototype.clearSelectedRows=function(){},m.prototype.getFirstSelectedRow=function(){},m.prototype.getLastSelectedRow=function(){},m.prototype.activateColumn=function(t,e){},m.prototype.activateRows=function(t,e,i){},m.prototype.moveRowsToTop=function(t){},m.prototype.getFirstIndexInView=function(){},m.prototype.getLastIndexInView=function(){},m.prototype.isInCurrentView=function(t){},m.prototype.getFrozenLayout=function(){},m.prototype.setFrozenLayout=function(t){},m.prototype.insertColumn=function(t,e){},m.prototype.removeColumnAt=function(t){},m.prototype.moveColumn=function(t,e){},m.prototype.enableRowVirtualization=function(t){},m.prototype.enableColumnVirtualization=function(t){},m.prototype.getColumnIndex=function(t){},m.prototype.getCellIndex=function(t,e){},m.prototype.getIndex=function(){},m.prototype.setIndex=function(t){},m.prototype.getRowOffset=function(){},m.prototype.setRowOffset=function(t){},m.prototype.updateLayout=function(){},m.prototype.stretchCell=function(t,e,i,o){},m.prototype.unstretchCell=function(t,e){},m.prototype.unstretchAllCells=function(){},m.prototype.getStretchedCell=function(t,e){},m.prototype.getStretchedCells=function(){},m.prototype.updateStretchedCells=function(){},m.prototype.getColumnHost=function(){},m.prototype.setHidingMethod=function(t){},m.prototype.getHidingMethod=function(){},m.prototype.setColumnVisibility=function(t,e,i){},m.prototype.getRowLayout=function(){},m.prototype.reserveRightSpace=function(t){},m.prototype.getReservedSpace=function(){},m.prototype.getComputedStyle=function(){},m.prototype.isColumnActive=function(t){},m.prototype.setRowAttributes=function(t,e){},m.prototype.getContextRow=function(t){},m.prototype.selectColumn=function(t,e){},m.prototype.isSelectedColumn=function(t){},m.prototype.selectCell=function(t,e,i){},m.prototype.setCellBounds=function(t,e,i,o){},m.prototype.getHorizontalLayout=function(){},m.prototype.calculateColumnBounds=function(t,e,i,o){},m.prototype.updateColumnBounds=function(t,e){};const v=m;var C=function(t){(this._element=document.createElement("div")).className="column",this._cells=[],this._section=t};h.inherits(C,p),C.prototype._nextSibling=null,C.prototype._parent=null,C.prototype._section=null,C.prototype._cells=null,C.prototype._cellStart=0,C.prototype._cellEnd=0,C.prototype._autoStyleUpdating=!1,C.prototype._deactivation=!1,C.prototype._sizeClasses=null,C.prototype._colLeft=0,C.prototype._absolute=!1,C.prototype._scrollFrame=null,C.prototype._invisibility=0,C.prototype._bits=[1,2,4,8],C.prototype._pinned=!0,C.prototype.clearContent=function(){for(var t=this._cells.length;--t>=0;)this._cells[t].setContent(null)},C.prototype.setLeft=function(t){return this._colLeft=t,this._absolute&&(this._element.style.left=t+"px"),!0},C.prototype.enableAbsolutePosition=function(t){(t=!1!==t)!==this._absolute&&(this._absolute=t,this._element.style.left=t?this._colLeft+"px":"")},C.prototype.dispose=function(){this._dispose();for(var t=this._cells.length;--t>=0;)this._cells[t].dispose();this._scrollFrame=this._nextSibling=this._parent=this._cells=this._section=null},C.prototype.setStyle=function(t,e){var i=this._element;i.style[t]=e,i.style.backgroundColor?i.classList.contains("no-shading")||i.classList.add("no-shading"):i.classList.contains("no-shading")&&i.classList.remove("no-shading")},C.prototype.setStyles=function(t){var e=this._element,i=e.style;for(var o in t)i[o]=t[o];e.style.backgroundColor?e.classList.contains("no-shading")||e.classList.add("no-shading"):e.classList.contains("no-shading")&&e.classList.remove("no-shading")},C.prototype.show=function(t){this.setVisibility(0,!1!==t)},C.prototype.setWidth=function(t){this._element.style.width=t+"px";var e,i=0;t>0&&t<=24?i=3:t>24&&t<=40?i=2:t>40&&t<60&&(i=1);var o=this._sizeClasses;if(o){if(o.length>i){for(e=o.length;--e>=i;)this.removeClass(o[e]);o.length=i}i||(this._sizeClasses=null)}if(i)for(o||(o=[],this._sizeClasses=o),e=o.length;e<i;++e)o[e]=C._sizeClasses[e],this.addClass(o[e]);return this.setVisibility(1,t>0),!0},C._sizeClasses=["small-col","very-small-col","tiny-col"],C.prototype.setHeight=function(t){return this._element.style.height=t+"px",this.setVisibility(2,t>0),!0},C.prototype.getParent=function(){return this._parent},C.prototype.setParent=function(t,e){if(this._element){this._parent=i.getElement(t);var o=this._section?this._section.getHidingMethod():"";this._invisibility&&!o||this._setParent(this._parent,e)}},C.prototype.insertBefore=function(t){this._parent?this._scrollFrame?t&&this._parent===t.getParent()?this._insertBefore(t):this._insertBefore(this._scrollFrame):t?this._parent===t.getParent()&&this._insertBefore(t):this._setParent(this._parent):(this._insertBefore(t),this._parent=t.getParent())},C.prototype.enableAutoStyleUpdating=function(t){t=!1!==t,this._autoStyleUpdating!==t&&(this._autoStyleUpdating=t)},C.prototype.setNextSibling=function(t){this._nextSibling=t},C.prototype.isActive=function(){return!(this._invisibility&this._bits[3])},C.prototype.disableDeactivation=function(t){this._deactivation=!1!==t,this._deactivation&&(this.isActive()||this.activate())},C.prototype.activate=function(t){return t=this._pinned||this._deactivation||!1!==t,this.isActive()!==t&&(this.setVisibility(3,t),!0)},C.prototype.deactivate=function(t){this.activate(!1===t)},C.prototype.setCellCount=function(t){var e;for(e=this._cells.length;e<t;++e)this._cells.push(new g(null,this._section));for(e=this._cells.length;--e>=t;)this._cells[e].dispose();this._cells.length=t,this._cellStart>t?this._cellStart=this._cellEnd=t:this._cellEnd>t&&(this._cellEnd=t)},C.prototype.getCell=function(t){return this._cells[t]||null},C.prototype.collapseCells=function(t,e,i,o,n){if(!(e<=0)){var r=!1,s=this._cells[t];s&&!o&&(r|=s.collapse(i,n));for(var l=1;l<e&&(s=this._cells[t+l]);++l)r|=s.collapse(i,n);r&&(i?e>1&&(this._hasCollapsedCells=!0):this.updateCellOrders())}},C.prototype.uncollapseAllCells=i._deprecatedFunction,C.prototype.activateCells=function(t,e){var i,o=this._element;if(this._hasCollapsedCells)t=this._cellEnd,e>this._cellEnd&&(this._cellEnd=e);else if(this._cellStart===t){var n=this._cellEnd-e;if(n>0){for(i=this._cellEnd;--i>=e;)this._cells[i].removeParent();return void(this._cellEnd=e)}if(!(n<0))return;t=this._cellEnd,this._cellEnd=e}else{for(i=this._cellEnd;--i>=this._cellStart;)this._cells[i].removeParent();this._cellStart=t,this._cellEnd=e}for(i=t;i<e;++i){var r=this._cells[i];r.isKeptInDoc()&&(r.initialize(),o.appendChild(r.getElement()))}},C.prototype.moveCellsToTop=function(t){if(this.isActive()){for(var e=this._element,o=0;o<t;++o){var n=this._cells[o];n.isKeptInDoc()&&e.appendChild(n.getElement())}this._cells=i.cycleArray(this._cells,t)}},C.prototype.updateCellOrders=function(){this._hasCollapsedCells=!1;for(var t=this._element,e=this._cellStart;e<this._cellEnd;++e){var i=this._cells[e];i.isKeptInDoc()?t.appendChild(i.getElement()):this._hasCollapsedCells=!0}},C.prototype.hasCollapsedCells=function(){return this._hasCollapsedCells},C.prototype.getCellIndex=function(t){if(!t)return-1;for(var e=this._cellStart;e<this._cellEnd;++e)if(this._cells[e].getElement()===t)return e;return-1},C.prototype.getSection=function(){return this._section},C.prototype.log=function(){for(var t=[],e=this._cells.length,i=0;i<e;++i)t.push(this._cells[i].getTextContent());return t},C.prototype.getVisibility=function(){return!this._invisibility},C.prototype.setVisibility=function(t,e){var i=!this._invisibility,o=this._bits[t]||1;e?this._invisibility&=~o:this._invisibility|=o;var n=!this._invisibility;if(i!==n)if(this._section&&this._section.getHidingMethod())this.enableClass("hidden",!n);else if(n){var r=this._parent;if(!r)return;for(var s=this._nextSibling;s;){if(s._parent!==r){s=null;break}if(!s._invisibility)break;s=s._nextSibling}this.insertBefore(s)}else this._setParent(null)},C.prototype.updateLayout=function(){},C.prototype.setScrollState=function(t,e,i){this._scrollFrame=t,this.enableAbsolutePosition(i),this.setParent(e||this._section.getColumnHost()),e||this.activate(),this._pinned=!e},C._proto=C.prototype;const S=C;var w=function(){this._items=[]};w.prototype._items=null,w.prototype.dispose=function(){this._items=null},w.prototype.setItemCount=function(t){var e=this._items,i=e.length;if(i!==t)for(e.length=t;i<t;)e[i++]={}},w.prototype.getItem=function(t){return this._items[t]||null},w.prototype.moveItemsToTop=function(t){this._items=i.cycleArray(this._items,t)};const b=w;var R=function(t,e,i){t.setTop(e.getLaneStart(i)),t.setHeight(e.getLaneSize(i))},I=function(t,e,i,o){if(i){var n=e.getLaneStart(i);t.setLeft(n),t.setWidth(o-n)}else t.setStyle("left",""),t.setWidth(o)},x=function(t,e,i){this._trackX=t,this._trackY=e,this._section=i,this._cells=[]};x.prototype._trackX,x.prototype._trackY,x.prototype._section,x.prototype._cells,x.prototype._activeCount=0,x.prototype._stretchSize=0,x.prototype.dispose=function(){var t=this._cells;if(this._activeCount){this._activeCount=0;for(var e=t.length;--e>=0;){var i=t[e];i&&i.dispose()}}t.length=0},x.prototype.setStretchSize=function(t){this._stretchSize=t},x.prototype.getStretchSize=function(){return this._stretchSize},x.prototype.setCellCount=function(t){var e=this._cells,i=e.length;if(i<t)for(e.length=t;i<t;)e[i++]=null;else if(i>t){for(;--i>=t;){var o=e[i];o&&o.dispose()}e.length=t}},x.prototype.getCell=function(t){return this._cells[t]||null},x.prototype.getCells=function(){var t=[];if(this._activeCount){for(var e=this._cells,i=e.length,o=0;o<i;++o){var n=e[o];n&&n.getParent()&&t.push(n)}this._activeCount=t.length}return t},x.prototype.getColumnIndex=function(t){if(t){if(!t.getElement)return t._colIndex||0;var e=t.getElement();if(e)return e._colIndex||0}return-1},x.prototype.getRowIndex=function(t){if(t){if(t.getElement)return this._cells.indexOf(t);for(var e=this._cells,i=e.length,o=0;o<i;++o){var n=e[o];if(n&&n.getElement()===t)return o}}return-1},x.prototype.stretchCell=function(t,e){++this._activeCount,(!e||e<0)&&(e=0);var i=this._cells[t]||null;i||((i=new g(null,this._section)).addClass("tr-stretched"),i.stretched=!0,this._cells[t]=i);var o=i.getElement();o.stretched=!0,o._colIndex=e;var n=this._stretchSize||this._trackX.getTrackSize();return I(i,this._trackX,e,n),R(i,this._trackY,t),i},x.prototype.unstretchCell=function(t){var e=this._cells[t]||null;return e&&e.setParent(null),e},x.prototype.unstretchAllCells=function(){if(this._activeCount){this._activeCount=0;for(var t=this._cells,e=t.length;--e>=0;){var i=t[e];i&&i.setParent(null)}}},x.prototype.updateCells=function(){if(this._activeCount){for(var t=0,e=this._cells,i=e.length,o=this._trackX,n=this._trackY,r=this._stretchSize||o.getTrackSize(),s=0;s<i;++s){var l=e[s];l&&l.getParent()&&(++t,I(l,o,l.getElement()._colIndex,r),R(l,n,s))}this._activeCount=t}},x.prototype.updateXAxis=function(){if(this._activeCount){for(var t=0,e=this._cells,i=e.length,o=this._trackX,n=this._stretchSize||o.getTrackSize(),r=0;r<i;++r){var s=e[r];s&&s.getParent()&&(++t,I(s,o,s.getElement()._colIndex,n))}this._activeCount=t}},x.prototype.updateYAxis=function(){if(this._activeCount){for(var t=0,e=this._cells,i=e.length,o=this._trackY,n=0;n<i;++n){var r=e[n];r&&r.getParent()&&(++t,R(r,o,n))}this._activeCount=t}},x.prototype.moveCellsToTop=function(t){this._activeCount&&(this._cells=i.cycleArray(this._cells,t),this.updateYAxis())};const L=x;var D=function(t,e){this.indexX=t,this.indexY=e};D.prototype.isSpanIndices=function(t,e){return t===this.indexX&&e===this.indexY},D.prototype.isOccupiedIndices=function(t,e){return t!==this.indexX||e!==this.indexY},D.prototype.register=function(t,e){this._register(t,e,!0)},D.prototype.unregister=function(t,e){this._register(t,e,!1)},D.prototype._register=function(t,e,i){var o=t.indexOf(this);i?o<0&&t.push(this):o>=0&&t.splice(o,1);for(var n=i?this:null,r=this.indexX+this.colSpan,s=this.indexY+this.rowSpan,l=this.indexX;l<r;++l)for(var a=this.indexY;a<s;++a)e[l+","+a]=n},D.prototype.indexX,D.prototype.indexY,D.prototype.colSpan=1,D.prototype.rowSpan=1,D.prototype.prevColSpan=1,D.prototype.prevRowSpan=1,D.prototype.retVal=0;const A=D;var z=function(){this._spans=[],this._occupiedMap={}};z.prototype.removeColumn=function(t){var e=!1;return this.removeSpanByColIndex(t)&&(e=!0),this.shiftColumn(t,-1)&&(e=!0),e},z.prototype.shiftColumn=function(t,e){if(this._spans.length<=0||0===e)return!1;for(var i=!1,o=this._spans.length;--o>=0;){var n=this._spans[o];n.indexX>=t&&(i=!0,n.indexX+=e)}if(!i)return!1;var r=this._spans;for(this._spans=[],this._occupiedMap={},o=r.length;--o>=0;)(n=r[o]).indexX>=0&&n.register(this._spans,this._occupiedMap);return!0},z.prototype.removeSpan=function(t,e){if(this._spans.length<=0)return null;var i=t+","+e,o=this._occupiedMap[i];return!o||o.isOccupiedIndices(t,e)?null:(o.unregister(this._spans,this._occupiedMap),o)},z.prototype.removeSpanByColIndex=function(t,e){var i,o=this._spans.length;if(o<=0)return null;for(var n=e||[],r=0,s=0;s<o;++s)(i=this._spans[s])&&i.indexX===t&&(n.push(i),r++);if(r<=0)return null;for(o=n.length,s=0;s<r;++s)n[o-s-1].unregister(this._spans,this._occupiedMap);return n},z.prototype.removeSpanStartedFromRowIndex=function(t,e){var i,o=this._spans.length;if(o<=0)return null;for(var n=e||[],r=0,s=0;s<o;++s)(i=this._spans[s])&&i.indexY>=t&&(n.push(i),r++);if(r<=0)return null;for(o=n.length,s=0;s<r;++s)n[o-s-1].unregister(this._spans,this._occupiedMap);return n},z.prototype.clearAllSpans=function(){if(this._spans.length<=0)return null;var t=this._spans;return this._spans=[],this._occupiedMap={},t},z.prototype.hasSpan=function(){return this._spans.length>0},z.prototype.getSpan=function(t,e){var i=this.getOccupyingSpan(t,e);return i&&i.isSpanIndices(t,e)?i:null},z.prototype.getOccupyingSpan=function(t,e){return this._spans.length<=0?null:this._occupiedMap[t+","+e]||null},z.prototype.getAllSpans=function(){return this._spans},z.prototype.getColSpan=function(t,e){var i=this._occupiedMap[t+","+e];return null==i?1:i.isOccupiedIndices(t,e)?i.indexX-t:i.colSpan},z.prototype.getRowSpan=function(t,e){var i=this._occupiedMap[t+","+e];return null==i?1:i.isOccupiedIndices(t,e)?i.indexY-e:i.rowSpan},z.prototype.setColSpan=function(t,e,i){return this._updateSpan(t,e,!0,i)},z.prototype.setRowSpan=function(t,e,i){return this._updateSpan(t,e,!1,i)},z.prototype._updateSpan=function(t,e,i,o){o<1&&(o=1);var n=this.getSpan(t,e);n&&(n.retVal=0);var r,s,l,a,h,u,p=t,_=e,d=n?n.colSpan:1,c=n?n.rowSpan:1,g=!0;if(i){if(d===o)return n;if(d>o)p=t+o,r=t+d,g=!1;else{if((l=this._occupiedMap[t+","+e])&&l!==n)return n;p=t+d,r=t+o}s=e+c}else{if(c===o)return n;if(c>o)_=e+o,s=e+c,g=!1;else{if((l=this._occupiedMap[t+","+e])&&l!==n)return n;_=e+c,s=e+o}r=t+d}if(g){var f=[];for(h=p;h<r;++h)for(u=_;u<s;++u){if(a=h+","+u,this._occupiedMap[a])return n;f.push(a)}for(null==n&&(n=new A(t,e),a=t+","+e,this._spans.push(n),this._occupiedMap[a]=n),h=f.length;--h>=0;)this._occupiedMap[f[h]]=n}else{if(i?o+c<=2:o+d<=2){a=t+","+e;var y=this._spans.indexOf(n);this._spans.splice(y,1),this._occupiedMap[a]=null}for(h=p;h<r;++h)for(u=_;u<s;++u)this._occupiedMap[h+","+u]=null}return i?(n.prevColSpan=n.colSpan,n.colSpan=o):(n.prevRowSpan=n.rowSpan,n.rowSpan=o),n.retVal=g?1:-1,n},z.prototype._spans,z.prototype._occupiedMap;const V=z;var E=function(){this._selections=[]};E.prototype.clone=function(){var t=new E;return t._selections=this._selections.concat(),t._count=this._count,t._anchor=this._anchor,t._firstIndex=this._firstIndex,t._lastIndex=this._lastIndex,t},E.prototype.toString=function(){return this._selections.join(", ")},E.prototype.select=function(t){return!(t<0||!this._select(t)||(this._anchor=t,(this._firstIndex<0||t<this._firstIndex)&&(this._firstIndex=t),(this._lastIndex<0||t>this._lastIndex)&&(this._lastIndex=t),0))},E.prototype.deselect=function(t){return!!this._selections[t]&&(this._selections[t]=!1,--this._count,this._anchor===t&&(this._anchor=-1),this._firstIndex===t&&(this._firstIndex=this._findNextSelection(t)),this._lastIndex===t&&(this._lastIndex=this._findPrevSelection(t)),!0)},E.prototype.toggleSelection=function(t){this._selections[t]?this.deselect(t):this.select(t)},E.prototype.singularlySelect=function(t){return 1!==this._count||t<0?(this.clearAllSelections(),this.select(t),!0):this._firstIndex!==t&&(this._selections[this._anchor]=!1,this._selections[t]=!0,this._anchor=t,this._firstIndex=t,this._lastIndex=t,!0)},E.prototype.selectRange=function(t,e){if(0!==e)if(t<0&&(t=0),1!==e&&-1!==e){var i=t,o=i+e;if(e<0&&(i=(o=i+1)+e),!(i>=o)){this._anchor=t,(this._firstIndex<0||i<this._firstIndex)&&(this._firstIndex=i),(this._lastIndex<0||o>=this._lastIndex)&&(this._lastIndex=o-1);for(var n=i;n<o;++n)this._select(n)}}else this.select(t)},E.prototype.deselectRange=function(t,e){if(!(this._count<=0))if(t<0&&(t=0),1!==e&&-1!==e){var i=t+e;if(e<0&&(t=(i=t+1)+e),this._firstIndex>=t&&this._lastIndex<i)this.clearAllSelections();else{this._anchor>=t&&this._anchor<i&&(this._anchor=-1),this._firstIndex>=t&&this._firstIndex<i&&(this._firstIndex=this._findNextSelection(i-1)),this._lastIndex>=t&&this._lastIndex<i&&(this._lastIndex=this._findPrevSelection(t));var o=0;for(o=t;o<i;++o)this._selections[o]&&(this._selections[o]=!1,--this._count)}}else this.deselect(t)},E.prototype.hasSelection=function(t,e){if(this._count<=0)return!1;var i=t+e;if(e<0&&(t=(i=t+1)+e),i<this._firstIndex||t>this._lastIndex)return!1;for(var o=t;o<i;++o)if(this._selections[o])return!0;return!1},E.prototype.getSelection=function(t){return!0===this._selections[t]},E.prototype.setSelection=function(t,e){return!1!==e?this.select(t):this.deselect(t)},E.prototype.getSelectionAnchor=function(){return this._anchor},E.prototype.setSelectionAnchor=function(t){this._anchor=t},E.prototype.getSelectionCount=function(){return this._count},E.prototype.getFirstSelectedIndex=function(){return this._firstIndex},E.prototype.getLastSelectedIndex=function(){return this._lastIndex},E.prototype.getAllSelections=function(){if(this._count>0){for(var t=new Array(this._count),e=0,i=this._firstIndex;i<=this._lastIndex;++i)this._selections[i]&&(t[e++]=i);return t}return[]},E.prototype.getSelectionMap=function(){return this._selections},E.prototype.clearAllSelections=function(){return this._count>0?(this._selections.length=0,this._count=0,this._anchor=-1,this._firstIndex=-1,this._lastIndex=-1,0):0},E.prototype.copyFrom=function(t,e,i,o){if(!(o<=0)){var n=e+i;if(null!=t)if(!1!==t.hasSelection(e,o)){for(var r=0;r<o;++r)t._selections[e+r]?this.select(n+r):this.deselect(n+r);this._anchor=-1,t._anchor>=0&&t._anchor>=e&&t._anchor<e+o&&(this._anchor=t._anchor+i)}else this.deselectRange(n,o);else this.deselectRange(n,o)}},E.prototype._select=function(t){return!this._selections[t]&&(this._selections[t]=!0,++this._count,!0)},E.prototype._findNextSelection=function(t){if(this._lastIndex>=0)for(;++t<=this._lastIndex;)if(this._selections[t])return t;return-1},E.prototype._findPrevSelection=function(t){if(this._firstIndex>=0)for(;--t>=this._firstIndex;)if(this._selections[t])return t;return-1},E.prototype._selections=null,E.prototype._count=0,E.prototype._anchor=-1,E.prototype._firstIndex=-1,E.prototype._lastIndex=-1;const T=E;var P=function(t,e){this._onInterval=this._onInterval.bind(this),"function"==typeof t?this._func=t:"function"==typeof e&&(this._func=e),"number"==typeof e?this._delay=e:"number"==typeof t&&(this._delay=t)};P.prototype._func=null,P.prototype._delay=0,P.prototype._timerId=0,P.prototype._pending=!1,P.prototype.start=function(){this._func&&(this._timerId?this._pending=!0:this._timerId=setInterval(this._onInterval,this._delay))},P.prototype.dispose=function(){this._timerId&&(clearInterval(this._timerId),this._timerId=0),this._func=null},P.prototype._onInterval=function(){this._pending?this._pending=!1:(this._func(),clearInterval(this._timerId),this._timerId=0)},P._proto=P.prototype;const M=P;var F=function(){var t=this;t._addEvents("scroll","activated","deactivated","scrollStart","scrollEnd","thicknessChanged","layoutChanged","enabled","disabled"),t._onTrackScroll=t._onTrackScroll.bind(t),t._onKeyDown=t._onKeyDown.bind(t),t._onStartFading=t._onStartFading.bind(t),t._onMouseWheel=t._onMouseWheel.bind(t),t._flash=t._flash.bind(t),t._onTouchStart=t._onTouchStart.bind(t),t._onTouchMove=t._onTouchMove.bind(t),t._onTouchEnd=t._onTouchEnd.bind(t),t._smoothScroll=t._smoothScroll.bind(t),t._updateEffectiveArea=t._updateEffectiveArea.bind(t),t._onRestingPosition=t._onRestingPosition.bind(t),t._element=document.createElement("div"),t._element.className="grid-scrollbar",t._trackContent=document.createElement("div"),t._panes=[],t._paneSliders=[],t._startPos={},t._endPos={},t._reverter=new M(t._onRestingPosition,300),t._element.addEventListener("scroll",t._onTrackScroll),t._element.addEventListener("mouseover",t._flash),t._element.appendChild(t._trackContent),t.disableKeyboardInput(!1),F._queryNativeTrackThickness(t._dispatch.bind(t,"thicknessChanged")),t._updateEffectiveArea()||t.listen("thicknessChanged",t._updateEffectiveArea)};h.inherits(F,p),F.prototype._vertical=!0,F.prototype._step=0,F.prototype._parentNode=null,F.prototype._hostClassName="",F.prototype._trackContent=null,F.prototype._panes=null,F.prototype._paneSliders=null,F.prototype._enabled=!0,F.prototype._active=!1,F.prototype._isFrozen=!1,F.prototype._otherScrollbar=null,F.prototype._autoHideScrollbar=!0,F.prototype._trackSize=120,F.prototype._tContentSize=0,F.prototype._tScrollVal=0,F.prototype._tPercentVal=0,F.prototype._paneSize=0,F.prototype._pContentSize=0,F.prototype._pScrollVal=0,F.prototype._footerCount=0,F.prototype._fadingId=0,F.prototype._postponeFading=!1,F.prototype._layoutChanged=!1,F.prototype._contentDirty=!0,F.prototype._layoutDirty=!0,F.prototype._touchInput=!0,F.prototype._swiping=!1,F.prototype._touchDrag=!1,F.prototype._startPos,F.prototype._endPos,F.prototype._smoothing=!0,F.prototype._smoothingId=0,F.prototype._smoothingSpeed=0,F.prototype._wheelScrolling="",F.prototype._mouseWheelLogic=null,F._trackThickness=0,F._queryTimeout=0,F._queryStarted=!1,F._outerDummy=null,F._innerDummy=null,F._listeners=null,F.prototype._updateEffectiveArea=function(){var t=this.getTrackThickness();if(t){var e=this._vertical?"width":"height";this._element.style[e]=t+1+"px"}return!!t},F._queryNativeTrackThickness=function(t){if(F._queryStarted||F._repeatQuery(),t&&F._trackThickness<=0){var e=F._listeners;e||(e=F._listeners=[]),e.push(t)}},F._repeatQuery=function(){F._queryStarted=!0,F._retrieveNativeTrackThinkness()||(F._queryTimeout+=100,F._queryTimeout<3e3?setTimeout(F._repeatQuery,F._queryTimeout):(F._trackThickness=13,F._clearStaticResources()))},F._retrieveNativeTrackThinkness=function(){if(F._trackThickness>0)return!0;var t=F._innerDummy,e=F._outerDummy;t||((t=F._innerDummy=document.createElement("p")).style.width="100%",t.style.height="200px",(e=F._outerDummy=document.createElement("div")).style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.appendChild(t)),e.style.overflow="hidden",document.body.appendChild(e);var i=t.offsetWidth;e.style.overflow="scroll";var o=t.offsetWidth;return i==o&&(o=e.clientWidth),document.body.removeChild(e),(F._trackThickness=i-o)>0&&(F._clearStaticResources(),!0)},F._clearStaticResources=function(){F._innerDummy=F._outerDummy=null;var t=F._listeners;if(t){F._listeners=null;for(var e={},i=t.length;--i>=0;)t[i](e)}},F.updateTrackThickness=function(){F._trackThickness=0,F._queryTimeout=0,F._queryStarted=!1,F._queryNativeTrackThickness()},F.prototype.dispose=function(){this.unlistenAll(),this._smoothingId&&(clearInterval(this._smoothingId),this._smoothingId=0),this._active=this._layoutChanged=!1,this._dispose();for(var t=this._panes.length;--t>=0;)this._panes[t].dispose(),this._paneSliders[t].dispose();this._reverter.dispose()},F.prototype.getContent=function(t){return this._paneSliders[0].getContent(t)},F.prototype.getParent=function(){return this._parentNode},F.prototype.setParent=function(t,e){var o=i.getElement(t),n=this._parentNode!==o;n&&this._parentNode&&(this.removeWheelListener(this._parentNode),this._parentNode.classList.remove(this._hostClassName)),this.isActive()?(this._setParent(o,e),this._parentNode=this._element.parentNode,this._parentNode&&this._parentNode.classList.add(this._hostClassName)):this._parentNode=o,n&&this.addWheelListener(this._parentNode)},F.prototype.attachToExternalElement=function(t){this.setParent(t);var e=this.getElement();e.style.right="0",this._vertical?e.style.overflowX="hidden":e.style.overflowY="hidden",e.style.boxSizing="border-box",e.style.position="absolute",e.style.outline="none"},F.prototype._onActiveStateChange=function(){var t,e=this;if(e._scrollTo(0,!0),e._active){for(e._parentNode&&(e._layoutDirty=!0,e._setParent(e._parentNode),e._parentNode.classList.add(e._hostClassName)),e._flash(),t=e._panes.length;--t>=0;)e._panes[t].removeClass("scroll-disabled");e._dispatch("activated",{})}else{e._setParent(null),e._parentNode&&e._parentNode.classList.remove(e._hostClassName);var i=e._vertical?"height":"width";for(t=e._panes.length;--t>=0;)e._panes[t].addClass("scroll-disabled"),e._panes[t].setStyle(i,"");e._dispatch("deactivated",{})}e._vertical&&e._otherScrollbar&&e._otherScrollbar.isActive()&&e._otherScrollbar.invalidate()},F.prototype._onEnablingStateChange=function(){var t=this;t._enabled?t._dispatch("enabled",{}):t._dispatch("disabled",{})},F.prototype.isActive=function(){return this._active},F.prototype.isEnabled=function(){return this._enabled},F.prototype.enable=function(t){t=!1!==t,this._enabled!=t&&(this._enabled=t,this._updateLayout(),this._onEnablingStateChange())},F.prototype.disable=function(t){this.enable(!1===t)},F.prototype.getTrackSize=function(){return this._trackSize},F.prototype.getPaneSize=function(){return this._paneSize},F.prototype.getContentSize=function(){return this._pContentSize},F.prototype.getTrackThickness=function(){return F._trackThickness},F.prototype.getScrollGap=function(){return this._pContentSize-this.getPaneSize()},F.prototype.setTrackSize=function(t,e){this._trackSize=t>0?t:0,this._paneSize=e>0?e:0},F.prototype.calculateContentSize=function(){return 0},F.prototype.update=function(){if(this._contentDirty){this._contentDirty=!1;var t=this.calculateContentSize();(!t||t<0)&&(t=0),this._pContentSize!==t&&(this._pContentSize=t,this._layoutDirty=!0)}return!!this._layoutDirty&&(this._layoutDirty=!1,this._updateLayout(),!0)},F.prototype.invalidate=function(t,e){this._contentDirty=!0,this._layoutDirty=!0,null!=e&&(this._pScrollVal=e),t&&this.update()},F.prototype.invalidateContent=function(){this._contentDirty=!0},F.prototype.isScrollPosValid=function(t){var e=t-this.getPaneSize(),i=this._pScrollVal;return 0===i||i>0&&e>0&&i<e},F.prototype.flash=function(){this.update(),this._flash()},F.prototype._scroll=function(t){this._scrollTo(this._pScrollVal+t)},F.prototype._scrollTo=function(t,e){if(this._active||e){t=this._calcProperScrollValue(t);var i=!1;this._pScrollVal!==t&&(this._pScrollVal=t,i=!0),this._setTrackScrollVal(t),i?(e&&(this._layoutChanged=!0),this._dispatchScrollEvent(null)):e&&this._dispatch("layoutChanged",{})}},F.prototype._calcProperScrollValue=function(t){if(!t||t-.5<0)return 0;if(this._tPercentVal>=1&&Math.abs(this._pScrollVal-t)<=2)return this._pScrollVal;var e=this.getScrollGap();if(e<=0)return 0;if(t+.5>=e)return e;var i=this._step;if(i){if((t=Math.round(t/i)*i)-i/2<=0)return 0;if(t+i/2>=e)return e}return Math.round(t)},F.prototype._convertTrackToPane=function(t){t=Math.round(t);var e=this._getTrackGap();this._tPercentVal>=1&&Math.abs(this._tScrollVal-t)<=5&&(t=e),this._tScrollVal=t,this._tPercentVal=e?t/e:0;var i=this.getScrollGap();return e===i?t:this._tPercentVal*i},F.prototype._setTrackScrollVal=function(t){var e=this._getTrackGap(),i=0;if(e>0){if(t>0){var o=this.getScrollGap();i=e===o?t:t/o*e,i=Math.round(i)}i>=e&&(i=e)}if(i!==this._tScrollVal){this._tScrollVal=i,this._tPercentVal=e?i/e:0;var n=this._element;return this._vertical?n.scrollTop=i:n.scrollLeft=i,!0}return!1},F.prototype._getTrackGap=function(){var t=this._tContentSize-this.getTrackSize();return t>0?t:0},F.prototype._getScrollValue=function(){return this._pScrollVal},F.prototype._isEndOfScroll=function(){return!this._active||this._pScrollVal>=this.getScrollGap()},F.prototype._isStartOfScroll=function(){return!this._pScrollVal},F.prototype._isOnEdge=function(t){return t<0&&this._isStartOfScroll()||t>0&&this._isEndOfScroll()},F.prototype._flash=function(){this._active&&this._autoHideScrollbar&&(this._fadingId?this._postponeFading=!0:(this._element._fading&&(this._element.classList.remove("grid-scroll-fadeout"),this._element._fading=!1),this._fadingId=setTimeout(this._onStartFading,1e3)))},F.prototype._clearAllPanes=function(){for(var t=this._panes.length;--t>=0;){this._panes[t].setParent(null);var e=this._paneSliders[t];e._content=e._columns=null;for(var i=e.getElement();null!==i.firstChild;)i.removeChild(i.firstChild)}},F.prototype.disableKeyboardInput=function(t){!1===t?(this._element.setAttribute("tabindex","0"),this._element.addEventListener("keydown",this._onKeyDown,!1)):(this._element.removeAttribute("tabindex"),this._element.removeEventListener("keydown",this._onKeyDown,!1))},F.prototype.disableTouchInput=function(t){this._touchInput=!1===t},F.prototype.setAutoHide=function(t){this._autoHideScrollbar=t,t||(this._element._fading&&(this._element.classList.remove("grid-scroll-fadeout"),this._element._fading=!1),this._fadingId&&(clearTimeout(this._fadingId),this._fadingId=0))},F.prototype.getAutoHide=function(){return this._autoHideScrollbar},F.prototype.setOtherScrollbar=function(t){this._otherScrollbar=t},F.prototype.setFooterCount=function(t){this._footerCount=t},F.prototype._calcActiveState=function(){if(this._enabled&&this.getTrackSize()>20){var t=this.getPaneSize();if(t>0)return this._pContentSize-t>0}return!1},F.prototype._updateLayout=function(){var t=this._calcActiveState();if(t!==this._active&&(this._active=t,this._onActiveStateChange()),this._active){var e=this.getTrackSize(),i=this.getPaneSize();if(this._tContentSize=this._pContentSize/i*e,this._vertical)this._trackContent.style.height=this._tContentSize+"px",this._element.style.height=e+"px",this._panes[0].setHeight(i);else{this._trackContent.style.width=this._tContentSize+"px",this._element.style.width=e+"px";for(var o=this._panes.length;--o>=0;)this._panes[o].setWidth(i)}this._scrollTo(this._pScrollVal,!0)}},F.prototype.resetPaneSize=function(){for(var t=this._vertical?"height":"width",e=this._panes.length;--e>=0;)this._panes[e].setStyle(t,"")},F._preventVScrolling=function(t){t.currentTarget.scrollTop=0},F._preventHScrolling=function(t){t.currentTarget.scrollLeft=0},F.prototype._addPaneAt=function(t){null==t&&(t=this._panes.length);var e=this._panes[t];if(!e){if((e=new p(document.createElement("div"))).setClass("grid-pane"),this._vertical?(e.addClass("sections"),e.listen("scroll",F._preventVScrolling)):(e.addClass("columns"),e.listen("scroll",F._preventHScrolling)),this._active||e.addClass("scroll-disabled"),this._paneSize&&this._active){var i=this.getPaneSize();this._vertical?e.setHeight(i):e.setWidth(i)}e.listen("touchstart",this._onTouchStart),e.listen("touchmove",this._onTouchMove),e.listen("touchend",this._onTouchEnd),e.listen("touchcancel",this._onTouchEnd);var o=new p(document.createElement("div"));o.setClass("grid-pane-slider"),o.setParent(e),this._panes[t]=e,this._paneSliders[t]=o}return e},F.prototype._onStartFading=function(t){this._fadingId=0,this._active&&(this._postponeFading?(this._postponeFading=!1,this._flash()):this._element._fading||(this._element.classList.add("grid-scroll-fadeout"),this._element._fading=!0))},F.prototype._onTrackScroll=function(t){var e=this._vertical?t.target.scrollTop:t.target.scrollLeft,i=this._convertTrackToPane(e);(i=this._calcProperScrollValue(i))!==this._pScrollVal&&(this._pScrollVal=i,this._dispatchScrollEvent(t))},F.prototype._onRestingPosition=function(){this._setSliderPosition(-this._pScrollVal,!0)},F.prototype._setSliderPosition=function(t,e){var i="",o="",n=this._vertical?"top":"left";t&&(e?o=t+"px":(i=this._vertical?"translateY":"translateX",i+="("+t+"px)",this._reverter.start()));for(var r=this._paneSliders.length;--r>=0;){var s=this._paneSliders[r],l=s.getElement().style;s._titleSection?l[n]=t+"px":(l.transform=i,l[n]=o)}e?this._dispatch("scrollEnd",{}):this._dispatch("scrollStart",{})},F.prototype._dispatchScrollEvent=function(t){if(this._setSliderPosition(-this._pScrollVal,!1),this._flash(),!this._isEventDispatching("scroll")){if(!t){var e=this._element;t={currentTarget:e,srcElement:e,target:e}}t.layoutChanged=this._layoutChanged,this._vertical?t.scrollTop=this._pScrollVal:t.scrollLeft=this._pScrollVal,this._dispatch("scroll",t)}},F.prototype._onKeyDown=function(t){if(this._isFrozen)i._preventDefault(t);else if(this._active&&(this._vertical?38===t.keyCode||40===t.keyCode:37===t.keyCode||39===t.keyCode)){var e=this.getScrollGap(),o=Math.round(.07*e);o<10?o=10:o>100&&(o=100),37!==t.keyCode&&38!==t.keyCode||(o*=-1),this._scroll(o),i._preventDefault(t)}},F.prototype._onTouchStart=function(t){this._isFrozen?i._preventDefault(t):!this._swiping&&this._touchInput&&(this._vertical&&this.update(),this._flash(),this._smoothingId&&(clearInterval(this._smoothingId),this._smoothingId=0),this._swiping=!0,this._getTouchInfo(t,this._startPos))},F.prototype._onTouchMove=function(t){var e=this;if(e._isFrozen)i._preventDefault(t);else if(e._swiping&&e._active&&e._touchInput&&!(t.touches&&t.touches.length>1)){var o=e._startPos,n=e._endPos;e._getTouchInfo(t,n);var r=this._vertical?o.y-n.y:o.x-n.x;r>-5&&r<5||e._isOnEdge(r)||(e._touchDrag?e._scrollTo(o.scrollValue+r):n.timeStamp-o.timeStamp>30&&(e._touchDrag=!0),t.cancelable&&t.preventDefault())}},F.prototype._onTouchEnd=function(t){if(this._isFrozen)i._preventDefault(t);else if(this._swiping=!1,this._touchDrag&&(this._touchDrag=!1,t.cancelable&&t.preventDefault(),this._smoothing&&!this._smoothingId)){var e=this._startPos,o=this._getTouchInfo(t,this._endPos),n=o.timeStamp-e.timeStamp,r=this._vertical?e.y-o.y:e.x-o.x;this._smoothingSpeed=30*r/n,(this._smoothingSpeed>10||this._smoothingSpeed<-10)&&(this._smoothingId=setInterval(this._smoothScroll,25))}},F.prototype._getTouchInfo=function(t,e){var i=t.changedTouches[0];return e||(e={}),e.x=i.pageX,e.y=i.pageY,e.timeStamp=t.timeStamp,e.scrollValue=this._getScrollValue(),e},F.prototype._smoothScroll=function(){var t=this._smoothingSpeed;t=.9*t|0,this._smoothingSpeed=t,t>1||t<-1?this._scroll(t):(clearInterval(this._smoothingId),this._smoothingId=0)},F.prototype.disableMouseWheel=function(t){!1===t?this.setMouseWheelLogic(this._mouseWheelLogic||this._onMouseWheel):this.setMouseWheelLogic(null)},F.prototype.setMouseWheelLogic=function(t){this.removeWheelListener(this._parentNode),this._mouseWheelLogic=t,this._mouseWheelLogic&&this.addWheelListener(this._parentNode)},F.prototype.addWheelListener=function(t){t&&this._mouseWheelLogic&&t.addEventListener("wheel",this._mouseWheelLogic,!1)},F.prototype.removeWheelListener=function(t){t&&this._mouseWheelLogic&&t.removeEventListener("wheel",this._mouseWheelLogic,!1)},F.prototype.setMouseWheelSpeed=function(t){this._wheelScrolling="string"==typeof t?t:""},F.prototype.getMouseWheelSpeed=function(){return this._wheelScrolling},F.prototype.getDefaultMouseWheelLogic=function(){return this._onMouseWheel},F.prototype._onMouseWheel=function(t){if(this._isFrozen)i._preventDefault(t);else if(!(t.ctrlKey||t.altKey||t.shiftKey)&&this.isActive()){var e=this._vertical?t.deltaY:t.deltaX;if(e&&!this._isOnEdge(e)){if(i._preventDefault(t),t.deltaMode&&(e=e>0?100:-100),"linear"!=this._wheelScrolling){var o=this.getContentSize();o>=4e3&&(e*=1+o/4e3|0)}this.update(),this._scroll(e)}}},F.prototype.setScrollingStep=function(t){this._step=t>0?t:0},F.prototype.freezeScrolling=function(t){var e=this._isFrozen;return this._isFrozen=!1!==t,e},F._proto=F.prototype;const k=F;var H=function(){var t=this;t._vertical=!1,t._onDeactivated=t._onDeactivated.bind(t),t._onActivated=t._onActivated.bind(t),t._hostClassName="hscrollbar-host",H.base(this,"constructor"),t._element.classList.add("grid-hscroll"),t._trackContent.style.height="1px",t.disableMouseWheel(!1),t.listen("activated",t._onActivated),t.listen("deactivated",t._onDeactivated)};h.inherits(H,k),H.prototype._pinnedLeftColumnCount=0,H.prototype._pinnedRightColumnCount=0,H.prototype.setScrollContent=function(t,e,i,o){this._clearAllPanes();var n=e.length;if(!(n<=0)){this._pinnedLeftColumnCount=i>=0?i:0,this._pinnedRightColumnCount=o>0?o:0;var r=e[0],s=r.getColumnCount(),l=s-o;(!l||l<0)&&(l=s);for(var a=0;a<n;++a){r=e[a];var h,u,p=this._addPaneAt(a),_=this._paneSliders[a],d=p.getElement(),c=_.getElement();for(h=0;h<i;++h)(u=r.getColumn(h)).setScrollState(d,null,!1);p.setParent(r.getColumnHost());var g=[],f=[];for(h=i;h<l;++h)(u=r.getColumn(h)).setScrollState(null,c,this.isActive()),g.push(u),f.push(u.getElement());for(h=l;h<s;++h)(u=r.getColumn(h)).setScrollState(null,null,!1);var y=r.getReservedSpace();y&&(this._pinnedRightColumnCount||(_.addContent(y),f.push(y)),r._updateRightSpaceStyle()),r._updateLayers(),_._titleSection=r.hasClass("title"),_._columns=g,_._content=f}this.invalidateContent()}},H.prototype.setWidth=function(t){return this.setTrackSize(t,t),!0},H.prototype.getWidth=function(){return this.getPaneSize()},H.prototype.getScrollLeft=function(){return this._getScrollValue()},H.prototype.setScrollLeft=function(t){this.update(),this._scrollTo(t)},H.prototype.getPinnedLeftColumnCount=function(){return this.isEnabled()?this._pinnedLeftColumnCount:0},H.prototype.getPinnedRightColumnCount=function(){return this.isEnabled()?this._pinnedRightColumnCount:0},H.prototype.setPaneLeft=function(t){for(var e=t&&this.isActive()?-t+"px":"",i=this._panes.length;--i>=0;)this._paneSliders[i].setStyle("marginLeft",e)},H.prototype.isEndOfHorizontalScroll=function(){return this._isEndOfScroll()},H.prototype.getContentWidth=function(){var t=this._paneSliders[0],e=0;if(t)for(var i=t._content,o=i.length;--o>=0;){var n=i[o],r=n?n.style.width:0;r&&(e+=parseFloat(r))}return e},H.prototype.calculateContentSize=function(){return this.getContentWidth()},H.prototype.getTrackSize=function(){return this._footerCount<=0&&this._otherScrollbar&&this._otherScrollbar.isActive()&&!this._pinnedRightColumnCount?this._trackSize-this.getTrackThickness():this._trackSize},H.prototype._onActivated=function(t){this._updateActivation(!0)},H.prototype._onDeactivated=function(t){this._updateActivation(!1)},H.prototype._updateActivation=function(t){for(var e=this._paneSliders.length,i=0;i<e;++i)for(var o=this._paneSliders[i]._columns,n=o?o.length:0,r=0;r<n;++r){var s=o[r];s.getElement()&&s.enableAbsolutePosition(t)}},H._proto=H.prototype;const G=H;var O=function(t){var e=this;e._onMouseMove=e._onMouseMove.bind(e),e._onMouseOut=e._onMouseOut.bind(e),e._onResetTransformIE=e._onResetTransformIE.bind(e),e._trackX=new y,e._trackY=new y,e._trackX.setDefaultLaneSize(100),e._trackY.setDefaultLaneSize(32),e._cellSpans=new V,e._element=document.createElement("div"),e._element.className="tr-lg tr-even-shading",e._ctxRows=new b,e._columns=[],e._cells=[],e._highlightedCells=[],e._stretchedCells=new L(e._trackX,e._trackY,e),e._selectionList=new T,t&&(e._virOwner=t.owner||null,t.horizontalScrollbar&&(e._hscrollbar=t.horizontalScrollbar)),e._virOwner||e._element.classList.add("section"),e._addEvent("rowHighlighted"),e._addEvent("rowCountChanged"),e._addEvent("rowHeightChanged"),e._addEvent("rowAvailable")};h.inherits(O,p),O.prototype._index=-1,O.prototype._availableRowCount=0,O.prototype._activeRow=0,O.prototype._activeRowEnd=0,O.prototype._colCount=0,O.prototype._rowCount=0,O.prototype._hiddenRowCount=0,O.prototype._trackX,O.prototype._trackY,O.prototype._cellSpans,O.prototype._columns,O.prototype._firstColumn,O.prototype._lastColumn,O.prototype._rightSpace,O.prototype._rightSpaceSize=0,O.prototype._frozenLayout=!1,O.prototype._rowHighlightEnabled=!1,O.prototype._rowHighlightIndex=-1,O.prototype._highlightedCells,O.prototype._coverLayer=null,O.prototype._stretchedCells=null,O.prototype._ctx=null,O.prototype._selectionList,O.prototype._colVir=!1,O.prototype._initialized=!1,O.prototype._hidingMethod="",O.prototype._virOwner=null,O.prototype._transformIETimer=0,O.prototype._ctxRows,O.prototype._boundLayer=null,O.prototype._columnBound=null,O.prototype._hscrollbar=null,O.prototype.dispose=function(){this.setRowCount(0),this.unlistenAll(),this._ctxRows.dispose(),this._stretchedCells.dispose();for(var t=this._columns.length;--t>=0;)this._columns[t].dispose();this._colCount=this._rowCount=this._activeRowEnd=this._availableRowCount=0,this._highlightedCells.length=0,this._ctx=null,this._hscrollbar=null,this._dispose()},O.prototype.getWidth=function(){return this.isVisible()?this._getWidth():0},O.prototype._getWidth=function(){return this.getContentWidth()+this._rightSpaceSize},O.prototype.setWidth=function(t){return!(t<0||null==this._trackX.setTrackSize(t-this._rightSpaceSize)||(this._syncLayoutToColumns(0),0))},O.prototype.getHeight=function(){return this.isVisible()?this.getContentHeight():0},O.prototype.setHeight=function(t){return!(t<0||(null==this._trackY.setTrackSize(t)||this._syncLayoutToRows(0,this._rowCount),0))},O.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._trackY.show(t),this.setFrozenLayout(!1===t),this._dispatchRowHeightChangedEvent(0,this._rowCount)},O.prototype.hitTest=function(t,e,i){if(t<0)return null;if(e<0)return null;if(t>=this.getContentWidth())return null;if(e>=this.getHeight())return null;var o=this._trackX.hitTest(t);if(o<0)return null;var n=this._trackY.hitTest(e);if(n<0)return null;var r={};if(r.colIndex=o,r.rowIndex=n,!0!==i){var s=this._cellSpans.getOccupyingSpan(o,n);s&&(r.colIndex=s.indexX,r.rowIndex=s.indexY)}return r},O.prototype.hitTestX=function(t){return t<0?-1:t>=this.getContentWidth()?~this._colCount:this._trackX.hitTest(t)},O.prototype.hitTestY=function(t){return t<0?-1:t>=this.getHeight()?~this._rowCount:this._trackY.hitTest(t)},O.prototype.getDefaultColumnWidth=function(){return this._trackX.getDefaultLaneSize()},O.prototype.setDefaultColumnWidth=function(t){this._trackX.getDefaultLaneSize()!==t&&(this._trackX.setDefaultLaneSize(t),this._syncLayoutToColumns(0))},O.prototype.getDefaultRowHeight=function(){return this._trackY.getDefaultLaneSize()},O.prototype.setDefaultRowHeight=function(t){if(this._trackY.getDefaultLaneSize()!==t){this._trackY.setDefaultLaneSize(t);for(var e=0;e<this._colCount;++e)this._columns[e].setHeight(t);this._syncLayoutToRows(0,this._rowCount),this._dispatchRowHeightChangedEvent(0,this._rowCount)}},O.prototype.getColumnWidth=function(t){return this._trackX.getLaneSize(t)},O.prototype.setColumnWidth=function(t,e){return!!this._setColumnWidth(t,e)&&(this._syncLayoutToColumns(t),!0)},O.prototype._setColumnWidth=function(t,e){return this._trackX.setLaneSize(t,e)},O.prototype._updateColumnLayout=function(){this._syncLayoutToColumns(0)},O.prototype.getRowHeight=function(t){return this._trackY.getLaneSize(t)},O.prototype.setRowHeight=function(t,e){if(t<0||t>=this._rowCount)return!1;var i=this._trackY.setLaneSize(t,e);return this._syncLayoutToRows(t,t+1),i&&this._dispatchRowHeightChangedEvent(t,t+1),this._resetTransformIETimer(),i},O.prototype._updateRowHeights=function(t,e){for(var i=0,o=0;o<this._rowCount;++o){var n=t.getLaneSize(e);i|=this._trackY.setLaneSize(o,n),++e}return this._syncLayoutToRows(0,this._rowCount),i},O.prototype.isColumnVisible=function(t){return this._trackX.isLaneVisible(t)},O.prototype.hideColumn=function(t,e){return this.setColumnVisibility(t,!1===e,0)},O.prototype.isRowVisible=function(t){return this._trackY.isLaneVisible(t)},O.prototype.hideRow=function(t,e){return!!this._trackY.hideLane(t,e)&&(null!=e&&!e||this.isRowVisible(t)?this.isRowVisible(t)&&this._hiddenRowCount--:this._hiddenRowCount++,this._syncLayoutToRows(t,this._rowCount),this._dispatchRowHeightChangedEvent(t,t+1),!0)},O.prototype.getMinimumColumnWidth=function(t){return this._trackX.getMinimumLaneSize(t)},O.prototype.setMinimumColumnWidth=function(t,e){return!!this._trackX.setMinimumLaneSize(t,e)&&(this._syncLayoutToColumns(t),!0)},O.prototype.getMinimumRowHeight=function(t){return this._trackY.getMinimumLaneSize(t)},O.prototype.setMinimumRowHeight=function(t,e){return!!this._trackY.setMinimumLaneSize(t,e)&&(this._syncLayoutToRows(t,this._rowCount),this._dispatchRowHeightChangedEvent(t,t+1),!0)},O.prototype.getCellLeft=function(t){return this._trackX.getLaneStart(t)},O.prototype.getCellTop=function(t){return this._trackY.getLaneStart(t)},O.prototype.getCellWidth=function(t,e){var i=this._cellSpans.getOccupyingSpan(t,e);if(i){var o=this._trackX.getLaneStart(i.indexX);return this._trackX.getLaneEnd(i.indexX+i.colSpan-1)-o}return this.getColumnWidth(t)},O.prototype.getCellHeight=function(t,e){var i=this._cellSpans.getOccupyingSpan(t,e);if(i){var o=this._trackY.getLaneStart(i.indexY);return this._trackY.getLaneEnd(i.indexY+i.rowSpan-1)-o}return this.getRowHeight(e)},O.prototype.hasCellSpan=function(){return this._cellSpans.hasSpan()},O.prototype.getCellRowSpan=function(t,e){return this._cellSpans.getRowSpan(t,e)},O.prototype.setCellRowSpan=function(t,e,i){var o=this._cellSpans.setRowSpan(t,e,i);if(this._updateCellSpanSize(t,e,o),o)return o.retVal>=0?this._updateCellSpanClass(t,e,o.colSpan,o.rowSpan,!0):o.colSpan>1?(this._updateCellSpanClass(t,e,o.colSpan,o.prevRowSpan,!1),this._updateCellSpanClass(t,e,o.colSpan,o.rowSpan,!0)):this._updateCellSpanClass(t,e,o.colSpan,o.prevRowSpan,!1),0!==o.retVal;var n=this._getCell(t,e);return n&&n._rowSpan>1&&this._updateCellSpanClass(t,e,n._colSpan,n._rowSpan,!1),!1},O.prototype.getCellColSpan=function(t,e){return this._cellSpans.getColSpan(t,e)},O.prototype.setCellColSpan=function(t,e,i){var o=this._cellSpans.setColSpan(t,e,i);if(this._updateCellSpanSize(t,e,o),o)return o.retVal>=0?this._updateCellSpanClass(t,e,o.colSpan,o.rowSpan,!0):o.colSpan>1?(this._updateCellSpanClass(t,e,o.prevColSpan,o.rowSpan,!1),this._updateCellSpanClass(t,e,o.colSpan,o.rowSpan,!0)):this._updateCellSpanClass(t,e,o.prevColSpan,o.rowSpan,!1),0!==o.retVal;var n=this._getCell(t,e);return n&&n._colSpan>1&&this._updateCellSpanClass(t,e,n._colSpan,n._rowSpan,!1),!1},O.prototype.clearCellSpans=function(){var t=this._cellSpans.clearAllSpans();if(null==t)return!1;for(var e=t.length;--e>=0;){var i=t[e];this._updateCellSpan(i.indexX,i.indexY,i,!1)}return!0},O.prototype.clearColumnSpans=function(t){var e=this._cellSpans.removeSpanByColIndex(t);if(null==e)return!1;for(var i=e.length;--i>=0;){var o=e[i];this._updateCellSpan(o.indexX,o.indexY,o,!1)}return!0},O.prototype.clearColumnCustomizations=function(){this._trackX.clearLaneCustomizations(),this._syncLayoutToColumns(0)},O.prototype.clearRowCustomizations=function(){this._trackY.clearLaneCustomizations(),this._syncLayoutToRows(0,this._rowCount)},O.prototype.getColumnScalability=function(t){return this._trackX.getLaneScalability(t)},O.prototype.setColumnScalability=function(t,e){return this._trackX.setLaneScalability(t,e)},O.prototype.getRowScalability=function(t){return this._trackY.getLaneScalability(t)},O.prototype.setRowScalability=function(t,e){return this._trackY.setLaneScalability(t,e)},O.prototype.getCell=function(t,e,i){if(i&&this._cellSpans.hasSpan()){var o=this._cellSpans.getColSpan(t,e),n=this._cellSpans.getRowSpan(t,e);o<0&&(t+=o),n<0&&(e+=n)}return this._getCell(t,e)},O.prototype.getCellContent=function(t,e){var i=this.getCell(t,e);return null!==i?i.getContent():null},O.prototype.setCellContent=function(t,e,i){var o=this.getCell(t,e);return null==o?(window.console.log("Error: Accessing nonexistent cell in Grid's Table"),null):o.setContent(i)},O.prototype.getColumnCount=function(){return this._colCount},O.prototype.setColumnCount=function(t){if(t<0&&(t=0),this._colCount!==t){var e=this._colCount;this._trackX.setLaneCount(t),this._colCount=this._trackX.getLaneCount();var i=0,o=null;if(e>t)for(i=e;--i>=t;)(o=this._columns.pop()).dispose(),o===this._firstColumn&&(this._firstColumn=null),o===this._lastColumn&&(this._lastColumn=null);else for(i=e;i<t;++i)o=this._newColumn(i);for(this._updateColumnIndices(),i=e;i<t;++i)this._columns[i].activate(!this._colVir);t<=0&&this._selectionList.clearAllSelections()}},O.prototype.getRowCount=function(){return this._rowCount},O.prototype.setRowCount=function(t,e){if(t<0&&(t=0),this._rowCount!==t){var i,o=this._rowCount;for(this._trackY.setLaneCount(t),this._rowCount=this._trackY.getLaneCount(),this._ctxRows.setItemCount(t),this._stretchedCells.setCellCount(t),i=0;i<this._colCount;++i)this._columns[i].setCellCount(t);if(o>t)if(t<this._rowHighlightIndex&&this.setRowHighlight(-1),t<this._activeRowEnd&&(this._activeRowEnd=t),t<this._availableRowCount&&(this._availableRowCount=t),this._cellSpans.removeSpanStartedFromRowIndex(t),this._updateViewHeight(),t>0)for(var n=t;n<o;++n)this._selectionList.deselect(n);else this._selectionList.clearAllSelections();else this._syncLayoutToRows(o,t);var r={};r.prevCount=o,r.rowCount=this._rowCount,this._dispatch("rowCountChanged",r),o<t&&this._insertCells(0,this._rowCount)}},O.prototype.getVisibleRowCount=function(){return this._rowCount-this._hiddenRowCount},O.prototype.addRow=function(t){t<=0||(this._colCount<=0?window.console.log("WARNING: Row cannot be added, unless at least one column is added"):this.setRowCount(this._rowCount+t))},O.prototype.removeRow=function(t){t<=0||(t>this._rowCount&&(t=this._rowCount),this.setRowCount(this._rowCount-t))},O.prototype.setBorders=function(t,e,i,o){},O.prototype.getColumnStyle=function(t,e){var i=this._columns[t];return i?i.getStyle(e):null},O.prototype.setColumnStyle=function(t,e,i){var o=this._columns[t];o&&o.setStyle(e,i)},O.prototype.enableColumnClass=function(t,e,i){var o=this._columns[t];o&&o.enableClass(e,i)},O.prototype.hasColumnClass=function(t,e){var i=this._columns[t];return!!i&&i.hasClass(e)},O.prototype.enableRowClass=function(t,e,i){if(t>=0&&t<this._rowCount)for(var o=0;o<this._colCount;++o)this._columns[o].getCell(t).enableClass(e,i)},O.prototype.setRowStyle=function(t,e,i,o){if(t>=0&&t<this._rowCount){i&&(null==o||o)||(i="");for(var n=0;n<this._colCount;++n)this._columns[n].getCell(t).setStyle(e,i)}},O.prototype.getRelativePosition=function(t){return i.getRelativePosition(t,this._element)},O.prototype.getContentWidth=function(){return this._trackX.getTrackSize()},O.prototype.getContentHeight=function(){var t=this._trackY.getTrackSize();if(t<=0&&this._colCount*this.getVisibleRowCount()>0){var e=this._columns[0],i=e.getCell(this._rowCount-1);return i.getTop()+i.getHeight()-e.getCell(0).getTop()}return t},O.prototype.getCellsByRowIndex=function(t){if(t<0||t>=this._rowCount)return null;for(var e=new Array(this._colCount),i=0;i<this._colCount;++i)e[i]=this._columns[i].getCell(t);return e},O.prototype.disableHorizontalGridLine=function(t){this.enableClass("no-horizontal-grid-line",!1!==t)},O.prototype.disableVerticalGridLine=function(t){this.enableClass("no-vertical-grid-line",!1!==t)},O.prototype.enableShading=function(t){!1!==t?this.addClass("tr-even-shading"):(this.removeClass("tr-even-shading"),this.removeClass("tr-odd-shading"))},O.prototype.setTransposedShading=function(t){this.enableClass("transposed-shading",!1!==t)},O.prototype.enableRowHighlighting=function(t){null==t&&(t=!0),this._rowHighlightEnabled!==t&&(this._rowHighlightEnabled=t,this._rowHighlightEnabled?(this.listen("mousemove",this._onMouseMove),this.listen("mouseout",this._onMouseOut)):(this.setRowHighlight(-1),this.unlisten("mousemove",this._onMouseMove),this.unlisten("mouseout",this._onMouseOut)))},O.prototype.getRowHighlight=function(){return this._rowHighlightIndex},O.prototype.setRowHighlight=function(t){if((!this._rowHighlightEnabled||t<-1||t>=this._rowCount)&&(t=-1),this._rowHighlightIndex!==t){var e=this._rowHighlightIndex;this._rowHighlightIndex=t;for(var i=this._highlightedCells.length;--i>=0;)this._highlightedCells[i].removeClass("highlighted-row");if(t>=0&&t<this._rowCount){this._highlightedCells.length=this._colCount;for(var o=this._colCount;--o>=0;){var n=this._columns[o].getCell(t);this._highlightedCells[o]=n,n.addClass("highlighted-row")}}else this._highlightedCells.length=0;if(this._hasListener("rowHighlighted")){var r={};r.prevRowIndex=e,r.rowIndex=t,this._dispatch("rowHighlighted",r)}}},O.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},O.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},O.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},O.prototype.setSelectedRow=function(t,e){t<0||t>=this._rowCount||(this._selectionList.setSelection(t,e),this._updateSelectionUI(t))},O.prototype.selectSingleRow=function(t){t<0||t>=this._rowCount||(this.clearSelectedRows(),this._selectionList.select(t),this._addSelectionUI(t))},O.prototype.selectRowRange=function(t,e){if(!(t<0||t>=this._rowCount)){t+e>this._rowCount&&(e=this._rowCount-t),this._selectionList.selectRange(t,e);for(var i=0;i<e;++i)this._addSelectionUI(i+t)}},O.prototype.clearSelectedRows=function(){var t=this._selectionList.getSelectionCount();if(t){var e=this._selectionList.getAllSelections();this._selectionList.clearAllSelections();for(var i=0;i<t;++i)this._removeSelectionUI(e[i]);return t}return 0},O.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},O.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},O.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},O.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},O.prototype.activateColumn=function(t,e){var i=this._columns[t];if(i){var o=i.activate(e);if(e&&o&&this._rightSpace){var n=this._rightSpace.parentNode;n&&n.appendChild(this._rightSpace)}}},O.prototype.activateRows=function(){this._onEnterDocument()},O.prototype.moveRowsToTop=function(t){this._ctxRows.moveItemsToTop(t),this._stretchedCells.moveCellsToTop(t);for(var e=0;e<this._colCount;++e)this._columns[e].moveCellsToTop(t)},O.prototype.getFirstIndexInView=function(){return 0},O.prototype.getLastIndexInView=function(){return this._availableRowCount-1},O.prototype.isInCurrentView=function(t){return 0!==this._rowCount&&t>=0&&t<this._rowCount},O.prototype.getFrozenLayout=function(){return this._frozenLayout},O.prototype.setFrozenLayout=function(t){this.isVisible()||(t=!0),this._frozenLayout!==t&&(this._frozenLayout=t,this._frozenLayout||(this._syncLayoutToColumns(0),this._syncLayoutToRows(0,this._rowCount),this._dispatchRowHeightChangedEvent(0,this._rowCount)))},O.prototype.getColumn=function(t){return this._columns[t]||null},O.prototype.insertColumn=function(t,e){t<0?t=0:t>this._colCount&&(t=this._colCount);var i=t<this._colCount,o=this._cellSpans.getAllSpans();this._updateCellSpans(o,!1),this._trackX.insertLane(t,e),this._colCount=this._trackX.getLaneCount();var n=this._newColumn(t);if(this._updateColumnIndices(),this._cellSpans.shiftColumn(t,1)&&(o=this._cellSpans.getAllSpans()),this._updateCellSpans(o,!0),this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._selectionList.getSelectionCount())for(var r=this._selectionList.getAllSelections(),s=r.length;--s>=0;){var l=n.getCell(r[s]);l&&l.addClass("selected-row")}return n.activate(i||!this._colVir),n},O.prototype.removeColumnAt=function(t){var e=this._trackX.removeLaneAt(t);if(null==e)return null;var i=this._cellSpans.getAllSpans();this._updateCellSpans(i,!1),this._colCount=this._trackX.getLaneCount();var o=this._columns.splice(t,1)[0];return o.dispose(),e.control=o,this._updateColumnIndices(),this._cellSpans.removeColumn(t)&&(i=this._cellSpans.getAllSpans()),this._updateCellSpans(i,!0),this._syncLayoutToColumns(t),t>=this._colCount&&this._updateCssWidth(),e},O.prototype.moveColumn=function(t,e){if(t<0)t=0;else if(t>=this._colCount)return;if(e<0?e=0:e>=this._colCount&&(e=this._colCount-1),t!==e){var o=this._cellSpans.getAllSpans();this._updateCellSpans(o,!1),this._trackX.moveLane(t,e);var n=this._columns[t];i.moveArrayItem(this._columns,t,e);var r=this._columns[e+1]||null;n.insertBefore(r),this._updateColumnIndices(),this._updateCellSpans(o,!0);var s=t<e?t:e;this._syncLayoutToColumns(s)}},O.prototype.enableRowVirtualization=function(){console.log("WARNING: This function is deprecated")},O.prototype.enableColumnVirtualization=function(t){this._colVir=!1!==t},O.prototype.getColumnIndex=function(t){if(t){if(t.stretched)return this._stretchedCells.getColumnIndex(t);for(var e=this._columns.length,i=0;i<e;++i)if(this._columns[i].getElement()===t)return i}return-1},O.prototype.getCellIndex=function(t,e){if(e){if(e.stretched)return this._stretchedCells.getRowIndex(e);var i=this._columns[t];if(i)return i.getCellIndex(e)}return-1},O.prototype.getIndex=function(){return this._index},O.prototype.setIndex=function(t){this._index=t},O.prototype.getRowOffset=function(){return this._rowOffset},O.prototype.setRowOffset=function(t){this._rowOffset=t},O.prototype.updateLayout=function(){this._calculateViewSize(!0),this._updateRightSpaceStyle()},O.prototype.stretchCell=function(t,e,i,o){var n=-1;if("number"==typeof t?(n=t,null==e&&(e=0)):t&&(t.stretched?(n=this._stretchedCells.getColumnIndex(t),null==e&&(e=this._stretchedCells.getRowIndex(t))):t.getParent&&(n=this.getColumnIndex(t.getParent()))),n<0||e<0||null==e)return null;var r=null;if(!1!==i){var s=this._coverLayer;s||((s=this._coverLayer=document.createElement("div")).className="cover-layer",this._updateLayers()),this._calculateViewSize(),(r=this._stretchedCells.stretchCell(e,o?n:0)).setParent(s)}else r=this._stretchedCells.unstretchCell(e);return r},O.prototype.unstretchCell=function(t,e){return this.stretchCell(t,e,!1)},O.prototype.unstretchAllCells=function(){this._stretchedCells.unstretchAllCells()},O.prototype.getStretchedCell=function(t,e){return null==e&&(e="number"==typeof t?t:this._stretchedCells.getRowIndex(t)),"number"==typeof e?this._stretchedCells.getCell(e):null},O.prototype.getStretchedCells=function(){return this._stretchedCells.getCells()},O.prototype.updateStretchedCells=function(){this._updateLayers();var t=this._coverLayer?this._coverLayer.children.length:0;return!(t<=0||(this._calculateViewSize(!0),this._stretchedCells.updateCells(),!t))},O.prototype._calculateViewSize=function(t){var e=this._ctx,i=t?0:this._stretchedCells.getStretchSize();if(!i&&e&&e.getWidth){var o=this.getContentWidth();return(i=e.getWidth())?(e.hasClass("no-borders")||(i-=1),o<i&&(i=o),this._stretchedCells.setStretchSize(i),i):o}return i},O.prototype._getViewSize=function(){return this._calculateViewSize()},O.prototype.getColumnHost=function(){return this._element},O.prototype.setHidingMethod=function(t){this._hidingMethod=t},O.prototype.getHidingMethod=function(){return this._hidingMethod},O.prototype.setColumnVisibility=function(t,e,i){return!!this._trackX.hideLane(t,!e,i)&&(this._syncLayoutToColumns(t),!0)},O.prototype.getRowLayout=function(){return this._trackY},O.prototype.reserveRightSpace=function(t){if(t&&t>0){if(!this._rightSpace){var e=this._rightSpace=document.createElement("div");e.className="tr-reserved-space",e.style.height=this.getContentHeight()+"px",this._updateLayers()}this._rightSpace.style.width=t+"px",this._rightSpaceSize=t,this._updateCssWidth()}else if(this._rightSpace){var i=this._rightSpace.parentNode;i&&i.removeChild(this._rightSpace),this._rightSpace=null,this._rightSpaceSize=0,this._updateCssWidth()}return this._rightSpace},O.prototype._updateRightSpaceStyle=function(){var t=this._rightSpace;if(t){var e=!1,i=0;this._hscrollbar&&(e=this._hscrollbar.isActive(),i=this._hscrollbar.getPinnedRightColumnCount()),e&&!i?(t.style.top=this._trackY.getLaneStart(this._activeRow)+"px",t.style.left=this._trackX.getLaneStart(this._colCount)+"px",t.style.position="",t.style.display=""):(t.style.position="static",t.style.display="inline-block")}},O.prototype._updateLayers=function(){if(this._rightSpace){var t=this._rightSpace.parentNode;t?t.appendChild(this._rightSpace):this._element.appendChild(this._rightSpace)}this._boundLayer&&this._element.appendChild(this._boundLayer),this._coverLayer&&this._element.appendChild(this._coverLayer)},O.prototype.getReservedSpace=function(){return this._rightSpace},O.prototype.getComputedStyle=function(){var t=this._element;return t.offsetParent?getComputedStyle(t):null},O.prototype.isColumnActive=function(t){var e=this._columns[t];return!!e&&e.isActive()},O.prototype.setRowAttributes=function(t,e){if(!(t<0||t>=this._rowCount))for(var i=0;i<this._colCount;++i)for(var o=e(i),n=o.length;--n>=0;){var r=o[n],s=this._columns[i].getCell(t);s&&(r.remove?s.removeAttribute(r.attribute):s.setAttribute(r.attribute,r.value))}},O.prototype.getContextRow=function(t){return this._ctxRows.getItem(t)},O.prototype.selectColumn=function(t,e){this.enableColumnClass(t,"selected-column",e);var i=this._columnBound;i||((i=this._columnBound=document.createElement("div")).className="selection-bound column-bound");var o=this._boundLayer;o||((o=this._boundLayer=document.createElement("div")).className="cover-layer",this._updateLayers())},O.prototype.isSelectedColumn=function(t){return this.hasColumnClass(t,"selected-column")},O.prototype.selectCell=function(t,e,i){var o=this._getCell(t,e);o&&o.enableClass("selection",i)},O.prototype.setCellBounds=function(t,e,i,o){},O.prototype.getHorizontalLayout=function(){return this._trackX},O.prototype.calculateColumnBounds=function(t,e,i,o){var n=0,r=0,s=!1,l=!1,a=this._trackX.getLaneCount();if(t>=0&&(n=this._trackX.getLaneStart(t),r=this._trackX.getLaneEnd(e)),n<r){var h,u,p=0,_=0,d=0,c=0;this._hscrollbar&&(_=this._hscrollbar.getScrollLeft(),d=this._hscrollbar.getPinnedLeftColumnCount(),c=this._hscrollbar.getPinnedRightColumnCount()),h=u=this._trackX.getTrackSize(),d&&(p=this._trackX.getLaneStart(d)),c&&(a-=c,h=this._getViewSize()-u+this._trackX.getLaneStart(a)),t>=d&&t<a?(n-=_)<p?(n=p,s=!0):n>h&&(n=h,s=!0):t>=a&&(n=this._getViewSize()-u+this._trackX.getLaneStart(t)),e>=d&&e<a?(r-=_)<p?(r=p,l=!0):r>h&&(r=h,l=!0):e>=a&&(r=this._getViewSize()-u+this._trackX.getLaneEnd(e))}i[0]=n,i[1]=r,o[0]=s,o[1]=l},O.prototype.updateColumnBounds=function(t,e){var i=this._columnBound;if(i){var o=t[0],n=t[1];if(o>=n){var r=i.parentNode;r&&r.removeChild(i)}else i.style.left=o+"px",i.style.width=n-o+"px",i.style.height=this._trackY.getTrackSize()+"px",i.classList.toggle("no-left-bound",e[0]),i.classList.toggle("no-right-bound",e[1]),this._boundLayer&&this._boundLayer.appendChild(i)}},O.prototype._getCell=function(t,e){var i=this._columns[t];return i?i.getCell(e):null},O.prototype._insertCells=function(t,e){this._activeRow=t,this._activeRowEnd=e;for(var i=this._trackY.getLaneStart(t),o=0;o<this._colCount;++o){var n=this._columns[o];n.hasCollapsedCells()||n.setTop(i),n.activateCells(t,e)}if(this._rightSpace&&(this._rightSpace.style.top=i+"px"),e>this._availableRowCount){var r={};r.prevRowIndex=this._availableRowCount,r.rowIndex=e,this._availableRowCount=e,this._dispatch("rowAvailable",r)}},O.prototype._newColumn=function(t){var e=new S(this._virOwner||this);e.setHeight(this._trackY.getDefaultLaneSize()),e.setCellCount(this._rowCount),e.setTop(this._trackY.getLaneStart(this._activeRow)),e.activateCells(this._activeRow,this._activeRowEnd);for(var i=0;i<this._rowCount;++i)this._trackY.isAtDefaultSize(i)||e.getCell(i).setHeight(this._trackY.getLaneSize(i));if(t>=this._columns.length)this._columns.push(e),e.setParent(this._element);else{this._columns.splice(t,0,e);var o=this._columns[t+1];e.insertBefore(o)}return e},O.prototype._updateCssWidth=function(){this._frozenLayout||(this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._element.style.width=this._getWidth()+"px")},O.prototype._updateViewHeight=function(){if(!this._frozenLayout){var t=this.getContentHeight();this._element.style.height=t+"px",this._rightSpace&&(this._rightSpace.style.height=t+"px")}},O.prototype._updateColumnIndices=function(){var t=this._columns.length,e=this._columns[0];e!==this._firstColumn&&(this._firstColumn&&this._firstColumn.removeClass("first"),this._firstColumn=e,this._firstColumn&&this._firstColumn.addClass("first"));var i=this._columns[t-1];i!==this._lastColumn&&(this._lastColumn&&this._lastColumn.removeClass("last"),this._lastColumn=i,this._lastColumn&&this._lastColumn.addClass("last"));for(var o=null,n=this._columns.length;--n>=0;){var r=this._columns[n];r.setNextSibling(o),o=r}},O.prototype._syncLayoutToColumns=function(t){if(this._frozenLayout)return!1;if(this._rightSpace&&(this._rightSpace.style.left=this._trackX.getLaneStart(this._colCount)+"px"),t>=this._colCount)return!1;for(var e=t;e<this._colCount;++e){var i=this._columns[e];i.setLeft(this._trackX.getLaneStart(e)),i.setWidth(this._trackX.getLaneSize(e))}return this._updateCellSpanLayout(this._cellSpans.getAllSpans()),this._updateCssWidth(),!0},O.prototype._syncLayoutToRows=function(t,e){if(!this._frozenLayout){for(var i=t;i<e;++i)for(var o=this._trackY.isAtDefaultSize(i)?-1:this._trackY.getLaneSize(i),n=0;n<this._colCount;++n)this._columns[n].getCell(i).setHeight(o);this._stretchedCells.updateYAxis(),t?this._updateCellSpanLayout(this._cellSpans.getAllSpans()):this._updateCellSpans(this._cellSpans.getAllSpans(),!0),this._updateViewHeight()}},O.prototype._dispatchRowHeightChangedEvent=function(t,e){if(this._hasListener("rowHeightChanged")&&!(t>=e)){var i={};i.rowIndex=t,i.changeLength=e-t,this._dispatch("rowHeightChanged",i)}},O.prototype._updateCellSpanSize=function(t,e,i){var o=this._getCell(t,e);if(null!=o)if(i&&i.colSpan>1?(o.setWidth(this.getCellWidth(t,e)),this._columns[t].disableDeactivation()):o.setWidth(-1),i&&i.rowSpan>1)o.setHeight(this.getCellHeight(t,e));else{var n=this._trackY.isAtDefaultSize(e)?-1:this._trackY.getLaneSize(e);o.setHeight(n)}},O.prototype._updateCellSpanLayout=function(t){if(null!=t)for(var e=t.length;--e>=0;){var i=t[e];this._updateCellSpanSize(i.indexX,i.indexY,i)}},O.prototype._updateCellSpan=function(t,e,i,o){this._updateCellSpanSize(t,e,o?i:null),this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,o)},O.prototype._updateCellSpanClass=function(t,e,i,o,n){for(var r,s=0;s<i&&(r=this._columns[t+s]);++s)r.collapseCells(e,o,n,0===s,s>0);var l=this._getCell(t,e);l&&(l._colSpan=n?i:1,l._rowSpan=n?o:1)},O.prototype._updateCellSpans=function(t,e){if(null!=t)for(var i=t.length;--i>=0;){var o=t[i];this._updateCellSpan(o.indexX,o.indexY,o,e)}},O.prototype._onMouseMove=function(t){var e=t.target,o=i.closestElement(e,"column"),n=this.getColumnIndex(o),r=n>=0?i.closestElement(e,"cell"):null;this.setRowHighlight(this.getCellIndex(n,r))},O.prototype._onMouseOut=function(t){var e=t.relatedTarget;if(e)for(var i=this._element;null!==e.parentNode;)if((e=e.parentNode)===i)return;this.setRowHighlight(-1)},O.prototype._updateSelectionUI=function(t){for(var e=this._selectionList.getSelection(t),i=0;i<this._colCount;++i){var o=this._columns[i].getCell(t);o&&o.enableClass("selected-row",e)}},O.prototype._addSelectionUI=function(t){for(var e=0;e<this._colCount;++e){var i=this._columns[e].getCell(t);i&&i.addClass("selected-row")}},O.prototype._removeSelectionUI=function(t){for(var e=0;e<this._colCount;++e){var i=this._columns[e].getCell(t);i&&i.removeClass("selected-row")}},O.prototype._onEnterDocument=function(){if(!this._initialized&&this.getParent()){for(var t=0;t<this._colCount;++t)this._columns[t].enableAutoStyleUpdating();this._syncLayoutToColumns(0),this._initialized=!0}},O.prototype._setContext=function(t){this._ctx=t},O.prototype._getContext=function(){return this._ctx},O.prototype._resetTransformIETimer=function(){i.isIE&&(this._transformIETimer||(this.enableClass("reset-transform"),this._transformIETimer=setTimeout(this._onResetTransformIE,20)))},O.prototype._onResetTransformIE=function(){this._transformIETimer=0,this.enableClass("reset-transform",!1)},O._proto=O.prototype;const B=O;var N=function(){var t=this;t._rows={},t._subs={},t._staticFields={},t._onInsert=t._onInsert.bind(t),t._onUpdate=t._onUpdate.bind(t),t._onDelete=t._onDelete.bind(t),t._onBatchRequestADCData=t._onBatchRequestADCData.bind(t),t._onADCUpdate=t._onADCUpdate.bind(t),t._onADCError=t._onADCError.bind(t),t._onQ2DataChanged=t._onQ2DataChanged.bind(t),t._onQ2SubAdded=t._onQ2SubAdded.bind(t),t._onQ2SubRemoved=t._onQ2SubRemoved.bind(t),t._addEvent("dataComposed"),t._addEvent("dataChanged")};h.inherits(N,s),N.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._quotes2=null},N.prototype.setSubscriptions=function(t){this._quotes2&&(this._quotes2.removeEventListener("dataChanged",this._onQ2DataChanged),this._quotes2.removeEventListener("subscriptionAdded",this._onQ2SubAdded),this._quotes2.removeEventListener("subscriptionRemoved",this._onQ2SubRemoved)),this._quotes2=t,this._quotes2&&(this._quotes2.addEventListener("dataChanged",this._onQ2DataChanged),this._quotes2.addEventListener("subscriptionAdded",this._onQ2SubAdded),this._quotes2.addEventListener("subscriptionRemoved",this._onQ2SubRemoved))},N.prototype.getSubscriptions=function(){return this._quotes2},N.prototype.addSubscription=function(t,e,i){if(!this.getSubscription(t.id)){var o={s:t,rics:{}};this._subs[t.id]=o,this._quotes2||(t.onNewRow(this._onInsert),t.onUpdate(this._onUpdate),t.onRemoveRow(this._onDelete)),e&&(o.primary=e,i||(i={}),this._onInsert(t,e,i))}},N.prototype.removeSubscription=function(t){var e=t.id;if(t&&this._subs[e]){this._quotes2||t.stop();var i=this._subs[e].rics;for(var o in i)this.setRowData(e+o,null);delete this._subs[e]}},N.prototype.startAllSubscriptions=function(){if(this._quotes2)this._quotes2.start();else for(var t in this._subs)this._subs[t].s.start()},N.prototype.stopAllSubscriptions=function(){if(this._quotes2)this._quotes2.stop();else for(var t in this._subs)this._subs[t].s.stop()},N.prototype.getSubscription=function(t){return this._subs[t]?this._subs[t].s:null},N.prototype.getPrimaryRic=function(t){var e=this._subs[t];return e?e.primary:""},N.prototype.clearAllData=function(t){this._quotes2?this._quotes2.removeAllSubscriptions():this.stopAllSubscriptions(),this._subs={},this._rows={},this._adcTimerId>=0&&(clearTimeout(this._adcTimerId),this._adcTimerId=-1),this._adcRicMap=null,t||this._dispatchDataChange({globalChange:!0})},N.prototype.clearColumnData=function(t,e){for(var i="string"==typeof t?[t]:t,o=i.length;--o>=0;){var n=i[o];if(n)for(var r in this._rows)delete this._rows[r][n]}e||this._dispatchDataChange({globalChange:!0})},N.prototype.getData=function(t,e){var i=this.getRowData(t);return i?i[e]:null},N.prototype.getAllRics=function(){var t={};for(var e in this._subs){var i=this._subs[e].rics;for(var o in i)t[o]||(t[o]=[]),t[o].push(e)}return t},N.prototype.getAllRowIds=function(){var t=[];for(var e in this._rows)t.push(e);return t},N.prototype.hasRowId=function(t){return!!this._rows[t]},N.prototype.getColumnData=function(t){var e=[];for(var i in this._rows)e.push(this._rows[i][t]);return e},N.prototype.getRowData=function(t){return this._rows[t]||null},N.prototype.getMultipleRowData=function(t,e,i){var o=t.length;null==i&&(i=o),i>o&&(i=o),e>0||(e=0);for(var n=new Array(o),r=this._rows,s=e;s<i;++s)n[s]=r[t[s]]||null;return n},N.prototype.getAllRowData=function(){var t=[],e=this._rows;for(var i in e)t.push(e[i]);return t},N.prototype.setData=function(t,e,i){var o={};return o[e]=i,this.setRowData(t,o)},N.prototype.hasDataCloudData=function(t){if(!this._adcFields)return!1;var e=this.getRowData(t);if(!e)return!1;for(var i=this._adcFields.length;--i>=0;)if(null!=e[this._adcFields[i]])return!0;return!1},N.prototype.setRowData=function(t,e,i){var o=this.getRowData(t),n=!1,r=null;if(e)if(o){for(var s in e)o[s]=e[s],n=!0;r=e}else o=e,this._rows[t]=o,n=!0;else o&&(delete this._rows[t],n=!0);if(n&&!this._composing){var l=i||{};l.rid=t,r&&(l.changes=r),l.rowData=o,this._dispatchDataChange(l)}return n},N.prototype.cloneRowData=function(t){var e=this._rows[t];if(!e)return null;var i={};for(var o in e)0!==o.indexOf("FREE_TEXT")&&(i[o]=e[o]);return i},N.prototype.addStaticFields=function(t){if(Array.isArray(t))for(var e in t)this._staticFields[t[e]]?this._staticFields[t[e]]++:this._staticFields[t[e]]=1},N.prototype.removeStaticFields=function(t){if(Array.isArray(t))for(var e in t)this._staticFields[t[e]]&&(this._staticFields[t[e]]--,0===this._staticFields[t[e]]&&delete this._staticFields[t[e]])},N.prototype.resetStaticFields=function(){this._staticFields={}},N.prototype.getStaticFields=function(){return this._staticFields},N.prototype.dump=function(t){return N.constructTable(this.getAllRowData(),t,Object.keys(this._rows))},N.prototype.log=function(t){console.table(this.dump(t))},N.prototype.setDataCloudSettings=function(t,e,i,o){null!=t&&(this._userId=t),null!=e&&(this._productId=e),null!=i&&(this._adcUrl=i),o&&(this._lang=o)},N.prototype.getDataCloudFields=function(){return this._adcFields},N.prototype.addDataCloudFields=function(t){this._adcFields||(this._adcFields=[],this._adcRefMap={});var e=[];if(t instanceof Array)for(var i=t.length;--i>=0;)this._addDataCloudField(t[i],e);else this._addDataCloudField(t,e);if(e.length<=0)return!1;var o=this.getAllRics();return this._batchRequestDataCloud(o,e),!0},N.prototype.removeDataCloudField=function(t){if(!this._adcFields)return!1;if(!this._adcRefMap[t])return!1;if(--this._adcRefMap[t],!this._adcRefMap[t]){var e=this._adcFields.indexOf(t);this._adcFields.splice(e,1),this.clearColumnData(t)}return!0},N.prototype._dispatchDataChange=function(t){this._composing||(this._composing=!0,this._dispatch("dataComposed",t),this._composing=!1,this._dispatch("dataChanged",t))},N._defaultPropertyGetter=function(t,e,i){var o=e[i];return o?o[t]:null},N._defaultGetter=function(t,e){return t[e]},N.constructTable=function(t,e,i){var o=0,n=t.length,r=n,s=null,l=i||null,a=N._defaultGetter,h=!1;if(e){if(e.rowCount&&(r=e.rowCount,h=!0),e.colNames){s={};for(var u=e.colNames.length,p=0;p<u;++p)s[e.colNames[p]]=!0;h=!0}e.getter&&(a="string"==typeof e.getter?N._defaultPropertyGetter.bind(null,e.getter):e.getter,h=!0),e.startIndex&&(o=e.startIndex,h=!0),!1===e.withRowIds&&(l=null)}if(!h&&!l)return t;for(var _=[],d=o;d<n&&!(_.length>=r);++d){var c,g=t[d],f=l?{rid:l[d]}:{};if(g)if(s)for(c in s)null!=g[c]&&(f[c]=a(g,c));else for(c in g)f[c]=a(g,c);_.push(f)}return _},N.prototype._insertRic=function(t,e,i){var o=t+(e=e.replace("0#",""));if(this._onADCForNewRic(t,e),!this.getRowData(o)){var n=i;for(var r in i={},n)i[r]=n[r];i.SUB_ID=t,i.RIC=e}this.setRowData(o,i)},N.prototype._onQ2DataChanged=function(t){var e=t.subId,i=t.ric,o=t.values;o?this._insertRic(e,i,o):(delete this._subs[e].rics[i],this.setRowData(e+i,null))},N.prototype._onQ2SubAdded=function(t){for(var e=t.subs,i=t.duplicateSubIds,o=e.length,n=0;n<o;++n){var r=e[n],s=r.ric;if(this.addSubscription(r,s),i){var l=i[n];l&&window.setTimeout(this._onDuplicateRic.bind(this,r.id,this.getRowData(l+s)),10)}}},N.prototype._onQ2SubRemoved=function(t){for(var e=t.subs,i=e.length,o=0;o<i;++o){var n=e[o];this.removeSubscription(n)}},N.prototype._onADCForNewRic=function(t,e){var i=this._subs[t];i&&(this._adcFields&&(i.rics[e]||(this._adcTimerId<0&&(this._adcRicMap={},this._adcTimerId=setTimeout(this._onBatchRequestADCData,100)),this._adcRicMap[e]||(this._adcRicMap[e]=[]),this._adcRicMap[e].push(t))),i.rics[e]=!0)},N.prototype._onDuplicateRic=function(t,e){var i=this._subs[t];if(i){var o=(i=i.s).ric,n=e.SUB_ID,r=this._cloneRowData(e,o,t);if(r){this._onInsert(i,o,r);var s=i.children;if(s)for(var l=s.length,a=0;a<l;++a)o=s[a],r=this._cloneRowData(n,o,t),this._onInsert(i,o,r)}}},N.prototype._onInsert=function(t,e,i){var o=t.id;this._quotes2?this._insertRic(o,e,i):(this._onADCForNewRic(o,e),this.setRowData(o+e,i,{subscription:t,ric:e}))},N.prototype._onUpdate=N.prototype._onInsert,N.prototype._onDelete=function(t,e,i){delete this._subs[t.id].rics[e],this.setRowData(t.id+e,null,{subscription:t,ric:e})},N.prototype._addDataCloudField=function(t,e){this._adcRefMap[t]?++this._adcRefMap[t]:(this._adcFields.push(t),e.push(t),this._adcRefMap[t]=1)},N.prototype._onADCUpdate=function(t){var e=t.currentTarget,i=null;try{i=JSON.parse(e.responseText)}catch(t){return}if("Ok"===i.status){for(var o=i.cols,n=i.rows,r=n[0],s=-1,l={},a=0;a<o;++a){var h=r[a];"instrument"===h.i?s=a:h.r&&(l[h.r]=a)}for(var u=n.length,p=1;p<u;++p){var _=n[p],d=_[s],c={};for(var g in l){var f=_[l[g]];null!=f&&null!==f&&null==f.f&&(this._quotes2?(c[g]=f,c[g+"_FORMATTED"]=f):c[g]={formatted:f+"",raw:f})}var y=e.ricMap[d];if(y)for(a=y.length;--a>=0;){var m=y[a];this._subs[m]&&this.setRowData(m+d,c)}}}},N.prototype._onADCError=function(t){window.console.log(t)},N.prototype._onBatchRequestADCData=function(t){this._adcTimerId<=0||(this._adcTimerId=-1,this._batchRequestDataCloud(this._adcRicMap,this._adcFields),this._adcRicMap=null)},N.prototype._batchRequestDataCloud=function(t,e){if(!this._adcUrl)return null;var i=[];for(var o in t)i.push(o);for(;i.length>30;)this._requestDataCloud(t,e,i.splice(0,30));return this._requestDataCloud(t,e,i)},N.prototype._requestDataCloud=function(t,e,i){if(!i||i.length<=0)return null;if(!e||e.length<=0)return null;var o=new XMLHttpRequest;o.onload=this._onADCUpdate,o.onerror=this._onADCError,o.ricMap=t,o.open("POST",this._adcUrl,!0),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded");var n="formula="+e+"&identifiers="+i;return this._productId&&(n+="&productid="+this._productId),this._userId&&(n+="&uuid="+this._userId),this._lang&&(n+="&lang="+this._lang),o.send(n),o},N.prototype._cloneRowData=function(t,e,i){var o="string"==typeof t?t:t.SUB_ID,n=this._rows[o+e];if(!n){if("object"!=typeof t)return null;n=t}var r={};for(var s in n)null==this._staticFields[s]&&(r[s]=n[s]);return r.SUB_ID=i,r},N.prototype._rows,N.prototype._subs,N.prototype._quotes2=null,N.prototype._staticFields=null,N.prototype._adcFields=null,N.prototype._adcRefMap=null,N.prototype._adcTimerId=-1,N.prototype._adcRicMap=null,N.prototype._adcUrl="/datacloud/rest/select",N.prototype._userId="",N.prototype._productId="",N.prototype._composing=!1,N.prototype._lang="",N._proto=N.prototype;const W=N;var Y=function(t){this._rid=t,this._children={}};Y.prototype._rid,Y.prototype._children,Y.prototype._childCount=0,Y.prototype._collapsed=!1,Y.prototype._value=0,Y.prototype.getId=function(){return this._rid},Y.prototype.addChild=function(t,e){return!(!t||this._children[t]||(e&&(e[t]=this._rid),this._children[t]=1,++this._childCount,0))},Y.prototype.addChildren=function(t,e){for(var i=Array.isArray(t)?t:[t],o=i.length,n=0,r=0;r<o;++r)n|=this.addChild(i[r],e);return!!n},Y.prototype.containsChild=function(t){return!!this._children[t]},Y.prototype.removeChild=function(t,e){return!(!this._childCount||!this._children[t]||(e&&delete e[t],delete this._children[t],--this._childCount,0))},Y.prototype.removeChildren=function(t,e){if(!this._childCount)return!1;for(var i=Array.isArray(t)?t:[t],o=i.length,n=0,r=0;r<o;++r)n|=this.removeChild(i[r],e);return!!n},Y.prototype.removeAllChildren=function(t){if(this._childCount){if(t){var e=this._children;for(var i in e)t[i]&&delete t[i]}return this._children={},this._childCount=0,!0}return!1},Y.prototype.getChildIds=function(){return this._childCount?Object.keys(this._children):[]},Y.prototype.collapse=function(t){return t=!1!==t,this._collapsed!==t&&(this._collapsed=t,!0)},Y.prototype.expand=function(t){return this.collapse(!1===t)},Y.prototype.isCollapsed=function(){return this._collapsed},Y.prototype.getCollapsingStates=function(t){if(t||(t={}),this._childCount){var e=this._children,i=this._collapsed;for(var o in e)t[o]=i}return t},Y.prototype.getValue=function(){return this._value},Y.prototype.setValue=function(t){this._value=t};const X=Y;var q=function(){this._segments={},this._childToSegmentId={}};q.prototype._segments,q.prototype._segmentCount=0,q.prototype._collapsedRids=null,q.prototype._dirtyCollapsingState=!1,q.prototype._childToSegmentId,q.prototype.addSegment=function(t){return!(!t||this._segments[t]||(this._childToSegmentId[t]&&console.log("child of a segment cannot be set as a segment separator"),this._segments[t]=new X(t),++this._segmentCount,0))},q.prototype.addSegments=function(t){for(var e=Array.isArray(t)?t:[t],i=e.length,o=0,n=0;n<i;++n)o|=this.addSegment(e[n]);return!!o},q.prototype.containsSegment=function(t){return!!this._segments[t]},q.prototype.getParentRowId=function(t){return this._childToSegmentId[t]||""},q.prototype.removeSegment=function(t){var e=this._segments[t];return!!e&&(e.isCollapsed()&&(this._dirtyCollapsingState=!0),e.removeAllChildren(this._childToSegmentId),delete this._segments[t],--this._segmentCount,!0)},q.prototype.removeAllSegments=function(){return!!this._segmentCount&&(this._segments={},this._childToSegmentId={},this._segmentCount=0,this._dirtyCollapsingState=!0,!0)},q.prototype.getSegmentCount=function(){return this._segmentCount},q.prototype.getSegment=function(t){return this._segments[t]||null},q.prototype.getSegments=function(){return this._segmentCount?this._segments:null},q.prototype.getSegmentIds=function(){return Object.keys(this._segments)},q.prototype.collapseSegment=function(t,e){var i=this._segments[t];return!(!i||!i.collapse(e))&&(this._dirtyCollapsingState=!0,!0)},q.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},q.prototype.expandAllSegments=function(){if(this._segmentCount){var t=this._segments,e=0;for(var i in t)e|=t[i].expand();if(e)return this._dirtyCollapsingState=!0,!0}return!1},q.prototype.isCollapsedSegment=function(t){var e=this._segments[t];return!!e&&e.isCollapsed()},q.prototype.getCollapsedRows=function(){if(this._dirtyCollapsingState){this._dirtyCollapsingState=!1;var t=null,e=0;if(this._segmentCount){var i=this._segments;for(var o in t={},i)i[o].isCollapsed()&&(i[o].getCollapsingStates(t),++e)}this._collapsedRids=e?t:null}return this._collapsedRids},q.prototype.addSegmentChild=function(t,e){var i=this._segments[t];return!(!i||!i.addChild(e,this._childToSegmentId))&&(i.isCollapsed()&&(this._dirtyCollapsingState=!0),!0)},q.prototype.addSegmentChildren=function(t,e){var i=this._segments[t];return!(!i||!i.addChildren(e,this._childToSegmentId))&&(i.isCollapsed()&&(this._dirtyCollapsingState=!0),!0)},q.prototype.containsSegmentChild=function(t,e){var i=this._segments[t];return!!i&&i.containsChild(e)},q.prototype.removeSegmentChild=function(t,e){var i=this._segments[t];return!(!i||!i.removeChild(e,this._childToSegmentId))&&(i.isCollapsed()&&(this._dirtyCollapsingState=!0),!0)},q.prototype.removeSegmentChildren=function(t,e){var i=this._segments[t];return!(!i||!i.removeChildren(e,this._childToSegmentId))&&(i.isCollapsed()&&(this._dirtyCollapsingState=!0),!0)},q.prototype.removeAllSegmentChildren=function(){this._childToSegmentId={};var t=this._segments,e=this._dirtyCollapsingState,i=!1;for(var o in t){var n=this._segments[o];n.removeAllChildren()&&(i=!0,!e&&n.isCollapsed()&&(e=this._dirtyCollapsingState=!0))}return i},q.prototype.fillSegment=function(t,e){var i=Array.isArray(e)?e.length:0;if(i){var o=this._segments,n=this._childToSegmentId,r=o[t];if(r){var s=e.indexOf(t);if(s>=0){r.isCollapsed()&&(this._dirtyCollapsingState=!0),r.removeAllChildren(n);for(var l=s+1;l<i;++l){var a=e[l];if(o[a])break;r.addChild(a,n)}}}}},q.prototype.fillSegments=function(t){var e=Array.isArray(t)?t.length:0;this._childToSegmentId={};for(var i=this._segments,o=this._childToSegmentId,n=null,r=!1,s=0;s<e;++s){var l=t[s],a=i[l];a?((n=a).isCollapsed()&&(this._dirtyCollapsingState=!0),n.removeAllChildren()):n&&(n.addChild(l,o),r=!0)}return r},q.prototype.getSegmentValues=function(t){var e=t?t.length:0;if(!e)return null;for(var i=this._segments,o=this._childToSegmentId,n=null,r=new Array(e),s=0,l=0,a=0,h={};a<e;){var u=t[a];if(i[u]){if(++s,n=i[u],l+=100,r[a]=l,n.setValue(l),s>=this._segmentCount){++a;break}}else r[a]=s?l+10:0,o[u]&&(h[u]=a);++a}if(s){for(;a<e;)u=t[a],r[a]=l+10,o[u]&&(h[u]=a),++a;for(var p in h)n=i[o[p]],r[h[p]]=n.getValue()+1}return s?r:null};const U=q;var K=function(){K.base(this,"constructor"),this._removeRows=this._removeRows.bind(this),this._bySegmentSeparator=this._bySegmentSeparator.bind(this),this._prevData={},this._rids=[],this._compMap={}};h.inherits(K,W),K.prototype._prevData=null,K.prototype._rids,K.prototype._frozen=!1,K.prototype._runningId=0,K.prototype._compMap=null,K.prototype._segments=null,K.prototype._autoSegmentFilling=!1,K.prototype._removedRows=null,K.prototype._userSegmentComparer=null,K.SortLogic,K.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._compMap=null,this._segments=null},K.prototype.getColumnData=function(t){for(var e=new Array(this._rids.length),i=this._rids.length;--i>=0;)e[i]=this._rows[this._rids[i]][t];return e},K.prototype.getRowId=function(t){return this._rids[t]||""},K.prototype.getAllRowIds=function(t){return t?this._rids:this._rids.slice(0)},K.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},K.prototype.getRowCount=function(){return this._rids.length},K.prototype.getDataAt=function(t,e){return this.getData(this._rids[t],e)},K.prototype.getRowDataAt=function(t){return this.getRowData(this._rids[t])},K.prototype.getPreviousData=function(t,e){var i=this._prevData[t]||null;return i?i[e]:null},K.prototype.setData=function(t,e,i){if(!this._needFiring())return this._setData(t,e,i);var o={};return o[e]=i,this.setRowData(t,o)},K.prototype.setRowData=function(t,e,i){if(!t)return!1;var o=this.getRowData(t),n=!1,r="updated",s=!1;if(e){if(o){var l=this._prevData[t];for(var a in e)l[a]=o[a],o[a]=e[a]}else if(r="inserted",o=e,this._rows[t]=o,this._prevData[t]={},i){var h=i.nextRid,u=null!=h?this.getRowIndex(h):-1;u<0&&(u=i.fallback),null==u||u<0||u>=this._rids.length?this._rids.push(t):(this._rids.splice(u,0,t),s=!this._isLastSegment(u))}else this._rids.push(t);n=!0}else if(o){r="removed",this._prevData[t]=this._rows[t],delete this._rows[t],this._segments&&(s=this._segments.containsSegment(t));for(var p=this._rids.length;--p>=0;)if(this._rids[p]===t){this._rids.splice(p,1);break}n=!0}if(n&&this._needFiring())if(this._autoFillSegments())this.dispatchGlobalChange();else{var _=i||{};_.rid=t,_.changes=e,_.rowData=o,_.type=r,s&&(_.segmentChanged=!0),this._dispatchDataChange(_)}return n},K.prototype.setColumnData=function(t,e,i){var o=e?e.length:0;if(!(o<0)){var n=this._frozen;this.freeze();for(var r=this._generateRids(o,i),s=0;s<o;++s)this._setData(r[s],t,e[s]);this.freeze(n)}},K.prototype.setDataFromObjectMap=function(t){if(t)if(Array.isArray(t))this.addRows(t);else{var e=this._frozen;for(var i in this.freeze(),t)this.setRowData(i,t[i]);this.freeze(e)}},K.prototype.setDataFrom2DArray=function(t,e,i){var o=t?t.length:0;if(!(o<0)){var n=this._frozen;this.freeze();for(var r=0,s=this._generateRids(o,i),l=0;l<o;++l){var a=t[l],h=s[l];if(e)for(r=a.length;--r>=0;)this._setData(h,e[r],a[r]);else for(r=a.length;--r>=0;)this._setData(h,""+r,a[r])}this.freeze(n)}},K.prototype.setDataAt=function(t,e,i){var o=this.getRowId(t);return!!o&&this.setData(o,e,i)},K.prototype.setRowDataAt=function(t,e,i){var o=this.getRowId(t);return!!o&&this.setRowData(o,e,i)},K.prototype.addRow=function(t,e){return t||(t={}),e=this._generateUniqueRid(t,e),this.setRowData(e,t),e},K.prototype.addRows=function(t,e){if(Array.isArray(t)){var i=t.length;if(i)if(1!==i){e||(e=[]);var o=this._frozen;this.freeze();for(var n=0;n<i;++n)this.addRow(t[n],e[n]);this.freeze(o)}else this.addRow(t[0],e?e[0]:null)}},K.prototype.unshiftRow=function(t,e){return this.insertRow(0,t,e)},K.prototype.insertRow=function(t,e,i){var o={};return"number"==typeof t?(o.nextRid=this._rids[t],o.fallback=t):o.nextRid=t,e||(e={}),i=this._generateUniqueRid(e,i),this.setRowData(i,e,o),i},K.prototype.insertAfter=function(t,e,i){var o="string"==typeof t?this.getRowIndex(t):t;return!(o>=0)||o>=this._rids.length-1?this.addRow(e,i):this.insertRow(o+1,e,i)},K.prototype.removeRow=function(t){"number"==typeof t?this.setRowData(this.getRowId(t),null):this.setRowData(t,null)},K.prototype.removeRows=function(t){if(1!==t.length){var e,i=!1;for(this._removedRows={},e=t.length;--e>=0;)"number"==typeof(o=t[e])&&(o=this.getRowId(o)),this.getRowData(o)&&(this._prevData[o]=this._rows[o],this._removedRows[o]=1,delete this._rows[o],i=!0);i?(this._rids=this._rids.filter(this._removeRows),this._removedRows=null,this.dispatchGlobalChange()):this._removedRows=null}else{var o=t[0];"number"==typeof o?this.removeRow(o):this.setRowData(o,null)}},K.prototype._removeRows=function(t){return!this._removedRows[t]},K.prototype.clearAllData=function(t){K.base(this,"clearAllData",!0),this._prevData={},this._rids.length&&(this._rids.length=0,this.dispatchGlobalChange(t))},K.prototype.removeAllRows=K.prototype.clearAllData,K._ascendingOrder=function(t,e){return t-e},K.prototype.moveRow=function(t,e,i){var o=null,n="";if(e>=0&&e<this._rids.length||(e=this._rids.length),Array.isArray(t)){var r=t;r.sort(K._ascendingOrder);for(var s=[],l=r.length;--l>=0;){var a=r[l];(n=this._rids[a])&&(s.unshift(n),this._rids.splice(a,1),a<e&&--e)}s.length&&(this._rids.splice.apply(this._rids,[e,0].concat(s)),o=s)}else t<0&&(t=0),t!==e&&t+1!==e&&(n=this._rids.splice(t,1)[0])&&(t<e&&--e,this._rids.splice(e,0,n),o=n);return o&&(this._segments&&this._sort(null),this._dispatchPositionChange(i)),o},K.prototype._moveRow=function(t,e,i){var o=t.length;if(!o)return null;for(var n=new Array(o),r=0;r<o;++r)n[r]=this.getRowIndex(t[r]);var s=e?this.getRowIndex(e):this._rids.length;return o>1?this.moveRow(n,s,i):this.moveRow(n[0],s,i)},K.prototype.moveRows=function(t,e,i,o){"string"==typeof t&&(t=this.getRowIndex(t)),"string"==typeof e&&(e=this.getRowIndex(e)),t<0&&(t=0),e<0&&(e=this._rids.length),i||(i=1);var n=t+i-1,r=e;if(e>=t&&(r=e<=n?t:e-i),i>0&&n<=this._rids.length){r>this._rids.length&&(r=this._rids.length);var s=this._rids.splice(t,i),l=[r,0].concat(s);return Array.prototype.splice.apply(this._rids,l),this._segments&&this._sort(null),this._dispatchPositionChange(o),s}return null},K.prototype.swapRow=function(t,e){var i=this._rids.length;if(!(t<0||t>=i||e<0||e>=i)){var o=this._rids[t];this._rids[t]=this._rids[e],this._rids[e]=o}},K.prototype.clearRowData=K.prototype.removeRow,K.prototype.clearColumnData=function(t,e){for(var i="string"==typeof t?[t]:t,o=i.length;--o>=0;){var n=i[o];if(n)for(var r in this._rows)delete this._rows[r][n],delete this._prevData[r][n]}this.dispatchGlobalChange(e)},K.prototype.getDataSource=function(){return null},K.prototype.setDataSource=function(t){},K.prototype.getSortingLogics=function(){return this._compMap},K.prototype.sortOnce=function(t,e,i,o){var n=K._buildSortContext([],t,e,i||this._compMap,o);return!!this._sort(n)&&(this._dispatchPositionChange(),!0)},K.prototype.setSortingLogic=function(t){this._compMap._default=t},K.prototype.setColumnSortingLogic=function(t,e){this._compMap[t]=e},K.prototype.freeze=function(t){t=!1!==t;var e=this._frozen;return e!==t&&(this._frozen=t,this._autoFillSegments(),this.dispatchGlobalChange()),e},K.prototype.unfreeze=function(t){return this.freeze(!1===t)},K.prototype.isFrozen=function(){return this._frozen},K.prototype.setSegmentSeparator=function(t,e){var i=!1;if("string"==typeof t&&(!1!==e?(this._segments||(this._segments=new U),this._segments.addSegment(t)&&(i=!0)):this._segments&&this._segments.removeSegment(t)&&(i=!0,this._segments.getSegmentCount()||(this._segments=null))),i&&this._needFiring())if(this._autoFillSegments())this.dispatchGlobalChange();else{var o=this._rows[t]||null;o&&this._dispatchDataChange({rid:t,changes:{},rowData:o,type:"updated",segmentChanged:!0})}return i},K.prototype.unsetAllSegmentSeparators=function(){return!!this._segments&&(this._segments=null,this.dispatchGlobalChange(),!0)},K.prototype.hasSegmentation=function(){return!!this._segments},K.prototype.isSegmentSeparator=function(t){return!!this._segments&&this._segments.containsSegment(t)},K.prototype.getSegmentParentRowId=function(t){return this._segments?this._segments.getParentRowId(t):""},K.prototype.getSegmentValues=function(t){return this._segments?this._segments.getSegmentValues(t||this._rids):null},K.prototype._isLastSegment=function(t){var e=this._segments;if(e)for(var i=this._rids,o=i.length,n=t+1;n<o;++n)if(e.containsSegment(i[n]))return!1;return!0},K.prototype._getSegmentSeparators=function(){return this._segments},K.prototype.enableAutoSegmentFilling=function(t){this._autoSegmentFilling=0!=t,this._autoFillSegments()},K.prototype._autoFillSegments=function(){return!!this._autoSegmentFilling&&this.fillSegments()},K.prototype.fillSegment=function(t){this._segments&&this._segments.fillSegment(t,this._rids)},K.prototype.fillSegments=function(){return!!this._segments&&this._segments.fillSegments(this._rids)},K.prototype.addSegmentChild=function(t,e){return!(!this._segments||!this._segments.addSegmentChild(t,e))&&(this._sort(null)&&this._dispatchPositionChange(),!0)},K.prototype.addSegmentChildren=function(t,e){return!(!this._segments||!this._segments.addSegmentChildren(t,e))&&(this._sort(null)&&this._dispatchPositionChange(),!0)},K.prototype.removeSegmentChild=function(t,e){return!!this._segments&&this._segments.removeSegmentChild(t,e)},K.prototype.removeSegmentChildren=function(t,e){return!!this._segments&&this._segments.removeSegmentChildren(t,e)},K.prototype.removeAllSegmentChildren=function(){return!!this._segments&&this._segments.removeAllSegmentChildren()},K.prototype.getSegmentIds=function(){return this._segments?this._segments.getSegmentIds():null},K.prototype.getSegmentChildIds=function(t){if(this._segments){var e=this._segments.getSegment(t);if(e){var i=e.getChildIds();return i.length?i:null}}return null},K.prototype.sortSegments=function(t){if(this._segments&&"function"==typeof t){var e,i=this._rids,o=this._segments,n=o.getSegmentCount(),r=[],s=[],l=0,a=i.length,h="",u=null;for(e=0;e<a&&(h=i[e],!((u=o.getSegment(h))&&(s.push(e),r.push(u),++l>=n)));++e);this._userSegmentComparer=t,r.sort(this._bySegmentSeparator),this._userSegmentComparer=null;var p=!1;for(e=0;e<l;++e){var _=s[e];h=i[_];var d=(u=r[e]).getId();h!==d&&(i[_]=d,p=!0)}p&&(this._sort(null),this._dispatchPositionChange())}},K.prototype._bySegmentSeparator=function(t,e){return this._userSegmentComparer(this.getRowData(t.getId()),this.getRowData(e.getId()))},K.prototype._sort=function(t){var e=this._rids,i=this.getMultipleRowData(e),o=this.getSegmentValues(e),n=K._performMultiLevelSorting(i,t,o);return!!n&&(this._rids=K._reorderItems(e,n),!0)},K.prototype.dispatchGlobalChange=function(t){!t&&this._needFiring()&&this._dispatchDataChange(K._globalChangeArg)},K.prototype._dispatchPositionChange=function(t){!t&&this._needFiring()&&this._dispatch("dataChanged",K._positionChangeArg)},K.prototype.dump=function(t){return W.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},K.prototype._setData=function(t,e,i){var o=this.getRowData(t);return o||(o={},this._rows[t]=o,this._prevData[t]={},this._rids.push(t)),this._prevData[t][e]=o[e],o[e]=i,!0},K.prototype._generateRids=function(t,e){var i,o=0;if(e)i=e;else{i=[];for(var n=this._rids.length;o<n&&o<t;)i.push(this._rids[o++])}for(o=i.length;o<t;)i.push(""+o++);return i},K.prototype._generateUniqueRid=function(t,e){if(!e){if(t.ROW_ID)return t.ROW_ID;for(e="_"+this._runningId++;this._rows[e];)e="_"+this._runningId++}return e},K.prototype._needFiring=function(){return!this._frozen&&!this._composing},K.getSortingDefinitions=i._deprecatedFunction,K._globalChangeArg={globalChange:!0},K._positionChangeArg={globalChange:!0,positionChangeOnly:!0},K._buildSortContext=function(t,e,i,o,n){var r,s;Array.isArray(e)?(r=e,s=i):(r=[e],s=e?[i]:[0]);var l=null,a=null;"function"==typeof o?l=o:a=o;var h=r.length;t.length=h;for(var u=h;--u>=0;){Array.isArray(a)&&(l=a[u]);var p=t[u];p||(p=t[u]=new Array(5));var _=r[u];p[0]=_,p[1]=null,p[2]=l||a[_]||a._default,p[2]||(p[2]=K._defaultComparer),p[3]=K._getSortOrder(s[u]),p[4]=n}return t},K._multiColumnCompareLogic=function(t,e,i,o){for(var n=o.length,r=0,s=0;s<n;++s){var l=o[s];if(r=K._singleColumnCompareLogic(t,e,l[3],l))return r}return r},K._singleColumnCompareLogic=function(t,e,i,o){var n=o[1];return o[2](n[t],n[e],i,o[4])},K._performMultiLevelSorting=function(t,e,i){var o=t?t.length:0,n=e?e.length:0;if(!o)return null;for(var r=0;r<n;++r){var s=e[r],l=s[0],a=s[1];a?a.length=o:a=s[1]=new Array(o);for(var h=0;h<o;++h)a[h]=t[h][l]}if(i){var u=["ROW_SEGMENT",i,K._segmentComparer,1,null];e?(e=e.slice()).unshift(u):e=[u],++n}if(!n)return null;var p,_,d=0;return n>1?(p=K._multiColumnCompareLogic,_=e,d=1):(p=K._singleColumnCompareLogic,d=(_=e[0])[3]),K._mergeSort(o,d,p,_)},K._mergeSort=function(t,e,i,o){for(var n,r,s,l,a,h=!1,u=1,p=K._createIndexArray(t),_=p.slice();u<=t;){for(n=a=0;n<t;)if((a=(s=l=(r=a)+u)+u)>t&&(a=t),s<a){for(;;)if(i(p[r],p[s],e,o)<=0){if(_[n++]=p[r],++r>=l){for(;s<a;)_[n++]=p[s],++s;break}}else if(h=!0,_[n++]=p[s],++s>=a){for(;r<l;)_[n++]=p[r],++r;break}}else for(;n<t;)_[n]=p[n],++n;var d=p;p=_,_=d,u<<=1}return h?p:null},K._reorderItems=function(t,e){if(e){for(var i=t.length;--i>=0;)e[i]=t[e[i]];return e}return t},K._createIndexArray=function(t){var e=K._idxAryMap[t];if(!e){K._idxAryCount>50&&(K._idxAryMap={},K._idxAryCount=0),e=K._idxAryMap[t]=new Array(t),K._idxAryCount++;for(var i=0;i<t;++i)e[i]=i}return e.slice()},K._idxAryMap={},K._idxAryCount=0,K._segmentComparer=function(t,e){return t===e?0:t<e?-1:1},K._defaultComparer=function(t,e,i){return null==t||t!=t?null==e||e!=e?0:1:null==e||e!=e?-1:t<e?-i:e<t?i:0},K._getSortOrder=function(t){if("number"==typeof t)return t;if(t&&"string"==typeof t){if("a"===(t=t.charAt(0).toLowerCase()))return 1;if("d"===t)return-1}return 0},K._proto=K.prototype;const Q=K;var j=function(t,e){this._onDataChanged=this._onDataChanged.bind(this),this._refs=[],t&&(this._dt=t,this._dt.listen("dataChanged",this._onDataChanged,0)),e&&(this._field=e)};j.prototype.dispose=function(){this._dt&&(this._dt.unlisten("dataChanged",this._onDataChanged),this._dt=null)},j.prototype.setDataSource=function(t){this._dt!==t&&(this._dt&&this._dt.unlisten("dataChanged",this._onDataChanged),this._dt=t,this._dt&&this._dt.listen("dataChanged",this._onDataChanged,0),this._requestRecalculation())},j.prototype.setField=function(t){this._field!==t&&(this._field=t,this._requestRecalculation())},j.prototype.disableOnDemandMode=function(t){var e=!1===t;this._onDemandMode!==e&&(this._onDemandMode=e,this._requestRecalculation())},j.prototype.setColumnDataGetter=function(t){this._colDataGetter!==t&&(this._colDataGetter=t,this._requestRecalculation())},j.prototype.getColumnDataGetter=function(){return this._colDataGetter},j.prototype.getSum=function(){return this._updateStats(),this._sum},j.prototype.getDataCount=function(){return this._updateStats(),this._count},j.prototype.getMin=function(){return this._updateStats(),this._min},j.prototype.getMax=function(){return this._updateStats(),this._max},j.prototype.getAbsoluteMax=function(){this._updateStats();var t=this._max>=0?this._max:-this._max,e=this._min>=0?this._min:-this._min;return t>=e?t:e},j.prototype.getAverage=function(){return this._updateStats(),this._sum/this._count},j.prototype.getMean=j.prototype.getAverage,j.prototype.getMidRange=function(){return this._updateStats(),.5*(this._max+this._min)},j.prototype.getCachedColumnData=function(){return this._dirty?this._recalculate():this._cacheData||(this._cacheData=this._getColData()),this._cacheData},j.prototype.markDirty=function(){return!!this._onDemandMode&&(this._dirty=!0,this._dirty)},j.prototype._getColData=function(){return this._colDataGetter?this._colDataGetter(this._field,this._dt):this._dt.getColumnData(this._field)},j.prototype._requestRecalculation=function(){this.markDirty()||this._recalculate()},j.prototype._updateStats=function(){this._dirty&&this._recalculate()},j.prototype._recalculate=function(){if(this._dirty=!1,this._cacheData=null,this._sum=0,this._min=NaN,this._max=NaN,this._count=0,this._dt&&this._field){var t=this._cacheData=this._getColData(),e=t.length;if(e){for(var i,o=j._isDataNumeric,n=0;n<e;)if(o(i=+t[n++])){this._sum=this._min=this._max=i,++this._count;break}for(;n<e;)o(i=+t[n])&&(this._sum+=i,i<this._min?this._min=i:i>this._max&&(this._max=i),++this._count),++n}}},j.prototype._onDataChanged=function(t){if(t.rid){if(!this._colDataGetter&&t.changes&&null==t.changes[this._field])return;if(this.markDirty())return;this._updateRowData(t.rid)}else if(t.rids){if(this.markDirty())return;var e=t.rids;1===e.length?this._updateRowData(e[0]):this._recalculate()}else if(t.globalChange){if(t.positionChangeOnly)return void(this._cacheData=null);this._requestRecalculation()}},j.prototype._updateRowData=function(t){var e=this._dt.getPreviousData(t,this._field),i=this._dt.getData(t,this._field);if(e!==i){var o=j._isDataNumeric(i);if(j._isDataNumeric(e)){if(this._min===e&&(!o||i>this._min))return void this._recalculate();if(this._max===e&&(!o||i<this._max))return void this._recalculate();this._sum-=e,--this._count}o&&(this._sum+=i,i>=this._min||(this._min=i),i<=this._max||(this._max=i),++this._count)}},j._isDataNumeric=function(t){return"number"==typeof t&&t==t},j.prototype.addRef=function(t){return t&&this._refs.indexOf(t)<0&&this._refs.push(t),this._refs.length},j.prototype.deRef=function(t){if(t){var e=this._refs.indexOf(t);e>=0&&this._refs.splice(e,1)}return this._refs.length},j.prototype.getRefCount=function(){return this._refs.length},j.prototype._dt=null,j.prototype._field="",j.prototype._onDemandMode=!0,j.prototype._dirty=!0,j.prototype._cacheData=null,j.prototype._sum=0,j.prototype._min=NaN,j.prototype._max=NaN,j.prototype._count=0,j.prototype._colDataGetter=null,j.prototype._refs;const J=j;var $=function(t){this._onDataChanged=this._onDataChanged.bind(this),this._onWrapSizeChanged=this._onWrapSizeChanged.bind(this),this._dv=t.dataView,this._dt=this._dv.getDataTable(),this._dv.listen("dataChanged",this._onDataChanged),this._dv.listen("wrapSizeChanged",this._onWrapSizeChanged),this._wrapIndex=t.wrapIndex,this._refreshRids(t.rids),this._addEvents("dataChanged")};h.inherits($,s),$.prototype._dv=null,$.prototype._dt=null,$.prototype._wrapIndex=0,$.prototype._rids,$.prototype._dataConflator=null,$.prototype._onDataChanged=function(t){if(this._dv){var e=this._dv.getVisibleRowIds(!0);this._refreshRids(e)&&(t.globalChange||(t.globalChange=!0),this._dispatch("dataChanged",t))}},$.prototype._onWrapSizeChanged=function(t){this._refreshRids(t.rids)&&this._dispatch("dataChanged",Q._globalChangeArg)},$.prototype._refreshRids=function(t){var e=!1;if(this._dv&&Array.isArray(t)){var i=this.getWrapSize();if(i>0){var o=i*this._wrapIndex;o<t.length?(e=!0,this._rids=t.slice(o,o+i)):this._rids.length&&(e=!0,this._rids.length=0)}}return e},$.prototype.dispose=function(){this._dv&&(this.unlistenAll(),this._dv.unlisten("dataChanged",this._onDataChanged),this._dv.unlisten("wrapSizeChanged",this._onWrapSizeChanged),this._dt=this._dv=null)},$.prototype.getData=function(t,e){return this._dt.getData(t,e)},$.prototype.getRowData=function(t){return this._dt.getRowData(t)},$.prototype.getColumnData=function(t,e){for(var i=this.getAllRowIds(!0,e),o=[],n=i.length,r=0;r<n;++r){var s=this._dt.getRowData(i[r]);s?o.push(s[t]):e&&o.push(null)}return o},$.prototype.getRowId=function(t){return this._rids[t]||""},$.prototype._toRowId=function(t){return"number"==typeof t?this._rids[t]||"":t||""},$.prototype._toRowIds=function(t){for(var e=Array.isArray(t)?t.length:0,i=new Array(e),o=this._rids,n=0;n<e;++n){var r=t[n];i[n]="number"==typeof r?o[r]||"":r||""}return i},$.prototype.getAllRowIds=function(t,e){return t?this._rids:this._rids.slice(0)},$.prototype.getVisibleRowIds=function(t){return t?this._rids:this._rids.slice(0)},$.prototype.getSortedRowIds=function(t){return t?this._rids:this._rids.slice(0)},$.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},$.prototype.getRowCount=function(){return this._rids.length},$.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},$.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},$.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},$.prototype.getMultipleRowData=function(t,e,i){return this._dt.getMultipleRowData(t,e,i)},$.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},$.prototype.setData=function(t,e,i){return!!this._dt&&this._dt.setData(t,e,i)},$.prototype.setRowData=function(t,e,i){return this._dv.setRowData(t,e,i)},$.prototype.setColumnData=function(t,e,i){this._dt&&this._dt.setColumnData(t,e,i)},$.prototype.setDataAt=function(t,e,i){var o=this.getRowId(t);return!(!o||!this._dt)&&this._dt.setData(o,e,i)},$.prototype.setRowDataAt=function(t,e,i){var o=this.getRowId(t);return this.setRowData(o,e,i)},$.prototype.insertRow=function(t,e,i){var o=this._toRowId(t);return this._dv.insertRow(o,e,i)},$.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},$.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},$.prototype.moveRow=function(t,e){var i=this._toRowId(e),o=Array.isArray(t)?t:[t],n=this._toRowIds(o);return this._dv.moveRow(n,i)},$.prototype.getDataTable=function(){return this._dt},$.prototype.getDataSource=function(){return this._dv},$.prototype.setDataSource=function(t){},$.prototype.setConflationRate=function(t){this._dv.setConflationRate(t)},$.prototype.getConflationRate=function(){return this._dv.getConflationRate()},$.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},$.prototype.sort=function(t,e,i,o){this._dv.sort(t,e,i,o)},$.prototype.sortOnce=function(t,e){this._dv.sortOnce(t,e)},$.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},$.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},$.prototype.isSorting=function(){return this._dv.isSorting()},$.prototype.hideRow=function(t,e){this.showRows([t],!1===e)},$.prototype.hideRows=function(t,e){this.showRows(t,!1===e)},$.prototype.showRows=function(t,e){var i=this._toRowIds(t);this._dv.showRows(i,e)},$.prototype.unhideAllRows=function(){this._dv.unhideAllRows()},$.prototype.hasHiddenRow=function(){return this._dv.hasHiddenRow()},$.prototype.filterIn=function(t,e,i){return this._dv.filterIn(t,e,i)},$.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},$.prototype.filterInOnce=function(t,e,i){this._dv.filterInOnce(t,e,i)},$.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},$.prototype.clearFilter=function(){this._dv.clearFilter()},$.prototype.disablePageCorrection=function(t){},$.prototype.setPage=function(t){return!1},$.prototype.gotoPage=$.prototype.setPage,$.prototype.nextPage=function(){return!1},$.prototype.previousPage=function(){return!1},$.prototype.prevPage=$.prototype.previousPage,$.prototype.lastPage=function(){return!1},$.prototype.firstPage=function(){return!1},$.prototype.getCurrentPage=function(){return 1},$.prototype.getPageIndex=$.prototype.getCurrentPage,$.prototype.isOnLastPage=function(){return!0},$.prototype.isOnFirstPage=function(){return!0},$.prototype.getPageSize=function(){return 0},$.prototype.getPageCount=function(){return 1},$.prototype.getTotalPages=$.prototype.getPageCount,$.prototype.setPageSize=function(t){},$.prototype.groupBy=function(t,e){this._dv.groupBy(t,e)},$.prototype.addGroup=function(t){this._dv.addGroup(t)},$.prototype.sortGroups=function(t){this._dv.sortGroups(t)},$.prototype.moveGroup=function(t,e){this._dv.moveGroup(t,e)},$.prototype.setPredefinedGroups=function(t){this._dv.setPredefinedGroups(t)},$.prototype.addFooter=function(t){this._dv.addFooter(t)},$.prototype.removeFooter=function(){this._dv.removeFooter()},$.prototype.enableMultiGroup=function(t){this._dv.enableMultiGroup(t)},$.prototype.getGroupByRowId=function(t){return this._dv.getGroupByRowId(t)},$.prototype.getGroup=function(t){return this._dv.getGroup(t)},$.prototype.getAllGroups=function(t){return this._dv.getAllGroups(t)},$.prototype.getGroupList=function(){return this._dv.getGroupList()},$.prototype.getGroupId=function(){return this._dv.getGroupId()},$.prototype.getGroupValue=function(){return this._dv.getGroupValue()},$.prototype.getGroupRowId=function(){return this._dv.getGroupRowId()},$.prototype.getFooterRowIndex=function(t){return this._dv.getFooterRowIndex(t)},$.prototype.getFooterRowIds=function(){return this._dv.getFooterRowIds()},$.prototype.hasGroup=function(){return this._dv.hasGroup()},$.prototype.getGroupRows=function(){return null},$.prototype.getGroupLevel=function(t){var e=this._toRowId(t);return this._dv.getGroupLevel(e)},$.prototype.enableColumnStats=function(t,e,i){return this._dv.enableColumnStats(t,e,i)},$.prototype.getColumnStats=function(t){return this._dv.getColumnStats(t)},$.prototype.hide=function(t){return this._dv.hide(t)},$.prototype.isHidden=function(){return this._dv.isHidden()},$.prototype.isHiddenRow=function(t){return this._dv.isHiddenRow(t)},$.prototype.collapse=function(t){this._dv.collapse(t)},$.prototype.collapseAllGroups=function(t){this._dv.collapseAllGroups(t)},$.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},$.prototype.isCollapsed=function(){return this._dv.isCollapsed()},$.prototype.enableContentAsHeader=function(t){this._dv.enableContentAsHeader(t)},$.prototype.getVisibleRowCount=function(){return this._rids.length},$.prototype.isRowDataInGroup=function(t,e){return this._dv.isRowDataInGroup(t,e)},$.prototype.isRowIdInGroup=function(t,e){return this._dv.isRowIdInGroup(t,e)},$.prototype.addRowExpansion=function(t,e){this._dv.addRowExpansion(t,e)},$.prototype.removeRowExpansion=function(t){this._dv.removeRowExpansion(t,count)},$.prototype.toggleRowExpansion=function(t,e,i){var o=this._toRowId(t);this._dv.toggleRowExpansion(o,e,i)},$.prototype.removeAllRowExpansions=function(){this._dv.removeAllRowExpansions()},$.prototype.getRowsWithExpansion=function(t,e){return this._dv.getRowsWithExpansion(t,e)},$.prototype.getExpansionParents=function(t,e){return this._dv.getExpansionParents(t,e)},$.prototype.isRowExpansion=function(t){return this._dv.isRowExpansion(t)},$.prototype.hasRowExpansion=function(t){return this._dv.hasRowExpansion(t)},$.prototype.getRowExpansionId=function(t,e){return this._dv.getRowExpansionId(t,e)},$.prototype.getRowExpansionIndex=function(t){return this._dv.getRowExpansionIndex(t)},$.prototype.searchAll=function(t,e){return this._dv.searchAll(t,e)},$.prototype.searchPrev=function(t,e){var i=this._toRowId(t);return this._dv.searchPrev(i,e)},$.prototype.searchNext=function(t,e){var i=this._toRowId(t);return this._dv.searchNext(i,e)},$.prototype.stall=function(t){return this._dv.stall(t)},$.prototype.enableAutoGroupRemoval=function(t){return this._dv.enableAutoGroupRemoval(t)},$.prototype.enableAutoGroupHiding=function(t){return this._dv.enableAutoGroupHiding(t)},$.prototype.synchronizeRowOrder=function(){this._dv.synchronizeRowOrder()},$.prototype.setSegmentSeparator=function(t,e){var i=this._toRowId(t);return this._dv.setSegmentSeparator(i,e)},$.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},$.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},$.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},$.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},$.prototype.collapseSegment=function(t,e){var i=this._toRowId(t);return this._dv.collapseSegment(i,e)},$.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},$.prototype.expandAllSegments=function(){return this._dv.expandAllSegments()},$.prototype.setSegmentCollapsingLogic=function(){},$.prototype.isSegmentCollapsed=function(t){var e=this._toRowId(t);return this._dv.isSegmentCollapsed(e,collapsed)},$.prototype.fillSegment=function(t){var e=this._toRowId(t);this._dv.fillSegment(e)},$.prototype.fillSegments=function(){this._dv.fillSegments()},$.prototype.addSegmentChild=function(t,e){var i=this._toRowId(t),o=this._toRowId(e);return this._dv.addSegmentChild(i,o)},$.prototype.addSegmentChildren=function(t,e){var i=this._toRowId(t),o=this._toRowId(rowRef);return this._dv.addSegmentChildren(i,o)},$.prototype.removeSegmentChild=function(t,e){var i=this._toRowId(t),o=this._toRowId(e);return this._dv.removeSegmentChild(i,o)},$.prototype.removeSegmentChildren=function(t,e){var i=this._toRowId(t),o=this._toRowId(rowRef);return this._dv.removeSegmentChildren(i,o)},$.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},$.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},$.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},$.prototype.sortSegments=function(t){this._dt.sortSegments(t)},$.prototype.getWrapSize=function(){return this._dv.getWrapSize()},$.prototype.getWrappedViews=function(){return this._dv.getWrappedViews()},$.prototype.wrapView=function(t){this._dv.wrapView(t)},$.prototype.dump=function(t){return DataCache.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},$.prototype.log=function(t){console.table(this.dump(t))},$.prototype.isRowFiltered=function(t,e){return this._dv.isRowFiltered(t,e)};const Z=$;var tt=function(t,e,i){this._onConflated=this._onConflated.bind(this),this._data=[],"function"==typeof t?this.setFunction(t,i):"function"==typeof e&&this.setFunction(e,i),"number"==typeof e?this.setConflatingTime(e):"number"==typeof t&&this.setConflatingTime(t)};tt.prototype._data,tt.prototype._func=null,tt.prototype._delay=0,tt.prototype._timerId=0,tt.prototype._conflated=!1,tt.prototype._disabled=!1,tt.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},tt.prototype.popAllData=function(){if(this._data.length){var t=this._data;return this._data=[],t}return null},tt.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},tt.prototype.conflate=function(t){return!this._disabled&&(null!=t&&this._data.push(t),!this._conflated&&(this._timerId||(this._timerId=setTimeout(this._onConflated,this._delay)),!0))},tt.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},tt.prototype._onConflated=function(){this._conflated=!0;try{this._func()}catch(t){console.error(t.message||t)}this._timerId=0,this._data.length=0,this._conflated=!1},tt.prototype.getData=function(){return this._data},tt.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},tt.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},tt.prototype.getConflatingTime=function(){return this._delay},tt.prototype.disable=function(t){this._disabled=!1!==t},tt.prototype.isEnabled=function(){return!this._disabled},tt.prototype.enable=function(t){this._disabled=!1===t};var et=function(t){var e=this;e._groupFilterLogic=e._groupFilterLogic.bind(e),e._internalGroupSortingLogic=e._internalGroupSortingLogic.bind(e),e._onDataChanged=e._onDataChanged.bind(e),e._onGroupAdded=e._onGroupAdded.bind(e),e._onBeforeGroupAdded=e._onBeforeGroupAdded.bind(e),e._onRefreshTimeout=e._onRefreshTimeout.bind(e),e._updateWrapCount=e._updateWrapCount.bind(e),e._rids=[],e._sortingDefs=[],e._columnStats={},e._shared={},e._conflator=new tt(this._onDataChanged,0),e._conflator.disable(),e._addEvents("dataChanged","preDisposed","pageIndexChanged","pageCountChanged","groupAdded","beforeGroupAdded","groupCriteriaChanged","beforeFiltering","wrapCountChanged","wrapSizeChanged"),e.setDataSource(t)};h.inherits(et,s),et.prototype._rids,et.prototype._groupView=null,et.prototype._pageView=null,et.prototype._expansionView=null,et.prototype._hiddenRids=null,et.prototype._collapsedRids=null,et.prototype._expansionMap=null,et.prototype._expansionChildren=null,et.prototype._expansionCount=0,et.prototype._dt=null,et.prototype._parent=null,et.prototype._shared=null,et.prototype._sortingDefs=null,et.prototype._userFilter=null,et.prototype._filteringOut=!1,et.prototype._refreshTimerId=0,et.prototype._groupSortingLogic=null,et.prototype._pageCorrection=!0,et.prototype._pageSize=0,et.prototype._pageIndex=1,et.prototype._lastPageIndex=0,et.prototype._groupCriteria=null,et.prototype._preDefGroups=null,et.prototype._preDefGroupsDirty=!1,et.prototype._groupMembers=null,et.prototype._groupList=null,et.prototype._groupRows=null,et.prototype._groupId="",et.prototype._groupValue,et.prototype._groupRowId="",et.prototype._footerRowIds=null,et.prototype._groupLevel=0,et.prototype._groupViewDirty=!1,et.prototype._columnStats,et.prototype._hidden=!1,et.prototype._hiddenHeaderRow=!1,et.prototype._collapsed=!1,et.prototype._showOnlyFirstMember=!1,et.prototype._beingAdded=!1,et.prototype._conflator=null,et.prototype._wrappedViews=null,et.prototype._wrapSize=0,et.prototype._wrapTimerId=0,et.prototype.dispose=function(){if(this._dispatch("preDisposed",{}),this.unlistenAll(),this.wrapView(0),this.setDataSource(null),this.groupBy(null),this._conflator.dispose(),this._sortingDefs=null,this._shared=null,this._userFilter=this._groupSortingLogic=null,this._wrapTimerId&&(clearTimeout(this._wrapTimerId),this._wrapTimerId=0),this._refreshTimerId&&(clearTimeout(this._refreshTimerId),this._refreshTimerId=0),this._columnStats){for(var t in this._columnStats)this._columnStats[t].dispose();this._columnStats=null}},et.prototype.getData=function(t,e){return this._dt.getData(t,e)},et.prototype.getRowData=function(t){return this._dt.getRowData(t)},et.prototype.getColumnData=function(t,e){for(var i=this.getAllRowIds(!0,e),o=[],n=i.length,r=0;r<n;++r){var s=this._dt.getRowData(i[r]);s?o.push(s[t]):e&&o.push(null)}return o},et.prototype.getRowId=function(t){return this._rebuildRowIdsFromChildren(),this._getRids()[t]||""},et.prototype._toRowId=function(t){return"number"==typeof t?(this._rebuildRowIdsFromChildren(),this._getRids()[t]||""):t||""},et.prototype._toRowIds=function(t){for(var e=Array.isArray(t)?t.length:0,i=new Array(e),o=this._getRids(),n=0;n<e;++n){var r=t[n];"number"==typeof r?(this._rebuildRowIdsFromChildren(),i[n]=o[r]||""):i[n]=r||""}return i},et.prototype.getAllRowIds=function(t,e){this._rebuildRowIdsFromChildren();var i=e?this._getRids():this._pageView||this._rids;return t?i:i.slice(0)},et.prototype.getVisibleRowIds=function(t){this._rebuildRowIdsFromChildren();var e=this._getRids();return t?e:e.slice(0)},et.prototype.getSortedRowIds=function(t){return this._rebuildRowIdsFromChildren(),t?this._rids:this._rids.slice(0)},et.prototype.getRowIndex=function(t){return this._rebuildRowIdsFromChildren(),this._getRids().indexOf(t)},et.prototype.getRowCount=function(){return this._getRids().length},et.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},et.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},et.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},et.prototype.getMultipleRowData=function(t,e,i){return this._dt.getMultipleRowData(t,e,i)},et.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},et.prototype.setData=function(t,e,i){return!!this._dt&&this._dt.setData(t,e,i)},et.prototype.setRowData=function(t,e,i){return!(!t||!this._dt||this.isRowExpansion(t))&&this._dt.setRowData(t,e,i)},et.prototype.setColumnData=function(t,e,i){this._dt&&this._dt.setColumnData(t,e,i)},et.prototype.setDataAt=function(t,e,i){var o=this.getRowId(t);return!(!o||!this._dt)&&this._dt.setData(o,e,i)},et.prototype.setRowDataAt=function(t,e,i){var o=this.getRowId(t);return this.setRowData(o,e,i)},et.prototype.insertRow=function(t,e,i){this._rebuildRowIdsFromChildren();var o=this._toRowId(t);return this._dt?this._dt.insertRow(o,e,i):""},et.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},et.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},et.prototype.moveRow=function(t,e){var i=this._toRowId(e),o=Array.isArray(t)?t:[t],n=this._toRowIds(o);return this._dt.hasSegmentation()&&this.synchronizeRowOrder(),this._dt._moveRow(n,i)},et.prototype.swapRow=i._deprecatedFunction,et.prototype.getDataTable=function(){return this._dt},et.prototype.getDataSource=function(){return this._parent},et.prototype.setDataSource=function(t){if(t){if(this._groupLevel>0)return;this._setParent(t),this._onDataChanged(Q._globalChangeArg),this._parent.listen("dataChanged",this._onDataChanged)}else this._parent&&(this._parent.unlisten("dataChanged",this._onDataChanged),this._resetAllViews(),this._groupViewDirty=!1),this._parent=this._dt=null,this._shared={}},et.prototype.setConflationRate=function(t){this._conflator.disable(!t),this._conflator.setConflatingTime(t)},et.prototype.getConflationRate=function(){return this._conflator.getConflatingTime()},et.prototype._resetAllViews=function(){this._rids.length=0,this._groupView&&this._groupView.length&&(this._groupView.length=0),this._pageView&&this._pageView.length&&(this._pageView.length=0),this._expansionView&&this._expansionView.length&&(this._expansionView.length=0)},et.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},et.prototype.sort=function(t,e,i,o){if(this._groupLevel>0)window.console.log("ERROR: Sub-group cannot be sorted individually");else{var n=this.getSortingLogics(),r=this._sortingDefs,s=r.length;if(Array.isArray(i))for(var l=i.length;--l>=0;)if("function"!=typeof i[l]){var a=Array.isArray(t)?t[l]:t;i[l]=n[a]||n._default}if(Q._buildSortContext(r,t,e,i||n),1===r.length&&0===r[0][3]&&(r.length=0),!(s<=0&&r.length<=0||this._shared.stalledRids)){var h=!1;this._groupMembers||r.length<=0||o?(h=!0,this._updateRowIds()):h=this._sort(),h&&this._dispatchDataChange(Q._positionChangeArg)}}},et.prototype.sortOnce=function(t,e){this.sort(t,e),this._sortingDefs.length=0},et.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},et.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},et.prototype.isSorting=function(){return this._sortingDefs.length>0},et.prototype.hideRow=function(t,e){this.showRows([t],!1===e)},et.prototype.hideRows=function(t,e){this.showRows(t,!1===e)},et.prototype.showRows=function(t,e){var i=!1===e;if(i)this._hiddenRids||(this._hiddenRids={});else if(!this._hiddenRids)return;for(var o=this._toRowIds(t),n=o.length;--n>=0;){var r=o[n];r&&(this._hiddenRids[r]=i)}this._refreshAndNotify()},et.prototype.unhideAllRows=function(){this._hiddenRids&&(this._hiddenRids=null,this._refreshAndNotify())},et.prototype.hasHiddenRow=function(){return!!this._hiddenRids},et.prototype.filterIn=function(t,e,i){var o=this._getFilterLogic(t,e),n=!0===i;return!!(this._userFilter!==o||"function"==typeof t||o&&n!==this._filteringOut)&&(this._shared.filterLogic=o,this._userFilter=o,this._filteringOut=n,this._refreshAndNotify(),!0)},et.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},et.prototype.filterInOnce=function(t,e,i){var o=this._getFilterLogic(t,e);if(o){for(var n=!0===i,r=this._rids,s=this._dt,l={},a=0,h=r.length;--h>=0;){var u=r[h],p=s.getRowData(u);p&&o(u,p)!==n||(l[u]=!0,++a)}if(!(a<=0)){var _=this._removeRowIds(l);this._updatePageCount()||this._transformView(_)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(Object.keys(l))}}},et.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},et.prototype._removeRowIds=function(t){var e=this._removeArrayItems(this._rids,t);if(this._groupView&&(e=this._removeArrayItems(this._groupView,t)),this._groupMembers)for(var i=this._groupList.length,o=0;o<i;++o){var n=this._groupList[o];this._groupMembers[n]._removeRowIds(t)}return e},et.prototype.clearFilter=function(){this._userFilter&&(this._userFilter=null,this._shared.filterLogic=null,this._refreshAndNotify())},et.prototype.disablePageCorrection=function(t){this._pageCorrection=!1===t},et.prototype.setPage=function(t){var e=this._setPage(t);return e&&this._dispatchGlobalChange(),e},et.prototype.gotoPage=et.prototype.setPage,et.prototype.nextPage=function(){return this.gotoPage(this._pageIndex+1)},et.prototype.previousPage=function(){return this.gotoPage(this._pageIndex-1)},et.prototype.prevPage=et.prototype.previousPage,et.prototype.lastPage=function(){return this.gotoPage(this._lastPageIndex-1)},et.prototype.firstPage=function(){return this.gotoPage(0)},et.prototype.getCurrentPage=function(){return this._pageIndex},et.prototype.getPageIndex=et.prototype.getCurrentPage,et.prototype.isOnLastPage=function(){return this._pageIndex===this._lastPageIndex},et.prototype.isOnFirstPage=function(){return 1===this._pageIndex},et.prototype.getPageSize=function(){return this._pageSize},et.prototype.getPageCount=function(){return this._lastPageIndex},et.prototype.getTotalPages=et.prototype.getPageCount,et.prototype.setPageSize=function(t){t>=0||(t=0),this._pageSize!==t&&(this._pageSize=t,this._updatePageCount(),t>0?this._pageView||(this._pageView=[]):this._pageView&&(this._pageView=null),this._pageView&&0!==t?this._transformView():this._updateRowIds(),this._dispatchGlobalChange())},et.prototype.groupBy=function(t,e){if(this._shared.multiGroupRow=!1,this._groupCriteria){if(this._groupList&&this._groupList.length>0){for(var i in this._groupMembers)this._groupMembers[i].dispose();this._groupMembers={},this._groupList.length=0}this._groupCriteria=null}var o,n,r;if(null!=e&&this._setPredefinedGroups(e),t&&0===this._groupLevel)for(this._groupCriteria=[],n=(r=Array.isArray(t)?t:[t]).length,o=0;o<n;++o){var s=r[o];"string"==typeof s?this._groupCriteria.push(this._defaultGroupCriteria.bind(this,s)):s&&this._groupCriteria.push(s)}if(this._groupCriteria)this._groupMembers||(this._groupMembers={},this._groupList=[],this._groupRows={}),this._groupView||(this._groupView=[]);else{if(this._groupMembers=null,this._groupList=null,this._groupView=null,this._groupRows){if(this._groupLevel<=0)this._footerRowIds=null;else if(this._groupRowId&&delete this._groupRows[this._groupRowId],this._footerRowIds){for(n=this._footerRowIds.length,o=0;o<n;++o)delete this._groupRows[this._footerRowIds[o]];this._footerRowIds=null}this._groupRows=null}this._groupValue=null}this._groupLevel=0,this._updateRowIds(),this._dispatch("groupCriteriaChanged",{}),this._dispatchGlobalChange()},et.prototype.addGroup=function(t){if(this._groupMembers)if(isArray(t))for(var e=t,i=e.length,o=0;o<i;++o)this._addGroup(e[o]);else this._addGroup(t)},et.prototype.sortGroups=function(t){if(this._groupMembers&&(this._groupSortingLogic=null==t?et._defaultGroupSortingLogic:t||null,this._groupSortingLogic)){this._groupList.sort(this._internalGroupSortingLogic);for(var e=this._groupList.length;--e>=0;){var i=this._groupList[e];this._groupMembers[i].sortGroups(this._groupSortingLogic)}this._groupViewDirty=!0,this._groupLevel<=0&&this._dispatchGlobalChange()}},et.prototype.moveGroup=function(t,e){var i=this.getGroup(t);if(i){var o=i.getDataSource(),n=i.getGroupId(),r=o._groupList.indexOf(n);r!==e&&r+1!==e&&(o._groupList.splice(r,1),r<e&&--e,o._groupList.splice(e,0,n),this._requestRebuildingRowIds(!1))}},et.prototype.setPredefinedGroups=function(t){this._setPredefinedGroups(t),this._groupMembers&&this._refreshAndNotify()},et.prototype._setPredefinedGroups=function(t){if(this._preDefGroups!==t){this._preDefGroups&&(this._preDefGroups.length=0);var e=!1;if(t)for(var i=t.length;--i>=0;)if(Array.isArray(t[i])){e=!0;break}e?this._preDefGroups=t:Array.isArray(t)?this._preDefGroups=[t]:this._preDefGroups=null,this._preDefGroupsDirty=!0}},et.prototype.addFooter=function(t){if(this._groupLevel<=0)console.log("WARNING: Only group can have a footer");else if(null==t&&(t=1),!(t<=0)){this._footerRowIds||(this._footerRowIds=[]);for(var e=0;e<t;++e){var i=this._groupRowId+"_footer"+(this._footerRowIds.length||"");this._footerRowIds.push(i),this._groupRows[i]=this}this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},et.prototype.removeFooter=function(){if(this._footerRowIds){for(var t=this._footerRowIds.length,e=0;e<t;++e)delete this._groupRows[this._footerRowIds[e]];this._footerRowIds=null,this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},et.prototype.enableMultiGroup=function(t){this._shared.multiGroupRow=!1!==t},et.prototype.getGroupByRowId=function(t){return this._groupRows&&this._groupRows[t]||null},et.prototype.getGroup=function(t){if(!this._groupMembers)return null;var e;if("number"==typeof t){if(!(e=this._groupList[t]))return null}else e=t+"";var i=this._groupMembers[e];if(i)return i;var o=e;return(i=this._groupRows[o])||this._getGroupByContentRowId(o)},et.prototype._getGroupByContentRowId=function(t){if(this._groupMembers)for(var e=0;e<this._groupList.length;e++){var i=this._groupList[e],o=this._groupMembers[i]._getGroupByContentRowId(t);if(o)return o}else if(-1!==this._rids.indexOf(t))return this;return null},et.prototype.getAllGroups=function(t){if(t||(t=[]),this._groupMembers)for(var e=this._groupList.length,i=0;i<e;++i){var o=this._groupList[i],n=this._groupMembers[o];t.push(n),n.getAllGroups(t)}return t},et.prototype.getGroupList=function(){return this._groupList},et.prototype.getGroupId=function(){return this._groupId},et.prototype.getGroupValue=function(){return this._groupValue},et.prototype.getGroupRowId=function(){return this._groupRowId},et.prototype.getFooterRowIndex=function(t){if(this._footerRowIds)for(var e=this._footerRowIds.length;--e>=0;)if(this._footerRowIds[e]===t)return e;return-1},et.prototype.getFooterRowIds=function(){return this._footerRowIds},et.prototype.hasGroup=function(){return!!this._groupMembers},et.prototype.getGroupRows=function(){return null},et.prototype.getGroupLevel=function(t){if(null!=t&&this._groupRows){if("number"!=typeof t){var e=this.getGroup(t);return e?e._groupLevel:-1}this._rebuildRowIdsFromChildren();for(var i=this._getRids(),o=i[t];o;){var n=this._groupRows[o];if(n)return n._groupLevel;o=i[--t]}}return this._groupLevel},et.prototype.enableColumnStats=function(t,e,i){if(!t)return null;var o=!1!==e,n=this._columnStats[t];if(o?(n||(n=new J(this,t),this._columnStats[t]=n),n.addRef(i)):n&&(n.deRef(i)||(n.dispose(),delete this._columnStats[t])),this._groupMembers)for(var r=this._groupList.length;--r>=0;){var s=this._groupList[r];this._groupMembers[s].enableColumnStats(t,e,i)}return n||null},et.prototype.getColumnStats=function(t){return this._columnStats[t]||null},et.prototype.hide=function(t){var e=!1!==t;return this._hidden!==e&&(this._hidden=e,this._refreshAndNotify(),!0)},et.prototype.isHidden=function(){return this._hidden},et.prototype.isHiddenRow=function(t){return!!this._hiddenRids&&!0===this._hiddenRids[t]},et.prototype._isHeaderRowShown=function(){return!(this._hiddenHeaderRow||this._shared.filterLogic&&0===this._rids.length||this._shared.autoGroupHiding&&null==this._groupValue)},et.prototype._setCollapse=function(t){if(this._shared.contentAsHeader){if(this._hiddenHeaderRow&&this._showOnlyFirstMember!==t)return this._showOnlyFirstMember=t,!0}else if(this._isHeaderRowShown()&&this._collapsed!==t)return this._collapsed=t,!0;return!1},et.prototype.collapse=function(t){this._setCollapse(!1!==t)&&(this._shared.contentAsHeader?this._hiddenHeaderRow&&this._requestRebuildingRowIds(this._showOnlyFirstMember):this._groupLevel>0&&this._requestRebuildingRowIds(this._collapsed))},et.prototype.collapseAllGroups=function(t){var e=this.getAllGroups(),i=e.length;if(i){for(var o=!1!==t,n=0;n<i;++n)e[n]._setCollapse(o);this._requestRebuildingRowIds(!1)}},et.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},et.prototype.isCollapsed=function(){return this._collapsed||this._showOnlyFirstMember},et.prototype.enableContentAsHeader=function(t){this._shared.contentAsHeader=!1!==t},et.prototype._getFirstHiddenRids=function(){if(this._shared.contentAsHeader&&this._showOnlyFirstMember){var t=this._rids;if(Array.isArray(t)&&t.length)return[t[0]]}return null},et.prototype.getVisibleRowCount=function(){return this._collapsed?0:(this._rebuildRowIdsFromChildren(),this._getRids().length)},et.prototype.isRowDataInGroup=function(t,e){var i=this._groupCriteria,o=this._groupLevel;if(!e||e===this.getGroupId())return this._isAllowedInGroup(null,t);for(var n=o;n<i.length;n++)if(i[n](t).indexOf(e)>=0)return!0;return!1},et.prototype.isRowIdInGroup=function(t,e){var i=this.getRowData(t);return!!i&&this.isRowDataInGroup(i,e)},et._getDataViewExpansionId=function(t,e){return t+"_ex"+e},et.prototype.addRowExpansion=function(t,e){if(!(this._groupLevel>0)){if(!e||e<0){if(null!=e)return;e=1}var i=this._rids.indexOf(t);if(!(i<0)){var o=0;this._expansionMap?o=this._expansionMap[t]||0:(this._expansionMap={},this._expansionChildren={});var n=o+e;this._expansionMap[t]=n;for(var r=o;r<n;r++)this._expansionChildren[et._getDataViewExpansionId(t,r)]=t;if(o||this._expansionCount++,!this._groupViewDirty&&this._updateExpansionView()){var s={};s.rid=t,s.type="inserted",s.nextRid=this._rids[i+1],s.fallback=i,this._dispatchDataChange(s)}}}},et.prototype.removeRowExpansion=function(t){if(this._expansionMap){var e=this._expansionMap[t];if(e){for(var i=new Array(e),o=0;o<e;++o)i[o]=et._getDataViewExpansionId(t,o),delete this._expansionChildren[i[o]];delete this._expansionMap[t],this._expansionCount--,this._groupViewDirty||this._updateExpansionView()&&(1===e?this._dispatchRowRemoved(i[0]):this._dispatchMultiRowRemoved(i))}}},et.prototype.toggleRowExpansion=function(t,e,i){var o=this._toRowId(t);(e=null!=e?!0===e:!this.hasRowExpansion(o))?this.addRowExpansion(o,i):this.removeRowExpansion(o)},et.prototype.removeAllRowExpansions=function(){this._expansionMap&&(this._expansionMap=null,this._expansionCount=0,this._expansionView=null,this._expansionChildren=null,this._refreshAndNotify())},et.prototype.getRowsWithExpansion=function(t,e){if(!this._expansionMap)return[];var i=this._expansionView,o=i.length;(null==e||e>o)&&(e=o),t>0||(t=0);for(var n=this._expansionCount,r=new Array(o),s=t;s<e;++s){var l=i[s];if(this._expansionMap[l]&&(r[s]=l,--n<=0))break}return r},et.prototype.getExpansionParents=function(t,e){var i=[];if(this._expansionMap){var o=this._expansionView,n=o.length;(null==e||e>n)&&(e=n),(!t||t<0)&&(t=0);for(var r=t;r<e;++r)i[r]=this._expansionChildren[o[r]]||""}return i},et.prototype.isRowExpansion=function(t){return!!this._expansionChildren&&!!this._expansionChildren[t]},et.prototype.hasRowExpansion=function(t){return!!this._expansionMap&&!!this._expansionMap[t]},et.prototype.getRowExpansionId=function(t,e){return this._expansionMap&&(e||(e=0),e<(this._expansionMap[t]||0))?et._getDataViewExpansionId(t,e):""},et.prototype.getRowExpansionIndex=function(t){if(t){var e=t.match(/_ex(\d+)$/);if(e)return+e[1]}return-1},et.prototype._updateExpansionView=function(){var t=this._expansionMap;if(t){if(!this._expansionCount||this._expansionCount<0)return this._expansionCount=0,this._expansionMap=null,this._expansionView=null,this._expansionChildren=null,!0;var e=this._pageView||this._groupView||this._rids,i=e.length,o=this._expansionView?this._expansionView.length:0;this._expansionView?this._expansionView.length=i:this._expansionView=new Array(i);for(var n=this._expansionCount,r=0,s=0;r<i;++r){var l=e[r];if(this._expansionView[s++]=l,n){var a=t[l]||0;if(a){for(var h=0;h<a;++h)this._expansionView[s++]=et._getDataViewExpansionId(l,h);--n}}}return o!==this._expansionView.length}return!1},et.prototype._transformView=function(t){var e=this._updatePaginationView(t);return!!(e|=this._updateExpansionView())},et.prototype.searchAll=function(t,e){e||(e=[]),this._rebuildRowIdsFromChildren();for(var i=this._getRids(),o=i.length,n=0;n<o;++n){var r=i[n],s=this._dt.getRowData(r);s&&t(s)&&e.push(r)}return e},et.prototype.searchPrev=function(t,e){this._rebuildRowIdsFromChildren();var i=this._getRids(),o=-1;"number"==typeof t?this._dt.getRowData(i[t])&&(o=t):o=i.indexOf(t);var n=-1,r=i.length;return o>0&&(n=this._searchRow(i,e,o-1,-1,-1))>=0||o>=0&&(n=this._searchRow(i,e,r-1,o,-1))>=0?n:-1},et.prototype.searchNext=function(t,e){this._rebuildRowIdsFromChildren();var i=this._getRids(),o=-1;if("number"==typeof t?this._dt.getRowData(i[t])&&(o=t):o=i.indexOf(t),o<0)return-1;var n=-1,r=i.length;return o<r-1&&(n=this._searchRow(i,e,o+1,r,1))>=0||o>0&&(n=this._searchRow(i,e,0,o,1))>=0?n:-1},et.prototype._searchRow=function(t,e,i,o,n){for(;i!==o;){var r=t[i],s=this._dt.getRowData(r);if(s&&e(s))return i;i+=n}return-1},et.prototype.stall=function(t){var e=!1!==t;if(!!this._shared.stalledRids===e)return!1;if(e){var i={};this._shared.stalledRids=i;for(var o=this._getRids(),n=o.length;--n>=0;)i[o[n]]=1}else this._shared.stalledRids=null,this._refreshAndNotify();return!0},et.prototype.enableAutoGroupRemoval=function(t){return t=!1!==t,!!this._shared.autoGroupRemoval!==t&&(this._shared.autoGroupRemoval=t,this._triggerGroupRefreshing(),!0)},et.prototype.enableAutoGroupHiding=function(t){return t=!1!==t,!!this._shared.autoGroupHiding!==t&&(this._shared.autoGroupHiding=t,this._triggerGroupRefreshing(),!0)},et.prototype.synchronizeRowOrder=function(){this.isSorting()&&this._dt._sort(this._sortingDefs)},et.prototype.setSegmentSeparator=function(t,e){var i="";return"number"==typeof t?i=this.getRowId(t):"string"==typeof t&&(i=t),!!i&&((e=!1!==e)&&this.synchronizeRowOrder(),this._dt.setSegmentSeparator(i,e))},et.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},et.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},et.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},et.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},et.prototype.collapseSegment=function(t,e){e=!1!==e;var i=this._dt._getSegmentSeparators();if(i){var o=this._toRowId(t);if(i.collapseSegment(o,e))return this._refreshAndNotify(),!0}return!1},et.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},et.prototype.expandAllSegments=function(){var t=this._dt._getSegmentSeparators();return!(!t||!t.expandAllSegments()||(this._refreshAndNotify(),0))},et.prototype.setSegmentCollapsingLogic=function(){},et.prototype.isSegmentCollapsed=function(t){var e=this._dt._getSegmentSeparators();return!!e&&e.isCollapsedSegment(this._toRowId(t))},et.prototype.fillSegment=function(t){this._dt.fillSegment(this._toRowId(t))},et.prototype.fillSegments=function(){this._dt.fillSegments()},et.prototype.addSegmentChild=function(t,e){if(this._dt._getSegmentSeparators()){var i=this._toRowId(t),o=this._toRowId(e);return this._dt.addSegmentChild(i,o)}return!1},et.prototype.addSegmentChildren=function(t,e){if(this._dt._getSegmentSeparators()){var i=this._toRowId(t),o=this._toRowIds(e);return this._dt.addSegmentChildren(i,o)}return!1},et.prototype.removeSegmentChild=function(t,e){if(this._dt._getSegmentSeparators()){var i=this._toRowId(t),o=this._toRowId(e);return this._dt.removeSegmentChild(i,o)}return!1},et.prototype.removeSegmentChildren=function(t,e){if(this._dt._getSegmentSeparators()){var i=this._toRowId(t),o=this._toRowIds(e);return this._dt.removeSegmentChildren(i,o)}return!1},et.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},et.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},et.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},et.prototype.sortSegments=function(t){this._dt.sortSegments(t)},et.prototype._getSharedObject=function(){return this._shared},et.prototype.getWrapSize=function(){return this._wrapSize},et.prototype.getWrappedViews=function(){return this._wrappedViews},et.prototype.wrapView=function(t){null!=t&&((!t||t<0)&&(t=0),this._wrapSize!==t&&(this._wrapSize=t,this._dispatch("wrapSizeChanged",{wrapSize:t,rids:this.getVisibleRowIds(!0)}))),this._updateWrapCount()},et.prototype._updateWrapCount=function(){this._wrapTimerId=0;var t,e=this._wrapSize,i=this._wrappedViews,o=i?i.length:0,n=0;if(e){var r=this.getVisibleRowIds(!0),s=r.length;if(o<(n=Math.ceil(s/e)))for(i||(i=this._wrappedViews=[]),t=o;t<n;++t)this._wrappedViews[t]=new Z({dataView:this,wrapIndex:t,rids:r})}if(n<o){for(t=o;--t>=n;)this._wrappedViews[t].dispose();this._wrappedViews.length=n}e||(this._wrappedViews=null),o!==n&&this._dispatch("wrapCountChanged",{prevCount:o,newCount:n})},et.prototype.dump=function(t){this._rebuildRowIdsFromChildren();var e=this._getRids();return W.constructTable(this.getMultipleRowData(e),t,e)},et.prototype.log=function(t){console.table(this.dump(t))},et.prototype._getRids=function(){return this._expansionView||this._pageView||this._groupView||this._rids},et.prototype._updateRowIds=function(t){if(this._groupViewDirty=!1,this._parent&&!this._hidden){if(!this._shared.stalledRids){this._rids=t||this._parent.getAllRowIds(),this._hiddenRids&&this._removeArrayItems(this._rids,this._hiddenRids);var e=this._dt._getSegmentSeparators();this._collapsedRids=null;var i=null;if(e){i=e.getSegments();var o=this._collapsedRids=e.getCollapsedRows();o&&this._removeArrayItems(this._rids,o)}if(this._dispatch("beforeFiltering",{}),this._quickFilter(this._userFilter,this._filteringOut,i),this._groupLevel>0&&!t&&this._quickFilter(this._groupFilterLogic,!1),this._groupMembers)this._populateGroups();else{var n=this._updatePageCount();this._sort()||n||this._transformView()}}}else this._resetAllViews()},et.prototype._onDataChanged=function(t){if(!this._conflator.conflate(t)){var e=this._conflator.popAllData()||[t],i=e.length;if(1===i){var o=e[0];if(o.globalChange)return this._updateRowIds(),void this._dispatchDataChange(t);var n=o.type;"inserted"===n?this._onRowInserted(o):"removed"===n?this._onRowRemoved(o):this._onRowUpdated(o)}else{this._updateRowIds();for(var r=!0,s=0;s<i;s++)if(!e[s].positionChangeOnly){r=!1;break}this._dispatchDataChange({globalChange:!0,positionChangeOnly:r,events:e})}}},et.prototype._onRowInserted=function(t){if(this._shared.stalledRids)return 0;if(this.isRowFiltered(t.rid,t.rowData))return 0;var e=0;if(this._groupMembers){var i,o=this._resolveGroupId(t.rowData),n=o.length;n>1&&(this._shared.multiGroupRow=!0);for(var r=0;r<n;r++)if(i=o[r],this._groupMembers[i])e=this._groupMembers[i]._onRowInserted(t);else{var s=this._addGroup(i);s&&(t.globalChange=!0,s._onRowInserted(t),e=1)}t.globalChange&&(this._groupViewDirty=!0)}if(this._hidden)return e;var l=t.rid,a=t.rowData;if(!this._isAllowedInGroup(l,a))return e;var h,u=t.nextRid;h=this.isSorting()&&!t.segmentChanged?this._addDataRow(l):this._addDataRow(l,u,t.fallback);var p=this._updatePageCount(),_=this._sort();return _&&(t.globalChange=!0),t.globalChange?_||p||this._transformView():(t={rid:l,rowData:a,type:"inserted"},null!=u&&(t.nextRid=u,t.fallback=h),this._transformView(h)&&(t.globalChange=!0)),this._dispatchDataChange(t),1},et.prototype._onRowRemoved=function(t){if(this._shared.stalledRids)return 0;if(t.segmentChanged&&this.isSorting())return this._refreshAndNotify(),1;var e,i=0,o=t.rids;if(this._groupMembers){var n,r,s=t.rowData;if(!o&&s){for(n=this._resolveGroupId(s),e=0;e<n.length;e++)r=n[e],this._groupMembers[r]&&(i+=this._groupMembers[r]._onRowRemoved(t));i>1&&(this._groupViewDirty=!0)}else{var l=this._groupList.length;for(e=0;e<l;++e)r=this._groupList[e],i+=this._groupMembers[r]._onRowRemoved(t)}}var a,h,u=NaN,p=null;if(i=0,o){for(p=[],e=o.length;--e>=0;)a=o[e],(h=this._removeDataRow(a))>=0&&(p.push(a),h>=u||(u=h));i=p.length}else a=t.rid,(h=this._removeDataRow(a))>=0&&(p=[a],u=h,i=1);return i>0&&(this._updatePageCount()||this._transformView(u)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(p),this._shared.autoGroupRemoval&&this._groupRows&&this._rids.length<=0&&this._triggerGroupRefreshing(),this._hiddenHeaderRow&&this._requestRebuildingRowIds(!0)),i},et.prototype._onRowUpdated=function(t){var e,i,o=t.rid,n=t.rowData;if(this.isRowFiltered(o,n))return this._onRowRemoved(t)?1:0;if(this._groupMembers){var r=[],s=this._groupList.length;for(e=0;e<s;++e)i=this._groupList[e],r[this._groupMembers[i]._onRowUpdated(t)]=!0;t.globalChange&&(this._groupViewDirty=!0);var l=0;if(r[2]?l=2:r[1]?this._isAllowedInGroup(o,n)||(l=1):r[4]&&(l=4),this._groupLevel>0)1===l?(this._removeArrayItem(this._rids,o)>=0&&this._groupView&&this._removeArrayItem(this._groupView,o),this._shared.multiGroupRow&&(this._groupViewDirty=!0)):2===l&&(this._hidden||(this._rids.indexOf(o)<0&&this._rids.push(o),this._groupViewDirty=!0,this._resolveGroupId(n).length>1&&(this._shared.multiGroupRow=!0)));else{var a=r[1]&&r[2]||r[4];if(this._shared.multiGroupRow||!a){var h=this._resolveGroupId(n);for(e=0;e<h.length;e++){i=h[e];var u=this._addGroup(i);u&&(u._onRowInserted(t),l=1)}}!a&&!this._hidden&&this._rids.indexOf(o)<0&&this._addDataRow(o),4===l?this._shared.multiGroupRow?this._dispatchGlobalChange():this._dispatchDataChange(t):(this._groupViewDirty=!0,this._dispatchGlobalChange())}return l}return this._isAllowedInGroup(o,n)?this._rids.indexOf(o)<0?(this._onRowInserted(t),2):(this._shared.stalledRids||this._sort()&&(t.globalChange=!0),this._dispatchDataChange(t),4):this._onRowRemoved(t)?1:0},et.prototype._onGroupAdded=function(t){if(!this._hidden){var e=t.newGroup,o=e.getGroupRowId();this._groupView.push(o),this._groupViewDirty=!0,this._dispatch("groupAdded",t),i.pushArrayItems(this._groupView,e.getFooterRowIds())}},et.prototype._onBeforeGroupAdded=function(t){this._dispatch("beforeGroupAdded",t)},et.prototype._requestRebuildingRowIds=function(t){this._groupMembers&&(this._groupViewDirty=!0),this._groupLevel>0?this._parent._requestRebuildingRowIds(t):(t?this._rebuildRowIdsFromChildren():this._updateRowIds(),this._dispatchGlobalChange())},et.prototype._refreshAndNotify=function(){this._updateRowIds(),this._dispatchGlobalChange()},et.prototype._onRefreshTimeout=function(){this._refreshTimerId=0,this._refreshAndNotify()},et.prototype._addDataRow=function(t,e,i){var o=this._getRowIndex(this._rids,e,i);return this._insertItems(this._rids,o,t),this._groupView?this._groupMembers?(this._groupViewDirty=!0,this._insertItems(this._groupView,-1,t)):o<0?this._insertItems(this._groupView,-1,t):(o=this._getRowIndex(this._groupView,e,i),this._insertItems(this._groupView,o,t)):o>=0?o:this._rids.length-1},et.prototype._insertItems=function(t,e,i){return e<0?(e=t.length,t.push(i)):t.splice(e,0,i),e},et.prototype._getRowIndex=function(t,e,i){if(null==e)return-1;var o=this._rids.indexOf(e);return o>=0?o:null==i||i>=t.length?-1:i},et.prototype._removeDataRow=function(t){var e=this._removeArrayItem(this._rids,t);return this._groupView&&e>=0&&(e=this._removeArrayItem(this._groupView,t)),e},et.prototype._removeArrayItem=function(t,e){for(var i=t.length,o=0;o<i;++o)if(t[o]===e)return t.splice(o,1),o;return-1},et.prototype._removeArrayItems=function(t,e){for(var i=NaN,o=0,n=t.length;--n>=0;)e[t[n]]?++o:o&&(i=n+1,t.splice(i,o),o=0);return o&&(t.splice(0,o),i=0),i},et.prototype._isAllowedInGroup=function(t,e){if(this._groupLevel>0)for(var i=this,o=this._groupLevel;--o>=0;){if(!i._groupFilterLogic(t,e))return!1;i=i.getDataSource()}return!0},et.prototype.isRowFiltered=function(t,e){return this._shared.stalledRids?!this._shared.stalledRids[t]:!((!this._hiddenRids||!this._hiddenRids[t])&&(this.isSegmentSeparator(t)||(!this._collapsedRids||!this._collapsedRids[t])&&(!this._userFilter||this._userFilter(t,e)!==this._filteringOut)))},et.prototype._sort=function(){if(this._groupMembers)return!1;if(this._dt._getSegmentSeparators()||this.isSorting()){var t=this._rids,e=this._dt.getMultipleRowData(t),i=this._dt.getSegmentValues(t),o=Q._performMultiLevelSorting(e,this._sortingDefs,i);if(o)return this._rids=Q._reorderItems(t,o),this._transformView(),!0}return!1},et.prototype._quickFilter=function(t,e,i){if(t){for(var o=this._rids,n=o.length,r=this._dt,s=0,l=n;--l>=0;){var a=o[l],h=!1;if(!i||!i[a]){var u=r.getRowData(a);h=!u||t(a,u)===e}h?++s:s>0&&(o.splice(l+1,s),s=0)}s>0&&o.splice(0,s)}},et.prototype._getFilterLogic=function(t,e){return null!=t?"function"==typeof t?t:"string"==typeof t?et._defaultFilterLogic.bind(null,t,e):et._defaultFilterLogic.bind(null,t+"",e):null},et.prototype._setPage=function(t){return t>this._lastPageIndex&&this._pageCorrection&&(t=this._lastPageIndex),t<1&&(t=1),t!=this._pageIndex&&(this._pageIndex=t,this._transformView(),this._dispatch("pageIndexChanged",{pageIndex:this._pageIndex}),!0)},et.prototype._updatePaginationView=function(t){var e=!1;if(this._pageView){t||(t=0);var i=this._pageSize*(this._pageIndex-1),o=this._pageSize+i;if(t<o){var n=this._groupView||this._rids;o>n.length&&(o=n.length);var r=o-i;this._pageView.length=r>=0?r:0;for(var s=i;s<o;++s)this._pageView[s-i]=n[s];e=!0}}return e},et.prototype._updatePageCount=function(){var t=1;if(this._pageSize>0){var e=this._groupView||this._rids,i=e.length>0?e.length:0;t=Math.ceil(i/this._pageSize)}return!!(this._lastPageIndex!==t&&(this._lastPageIndex=t,this._dispatch("pageCountChanged",{pageCount:this._lastPageIndex}),this._lastPageIndex<this._pageIndex&&this._pageCorrection))&&this._setPage(this._lastPageIndex)},et.prototype._dispatchRowRemoved=function(t){t&&this._dispatchDataChange({type:"removed",rid:t})},et.prototype._dispatchMultiRowRemoved=function(t){if(t){var e=t.length;1===e?this._dispatchRowRemoved(t[0]):e>1&&this._dispatchDataChange({type:"removed",rids:t})}},et.prototype._dispatchGlobalChange=function(){this._dispatchDataChange(Q._globalChangeArg)},et.prototype._dispatchDataChange=function(t){this._dispatch("dataChanged",t),this._wrapSize&&!this._wrapTimerId&&(this._wrapTimerId=setTimeout(this._updateWrapCount))},et.prototype._setParent=function(t){this._parent=t,this._dt=t;do{(t=t.getDataSource())&&(this._dt=t)}while(t);if(this._parent&&this._dt!==this._parent){this._shared=this._parent._shared;var e=this._parent._columnStats;if(e)for(var i in e){var o=this.enableColumnStats(i),n=this._parent.getColumnStats(i);o&&n&&o.setColumnDataGetter(n.getColumnDataGetter())}}},et.prototype._populateGroups=function(){var t,e,i,o,n,r,s=this._rids;this._rids=[];var l={},a=[];for(e=s.length,t=0;t<e;++t){var h=s[t],u=this._dt.getRowData(h);if(u){(r=(n=this._resolveGroupId(u)).length)>1&&(this._shared.multiGroupRow=!0);for(var p=0;p<r;p++){var _=l[o=n[p]];_?_.push(h):(_=[h],l[o]=_,a.push(o))}}}if(this._shared.autoGroupRemoval)for(t=e=this._groupList.length;--t>=0;)l[o=this._groupList[t]]||(i=this._groupMembers[o])&&!i._predefinedGroup&&this._removeGroupMember(t,o);var d=null;if(this._preDefGroups&&this._groupLevel<this._preDefGroups.length&&(d=this._preDefGroups[this._groupLevel]),e=this._groupList.length,this._preDefGroupsDirty)for(this._preDefGroupsDirty=!1,t=e;--t>=0;)o=this._groupList[t],(i=this._groupMembers[o])&&i._predefinedGroup&&(d?d.indexOf(i._groupId)<0&&this._removeGroupMember(t,o):this._removeGroupMember(t,o));if(d)for(e=d.length,t=0;t<e;++t){var c=this._addGroup(d[t]);c&&(c._predefinedGroup=!0)}for(e=a.length,t=0;t<e;++t)this._addGroup(a[t]);for(e=this._groupList.length,t=0;t<e;++t)o=this._groupList[t],(i=this._groupMembers[o])._updateRowIds(l[o]),i._markColumnStatsDirty();this._groupViewDirty=!0,this._rebuildRowIdsFromChildren()},et.prototype._removeGroupMember=function(t,e){var i=this._groupMembers[e];i&&(this._groupList.splice(t,1),delete this._groupMembers[e],i.dispose())},et.prototype._defaultGroupCriteria=function(t,e){var i=e[t];return Array.isArray(i)?i.map((function(t){return t+""})):[i+""]},et.prototype._groupFilterLogic=function(t,e){return this._groupCriteria[this._groupLevel-1](e).indexOf(this._groupId)>=0},et.prototype._internalGroupSortingLogic=function(t,e){var i=this._groupMembers[t],o=this._groupMembers[e];return this._groupSortingLogic(t,e,i,o)},et.prototype._addGroup=function(t){var e=t+"";if(!e)return null;var i=this._groupMembers[e];if(i)return null;var o,n=(this._groupRowId||"_grp")+"_"+e;return this._hasListener("beforeGroupAdded")&&(o={dataView:this,newGroupId:e,newGroupValue:t,newGroupRowId:n,newGroupLevel:this._groupLevel+1},this._dispatch("beforeGroupAdded",o),o.cancel)?null:((i=new et)._groupId=e,"string"==typeof t?"null"==t?i._groupValue=null:"undefined"!=t&&(i._groupValue=t):i._groupValue=t,o&&!0===o.hideHeaderRow&&(i._hiddenHeaderRow=!0),i._groupRowId=n,i._groupLevel=this._groupLevel+1,i._groupCriteria=this._groupCriteria,i._preDefGroups=this._preDefGroups,i._groupLevel<i._groupCriteria.length&&(i._groupMembers={},i._groupList=[],i._groupView=[]),i._groupRows=this._groupRows,i._setParent(this),i._sortingDefs=this._sortingDefs,this._groupMembers[e]=i,this._groupList.push(e),this._groupRows[i._groupRowId]=i,this._hidden||(i._isHeaderRowShown()&&this._groupView.push(i._groupRowId),this._groupViewDirty=!0,i._beingAdded=!0,this._dispatch("groupAdded",{dataView:this,newGroup:i}),i._beingAdded=!1),i.listen("groupAdded",this._onGroupAdded),this._hasListener("beforeGroupAdded")&&i.listen("beforeGroupAdded",this._onBeforeGroupAdded),i)},et.prototype._triggerGroupRefreshing=function(){this._groupLevel>0?this._parent&&this._parent._triggerGroupRefreshing():this._groupRows&&!this._refreshTimerId&&(this._refreshTimerId=setTimeout(this._onRefreshTimeout,100))},et.prototype._rebuildRowIdsFromChildren=function(){if(this._groupViewDirty){if(this._rids.length=0,this._groupView&&(this._groupView.length=0),!this._hidden)for(var t=this._groupList.length,e=0;e<t;++e){var o=this._groupList[e],n=this._groupMembers[o];if(n._rebuildRowIdsFromChildren(),i.pushArrayItems(this._rids,n._rids),!this._collapsed&&this._groupView&&(n._isHeaderRowShown()&&this._groupView.push(n._groupRowId),!n._collapsed)){var r=n._getFirstHiddenRids()||n._groupView||n._rids;i.pushArrayItems(this._groupView,r),i.pushArrayItems(this._groupView,n._footerRowIds)}}this._groupViewDirty=!1,this._updatePageCount()||this._transformView()}},et.prototype._resolveGroupId=function(t){return this._groupCriteria[this._groupLevel](t)},et.prototype._markColumnStatsDirty=function(){for(var t in this._columnStats)this._columnStats[t].markDirty()},et._defaultFilterLogic=function(t,e,i,o){return o[t]===e},et._defaultGroupSortingLogic=function(t,e){return t==e?0:t<e?-1:1};const it=et;var ot=function(t,e,i){this._onConflated=this._onConflated.bind(this),this._data=[],"function"==typeof t?this.setFunction(t,i):"function"==typeof e&&this.setFunction(e,i),"number"==typeof e?this.setConflatingTime(e):"number"==typeof t&&this.setConflatingTime(t)};ot.prototype._data,ot.prototype._func=null,ot.prototype._delay=0,ot.prototype._timerId=0,ot.prototype._conflated=!1,ot.prototype._disabled=!1,ot.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},ot.prototype.popAllData=function(){if(this._data.length){var t=this._data;return this._data=[],t}return null},ot.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},ot.prototype.conflate=function(t){return!this._disabled&&(null!=t&&this._data.push(t),!this._conflated&&(this._timerId||(this._timerId=setTimeout(this._onConflated,this._delay)),!0))},ot.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},ot.prototype._onConflated=function(){this._conflated=!0;try{this._func()}catch(t){console.error(t.message||t)}this._timerId=0,this._data.length=0,this._conflated=!1},ot.prototype.getData=function(){return this._data},ot.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},ot.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},ot.prototype.disable=function(t){this._disabled=!1!==t},ot.prototype.isEnabled=function(){return!this._disabled},ot.prototype.enable=function(t){this._disabled=!1===t},ot._proto=ot.prototype;const nt=ot;var rt=function(t){var e=this;e._onDataChanged=e._onDataChanged.bind(e),e.extendEventArg=e.extendEventArg.bind(e),e._dataChangedConflator=new nt(100,e._onDataChanged),e._grid=t,e._grid.setEventArgExtender("rowCountChanged",e.extendEventArg),e._grid.setEventArgExtender("rowHeightChanged",e.extendEventArg),e._grid.setEventArgExtender("rowAvailable",e.extendEventArg),e._grid.listen("rowAvailable",e._dispatch.bind(this,"rowAvailable")),e._addEvent("dataChanged"),e._addEvent("rowAvailable")};h.inherits(rt,s),rt._runningId=0,rt.prototype._id="",rt.prototype._type="",rt.prototype._grid=null,rt.prototype._snapshot=null,rt.prototype._dataView=null,rt.prototype._dataArg=null,rt.prototype._autoSyncRowCount,rt.prototype._bindingEnabled=!0,rt.prototype._parent=null,rt.prototype._children=null,rt.prototype._dataChangedConflator,rt.prototype.getId=function(){return this._id},rt.prototype.setId=function(t){return this._id=t||"section"+rt._runningId++,this._grid.setAttribute("id",this._id),this._id},rt.prototype.getSection=function(){return this._snapshot||this._grid},rt.prototype.getSectionName=function(){return this._grid.getId()},rt.prototype.getIndex=function(){return this._grid.getIndex()},rt.prototype.getType=function(){return this._type},rt.prototype.setType=function(t){this._type!==t&&(this._type&&this._grid.removeClass(this._type),this._type=t||"",t&&this._grid.addClass(t))},rt.prototype.getDataSource=function(){return this._dataView},rt.prototype.setDataSource=function(t){var e=this;e.getAutoSyncRowCount()&&e._dataView!==t&&(e._dataView&&e._dataView.unlisten("dataChanged",this._onDataChanged),e._dataChangedConflator.reset(),e._dataArg=null,e._dataView=t,null!==e._dataView&&e._dataView.listen("dataChanged",e._onDataChanged),e._dispatchDataChanged(0,NaN))},rt.prototype.getRootDataSource=function(){if(!this._dataView)return null;var t=this._dataView.getDataSource();if(!t)return null;for(;t.getDataSource();)t=t.getDataSource();return t},rt.prototype.getData=function(t,e){return this._dataView?(e=this._getRowId(e),this._dataView.getData(e,t)):null},rt.prototype.setData=function(t,e,i){return!!this._dataView&&(e=this._getRowId(e),this._dataView.setData(e,t,i),!0)},rt.prototype.getRowData=function(t){return this._dataView?(t=this._getRowId(t),this._dataView.getRowData(t)):null},rt.prototype.removeRowData=function(t){if(!this._dataView)return!1;var e=this.getRootDataSource();if(!e)return!1;t=this._getRowId(t);var i=e.getRowIndex(t);return!(i<0||(e.removeRow(i),0))},rt.prototype.activateColumns=function(t,e,i){if("content"===this._type)for(var o=i+1;--o>=e;){var n=t[o];null!=n&&this._grid.activateColumn(o,n)}},rt.prototype.getChildren=function(){return this._children},rt.prototype.setParent=function(t){if(this._parent){var e=this._parent._children.indexOf(this);e>=0&&(this._parent._children.splice(e,1),this._parent._children.length<=0&&(this._parent._children=null)),this._parent=null}this._parent=t,this._parent&&(this._parent._children||(this._parent._children=[]),this._parent._children.push(this))},rt.prototype.getParent=function(){return this._parent},rt.prototype.getDataChangedConflator=function(){return this._dataChangedConflator},rt.prototype.disableConflation=function(t){this._dataChangedConflator.disable(t)},rt.prototype.disableDataBinding=function(t){this._bindingEnabled=!1===t},rt.prototype.getAutoSyncRowCount=function(){return null!=this._autoSyncRowCount?this._autoSyncRowCount:"content"===this._type},rt.prototype.setAutoSyncRowCount=function(t){if(this._autoSyncRowCount=t,this.getAutoSyncRowCount()){var e=this._dataView?this._dataView.getVisibleRowCount():0;this._grid.setRowCount(e)}},rt.prototype.isDataBindable=function(){return!(!this._bindingEnabled||!this._dataView)},rt.prototype.dispose=function(){var t=this;t._dataChangedConflator.reset(),t._dataArg=null,t._grid&&t._grid.dispose(),t._dataView&&t._dataView.unlisten("dataChanged",t._onDataChanged),t.unlistenAll(),t.setParent(null),t._grid=null,t._dataView=null},rt.prototype.extendEventArg=function(t){return t||(t={}),t.sectionSettings!==this&&(t.sectionSettings=this,t.section=this._snapshot||this._grid,t.sectionName=this._grid.getId(),t.sectionIndex=this._grid.getIndex(),t.sectionType=this._type,t.dataSource=this._dataView,this._snapshot?t.print=!0:t.print&&(t.print=!1)),t},rt.prototype.extendRenderEventArg=function(t,e,i){return t=this.extendEventArg(t),e>=0||(this._snapshot?(e=0,i=this._grid.getRowCount()):(e=this._grid.getFirstIndexInView(),i=this._grid.getLastIndexInView()+1)),t.fromRowIndex=e,t.toRowIndex=i,t},rt.prototype.extendDataEventArg=function(t,e,i){var o,n;if(t||(t={}),t.firstUpdate=e,t.lastUpdate=i,this._snapshot?(o=0,n=this._grid.getRowCount()):(o=this._grid.getFirstIndexInView(),n=this._grid.getLastIndexInView()+1),t.fromRowIndex=e>o?e:o,this._dataView){var r=this._dataView.getVisibleRowCount();t.dataRowCount=r,n>r&&(n=r)}return t.toRowIndex=i+1<n?i+1:n,this.extendEventArg(t),t},rt.prototype.setIndex=function(t){this._grid.setIndex(t)},rt.prototype.getRowOffset=function(){return this._grid.getRowOffset()},rt.prototype.setRowOffset=function(t){this._grid.setRowOffset(t)},rt.prototype.enableColumnVirtualization=function(t){t=!1!==t,"content"===this._type&&this._grid.enableColumnVirtualization(t)},rt.prototype.isBinding=function(){return this._isEventDispatching("dataChanged")},rt.prototype._onDataChanged=function(t){if(!this.isBinding()){if(this._bindingEnabled){if(t)this._mergeEvent(t);else if(!this._dataArg)return}else if(!this.getAutoSyncRowCount())return;this._dataChangedConflator.conflate()||(this._calculateChangeIndices(),this._dataArg?this._dispatchDataChanged(this._dataArg.firstUpdate,this._dataArg.lastUpdate):this._dispatchDataChanged(0,NaN))}},rt.prototype._dispatchDataChanged=function(t,e){var i=this.getAutoSyncRowCount(),o=this._dataView?this._dataView.getVisibleRowCount():0,n=this._grid.getRowCount();i?o!==n&&this._grid.setRowCount(o,!0):o>n&&(e=n-1),this.updateRowData(t,e,this._dataArg),this._dataArg=null},rt.prototype.updateRowData=function(t,e,i){this.isDataBindable()&&(i=this.extendDataEventArg(i,t,e)).fromRowIndex<i.toRowIndex&&this._dispatch("dataChanged",i)},rt.prototype.rerender=function(){this.isDataBindable()?this.updateRowData():this._dispatch("rowAvailable",this.extendEventArg())},rt.prototype.snapshot=function(t){if(t){this._snapshot=t;try{t.setColumnCount(this._grid.getColumnCount()),t.setRowCount(this._grid.getRowCount()),this._dispatch("rowAvailable",this.extendEventArg())}catch(t){console.warn("Unable to take a snapshot: "+t.message)}this._snapshot=null,this._dispatch("rowAvailable",this.extendEventArg())}},rt.prototype._getRowId=function(t){return i.isNumber(t)?this._dataView.getRowId(t):t},rt.prototype._mergeEvent=function(t){var e=this._dataArg;if(e||((e=this._dataArg={}).actualUpdate=!0,e.positionChangeOnly=!0,e.events=[],e.firstUpdate=NaN,e.lastUpdate=NaN,e.updatedRids={}),t.positionChangeOnly||(e.positionChangeOnly=!1),t.events?e.events=e.events.concat(t.events):e.events.push(t),!e.globalChange){if(t.globalChange)return e.globalChange=!0,e.firstUpdate=0,void(e.lastUpdate=NaN);var i=t.rids;if(i)for(var o=i.length;--o>=0;)e.updatedRids[i[o]]=!0;else t.rid&&(e.updatedRids[t.rid]=!0);"updated"!==t.type&&(e.indexShifted=!0,"removed"===t.type&&(e.dataRemoved=!0))}},rt.prototype._calculateChangeIndices=function(){var t,e;if(this.isDataBindable()&&!this._dataArg.globalChange)if(this._dataArg.indexShifted){if(this._dataArg.dataRemoved)this._dataArg.firstUpdate=0;else for(t in this._dataArg.updatedRids)(e=this._dataView.getRowIndex(t))>=0&&(this._dataArg.firstUpdate<=e||(this._dataArg.firstUpdate=e));this._dataArg.lastUpdate=this._dataView.getVisibleRowCount()}else for(t in this._dataArg.updatedRids)(e=this._dataView.getRowIndex(t))>=0&&(this._dataArg.firstUpdate<=e||(this._dataArg.firstUpdate=e),this._dataArg.lastUpdate>=e||(this._dataArg.lastUpdate=e))},rt._proto=rt.prototype;const st=rt;var lt=function(t){this._layout=t,this._arg={},this._addEvent("indexChanged")};h.inherits(lt,s),lt.prototype._layout,lt.prototype._viewSize=0,lt.prototype._viewOffset=0,lt.prototype._startOffsetCount=0,lt.prototype._endOffsetCount=0,lt.prototype._bufferSize=0,lt.prototype._arg=null,lt.prototype._enabled=!0,lt.prototype._active=!0,lt.prototype._virtualizable=!1,lt.prototype._getMinIndex=function(){return this._startOffsetCount},lt.prototype._getMaxIndex=function(){var t=this._layout.getLaneCount()-this._endOffsetCount;return t>this._startOffsetCount?t:this._startOffsetCount},lt.prototype.getContentStart=function(t){return this._layout.getLaneStart(t)},lt.prototype.getContentInViewCount=function(){var t=this.getFirstIndexInView(),e=this.getLastIndexInView();return t>=0&&t<e?e-t+1:0},lt.prototype._getContentSizeInBounds=function(){var t=this._getMinIndex(),e=this._getMaxIndex();return this._layout.getLaneStart(e)-this._layout.getLaneStart(t)},lt.prototype.getViewSize=function(){return this._viewSize},lt.prototype.getViewOffset=function(){var t=this._getMinIndex();return this._viewOffset+this._layout.getLaneStart(t)},lt.prototype.getIndexOffset=function(){return this._startOffsetCount},lt.prototype.isVirtualizable=function(){return this._virtualizable},lt.prototype.getFirstIndexInView=function(){if(!this._virtualizable)return 0;var t=this.getViewOffset(),e=this._layout.getTrackSize();return t>=e&&(t=e-this._viewSize),t<0?0:this._layout.hitTest(t)},lt.prototype.getLastIndexInView=function(){if(this._virtualizable){var t=this.getViewOffset()+this._viewSize,e=this._getMaxIndex();return t>=this._layout.getLaneStart(e)?e-1:this._layout.hitTest(t)}return this._layout.getLaneCount()-1},lt.prototype.getPrevFirstIndexInView=function(){return null!=this._arg.prevFirstIndex?this._arg.prevFirstIndex:-1},lt.prototype.getPrevLastIndexInView=function(){return null!=this._arg.prevLastIndex?this._arg.prevLastIndex:-1},lt.prototype.update=function(t){if(!(!0===t||this._enabled&&this._active))return!1;if(this._isEventDispatching("indexChanged"))return!1;var e=this.getFirstIndexInView(),i=this.getLastIndexInView(),o=this._arg.prevFirstIndex!==e||this._arg.prevLastIndex!==i;return(t||o)&&(this._arg.firstIndex=e,this._arg.lastIndex=i,this._dispatch("indexChanged",this._arg),this._arg.prevFirstIndex=e,this._arg.prevLastIndex=i),o},lt.prototype.isEnabled=function(){return this._enabled},lt.prototype.enable=function(t){t=!1!==t,this._enabled!==t&&(this._enabled=t,this.validateVirtualization(),this.update(!0))},lt.prototype.disable=function(t){this.enable(!1===t)},lt.prototype.isActive=function(){return this._active},lt.prototype.activate=function(t){t=!1!==t,this._active!==t&&(this._active=t,this.validateVirtualization(),this.update(!0))},lt.prototype.deactivate=function(t){this.activate(!1===t)},lt.prototype.getBufferSize=function(){return this._bufferSize},lt.prototype.setContentLayout=function(t){this._layout!==t&&(this._layout=t,this.validateVirtualization())},lt.prototype.setViewSize=function(t){t<0&&(t=0),this._viewSize!==t&&(this._viewSize=t,this.validateVirtualization())},lt.prototype.setViewOffset=function(t){this._viewOffset=t>0?t:0,this.update()},lt.prototype.setViewBounds=function(t,e){this._startOffsetCount=t>0?t:0,this._endOffsetCount=e>0?e:0,this.validateVirtualization()},lt.prototype.setBufferSize=function(t){t<0&&(t=0),this._bufferSize!==t&&(this._bufferSize=t,this.validateVirtualization())},lt.prototype.validateVirtualization=function(){this._virtualizable=!1,this._enabled&&this._active&&this._viewSize>0&&this._getContentSizeInBounds()>this._viewSize&&(this._virtualizable=!0)},lt._proto=lt.prototype;const at=lt;var ht=function(){var t=this;t._vertical=!0,t._hostClassName="vscrollbar-host",ht.base(this,"constructor"),t._onScroll=t._onScroll.bind(t),t._addPaneAt(),t._element.classList.add("grid-vscroll"),t._trackContent.style.width="1px",t.disableMouseWheel(!1),t.listen("scroll",t._onScroll),t._addEvent("contentScrolled")};h.inherits(ht,k),ht.prototype.setScrollContent=function(t,e,i){this._clearAllPanes();var o=e.length;if(!(o<=0)){for(var n=this._panes[0],r=this._paneSliders[0],s=0;s<i;)e[s++].setParent(t);n.setParent(t);for(var l=o-this._footerCount;s<l;)e[s++].setParent(r);for(;s<o;)e[s++].setParent(t);this.invalidateContent()}},ht.prototype.setHeight=function(t){return this.setTrackSize(t,t),!0},ht.prototype.getHeight=function(){return this.getPaneSize()},ht.prototype.getScrollTop=function(){return this._getScrollValue()},ht.prototype.setScrollTop=function(t){this.update(),this._scrollTo(t)},ht.prototype.isEndOfVerticalScroll=function(){return this._isEndOfScroll()},ht.prototype.getContentHeight=function(){for(var t=this._paneSliders[0].getContent(!0),e=0,i=t.length;--i>=0;)e+=t[i].offsetHeight;return e},ht.prototype.calculateContentSize=function(){return this.getContentHeight()},ht.prototype.getPane=function(){return this._panes[0]},ht.prototype._onScroll=function(t){this._dispatch("contentScrolled",t)},ht._proto=ht.prototype;const ut=ht;var pt=function(t,e){return t>e?e:t<0?0:t},_t=function(t){var e=this;e._onRestingPosition=e._onRestingPosition.bind(e),e._updateRowBounds=e._updateRowBounds.bind(e),e._element=document.createElement("div"),e._element.className="tr-vlg section",t||(t={}),t.horizontalScrollbar&&(e._hscrollbar=t.horizontalScrollbar),t.owner=this,e._grid=new B(t),e._grid.setParent(e._element),e._layoutY=new y,e._selectionList=new T,e._reverter=new M(e._onRestingPosition,200),e._addEvent("rowHighlighted"),e._addEvent("rowCountChanged"),e._addEvent("rowHeightChanged"),e._addEvent("rowAvailable")};h.inherits(_t,p),_t.prototype._index=-1,_t.prototype._firstIndex=0,_t.prototype._grid,_t.prototype._layoutY,_t.prototype._selectionList=null,_t.prototype._reverter=null,_t.prototype._rowBound=null,_t.prototype._cellBound=null,_t.prototype._cbLftIdx=0,_t.prototype._cbRgtIdx=0,_t.prototype._cbTopIdx=0,_t.prototype._cbBtmIdx=0,_t.prototype._rowBoundTimer=0,_t.prototype._boundLayer=null,_t.prototype._hscrollbar=null,_t.prototype.getWidth=function(){return this.isVisible()?this._grid.getWidth():0},_t.prototype.getHeight=function(){return this.isVisible()?this._element.offsetHeight:0},_t.prototype.dispose=function(){this.setRowCount(0),this.unlistenAll(),this._hscrollbar=null,this._grid.dispose(),this._dispose(),this._reverter.dispose(),this._rowBoundTimer&&(clearTimeout(this._rowBoundTimer),this._rowBoundTimer=0)},_t.prototype.setWidth=function(t){return this._grid.setWidth(t)},_t.prototype.setHeight=function(t){return console.log("unsupported"),!1},_t.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._dispatchRowHeightChangedEvent(0,this._layoutY.getLaneCount())},_t.prototype.hitTest=function(t,e){var i=[];return i.colIndex=this._grid.hitTestX(t),i.rowIndex=this._layoutY.hitTest(e),i},_t.prototype.hitTestX=function(t){return this._grid.hitTestX(t)},_t.prototype.hitTestY=function(t){return this._layoutY.hitTest(t)},_t.prototype.getDefaultColumnWidth=function(){return this._grid.getDefaultColumnWidth()},_t.prototype.setDefaultColumnWidth=function(t){this._grid.setDefaultColumnWidth(t)},_t.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},_t.prototype.setDefaultRowHeight=function(t){this._layoutY.getDefaultLaneSize()!==t&&(this._layoutY.setDefaultLaneSize(t),this._element.style.height=this._layoutY.getTrackSize()+"px",this._grid.setDefaultRowHeight(t),this._dispatchRowHeightChangedEvent(0,this._layoutY.getLaneCount()))},_t.prototype.getColumnWidth=function(t){return this._grid.getColumnWidth(t)},_t.prototype.setColumnWidth=function(t,e){return this._grid.setColumnWidth(t,e)},_t.prototype._setColumnWidth=function(t,e){return this._grid._setColumnWidth(t,e)},_t.prototype._updateColumnLayout=function(){this._grid._updateColumnLayout()},_t.prototype.getRowHeight=function(t){return this._layoutY.getLaneSize(t)},_t.prototype.setRowHeight=function(t,e){return!!this._layoutY.setLaneSize(t,e)&&(this._grid.setRowHeight(t-this._firstIndex,e),this._element.style.height=this._layoutY.getTrackSize()+"px",this._requestUpdatingRowBounds(),this._dispatchRowHeightChangedEvent(t,t+1))},_t.prototype.isColumnVisible=function(t){return this._grid.isColumnVisible(t)},_t.prototype.hideColumn=function(t,e){return this._grid.hideColumn(t,e)},_t.prototype.isRowVisible=function(t){return this._grid.isRowVisible(t-this._firstIndex)},_t.prototype.hideRow=function(t,e){return this._grid.hideRow(t-this._firstIndex,e)},_t.prototype.getMinimumColumnWidth=function(t){return this._grid.getMinimumColumnWidth(t)},_t.prototype.setMinimumColumnWidth=function(t,e){return this._grid.setMinimumColumnWidth(t,e)},_t.prototype.getMinimumRowHeight=function(t){return this._layoutY.getMinimumLaneSize(t)},_t.prototype.setMinimumRowHeight=function(t,e){return console.log("unsupported"),!1},_t.prototype.getCellLeft=function(t){return this._grid.getCellLeft(t)},_t.prototype.getCellTop=function(t){return this._layoutY.getLaneStart(t)},_t.prototype.getCellWidth=function(t,e){return this._grid.getCellWidth(t,0)},_t.prototype.getCellHeight=function(t,e){return this._layoutY.getLaneSize(e)},_t.prototype.hasCellSpan=function(){return this._grid.hasCellSpan()},_t.prototype.getCellRowSpan=function(t,e){return this._grid.getCellRowSpan(t,e-this._firstIndex)},_t.prototype.setCellRowSpan=function(t,e,i){return this._grid.setCellRowSpan(t,e-this._firstIndex,i)},_t.prototype.getCellColSpan=function(t,e){return this._grid.getCellColSpan(t,e-this._firstIndex)},_t.prototype.setCellColSpan=function(t,e,i){return this._grid.setCellColSpan(t,e-this._firstIndex,i)},_t.prototype.clearCellSpans=function(){return this._grid.clearCellSpans()},_t.prototype.clearColumnSpans=function(t){return this._grid.clearColumnSpans(t)},_t.prototype.clearColumnCustomizations=function(){this._grid.clearColumnCustomizations()},_t.prototype.clearRowCustomizations=function(){this._layoutY.clearLaneCustomizations(),this._grid.clearRowCustomizations()},_t.prototype.getColumnScalability=function(t){return this._grid.getColumnScalability(t)},_t.prototype.setColumnScalability=function(t,e){return this._grid.setColumnScalability(t,e)},_t.prototype.getRowScalability=function(t){return this._layoutY.getLaneScalability(t)},_t.prototype.setRowScalability=function(t,e){return console.log("unsupported"),!1},_t.prototype.getCell=function(t,e,i){return this._grid.getCell(t,e-this._firstIndex,i)},_t.prototype.getCellContent=function(t,e){return this._grid.getCellContent(t,e-this._firstIndex)},_t.prototype.setCellContent=function(t,e,i){return this._grid.setCellContent(t,e-this._firstIndex,i)},_t.prototype.getColumnCount=function(){return this._grid.getColumnCount()},_t.prototype.setColumnCount=function(t){this._grid.setColumnCount(t)},_t.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},_t.prototype.setRowCount=function(t,e){var i=this._layoutY.getLaneCount();i!==t&&(this._layoutY.setLaneCount(t),this._element.style.height=this._layoutY.getTrackSize()+"px",this._requestUpdatingRowBounds(),this._dispatch("rowCountChanged",{rowCount:t,prevCount:i,noBinding:e}))},_t.prototype.getVisibleRowCount=function(){return this.getRowCount()},_t.prototype.addRow=function(t){t<=0||(this._grid.getColumnCount()<=0?console.log("WARNING: Row cannot be added, unless at least one column is added"):this.setRowCount(this._layoutY.getLaneCount()+t))},_t.prototype.removeRow=function(t){if(!(t<=0)){var e=this._layoutY.getLaneCount();t>e&&(t=e),this.setRowCount(e-t)}},_t.prototype.setBorders=function(t,e,i,o){this._grid.setBorders(t,e,i,o)},_t.prototype.getColumnStyle=function(t,e){return this._grid.getColumnStyle(t,e)},_t.prototype.setColumnStyle=function(t,e,i){this._grid.setColumnStyle(t,e,i)},_t.prototype.enableColumnClass=function(t,e,i){this._grid.enableColumnClass(t,e,i)},_t.prototype.hasColumnClass=function(t,e){return this._grid.hasColumnClass(t,e)},_t.prototype.enableRowClass=function(t,e,i){this._grid.enableRowClass(t-this._firstIndex,e,i)},_t.prototype.setRowStyle=function(t,e,i,o){this._grid.setRowStyle(t-this._firstIndex,e,i,o)},_t.prototype.getContentWidth=function(){return this._grid.getContentWidth()},_t.prototype.getContentHeight=function(){return this._layoutY.getTrackSize()},_t.prototype.getCellsByRowIndex=function(t){return this._grid.getCellsByRowIndex(t-this._firstIndex)},_t.prototype.disableHorizontalGridLine=function(t){this._grid.disableHorizontalGridLine(t)},_t.prototype.disableVerticalGridLine=function(t){this._grid.disableVerticalGridLine(t)},_t.prototype.enableShading=function(t){this._grid.enableShading(t)},_t.prototype.setTransposedShading=function(t){this._grid.setTransposedShading(t)},_t.prototype.enableRowHighlighting=function(t){this._grid.enableRowHighlighting(t)},_t.prototype.getRowHighlight=function(){var t=this._grid.getRowHighlight();return t>=0&&(t+=this._firstIndex),t},_t.prototype.setRowHighlight=function(t){var e=this._grid.getRowHighlight();if(e>=0&&(e+=this._firstIndex),this._grid.setRowHighlight(t-this._firstIndex),(t=this._grid.getRowHighlight())>=0&&(t+=this._firstIndex),this._hasListener("rowHighlighted")){var i={};i.prevRowIndex=e,i.rowIndex=t,this._dispatch("rowHighlighted",i)}},_t.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},_t.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},_t.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},_t.prototype.setSelectedRow=function(t,e){this._selectionList.setSelection(t,e);var i=this._selectionList.getSelection(t);this._grid.setSelectedRow(t-this._firstIndex,i),i&&this._initRowBounds(),this._updateRowBounds()},_t.prototype.selectSingleRow=function(t){this._selectionList.clearAllSelections(),this._grid.clearSelectedRows(),this.setSelectedRow(t)},_t.prototype.selectRowRange=function(t,e){this._selectionList.selectRange(t,e),this._updateRowSelection(),this._initRowBounds(),this._updateRowBounds()},_t.prototype.clearSelectedRows=function(){var t=this._selectionList.clearAllSelections();return this._grid.clearSelectedRows(),this._updateRowBounds(),t},_t.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},_t.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},_t.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},_t.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},_t.prototype.activateColumn=function(t,e){this._grid.activateColumn(t,e)},_t.prototype.activateRows=function(t,e,i){var o=this._layoutY.getLaneCount();t||(t=this._rowOffset),e||0===e||(e=t+o),(t-=this._rowOffset)<0&&(t=0),(e-=this._rowOffset)<0&&(e=0);var n=this._getInnerRowCount(),r=this._firstIndex,s=0;(s=t-(1&t))<0?s=0:s>o&&(s=o);var l=e+(1&e)-s;l+2===n&&(l=n),l<0?l=0:l+s>o&&(l=o-s),this._firstIndex=s;var a=s+l,h=this._layoutY.getLaneStart(s),u=this._grid.getElement();u&&(u.style.transform=h?"translateY("+h+"px)":"",u.style.top="",this._reverter.start()),this._grid._onEnterDocument();var p=!1;if(l!==n){if(this._grid.setRowCount(l),l>n){var _={};_.prevRowIndex=s+n,_.rowIndex=s+l,i&&(_.noDataUpdate=!0),this._dispatch("rowAvailable",_)}p=!0}if(i){if(!p){this._grid.clearSelectedRows();var d=r+n;s<r&&r<a&&d>=a?(this.moveRowsToTop(a-r),i[0]=s,i[1]=r):r<s&&s<d&&a>=d?(this.moveRowsToTop(s-r),i[0]=d,i[1]=a):s===r&&a===d?(i[0]=0,i[1]=0):p=!0}p&&(i[0]=s,i[1]=a)}this._layoutY.isHomogeneous()||this._grid._updateRowHeights(this._layoutY,s),this._updateRowSelection()},_t.prototype.moveRowsToTop=function(t){this._grid.moveRowsToTop(t)},_t.prototype.getFirstIndexInView=function(){return this._firstIndex},_t.prototype.getLastIndexInView=function(){return this._firstIndex+this._getInnerRowCount()-1},_t.prototype.isInCurrentView=function(t){return this._firstIndex<=t&&t<this._firstIndex+this._getInnerRowCount()},_t.prototype.getFrozenLayout=function(){return this._grid.getFrozenLayout()},_t.prototype.setFrozenLayout=function(t){this._grid.setFrozenLayout(t)},_t.prototype.getColumn=function(t){return this._grid.getColumn(t)},_t.prototype.insertColumn=function(t,e){return this._grid.insertColumn(t,e)},_t.prototype.removeColumnAt=function(t){return this._grid.removeColumnAt(t)},_t.prototype.moveColumn=function(t,e){this._grid.moveColumn(t,e)},_t.prototype.enableRowVirtualization=function(t){},_t.prototype.enableColumnVirtualization=function(t){this._grid.enableColumnVirtualization(t)},_t.prototype.getColumnIndex=function(t){return this._grid.getColumnIndex(t)},_t.prototype.getCellIndex=function(t,e){var i=this._grid.getCellIndex(t,e);return i<0?-1:i+this._firstIndex},_t.prototype.getIndex=function(){return this._index},_t.prototype.setIndex=function(t){this._index=t},_t.prototype.setRowOffset=function(t){this._rowOffset=t},_t.prototype.getRowOffset=function(){return this._rowOffset},_t.prototype.updateLayout=function(){this._grid.updateLayout()},_t.prototype.stretchCell=function(t,e,i,o){return this._grid.stretchCell(t,null!=e?e-this._firstIndex:null,i,o)},_t.prototype.unstretchCell=function(t,e){return this._grid.unstretchCell(t,null!=e?e-this._firstIndex:null)},_t.prototype.unstretchAllCells=function(){this._grid.unstretchAllCells()},_t.prototype.getStretchedCell=function(t,e){return this._grid.getStretchedCell(t,null!=e?e-this._firstIndex:null)},_t.prototype.getStretchedCells=function(){return this._grid.getStretchedCells()},_t.prototype.updateStretchedCells=function(){return this._grid.updateStretchedCells()},_t.prototype.getColumnHost=function(){return this._grid.getElement()},_t.prototype.setHidingMethod=function(t){this._grid.setHidingMethod(t)},_t.prototype.getHidingMethod=function(){return this._grid.getHidingMethod()},_t.prototype.setColumnVisibility=function(t,e,i){return this._grid.setColumnVisibility(t,e,i)},_t.prototype.getRowLayout=function(){return this._layoutY},_t.prototype.reserveRightSpace=function(t){return this._grid.reserveRightSpace(t)},_t.prototype.getReservedSpace=function(){return this._grid.getReservedSpace()},_t.prototype.getComputedStyle=function(){return this._grid.getComputedStyle()},_t.prototype.isColumnActive=function(t){return this._grid.isColumnActive(t)},_t.prototype.setRowAttributes=function(t,e){return this._grid.setRowAttributes(t,e)},_t.prototype.getContextRow=function(t){return this._grid.getContextRow(t-this._firstIndex)},_t.prototype.selectColumn=function(t,e){this._grid.selectColumn(t,e)},_t.prototype.isSelectedColumn=function(t){return this._grid.isSelectedColumn(t)},_t.prototype.selectCell=function(t,e,i){this._grid.selectCell(t,e-this._firstIndex,i)},_t.prototype.setCellBounds=function(t,e,i,o){var n=this._cellBound;n||((n=this._cellBound=document.createElement("div")).className="selection-bound"),this._initBoundLayer();var r=t+i,s=e+o,l=this.getColumnCount(),a=this._layoutY.getLaneCount();this._cbLftIdx=pt(t,l),this._cbRgtIdx=pt(r,l),this._cbTopIdx=pt(e,a),this._cbBtmIdx=pt(s,a),this._updateCellBounds()},_t.prototype.getHorizontalLayout=function(){return this._grid.getHorizontalLayout()},_t.prototype.calculateColumnBounds=function(t,e,i,o){this._grid.calculateColumnBounds(t,e,i,o)},_t.prototype._updateCellBounds=function(){var t=this._cellBound;if(t){var e,i,o,n,r=this.getHorizontalLayout(),s=this._layoutY,l=this._cbLftIdx,a=this._cbRgtIdx,h=this._cbTopIdx,u=this._cbBtmIdx;e=i=o=n=0,l<a&&h<u&&(e=r.getLaneStart(l),i=r.getLaneEnd(a-1),o=s.getLaneStart(h),n=s.getLaneEnd(u-1));var p=i-e,_=n-o,d=[!1,!1];if(p>0&&_>0&&this._hscrollbar){var c=[0,0];this.calculateColumnBounds(l,a-1,c,d),p=(i=c[1])-(e=c[0])}if(p>0)t.style.left=e+"px",t.style.top=o+"px",t.style.width=p+"px",t.style.height=_+"px",t.classList.toggle("no-left-bound",d[0]),t.classList.toggle("no-right-bound",d[1]),this._boundLayer&&this._boundLayer.appendChild(t);else{var g=t.parentNode;g&&g.removeChild(t)}}},_t.prototype.updateColumnBounds=function(t,e){this._grid.updateColumnBounds(t,e),this._updateRowBounds()},_t.prototype._initBoundLayer=function(){var t=this._boundLayer;t||((t=this._boundLayer=document.createElement("div")).className="cover-layer",this._element.appendChild(t))},_t.prototype._initRowBounds=function(){var t=this._rowBound;t||((t=this._rowBound=document.createElement("div")).className="selection-bound"),this._initBoundLayer()},_t.prototype._requestUpdatingRowBounds=function(){this._rowBoundTimer||(this._rowBoundTimer=setTimeout(this._updateRowBounds,10))},_t.prototype._updateRowBounds=function(){this._rowBoundTimer=0,this._updateCellBounds();var t=this._rowBound;if(t){var e=this.getFirstSelectedRow(),i=-1,o=0,n=0,r=this._layoutY.getLaneCount();if(e>=r&&(e=r-1),e>=0&&((i=this.getLastSelectedRow())>=r&&(i=r-1),o=this._layoutY.getLaneStart(e),n=this._layoutY.getLaneEnd(i)),o>=n){var s=t.parentNode;s&&s.removeChild(t)}else{t.style.top=o+"px",t.style.height=n-o+"px";var l=this._grid._getViewSize();t.style.width=l+"px";var a=0,h=0,u=0,p=!1;this._hscrollbar&&(a=this._hscrollbar.getScrollLeft(),h=this._hscrollbar.getPinnedLeftColumnCount(),u=this._hscrollbar.getPinnedRightColumnCount(),p=this._hscrollbar.isEndOfHorizontalScroll()),t.classList.toggle("no-left-bound",!h&&a>0),t.classList.toggle("no-right-bound",!u&&!p),this._boundLayer&&this._boundLayer.appendChild(t)}}},_t.prototype._getInnerRowCount=function(){return this._grid.getRowCount()},_t.prototype._updateRowSelection=function(){this._grid.clearSelectedRows();var t=this._selectionList,e=t.getSelectionCount();if(!(e<=0)){var i,o=this._firstIndex,n=o+this._getInnerRowCount();if(1===e)o<=(i=t.getFirstSelectedIndex())&&i<n&&this._grid.setSelectedRow(i-o,!0);else if(e>=n-o)for(i=o;i<n;++i)t.getSelection(i)&&this._grid.setSelectedRow(i-o,!0);else for(var r=t.getAllSelections(),s=0;s<e;++s)o<=(i=r[s])&&i<n&&this._grid.setSelectedRow(i-o,!0)}},_t.prototype._dispatchRowHeightChangedEvent=function(t,e){if(t>=e)return!1;var i={};return i.rowIndex=t,i.changeLength=e-t,this._dispatch("rowHeightChanged",i),!0},_t.prototype._onRestingPosition=function(){var t=this._grid.getElement();if(t){var e=this._layoutY.getLaneStart(this._firstIndex);t.style.transform="",t.style.top=e?e+"px":""}},_t.prototype._updateRightSpaceStyle=function(){this._grid._updateRightSpaceStyle()},_t.prototype._updateLayers=function(){this._grid._updateLayers()},_t.prototype._setContext=function(t){this._grid._setContext(t)},_t.prototype._getContext=function(){return this._grid._getContext()},_t._proto=_t.prototype;const dt=_t;var ct=function(t){ct._sectionType||(ct._sectionType={},ct._sectionType.title=!0,ct._sectionType.header=!0,ct._sectionType.content=!0,ct._sectionType.footer=!0);var e=this;if(e._onMouseMove=e._onMouseMove.bind(e),e._onRowHightlighted=e._onRowHightlighted.bind(e),e._onWindowResize=e._onWindowResize.bind(e),e._onSectionDataChanged=e._onSectionDataChanged.bind(e),e._onRowCountChanged=e._onRowCountChanged.bind(e),e._onRowHeightChanged=e._onRowHeightChanged.bind(e),e._onRowAvailable=e._onRowAvailable.bind(e),e._onVScroll=e._onVScroll.bind(e),e._onHScroll=e._onHScroll.bind(e),e._onSyncVScroll=e._onSyncVScroll.bind(e),e.updateLayout=e.updateLayout.bind(e),e._onRowRefresh=e._onRowRefresh.bind(e),e._onVScrollEnabled=e._onVScrollEnabled.bind(e),e._onVScrollDisabled=e._onVScrollDisabled.bind(e),e._onRowInViewChanged=e._onRowInViewChanged.bind(e),e._onColInViewChanged=e._onColInViewChanged.bind(e),e._updateVScrollbar=e._updateVScrollbar.bind(e),e._updateColumnBounds=e._updateColumnBounds.bind(e),e._dispatchColumnPositionChanged=e._dispatchColumnPositionChanged.bind(e),e._dispatchRowPositionChanged=e._dispatchRowPositionChanged.bind(e),t)for(var o=t.childNodes.length;--o>=0;)i.isElement(t.childNodes[o])||t.removeChild(t.childNodes[o]);e._element=t||document.createElement("div"),e._element.classList.add("tr-grid"),e._layoutX=new y,e._layoutY=new y,e._layoutX.setDefaultLaneSize(100),e._layoutY.setDefaultLaneSize(32),e._settings=[],e._plugins={},e._columnDefs=[],e._sectionStarts=[],e._rowHeightException="title",e._rowVirtualizer=new at(e._layoutY),e._rowVirtualizer.deactivate(),e._rowVirtualizer.setViewSize(360),e._colVirtualizer=new at(e._layoutX),e._colVirtualizer.enable(!1),e._colVirtualizer.deactivate(),e._colVirtualizer.setViewSize(400),e._vscrollbar=new ut,e._vscrollbar.disable(),e._vscrollbar.setParent(this.getParent()||this.getElement()),e._vscrollbar.listen("scroll",e._onVScroll),e._vscrollbar.listen("layoutChanged",e._onVScroll),e._vscrollbar.listen("activated",e.updateLayout),e._vscrollbar.listen("deactivated",e.updateLayout),e._vscrollbar.listen("thicknessChanged",e.updateLayout),e._vscrollbar.listen("enabled",e._onVScrollEnabled),e._vscrollbar.listen("disabled",e._onVScrollDisabled),e._hscrollbar=new G,e._hscrollbar.disable(),e._hscrollbar.setParent(this.getParent()||this.getElement()),e._hscrollbar.listen("scroll",this._onHScroll),e._hscrollbar.listen("layoutChanged",this._onHScroll),e._hscrollbar.listen("activated",this.updateLayout),e._hscrollbar.listen("deactivated",this.updateLayout),e._hscrollbar.setOtherScrollbar(e._vscrollbar),e._vscrollbar.setOtherScrollbar(e._hscrollbar),i.isMobile?e._element.addEventListener("touchmove",this._onMouseMove,!1):e._element.addEventListener("mousemove",this._onMouseMove,!1),window.addEventListener("resize",e._onWindowResize,!1),e._rowVirtualizer.listen("indexChanged",e._onRowInViewChanged),e._colVirtualizer.listen("indexChanged",e._onColInViewChanged),e._rowHeightConflator=new nt(e._onRowHeightChanged,50),e._vScrollbarConflator=new nt(e._updateVScrollbar,200),e._columnBoundConflator=new nt(e._updateColumnBounds,10),e._columnPositionConflator=new nt(e._dispatchColumnPositionChanged,10),e._rowPositionConflator=new nt(e._dispatchRowPositionChanged,10),e._addEvents("sectionAdded","columnAdded","columnRemoved","columnMoved","columnVisibilityChanged","columnAlignmentChanged","widthChanged","dataSourceChanged","postDataSourceChanged","preSectionRender","postSectionRender","preSectionDataBinding","postSectionDataBinding","rowExpansionBinding","rowHighlighted","preForcedUpdate","rowAdded","rowRemoved","columnPositionChanged","rowPositionChanged");var n=ct.map;n||(n={},ct.map=n);var r=e._element;r._control=e;var s=r.id||r.name;s&&!n[s]||(s="_grid"+ct._runningGridId),e._id=s,n[s]=e,ct._runningGridId++;var l=document.createElement("input");l.style.position="absolute",l.style.width="0",l.style.height="0",l.style.padding="0",l.style.border="0",l.value="0",e._hiddenInput=l,r.insertBefore(l,r.firstChild),Object.defineProperty(e,"zoomFactor",{set:function(t){!t||t<0||this._zoomFactor!==t&&(this._zoomFactor=t,e._updateLayout())},get:function(){return this._zoomFactor}})};h.inherits(ct,p),ct.SectionReference,ct.MouseInfo,ct.CellReference,ct.ColumnOptions,ct._runningGridId=0,ct._runningColumnId=0,ct._sectionType,ct.prototype._plugins,ct.prototype._dataSource=null,ct.prototype._layoutX,ct.prototype._layoutY,ct.prototype._vscrollbar,ct.prototype._hscrollbar,ct.prototype._tempFrozenSectionRef="",ct.prototype._startVScrollbarIndex=-1,ct.prototype._hScrollbarEnabled=!0,ct.prototype._pinnedLeftColumnCount=0,ct.prototype._pinnedRightColumnCount=0,ct.prototype._frozenFooterCount=0,ct.prototype._fixFrozenTopSections=!1,ct.prototype._fixFrozenBottomSection=!1,ct.prototype._sectionStarts,ct.prototype._settings,ct.prototype._firstSettings,ct.prototype._lastSettings,ct.prototype._fitContentWidth=!1,ct.prototype._columnDefs,ct.prototype._rowVirtualizer,ct.prototype._colVirtualizer,ct.prototype._autoSetDataSource=!0,ct.prototype._renderingHandler=null,ct.prototype._dataBindingHandler=null,ct.prototype._frozenLayout=!1,ct.prototype._noBinding=!1,ct.prototype._rowHeightSync=!0,ct.prototype._rowHighlighting=!1,ct.prototype._dispatchingDataChanged=!1,ct.prototype._rowHeightException="",ct.prototype._rowScrollingStep=0,ct.prototype._zoomFactor=1,ct.prototype._reservedSpace=0,ct.prototype._hidingMethod="",ct.prototype._rowHeightConflator=null,ct.prototype._vScrollbarConflator=null,ct.prototype._columnBoundConflator=null,ct.prototype._rowRefreshTimer=0,ct.prototype._layoutUpdating=!1,ct.prototype._hiddenInput,ct.prototype._bottomPadding=6,ct.prototype._bottomPaddingSect=null,ct.prototype._preserveProportion=!1,ct.prototype._preserveGridSize=!1,ct.getVersion=function(){return"5.0.50"},ct.prototype.dispose=function(){var t=this._id,e=ct.map;if(e[t]){e[t]=null,this._disposed=!0,this._rowRefreshTimer&&(clearTimeout(this._rowRefreshTimer),this._rowRefreshTimer=0),this.unlistenAll(),window.removeEventListener("resize",this._onWindowResize,!1);for(var i=this._columnDefs.length;--i>=0;){var o=this._getColumnDef(i);o.renderingHandler=o.dataBindingHandler=null}for(var n in this._plugins){var r=this._plugins[n];r.unload&&r.unload(this)}this.removeAllSections();var s=this._vscrollbar._mainScrollbar;s&&(s.unlisten("scroll",this._onSyncVScroll),this._vscrollbar._mainScrollbar=null),this._vscrollbar.dispose(),this._hscrollbar.dispose(),this._rowHeightConflator.dispose(),this._vScrollbarConflator.dispose(),this._columnBoundConflator.dispose(),this._columnPositionConflator.dispose(),this._rowPositionConflator.dispose();var l=this._element;null!==l&&(l._control&&delete l._control,l.removeChild(this._hiddenInput)),this._dispose(),this._columnDefs.length=0,delete this._plugins}else console.log("WARNING: Core grid is disposed twice")},ct.prototype.isDisposed=function(){return this._disposed},ct.prototype.setParent=function(t,e){this._setParent(t,e),this._onParentChange()},ct.prototype.insertBefore=function(t){this._insertBefore(t),this._onParentChange()},ct.prototype._onParentChange=function(){var t=this.getParent()||this.getElement();this._vscrollbar._mainScrollbar||this._vscrollbar.setParent(t),this._hscrollbar.setParent(t),this._updateLayout()},ct.prototype.getConfigObject=function(t){var e=t||{},i=this.getColumnCount();e.columns||(e.columns=[]);for(var o=0;o<i;o++){var n=e.columns[o];n||(n=e.columns[o]={});var r=this._getColumnDef(o);r.styles&&(n.styles=r.styles),r.stationary&&(n.stationary=r.stationary),r.leftPinned&&(n.leftPinned=r.leftPinned),r.rightPinned&&(n.rightPinned=r.rightPinned)}this._rowHighlighting&&(e.rowHighlighting=!0),e.columnVirtualization=this._colVirtualizer.isEnabled(),this._fixFrozenTopSections&&(e.topFreezingCount=this._startVScrollbarIndex>=0&&this._startVScrollbarIndex+1),this._fixFrozenBottomSection&&(e.bottomFreezingCount=this._frozenFooterCount),this._rowScrollingStep&&(e.stepScroll=1===this._rowScrollingStep||this._rowScrollingStep),e.autoHideScrollbar=this._vscrollbar.getAutoHide();var s=this._vscrollbar.getMouseWheelSpeed();s&&(e.linearWheelScrolling=s),this.hasClass("no-borders")&&(e.borders=!1),this.hasClass("no-gridlines")&&(e.gridlines=!1),this.hasClass("no-vertical-grid-line")&&(e.verticalLines=!1),this.hasClass("no-horizontal-grid-line")&&(e.horizontalLines=!1),this._bottomPaddingSect&&(e.contentBottomPadding=this._bottomPadding),this._reservedSpace>0&&(e.contentRightPadding=this._reservedSpace);var l=this.getDataConflationRate();for(var a in l&&(e.dataConflationRate=l),this._plugins){var h=this._plugins[a];"function"==typeof h.getConfigObject&&h.getConfigObject(e)}return e},ct.prototype.fillParentWidth=function(t){if(this._fitContentWidth)return!1;if(this._layoutX.isFixedSize())return!1;var e=this._element,i=(0|e.getBoundingClientRect().width)-e.clientLeft;return null!==this._layoutX.setTrackSize(i-this._reservedSpace)},ct.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",!1!==t&&this.updateLayout()},ct.prototype.getContentWidth=function(){return this._layoutX.getTrackSize()},ct.prototype.getSectionCount=function(){return this._settings.length},ct.prototype._updateFrozenTopSections=function(){if(!this._fixFrozenTopSections){var t=this._getTopSectionCount();this._freezeTopSectionAt(t-1)}},ct.prototype._updateFrozenBottomSections=function(){if(!this._fixFrozenBottomSection){var t=this._getBottomSectionCount();this._setFrozenFooter(t)}},ct.prototype._getTopSectionCount=function(){for(var t=this._settings,e=t.length,i=0,o=0;o<e;o++){var n=t[o].getType();if("header"!==n&&"title"!==n)break;i++}return i},ct.prototype._getBottomSectionCount=function(){for(var t=this._settings,e=0,i=t.length-1;i>=0&&"footer"===t[i].getType();i--)e++;return e},ct.prototype.addSection=function(t,e){return this.addSectionAt(this.getSectionCount(),t,e)},ct.prototype.addSectionAt=function(t,e,i){var o=this._settings.length;t<0&&(t=0),t>o&&(t=o);var n=this._toSectionType(e),r="bottomPadding"===i,s=this._newSection(r?"footer":n,i);if(!s)return null;var l=s.getSection();if(r&&(s.setAutoSyncRowCount(!1),this._bottomPaddingSect=l),t>=o?(this._putToLast(l),this._settings.push(s)):(this._settings.splice(t,0,s),l.insertBefore(this._settings[t+1].getSection())),this._updateSectionIndices(t),"footer"===(n=s.getType())?this._updateFrozenBottomSections():"header"!==n&&"title"!==n||this._updateFrozenTopSections(),this._onColumnCountChanged(),this._onSectionCountChanged(!0),this._colVirtualizer.isEnabled()){var a=this._getColActivationList(),h=this.getColumnCount();s.activateColumns(a,0,h-1)}if(this._hasListener("sectionAdded")){var u=s.extendEventArg();this._dispatch("sectionAdded",u)}return l},ct.prototype.removeSection=function(t){var e=this.getSection(t);return null!==e?this.removeSectionAt(e.getIndex()):null},ct.prototype.removeSectionAt=function(t){var e=this._settings.length;if(t>=0&&t<e){var i=this._settings[t],o=i.getIndex(),n=i.getSection(),r=i.getType();return n.setRowCount(0),this._settings.splice(t,1),this._updateSectionIndices(o),"footer"===r?(this._updateFrozenBottomSections(),this._onColumnCountChanged()):"header"!==r&&"title"!==r||this._updateFrozenTopSections(),this._onSectionCountChanged(),i.dispose(),n}return null},ct.prototype.removeLastSection=function(){return this.removeSectionAt(this._settings.length-1)},ct.prototype.removeAllSections=function(){for(var t=this._settings.length,e=0;e<t;++e)this._settings[e].dispose();this._bottomPaddingSect=null,this._firstSettings=this._lastSettings=null,this._settings.length=0,this._updateSectionIndices(0),this._onSectionCountChanged()},ct.prototype.setBottomPaddingSection=function(t){var e=this._bottomPaddingSect;t?("number"==typeof t&&(this._bottomPadding=t),e||(e=this.addSection("content","bottomPadding")),e&&(e.setDefaultRowHeight(this._bottomPadding),e.getRowCount()||e.addRow(1))):e&&this.removeSection(e)},ct.prototype._updatePaddingBottomSect=function(){var t=this._bottomPaddingSect;if(t){var e=this._settings.length-1;if(e>0){var i=this._settings[e];if(i.getSection()!==t){for(var o=null,n=e;--n>=0;){var r=this._settings[n];if(r.getSection()===t){o=r;break}}if(n>=0)return this._putToLast(t),this._settings.splice(n,1),this._settings.push(o),o.setType("footer"===i.getType()?"footer":"content"),!0;this._bottomPaddingSect=null}else{var s=this._settings[e-1];s&&i.setType("footer"===s.getType()?"footer":"content")}}}return!1},ct.prototype.moveSection=function(t,e){var o=this.getSectionCount();if(t<0)t=0;else if(t>=o)return;if(e<0?e=0:e>=o&&(e=o-1),t!==e){var n=this._settings[t],r=this._settings[e];i.moveArrayItem(this._settings,t,e),r?n.getSection().insertBefore(r.getSection()):this._putToLast(n.getSection()),this._updateSectionIndices(t<=e?t:e),this._syncRowHeights(),this._onSectionCountChanged(),this._frozenLayout||this._rowVirtualizer.update(!0)}},ct.prototype.getSection=function(t){var e=this.getSectionSettings(t);return null!==e?e.getSection():null},ct.prototype.getSectionSettings=function(t){if(i.isString(t)){if(ct._sectionType[t])return this._getNextSection(1,null,t);for(var e=this._settings.length;--e>=0;)if(this._settings[e].getId()===t)return this._settings[e]}else if(null!=t){var o=-1;if(null!=t.getIndex?o=t.getIndex():i.isNumber(t)&&(o=t),o>=0&&o<this._settings.length)return this._settings[o]}return null},ct.prototype.getAllSections=function(t){if(null==t)return this._getAllSections();for(var e=this.getAllSectionSettings(t),i=e,o=i.length;--o>=0;)i[o]=e[o].getSection();return i},ct.prototype.getAllSectionSettings=function(t){if(!t)return this._settings;var e=this._settings.length,i=[];t=this._toSectionType(t);for(var o=0;o<e;++o){var n=this._settings[o];t===n.getType()&&i.push(n)}return i},ct.prototype.getSectionIndex=function(t){if(i.isNumber(t))return t;if(t instanceof MouseEvent){var e=i.getRelativePosition(t,this._element),o={};return this._hitTestY(e.y,o),o.sectionIndex}var n=this.getSection(t);return null==n?-1:n.getIndex()},ct.prototype.getSectionTop=function(t){var e=this.getSection(t);if(null==e)return 0;var i=this._layoutY.getLaneStart(e.getRowOffset());return this._startVScrollbarIndex>=0&&e.getIndex()>=this._startVScrollbarIndex&&(i-=this._vscrollbar.getScrollTop()),i},ct.prototype.getPreviousSection=function(t,e){null==t&&(t=this._settings.length);var i=this._getNextSection(-1,t,e);return null!==i?i.getSection():null},ct.prototype.getNextSection=function(t,e){var i=this._getNextSection(1,t,e);return null!==i?i.getSection():null},ct.prototype.getLastSection=function(){return this.getSection(this._settings.length-1)},ct.prototype.getCell=function(t,e,i,o){var n=this.getSection(t);return n?n.getCell(e,i,o):null},ct.prototype.getCellInfo=function(t){if(!t)return null;var e=t.colIndex,i=t.rowIndex,o=t.sectionName,n=null;if(null==e||null==i)(n=this.getRelativePosition(t)).hit||(n=null);else{o||(o="content");var r=this.getSectionSettings(o);r&&r.getSection().getCell(e,i)&&((n={}).colIndex=e,n.rowIndex=i,r.extendEventArg(n))}return n},ct.prototype.getNextCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?e:1)},ct.prototype.getPrevCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?-e:-1)},ct.prototype._getNextCellInRow=function(t,e){var i=this.getCellInfo(t);if(i){var o=i.colIndex+e,n=i.rowIndex,r=i.section;i.colIndex=o,i.cell=r.getCell(o,n)}return i},ct.prototype.getNextCell=function(t){var e=this.getNextCellInRow(t);if(e&&!e.cell){var i=e.section,o=e.colIndex=0,n=e.rowIndex;e.rowIndex=++n,e.cell=i.getCell(o,n)}return e},ct.prototype.getPrevCell=function(t){var e=this.getPrevCellInRow(t);if(e&&!e.cell){var i=e.section,o=e.colIndex=i.getColumnCount()-1,n=e.rowIndex;e.rowIndex=--n,e.cell=i.getCell(o,n)}return e},ct.prototype.getColumnCount=function(){return this._layoutX.getLaneCount()},ct.prototype.setColumnCount=function(t){var e=this._layoutX.getLaneCount();if(t>=e){this._layoutX.setLaneCount(t);for(var i=this._settings.length;--i>=0;)this._settings[i].getSection().setColumnCount(t);this._onColumnCountChanged(),this._syncLayoutToColumns(e,t),this._dispatchColumnAddedEvent(e,t-e,!1)}else this._removeColumn(e-t)},ct.prototype.insertColumn=function(t,e){var i=this.getColumnCount();t<i||(t=i),this._layoutX.insertLane(t);for(var o=this._settings.length;--o>=0;)this._settings[o].getSection().insertColumn(t);this._columnDefs.splice(t,0,null),this._deserializeColumn(t,e),this._onColumnCountChanged(),this._syncLayoutToColumns(t,t+1),this._dispatchColumnAddedEvent(t,1,t<i,e)},ct.prototype.insertColumns=function(t,e){var i=this.getColumnCount();t<i||(t=i);var o,n=0;if(Array.isArray(e)){if(1===(n=e.length))return void this.insertColumn(t,e[0]);o=e}else{if("number"!=typeof e)return void this.insertColumn(t,e);if(1===(n=e))return void this.insertColumn(t,null)}if(!(n<=0)){var r=this.freezeLayout(),s=[t,0].concat(new Array(n));Array.prototype.splice.apply(this._columnDefs,s);for(var l=0;l<n;l++){var a=t+l;this._layoutX.insertLane(a);for(var h=this._settings.length;--h>=0;)this._settings[h].getSection().insertColumn(a);var u=o&&o[l];this._deserializeColumn(a,u)}this._dispatchColumnAddedEvent(t,n,t<i,o),this.freezeLayout(r)}},ct.prototype.removeColumnAt=function(t){var e=this.getColumnCount();if(t<0||t>=e)return null;var i=-1;this._colVirtualizer.isVirtualizable()&&(i=this._colVirtualizer.getLastIndexInView());for(var o=this._layoutX.removeLaneAt(t),n=this._settings.length,r=0;r<n;++r)this._settings[r].getSection().removeColumnAt(t);var s=this._pinnedLeftColumnCount,l=this._pinnedRightColumnCount,a=this._columnDefs.splice(t,1)[0];if(this._onColumnCountChanged(),(t<s||t>=e-l)&&this._updateScrollbarWidth(!0,!0),this._syncLayoutToColumns(t,e-1,!0),a||(a={}),a.layout=o,this._hasListener("columnRemoved")){var h={atTheMiddle:!0};h.colIndex=t,h.columns="deprecated",h.columnData=a.columnData,h.colId=a.id||"",this._dispatch("columnRemoved",h)}return t<=i&&i===this._colVirtualizer.getLastIndexInView()&&this._colVirtualizer.update(),a},ct.prototype.removeAllColumns=function(){this.getColumnCount()>0&&(this._pinnedLeftColumnCount=0,this._pinnedRightColumnCount=0,this.setColumnCount(0))},ct.prototype.getStationaryColumnIndex=function(){for(var t=this.getColumnCount()-1;t>=0;t--)if(this._getColumnDef(t).stationary)return t;return-1},ct.prototype.isColumnMoveAllowed=function(t,e){if(Array.isArray(t)||(t=[t]),0===t.length||null==e)return!1;var i=this.getStationaryColumnIndex();if(i>-1){if(e<=i)return!1;for(var o=0;o<t.length;o++)if(t[o]<=i)return!1}return!0},ct.prototype.moveColumn=function(t,e){var o=this.getColumnCount();if(t<0?t=0:t>=o&&(t=o-1),e<0?e=0:e>=o&&(e=o-1),t===e)return!1;if(!this.isColumnMoveAllowed(t,e))return!1;var n=-1;this._colVirtualizer.isVirtualizable()&&(n=this._colVirtualizer.getLastIndexInView());var r=this._getColumnId(t);this._layoutX.moveLane(t,e);for(var s=this._settings.length,l=0;l<s;++l)this._settings[l].getSection().moveColumn(t,e);var a=this._columnDefs[t],h=this._countPinnedLeftColumns(),u=this._countPinnedRightColumns();if(i.moveArrayItem(this._columnDefs,t,e),this._hScrollbarEnabled&&(t<h?e>=o-u?this.freezeColumn(h-2,u+1):e>=h&&this.freezeColumn(h-2,u):a.rightPinned?e<h?this.freezeColumn(h,u-1):e<o-u&&this.freezeColumn(h-1,u-1):e<h?this.freezeColumn(h,u):e>=o-u&&this.freezeColumn(h-1,u+1)),this._hasListener("columnMoved")){var p={};p.fromColIndex=t,p.toColIndex=e,p.colId=r,this._dispatch("columnMoved",p)}return n===this._colVirtualizer.getLastIndexInView()&&(t<=n&&e>n||e<=n&&t>n)&&this._colVirtualizer.update(),!0},ct.prototype.getColumnLayout=function(){return this._layoutX},ct.prototype.updateColumnLayout=function(){this._syncLayoutToColumns(0,this.getColumnCount())},ct.prototype._deserializeColumn=function(t,e){if(e){var i,o=e.layout||e,n=e.width;null!=n&&(o.size=n),null!=(n=e.scalable)&&(o.scalable=n),null!=(n=e.minWidth)&&(o.minSize=n),null==o.scalable&&(o.scalable=null==o.size),this._layoutX.deserializeLane(t,o);var r=e.styles;for(i in r)this.setColumnStyle(t,i,r[i]);var s=e.classes;for(i in s)this.enableColumnClass(t,i,s[i]);var l=this._getColumnDef(t),a=e.dataColumnName;null!=a&&(l.dataColumnName=a),null!=(a=e.stationary)&&(l.stationary=!!a),null!=(a=e.leftPinned)&&(l.leftPinned=!!a),null!=(a=e.rightPinned)&&(l.rightPinned=!!a),this.setColumnRenderingHandler(t,e.renderingHandler),this.setColumnDataBindingHandler(t,e.dataBindingHandler),(a=e.columnData)&&this.setColumnData(t,a);var h=e.formatter||e.binding;if(Array.isArray(h)&&(h=h[0]),h&&"function"!=typeof h){var u=h.init;"function"==typeof u&&u(e,this)}}},ct.prototype.addRow=function(t){if(null==t)t=1;else if(t<=0)return;this.getColumnCount()<=0&&this.setColumnCount(1);var e=this.getLastSection();null==e&&(e=this.addSection()),e.addRow(t)},ct.prototype.removeRow=function(t){var e=this.getLastSection();null!=e&&(null==t&&(t=1),e.removeRow(t))},ct.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},ct.prototype.setSectionRowCount=function(t,e){var i=this.getSection(t);null!=i&&i.setRowCount(e)},ct.prototype.getRowIndex=function(t,e){return this._sectionStarts[t]+e},ct.prototype.getRelativeIndex=i._deprecatedFunction,ct.prototype.removeAllRows=function(){for(var t=this._settings.length,e=0;e<t;++e)this._settings[e].getSection().setRowCount(0),this._sectionStarts[e]=0;this._sectionStarts[t]=0},ct.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},ct.prototype.setDefaultRowHeight=function(t,e){if(this._layoutY.setDefaultLaneSize(t)){this._rowHeightSync=!1;var i=this._layoutY.getDefaultLaneSize();this._rowHeightException=e?"":"title";for(var o=this._settings.length,n=0;n<o;++n){var r=this._settings[n];r.getType()!==this._rowHeightException&&"bottomPadding"!==r.getId()&&r.getSection().setDefaultRowHeight(i)}this._syncRowHeights(),this._rowHeightSync=!0,this.setRowScrollingStep(this._rowScrollingStep)}},ct.prototype.getDataSource=function(){return this._dataSource},ct.prototype.setDataConflationRate=function(t){this._dataSource.setConflationRate(t)},ct.prototype.getDataConflationRate=function(){return this._dataSource.getConflationRate()},ct.prototype.setDataSource=function(t){t&&t instanceof Q&&(t=new it(t));var e={};if(e.prevDataSource=this._dataSource,this._dataSource=t||null,e.dataSource=this._dataSource,this._dispatch("dataSourceChanged",e),this._autoSetDataSource)for(var i=this._settings.length,o=0;o<i;++o)this._settings[o].setDataSource(t);return this._dispatch("postDataSourceChanged",e),this._dataSource},ct.prototype.setColumnTemplate=i._deprecatedFunction,ct.prototype.getColumnTemplate=i._deprecatedFunction,ct.prototype.getColumnRenderEvent=i._deprecatedFunction,ct.prototype.getColumnDataBindingEvent=function(t){console.log("getColumnDataBindingEvent() is deprecated. Use setColumnDataBindingHandler() instead");var e=this;return{listen:function(i){e.setColumnDataBindingHandler(t,i)},unlisten:function(){e.setColumnDataBindingHandler(t,null)}}},ct.prototype.setColumnStyle=function(t,e,o,n){if(e){var r;i.isNumber(t)||(t=0,console.log("WARNING: the first parameter for setColumnStyle must be column index")),null==n?r=this._getNestedColumnDef(t,"styles"):(n=this._toSectionType(n),r=this._getNestedColumnDef(t,n,"styles")),r[e]=o;for(var s=this._settings.length;--s>=0;){var l=this._settings[s];null!=n&&n!==l.getType()||l.getSection().setColumnStyle(t,e,o)}}},ct.prototype.enableColumnClass=function(t,e,i,o){var n;"number"!=typeof t&&(t=0),null==o?n=this._getNestedColumnDef(t,"classes"):(o=this._toSectionType(o),n=this._getNestedColumnDef(t,o,"classes"));var r=!1;if((i=!1!==i)?n[e]||(r=n[e]=!0):n[e]&&(delete n[e],r=!0),r)for(var s=this._settings.length;--s>=0;){var l=this._settings[s];null!=o&&o!==l.getType()||l.getSection().enableColumnClass(t,e,i)}return r},ct.prototype.hasColumnClass=function(t,e,i){var o;return null==i?o=this._getNestedColumnDef(t,"classes"):(i=this._toSectionType(i),o=this._getNestedColumnDef(t,i,"classes")),!(!o||!o[e])},ct.prototype.setColumnAlignment=function(t,e){var i=e?e.charAt(0).toLowerCase():"",o=0;o|=this.enableColumnClass(t,"tr-align-left","l"===i),o|=this.enableColumnClass(t,"tr-align-right","r"===i),(o|=this.enableColumnClass(t,"tr-align-center","c"===i))&&this._dispatch("columnAlignmentChanged",{colIndex:t,alignment:i})},ct.prototype.getColumnAlignment=function(t){return this.hasColumnClass(t,"tr-align-right")?"right":this.hasColumnClass(t,"tr-align-center")?"center":this.hasColumnClass(t,"tr-align-left")?"left":"default"},ct.prototype.getColumnLeft=function(t){var e=this._columnDefs[t];if(e&&e.rightPinned){for(var i=this.getElement().clientWidth,o=this._layoutX.getTrackSize(),n=o<i?o:i,r=this.getColumnCount()-1;r>=t;--r)n-=this._layoutX.getLaneSize(r);return n}return this._hScrollbarEnabled&&t>=this._pinnedLeftColumnCount?this._layoutX.getLaneStart(t)-this._hscrollbar.getScrollLeft():this._layoutX.getLaneStart(t)},ct.prototype.getColumnRight=function(t){return this.getColumnLeft(t)+this._layoutX.getLaneSize(t)},ct.prototype.getColumnWidth=function(t){return this._layoutX.getLaneSize(t)},ct.prototype.getColumnCustomLaneSize=function(t){return this._layoutX.getCustomLaneSize(t)},ct.prototype._calculateColumnWidths=function(t,e){if(!this._preserveGridSize)return e;var i,o=0,n={},r=t.length,s=new Array(r);for(i=0;i<r;i++)n[t[i]]=!0,s[i]=e[i],o+=e[i];var l=0,a=0,h=this.getColumnCount(),u=this._layoutX;for(i=0;i<h;i++)n[i]||u.isLaneVisible(i)&&(u.getLaneScalability(i)?(l+=u.getMinimumLaneSize(i),a++):l+=u.getLaneSize(i));var p=this.getContentWidth(),_=o+l-p;if(a<1||_>0){for(u.resetLaneToDefaultSize(),u.setTrackSize(p-this._reservedSpace),l=0,i=0;i<h;i++)n[i]||u.isLaneVisible(i)&&(u.getLaneScalability(i)?l+=u.getMinimumLaneSize(i):l+=u.getLaneSize(i));if((_=o+l-p)>0)for(_/=r,i=0;i<r;i++)s[i]-=_}return s},ct.prototype.setColumnWidth=function(t,e,i){var o=this._calculateColumnWidths([t],[e]),n=this._setColumnWidth(t,o[0],i);return n&&this._syncLayoutToColumns(t,t+1),n},ct.prototype.setColumnWidths=function(t,e){var i,o=0,n=[],r=[],s=[];for(i=t.length;--i>=0;){var l=t[i];null!=l&&(n.push(i),r.push(l));var a=Array.isArray(e)?e[i]:e;s.push(a)}var h=this._calculateColumnWidths(n,r);for(i=0;i<h.length;i++)o|=this._setColumnWidth(n[i],h[i],s[i]);return o&&this._syncLayoutToColumns(0,t.length),!!o},ct.prototype.isColumnVisible=function(t){return this._layoutX.isLaneVisible(t)},ct.prototype.hideColumn=function(t,e){var i=!1===e;this.setColumnVisibility(t,i,0)},ct.prototype.hideColumns=function(t,e){var i=Array.isArray(t)?t.length:0,o=[],n=this.getColumnCount();e=!1!==e;for(var r=0;r<i;++r){var s=t[r];s>=0&&s<n&&this._layoutX.hideLane(s,e,0)&&o.push(s)}if(o.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){var l={};l.colIndices=o,l.hidden=e,this._dispatch("columnVisibilityChanged",l)}},ct.prototype.showAllColumns=function(){for(var t=[],e=this.getColumnCount(),i=0;i<e;++i)this._layoutX.hideLane(i,!1,0)&&t.push(i);if(t.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){var o={};o.colIndices=t,o.hidden=!1,this._dispatch("columnVisibilityChanged",o)}},ct.prototype.getMinimumColumnWidth=function(t){return this._layoutX.getMinimumLaneSize(t)},ct.prototype.setMinimumColumnWidth=function(t,e){this._layoutX.setMinimumLaneSize(t,e)&&this._syncLayoutToColumns(t,t+1)},ct.prototype.setMinimumColumnWidths=function(t,e){for(var i=0,o=NaN,n=NaN,r=t.length;--r>=0;){var s=t[r];null!=s&&(n||(n=r),o=r,i|=this._layoutX.setMinimumLaneSize(r,s,e))}return i&&this._syncLayoutToColumns(o,n+1),!!i},ct.prototype.getColumnScalability=function(t){return this._layoutX.getLaneScalability(t)},ct.prototype.setColumnScalability=function(t,e){var o=!1;return i.isNumber(t)?(e=!1!==e,(o=this._layoutX.setLaneScalability(t,e))&&this._syncLayoutToColumns(t,t+1)):this.setDefaultColumnScalable(t),o},ct.prototype.setDefaultColumnScalable=function(t){this._layoutX.setDefaultScalability(!!t)},ct.prototype.resetColumnWidths=function(){var t=this._layoutX.resetLaneToDefaultSize();return t&&this._syncLayoutToColumns(0,this.getColumnCount()),t},ct.prototype.setColumnDefaultWidth=function(t,e){this._layoutX.setLaneDefaultSize(t,e)},ct.prototype.preserveProportion=function(t){this._preserveProportion=!0===t},ct.prototype.isProportionPreserved=function(){return this._preserveProportion},ct.prototype.preserveGridSize=function(t){this._preserveGridSize=!0===t},ct.prototype.getColumnData=function(t){return this._getColumnDef(t).columnData||null},ct.prototype.setColumnData=function(t,e){return this._getColumnDef(t).columnData=e,e},ct.prototype.newColumnData=function(t){return this.getColumnData(t)||{}},ct.prototype.setAlwaysRenderColumn=function(t,e){this.getColumnData(t).alwaysRender=!1!==e},ct.prototype._isAlwaysRenderColumn=function(t){var e=this.getColumnData(t);return!!e&&!0===e.alwaysRender},ct.prototype.getFitContentWidth=function(){return this._fitContentWidth},ct.prototype.setFitContentWidth=function(t){this._fitContentWidth!==t&&(this._fitContentWidth=t,this.enableClass("fit-width",this._fitContentWidth))},ct.prototype.loadPlugin=function(t,e){var i=null;if("string"==typeof t){var o=window.tr,n=o?o.grid:null;if(!n)return null;if(n[t])i=new n[t];else{if(!n[t+"Plugin"])return null;i=new n[t+"Plugin"]}}else i=t;if(!i||!i.getName)return null;var r=i.getName();if(!r)return null;var s=this._plugins[r];if(s){if(s===i)return s;console.log("WARNING: Two of the same "+r+"s cannot be loaded on a single grid. The existing plugin is replaced."),this.unloadPlugin(r)}return i.initialize&&i.initialize(this,e),this._plugins[r]=i,i},ct.prototype.unloadPlugin=function(t){var e;if(t){var i="";"string"==typeof t?i=t:t.getName&&(i=t.getName()),(e=this._plugins[i])||(i+="Plugin",e=this._plugins[i]),e&&(e.unload&&e.unload(this),delete this._plugins[i])}return e||null},ct.prototype.getPlugin=function(t){var e=this._plugins[t];return e||(e=this._plugins[t+"Plugin"]),e||null},ct.prototype.getPlugins=function(){var t=[];for(var e in this._plugins)t.push(this._plugins[e]);return t},ct.prototype.getPluginList=function(){var t=[];for(var e in this._plugins)t.push(e);return t},ct.prototype.freezeSection=function(t){this._fixFrozenTopSections=!0,this._freezeTopSectionAt(t)},ct.prototype._freezeTopSectionAt=function(t){if("number"==typeof t){var e=t+1;if(e===this._startVScrollbarIndex)return;this._startVScrollbarIndex=e}else this._startVScrollbarIndex=-1,"string"==typeof t&&(this._tempFrozenSectionRef=t);this._onSectionCountChanged()},ct.prototype.freezeFooter=function(t){this._fixFrozenBottomSection=!0,this._frozenFooterCount!==t&&(this._setFrozenFooter(t),this._onSectionCountChanged())},ct.prototype._setFrozenFooter=function(t){this._frozenFooterCount!==t&&(this._frozenFooterCount=t,this._vscrollbar.setFooterCount(t),this._hscrollbar.setFooterCount(t))},ct.prototype.getFooterCount=function(){return this._frozenFooterCount},ct.prototype.freezeColumn=function(t,e){var i,o=this.getColumnCount(),n=0,r=0;if(t||0===t)for(this._hScrollbarEnabled=!0,n=t>=0?t+1:0,this._pinnedLeftColumnCount=n,i=0;i<o;++i)this._getColumnDef(i).leftPinned=--n>=0;else this._hScrollbarEnabled=!1;if(null!=e)for(r=e>0?e:0,this._pinnedRightColumnCount=r,i=o;--i>=0;)this._getColumnDef(i).rightPinned=--r>=0;this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0)},ct.prototype._countPinnedLeftColumns=function(){var t=0;if(this._hScrollbarEnabled)for(var e=this._columnDefs.length;--e>=0;){var i=this._columnDefs[e];if(i&&i.leftPinned){t=e+1;break}}return this._pinnedLeftColumnCount=t,t},ct.prototype._countPinnedRightColumns=function(){var t=0;if(this._hScrollbarEnabled){var e,i=this._columnDefs.length;for(e=0;e<i;++e){var o=this._columnDefs[e];if(o&&o.rightPinned)break}t=i-e}return this._pinnedRightColumnCount=t,t},ct.prototype.isPinnedColumn=function(t){return t<this.getFrozenColumnCount()||t>=this.getFirstPinnedRightIndex()},ct.prototype.getFrozenColumnCount=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:0},ct.prototype.getPinnedLeftColumnCount=ct.prototype.getFrozenColumnCount,ct.prototype.getPinnedRightColumnCount=function(){return this._pinnedRightColumnCount},ct.prototype.getFirstPinnedRightIndex=function(){return this.getColumnCount()-this._pinnedRightColumnCount},ct.prototype.updateLayout=function(){this._disposed||this._layoutUpdating||(this._layoutUpdating=!0,this._dispatch("preForcedUpdate",{}),this._updateLayout(),this._colVirtualizer.isEnabled()&&this._activateColumns(),this._layoutUpdating=!1)},ct.prototype.updateScrollbars=function(t,e){e&&this._updateScrollbarWidth(!0,!1),t&&this._updateScrollbarHeight(!0,!1)},ct.prototype.freezeLayout=function(t){t=!1!==t;var e=this._frozenLayout;if(e!==t){var i;this._frozenLayout=t,this._frozenLayout||(this._disableEvent("widthChanged"),this._onSectionCountChanged(),this._onColumnCountChanged(),this._colVirtualizer.isEnabled()&&this._activateColumns()),this._rowHeightSync=!1;var o=this._settings.length;for(i=0;i<o;i++)this._settings[i].getSection().setFrozenLayout(this._frozenLayout);this._frozenLayout||(this._syncLayoutToColumns(0,this.getColumnCount()),this._disableEvent("widthChanged",!1),this._dispatch("widthChanged",{}),this._syncRowHeights()||this._rowVirtualizer.update(!0)),this._rowHeightSync=!0}return e},ct.prototype.unfreezeLayout=function(t){this.freezeLayout(!1===t)},ct.prototype.isLayoutFrozen=function(){return this._frozenLayout},ct.prototype.showBorders=i._deprecatedFunction,ct.prototype.hideBorders=i._deprecatedFunction,ct.prototype.toggleBorders=function(t){this.toggleClass("no-borders",null!=t?!t:null)},ct.prototype.toggleGridlines=function(t){this.toggleClass("no-gridlines",null!=t?!t:null)},ct.prototype.toggleVerticalLines=function(t){this.toggleClass("no-vertical-grid-line",null!=t?!t:null)},ct.prototype.toggleHorizontalLines=function(t){this.toggleClass("no-horizontal-grid-line",null!=t?!t:null)},ct.prototype.getDataColumnMap=function(){for(var t=[],e=this.getColumnCount();--e>=0;)t[e]=this.getDataColumnName(e);return t},ct.prototype.setDataColumnMap=function(t){var e,i;if(t)for(e=t.length;--e>=0;)(i=this._getColumnDef(e)).dataColumnName=t[e];else for(e=this._columnDefs.length;--e>=0;)(i=this._columnDefs[e])&&null!=i.dataColumnName&&(i.dataColumnName=null)},ct.prototype.getDataColumnName=function(t){return this._getColumnDef(t).dataColumnName||""},ct.prototype.setDataColumnName=function(t,e){this._getColumnDef(t).dataColumnName=e},ct.prototype.setDefaultRenderingHandler=function(t){this._renderingHandler="function"==typeof t?t:null},ct.prototype.setDefaultDataBindingHandler=function(t){this._dataBindingHandler="function"==typeof t?t:null},ct.prototype.setColumnRenderingHandler=function(t,e){this._getColumnDef(t).renderingHandler="function"==typeof e?e:null},ct.prototype.setColumnDataBindingHandler=function(t,e){this._getColumnDef(t).dataBindingHandler="function"==typeof e?e:null},ct.prototype.getColumnRenderingHandler=function(t){return this._getColumnDef(t).renderingHandler||null},ct.prototype.getColumnDataBindingHandler=function(t){return this._getColumnDef(t).dataBindingHandler||null},ct.prototype.enableRowHighlighting=function(t){if(null==t&&(t=!0),this._rowHighlighting!==t){this._rowHighlighting=t;for(var e=this.getAllSections("content"),i=e.length;--i>=0;)e[i].enableRowHighlighting(this._rowHighlighting)}},ct.prototype._getTarget=function(t){var e=t.target;if(e){var o=null;return this._element.contains(e)||(o=t.composedPath?t.composedPath():t.path),o?o[0]||null:e}return t.getElement?t.getElement():i.isElement(t)?t:null},ct.prototype.getRelativePosition=function(t,e){if(!t)return{};var o=e||{},n=this._getTarget(t);t.target?i.getRelativePosition(t,this.getElement(),o):n&&i.getRelativePosition(n,this.getElement(),o),1!==this._zoomFactor&&(o.x/=this._zoomFactor,o.y/=this._zoomFactor),o.hit=!1,o.grid=this,o.clientX=t.clientX,o.clientY=t.clientY,o.zoomFactor=this._zoomFactor;var r=i.closestElement(n,"cell");if(!r)return o;o.cellElement=r;var s=i.closestElement(r,"column");o.columnElement=s;var l;if(!(l=s?i.closestElement(s,"tr-lg"):i.closestElement(r,"tr-lg")))return o;o.sectionName=l.id||i.closestElement(l,"tr-vlg").id;var a=this.getSectionSettings(o.sectionName);if(!a)return o;a.extendEventArg(o);var h=a.getSection(),u=h.getColumnIndex(s||r);return u<0||(o.colIndex=u,!1===this._hitTestY(-1,o)||(r.stretched?o.cell=h.getStretchedCell(u,o.rowIndex):o.cell=h.getCell(u,o.rowIndex),o.hit=!0)),o},ct.prototype.getColumnIndex=function(t){for(var e=this.getColumnCount();--e>=0;)if(t===this.getDataColumnName(e))return e;return-1},ct.prototype.getVScrollbar=function(){return this._vscrollbar},ct.prototype.getHScrollbar=function(){return this._hscrollbar},ct.prototype.autoHideScrollbars=function(t){t=null==t||t,this._vscrollbar.setAutoHide(t),this._hscrollbar.setAutoHide(t)},ct.prototype.getVScrollStartIndex=function(){return this._startVScrollbarIndex},ct.prototype.getHScrollStartIndex=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:-1},ct.prototype.scrollToColumn=function(t,e){if(!this._updateScrollbar(this._hscrollbar))return!1;var i=this._layoutX.getLaneCount();if(t<=0?t=0:t>=i&&(t=i-1),this.isPinnedColumn(t))return!1;var o=this._hScrollbarEnabled?this._layoutX.getLaneStart(this._pinnedLeftColumnCount):0,n=this._hscrollbar.getScrollLeft(),r=n+o,s=this._hscrollbar.getWidth(),l=this._layoutX.hitTest(r),a=this._layoutX.getLaneStart(t),h=this._layoutX.getLaneSize(t);if(e||h>=s||t<=l){var u=a-o;if(n!==u)return this._hscrollbar.setScrollLeft(u),!0}else{var p=r+s;if(t>=this._layoutX.hitTest(p-.1)){var _=n+(a+h)-p;return this._hscrollbar.setScrollLeft(_),!0}}return!1},ct.prototype.getScrollLeft=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getScrollLeft():0},ct.prototype.setScrollLeft=function(t){this._updateScrollbar(this._hscrollbar)&&this._hscrollbar.setScrollLeft(t)},ct.prototype.scrollRight=function(t){this.setScrollLeft(this._hscrollbar.getScrollLeft()+t)},ct.prototype.getScrollWidth=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getContentWidth():0},ct.prototype.getYScrollVal=function(t,e,i){if(!this._updateScrollbar(this._vscrollbar))return null;var o=null;t&&(o=this.getSection(t));var n=this._layoutY.getLaneCount(),r=o?o.getRowOffset():this._sectionStarts[this._startVScrollbarIndex];r&&(e+=r),e<=0?e=0:e>=n&&(e=n-1);var s=this._layoutY.getLaneStart(r),l=this._vscrollbar.getScrollTop()+s,a=o?o.getFirstIndexInView():this._layoutY.hitTest(l),h=-1;if(i)h=e;else if(e<=a)(h=e-3)<0&&(h=0);else{var u=l+this._vscrollbar.getHeight(),p=o?o.getLastIndexInView():this._layoutY.hitTest(u-.1);e>=p&&(h=e-(p-a)+3)<0&&(h=0)}return h>=0?this._layoutY.getLaneStart(h)-s:null},ct.prototype.scrollToRow=function(t,e,i){var o=this.getYScrollVal(t,e,i);null!==o&&this._vscrollbar.setScrollTop(o)},ct.prototype.getVScrollView=function(){if(!this._updateScrollbar(this._vscrollbar))return null;var t=this._layoutY.getLaneCount();if(0===t)return null;var e=this._sectionStarts[this._startVScrollbarIndex],i=this._layoutY.getLaneStart(e),o=this._vscrollbar.getScrollTop()+i,n=this._vscrollbar.getHeight(),r=o+n,s=this._layoutY.hitTest(o),l=this._layoutY.hitTest(r-.1),a=this._layoutY.getLaneStart(s),h=this._layoutY.getLaneEnd(l),u=o-n,p=u<=i?e:this._layoutY.hitTest(u)+1,_=r+n,d=_>=this._layoutY.getTrackSize()?t-1:this._layoutY.hitTest(_-.1)-1;s-=e,l-=e;var c={};return c.viewTop=o-i,c.viewBottom=r-i,c.topRowIndex=s,c.bottomRowIndex=l,c.firstFullRow=a<o?s+1:s,c.lastFullRow=h>r?l-1:l,c.prevPageRowIndex=p-e,c.nextPageRowIndex=d-e,c},ct.prototype.getScrollTop=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getScrollTop():0},ct.prototype.setScrollTop=function(t){this._updateScrollbar(this._vscrollbar)&&this._vscrollbar.setScrollTop(t)},ct.prototype.scrollDown=function(t){this.setScrollTop(this._vscrollbar.getScrollTop()+t)},ct.prototype.getScrollHeight=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getContentHeight():0},ct.prototype.enableAutoSetDataSource=function(t){this._autoSetDataSource=t},ct.prototype.getRowVirtualizer=function(){return this._rowVirtualizer},ct.prototype.getColumnVirtualizer=function(){return this._colVirtualizer},ct.prototype.enableRowVirtualization=function(t){this._rowVirtualizer.enable(t),this._rowVirtualizer.isEnabled()&&this._vscrollbar.isEnabled()?this._rowVirtualizer.activate():this._rowVirtualizer.deactivate()},ct.prototype.enableColumnVirtualization=function(t){this._colVirtualizer.enable(t);for(var e=this._colVirtualizer.isEnabled(),i=this._settings.length;--i>=0;)this._settings[i].enableColumnVirtualization(e)},ct.prototype.setRowScrollingStep=function(t){this._rowScrollingStep=t>0?t:0,this._vscrollbar.setScrollingStep(this._layoutY.getDefaultLaneSize()*this._rowScrollingStep)},ct.prototype.getVMouseWheelHandler=function(){return this._vscrollbar.getDefaultMouseWheelLogic()},ct.prototype.synchronizeVScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);var e=t.getVScrollbar();e._mainScrollbar=this._vscrollbar,e.setStyle("visibility","hidden"),e.setStyle("pointerEvents","none"),e.disableMouseWheel(),e.attachToExternalElement(this._vscrollbar.getParent()),this._vscrollbar.listen("scroll",t._onSyncVScroll)},ct.prototype.updateRowData=function(t,e,i,o){var n=this.getSectionSettings(t||"content");n&&n.updateRowData(e,i,o)},ct.prototype.rerender=function(){for(var t=this._settings.length,e=0;e<t;e++)this._settings[e].rerender()},ct.prototype.requestRowRefresh=function(){this._rowRefreshTimer||(this._rowRefreshTimer=setTimeout(this._onRowRefresh,100))},ct.prototype.deactivateRendering=function(t){if((t=!1!==t)!=this._noBinding){this._noBinding=t;var e=this.getSectionSettings("content");e&&(e.disableDataBinding(t),t||this.requestRowRefresh())}},ct.prototype._onRowRefresh=function(){this._rowRefreshTimer=0,this.updateRowData()},ct.prototype.disableLazyRendering=function(t){console.log("WARNING: This function is deprecated.")},ct.prototype.getData=function(t,e,i){var o=this.getSectionSettings(t);if(!o)return null;var n=this._toDataColumnName(e);return o.getData(n,i)},ct.prototype.setData=function(t,e,i,o){var n=this.getSectionSettings(t);if(n&&n.isDataBindable()){var r=this._toDataColumnName(e);return n.setData(r,i,o)}return!1},ct.prototype.removeRowData=function(t,e){var i=this.getSectionSettings(t);return!(!i||!i.isDataBindable())&&i.removeRowData(e)},ct.prototype.setHidingMethod=function(t){if(t||(t=""),this._hidingMethod!==t){this._hidingMethod=t;for(var e=this.getAllSections(),i=e.length;--i>=0;)e[i].setHidingMethod(t)}},ct.prototype.getHorizontalLayout=function(){return this._layoutX},ct.prototype.setColumnVisibility=function(t,e,i){if(this._layoutX.hideLane(t,!e,i)){if(this._syncLayoutToColumns(t,t+1),e&&this.requestRowRefresh(),this._hasListener("columnVisibilityChanged")){var o={};o.colIndex=t,o.hidden=!e,this._dispatch("columnVisibilityChanged",o)}return!0}return!1},ct.prototype.reserveRightSpace=function(t){if(this._reservedSpace!==t){this._reservedSpace=t;for(var e=this._settings.length;--e>=0;)this._settings[e].getSection().reserveRightSpace(t);return this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),!0}return!1},ct.prototype.getHiddenInput=function(){return this._hiddenInput},ct.prototype.focus=function(){var t=this._hiddenInput,e=document.activeElement;if(t&&t!==e){var i=window.pageXOffset,o=window.pageYOffset;if(t.setActive)try{t.setActive()}catch(e){t.focus({preventScroll:!0})}else t.focus({preventScroll:!0});o===window.pageYOffset&&i===window.pageXOffset||window.scrollTo(i,o)}},ct.prototype.isBinding=function(){return this._dispatchingDataChanged},ct.prototype.hideRow=function(t,e){this._dataSource.hideRow(t,e)},ct.prototype.hideRows=function(t,e){Array.isArray(t)?this._dataSource.hideRows(t,e):this._dataSource.hideRow(t,e)},ct.prototype.showRows=function(t,e){Array.isArray(t)?this._dataSource.showRows(t,e):this._dataSource.showRows([t],e)},ct.prototype.unhideAllRows=function(){this._dataSource.unhideAllRows()},ct.prototype.hasHiddenRow=function(){return this._dataSource.hasHiddenRow()},ct.prototype.initSimpleTable=function(t){var e=0;t||this.getColumnCount()||(t=["Default"]),t&&(e=t.length,this.setColumnCount(e),this.setDataColumnMap(t));var i=this.addSection("title");if(i.addRow(1),!this._renderingHandler)for(var o=0;o<e;++o)i.setCellContent(o,0,t[o]);this.addSection("content");var n=this.getSectionSettings("title");n.disableDataBinding();var r=this.getSectionSettings("content");r.setAutoSyncRowCount(!0),r.setParent(n),this._dataBindingHandler||this.setDefaultDataBindingHandler(ct._defaultDataBinding)},ct._defaultDataBinding=function(t){t.cell.setContent(t.dataValue)},ct.prototype.selectColumn=function(t,e){for(var i=this._settings.length;--i>=0;)this._settings[i].getSection().selectColumn(t,e);this._updateColumnBounds()},ct.prototype.isSelectedColumn=function(t){var e=this._settings[0]||null;return!!e&&e.getSection().isSelectedColumn(t)},ct.prototype._updateColumnBounds=function(){if(!this._columnBoundConflator.conflate()){var t,e=this.getColumnCount(),i=-1,o=-1;for(t=0;t<e;++t)this.isSelectedColumn(t)&&(o=t,i<0&&(i=t));var n=this._settings.length;if(n){var r=this._settings[0].getSection(),s=[0,0],l=[!1,!1];for(r.calculateColumnBounds(i,o,s,l),t=n;--t>=0;)(r=this._settings[t].getSection()).updateColumnBounds(s,l)}}},ct.prototype.getColumnRect=function(t,e){var i=this.getElement().clientWidth,o=i,n=this._hscrollbar;n.isActive()&&(o=n.getTrackSize());var r=0,s=0;if(this._settings.length){var l=[0,0];this._settings[0].getSection().calculateColumnBounds(t,e,l,[]),s=l[1]-(r=l[0])}return{top:0,left:r,width:s,height:this._layoutY.getTrackSize(),leftPinnedIndex:this._pinnedLeftColumnCount-1,rightPinnedIndex:this.getFirstPinnedRightIndex(),scrollViewSize:o,gridWidth:i}},ct.prototype.getRowRect=function(t,e){var i=this._layoutX.getTrackSize(),o=this.getElement().clientWidth;i=i<o?i:o;var n=this.getSection("content"),r=n?n.getRowOffset():1,s=this._layoutY,l=s.getLaneStart(r),a=0,h=n.getHeight(),u=this._vscrollbar;u.isActive()&&(a=u.getScrollTop(),h=u.getTrackSize());var p=h+l,_=s.getLaneStart(t+r)-a,d=s.getLaneEnd(e+r)-a;return _<l?_=l:_>p&&(_=p),d<l?d=l:d>p&&(d=p),{top:_-=l,left:0,width:i,height:(d-=l)-_,scrollViewSize:h,scrollViewTop:l,scrollViewBottom:p}},ct.prototype.normalizeConfig=function(t){t||(t={});var e,i,o=t.columns,n=o?o.length:0,r=t.columnFreezing;null==r&&(r=t.freezeColumn);var s=t.pinnedRightColumns||t.frozenRightColumns;if(s)for(delete t.pinnedRightColumns,delete t.frozenRightColumns,t.columnVirtualRendering=!1,t.columnVirtualization=!1,e=n;--e>=0;)--s>=0&&(i=o[e])&&(i.rightPinned=!0);return null!=r&&(delete t.columnFreezing,delete t.freezeColumn,r>=0&&o&&(i=o[r])&&(i.leftPinned=!0)),t},ct.prototype._dispatchColumnPositionChanged=function(){this._columnPositionConflator.conflate()||this._dispatch("columnPositionChanged",{sender:this})},ct.prototype._dispatchRowPositionChanged=function(){this._rowPositionConflator.conflate()||this._dispatch("rowPositionChanged",{sender:this})},ct.prototype._getAllSections=function(){for(var t=[],e=this._settings.length,i=0;i<e;i++)t.push(this._settings[i].getSection());return t},ct.prototype._getNextSection=function(t,e,i){var o=this.getSectionIndex(e)+t;if(null==i)return this.getSectionSettings(o);i=this._toSectionType(i);for(var n=this._settings.length;o>=0&&o<n;){var r=this._settings[o];if(i===r.getType())return r;o+=t}return null},ct.prototype._toSectionType=function(t){if(ct._sectionType[t])return t;if(i.isString(t))switch(t.charAt(0).toLowerCase()){case"t":return"title";case"h":case"s":return"header";case"f":return"footer"}return"content"},ct.prototype._newSection=function(t,e){if(e)for(var i=this._settings.length;--i>=0;)if(this._settings[i].getId()===e)return null;t=this._toSectionType(t);var o={horizontalScrollbar:this._hscrollbar},n="content"===t?new dt(o):new B(o);n._setContext(this);var r=new st(n);r.setId(e),r.setType(t),r.listen("dataChanged",this._onSectionDataChanged),r.listen("rowAvailable",this._onRowAvailable);var s="content"===t&&this._rowHighlighting;return n.enableRowHighlighting(s),n.enableShading(!1),n.setHidingMethod(this._hidingMethod),r.enableColumnVirtualization(this._colVirtualizer.isEnabled()),n.setColumnCount(this._layoutX.getLaneCount()),n.reserveRightSpace(this._reservedSpace),this._syncLayoutToSectionColumns(n),this._syncStyleToSectionColumns(n,t),t!==this._rowHeightException&&n.setDefaultRowHeight(this._layoutY.getDefaultLaneSize()),n.listen("rowHighlighted",this._onRowHightlighted),n.listen("rowCountChanged",this._onRowCountChanged),n.listen("rowHeightChanged",this._onRowHeightChanged),this._autoSetDataSource&&r.setDataSource(this._dataSource),r},ct.prototype._putToLast=function(t){if(0===this._settings.length)t.setParent(this._element,!0);else{var e=this.getLastSection().getElement().nextSibling;null!==e?t.insertBefore(e):t.setParent(this._element)}},ct.prototype._syncStyleToSectionColumns=function(t,e){for(var i,o=this._columnDefs.length;--o>=0;){var n=this._getColumnDef(o),r=n.styles;for(i in r)t.setColumnStyle(o,i,r[i]);var s=n.classes;for(i in s)t.enableColumnClass(o,i,!0);var l=n[e];if(l){for(i in r=l.styles)t.setColumnStyle(o,i,r[i]);for(i in s=l.classes)t.enableColumnClass(o,i,!0)}}},ct.prototype._syncRowHeights=function(){for(var t=this._settings.length,e=0;e<t;++e)this._syncSectionRowHeights(this._settings[e].getSection());return!this._frozenLayout&&this._updateScrollbarHeight(!0,!0)},ct.prototype._syncSectionRowHeights=function(t){this._layoutY.copyFrom(t.getRowLayout(),this._sectionStarts[t.getIndex()])},ct.prototype._setColumnWidth=function(t,e,i){var o=!1,n=this._layoutX;if(null!=i)o=n.setLaneScalability(t,!!i);else{var r=n.getLaneScalability(t);if(this._preserveProportion){if(r){for(var s=this.getColumnCount(),l=0,a=0,h=0;h<s;++h)if(n.getLaneScalability(h)){var u=n.getLaneSize(h);l+=n.getCustomLaneSize(h),a+=u}(!(e=(e*l-e*n.getCustomLaneSize(t))/(a-e))||e<0)&&(e=l)}}else o=n.setLaneScalability(t,!1)}return n.setLaneSize(t,e)||o},ct.prototype._dispatchColumnAddedEvent=function(t,e,i,o){if(this._hasListener("columnAdded")){var n={};if(n.atTheMiddle=i,1===e)n.colIndex=t,n.context=o,this._dispatch("columnAdded",n);else for(var r=Array.isArray(o)?o:[],s=0;s<e;++s)n.colIndex=t+s,n.context=r[s],this._dispatch("columnAdded",n)}this._dispatchColumnRenderEvent({},t,t+e,0,this._settings.length,NaN,NaN)},ct.prototype._dispatchColumnRenderEvent=function(t,e,i,o,n,r,s){if(o<n){var l;if(t.sender=this,t.fromColIndex=e,t.toColIndex=i,this._hasListener("preSectionRender"))for(l=o;l<n;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("preSectionRender",t);for(var a=e;a<i;++a){var h=this.getColumnRenderingHandler(a)||this._renderingHandler;if(h)for(t.colIndex=a,t.dataColumnName=this.getDataColumnName(a),l=o;l<n;++l){var u=this._settings[l];u.extendRenderEventArg(t,r,s);for(var p=u.getSection(),_=t.fromRowIndex,d=t.toRowIndex,c=_;c<d;++c)t.rowIndex=c,t.cell=p.getCell(a,c,!1),h(t)}}if(this._hasListener("postSectionRender"))for(l=o;l<n;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("postSectionRender",t);if(!t.noDataUpdate&&!this._noBinding)for(l=o;l<n;++l)this.updateRowData(this._settings[l],r,s-1)}},ct.prototype._dispatchRowExpansionBinding=function(t){if(this._hasListener("rowExpansionBinding")){var e=t.dataSource;if(e&&e.getDataSource()){var i=t.fromRowIndex,o=t.toRowIndex,n=e.getExpansionParents(i,o),r=e.getVisibleRowIds(!0),s=t.section;t.rowData=null,t.cell=null;for(var l=i;l<o;++l){var a=n[l],h=s.getContextRow(l);if(a)t.originalRowData=e.getRowData(a),t.originalRowId=a,t.rowExpansion=h.rowExpansion=!0;else{if(!h.rowExpansion)continue;t.originalRowData=null,t.originalRowId=null,t.rowExpansion=h.rowExpansion=!1}t.rowId=r[l],t.rowIndex=l,this._dispatch("rowExpansionBinding",t)}t.originalRowData=null,t.originalRowId=null,t.rowExpansion=!1}}},ct.prototype._removeColumn=function(t){var e=this._layoutX.getLaneCount();if(t>e&&(t=e),!(t<=0)){var i=e-t;this._layoutX.setLaneCount(i);for(var o=this._settings.length;--o>=0;)this._settings[o].getSection().setColumnCount(i);var n=this._columnDefs.slice(i);if(this._columnDefs.length=i,this._onColumnCountChanged(),this._syncLayoutToColumns(i,0,!0),this._hasListener("columnRemoved"))for(var r={},s=e;--s>=i;){var l=n[s-i];r.colIndex=s,r.columnData=l?l.columnData:null,this._dispatch("columnRemoved",r)}}},ct.prototype._onSectionDataChanged=function(t){if(!this._dispatchingDataChanged){this._dispatchingDataChanged=!0;var e,i,o=t.fromRowIndex,n=t.toRowIndex,r=t.section,s=t.dataSource,l=s&&s.getDataSource()?1:0;l&&(e=s.getVisibleRowIds(!0),i=s.getMultipleRowData(e,o,n),t.dataRows=i),this._dispatch("preSectionDataBinding",t);for(var a=this._layoutX.getLaneCount(),h=this.getDataColumnMap(),u=0;u<a;++u)if(r.isColumnActive(u)&&(this.isColumnVisible(u)||this._isAlwaysRenderColumn(u))){var p=this.getColumnDataBindingHandler(u)||this._dataBindingHandler;if(p){var _=h[u];t.dataColumnName=_,t.colIndex=u;for(var d=o;d<n;++d){if(l){var c=i[d];if(!c)continue;t.rowData=c,t.rowId=e[d],t.dataValue=c[_]}t.rowIndex=d,t.cell=r.getCell(u,d,!1),p(t)}}}this._dispatch("postSectionDataBinding",t),this._dispatchRowExpansionBinding(t),this._dispatchingDataChanged=!1}},ct.prototype._updateScrollbar=function(t){return!!t&&(t.isEnabled()&&t.update(),t.isActive())},ct.prototype._onVScroll=function(t){this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop()),this._dispatchRowPositionChanged()},ct.prototype._onHScroll=function(t){var e=this._hscrollbar.getScrollLeft();this._colVirtualizer.setViewOffset(e),this._updateColumnBounds(),this._dispatchColumnPositionChanged()},ct.prototype._onVScrollEnabled=function(){this._updateScrollbarHeight(!0,!1),this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.activate(),this._vscrollbar.getAutoHide()||this._updateVScrollbar()},ct.prototype._onVScrollDisabled=function(){this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.deactivate()},ct.prototype._onRowInViewChanged=function(t){for(var e=t.firstIndex,i=t.lastIndex+1,o=this._settings.length,n=[0,0],r=0;r<o;++r){var s=this._settings[r],l=s.getSection();l&&!l.getFrozenLayout()&&(l.activateRows(e,i,n),this.updateRowData(s,n[0],n[1]-1))}},ct.prototype._onColInViewChanged=function(t){var e=t.prevFirstIndex,i=t.prevLastIndex,o=t.firstIndex,n=t.lastIndex,r=e<o?e:o,s=i>n?i:n;this._activateColumns(o,n,r,s);for(var l=this._rowVirtualizer.getFirstIndexInView(),a=this._rowVirtualizer.getLastIndexInView(),h=this.getSectionCount(),u=0;u<h;++u){var p=this._settings[u],_=p.getRowOffset();this.updateRowData(p,l-_,a-_)}},ct.prototype._activateColumns=function(t,e,i,o){null==i&&(i=0),null==o&&(o=this.getColumnCount()-1);for(var n=this._getColActivationList(t,e,i,o),r=this.getSectionCount();--r>=0;)this._settings[r].activateColumns(n,i,o)},ct.prototype._getColActivationList=function(t,e,i,o){null==i&&(i=0);var n=this.getColumnCount();null==o&&(o=n-1),null==t&&(t=this._colVirtualizer.getFirstIndexInView()),null==e&&(e=this._colVirtualizer.getLastIndexInView());for(var r=this.getHScrollStartIndex(),s=this.getFirstPinnedRightIndex(),l=new Array(o+1),a=i;a<=o;++a)l[a]=a<r||a>=t&&a<=e||a>=s;return l},ct.prototype._getColumnDef=function(t){if(t>=0){var e=this._columnDefs[t];return e||(e=this._columnDefs[t]={id:""+ct._runningColumnId++,columnData:{}}),e}return{}},ct.prototype._getNestedColumnDef=function(t,e,i){var o=this._getColumnDef(t);if(e){var n=o;(o=n[e])||(o=n[e]={}),i&&((o=(n=o)[i])||(o=n[i]={}))}return o},ct.prototype._getColumnId=function(t){return this._getColumnDef(t).id},ct.prototype._onWindowResize=function(){this._updateLayout(),this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop())},ct.prototype._onMouseMove=function(){this._vscrollbar.flash(),this._hscrollbar.flash()},ct.prototype._onRowHightlighted=function(t){if(this._hasListener("rowHighlighted")){var e=t.sender,i=this.getSectionSettings(e.getId());if(null!=i){i.extendEventArg(t);var o=i.getDataSource();null!==o&&(t.rowId=o.getRowId(t.rowIndex),t.dataRow=o.getRowData(t.rowId)),this._dispatch("rowHighlighted",t)}}},ct.prototype._onRowCountChanged=function(t){if(!this._disposed){var e=t.sender,i=t.prevCount,o=t.rowCount,n=e.getIndex(),r=this._updateSectionIndices(n),s=0;if(i>o)this._layoutY.removeLaneAt(r,i-o),this._layoutY.isHomogeneous()||this._syncSectionRowHeights(e);else{var l=this._layoutY.getDefaultLaneSize(),a=e.getDefaultRowHeight();if(this._layoutY.insertLane(r+i,o-i),a!==l)for(s=i;s<o;++s)this._layoutY.setLaneSize(r+s,a)}var h=n<=this._startVScrollbarIndex||n>=this._getFooterStartIndex(),u=this._frozenFooterCount>0,p=this._updateScrollbarHeight(h,u,t.noBinding);this._frozenLayout||p||(this._rowVirtualizer.isVirtualizable()?e.activateRows(this._rowVirtualizer.getFirstIndexInView(),this._rowVirtualizer.getLastIndexInView()):e.activateRows()),u||this._updateVScrollbar(),i<o?this._dispatch("rowAdded",t):i>o&&this._dispatch("rowRemoved",t)}},ct.prototype._onRowHeightChanged=function(t){if(this._rowHeightSync&&!this._disposed&&!this._rowHeightConflator.conflate(t)){for(var e=this._rowHeightConflator.popAllData(),i=e.length,o=NaN,n=0;n<i;++n){var r=e[n],s=r.sender;if(this._containsSection(s))for(var l=s.getIndex(),a=r.rowIndex,h=this.getRowIndex(l,a),u=r.changeLength,p=0;p<u;++p)this._layoutY.setLaneSize(h+p,s.getRowHeight(a+p))&&(l>=o||(o=l))}this._rowHeightConflator._needScrollbarUpdate?(this._rowHeightConflator._needScrollbarUpdate=!1,this._updateScrollbarHeight(!0,!0)):o>=0&&this._updateScrollbarHeight(o<this._startVScrollbarIndex,o>=this._startVScrollbarIndex),this._dispatchRowPositionChanged()}},ct.prototype._containsSection=function(t){for(var e=this._settings.length;--e>=0;)if(this._settings[e].getSection()===t)return!0;return!1},ct.prototype._onRowAvailable=function(t){var e=t.sectionIndex;this._dispatchColumnRenderEvent(t,0,this.getColumnCount(),e,e+1,t.prevRowIndex,t.rowIndex)},ct.prototype._onSectionCountChanged=function(t){if(!this._frozenLayout){if(this._tempFrozenSectionRef){var e=this.getNextSection(this._tempFrozenSectionRef);null!==e&&(this._startVScrollbarIndex=e.getIndex(),this._tempFrozenSectionRef="")}this._startVScrollbarIndex>=0&&this._startVScrollbarIndex<this._getFooterStartIndex()?(this._vscrollbar.enable(),this._vscrollbar.setScrollContent(this,this._getAllSections(),this._startVScrollbarIndex),t||this._updateScrollbarHeight(!0,!0),this._syncLayoutToColumns()):this._vscrollbar.disable()}},ct.prototype._onColumnCountChanged=function(){if(!this._frozenLayout&&!this._disposed){var t=this._countPinnedLeftColumns(),e=this._countPinnedRightColumns();this._updateColumnBounds(),this._hScrollbarEnabled&&t+e<this.getColumnCount()?(this._hscrollbar.enable(),this._colVirtualizer.activate(),this._hscrollbar.setScrollContent(this,this._getAllSections(),t,e)):(this._hscrollbar.disable(),this._colVirtualizer.deactivate(),t=e=0),this._element.classList.toggle("right-pinning",e>0),this._dispatchColumnPositionChanged()}},ct.prototype._onSyncVScroll=function(t){this._vscrollbar.setScrollTop(t.scrollTop)},ct.prototype._getFooterStartIndex=function(){return this.getSectionCount()-this._frozenFooterCount},ct.prototype._getVScrollStart=function(){return this._getSectionSize(0,this._startVScrollbarIndex)},ct.prototype._getFooterSize=function(){return this._frozenFooterCount>0?this._getSectionSize(this._getFooterStartIndex()):0},ct.prototype._getSectionSize=function(t,e){if(t){if(t<0)return 0}else t=0;null==e&&(e=this.getSectionCount()-t);var i=this._layoutY.getLaneStart(this._sectionStarts[t]),o=t+e;return(e>0?this._layoutY.getLaneStart(this._sectionStarts[o]):0)-i},ct.prototype._updateScrollbarHeight=function(t,e,i){if(!this._vscrollbar.isEnabled())return!1;var o=e,n=t&&this._startVScrollbarIndex>=0,r=this._rowHeightConflator.isConflating();if(r&&(this._rowHeightConflator._needScrollbarUpdate=!0,o=!1),n&&!r){var s=this.getElement();if(!s)return!1;var l=this.getParent(),a=this._vscrollbar.getParent();a?a!==l&&a.firstElementChild&&(a=a.firstElementChild):(a=s,this._vscrollbar.setParent(a));var h=this._getVScrollStart(),u=this._getFooterSize();a!==s&&(h+=s.clientTop),this._vscrollbar.resetPaneSize();var p=a.clientHeight-(h+u)*this._zoomFactor;this._vscrollbar.setTop(h*this._zoomFactor),this._vscrollbar.setTrackSize(p,p/this._zoomFactor);var _=this._layoutY.getDefaultLaneSize(),d=12*_;p>d&&(d=(Math.ceil(p/_)+4)*_),this._rowVirtualizer.setViewSize(d/this._zoomFactor),this._rowVirtualizer.setViewBounds(this._startVScrollbarIndex,this.getFooterCount())}else this._rowVirtualizer.validateVirtualization();var c=!1;return i||(c=this._rowVirtualizer.update()),this._vscrollbar.invalidate(o),c},ct.prototype._updateScrollbarWidth=function(t,e){if(t&&this._hScrollbarEnabled){var i=this.getElement(),o=this._hscrollbar.getParent();o||(o=this.getParent()||i,this._hscrollbar.setParent(o));var n=this._layoutX.getLaneStart(this._pinnedLeftColumnCount),r=this._layoutX.getLaneCount(),s=0,l=this._countPinnedRightColumns();l&&(s=this._layoutX.getLaneStart(r)-this._layoutX.getLaneStart(r-l));var a=o!==i?i.clientLeft:0,h=o.clientWidth-(n+a+s)*this._zoomFactor;l>0&&(h-=this._reservedSpace),this._hscrollbar.setPaneLeft(n),this._hscrollbar.setLeft((n+a)*this._zoomFactor),this._hscrollbar.setTrackSize(h,h/this._zoomFactor);var u=4*this._layoutX.getDefaultLaneSize();h>u&&(u=h),this._colVirtualizer.setViewSize(u/this._zoomFactor),this._colVirtualizer.setViewBounds(this._pinnedLeftColumnCount,l)}else this._colVirtualizer.validateVirtualization();this._colVirtualizer.update(),this._hscrollbar.invalidate(e)},ct.prototype._hitTestY=function(t,e){var o;if(e.sectionSettings)o=e.sectionSettings;else{var n,r=(n="number"==e.rowIndex?e.rowIndex:this._layoutY.hitTest(t))>=0?n:~n,s=i.upperBound(this._sectionStarts,r)-1;if(e.sectionIndex=s,!(o=this._settings[s]))return!1;o.extendEventArg(e)}var l=o.getSection();return null!=e.colIndex&&e.cellElement?e.rowIndex=l.getCellIndex(e.colIndex,e.cellElement):e.rowIndex=n+l.getRowOffset(),!0},ct.prototype._syncLayoutToColumns=function(t,e,i){if(!this._frozenLayout){var o=this._layoutX.getLaneCount(),n=this.fillParentWidth(100);(n||null==t||null==e)&&(t=0,e=o,n=!0);var r=this._settings.length;if(!(r<=0)){var s=!1;if(t<e)for(var l=0;l<r;++l)s=this._syncLayoutToSectionColumns(this._settings[l].getSection(),t,e)||s;var a=n||t<this.getHScrollStartIndex()||e>this.getFirstPinnedRightIndex();this._updateScrollbarWidth(a,!0),this._updateColumnBounds(),this._dispatchColumnPositionChanged(),(s||i)&&this._dispatch("widthChanged",{from:t,to:e,colChanged:t})}}},ct.prototype._syncLayoutToSectionColumns=function(t,e,i){null==e&&(e=0),null==i&&(i=this._layoutX.getLaneCount());for(var o=0,n=e;n<i;++n)o|=t._setColumnWidth(n,this._layoutX.getLaneSize(n));return!(!o||this._frozenLayout||(t._updateColumnLayout(),0))},ct.prototype._toDataColumnName=function(t){return i.isNumber(t)?this.getDataColumnName(t):t},ct.prototype._updateSectionIndices=function(t){this._updatePaddingBottomSect()&&--t,t<0&&(t=0);var e=this._settings.length,i=this._settings[0]||null;i!==this._firstSettings&&(this._firstSettings&&this._firstSettings.getSection().removeClass("first"),this._firstSettings=i,this._firstSettings&&this._firstSettings.getSection().addClass("first"));var o=this._settings[e-1]||null;o!==this._lastSettings&&(this._lastSettings&&this._lastSettings.getSection().removeClass("last"),this._lastSettings=o,this._lastSettings&&this._lastSettings.getSection().addClass("last")),this._sectionStarts.length=e+1,this._sectionStarts[0]=0;for(var n=t;n<e;++n){var r=this._settings[n].getSection();r.setIndex(n),r.setRowOffset(this._sectionStarts[n]),this._sectionStarts[n+1]=this._sectionStarts[n]+r.getRowCount()}return this._sectionStarts[t]},ct.prototype._updateLayout=function(){if(!this._disposed){this._syncLayoutToColumns(),this._updateScrollbarHeight(!0,!0),this._updateScrollbarWidth(!0,!0);for(var t=this.getSectionCount(),e=0;e<t;++e)this._settings[e].getSection().updateLayout()}},ct.prototype._updateVScrollbar=function(){!this._disposed&&this._vscrollbar.isEnabled()&&(this._vScrollbarConflator.conflate()||this._vscrollbar.update())},ct._proto=ct.prototype;const gt=ct;var ft=function(){};h.inherits(ft,s),ft.prototype.getName=function(){return"Plugin"},ft.prototype.initialize=function(t){this._host=t},ft.prototype.unload=function(t){this._host=null,this.unlistenAll()},ft.prototype.getRelativeGrid=function(t){var e;if(t.target){var o=(e=t.target).api;if(o&&o.getCoreGrid)return o.getCoreGrid()}else t.getElement?e=t.getElement():i.isElement(t)&&(e=t);var n=e?i.closestElement(e,"tr-grid"):null;if(n)if(this._host){if(this._host.getElement()===n)return this._host}else for(var r=this._hosts?this._hosts.length:0,s=0;s<r;s++){var l=this._hosts[s];if(l.getElement()===n)return l}return null},ft.prototype.getGridElementFromPoint=function(t,e){for(var o=document.elementFromPoint(t,e),n=i.closestElement(o,"tr-grid"),r=[],s=[];!n&&o&&"HTML"!=o.tagName;)r.push(o),s.push(o.style.visibility),o.style.visibility="hidden",o=document.elementFromPoint(t,e),n=i.closestElement(o,"tr-grid");for(var l=0;l<r.length;l++)r[l].style.visibility=s[l];return n},ft.prototype._getDataColumnMap=function(){return this._dataMap?this._dataMap:this._host?this._host.getDataColumnMap():this._hosts&&this._hosts[0]?this._hosts[0].getDataColumnMap():null},ft.prototype._getDataColumnName=function(t){var e=this._getDataColumnMap();return e&&e[t]||""},ft.prototype._isNotFirstHost=function(t){return!!this._hosts&&t.sender!==this._hosts[0]},ft.prototype._onColumnAdded=function(t){if(!this._isNotFirstHost(t)&&t.atTheMiddle){var e=t.colIndex;i.insertArrayItem(this._colData,e,null),i.insertArrayItem(this._dataMap,e,null)}},ft.prototype._onColumnMoved=function(t){if(!this._isNotFirstHost(t)){var e=t.fromColIndex,o=t.toColIndex;i.moveArrayItem(this._colData,e,o),i.moveArrayItem(this._dataMap,e,o)}},ft.prototype._onColumnRemoved=function(t){if(!this._isNotFirstHost(t)&&t.atTheMiddle){var e=t.colIndex;this._colData&&this._colData.splice(e,1),this._dataMap&&this._dataMap.splice(e,1)}},ft.prototype._getColumnCount=function(){var t=this._host||this._hosts[0];return t?t.getColumnCount():0},ft.prototype._getPlugin=function(t){var e=this._host||this._hosts[0];return e?e.getPlugin(t):null},ft.prototype._scrollDown=function(t){(this._host||this._hosts[0]).scrollDown(t)},ft.prototype._scrollToRow=function(t){(this._host||this._hosts[0]).scrollToRow(null,t)},ft.prototype._scrollRight=function(t){if(this._host)this._host.scrollRight(t);else if(this._hosts)for(var e=this._hosts.length,i=0;i<e;++i)this._hosts[i].scrollRight(t)},ft.prototype._host=null,ft.prototype._hosts=null,ft.prototype._dataMap=null,ft.prototype._colData=null,ft._proto=ft.prototype;const yt=ft;var mt=function(){var t=this;t._onColumnAdded=t._onColumnAdded.bind(t),t._onColumnMoved=t._onColumnMoved.bind(t),t._onColumnRemoved=t._onColumnRemoved.bind(t),t._onMouseUp=t._onMouseUp.bind(t),t._onMouseDown=t._onMouseDown.bind(t),t._onDrag=t._onDrag.bind(t),t._onDragStart=t._onDragStart.bind(t),t._onDragEnd=t._onDragEnd.bind(t),t._onDragPulse=t._onDragPulse.bind(t),t._hosts=[],t._guideline=document.createElement("svg"),t._guideline.className="tr-guideline",t._dragbox=document.createElement("svg"),t._dragbox.className="tr-dragbox",t._addEvent("dragged"),t._addEvent("dragStart"),t._addEvent("dragInterval"),t._addEvent("preColumnMoved"),t._addEvent("columnMoved")};h.inherits(mt,yt),mt.prototype._clickedGrid,mt.prototype._clickedSection=null,mt.prototype._clickedRow=-1,mt.prototype._guideline,mt.prototype._dragbox,mt.prototype._timerId=0,mt.prototype._dragPulseId=0,mt.prototype._pos=null,mt.prototype._cacheLeft=0,mt.prototype._cacheWidth=0,mt.prototype._startColumn=-1,mt.prototype._endColumn=-1,mt.prototype._destColumn=-1,mt.prototype._leftMovableBorder=-1,mt.prototype._rightMovableBorder=-1,mt.prototype._isDragging=!1,mt.prototype._lockFrozen=!1,mt.prototype._disabled=!1,mt.prototype._noColumnMoving=!1,mt.prototype._noDragBox=!1,mt.prototype.getName=function(){return"DragAndDropTitlePlugin"},mt.prototype.initialize=function(t){this._hosts.indexOf(t)>=0||(this._hosts.push(t),t.listen("mousedown",this._onMouseDown),t.listen("columnAdded",this._onColumnAdded),t.listen("columnMoved",this._onColumnMoved),t.listen("columnRemoved",this._onColumnRemoved),t.listen("dragstart",i._preventDefault))},mt.prototype.unload=function(t){var e=this._hosts.indexOf(t);e<0||(this._hosts.splice(e,1),t.unlisten("mousedown",this._onMouseDown),t.unlisten("columnAdded",this._onColumnAdded),t.unlisten("columnMoved",this._onColumnMoved),t.unlisten("columnRemoved",this._onColumnRemoved))},mt.prototype.getMarker=function(){return null},mt.prototype.lockFrozenColumn=function(t){this._lockFrozen=t},mt.prototype.disable=function(t){this._disabled=!1!==t},mt.prototype.disableMoving=function(t){this._noColumnMoving=!1!==t},mt.prototype.disableDragBox=function(t){this._noDragBox=!1!==t},mt.prototype._isAllowed=function(t){var e=this._clickedGrid||this._hosts[0];if(e){var i=e.getStationaryColumnIndex();if(i<0)return!0;if(t<=i)return!1}return!0},mt.prototype._onMouseDown=function(t){if(!this._disabled&&!(t.shiftKey||t.ctrlKey||t.altKey||t.button||this._timerId)){var e=this.getRelativeGrid(t);if(e&&(this._pos=e.getRelativePosition(t),!1!==this._pos.hit)){var i=this._pos.section;if(i&&"title"===this._pos.sectionType){var o=this._pos.colIndex;if(this._isAllowed(o)&&(!this._lockFrozen||!e.isPinnedColumn(o))){var n=this._pos.rowIndex,r=this._findMoveableBorder(o,n-1,i),s=this._getSpan(o,n,i);this._clickedGrid=e,this._clickedSection=i,this._clickedRow=n,this._startColumn=s.left,this._endColumn=s.right,this._leftMovableBorder=r.left,this._rightMovableBorder=r.right,this._destColumn=this._startColumn,this._timerId=setTimeout(this._onDragStart,300),window.addEventListener("mouseup",this._onMouseUp,!1)}}}}},mt.prototype._onMouseUp=function(t){this._timerId&&(window.clearTimeout(this._timerId),window.removeEventListener("mouseup",this._onMouseUp,!1),this._timerId=0,this._clearCache())},mt.prototype._onDragStart=function(){if(!this._disabled&&!this._isDragging&&(this._hasListener("dragStart")&&this._dispatch("dragStart",this._pos),!this._pos.cancel&&(this._timerId=0,window.removeEventListener("mouseup",this._onMouseUp,!1),this._clickedGrid))){this._isDragging=!0,document.body.classList.add("tr-dragging"),window.addEventListener("mousemove",this._onDrag,!1),window.addEventListener("mouseup",this._onDragEnd,!0);var t=this._clickedGrid,e=t.getHeight(),i=this._clickedSection.getBoundingClientRect(),o=this._clickedSection.getCell(this._startColumn,this._clickedRow).getBoundingClientRect(),n=t.getElement();this._guideline.style.top=o.top-i.top+"px",this._guideline.style.height=e-1+"px",this._dragbox.style.height=e-33+"px",this._dragbox.style.width=this._clickedSection.getColumnWidth(this._startColumn)+"px",n.appendChild(this._guideline),this._dimCol(!0),this._renderGuideline(),this._scrollStep=Math.floor(t.getScrollWidth()/25),this._scrollStep<40?this._scrollStep=40:this._scrollStep>400&&(this._scrollStep=400);var r=t.getHScrollbar();this._cacheLeft=r.getLeft()+20,this._cacheWidth=r.getLeft()+r.getWidth()-20,this._dragPulseId=window.setInterval(this._onDragPulse,150)}},mt.prototype._onDrag=function(t){if(this._isDragging){i._preventDefault(t),this._pos=this._clickedGrid.getRelativePosition(t);var e=this.getRelativeGrid(t);if(e&&e===this._clickedGrid){var o=this._pos.colIndex;!(o>=this._leftMovableBorder&&o<=this._rightMovableBorder&&this._isAllowed(o))||this._lockFrozen&&e.isPinnedColumn(o)||(this._renderGuideline(),this._dispatch("dragged",t)),this._renderDragBox(t)}}},mt.prototype._onDragEnd=function(t){if(this._isDragging){this._isDragging=!1,document.body.classList.remove("tr-dragging"),this._dimCol(!1);var e=this._guideline.parentNode;if(e&&e.removeChild(this._guideline),(e=this._dragbox.parentNode)&&e.removeChild(this._dragbox),window.removeEventListener("mousemove",this._onDrag,!1),window.removeEventListener("mouseup",this._onDragEnd,!0),this._dragPulseId&&(window.clearInterval(this._dragPulseId),this._dragPulseId=0),this._pos=null,i._preventDefault(t),this._destColumn>this._startColumn&&--this._destColumn,!this._destColumn&&0!==this._destColumn||this._destColumn<0||!this._isAllowed(this._destColumn)||this._destColumn>=this._startColumn&&this._destColumn<=this._endColumn)this._clearCache();else{var o={startColumnIndex:this._startColumn,destColumnIndex:this._destColumn};if(this._hasListener("preColumnMoved")&&this._dispatch("preColumnMoved",o),!o.cancel){if(!this._noColumnMoving){var n=-1,r=-1;this._startColumn>this._destColumn?(n=this._destColumn,this._startColumn,r=-1*(this._startColumn-this._destColumn)):this._startColumn<this._destColumn&&(n=this._endColumn+1,r=this._destColumn-n+1);for(var s=this._hosts.length;--s>=0;){var l,a=this._hosts[s];if(r>0)for(l=this._startColumn;l<=this._endColumn;l++)a.moveColumn(this._startColumn,this._destColumn);else for(l=this._startColumn;l<=this._endColumn;l++)a.moveColumn(this._startColumn+(l-this._startColumn),this._destColumn+(l-this._startColumn))}}this._hasListener("columnMoved")&&this._dispatch("columnMoved",{startColumnIndex:this._startColumn,endColumnIndex:this._endColumn,destColumnIndex:this._destColumn,clickedRow:this._clickedRow}),this._clearCache()}}}},mt.prototype._onDragPulse=function(){if(this._isDragging&&this._pos){this._dispatch("dragInterval",this._pos);var t=this._clickedGrid;if(t&&t.getHScrollbar().isActive()){var e=this._pos.x,i=0;e<this._cacheLeft?i=-Math.floor(this._scrollStep*(.8+Math.random())):e>this._cacheWidth&&(i=Math.floor(this._scrollStep*(.8+Math.random()))),this._scrollRight(i)}}},mt.prototype._clearCache=function(){this._startColumn=this._endColumn=this._destColumn=-1,this._leftMovableBorder=this._rightMovableBorder=-1,this._clickedRow=-1,this._clickedSection=this._clickedGrid=null},mt.prototype._getSpan=function(t,e,i){var o=i.getCellColSpan(t,e);return o<=0&&(t+=o,o=i.getCellColSpan(t,e)),{left:t,right:t+o-1}},mt.prototype._findMoveableBorder=function(t,e,i){if(e<0||!e&&0!==e)return{left:0,right:i.getColumnCount()-1};var o=this._getSpan(t,e,i);return o.right>=o.left?o:this._findMoveableBorder(t,e-1,i)},mt.prototype._renderGuideline=function(){var t=this._pos.colIndex;if(!(null==t||t<0)){for(var e=this._getSpan(t,this._clickedRow,this._clickedSection),i=e.left,o=e.right,n=this._clickedGrid.getColumnLeft(i),r=0,s=i;s<=o;++s)r+=this._clickedGrid.getColumnWidth(s);var l=this._pos.x>n+r/2,a=l?o+1:i;n=this._clickedGrid.getColumnLeft(this._destColumn),a<this._leftMovableBorder?a=this._leftMovableBorder:a>this._rightMovableBorder&&(a=this._rightMovableBorder+1,l&&(n-=4)),this._destColumn=a,this._guideline.style.left=n+"px"}},mt.prototype._renderDragBox=function(t){if(!this._noDragBox){var e=this._clickedGrid.getElement();this._dragbox.parentNode||e.appendChild(this._dragbox);var i=e.getBoundingClientRect(),o=this._clickedGrid.zoomFactor,n=i.width,r=t.clientX-i.left,s=(t.pageY-i.top)/o-window.scrollY,l=parseFloat((r/n).toFixed(2)),a=i.width*l/o-this._dragbox.offsetWidth*l;this._dragbox.style.left=a+"px",this._dragbox.style.top=s+10+"px"}},mt.prototype._dimCol=function(t){for(var e=this._startColumn;e<=this._endColumn;e++)this._clickedGrid.enableColumnClass(e,"drag-fadeout",t)},mt._proto=mt.prototype;const vt=mt;var Ct=function(t){var e=this;e._onSectionAdded=e._onSectionAdded.bind(e),e._onMouseDown=e._onMouseDown.bind(e),e._onUIUpdated=e._onUIUpdated.bind(e),e._onColumnAdded=e._onColumnAdded.bind(e),e._onColumnRemoved=e._onColumnRemoved.bind(e),e._onItemSortingClicked=e._onItemSortingClicked.bind(e),e.refresh=e.refresh.bind(e),e._hosts=[],e._sortLogic={},e._addEvents("preClicked","clicked","preDataSorting","columnSorted"),e._sortStates=[],e._sortingSequence=["a","d"],t&&e.config({sorting:t})};h.inherits(Ct,yt),Ct.prototype._sortStates,Ct.prototype._maxCount=1,Ct.prototype._dataSorting=!0,Ct.prototype._isDisableDoubleClickToSort=!0,Ct.prototype._clickTimer=0,Ct.prototype._delayInterval=0,Ct.prototype._lastMouseDown=0,Ct.prototype._initialSort=null,Ct.prototype._mode="",Ct.prototype._sortableColumns=!0,Ct.prototype._sortableIndicator=!1,Ct.prototype._solarTheme=!1,Ct.prototype._sortLogic,Ct.prototype._userManagedLogic=!1,Ct.prototype._disabled=!1,Ct.prototype._rowDefMode=!1,Ct._icons={},Ct.prototype._sortingSequence,Ct.prototype._sortingSequenceMap=null,Ct.prototype.getName=function(){return"SortableTitlePlugin"},Ct.prototype.initialize=function(t,e){this._hosts.indexOf(t)>=0||(this._hosts.push(t),1===this._hosts.length&&(t.listen("columnAdded",this._onColumnAdded),t.listen("columnRemoved",this._onColumnRemoved)),t.listen("sectionAdded",this._onSectionAdded),t.listen("postSectionRender",this._onUIUpdated),t.listen("dataSourceChanged",this.refresh),this.config(e))},Ct.prototype.unload=function(t){var e=this._hosts.indexOf(t);e<0||(this._hosts.splice(e,1),t.unlisten("sectionAdded",this._onSectionAdded),t.unlisten("postSectionRender",this._onUIUpdated),t.unlisten("dataSourceChanged",this.refresh),t.unlisten("columnAdded",this._onColumnAdded),t.unlisten("columnRemoved",this._onColumnRemoved),this._hosts.length<=0&&this._clickTimer&&(clearTimeout(this._clickTimer),this._clickTimer=0))},Ct.prototype.afterInit=function(){var t=this;if(t.setSortLogics(t._sortLogic),null!=t._initialSort){var e=t._initialSort;Array.isArray(e)||(e=[e]),1===t._maxCount&&(e=e.slice(0,1)),t.sortColumns(e)}},Ct.prototype.config=function(t){if(t){var e=this,i=t.icons;null!=i&&i.sorting&&(Ct._icons=i.sorting);var o=t.themeName;!o||o.indexOf("solar")>=0?e._solarTheme=!0:e._solarTheme=!1,e._initialSort=e._initialSortByColumnField(t);var n=t.sorting;if(n){n.ROW_DEF&&(this._rowDefMode=!0),n.userManagedLogic&&(e._userManagedLogic=!0);var r=n.multiColumn||n.multicolumn;if(null!=r&&(!0===r&&(r=-1),!1===r&&(r=1),e.setSortableColumnCount("number"==typeof r&&r>0?r:-1)),null!=(r=n.sortableIndicator)&&(e._sortableIndicator=r),null!=(r=n.disabled)&&(e._disabled=!!r),null!=(r=n.threeStatesSorting)&&e.disableTwoStateSorting(r),null!=(r=n.sortingSequence)&&Array.isArray(r)&&(e._sortingSequence=r),null!=(r=n.mode)&&(e._mode=r,"manual"===r&&e.disableDataSorting()),null!=(r=n.indicatorOnly)&&e.disableDataSorting(r),null!=(r=n.disableDoubleClickToSort)&&e.disableDoubleClickToSort(r),"function"==typeof(r=n.columnSorted)&&e.listen("columnSorted",r),"function"==typeof(r=n.preClicked)&&e.listen("preClicked",r),"function"==typeof(r=n.clicked)&&e.listen("clicked",r),"function"==typeof(r=n.preDataSorting)&&e.listen("preDataSorting",r),null!=(r=n.sortableColumns)&&(e._sortableColumns=r),"object"==typeof(r=n.initialSort)&&(e._initialSort=r),"object"==typeof(r=n.sortLogic))for(var s in r)"function"==typeof r[s]&&(e._sortLogic[s]=r[s])}}},Ct.prototype.getConfigObject=function(t){var e=t||{},i=e.columns;i||(i=e.columns=[]);var o=this._hosts[0];if(!o)return e;for(var n,r,s,l=o.getColumnCount(),a=0;a<l;++a)(n=i[a])||(n=i[a]={}),(r=this._getSortOptions(a))&&(this._sortableColumns?r.disabled&&(n.sortable=!1):r.disabled||(n.sortable=!0),(s=r.field)&&(n.sortBy=s,this._sortingSequenceMap&&this._sortingSequenceMap[s]&&(n.sortingSequence=this._sortingSequenceMap[s])));var h=e.sorting;h||(h=e.sorting={}),h.initialSort=this.getSortedColumns(),h.sortableIndicator=this._sortableIndicator,1!==this._maxCount&&(h.multiColumn=-1===this._maxCount||this._maxCount),h.disableDoubleClickToSort=this._isDisableDoubleClickToSort,h.sortableColumns=this._sortableColumns,h.indicatorOnly=!this._dataSorting,this._disabled&&(h.disabled=!0);var u=this._sortingSequence,p=!0;return 2===u.length&&"a"===u[0]&&"d"===u[1]&&(p=!1),p&&(h.sortingSequence=u.slice()),e},Ct.prototype.getColumnMenu=function(t,e){e||(e={});var i=e.menus;i||(i=e.menus=[]);var o=i[0];o||(o=i[0]={menuItems:[]});var n=this.getSortOrder(t),r={indexScore:100,label:"Sort Column",icon:"sort-a-to-z",group:"FREQUENTLY_USED",subMenu:{menuItems:[{indexScore:3,label:"Ascending",radioMode:!0,value:{colIndex:t,order:"a"},selected:"a"===n,click:this._onItemSortingClicked},{indexScore:2,label:"Descending",radioMode:!0,value:{colIndex:t,order:"d"},selected:"d"===n,click:this._onItemSortingClicked},{indexScore:1,label:"Un-Sort",radioMode:!0,value:{colIndex:t,order:"n"},selected:"n"===n,click:this._onItemSortingClicked}]}};return o.menuItems.push(r),e},Ct.prototype._onItemSortingClicked=function(t){this._hosts[0].getPlugin("ColumnMenuPlugin").hide();var e=t.currentTarget.value,i=e.colIndex,o=e.sortOrder;this.sortColumn(i,o)},Ct.prototype.getIcons=function(){return Ct._icons},Ct.prototype.setSortLogics=function(t){if(null!=t){var e=this._hosts[0];if(e){var i=e.getDataSource();for(var o in t)this._setSortLogic(i,o,t[o])}}},Ct.prototype.setSortLogic=function(t,e){if("string"==typeof t){var i=this._hosts[0];if(i){var o=i.getDataSource();this._setSortLogic(o,t,e)}}},Ct.prototype._setSortLogic=function(t,e,i){t&&"string"==typeof e&&("*"===e?t.setSortingLogic(i):t.setColumnSortingLogic(e,i))},Ct.prototype.getSortOrder=function(t){var e=null!=t?this.getSortPriority(t):0,i=this._sortStates[e];return(i?i.sortOrder:"")||"n"},Ct.prototype.getSortedColumnIndex=function(t){var e=this._sortStates[t||0];if(e)for(var i=this._hosts[0],o=i?i.getColumnCount():0,n=0;n<o;++n)if(this._getSortOptions(n)===e)return n;return-1},Ct.prototype.getSortPriority=function(t){var e=this._getSortOptions(t);if(e&&e.sortOrder)for(var i=this._sortStates.length,o=0;o<i;++o)if(this._sortStates[o]===e)return o;return-1},Ct.prototype.isColumnSorted=function(t){return this.getSortPriority(t)>=0},Ct.prototype.getSortedColumns=function(){var t=this._sortStates.length;if(t<=0)return null;for(var e=new Array(t),i=0;i<t;++i){var o=this.getSortedColumnIndex(i);e[i]={colIndex:o,sortOrder:this._sortStates[i].sortOrder||"n"}}return e},Ct.prototype.sortColumn=function(t,e,i){if(t>=0){var o=this._preSortColumn(t,e);o&&this._sortColumn([o],i)}},Ct.prototype.sortColumns=function(t,e){if(Array.isArray(t)){for(var i=[],o=0;o<t.length;o++){var n=t[o],r=this._preSortColumn(n.colIndex,n.sortOrder||n.order);r&&(i[o]=r)}this._sortColumn(i,e)}},Ct.prototype.clearSortState=function(t){this._popSortState(0,t),this.updateSortSymbols()},Ct.prototype.refresh=function(){this._sortStates.length&&(this._sortDataView(),this.updateSortSymbols())},Ct.prototype.restoreUserActions=Ct.prototype.refresh,Ct.prototype.setSortableColumnCount=function(t){this._maxCount=t||1,this._popSortState(this._maxCount)},Ct.prototype.getSortingStates=function(){return this._sortStates},Ct.prototype.updateSortSymbols=function(){if(!this._disabled)for(var t=this._hosts.length;--t>=0;)this._updateSortableIndicator(t)},Ct.prototype.getDataColumnMap=function(){var t=this._hosts[0],e=[];if(t)for(var i=t.getColumnCount(),o=0;o<i;++o)e[o]=this.getColumnSortingField(o);return e},Ct.prototype.getDataColumnNames=Ct.prototype.getDataColumnMap,Ct.prototype.setDataColumnMap=function(t){if(Array.isArray(t))for(var e=t.length;--e>=0;)this.setColumnSortingField(e,t[e])},Ct.prototype.setDataColumnNames=Ct.prototype.setDataColumnMap,Ct.prototype.getColumnSortingField=function(t){var e=this._getSortOptions(t),i=e?e.field:null;if(null==i&&!this._rowDefMode){var o=this._hosts[0];o&&(i=o.getDataColumnName(t))}return i||""},Ct.prototype.setColumnSortingField=function(t,e,i){if("number"==typeof t&&null!=e){var o=this._newSortOptions(t);e||(e=""),o.field!==e&&(o.field=e),null==i||this._userManagedLogic||o.sortLogic!==i&&(o.sortLogic=i||null)}},Ct.prototype.getColumnSortingFields=function(){for(var t=[],e=this._hosts[0],i=e?e.getColumnCount():0,o=0;o<i;++o){var n=this._getSortOptions(o);if(n&&n.sortOrder){var r=this._sortStates.indexOf(n);r>=0&&(t[r]=this.getColumnSortingField(o))}}return t},Ct.prototype.setFirstSortOrder=function(t,e){"a"!==(e=e?Ct._toSortOrder(e):"a")&&"d"!==e&&(e="a");for(var i,o=(i=Array.isArray(t)?t:[t]).length,n=0;n<o;++n){var r=i[n],s=this.getSortingSequence(r).slice(),l=s.indexOf(e);l>=0&&s.splice(l,1),s.unshift(e),this.setSortingSequence(s,r)}},Ct.prototype.disableTwoStateSorting=function(t){var e=this._sortingSequence.indexOf("n");!1===t?e>=0&&this._sortingSequence.splice(e,1):e<0&&this._sortingSequence.push("n")},Ct.prototype.disableSortSymbols=function(t){},Ct.prototype.disableDataSorting=function(t){this._dataSorting=!1===t},Ct.prototype.disableDoubleClickToSort=function(t){this._isDisableDoubleClickToSort=!!t},Ct.prototype.disableCellClick=function(t,e){t&&t.enableClass("no-sort",!1!==e)},Ct.prototype.disableColumnSorting=function(t,e){if(e=!1!==e,"number"==typeof t)this._disableColumnSorting(t,e);else if(Array.isArray(t))for(var i=t.length,o=0;o<i;++o)this._disableColumnSorting(t[o]||0,e)},Ct.prototype._disableColumnSorting=function(t,e){var i=this._newSortOptions(t);i.disabled!==e&&(i.disabled=e)},Ct.prototype.setClickDelayInterval=function(t){this._delayInterval=null!=t?t:500},Ct.prototype._prepareColumnOptions=function(t,e){var i=e||{},o={colIndex:t,field:i.field,sortable:!!this._sortableColumns};return null!=i.sortBy&&(o.sortable=!!i.sortBy,o.sortBy=i.sortBy),null!=i.sortable&&(o.sortable=!!i.sortable),o.sortLogic=i.sortLogic||i.sortingLogic||i.sorter,o.sort=i.defaultSort||i.sort,o},Ct.prototype._initialSortByColumnField=function(t){for(var e=t.columns||[],i=null,o=0;o<e.length;o++){var n=this._prepareColumnOptions(o,e[o]),r=n.sort;r&&(i={colIndex:n.colIndex,sortOrder:r})}return i},Ct.prototype._onSectionAdded=function(t){if("title"===t.sectionType){var e=t.section;0===e.getIndex()&&(e.listen("mousedown",this._onMouseDown),e.listen("click",this._onClickTitle.bind(this,t.sender),0))}},Ct.prototype._onUIUpdated=function(t){"title"===t.sectionType&&this.updateSortSymbols()},Ct.prototype._canClickToSort=function(t){if(this._disabled)return!1;var e=t.grid;if(!e||!e.getElement())return!1;var i=this._getPlugin("CellEditingPlugin");if(i&&i.isEditing())return!1;if(this._dispatch("preClicked",t),t.cancel)return!1;var o=t.colIndex,n=t.section,r=t.rowIndex;return!!this._isCellSortable(n,o,r)},Ct.prototype._proceedSorting=function(t){if(this._clickTimer=0,this._canClickToSort(t)){var e=t.colIndex,i=this._preSortColumn(e);if(i&&this._sortColumn([i],{isUserAction:!0}),this._hasListener("clicked")){var o={};o.colIndex=e,o.sortOrder=this.getSortOrder(e),o.dataColumnName=this.getColumnSortingField(e),this._dispatch("clicked",o)}}},Ct.prototype._onMouseDown=function(t){t.button||(this._lastMouseDown=t.timeStamp)},Ct.prototype._onClickTitle=function(t,e){if(!this._disabled)if(2===e.detail&&this._isDisableDoubleClickToSort)this._clickTimer&&(clearTimeout(this._clickTimer),this._clickTimer=0);else if(!(e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)&&e.timeStamp-this._lastMouseDown<500){var i=t.getRelativePosition(e);if(i.hit){var o=this._getPlugin("ColumnSelectionPlugin");if(o&&o.isEnabled()){var n=i.colIndex;if(!o.isSelectedColumn(n))return}i.target=e.target,this._delayInterval>0?this._clickTimer||(this._clickTimer=setTimeout(this._proceedSorting.bind(this,i),this._delayInterval)):this._proceedSorting(i)}}},Ct.prototype._popSortState=function(t,e){if(t<0||this._sortStates.length<=t)return!1;for(var i=!1,o=this._sortStates.length;--o>=t;)this._clearSortSymbols(this._sortStates[o]),i=!0;return this._sortStates.length=t,this._sortDataView(e),i},Ct._toSortOrder=function(t){return!t||"string"!=typeof t||"d"!==(t=t.charAt(0).toLowerCase())&&"a"!==t?"n":t},Ct.prototype.getSortingSequence=function(t){return this._sortingSequenceMap&&(t||0===t)&&("string"!=typeof t&&(t=this.getColumnSortingField(t)),this._sortingSequenceMap[t])?this._sortingSequenceMap[t]:this._sortingSequence},Ct.prototype.setSortingSequence=function(t,e){if(Array.isArray(t))t.length||(t=null);else if(t)return;var i;if(null!=e&&("string"==typeof e?i=e:"number"==typeof e&&(i=this.getColumnSortingField(e))),t){var o=t.map(Ct._toSortOrder);i?(this._sortingSequenceMap||(this._sortingSequenceMap={}),this._sortingSequenceMap[i]=o):this._sortingSequence=o}else i?this._sortingSequenceMap&&delete this._sortingSequenceMap[i]:this._sortingSequence=this._sortingSequence.length>2?["a","d","n"]:["a","d"]},Ct.prototype.clearAllColumnSortingSequences=function(){this._sortingSequenceMap=null},Ct.prototype._preSortColumn=function(t,e){if(!this._maxCount)return null;var i=this.getSortPriority(t),o=i>=0?this._sortStates[i]:null,n=o?o.sortOrder:"n",r="n",s=this.getColumnSortingField(t);if(null==e){var l=this.getSortingSequence(s),a=l.indexOf(n);r=l[a=a<0?0:(a+1)%l.length]}else r=Ct._toSortOrder(e);if(o){if(n===r)return this.updateSortSymbols(),null;this._sortStates.splice(i,1),this._clearSortSymbols(o)}"a"!==r&&"d"!==r||(o||(o=this._newSortOptions(t)),this._sortStates.push(o)),o&&("n"!==n?o.prevOrder=n:delete o.prevOrder,o.order=r,o.sortOrder=r);var h=[];if(this._maxCount>0)for(;this._sortStates.length>this._maxCount;){var u=this._clearSortSymbols(this._sortStates.shift());null!==u&&h.push(u)}return{colIndex:t,sortedField:s,sortOrder:r||"n",prevOrder:n,clearedSortColIndexes:h}},Ct.prototype._sortColumn=function(t,e){this._sortDataView(e),this.updateSortSymbols();var i=t[0]||{},o=t.length;if(o>1){i.colIndices=new Array(o),i.sortedFields=new Array(o),i.sortOrders=new Array(o),i.prevOrders=new Array(o);for(var n=0;n<o;n++){var r=t[n];i.colIndices[n]=r.colIndex,i.sortedFields[n]=r.sortedField,i.sortOrders[n]=r.sortOrder,i.prevOrders[n]=r.prevOrder}}this._dispatch("columnSorted",i)},Ct.prototype._onColumnAdded=function(t){var e=this,i=t.colIndex,o=t.context,n=e._prepareColumnOptions(i,o),r=n.sortBy||n.field,s=n.sortLogic||e._sortLogic[r],l=o?o.sortingSequence:null;null!=l&&r&&e.setSortingSequence(l,r),n.sortable?e.setColumnSortingField(i,r,"function"==typeof s?s:null):e.disableColumnSorting(i,!0)},Ct.prototype._onColumnRemoved=function(t){if(t.atTheMiddle&&this._sortStates.length){var e=t.columnData,i=e?e.sortableTitle:null;if(i&&i.sortOrder){var o=this._sortStates.indexOf(i);o>=0&&this._sortStates.splice(o,1),this._clearSortSymbols(i),this._sortDataView()}}},Ct._toRowDefField=function(t){return"ROW_DEF"},Ct.prototype._sortDataView=function(t){if(t=t||{},this._dispatch("preDataSorting",t),this._dataSorting){var e=this._sortStates.length,i=null,o=null,n=null;if(e){i=new Array(e),o=new Array(e);for(var r=0;r<e;++r)i[r]=this._sortStates[r].sortOrder,o[r]=this._sortStates[r].sortLogic;n=this._rowDefMode?this._sortStates.map(Ct._toRowDefField):this.getColumnSortingFields()}for(var s=this._hosts.length;--s>=0;){var l=this._hosts[s].getDataSource();if(l){var a=1==t.isUserAction;l.sort(n,i,o,a)}}}},Ct.prototype._clearSortSymbols=function(t){var e=t.targetCells;if(!e)return null;for(var i=null,o=e.length;--o>=0;){var n,r=e[o];r.removeClass("sorting"),r.removeClass("sortable"),r.removeFloatingIcon("sort-symbol"),r.removeFloatingIcon("priority-symbol"),null==i&&(n=r.getSection())&&(i=n.getColumnIndex(r.getParent()))}return e.length=0,i},Ct.prototype._updateSortableIndicator=function(t){var e=this,i=e._hosts[t];if(i){var o=i.getSection("title");if(null!=o)for(var n=o.getColumnCount();--n>=0;)for(var r=o.getRowCount(),s=0;s<r;s++){var l=o.getCell(n,s,!0);if(l&&(l.removeClass("sorting"),l.removeClass("sortable"),l.removeClass("asc"),l.removeClass("desc"),l.removeClass("edge-indicator"),l.removeFloatingIcon("sort-symbol"),l.removeFloatingIcon("priority-symbol"),l.removeFloatingIcon("sortable-indicator"),s===r-1&&e._isCellSortable(o,n,s))){l.addClass("sortable");var a,h,u,p=e._getColumnSortingStatePriority(n),_=e._sortStates[p];_&&"n"!==_.sortOrder?(_.targetCells||(_.targetCells=[]),_.targetCells[t]=l,"a"===_.sortOrder?l.addClass("asc"):l.addClass("desc"),l.addClass("sorting"),e._solarTheme?("a"===_.sortOrder?(u="▲",h=Ct._icons.ascending):(u="▼",h=Ct._icons.descending),(a=e._createIconElem(h,u)).className="sort-symbol",l.insertFloatingIcon(a,0),e._sortStates.length>1&&((a=document.createElement("span")).className="priority-symbol",a.textContent=p+1,l.insertFloatingIcon(a,1))):l.addClass("edge-indicator")):e._sortableIndicator&&(h=Ct._icons.sortable,(a=e._createIconElem(h,"◊")).className="sortable-indicator",l.insertFloatingIcon(a,0))}}}},Ct.prototype._createIconElem=function(t,e){var i;return t&&"string"==typeof t?(i=document.createElement("ef-icon")).setAttribute("icon",t):(i=document.createElement("span")).textContent=e,i},Ct.prototype._getColumnSortingStatePriority=function(t){for(var e=this._sortStates.length;--e>=0;)if(this.getSortedColumnIndex(e)===t)return e;return-1},Ct.prototype._getSortOptions=function(t){var e=this._hosts[0];if(e){var i=e.getColumnData(t);if(i)return i.sortableTitle}return null},Ct.prototype._newSortOptions=function(t){var e=this._hosts[0],i=null;if(e&&t>=0){var o=e.getColumnData(t);o||(o=e.setColumnData(t,{})),(i=o.sortableTitle)||(i=o.sortableTitle={})}return i||{}},Ct.prototype._isCellSortable=function(t,e,i){var o=this._getSortOptions(e);if(o){if(o.disabled)return!1;var n=o.field;if(null!=n&&!n)return!1}var r=t.getCell(e,i,!0);return!r.hasClass("no-sort")&&r===t.getCell(e,t.getRowCount()-1,!0)},Ct._proto=Ct.prototype;const St=Ct;var wt=window.tr;wt||(wt=window.tr={});var bt=wt.grid;bt||(bt=wt.grid={}),Object.assign(wt,i),wt.EventDispatcher=s,wt.ElementWrapper=p,wt.ElementFrameWork=a,wt.ILayoutGrid=v,wt.LayoutGrid=B,wt.Grid=gt,wt.ColumnStats=J,wt.DataCache=W,wt.DataTable=Q,wt.DataView=it,bt.CellFloatingPanel=d,bt.Cell=g,bt.CellSpan=A,bt.CellSpans=V,bt.Column=S,bt.Scrollbar=k,bt.HScrollbar=G,bt.VScrollbar=ut,bt.VirtualizedLayoutGrid=dt,bt.Conflator=nt,bt.Reverter=M,bt.TrackLayout=y,bt.Virtualizer=at,bt.SelectionList=T,bt.SectionSettings=st,bt.Plugin=yt,bt.DragAndDropTitlePlugin=vt,bt.SortableTitlePlugin=St})();
|