@refinitiv-ui/efx-grid 6.0.94 → 6.0.96

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- !function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e,i){"use strict";i.r(e),i.d(e,"Grid",(function(){return ei}));var n={create:function(t,e){var i=document.createElement(t);return e&&(i.className=e),i},div:function(t){return n.create("div",t)},text:function(t,e){var i=n.create("span",e);return(t||0===t)&&(i.textContent=t),i},appendChild:function(t,e){if(!t)return null;var i,n;Array.isArray(arguments[1])?(n=arguments[1],i=0):(n=arguments,i=1);for(var o=n.length;i<o;)t.appendChild(n[i]),++i;return t},buildTree:function(t,e){if(!t)return null;for(var i=arguments,o=i.length,r=1;r<o;++r){var s,a=i[r];if(a)Array.isArray(a)?s=n.buildTree.apply(null,a):1===a.nodeType&&(s=a),s&&t.appendChild(s)}return t},removeParent:function(t){if(!t)return null;var e=t.parentNode;return e&&e.removeChild(t),e},setParent:function(t,e){return t?e?(e.appendChild(t),e):n.removeParent(t):null},removeChildren:function(t,e){if(t){var i=t.childNodes.length;for((null==e||e>i)&&(e=i);--e>=0;)t.removeChild(t.lastChild)}},setContent:function(t,e){if(t)if(e||0===e){var i=e.nodeType;1===i||3===i?e!==t.lastChild&&(n.removeChildren(t),t.appendChild(e)):Array.isArray(e)?(n.removeChildren(t),n.appendChild(t,e)):t.textContent=e}else n.removeChildren(t)},toggleAttribute:function(t,e,i){i?t.setAttribute(e,"string"==typeof i?i:""):null==i?t.hasAttribute(e)?t.removeAttribute(e):t.setAttribute(e,""):t.removeAttribute(e)},toggleClass:function(t,e,i){i?t.classList.add(e):null==i?t.classList.contains(e)?t.classList.remove(e):t.classList.add(e):t.classList.remove(e)},addClasses:function(t,e){if(t)for(var i=Array.isArray(e)?e:arguments,n=i.length,o=0;o<n;++o){var r=i[o];r&&"string"==typeof r&&t.classList.add(r)}},removeClasses:function(t,e){if(t)for(var i=Array.isArray(e)?e:arguments,n=i.length,o=0;o<n;++o){var r=i[o];r&&"string"==typeof r&&t.classList.remove(r)}},preventDefault:function(t){t.preventDefault(),t.stopPropagation()},stopPropagation:function(t){t.stopPropagation()},getClientPosition:function(t,e){var i=e||{x:0,y:0};if(t.getBoundingClientRect){var n=t.getBoundingClientRect();i.x=n.left,i.y=n.top}else i.x=t.clientX,i.y=t.clientY;return i},getRelativePosition:function(t,e,i){i=n.getClientPosition(t,i);var o=n.getClientPosition(e);return i.x-=o.x,i.y-=o.y,i},closestElement:function(t,e){for(var i=t;i;){if(i.classList&&i.classList.contains(e))return i;i=i.parentNode||i.host}return null},closestTagName:function(t,e){for(var i=t;i;){if(i.tagName&&i.tagName==e)return i;i=i.parentNode||i.host}return null}},o=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)};o.prototype._data,o.prototype._func=null,o.prototype._delay=0,o.prototype._timerId=0,o.prototype._conflated=!1,o.prototype._disabled=!1,o.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},o.prototype.popAllData=function(){if(this._data.length){var t=this._data;return this._data=[],t}return null},o.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},o.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))},o.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},o.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},o.prototype.getData=function(){return this._data},o.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},o.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},o.prototype.getConflatingTime=function(){return this._delay},o.prototype.disable=function(t){this._disabled=!1!==t},o.prototype.isEnabled=function(){return!this._disabled},o.prototype.enable=function(t){this._disabled=!1===t};var r={inherits:function(t,e){function i(){}i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t,t.base=function(t,i,n){i||(i="constructor");for(var o=arguments.length,r=new Array(o),s=2;s<o;s++)r[s-2]=arguments[s];return e.prototype[i].apply(t,r)}}},s=r,a=function(){};a.prototype._events=null,a.prototype._listenerCount=0,a.prototype.addEventListener=function(t,e){if(t&&e){this._events||(this._events={});var i=this._events[t];i?i.indexOf(e)<0&&(i.push(e),++this._listenerCount):(this._events[t]=[e],++this._listenerCount)}},a.prototype.removeEventListener=function(t,e){var i=this._events?this._events[t]:null;if(i){var n=i.indexOf(e);n>=0&&(i.splice(n,1),--this._listenerCount)}},a.prototype.removeAllEventListeners=function(){this._events=null,this._listenerCount=0},a.prototype.hasListener=function(t){if(this._listenerCount){if(t){var e=this._events?this._events[t]:null;return!!e&&e.length>0}return!0}return!1},a.prototype.getListener=function(t,e){if(t){var i=this._events?this._events[t]:null;if(i)return e||(e=0),i[e]||null}return null},a.prototype.addListener=function(t,e){var i=t?t[e]:null;"function"==typeof i&&this.addEventListener(e,i)},a.prototype._prepareEventArguments=function(t,e){return e},a.prototype._dispatch=function(t,e){var i=this._events?this._events[t]:null;if(i){e=this._prepareEventArguments(t,e);for(var n=i.length,o=0;o<n;++o)i[o](e)}};a.preventDefault=function(t){t&&t.preventDefault&&(t.preventDefault(),t.stopPropagation())};var l=a,u=function(t,e){if(t=t.trim(),this._inputConverter[t]&&(t=this._inputConverter[t]),this._input=t,null!=e&&(this._index=e),null!=this._constants[t])return this._value=this._constants[t],void(this._type=typeof this._value);var i=t.charAt(0),n=t.length>1?t.charAt(t.length-1):"";if('"'===i&&'"'===n)return this._value=t.substring(1,t.length-1),void(this._type="string");if("'"===i&&"'"===n)return this._value=t.substring(1,t.length-1),void(this._type="string");if("("!==i||")"!==n)if("["!==i||"]"!==n)if(t.match(/TR\.\w+\(/))this._type="dynamic";else{var o=t.match(/[\w._]+\(/g);if(o&&1===o.length)this._resolveFunction(t,o[0]);else{var r=t.match(/[\w._♦]+/g);if(r&&r.length>1)this._resolveVariableGroup(t);else if("♦"!==i){var s=Number(t);if(s==s)return this._value=s,void(this._type="number");this._type="dynamic"}else this._type="token"}}else this._resolveArray(t);else this._resolveVariableGroup(t)};u.prototype._input="",u.prototype._index=-1,u.prototype._type="",u.prototype._subVars=null,u.prototype._funcName="",u.prototype._value,u.prototype._valueWithTokenField="",u.prototype._inputConverter={TRUE:"true",FALSE:"false",PI:"Math.PI","TRUE()":"true","FALSE()":"false","PI()":"Math.PI"},u.prototype._constants={true:!0,false:!1,null:null,NaN:NaN,"Math.E":Math.E,"Math.PI":Math.PI,"Math.SQRT2":Math.SQRT2,"Math.SQRT1_2":Math.SQRT1_2,"Math.LN2":Math.LN2,"Math.LN10":Math.LN10,"Math.LOG2E":Math.LOG2E,"Math.LOG10E":Math.LOG10E},u.prototype.getExpression=function(){return"dynamic"===this._type?'this.__D("'+this._input+'", __R)':"group"===this._type?this._value:"function"===this._type?this._subVars?"this.__F["+this._index+"]("+this._subVars.join(", ")+")":"this.__F["+this._index+"]()":"array"===this._type?this._subVars?"["+this._subVars.join(", ")+"]":"[]":this._input},u.prototype.getInputWithTokenField=function(){return"dynamic"===this._type?"♠"+this._input+"♥":"group"===this._type?this._valueWithTokenField:"function"===this._type?this._funcName+"("+this.getChildInputWithToken()+")":"array"===this._type?"["+this.getChildInputWithToken()+"]":this._input},u.prototype.getChildInputWithToken=function(){var t=this._subVars?this._subVars.length:0;if(t<=0)return"";for(var e=new Array(t),i=0;i<t;++i)e[i]=this._subVars[i].getInputWithTokenField();return e.join(", ")},u.prototype.toString=u.prototype.getExpression,u.prototype.getValue=function(){return this._value},u.prototype.getInput=function(){return this._input},u.prototype.getIndex=function(){return this._index},u.prototype.setIndex=function(t){this._index=t},u.prototype.getFunctionName=function(){return this._funcName},u.prototype.getFieldNames=function(t){if(this._subVars){if(t)for(var e=this._subVars.length,i=0;i<e;++i)this._subVars[i].getFieldNames(t);return this._subVars[0].getFieldNames()}return"dynamic"===this._type?(t&&(t[this._input]=!0),this._input):""},u.prototype._resolveVariableGroup=function(t){var e=this._subVars?this._subVars.length:0;return this._type="group",this._value=t.replace(/[\w._♦]+/g,function(t){this._subVars||(this._subVars=[]);var e=new u(t,this._subVars.length);return this._subVars.push(e),e.getExpression()}.bind(this)),this._valueWithTokenField=t.replace(/[\w._♦]+/g,function(t){return this._subVars[e++].getInputWithTokenField()}.bind(this)),this._value},u.prototype._resolveFunction=function(t,e){if(this._type="function",this._funcName=e.substr(0,e.length-1),t=(t=t.replace(e,"")).substr(0,t.length-1)){this._subVars=[];for(var i=t.split(","),n=i.length,o=0;o<n;++o)this._subVars[o]=new u(i[o],o)}},u.prototype._resolveArray=function(t){if(this._type="array",t=t.substr(1,t.length-1)){this._subVars=[];for(var e=t.split(","),i=e.length,n=0;n<i;++n)this._subVars[n]=new u(e[n],n)}};var h=u,p=function(t,e){this._input=t||"",null!=e&&(this._context=e,e._DATA&&(this.__D=e._DATA)),this.__F=[],this._fnTokens=[],this._fields=[],this._fieldMap={},this._dataCache={},this._intervalServices={},this._formulaCount=1,this._onDataCacheChanged=this._onDataCacheChanged.bind(this),this.dispatchDataChanged=this.dispatchDataChanged.bind(this),this._parse(this._input)};s.inherits(p,l),p._isBoundFormula={RECORD:!0,TR:!0,MTXSERIES:!0,NOW:!0,TODAY:!0,ADSTYLEATTRIBUTE:!0,ADBONDDERIV:!0,ADBONDYIELD:!0,BDSETTLE:!0,ACCRUED:!0,CFYLD:!0,DFFORMATDATE:!0,DFADDPERIOD:!0,DFADDWD:!0,DFADDMONTHS:!0,DFADDYEARS:!0,DFADJUSTTOWD:!0,DFLASTWD:!0,DFFINDDATED:!0,DFCOUNTDAYS:!0,DFCOUNTWD:!0,ADFXSWPTODEP:!0,FXCALCPERIOD:!0,OPCALCDERIV:!0,OPIMPLIEDVOL:!0,ADFORMAT:!0,ADHISTORYVALUE:!0},p.prototype._input="",p.prototype._expression="",p.prototype._alias="",p.prototype._main=null,p.prototype.__F=null,p.prototype._fnTokens=null,p.prototype._fields=null,p.prototype._fieldMap=null,p.prototype._reference="",p.prototype._context=null,p.prototype._rtService=null,p.prototype._intervalServices=null,p.prototype._dataCache=null,p.prototype._dataLastError="",p.prototype._inputWithTokenField="",p.prototype._formulaCount=0,p._invalidOps={"+=":!0,"-=":!0,"*=":!0,"/=":!0,"|=":!0,"&=":!0,"^=":!0},p.prototype.dispose=function(){for(var t in this._rtService&&(this._rtService.dispose(),this._rtService=null),this._intervalServices)this._intervalServices[t].removeEventListener("dataChanged",this.dispatchDataChanged);this._intervalServices=null,this.unlistenAll()},p.prototype.calculate=function(t){if(this._main){this._dataLastError="";var e=this._main(t);switch(this._dataLastError){case"Pending data":e=null;break;case"Pending - no erase":e="..."}return e}return null},p.prototype.getFunction=function(){return this._main},p.prototype.getFieldNames=function(){return this._fields},p.prototype._setReference=function(t){this._reference=t},p.prototype.getReference=function(){return this._reference},p.prototype.getExpression=function(){return this._expression},p.prototype.toString=p.prototype.getReference,p.prototype.getInput=function(){return this._input},p.prototype.getAlias=function(){return this._alias||this._input},p.prototype.setAlias=function(t){this._alias=t},p.prototype.addFormulaCount=function(){this._formulaCount++},p.prototype.subtractFormulaCount=function(){return 0==--this._formulaCount},p.prototype.updateContext=function(){if(this._context)for(var t=this._fnTokens.length,e=0;e<t;++e){var i=this._fnTokens[e].getFunctionName();this.__F[e]=this._context[i]||p._emptyFunction,p._isBoundFormula[i]&&(this.__F[e]=this.__F[e].bind(this))}},p.prototype._logger=function(t){console.log("["+t+"] "+this._fnTokens[t].getFunctionName()+" is executed")},p._emptyFunction=function(){},p.prototype._detectCodeInjection=function(t){var e=!1;if(t.match(/\+\+|--/)&&(e=!0),!e)for(var i=t.match(/([^=]=+)/g)||[],n=i.length;--n>=0;){var o=i[n],r=o.substring(o.length-2);if(p._invalidOps[r]){e=!0;break}}return e},p.toUpperCase=function(t){if(!t||"="!==t.charAt(0))return t||"";var e=[],i=[];return t=(t=(t=p.tokenizeQuotes(t,e,i)).toUpperCase()).replace(/TR(\.[\w ]+)+\([^\(\)]*\)(\.[a-zA-Z]+)*/g,p._encloseWithTR),t=p.resolveTokens(t,e,i)},p._encloseWithTR=function(t){return'TR("'+t+'")'},p.tokenizeQuotes=function(t,e,i){var n;e||(e=[]),i||(i=[]);var o=!1,r=[];do{o=!1,t=t.replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,(function(t){return o=!0,n=e.length,e.push(new h(t,n)),r.push(n),"♦"+n+"♦"}))}while(o);return i.push(r),t},p.tokenizeAdcWithParams=function(t,e,i){var n;e||(e=[]),i||(i=[]);var o=!1,r=[];do{o=!1,t=t.replace(/TR\.\w+\([^\)]*\)+/g,(function(t){return o=!0,n=e.length,e.push(new h(t,n)),r.push(n),"♦"+n+"♦"}))}while(o);return i.push(r),t},p.replaceUnwantedCharacters=function(t,e,i){for(;t.indexOf(" ")>=0;)t=t.replace(/ {2}/g," ");return t=(t=(t=t.replace(/\$/g,"")).replace(/\&+/g,(function(t){return"&"===t?"+":t}))).replace(/(<=|>=|!=|!==|===|==|=(?!([\w]*\([^()]*\))))/g,(function(t){return"="===t?"==":t}))},p.prototype._tokenizeParentheses=function(t,e,i){e||(e=[]),i||(i=[]);for(var n={},o=/[\w._]*(?:=|=[\w]*)?\([^()]*\)/,r=new RegExp(o.source,"g");t.match(o);){var s=[];t=t.replace(r,(function(t,i){"="===t.charAt(0)&&(t=t.substr(1,t.length));var o=n[t];return null==o&&(o=e.length,e.push(new h(t,o)),n[t]=o),s.push(o),"♦"+o+"♦"})),i.push(s)}return t},p.prototype._tokenizeConstants=function(t,e,i){e||(e=[]),i||(i=[]);var n=[];return t=t.replace(/[\w._♦]+/g,(function(t){if("♦"===t.charAt(0))return t;var i=e.length;return e.push(new h(t,i)),n.push(i),"♦"+i+"♦"})),i.push(n),t},p.resolveTokens=function(t,e,i){for(var n=i.length;--n>=0;)for(var o=i[n],r=o.length,s=0;s<r;++s){var a=o[s],l=e[a];t=t.replace(new RegExp("♦"+a+"♦","g"),(function(){return l.getExpression()}))}return t},p._getInputWithTokenField=function(t,e,i){for(var n=i.length;--n>=0;)for(var o=i[n],r=o.length,s=0;s<r;++s){var a=o[s],l=e[a];t=t.replace(new RegExp("♦"+a+"♦","g"),(function(){return l.getInputWithTokenField()}))}return"="+t},p.prototype._parse=function(t){if(this._expression="",this._main=null,this.__F.length=0,this._fnTokens.length=0,this._fields.length=0,!t)return null;if("="===t.charAt(0)&&(t=t.substr(1)),!(t=(t=(t=(t=t.trim()).replace(/<>/g,"!=")).replace(/‛|‘|’/g,"'")).replace(/‟|“|”/g,'"'))||this._detectCodeInjection(t))return null;var e=[],i=[];t=p.tokenizeQuotes(t,e,i),t=p.tokenizeAdcWithParams(t,e,i),t=p.replaceUnwantedCharacters(t,e,i),t=this._tokenizeParentheses(t,e,i),t=this._tokenizeConstants(t,e,i),this._inputWithTokenField=p._getInputWithTokenField(t,e,i),t=p.resolveTokens(t,e,i);for(var n={},o=e.length,r=0;r<o;++r){var s=e[r];if(s.getFunctionName()){var a=this._fnTokens.length;t=t.replace(new RegExp("this\\.__F\\["+r+"\\]","g"),"this.__F["+a+"]"),s.setIndex(a),this._fnTokens.push(s)}s.getFieldNames(n)}return this._expression=t,this.updateContext(),this._main=this._createFunction(this._expression),this._main?(this._fieldMap=n,this._fields=Object.keys(n),this._main):null},p.prototype._createFunction=function(t){var e=null;try{(e=(e=new Function("__R","return "+t+";")).bind(this))({})}catch(t){e=null}return e},p.prototype.__D=function(t,e){return e[t]},p.prototype.addField=function(t,e){return!this._fieldMap[t]&&(!(t.indexOf("undefined")>=0)&&(this._fields.push(t),this._fieldMap[t]=!0,this._dispatch("dataRequired",{field:t,src:e||"adc"}),!0))},p.prototype.changeField=function(t,e){var i=this._fields.indexOf(t);if(i<0)return!1;this._fields.splice(i,1),this._fields.indexOf(e)<0&&this._fields.push(e);var n=this._input,o="♠"+t+"♥",r="♠"+e+"♥";return this._inputWithTokenField=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t===o?r:t})),this._input=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t.substr(1,t.length-2)})),this._expression=this._expression.replace(new RegExp('this\\.__D\\("'+t+'", __R\\)',"g"),'this.__D("'+e+'", __R)'),this._main=this._createFunction(this._expression),this._dispatch("formulaChanged",{oldInput:n,formula:this}),!0},p.prototype.changeFields=function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var i=this._input,n=t.length;--n>=0;){var o=t[n],r=e[n],s=this._fields.indexOf(o);if(!(s<0)){this._fields.splice(s,1),this._fields.indexOf(r)<0&&this._fields.push(r);var a="♠"+o+"♥",l="♠"+r+"♥";this._inputWithTokenField=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t===a?l:t})),this._input=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t.substr(1,t.length-2)})),this._expression=this._expression.replace(new RegExp('this\\.__D\\("'+o+'", __R\\)',"g"),'this.__D("'+r+'", __R)')}}return this._main=this._createFunction(this._expression),this._dispatch("formulaChanged",{oldInput:i,formula:this}),!0},p.prototype.getRealtimeService=function(){return this._rtService},p.prototype.setRealtimeService=function(t){this._rtService&&this._rtService.dispose(),this._rtService=t,this._rtService.addEventListener("dataChanged",this._onDataCacheChanged)},p.prototype.getIntervalService=function(t){return this._intervalServices[t]},p.prototype.setIntervalService=function(t,e){if(e){var i=this._intervalServices[t];i&&i.removeEventListener("dataChanged",this.dispatchDataChanged),this._intervalServices[t]=e,e.addEventListener("dataChanged",this.dispatchDataChanged)}},p.prototype.getCachedData=function(t){return this._dataCache[t]},p.prototype.setCachedData=function(t,e){this._dataCache[t]=e},p.prototype.setDataError=function(t){this._dataLastError=t},p.prototype.dispatchDataChanged=function(t){this._dispatch("dataCacheChanged",{})},p.prototype._onDataCacheChanged=function(t){var e=t.ric,i=t.values,n=this._dataCache[e];if(n)for(var o in i)n[o]=i[o];else this._dataCache[e]=i;this._dispatch("dataCacheChanged",{})},p._proto=p.prototype;var d=p,c={en:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat",Sunday:"Sunday",Monday:"Monday",Tuesday:"Tuesday",Wednesday:"Wednesday",Thursday:"Thursday",Friday:"Friday",Saturday:"Saturday",jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec",January:"January",February:"February",March:"March",April:"April",May:"May",June:"June",July:"July",August:"August",September:"September",October:"October",November:"November",December:"December",am:"am",AM:"AM",pm:"pm",PM:"PM"},de:{sun:"So",mon:"Mo",tue:"Di",wed:"Mi",thu:"Do",fri:"Fr",sat:"Sa",Sunday:"Sonntag",Monday:"Montag",Tuesday:"Dienstag",Wednesday:"Mittwoch",Thursday:"Donnerstag",Friday:"Freitag",Saturday:"Samstag",jan:"Jan",feb:"Feb",mar:"Mrz",apr:"Apr",may:"Mai",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Okt",nov:"Nov",dec:"Dez",January:"Januar",February:"Februar",March:"März",April:"April",May:"Mai",June:"Juni",July:"Juli",August:"August",September:"September",October:"Oktober",November:"November",December:"Dezember",am:"am",AM:"AM",pm:"pm",PM:"PM"},ja:{sun:"日",mon:"月",tue:"火",wed:"水",thu:"木",fri:"金",sat:"土",Sunday:"日曜日",Monday:"月曜日",Tuesday:"火曜日",Wednesday:"水曜日",Thursday:"木曜日",Friday:"金曜日",Saturday:"土曜日",jan:"1月",feb:"2月",mar:"3月",apr:"4月",may:"5月",jun:"6月",jul:"7月",aug:"8月",sep:"9月",oct:"10月",nov:"11月",dec:"12月",January:"1月",February:"2月",March:"3月",April:"4月",May:"5月",June:"6月",July:"7月",August:"8月",September:"9月",October:"10月",November:"11月",December:"12月",am:"午前",AM:"午前",pm:"午後",PM:"午後"},zh:{sun:"周日",mon:"周一",tue:"周二",wed:"周三",thu:"周四",fri:"周五",sat:"周六",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",jan:"1月",feb:"2月",mar:"3月",apr:"4月",may:"5月",jun:"6月",jul:"7月",aug:"8月",sep:"9月",oct:"10月",nov:"11月",dec:"12月",January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月",am:"上午",AM:"上午",pm:"下午",PM:"下午"},"zh-Hant":{sun:"週日",mon:"週一",tue:"週二",wed:"週三",thu:"週四",fri:"週五",sat:"週六",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",jan:"1月",feb:"2月",mar:"3月",apr:"4月",may:"5月",jun:"6月",jul:"7月",aug:"8月",sep:"9月",oct:"10月",nov:"11月",dec:"12月",January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月",am:"上午",AM:"上午",pm:"下午",PM:"下午"}},_=function(t,e,i){if(!t)return null;if(!e||t===e)return t;var n;if(i)for(var o=i.length,r=0;r<o;++r)(n=i[r])&&m(t,e,n);else for(n in e)m(t,e,n);return t},f=function(t,e){return _({},t,e)},g=function(t){for(var e in t)return!1;return!0},y=function(t,e){if(!Array.isArray(t))return t;if(!e)return null;var i=t;t={};for(var n=i.length,o=0;o<n;++o){var r=e[o];r&&void 0!==i[o]&&(t[r]=i[o])}return t},m=function(t,e,i){var n=e[i];if(null!=n){var o=t[i];Array.isArray(o)?t[i]=o.concat(n):Array.isArray(n)&&o?t[i]=n.concat(o):t[i]=n}},v=function(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if("object"==typeof t){if(Array.isArray(t)){if(t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(!v(t[i],e[i]))return!1}else{if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(!v(t[n],e[n]))return!1}return!0}return!1},C=function(t){return Array.isArray(t)?"{\n"+t.join("\n")+"\n}":t},S=function(t){return t.replace(/\n+/g,"\n\t").replace(/\n\t}$/,"\n}")},w=function(t,e){if(!t)return null;var i=document.createElement("style");i.textContent="\n"+t+"\n";var n,o=function(t){var e;if(t&&(t.shadowRoot?e=t.shadowRoot:t.getRootNode&&(e=t.getRootNode()),e&&e!==document&&e!==t))return e;return null}(e),r=!0;return o||(r=!1,o=document.head),r&&o.children&&o.children.length&&(n=o.children[0]),n?o.insertBefore(i,n):o.appendChild(i),i},b=function(t,e){for(var i in e||(e=[]),t){var n=t[i];"object"==typeof n?b(n,e):e.push(n)}return e},R=function(t){if(!t||"string"!=typeof t)return"";if("#"===t.charAt(0))return t;var e=t.match(/\d+/g);if(!e||e.length<3)return t;for(var i="#",n=0;n<3;n++){var o=+e[n];o>=16||(i+="0"),i+=o?o.toString(16).toUpperCase():"0"}return i},I=function(t,e,i){this.resolve=this.resolve.bind(this),this.reject=this.reject.bind(this),"function"==typeof t&&(this._resolveHandler=t),"function"==typeof e&&(this._rejectHandler=e),null!=i&&(this._ctx=i),this.promise=new Promise(function(t,e){this._resolve=t,this._reject=e}.bind(this))};I.prototype.promise=null,I.prototype._resolve=null,I.prototype._reject=null,I.prototype._resolveHandler=null,I.prototype._rejectHandler=null,I.prototype._ctx=null,I.prototype._fulfilled=!1,I.prototype.resolve=function(t){if(this._resolve){if(this._resolveHandler){var e=this._resolveHandler(t,this._ctx||this);null!=e&&(t=e)}this._resolve(t),this._finally()}},I.prototype.reject=function(t){if(this._reject){if(this._rejectHandler){var e=this._rejectHandler(t,this._ctx||this);null!=e&&(t=e)}this._reject(t),this._finally()}},I.prototype.isFulfilled=function(){return this._fulfilled},I.prototype._finally=function(){this._fulfilled=!0,this._ctx=this._resolveHandler=this._rejectHandler=null,this._resolve=this._reject=null};var D={},x=function(t,e){"attributes"==e.type&&"lang"==e.attributeName&&(t.lang=e.target.lang||"en")},A=function(t,e,i){"attributes"===i.type&&(null!=e?i.attributeName===e&&t(i.target.getAttribute(e)):t(i.target))};D._getNewId=function(){return"observer_"+ ++D._id},D._addObserver=function(t,e,i){var n=i;n||(n={}),n.attributes=!0,D._observer.observe(t,n),D._addListener(t,e)},D._onMutationCallback=function(t){for(var e=0;e<t.length;e++)for(var i=t[e],n=D._listeners[i.target._observeId],o=0;o<n.length;o++)n[o](i)},D._addListener=function(t,e){var i=D._listeners;if(i||(i=D._listeners={}),!t._observeId){var n=D._getNewId();t._observeId=n}i[t._observeId]||(i[t._observeId]=[]);var o=i[t._observeId];o.indexOf(e)<0&&o.push(e)},D.addLanguageListener=function(t){t&&(t.lang=document.documentElement.lang||"en",D._addObserver(document.documentElement,x.bind(null,t)))},D.addAttributeListener=function(t,e,i){t&&e&&D._addObserver(t,A.bind(null,e,i))},D._observer=new MutationObserver(D._onMutationCallback),D._listeners={},D._id=0;var L={en:!0,de:!0,ja:!0,zh:!0,"zh-Hant":!0},T={_deferred:null,themeReady:null,_defaultColors:{up:"#39C46E",down:"#F5475B",level:"#C2C2C2",tickUp:"#39C46E",tickDown:"#F5475B",baseGrid:"#1A1A1C",baseText:"#C2C2C2",trackColor:"#FF9933"}};T.themeColors=T._defaultColors,T._components={},T._themeName="",T._elfVersion=0,T._dummyIcon=null,T._iconLoaded=!1,T._profileName=null,T._callbacks=[],T._observed=!1,T._pendingResolve=!1,T._themeLoaded=!1,T._icons={"elf-theme-halo":{rowGrouping:{expander:"down"},sorting:{ascending:"hollow-arrow-up",descending:"hollow-arrow-down",sortable:"sort-up-down"},columnStack:{stack:"map-layers",expand:"right",collapse:"left"}},"elf-theme-solar":{columnStack:{stack:"list",expand:"right",collapse:"left"}}},T._icons["halo-theme"]=T._icons["elf-theme-halo"],T._icons["solar-theme"]=T._icons["elf-theme-solar"],T.getElfVersion=function(){if(!T._elfVersion){var t=0;if(window.EFX_GRID){var e=window.EFX_GRID.version;t=+(e=e.split("."))[0]}else if(window.elf)if(window.elf.version){var i=window.elf.version.match(/\d/);i&&i[0]&&(t=parseInt(i[0],10))}else window.elf.customElements?t=3:window.customElements&&(t=4);else window.Polymer&&(t=1);T._elfVersion=t}return T._elfVersion},T.hasComponent=function(t){var e=T._components[t];if(null==e){e=0;var i=T.getElfVersion();if(t)1===i?document.createElement(t).is===t&&(e=i):i>1&&(window.customElements&&window.customElements.get(t)||document.createElement(t).constructor!==HTMLElement)&&(e=i),T._components[t]=e}return e},T.toLangString=function(t){if(!t)return"";if("zh-hant"===(t=t.toLowerCase()))return"zh-Hant";var e=t.replace(/-.*/,"");return L[e]?e:""},T.hasTheme=function(t){return t===T.getThemeName()},T.getThemeName=function(t){return T._themeName||(T._themeName=T.getCssVariable("--theme-name",document.documentElement)),T._themeName},T.setThemeName=function(t){T._themeName=t},T.isThemeLoaded=function(){return T._themeLoaded},T.getColors=function(){return T.themeColors},T.isHaloTheme=function(t){return null==t&&(t=T.getThemeName()),!!t&&t.indexOf("halo")>=0},T.injectIcons=function(t,e){if("object"==typeof t){var i=T.getThemeName();t.themeName=i;var n=T.getElfVersion();t.elfVersion=n;var o=T._icons[i];o&&(t.icons=o)}},T.getIconList=function(){var t=T._icons[T.getThemeName()];return t?b(t):[]},T._onIconPreloaded=function(){if(T._dummyIcon){var t=T._dummyIcon.parentNode;t&&t.removeChild(T._dummyIcon),T._dummyIcon=null}},T.prepareIconPreloading=function(){if(!T._iconLoaded){T._iconLoaded=!0;var t=T.getIconList();if(t.length){setTimeout(T._onIconPreloaded,10);var e=T._dummyIcon=document.createElement("ef-icon");return e.style.transform="scale(0)",document.body.appendChild(e),t}}return null},T.getCssVariable=function(t,e){var i="",n=e||document.body;return window&&"string"==typeof t&&1===n.nodeType&&t.match(/^--/)&&(i=(i=window.getComputedStyle(n).getPropertyValue(t)).replace(/[\"\']/g,"")),i},T.getCssVariables=function(t,e){var i=e||document.body;if(window&&1===i.nodeType){var n=window.getComputedStyle(i);for(var o in t){var r=t[o];r&&r.match(/^--/)&&(t[o]=n.getPropertyValue(r).replace(/\"/g,""))}}return t||null},T.setRTK=function(t){null!=t&&(T._rtk=t)},T.getMovementColorProfile=function(){return document.documentElement.getAttribute("movement-color-profile")},T._addThemeChangedCallback=function(t){var e=T._callbacks;e.indexOf(t)<0&&e.push(t)},T.reloadThemeColors=function(){return T._deferred&&T._deferred.isFulfilled()?(T._profileName="",T._themeLoaded=!1,T.themeReady=null,T.getThemeColors()):T.themeReady},T.getThemeColors=function(t){if("function"==typeof t&&T._addThemeChangedCallback(t),T.themeReady)return T.themeReady;var e=T._deferred=new I;T.themeReady=e.promise;var i=T.getMovementColorProfile();if(i)i!==T._profileName?setTimeout(T._profileNameRetrieved,100):T._deferred.resolve(T.themeColors);else{var n={providerName:"Configuration",settingName:"RDE_USER_CURRENT_TICK_COLOR"},o=window?window.JET:null;if(T._themeLoaded=!1,T._rtk&&T._rtk.Settings)T._rtk.Settings.getAsync(n).then(T._loadingProfileSuccess).catch(T._loadingProfileFailure);else if(o&&o.Settings)try{o.Settings.read(T._loadingProfileSuccess,n)}catch(t){T._loadingProfileFailure()}else setTimeout(T._profileNameRetrieved,100)}return e.promise};var E=function(t){if(t!==T._profileName){T._retrieveThemeColors(t),T._pendingResolve&&(T._pendingResolve=!1,T._deferred.resolve(T.themeColors));for(var e=T._callbacks,i=0;i<e.length;i++)e[i]()}};T._loadingProfileSuccess=function(t){t&&document.documentElement.setAttribute("movement-color-profile",t.toLowerCase()),T._observed?T._pendingResolve=!0:T._profileNameRetrieved(t)},T._loadingProfileFailure=function(){T._retrieveThemeColors(),T._observed||(T._observed=!0,D.addAttributeListener(document.documentElement,E,"movement-color-profile")),T._deferred.reject("Failed to get movement color profile from settings.")},T._profileNameRetrieved=function(){var t=T.getMovementColorProfile();T._retrieveThemeColors(t),T._observed||(T._observed=!0,D.addAttributeListener(document.documentElement,E,"movement-color-profile")),T._deferred.resolve(T.themeColors)},T._retrieveThemeColors=function(t){T._themeLoaded=!0,T._profileName=t;var e=T.themeColors=T.getCssVariables({primary:"--color-scheme-primary",secondary:"--color-scheme-secondary",tertiary:"--color-scheme-tertiary",complementary:"--color-scheme-complementary",up:"--color-scheme-positive",down:"--color-scheme-negative",level:"--color-scheme-neutral",tickUp:"--color-scheme-tickup",tickDown:"--color-scheme-tickdown"});e.up||(e.up=T._defaultColors.up,e.down=T._defaultColors.down,e.level=T._defaultColors.level,e.tickUp=T._defaultColors.tickUp,e.tickDown=T._defaultColors.tickDown),e.positive=e.up,e.negative=e.down,e.neutral=e.level;var i=document.createElement("table");i.style.visibility="hidden",i.style.position="fixed",i.style.left="0",i.style.top="0",i.style.width="0";var n=i.insertRow(-1),o=n.insertCell(-1);document.body.appendChild(i);var r=window.getComputedStyle(n);e.tableBg=r.backgroundColor;var s=window.getComputedStyle(o);e.tableText=s.color,e.tableBorder=s.borderColor,e.tableText===e.tableBorder&&(o.className="tr-lg",s=window.getComputedStyle(o),e.tableBg=s.backgroundColor,e.tableText=s.color,e.tableBorder=s.borderColor,e.tableText===e.tableBorder&&(e.tableBg=T._defaultColors.baseGrid,e.tableText=T._defaultColors.baseText,e.tableBorder="")),e.tableBg=R(e.tableBg),e.tableText=R(e.tableText),e.tableBorder=R(e.tableBorder),document.body.removeChild(i),e.baseGrid=e.tableBg,e.baseText=e.tableText,e.trackColor=e.primary||T._defaultColors.trackColor};var M=T,F=(new Date(NaN),Date.UTC(1900,0,1)),P=Date.UTC(1900,2,1),z=["sun","mon","tue","wed","thu","fri","sat"],V=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],k=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],O=["January","February","March","April","May","June","July","August","September","October","November","December"],N=function(t){return t>9?""+t:"0"+t},H={D:function(t,e){return""+t.getDate()},DD:function(t,e){return N(t.getDate())},DDD:function(t,e){return e[z[t.getDay()]]},D_:function(t,e){return e[V[t.getDay()]]},M:function(t,e){return""+(t.getMonth()+1)},MM:function(t,e){return N(t.getMonth()+1)},MMM:function(t,e){return e[k[t.getMonth()]]},M_:function(t,e){return e[O[t.getMonth()]]},YY:function(t,e){return(""+t.getFullYear()).substr(-2)},Y_:function(t,e){return""+t.getFullYear()},H:function(t,e){return""+t.getHours()},H_:function(t,e){return N(t.getHours())},h:function(t,e){var i=t.getHours()%12;return 0===i?"12":""+i},h_:function(t,e){var i=t.getHours()%12;return N(i=0===i?12:i)},m:function(t,e){return""+t.getMinutes()},m_:function(t,e){return N(t.getMinutes())},s:function(t,e){return""+t.getSeconds()},s_:function(t,e){return N(t.getSeconds())},S:function(t,e){return~~(t.getMilliseconds()/100)},SS:function(t,e){return N(~~(t.getMilliseconds()/10))},S_:function(t,e){return(i=t.getMilliseconds())>99?""+i:i>9?"0"+i:"00"+i;var i},A:function(t,e){return t.getHours()<12?e.AM:e.PM},a:function(t,e){return t.getHours()<12?e.am:e.pm}},B={_dateTimePattern:"M/D/YY h:mm A",_localeSetting:"en",_activeLocaleMap:null,_activeInput:null,setDateTimePattern:function(t){B._dateTimePattern=t||"M/D/YY h:mm A"},setLocale:function(t){var e=M.toLangString(t);B._localeSetting=c[e]?e:"en"},format:function(t,e,i){var n=null,o="",r=!(!i||"LOCAL"!==i.toUpperCase());if("number"==typeof t)t>1e8?n=new Date(t):(n=B.fromDateNumber(t),r=!0);else if(t instanceof Date)n=new Date(t);else{var s=(o=t+"").match(/^\d{4}(-\d{2}(-\d{2}(T\d{2}\:\d{2}\:\d{2})?)?)?$/);o=o.replace(/\-/g,"/"),s&&(o=o.replace(/T/g," ")),n=new Date(o)}return B.isInvalidDate(n)?t||"":(r||n.setTime(n.getTime()+6e4*n.getTimezoneOffset()),B.formatDateObject(n,e))},formatDateObject:function(t,e){if(B.isInvalidDate(t))return"";e||(e=B._dateTimePattern),B._activeInput=t,B._activeLocaleMap=c[B._localeSetting]||DateTimeLocale.en;var i=e.replace(/D+|M+|Y+|H+|S+|A+|d+|m+|y+|h+|s+|a+|\[[^\]]*\]+/g,B._parseDatePattern);return B._activeInput=null,i},_lowerCaseDatePatterns:{d:!0,y:!0},_parseDatePattern:function(t){var e=t?t.charAt(0):"";if("["===e)return t.substring(1,t.length-1);var i=H[t];if(!i){var n=t;B._lowerCaseDatePatterns[e]&&(n=t.toUpperCase(),e=e.toUpperCase(),i=H[n]),i||(i=H[n=e+"_"])}return i?i(B._activeInput,B._activeLocaleMap):t},isValidDate:function(t){if(t&&t.getTime){var e=t.getTime();return e==e}return!1},isInvalidDate:function(t){if(t&&t.getTime){var e=t.getTime();return e!=e}return!0},fromDateNumber:function(t){var e=B.dateNumberToMs(t);if(e==e){var i=B.timeNumberToMs(t);return new Date(e+i)}return new Date(NaN)},dateNumberToMs:function(t){if(!(t=Math.floor(+t))||t<=0||60===t)return NaN;var e=t-25569;return t<60&&e++,864e5*e},timeNumberToMs:function(t){"number"!=typeof t&&(t=+t);var e=t-Math.floor(t);return e?(e<0&&(e=-e),1e3*Math.round(86400*e)):0},toDateObject:function(t){var e=null;if(t instanceof Date)e=t;else if("number"==typeof t)e=t>3e9||t<=0?new Date(t):t>1e5?new Date(1e3*t):B.fromDateNumber(t);else if(t){var i=t+"",n=i.match(/^\d{4}(-\d{2}(-\d{2}(T\d{2}\:\d{2}\:\d{2})?)?)?$/);i=i.replace(/\-/g,"/"),n&&(i=i.replace(/T/g," ")),e=new Date(i)}else e=new Date(NaN);return e},toDateNumber:function(t){return B._millisecondToDateNumber(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()))},toTimeNumber:function(t){return Date.UTC(1970,0,1,t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds())/864e5},_millisecondToDateNumber:function(t){if((t=+t)!=t||t<F)return NaN;var e=t/864e5+25569;return t<P&&e--,e},toYYYYMMDD:function(t){var e=t?t.toJSON():"";return e?e.substr(0,10):""}},G=B,W={ISEMPTY:function(t){return t!=t||0===t||t?0:1},ISERR:function(t){return t!=t||null==t?1:0},ISNA:function(t){return""===t?1:0},ISNUMBER:function(t){return"number"==typeof t?1:0},ISSTRING:function(t){return"string"==typeof t?1:0},ISNASTRING:function(t){if(t){if(0===t.length)return 1;if(t.constructor===Object){for(var e in t)return 0;return 1}}else if(""===t)return 1;return 0}},U=W,Y={AND:function(){for(var t=arguments[0]instanceof Array?arguments[0]:arguments,e=t.length;--e>=0;)if(!t[e])return 0;return 1},FALSE:function(){return 0},IF:function(t,e,i){return t?e:i},NOT:function(t){return t?0:1},OR:function(){for(var t=arguments[0]instanceof Array?arguments[0]:arguments,e=t.length;--e>=0;)if(t[e])return 1;return 0},TRUE:function(){return 1}},q=Y,X={};X.ABS=Math.abs,X.ACOS=Math.acos,X.ACOSH=function(t){return Math.log(t+Math.sqrt(t*t-1))},X.ASIN=Math.asin,X.ASINH=function(t){return t===-1/0?t:Math.log(t+Math.sqrt(t*t+1))},X.ATAN=Math.atan,X.ATAN2=function(t,e){return Math.atan2(e,t)},X.ATANH=function(t){return Math.log((1+t)/(1-t))/2},X.CEILING=function(t,e){return e||(e=1),t/=e,Math.ceil(t)*e},X.CEIL=X.CEILING,X.COMBIN=function(t,e){var i=X.FACT;return i(t)/(i(e)*i(t-e))},X.COS=Math.cos,X.COSH=function(t){var e=Math.exp(t);return(e+1/e)/2},X.DEGREES=function(t){return t/(Math.PI/180)},X.EVEN=function(t){return(t=Math.ceil(t))%2?t<0?t-1:t+1:t},X.EXP=Math.exp,X.FACT=function(t){if(t<0)return NaN;t=Math.floor(t);for(var e=1;t>1;)e*=t,--t;return e},X.FACTDOUBLE=function(t){if(t<0)return NaN;t=Math.floor(t);for(var e=1;t>1;)e*=t,t-=2;return e},X.FLOOR=function(t,e){return e||(e=1),t/=e,Math.floor(t)*e},X.GCD=function(t,e){if(t<0&&(t=-t),e<0&&(e=-e),e>t){var i=t;t=e,e=i}for(;0!=e;){if(0==(t%=e))return e;e%=t}return t},X.INT=Math.floor,X.LCM=function(){for(var t=arguments[0]instanceof Array?arguments[0]:arguments,e=t.length,i=Math.abs(t[0]),n=1;n<e;n++){for(var o=Math.abs(t[n]),r=i;i&&o;)i>o?i%=o:o%=i;i=Math.abs(r*t[n])/(i+o)}return i},X.LN=Math.log,X.LOG=function(t,e){return null==e&&(e=10),Math.log(t)/Math.log(e)},X.LOG10=function(t){return Math.log(t)/Math.LN10},X.MOD=function(t,e){return t%e},X.ODD=function(t){return(t=Math.ceil(t))%2==0?t<0?t-1:t+1:t},X.POWER=Math.pow,X.PRODUCT=function(){var t=arguments[0]instanceof Array?arguments[0]:arguments,e=t[0];if(null==e||e!=e)return NaN;for(var i=t.length;--i>=1;)e*=t[i];return e},X.PROD=X.PRODUCT,X.QUOTIENT=function(t,e){return Math.floor(t/e)},X.RADIANS=function(t){return t*(Math.PI/180)},X.RAND=Math.random,X.RANDBETWEEN=function(t,e){return Math.floor(Math.random()*(e-t+1))+t},X.ROUND=function(t,e){if(!e)return Math.round(t);var i=Math.pow(10,e);return Math.round(t*i)/i},X.ROUNDDOWN=function(t,e){if(!e)return Math.floor(t);var i=Math.pow(10,e);return Math.floor(t*i)/i},X.ROUNDUP=function(t,e){if(!e)return Math.ceil(t);var i=Math.pow(10,e);return Math.ceil(t*i)/i},X.SERIESSUM=function(t,e,i,n){for(var o=0,r=n.length;--r>=0;)o+=n[r]*Math.pow(t,e+r*i);return o},X.SIGN=function(t){return t>0?1:t<0?-1:0},X.SIN=Math.sin,X.SINH=function(t){var e=Math.exp(t);return(e-1/e)/2},X.SQRT=Math.sqrt,X.SQRTPI=function(t){return Math.sqrt(t*Math.PI)},X.SUM=function(){for(var t=arguments[0]instanceof Array?arguments[0]:arguments,e=0,i=t.length;--i>=0;)e+=t[i];return e},X.SUMPRODUCT=function(){var t,e=arguments[0]instanceof Array?arguments[0]:arguments,i=e.length;if(0===i)return 0;var n=[];for(t=0;t<i;++t)n[t]=1;for(t=0;t<i;++t)n[t]*=e[t];var o=0;for(t=0;t<i;++t)o+=n[t];return o},X.SUMSQ=function(){for(var t=arguments[0]instanceof Array?arguments[0]:arguments,e=0,i=t.length;--i>=0;){var n=t[i];e+=n*n}return e},X.TAN=Math.tan,X.TANH=function(t){if(t===1/0)return 1;if(t===-1/0)return-1;var e=Math.exp(2*t);return(e-1)/(e+1)},X.TRUNC=function(t,e){if(!e)return Math.floor(t);var i=Math.pow(10,e);return Math.floor(t*i)/i};var j=X,K={AVERAGE:function(){var t=arguments[0]instanceof Array?arguments[0]:arguments,e=t.length;if(e<=0)return NaN;for(var i=0,n=e;--n>=0;)i+=t[n];return i/e}};K.AVG=K.AVERAGE,K.COUNT=function(){for(var t=arguments[0]instanceof Array?arguments[0]:arguments,e=0,i=t.length;--i>=0;){var n=t[i];null!=n&&n==n&&++e}return e},K.MAX=function(){var t=arguments[0]instanceof Array?arguments[0]:arguments;if(t.length<=0)return NaN;for(var e=t[0],i=t.length;--i>=1;)t[i]>e&&(e=t[i]);return e},K.MIN=function(){var t=arguments[0]instanceof Array?arguments[0]:arguments;if(t.length<=0)return NaN;for(var e=t[0],i=t.length;--i>=1;)t[i]<e&&(e=t[i]);return e},K.STDEV=function(){var t=arguments[0]instanceof Array?arguments[0]:Array.prototype.slice.call(arguments),e=t.length;if(e<=0)return NaN;if(1===e)return 0;for(var i=K.AVERAGE(t),n=0,o=e;--o>=0;){var r=t[o]-i;n+=r*r}return Math.sqrt(n/(e-1))},K.STDEVP=function(){var t=arguments[0]instanceof Array?arguments[0]:Array.prototype.slice.call(arguments),e=t.length;if(e<=0)return NaN;if(1===e)return 0;for(var i=K.AVERAGE(t),n=0,o=e;--o>=0;){var r=t[o]-i;n+=r*r}return Math.sqrt(n/e)};var J=K,Q={},Z=function(t){return t||0===t?t+"":""};Q.EXACT=function(t,e){return(t+="")===(e+="")?1:0},Q.FIND=function(t,e,i){return(t=Z(t))&&(e=Z(e))?((!(i=+i)||i<0)&&(i=0),e.indexOf(t,i)):0},Q.LEFT=function(t,e){return(e=+e)||(e=0),e<0&&(e=1),Z(t).substr(0,e)},Q.LENGTH=function(t){return Z(t).length},Q.LEN=Q.LENGTH,Q.LOWER=function(t){return Z(t).toLowerCase()},Q.MID=function(t,e,i){return Z(t).substr(e,i)},Q.REPLACE=function(t,e,i,n){n+="";var o=(t=Z(t)).split("");return o.splice(i,e,n),o.join("")},Q.RIGHT=function(t,e){(e=+e)||(e=0),e<0&&(e=1);var i=(t=Z(t)).length-e;return t.substr(i,e)},Q.TRIM=function(t){return Z(t).trim()},Q.UPPER=function(t){return Z(t).toUpperCase()},Q.VALUE=function(t){return+t},Q.CHAR=function(t){var e=+t;return String.fromCharCode(e)},Q.CLEAN=function(t){for(var e=Z(t).split(""),i=e.length;--i>=0;){var n=e[i].charCodeAt(0);(n<32||n>127)&&(e[i]="")}return e.join("")},Q.CODE=function(t){return Z(t).charCodeAt(0)},Q.PROPER=function(t){for(var e=(t=Z(t)).split(/[\W_]/g),i=t.match(/[\W_]/g),n=e.length,o="",r=0;r<n;r++){var s=e[r],a=s.length;1===a?o+=s.toUpperCase():0!==a&&(o+=s.charAt(0).toUpperCase()+s.substr(1).toLowerCase());var l=i[r];l&&(o+=l)}return o},Q.REPEAT=function(t,e){if(!(e=+e)||e<0)return"";if(""===(t=Z(t)))return"";for(var i=t,n=1;n<e;n++)i+=t;return i},Q.STRING=function(t,e){return(t=+t)?(!(e=+e)||e<0?e=0:e>9&&(e=9),t.toFixed(e)):""};var $=Q,tt=function(){this._context={},tt._addContext(this._context,tt.getContext()),this._context._DATA=this._getData.bind(this),this._setData=this._defaultFormulaDataSetter.bind(this),this._formulas=[],this._formulaMap={},this._referenceMap={}};s.inherits(tt,l),tt.prototype._context=null,tt.prototype._rowData=null,tt.prototype._setData=null,tt.prototype._formulas=null,tt.prototype._formulaMap=null,tt.prototype._referenceMap=null,tt._context=null,tt.getContext=function(){var t=tt._context;return t||(t={},tt._context=t,tt._addContext(t,G),tt._addContext(t,U),tt._addContext(t,q),tt._addContext(t,j),tt._addContext(t,J),tt._addContext(t,$)),t},tt.addContext=function(t){var e=tt.getContext();tt._addContext(e,t)},tt._addContext=function(t,e){for(var i in e)t[i]=e[i]},tt.prototype.setFormulaDataGetter=function(t){"function"==typeof t&&(this._context._DATA=t)},tt.prototype.setFormulaDataSetter=function(t){"function"==typeof t&&(this._setData=t)},tt.prototype._defaultFormulaDataSetter=function(t,e,i,n){if("..."!==e){var o=t.getAlias();i[o]=e,n&&(n[o]=e)}},tt.prototype.addFormula=function(t){var e;return t instanceof d?e=t:(this._rowData={},e=new d(t,this._context),this._rowData=null),e.addEventListener("dataCacheChanged",this._dispatch.bind(this,"dataChanged")),e.addEventListener("dataRequired",this._dispatch.bind(this,"dataRequired")),e.addEventListener("formulaChanged",this._dispatch.bind(this,"formulaChanged")),this._formulas.push(e),e},tt.prototype.mockFormula=function(t){return new d(t instanceof d?t.getInput():t,this._context)},tt.prototype.removeFormula=function(t){var e;if(t instanceof d&&(t=this._formulas.indexOf(t)),"number"==typeof t)(e=this._formulas[t])&&(this._formulas.splice(t,1),e.getReference()&&(delete this._formulaMap[e.getReference()],delete this._referenceMap[e.getReference()]),e.dispose());else if("string"==typeof t&&(e=this._formulaMap[t])){var i=this._formulas.indexOf(e);i>=0&&(this._formulas.splice(i,1),delete this._formulaMap[t],delete this._referenceMap[t]),e.dispose()}return e||null},tt.prototype.removeAllFormulas=function(){for(var t=this._formulas,e=t.length;--e>=0;)delete this._referenceMap[t[e].getReference()];this._formulas.length=0,this._formulaMap={}},tt.prototype.getFormula=function(t){return("number"==typeof t?this._formulas[t]:this._formulaMap[t])||null},tt.prototype.getFormulaByExpression=function(t){for(var e=this._formulas.length,i=0;i<e;++i){var n=this._formulas[i];if(n.getInput()===t)return n}return null},tt.prototype.getAllFormulas=function(){return this._formulas},tt.prototype.getAllFormulaReferences=function(){return this._referenceMap},tt.prototype.getFormulaCount=function(){return this._formulas.length},tt.prototype._generateUniqueReference=function(t){for(var e=t,i=0;null!=this._referenceMap[e];)e=t+"_"+ ++i;return e},tt.prototype.addReference=function(t,e){if(!t||!e)return"";e=this._generateUniqueReference(e);var i="";if(t instanceof d){if(!this._setFormulaReference(t,e))return"";i=t.getAlias()}else i=t;return this._referenceMap[e]=i,e},tt.prototype.renameReference=function(t,e){if(!e)return this.removeReference(t);if(!t||null==this._referenceMap[t]||t===e)return!1;var i=this._formulaMap[t];if(i&&!this.isValidReference(i,e))return!1;for(var n=this._formulas.length;--n>=0;){var o=this._formulas[n];if(o.changeField(t,e)){var r=o.getReference();r&&(this._referenceMap[r]=o.getAlias())}}return i&&this._setFormulaReference(i,e),this._referenceMap[e]=this._referenceMap[t],delete this._referenceMap[t],!0},tt.prototype.removeReference=function(t){if(!t||null==this._referenceMap[t])return!1;var e=this._formulaMap[t];return null!=e&&(e._setReference(""),delete this._formulaMap[t]),delete this._referenceMap[t],!0},tt.prototype.resolveReference=function(t){return this._referenceMap[t]||t},tt.prototype._getData=function(t,e){if(!this._rowData)return null;var i=this._rowData[this.resolveReference(t)];if(i){var n=Number(i);n==n&&(i=n)}return i},tt.prototype._setFormulaReference=function(t,e){if(this._formulaMap[e])return console.warn("Duplicate formula reference detected."),!1;var i=t.getReference();if(i===e)return!1;e&&(this._formulaMap[e]=t),t._setReference(e);var n=this._sortDependencies(this._formulas,this._formulaMap);return n?(this._formulas=n,delete this._formulaMap[i],!0):(t._setReference(i),delete this._formulaMap[e],!1)},tt.prototype.calculate=function(t,e){this._rowData=t;for(var i=this._formulas.length,n=0;n<i;++n){var o=this._formulas[n];if(e){var r=null!=e[o.getAlias()];if(!r){for(var s=o.getFieldNames(),a=s.length;--a>=0;)if(null!=e[this.resolveReference(s[a])]){r=!0;break}if(!r)continue}}var l=o.calculate(t);this._setData(o,l,t,e)}this._rowData=null},tt.prototype.isValidReference=function(t,e){if(!e)return!0;if(this._referenceMap[e])return!1;var i=t.getReference(),n=this._createParentChildrenMap(this._formulas);if(i)for(var o in delete n[i],n){var r=n[o],s=r.indexOf(i);-1!==s&&((r=r.slice(0)).splice(s,1),-1===(s=r.indexOf(e))&&r.push(e),n[o]=r)}return n[e]=t.getFieldNames(),!!this._sortParentChildrenMap(n)},tt.prototype._sortDependencies=function(t,e){if(1===t.length)return t;var i=this._createParentChildrenMap(t),n=this._sortParentChildrenMap(i);if(!n)return null;var o=t.filter((function(t){return!t.getReference()})),r=[];if(e){for(var s=n.length;--s>=0;){var a=e[n[s]];a&&r.push(a)}o.length>0&&(r=r.concat(o))}return r},tt.prototype._createParentChildrenMap=function(t){var e,i={};for(e=t.length;--e>=0;){var n=t[e],o=n.getReference();o&&(i[o]=n.getFieldNames())}return i},tt.prototype._sortParentChildrenMap=function(t){var e,i,n,o,r,s={};for(r in t){o=(n=t[r]).length;for(var a=0;a<o;++a)s[i=n[a]]=s[i]+1||1}var l=[];for(r in t)s[r]||l.push(r);for(var u=[];l.length>0;)for(r=l.shift(),u.push(r),o=(n=t[r])?n.length:0,e=0;e<o;++e)--s[i=n[e]]>0||l.push(i);for(i in s)if(s[i])return null;return u},tt._proto=tt.prototype;var et,it,nt={};nt.isIE=(et=window.navigator.userAgent).indexOf("MSIE ")>0||et.indexOf("Trident/")>0||et.indexOf("Edge/")>0,nt.isTouchDevice=!!(navigator.maxTouchPoints&&navigator.maxTouchPoints<256||navigator.msMaxTouchPoints&&navigator.msMaxTouchPoints<256),nt.isSafari=(it=navigator.userAgent,!/Chrome|Android|CriOS|FxiOS|EdgiOS/i.test(it)&&/Safari/i.test(it)),nt.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),nt.getElement=function(t){return nt.isElement(t)?t:t&&nt.isFunction(t.getElement)?t.getElement():null},nt.isElement=function(t){return!!t&&1===t.nodeType},nt.isEmpty=function(t,e){return null==t||void 0===t||!e&&""===t||nt.isArray(t)&&0===t.length},nt.isNumber=function(t){return"number"==typeof t&&isFinite(t)},nt.isString=function(t){return"string"==typeof t},nt.isArray=Array.isArray,nt.isFunction=function(t){return"function"==typeof t},nt.getClientPosition=function(t,e){var i=e||{};if(t.getBoundingClientRect){var n=t.getBoundingClientRect();i.x=n.left,i.y=n.top}else i.x=t.clientX,i.y=t.clientY;return i},nt.getRelativePosition=function(t,e,i){i=nt.getClientPosition(t,i);var n=nt.getClientPosition(e);return i.x-=n.x,i.y-=n.y,i},nt.moveArrayItem=function(t,e,i){if(!t)return null;var n=t.length;if(e>=n&&i>=n)return t;var o=t.splice(e,1)[0];return i<n?t.splice(i,0,o):t[i]=o,t},nt.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 n=0,o=0;n<i;)o+=1e5,Array.prototype.push.apply(t,e.slice(n,o)),n=o;return t},nt.insertEmptyItems=function(t,e,i){if(i>0)if(i>1){var n=t.slice(e);t.length=e,t.length+=i,nt.pushArrayItems(t,n)}else t.splice(e,0,null)},nt.cycleArray=function(t,e){if(e>0&&t&&e<t.length){var i=t.splice(0,e);return t.concat(i)}return t||null},nt.lowerBound=function(t,e,i,n,o){(null==i||i<0)&&(i=0),(null==n||n<0||n>t.length)&&(n=t.length),i>n&&(i=n),null==o&&(o=nt._defaultLessComparator);for(var r=0;n>i;)o(t[r=i+n>>1],e)?i=r+1:n=r;return i},nt.upperBound=function(t,e,i,n,o){for(var r=nt.lowerBound(t,e,i,n,o);t[r]===e;)++r;return r},nt.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}))},nt._defaultLessComparator=function(t,e){return t<e},nt._deprecatedFunction=function(){console.warn("Calling deprecated method")},nt.calculatePercent=function(t,e,i){if(!t&&0!==t||!e&&0!==e||!i&&0!==i)return NaN;if(i===t)return 50;var n=(e-t)/(i-t);return n<0?0:n>1?100:100*n},nt.closestElement=function(t,e){for(var i=t;i;){if(i.classList&&i.classList.contains(e))return i;i=i.parentNode||i.host}return null},nt._preventDefault=function(t){t.preventDefault(),t.stopPropagation()};var ot=nt,rt=function(t){this.dispatch=this.dispatch.bind(this),this._listeners=[],this.setSender(t)};rt.prototype.listen=function(t,e){if(t&&ot.isFunction(t)&&this._listeners.indexOf(t)<0)if(null==e)this._listeners.push(t);else{t._priority=e;var i=ot.lowerBound(this._listeners,t,0,this._listeners.length,rt.listenerComparer);this._listeners.splice(i,0,t)}},rt.prototype.unlisten=function(t){if(t){var e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}},rt.prototype.unlistenAll=function(){this._listeners.length=0},rt.prototype.getListenerCount=function(){return this._listeners.length},rt.prototype.hasListener=function(){return this._listeners.length>0},rt.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);null!==this._sender&&(t.sender=null),this._dispatching=!1}},rt.prototype.isDispatching=function(){return this._dispatching},rt.prototype.isEnabled=function(){return this._enabled},rt.prototype.enable=function(t){this._enabled=!1!==t},rt.prototype.disable=function(t){this._enabled=!1===t},rt.prototype.setSender=function(t){this._sender=t||null},rt.prototype.setEventArgExtender=function(t){this._extender=null!=t?t:null},rt.listenerComparer=function(t,e){return null==e._priority||t._priority>=e._priority},rt.prototype._listeners=null,rt.prototype._sender=null,rt.prototype._extender=null,rt.prototype._enabled=!0,rt.prototype._dispatching=!1,rt._proto=rt.prototype;var st=rt,at=function(){};at.prototype._customEvents=null,at.prototype.listen=function(t,e,i){this._customEvents&&this._customEvents[t]&&this._customEvents[t].listen(e,i)},at.prototype.unlisten=function(t,e){this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlisten(e)},at.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()},at.prototype._addEvent=function(t){t&&(this._customEvents||(this._customEvents={}),this._customEvents[t]||(this._customEvents[t]=new st(this)))},at.prototype._addEvents=function(t){for(var e=Array.isArray(t)?t:arguments,i=e.length,n=0;n<i;++n)this._addEvent(e[n])},at.prototype._isEventDispatching=function(t){var e=this._customEvents[t];return!!e&&e.isDispatching()},at.prototype._disableEvent=function(t,e){var i=this._customEvents[t];i&&i.disable(e)},at.prototype._hasListener=function(t){return!(!this._customEvents||!this._customEvents[t])&&this._customEvents[t].hasListener()},at.prototype._dispatch=function(t,e){this._customEvents[t].dispatch(e)},at._proto=at.prototype;var lt=at,ut=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")};s.inherits(ut,lt),ut.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._quotes2=null},ut.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))},ut.prototype.getSubscriptions=function(){return this._quotes2},ut.prototype.addSubscription=function(t,e,i){if(!this.getSubscription(t.id)){var n={s:t,rics:{}};this._subs[t.id]=n,this._quotes2||(t.onNewRow(this._onInsert),t.onUpdate(this._onUpdate),t.onRemoveRow(this._onDelete)),e&&(n.primary=e,i||(i={}),this._onInsert(t,e,i))}},ut.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 n in i)this.setRowData(e+n,null);delete this._subs[e]}},ut.prototype.startAllSubscriptions=function(){if(this._quotes2)this._quotes2.start();else for(var t in this._subs)this._subs[t].s.start()},ut.prototype.stopAllSubscriptions=function(){if(this._quotes2)this._quotes2.stop();else for(var t in this._subs)this._subs[t].s.stop()},ut.prototype.getSubscription=function(t){return this._subs[t]?this._subs[t].s:null},ut.prototype.getPrimaryRic=function(t){var e=this._subs[t];return e?e.primary:""},ut.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})},ut.prototype.clearColumnData=function(t,e){for(var i="string"==typeof t?[t]:t,n=i.length;--n>=0;){var o=i[n];if(o)for(var r in this._rows)delete this._rows[r][o]}e||this._dispatchDataChange({globalChange:!0})},ut.prototype.getData=function(t,e){var i=this.getRowData(t);return i?i[e]:null},ut.prototype.getAllRics=function(){var t={};for(var e in this._subs){var i=this._subs[e].rics;for(var n in i)t[n]||(t[n]=[]),t[n].push(e)}return t},ut.prototype.getAllRowIds=function(){var t=[];for(var e in this._rows)t.push(e);return t},ut.prototype.hasRowId=function(t){return!!this._rows[t]},ut.prototype.getColumnData=function(t){var e=[];for(var i in this._rows)e.push(this._rows[i][t]);return e},ut.prototype.getRowData=function(t){return this._rows[t]||null},ut.prototype.getMultipleRowData=function(t,e,i){var n=t.length;null==i&&(i=n),i>n&&(i=n),e>0||(e=0);for(var o=new Array(n),r=this._rows,s=e;s<i;++s)o[s]=r[t[s]]||null;return o},ut.prototype.getAllRowData=function(){var t=[],e=this._rows;for(var i in e)t.push(e[i]);return t},ut.prototype.setData=function(t,e,i){var n={};return n[e]=i,this.setRowData(t,n)},ut.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},ut.prototype.setRowData=function(t,e,i){var n=this.getRowData(t),o=!1,r=null;if(e)if(n){for(var s in e)n[s]=e[s],o=!0;r=e}else n=e,this._rows[t]=n,o=!0;else n&&(delete this._rows[t],o=!0);if(o&&!this._composing){var a=i||{};a.rid=t,r&&(a.changes=r),a.rowData=n,this._dispatchDataChange(a)}return o},ut.prototype.cloneRowData=function(t){var e=this._rows[t];if(!e)return null;var i={};for(var n in e)0!==n.indexOf("FREE_TEXT")&&(i[n]=e[n]);return i},ut.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},ut.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]])},ut.prototype.resetStaticFields=function(){this._staticFields={}},ut.prototype.getStaticFields=function(){return this._staticFields},ut.prototype.dump=function(t){return ut.constructTable(this.getAllRowData(),t,Object.keys(this._rows))},ut.prototype.log=function(t){console.table(this.dump(t))},ut.prototype.setDataCloudSettings=function(t,e,i,n){null!=t&&(this._userId=t),null!=e&&(this._productId=e),null!=i&&(this._adcUrl=i),n&&(this._lang=n)},ut.prototype.getDataCloudFields=function(){return this._adcFields},ut.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 n=this.getAllRics();return this._batchRequestDataCloud(n,e),!0},ut.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},ut.prototype._dispatchDataChange=function(t){this._composing||(this._composing=!0,this._dispatch("dataComposed",t),this._composing=!1,this._dispatch("dataChanged",t))},ut._defaultPropertyGetter=function(t,e,i){var n=e[i];return n?n[t]:null},ut._defaultGetter=function(t,e){return t[e]},ut.constructTable=function(t,e,i){var n=0,o=t.length,r=o,s=null,a=i||null,l=ut._defaultGetter,u=!1;if(e){if(e.rowCount&&(r=e.rowCount,u=!0),e.colNames){s={};for(var h=e.colNames.length,p=0;p<h;++p)s[e.colNames[p]]=!0;u=!0}e.getter&&(l="string"==typeof e.getter?ut._defaultPropertyGetter.bind(null,e.getter):e.getter,u=!0),e.startIndex&&(n=e.startIndex,u=!0),!1===e.withRowIds&&(a=null)}if(!u&&!a)return t;for(var d=[],c=n;c<o&&!(d.length>=r);++c){var _,f=t[c],g=a?{rid:a[c]}:{};if(f)if(s)for(_ in s)null!=f[_]&&(g[_]=l(f,_));else for(_ in f)g[_]=l(f,_);d.push(g)}return d},ut.prototype._insertRic=function(t,e,i){var n=t+(e=e.replace("0#",""));this._onADCForNewRic(t,e);var o=this.getRowData(n);if(o){var r=o.ROW_DEF;r&&r.isChain()&&(i.SUB_ID=t)}else{var s=i;for(var a in i={},s)i[a]=s[a];i.SUB_ID=t,i.RIC=e}this.setRowData(n,i)},ut.prototype._onQ2DataChanged=function(t){var e=t.subId,i=t.ric,n=t.values;n?this._insertRic(e,i,n):(delete this._subs[e].rics[i],this.setRowData(e+i,null))},ut.prototype._onQ2SubAdded=function(t){for(var e=t.subs,i=t.duplicateSubIds,n=e.length,o=0;o<n;++o){var r=e[o],s=r.ric;if(!(r.id.indexOf("_ci_")>=0)&&(this.addSubscription(r,s),i)){var a=i[o];a&&window.setTimeout(this._onDuplicateRic.bind(this,r.id,this.getRowData(a+s)),10)}}},ut.prototype._onQ2SubRemoved=function(t){for(var e=t.subs,i=e.length,n=0;n<i;++n){var o=e[n];o.id.indexOf("_ci_")>=0||this.removeSubscription(o)}},ut.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)},ut.prototype._onDuplicateRic=function(t,e){var i=this._subs[t];if(i){var n=(i=i.s).ric,o=e.SUB_ID,r=this._cloneRowData(e,n,t);if(r){this._onInsert(i,n,r);var s=i.children;if(s)for(var a=s.length,l=0;l<a;++l)n=s[l],r=this._cloneRowData(o,n,t),this._onInsert(i,n,r)}}},ut.prototype._onInsert=function(t,e,i){var n=t.id;this._quotes2?this._insertRic(n,e,i):(this._onADCForNewRic(n,e),this.setRowData(n+e,i,{subscription:t,ric:e}))},ut.prototype._onUpdate=ut.prototype._onInsert,ut.prototype._onDelete=function(t,e,i){delete this._subs[t.id].rics[e],this.setRowData(t.id+e,null,{subscription:t,ric:e})},ut.prototype._addDataCloudField=function(t,e){this._adcRefMap[t]?++this._adcRefMap[t]:(this._adcFields.push(t),e.push(t),this._adcRefMap[t]=1)},ut.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 n=i.cols,o=i.rows,r=o[0],s=-1,a={},l=0;l<n;++l){var u=r[l];"instrument"===u.i?s=l:u.r&&(a[u.r]=l)}for(var h=o.length,p=1;p<h;++p){var d=o[p],c=d[s],_={};for(var f in a){var g=d[a[f]];null!=g&&null!==g&&null==g.f&&(this._quotes2?(_[f]=g,_[f+"_FORMATTED"]=g):_[f]={formatted:g+"",raw:g})}var y=e.ricMap[c];if(y)for(l=y.length;--l>=0;){var m=y[l];this._subs[m]&&this.setRowData(m+c,_)}}}},ut.prototype._onADCError=function(t){window.console.log(t)},ut.prototype._onBatchRequestADCData=function(t){this._adcTimerId<=0||(this._adcTimerId=-1,this._batchRequestDataCloud(this._adcRicMap,this._adcFields),this._adcRicMap=null)},ut.prototype._batchRequestDataCloud=function(t,e){if(!this._adcUrl)return null;var i=[];for(var n in t)i.push(n);for(;i.length>30;)this._requestDataCloud(t,e,i.splice(0,30));return this._requestDataCloud(t,e,i)},ut.prototype._requestDataCloud=function(t,e,i){if(!i||i.length<=0)return null;if(!e||e.length<=0)return null;var n=new XMLHttpRequest;n.onload=this._onADCUpdate,n.onerror=this._onADCError,n.ricMap=t,n.open("POST",this._adcUrl,!0),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded");var o="formula="+e+"&identifiers="+i;return this._productId&&(o+="&productid="+this._productId),this._userId&&(o+="&uuid="+this._userId),this._lang&&(o+="&lang="+this._lang),n.send(o),n},ut.prototype._cloneRowData=function(t,e,i){var n="string"==typeof t?t:t.SUB_ID,o=this._rows[n+e];if(!o){if("object"!=typeof t)return null;o=t}var r={};for(var s in o)null==this._staticFields[s]&&(r[s]=o[s]);return r.SUB_ID=i,r},ut.prototype._rows,ut.prototype._subs,ut.prototype._quotes2=null,ut.prototype._staticFields=null,ut.prototype._adcFields=null,ut.prototype._adcRefMap=null,ut.prototype._adcTimerId=-1,ut.prototype._adcRicMap=null,ut.prototype._adcUrl="/datacloud/rest/select",ut.prototype._userId="",ut.prototype._productId="",ut.prototype._composing=!1,ut.prototype._lang="",ut._proto=ut.prototype;var ht=ut,pt=function(t,e){this._rid=t,this._children={},this._shared=e};s.inherits(pt,l),pt._subSegSortLogic=function(t,e){return"Uncategorized"===t?1:"Uncategorized"===e||t<e?-1:e<t?1:0},pt._assignSubSegmentOrder=function(t,e){t.setOrder(e+1)},pt.prototype._shared=null,pt.prototype._rid,pt.prototype._children,pt.prototype._childCount=0,pt.prototype._collapsed=!1,pt.prototype._order=0,pt.prototype._disposed=!1,pt.prototype._subSegDef=null,pt.prototype._subSegLevel=0,pt.prototype._subSegMap=null,pt.prototype._subSegNames=null,pt.prototype._subSegName="",pt.prototype._subSegVal,pt.prototype._subSegParent=null,pt.prototype.dispose=function(){if(!this._disposed){this._disposed=!0,this.removeAllEventListeners();var t=this._subSegNames;if(t){for(var e=t.length,i=this._subSegMap,n=0;n<e;++n)i[t[n]].dispose();this._subSegMap=this._subSegNames=null}this._collapsed&&(this._shared.dirtyCollapsingState=!0),this._shared=null,this._subSegParent=this._subSegDef=this._subSegVal=null}},pt.prototype.getId=function(){return this._rid},pt.prototype.getParentId=function(){return this._subSegParent?this._subSegParent.getId():""},pt.prototype.getSubSegmentIds=function(t){var e=this._subSegNames;if(e){t||(t=[]);for(var i=e.length,n=this._subSegMap,o=0;o<i;++o){var r=n[e[o]];t.push(r.getId()),r.getSubSegmentIds(t)}return t}return null},pt.prototype.addChild=function(t,e){if(t){if(this._shared.childToSegment[t]=this._rid,!this._children[t])return this._collapsed&&(this._shared.dirtyCollapsingState=!0),this._children[t]=e||t,++this._childCount,!0;this._children[t]=e||t}return!1},pt.prototype.addChildren=function(t,e){var i,n=Array.isArray(t)?t:[t],o=n.length,r=0;if(null!=e)for(e=Array.isArray(e)?e:[e],i=0;i<o;++i)r|=this.addChild(n[i],e[i]);else for(i=0;i<o;++i)r|=this.addChild(n[i]);return!!r},pt.prototype.containsChild=function(t){return!!this._children[t]},pt.prototype.removeChild=function(t){return!this._subSegLevel&&(!!this._childCount&&(!!this._children[t]&&(delete this._shared.childToSegment[t],delete this._children[t],--this._childCount,this._collapsed&&(this._shared.dirtyCollapsingState=!0),!0)))},pt.prototype.removeChildren=function(t){if(this._subSegLevel)return!1;if(!this._childCount)return!1;for(var e=Array.isArray(t)?t:[t],i=e.length,n=0,o=0;o<i;++o)n|=this.removeChild(e[o]);return!!n},pt.prototype.removeAllChildren=function(){if(this._subSegLevel)return!1;if(!this._childCount)return!1;var t=this._shared.childToSegment,e=this._children;for(var i in e)t[i]&&delete t[i];return this._children={},this._childCount=0,this._collapsed&&(this._shared.dirtyCollapsingState=!0),!0},pt.prototype.getChildIds=function(){return this._childCount?Object.keys(this._children):[]},pt.prototype.getChildren=function(){return this._children},pt.prototype.getChildCount=function(){return this._childCount},pt.prototype.getClassification=function(){return this._subSegDef&&this._subSegDef.classifiers||null},pt.prototype.setClassification=function(t){if(this._subSegLevel)return!1;var e=null;this._subSegDef&&(e=this._subSegDef.classifiers);var i,n=null;t&&("string"==typeof t?n=[t]:Array.isArray(t)&&(n=t));var o=n?n.length:0;if(o){if((e?e.length:0)===o){for(i=0;i<o&&n[i]===e[i];++i);if(i>=o)return!1}return this._subSegDef||(this._subSegDef={root:this,subSegments:null}),this._subSegDef.classifiers=n,!0}return!!e&&(this._subSegDef.classifiers=null,this._subSegDef.subSegments=null,this._subSegDef=null,!0)},pt.prototype.classify=function(t){var e=this._subSegDef?this._subSegDef.classifiers:null,i=e?e.length:0,n=this._subSegNames,o=n?n.length:0;if(!o&&this._subSegLevel>=i)return!1;var r,s=this._shared;this._collapsed&&(s.dirtyCollapsingState=!0);var a="",l={},u=0,h=this._subSegMap,p=null;if(o)for(u=o,r=0;r<u;++r)l[a=n[r]]=1,(p=h[a])._childCount&&(p._children={},p._childCount=0),p._collapsed&&(s.dirtyCollapsingState=!0);var d,c=!this._subSegLevel,_=this._children;if(this._subSegLevel<i&&t){h||(h=this._subSegMap={},n=this._subSegNames=[]);var f=e[this._subSegLevel];for(d in _){var g=_[d],y=t[g],m=y?y[f]:null;s.childToSegment[d]=this._rid,a="Uncategorized",(m||0===m||!1===m)&&(a=m+""),l[a]&&(l[a]=0,--u),(p=h[a])||((p=new pt(this._rid+"/"+a,s))._subSegDef=this._subSegDef,p._subSegLevel=this._subSegLevel+1,p._subSegName=a,p._subSegVal=m,p._subSegParent=this,h[a]=p,n.push(a),this._dispatch("subSegmentAdded",{rid:p.getId(),segment:p})),p.addChild(d,g)}}else if(c)for(d in _)s.childToSegment[d]=this._rid;if(u>0){for(a in u>=n.length&&(n.length=0),l)if(l[a]){p=h[a],delete h[a];var v=n.indexOf(a);v>=0&&n.splice(v,1),this._dispatch("subSegmentRemoved",{rid:p.getId(),segment:p})}n.length||(n=this._subSegMap=this._subSegNames=null)}if(o=n?n.length:0)for(n.sort(pt._subSegSortLogic),r=0;r<o;++r)(p=h[n[r]]).classify(t);if(c&&this._subSegDef)if(o){var C=this._subSegDef.subSegments=[];this.getAllSubSegments(C),C.forEach(pt._assignSubSegmentOrder)}else this._subSegDef.subSegments=null;return!0},pt.prototype.hasSubSegments=function(){return!!this._subSegNames&&!!this._subSegNames.length},pt.prototype.isSubSegment=function(){return!!this._subSegLevel},pt.prototype.getFirstAncestor=function(){return this._subSegLevel&&this._subSegDef&&this._subSegDef.root||null},pt.prototype.getAllSubSegments=function(t){var e=this._subSegNames;if(e){t||(t=[]);for(var i=this._subSegMap,n=e.length,o=0;o<n;++o){var r=i[e[o]];t.push(r),r.getAllSubSegments(t)}}return t||null},pt.prototype.getSegmentLevel=function(){return this._subSegLevel},pt.prototype.setRowData=function(t,e){if(t){var i=t[this._rid];i||(i=t[this._rid]={}),e||(e=t),(i=e[this._rid])||(i=e[this._rid]={});for(var n=this;n&&n.isSubSegment();)n.getSubSegmentName(i),n=n._subSegParent}},pt.prototype.getSubSegmentName=function(t){if(t&&this._subSegLevel){var e=this.getClassification()[this._subSegLevel-1];e&&(t[e]=this._subSegName)}return this._subSegName},pt.prototype.collapse=function(t){return t=!1!==t,this._collapsed!==t&&(this._collapsed=t,this._shared.dirtyCollapsingState=!0,!0)},pt.prototype.expand=function(t){return this.collapse(!1===t)},pt.prototype.isCollapsed=function(){return this._collapsed},pt.prototype.getCollapsingStates=function(t,e){var i=this._subSegNames;if(!this._subSegLevel&&!i&&!this._collapsed)return!1;t||(t={});var n=!1;if(this._subSegLevel&&e&&(t[this._rid]=!0,n=!0),this._childCount){var o=e||this._collapsed;if(i)for(var r=this._subSegMap,s=i.length,a=0;a<s;++a){var l=r[i[a]];t[l.getId()]=!!e,l.getCollapsingStates(t,o)&&(n=!0)}else if(o){var u=this._children;for(var h in u)t[h]=o;n=!0}}return n},pt.prototype.getOrder=function(){if(this._subSegLevel){var t=this.getFirstAncestor();if(t)return t.getOrder()+this._order}return 1e4*this._order},pt.prototype.getLastOrder=function(){if(this._subSegDef){var t=this._subSegDef.subSegments;if(t){var e=t[t.length-1];if(e)return e.getOrder()}}return this.getOrder()},pt.prototype.setOrder=function(t){this._order=t},pt._tabs=null,pt.prototype.log=function(t){var e,i=pt._tabs;if(!i){i=pt._tabs=[];var n="";for(e=0;e<11;++e)i[e]=n,n+=" "}var o=this._collapsed?"+ ":"- ";t.push(i[this._subSegLevel]+o+this._rid);var r=this._subSegNames;if(r){var s=r.length,a=this._subSegMap;for(e=0;e<s;++e)a[r[e]].log(t)}else if(this._childCount){var l=i[this._subSegLevel+1];for(var u in this._children)t.push(l+"- "+u)}return t};var dt=pt,ct=function(){this._onSubSegmentAdded=this._onSubSegmentAdded.bind(this),this._onSubSegmentRemoved=this._onSubSegmentRemoved.bind(this),this._segments={},this._insertionList=[],this._removalList=[],this._shared={childToSegment:{},dirtyCollapsingState:!1}};s.inherits(ct,l),ct.prototype._segments,ct.prototype._segmentCount=0,ct.prototype._collapsedRids=null,ct.prototype._shared,ct.prototype._segmentList=null,ct.prototype._insertionList=null,ct.prototype._removalList=null,ct.prototype._classification=!1,ct.prototype._classifierChanged=!1,ct.prototype.dispose=function(){this.removeAllSegments(),this.removeAllEventListeners(),this._collapsedRids=null,this._segmentList=this._insertionList=this._removalList=null},ct.prototype.addSegment=function(t,e){if(t&&!this._segments[t]){if(this.getParentRowId(t))return console.log("child of a segment cannot be set as a segment separator"),!1;var i=this._segments[t]=new dt(t,this._shared);return i.addEventListener("subSegmentAdded",this._onSubSegmentAdded),i.addEventListener("subSegmentRemoved",this._onSubSegmentRemoved),++this._segmentCount,this._segmentList=null,e&&e.length&&i.addChildren(e),!0}return!1},ct.prototype.addSegments=function(t){for(var e=Array.isArray(t)?t:[t],i=e.length,n=0,o=0;o<i;++o)n|=this.addSegment(e[o]);return!!n},ct.prototype.containsSegment=function(t){return!!this._segments[t]},ct.prototype.getParentRowId=function(t){return this._shared.childToSegment[t]||""},ct.prototype.removeSegment=function(t){var e=this._segments[t];if(e){if(this._segmentCount<=1)return this.removeAllSegments();e.isSubSegment()&&this._removalList.push(e.getId());var i=e.getSubSegmentIds();if(i)for(var n=i.length,o=0;o<n;++o){var r=i[o];this._segments[r]&&(this._removalList.push(r),delete this._segments[r],--this._segmentCount)}return e.removeAllChildren(),e.dispose(),delete this._segments[t],--this._segmentCount,!0}return!1},ct.prototype.removeAllSegments=function(){if(this._segmentCount){for(var t in this._segments)this._segments[t].dispose();return this._segments={},this._segmentCount=0,this._segmentList=null,this._shared.childToSegment={},this._classification=this._classifierChanged=!1,!0}return!1},ct.prototype.getSegmentCount=function(){return this._segmentCount},ct.prototype.getSegment=function(t){return this._segments[t]||null},ct.prototype.getSegmentParent=function(t){var e=this.getParentRowId(t);return e?this.getSegment(e):null},ct.prototype.getSegments=function(){return this._segmentCount?this._segments:null},ct.prototype.getSegmentIds=function(){return Object.keys(this._segments)},ct.prototype.collapseSegment=function(t,e){var i=this._segments[t];return!!i&&i.collapse(e)},ct.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},ct.prototype.expandAllSegments=function(){if(this._segmentCount){var t=this._segments,e=0;for(var i in t)e|=t[i].expand();if(e)return!0}return!1},ct.prototype.isCollapsedSegment=function(t){var e=this._segments[t];return!!e&&e.isCollapsed()},ct.prototype.getCollapsedRows=function(){if(this._shared.dirtyCollapsingState){this._shared.dirtyCollapsingState=!1;var t=null,e=0;if(this._segmentCount){var i=this._segments;for(var n in t={},i){var o=i[n];o.isSubSegment()||o.getCollapsingStates(t)&&++e}}this._collapsedRids=e?t:null}return this._collapsedRids},ct.prototype.addSegmentChild=function(t,e,i){var n=this._segments[t];return!(!n||n.isSubSegment())&&n.addChild(e,i)},ct.prototype.addSegmentChildren=function(t,e,i){var n=this._segments[t];return!(!n||n.isSubSegment())&&n.addChildren(e,i)},ct.prototype.containsSegmentChild=function(t,e){var i=this._segments[t];return!!i&&i.containsChild(e)},ct.prototype.removeSegmentChild=function(t,e){var i=this._segments[t];return!!i&&i.removeChild(e)},ct.prototype.removeSegmentChildren=function(t,e){var i=this._segments[t];return!!i&&i.removeChildren(e)},ct.prototype.removeAllSegmentChildren=function(){this._shared.childToSegment={};var t=this._segments,e=!1;for(var i in t){t[i].removeAllChildren()&&(e=!0)}return e&&this.classify(null),e},ct.prototype.fillSegment=function(t,e){var i=Array.isArray(e)?e.length:0;if(i){var n=this._segments,o=n[t];if(o&&!o.isSubSegment()){var r=e.indexOf(t);if(r>=0){o.removeAllChildren();for(var s=r+1;s<i;++s){var a=e[s];if(n[a])break;o.addChild(a)}}}}},ct.prototype.fillSegments=function(t){this._shared.childToSegment={};for(var e=Array.isArray(t)?t.length:0,i=this._segments,n=null,o=!1,r=0;r<e;++r){var s=t[r],a=i[s];a&&!a.isSubSegment()?(n=a).removeAllChildren():n&&!n.isSubSegment()&&(n.addChild(s),o=!0)}return o},ct.prototype.calcSegmentOrder=function(t){var e=this._segmentList;e?e.length=0:e=this._segmentList=[];for(var i=t?t.length:0,n=this._segments,o=this._segmentCount,r=0,s=0;s<i;++s){var a=n[t[s]];if(a&&(a.isSubSegment()||(this._segmentList.push(a),a.setOrder(++r)),--o<=0))break}},ct.prototype.getSegmentValues=function(t,e){var i=t?t.length:0;if(!i)return null;for(var n=this._segments,o=this._shared.childToSegment,r=null,s=null,a=new Array(i),l=0,u=-10,h=0,p=0;p<i;++p){var d=t[p];if(r=n[d])l=100*r.getOrder(),h=0,r.isSubSegment()||s!==r&&(s=r,u=100*r.getLastOrder());else{var c=o[d];c?(l=100*(r=n[c]).getOrder(),h=1,e&&(u=100*r.getLastOrder())):u?(l=u,h=10):l=h=0}a[p]=l+h}return s?a:null},ct.prototype.logStructure=function(){var t=this._segmentList;if(!t)return"";for(var e=t.length,i=[],n=0;n<e;++n)t[n].log(i);return i.join("\n")},ct.prototype.logRowIdMap=function(){var t=[],e=this._shared.childToSegment;for(var i in e){var n=e[i];t.push(i+" > "+n)}return t.join("\n")},ct.prototype.setSegmentClassification=function(t,e){var i=this._segments[t];return!(!i||!i.setClassification(e))&&(i.getClassification()&&(this._classification=!0),this._classifierChanged=!0,!0)},ct.prototype.hasClassification=function(){return this._classification||this._classifierChanged},ct.prototype.classify=function(t){if(!this._segmentCount)return!1;if(!this.hasClassification())return!1;this._classification=this._classifierChanged=!1;var e=this._segments;for(var i in e){var n=this._segments[i];n.isSubSegment()||(n.getClassification()&&(this._classification=!0),n.classify(t))}return this._insertionList.length||this._removalList.length?(this._dispatch("subSegmentChanged",{insertionList:this._insertionList,removalList:this._removalList}),this._insertionList.length=0,this._removalList.length=0,this._dispatch("classified",{}),!0):(this._dispatch("classified",{}),!1)},ct.prototype._onSubSegmentAdded=function(t){var e=t.rid;if(this._segments[e])console.log("Incorrect logic detected.");else{var i=t.segment;this._insertionList.push(i),this._segments[e]=i,this._segmentCount++,i.addEventListener("subSegmentAdded",this._onSubSegmentAdded),i.addEventListener("subSegmentRemoved",this._onSubSegmentRemoved)}},ct.prototype._onSubSegmentRemoved=function(t){var e=t.rid;this.removeSegment(e)};var _t=ct,ft=function(){ft.base(this,"constructor"),this._removeRows=this._removeRows.bind(this),this._bySegmentSeparator=this._bySegmentSeparator.bind(this),this._onClassifyingTimer=this._onClassifyingTimer.bind(this),this._onSubSegmentChanged=this._onSubSegmentChanged.bind(this),this._prevData={},this._rids=[],this._compMap={},this._addEvent("subSegmentChanged")};s.inherits(ft,ht),ft.prototype._prevData=null,ft.prototype._rids,ft.prototype._frozen=!1,ft.prototype._runningId=0,ft.prototype._compMap=null,ft.prototype._segments=null,ft.prototype._autoSegmentFilling=!1,ft.prototype._removedRows=null,ft.prototype._userSegmentComparer=null,ft.prototype._segmentSortOrder=0,ft.prototype._segmentSortContext=null,ft.prototype._clsSource=null,ft.prototype._classifyingTimer=0,ft.SortLogic,ft.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._classifyingTimer&&(clearTimeout(this._classifyingTimer),this._classifyingTimer=0),this._compMap=null,this._clsSource=null,ft._removeIndexArray(),this._segments&&(this._segments.dispose(),this._segments=null)},ft.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},ft.prototype.getRowId=function(t){return this._rids[t]||""},ft.prototype.getAllRowIds=function(t){return t?this._rids:this._rids.slice(0)},ft.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},ft.prototype.getRowCount=function(){return this._rids.length},ft.prototype.getDataAt=function(t,e){return this.getData(this._rids[t],e)},ft.prototype.getRowDataAt=function(t){return this.getRowData(this._rids[t])},ft.prototype.getPreviousData=function(t,e){var i=this._prevData[t]||null;return i?i[e]:null},ft.prototype.setData=function(t,e,i){if(!this._needFiring())return this._setData(t,e,i);var n={};return n[e]=i,this.setRowData(t,n)},ft.prototype._removeRidFromSegments=function(t){if(this._segments)if(this._segments.getSegment(t)){if(this._segments.removeSegment(t))return this._segments.getSegmentCount()||(this._segments.dispose(),this._segments=null),!0}else{var e=this._segments.getParentRowId(t);e&&this._segments.removeSegmentChild(e,t)}return!1},ft.prototype.setRowData=function(t,e,i){if(!t)return!1;var n=this.getRowData(t),o=!1,r="updated",s=!1;if(e){if(n){var a=this._prevData[t];for(var l in e)a[l]=n[l],n[l]=e[l]}else if(r="inserted",n=e,this._rows[t]=n,this._prevData[t]={},i){var u=i.nextRid,h=u?this.getRowIndex(u):-1;h<0&&(h=i.fallback),null==h||h<0||h>=this._rids.length?this._rids.push(t):(this._rids.splice(h,0,t),s=!this._isLastSegment(h))}else this._rids.push(t);o=!0}else n&&(r="removed",this._prevData[t]=this._rows[t],delete this._rows[t],s=this._removeRidFromSegments(t),ft._removeArrayItem(this._rids,t),o=!0);if(o&&this._needFiring()){if(this._autoFillSegments())this.dispatchGlobalChange();else{var p=i||{};p.rid=t,p.changes=e,p.rowData=n,p.type=r,s&&(p.segmentChanged=!0),this._dispatchDataChange(p)}this.requestClassifying()}return o},ft.prototype.setColumnData=function(t,e,i){var n=e?e.length:0;if(!(n<0)){var o=this._frozen;this.freeze();for(var r=this._generateRids(n,i),s=0;s<n;++s)this._setData(r[s],t,e[s]);this.freeze(o)}},ft.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)}},ft.prototype.setDataFrom2DArray=function(t,e,i){var n=t?t.length:0;if(!(n<0)){var o=this._frozen;this.freeze();for(var r=0,s=this._generateRids(n,i),a=0;a<n;++a){var l=t[a],u=s[a];if(e)for(r=l.length;--r>=0;)this._setData(u,e[r],l[r]);else for(r=l.length;--r>=0;)this._setData(u,""+r,l[r])}this.freeze(o)}},ft.prototype.setDataAt=function(t,e,i){var n=this.getRowId(t);return!!n&&this.setData(n,e,i)},ft.prototype.setRowDataAt=function(t,e,i){var n=this.getRowId(t);return!!n&&this.setRowData(n,e,i)},ft.prototype.addRow=function(t,e){return t||(t={}),e=this._generateUniqueRid(t,e),this.setRowData(e,t),e},ft.prototype.addRows=function(t,e){if(Array.isArray(t)){var i=t.length;if(i)if(1!==i){e||(e=[]);var n=this._frozen;this.freeze();for(var o=0;o<i;++o)this.addRow(t[o],e[o]);this.freeze(n)}else this.addRow(t[0],e?e[0]:null)}},ft.prototype.unshiftRow=function(t,e){return this.insertRow(0,t,e)},ft.prototype.insertRow=function(t,e,i){var n=null;return"number"==typeof t?((n={}).nextRid=this._rids[t],n.fallback=t):t&&((n={}).nextRid=t),e||(e={}),i=this._generateUniqueRid(e,i),this.setRowData(i,e,n),i},ft.prototype.insertAfter=function(t,e,i){var n="string"==typeof t?this.getRowIndex(t):t;return!(n>=0)||n>=this._rids.length-1?this.addRow(e,i):this.insertRow(n+1,e,i)},ft.prototype.removeRow=function(t){"number"==typeof t?this.setRowData(this.getRowId(t),null):this.setRowData(t,null)},ft.prototype.removeRows=function(t){if(1!==t.length){var e,i=!1;for(this._removedRows={},e=t.length;--e>=0;){"number"==typeof(n=t[e])&&(n=this.getRowId(n)),this.getRowData(n)&&(this._prevData[n]=this._rows[n],this._removedRows[n]=1,delete this._rows[n],this._removeRidFromSegments(n),i=!0)}i?(this._rids=this._rids.filter(this._removeRows),this._removedRows=null,this.dispatchGlobalChange()):this._removedRows=null}else{var n=t[0];"number"==typeof n?this.removeRow(n):this.setRowData(n,null)}},ft.prototype._removeRows=function(t){return!this._removedRows[t]},ft._removeArrayItem=function(t,e){var i=t.indexOf(e);return i>=0&&(i>=t.length?t.pop():t.splice(i,1),!0)},ft.prototype.clearAllData=function(t){ft.base(this,"clearAllData",!0),this._prevData={},this._segments&&(this._segments.dispose(),this._segments=null),this._rids.length&&(this._rids.length=0,this.dispatchGlobalChange(t))},ft.prototype.removeAllRows=ft.prototype.clearAllData,ft._ascendingOrder=function(t,e){return t-e},ft.prototype.moveRow=function(t,e,i){var n=null,o="";if(e>=0&&e<this._rids.length||(e=this._rids.length),Array.isArray(t)){var r=t;r.sort(ft._ascendingOrder);for(var s=[],a=r.length;--a>=0;){var l=r[a];(o=this._rids[l])&&(s.unshift(o),this._rids.splice(l,1),l<e&&--e)}s.length&&(this._rids.splice.apply(this._rids,[e,0].concat(s)),n=s)}else t<0&&(t=0),t!==e&&t+1!==e&&(o=this._rids.splice(t,1)[0])&&(t<e&&--e,this._rids.splice(e,0,o),n=o);return n&&(this._segments&&(this._segments.calcSegmentOrder(this._rids),this._sort(null)),this._dispatchPositionChange(i)),n},ft.prototype._moveRow=function(t,e,i){var n=t.length;if(!n)return null;for(var o=new Array(n),r=0;r<n;++r)o[r]=this.getRowIndex(t[r]);var s=e?this.getRowIndex(e):this._rids.length;return n>1?this.moveRow(o,s,i):this.moveRow(o[0],s,i)},ft.prototype.moveRows=function(t,e,i,n){"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 o=t+i-1,r=e;if(e>=t&&(r=e<=o?t:e-i),i>0&&o<=this._rids.length){r>this._rids.length&&(r=this._rids.length);var s=this._rids.splice(t,i),a=[r,0].concat(s);return Array.prototype.splice.apply(this._rids,a),this._segments&&this._sort(null),this._dispatchPositionChange(n),s}return null},ft.prototype.swapRow=function(t,e){var i=this._rids.length;if(!(t<0||t>=i||e<0||e>=i)){var n=this._rids[t];this._rids[t]=this._rids[e],this._rids[e]=n}},ft.prototype.clearRowData=ft.prototype.removeRow,ft.prototype.clearColumnData=function(t,e){for(var i="string"==typeof t?[t]:t,n=i.length;--n>=0;){var o=i[n];if(o)for(var r in this._rows)delete this._rows[r][o],delete this._prevData[r][o]}this.dispatchGlobalChange(e)},ft.prototype.getDataSource=function(){return null},ft.prototype.setDataSource=function(t){},ft.prototype.getSortingLogics=function(){return this._compMap},ft.prototype.sortOnce=function(t,e,i,n){var o=ft._buildSortContext([],t,e,i||this._compMap,n);return!!this._sort(o)&&(this._dispatchPositionChange(),!0)},ft.prototype.setSortingLogic=function(t){this._compMap._default=t},ft.prototype.setColumnSortingLogic=function(t,e){t&&(this._compMap[t]=e)},ft.prototype.getColumnSortingLogic=function(t){if(t){var e=this._compMap[t];if(e)return e}return this._compMap._default||null},ft.prototype.freeze=function(t){t=!1!==t;var e=this._frozen;return e!==t&&(this._frozen=t,this._autoFillSegments(),this.dispatchGlobalChange()),e},ft.prototype.unfreeze=function(t){return this.freeze(!1===t)},ft.prototype.isFrozen=function(){return this._frozen},ft.prototype.setSegmentSeparator=function(t,e){var i=!1,n=0;if(t&&"string"==typeof t)if(!1!==e){if(this._segments||(this._segments=new _t,this._segments.addEventListener("subSegmentChanged",this._onSubSegmentChanged)),this._autoSegmentFilling){var o=this._segments.getParentRowId(t);o&&this._segments.removeSegmentChild(o,t)}this._segments.addSegment(t)&&(this._segments.calcSegmentOrder(this._rids),i=!0)}else if(this._segments){var r=this._segments.getSegment(t);r&&(n=r.getChildCount(),this._segments.removeSegment(t)&&(i=!0,this._segments.getSegmentCount()||(this._segments=null)))}if(i&&this._needFiring())if(this._autoFillSegments()||n)this.dispatchGlobalChange();else{var s=this._rows[t]||null;s&&this._dispatchDataChange({rid:t,changes:{},rowData:s,type:"updated",segmentChanged:!0})}return i},ft.prototype.unsetAllSegmentSeparators=function(){return!!this._segments&&(this._segments.dispose(),this._segments=null,this.dispatchGlobalChange(),!0)},ft.prototype.hasSegmentation=function(){return!!this._segments},ft.prototype.isSegmentSeparator=function(t){return!!this._segments&&this._segments.containsSegment(t)},ft.prototype.getSegment=function(t){return this._segments?this._segments.getSegment(t):null},ft.prototype.getSegmentParent=function(t){return this._segments?this._segments.getSegmentParent(t):null},ft.prototype.getSegmentLevel=function(t){var e=this.getSegment(t);return e?e.getSegmentLevel()+1:0},ft.prototype.getSegmentParentRowId=function(t){return this._segments?this._segments.getParentRowId(t):""},ft.prototype.getSegmentValues=function(t,e){return this._segments?this._segments.getSegmentValues(t||this._rids,e):null},ft.prototype._isLastSegment=function(t){var e=this._segments;if(e)for(var i=this._rids,n=i.length,o=t+1;o<n;++o)if(e.containsSegment(i[o]))return!1;return!0},ft.prototype._getSegmentSeparators=function(){return this._segments},ft.prototype.enableAutoSegmentFilling=function(t){this._autoSegmentFilling=0!=t,this._autoFillSegments()},ft.prototype._autoFillSegments=function(){return!!this._autoSegmentFilling&&this.fillSegments()},ft.prototype.fillSegment=function(t){this._segments&&(this._segments.fillSegment(t,this._rids),this.dispatchGlobalChange(),this.requestClassifying())},ft.prototype.fillSegments=function(){if(this._segments){var t=this._segments.fillSegments(this._rids);return t&&(this.dispatchGlobalChange(),this.requestClassifying()),t}return!1},ft.prototype.addSegmentChild=function(t,e,i){if(this._segments&&this._segments.addSegmentChild(t,e,i))return this._sort(null),this._dispatchPositionChange(),this.requestClassifying(),!0;return!1},ft.prototype.addSegmentChildren=function(t,e,i){if(this._segments&&this._segments.addSegmentChildren(t,e,i))return this._sort(null),this._dispatchPositionChange(),this.requestClassifying(),!0;return!1},ft.prototype.removeSegmentChild=function(t,e){if(this._segments){var i=this._segments.removeSegmentChild(t,e);return i&&(this.dispatchGlobalChange(),this.requestClassifying()),i}return!1},ft.prototype.removeSegmentChildren=function(t,e){if(this._segments){var i=this._segments.removeSegmentChildren(t,e);return i&&(this.dispatchGlobalChange(),this.requestClassifying()),i}return!1},ft.prototype.removeAllSegmentChildren=function(){if(this._segments){var t=this._segments.removeAllSegmentChildren();return t&&this.dispatchGlobalChange(),t}return!1},ft.prototype.getSegmentIds=function(){return this._segments?this._segments.getSegmentIds():null},ft.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},ft.prototype.sortSeparators=function(t,e,i){var n=!1;if(!this._segments)return!1;if("function"==typeof t)return this.sortSegments(t);var o=ft._buildSortContext([],i,e,t),r=o?o.length:0;if(!r)return n;var s,a,l=0;return r>1?(s=ft._multiColumnSeparatorCompareLogic,a=o,l=1):(s=ft._singleColumnSeparatorCompareLogic,l=(a=o[0])[3]),this._segmentSortOrder=l,this._segmentSortContext=a,n=this.sortSegments(s),this._segmentSortOrder=0,this._segmentSortContext=null,n},ft.prototype.sortSegments=function(t){if(!this._segments)return!1;if("function"!=typeof t)return this._segments.calcSegmentOrder(this._rids),!1;var e,i=this._rids,n=this._segments,o=n.getSegmentCount(),r=[],s=[],a=0,l=i.length,u="",h=null;for(e=0;e<l&&(u=i[e],!((h=n.getSegment(u))&&(s.push(e),r.push(h),++a>=o)));++e);this._userSegmentComparer=t,r.sort(this._bySegmentSeparator),this._userSegmentComparer=null;var p=!1;for(e=0;e<a;++e){var d=s[e];u=i[d];var c=(h=r[e]).getId();u!==c&&(i[d]=c,p=!0)}return!!p&&(this._segments.calcSegmentOrder(i),this._sort(null),this._dispatchPositionChange(),!0)},ft.prototype._bySegmentSeparator=function(t,e){return this._userSegmentComparer(this.getRowData(t.getId()),this.getRowData(e.getId()),this._segmentSortOrder,this._segmentSortContext)},ft.prototype.setClassificationSource=function(t){this._clsSource=null,t&&t._rows&&(this._clsSource=t._rows)},ft.prototype.setSegmentClassification=function(t,e){if(this._segments&&this._segments.setSegmentClassification(t,e))return this.classifySegments();return!1},ft.prototype.classifySegments=function(){return!(!this._segments||!this._rids.length)&&this._segments.classify(this._clsSource||this._rows)},ft.prototype.requestClassifying=function(){this._segments&&!this._classifyingTimer&&this._segments.hasClassification()&&(this._classifyingTimer=setTimeout(this._onClassifyingTimer,10))},ft.prototype._onClassifyingTimer=function(){this._classifyingTimer=0,this.classifySegments()},ft.prototype._onSubSegmentChanged=function(t){var e,i=t.insertionList,n=t.removalList,o=!1,r=this._rows,s=this._clsSource||r,a=this._rids,l=this._prevData,u=n.length,h={};for(e=0;e<u;e++){var p=n[e];r[p]&&(h[p]=l[p]=r[p],delete r[p],ft._removeArrayItem(a,p),o=!0)}var d=i.length;for(e=0;e<d;e++){var c=i[e],_=c.getParentId(),f=c.getId();if(!r[f]){l[f]={},c.setRowData(r,s);var g=a.indexOf(_);g<0||g+1>=a.length?a.push(f):a.splice(g+1,0,f),o=!0}}o&&(t.removedRows=h,this._dispatch("subSegmentChanged",t),this.dispatchGlobalChange())},ft.prototype._sort=function(t){var e=this._rids,i=this.getMultipleRowData(e),n=this.getSegmentValues(e),o=ft._performMultiLevelSorting(i,t,n);return!!o&&(this._rids=ft._reorderItems(e,o),!0)},ft.prototype.dispatchGlobalChange=function(t){!t&&this._needFiring()&&this._dispatchDataChange(ft._globalChangeArg)},ft.prototype._dispatchPositionChange=function(t){!t&&this._needFiring()&&this._dispatch("dataChanged",ft._positionChangeArg)},ft.prototype.dump=function(t){return ht.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},ft.prototype._setData=function(t,e,i){var n=this.getRowData(t);return n||(n={},this._rows[t]=n,this._prevData[t]={},this._rids.push(t)),this._prevData[t][e]=n[e],n[e]=i,!0},ft.prototype._generateRids=function(t,e){var i,n=0;if(e)i=e;else{i=[];for(var o=this._rids.length;n<o&&n<t;)i.push(this._rids[n++])}for(n=i.length;n<t;)i.push(""+n++);return i},ft.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},ft.prototype._needFiring=function(){return!this._frozen&&!this._composing},ft.getSortingDefinitions=ot._deprecatedFunction,ft._globalChangeArg={globalChange:!0},ft._positionChangeArg={globalChange:!0,positionChangeOnly:!0},ft._buildSortContext=function(t,e,i,n,o){var r,s;Array.isArray(e)?(r=e,s=i):(r=[e],s=e?[i]:[0]);var a=null,l=null;"function"==typeof n?a=n:l=n;var u=r.length;t.length=u;for(var h=u;--h>=0;){Array.isArray(l)&&(a=l[h]);var p=t[h];p||(p=t[h]=new Array(5));var d=r[h];p[0]=d,p[1]=null,p[2]=a||l[d]||l._default,p[2]||(p[2]=ft._defaultComparer),p[3]=ft._getSortOrder(s[h]),p[4]=o}return t},ft._multiColumnCompareLogic=function(t,e,i,n){for(var o=n.length,r=0,s=0;s<o;++s){var a=n[s];if(r=ft._singleColumnCompareLogic(t,e,a[3],a))return r}return r},ft._singleColumnCompareLogic=function(t,e,i,n){var o=n[1];return n[2](o[t],o[e],i,n[4])},ft._multiColumnSeparatorCompareLogic=function(t,e,i,n){for(var o=n.length,r=0,s=0;s<o;++s){var a=n[s];if(r=ft._singleColumnSeparatorCompareLogic(t,e,a[3],a))return r}return r},ft._singleColumnSeparatorCompareLogic=function(t,e,i,n){var o=n[0];return n[2](t[o],e[o],i,n[4])},ft._performMultiLevelSorting=function(t,e,i){var n,o=t?t.length:0,r=e?e.length:0;if(!o)return null;for(var s=0;s<r;++s){var a,l=e[s],u=l[1];if((n=l[2]).rowSorting)if(u)for(u.length=o,a=0;a<o;++a)u[a]=t[a];else u=l[1]=t;else{u?u.length=o:u=l[1]=new Array(o);var h=l[0];for(a=0;a<o;++a)u[a]=t[a][h]}}if(i){var p=["ROW_SEGMENT",i,ft._segmentComparer,1,null];e?(e=e.slice()).unshift(p):e=[p],++r}if(!r)return null;var d,c=0;return r>1?(n=ft._multiColumnCompareLogic,d=e,c=1):(n=ft._singleColumnCompareLogic,c=(d=e[0])[3]),ft._mergeSort(o,c,n,d)},ft._mergeSort=function(t,e,i,n){for(var o,r,s,a,l,u=!1,h=1,p=ft._createIndexArray(t),d=p.slice();h<=t;){for(o=l=0;o<t;)if((l=(s=a=(r=l)+h)+h)>t&&(l=t),s<l){for(;;)if(i(p[r],p[s],e,n)<=0){if(d[o++]=p[r],++r>=a){for(;s<l;)d[o++]=p[s],++s;break}}else if(u=!0,d[o++]=p[s],++s>=l){for(;r<a;)d[o++]=p[r],++r;break}}else for(;o<t;)d[o]=p[o],++o;var c=p;p=d,d=c,h<<=1}return u?p:null},ft._reorderItems=function(t,e){if(e){for(var i=t.length;--i>=0;)e[i]=t[e[i]];return e}return t},ft._createIndexArray=function(t){var e=ft._idxAryMap[t];if(!e){ft._idxAryCount>50&&(ft._idxAryMap={},ft._idxAryCount=0),e=ft._idxAryMap[t]=new Array(t),ft._idxAryCount++;for(var i=0;i<t;++i)e[i]=i}return e.slice()},ft._removeIndexArray=function(){ft._idxAryMap={},ft._idxAryCount=0},ft._idxAryMap={},ft._idxAryCount=0,ft._segmentComparer=function(t,e){return t===e?0:t<e?-1:1},ft._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},ft._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},ft._proto=ft.prototype;var gt=ft;const yt="ROW_DEF",mt="CONTENT",vt="CHAIN",Ct="CONSTITUENT",St="GROUP_HEADER",wt="SUBGROUP_HEADER",bt="GROUP_MEMBER";let Rt=function(t){if(this._changes={},t&&t.segmentId)return this._dataId=this._rowId=t.segmentId,this._autoGenerated=!0,void(this._subSegment=!0);this._rowId="_"+Rt._runningId+++"_",this._dataId=this._rowId,t&&(t.asConstituent?this._initializeAsConstituent(t):this.initialize(t))};Rt._runningId=0,Rt._childDataField="CHILD_VALUES",Rt.prototype._userInput="",Rt.prototype._ric="",Rt.prototype._permId="",Rt.prototype._label=null,Rt.prototype._isChain=null,Rt.prototype._realTime=!0,Rt.prototype._rowId="",Rt.prototype._dataId="",Rt.prototype._userId=!1,Rt.prototype._dc=null,Rt.prototype._view=null,Rt.prototype._subId="",Rt.prototype._expanded=null,Rt.prototype._autoGenerated=!1,Rt.prototype._subSegment=!1,Rt.prototype._staticValues=null,Rt.prototype._changes,Rt.prototype._updateCount=0,Rt.prototype._children=null,Rt.prototype._parent=null,Rt.prototype._groupOrder=0,Rt.prototype._depthLevel=0,Rt.prototype._userModel=null,Rt.prototype._info=null,Rt.prototype.dispose=function(){if(!this.isDisposed()){if(this._children&&(this._children.forEach(Rt.dispose),this._children=null),this._staticValues=null,this._parent=null,this._depthLevel=0,this.unsubscribeForUpdates(),this._dc){let t=this.getRowData();t&&(t[yt]=null),this._dc=null}this._view&&(this._view=null),this._rowId=this._dataId="",this._userId=!1,this._userModel=null}},Rt.prototype.isDisposed=function(){return!this._rowId},Rt.prototype.initialize=function(t){if(!t)return;if(!this._autoGenerated){let e=t.rowId;e&&"string"==typeof e&&(this._rowId=this._dataId=e,this._userId=!0)}let e=Rt.extractRowOptions(t),i=t.permId;null!=i&&(this._permId=i),i=t.ric,null!=i&&(this._ric=i),i=t.label,void 0!==i&&(this._label=i),i=t.chainRic,null!=i&&(this._chainRic=i),i=e.asChain,null!==i&&(this._isChain=i),i=t.realTime,null!=i&&(this._realTime=i),i=t.collapsed;let n=e.collapsed;null==i&&n||(this._expanded=!n),i=t.keepModel,i&&(this._userModel=t),i=t.info,i&&(this._info=i);let o=this._ric||this._chainRic;(o||this._permId)&&this.setContent(o,e),i=t.values,void 0!==i&&this.setStaticRowData(i,t.fields)},Rt.prototype._initializeAsConstituent=function(t){this._autoGenerated=!0;let e=t.parent;if(this.setParent(e)&&(this._dataId=t.dataId,this._ric=t.ric,this._dc=e._dc,this._dc)){let t=this.getRowData();t&&(t[yt]=this)}let i=t.values;void 0!==i&&this.setStaticRowData(i,t.fields)},Rt.prototype.setContent=function(t,e){if(this._autoGenerated)return!1;t?"string"!=typeof t&&(t+=""):t="";let i=this._userInput!==t,n=e.permId;if(this._permId!==n&&(this._permId=n||"",i=!0),!i)return!1;if(this.unsubscribeForUpdates()||this._clearStaticData(),this.resetUpdates(),this._userInput=t,"'"===this._userInput.charAt(0))this._ric=this._chainRic="";else{let t=e.asChain,i=!e.collapsed,n=e.chainRic;!0===t?(this._ric=!1===i?this._userInput:this._userInput.replace("0#",""),this._expanded=i):this._ric=this._userInput,this._isChain=null!=t?t:null,this._chainRic=n||""}let o="";if(this._view){if(o=this._view.getSegmentParentRowId(this._rowId),this._isChain&&o){let t=It(this._view,this._rowId);this._view.removeSegmentChild(o,this._rowId),this._view.moveRow(this._rowId,t),o=""}this._view.setSegmentSeparator(this._rowId,!!this._isChain),this.isChainCollapsed()?this._expanded&&this.expandChain():this._expanded||this.collapseChain()}if(this._dataId=this._rowId+this.getSymbol(),o&&this._view.addSegmentChild(o,this._rowId,this._dataId),!this.subscribeForUpdates()&&this._dc){let t={};t[yt]=this,t.X_RIC_NAME=this.getDisplayText(),this.setRowData(t)}return!0},Rt.prototype.getRowId=function(){return this._rowId},Rt.prototype.getConfigObject=function(t){let e=t||{};this._userId&&(e.rowId=this._rowId);let i=this._ric;if(i&&(e.ric=i),this._ric||"'"!==this._userInput.charAt(0)||(e.ric=this._userInput),i=this._realTime,i||(e.realTime=!1),i=this._permId,i&&(e.permId=i),i=this._chainRic,i&&(e.chainRic=i),i=this._label,i&&(e.label=i),i=this._userModel,i&&(e.keepModel=e),i=this._isChain,null!=i&&(e.asChain=i),i=this._expanded,null!=i&&(e.collapsed=!i),i=this._view.isHiddenRow(this._rowId),i&&(e.hidden=i),i=this._info,i&&(e.info=this._info),i=this._getStaticRowData(),i&&(e.values=i),this.isChain()){let t=this.getChildren();if(t){let n=i?i[Rt._childDataField]:{};n||(n={});let o,r,s,a=!1,l=t.length;for(o=0;o<l;o++)r=t[o],s=r._getStaticRowData(),s&&(a=!0,n[r.getRic()]=s);a&&(e.values||(e.values={}),e.values[Rt._childDataField]=n)}}return e},Rt.prototype.getDataId=function(){return this._dataId},Rt.prototype.getType=function(){if(this._isChain)return vt;if(this._parent)return Ct;{let t=this._view;if(!t)return"";{let e=this.getRowId(),i=t.isSegmentSeparator(e),n=t.getSegmentLevel(e);if(i)return 1===n?St:wt;if(t.getSegmentParentRowId(e))return bt}}return mt},Rt.prototype.setDataSource=function(t){if(this._dc=t||null,!this._dc)return;let e=this.getRowData();e||(e={},e[yt]=this,e.X_RIC_NAME=this.getDisplayText(),this.setRowData(e)),this._staticValues&&this.setRowData(this._staticValues),this.subscribeForUpdates()},Rt.prototype.getDataSource=function(){return this._dc},Rt.prototype.getRowData=function(){return this._dc?this._dc.getRowData(this._dataId):{}},Rt.prototype.getData=function(t){return this._dc?this._dc.getData(this._dataId,t):null},Rt.prototype.setStaticRowData=function(t,e){this._clearStaticData(),Array.isArray(t)&&(t=y(t,e)),this._staticValues="object"==typeof t?t:null,this._staticValues&&this.setRowData(t)},Rt.prototype._getStaticRowData=function(){return this._staticValues?f(this._staticValues):null},Rt.prototype.updateRowData=function(t,e){Array.isArray(t)&&(t=y(t,e)),t&&this.setRowData(t)},Rt.prototype.setStaticData=function(t,e){this._staticValues||(this._staticValues={}),this._staticValues[t]=e,this.setData(t,e)},Rt.prototype.setRowData=function(t){this._dc&&this._dc.setRowData(this._dataId,t)},Rt.prototype.setData=function(t,e){this._dc&&this._dc.setData(this._dataId,t,e)},Rt.prototype._clearStaticData=function(){if(this._staticValues){for(let t in this._staticValues)this._staticValues[t]=null;this._dc&&this._dc.setRowData(this._dataId,this._staticValues),this._staticValues=null}},Rt.prototype.getUserInput=function(){return this._userInput},Rt.prototype.getRic=function(){return this._ric},Rt.prototype.getPermId=function(){return this._permId},Rt.prototype.getSymbol=function(){return this._ric||this._permId},Rt.prototype.getDisplayText=function(){return null!=this._label?this._label:this._ric?this._ric:this._permId?this._permId:this._userInput},Rt.prototype.getLabel=function(){return this._label},Rt.prototype.isRowHeader=function(){return"'"===this._userInput.charAt(0)},Rt.prototype.isChain=function(){return this._isChain},Rt.hasChain=function(t){return t.isChain()},Rt.prototype.isChainCollapsed=function(){return!!this._view&&this._view.isSegmentCollapsed(this._rowId)},Rt.prototype.isChainExpanded=function(){return!this.isChainCollapsed()},Rt.prototype.isFixedPosition=function(){return this._isChain&&this.isChainExpanded()},Rt.prototype.isAutoGenerated=function(){return this._autoGenerated},Rt.prototype.isRealTimeRow=function(){return!!this.getRic()&&(!!this._realTime&&(!this._autoGenerated&&!this.isRowHeader()))},Rt.prototype.subscribeForUpdates=function(){if(!this.isRealTimeRow()&&!this.getPermId())return!1;let t=this._dc?this._dc.getSubscriptions():null;if(!t)return!1;let e=this.unsubscribeForUpdates();if(this.isChain()){let e=this._chainRic;if(!e&&(e=this._ric,e.indexOf("0#")<0)){(e.match(/\./g)||[]).length<2&&(e="0#"+e)}this._subId=t.addChain(e,this._rowId)}else this._ric&&(this._subId=t.addRic(this._ric,this._rowId));return e?this._dc.setRowData(this._dataId,e):this._dc.setRowData(this._dataId,{X_RIC_NAME:this.getDisplayText(),ROW_DEF:this}),!0},Rt.prototype.unsubscribeForUpdates=function(){if(!this._subId)return;let t=this._dc.getSubscriptions(),e=this.getRowData();return t.removeSubscription(this._subId),this._subId="",this.resetUpdates(),this._dc.setRowData(this._dataId,null),this._clearStaticData(),e},Rt.prototype.isSubscribing=function(){return!!this._subId},Rt.prototype.addUpdate=function(t){if(t){let e=t.changes;if(e){let t=0;for(let i in e)this._changes[i]=t=1;if(t)return++this._updateCount,!0}}return!1},Rt.prototype.getUpdates=function(){return this._updateCount?this._changes:null},Rt.prototype.resetUpdates=function(){this._updateCount&&(this._changes={},this._updateCount=0)};let It=function(t,e){let i=t.getRowIndex(e);do{if((e=t.getRowId(++i))&&!t.getSegmentParentRowId(e))break}while(e);return e};Rt.prototype.registerToView=function(t,e){if(!t||this._view===t)return;this._view=t;let i=null;if(this._subSegment)return i=this._view.getRowData(this.getRowId()),void(i&&(i[yt]=this));i={},i[yt]=this;let n="";e&&(n=t.getSegmentParentRowId(e),n&&this._isChain&&(e=It(t,e)));let o=t.insertRow(e,i,this.getRowId());o!==this._rowId&&(this._rowId=o,this._userId=!1),this._isChain?(t.setSegmentSeparator(this._rowId),this._expanded||this.collapseChain()):n&&t.addSegmentChild(n,this._rowId,this._dataId)},Rt.prototype._deregisterFromView=function(t){return this._view?(t&&t.push(this._rowId),this._view=null,this._rowId):""},Rt.deregisterFromView=function(t,e){return e._deregisterFromView(t),t},Rt.prototype._getChildStaticRowData=function(t){if(!this._staticValues)return null;let e=this._staticValues[Rt._childDataField];return e&&e[t]||null},Rt.prototype.addConstituent=function(t){if(!t||this._ric===t)return null;if(!(this._rowId&&this._subId&&this._isChain))return null;let e=null;if(this._children){for(let i=this._children.length;--i>=0;)if(this._children[i]._ric===t){e=this._children[i];break}}else this._children=[];let i=!e;if(i){let i={asConstituent:!0,dataId:this._subId+t,ric:t,parent:this},n=this._getChildStaticRowData(t);n&&(i.values=n),e=new Rt(i)}if(this._view){let t=this.getRowId(),i=e.getData("CHILD_ORDER"),n=this._view.getRowIndex(t),o=n+this.getChildCount();null!=i&&(o=n+i+1),e.registerToView(this._view,this._view.getRowId(o)),this._view.addSegmentChild(t,e.getRowId(),e.getDataId())}return i?e:null},Rt.prototype._toRealTimeRow=function(){this._ric&&(this.isRowHeader()||(this._realTimeField=!0,this._dataId=this._rowId+this._ric,this._autoGenerated=!1,this._parent=null,this._depthLevel=0,this.subscribeForUpdates()))},Rt.prototype.unlinkChain=function(){if(!this._isChain)return;if(this.isChainExpanded()){let t=this.getDescendants(),e=t.length;for(let i=0;i<e;i++)t[i]._toRealTimeRow()}this.unsubscribeForUpdates();let t=this._view;if(t){let e=this.getRowId(),i=t.getSegment(e);i&&i.setClassification(null),t.setSegmentSeparator(e,!1)}this._isChain=this._expanded=!1,this._chainRic="",this._userInput=this._ric,this._children=null,this.subscribeForUpdates()},Rt.prototype.collapseChain=function(){return!(!this._isChain||!this._view)&&(this._expanded=!1,this._view.collapseSegment(this._rowId,!0))},Rt.prototype.expandChain=function(){return!(!this._isChain||!this._view)&&(this._expanded=!0,this._view.collapseSegment(this._rowId,!1))},Rt.prototype.toggleChain=function(){return this._expanded?this.collapseChain():this.expandChain()},Rt.prototype.addChild=function(t){return!!t&&t.setParent(this)},Rt.prototype.getChildren=function(){return this._children},Rt.prototype.getDescendants=function(t){if(t||(t=[]),this._children){let e=this._children,i=e.length;for(let n=0;n<i;++n){let i=e[n];t.push(i),i.getDescendants(t)}}return t},Rt.prototype.getAllDescendantIds=function(){let t=this.getDescendants();return t.length?t.map(Rt.toRowId):null},Rt.prototype.getChildCount=function(){return this._children?this._children.length:0},Rt.prototype.getParent=function(){return this._parent},Rt.prototype.setParent=function(t){if(this._parent===t||t===this)return!1;if(this._parent){let t=this._parent._children.lastIndexOf(this);t>=0&&this._parent._children.splice(t,1),this._parent=null,this._depthLevel=0}return!!t&&(t._children||(t._children=[]),t._children.push(this),this._parent=t,this._depthLevel=t._depthLevel+1,!0)},Rt.prototype.getDepthLevel=function(){return this._depthLevel},Rt.prototype.getGroupOrder=function(){return this._parent?this._parent.getGroupOrder()+.1:this._groupOrder},Rt.prototype.setGroupOrder=function(t){return!this._parent&&this._groupOrder!==t&&(this._groupOrder=t,!0)},Rt.prototype.getUserModel=function(){return this._userModel},Rt.prototype.setRowInfo=function(t){this._info=t},Rt.prototype.getRowInfo=function(){return this._info},Rt.toRowId=function(t){return t.getRowId()},Rt.extractRowOptions=function(t){let e=t.ric,i=t.permId,n=t.chainRic,o=t.collapsed,r=t.asChain;null==r&&n&&(r=!0);let s=null;e&&e.indexOf("0#")>=0&&(null==r&&(r=!0),s=!0);let a={};return a.collapsed=null==o?!s:o,a.ric=e,a.permId=i||"",a.chainRic=n,a.asChain=r,a},Rt.dispose=function(t){t.dispose()};const Dt="/synapse/service/suggestions/suggest/?hits=1&profile="+encodeURIComponent("Field Selector");let xt={};function At(t){t.currentTarget._error={type:t.type}}function Lt(t){let e=t.currentTarget,i=e._defer,n=e._field;if(delete xt._loadingField[n],200===e.status){let t=JSON.parse(e.responseText),o=null,r=t.result&&t.result[0];if(r){let t=r.hits&&r.hits[0];if(t&&t.p){let e=t.p;e.fn.toUpperCase()===n.toUpperCase()&&(o=xt.get(n)||{},o.field=e.fn,o.name=e.fl,o.rank=e.Rank,o.fieldDataType=e.fdt,o.id=e.fid,o.IsMonitorOnlyField=e.fimo,o.IsRealtimePortfolioField=e.firp,o.IsRealtimeField=e.firt,o.source=e.fsrc,o.sourceRank=e.fsrnk,o.description=t.title,xt.set(n,o))}}o?i.resolve(o):i.reject("No definition for "+n)}else e._error?(e._error.field=n,i.reject(e._error)):i.reject({field:n,status:e.status,statusText:e.statusText,request:e})}xt._defs={CF_NAME:{name:"Name",rank:2800003,fieldDataType:"ALPHANUMERIC",id:"6307",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100003,description:"The name of the instrument"},CF_LAST:{name:"Last",rank:2800024,fieldDataType:"PRICE",id:"5364",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100024,description:"The latest trade price or value."},PCTCHNG:{name:"Pct. Chng",rank:2709440,fieldDataType:"PRICE",id:"56",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:9440,description:"Percentage change in the latest trade price or value from the historic close."},CF_NETCHNG:{name:"Net. Chng",rank:2800027,fieldDataType:"PRICE",id:"5367",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100027,description:"Net Change is the difference between latest trade price or value and the historic closing value or settlement price."},CF_CLOSE:{name:"Close",rank:2800023,fieldDataType:"PRICE",id:"5360",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100023,description:"The last trade price, settlement value or closing value."},CF_CURR:{name:"Currency",rank:2800021,fieldDataType:"ENUMERATED",id:"6452",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100021,description:"The currency that the instrument is quoted in"},CF_BID:{name:"Bid",rank:2800025,fieldDataType:"PRICE",id:"5359",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100025,description:"The latest Bid price."},CF_ASK:{name:"Ask",rank:2800026,fieldDataType:"PRICE",id:"5358",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100026,description:"The latest Ask price."}},xt._timeSeriesChildren={},xt._synapse="",xt._lang="en",xt._timeSeriesExpansion=!0,xt._loadingField={},xt.set=function(t,e){if(xt._defs[t])for(let i in e)xt._defs[t][i]=e[i];else xt._defs[t]=e},xt.get=function(t){return xt._defs[t]||null},xt.getFieldInfo=xt.get,xt.hasFieldInfo=function(t){let e=xt.get(t);return!(!e||!e.field)},xt.getTimeSeriesChildren=function(t){return xt._timeSeriesChildren[t]},xt.addTimeSeriesChild=function(t,e){xt._timeSeriesChildren[t]||(xt._timeSeriesChildren[t]=[]),xt._timeSeriesChildren[t].push(e)},xt.remove=function(t){delete xt._defs[t]},xt.setSynapseConfig=function(t){xt._synapse=t},xt.disableTimeSeriesExpansion=function(t){xt._timeSeriesExpansion=0==t},xt.isFormula=function(t){return"="===t.charAt(0)},xt.isAdc=function(t){return 0===t.indexOf("TR.")},xt.isRealTimeField=function(t){return!!t&&(!xt.isAdc(t)&&(!xt.isFormula(t)&&(!xt.isTimeSeriesChild(t)&&(!xt.isTimeSeries(t)&&!1!==xt.getFieldProperty(t,"IsRealtimeField")))))},xt.isTimeSeriesChild=function(t){return!!xt.getFieldProperty(t,"timeSeriesParent")},xt.isTimeSeries=function(t){if(!t)return!1;if(!xt._timeSeriesExpansion)return!1;let e=xt.getFieldProperty(t,"timeSeries");if(null!=e)return e;return/^TR\.[\w]+\([\w\-\=\,]*(?:EDATE|SDATE)\=+[\w\-\=\,]*[ \w]*\)$/i.test(t)},xt.setFieldProperty=function(t,e,i){xt._defs[t]||(xt._defs[t]={}),xt._defs[t][e]=i},xt.getFieldProperty=function(t,e){let i=xt._defs[t];return i?i[e]:null},xt.loadFieldInfo=function(t){if(xt._loadingField[t])return xt._loadingField[t].promise;let e=new I,i=xt._synapse;if(i)if(xt.hasFieldInfo(t))e.resolve(xt.get(t));else if(i.debug){let i=this._mockOnLoadEndData(t,e);setTimeout(Lt.bind(null,i),1e3)}else if(i.apiKey&&i.contextApp){let n=Dt+"&api-key="+encodeURIComponent(i.apiKey)+"&contextApp="+encodeURIComponent(i.contextApp)+"&language="+encodeURIComponent(xt._lang)+"&query="+encodeURIComponent(t);i.auth&&(n+="&auth="+encodeURIComponent(i.auth));let o=new XMLHttpRequest;o._defer=e,o._field=t,xt._loadingField[t]=e,o.addEventListener("loadend",Lt),o.addEventListener("timeout",At),o.addEventListener("error",At),o.open("GET",n,!0),o.send()}else e.resolve(null);else e.resolve(null);return e.promise},xt._mockOnLoadEndData=function(t,e){let i,n=t.toUpperCase(),o=n.toLowerCase();i=2===o.indexOf("_")?n[3]+o.substring(4):n[0]+o.substring(1);let r=n.indexOf("DATE")>=0?"DATE":"PRICE",s={action:'"'+n+'" SRCH',assetClassifierExplanation:"AssetClassifier is disabled.",assetClassifierStatus:"NOT_INVOKED",result:[{name:"Fields",default:!1,size:1,hits:[{cmd:i,explanation:null,fr:!1,id:"1635614732",navigation:null,p:{Rank:2800024,fdt:r,fid:"5364",fimo:!1,firp:!1,firt:!0,fl:i,fn:n,fsrc:"IDN",fsrnk:100024},position:0,preview:!1,relations:{},score:2840024,source:"87",subtitle:"",symbol:i,title:"title mockup of "+n,vc:"FLD"}],hasMore:!1}],search:"cpurl://apps.cp./apps/SearchAll?Search.Value="+o+"*"};return s=JSON.stringify(s),{currentTarget:{_defer:e,_field:t,status:200,response:s,responseText:s}}},function(){for(let t in xt._defs)xt._defs[t].field=t}();var Tt=xt;let Et={_formulas:{},set:function(t,e){Et._formulas[t]=e},get:function(t){return Et._formulas[t]||""},remove:function(t){delete Et._formulas[t]}};var Mt=Et;const Ft={STRING:"string",BOOLEAN:"boolean",NUMBER:"number",DATE:"datetime",DATETIME:"datetime",TIME:"datetime",ENUMERATED:"string",ALPHANUMERIC:"string",PERCENT:"string",PRICE:"number",DOUBLE:"number",MONEY:"number",INTEGER:"number",FLOAT:"number",SCORE:"number"};let Pt=function(t,e){this._defaultRenderer=this._defaultRenderer.bind(this),this._customRenderer=this._customRenderer.bind(this),this._internalRenderer=this._defaultRenderer,this._internalSorter=this._defaultSorter,this._eventArg={colDef:this},e&&(this._updateContext("grid",e),this._updateContext("core",e.getCoreGrid())),this._classes=[],this._requiredFields=[],this._children=[],t&&(t.parent?this._initializeTimeSeriesChild(t):this.initialize(t))};Pt.prototype._field="",Pt.prototype._dataType="",Pt.prototype._name="",Pt.prototype._defaultName=!0,Pt.prototype._defaultField=!0,Pt.prototype._tooltip=null,Pt.prototype._requiredFields,Pt.prototype._headerRenderer=null,Pt.prototype._headerAlignment="",Pt.prototype._internalRenderer,Pt.prototype._userRenderers=null,Pt.prototype._activatedRenderer=null,Pt.prototype._rendererMap=null,Pt.prototype._userSorter=null,Pt.prototype._sortable=!0,Pt.prototype._eventArg,Pt.prototype._autoGenerated=!1,Pt.prototype._classes,Pt.prototype._fnEngine=null,Pt.prototype._formula=null,Pt.prototype._formulaRef="",Pt.prototype._initialOrder="",Pt.prototype._rowSorting=null,Pt.prototype._textSelect=!1,Pt.prototype._userModel=null,Pt.prototype._parent=null,Pt.prototype._children=null,Pt.prototype._info=null,Pt.prototype._coreColDef=null,Pt.prototype.dispose=function(){this._eventArg={},this._coreColDef=null,this._activatedRenderer=this._rendererMap=null,this.setRenderer(null),this.setSorter(null),this._userModel=null,this._parent=null,this._children=null},Pt.prototype._initializeTimeSeriesChild=function(t){this._autoGenerated=!0;let e=t.parent;this._setParent(e),this.initialize(t)},Pt.prototype.initialize=function(t){if(!t)return;let e,i,n,o,r=t.field,s=Tt.get(r);if(s&&s!==t){let e=t;for(n in t={},s)t[n]=s[n];for(n in e)t[n]=e[n]}if(o=t.formulaEngine,o&&o.addFormula&&(this._fnEngine=o),o=t.formulaReference,o&&(this._formulaRef=o+""),o=t.require||t.requiredFields,null!=o&&("string"==typeof o?this._requiredFields=o.split(" "):Array.isArray(o)&&(this._requiredFields=o.slice())),this._setField(r,t),o=t.name||t.title,null!=o&&(this._name=o,this._defaultName=!1),o=t.dataType,null!=o&&(this._dataType=o),o=t.notRealTimeField,null!=o&&Tt.setFieldProperty(r,"IsRealtimeField",!o),o=t.tooltip,null!=o&&(this._tooltip=o),o=t.headerAlignment||t.titleAlignment,null!=o&&(this._headerAlignment=function(t){if(t){let e=t.charAt(0).toLowerCase();if("l"===e)return"left";if("r"===e)return"right";if("c"===e)return"center"}return""}(o)),o=t.headerBinding||t.headerRenderer,void 0!==o&&(this._headerRenderer=o),o=t.binding||t.renderer,o||(o=t.formatter),void 0!==o)if(o instanceof Array)for(i=o.length,e=0;e<i;++e)this.addRenderer(o[e]);else o?"function"==typeof o?this.setRenderer(o):o.binding&&this.setRenderer(o.binding):this.setRenderer(null);o=t.rowSorting,null!=o&&(this._rowSorting=!!o),o=t.sortLogic||t.sortingLogic||t.sorter,void 0!==o&&this.setSorter(o),o=t.sortable,null!=o&&(this._sortable=!!o),o=t.className||t.class,"string"==typeof o&&(this._classes=o.split(" ")),o=t.sortOrder||t.sort,o&&(this._initialOrder=o),o=t.textSelect,o&&(this._textSelect=o),o=t.info,o&&(this._info=o),this._userModel=t},Pt.prototype.getId=function(){return this._coreColDef&&this._coreColDef.id||""},Pt.prototype.getRequireFields=function(){return this._requiredFields},Pt.prototype.getRequiredFields=Pt.prototype.getRequireFields,Pt.prototype.getRenderer=function(){return this._internalRenderer},Pt.prototype.getHeaderRenderer=function(){return this._headerRenderer},Pt.prototype.getName=function(){return this._defaultName?this._defaultField?"Column "+this.getId():this.getField():this._name},Pt.prototype.isDefaultName=function(){return this._defaultName},Pt.prototype.getFieldDefinition=function(){return Tt.get(this.getField())},Pt.prototype.getFieldDataType=function(){let t=this.getFieldDefinition();return t&&t.fieldDataType?t.fieldDataType:""},Pt.prototype.getDataType=function(){if(this._dataType)return this._dataType;let t=this.getFieldDataType();return t?Ft[t.toUpperCase()]:""},Pt.prototype.setDataType=function(t){let e=Ft[t.toUpperCase()];e&&(t=e),this._dataType=t},Pt.getDataType=function(t){let e=Tt.get(t);if(e){let t=e.fieldDataType?e.fieldDataType.toUpperCase():null;return Ft[t]?Ft[t]:""}return""},Pt.prototype.getTooltip=function(){if(null!=this._tooltip){if("string"==typeof this._tooltip)return this._tooltip;if(!this._tooltip)return""}let t=this.getName();if(t)return t;let e=this.getField();return e||""},Pt.prototype.getField=function(){return this._coreColDef&&this._coreColDef.field||""},Pt.prototype.getAllFields=function(){let t=this.getField();return t?this._requiredFields.concat(t):this._requiredFields.slice()},Pt.prototype.isRealTimeField=function(){return Tt.isRealTimeField(this.getField()||this._field)},Pt.prototype.isTimeSeries=function(){return Tt.isTimeSeries(this.getField())},Pt.prototype.isTimeSeriesChild=function(){return Tt.isTimeSeriesChild(this.getField())},Pt.prototype.isFormulaField=function(){return!!this._formula},Pt.isFormulaField=function(t){return Tt.isFormula(t)},Pt.isAdcField=function(t){return Tt.isAdc(t)},Pt.isRealTimeField=function(t){return Tt.isRealTimeField(t)},Pt.getRealTimeFields=function(t,e){e.isRealTimeField()&&t.push(e.getField());let i=e.getRequiredFields(),n=i.length;for(let e=0;e<n;++e){let n=i[e];Pt.isRealTimeField(n)&&t.push(n)}return t},Pt.prototype.isSortable=function(){return this._sortable},Pt.prototype.isScalable=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnScalability(e)},Pt.prototype.getInitialSortOrder=function(){return this._initialOrder},Pt.prototype.getWidth=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnWidth(e)},Pt.prototype.getMinWidth=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getMinimumColumnWidth(e)},Pt.prototype.getTextAlign=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnAlignment(e)},Pt.prototype.isFieldEmpty=function(){return!this.getField()},Pt.prototype.getHeaderAlignment=function(){return this._headerAlignment||""},Pt.prototype.getClasses=function(){return this._classes},Pt.prototype.getConfigObject=function(t){let e=t||{};if(this._info&&(e.info=this._info),null==e.field&&!this._defaultField){let t=this.getField();t&&(e.field=t)}let i=this.getDataType();i&&(e.dataType=i),this._formulaRef&&(e.formulaReference=this._formulaRef),this._requiredFields&&this._requiredFields.length&&(e.require=this._requiredFields),this._defaultName||(e.name=this.getName()),i=!1===Tt.getFieldProperty(this.getField(),"IsRealtimeField"),i&&(e.notRealTimeField=i),null!=this._tooltip&&(e.tooltip=this._tooltip),null!=this._rowSorting&&(e.rowSorting=this._rowSorting),this._sortable||(e.sortable=!1);let n=this._classes;n&&n.length>0&&(e.className=n.join(" ")),this._textSelect&&(e.textSelect=this._textSelect),this._headerAlignment&&(e.headerAlignment=this._headerAlignment),this._autoGenerated&&(e.autoGenerated=this._autoGenerated);let o=this._eventArg.core,r=this._eventArg.grid.getColumnIndex(this),s=o.getColumnScalability(r),a=o.getColumnCustomLaneSize(r);return!0===s&&1===a||(e.scalable=s,e.width=a),i=o.getMinimumColumnWidth(r),i>0&&(e.minWidth=i),null==e.hidden&&(o.getColumnVisibility(r,0)||(e.hidden=!0)),i=o.getColumnAlignment(r),"default"!==i&&(e.textAlign=i),e},Pt.prototype.isHidden=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return!t.isColumnVisible(e)},Pt.prototype.isTextSelect=function(){return this._textSelect},Pt.prototype.hide=function(t){let e=this._eventArg.core,i=this._eventArg.grid.getColumnIndex(this);e.hideColumn(i,!1!==t)},Pt.prototype.setHeaderRenderer=function(t){this._headerRenderer=t},Pt.prototype.setRenderer=function(t){"function"==typeof t?(this._internalRenderer=this._customRenderer,this._activatedRenderer!==t&&(this._userRenderers?this._userRenderers.length=0:this._userRenderers=[],this._userRenderers.push(t))):(this._internalRenderer=this._defaultRenderer,this._userRenderers=null)},Pt.prototype.getParent=function(){return this._parent},Pt.prototype._setParent=function(t){return this._parent===t||t===this||t&&(this._parent=t,this._parent._addChild(this)),!1},Pt.prototype.getChildren=function(){return this._children},Pt.prototype._addChild=function(t){this===t||this._children.indexOf(t)>-1||this._children.push(t)},Pt.prototype.addRenderer=function(t){t&&(this._userRenderers?this._userRenderers.push(t):this.setRenderer(t))},Pt.prototype.activateRenderer=function(t,e){let i=null;if(null!=t){let n=this._rendererMap;n||(n=this._rendererMap={}),"function"==typeof e?i=n[t]=e:null==e?i=n[t]:e||(i=n[t]=null)}return this._activatedRenderer=i||null,i||(i=this._userRenderers?this._userRenderers[0]:null),this.setRenderer(i),!!this._activatedRenderer},Pt.prototype.getSorter=function(){return this._userSorter},Pt.prototype.setSorter=function(t){this._userSorter="function"==typeof t?t:null},Pt.prototype.isRowSorting=function(){return null==this._rowSorting?!Tt.getFieldProperty(this.getField(),"IsRealtimeField"):!!this._rowSorting},Pt.prototype.isAutoGenerated=function(){return this._autoGenerated},Pt.prototype.setName=function(t){this._name=t,this._defaultName=!1},Pt.prototype._setField=function(t,e){this._defaultField=null==t,t||(t=""),t=t.trim();let i=e?e.formula:"";if(this._fnEngine){let e=t.toUpperCase(),n=i||Mt.get(e);(n||Pt.isFormulaField(t))&&(t=d.toUpperCase(t),this._formula=this._fnEngine.addFormula(n||t),n&&(this._formula.setAlias(t),this._fnEngine.addReference(this._formula,t)),this._retrieveNestedFields(this._formula.getFieldNames())),this._formulaRef&&(this._formulaRef=this._fnEngine.addReference(this._formula||t,this._formulaRef))}this._field=t,Tt.setFieldProperty(t,"timeSeries",!!Tt.isTimeSeries(t));let n=e.parent;e&&n&&Tt.setFieldProperty(t,"timeSeriesParent",n.getField()),this._updateContext("field",t),this.isRealTimeField()&&this._updateContext("formattedField",t+"_FORMATTED")},Pt.prototype._retrieveNestedFields=function(t){if(t)for(let e=t.length;--e>=0;){let i=t[e],n=i.toUpperCase(),o=Mt.get(n);if(o){let t=this._fnEngine.getFormula(i);t?t.addFormulaCount():(t=this._fnEngine.addFormula(o),t.setAlias(i),this._fnEngine.addReference(t,i)),this._retrieveNestedFields(t.getFieldNames())}else this._requiredFields.push(i)}},Pt.prototype._defaultRenderer=function(t){let e=t.dataValue;t.cell.setContent(e?e.getData(this._field):null)},Pt.prototype._customRenderer=function(t){let e=t.dataValue,i=this._eventArg;if(e){let n=e.getRowData();i.rowDef=e,i.rowData=n,i.rowIndex=t.rowIndex,i.data=n?n[this._field]:null}else i.data=null;if(i.colIndex=t.colIndex,i.cell=t.cell,i.section=t.section,this._activatedRenderer)this._activatedRenderer(i);else{let t=this._userRenderers,e=t.length;for(let n=0;n<e;++n)t[n](i)}},Pt.prototype._updateContext=function(t,e){this._eventArg[t]=e},Pt.prototype.getUserModel=function(){return this._userModel},Pt.prototype.clearUserModel=function(){this._userModel=null},Pt.prototype.setColumnInfo=function(t){this._info=t},Pt.prototype.getColumnInfo=function(){return this._info},Pt.prototype._setCoreColumnDef=function(t){this._coreColDef=t||null};var zt=Pt;let Vt=function(){this._onRequest=this._onRequest.bind(this),this._rics={},this._fields={},this._adcOptions={productId:"001"}};r.inherits(Vt,a),Vt.prototype._timerId=0,Vt.prototype._rics,Vt.prototype._fields,Vt.prototype._rtk,Vt.prototype._adcOptions=null,Vt.prototype.setRTK=function(t){this._rtk=t},Vt._mockAdc=null,Vt.setMockAdc=function(t,e){Vt._mockAdc||(Vt._mockAdc={}),Vt._mockAdc[t]=e},Vt.getMockAdc=function(t){return Vt._mockAdc?Vt._mockAdc[t]:null},Vt.clearMockAdc=function(){Vt._mockAdc=null},Vt.prototype.setADCOptions=function(t){let e=t.productId;e&&(this._adcOptions.productId=e)},Vt.prototype.addRic=function(t){t&&!this._rics[t]&&(this._rics[t]=1,this._request())},Vt.prototype.addRics=function(t){let e=t?t.length:0,i=!1;for(let n=0;n<e;++n){let e=t[n];e&&!this._rics[e]&&(this._rics[e]=1,i=!0)}return!!i&&(this._request(),!0)},Vt.prototype.addField=function(t){this._addField(t)&&this._request()},Vt.prototype.addFields=function(t){let e=t.length,i=0;for(let n=0;n<e;++n)i|=this._addField(t[n]);return!!i&&(this._request(),!0)},Vt.prototype._addField=function(t){return Vt.isValidField(t)&&!this._fields[t]?(this._fields[t]=1,1):0},Vt.isValidField=function(t){return!(!t||0!==t.indexOf("TR."))},Vt.prototype._request=function(){this._timerId||(this._timerId=setTimeout(this._onRequest,0))},Vt.prototype._onRequest=function(){this._timerId=0;let t=window.JET;if(this._rtk){if(!this._rtk.Data)return}else if(!t||!t.ContainerDescription||"function"!=typeof t.Data)return;let e,i=Object.keys(this._rics),n=[],o=[];for(let t in this._fields)xt.isTimeSeries(t)?o.push(t):n.push(t);let r,s,a=n.length,l=o.length;if((a||l)&&i.length)if(this._rics={},this._fields={},this._rtk){let t;if(o.length>0){let t=o.join(",");s={method:"select",formula:t,identifiers:i,productId:this._adcOptions.productId,output:"Col,date|,Row,In|,va,T,NoEmptyTickers"},r=this._onRTKTimeSeriesSuccess.bind(this,o);let e=Vt.getMockAdc(s.formula);e?setTimeout((function(){r(e)}),10):this._rtk.Data.Adc.request(s).then(r).catch((function(t){console.log(t)}))}n.length>0&&(t=n.join(","),s={method:"select",formula:t,identifiers:i,productId:this._adcOptions.productId,output:"Col,In,va,T,NoEmptyTickers"},r=this._onRTKSuccess.bind(this,n),this._rtk.Data.Adc.request(s).then(r).catch((function(t){console.log(t)})))}else{let o=[];for(e=0;e<a;e++)o.push({name:n[e]});s={instruments:i,fields:o},r=this._onJETSuccess.bind(this,n),t.Data("datagrid").then((function(t){return t.request(s)})).then(JSON.parse).then(r).catch((function(t){console.log(t)}))}},Vt.prototype._onJETSuccess=function(t,e){this._dispatch("adcDataReceived",e);let i,n,o,r=e.data,s=e.headers&&e.headers[0];if(!Array.isArray(r)||!Array.isArray(s))return;let a=1,l=t.length,u=s.length,h=new Array(u);for(i=0;i<l&&a<u;i++)n=t[i],s[a].field===n.toUpperCase()&&(h[a]=n,a++);let p=r.length,d=h.length,c={};for(i=0;i<p;i++){let t=r[i];if(o=t[0],c[o])continue;let e=c[o]={};for(a=1;a<d;a++){let i=t[a];null!=i&&""!==i&&(n=h[a],e[n]=i)}}let _={};for(o in c){let t=c[o];g(t)||(_[o]=t)}this._dispatch("dataChanged",{data:_})},Vt.prototype._onRTKSuccess=function(t,e){this._dispatch("adcDataReceived",e);let i,n,o,r=e.rows,s=e.rows&&e.rows[0];if(!Array.isArray(r)||!Array.isArray(s))return;let a=1,l=t.length,u=s.length,h=new Array(u);for(i=0;i<l&&a<u;i++)n=t[i],s[a].r.toUpperCase()===n.toUpperCase()&&(h[a]=n,a++);let p=r.length,d=h.length,c={};for(i=1;i<p;i++){let t=r[i];if(o=t[0],c[o])continue;let e=c[o]={};for(a=1;a<d;a++){let i=t[a];null!=i&&""!==i&&"object"!=typeof i&&(n=h[a],e[n]=i)}}let _={};for(o in c){let t=c[o];g(t)||(_[o]=t)}this._dispatch("dataChanged",{data:_})},Vt.prototype._onRTKTimeSeriesSuccess=function(t,e){this._dispatch("adcDataReceived",e);let i=e.rows,n=e.rows&&e.rows[0];if(!Array.isArray(i)||!Array.isArray(n))return;let o=n.slice(2).map(t=>t.v),r={},s=0,a=i.length;for(let e=1;e<a;e++){let n=i[e][1];r[n]||(r[n]=t[s++])}let l={},u={};for(let t=1;t<a;t++){let e=i[t],n=e[0],s=e[1];l[n]||(l[n]={});let a=l[n];if(1===o.length)a[r[s]]=e[2];else for(let t=0;t<o.length;t++){let i=r[s].replace("TR.","")+"_"+o[t],n=e[2+t];null!==n&&(u[i]=r[s],a[i]=n)}}let h={};for(let t in l){let e=l[t];g(e)||(h[t]=e)}let p={data:h};o.length>1&&(p.timeSeries=!0,p.childrenFieldToParent=u),this._dispatch("dataChanged",p)};var kt=Vt,Ot=function(){this._groupMap={},this._childToParent={}};Ot.prototype._groupMap,Ot.prototype._childToParent,Ot.getGroupId=function(t){return t&&t.id||""},Ot.calcTreeDepth=function(t,e){for(var i=-1,n=e;n;){if(++i>15){console.log("WARNING: Infinite loop detected during column group creation");break}n=t[n.parentId]}return i},Ot.getLeafDescendants=function(t,e){var i=t[e];if(!i)return null;for(var n=[],o=[i],r=0,s={};r<o.length;){s[(i=o[r++]).id]=!0;for(var a=i.children,l=a?a.length:0,u=0;u<l;++u){var h=a[u];(i=t[h])?s[i.id]||o.push(i):n.push(h)}}return n},Ot._cloneObject=function(t){var e=f(t);return Array.isArray(e.children)?e.children=e.children.slice():e.children=[],e},Ot._toGroupDefinition=function(t,e){var i=null;return t&&(i=Array.isArray(t)?{children:t.slice()}:Ot._cloneObject(t),e&&(i.id||(i.name=e),i.id=e)),i},Ot.prototype.toString=function(){var t=this._groupMap,e=[];for(var i in e.push("=== groupDefs ==="),t){var n=t[i];e.push(i+": "+JSON.stringify(n,["id","parentId","children"]))}return e.push("=== childToParent ==="),e.push(JSON.stringify(this._childToParent,null,2)),e.push(""),e.join("\n")},Ot.prototype.getGroup=function(t){return t&&this._groupMap[t]||null},Ot.prototype.getDefinition=Ot.prototype.getGroup,Ot.prototype.getGroups=function(){var t=[],e=this._groupMap;for(var i in e)t.push(e[i]);return t},Ot.prototype.getGroupIds=function(){return Object.keys(this._groupMap)},Ot.prototype.getGroupMap=function(){return this._groupMap},Ot.prototype.cloneGroupMap=function(){var t=this._groupMap,e={};for(var i in t){var n=t[i],o=Ot._cloneObject(n);e[i]=o}return e},Ot.prototype.rebuildMap=function(){var t,e,i=this._groupMap,n=this._childToParent={},o=Object.keys(i),r=o.length;for(t=0;t<r;++t)for(var s=i[e=o[t]].children,a=s?s.length:0,l=0;l<a;l++)n[s[l]]=e;for(t=0;t<r;++t){var u=n[e=o[t]];u&&(i[e].parentId=u)}},Ot.prototype.getGroupChildren=function(t){var e=this._groupMap[t];return e?e.children:null},Ot.prototype.getLeafDescendants=function(t){return Ot.getLeafDescendants(this._groupMap,t)},Ot.prototype.getGroupLevel=function(t){return Ot.calcTreeDepth(this._groupMap,this._groupMap[t])},Ot.prototype.getRootGroup=function(t){if(!t)return null;var e=this._groupMap,i=e[t]||null;if(i)for(;i.parentId;){var n=e[i.parentId];if(!n)break;i=n}return i},Ot.prototype.getParentGroup=function(t){return this.getGroup(this._childToParent[t])},Ot.prototype.getParentIds=function(t){if(t&&"string"==typeof t){var e=this._childToParent[t];if(e){for(var i=[e],n=this._groupMap[e];n&&n.parentId;)(n=this._groupMap[n.parentId])&&i.push(n.id);return i}}return null},Ot.prototype.getParentId=function(t,e){var i=this._childToParent[t];if(null!=e)for(var n=this.getGroupLevel(i);n>e&&i;)i=this._childToParent[i],n--;return i||""},Ot.prototype.removeAllGroups=function(){for(var t in this._groupMap)return this._groupMap={},this._childToParent={},!0;return!1},Ot.prototype.setGroups=function(t){for(var e=this._groupMap={},i=t?t.length:0,n=0;n<i;n++){var o=t[n],r=o.id;r&&(e[r]=Ot._cloneObject(o))}this.rebuildMap()},Ot.prototype.addGroup=function(t){var e=Ot.getGroupId(t);return e?this.setGroup(e,t):e},Ot.prototype.removeGroup=function(t){return!!this._groupMap[t]&&(this.removeAllChildren(t),this.unsetParent(t),delete this._groupMap[t],!0)},Ot.prototype.setGroup=function(t,e){if(!t)return"";if(e){var i=Ot._toGroupDefinition(e,t);this._ungroupChildren(i.children),this._groupMap[t]&&this.removeAllChildren(t);var n=this._childToParent[t];n&&(i.parentId=n.id),this._groupMap[t]=i;for(var o=i.children,r=o.length,s=0;s<r;++s){var a=o[s];this._childToParent[a]=t;var l=this._groupMap[a];l&&(l.parentId=t)}}else if(!this.removeGroup(t))return"";return t},Ot.prototype._ungroupChildren=function(t){if(Array.isArray(t))for(var e=t.length,i=0;i<e;++i)this.unsetParent(t[i])},Ot.prototype.hasGroupChild=function(t,e){var i=this._groupMap[t];if(e&&i){var n=i.children;if(n)return n.indexOf(e)>=0}return!1},Ot.prototype.contains=function(t,e){if(t&&e){if(t===e)return!0;for(var i=20,n=this._childToParent[e];n&&i;){if(t===n)return!0;--i,n=this._childToParent[n]}}return!1},Ot.prototype.addGroupChild=function(t,e,i){var n=this._groupMap[t];if(e&&n){var o=n.children;if(o&&o.indexOf(e)<0){this.unsetParent(e),this._childToParent[e]=t;var r=this._groupMap[e];return r&&(r.parentId=t),null!=i&&i>=0?o.splice(i,0,e):o.push(e),!0}}return!1},Ot.prototype.removeGroupChild=function(t,e){return null==e?this.unsetParent(t):!!this.hasGroupChild(t,e)&&this.unsetParent(e)},Ot.prototype.unsetParent=function(t){var e=this._childToParent[t];if(!e)return!1;this._childToParent[t]="";var i=this._groupMap[t];i&&(i.parentId="");var n=this._groupMap[e];if(n){var o=n.children;if(o&&o.length){var r=o.indexOf(t);r>=0&&o.splice(r,1)}}return!0},Ot.prototype.removeAllChildren=function(t){var e=this._groupMap[t];if(e){var i=e.children,n=i?i.length:0;if(n){e.children=[];for(var o=0;o<n;++o){var r=i[o];this._childToParent[r]&&(this._childToParent[r]="");var s=this._groupMap[r];s&&(s.parentId="")}return!0}}return!1},Ot.prototype.setGroupChildren=function(t,e){var i=this._groupMap[t];if(i){if(Array.isArray(e)){var n=e.slice();this._ungroupChildren(n),this.removeAllChildren(t),i.children=n;for(var o=i.id,r=n.length,s=0;s<r;++s){var a=n[s];this._childToParent[a]=o;var l=this._groupMap[a];l&&(l.parentId=o)}return!0}if(!e&&i.children.length)return this.removeAllChildren(t),!0}return!1},Ot.prototype.getGroupName=function(t){var e=this._groupMap[t];return e&&e.name||""},Ot.prototype.setGroupName=function(t,e){var i=this._groupMap[t];return!(!i||i.name===e)&&(i.name=e,!0)};var Nt=function(t){this._element=t||document.createElement("div")};s.inherits(Nt,lt),Nt.prototype._element=null,Nt.prototype._content=null,Nt.prototype._textSpan=null,Nt.prototype._nativeEvents=null,Nt._passiveEvents=null,Nt.prototype.getContent=function(t){return t?this._element.children:this._element.lastChild},Nt.prototype.setContent=function(t,e){if(null==t||t!=t?t=null:1!==t.nodeType&&11!==t.nodeType&&(null==t.getElement?(ot.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},Nt.prototype.addContent=function(t){return null==(t=ot.getElement(t))?null:(this._content=this._element.children,this._element.appendChild(t),t)},Nt.prototype.removeContent=function(t){return null!=(t=ot.getElement(t))&&(this._content=this._element.children,this._element.removeChild(t),!0)},Nt.prototype.listen=function(t,e,i){if(this._customEvents&&this._customEvents[t])this._customEvents[t].listen(e,i);else{this._nativeEvents||(this._nativeEvents={});var n=this._nativeEvents[t];if(!n){if(n=new st,this._nativeEvents[t]=n,n.dispatch=n.dispatch.bind(n),!Nt._passiveEvents){var o=!1;try{var r=Object.defineProperty({},"passive",{get:function(){return o=!0,!1}});window.addEventListener("testPassive",null,r),window.removeEventListener("testPassive",null,r)}catch(t){}if(o){var s={passive:!0};Nt._passiveEvents={touchstart:s,touchmove:s}}else Nt._passiveEvents={}}this._element.addEventListener(t,n.dispatch,Nt._passiveEvents[t]||!1)}n.listen(e,i)}},Nt.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)}},Nt.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}},Nt.prototype._unlistenAll=function(t){var e=this._nativeEvents[t];this._element.removeEventListener(t,e.dispatch,!1),e.unlistenAll()},Nt.prototype.dispose=function(){this._dispose()},Nt.prototype._dispose=function(){this.setParent(null),this.unlistenAll(),this._element=this._content=this._textSpan=null,this._customEvents=this._nativeEvents=null},Nt.prototype.setEventArgExtender=function(t,e){if(this._customEvents){var i=this._customEvents[t];i&&i.setEventArgExtender(e)}},Nt.prototype.getElement=function(){return this._element},Nt.prototype.getNextSibling=function(){return this._element.nextSibling},Nt.prototype.getParent=function(){return this._element.parentNode},Nt.prototype.setParent=function(t,e){this._setParent(t,e)},Nt.prototype._setParent=function(t,e){null!==(t=ot.getElement(t))?e?t.insertBefore(this._element,t.firstChild):t.appendChild(this._element):null!==this._element.parentNode&&this._element.parentNode.removeChild(this._element)},Nt.prototype.insertBefore=function(t){this._insertBefore(t)},Nt.prototype._insertBefore=function(t){if(null!=(t=ot.getElement(t))){var e=t.parentNode;null!=e&&e.insertBefore(this._element,t)}else this.setParent(this.getParent())},Nt.prototype.insertAfter=function(t){(t=ot.getElement(t))?t.nextSibling?this.insertBefore(t.nextSibling):this.setParent(t.parentNode):this.setParent(this.getParent(),!0)},Nt.prototype.hasClass=function(t){return!!this._element&&this._element.classList.contains(t)},Nt.prototype.addClass=function(t){this._element&&this._element.classList.add(t)},Nt.prototype.removeClass=function(t){this._element&&this._element.classList.remove(t)},Nt.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))},Nt.prototype.enableClass=function(t,e){!1!==e?this.addClass(t):this.removeClass(t)},Nt.prototype.getClass=function(){return this._element.className},Nt.prototype.setClass=function(t){this._element.className=t},Nt.prototype.getAttribute=function(t){return this._element.getAttribute(t)},Nt.prototype.setAttribute=function(t,e){this._element.setAttribute(t,e)},Nt.prototype.setAttributes=function(t){for(var e in t)this._element.setAttribute(e,t[e])},Nt.prototype.removeAttribute=function(t){this._element.removeAttribute(t)},Nt.prototype.getStyle=function(t){return this._element.style[t]},Nt.prototype.setStyle=function(t,e){this._element.style[t]=e},Nt.prototype.setStyles=function(t){var e=this._element.style;for(var i in t)e[i]=t[i]},Nt.prototype.getId=function(){return this._element.id},Nt.prototype.setId=function(t){this._element.id=t},Nt.prototype.toString=function(){var t=this._element.outerHTML;return t=t.replace(this._element.innerHTML,"")},Nt.prototype.getTextContent=function(){return this._element.textContent},Nt.prototype.setTextContent=function(t){this._element.textContent=t},Nt.prototype.getLeft=function(){return this._element.offsetLeft},Nt.prototype.setLeft=function(t){return this._element.style.left=t+"px",!0},Nt.prototype.getTop=function(){return this._element.offsetTop},Nt.prototype.setTop=function(t){return this._element.style.top=t+"px",!0},Nt.prototype.getWidth=function(){return this._element.offsetWidth},Nt.prototype.setWidth=function(t){return this._element.style.width=t+"px",!0},Nt.prototype.getHeight=function(){return this._element.offsetHeight},Nt.prototype.setHeight=function(t){return t<0&&(t=0),this._element.style.height=t+"px",!0},Nt.prototype.getBoundingClientRect=function(){return this._element.getBoundingClientRect()},Nt.prototype.fillParentWidth=function(t){return null==t&&(t=100),this._element.style.width=t+"%",!0},Nt.prototype.fillParentHeight=function(t){return null==t&&(t=100),this._element.style.height=t+"%",!0},Nt.prototype.getTooltip=function(){return this.getAttribute("title")},Nt.prototype.setTooltip=function(t){t?this.setAttribute("title",t):this.removeAttribute("title")},Nt.prototype.show=function(t){this._element.style.display=!1!==t?"":"none"},Nt.prototype.hide=function(t){this.show(!1===t)},Nt.prototype.isVisible=function(){return"none"!==this._element.style.display},Nt.prototype.enable=function(t){(t=!1!==t)?this.removeAttribute("disabled"):(this.setAttribute("disabled","disabled"),this._element.disabled=!t)},Nt.prototype.disable=function(t){this.enable(!1===t)},Nt.prototype.isEnabled=function(){return!this._element.hasAttribute("disabled")},Nt.prototype.getScrollLeft=function(){return this._element.scrollLeft},Nt.prototype.getScrollTop=function(){return this._element.scrollTop},Nt.prototype.isEndOfHorizontalScroll=function(){return this._element.scrollLeft>=this._element.scrollWidth-this.getWidth()},Nt.prototype.isEndOfVerticalScroll=function(){return this._element.scrollTop>=this._element.scrollHeight-this.getHeight()},Nt._proto=Nt.prototype;var Ht=Nt,Bt=function(){this._items=[],this._element=null};s.inherits(Bt,Ht),Bt.prototype._items=[],Bt.prototype.hasItem=function(){return!!this._items.length},Bt.prototype.containItem=function(t){return this._items.indexOf(t)>-1},Bt.prototype.insertItem=function(t,e){var i=this._items;i.indexOf(t)>-1||(i.push(t),e&&(t._order=e),i.length&&i.sort(Bt._iconComparer),this._updatePanelItems())},Bt.prototype.removeItem=function(t){var e=this._items,i=-1;if(t)for(var n=e.length;--n>=0;){var o=e[n];if("string"==typeof t){if(o.classList.contains(t)){i=n;break}}else if(o===t){i=n;break}}else i=e.length-1;var r=null;return i>-1&&(r=e.splice(i,1)[0]),this._updatePanelItems(),r},Bt.prototype.clearItems=function(){var t=this._items;t.length&&(t.length=0,this._updatePanelItems())},Bt._iconComparer=function(t,e){return t._order?e._order?t._order-e._order:1:e._order?-1:0},Bt.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])}};var Gt=Bt,Wt=function(t,e){this._id=Wt._runningId++,this._element=document.createElement("div"),this._element.className="cell",e&&(this._section=e)};s.inherits(Wt,Ht),Wt.prototype._aligner=null,Wt._runningId=0,Wt.prototype._id=0,Wt.prototype._width=-1,Wt.prototype._height=-1,Wt.prototype._visible=!0,Wt.prototype._rawContent,Wt.prototype._section=null,Wt.prototype._contentLocked=!1,Wt.prototype._collapsedState=0,Wt.prototype._floatingPanel=null,Wt.prototype._frontIcon=null,Wt.prototype.getContent=function(t){return t&&this._element?this._element.children:this._content||null},Wt.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 n=this._setRawContent(t);return null!=e&&this._content&&this._content.setAttribute("title",e),n},Wt.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)))},Wt.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},Wt.prototype.getNextSibling=function(){return null!==this._element?this._element.nextSibling:null},Wt.prototype.getParent=function(){return null!==this._element?this._element.parentNode:null},Wt.prototype.setParent=function(t,e){var i=ot.getElement(t);if(i){if(this.initialize(),1===this._collapsedState)return;var n;!0===e&&(n=i.firstChild),n?i.insertBefore(this._element,n):i.appendChild(this._element)}else this.removeParent()},Wt.prototype.removeParent=function(){var t=this._element;t&&t.parentNode&&t.parentNode.removeChild(t)},Wt.prototype.insertBefore=function(t){var e=ot.getElement(t);if(null!=e){var i=e.parentNode;null!=i&&(this.initialize(),i.insertBefore(this._element,e))}else this.setParent(this.getParent())},Wt.prototype.getTextContent=function(){return this._rawContent?"string"==typeof this._rawContent?this._rawContent:this._rawContent.textContent:""},Wt.prototype.getTextElement=function(){return this._textSpan},Wt.prototype.getWidth=function(){return this._width>=0?this._width:this._element.offsetWidth},Wt.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)},Wt.prototype.getHeight=function(){return this._height>=0?this._height:this._element.offsetHeight},Wt.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)},Wt.prototype.fillParentWidth=function(t){return!1},Wt.prototype.fillParentHeight=function(t){return!1},Wt.prototype.show=function(t){var e=!1!==t;e!==this._visible&&(this._visible=e,this._updateDisplay())},Wt.prototype.isVisible=function(){return this._visible},Wt.prototype.getScrollLeft=function(){return 0},Wt.prototype.getScrollTop=function(){return 0},Wt.prototype.isEndOfHorizontalScroll=function(){return!0},Wt.prototype.isEndOfVerticalScroll=function(){return!0},Wt.prototype.hasElement=function(){return null!==this._element},Wt.prototype.getSection=function(){return this._section},Wt.prototype.initialize=function(){return null==this._aligner&&(ot.isIE?this._aligner=document.createElement("div"):this._aligner=document.createElement("button"),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},Wt.prototype.updateIcon=function(t){if(t){var e=this._frontIcon;if(e){if(e.containItem(t))return;e.clearItems()}this.insertFrontIcon(t,0)}},Wt.prototype.removeIcon=function(){var t=this._frontIcon;t&&(t.clearItems(),this._element.removeChild(t.getElement()),t=this._frontIcon=null)},Wt.prototype.isFrozen=ot._deprecatedFunction,Wt.prototype.freezeLayout=ot._deprecatedFunction,Wt.prototype.setAutoContentClipping=ot._deprecatedFunction,Wt.prototype.setContentTooltip=function(t){return!(null==t||!this._content)&&(this._content.setAttribute("title",t),!0)},Wt.prototype.lockContent=function(t){this._contentLocked=!1!==t},Wt.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 n=this.blinking;n&&(n.blinking>=0&&clearTimeout(n.blinking),n.cell=null,n.styles=null,delete this.blinking),this.removeIcon(),this.setContent(null),this._textSpan&&(this._textSpan.className="text",this._textSpan.textContent="")}},Wt.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)},Wt.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)},Wt.prototype.insertFloatingIcon=function(t,e){if(t){var i=this._floatingPanel;i||(i=this._floatingPanel=new Gt),i.insertItem(t,e),i.addClass("floating-panel");var n=this._element;n.contains(i.getElement())||n.appendChild(i.getElement())}},Wt.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},Wt.prototype.insertFrontIcon=function(t,e){if(t){var i=this._frontIcon;i||(i=this._frontIcon=new Gt),i.insertItem(t,e),i.addClass("front-panel");var n=this._element;n.contains(i.getElement())||n.insertBefore(i.getElement(),n.firstChild)}},Wt.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},Wt.prototype.getCellId=function(){return this._id},Wt.prototype.updatePadding=function(){},Wt.prototype.collapse=function(t,e){var i,n=!1!==t;return i=n?e?2:1:0,this._collapsedState!==i&&(n?e?this.addClass("spanned"):this.setParent(null):2===this._collapsedState&&this.removeClass("spanned"),this._collapsedState=i,!0)},Wt.prototype.isCollapsed=function(){return 0!==this._collapsedState},Wt.prototype.isKeptInDoc=function(){return 1!==this._collapsedState},Wt.prototype.getClientWidth=function(){return this._element?this._element.clientWidth:this.getWidth()},Wt.prototype.getClientHeight=function(){return this._element?this._element.clientHeight:this.getHeight()},Wt.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},Wt.prototype._updateDisplay=function(){var t=!1;this.isVisible()&&this._width&&this._height&&(t=!0),this._element.style.display=t?"":"none"},Wt._proto=Wt.prototype;var Ut=Wt,Yt=function(){this._ends=[],this._cols=[]};Yt.prototype._laneCount=0,Yt.prototype._defaultSize=10,Yt.prototype._defaultScalability=!0,Yt.prototype._homogeneous=!0,Yt.prototype._visibility=!0,Yt.prototype._ends,Yt.prototype._cols,Yt.prototype._bits=[1,2,4,8],Yt.prototype.hitTest=function(t){if(t<0)return-1;if(t>=this.getTrackSize())return~this._laneCount;var e=-1,i=0;if(this._homogeneous){var n=this._defaultSize;i=((e=Math.floor(t/n))+1)*n}else e=ot.upperBound(this._ends,t),i=this._ends[e];return(e>=this._laneCount||t>=i)&&(e=~e),e},Yt.prototype.dispose=function(){this._cols=this._ends=null},Yt.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},Yt.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},Yt.prototype.isHomogeneous=function(){return this._homogeneous},Yt.prototype.isAtMinimumSize=function(t){var e=this._getMinimumScalingSize(t);return(null!=t?this.getLaneSize(t):this.getTrackSize())<=e},Yt.prototype.isFixedSize=function(){for(var t=0;t<this._laneCount;++t)if(this.getLaneScalability(t))return!1;return!0},Yt.prototype.clearLaneCustomizations=function(){this._ends.length=0,this._cols.length=0,this._homogeneous=!0},Yt.prototype.getLaneCount=function(){return this._laneCount},Yt.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))},Yt.prototype.getDefaultLaneSize=function(){return this._defaultSize},Yt.prototype.setDefaultLaneSize=function(t){return t<0&&(t=0),this._defaultSize!==t&&(this._defaultSize=t,this._markDirtyIndex(0),!0)},Yt.prototype.getLaneDefaultSize=function(t){if(t<0||t>=this._laneCount)return-1;var e=this._newColumn(t);return e.defaultSize?e.defaultSize:-1},Yt.prototype.setLaneDefaultSize=function(t,e){t<0||t>=this._laneCount||e>=0&&(this._newColumn(t).defaultSize=e)},Yt.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},Yt.prototype.getDefaultScalability=function(){return this._defaultScalability},Yt.prototype.setDefaultScalability=function(t){return this._defaultScalability!==t&&(this._defaultScalability=t,!0)},Yt.prototype.getTrackSize=function(){return!this._visibility||this._laneCount<=0?0:this._homogeneous?this._laneCount*this._defaultSize:(this._updateEndPoints(),this._ends[this._laneCount-1])},Yt.prototype.setTrackSize=function(t){var e=0,i=0,n=[];for(e=0;e<this._laneCount;++e){var o=this._cols[e];o?o.invisibility||(!1!==this._getLaneScalability(o)?n.push(e):i+=this._getFixedSize(o)):n.push(e)}if(n.length<=0)return null;var r=this._distributeLaneSize(t-i,n),s=!1,a=[];for(e=r.length;--e>=0;){a[e]=0;var l=r[e];if(null!=l){var u=this.getLaneSize(e);this._newColumn(e),this._setCalculatedLaneSize(e,l)&&(a[e]=l-u,s=!0)}}return s?a:null},Yt.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},Yt.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]))},Yt.prototype.getLaneSize=function(t){if(this._visibility){var e=this._cols[t];return e?e.actualSize:this._defaultSize}return 0},Yt.prototype.getCustomLaneSize=function(t){var e=this._cols[t];return e&&null!=e.customSize?e.customSize:this._defaultSize},Yt.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))},Yt.prototype.setLaneProperty=function(t,e,i){if(t<0||t>=this._laneCount)return!1;var n=this._cols[t];return(null==n||n[e]!==i)&&((n=this._newColumn(t))[e]=i,!0)},Yt.prototype.getLaneProperty=function(t,e){var i=this._cols[t];return i&&null!=i[e]?i[e]:null},Yt.prototype.getMinimumLaneSize=function(t){var e=this._cols[t];return e&&null!=e.minSize?e.minSize:0},Yt.prototype.setMinimumLaneSize=function(t,e,i){if(t<0||t>=this._laneCount)return!1;if(e<0&&(e=0),this.getMinimumLaneSize(t)!==e){var n=this._newColumn(t);return n.minSize=e,i&&this.getLaneScalability(t)&&(n.customSize=e),this._setCalculatedLaneSize(t)}return!1},Yt.prototype.isLaneVisible=function(t){var e=this._cols[t];return!e||!e.invisibility},Yt.prototype.showLane=function(t,e){return this.hideLane(t,!1===e)},Yt.prototype.hideLane=function(t,e,i){if(t<0||t>=this._laneCount)return!1;var n=this._newColumn(t),o=!n.invisibility,r=null!=i?this._bits[i]:1;return!1!==e?n.invisibility|=r:n.invisibility&=~r,o!==!n.invisibility&&this._setCalculatedLaneSize(t)},Yt.prototype.getLaneVisibilityBit=function(t,e){if(t>=0&&t<this._laneCount){var i=this._cols[t];if(i){var n=null!=e?this._bits[e]:1;if(i.invisibility&n)return!1}}return!0},Yt.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)},Yt.prototype.getLaneScalability=function(t){var e=this._cols[t];return e&&null!=e.scalability?e.scalability:this._defaultScalability},Yt.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)},Yt.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},Yt.prototype.insertLane=function(t,e){t<0&&(t=0);var i=1;if(ot.isNumber(e)){if(e<=0)return;i=e,e=null}if(t>=this._laneCount&&(t=this._laneCount,!e))this.setLaneCount(this._laneCount+i);else if(this._laneCount+=i,this._markDirtyIndex(t),ot.insertEmptyItems(this._cols,t,i),e)for(var n=t+i,o=t;o<n;++o)this.deserializeLane(o,e)},Yt.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 i=t<e?t:e;this._markDirtyIndex(i),ot.moveArrayItem(this._cols,t,e)}},Yt.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},Yt.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)}},Yt.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}},Yt.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 n=null!=i.minSize?i.minSize:0;e<n&&(e=n)}}else e=0;return i.actualSize!==e&&(i.actualSize=e,this._homogeneous=!1,this._markDirtyIndex(t),!0)},Yt.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 n=this._laneCount;--n>=0;)e+=this._getMinimumScalingSize(n);return e},Yt.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},Yt.prototype._getLaneScalability=function(t){return null==t.scalability?this._defaultScalability:t.scalability},Yt.prototype._distributeLaneSize=function(t,e){if(e.length<=0)return[];t<0&&(t=0);var i=0,n=0,o=0,r=0,s=[],a=[],l=[];for(i=e.length;--i>=0;)s[o=e[i]]=this.getMinimumLaneSize(o),a[o]=this.getCustomLaneSize(o),n+=a[o];for(var u=!0;u;)for(u=!1,i=e.length;--i>=0;){var h=s[o=e[i]],p=a[o];(r=t*p/n)<=h&&(u=!0,l[o]=h,t-=h,n-=p,e.splice(i,1))}var d=e.length-1,c=0,_=0;for(i=d;--i>=0;){r=t*a[o=e[i]]/n;var f=Math.floor(r);(_+=r-f)>=1&&(++f,--_),l[o]=f,c+=f}return l[e[d]]=Math.floor(t-c),l},Yt.prototype._markDirtyIndex=function(t){t<this._ends.length&&(this._ends.length=t)},Yt.prototype._newColumn=function(t){var e=this._cols[t];return e||(this._cols[t]=e={},e.invisibility=0),e},Yt.prototype.copyFrom=function(t,e){if(!this._homogeneous||!t._homogeneous||this._defaultSize!==t._defaultSize){e||(e=0);var i=t.getLaneCount(),n=this.getLaneCount(),o=e+i;o>n&&(o=n);for(var r=0,s=e;s<o;++s){var a=t.getLaneSize(r++),l=this._newColumn(s);l.customSize!==a&&(l.customSize=a,l.actualSize!==a&&(l.actualSize=a,this._homogeneous=!1,this._markDirtyIndex(s)))}}};var qt=Yt,Xt=function(){};Xt.prototype.hitTest=function(t,e,i){},Xt.prototype.hitTestX=function(t){},Xt.prototype.hitTestY=function(t){},Xt.prototype.getDefaultColumnWidth=function(){},Xt.prototype.setDefaultColumnWidth=function(t){},Xt.prototype.getDefaultRowHeight=function(){},Xt.prototype.setDefaultRowHeight=function(t){},Xt.prototype.getColumnWidth=function(t){},Xt.prototype.setColumnWidth=function(t,e){},Xt.prototype.getRowHeight=function(t){},Xt.prototype.setRowHeight=function(t,e){},Xt.prototype.isColumnVisible=function(t){},Xt.prototype.hideColumn=function(t,e){},Xt.prototype.isRowVisible=function(t){},Xt.prototype.hideRow=function(t,e){},Xt.prototype.getMinimumColumnWidth=function(t){},Xt.prototype.setMinimumColumnWidth=function(t,e){},Xt.prototype.getMinimumRowHeight=function(t){},Xt.prototype.setMinimumRowHeight=function(t,e){},Xt.prototype.getCellLeft=function(t){},Xt.prototype.getCellTop=function(t){},Xt.prototype.getCellWidth=function(t,e){},Xt.prototype.getCellHeight=function(t,e){},Xt.prototype.hasCellSpan=function(){},Xt.prototype.getCellRowSpan=function(t,e){},Xt.prototype.setCellRowSpan=function(t,e,i){},Xt.prototype.getCellColSpan=function(t,e){},Xt.prototype.setCellColSpan=function(t,e,i){},Xt.prototype.clearCellSpans=function(){},Xt.prototype.clearColumnSpans=function(t){},Xt.prototype.clearColumnCustomizations=function(){},Xt.prototype.clearRowCustomizations=function(){},Xt.prototype.getColumnScalability=function(t){},Xt.prototype.setColumnScalability=function(t,e){},Xt.prototype.getRowScalability=function(t){},Xt.prototype.setRowScalability=function(t,e){},Xt.prototype.getCell=function(t,e,i){},Xt.prototype.getCellContent=function(t,e){},Xt.prototype.setCellContent=function(t,e,i){},Xt.prototype.getColumn=function(t){},Xt.prototype.getColumnCount=function(){},Xt.prototype.setColumnCount=function(t){},Xt.prototype.getRowCount=function(){},Xt.prototype.setRowCount=function(t,e){},Xt.prototype.getVisibleRowCount=function(){},Xt.prototype.addRow=function(t){},Xt.prototype.removeRow=function(t){},Xt.prototype.setBorders=function(t,e,i,n){},Xt.prototype.getColumnStyle=function(t,e){},Xt.prototype.setColumnStyle=function(t,e,i){},Xt.prototype.enableColumnClass=function(t,e,i){},Xt.prototype.hasColumnClass=function(t,e){},Xt.prototype.enableRowClass=function(t,e,i){},Xt.prototype.setRowStyle=function(t,e,i,n){},Xt.prototype.getRelativePosition=function(t){},Xt.prototype.getContentWidth=function(){},Xt.prototype.getContentHeight=function(){},Xt.prototype.getCellsByRowIndex=function(t){},Xt.prototype.disableHorizontalGridLine=function(t){},Xt.prototype.disableVerticalGridLine=function(t){},Xt.prototype.enableShading=function(t){},Xt.prototype.setTransposedShading=function(t){},Xt.prototype.enableRowHighlighting=function(t){},Xt.prototype.getRowHighlight=function(){},Xt.prototype.setRowHighlight=function(t){},Xt.prototype.getSelectedRows=function(){},Xt.prototype.getSelectedRowCount=function(){},Xt.prototype.isSelectedRow=function(t){},Xt.prototype.getRowAnchor=function(){},Xt.prototype.setRowAnchor=function(t){},Xt.prototype.setSelectedRow=function(t,e){},Xt.prototype.selectSingleRow=function(t){},Xt.prototype.selectRowRange=function(t,e){},Xt.prototype.clearSelectedRows=function(){},Xt.prototype.getFirstSelectedRow=function(){},Xt.prototype.getLastSelectedRow=function(){},Xt.prototype.activateColumn=function(t,e){},Xt.prototype.activateRows=function(t,e,i){},Xt.prototype.moveRowsToTop=function(t){},Xt.prototype.getFirstIndexInView=function(){},Xt.prototype.getLastIndexInView=function(){},Xt.prototype.isInCurrentView=function(t){},Xt.prototype.getFrozenLayout=function(){},Xt.prototype.setFrozenLayout=function(t){},Xt.prototype.insertColumn=function(t,e){},Xt.prototype.removeColumnAt=function(t){},Xt.prototype.moveColumn=function(t,e){},Xt.prototype.enableRowVirtualization=function(t){},Xt.prototype.enableColumnVirtualization=function(t){},Xt.prototype.getColumnIndex=function(t){},Xt.prototype.getCellIndex=function(t,e){},Xt.prototype.getIndex=function(){},Xt.prototype.setIndex=function(t){},Xt.prototype.getRowOffset=function(){},Xt.prototype.setRowOffset=function(t){},Xt.prototype.updateLayout=function(){},Xt.prototype.stretchCell=function(t,e,i,n){},Xt.prototype.unstretchCell=function(t,e){},Xt.prototype.unstretchAllCells=function(){},Xt.prototype.getStretchedCell=function(t,e){},Xt.prototype.getStretchedCells=function(){},Xt.prototype.updateStretchedCells=function(){},Xt.prototype.getColumnHost=function(){},Xt.prototype.setHidingMethod=function(t){},Xt.prototype.getHidingMethod=function(){},Xt.prototype.setColumnVisibility=function(t,e,i){},Xt.prototype.getRowLayout=function(){},Xt.prototype.reserveRightSpace=function(t){},Xt.prototype.getReservedSpace=function(){},Xt.prototype.getComputedStyle=function(){},Xt.prototype.isColumnActive=function(t){},Xt.prototype.setRowAttributes=function(t,e){},Xt.prototype.getContextRow=function(t){},Xt.prototype.selectColumn=function(t,e){},Xt.prototype.isSelectedColumn=function(t){},Xt.prototype.selectCell=function(t,e,i){},Xt.prototype.setCellBounds=function(t,e,i,n){},Xt.prototype.getHorizontalLayout=function(){},Xt.prototype.calculateColumnBounds=function(t,e,i,n){},Xt.prototype.updateColumnBounds=function(t,e,i){},Xt.prototype.updateColumnSeparators=function(){};var jt=function(t){(this._element=document.createElement("div")).className="column",this._cells=[],this._section=t};s.inherits(jt,Ht),jt.prototype._nextSibling=null,jt.prototype._parent=null,jt.prototype._section=null,jt.prototype._cells=null,jt.prototype._cellStart=0,jt.prototype._cellEnd=0,jt.prototype._autoStyleUpdating=!1,jt.prototype._deactivation=!1,jt.prototype._sizeClasses=null,jt.prototype._colLeft=0,jt.prototype._absolute=!1,jt.prototype._scrollFrame=null,jt.prototype._invisibility=0,jt.prototype._bits=[1,2,4,8],jt.prototype._pinned=!0,jt.prototype.clearContent=function(){for(var t=this._cells.length;--t>=0;)this._cells[t].setContent(null)},jt.prototype.setLeft=function(t){return this._colLeft=t,this._absolute&&(this._element.style.left=t+"px"),!0},jt.prototype.enableAbsolutePosition=function(t){(t=!1!==t)!==this._absolute&&(this._absolute=t,this._element.style.left=t?this._colLeft+"px":"")},jt.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},jt.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")},jt.prototype.setStyles=function(t){var e=this._element,i=e.style;for(var n in t)i[n]=t[n];e.style.backgroundColor?e.classList.contains("no-shading")||e.classList.add("no-shading"):e.classList.contains("no-shading")&&e.classList.remove("no-shading")},jt.prototype.show=function(t){this.setVisibility(0,!1!==t)},jt.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 n=this._sizeClasses;if(n){if(n.length>i){for(e=n.length;--e>=i;)this.removeClass(n[e]);n.length=i}i||(this._sizeClasses=null)}if(i)for(n||(n=[],this._sizeClasses=n),e=n.length;e<i;++e)n[e]=jt._sizeClasses[e],this.addClass(n[e]);return this.setVisibility(1,t>0),!0},jt._sizeClasses=["small-col","very-small-col","tiny-col"],jt.prototype.setHeight=function(t){return this._element.style.height=t+"px",this.setVisibility(2,t>0),!0},jt.prototype.getParent=function(){return this._parent},jt.prototype.setParent=function(t,e){if(this._element){this._parent=ot.getElement(t);var i=this._section?this._section.getHidingMethod():"";this._invisibility&&!i||this._setParent(this._parent,e)}},jt.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())},jt.prototype.enableAutoStyleUpdating=function(t){t=!1!==t,this._autoStyleUpdating!==t&&(this._autoStyleUpdating=t)},jt.prototype.setNextSibling=function(t){this._nextSibling=t},jt.prototype.isActive=function(){return!(this._invisibility&this._bits[3])},jt.prototype.disableDeactivation=function(t){this._deactivation=!1!==t,this._deactivation&&(this.isActive()||this.activate())},jt.prototype.activate=function(t){return t=this._pinned||this._deactivation||!1!==t,this.isActive()!==t&&(this.setVisibility(3,t),!0)},jt.prototype.deactivate=function(t){this.activate(!1===t)},jt.prototype.setCellCount=function(t){var e;for(e=this._cells.length;e<t;++e)this._cells.push(new Ut(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)},jt.prototype.getCell=function(t){return this._cells[t]||null},jt.prototype.collapseCells=function(t,e,i,n,o){if(!(e<=0)){var r=!1,s=this._cells[t];s&&!n&&(r|=s.collapse(i,o));for(var a=1;a<e&&(s=this._cells[t+a]);++a)r|=s.collapse(i,o);r&&(i?e>1&&(this._hasCollapsedCells=!0):this.updateCellOrders())}},jt.prototype.uncollapseAllCells=ot._deprecatedFunction,jt.prototype.activateCells=function(t,e){var i,n=this._element;if(this._hasCollapsedCells)t=this._cellEnd,e>this._cellEnd&&(this._cellEnd=e);else if(this._cellStart===t){var o=this._cellEnd-e;if(o>0){for(i=this._cellEnd;--i>=e;)this._cells[i].removeParent();return void(this._cellEnd=e)}if(!(o<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(),n.appendChild(r.getElement()))}},jt.prototype.moveCellsToTop=function(t){if(this.isActive()){for(var e=this._element,i=0;i<t;++i){var n=this._cells[i];n.isKeptInDoc()&&e.appendChild(n.getElement())}this._cells=ot.cycleArray(this._cells,t)}},jt.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}},jt.prototype.hasCollapsedCells=function(){return this._hasCollapsedCells},jt.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},jt.prototype.getSection=function(){return this._section},jt.prototype.log=function(){for(var t=[],e=this._cells.length,i=0;i<e;++i)t.push(this._cells[i].getTextContent());return t},jt.prototype.getVisibility=function(){return!this._invisibility},jt.prototype.setVisibility=function(t,e){var i=!this._invisibility,n=this._bits[t]||1;e?this._invisibility&=~n:this._invisibility|=n;var o=!this._invisibility;if(i!==o)if(this._section?this._section.getHidingMethod():"")this.enableClass("hidden",!o);else if(o){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)},jt.prototype.updateLayout=function(){},jt.prototype.setScrollState=function(t,e,i){this._scrollFrame=t,this.enableAbsolutePosition(i),this.setParent(e||this._section.getColumnHost()),e||this.activate(),this._pinned=!e},jt._proto=jt.prototype;var Kt=jt,Jt=function(){this._items=[]};Jt.prototype._items=null,Jt.prototype.dispose=function(){this._items=null},Jt.prototype.setItemCount=function(t){var e=this._items,i=e.length;if(i!==t)for(e.length=t;i<t;)e[i++]={}},Jt.prototype.getItem=function(t){return this._items[t]||null},Jt.prototype.moveItemsToTop=function(t){this._items=ot.cycleArray(this._items,t)};var Qt=Jt,Zt=function(t,e,i){t.setTop(e.getLaneStart(i)),t.setHeight(e.getLaneSize(i))},$t=function(t,e,i,n){if(i){var o=e.getLaneStart(i);t.setLeft(o),t.setWidth(n-o)}else t.setStyle("left",""),t.setWidth(n)},te=function(t,e,i){this._trackX=t,this._trackY=e,this._section=i,this._cells=[]};te.prototype._trackX,te.prototype._trackY,te.prototype._section,te.prototype._cells,te.prototype._activeCount=0,te.prototype._stretchSize=0,te.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},te.prototype.setStretchSize=function(t){this._stretchSize=t},te.prototype.getStretchSize=function(){return this._stretchSize},te.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 n=e[i];n&&n.dispose()}e.length=t}},te.prototype.getCell=function(t){var e=this._cells[t];return e&&e.getParent()?e:null},te.prototype.getCells=function(){var t=[];if(this._activeCount){for(var e=this._cells,i=e.length,n=0;n<i;++n){var o=e[n];o&&o.getParent()&&t.push(o)}this._activeCount=t.length}return t},te.prototype.getColumnIndex=function(t){if(t){if(!t.getElement)return null!=t._colIndex?t._colIndex:-1;var e=t.getElement();if(e)return null!=e._colIndex?e._colIndex:-1}return-1},te.prototype.getRowIndex=function(t){if(t){if(t.getElement)return t.getParent()?this._cells.indexOf(t):-1;for(var e=this._cells,i=e.length,n=0;n<i;++n){var o=e[n];if(o&&o.getParent()&&o.getElement()===t)return n}}return-1},te.prototype.stretchCell=function(t,e){++this._activeCount,(!e||e<0)&&(e=0);var i=this._cells[t]||null;i||((i=new Ut(null,this._section)).addClass("tr-stretched"),i.stretched=!0,this._cells[t]=i);var n=i.getElement();n.stretched=!0,n._colIndex!==e&&(n._colIndex=e,e>0?n.classList.add("right-stretching"):n.classList.remove("right-stretching")),n._rowIndex!==t&&(n._rowIndex=t);var o=this._stretchSize||this._trackX.getTrackSize();return $t(i,this._trackX,e,o),Zt(i,this._trackY,t),i},te.prototype.unstretchCell=function(t){var e=this._cells[t]||null;return e&&e.setParent(null),e},te.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)}}},te.prototype.updateCells=function(){if(this._activeCount){for(var t=0,e=this._cells,i=e.length,n=this._trackX,o=this._trackY,r=this._stretchSize||n.getTrackSize(),s=0;s<i;++s){var a=e[s];a&&a.getParent()&&(++t,$t(a,n,a.getElement()._colIndex,r),Zt(a,o,s))}this._activeCount=t}},te.prototype.updateXAxis=function(){if(this._activeCount){for(var t=0,e=this._cells,i=e.length,n=this._trackX,o=this._stretchSize||n.getTrackSize(),r=0;r<i;++r){var s=e[r];s&&s.getParent()&&(++t,$t(s,n,s.getElement()._colIndex,o))}this._activeCount=t}},te.prototype.updateYAxis=function(){if(this._activeCount){for(var t=0,e=this._cells,i=e.length,n=this._trackY,o=0;o<i;++o){var r=e[o];r&&r.getParent()&&(++t,Zt(r,n,o))}this._activeCount=t}},te.prototype.moveCellsToTop=function(t){this._activeCount&&(this._cells=ot.cycleArray(this._cells,t),this.updateYAxis())};var ee=te,ie=function(t,e){this.indexX=t,this.indexY=e};ie.prototype.isSpanIndices=function(t,e){return t===this.indexX&&e===this.indexY},ie.prototype.isOccupiedIndices=function(t,e){return t!==this.indexX||e!==this.indexY},ie.prototype.register=function(t,e){this._register(t,e,!0)},ie.prototype.unregister=function(t,e){this._register(t,e,!1)},ie.prototype._register=function(t,e,i){var n=t.indexOf(this);i?n<0&&t.push(this):n>=0&&t.splice(n,1);for(var o=i?this:null,r=this.indexX+this.colSpan,s=this.indexY+this.rowSpan,a=this.indexX;a<r;++a)for(var l=this.indexY;l<s;++l)e[a+","+l]=o},ie.prototype.indexX,ie.prototype.indexY,ie.prototype.colSpan=1,ie.prototype.rowSpan=1,ie.prototype.prevColSpan=1,ie.prototype.prevRowSpan=1,ie.prototype.retVal=0;var ne=ie,oe=function(){this._spans=[],this._occupiedMap={}};oe.prototype.removeColumn=function(t){var e=!1;return this.removeSpanByColIndex(t)&&(e=!0),this.shiftColumn(t,-1)&&(e=!0),e},oe.prototype.freezeMapping=function(t){this._frozenMapping=!1!==t,this._frozenMapping||this._mapCellSpans()},oe.prototype._mapCellSpans=function(){var t,e,i=this._spans;for(this._spans=[],this._occupiedMap={},t=i.length;--t>=0;)(e=i[t]).indexX>=0&&e.register(this._spans,this._occupiedMap)},oe.prototype.shiftColumn=function(t,e){if(this._spans.length<=0||0===e)return!1;for(var i=!1,n=this._spans.length;--n>=0;){var o=this._spans[n];o.indexX>=t&&(i=!0,o.indexX+=e)}return!(!i||this._frozenMapping)&&(this._mapCellSpans(),!0)},oe.prototype.removeSpan=function(t,e){if(this._spans.length<=0)return null;var i=t+","+e,n=this._occupiedMap[i];return!n||n.isOccupiedIndices(t,e)?null:(n.unregister(this._spans,this._occupiedMap),n)},oe.prototype.removeSpanByColIndex=function(t,e){var i,n=this._spans.length;if(n<=0)return null;for(var o=e||[],r=0,s=0;s<n;++s)(i=this._spans[s])&&i.indexX===t&&(o.push(i),r++);if(r<=0)return null;for(n=o.length,s=0;s<r;++s)o[n-s-1].unregister(this._spans,this._occupiedMap);return o},oe.prototype.removeSpanStartedFromRowIndex=function(t,e){var i,n=this._spans.length;if(n<=0)return null;for(var o=e||[],r=0,s=0;s<n;++s)(i=this._spans[s])&&i.indexY>=t&&(o.push(i),r++);if(r<=0)return null;for(n=o.length,s=0;s<r;++s)o[n-s-1].unregister(this._spans,this._occupiedMap);return o},oe.prototype.clearAllSpans=function(){if(this._spans.length<=0)return null;var t=this._spans;return this._spans=[],this._occupiedMap={},t},oe.prototype.hasSpan=function(){return this._spans.length>0},oe.prototype.getSpan=function(t,e){var i=this.getOccupyingSpan(t,e);return i&&i.isSpanIndices(t,e)?i:null},oe.prototype.getOccupyingSpan=function(t,e){return this._spans.length<=0?null:this._occupiedMap[t+","+e]||null},oe.prototype.getAllSpans=function(){return this._spans},oe.prototype.getColSpan=function(t,e){var i=this._occupiedMap[t+","+e];return null==i?1:i.isOccupiedIndices(t,e)?i.indexX-t:i.colSpan},oe.prototype.getRowSpan=function(t,e){var i=this._occupiedMap[t+","+e];return null==i?1:i.isOccupiedIndices(t,e)?i.indexY-e:i.rowSpan},oe.prototype.setColSpan=function(t,e,i){return this._updateSpan(t,e,!0,i)},oe.prototype.setRowSpan=function(t,e,i){return this._updateSpan(t,e,!1,i)},oe.prototype._updateSpan=function(t,e,i,n){n<1&&(n=1);var o=this.getSpan(t,e);o&&(o.retVal=0);var r,s,a,l,u,h,p=t,d=e,c=o?o.colSpan:1,_=o?o.rowSpan:1,f=!0;if(i){if(c===n)return o;if(c>n)p=t+n,r=t+c,f=!1;else{if((a=this._occupiedMap[t+","+e])&&a!==o)return o;p=t+c,r=t+n}s=e+_}else{if(_===n)return o;if(_>n)d=e+n,s=e+_,f=!1;else{if((a=this._occupiedMap[t+","+e])&&a!==o)return o;d=e+_,s=e+n}r=t+c}if(f){var g=[];for(u=p;u<r;++u)for(h=d;h<s;++h){if(l=u+","+h,this._occupiedMap[l])return o;g.push(l)}for(null==o&&(o=new ne(t,e),l=t+","+e,this._spans.push(o),this._occupiedMap[l]=o),u=g.length;--u>=0;)this._occupiedMap[g[u]]=o}else{if(i?n+_<=2:n+c<=2){l=t+","+e;var y=this._spans.indexOf(o);this._spans.splice(y,1),this._occupiedMap[l]=null}for(u=p;u<r;++u)for(h=d;h<s;++h)this._occupiedMap[u+","+h]=null}return i?(o.prevColSpan=o.colSpan,o.colSpan=n):(o.prevRowSpan=o.rowSpan,o.rowSpan=n),o.retVal=f?1:-1,o},oe.prototype._spans,oe.prototype._occupiedMap,oe.prototype._frozenMapping=!1;var re=oe,se=function(){this._selections=[]};se.prototype.clone=function(){var t=new se;return t._selections=this._selections.concat(),t._count=this._count,t._anchor=this._anchor,t._firstIndex=this._firstIndex,t._lastIndex=this._lastIndex,t},se.prototype.toString=function(){return this._selections.join(", ")},se.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))},se.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)},se.prototype.deselectFrom=function(t){if(this._lastIndex<t)return!1;if(this._firstIndex>=t)return this.clearAllSelections(),!0;for(var e=this._lastIndex,i=this._selections,n=t;n<=e;++n)i[n]&&(i[t]=!1,--this._count);return this._anchor>=t&&(this._anchor=-1),this._lastIndex=this._findPrevSelection(t),!0},se.prototype.toggleSelection=function(t){this._selections[t]?this.deselect(t):this.select(t)},se.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)},se.prototype.selectRange=function(t,e){if(0!==e)if(t<0&&(t=0),1!==e&&-1!==e){var i=t,n=i+e;if(e<0&&(i=(n=i+1)+e),!(i>=n)){this._anchor=t,(this._firstIndex<0||i<this._firstIndex)&&(this._firstIndex=i),(this._lastIndex<0||n>=this._lastIndex)&&(this._lastIndex=n-1);for(var o=i;o<n;++o)this._select(o)}}else this.select(t)},se.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 n=0;for(n=t;n<i;++n)this._selections[n]&&(this._selections[n]=!1,--this._count)}}else this.deselect(t)},se.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 n=t;n<i;++n)if(this._selections[n])return!0;return!1},se.prototype.getSelection=function(t){return!0===this._selections[t]},se.prototype.setSelection=function(t,e){return!1!==e?this.select(t):this.deselect(t)},se.prototype.getSelectionAnchor=function(){return this._anchor},se.prototype.setSelectionAnchor=function(t){this._anchor=t},se.prototype.getSelectionCount=function(){return this._count},se.prototype.getFirstSelectedIndex=function(){return this._firstIndex},se.prototype.getLastSelectedIndex=function(){return this._lastIndex},se.prototype.getAllSelections=function(){if(this._count>0){for(var t=new Array(this._count),e=0,i=this._selections,n=this._lastIndex,o=this._firstIndex;o<=n;++o)i[o]&&(t[e++]=o);return t}return[]},se.prototype.getConnectedRanges=function(t,e){if(this._count>0){var i=[];(null==t||t<this._firstIndex)&&(t=this._firstIndex),(null==e||e>this._lastIndex)&&(e=this._lastIndex+1);for(var n=null,o=t;o<e;++o)this._selections[o]?n||(n=[o,-1]):n&&(n[1]=o-1,i.push(n),n=null);return n&&(n[1]=this._lastIndex,i.push(n),n=null),i}return[]},se.prototype.getSelectionMap=function(){return this._selections},se.prototype.clearAllSelections=function(){if(this._count>0){return this._selections.length=0,this._count=0,this._anchor=-1,this._firstIndex=-1,this._lastIndex=-1,0}return 0},se.prototype.copyFrom=function(t,e,i,n){if(!(n<=0)){var o=e+i;if(null!=t)if(!1!==t.hasSelection(e,n)){for(var r=0;r<n;++r)t._selections[e+r]?this.select(o+r):this.deselect(o+r);this._anchor=-1,t._anchor>=0&&t._anchor>=e&&t._anchor<e+n&&(this._anchor=t._anchor+i)}else this.deselectRange(o,n);else this.deselectRange(o,n)}},se.prototype._select=function(t){return!this._selections[t]&&(this._selections[t]=!0,++this._count,!0)},se.prototype._findNextSelection=function(t){if(this._lastIndex>=0)for(;++t<=this._lastIndex;)if(this._selections[t])return t;return-1},se.prototype._findPrevSelection=function(t){if(this._firstIndex>=0)for(;--t>=this._firstIndex;)if(this._selections[t])return t;return-1},se.prototype._selections=null,se.prototype._count=0,se.prototype._anchor=-1,se.prototype._firstIndex=-1,se.prototype._lastIndex=-1;var ae=se,le=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)};le.prototype._func=null,le.prototype._delay=0,le.prototype._timerId=0,le.prototype._pending=!1,le.prototype.start=function(){this._func&&(this._timerId?this._pending=!0:this._timerId=setInterval(this._onInterval,this._delay))},le.prototype.dispose=function(){this._timerId&&(clearInterval(this._timerId),this._timerId=0),this._func=null},le.prototype._onInterval=function(){this._pending?this._pending=!1:(this._func(),clearInterval(this._timerId),this._timerId=0)},le._proto=le.prototype;var ue=le,he=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 ue(t._onRestingPosition,300),t._element.addEventListener("scroll",t._onTrackScroll),t._element.addEventListener("mouseover",t._flash),t._element.appendChild(t._trackContent),t.disableKeyboardInput(!1),t._onThicknessChanged=t._dispatch.bind(t,"thicknessChanged"),he._queryNativeTrackThickness(t._onThicknessChanged),t._updateEffectiveArea()||t.listen("thicknessChanged",t._updateEffectiveArea)};s.inherits(he,Ht),he.prototype._vertical=!0,he.prototype._step=0,he.prototype._parentNode=null,he.prototype._hostClassName="",he.prototype._trackContent=null,he.prototype._panes=null,he.prototype._paneSliders=null,he.prototype._enabled=!0,he.prototype._active=!1,he.prototype._isFrozen=!1,he.prototype._otherScrollbar=null,he.prototype._autoHideScrollbar=!0,he.prototype._trackSize=120,he.prototype._tContentSize=0,he.prototype._tScrollVal=0,he.prototype._tPercentVal=0,he.prototype._paneSize=0,he.prototype._pContentSize=0,he.prototype._pScrollVal=0,he.prototype._footerCount=0,he.prototype._fadingId=0,he.prototype._postponeFading=!1,he.prototype._layoutChanged=!1,he.prototype._contentDirty=!0,he.prototype._layoutDirty=!0,he.prototype._touchInput=!0,he.prototype._swiping=!1,he.prototype._touchDrag=!1,he.prototype._startPos,he.prototype._endPos,he.prototype._smoothing=!0,he.prototype._smoothingId=0,he.prototype._smoothingSpeed=0,he.prototype._wheelScrolling="",he.prototype._mouseWheelLogic=null,he.prototype._onThicknessChanged=null,he._trackThickness=0,he._queryTimeout=0,he._queryStarted=!1,he._outerDummy=null,he._innerDummy=null,he._listeners=null,he.prototype._updateEffectiveArea=function(){var t=this.getTrackThickness();if(t){var e=this._vertical?"width":"height";this._element.style[e]=t+1+"px"}return!!t},he._queryNativeTrackThickness=function(t){if(he._queryStarted||he._repeatQuery(),t&&he._trackThickness<=0){var e=he._listeners;e||(e=he._listeners=[]),e.push(t)}},he._repeatQuery=function(){he._queryStarted=!0,he._retrieveNativeTrackThinkness()||(he._queryTimeout+=100,he._queryTimeout<3e3?setTimeout(he._repeatQuery,he._queryTimeout):(he._trackThickness=13,he._clearStaticResources()))},he._retrieveNativeTrackThinkness=function(){if(he._trackThickness>0)return!0;var t=he._innerDummy,e=he._outerDummy;t||((t=he._innerDummy=document.createElement("p")).style.width="100%",t.style.height="200px",(e=he._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 n=t.offsetWidth;return i==n&&(n=e.clientWidth),document.body.removeChild(e),(he._trackThickness=i-n)>0&&(he._clearStaticResources(),!0)},he._clearStaticResources=function(){he._innerDummy=he._outerDummy=null;var t=he._listeners;if(t){he._listeners=null;for(var e={},i=t.length;--i>=0;)t[i](e)}},he.updateTrackThickness=function(){he._trackThickness=0,he._queryTimeout=0,he._queryStarted=!1,he._queryNativeTrackThickness()},he.prototype.dispose=function(){var t=he._listeners;if(t){var e=t.indexOf(this._onThicknessChanged);e>=0&&(t.splice(e,1),this._onThicknessChanged=null)}this.unlistenAll(),this._smoothingId&&(clearInterval(this._smoothingId),this._smoothingId=0),this._active=this._layoutChanged=!1,this._dispose();for(var i=this._panes.length;--i>=0;)this._panes[i].dispose(),this._paneSliders[i].dispose();this._reverter.dispose()},he.prototype.getContent=function(t){return this._paneSliders[0].getContent(t)},he.prototype.getParent=function(){return this._parentNode},he.prototype.setParent=function(t,e){var i=ot.getElement(t),n=this._parentNode!==i;n&&this._parentNode&&(this.removeWheelListener(this._parentNode),this._parentNode.classList.remove(this._hostClassName)),this.isActive()?(this._setParent(i,e),this._parentNode=this._element.parentNode,this._parentNode&&this._parentNode.classList.add(this._hostClassName)):this._parentNode=i,n&&this.addWheelListener(this._parentNode)},he.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"},he.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()},he.prototype._onEnablingStateChange=function(){var t=this;t._enabled?t._dispatch("enabled",{}):t._dispatch("disabled",{})},he.prototype.isActive=function(){return this._active},he.prototype.isEnabled=function(){return this._enabled},he.prototype.enable=function(t){t=!1!==t,this._enabled!=t&&(this._enabled=t,this._updateLayout(),this._onEnablingStateChange())},he.prototype.disable=function(t){this.enable(!1===t)},he.prototype.getTrackSize=function(){return this._trackSize},he.prototype.getPaneSize=function(){return this._paneSize},he.prototype.getContentSize=function(){return this._pContentSize},he.prototype.getTrackThickness=function(){return he._trackThickness},he.prototype.getScrollGap=function(){return this._pContentSize-this.getPaneSize()},he.prototype.setTrackSize=function(t,e){this._trackSize=t>0?t:0,this._paneSize=e>0?e:0},he.prototype.calculateContentSize=function(){return 0},he.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)},he.prototype.invalidate=function(t,e){this._contentDirty=!0,this._layoutDirty=!0,null!=e&&(this._pScrollVal=e),t&&this.update()},he.prototype.invalidateContent=function(){this._contentDirty=!0},he.prototype.isScrollPosValid=function(t){var e=t-this.getPaneSize(),i=this._pScrollVal;return 0===i||i>0&&e>0&&i<e},he.prototype.flash=function(){this.update(),this._flash()},he.prototype._scroll=function(t){this._scrollTo(this._pScrollVal+t)},he.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",{})}},he.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)},he.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},he.prototype._setTrackScrollVal=function(t){var e=this._getTrackGap(),i=0;if(e>0){if(t>0){var n=this.getScrollGap();i=e===n?t:t/n*e,i=Math.round(i)}i>=e&&(i=e)}if(i!==this._tScrollVal){this._tScrollVal=i,this._tPercentVal=e?i/e:0;var o=this._element;return this._vertical?o.scrollTop=i:o.scrollLeft=i,!0}return!1},he.prototype._getTrackGap=function(){var t=this._tContentSize-this.getTrackSize();return t>0?t:0},he.prototype._getScrollValue=function(){return this._pScrollVal},he.prototype._isEndOfScroll=function(){return!this._active||this._pScrollVal>=this.getScrollGap()},he.prototype._isStartOfScroll=function(){return!this._pScrollVal},he.prototype._isOnEdge=function(t){return t<0&&this._isStartOfScroll()||t>0&&this._isEndOfScroll()},he.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)))},he.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)}},he.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))},he.prototype.disableTouchInput=function(t){this._touchInput=!1===t},he.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))},he.prototype.getAutoHide=function(){return this._autoHideScrollbar},he.prototype.setOtherScrollbar=function(t){this._otherScrollbar=t},he.prototype.setFooterCount=function(t){this._footerCount=t},he.prototype._calcActiveState=function(){if(this._enabled&&this.getTrackSize()>20){var t=this.getPaneSize();if(t>0)return this._pContentSize-t>0}return!1},he.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 n=this._panes.length;--n>=0;)this._panes[n].setWidth(i)}this._scrollTo(this._pScrollVal,!0)}},he.prototype.resetPaneSize=function(){for(var t=this._vertical?"height":"width",e=this._panes.length;--e>=0;)this._panes[e].setStyle(t,"")},he._preventVScrolling=function(t){t.currentTarget.scrollTop=0},he._preventHScrolling=function(t){t.currentTarget.scrollLeft=0},he.prototype._addPaneAt=function(t){null==t&&(t=this._panes.length);var e=this._panes[t];if(!e){if((e=new Ht(document.createElement("div"))).setClass("grid-pane"),this._vertical?(e.addClass("sections"),e.listen("scroll",he._preventVScrolling)):(e.addClass("columns"),e.listen("scroll",he._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 n=new Ht(document.createElement("div"));n.setClass("grid-pane-slider"),n.setParent(e),this._panes[t]=e,this._paneSliders[t]=n}return e},he.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))},he.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))},he.prototype._onRestingPosition=function(){this._setSliderPosition(-this._pScrollVal,!0)},he.prototype._setSliderPosition=function(t,e){var i="",n="",o=this._vertical?"top":"left";t&&(e?n=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],a=s.getElement().style;s._titleSection?a[o]=t+"px":(a.transform=i,a[o]=n)}e?this._dispatch("scrollEnd",{}):this._dispatch("scrollStart",{})},he.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)}},he.prototype._onKeyDown=function(t){if(this._isFrozen)ot._preventDefault(t);else if(this._active){if(this._vertical?38===t.keyCode||40===t.keyCode:37===t.keyCode||39===t.keyCode){var e=this.getScrollGap(),i=Math.round(.07*e);i<10?i=10:i>100&&(i=100),37!==t.keyCode&&38!==t.keyCode||(i*=-1),this._scroll(i),ot._preventDefault(t)}}},he.prototype._onTouchStart=function(t){this._isFrozen?ot._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))},he.prototype._onTouchMove=function(t){var e=this;if(e._isFrozen)ot._preventDefault(t);else if(e._swiping&&e._active&&e._touchInput&&!(t.touches&&t.touches.length>1)){var i=e._startPos,n=e._endPos;e._getTouchInfo(t,n);var o=this._vertical?i.y-n.y:i.x-n.x;if(!(o>-5&&o<5||e._isOnEdge(o))){if(e._touchDrag)e._scrollTo(i.scrollValue+o);else n.timeStamp-i.timeStamp>30&&(e._touchDrag=!0);t.cancelable&&t.preventDefault()}}},he.prototype._onTouchEnd=function(t){if(this._isFrozen)ot._preventDefault(t);else if(this._swiping=!1,this._touchDrag&&(this._touchDrag=!1,t.cancelable&&t.preventDefault(),this._smoothing&&!this._smoothingId)){var e=this._startPos,i=this._getTouchInfo(t,this._endPos),n=i.timeStamp-e.timeStamp,o=this._vertical?e.y-i.y:e.x-i.x;this._smoothingSpeed=30*o/n,(this._smoothingSpeed>10||this._smoothingSpeed<-10)&&(this._smoothingId=setInterval(this._smoothScroll,25))}},he.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},he.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)},he.prototype.disableMouseWheel=function(t){!1===t?this.setMouseWheelLogic(this._mouseWheelLogic||this._onMouseWheel):this.setMouseWheelLogic(null)},he.prototype.setMouseWheelLogic=function(t){this.removeWheelListener(this._parentNode),this._mouseWheelLogic=t,this._mouseWheelLogic&&this.addWheelListener(this._parentNode)},he.prototype.addWheelListener=function(t){t&&this._mouseWheelLogic&&t.addEventListener("wheel",this._mouseWheelLogic,!1)},he.prototype.removeWheelListener=function(t){t&&this._mouseWheelLogic&&t.removeEventListener("wheel",this._mouseWheelLogic,!1)},he.prototype.setMouseWheelSpeed=function(t){this._wheelScrolling="string"==typeof t?t:""},he.prototype.getMouseWheelSpeed=function(){return this._wheelScrolling},he.prototype.getDefaultMouseWheelLogic=function(){return this._onMouseWheel},he.prototype._onMouseWheel=function(t){if(!t.target.opened)if(this._isFrozen)ot._preventDefault(t);else if(!t.ctrlKey&&!t.altKey&&this.isActive()){var e=this._vertical?t.deltaY:t.deltaX;if(e&&!this._isOnEdge(e)){if(ot._preventDefault(t),t.deltaMode&&(e=e>0?100:-100),"linear"!=this._wheelScrolling){var i=this.getContentSize();i>=4e3&&(e*=1+i/4e3|0)}this.update(),this._scroll(e)}}},he.prototype.setScrollingStep=function(t){this._step=t>0?t:0},he.prototype.freezeScrolling=function(t){var e=this._isFrozen;return this._isFrozen=!1!==t,e},he.prototype.restoreTrackPosition=function(){var t=this._element;this._vertical&&(t.scrollTop=this._tScrollVal,t.scrollTop&&(this._tScrollVal=t.scrollTop))},he._proto=he.prototype;var pe=he,de=function(){var t=this;t._vertical=!1,t._onDeactivated=t._onDeactivated.bind(t),t._onActivated=t._onActivated.bind(t),t._hostClassName="hscrollbar-host",de.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)};s.inherits(de,pe),de.prototype._pinnedLeftColumnCount=0,de.prototype._pinnedRightColumnCount=0,de.prototype.setScrollContent=function(t,e,i,n){this._clearAllPanes();var o=e.length;if(!(o<=0)){this._pinnedLeftColumnCount=i>=0?i:0,this._pinnedRightColumnCount=n>0?n:0;var r=e[0],s=r.getColumnCount(),a=s-n;(!a||a<0)&&(a=s);for(var l=0;l<o;++l){r=e[l];var u,h,p=this._addPaneAt(l),d=this._paneSliders[l],c=p.getElement(),_=d.getElement();for(u=0;u<i;++u)(h=r.getColumn(u)).setScrollState(c,null,!1);p.setParent(r.getColumnHost());var f=[],g=[];for(u=i;u<a;++u)(h=r.getColumn(u)).setScrollState(null,_,this.isActive()),f.push(h),g.push(h.getElement());for(u=a;u<s;++u)(h=r.getColumn(u)).setScrollState(null,null,!1);var y=r.getReservedSpace();y&&(this._pinnedRightColumnCount||(d.addContent(y),g.push(y)),r._updateRightSpaceStyle()),r._updateLayers(),d._titleSection=r.hasClass("title"),d._columns=f,d._content=g}this.invalidateContent()}},de.prototype.setWidth=function(t){return this.setTrackSize(t,t),!0},de.prototype.getWidth=function(){return this.getPaneSize()},de.prototype.getScrollLeft=function(){return this._getScrollValue()},de.prototype.setScrollLeft=function(t){this.update(),this._scrollTo(t)},de.prototype.getPinnedLeftColumnCount=function(){return this.isEnabled()?this._pinnedLeftColumnCount:0},de.prototype.getPinnedRightColumnCount=function(){return this.isEnabled()?this._pinnedRightColumnCount:0},de.prototype.setPaneLeft=function(t){for(var e=t&&this.isActive()?-t+"px":"",i=this._panes.length;--i>=0;)this._paneSliders[i].setStyle("marginLeft",e)},de.prototype.isEndOfHorizontalScroll=function(){return this._isEndOfScroll()},de.prototype.getContentWidth=function(){var t=this._paneSliders[0],e=0;if(t)for(var i=t._content,n=i.length;--n>=0;){var o=i[n],r=o?o.style.width:0;r&&(e+=parseFloat(r))}return e},de.prototype.calculateContentSize=function(){return this.getContentWidth()},de.prototype.getTrackSize=function(){return this._footerCount<=0&&this._otherScrollbar&&this._otherScrollbar.isActive()&&!this._pinnedRightColumnCount?this._trackSize-this.getTrackThickness():this._trackSize},de.prototype._onActivated=function(t){this._updateActivation(!0)},de.prototype._onDeactivated=function(t){this._updateActivation(!1)},de.prototype._updateActivation=function(t){for(var e=this._paneSliders.length,i=0;i<e;++i)for(var n=this._paneSliders[i]._columns,o=n?n.length:0,r=0;r<o;++r){var s=n[r];s.getElement()&&s.enableAbsolutePosition(t)}},de._proto=de.prototype;var ce=de,_e=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 qt,e._trackY=new qt,e._trackX.setDefaultLaneSize(100),e._trackY.setDefaultLaneSize(32),e._cellSpans=new re,e._element=document.createElement("div"),e._element.className="tr-lg tr-even-shading",e._ctxRows=new Qt,e._columns=[],e._cells=[],e._highlightedCells=[],e._stretchedCells=new ee(e._trackX,e._trackY,e),e._selectionList=new ae,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")};s.inherits(_e,Ht),_e.prototype._index=-1,_e.prototype._availableRowCount=0,_e.prototype._activeRow=0,_e.prototype._activeRowEnd=0,_e.prototype._colCount=0,_e.prototype._rowCount=0,_e.prototype._hiddenRowCount=0,_e.prototype._trackX,_e.prototype._trackY,_e.prototype._cellSpans,_e.prototype._columns,_e.prototype._firstColumn,_e.prototype._lastColumn,_e.prototype._rightSpace,_e.prototype._rightSpaceSize=0,_e.prototype._frozenLayout=!1,_e.prototype._rowHighlightEnabled=!1,_e.prototype._rowHighlightIndex=-1,_e.prototype._highlightedCells,_e.prototype._coverLayer=null,_e.prototype._stretchedCells=null,_e.prototype._ctx=null,_e.prototype._selectionList,_e.prototype._colVir=!1,_e.prototype._initialized=!1,_e.prototype._hidingMethod="",_e.prototype._virOwner=null,_e.prototype._transformIETimer=0,_e.prototype._ctxRows,_e.prototype._boundLayer=null,_e.prototype._colBounds=null,_e.prototype._colBoundCache=null,_e.prototype._colSelDirty=!1,_e.prototype._hscrollbar=null,_e.prototype._leftColumnSeparator=null,_e.prototype._rightColumnSeparator=null,_e.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._colBounds=this._colBoundCache=null,this._colSelDirty=!1,this._highlightedCells.length=0,this._ctx=null,this._hscrollbar=null,this._dispose()},_e.prototype.getWidth=function(){return this.isVisible()?this._getWidth():0},_e.prototype._getWidth=function(){return this.getContentWidth()+this._rightSpaceSize},_e.prototype.setWidth=function(t){return!(t<0)&&(null!=this._trackX.setTrackSize(t-this._rightSpaceSize)&&(this._syncLayoutToColumns(0),!0))},_e.prototype.getHeight=function(){return this.isVisible()?this.getContentHeight():0},_e.prototype.setHeight=function(t){return!(t<0)&&(null==this._trackY.setTrackSize(t)||this._syncLayoutToRows(0,this._rowCount),!0)},_e.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._trackY.show(t),this.setFrozenLayout(!1===t),this._dispatchRowHeightChangedEvent(0,this._rowCount)},_e.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 n=this._trackX.hitTest(t);if(n<0)return null;var o=this._trackY.hitTest(e);if(o<0)return null;var r={};if(r.colIndex=n,r.rowIndex=o,!0!==i){var s=this._cellSpans.getOccupyingSpan(n,o);s&&(r.colIndex=s.indexX,r.rowIndex=s.indexY)}return r},_e.prototype.hitTestX=function(t){return t<0?-1:t>=this.getContentWidth()?~this._colCount:this._trackX.hitTest(t)},_e.prototype.hitTestY=function(t){return t<0?-1:t>=this.getHeight()?~this._rowCount:this._trackY.hitTest(t)},_e.prototype.getDefaultColumnWidth=function(){return this._trackX.getDefaultLaneSize()},_e.prototype.setDefaultColumnWidth=function(t){this._trackX.getDefaultLaneSize()!==t&&(this._trackX.setDefaultLaneSize(t),this._syncLayoutToColumns(0))},_e.prototype.getDefaultRowHeight=function(){return this._trackY.getDefaultLaneSize()},_e.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)}},_e.prototype.getColumnWidth=function(t){return this._trackX.getLaneSize(t)},_e.prototype.setColumnWidth=function(t,e){return!!this._setColumnWidth(t,e)&&(this._syncLayoutToColumns(t),!0)},_e.prototype._setColumnWidth=function(t,e){return this._trackX.setLaneSize(t,e)},_e.prototype._updateColumnLayout=function(){this._syncLayoutToColumns(0)},_e.prototype._startBindingSession=function(t){},_e.prototype._getTempRowHeights=function(){return null},_e.prototype.getRowHeight=function(t){return this._trackY.getLaneSize(t)},_e.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},_e.prototype._updateRowHeights=function(t,e){for(var i=0,n=0;n<this._rowCount;++n){var o=t.getLaneSize(e);i|=this._trackY.setLaneSize(n,o),++e}return this._syncLayoutToRows(0,this._rowCount),i},_e.prototype.isColumnVisible=function(t){return this._trackX.isLaneVisible(t)},_e.prototype.hideColumn=function(t,e){return this.setColumnVisibility(t,!1===e,0)},_e.prototype.isRowVisible=function(t){return this._trackY.isLaneVisible(t)},_e.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)},_e.prototype.getMinimumColumnWidth=function(t){return this._trackX.getMinimumLaneSize(t)},_e.prototype.setMinimumColumnWidth=function(t,e){return!!this._trackX.setMinimumLaneSize(t,e)&&(this._syncLayoutToColumns(t),!0)},_e.prototype.getMinimumRowHeight=function(t){return this._trackY.getMinimumLaneSize(t)},_e.prototype.setMinimumRowHeight=function(t,e){return!!this._trackY.setMinimumLaneSize(t,e)&&(this._syncLayoutToRows(t,this._rowCount),this._dispatchRowHeightChangedEvent(t,t+1),!0)},_e.prototype.getCellLeft=function(t){return this._trackX.getLaneStart(t)},_e.prototype.getCellTop=function(t){return this._trackY.getLaneStart(t)},_e.prototype.getCellWidth=function(t,e){var i=this._cellSpans.getOccupyingSpan(t,e);if(i){var n=this._trackX.getLaneStart(i.indexX);return this._trackX.getLaneEnd(i.indexX+i.colSpan-1)-n}return this.getColumnWidth(t)},_e.prototype.getCellHeight=function(t,e){var i=this._cellSpans.getOccupyingSpan(t,e);if(i){var n=this._trackY.getLaneStart(i.indexY);return this._trackY.getLaneEnd(i.indexY+i.rowSpan-1)-n}return this.getRowHeight(e)},_e.prototype.hasCellSpan=function(){return this._cellSpans.hasSpan()},_e.prototype.getCellRowSpan=function(t,e){return this._cellSpans.getRowSpan(t,e)},_e.prototype.setCellRowSpan=function(t,e,i){var n=this._cellSpans.setRowSpan(t,e,i);if(this._updateCellSpanSize(t,e,n),n)return n.retVal>=0?this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,!0):n.colSpan>1?(this._updateCellSpanClass(t,e,n.colSpan,n.prevRowSpan,!1),this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,!0)):this._updateCellSpanClass(t,e,n.colSpan,n.prevRowSpan,!1),0!==n.retVal;var o=this._getCell(t,e);return o&&o._rowSpan>1&&this._updateCellSpanClass(t,e,o._colSpan,o._rowSpan,!1),!1},_e.prototype.getCellColSpan=function(t,e){return this._cellSpans.getColSpan(t,e)},_e.prototype.setCellColSpan=function(t,e,i){var n=this._cellSpans.setColSpan(t,e,i);if(this._updateCellSpanSize(t,e,n),n)return n.retVal>=0?this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,!0):n.colSpan>1?(this._updateCellSpanClass(t,e,n.prevColSpan,n.rowSpan,!1),this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,!0)):this._updateCellSpanClass(t,e,n.prevColSpan,n.rowSpan,!1),0!==n.retVal;var o=this._getCell(t,e);return o&&o._colSpan>1&&this._updateCellSpanClass(t,e,o._colSpan,o._rowSpan,!1),!1},_e.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},_e.prototype.clearColumnSpans=function(t){var e=this._cellSpans.removeSpanByColIndex(t);if(null==e)return!1;for(var i=e.length;--i>=0;){var n=e[i];this._updateCellSpan(n.indexX,n.indexY,n,!1)}return!0},_e.prototype.clearColumnCustomizations=function(){this._trackX.clearLaneCustomizations(),this._syncLayoutToColumns(0)},_e.prototype.clearRowCustomizations=function(){this._trackY.clearLaneCustomizations(),this._syncLayoutToRows(0,this._rowCount)},_e.prototype.getColumnScalability=function(t){return this._trackX.getLaneScalability(t)},_e.prototype.setColumnScalability=function(t,e){return this._trackX.setLaneScalability(t,e)},_e.prototype.getRowScalability=function(t){return this._trackY.getLaneScalability(t)},_e.prototype.setRowScalability=function(t,e){return this._trackY.setLaneScalability(t,e)},_e.prototype.getCell=function(t,e,i){if(i&&this._cellSpans.hasSpan()){var n=this._cellSpans.getColSpan(t,e),o=this._cellSpans.getRowSpan(t,e);n<0&&(t+=n),o<0&&(e+=o)}return this._getCell(t,e)},_e.prototype.getCellContent=function(t,e){var i=this.getCell(t,e);return null!==i?i.getContent():null},_e.prototype.setCellContent=function(t,e,i){var n=this.getCell(t,e);return null==n?(window.console.log("Error: Accessing nonexistent cell in Grid's Table"),null):n.setContent(i)},_e.prototype.getColumnCount=function(){return this._colCount},_e.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,n=null;if(e>t)for(i=e;--i>=t;)(n=this._columns.pop()).dispose(),n===this._firstColumn&&(this._firstColumn=null),n===this._lastColumn&&(this._lastColumn=null);else for(i=e;i<t;++i)n=this._newColumn(i);for(this._updateColumnIndices(),i=e;i<t;++i)this._columns[i].activate(!this._colVir);t<=0&&this._selectionList.clearAllSelections()}},_e.prototype.getRowCount=function(){return this._rowCount},_e.prototype.setRowCount=function(t,e){if(t<0&&(t=0),this._rowCount!==t){var i,n=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(n>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 o=t;o<n;++o)this._selectionList.deselect(o);else this._selectionList.clearAllSelections();else this._syncLayoutToRows(n,t);var r={};r.prevCount=n,r.rowCount=this._rowCount,this._dispatch("rowCountChanged",r),n<t&&this._insertCells(0,this._rowCount)}},_e.prototype.getVisibleRowCount=function(){return this._rowCount-this._hiddenRowCount},_e.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))},_e.prototype.removeRow=function(t){t<=0||(t>this._rowCount&&(t=this._rowCount),this.setRowCount(this._rowCount-t))},_e.prototype.setBorders=function(t,e,i,n){},_e.prototype.getColumnStyle=function(t,e){var i=this._columns[t];return i?i.getStyle(e):null},_e.prototype.setColumnStyle=function(t,e,i){var n=this._columns[t];n&&n.setStyle(e,i)},_e.prototype.enableColumnClass=function(t,e,i){var n=this._columns[t];n&&n.enableClass(e,i)},_e.prototype.hasColumnClass=function(t,e){var i=this._columns[t];return!!i&&i.hasClass(e)},_e.prototype.enableRowClass=function(t,e,i){if(t>=0&&t<this._rowCount)for(var n=0;n<this._colCount;++n)this._columns[n].getCell(t).enableClass(e,i)},_e.prototype.setRowStyle=function(t,e,i,n){if(t>=0&&t<this._rowCount){i&&(null==n||n)||(i="");for(var o=0;o<this._colCount;++o)this._columns[o].getCell(t).setStyle(e,i)}},_e.prototype.getRelativePosition=function(t){return ot.getRelativePosition(t,this._element)},_e.prototype.getContentWidth=function(){return this._trackX.getTrackSize()},_e.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},_e.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},_e.prototype.disableHorizontalGridLine=function(t){this.enableClass("no-horizontal-grid-line",!1!==t)},_e.prototype.disableVerticalGridLine=function(t){this.enableClass("no-vertical-grid-line",!1!==t)},_e.prototype.enableShading=function(t){!1!==t?this.addClass("tr-even-shading"):(this.removeClass("tr-even-shading"),this.removeClass("tr-odd-shading"))},_e.prototype.setTransposedShading=function(t){this.enableClass("transposed-shading",!1!==t)},_e.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)))},_e.prototype.getRowHighlight=function(){return this._rowHighlightIndex},_e.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 n=this._colCount;--n>=0;){var o=this._columns[n].getCell(t);this._highlightedCells[n]=o,o.addClass("highlighted-row")}var r=this.getStretchedCell(t);r&&(this._highlightedCells.push(r),r.addClass("highlighted-row"))}else this._highlightedCells.length=0;if(this._hasListener("rowHighlighted")){var s={};s.prevRowIndex=e,s.rowIndex=t,this._dispatch("rowHighlighted",s)}}},_e.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},_e.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},_e.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},_e.prototype.setSelectedRow=function(t,e){t<0||t>=this._rowCount||(this._selectionList.setSelection(t,e),this._updateSelectionUI(t))},_e.prototype.selectSingleRow=function(t){t<0||t>=this._rowCount||(this.clearSelectedRows(),this._selectionList.select(t),this._addSelectionUI(t))},_e.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)}},_e.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},_e.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},_e.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},_e.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},_e.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},_e.prototype.activateColumn=function(t,e){var i=this._columns[t];if(i){var n=i.activate(e);if(e&&n&&this._rightSpace){var o=this._rightSpace.parentNode;o&&o.appendChild(this._rightSpace)}}},_e.prototype.activateRows=function(){this._onEnterDocument()},_e.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)},_e.prototype.getFirstIndexInView=function(){return 0},_e.prototype.getLastIndexInView=function(){return this._availableRowCount-1},_e.prototype.isInCurrentView=function(t){return 0!==this._rowCount&&(t>=0&&t<this._rowCount)},_e.prototype.getFrozenLayout=function(){return this._frozenLayout},_e.prototype.setFrozenLayout=function(t){this.isVisible()||(t=!0),this._frozenLayout!==t&&(this._frozenLayout=t,this._cellSpans.freezeMapping(this._frozenLayout),this._frozenLayout||(this._syncLayoutToColumns(0),this._syncLayoutToRows(0,this._rowCount),this._dispatchRowHeightChangedEvent(0,this._rowCount)))},_e.prototype.getColumn=function(t){return this._columns[t]||null},_e.prototype.insertColumn=function(t,e){t<0?t=0:t>this._colCount&&(t=this._colCount);var i=t<this._colCount,n=this._cellSpans.getAllSpans();this._updateCellSpans(n,!1),this._trackX.insertLane(t,e),this._colCount=this._trackX.getLaneCount();var o=this._newColumn(t);if(this._updateColumnIndices(),this._cellSpans.shiftColumn(t,1)&&(n=this._cellSpans.getAllSpans()),this._updateCellSpans(n,!0),this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._selectionList.getSelectionCount())for(var r=this._selectionList.getAllSelections(),s=r.length;--s>=0;){var a=o.getCell(r[s]);a&&a.addClass("selected-row")}return o.activate(i||!this._colVir),o},_e.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 n=this._columns.splice(t,1)[0];return n.dispose(),e.control=n,this._updateColumnIndices(),this._cellSpans.removeColumn(t)&&(i=this._cellSpans.getAllSpans()),this._updateCellSpans(i,!0),this._syncLayoutToColumns(t),t>=this._colCount&&this._updateCssWidth(),e},_e.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 i=this._cellSpans.getAllSpans();this._updateCellSpans(i,!1),this._trackX.moveLane(t,e);var n=this._columns[t];if(ot.moveArrayItem(this._columns,t,e),n.getElement().offsetParent){for(var o=e+1,r=this._columns[o]||null;r&&!r.getElement().offsetParent;)r=this._columns[++o];n.insertBefore(r)}this._updateColumnIndices(),this._updateCellSpans(i,!0);var s=t<e?t:e;this._syncLayoutToColumns(s)}},_e.prototype.enableRowVirtualization=function(){console.log("WARNING: This function is deprecated")},_e.prototype.enableColumnVirtualization=function(t){this._colVir=!1!==t},_e.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},_e.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},_e.prototype.getIndex=function(){return this._index},_e.prototype.setIndex=function(t){this._index=t},_e.prototype.getRowOffset=function(){return this._rowOffset},_e.prototype.setRowOffset=function(t){this._rowOffset=t},_e.prototype.updateLayout=function(){this._calculateViewSize(!0),this._stretchedCells.updateCells(),this._updateRightSpaceStyle()},_e.prototype.stretchCell=function(t,e,i,n){var o=-1;if("number"==typeof t?(o=t,null==e&&(e=0)):t&&(t.stretched?(o=this._stretchedCells.getColumnIndex(t),null==e&&(e=this._stretchedCells.getRowIndex(t))):t.getParent&&(o=this.getColumnIndex(t.getParent()))),o<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,n?o:0)).setParent(s)}else r=this._stretchedCells.unstretchCell(e);if(r){var a=this._selectionList.getSelection(e);r.enableClass("selected-row",a)}return r},_e.prototype.unstretchCell=function(t,e){return this.stretchCell(t,e,!1)},_e.prototype.unstretchAllCells=function(){this._stretchedCells.unstretchAllCells()},_e.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},_e.prototype.getStretchedCells=function(){return this._stretchedCells.getCells()},_e.prototype.updateStretchedCells=function(){this._updateLayers();var t=this._coverLayer?this._coverLayer.children.length:0;return!(t<=0)&&(this._calculateViewSize(!0),this._stretchedCells.updateCells(),!!t)},_e.prototype._calculateViewSize=function(t){if(this._frozenLayout)return this._stretchedCells.getStretchSize();var e=this._ctx,i=t?0:this._stretchedCells.getStretchSize();if(!i&&e&&e.getWidth){var n=this.getContentWidth();return(i=e.getWidth())?(n<i&&(i=n),this._stretchedCells.setStretchSize(i),i):n}return i},_e.prototype._enableStretchCellClass=function(t,e,i){var n=this.getStretchedCell(t);n&&n.enableClass(e,i)},_e.prototype._getViewSize=function(){return this._calculateViewSize()},_e.prototype.getColumnHost=function(){return this._element},_e.prototype.setHidingMethod=function(t){this._hidingMethod=t},_e.prototype.getHidingMethod=function(){return this._hidingMethod},_e.prototype.setColumnVisibility=function(t,e,i){return!!this._trackX.hideLane(t,!e,i)&&(this._syncLayoutToColumns(t),!0)},_e.prototype.getRowLayout=function(){return this._trackY},_e.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},_e.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")}},_e.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)},_e.prototype.getReservedSpace=function(){return this._rightSpace},_e.prototype.getComputedStyle=function(){var t=this._element;return t.offsetParent?getComputedStyle(t):null},_e.prototype.isColumnActive=function(t){var e=this._columns[t];return!!e&&e.isActive()},_e.prototype.setRowAttributes=function(t,e){if(!(t<0||t>=this._rowCount))for(var i=0;i<this._colCount;++i)for(var n=e(i),o=n.length;--o>=0;){var r=n[o],s=this._columns[i].getCell(t);s&&(r.remove?s.removeAttribute(r.attribute):s.setAttribute(r.attribute,r.value))}},_e.prototype.getContextRow=function(t){return this._ctxRows.getItem(t)},_e.prototype.selectColumn=function(t,e){(this.enableColumnClass(t,"selected-column",e),e)&&(this._colSelDirty=!0,this._boundLayer||(this._initBoundLayer(),this._updateLayers()))},_e.prototype.isSelectedColumn=function(t){return this.hasColumnClass(t,"selected-column")},_e.prototype.selectCell=function(t,e,i){var n=this._getCell(t,e);n&&n.enableClass("selection",i)},_e.prototype.setCellBounds=function(t,e,i,n){},_e.prototype.getHorizontalLayout=function(){return this._trackX},_e.prototype.calculateColumnBounds=function(t,e,i,n){var o=0,r=0,s=!1,a=!1,l=this._trackX.getLaneCount();if(t>=0&&(o=this._trackX.getLaneStart(t),r=this._trackX.getLaneEnd(e)),o<r){var u,h,p=0,d=0,c=0,_=0;this._hscrollbar&&(d=this._hscrollbar.getScrollLeft(),c=this._hscrollbar.getPinnedLeftColumnCount(),_=this._hscrollbar.getPinnedRightColumnCount()),u=h=this._trackX.getTrackSize(),c&&(p=this._trackX.getLaneStart(c)),_&&(l-=_,u=this._getViewSize()-h+this._trackX.getLaneStart(l)),t>=c&&t<l?(o-=d)<p?(o=p,s=!0):o>u&&(o=u,s=!0):t>=l&&(o=this._getViewSize()-h+this._trackX.getLaneStart(t)),e>=c&&e<l?(r-=d)<p?(r=p,a=!0):r>u&&(r=u,a=!0):e>=l&&(r=this._getViewSize()-h+this._trackX.getLaneEnd(e))}i[0]=o,i[1]=r,n[0]=s,n[1]=a},_e.prototype.updateColumnBounds=function(t,e,i){if(this._colSelDirty){var n=this._colBounds,o=this._colBoundCache;n||(n=this._colBounds=[]),o||(o=this._colBoundCache=[]);var r,s=t.length,a=null,l=null,u=n.length;for(r=s;r<u;++r)(a=(l=n[r]).parentNode)&&a.removeChild(l);if(n.length=u=s,s)for(r=0;r<s;++r){var h=t[r],p=e[r],d=h[0],c=h[1];(l=o[r])||((l=o[r]=document.createElement("div")).className="selection-bound column-bound"),l.style.left=d+"px",l.style.width=c-d+"px",i=i||0,l.style.top=i+"px",l.style.height=this._trackY.getTrackSize()-i+"px",l.classList.toggle("no-left-bound",p[0]),l.classList.toggle("no-right-bound",p[1]),this._boundLayer&&(n[r]||(n[r]=l,this._boundLayer.appendChild(l)))}else this._colSelDirty=!1}},_e.prototype.updateColumnSeparators=function(){var t=this._hscrollbar.getPinnedLeftColumnCount(),e=this._hscrollbar.getPinnedRightColumnCount();!t&&!e||this._boundLayer||this._initBoundLayer();var i=!1;this._hscrollbar&&(i=this._hscrollbar.isActive());var n=this._boundLayer,o=this._leftColumnSeparator;if(i&&t){o||(o=this._leftColumnSeparator=this._createColumnSeparator()),o.parentNode||(n.children.length?n.insertBefore(o,n.children[0]):n.appendChild(o));var r=this._trackX.getLaneStart(t);o.style.left=r-1+"px",o.style.height=this._trackY.getTrackSize()+"px"}else o&&o.parentNode&&this._boundLayer.removeChild(o);if(o=this._rightColumnSeparator,i&&e){o||(o=this._rightColumnSeparator=this._createColumnSeparator()),o.parentNode||(n.children.length?n.insertBefore(o,n.children[0]):n.appendChild(o));var s=this.getColumnCount(),a=this._trackX.getLaneEnd(s-1)-this._trackX.getLaneStart(s-e),l=this._getViewSize();o.style.left=l-a-this._rightSpaceSize+"px",o.style.height=this._trackY.getTrackSize()+"px"}else o&&o.parentNode&&this._boundLayer.removeChild(o)},_e.prototype._createColumnSeparator=function(){var t=document.createElement("div");return t.classList.add("column-separator"),t},_e.prototype._initBoundLayer=function(){var t=this._boundLayer;return t||((t=this._boundLayer=document.createElement("div")).className="cover-layer",this._element.appendChild(t)),t},_e.prototype._getCell=function(t,e){var i=this._columns[t];return i?i.getCell(e):null},_e.prototype._insertCells=function(t,e){this._activeRow=t,this._activeRowEnd=e;for(var i=this._trackY.getLaneStart(t),n=0;n<this._colCount;++n){var o=this._columns[n];o.hasCollapsedCells()||o.setTop(i),o.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)}},_e.prototype._newColumn=function(t){var e=new Kt(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 n=this._columns[t+1];e.insertBefore(n)}return e},_e.prototype._updateCssWidth=function(){this._frozenLayout||(this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._element.style.width=this._getWidth()+"px")},_e.prototype._updateViewHeight=function(){if(!this._frozenLayout){var t=this.getContentHeight();this._element.style.height=t+"px",this._rightSpace&&(this._rightSpace.style.height=t+"px")}},_e.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 n=null,o=this._columns.length;--o>=0;){var r=this._columns[o];r.setNextSibling(n),n=r}},_e.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},_e.prototype._syncLayoutToRows=function(t,e){if(!this._frozenLayout){for(var i=t;i<e;++i)for(var n=this._trackY.isAtDefaultSize(i)?-1:this._trackY.getLaneSize(i),o=0;o<this._colCount;++o)this._columns[o].getCell(i).setHeight(n);this._stretchedCells.updateYAxis(),t?this._updateCellSpanLayout(this._cellSpans.getAllSpans()):this._updateCellSpans(this._cellSpans.getAllSpans(),!0),this._updateViewHeight()}},_e.prototype._dispatchRowHeightChangedEvent=function(t,e){if(this._hasListener("rowHeightChanged")&&!(t>=e)){var i={};i.rowIndex=t,i.changeLength=e-t,this._dispatch("rowHeightChanged",i)}},_e.prototype._updateCellSpanSize=function(t,e,i){var n=this._getCell(t,e);if(null!=n)if(i&&i.colSpan>1?(n.setWidth(this.getCellWidth(t,e)),this._columns[t].disableDeactivation()):n.setWidth(-1),i&&i.rowSpan>1)n.setHeight(this.getCellHeight(t,e));else{var o=this._trackY.isAtDefaultSize(e)?-1:this._trackY.getLaneSize(e);n.setHeight(o)}},_e.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)}},_e.prototype._updateCellSpan=function(t,e,i,n){this._updateCellSpanSize(t,e,n?i:null),this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,n)},_e.prototype._updateCellSpanClass=function(t,e,i,n,o){for(var r,s=0;s<i&&(r=this._columns[t+s]);++s)r.collapseCells(e,n,o,0===s,s>0);var a=this._getCell(t,e);a&&(a._colSpan=o?i:1,a._rowSpan=o?n:1)},_e.prototype._updateCellSpans=function(t,e){if(null!=t)for(var i=t.length;--i>=0;){var n=t[i];this._updateCellSpan(n.indexX,n.indexY,n,e)}},_e.prototype._onMouseMove=function(t){var e=t.target,i=ot.closestElement(e,"cell"),n=this._stretchedCells.getColumnIndex(i);if(n<0){var o=ot.closestElement(e,"column");n=this.getColumnIndex(o)}var r=this.getCellIndex(n,i);this.setRowHighlight(r)},_e.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)},_e.prototype._updateSelectionUI=function(t){var e=this._selectionList.getSelection(t);this._enableStretchCellClass(t,"selected-row",e),this.enableRowClass(t,"selected-row",e)},_e.prototype._addSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!0),this.enableRowClass(t,"selected-row",!0)},_e.prototype._removeSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!1),this.enableRowClass(t,"selected-row",!1)},_e.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}},_e.prototype._setContext=function(t){this._ctx=t},_e.prototype._getContext=function(){return this._ctx},_e.prototype._resetTransformIETimer=function(){ot.isIE&&(this._transformIETimer||(this.enableClass("reset-transform"),this._transformIETimer=setTimeout(this._onResetTransformIE,20)))},_e.prototype._onResetTransformIE=function(){this._transformIETimer=0,this.enableClass("reset-transform",!1)},_e._proto=_e.prototype;var fe=_e,ge=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)};ge.prototype.dispose=function(){this._dt&&(this._dt.unlisten("dataChanged",this._onDataChanged),this._dt=null)},ge.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())},ge.prototype.setField=function(t){this._field!==t&&(this._field=t,this._requestRecalculation())},ge.prototype.disableOnDemandMode=function(t){var e=!1===t;this._onDemandMode!==e&&(this._onDemandMode=e,this._requestRecalculation())},ge.prototype.setColumnDataGetter=function(t){this._colDataGetter!==t&&(this._colDataGetter=t,this._requestRecalculation())},ge.prototype.getColumnDataGetter=function(){return this._colDataGetter},ge.prototype.getSum=function(){return this._updateStats(),this._sum},ge.prototype.getDataCount=function(){return this._updateStats(),this._count},ge.prototype.getMin=function(){return this._updateStats(),this._min},ge.prototype.getMax=function(){return this._updateStats(),this._max},ge.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},ge.prototype.getAverage=function(){return this._updateStats(),this._sum/this._count},ge.prototype.getMean=ge.prototype.getAverage,ge.prototype.getMidRange=function(){return this._updateStats(),.5*(this._max+this._min)},ge.prototype.getCachedColumnData=function(){return this._dirty?this._recalculate():this._cacheData||(this._cacheData=this._getColData()),this._cacheData},ge.prototype.markDirty=function(){return!!this._onDemandMode&&(this._dirty=!0,this._dirty)},ge.prototype._getColData=function(){return this._colDataGetter?this._colDataGetter(this._field,this._dt):this._dt.getColumnData(this._field)},ge.prototype._requestRecalculation=function(){this.markDirty()||this._recalculate()},ge.prototype._updateStats=function(){this._dirty&&this._recalculate()},ge.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,n=ge._isDataNumeric,o=0;o<e;)if(n(i=+t[o++])){this._sum=this._min=this._max=i,++this._count;break}for(;o<e;)n(i=+t[o])&&(this._sum+=i,i<this._min?this._min=i:i>this._max&&(this._max=i),++this._count),++o}}},ge.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()}},ge.prototype._updateRowData=function(t){var e=this._dt.getPreviousData(t,this._field),i=this._dt.getData(t,this._field);if(e!==i){var n=ge._isDataNumeric(i);if(ge._isDataNumeric(e)){if(this._min===e&&(!n||i>this._min))return void this._recalculate();if(this._max===e&&(!n||i<this._max))return void this._recalculate();this._sum-=e,--this._count}n&&(this._sum+=i,i>=this._min||(this._min=i),i<=this._max||(this._max=i),++this._count)}},ge._isDataNumeric=function(t){return"number"==typeof t&&t==t},ge.prototype.addRef=function(t){return t&&this._refs.indexOf(t)<0&&this._refs.push(t),this._refs.length},ge.prototype.deRef=function(t){if(t){var e=this._refs.indexOf(t);e>=0&&this._refs.splice(e,1)}return this._refs.length},ge.prototype.getRefCount=function(){return this._refs.length},ge.prototype._dt=null,ge.prototype._field="",ge.prototype._onDemandMode=!0,ge.prototype._dirty=!0,ge.prototype._cacheData=null,ge.prototype._sum=0,ge.prototype._min=NaN,ge.prototype._max=NaN,ge.prototype._count=0,ge.prototype._colDataGetter=null,ge.prototype._refs;var ye=ge,me=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")};s.inherits(me,lt),me.prototype._dv=null,me.prototype._dt=null,me.prototype._wrapIndex=0,me.prototype._rids,me.prototype._dataConflator=null,me.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))}},me.prototype._onWrapSizeChanged=function(t){this._refreshRids(t.rids)&&this._dispatch("dataChanged",gt._globalChangeArg)},me.prototype._refreshRids=function(t){var e=!1;if(this._dv&&Array.isArray(t)){var i=this.getWrapSize();if(i>0){var n=i*this._wrapIndex;n<t.length?(e=!0,this._rids=t.slice(n,n+i)):this._rids.length&&(e=!0,this._rids.length=0)}}return e},me.prototype.dispose=function(){this._dv&&(this.unlistenAll(),this._dv.unlisten("dataChanged",this._onDataChanged),this._dv.unlisten("wrapSizeChanged",this._onWrapSizeChanged),this._dt=this._dv=null)},me.prototype.getData=function(t,e){return this._dt.getData(t,e)},me.prototype.getRowData=function(t){return this._dt.getRowData(t)},me.prototype.getColumnData=function(t,e){for(var i=this.getAllRowIds(!0,e),n=[],o=i.length,r=0;r<o;++r){var s=this._dt.getRowData(i[r]);s?n.push(s[t]):e&&n.push(null)}return n},me.prototype.getRowId=function(t){return this._rids[t]||""},me.prototype._toRowId=function(t){return"number"==typeof t?this._rids[t]||"":t||""},me.prototype._toRowIds=function(t){for(var e=Array.isArray(t)?t.length:0,i=new Array(e),n=this._rids,o=0;o<e;++o){var r=t[o];i[o]="number"==typeof r?n[r]||"":r||""}return i},me.prototype.getAllRowIds=function(t,e){return t?this._rids:this._rids.slice(0)},me.prototype.getVisibleRowIds=function(t){return t?this._rids:this._rids.slice(0)},me.prototype.getSortedRowIds=function(t){return t?this._rids:this._rids.slice(0)},me.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},me.prototype.getRowCount=function(){return this._rids.length},me.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},me.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},me.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},me.prototype.getMultipleRowData=function(t,e,i){return this._dt.getMultipleRowData(t,e,i)},me.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},me.prototype.setData=function(t,e,i){return!!this._dt&&this._dt.setData(t,e,i)},me.prototype.setRowData=function(t,e,i){return this._dv.setRowData(t,e,i)},me.prototype.setColumnData=function(t,e,i){this._dt&&this._dt.setColumnData(t,e,i)},me.prototype.setDataAt=function(t,e,i){var n=this.getRowId(t);return!(!n||!this._dt)&&this._dt.setData(n,e,i)},me.prototype.setRowDataAt=function(t,e,i){var n=this.getRowId(t);return this.setRowData(n,e,i)},me.prototype.insertRow=function(t,e,i){var n=this._toRowId(t);return this._dv.insertRow(n,e,i)},me.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},me.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},me.prototype.moveRow=function(t,e){var i=this._toRowId(e),n=Array.isArray(t)?t:[t],o=this._toRowIds(n);return this._dv.moveRow(o,i)},me.prototype.getDataTable=function(){return this._dt},me.prototype.getDataSource=function(){return this._dv},me.prototype.setDataSource=function(t){},me.prototype.setConflationRate=function(t){this._dv.setConflationRate(t)},me.prototype.getConflationRate=function(){return this._dv.getConflationRate()},me.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},me.prototype.sort=function(t,e,i,n){this._dv.sort(t,e,i,n)},me.prototype.sortOnce=function(t,e){this._dv.sortOnce(t,e)},me.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},me.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},me.prototype.isSorting=function(){return this._dv.isSorting()},me.prototype.hideRow=function(t,e){this.showRows([t],!1===e)},me.prototype.hideRows=function(t,e){this.showRows(t,!1===e)},me.prototype.showRows=function(t,e){var i=this._toRowIds(t);this._dv.showRows(i,e)},me.prototype.unhideAllRows=function(){this._dv.unhideAllRows()},me.prototype.hasHiddenRow=function(){return this._dv.hasHiddenRow()},me.prototype.filterIn=function(t,e,i){return this._dv.filterIn(t,e,i)},me.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},me.prototype.filterInOnce=function(t,e,i){this._dv.filterInOnce(t,e,i)},me.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},me.prototype.clearFilter=function(){this._dv.clearFilter()},me.prototype.disablePageCorrection=function(t){},me.prototype.setPage=function(t){return!1},me.prototype.gotoPage=me.prototype.setPage,me.prototype.nextPage=function(){return!1},me.prototype.previousPage=function(){return!1},me.prototype.prevPage=me.prototype.previousPage,me.prototype.lastPage=function(){return!1},me.prototype.firstPage=function(){return!1},me.prototype.getCurrentPage=function(){return 1},me.prototype.getPageIndex=me.prototype.getCurrentPage,me.prototype.isOnLastPage=function(){return!0},me.prototype.isOnFirstPage=function(){return!0},me.prototype.getPageSize=function(){return 0},me.prototype.getPageCount=function(){return 1},me.prototype.getTotalPages=me.prototype.getPageCount,me.prototype.setPageSize=function(t){},me.prototype.groupBy=function(t,e){this._dv.groupBy(t,e)},me.prototype.addGroup=function(t){this._dv.addGroup(t)},me.prototype.sortGroups=function(t){this._dv.sortGroups(t)},me.prototype.moveGroup=function(t,e){this._dv.moveGroup(t,e)},me.prototype.setPredefinedGroups=function(t){this._dv.setPredefinedGroups(t)},me.prototype.addFooter=function(t){this._dv.addFooter(t)},me.prototype.removeFooter=function(){this._dv.removeFooter()},me.prototype.enableMultiGroup=function(t){this._dv.enableMultiGroup(t)},me.prototype.getGroupByRowId=function(t){return this._dv.getGroupByRowId(t)},me.prototype.getGroup=function(t){return this._dv.getGroup(t)},me.prototype.getAllGroups=function(t){return this._dv.getAllGroups(t)},me.prototype.getGroupList=function(){return this._dv.getGroupList()},me.prototype.getGroupId=function(){return this._dv.getGroupId()},me.prototype.getGroupValue=function(){return this._dv.getGroupValue()},me.prototype.getGroupRowId=function(){return this._dv.getGroupRowId()},me.prototype.getFooterRowIndex=function(t){return this._dv.getFooterRowIndex(t)},me.prototype.getFooterRowIds=function(){return this._dv.getFooterRowIds()},me.prototype.hasGroup=function(){return this._dv.hasGroup()},me.prototype.getGroupRows=function(){return null},me.prototype.getGroupLevel=function(t){var e=this._toRowId(t);return this._dv.getGroupLevel(e)},me.prototype.enableColumnStats=function(t,e,i){return this._dv.enableColumnStats(t,e,i)},me.prototype.getColumnStats=function(t){return this._dv.getColumnStats(t)},me.prototype.hide=function(t){return this._dv.hide(t)},me.prototype.isHidden=function(){return this._dv.isHidden()},me.prototype.isHiddenRow=function(t){return this._dv.isHiddenRow(t)},me.prototype.collapse=function(t){this._dv.collapse(t)},me.prototype.collapseAllGroups=function(t){this._dv.collapseAllGroups(t)},me.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},me.prototype.isCollapsed=function(){return this._dv.isCollapsed()},me.prototype.enableContentAsHeader=function(t){this._dv.enableContentAsHeader(t)},me.prototype.getVisibleRowCount=function(){return this._rids.length},me.prototype.isRowDataInGroup=function(t,e){return this._dv.isRowDataInGroup(t,e)},me.prototype.isRowIdInGroup=function(t,e){return this._dv.isRowIdInGroup(t,e)},me.prototype.addRowExpansion=function(t,e){this._dv.addRowExpansion(t,e)},me.prototype.removeRowExpansion=function(t){this._dv.removeRowExpansion(t)},me.prototype.toggleRowExpansion=function(t,e,i){var n=this._toRowId(t);this._dv.toggleRowExpansion(n,e,i)},me.prototype.removeAllRowExpansions=function(){this._dv.removeAllRowExpansions()},me.prototype.getRowsWithExpansion=function(t,e){return this._dv.getRowsWithExpansion(t,e)},me.prototype.getExpansionParents=function(t,e){return this._dv.getExpansionParents(t,e)},me.prototype.isRowExpansion=function(t){return this._dv.isRowExpansion(t)},me.prototype.hasRowExpansion=function(t){return this._dv.hasRowExpansion(t)},me.prototype.getRowExpansionId=function(t,e){return this._dv.getRowExpansionId(t,e)},me.prototype.getRowExpansionIndex=function(t){return this._dv.getRowExpansionIndex(t)},me.prototype.searchAll=function(t,e){return this._dv.searchAll(t,e)},me.prototype.searchPrev=function(t,e){var i=this._toRowId(t);return this._dv.searchPrev(i,e)},me.prototype.searchNext=function(t,e){var i=this._toRowId(t);return this._dv.searchNext(i,e)},me.prototype.stall=function(t){return this._dv.stall(t)},me.prototype.enableAutoGroupRemoval=function(t){return this._dv.enableAutoGroupRemoval(t)},me.prototype.enableAutoGroupHiding=function(t){return this._dv.enableAutoGroupHiding(t)},me.prototype.synchronizeRowOrder=function(){this._dv.synchronizeRowOrder()},me.prototype.setSegmentSeparator=function(t,e){var i=this._toRowId(t);return this._dv.setSegmentSeparator(i,e)},me.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},me.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},me.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},me.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},me.prototype.collapseSegment=function(t,e){var i=this._toRowId(t);return this._dv.collapseSegment(i,e)},me.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},me.prototype.expandAllSegments=function(){return this._dv.expandAllSegments()},me.prototype.setSegmentCollapsingLogic=function(){},me.prototype.isSegmentCollapsed=function(t){var e=this._toRowId(t);return this._dv.isSegmentCollapsed(e)},me.prototype.fillSegment=function(t){var e=this._toRowId(t);this._dv.fillSegment(e)},me.prototype.fillSegments=function(){this._dv.fillSegments()},me.prototype.addSegmentChild=function(t,e){var i=this._toRowId(t),n=this._toRowId(e);return this._dv.addSegmentChild(i,n)},me.prototype.addSegmentChildren=function(t,e){var i=this._toRowId(t),n=this._toRowIds(e);return this._dv.addSegmentChildren(i,n)},me.prototype.removeSegmentChild=function(t,e){var i=this._toRowId(t),n=this._toRowId(e);return this._dv.removeSegmentChild(i,n)},me.prototype.removeSegmentChildren=function(t,e){var i=this._toRowId(t),n=this._toRowIds(e);return this._dv.removeSegmentChildren(i,n)},me.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},me.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},me.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},me.prototype.sortSegments=function(t){this._dt.sortSegments(t)},me.prototype.getWrapSize=function(){return this._dv.getWrapSize()},me.prototype.getWrappedViews=function(){return this._dv.getWrappedViews()},me.prototype.wrapView=function(t){this._dv.wrapView(t)},me.prototype.dump=function(t){return DataCache.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},me.prototype.log=function(t){console.table(this.dump(t))},me.prototype.isRowFiltered=function(t,e){return this._dv.isRowFiltered(t,e)};var ve=me,Ce=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._byRemovalMap=e._byRemovalMap.bind(e),e._rids=[],e._sortingDefs=[],e._columnStats={},e._shared={},e._conflator=new o(this._onDataChanged,0),e._conflator.disable(),e._addEvents("dataChanged","preDisposed","pageIndexChanged","pageCountChanged","groupAdded","beforeGroupAdded","groupCriteriaChanged","beforeFiltering","wrapCountChanged","wrapSizeChanged"),e.setDataSource(t)};s.inherits(Ce,lt),Ce.prototype._rids,Ce.prototype._groupView=null,Ce.prototype._pageView=null,Ce.prototype._expansionView=null,Ce.prototype._hiddenRids=null,Ce.prototype._collapsedRids=null,Ce.prototype._excludedRids=null,Ce.prototype._emptySegmentFiltering=!1,Ce.prototype._separatorFiltering=!1,Ce.prototype._expansionMap=null,Ce.prototype._expansionChildren=null,Ce.prototype._expansionCount=0,Ce.prototype._dt=null,Ce.prototype._parent=null,Ce.prototype._shared=null,Ce.prototype._sortingDefs=null,Ce.prototype._userFilter=null,Ce.prototype._filteringOut=!1,Ce.prototype._refreshTimerId=0,Ce.prototype._groupSortingLogic=null,Ce.prototype._pageCorrection=!0,Ce.prototype._pageSize=0,Ce.prototype._pageIndex=1,Ce.prototype._lastPageIndex=0,Ce.prototype._groupCriteria=null,Ce.prototype._preDefGroups=null,Ce.prototype._preDefGroupsDirty=!1,Ce.prototype._groupMembers=null,Ce.prototype._groupList=null,Ce.prototype._groupRows=null,Ce.prototype._groupId="",Ce.prototype._groupColor="",Ce.prototype._groupValue,Ce.prototype._groupRowId="",Ce.prototype._footerRowIds=null,Ce.prototype._groupLevel=0,Ce.prototype._groupViewDirty=!1,Ce.prototype._columnStats,Ce.prototype._hidden=!1,Ce.prototype._hiddenHeaderRow=!1,Ce.prototype._collapsed=!1,Ce.prototype._collapsible=!0,Ce.prototype._showOnlyFirstMember=!1,Ce.prototype._beingAdded=!1,Ce.prototype._conflator=null,Ce.prototype._wrappedViews=null,Ce.prototype._wrapSize=0,Ce.prototype._wrapTimerId=0,Ce.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}},Ce.prototype.getData=function(t,e){return this._dt.getData(t,e)},Ce.prototype.getRowData=function(t){return this._dt.getRowData(t)},Ce.prototype.getColumnData=function(t,e){for(var i=this.getAllRowIds(!0,e),n=[],o=i.length,r=0;r<o;++r){var s=this._dt.getRowData(i[r]);s?n.push(s[t]):e&&n.push(null)}return n},Ce.prototype.getRowId=function(t){return this._rebuildRowIdsFromChildren(),this._getRids()[t]||""},Ce.prototype._toRowId=function(t){return"number"==typeof t?(this._rebuildRowIdsFromChildren(),this._getRids()[t]||""):t||""},Ce.prototype._toRowIds=function(t){for(var e=Array.isArray(t)?t.length:0,i=new Array(e),n=this._getRids(),o=0;o<e;++o){var r=t[o];"number"==typeof r?(this._rebuildRowIdsFromChildren(),i[o]=n[r]||""):i[o]=r||""}return i},Ce.prototype.getAllRowIds=function(t,e){this._rebuildRowIdsFromChildren();var i=e?this._getRids():this._pageView||this._rids;return t?i:i.slice(0)},Ce.prototype.getVisibleRowIds=function(t){this._rebuildRowIdsFromChildren();var e=this._getRids();return t?e:e.slice(0)},Ce.prototype.getSortedRowIds=function(t){return this._rebuildRowIdsFromChildren(),t?this._rids:this._rids.slice(0)},Ce.prototype.getRowIndex=function(t){return this._rebuildRowIdsFromChildren(),this._getRids().indexOf(t)},Ce.prototype.getRowCount=function(){return this._getRids().length},Ce.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},Ce.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},Ce.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},Ce.prototype.getMultipleRowData=function(t,e,i){return this._dt.getMultipleRowData(t,e,i)},Ce.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},Ce.prototype.setData=function(t,e,i){return!!this._dt&&this._dt.setData(t,e,i)},Ce.prototype.setRowData=function(t,e,i){return!(!t||!this._dt||this.isRowExpansion(t))&&this._dt.setRowData(t,e,i)},Ce.prototype.setColumnData=function(t,e,i){this._dt&&this._dt.setColumnData(t,e,i)},Ce.prototype.setDataAt=function(t,e,i){var n=this.getRowId(t);return!(!n||!this._dt)&&this._dt.setData(n,e,i)},Ce.prototype.setRowDataAt=function(t,e,i){var n=this.getRowId(t);return this.setRowData(n,e,i)},Ce.prototype.insertRow=function(t,e,i){this._rebuildRowIdsFromChildren();var n=this._toRowId(t);return this._dt?this._dt.insertRow(n,e,i):""},Ce.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},Ce.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},Ce.prototype.moveRow=function(t,e){var i=this._toRowId(e),n=Array.isArray(t)?t:[t],o=this._toRowIds(n);return this._dt.hasSegmentation()&&this.synchronizeRowOrder(),this._dt._moveRow(o,i)},Ce.prototype.swapRow=ot._deprecatedFunction,Ce.prototype.getDataTable=function(){return this._dt},Ce.prototype.getDataSource=function(){return this._parent},Ce.prototype.setDataSource=function(t){if(t){if(this._groupLevel>0)return;this._setParent(t),this._onDataChanged(gt._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={}},Ce.prototype.setConflationRate=function(t){this._conflator.disable(!t),this._conflator.setConflatingTime(t)},Ce.prototype.getConflationRate=function(){return this._conflator.getConflatingTime()},Ce.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)},Ce.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},Ce.prototype.sort=function(t,e,i,n){if(this._groupLevel>0)window.console.log("ERROR: Sub-group cannot be sorted individually");else{var o=this.getSortingLogics(),r=this._sortingDefs,s=r.length;if(Array.isArray(i))for(var a=i.length;--a>=0;)if("function"!=typeof i[a]){var l=Array.isArray(t)?t[a]:t;i[a]=o[l]||o._default}if(gt._buildSortContext(r,t,e,i||o),1===r.length&&0===r[0][3]&&(r.length=0),!(s<=0&&r.length<=0||this._shared.stalledRids)){var u=!1;this._groupMembers||r.length<=0||n?(u=!0,this._updateRowIds()):u=this._sort(),u&&this._dispatchDataChange(gt._positionChangeArg)}}},Ce.prototype.sortOnce=function(t,e){this.sort(t,e),this._sortingDefs.length=0},Ce.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},Ce.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},Ce.prototype.getColumnSortingLogic=function(t){return this._dt?this._dt.getColumnSortingLogic(t):null},Ce.prototype.isSorting=function(){return this._sortingDefs.length>0},Ce.prototype.hideRow=function(t,e){this.hideRows([t],e)},Ce.prototype.hideRows=function(t,e){e=!1!==e;var i=this._hiddenRids;if(e)i||(i=this._hiddenRids={});else if(!i)return;for(var n=this._toRowIds(t),o=!1,r=n.length;--r>=0;){var s=n[r];s&&(e?i[s]||(i[s]=!0,o=!0):i[s]&&(delete i[s],o=!0))}if(o){if(!e){var a=!1;for(var l in i){a=!0;break}a||(i=this._hiddenRids=null)}this._refreshAndNotify()}},Ce.prototype.showRows=function(t,e){this.hideRows(t,!1===e)},Ce.prototype.unhideAllRows=function(){this._hiddenRids&&(this._hiddenRids=null,this._refreshAndNotify())},Ce.prototype.hasHiddenRow=function(){return!!this._hiddenRids},Ce.prototype.filterIn=function(t,e,i){var n=this._getFilterLogic(t,e),o=!0===i;return!!(this._userFilter!==n||"function"==typeof t||n&&o!==this._filteringOut)&&(this._shared.filterLogic=n,this._userFilter=n,this._filteringOut=o,this._refreshAndNotify(),!0)},Ce.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},Ce.prototype.filterInOnce=function(t,e,i){var n=this._getFilterLogic(t,e),o={};if(this._getRemovalMap(o,n,!0===i)){var r=this._removeRowIds(o);this._updatePageCount()||this._transformView(r)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(Object.keys(o))}},Ce.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},Ce.prototype._removeRowIds=function(t){var e=Ce._removeArrayItems(this._rids,t);if(this._groupView&&(e=Ce._removeArrayItems(this._groupView,t)),this._groupMembers)for(var i=this._groupList.length,n=0;n<i;++n){var o=this._groupList[n];this._groupMembers[o]._removeRowIds(t)}return e},Ce.prototype.clearFilter=function(){this._userFilter&&(this._userFilter=null,this._shared.filterLogic=null,this._refreshAndNotify())},Ce.prototype.disablePageCorrection=function(t){this._pageCorrection=!1===t},Ce.prototype.setPage=function(t){var e=this._setPage(t);return e&&this._dispatchGlobalChange(),e},Ce.prototype.gotoPage=Ce.prototype.setPage,Ce.prototype.nextPage=function(){return this.gotoPage(this._pageIndex+1)},Ce.prototype.previousPage=function(){return this.gotoPage(this._pageIndex-1)},Ce.prototype.prevPage=Ce.prototype.previousPage,Ce.prototype.lastPage=function(){return this.gotoPage(this._lastPageIndex)},Ce.prototype.firstPage=function(){return this.gotoPage(0)},Ce.prototype.getCurrentPage=function(){return this._pageIndex},Ce.prototype.getPageIndex=Ce.prototype.getCurrentPage,Ce.prototype.isOnLastPage=function(){return this._pageIndex===this._lastPageIndex},Ce.prototype.isOnFirstPage=function(){return 1===this._pageIndex},Ce.prototype.getPageSize=function(){return this._pageSize},Ce.prototype.getPageCount=function(){return this._lastPageIndex},Ce.prototype.getTotalPages=Ce.prototype.getPageCount,Ce.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())},Ce.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 n,o,r;if(null!=e&&this._setPredefinedGroups(e),t&&0===this._groupLevel)for(this._groupCriteria=[],o=(r=Array.isArray(t)?t:[t]).length,n=0;n<o;++n){var s=r[n];"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(o=this._footerRowIds.length,n=0;n<o;++n)delete this._groupRows[this._footerRowIds[n]];this._footerRowIds=null}this._groupRows=null}this._groupValue=null}this._groupLevel=0,this._updateRowIds(),this._dispatch("groupCriteriaChanged",{}),this._dispatchGlobalChange()},Ce.prototype.addGroup=function(t){if(this._groupMembers)if(isArray(t))for(var e=t,i=e.length,n=0;n<i;++n)this._addGroup(e[n]);else this._addGroup(t)},Ce.prototype.sortGroups=function(t){if(this._groupMembers&&(this._groupSortingLogic=null==t?Ce._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()}},Ce.prototype.moveGroup=function(t,e){var i=this.getGroup(t);if(i){var n=i.getDataSource(),o=i.getGroupId(),r=n._groupList.indexOf(o);r!==e&&r+1!==e&&(n._groupList.splice(r,1),r<e&&--e,n._groupList.splice(e,0,o),this._requestRebuildingRowIds(!1))}},Ce.prototype.setPredefinedGroups=function(t){this._setPredefinedGroups(t),this._groupMembers&&this._refreshAndNotify()},Ce.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}},Ce.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)}},Ce.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)}},Ce.prototype.enableMultiGroup=function(t){this._shared.multiGroupRow=!1!==t},Ce.prototype.getGroupByRowId=function(t){return this._groupRows&&this._groupRows[t]||null},Ce.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 n=e;return(i=this._groupRows[n])||this._getGroupByContentRowId(n)},Ce.prototype._getGroupByContentRowId=function(t){if(this._groupMembers)for(var e=0;e<this._groupList.length;e++){var i=this._groupList[e],n=this._groupMembers[i]._getGroupByContentRowId(t);if(n)return n}else if(-1!==this._rids.indexOf(t))return this;return null},Ce.prototype.getAllGroups=function(t){if(t||(t=[]),this._groupMembers)for(var e=this._groupList.length,i=0;i<e;++i){var n=this._groupList[i],o=this._groupMembers[n];t.push(o),o.getAllGroups(t)}return t},Ce.prototype.getGroupList=function(){return this._groupList},Ce.prototype.getGroupId=function(){return this._groupId},Ce.prototype.getGroupValue=function(){return this._groupValue},Ce.prototype.getGroupRowId=function(){return this._groupRowId},Ce.prototype.getFooterRowIndex=function(t){if(this._footerRowIds)for(var e=this._footerRowIds.length;--e>=0;)if(this._footerRowIds[e]===t)return e;return-1},Ce.prototype.getFooterRowIds=function(){return this._footerRowIds},Ce.prototype.hasGroup=function(){return!!this._groupMembers},Ce.prototype.getGroupRows=function(){return null},Ce.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(),n=i[t];n;){var o=this._groupRows[n];if(o)return o._groupLevel;n=i[--t]}}return this._groupLevel},Ce.prototype.enableColumnStats=function(t,e,i){if(!t)return null;var n=!1!==e,o=this._columnStats[t];if(n?(o||(o=new ye(this,t),this._columnStats[t]=o),o.addRef(i)):o&&(o.deRef(i)||(o.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 o||null},Ce.prototype.getColumnStats=function(t){return this._columnStats[t]||null},Ce.prototype.hide=function(t){var e=!1!==t;return this._hidden!==e&&(this._hidden=e,this._refreshAndNotify(),!0)},Ce.prototype.isHidden=function(){return this._hidden},Ce.prototype.isHiddenRow=function(t){return!!this._hiddenRids&&!0===this._hiddenRids[t]},Ce.prototype._isHeaderRowShown=function(){return!this._hiddenHeaderRow&&((!this._shared.filterLogic||0!==this._rids.length)&&(!this._shared.autoGroupHiding||null!=this._groupValue))},Ce.prototype._setCollapse=function(t){if(this._shared.contentAsHeader){if(this._hiddenHeaderRow&&this._showOnlyFirstMember!==t)return this._showOnlyFirstMember=t,!0}else if(this._isHeaderRowShown()&&this._collapsible&&this._collapsed!==t)return this._collapsed=t,!0;return!1},Ce.prototype.collapse=function(t){this._setCollapse(!1!==t)&&(this._shared.contentAsHeader?this._hiddenHeaderRow&&this._requestRebuildingRowIds(this._showOnlyFirstMember):this._groupLevel>0&&this._requestRebuildingRowIds(this._collapsed))},Ce.prototype.collapseAllGroups=function(t){var e=this.getAllGroups(),i=e.length;if(i){for(var n=!1!==t,o=0;o<i;++o){e[o]._setCollapse(n)}this._requestRebuildingRowIds(!1)}},Ce.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},Ce.prototype.isCollapsed=function(){return this._collapsed||this._showOnlyFirstMember},Ce.prototype.enableContentAsHeader=function(t){this._shared.contentAsHeader=!1!==t},Ce.prototype.setDefaultCollapse=function(t){this._shared.defaultCollapse=!!t},Ce.prototype.getDefaultCollapse=function(){return!!this._shared.defaultCollapse},Ce.prototype.isCollapsible=function(){return this._collapsible},Ce.prototype.disableCollapsing=function(t){this._collapsible=!(!1!==t)},Ce.prototype.setGroupColor=function(t){1===this._groupLevel&&(this._groupColor=t)},Ce.prototype.getGroupColor=function(){return 0===this._groupLevel?"":1===this._groupLevel?this._groupColor:this._parent.getGroupColor()},Ce.prototype._getFirstHiddenRids=function(){if(this._shared.contentAsHeader&&this._showOnlyFirstMember){var t=this._rids;if(Array.isArray(t)&&t.length)return[t[0]]}return null},Ce.prototype.getVisibleRowCount=function(){return this._collapsed?0:(this._rebuildRowIdsFromChildren(),this._getRids().length)},Ce.prototype.isRowDataInGroup=function(t,e){var i=this._groupCriteria,n=this._groupLevel;if(!e||e===this.getGroupId())return this._isAllowedInGroup(null,t);for(var o=n;o<i.length;o++)if(i[o](t).indexOf(e)>=0)return!0;return!1},Ce.prototype.isRowIdInGroup=function(t,e){var i=this.getRowData(t);return!!i&&this.isRowDataInGroup(i,e)},Ce._getDataViewExpansionId=function(t,e){return t+"_ex"+e},Ce.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 n=0;this._expansionMap?n=this._expansionMap[t]||0:(this._expansionMap={},this._expansionChildren={});var o=n+e;this._expansionMap[t]=o;for(var r=n;r<o;r++)this._expansionChildren[Ce._getDataViewExpansionId(t,r)]=t;if(n||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)}}}},Ce.prototype.removeRowExpansion=function(t){if(this._expansionMap){var e=this._expansionMap[t];if(e){for(var i=new Array(e),n=0;n<e;++n)i[n]=Ce._getDataViewExpansionId(t,n),delete this._expansionChildren[i[n]];delete this._expansionMap[t],this._expansionCount--,this._groupViewDirty||this._updateExpansionView()&&(1===e?this._dispatchRowRemoved(i[0]):this._dispatchMultiRowRemoved(i))}}},Ce.prototype.toggleRowExpansion=function(t,e,i){var n=this._toRowId(t);(e=null!=e?!0===e:!this.hasRowExpansion(n))?this.addRowExpansion(n,i):this.removeRowExpansion(n)},Ce.prototype.removeAllRowExpansions=function(){this._expansionMap&&(this._expansionMap=null,this._expansionCount=0,this._expansionView=null,this._expansionChildren=null,this._refreshAndNotify())},Ce.prototype.getRowsWithExpansion=function(t,e){if(!this._expansionMap)return[];var i=this._expansionView,n=i.length;(null==e||e>n)&&(e=n),t>0||(t=0);for(var o=this._expansionCount,r=new Array(n),s=t;s<e;++s){var a=i[s];if(this._expansionMap[a]&&(r[s]=a,--o<=0))break}return r},Ce.prototype.getExpansionParents=function(t,e){var i=[];if(this._expansionMap){var n=this._expansionView,o=n.length;(null==e||e>o)&&(e=o),(!t||t<0)&&(t=0);for(var r=t;r<e;++r)i[r]=this._expansionChildren[n[r]]||""}return i},Ce.prototype.getExpansionParentByRowId=function(t){return this._expansionChildren&&this._expansionChildren[t]||""},Ce.prototype.isRowExpansion=function(t){return!!this._expansionChildren&&!!this._expansionChildren[t]},Ce.prototype.hasRowExpansion=function(t){return!!this._expansionMap&&!!this._expansionMap[t]},Ce.prototype.getRowExpansionCount=function(t){return this._expansionMap&&this._expansionMap[t]||0},Ce.prototype.getRowExpansionId=function(t,e){if(this._expansionMap&&(e||(e=0),e<(this._expansionMap[t]||0)))return Ce._getDataViewExpansionId(t,e);return""},Ce.prototype.getRowExpansionIndex=function(t){if(t){var e=t.match(/_ex(\d+)$/);if(e)return+e[1]}return-1},Ce.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,n=this._expansionView?this._expansionView.length:0;this._expansionView?this._expansionView.length=i:this._expansionView=new Array(i);for(var o=this._expansionCount,r=0,s=0;r<i;++r){var a=e[r];if(this._expansionView[s++]=a,o){var l=t[a]||0;if(l){for(var u=0;u<l;++u)this._expansionView[s++]=Ce._getDataViewExpansionId(a,u);--o}}}return n!==this._expansionView.length}return!1},Ce.prototype._transformView=function(t){var e=this._updatePaginationView(t);return!!(e|=this._updateExpansionView())},Ce.prototype.searchAll=function(t,e){e||(e=[]),this._rebuildRowIdsFromChildren();for(var i=this._getRids(),n=i.length,o=0;o<n;++o){var r=i[o],s=this._dt.getRowData(r);s&&t(s)&&e.push(r)}return e},Ce.prototype.searchPrev=function(t,e){this._rebuildRowIdsFromChildren();var i=this._getRids(),n=-1;"number"==typeof t?this._dt.getRowData(i[t])&&(n=t):n=i.indexOf(t);var o=-1,r=i.length;return n>0&&(o=this._searchRow(i,e,n-1,-1,-1))>=0||n>=0&&(o=this._searchRow(i,e,r-1,n,-1))>=0?o:-1},Ce.prototype.searchNext=function(t,e){this._rebuildRowIdsFromChildren();var i=this._getRids(),n=-1;if("number"==typeof t?this._dt.getRowData(i[t])&&(n=t):n=i.indexOf(t),n<0)return-1;var o=-1,r=i.length;return n<r-1&&(o=this._searchRow(i,e,n+1,r,1))>=0||n>0&&(o=this._searchRow(i,e,0,n,1))>=0?o:-1},Ce.prototype._searchRow=function(t,e,i,n,o){for(;i!==n;){var r=t[i],s=this._dt.getRowData(r);if(s&&e(s))return i;i+=o}return-1},Ce.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 n=this._getRids(),o=n.length;--o>=0;)i[n[o]]=1}else this._shared.stalledRids=null,this._refreshAndNotify();return!0},Ce.prototype.enableAutoGroupRemoval=function(t){return t=!1!==t,!!this._shared.autoGroupRemoval!==t&&(this._shared.autoGroupRemoval=t,this._triggerGroupRefreshing(),!0)},Ce.prototype.enableAutoGroupHiding=function(t){return t=!1!==t,!!this._shared.autoGroupHiding!==t&&(this._shared.autoGroupHiding=t,this._triggerGroupRefreshing(),!0)},Ce.prototype.synchronizeRowOrder=function(){this.isSorting()&&this._dt._sort(this._sortingDefs)},Ce.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))},Ce.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},Ce.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},Ce.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},Ce.prototype.getSegment=function(t){return this._dt.getSegment(t)},Ce.prototype.getSegmentParent=function(t){return this._dt.getSegmentParent(t)},Ce.prototype.getSegmentLevel=function(t){return this._dt.getSegmentLevel(t)},Ce.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},Ce.prototype.collapseSegment=function(t,e){e=!1!==e;var i=this._dt._getSegmentSeparators();if(i){var n=this._toRowId(t);if(i.collapseSegment(n,e))return this._refreshAndNotify(),!0}return!1},Ce.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},Ce.prototype.expandAllSegments=function(){var t=this._dt._getSegmentSeparators();return!(!t||!t.expandAllSegments())&&(this._refreshAndNotify(),!0)},Ce.prototype.setSegmentCollapsingLogic=function(){},Ce.prototype.isSegmentCollapsed=function(t){var e=this._dt._getSegmentSeparators();return!!e&&e.isCollapsedSegment(this._toRowId(t))},Ce.prototype.fillSegment=function(t){this._dt.fillSegment(this._toRowId(t))},Ce.prototype.fillSegments=function(){this._dt.fillSegments()},Ce.prototype.addSegmentChild=function(t,e,i){if(this._dt._getSegmentSeparators()){var n=this._toRowId(t),o=this._toRowId(e);return this._dt.addSegmentChild(n,o,i)}return!1},Ce.prototype.addSegmentChildren=function(t,e,i){if(this._dt._getSegmentSeparators()){var n=this._toRowId(t),o=this._toRowIds(e);return this._dt.addSegmentChildren(n,o,i)}return!1},Ce.prototype.removeSegmentChild=function(t,e){if(this._dt._getSegmentSeparators()){var i=this._toRowId(t),n=this._toRowId(e);return this._dt.removeSegmentChild(i,n)}return!1},Ce.prototype.removeSegmentChildren=function(t,e){if(this._dt._getSegmentSeparators()){var i=this._toRowId(t),n=this._toRowIds(e);return this._dt.removeSegmentChildren(i,n)}return!1},Ce.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},Ce.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},Ce.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},Ce.prototype.sortSeparators=function(t,e,i){this._dt.sortSeparators(t,e,i)},Ce.prototype.sortSegments=function(t){this._dt.sortSegments(t)},Ce.prototype.enableEmptySegmentFiltering=function(t){t=!1!==t,this._emptySegmentFiltering!==t&&(this._emptySegmentFiltering=t,this._userFilter&&this._refreshAndNotify())},Ce.prototype.enableSeparatorFiltering=function(t){t=!1!==t,this._separatorFiltering!==t&&(this._separatorFiltering=t,this._userFilter&&this._refreshAndNotify())},Ce.prototype.setSegmentClassification=function(t,e){return this._dt.setSegmentClassification(this._toRowId(t),e)},Ce.prototype._getSharedObject=function(){return this._shared},Ce.prototype.getWrapSize=function(){return this._wrapSize},Ce.prototype.getWrappedViews=function(){return this._wrappedViews},Ce.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()},Ce.prototype._updateWrapCount=function(){this._wrapTimerId=0;var t,e=this._wrapSize,i=this._wrappedViews,n=i?i.length:0,o=0;if(e){var r=this.getVisibleRowIds(!0),s=r.length;if(n<(o=Math.ceil(s/e)))for(i||(i=this._wrappedViews=[]),t=n;t<o;++t)this._wrappedViews[t]=new ve({dataView:this,wrapIndex:t,rids:r})}if(o<n){for(t=n;--t>=o;)this._wrappedViews[t].dispose();this._wrappedViews.length=o}e||(this._wrappedViews=null),n!==o&&this._dispatch("wrapCountChanged",{prevCount:n,newCount:o})},Ce.prototype.dump=function(t){this._rebuildRowIdsFromChildren();var e=this._getRids();return ht.constructTable(this.getMultipleRowData(e),t,e)},Ce.prototype.log=function(t){console.table(this.dump(t))},Ce.prototype._getRids=function(){return this._expansionView||this._pageView||this._groupView||this._rids},Ce.prototype._updateRowIds=function(t){if(this._groupViewDirty=!1,this._parent&&!this._hidden){if(!this._shared.stalledRids){this._rids=t||this._parent.getAllRowIds(),this._dispatch("beforeFiltering",{}),this._excludedRids={};var e=0;e+=Ce._copyObjectKeys(this._excludedRids,this._hiddenRids);var i=this._dt._getSegmentSeparators(),n=i?i.getSegments():null,o=this._getRemovalMap(this._excludedRids,this._userFilter,this._filteringOut,this._separatorFiltering?null:n);if(e+=o,this._collapsedRids=null,i&&(o&&this._emptySegmentFiltering&&(e+=this._getEmptySegments(this._excludedRids,n)),this._collapsedRids=i.getCollapsedRows(),e+=Ce._copyObjectKeys(this._excludedRids,this._collapsedRids)),this._groupLevel>0&&!t&&(e+=this._getRemovalMap(this._excludedRids,this._groupFilterLogic,!1)),e&&(this._rids=this._rids.filter(this._byRemovalMap)),this._excludedRids=null,this._groupMembers)this._populateGroups();else{var r=this._updatePageCount();this._sort()||r||this._transformView()}}}else this._resetAllViews()},Ce.prototype._onDataChanged=function(t){if(!this._conflator.conflate(t)){var e=this._conflator.popAllData()||[t],i=e.length;if(1===i){var n=e[0];if(n.globalChange)return this._updateRowIds(),void this._dispatchDataChange(n);var o=n.type;"inserted"===o?this._onRowInserted(n):"removed"===o?this._onRowRemoved(n):this._onRowUpdated(n)}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})}}},Ce.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,n=this._resolveGroupId(t.rowData),o=n.length;o>1&&(this._shared.multiGroupRow=!0);for(var r=0;r<o;r++)if(i=n[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 a=t.rid,l=t.rowData;if(!this._isAllowedInGroup(a,l))return e;var u,h=t.nextRid;u=this.isSorting()&&!t.segmentChanged?this._addDataRow(a):this._addDataRow(a,h,t.fallback);var p=this._updatePageCount(),d=this._sort();return d&&(t.globalChange=!0),t.globalChange?d||p||this._transformView():(t={rid:a,rowData:l,type:"inserted"},null!=h&&(t.nextRid=h,t.fallback=u),this._transformView(u)&&(t.globalChange=!0)),this._dispatchDataChange(t),1},Ce.prototype._onRowRemoved=function(t){if(this._shared.stalledRids)return 0;if(t.segmentChanged&&this.isSorting())return this._refreshAndNotify(),1;var e,i=0,n=t.rids;if(this._groupMembers){var o,r,s=t.rowData;if(!n&&s){for(o=this._resolveGroupId(s),e=0;e<o.length;e++)r=o[e],this._groupMembers[r]&&(i+=this._groupMembers[r]._onRowRemoved(t));i>1&&(this._groupViewDirty=!0)}else{var a=this._groupList.length;for(e=0;e<a;++e)r=this._groupList[e],i+=this._groupMembers[r]._onRowRemoved(t)}}var l,u,h=NaN,p=null;if(i=0,n){for(p=[],e=n.length;--e>=0;)l=n[e],(u=this._removeDataRow(l))>=0&&(p.push(l),u>=h||(h=u));i=p.length}else l=t.rid,(u=this._removeDataRow(l))>=0&&(p=[l],h=u,i=1);i>0&&(this._updatePageCount()||this._transformView(h)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(p),this._shared.autoGroupRemoval&&this._groupRows&&this._rids.length<=0&&this._triggerGroupRefreshing(),this._hiddenHeaderRow&&this._requestRebuildingRowIds(!0));return i},Ce.prototype._onRowUpdated=function(t){var e,i,n=t.rid,o=t.rowData;if(this.isRowFiltered(n,o))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 a=0;if(r[2]?a=2:r[1]?this._isAllowedInGroup(n,o)||(a=1):r[4]&&(a=4),this._groupLevel>0){if(1===a)Ce._removeArrayItem(this._rids,n)>=0&&this._groupView&&Ce._removeArrayItem(this._groupView,n),this._shared.multiGroupRow&&(this._groupViewDirty=!0);else if(2===a){if(!this._hidden)this._rids.indexOf(n)<0&&this._rids.push(n),this._groupViewDirty=!0,this._resolveGroupId(o).length>1&&(this._shared.multiGroupRow=!0)}}else{var l=r[1]&&r[2]||r[4];if(this._shared.multiGroupRow||!l){var u=this._resolveGroupId(o);for(e=0;e<u.length;e++){i=u[e];var h=this._addGroup(i);h&&(h._onRowInserted(t),a=1)}}!l&&!this._hidden&&this._rids.indexOf(n)<0&&this._addDataRow(n),4===a?this._shared.multiGroupRow?this._dispatchGlobalChange():this._dispatchDataChange(t):(this._groupViewDirty=!0,this._dispatchGlobalChange())}return a}return this._isAllowedInGroup(n,o)?this._rids.indexOf(n)<0?(this._onRowInserted(t),2):(this._shared.stalledRids||this._sort()&&(t.globalChange=!0),this._dispatchDataChange(t),4):this._onRowRemoved(t)?1:0},Ce.prototype._onGroupAdded=function(t){if(!this._hidden){var e=t.newGroup,i=e.getGroupRowId();this._groupView.push(i),this._groupViewDirty=!0,this._dispatch("groupAdded",t),ot.pushArrayItems(this._groupView,e.getFooterRowIds())}},Ce.prototype._onBeforeGroupAdded=function(t){this._dispatch("beforeGroupAdded",t)},Ce.prototype._requestRebuildingRowIds=function(t){this._groupMembers&&(this._groupViewDirty=!0),this._groupLevel>0?this._parent._requestRebuildingRowIds(t):(t?this._rebuildRowIdsFromChildren():this._updateRowIds(),this._dispatchGlobalChange())},Ce.prototype._refreshAndNotify=function(){this._updateRowIds(),this._dispatchGlobalChange()},Ce.prototype._onRefreshTimeout=function(){this._refreshTimerId=0,this._refreshAndNotify()},Ce.prototype._addDataRow=function(t,e,i){var n=this._getRowIndex(this._rids,e,i);return this._insertItems(this._rids,n,t),this._groupView?this._groupMembers?(this._groupViewDirty=!0,this._insertItems(this._groupView,-1,t)):n<0?this._insertItems(this._groupView,-1,t):(n=this._getRowIndex(this._groupView,e,i),this._insertItems(this._groupView,n,t)):n>=0?n:this._rids.length-1},Ce.prototype._insertItems=function(t,e,i){return e<0?(e=t.length,t.push(i)):t.splice(e,0,i),e},Ce.prototype._getRowIndex=function(t,e,i){if(null==e)return-1;var n=this._rids.indexOf(e);return n>=0?n:null==i||i>=t.length?-1:i},Ce.prototype._removeDataRow=function(t){var e=Ce._removeArrayItem(this._rids,t);return this._groupView&&e>=0&&(e=Ce._removeArrayItem(this._groupView,t)),e},Ce._removeArrayItem=function(t,e){var i=t.indexOf(e);return i>=0&&t.splice(i,1),i},Ce._removeArrayItems=function(t,e){for(var i=NaN,n=0,o=t.length;--o>=0;)e[t[o]]?++n:n&&(i=o+1,t.splice(i,n),n=0);return n&&(t.splice(0,n),i=0),i},Ce._copyObjectKeys=function(t,e){if(e){var i=0;for(var n in e)t[n]=1,++i;return i}return 0},Ce.prototype._isAllowedInGroup=function(t,e){if(this._groupLevel>0)for(var i=this,n=this._groupLevel;--n>=0;){if(!i._groupFilterLogic(t,e))return!1;i=i.getDataSource()}return!0},Ce.prototype.isRowFiltered=function(t,e){return this._shared.stalledRids?!this._shared.stalledRids[t]:!(!this._hiddenRids||!this._hiddenRids[t])||(!(!this._collapsedRids||!this._collapsedRids[t])||!(!this._userFilter||this._userFilter(t,e)!==this._filteringOut))},Ce.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,!0),n=gt._performMultiLevelSorting(e,this._sortingDefs,i);if(n)return this._rids=gt._reorderItems(t,n),this._transformView(),!0}return!1},Ce.prototype._byRemovalMap=function(t){return!this._excludedRids[t]},Ce.prototype._getRemovalMap=function(t,e,i,n){if(!e)return 0;var o,r,s,a=this._rids,l=this._dt,u=0,h=a.length;if(n)for(r=h;--r>=0;)n[o=a[r]]||((s=l.getRowData(o))?e(o,s)===i&&(t[o]=1,++u):(t[o]=1,++u));else for(r=h;--r>=0;)o=a[r],(s=l.getRowData(o))?e(o,s)===i&&(t[o]=1,++u):(t[o]=1,++u);return u},Ce.prototype._getEmptySegments=function(t,e){var i=this._dt._getSegmentSeparators(),n=0;for(var o in e){var r=i.getSegment(o);if(r){var s=r.getChildren(),a=!0;for(var l in s)if(!t[l]){a=!1;break}a&&(t[o]=1,++n)}}return n},Ce.prototype._getFilterLogic=function(t,e){return null!=t?"function"==typeof t?t:"string"==typeof t?Ce._defaultFilterLogic.bind(null,t,e):Ce._defaultFilterLogic.bind(null,t+"",e):null},Ce.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)},Ce.prototype._updatePaginationView=function(t){var e=!1;if(this._pageView){t||(t=0);var i=this._pageSize*(this._pageIndex-1),n=this._pageSize+i;if(t<n){var o=this._groupView||this._rids;n>o.length&&(n=o.length);var r=n-i;this._pageView.length=r>=0?r:0;for(var s=i;s<n;++s)this._pageView[s-i]=o[s];e=!0}}return e},Ce.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)},Ce.prototype._dispatchRowRemoved=function(t){t&&this._dispatchDataChange({type:"removed",rid:t})},Ce.prototype._dispatchMultiRowRemoved=function(t){if(t){var e=t.length;1===e?this._dispatchRowRemoved(t[0]):e>1&&this._dispatchDataChange({type:"removed",rids:t})}},Ce.prototype._dispatchGlobalChange=function(){this._dispatchDataChange(gt._globalChangeArg)},Ce.prototype._dispatchDataChange=function(t){this._dispatch("dataChanged",t),this._wrapSize&&!this._wrapTimerId&&(this._wrapTimerId=setTimeout(this._updateWrapCount))},Ce.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 n=this.enableColumnStats(i),o=this._parent.getColumnStats(i);n&&o&&n.setColumnDataGetter(o.getColumnDataGetter())}}},Ce.prototype._populateGroups=function(){var t,e,i,n,o,r,s=this._rids;this._rids=[];var a={},l=[];for(e=s.length,t=0;t<e;++t){var u=s[t],h=this._dt.getRowData(u);if(h){(r=(o=this._resolveGroupId(h)).length)>1&&(this._shared.multiGroupRow=!0);for(var p=0;p<r;p++){var d=a[n=o[p]];d?d.push(u):(d=[u],a[n]=d,l.push(n))}}}if(this._shared.autoGroupRemoval)for(t=e=this._groupList.length;--t>=0;)a[n=this._groupList[t]]||(i=this._groupMembers[n])&&!i._predefinedGroup&&this._removeGroupMember(t,n);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;)n=this._groupList[t],(i=this._groupMembers[n])&&i._predefinedGroup&&(c?c.indexOf(i._groupId)<0&&this._removeGroupMember(t,n):this._removeGroupMember(t,n));if(c)for(e=c.length,t=0;t<e;++t){var _=this._addGroup(c[t]);_&&(_._predefinedGroup=!0)}for(e=l.length,t=0;t<e;++t)this._addGroup(l[t]);for(e=this._groupList.length,t=0;t<e;++t)n=this._groupList[t],(i=this._groupMembers[n])._updateRowIds(a[n]),i._markColumnStatsDirty();this._groupViewDirty=!0,this._rebuildRowIdsFromChildren()},Ce.prototype._removeGroupMember=function(t,e){var i=this._groupMembers[e];i&&(this._groupList.splice(t,1),delete this._groupMembers[e],i.dispose())},Ce.prototype._defaultGroupCriteria=function(t,e){var i=e[t];return Array.isArray(i)?i.map((function(t){return t+""})):[i+""]},Ce.prototype._groupFilterLogic=function(t,e){return this._groupCriteria[this._groupLevel-1](e).indexOf(this._groupId)>=0},Ce.prototype._internalGroupSortingLogic=function(t,e){var i=this._groupMembers[t],n=this._groupMembers[e];return this._groupSortingLogic(t,e,i,n)},Ce.prototype._addGroup=function(t){var e=t+"";if(!e)return null;var i=this._groupMembers[e];if(i)return null;var n,o=(this._groupRowId||"_grp")+"_"+e;if(this._hasListener("beforeGroupAdded")&&(n={dataView:this,newGroupId:e,newGroupValue:t,newGroupRowId:o,newGroupLevel:this._groupLevel+1},this._dispatch("beforeGroupAdded",n),n.cancel))return null;i=new Ce;var r=this._shared.defaultCollapse;return null!=r&&(i._collapsed=r),i._groupId=e,"string"==typeof t?"null"==t?i._groupValue=null:"undefined"!=t&&(i._groupValue=t):i._groupValue=t,n&&!0===n.hideHeaderRow&&(i._hiddenHeaderRow=!0),i._groupRowId=o,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},Ce.prototype._triggerGroupRefreshing=function(){this._groupLevel>0?this._parent&&this._parent._triggerGroupRefreshing():this._groupRows&&!this._refreshTimerId&&(this._refreshTimerId=setTimeout(this._onRefreshTimeout,100))},Ce.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 i=this._groupList[e],n=this._groupMembers[i];if(n._rebuildRowIdsFromChildren(),ot.pushArrayItems(this._rids,n._rids),!this._collapsed&&this._groupView&&(n._isHeaderRowShown()&&this._groupView.push(n._groupRowId),!n._collapsed)){var o=n._getFirstHiddenRids()||n._groupView||n._rids;ot.pushArrayItems(this._groupView,o),ot.pushArrayItems(this._groupView,n._footerRowIds)}}this._groupViewDirty=!1,this._updatePageCount()||this._transformView()}},Ce.prototype._resolveGroupId=function(t){return this._groupCriteria[this._groupLevel](t)},Ce.prototype._markColumnStatsDirty=function(){for(var t in this._columnStats)this._columnStats[t].markDirty()},Ce._defaultFilterLogic=function(t,e,i,n){return n[t]===e},Ce._defaultGroupSortingLogic=function(t,e){return t==e?0:t<e?-1:1};var Se=Ce,we=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)};we.prototype._data,we.prototype._func=null,we.prototype._delay=0,we.prototype._timerId=0,we.prototype._conflated=!1,we.prototype._disabled=!1,we.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},we.prototype.popAllData=function(){if(this._data.length){var t=this._data;return this._data=[],t}return null},we.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},we.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))},we.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},we.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},we.prototype.getData=function(){return this._data},we.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},we.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},we.prototype.disable=function(t){this._disabled=!1!==t},we.prototype.isEnabled=function(){return!this._disabled},we.prototype.enable=function(t){this._disabled=!1===t},we._proto=we.prototype;var be=we,Re=function(t){var e=this;e._onDataChanged=e._onDataChanged.bind(e),e.extendEventArg=e.extendEventArg.bind(e),e._dataChangedConflator=new be(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")};s.inherits(Re,lt),Re._runningId=0,Re.prototype._id="",Re.prototype._type="",Re.prototype._grid=null,Re.prototype._snapshot=null,Re.prototype._dataView=null,Re.prototype._dataArg=null,Re.prototype._autoSyncRowCount,Re.prototype._bindingEnabled=!0,Re.prototype._parent=null,Re.prototype._children=null,Re.prototype._dataChangedConflator,Re.prototype.getId=function(){return this._id},Re.prototype.setId=function(t){return this._id=t||"section"+Re._runningId++,this._grid.setAttribute("id",this._id),this._id},Re.prototype.getSection=function(){return this._snapshot||this._grid},Re.prototype.getSectionName=function(){return this._grid.getId()},Re.prototype.getIndex=function(){return this._grid.getIndex()},Re.prototype.getType=function(){return this._type},Re.prototype.setType=function(t){this._type!==t&&(this._type&&this._grid.removeClass(this._type),this._type=t||"",t&&this._grid.addClass(t))},Re.prototype.getDataSource=function(){return this._dataView},Re.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))},Re.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},Re.prototype.getData=function(t,e){return this._dataView?(e=this._getRowId(e),this._dataView.getData(e,t)):null},Re.prototype.setData=function(t,e,i){return!!this._dataView&&(e=this._getRowId(e),this._dataView.setData(e,t,i),!0)},Re.prototype.getRowData=function(t){return this._dataView?(t=this._getRowId(t),this._dataView.getRowData(t)):null},Re.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)},Re.prototype.activateColumns=function(t,e,i){if("content"===this._type)for(var n=i+1;--n>=e;){var o=t[n];null!=o&&this._grid.activateColumn(n,o)}},Re.prototype.getChildren=function(){return this._children},Re.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))},Re.prototype.getParent=function(){return this._parent},Re.prototype.getDataChangedConflator=function(){return this._dataChangedConflator},Re.prototype.disableConflation=function(t){this._dataChangedConflator.disable(t)},Re.prototype.disableDataBinding=function(t){this._bindingEnabled=!1===t},Re.prototype.getAutoSyncRowCount=function(){return null!=this._autoSyncRowCount?this._autoSyncRowCount:"content"===this._type},Re.prototype.setAutoSyncRowCount=function(t){if(this._autoSyncRowCount=t,this.getAutoSyncRowCount()){var e=this._dataView?this._dataView.getVisibleRowCount():0;this._grid.setRowCount(e)}},Re.prototype.isDataBindable=function(){return!(!this._bindingEnabled||!this._dataView)},Re.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},Re.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},Re.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},Re.prototype.extendDataEventArg=function(t,e,i){var n,o;if(t||(t={}),t.firstUpdate=e,t.lastUpdate=i,this._snapshot?(n=0,o=this._grid.getRowCount()):(n=this._grid.getFirstIndexInView(),o=this._grid.getLastIndexInView()+1),t.fromRowIndex=e>n?e:n,this._dataView){var r=this._dataView.getVisibleRowCount();t.dataRowCount=r,o>r&&(o=r)}return t.toRowIndex=i+1<o?i+1:o,this.extendEventArg(t),t},Re.prototype.setIndex=function(t){this._grid.setIndex(t)},Re.prototype.getRowOffset=function(){return this._grid.getRowOffset()},Re.prototype.setRowOffset=function(t){this._grid.setRowOffset(t)},Re.prototype.enableColumnVirtualization=function(t){t=!1!==t,"content"===this._type&&this._grid.enableColumnVirtualization(t)},Re.prototype.isBinding=function(){return this._isEventDispatching("dataChanged")},Re.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))}},Re.prototype._dispatchDataChanged=function(t,e){var i=this.getAutoSyncRowCount(),n=this._dataView?this._dataView.getVisibleRowCount():0,o=this._grid.getRowCount();i?n!==o&&this._grid.setRowCount(n,!0):n>o&&(e=o-1),this.updateRowData(t,e,this._dataArg),this._dataArg=null},Re.prototype.updateRowData=function(t,e,i){this.isDataBindable()&&(this._grid._getTempRowHeights()&&(t=this._grid.getFirstIndexInView(),e=this._grid.getLastIndexInView()+1),(i=this.extendDataEventArg(i,t,e)).fromRowIndex<i.toRowIndex&&this._dispatch("dataChanged",i))},Re.prototype.rerender=function(){this.isDataBindable()?this.updateRowData():this._dispatch("rowAvailable",this.extendEventArg())},Re.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())}},Re.prototype._getRowId=function(t){return ot.isNumber(t)?this._dataView.getRowId(t):t},Re.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 n=i.length;--n>=0;)e.updatedRids[i[n]]=!0;else t.rid&&(e.updatedRids[t.rid]=!0);"updated"!==t.type&&(e.indexShifted=!0,"removed"===t.type&&(e.dataRemoved=!0))}},Re.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))},Re._proto=Re.prototype;var Ie=Re,De=function(t){this._layout=t,this._arg={},this._addEvent("indexChanged")};s.inherits(De,lt),De.prototype._layout,De.prototype._viewSize=0,De.prototype._viewOffset=0,De.prototype._startOffsetCount=0,De.prototype._endOffsetCount=0,De.prototype._bufferSize=0,De.prototype._arg=null,De.prototype._enabled=!0,De.prototype._active=!0,De.prototype._virtualizable=!1,De.prototype._getMinIndex=function(){return this._startOffsetCount},De.prototype._getMaxIndex=function(){var t=this._layout.getLaneCount()-this._endOffsetCount;return t>this._startOffsetCount?t:this._startOffsetCount},De.prototype.getContentStart=function(t){return this._layout.getLaneStart(t)},De.prototype.getContentInViewCount=function(){var t=this.getFirstIndexInView(),e=this.getLastIndexInView();return t>=0&&t<e?e-t+1:0},De.prototype._getContentSizeInBounds=function(){var t=this._getMinIndex(),e=this._getMaxIndex();return this._layout.getLaneStart(e)-this._layout.getLaneStart(t)},De.prototype.getViewSize=function(){return this._viewSize},De.prototype.getViewOffset=function(){var t=this._getMinIndex();return this._viewOffset+this._layout.getLaneStart(t)},De.prototype.getIndexOffset=function(){return this._startOffsetCount},De.prototype.isVirtualizable=function(){return this._virtualizable},De.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)},De.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},De.prototype.getPrevFirstIndexInView=function(){return null!=this._arg.prevFirstIndex?this._arg.prevFirstIndex:-1},De.prototype.getPrevLastIndexInView=function(){return null!=this._arg.prevLastIndex?this._arg.prevLastIndex:-1},De.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(),n=this._arg.prevFirstIndex!==e||this._arg.prevLastIndex!==i;return(t||n)&&(this._arg.firstIndex=e,this._arg.lastIndex=i,this._dispatch("indexChanged",this._arg),this._arg.prevFirstIndex=e,this._arg.prevLastIndex=i),n},De.prototype.isEnabled=function(){return this._enabled},De.prototype.enable=function(t){t=!1!==t,this._enabled!==t&&(this._enabled=t,this.validateVirtualization(),this.update(!0))},De.prototype.disable=function(t){this.enable(!1===t)},De.prototype.isActive=function(){return this._active},De.prototype.activate=function(t){t=!1!==t,this._active!==t&&(this._active=t,this.validateVirtualization(),this.update(!0))},De.prototype.deactivate=function(t){this.activate(!1===t)},De.prototype.getBufferSize=function(){return this._bufferSize},De.prototype.setContentLayout=function(t){this._layout!==t&&(this._layout=t,this.validateVirtualization())},De.prototype.setViewSize=function(t){t<0&&(t=0),this._viewSize!==t&&(this._viewSize=t,this.validateVirtualization())},De.prototype.setViewOffset=function(t){this._viewOffset=t>0?t:0,this.update()},De.prototype.setViewBounds=function(t,e){this._startOffsetCount=t>0?t:0,this._endOffsetCount=e>0?e:0,this.validateVirtualization()},De.prototype.setBufferSize=function(t){t<0&&(t=0),this._bufferSize!==t&&(this._bufferSize=t,this.validateVirtualization())},De.prototype.validateVirtualization=function(){this._virtualizable=!1,this._enabled&&this._active&&this._viewSize>0&&this._getContentSizeInBounds()>this._viewSize&&(this._virtualizable=!0)},De._proto=De.prototype;var xe=De,Ae=function(){var t=this;t._vertical=!0,t._hostClassName="vscrollbar-host",Ae.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")};s.inherits(Ae,pe),Ae.prototype.setScrollContent=function(t,e,i){this._clearAllPanes();var n=e.length;if(!(n<=0)){for(var o=this._panes[0],r=this._paneSliders[0],s=0;s<i;)e[s++].setParent(t);o.setParent(t);for(var a=n-this._footerCount;s<a;)e[s++].setParent(r);for(;s<n;)e[s++].setParent(t);this.invalidateContent()}},Ae.prototype.setHeight=function(t){return this.setTrackSize(t,t),!0},Ae.prototype.getHeight=function(){return this.getPaneSize()},Ae.prototype.getScrollTop=function(){return this._getScrollValue()},Ae.prototype.setScrollTop=function(t){this.update(),this._scrollTo(t)},Ae.prototype.isEndOfVerticalScroll=function(){return this._isEndOfScroll()},Ae.prototype.getContentHeight=function(){for(var t=this._paneSliders[0].getContent(!0),e=0,i=t.length;--i>=0;)e+=t[i].offsetHeight;return e},Ae.prototype.calculateContentSize=function(){return this.getContentHeight()},Ae.prototype.getPane=function(){return this._panes[0]},Ae.prototype._onScroll=function(t){this._dispatch("contentScrolled",t)},Ae._proto=Ae.prototype;var Le=Ae,Te=function(t,e){return t>e?e:t<0?0:t},Ee=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 fe(t),e._grid.setParent(e._element),e._layoutY=new qt,e._selectionList=new ae,e._reverter=new ue(e._onRestingPosition,200),e._addEvent("rowHighlighted"),e._addEvent("rowCountChanged"),e._addEvent("rowHeightChanged"),e._addEvent("rowAvailable")};s.inherits(Ee,Ht),Ee.prototype._index=-1,Ee.prototype._rowOffset=0,Ee.prototype._firstIndex=0,Ee.prototype._grid,Ee.prototype._layoutY,Ee.prototype._selectionList=null,Ee.prototype._reverter=null,Ee.prototype._rowBounds=null,Ee.prototype._rowBoundCache=null,Ee.prototype._rowSelDirty=!1,Ee.prototype._cellBound=null,Ee.prototype._cbLftIdx=0,Ee.prototype._cbRgtIdx=0,Ee.prototype._cbTopIdx=0,Ee.prototype._cbBtmIdx=0,Ee.prototype._rowBoundTimer=0,Ee.prototype._boundLayer=null,Ee.prototype._hscrollbar=null,Ee.prototype._session="A",Ee.prototype._tempRowHeights=null,Ee.prototype.getWidth=function(){return this.isVisible()?this._grid.getWidth():0},Ee.prototype.getHeight=function(){return this.isVisible()?this._element.offsetHeight:0},Ee.prototype.dispose=function(){this.setRowCount(0),this.unlistenAll(),this._hscrollbar=null,this._grid.dispose(),this._dispose(),this._reverter.dispose(),this._rowBounds=this._rowBoundCache=null,this._rowSelDirty=!1,this._rowBoundTimer&&(clearTimeout(this._rowBoundTimer),this._rowBoundTimer=0)},Ee.prototype.setWidth=function(t){return this._grid.setWidth(t)},Ee.prototype.setHeight=function(t){return console.log("unsupported"),!1},Ee.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._dispatchRowHeightChangedEvent(0,this._layoutY.getLaneCount())},Ee.prototype.hitTest=function(t,e){var i=[];return i.colIndex=this._grid.hitTestX(t),i.rowIndex=this._layoutY.hitTest(e),i},Ee.prototype.hitTestX=function(t){return this._grid.hitTestX(t)},Ee.prototype.hitTestY=function(t){return this._layoutY.hitTest(t)},Ee.prototype.getDefaultColumnWidth=function(){return this._grid.getDefaultColumnWidth()},Ee.prototype.setDefaultColumnWidth=function(t){this._grid.setDefaultColumnWidth(t)},Ee.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},Ee.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()))},Ee.prototype.getColumnWidth=function(t){return this._grid.getColumnWidth(t)},Ee.prototype.setColumnWidth=function(t,e){return this._grid.setColumnWidth(t,e)},Ee.prototype._setColumnWidth=function(t,e){return this._grid._setColumnWidth(t,e)},Ee.prototype._updateColumnLayout=function(){this._grid._updateColumnLayout()},Ee.prototype._startBindingSession=function(t){if(this._isBinding=t,!t){if(this._tempRowHeights){var e=this.getDefaultRowHeight(),i=!0,n=[];for(var o in this._tempRowHeights){var r=+o,s=this._layoutY.getLaneProperty(r,"sizeSession");s&&s!=this._session&&(this.setRowHeight(r,e),this._layoutY.setLaneProperty(r,"sizeSession",null),n.push(r))}for(var a=n.length,l=0;l<a;l++)delete this._tempRowHeights[n[l]];if(a)for(var u in this._tempRowHeights){i=null!=u;break}i||(this._tempRowHeights=null)}this._session="A"===this._session?"B":"A"}},Ee.prototype._getTempRowHeights=function(){return this._tempRowHeights},Ee.prototype.getRowHeight=function(t){return this._layoutY.getLaneSize(t)},Ee.prototype.setRowHeight=function(t,e){return this._isBinding&&e!=this.getDefaultRowHeight()&&(this._layoutY.setLaneProperty(t,"sizeSession",this._session),this._tempRowHeights||(this._tempRowHeights=[]),this._tempRowHeights[t]=!0),!!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))},Ee.prototype.isColumnVisible=function(t){return this._grid.isColumnVisible(t)},Ee.prototype.hideColumn=function(t,e){return this._grid.hideColumn(t,e)},Ee.prototype.isRowVisible=function(t){return this._grid.isRowVisible(t-this._firstIndex)},Ee.prototype.hideRow=function(t,e){return this._grid.hideRow(t-this._firstIndex,e)},Ee.prototype.getMinimumColumnWidth=function(t){return this._grid.getMinimumColumnWidth(t)},Ee.prototype.setMinimumColumnWidth=function(t,e){return this._grid.setMinimumColumnWidth(t,e)},Ee.prototype.getMinimumRowHeight=function(t){return this._layoutY.getMinimumLaneSize(t)},Ee.prototype.setMinimumRowHeight=function(t,e){return console.log("unsupported"),!1},Ee.prototype.getCellLeft=function(t){return this._grid.getCellLeft(t)},Ee.prototype.getCellTop=function(t){return this._layoutY.getLaneStart(t)},Ee.prototype.getCellWidth=function(t,e){return this._grid.getCellWidth(t,0)},Ee.prototype.getCellHeight=function(t,e){return this._layoutY.getLaneSize(e)},Ee.prototype.hasCellSpan=function(){return this._grid.hasCellSpan()},Ee.prototype.getCellRowSpan=function(t,e){return this._grid.getCellRowSpan(t,e-this._firstIndex)},Ee.prototype.setCellRowSpan=function(t,e,i){return this._grid.setCellRowSpan(t,e-this._firstIndex,i)},Ee.prototype.getCellColSpan=function(t,e){return this._grid.getCellColSpan(t,e-this._firstIndex)},Ee.prototype.setCellColSpan=function(t,e,i){return this._grid.setCellColSpan(t,e-this._firstIndex,i)},Ee.prototype.clearCellSpans=function(){return this._grid.clearCellSpans()},Ee.prototype.clearColumnSpans=function(t){return this._grid.clearColumnSpans(t)},Ee.prototype.clearColumnCustomizations=function(){this._grid.clearColumnCustomizations()},Ee.prototype.clearRowCustomizations=function(){this._layoutY.clearLaneCustomizations(),this._grid.clearRowCustomizations()},Ee.prototype.getColumnScalability=function(t){return this._grid.getColumnScalability(t)},Ee.prototype.setColumnScalability=function(t,e){return this._grid.setColumnScalability(t,e)},Ee.prototype.getRowScalability=function(t){return this._layoutY.getLaneScalability(t)},Ee.prototype.setRowScalability=function(t,e){return console.log("unsupported"),!1},Ee.prototype.getCell=function(t,e,i){return this._grid.getCell(t,e-this._firstIndex,i)},Ee.prototype.getCellContent=function(t,e){return this._grid.getCellContent(t,e-this._firstIndex)},Ee.prototype.setCellContent=function(t,e,i){return this._grid.setCellContent(t,e-this._firstIndex,i)},Ee.prototype.getColumnCount=function(){return this._grid.getColumnCount()},Ee.prototype.setColumnCount=function(t){this._grid.setColumnCount(t)},Ee.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},Ee.prototype.setRowCount=function(t,e){var i=this._layoutY.getLaneCount();i!==t&&(this._layoutY.setLaneCount(t),this._tempRowHeights&&(this._tempRowHeights.length=t),this._element.style.height=this._layoutY.getTrackSize()+"px",this._requestUpdatingRowBounds(),this._dispatch("rowCountChanged",{rowCount:t,prevCount:i,noBinding:e}))},Ee.prototype.getVisibleRowCount=function(){return this.getRowCount()},Ee.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))},Ee.prototype.removeRow=function(t){if(!(t<=0)){var e=this._layoutY.getLaneCount();t>e&&(t=e),this.setRowCount(e-t)}},Ee.prototype.setBorders=function(t,e,i,n){this._grid.setBorders(t,e,i,n)},Ee.prototype.getColumnStyle=function(t,e){return this._grid.getColumnStyle(t,e)},Ee.prototype.setColumnStyle=function(t,e,i){this._grid.setColumnStyle(t,e,i)},Ee.prototype.enableColumnClass=function(t,e,i){this._grid.enableColumnClass(t,e,i)},Ee.prototype.hasColumnClass=function(t,e){return this._grid.hasColumnClass(t,e)},Ee.prototype.enableRowClass=function(t,e,i){this._grid.enableRowClass(t-this._firstIndex,e,i)},Ee.prototype.setRowStyle=function(t,e,i,n){this._grid.setRowStyle(t-this._firstIndex,e,i,n)},Ee.prototype.getContentWidth=function(){return this._grid.getContentWidth()},Ee.prototype.getContentHeight=function(){return this._layoutY.getTrackSize()},Ee.prototype.getCellsByRowIndex=function(t){return this._grid.getCellsByRowIndex(t-this._firstIndex)},Ee.prototype.disableHorizontalGridLine=function(t){this._grid.disableHorizontalGridLine(t)},Ee.prototype.disableVerticalGridLine=function(t){this._grid.disableVerticalGridLine(t)},Ee.prototype.enableShading=function(t){this._grid.enableShading(t)},Ee.prototype.setTransposedShading=function(t){this._grid.setTransposedShading(t)},Ee.prototype.enableRowHighlighting=function(t){this._grid.enableRowHighlighting(t)},Ee.prototype.getRowHighlight=function(){var t=this._grid.getRowHighlight();return t>=0&&(t+=this._firstIndex),t},Ee.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)}},Ee.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},Ee.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},Ee.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},Ee.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._rowSelDirty=!0,this._initBoundLayer()),this._requestUpdatingRowBounds()},Ee.prototype.selectSingleRow=function(t){this._selectionList.clearAllSelections(),this._grid.clearSelectedRows(),this.setSelectedRow(t)},Ee.prototype.selectRowRange=function(t,e){this._selectionList.selectRange(t,e),this._updateRowSelection(),this._rowSelDirty=!0,this._initBoundLayer(),this._requestUpdatingRowBounds()},Ee.prototype.clearSelectedRows=function(){var t=this._selectionList.clearAllSelections();return this._grid.clearSelectedRows(),this._requestUpdatingRowBounds(),t},Ee.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},Ee.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},Ee.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},Ee.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},Ee.prototype.activateColumn=function(t,e){this._grid.activateColumn(t,e)},Ee.prototype.activateRows=function(t,e,i){var n=this._layoutY.getLaneCount();t||(t=this._rowOffset),e||0===e||(e=t+n),(t-=this._rowOffset)<0&&(t=0),(e-=this._rowOffset)<0&&(e=0);var o=this._getInnerRowCount(),r=this._firstIndex,s=0;(s=t-(1&t))<0?s=0:s>n&&(s=n);var a=e+(1&e)-s;a+2===o&&(a=o),a<0?a=0:a+s>n&&(a=n-s),this._firstIndex=s;var l=s+a,u=this._layoutY.getLaneStart(s),h=this._grid.getElement();h&&(h.style.transform=u?"translateY("+u+"px)":"",h.style.top="",this._reverter.start()),this._grid._onEnterDocument();var p=!1;if(a!==o){if(this._grid.setRowCount(a),a>o){var d={};d.prevRowIndex=s+o,d.rowIndex=s+a,i&&(d.noDataUpdate=!0),this._dispatch("rowAvailable",d)}p=!0}if(i){if(!p){this._grid.clearSelectedRows();var c=r+o;s<r&&r<l&&c>=l?(this.moveRowsToTop(l-r),i[0]=s,i[1]=r):r<s&&s<c&&l>=c?(this.moveRowsToTop(s-r),i[0]=c,i[1]=l):s===r&&l===c?(i[0]=0,i[1]=0):p=!0}p&&(i[0]=s,i[1]=l)}this._layoutY.isHomogeneous()||this._grid._updateRowHeights(this._layoutY,s),this._updateRowSelection()},Ee.prototype.moveRowsToTop=function(t){this._grid.moveRowsToTop(t)},Ee.prototype.getFirstIndexInView=function(){return this._firstIndex},Ee.prototype.getLastIndexInView=function(){var t=this._firstIndex+this._getInnerRowCount()-1,e=this._grid._getContext().getDataSource(),i=e?e.getRowCount()-1:-1;return t>i?i:t},Ee.prototype.isInCurrentView=function(t){return this._firstIndex<=t&&t<this._firstIndex+this._getInnerRowCount()},Ee.prototype.getFrozenLayout=function(){return this._grid.getFrozenLayout()},Ee.prototype.setFrozenLayout=function(t){this._grid.setFrozenLayout(t)},Ee.prototype.getColumn=function(t){return this._grid.getColumn(t)},Ee.prototype.insertColumn=function(t,e){return this._grid.insertColumn(t,e)},Ee.prototype.removeColumnAt=function(t){return this._grid.removeColumnAt(t)},Ee.prototype.moveColumn=function(t,e){this._grid.moveColumn(t,e)},Ee.prototype.enableRowVirtualization=function(t){},Ee.prototype.enableColumnVirtualization=function(t){this._grid.enableColumnVirtualization(t)},Ee.prototype.getColumnIndex=function(t){return this._grid.getColumnIndex(t)},Ee.prototype.getCellIndex=function(t,e){var i=this._grid.getCellIndex(t,e);return i<0?-1:i+this._firstIndex},Ee.prototype.getIndex=function(){return this._index},Ee.prototype.setIndex=function(t){this._index=t},Ee.prototype.setRowOffset=function(t){this._rowOffset=t},Ee.prototype.getRowOffset=function(){return this._rowOffset},Ee.prototype.updateLayout=function(){this._grid.updateLayout()},Ee.prototype.stretchCell=function(t,e,i,n){var o=this._grid.stretchCell(t,null!=e?e-this._firstIndex:null,i,n);if(o){var r=o.getElement();0===e?r.classList.add("top"):r.classList.remove("top")}return o},Ee.prototype.unstretchCell=function(t,e){return this._grid.unstretchCell(t,null!=e?e-this._firstIndex:null)},Ee.prototype.unstretchAllCells=function(){this._grid.unstretchAllCells()},Ee.prototype.getStretchedCell=function(t,e){return this._grid.getStretchedCell(t,null!=e?e-this._firstIndex:null)},Ee.prototype.getStretchedCells=function(){return this._grid.getStretchedCells()},Ee.prototype.updateStretchedCells=function(){return this._grid.updateStretchedCells()},Ee.prototype.getColumnHost=function(){return this._grid.getElement()},Ee.prototype.setHidingMethod=function(t){this._grid.setHidingMethod(t)},Ee.prototype.getHidingMethod=function(){return this._grid.getHidingMethod()},Ee.prototype.setColumnVisibility=function(t,e,i){return this._grid.setColumnVisibility(t,e,i)},Ee.prototype.getRowLayout=function(){return this._layoutY},Ee.prototype.reserveRightSpace=function(t){return this._grid.reserveRightSpace(t)},Ee.prototype.getReservedSpace=function(){return this._grid.getReservedSpace()},Ee.prototype.getComputedStyle=function(){return this._grid.getComputedStyle()},Ee.prototype.isColumnActive=function(t){return this._grid.isColumnActive(t)},Ee.prototype.setRowAttributes=function(t,e){return this._grid.setRowAttributes(t,e)},Ee.prototype.getContextRow=function(t){return this._grid.getContextRow(t-this._firstIndex)},Ee.prototype.selectColumn=function(t,e){this._grid.selectColumn(t,e)},Ee.prototype.isSelectedColumn=function(t){return this._grid.isSelectedColumn(t)},Ee.prototype.selectCell=function(t,e,i){this._grid.selectCell(t,e-this._firstIndex,i)},Ee.prototype.setCellBounds=function(t,e,i,n){var o=this._cellBound;o||((o=this._cellBound=document.createElement("div")).className="selection-bound"),this._initBoundLayer();var r=t+i,s=e+n,a=this.getColumnCount(),l=this._layoutY.getLaneCount();this._cbLftIdx=Te(t,a),this._cbRgtIdx=Te(r,a),this._cbTopIdx=Te(e,l),this._cbBtmIdx=Te(s,l),this._updateCellBounds()},Ee.prototype.getHorizontalLayout=function(){return this._grid.getHorizontalLayout()},Ee.prototype.calculateColumnBounds=function(t,e,i,n){this._grid.calculateColumnBounds(t,e,i,n)},Ee.prototype._updateCellBounds=function(){var t=this._cellBound;if(t){var e,i,n,o,r=this.getHorizontalLayout(),s=this._layoutY,a=this._cbLftIdx,l=this._cbRgtIdx,u=this._cbTopIdx,h=this._cbBtmIdx;e=i=n=o=0,a<l&&u<h&&(e=r.getLaneStart(a),i=r.getLaneEnd(l-1),n=s.getLaneStart(u),o=s.getLaneEnd(h-1));var p=i-e,d=o-n,c=[!1,!1];if(p>0&&d>0&&this._hscrollbar){var _=[0,0];this.calculateColumnBounds(a,l-1,_,c),p=(i=_[1])-(e=_[0])}if(p>0)t.style.left=e+"px",t.style.top=n+"px",t.style.width=p+"px",t.style.height=d+"px",t.classList.toggle("no-left-bound",c[0]),t.classList.toggle("no-right-bound",c[1]),this._boundLayer&&this._boundLayer.appendChild(t);else{var f=t.parentNode;f&&f.removeChild(t)}}},Ee.prototype.updateColumnBounds=function(t,e,i){this._grid.updateColumnBounds(t,e,i),this._updateRowBounds()},Ee.prototype.updateColumnSeparators=function(){this._grid.updateColumnSeparators()},Ee.prototype._initBoundLayer=function(){var t=this._boundLayer;t||((t=this._boundLayer=document.createElement("div")).className="cover-layer",this._element.appendChild(t))},Ee.prototype._requestUpdatingRowBounds=function(){this._rowBoundTimer||(this._rowBoundTimer=setTimeout(this._updateRowBounds,10))},Ee.prototype._updateRowBounds=function(){if(this._rowBoundTimer=0,this._updateCellBounds(),this._rowSelDirty){var t=this._rowBounds,e=this._rowBoundCache;t||(t=this._rowBounds=[]),e||(e=this._rowBoundCache=[]);var i=this._selectionList,n=this._layoutY.getLaneCount();i.deselectFrom(n);var o,r=i.getConnectedRanges(),s=r.length,a=null,l=null,u=t.length;for(o=s;o<u;++o)(a=(l=t[o]).parentNode)&&a.removeChild(l);if(t.length=u=s,s){var h=0,p=0,d=0,c=!1;this._hscrollbar&&(h=this._hscrollbar.getScrollLeft(),p=this._hscrollbar.getPinnedLeftColumnCount(),d=this._hscrollbar.getPinnedRightColumnCount(),c=this._hscrollbar.isEndOfHorizontalScroll());var _=!p&&h>0,f=!d&&!c,g=this._grid._getViewSize();for(o=0;o<s;++o){var y=r[o],m=y[0],v=y[1],C=this._layoutY.getLaneStart(m),S=this._layoutY.getLaneEnd(v);(l=e[o])||((l=e[o]=document.createElement("div")).className="selection-bound"),l.style.top=C+"px",l.style.height=S-C+"px",l.style.width=g+"px",l.classList.toggle("no-left-bound",_),l.classList.toggle("no-right-bound",f),this._boundLayer&&(t[o]||(t[o]=l,this._boundLayer.appendChild(l)))}}else{i.getSelectionCount()||(this._rowSelDirty=!1)}}},Ee.prototype._getInnerRowCount=function(){return this._grid.getRowCount()},Ee.prototype._updateRowSelection=function(){this._grid.clearSelectedRows();var t=this._selectionList,e=t.getSelectionCount();if(!(e<=0)){var i,n=this._firstIndex,o=n+this._getInnerRowCount();if(1===e)n<=(i=t.getFirstSelectedIndex())&&i<o&&this._grid.setSelectedRow(i-n,!0);else if(e>=o-n)for(i=n;i<o;++i)t.getSelection(i)&&this._grid.setSelectedRow(i-n,!0);else for(var r=t.getAllSelections(),s=0;s<e;++s)n<=(i=r[s])&&i<o&&this._grid.setSelectedRow(i-n,!0)}},Ee.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},Ee.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":""}},Ee.prototype._updateRightSpaceStyle=function(){this._grid._updateRightSpaceStyle()},Ee.prototype._updateLayers=function(){this._grid._updateLayers()},Ee.prototype._setContext=function(t){this._grid._setContext(t)},Ee.prototype._getContext=function(){return this._grid._getContext()},Ee._proto=Ee.prototype;var Me=Ee,Fe=function(t,e){return t-e},Pe=function(t){Pe._sectionType||(Pe._sectionType={},Pe._sectionType.title=!0,Pe._sectionType.header=!0,Pe._sectionType.content=!0,Pe._sectionType.footer=!0);var e=this;if(e.getColumnId=e.getColumnId.bind(e),e.getColumnIndex=e.getColumnIndex.bind(e),e._onMouseMove=e._onMouseMove.bind(e),e._onRowHightlighted=e._onRowHightlighted.bind(e),e._onGridClicked=e._onGridClicked.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._onSyncHScroll=e._onSyncHScroll.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),e._requestScrollbarUpdate=e._requestScrollbarUpdate.bind(e),t)for(var i=t.childNodes.length;--i>=0;)ot.isElement(t.childNodes[i])||t.removeChild(t.childNodes[i]);e._element=t||document.createElement("div"),e._element.classList.add("tr-grid"),e._layoutX=new qt,e._layoutY=new qt,e._layoutX.setDefaultLaneSize(100),e._layoutY.setDefaultLaneSize(32),e._settings=[],e._plugins={},e._columnDefs=[],e._sectionStarts=[],e._rowHeightException="title",e._rowVirtualizer=new xe(e._layoutY),e._rowVirtualizer.deactivate(),e._rowVirtualizer.setViewSize(360),e._colVirtualizer=new xe(e._layoutX),e._colVirtualizer.enable(!1),e._colVirtualizer.deactivate(),e._colVirtualizer.setViewSize(400),e._vscrollbar=new Le,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 ce,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),ot.isMobile||ot.isTouchDevice?e._element.addEventListener("touchmove",this._onMouseMove,!1):e._element.addEventListener("mousemove",this._onMouseMove,!1),ot.isSafari&&e._element.addEventListener("click",this._onGridClicked),window.addEventListener("resize",e._onWindowResize,!1),e._rowVirtualizer.listen("indexChanged",e._onRowInViewChanged),e._colVirtualizer.listen("indexChanged",e._onColInViewChanged),e._rowHeightConflator=new be(e._onRowHeightChanged,50),e._vScrollbarConflator=new be(e._updateVScrollbar,200),e._columnBoundConflator=new be(e._updateColumnBounds,10),e._columnPositionConflator=new be(e._dispatchColumnPositionChanged,10),e._rowPositionConflator=new be(e._dispatchRowPositionChanged,10),e._addEvents("sectionAdded","columnAdded","columnRemoved","columnMoved","columnVisibilityChanged","columnAlignmentChanged","widthChanged","dataSourceChanged","postDataSourceChanged","preSectionRender","postSectionRender","beforeContentBinding","preSectionDataBinding","postSectionDataBinding","firstRendered","afterContentBinding","rowExpansionBinding","rowHighlighted","preForcedUpdate","rowAdded","rowRemoved","columnPositionChanged","rowPositionChanged","beforeColumnBoundUpdate","beforeBatchOperation","afterBatchOperation","pinningChanged");var n=Pe.map;n||(n={},Pe.map=n);var o=e._element;o._control=e;var r=o.id||o.name;r&&!n[r]||(r="_grid"+Pe._runningGridId),e._id=r,n[r]=e,Pe._runningGridId++;var s=document.createElement("input");s.style.position="absolute",s.style.width="0",s.style.height="0",s.style.padding="0",s.style.border="0",s.value="0",e._hiddenInput=s,o.insertBefore(s,o.firstChild),Object.defineProperty(e,"zoomFactor",{set:function(t){!t||t<0||this._zoomFactor!==t&&(this._zoomFactor=t,e._updateLayout())},get:function(){return this._zoomFactor}})};s.inherits(Pe,Ht),Pe.SectionReference,Pe.MouseInfo,Pe.BatchInfo,Pe.CellReference,Pe.ColumnOptions,Pe._runningGridId=0,Pe._runningColumnId=0,Pe._sectionType,Pe.prototype._plugins,Pe.prototype._dataSource=null,Pe.prototype._layoutX,Pe.prototype._layoutY,Pe.prototype._vscrollbar,Pe.prototype._hscrollbar,Pe.prototype._tempFrozenSectionRef="",Pe.prototype._startVScrollbarIndex=-1,Pe.prototype._hScrollbarEnabled=!0,Pe.prototype._pinnedLeftColumnCount=0,Pe.prototype._pinnedRightColumnCount=0,Pe.prototype._frozenFooterCount=0,Pe.prototype._fixFrozenTopSections=!1,Pe.prototype._fixFrozenBottomSection=!1,Pe.prototype._sectionStarts,Pe.prototype._settings,Pe.prototype._firstSettings,Pe.prototype._lastSettings,Pe.prototype._fitContentWidth=!1,Pe.prototype._columnDefs,Pe.prototype._rowVirtualizer,Pe.prototype._colVirtualizer,Pe.prototype._autoSetDataSource=!0,Pe.prototype._renderingHandler=null,Pe.prototype._dataBindingHandler=null,Pe.prototype._frozenLayout=!1,Pe.prototype._noBinding=!1,Pe.prototype._rowHeightSync=!0,Pe.prototype._rowHighlighting=!1,Pe.prototype._dispatchingDataChanged=!1,Pe.prototype._rowHeightException="",Pe.prototype._rowScrollingStep=0,Pe.prototype._zoomFactor=1,Pe.prototype._reservedSpace=0,Pe.prototype._hidingMethod="",Pe.prototype._rowHeightConflator=null,Pe.prototype._vScrollbarConflator=null,Pe.prototype._columnBoundConflator=null,Pe.prototype._rowRefreshTimer=0,Pe.prototype._layoutUpdating=!1,Pe.prototype._hiddenInput,Pe.prototype._bottomPadding=6,Pe.prototype._bottomPaddingSect=null,Pe.prototype._preserveProportion=!1,Pe.prototype._preserveGridSize=!1,Pe.prototype._rowHeightTimerId=0,Pe.prototype._groupDefs=null,Pe.prototype._batches=null,Pe.prototype._firstRendered=!1,Pe.prototype._hasPendingRowChange=!1,Pe.getVersion=function(){return"5.1.95"},Pe.prototype.dispose=function(){var t=this._id,e=Pe.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 n=this._getColumnDef(i);n.renderingHandler=n.dataBindingHandler=null}for(var o in this._plugins){var r=this._plugins[o];r.unload&&r.unload(this)}this.removeAllSections();var s=this._vscrollbar._mainScrollbar;s&&(s.unlisten("scroll",this._onSyncVScroll),this._vscrollbar._mainScrollbar=null),(s=this._hscrollbar._mainScrollbar)&&(s.unlisten("scroll",this._onSyncHScroll),this._hscrollbar._mainScrollbar=null),this._vscrollbar.dispose(),this._hscrollbar.dispose(),this._rowHeightConflator.dispose(),this._vScrollbarConflator.dispose(),this._columnBoundConflator.dispose(),this._columnPositionConflator.dispose(),this._rowPositionConflator.dispose(),this._layoutX.dispose(),this._layoutY.dispose();var a=this._element;null!==a&&(a._control&&delete a._control,a.removeChild(this._hiddenInput)),this._dispose(),this._columnDefs.length=0,delete this._plugins}else console.log("WARNING: Core grid is disposed twice")},Pe.prototype.isDisposed=function(){return this._disposed},Pe.prototype.setParent=function(t,e){this._setParent(t,e),this._onParentChange()},Pe.prototype.insertBefore=function(t){this._insertBefore(t),this._onParentChange()},Pe.prototype._onParentChange=function(){var t=this.getParent()||this.getElement();this._vscrollbar._mainScrollbar||this._vscrollbar.setParent(t),this._hscrollbar.setParent(t),this._updateLayout()},Pe.prototype.getConfigObject=function(t){var e=t||{},i=this.getColumnCount();e.columns||(e.columns=[]);for(var n=0;n<i;n++){var o=e.columns[n];o||(o=e.columns[n]={});var r=this._getColumnDef(n);r.userId&&(o.id=r.userId),r.field&&(o.field=r.field),r.styles&&(o.styles=r.styles),r.stationary&&(o.stationary=r.stationary),r.leftPinned&&(o.leftPinned=r.leftPinned),r.rightPinned&&(o.rightPinned=r.rightPinned)}e.rowVirtualization=this.isRowVirtualizationEnabled(),e.columnVirtualization=this.isColumnVirtualizationEnabled(),e.rowHighlighting=this._rowHighlighting,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);var s=this._vscrollbar.getAutoHide();!0!==s&&(e.autoHideScrollbar=s);var a=this._vscrollbar.getMouseWheelSpeed();a&&(e.linearWheelScrolling=a),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.hasClass("no-content-vertical-line")&&(e.contentVerticalLines=!1),this._bottomPaddingSect&&(e.contentBottomPadding=this._bottomPadding),this._reservedSpace>0&&(e.contentRightPadding=this._reservedSpace);var l=this.getDataConflationRate();for(var u in l&&(e.dataConflationRate=l),this._plugins){var h=this._plugins[u];"function"==typeof h.getConfigObject&&h.getConfigObject(e)}return e},Pe.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)},Pe.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",!1!==t&&this.updateLayout()},Pe.prototype.getContentWidth=function(){return this._layoutX.getTrackSize()},Pe.prototype.getSectionCount=function(){return this._settings.length},Pe.prototype._updateFrozenTopSections=function(){if(!this._fixFrozenTopSections){var t=this._getTopSectionCount();this._freezeTopSectionAt(t-1)}},Pe.prototype._updateFrozenBottomSections=function(){if(!this._fixFrozenBottomSection){var t=this._getBottomSectionCount();this._setFrozenFooter(t)}},Pe.prototype._getTopSectionCount=function(){for(var t=this._settings,e=t.length,i=0,n=0;n<e;n++){var o=t[n].getType();if("header"!==o&&"title"!==o)break;i++}return i},Pe.prototype._getBottomSectionCount=function(){for(var t=this._settings,e=0,i=t.length-1;i>=0;i--){if("footer"!==t[i].getType())break;e++}return e},Pe.prototype.addSection=function(t,e){return this.addSectionAt(this.getSectionCount(),t,e)},Pe.prototype.addSectionAt=function(t,e,i){var n=this._settings.length;t<0&&(t=0),t>n&&(t=n);var o=this._toSectionType(e),r="bottomPadding"===i,s=this._newSection(r?"footer":o,i);if(!s)return null;var a=s.getSection();if(r&&(s.setAutoSyncRowCount(!1),this._bottomPaddingSect=a),t>=n?(this._putToLast(a),this._settings.push(s)):(this._settings.splice(t,0,s),a.insertBefore(this._settings[t+1].getSection())),this._updateSectionIndices(t),this._autoSetDataSource&&s.setDataSource(this._dataSource),"footer"===(o=s.getType())?this._updateFrozenBottomSections():"header"!==o&&"title"!==o||this._updateFrozenTopSections(),this._onColumnCountChanged(),this._onSectionCountChanged(!0),this._colVirtualizer.isEnabled()){var l=this._getColActivationList(),u=this.getColumnCount();s.activateColumns(l,0,u-1)}if(this._hasListener("sectionAdded")){var h=s.extendEventArg();this._dispatch("sectionAdded",h)}return a},Pe.prototype.removeSection=function(t){var e=this.getSection(t);return null!==e?this.removeSectionAt(e.getIndex()):null},Pe.prototype.removeSectionAt=function(t){var e=this._settings.length;if(t>=0&&t<e){var i=this._settings[t],n=i.getIndex(),o=i.getSection(),r=i.getType();return o.setRowCount(0),this._settings.splice(t,1),this._updateSectionIndices(n),"footer"===r?(this._updateFrozenBottomSections(),this._onColumnCountChanged()):"header"!==r&&"title"!==r||this._updateFrozenTopSections(),this._onSectionCountChanged(),i.dispose(),o}return null},Pe.prototype.removeLastSection=function(){return this.removeSectionAt(this._settings.length-1)},Pe.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()},Pe.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)},Pe.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 n=null,o=e;--o>=0;){var r=this._settings[o];if(r.getSection()===t){n=r;break}}if(o>=0)return this._putToLast(t),this._settings.splice(o,1),this._settings.push(n),n.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},Pe.prototype.moveSection=function(t,e){var i=this.getSectionCount();if(t<0)t=0;else if(t>=i)return;if(e<0?e=0:e>=i&&(e=i-1),t!==e){var n=this._settings[t],o=this._settings[e];ot.moveArrayItem(this._settings,t,e),o?n.getSection().insertBefore(o.getSection()):this._putToLast(n.getSection()),this._updateSectionIndices(t<=e?t:e),this._syncRowHeights(),this._onSectionCountChanged(),this._frozenLayout||this._rowVirtualizer.update(!0)}},Pe.prototype.getSection=function(t){var e=this.getSectionSettings(t);return null!==e?e.getSection():null},Pe.prototype.getSectionSettings=function(t){if(ot.isString(t)){if(Pe._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 i=-1;if(null!=t.getIndex?i=t.getIndex():ot.isNumber(t)&&(i=t),i>=0&&i<this._settings.length)return this._settings[i]}return null},Pe.prototype.getAllSections=function(t){if(null==t)return this._getAllSections();for(var e=this.getAllSectionSettings(t),i=e,n=i.length;--n>=0;)i[n]=e[n].getSection();return i},Pe.prototype.getAllSectionSettings=function(t){if(!t)return this._settings;var e=this._settings.length,i=[];t=this._toSectionType(t);for(var n=0;n<e;++n){var o=this._settings[n];t===o.getType()&&i.push(o)}return i},Pe.prototype.getSectionIndex=function(t){if(ot.isNumber(t))return t;if(t instanceof MouseEvent){var e=ot.getRelativePosition(t,this._element),i={};return this._hitTestY(e.y,i),i.sectionIndex}var n=this.getSection(t);return null==n?-1:n.getIndex()},Pe.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},Pe.prototype.getPreviousSection=function(t,e){null==t&&(t=this._settings.length);var i=this._getNextSection(-1,t,e);return null!==i?i.getSection():null},Pe.prototype.getNextSection=function(t,e){var i=this._getNextSection(1,t,e);return null!==i?i.getSection():null},Pe.prototype.getLastSection=function(){return this.getSection(this._settings.length-1)},Pe.prototype.getCell=function(t,e,i,n){var o=this.getSection(t);return o?o.getCell(e,i,n):null},Pe.prototype.getCellInfo=function(t){if(!t)return null;var e=t.colIndex,i=t.rowIndex,n=t.sectionName,o=null;if(null==e||null==i)(o=this.getRelativePosition(t)).hit||(o=null);else{n||(n="content");var r=this.getSectionSettings(n);if(r)r.getSection().getCell(e,i)&&((o={}).colIndex=e,o.rowIndex=i,r.extendEventArg(o))}return o},Pe.prototype.getNextCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?e:1)},Pe.prototype.getPrevCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?-e:-1)},Pe.prototype._getNextCellInRow=function(t,e){var i=this.getCellInfo(t);if(i){var n=i.colIndex+e,o=i.rowIndex,r=i.section;i.colIndex=n,i.cell=r.getCell(n,o)}return i},Pe.prototype.getNextCell=function(t){var e=this.getNextCellInRow(t);if(e&&!e.cell){var i=e.section,n=e.colIndex=0,o=e.rowIndex;e.rowIndex=++o,e.cell=i.getCell(n,o)}return e},Pe.prototype.getPrevCell=function(t){var e=this.getPrevCellInRow(t);if(e&&!e.cell){var i=e.section,n=e.colIndex=i.getColumnCount()-1,o=e.rowIndex;e.rowIndex=--o,e.cell=i.getCell(n,o)}return e},Pe.prototype.getColumnCount=function(){return this._layoutX.getLaneCount()},Pe.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)},Pe.prototype.insertColumn=function(t,e){var i=this.getColumnCount();t<i||(t=i),this._layoutX.insertLane(t);for(var n=this._settings.length;--n>=0;){this._settings[n].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)},Pe.prototype.insertColumns=function(t,e){var i=this.getColumnCount();t<i||(t=i);var n,o=0;if(Array.isArray(e)){if(1===(o=e.length))return void this.insertColumn(t,e[0]);n=e}else{if("number"!=typeof e)return void this.insertColumn(t,e);if(1===(o=e))return void this.insertColumn(t,null)}if(!(o<=0)){var r=this.freezeLayout(),s=[t,0].concat(new Array(o));Array.prototype.splice.apply(this._columnDefs,s);for(var a=0;a<o;a++){var l=t+a;this._layoutX.insertLane(l);for(var u=this._settings.length;--u>=0;){this._settings[u].getSection().insertColumn(l)}var h=n&&n[a];this._deserializeColumn(l,h)}this._dispatchColumnAddedEvent(t,o,t<i,n),this.freezeLayout(r)}},Pe.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 n=this._layoutX.removeLaneAt(t),o=this._settings.length,r=0;r<o;++r)this._settings[r].getSection().removeColumnAt(t);var s=this._pinnedLeftColumnCount,a=this._pinnedRightColumnCount,l=this._columnDefs.splice(t,1)[0];if(this._onColumnCountChanged(),(t<s||t>=e-a)&&this._updateScrollbarWidth(!0,!0),this._syncLayoutToColumns(t,e-1,!0),l||(l={}),l.layout=n,this._hasListener("columnRemoved")){var u={atTheMiddle:!0};u.colIndex=t,u.columns="deprecated",u.columnData=l.columnData,u.colId=l.id||"",this._dispatchColumnEvent("columnRemoved",u)}return t<=i&&i===this._colVirtualizer.getLastIndexInView()&&this._colVirtualizer.update(),l},Pe.prototype.removeAllColumns=function(){this.getColumnCount()>0&&(this._pinnedLeftColumnCount=0,this._pinnedRightColumnCount=0,this.setColumnCount(0))},Pe.prototype.getStationaryColumnIndex=function(){for(var t=this.getColumnCount()-1;t>=0;t--)if(this._getColumnDef(t).stationary)return t;return-1},Pe.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 n=0;n<t.length;n++)if(t[n]<=i)return!1}return!0},Pe.prototype.isColumnMovable=function(t){var e=this.getStationaryColumnIndex();return!(e>-1&&t<=e)},Pe.prototype.moveColumn=function(t,e){if("number"==typeof t)return this._moveColumn(t,e);if(!Array.isArray(t))return!1;var i,n=t.length,o=[],r=0,s=this.getColumnCount(),a={};for(i=0;i<n;++i)(r=t[i])>=0&&r<s&&null==a[r]&&(a[r]=1,o.push(r));if(e<0?e=0:e>=s&&(e=s-1),!(n=o.length))return!1;if(1===n)return this._moveColumn(o[0],e);if(!this.isColumnMoveAllowed(o,e))return!1;if(o.sort(Fe),a[e]){var l=!0;for(r=o[0],i=1;i<n;++i)if(++r!==o[i]){l=!1;break}if(l)return!1}var u,h,p=this.freezeLayout(!0),d=0;for(i=0;i<n;++i)(u=o[i])>=e&&(h=e+d,this._moveColumn(u,h),++d);var c=n-d;for(h=d?e-1:e,i=0;i<c;++i)u=o[i]-i,this._moveColumn(u,h);return this.freezeLayout(p),!0},Pe.prototype._moveColumn=function(t,e){var i=this.getColumnCount();if(t<0?t=0:t>=i&&(t=i-1),e<0?e=0:e>=i&&(e=i-1),t===e)return!1;if(!this.isColumnMoveAllowed(t,e))return!1;var n=-1;this._colVirtualizer.isVirtualizable()&&(n=this._colVirtualizer.getLastIndexInView());var o=this.getColumnId(t);this._layoutX.moveLane(t,e);for(var r=this._settings.length,s=0;s<r;++s){this._settings[s].getSection().moveColumn(t,e)}var a=this._columnDefs[t],l=this._countPinnedLeftColumns(),u=this._countPinnedRightColumns();if(ot.moveArrayItem(this._columnDefs,t,e),this._hScrollbarEnabled&&(t<l?e>=i-u?this.freezeColumn(l-2,u+1):e>=l&&this.freezeColumn(l-2,u):a.rightPinned?e<l?this.freezeColumn(l,u-1):e<i-u&&this.freezeColumn(l-1,u-1):e<l?this.freezeColumn(l,u):e>=i-u&&this.freezeColumn(l-1,u+1)),this._hasListener("columnMoved")){var h={};h.fromColIndex=t,h.toColIndex=e,h.colId=o,this._dispatchColumnEvent("columnMoved",h)}return n===this._colVirtualizer.getLastIndexInView()&&(t<=n&&e>n||e<=n&&t>n)&&this._colVirtualizer.update(),this._updateColumnBounds(),this._updateColumnSeparators(),!0},Pe.prototype.moveColumnById=function(t,e){var i=this.getColumnCount(),n=this.getColumnIndex(t);if(n<0||n>=i)return!1;var o=null!=e?this.getColumnIndex(e):-1;return o<0&&(o=i),this._moveColumnByIndex(n,o)},Pe.prototype._moveColumnByIndex=function(t,e){return t<e&&--e,t!==e&&this.moveColumn(t,e)},Pe.prototype.reorderColumns=function(t,e){var i="";"number"==typeof e?i=this.getColumnId(e):e&&(i=e),this.startBatch("move");var n=0;if(Array.isArray(t)){var o=t.length;if(o>1){var r,s,a,l,u=this.getColumnIds(),h=u.length,p=[],d=!1;for(r=0;r<o;++r){var c=t[r];"number"==typeof c?(a=c,s=u[c]||""):(s=c,a=u.indexOf(s)),s&&a>=0&&(p.push(s),i===s&&(d=!0))}if(o=p.length,d){if((l=this.getColumnIndex(i))>=0)for(;++l<h&&(i=u[l],!(p.indexOf(i)<0)););(l<0||l>=h)&&(i="")}for(r=o;--r>=0;)s=p[r],a=this.getColumnIndex(s),(l=this.getColumnIndex(i))<0&&(l=h),n|=this._moveColumnByIndex(a,l),i=s}else n=this.moveColumnById(t[0],i)}else null!=t&&(n=this.moveColumnById(t,i));return this.stopBatch("move"),!!n},Pe.prototype.getColumnLayout=function(){return this._layoutX},Pe.prototype.updateColumnLayout=function(){this._syncLayoutToColumns(0,this.getColumnCount())},Pe.prototype._deserializeColumn=function(t,e){if(e){var i,n=e.layout||e,o=e.width;null!=o&&(n.size=o),null!=(o=e.scalable)&&(n.scalable=o),null!=(o=e.minWidth)&&(n.minSize=o),null==n.scalable&&(n.scalable=null==n.size),this._layoutX.deserializeLane(t,n);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 a=this._getColumnDef(t),l=e.id;l&&"string"==typeof l&&(a.id=l,a.userId=l);var u=e.field;u&&"string"==typeof u&&(a.field=u);var h=e.dataColumnName;null!=h&&(a.dataColumnName=h),null!=(h=e.stationary)&&(a.stationary=!!h),null!=(h=e.leftPinned)&&(a.leftPinned=!!h),null!=(h=e.rightPinned)&&(a.rightPinned=!!h),this.setColumnRenderingHandler(t,e.renderingHandler),this.setColumnDataBindingHandler(t,e.dataBindingHandler),(h=e.columnData)&&this.setColumnData(t,h);var p=e.formatter||e.binding;if(Array.isArray(p)&&(p=p[0]),p&&"function"!=typeof p){var d=p.init;"function"==typeof d&&d(e,this)}}},Pe.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)},Pe.prototype.removeRow=function(t){var e=this.getLastSection();null!=e&&(null==t&&(t=1),e.removeRow(t))},Pe.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},Pe.prototype.setSectionRowCount=function(t,e){var i=this.getSection(t);null!=i&&i.setRowCount(e)},Pe.prototype.getRowIndex=function(t,e){return this._sectionStarts[t]+e},Pe.prototype.getRelativeIndex=ot._deprecatedFunction,Pe.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},Pe.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},Pe.prototype.setDefaultRowHeight=function(t,e){if(this._layoutY.setDefaultLaneSize(t)){this._rowHeightSync=!1;var i=this._layoutY.getDefaultLaneSize();this._rowHeightException=e?"":"title";for(var n=this._settings.length,o=0;o<n;++o){var r=this._settings[o];r.getType()!==this._rowHeightException&&"bottomPadding"!==r.getId()&&r.getSection().setDefaultRowHeight(i)}this._syncRowHeights(),this._rowHeightSync=!0,this.setRowScrollingStep(this._rowScrollingStep),this._updateColumnSeparators()}},Pe.prototype.getDataSource=function(){return this._dataSource},Pe.prototype.setDataConflationRate=function(t){this._dataSource.setConflationRate(t)},Pe.prototype.getDataConflationRate=function(){return this._dataSource.getConflationRate()},Pe.prototype.setDataSource=function(t){t&&t instanceof gt&&(t=new Se(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,n=0;n<i;++n)this._settings[n].setDataSource(t);return this._dispatch("postDataSourceChanged",e),this._dataSource},Pe.prototype.setColumnTemplate=ot._deprecatedFunction,Pe.prototype.getColumnTemplate=ot._deprecatedFunction,Pe.prototype.getColumnRenderEvent=ot._deprecatedFunction,Pe.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)}}},Pe.prototype.setColumnStyle=function(t,e,i,n){if(e){var o;ot.isNumber(t)||(t=0,console.log("WARNING: the first parameter for setColumnStyle must be column index")),null==n?o=this._getNestedColumnDef(t,"styles"):(n=this._toSectionType(n),o=this._getNestedColumnDef(t,n,"styles")),o[e]=i;for(var r=this._settings.length;--r>=0;){var s=this._settings[r];if(null==n||n===s.getType())s.getSection().setColumnStyle(t,e,i)}}},Pe.prototype.enableColumnClass=function(t,e,i,n){var o;"number"!=typeof t&&(t=0),null==n?o=this._getNestedColumnDef(t,"classes"):(n=this._toSectionType(n),o=this._getNestedColumnDef(t,n,"classes"));var r=!1;if((i=!1!==i)?o[e]||(r=o[e]=!0):o[e]&&(delete o[e],r=!0),r)for(var s=this._settings.length;--s>=0;){var a=this._settings[s];null!=n&&n!==a.getType()||a.getSection().enableColumnClass(t,e,i)}return r},Pe.prototype.hasColumnClass=function(t,e,i){var n;return null==i?n=this._getNestedColumnDef(t,"classes"):(i=this._toSectionType(i),n=this._getNestedColumnDef(t,i,"classes")),!(!n||!n[e])},Pe.prototype.setColumnAlignment=function(t,e){var i=e?e.charAt(0).toLowerCase():"",n=0;n|=this.enableColumnClass(t,"tr-align-left","l"===i),n|=this.enableColumnClass(t,"tr-align-right","r"===i),(n|=this.enableColumnClass(t,"tr-align-center","c"===i))&&this._dispatch("columnAlignmentChanged",{colIndex:t,alignment:i})},Pe.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"},Pe.prototype.getColumnLeft=function(t){var e=this._columnDefs[t];if(e&&e.rightPinned){for(var i=this.getElement().clientWidth,n=this._layoutX.getTrackSize(),o=n<i?n:i,r=this.getColumnCount()-1;r>=t;--r)o-=this._layoutX.getLaneSize(r);return o}return this._hScrollbarEnabled&&t>=this._pinnedLeftColumnCount?this._layoutX.getLaneStart(t)-this._hscrollbar.getScrollLeft():this._layoutX.getLaneStart(t)},Pe.prototype.getColumnRight=function(t){return this.getColumnLeft(t)+this._layoutX.getLaneSize(t)},Pe.prototype.getColumnWidth=function(t){return this._layoutX.getLaneSize(t)},Pe.prototype.getColumnCustomLaneSize=function(t){return this._layoutX.getCustomLaneSize(t)},Pe.prototype._calculateColumnWidths=function(t,e){if(!this._preserveGridSize)return e;var i,n=0,o={},r=t.length,s=new Array(r);for(i=0;i<r;i++)o[t[i]]=!0,s[i]=e[i],n+=e[i];var a=0,l=0,u=this.getColumnCount(),h=this._layoutX;for(i=0;i<u;i++)o[i]||h.isLaneVisible(i)&&(h.getLaneScalability(i)?(a+=h.getMinimumLaneSize(i),l++):a+=h.getLaneSize(i));var p=this.getContentWidth(),d=n+a-p;if(l<1||d>0){for(h.resetLaneToDefaultSize(),h.setTrackSize(p-this._reservedSpace),a=0,i=0;i<u;i++)o[i]||h.isLaneVisible(i)&&(h.getLaneScalability(i)?a+=h.getMinimumLaneSize(i):a+=h.getLaneSize(i));if((d=n+a-p)>0)for(d/=r,i=0;i<r;i++)s[i]-=d}return s},Pe.prototype.setColumnWidth=function(t,e,i){var n=this._calculateColumnWidths([t],[e]),o=this._setColumnWidth(t,n[0],i);return o&&this._syncLayoutToColumns(t,t+1),o},Pe.prototype.setColumnWidths=function(t,e){var i,n=0,o=[],r=[],s=[];for(i=t.length;--i>=0;){var a=t[i];null!=a&&(o.push(i),r.push(a));var l=Array.isArray(e)?e[i]:e;s.push(l)}var u=this._calculateColumnWidths(o,r);for(i=0;i<u.length;i++)n|=this._setColumnWidth(o[i],u[i],s[i]);return n&&this._syncLayoutToColumns(0,t.length),!!n},Pe.prototype.isColumnVisible=function(t){return this._layoutX.isLaneVisible(t)},Pe.prototype.hideColumn=function(t,e){var i=!1===e;this.setColumnVisibility(t,i,0)},Pe.prototype.hideColumns=function(t,e){var i=Array.isArray(t)?t.length:0,n=[],o=this.getColumnCount();e=!1!==e;for(var r=0;r<i;++r){var s=t[r];s>=0&&s<o&&this._layoutX.hideLane(s,e,0)&&n.push(s)}if(n.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){var a={};a.colIndices=n,a.hidden=e,this._dispatch("columnVisibilityChanged",a)}},Pe.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 n={};n.colIndices=t,n.hidden=!1,this._dispatch("columnVisibilityChanged",n)}},Pe.prototype.getMinimumColumnWidth=function(t){return this._layoutX.getMinimumLaneSize(t)},Pe.prototype.setMinimumColumnWidth=function(t,e){this._layoutX.setMinimumLaneSize(t,e)&&this._syncLayoutToColumns(t,t+1)},Pe.prototype.setMinimumColumnWidths=function(t,e){for(var i=0,n=NaN,o=NaN,r=t.length;--r>=0;){var s=t[r];null!=s&&(o||(o=r),n=r,i|=this._layoutX.setMinimumLaneSize(r,s,e))}return i&&this._syncLayoutToColumns(n,o+1),!!i},Pe.prototype.getColumnScalability=function(t){return this._layoutX.getLaneScalability(t)},Pe.prototype.setColumnScalability=function(t,e){var i=!1;return ot.isNumber(t)?(e=!1!==e,(i=this._layoutX.setLaneScalability(t,e))&&this._syncLayoutToColumns(t,t+1)):this.setDefaultColumnScalable(t),i},Pe.prototype.setDefaultColumnScalable=function(t){this._layoutX.setDefaultScalability(!!t)},Pe.prototype.resetColumnWidths=function(){var t=this._layoutX.resetLaneToDefaultSize();return t&&this._syncLayoutToColumns(0,this.getColumnCount()),t},Pe.prototype.setColumnDefaultWidth=function(t,e){this._layoutX.setLaneDefaultSize(t,e)},Pe.prototype.preserveProportion=function(t){this._preserveProportion=!0===t},Pe.prototype.isProportionPreserved=function(){return this._preserveProportion},Pe.prototype.preserveGridSize=function(t){this._preserveGridSize=!0===t},Pe.prototype.getColumnData=function(t){return this._getColumnDef(t).columnData},Pe.prototype.setColumnData=function(t,e){return this._getColumnDef(t).columnData=e||{},e},Pe.prototype.newColumnData=Pe.prototype.getColumnData,Pe.prototype.setAlwaysRenderColumn=function(t,e){this.getColumnData(t).alwaysRender=!1!==e},Pe.prototype._isAlwaysRenderColumn=function(t){return!0===this.getColumnData(t).alwaysRender},Pe.prototype.getFitContentWidth=function(){return this._fitContentWidth},Pe.prototype.setFitContentWidth=function(t){this._fitContentWidth!==t&&(this._fitContentWidth=t,this.enableClass("fit-width",this._fitContentWidth))},Pe.prototype.loadPlugin=function(t,e){var i=null;if("string"==typeof t){var n=window.tr,o=n?n.grid:null;if(!o)return null;if(o[t])i=new o[t];else{if(!o[t+"Plugin"])return null;i=new o[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},Pe.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},Pe.prototype.getPlugin=function(t){var e=this._plugins[t];return e||(e=this._plugins[t+"Plugin"]),e||null},Pe.prototype.getPlugins=function(){var t=[];for(var e in this._plugins)t.push(this._plugins[e]);return t},Pe.prototype.getPluginList=function(){var t=[];for(var e in this._plugins)t.push(e);return t},Pe.prototype.freezeSection=function(t){this._fixFrozenTopSections=!0,this._freezeTopSectionAt(t)},Pe.prototype.resetSectionFreezing=function(){this._fixFrozenTopSections=!1,this._updateFrozenTopSections()},Pe.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()},Pe.prototype.freezeFooter=function(t){this._fixFrozenBottomSection=!0,this._frozenFooterCount!==t&&(this._setFrozenFooter(t),this._onSectionCountChanged())},Pe.prototype._setFrozenFooter=function(t){this._frozenFooterCount!==t&&(this._frozenFooterCount=t,this._vscrollbar.setFooterCount(t),this._hscrollbar.setFooterCount(t))},Pe.prototype.getFooterCount=function(){return this._frozenFooterCount},Pe.prototype.freezeColumn=function(t,e){var i,n=this.getColumnCount(),o=0,r=0,s=!1;if(t||0===t)for(this._hScrollbarEnabled=!0,o=t>=0?t+1:0,this._pinnedLeftColumnCount!==o&&(s=!0,this._pinnedLeftColumnCount=o),i=0;i<n;++i)this._getColumnDef(i).leftPinned=--o>=0;else this._hScrollbarEnabled=!1;if(null!=e)for(r=e>0?e:0,this._pinnedRightColumnCount!==r&&(s=!0,this._pinnedRightColumnCount=r),i=n;--i>=0;)this._getColumnDef(i).rightPinned=--r>=0;this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),this._updateColumnSeparators(),s&&(this._isEventDispatching("pinningChanged")||this._dispatch("pinningChanged",{}))},Pe.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},Pe.prototype._countPinnedRightColumns=function(){var t=0;if(this._hScrollbarEnabled){var e,i=this._columnDefs.length;for(e=0;e<i;++e){var n=this._columnDefs[e];if(n&&n.rightPinned)break}t=i-e}return this._pinnedRightColumnCount=t,t},Pe.prototype.isPinnedColumn=function(t){return t<this.getFrozenColumnCount()||t>=this.getFirstPinnedRightIndex()},Pe.prototype.getFrozenColumnCount=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:0},Pe.prototype.getPinnedLeftColumnCount=Pe.prototype.getFrozenColumnCount,Pe.prototype.getPinnedRightColumnCount=function(){return this._pinnedRightColumnCount},Pe.prototype.getFirstPinnedRightIndex=function(){return this.getColumnCount()-this._pinnedRightColumnCount},Pe.prototype.updateLayout=function(){this._disposed||this._layoutUpdating||(this._layoutUpdating=!0,this._dispatch("preForcedUpdate",{}),this._updateLayout(),this._colVirtualizer.isEnabled()&&this._activateColumns(),this._layoutUpdating=!1)},Pe.prototype.updateScrollbars=function(t,e){e&&this._updateScrollbarWidth(!0,!1),t&&this._updateScrollbarHeight(!0,!1)},Pe.prototype.freezeLayout=function(t){t=!1!==t;var e=this._frozenLayout;if(e!==t){this._frozenLayout=t;var i,n=this.getPlugin("SortableTitlePlugin");this._frozenLayout&&n&&n.freezeIndicator(!0),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);if(!this._frozenLayout)this._syncLayoutToColumns(0,this.getColumnCount()),this._disableEvent("widthChanged",!1),this._dispatch("widthChanged",{}),this._syncRowHeights()||this._rowVirtualizer.update(!0),n&&n.freezeIndicator(!1);this._rowHeightSync=!0}return e},Pe.prototype.unfreezeLayout=function(t){this.freezeLayout(!1===t)},Pe.prototype.isLayoutFrozen=function(){return this._frozenLayout},Pe.prototype.showBorders=ot._deprecatedFunction,Pe.prototype.hideBorders=ot._deprecatedFunction,Pe.prototype.toggleBorders=function(t){this.toggleClass("no-borders",null!=t?!t:null)},Pe.prototype.toggleGridlines=function(t){this.toggleClass("no-gridlines",null!=t?!t:null)},Pe.prototype.toggleVerticalLines=function(t){this.toggleClass("no-vertical-grid-line",null!=t?!t:null)},Pe.prototype.toggleHorizontalLines=function(t){this.toggleClass("no-horizontal-grid-line",null!=t?!t:null)},Pe.prototype.toggleContentVerticalLines=function(t){this.toggleClass("no-content-vertical-line",null!=t?!t:null)},Pe.prototype.getDataColumnMap=function(){for(var t=[],e=this.getColumnCount();--e>=0;)t[e]=this.getDataColumnName(e);return t},Pe.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)},Pe.prototype.getDataColumnName=function(t){return this._getColumnDef(t).dataColumnName||""},Pe.prototype.setDataColumnName=function(t,e){this._getColumnDef(t).dataColumnName=e},Pe.prototype.setDefaultRenderingHandler=function(t){this._renderingHandler="function"==typeof t?t:null},Pe.prototype.setDefaultDataBindingHandler=function(t){this._dataBindingHandler="function"==typeof t?t:null},Pe.prototype.setColumnRenderingHandler=function(t,e){this._getColumnDef(t).renderingHandler="function"==typeof e?e:null},Pe.prototype.setColumnDataBindingHandler=function(t,e){this._getColumnDef(t).dataBindingHandler="function"==typeof e?e:null},Pe.prototype.getColumnRenderingHandler=function(t){return this._getColumnDef(t).renderingHandler||null},Pe.prototype.getColumnDataBindingHandler=function(t){return this._getColumnDef(t).dataBindingHandler||null},Pe.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)}},Pe.prototype._getTarget=function(t){var e=t.target;if(e){var i=null;return this._element.contains(e)||(i=t.composedPath?t.composedPath():t.path),i?i[0]||null:e}return t.getElement?t.getElement():ot.isElement(t)?t:null},Pe.prototype.getRelativePosition=function(t,e){if(!t)return{};var i=e||{},n=this._getTarget(t);t.target?ot.getRelativePosition(t,this.getElement(),i):n&&ot.getRelativePosition(n,this.getElement(),i),1!==this._zoomFactor&&(i.x/=this._zoomFactor,i.y/=this._zoomFactor),i.hit=!1,i.grid=this,i.clientX=t.clientX,i.clientY=t.clientY,i.zoomFactor=this._zoomFactor;var o=ot.closestElement(n,"cell");if(!o)return i;i.cellElement=o;var r=ot.closestElement(o,"column");i.columnElement=r;var s=null;if(!(s=r?ot.closestElement(r,"tr-lg"):ot.closestElement(o,"tr-lg")))return i;i.sectionName=s.id||ot.closestElement(s,"tr-vlg").id;var a=this.getSectionSettings(i.sectionName);if(!a)return i;a.extendEventArg(i);var l=a.getSection(),u=l.getColumnIndex(r||o);return u<0?i:(i.colIndex=u,!1===this._hitTestY(-1,i)||(o.stretched?i.cell=l.getStretchedCell(u,i.rowIndex):i.cell=l.getCell(u,i.rowIndex),i.hit=!0),i)},Pe.prototype.getVScrollbar=function(){return this._vscrollbar},Pe.prototype.getHScrollbar=function(){return this._hscrollbar},Pe.prototype.autoHideScrollbars=function(t){t=null==t||t,this._vscrollbar.setAutoHide(t),this._hscrollbar.setAutoHide(t)},Pe.prototype.getVScrollStartIndex=function(){return this._startVScrollbarIndex},Pe.prototype.getHScrollStartIndex=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:-1},Pe.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 n=this._hScrollbarEnabled?this._layoutX.getLaneStart(this._pinnedLeftColumnCount):0,o=this._hscrollbar.getScrollLeft(),r=o+n,s=this._hscrollbar.getWidth(),a=this._layoutX.hitTest(r),l=this._layoutX.getLaneStart(t),u=this._layoutX.getLaneSize(t);if(e||u>=s||t<=a){var h=l-n;if(o!==h)return this._hscrollbar.setScrollLeft(h),!0}else{var p=r+s;if(t>=this._layoutX.hitTest(p-.1)){var d=o+(l+u)-p;return this._hscrollbar.setScrollLeft(d),!0}}return!1},Pe.prototype.getScrollLeft=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getScrollLeft():0},Pe.prototype.setScrollLeft=function(t){this._updateScrollbar(this._hscrollbar)&&this._hscrollbar.setScrollLeft(t)},Pe.prototype.scrollRight=function(t){this.setScrollLeft(this._hscrollbar.getScrollLeft()+t)},Pe.prototype.getScrollWidth=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getContentWidth():0},Pe.prototype.getYScrollVal=function(t,e,i){if(!this._updateScrollbar(this._vscrollbar))return null;var n=null;t&&(n=this.getSection(t));var o=this._layoutY.getLaneCount(),r=n?n.getRowOffset():this._sectionStarts[this._startVScrollbarIndex];r&&(e+=r),e<=0?e=0:e>=o&&(e=o-1);var s=this._layoutY.getLaneStart(r),a=this._vscrollbar.getScrollTop()+s,l=n?n.getFirstIndexInView():this._layoutY.hitTest(a),u=-1;if(i)u=e;else if(e<=l)(u=e-3)<0&&(u=0);else{var h=a+this._vscrollbar.getHeight(),p=n?n.getLastIndexInView():this._layoutY.hitTest(h-.1);if(e>=p)(u=e-(p-l)+3)<0&&(u=0)}return u>=0?this._layoutY.getLaneStart(u)-s:null},Pe.prototype.scrollToRow=function(t,e,i){var n=this.getYScrollVal(t,e,i);null!==n&&this._vscrollbar.setScrollTop(n)},Pe.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),n=this._vscrollbar.getScrollTop()+i,o=this._vscrollbar.getHeight(),r=n+o,s=this._layoutY.hitTest(n),a=this._layoutY.hitTest(r-.1),l=this._layoutY.getLaneStart(s),u=this._layoutY.getLaneEnd(a),h=n-o,p=h<=i?e:this._layoutY.hitTest(h)+1,d=r+o,c=d>=this._layoutY.getTrackSize()?t-1:this._layoutY.hitTest(d-.1)-1;s-=e,a-=e;var _={};return _.viewTop=n-i,_.viewBottom=r-i,_.topRowIndex=s,_.bottomRowIndex=a,_.firstFullRow=l<n?s+1:s,_.lastFullRow=u>r?a-1:a,_.prevPageRowIndex=p-e,_.nextPageRowIndex=c-e,_},Pe.prototype.getScrollTop=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getScrollTop():0},Pe.prototype.setScrollTop=function(t){this._updateScrollbar(this._vscrollbar)&&this._vscrollbar.setScrollTop(t)},Pe.prototype.scrollDown=function(t){this.setScrollTop(this._vscrollbar.getScrollTop()+t)},Pe.prototype.getScrollHeight=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getContentHeight():0},Pe.prototype.restoreScrollbars=function(){this._vscrollbar.restoreTrackPosition()},Pe.prototype.enableAutoSetDataSource=function(t){this._autoSetDataSource=t},Pe.prototype.getRowVirtualizer=function(){return this._rowVirtualizer},Pe.prototype.getColumnVirtualizer=function(){return this._colVirtualizer},Pe.prototype.enableRowVirtualization=function(t){this._rowVirtualizer.enable(t),this._rowVirtualizer.isEnabled()&&this._vscrollbar.isEnabled()?this._rowVirtualizer.activate():this._rowVirtualizer.deactivate()},Pe.prototype.isRowVirtualizationEnabled=function(){return this._rowVirtualizer.isEnabled()},Pe.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)}},Pe.prototype.isColumnVirtualizationEnabled=function(){return this._colVirtualizer.isEnabled()},Pe.prototype.setRowScrollingStep=function(t){this._rowScrollingStep=t>0?t:0,this._vscrollbar.setScrollingStep(this._layoutY.getDefaultLaneSize()*this._rowScrollingStep)},Pe.prototype.getVMouseWheelHandler=function(){return this._vscrollbar.getDefaultMouseWheelLogic()},Pe.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)},Pe.prototype.synchronizeHScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);var e=t.getHScrollbar();e._mainScrollbar=this._hscrollbar,e.setStyle("visibility","hidden"),e.setStyle("pointerEvents","none"),e.disableMouseWheel(),e.attachToExternalElement(this._hscrollbar.getParent()),this._hscrollbar.listen("scroll",t._onSyncHScroll)},Pe.prototype.updateRowData=function(t,e,i,n){var o=this.getSectionSettings(t||"content");o&&o.updateRowData(e,i,n)},Pe.prototype.rerender=function(){for(var t=this._settings.length,e=0;e<t;e++)this._settings[e].rerender()},Pe.prototype.requestRowRefresh=function(){this._rowRefreshTimer||(this._rowRefreshTimer=setTimeout(this._onRowRefresh,100))},Pe.prototype._requestScrollbarUpdate=function(){this._updateScrollbarHeight(!0,!0),this._rowHeightTimerId=0},Pe.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())}},Pe.prototype._onRowRefresh=function(){this._rowRefreshTimer=0,this.updateRowData()},Pe.prototype.disableLazyRendering=function(t){console.log("WARNING: This function is deprecated.")},Pe.prototype.getData=function(t,e,i){var n=this.getSectionSettings(t);if(!n)return null;var o=this._toDataColumnName(e);return n.getData(o,i)},Pe.prototype.setData=function(t,e,i,n){var o=this.getSectionSettings(t);if(o&&o.isDataBindable()){var r=this._toDataColumnName(e);return o.setData(r,i,n)}return!1},Pe.prototype.removeRowData=function(t,e){var i=this.getSectionSettings(t);return!(!i||!i.isDataBindable())&&i.removeRowData(e)},Pe.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)}},Pe.prototype.getHorizontalLayout=function(){return this._layoutX},Pe.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 n={};n.colIndex=t,n.hidden=!e,this._dispatch("columnVisibilityChanged",n)}return!0}return!1},Pe.prototype.getColumnVisibility=function(t,e){return this._layoutX.getLaneVisibilityBit(t,e)},Pe.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},Pe.prototype.getHiddenInput=function(){return this._hiddenInput},Pe.prototype.focus=function(){var t=this._hiddenInput,e=document.activeElement;if(t&&t!==e){var i=window.pageXOffset,n=window.pageYOffset;if(t.setActive)try{t.setActive()}catch(e){t.focus({preventScroll:!0})}else t.focus({preventScroll:!0});n===window.pageYOffset&&i===window.pageXOffset||window.scrollTo(i,n)}},Pe.prototype.isBinding=function(){return this._dispatchingDataChanged},Pe.prototype.hideRow=function(t,e){this._dataSource.hideRow(t,e)},Pe.prototype.hideRows=function(t,e){Array.isArray(t)?this._dataSource.hideRows(t,e):this._dataSource.hideRow(t,e)},Pe.prototype.showRows=function(t,e){Array.isArray(t)?this._dataSource.showRows(t,e):this._dataSource.showRows([t],e)},Pe.prototype.unhideAllRows=function(){this._dataSource.unhideAllRows()},Pe.prototype.hasHiddenRow=function(){return this._dataSource.hasHiddenRow()},Pe.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 n=0;n<e;++n)i.setCellContent(n,0,t[n]);this.addSection("content");var o=this.getSectionSettings("title");o.disableDataBinding();var r=this.getSectionSettings("content");r.setAutoSyncRowCount(!0),r.setParent(o),this._dataBindingHandler||this.setDefaultDataBindingHandler(Pe._defaultDataBinding)},Pe._defaultDataBinding=function(t){t.cell.setContent(t.dataValue)},Pe.prototype.selectColumn=function(t,e){for(var i=this._settings.length;--i>=0;)this._settings[i].getSection().selectColumn(t,e);this._updateColumnBounds()},Pe.prototype.isSelectedColumn=function(t){var e=this._settings[0]||null;return!!e&&e.getSection().isSelectedColumn(t)},Pe.prototype._updateColumnBounds=function(){if(!this._columnBoundConflator.conflate()){var t=this._settings.length;if(t){var e,i=[],n=null,o=this.getColumnCount(),r=[];for(e=0;e<o;e++)this.isSelectedColumn(e)?(r.push(e),n||(n=[e,-1])):n&&(n[1]=e-1,i.push(n),n=null);n&&(n[1]=o-1,i.push(n),n=null);var s={selectedColumns:r,selectionRanges:i};this._dispatch("beforeColumnBoundUpdate",s);var a=i.length,l=[],u=[],h=this._settings[0],p=h.getSection();for(e=0;e<a;++e){n=i[e];var d=[0,0],c=[!1,!1];p.calculateColumnBounds(n[0],n[1],d,c),d[0]<d[1]&&(l.push(d),u.push(c))}var _=0,f=-1;for(null!=s.topBoundRowIndex&&(f=+s.topBoundRowIndex),f>=0&&"title"===h.getType()&&(_=this._layoutY.getLaneStart(f)),p.updateColumnBounds(l,u,_),e=1;e<t;e++)(p=this._settings[e].getSection()).updateColumnBounds(l,u)}}},Pe.prototype._updateColumnSeparators=function(){var t=this._settings.length;if(t)for(var e=0;e<t;e++){var i=this._settings[e].getSection();i&&i.updateColumnSeparators()}},Pe.prototype.getColumnRect=function(t,e){var i=this.getElement().clientWidth,n=i,o=this._hscrollbar;o.isActive()&&(n=o.getTrackSize());var r=0,s=0;if(this._settings.length){var a=[0,0];this._settings[0].getSection().calculateColumnBounds(t,e,a,[]),s=a[1]-(r=a[0])}return{top:0,left:r,width:s,height:this._layoutY.getTrackSize(),leftPinnedIndex:this._pinnedLeftColumnCount-1,rightPinnedIndex:this.getFirstPinnedRightIndex(),scrollViewSize:n,gridWidth:i}},Pe.prototype.getRowRect=function(t,e){var i=this._layoutX.getTrackSize(),n=this.getElement().clientWidth;i=i<n?i:n;var o=this.getSection("content"),r=o?o.getRowOffset():1,s=this._layoutY,a=s.getLaneStart(r),l=0,u=o.getHeight(),h=this._vscrollbar;h.isActive()&&(l=h.getScrollTop(),u=h.getTrackSize());var p=u+a,d=s.getLaneStart(t+r)-l,c=s.getLaneEnd(e+r)-l;return d<a?d=a:d>p&&(d=p),c<a?c=a:c>p&&(c=p),{top:d-=a,left:0,width:i,height:(c-=a)-d,scrollViewSize:u,scrollViewTop:a,scrollViewBottom:p}},Pe.prototype.normalizeConfig=function(t){t||(t={});var e,i,n=t.columns,o=n?n.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=o;--e>=0;)--s>=0&&(i=n[e])&&(i.rightPinned=!0);return null!=r&&(delete t.columnFreezing,delete t.freezeColumn,r>=0&&n&&(i=n[r])&&(i.leftPinned=!0)),t},Pe.prototype.setColumnGrouping=function(t){this._groupDefs=t||null},Pe.prototype.getColumnGroupParentId=function(t){if(this._groupDefs){var e="number"==typeof t?this.getColumnId(t):t;return this._groupDefs.getParentId(e)}return""},Pe.prototype.getColumnGroupChildIds=function(t){if(this._groupDefs){var e=this._groupDefs.getLeafDescendants(t);if(e&&e.length>0)return e}return null},Pe.prototype.getValidColumnList=function(t,e){var i=[];if(!t)return i;e||(e=this.createColumnMap(t));for(var n=this.getColumnCount(),o=0;o<n;++o){var r=this._getColumnDef(o).id;null!=e[r]&&i.push({index:o,id:r})}return i},Pe.prototype.createColumnMap=function(t){t||(t=this.getColumnIds());for(var e={},i=t.length,n=0;n<i;n++){var o=t[n];"number"==typeof o&&(o=this.getColumnId(o)),o&&(e[o]=!0)}return e},Pe.prototype.startBatch=function(t){return!!t&&(this._batches||(this._batches={}),this._batches[t]=t,"reset"===t&&this._disableEvent("columnVisibilityChanged",!0),this._dispatch("beforeBatchOperation",{batches:this._batches,batchType:t}),!0)},Pe.prototype.stopBatch=function(t){return!!t&&(this._dispatch("afterBatchOperation",{batches:this._batches,batchType:t}),"reset"===t&&this._disableEvent("columnVisibilityChanged",!1),delete this._batches[t],g(this._batches)&&(this._batches=null),!0)},Pe.prototype._dispatchColumnEvent=function(t,e){var i=this._batches;i&&(e.batches=i),this._dispatch(t,e)},Pe.prototype._dispatchColumnPositionChanged=function(){this._columnPositionConflator.conflate()||this._dispatch("columnPositionChanged",{sender:this})},Pe.prototype._dispatchRowPositionChanged=function(){this._rowPositionConflator.conflate()||this._dispatch("rowPositionChanged",{sender:this})},Pe.prototype._getAllSections=function(){for(var t=[],e=this._settings.length,i=0;i<e;i++)t.push(this._settings[i].getSection());return t},Pe.prototype._getNextSection=function(t,e,i){var n=this.getSectionIndex(e)+t;if(null==i)return this.getSectionSettings(n);i=this._toSectionType(i);for(var o=this._settings.length;n>=0&&n<o;){var r=this._settings[n];if(i===r.getType())return r;n+=t}return null},Pe.prototype._toSectionType=function(t){if(Pe._sectionType[t])return t;if(ot.isString(t))switch(t.charAt(0).toLowerCase()){case"t":return"title";case"h":case"s":return"header";case"f":return"footer"}return"content"},Pe.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 n={horizontalScrollbar:this._hscrollbar},o="content"===t?new Me(n):new fe(n);o._setContext(this);var r=new Ie(o);r.setId(e),r.setType(t),r.listen("dataChanged",this._onSectionDataChanged),r.listen("rowAvailable",this._onRowAvailable);var s="content"===t&&this._rowHighlighting;return o.enableRowHighlighting(s),o.enableShading(!1),o.setHidingMethod(this._hidingMethod),r.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),r},Pe.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)}},Pe.prototype._syncStyleToSectionColumns=function(t,e){for(var i,n=this._columnDefs.length;--n>=0;){var o=this._getColumnDef(n),r=o.styles;for(i in r)t.setColumnStyle(n,i,r[i]);var s=o.classes;for(i in s)t.enableColumnClass(n,i,!0);var a=o[e];if(a){for(i in r=a.styles)t.setColumnStyle(n,i,r[i]);for(i in s=a.classes)t.enableColumnClass(n,i,!0)}}},Pe.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)},Pe.prototype._syncSectionRowHeights=function(t){this._layoutY.copyFrom(t.getRowLayout(),this._sectionStarts[t.getIndex()])},Pe.prototype._setColumnWidth=function(t,e,i){var n=!1,o=this._layoutX;if(null!=i)n=o.setLaneScalability(t,!!i);else{var r=o.getLaneScalability(t);if(this._preserveProportion){if(r){for(var s=this.getColumnCount(),a=0,l=0,u=0;u<s;++u)if(o.getLaneScalability(u)){var h=o.getLaneSize(u);a+=o.getCustomLaneSize(u),l+=h}(!(e=(e*a-e*o.getCustomLaneSize(t))/(l-e))||e<0)&&(e=a)}}else n=o.setLaneScalability(t,!1)}return n=o.setLaneSize(t,e)||n},Pe.prototype._dispatchColumnAddedEvent=function(t,e,i,n){var o={};if(this._hasListener("columnAdded"))if(o.atTheMiddle=i,1===e)o.colIndex=t,o.context=n,this._dispatchColumnEvent("columnAdded",o);else for(var r=Array.isArray(n)?n:[],s=0;s<e;++s)o.colIndex=t+s,o.context=r[s],this._dispatchColumnEvent("columnAdded",o);this._frozenLayout&&(o.noDataUpdate=!0),this._dispatchColumnRenderEvent(o,t,t+e,0,this._settings.length,NaN,NaN)},Pe.prototype._dispatchColumnRenderEvent=function(t,e,i,n,o,r,s){if(n<o){var a;if(t.sender=this,t.fromColIndex=e,t.toColIndex=i,this._hasListener("preSectionRender"))for(a=n;a<o;++a)this._settings[a].extendRenderEventArg(t,r,s),this._dispatch("preSectionRender",t);for(var l=e;l<i;++l){var u=this.getColumnRenderingHandler(l)||this._renderingHandler;if(u)for(t.colIndex=l,t.dataColumnName=this.getDataColumnName(l),a=n;a<o;++a){var h=this._settings[a];h.extendRenderEventArg(t,r,s);for(var p=h.getSection(),d=t.fromRowIndex,c=t.toRowIndex,_=d;_<c;++_)t.rowIndex=_,t.cell=p.getCell(l,_,!1),u(t)}}if(this._hasListener("postSectionRender"))for(a=n;a<o;++a)this._settings[a].extendRenderEventArg(t,r,s),this._dispatch("postSectionRender",t);if(!t.noDataUpdate&&!this._noBinding)for(a=n;a<o;++a)this.updateRowData(this._settings[a],r,s-1)}},Pe.prototype._dispatchRowExpansionBinding=function(t){if(this._hasListener("rowExpansionBinding")){var e=t.dataSource;if(e&&e.getDataSource()){var i=t.fromRowIndex,n=t.toRowIndex,o=e.getVisibleRowIds(!0),r=t.section;t.rowData=null,t.cell=null;for(var s=!1,a=n-1;a>=i;--a){var l=e.getRowId(a);if(!s){var u=e.getRowExpansionCount(l);if(u>0){a=a+u+1,s=!0;continue}}var h=r.getContextRow(a),p=e.getExpansionParentByRowId(l);if(p)t.originalRowData=e.getRowData(p),t.originalRowId=p,t.rowExpansion=h.rowExpansion=!0;else{if(!h.rowExpansion)continue;t.originalRowData=null,t.originalRowId=null,t.rowExpansion=h.rowExpansion=!1}t.rowId=o[a],t.rowIndex=a,this._dispatch("rowExpansionBinding",t)}t.originalRowData=null,t.originalRowId=null,t.rowExpansion=!1}}},Pe.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 n=this._settings.length;--n>=0;){this._settings[n].getSection().setColumnCount(i)}var o=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 a=o[s-i];r.colIndex=s,r.columnData=a?a.columnData:null,this._dispatchColumnEvent("columnRemoved",r)}}},Pe.prototype._onSectionDataChanged=function(t){if(!this._dispatchingDataChanged){var e=this._layoutX.getLaneCount();if(this._dispatchingDataChanged=!!e,e){var i,n,o=t.fromRowIndex,r=t.toRowIndex,s=t.section,a=t.dataSource,l=a&&a.getDataSource()?1:0;s._startBindingSession(!0),l&&(i=a.getVisibleRowIds(!0),n=a.getMultipleRowData(i,o,r),t.dataRows=n);var u="content"===t.sectionType;u&&this._dispatch("beforeContentBinding",t),this._dispatch("preSectionDataBinding",t);for(var h=this.getDataColumnMap(),p=0;p<e;++p)if(s.isColumnActive(p)&&(this.isColumnVisible(p)||this._isAlwaysRenderColumn(p))){var d=this.getColumnDataBindingHandler(p)||this._dataBindingHandler;if(d){var c=h[p];t.dataColumnName=c,t.colIndex=p;for(var _=o;_<r;++_){if(l){var f=n[_];t.rowData=f,t.rowId=i[_],t.dataValue=f?f[c]:null}t.rowIndex=_,t.cell=s.getCell(p,_,!1),d(t)}}}this._dispatch("postSectionDataBinding",t),this._dispatchRowExpansionBinding(t),u&&(this._firstRendered||(this._dispatch("firstRendered",t),this._firstRendered=!0),this._dispatch("afterContentBinding",t)),s._startBindingSession(!1),this._dispatchingDataChanged=!1}}},Pe.prototype.resetInternalState=function(){this._firstRendered=!1},Pe.prototype._updateScrollbar=function(t){return!!t&&(t.isEnabled()&&t.update(),t.isActive())},Pe.prototype._onVScroll=function(t){this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop()),this._dispatchRowPositionChanged()},Pe.prototype._onHScroll=function(t){var e=this._hscrollbar.getScrollLeft();this._colVirtualizer.setViewOffset(e),this._updateColumnBounds(),this._dispatchColumnPositionChanged()},Pe.prototype._onVScrollEnabled=function(){this._updateScrollbarHeight(!0,!1),this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.activate(),this._vscrollbar.getAutoHide()||this._updateVScrollbar()},Pe.prototype._onVScrollDisabled=function(){this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.deactivate()},Pe.prototype._onRowInViewChanged=function(t){for(var e=t.firstIndex,i=t.lastIndex+1,n=this._settings.length,o=[0,0],r=0;r<n;++r){var s=this._settings[r],a=s.getSection();a&&!a.getFrozenLayout()&&(a.activateRows(e,i,o),this.updateRowData(s,o[0],o[1]-1))}},Pe.prototype._onColInViewChanged=function(t){if(this.getColumnCount()){var e=t.prevFirstIndex,i=t.prevLastIndex,n=t.firstIndex,o=t.lastIndex,r=e<n?e:n,s=i>o?i:o;this._activateColumns(n,o,r,s);for(var a=this.getSectionCount(),l=0;l<a;++l){var u=this._settings[l];this.updateRowData(u)}}},Pe.prototype._activateColumns=function(t,e,i,n){null==i&&(i=0),null==n&&(n=this.getColumnCount()-1);for(var o=this._getColActivationList(t,e,i,n),r=this.getSectionCount();--r>=0;){this._settings[r].activateColumns(o,i,n)}},Pe.prototype._getColActivationList=function(t,e,i,n){null==i&&(i=0);var o=this.getColumnCount();null==n&&(n=o-1),null==t&&(t=this._colVirtualizer.getFirstIndexInView()),null==e&&(e=this._colVirtualizer.getLastIndexInView());for(var r=this.getHScrollStartIndex(),s=this.getFirstPinnedRightIndex(),a=new Array(n+1),l=i;l<=n;++l)a[l]=l<r||l>=t&&l<=e||l>=s;return a},Pe.prototype._getColumnDef=function(t){if(t>=0){var e=this._columnDefs[t];return e||(e=this._columnDefs[t]={id:""+Pe._runningColumnId++,columnData:{}}),e}return{columnData:{}}},Pe.prototype._getNestedColumnDef=function(t,e,i){var n=this._getColumnDef(t);if(e){var o=n;(n=o[e])||(n=o[e]={}),i&&((n=(o=n)[i])||(n=o[i]={}))}return n},Pe.prototype.getColumnId=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).id||""},Pe.prototype._getColumnId=Pe.prototype.getColumnId,Pe.prototype.getColumnIds=function(){for(var t=this.getColumnCount(),e=new Array(t),i=0;i<t;++i)e[i]=this._getColumnDef(i).id||"";return e},Pe.prototype.setColumnField=function(t,e){this._getColumnDef(t).field=e||""},Pe.prototype.getColumnField=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).field||""},Pe.prototype.getColumnFields=function(){for(var t=this.getColumnCount(),e=new Array(t),i=0;i<t;++i)e[i]=this._getColumnDef(i).field||"";return e},Pe.prototype.getColumnIndex=function(t){if("number"==typeof t)return t;if(t)for(var e=t,i=this.getColumnCount(),n=0;n<i;++n){var o=this._getColumnDef(n);if(e===o.id||e===o.field)return n}return-1},Pe.prototype.getColumnIndices=function(t){for(var e=[],i=this.getColumnCount(),n=Array.isArray(t)?t:[t],o=n.length,r=0;r<o;++r){var s=this.getColumnIndex(n[r]);s>=0&&s<i&&e.push(s)}return e},Pe.prototype.getColumnIndexMap=function(){for(var t=this.getColumnCount(),e={},i="",n=0;n<t;++n){var o=this._getColumnDef(n);(i=o.field)&&(e[i]=n),(i=o.id)&&(e[i]=n)}return e},Pe.prototype._onWindowResize=function(){this._updateLayout(),this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop())},Pe.prototype._onMouseMove=function(){this._vscrollbar.flash(),this._hscrollbar.flash()},Pe.prototype._onGridClicked=function(){if(!window.getSelection().toString()){var t=document.activeElement;this._element.contains(t)||this.focus()}},Pe.prototype._onRowHightlighted=function(t){if(this._hasListener("rowHighlighted")){var e=t.sender,i=this.getSectionSettings(e.getId());if(null!=i){i.extendEventArg(t);var n=i.getDataSource();null!==n&&(t.rowId=n.getRowId(t.rowIndex),t.dataRow=n.getRowData(t.rowId)),this._dispatch("rowHighlighted",t)}}},Pe.prototype._onRowCountChanged=function(t){if(!this._disposed){var e=t.sender,i=t.prevCount,n=t.rowCount,o=e.getIndex(),r=this._updateSectionIndices(o),s=0;if(i>n)this._layoutY.removeLaneAt(r,i-n),this._layoutY.isHomogeneous()||this._syncSectionRowHeights(e);else{var a=this._layoutY.getDefaultLaneSize(),l=e.getDefaultRowHeight();if(this._layoutY.insertLane(r+i,n-i),l!==a)for(s=i;s<n;++s)this._layoutY.setLaneSize(r+s,l)}var u=t.noBinding,h=o<=this._startVScrollbarIndex||o>=this._getFooterStartIndex(),p=this._frozenFooterCount>0,d=this._updateScrollbarHeight(h,p,u);u&&(this._hasPendingRowChange=!0),this._frozenLayout||d||(this._rowVirtualizer.isVirtualizable()?e.activateRows(this._rowVirtualizer.getFirstIndexInView(),this._rowVirtualizer.getLastIndexInView()):e.activateRows()),this._hasPendingRowChange=!1,p||this._updateVScrollbar(),this._updateColumnSeparators(),i<n?this._dispatch("rowAdded",t):i>n&&this._dispatch("rowRemoved",t)}},Pe.prototype._onRowHeightChanged=function(t){if(this._rowHeightSync&&!this._disposed&&!this._rowHeightConflator.conflate(t)){for(var e=this._rowHeightConflator.popAllData(),i=e.length,n=NaN,o=0;o<i;++o){var r=e[o],s=r.section;if(this._containsSection(s))for(var a=s.getIndex(),l=r.rowIndex,u=this.getRowIndex(a,l),h=r.changeLength,p=0;p<h;++p)this._layoutY.setLaneSize(u+p,s.getRowHeight(l+p))&&(a>=n||(n=a))}this._rowHeightConflator._needScrollbarUpdate?(this._rowHeightConflator._needScrollbarUpdate=!1,this._updateScrollbarHeight(!0,!0)):n>=0&&(this._dispatchingDataChanged?this._rowHeightTimerId||(this._rowHeightTimerId=setTimeout(this._requestScrollbarUpdate,0)):this._updateScrollbarHeight(n<this._startVScrollbarIndex,n>=this._startVScrollbarIndex)),this._updateColumnSeparators(),this._dispatchRowPositionChanged()}},Pe.prototype._containsSection=function(t){for(var e=this._settings.length;--e>=0;)if(this._settings[e].getSection()===t)return!0;return!1},Pe.prototype._onRowAvailable=function(t){if(!this._hasPendingRowChange){var e=t.sectionIndex;this._dispatchColumnRenderEvent(t,0,this.getColumnCount(),e,e+1,t.prevRowIndex,t.rowIndex)}},Pe.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()}},Pe.prototype._onColumnCountChanged=function(){if(!this._frozenLayout&&!this._disposed){var t=this._countPinnedLeftColumns(),e=this._countPinnedRightColumns();this._updateColumnBounds(),this._updateColumnSeparators(),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()}},Pe.prototype._onSyncVScroll=function(t){this._vscrollbar.setScrollTop(t.scrollTop)},Pe.prototype._onSyncHScroll=function(t){this._hscrollbar.setScrollLeft(t.scrollLeft)},Pe.prototype._getFooterStartIndex=function(){return this.getSectionCount()-this._frozenFooterCount},Pe.prototype._getVScrollStart=function(){return this._getSectionSize(0,this._startVScrollbarIndex)},Pe.prototype._getFooterSize=function(){return this._frozenFooterCount>0?this._getSectionSize(this._getFooterStartIndex()):0},Pe.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]),n=t+e;return(e>0?this._layoutY.getLaneStart(this._sectionStarts[n]):0)-i},Pe.prototype._updateScrollbarHeight=function(t,e,i){if(!this._vscrollbar.isEnabled())return!1;var n=e,o=t&&this._startVScrollbarIndex>=0,r=this._rowHeightConflator.isConflating();if(r&&(this._rowHeightConflator._needScrollbarUpdate=!0,n=!1),o&&!r){var s=this.getElement();if(!s)return!1;var a=this.getParent(),l=this._vscrollbar.getParent();l?l!==a&&l.firstElementChild&&(l=l.firstElementChild):(l=s,this._vscrollbar.setParent(l));var u=this._getVScrollStart(),h=this._getFooterSize();l!==s&&(u+=s.clientTop),this._vscrollbar.resetPaneSize();var p=l.clientHeight-(u+h)*this._zoomFactor;this._vscrollbar.setTop(u*this._zoomFactor),this._vscrollbar.setTrackSize(p,p/this._zoomFactor);var d=this._layoutY.getDefaultLaneSize(),c=12*d;p>c&&(c=(Math.ceil(p/d)+4)*d),this._rowVirtualizer.setViewSize(c/this._zoomFactor),this._rowVirtualizer.setViewBounds(this._startVScrollbarIndex,this.getFooterCount())}else this._rowVirtualizer.validateVirtualization();var _=!1;return i||(_=this._rowVirtualizer.update()),this._vscrollbar.invalidate(n),_},Pe.prototype._updateScrollbarWidth=function(t,e){if(!this._frozenLayout){if(t&&this._hScrollbarEnabled){var i=this.getElement(),n=this._hscrollbar.getParent();n||(n=this.getParent()||i,this._hscrollbar.setParent(n));var o=this._layoutX.getLaneStart(this._pinnedLeftColumnCount),r=this._layoutX.getLaneCount(),s=0,a=this._countPinnedRightColumns();a&&(s=this._layoutX.getLaneStart(r)-this._layoutX.getLaneStart(r-a));var l=n!==i?i.clientLeft:0,u=n.clientWidth-(o+l+s)*this._zoomFactor;a>0&&(u-=this._reservedSpace),this._hscrollbar.setPaneLeft(o),this._hscrollbar.setLeft((o+l)*this._zoomFactor),this._hscrollbar.setTrackSize(u,u/this._zoomFactor);var h=4*this._layoutX.getDefaultLaneSize();u>h&&(h=u),this._colVirtualizer.setViewSize(h/this._zoomFactor),this._colVirtualizer.setViewBounds(this._pinnedLeftColumnCount,a)}else this._colVirtualizer.validateVirtualization();this._colVirtualizer.update(),this._hscrollbar.invalidate(e)}},Pe.prototype._hitTestY=function(t,e){var i;if(e.sectionSettings)i=e.sectionSettings;else{var n,o=(n="number"==e.rowIndex?e.rowIndex:this._layoutY.hitTest(t))>=0?n:~n,r=ot.upperBound(this._sectionStarts,o)-1;if(e.sectionIndex=r,!(i=this._settings[r]))return!1;i.extendEventArg(e)}var s=i.getSection();return null!=e.colIndex&&e.cellElement?e.rowIndex=s.getCellIndex(e.colIndex,e.cellElement):e.rowIndex=n+s.getRowOffset(),!0},Pe.prototype._syncLayoutToColumns=function(t,e,i){if(!this._frozenLayout){var n=this._layoutX.getLaneCount(),o=this.fillParentWidth(100);(o||null==t||null==e)&&(t=0,e=n,o=!0);var r=this._settings.length;if(!(r<=0)){var s=!1;if(t<e)for(var a=0;a<r;++a)s=this._syncLayoutToSectionColumns(this._settings[a].getSection(),t,e)||s;var l=o||t<this.getHScrollStartIndex()||e>this.getFirstPinnedRightIndex();this._updateScrollbarWidth(l,!0),this._updateColumnBounds(),this._updateColumnSeparators(),this._dispatchColumnPositionChanged(),(s||i)&&this._dispatch("widthChanged",{from:t,to:e,colChanged:t})}}},Pe.prototype._syncLayoutToSectionColumns=function(t,e,i){null==e&&(e=0),null==i&&(i=this._layoutX.getLaneCount());for(var n=0,o=e;o<i;++o)n|=t._setColumnWidth(o,this._layoutX.getLaneSize(o));return!(!n||this._frozenLayout)&&(t._updateColumnLayout(),!0)},Pe.prototype._toDataColumnName=function(t){return ot.isNumber(t)?this.getDataColumnName(t):t},Pe.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 n=this._settings[e-1]||null;n!==this._lastSettings&&(this._lastSettings&&this._lastSettings.getSection().removeClass("last"),this._lastSettings=n,this._lastSettings&&this._lastSettings.getSection().addClass("last")),this._sectionStarts.length=e+1,this._sectionStarts[0]=0;for(var o=t;o<e;++o){var r=this._settings[o].getSection();r.setIndex(o),r.setRowOffset(this._sectionStarts[o]),this._sectionStarts[o+1]=this._sectionStarts[o]+r.getRowCount()}return this._sectionStarts[t]},Pe.prototype._updateLayout=function(){var t=this.getElement();if(!this._disposed&&t.offsetParent){this._syncLayoutToColumns(),this._updateScrollbarHeight(!0,!0),this._updateScrollbarWidth(!0,!0);for(var e=this.getSectionCount(),i=0;i<e;++i){this._settings[i].getSection().updateLayout()}this._updateColumnSeparators()}},Pe.prototype._updateVScrollbar=function(){!this._disposed&&this._vscrollbar.isEnabled()&&(this._vScrollbarConflator.conflate()||this._vscrollbar.update())},Pe._proto=Pe.prototype;let ze={chainIcon:""};ze.styles=function(t){if(t){var e="";if(Array.isArray(t))e=t.map(C).join("\n").replace(/{\s*{/g,"{").replace(/\s+{/g," {");else e="string"==typeof t?t:t+"";if(e)return e.replace(/{[\w\W]*?}/g,S)}return""}([".tr-grid .chain-icon",["cursor: pointer;"],".tr-grid .chain-icon .fallback-arrow",["vertical-align: middle;","font-size: 7px;","line-height: 1;","display: inline-block;","transform: scaleX(1.5);","font-family: Arial;"],".tr-grid .closed .chain-icon",["transform: translate(0px, -1px) rotate(-90deg);"]]),ze.applyStyle=function(t){t&&!t._rowGroupingStyles&&(t._rowGroupingStyles=!0,w(ze.styles,t.getElement()))};var Ve=ze;let ke=function(){this._counter={},this._session={},this._referers={}};ke.prototype._counter=null,ke.prototype._session=null,ke.prototype._referers=null,ke.prototype.reset=function(){this._counter={},this._referers={},this.newSession()},ke.prototype.newSession=function(){this._session={}},ke.prototype.getAllReferences=function(){return Object.keys(this._counter)},ke.prototype.getAllReferers=function(){return Object.keys(this._referers)},ke.prototype.getAllReferrers=ke.prototype.getAllReferers,ke.prototype.getSession=function(){let t=[],e=[];for(let i in this._session){let n=this._session[i];n>0?t.push(i):n<0&&e.push(i)}return{newEntries:t.filter(Boolean),removedEntries:e.filter(Boolean)}},ke.prototype.addReference=function(t,e){if(t){if(e){let i=this._referers[e];if(i){if(i[t])return!1}else i=this._referers[e]={};i[t]=1}if(!this._counter[t])return this._counter[t]=1,-1===this._session[t]?this._session[t]=0:this._session[t]=1,!0;++this._counter[t]}return!1},ke.prototype.addRef=ke.prototype.addReference,ke.prototype.removeReference=function(t,e,i){if(!t)return!1;let n=this._counter[t];if(!n)return!1;if(null==i)i=1;else if(i<0)i=n;else if(!i)return!1;if(e){let i=this._referers[e];if(!i)return!1;if(!i[t])return!1;delete i[t]}return n-=i,!n||n<0?(delete this._counter[t],1===this._session[t]?this._session[t]=0:this._session[t]=-1,!0):(this._counter[t]=n,!1)},ke.prototype.release=ke.prototype.removeReference,ke.prototype.addReferences=function(t,e){if(!t)return 0;let i=0;if(Array.isArray(t)){let n=t.length;for(let o=0;o<n;++o)this.addReference(t[o],e)&&++i}else if("string"==typeof t)this.addReference(t,e)&&++i;else for(let n in t)this.addReference(n,e)&&++i;return i},ke.prototype.removeReferer=function(t){let e=0;if(t){let i=this._referers[t];if(i){for(let n in i)this.removeReference(n,t)&&++e;delete this._referers[t]}}return e},ke.prototype.removeReferrer=ke.prototype.removeReferer,ke.prototype.log=function(){console.log(this._counter)};var Oe=ke;let Ne=function(){let t=this;t._commitRicsChanges=t._commitRicsChanges.bind(this),t._commitFieldsChanges=t._commitFieldsChanges.bind(this),t._fieldChangedConflator=new o(0,t._commitFieldsChanges),t._ricChangedConflator=new o(0,t._commitRicsChanges),t._fields=new Oe,t._rics=new Oe,t._rowDefMap={}};r.inherits(Ne,a),Ne.prototype._fieldChangedConflator=null,Ne.prototype._ricChangedConflator=null,Ne.prototype._rowDefMap=null,Ne.prototype._rics=null,Ne.prototype._fields=null,Ne.prototype.getAllRics=function(){return this._rics.getAllReferences()},Ne.prototype.getAllRowDefs=function(){let t=[];for(let e in this._rowDefMap)t=t.concat(this._rowDefMap[e]);return t},Ne.prototype.getAllFields=function(){return this._fields.getAllReferences()},Ne.prototype.getRowDefByRic=function(t){return this._rowDefMap[t]||null},Ne.prototype.addRic=function(t){let e=t?t.getSymbol():"";if(!e)return!1;let i=this._rowDefMap,n=i[e];n?n.indexOf(t)<0&&n.push(t):n=i[e]=[t];let o=this._rics.addReference(e,t.getRowId());return this._commitRicsChanges(),o},Ne.prototype.removeRic=function(t,e){if(e||(e=t?t.getSymbol():""),!e)return;let i=this._rowDefMap[e];if(i){let e=i.indexOf(t);e>=0&&i.splice(e,1)}this._rics.removeReference(e,t.getRowId()),this._commitRicsChanges()},Ne.prototype.removeAllRics=function(){let t=this._rics.getAllReferers();for(let e in t)this._rics.removeReferer(t[e]);this._rowDefMap={},this._commitRicsChanges()},Ne.prototype._commitRicsChanges=function(){if(this._ricChangedConflator.conflate())return;let t=this._rics,e=t.getSession(),i=e.removedEntries,n=e.newEntries;i.length&&this._doDispatch({type:"ricRemoved",removedRics:i}),n.length&&this._doDispatch({type:"ricAdded",addedRics:n}),t.newSession()},Ne.prototype.addFields=function(t,e){if(!t)return;let i=this._fields;t instanceof zt?i.addReferences(t.getAllFields(),t.getId()):i.addReferences(t,e),this._commitFieldsChanges()},Ne.prototype.removeFields=function(t,e){t&&(t instanceof zt?this._fields.removeReferer(t.getId()):this._fields.removeReference(t,e),this._commitFieldsChanges())},Ne.prototype.removeFieldReferrer=function(t){this._fields.removeReferer(t),this._commitFieldsChanges()},Ne.prototype.removeAllFields=function(){let t=this._fields.getAllReferers();for(let e in t)this._fields.removeReferer(t[e]);this._commitFieldsChanges()},Ne.prototype._commitFieldsChanges=function(){if(this._fieldChangedConflator.conflate())return;let t=this._fields,e=t.getSession(),i=e.removedEntries,n=e.newEntries;i.length&&this._doDispatch({type:"fieldRemoved",removedFields:i}),n.length&&this._doDispatch({type:"fieldAdded",addedFields:n}),t.newSession()},Ne.prototype._doDispatch=function(t){let e=this;t.fields=e.getAllFields(),t.rics=e.getAllRics(),t.rowDefs=e.getAllRowDefs(),e._dispatch(t.type,t)},Ne.prototype.reset=function(){let t=this;t._rowDefMap={},t._fields.reset(),t._rics.reset(),t._fieldChangedConflator.reset(),t._ricChangedConflator.reset()};var He=Ne;let Be=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},Ge=function(){this._defaultSorter=this._defaultSorter.bind(this),this._dataSorter=this._dataSorter.bind(this),this._rowDefSorter=this._rowDefSorter.bind(this),this._multiColumnsSorter=this._multiColumnsSorter.bind(this),this._globalContext={},this._sortParams=[],this._ctxCaches=[]};Ge.prototype._globalContext,Ge.prototype._sortParams,Ge.prototype._ctxCaches,Ge.prototype._primaryParams,Ge.prototype.dispose=function(){this._globalContext={},this._sortParams.length=0,this._ctxCaches.length=0,this._primaryParams=null},Ge.prototype.getSorter=function(){this._primaryParams=null;let t=this._sortParams.length;if(1===t){let t=this._primaryParams=this._sortParams[0];if(t[1]){return t[3]?this._rowDefSorter:this._dataSorter}return this._defaultSorter}return t>1?this._multiColumnsSorter:Ge._noSorting},Ge.prototype.reset=function(){this._sortParams.length&&(this._sortParams.length=0)},Ge.prototype.setContext=function(t,e){this._globalContext[t]=e},Ge.prototype.addColumnContext=function(t,e,i,n,o,r){t||(t="");let s=this._sortParams.length,a=this._ctxCaches[s];a||(a=this._ctxCaches[s]=f(this._globalContext));let l=0;"a"===n?l=1:"d"===n&&(l=-1);let u=[t,"function"==typeof e?e:null,a,i,l];a.colIndex=o,a.field=t,a.formattedField=t+"_FORMATTED",a.colDef=r,this._sortParams.push(u)},Ge._noSorting=function(t,e,i){return 0},Ge.prototype._defaultSorter=function(t,e,i){let n=this._primaryParams[0];return Be(t.getData(n),e.getData(n),i)},Ge.prototype._dataSorter=function(t,e,i){let n=this._primaryParams,o=n[0];return(0,n[1])(t.getData(o),e.getData(o),i,n[2])},Ge.prototype._rowDefSorter=function(t,e,i){let n=this._primaryParams;return(0,n[1])(t,e,i,n[2])},Ge.prototype._multiColumnsSorter=function(t,e,i){let n=this._sortParams,o=n.length;for(let i=0;i<o;++i){let o=n[i],r=o[0],s=o[1],a=o[2],l=o[3],u=o[4],h=0;if(h=s?l?s(t,e,u,a):s(t.getData(r),e.getData(r),u,a):Be(t.getData(r),e.getData(r),u),h)return h}return 0};var We=Ge,Ue=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})};s.inherits(Ue,lt),Ue.prototype._hosts=null,Ue.prototype._sortStates,Ue.prototype._maxCount=1,Ue.prototype._dataSorting=!0,Ue.prototype._dblClickAllowed=!1,Ue.prototype._clickTimer=0,Ue.prototype._delayInterval=0,Ue.prototype._lastMouseDown=0,Ue.prototype._initialSort=null,Ue.prototype._mode="",Ue.prototype._sortableColumns=!0,Ue.prototype._sortableIndicator=!1,Ue.prototype._solarTheme=!1,Ue.prototype._sortLogic,Ue.prototype._userManagedLogic=!1,Ue.prototype._disabled=!1,Ue.prototype._frozenIndicator=!1,Ue.prototype._rowDefMode=!1,Ue._icons={},Ue.prototype._sortingSequence,Ue.prototype._sortingSequenceMap=null;Ue.prototype.getName=function(){return"SortableTitlePlugin"},Ue.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))},Ue.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))},Ue.prototype.afterInit=function(){var t=this;t.setSortLogics(t._sortLogic);var e=t._initialSort;null!=e&&(Array.isArray(e)?1===t._maxCount?t.sortColumns(e.slice(0,1)):t.sortColumns(e):t.sortColumns([e]))},Ue.prototype.config=function(t){if(t){var e=this,i=t.icons;null!=i&&i.sorting&&(Ue._icons=i.sorting);var n=t.themeName;!n||n.indexOf("solar")>=0?e._solarTheme=!0:e._solarTheme=!1,e._initialSort=e._initialSortByColumnField(t);var o=t.sorting;if(o){o.ROW_DEF&&(this._rowDefMode=!0),o.userManagedLogic&&(e._userManagedLogic=!0);var r=o.multiColumn||o.multicolumn;if(null!=r&&(!0===r&&(r=-1),!1===r&&(r=1),e.setSortableColumnCount("number"==typeof r&&r>0?r:-1)),null!=(r=o.sortableIndicator)&&(e._sortableIndicator=r),null!=(r=o.disabled)&&(e._disabled=!!r),null!=(r=o.threeStatesSorting)&&e.disableTwoStateSorting(r),null!=(r=o.sortingSequence)&&Array.isArray(r)&&(e._sortingSequence=r),null!=(r=o.mode)&&(e._mode=r,"manual"===r&&e.disableDataSorting()),null!=(r=o.indicatorOnly)&&e.disableDataSorting(r),null!=(r=o.disableDoubleClickToSort)&&e.disableDoubleClickToSort(r),"function"==typeof(r=o.columnSorted)&&e.listen("columnSorted",r),"function"==typeof(r=o.preClicked)&&e.listen("preClicked",r),"function"==typeof(r=o.clicked)&&e.listen("clicked",r),"function"==typeof(r=o.preDataSorting)&&e.listen("preDataSorting",r),null!=(r=o.sortableColumns)&&(e._sortableColumns=r),"object"==typeof(r=o.initialSort)&&(e._initialSort=r),"object"==typeof(r=o.sortLogic))for(var s in r)"function"==typeof r[s]&&(e._sortLogic[s]=r[s])}}},Ue.prototype.getConfigObject=function(t){var e=t||{},i=e.columns;i||(i=e.columns=[]);var n=this._hosts[0];if(!n)return e;var o,r,s,a,l,u=this.getSortedColumns();if(1===this._maxCount&&null!=u)for(s=u.length,r=0;r<s;r++){var h=u[r],p=h.colIndex;(o=i[p])||(o=i[p]={}),o.sortOrder=h.sortOrder}for(s=n.getColumnCount(),r=0;r<s;++r)(o=i[r])||(o=i[r]={}),(a=this._getSortOptions(r))&&(this._sortableColumns?a.disabled&&(o.sortable=!1):a.disabled||(o.sortable=!0),(l=a.field)&&(null!=o.field&&o.field!==l&&(o.sortBy=l),this._sortingSequenceMap&&this._sortingSequenceMap[l]&&(o.sortingSequence=this._sortingSequenceMap[l])));var d=e.sorting;d||(d=e.sorting={});var c=u;null!=c&&(d.initialSort=c),!1!==(c=this._sortableIndicator)&&(d.sortableIndicator=c),1!==this._maxCount&&(d.multiColumn=-1===this._maxCount||this._maxCount),this._dblClickAllowed&&(d.disableDoubleClickToSort=!this._dblClickAllowed),!0!==(c=this._sortableColumns)&&(d.sortableColumns=c),!0!==(c=this._dataSorting)&&(d.indicatorOnly=c),this._disabled&&(d.disabled=!0);var _=this._sortingSequence,f=!0;return 2===_.length&&"a"===_[0]&&"d"===_[1]&&(f=!1),f&&(d.sortingSequence=_.slice()),g(e.sorting)&&delete e.sorting,e},Ue.prototype.getColumnMenu=function(t,e){e||(e={});var i=e.menus;i||(i=e.menus=[]);var n=i[0];n||(n=i[0]={menuItems:[]});var o=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"===o,click:this._onItemSortingClicked},{indexScore:2,label:"Descending",radioMode:!0,value:{colIndex:t,order:"d"},selected:"d"===o,click:this._onItemSortingClicked},{indexScore:1,label:"Un-Sort",radioMode:!0,value:{colIndex:t,order:"n"},selected:"n"===o,click:this._onItemSortingClicked}]}};return n.menuItems.push(r),e},Ue.prototype._onItemSortingClicked=function(t){this._hosts[0].getPlugin("ColumnMenuPlugin").hide();var e=t.currentTarget.value,i=e.colIndex,n=e.sortOrder;this.sortColumn(i,n)},Ue.prototype.getIcons=function(){return Ue._icons},Ue.prototype.setSortLogics=function(t){if(null!=t){var e=this._hosts[0];if(e){var i=e.getDataSource();for(var n in t)this._setSortLogic(i,n,t[n])}}},Ue.prototype.setSortLogic=function(t,e){if("string"==typeof t){var i=this._hosts[0];if(i){var n=i.getDataSource();this._setSortLogic(n,t,e)}}},Ue.prototype._setSortLogic=function(t,e,i){t&&"string"==typeof e&&("*"===e?t.setSortingLogic(i):t.setColumnSortingLogic(e,i))},Ue.prototype.getSortOrder=function(t){var e=null!=t?this.getSortPriority(t):0,i=this._sortStates[e];return(i?i.sortOrder:"")||"n"},Ue.prototype.getSortedColumnIndex=function(t){return this._getColumnIndex(this._sortStates[t||0])},Ue.prototype.getSortPriority=function(t,e){var i=this._hosts[0];if(i){var n,o=this._sortStates.length;if(t>=0){var r=i.getColumnId(t);if(r)for(n=0;n<o;++n)if(this._sortStates[n].colId===r)return n}else if(e)for(n=0;n<o;++n){var s=this._sortStates[n];if(s.colId===e)return n;if(s.field===e)return n}}return-1},Ue.prototype.isColumnSorted=function(t){return this.getSortPriority(t)>=0},Ue.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 n=this.getSortedColumnIndex(i),o=this._sortStates[i],r={},s="";n>=0&&(r.colIndex=n,s=this._getColumnId(n)),s&&(r.colId=s);var a=o.field||"";a&&(r.field=a),r.sortOrder=o.sortOrder||"n",e[i]=r}return e},Ue.prototype.isSorting=function(){return!!this._sortStates.length},Ue.prototype.sortColumn=function(t,e,i){this._sortColumn(this._prepareSorting(t,e),i)},Ue.prototype.sortColumns=function(t,e){if(Array.isArray(t)){for(var i=t.length,n=new Array(i),o=0;o<i;o++)n[o]=this._prepareSorting(t[o]);this._sortColumn(n,e)}},Ue.prototype.clearSortState=function(t){this._popSortState(0,t)&&this.updateSortSymbols()},Ue.prototype.refresh=function(){this._sortStates.length&&(this._sortDataView(),this.updateSortSymbols())},Ue.prototype.restoreUserActions=Ue.prototype.refresh,Ue.prototype.setSortableColumnCount=function(t){this._maxCount=t||1,this._popSortState(this._maxCount)},Ue.prototype.getSortingStates=function(){return this._sortStates},Ue.prototype.updateSortSymbols=function(){if(!this._disabled)for(var t=this._hosts.length;--t>=0;)this._updateSortableIndicator(t)},Ue.prototype.getDataColumnMap=function(){var t=this._hosts[0],e=[];if(t)for(var i=t.getColumnCount(),n=0;n<i;++n)e[n]=this.getColumnSortingField(n);return e},Ue.prototype.getDataColumnNames=Ue.prototype.getDataColumnMap,Ue.prototype.setDataColumnMap=function(t){if(Array.isArray(t))for(var e=t.length;--e>=0;)this.setColumnSortingField(e,t[e])},Ue.prototype.setDataColumnNames=Ue.prototype.setDataColumnMap,Ue.prototype.getColumnSortingField=function(t){var e=this._getSortOptions(t),i=e?e.field:null;if(null==i&&!this._rowDefMode){var n=this._hosts[0];n&&((i=n.getColumnField(t))||(i=n.getDataColumnName(t)),i&&e&&(e.field=i))}return i||""},Ue.prototype.setColumnSortingField=function(t,e,i,n){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,n&&i&&(i.rowSorting=!0))}};var Ye=function(t){return t.field||""};Ue.prototype.getColumnSortingFields=function(){return this._sortStates.map(Ye)},Ue.prototype.setFirstSortOrder=function(t,e){"a"!==(e=e?Ue._toSortOrder(e):"a")&&"d"!==e&&(e="a");for(var i=null,n=(i=Array.isArray(t)?t:[t]).length,o=0;o<n;++o){var r=i[o],s=this.getSortingSequence(r).slice(),a=s.indexOf(e);a>=0&&s.splice(a,1),s.unshift(e),this.setSortingSequence(s,r)}},Ue.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")},Ue.prototype.freezeIndicator=function(t){var e=this._frozenIndicator;if(this._frozenIndicator=!1!==t,e&&!this._frozenIndicator)for(var i=this._hosts.length;--i>=0;)this._updateSortableIndicator(i)},Ue.prototype.disableSortSymbols=function(t){},Ue.prototype.disableDataSorting=function(t){this._dataSorting=!1===t},Ue.prototype.disableDoubleClickToSort=function(t){this._dblClickAllowed=!t},Ue.prototype.disableCellClick=function(t,e){t&&t.enableClass("no-sort",!1!==e)},Ue.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,n=0;n<i;++n)this._disableColumnSorting(t[n]||0,e)},Ue.prototype._disableColumnSorting=function(t,e){var i=this._newSortOptions(t);i.disabled!==e&&(i.disabled=e)},Ue.prototype.setClickDelayInterval=function(t){this._delayInterval=null!=t?t:500},Ue.prototype._initialSortByColumnField=function(t){for(var e=t.columns,i=e?e.length:0,n=0;n<i;n++){var o=e[n].defaultSort;if(o)return{colIndex:n,sortOrder:o}}return null},Ue.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))}},Ue.prototype._onUIUpdated=function(t){"title"===t.sectionType&&this.updateSortSymbols()},Ue.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 n=t.colIndex,o=t.section,r=t.rowIndex;return!!this._isCellSortable(o,n,r)},Ue.prototype._proceedSorting=function(t){if(this._clickTimer=0,this._canClickToSort(t)){var e=t.colIndex;this.sortColumn(e,null,{isUserAction:!0});var i=t.grid;if(i&&i.focus&&i.focus(),this._hasListener("clicked")){var n={};n.colIndex=e,n.sortOrder=this.getSortOrder(e),n.dataColumnName=this.getColumnSortingField(e),this._dispatch("clicked",n)}}},Ue.prototype._onMouseDown=function(t){t.button||(this._lastMouseDown=t.timeStamp)},Ue.prototype._getPlugin=function(t){var e=this._hosts[0];return e?e.getPlugin(t):null},Ue.prototype._onClickTitle=function(t,e){if(!this._disabled)if(2!==e.detail||this._dblClickAllowed){if(!(e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)&&e.timeStamp-this._lastMouseDown<500){var i=t.getRelativePosition(e);if(i.hit){var n=this._getPlugin("ColumnSelectionPlugin");if(n&&n.isEnabled()){var o=i.colIndex;if(!n.isSelectedColumn(o))return}i.target=e.target,this._delayInterval>0?this._clickTimer||(this._clickTimer=setTimeout(this._proceedSorting.bind(this,i),this._delayInterval)):this._proceedSorting(i)}}}else this._clickTimer&&(clearTimeout(this._clickTimer),this._clickTimer=0)},Ue.prototype._popSortState=function(t,e){if(t<0||this._sortStates.length<=t)return!1;for(var i=!1,n=this._sortStates.length;--n>=t;)this._clearSortSymbols(this._sortStates[n]),i=!0;return this._sortStates.length=t,this._sortDataView(e),i},Ue._toSortOrder=function(t){return!t||"string"!=typeof t||"d"!==(t=t.charAt(0).toLowerCase())&&"a"!==t?"n":t},Ue.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},Ue.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 n=t.map(Ue._toSortOrder);i?(this._sortingSequenceMap||(this._sortingSequenceMap={}),this._sortingSequenceMap[i]=n):this._sortingSequence=n}else i?this._sortingSequenceMap&&delete this._sortingSequenceMap[i]:this._sortingSequence=this._sortingSequence.length>2?["a","d","n"]:["a","d"]},Ue.prototype.clearAllColumnSortingSequences=function(){this._sortingSequenceMap=null},Ue.prototype.sortSeparators=function(t){var e=this._hosts[0].getDataSource();if(t)e.sortSeparators(t);else{for(var i=e.getSortingLogics(),n=[],o=[],r=this._sortStates.length,s=Ue._toRowDefField(),a=0;a<r;a++){var l=this._sortStates[a],u=this._rowDefMode?s:l.field;n.push(l.sortOrder),o.push(u)}e.sortSeparators(i,n,o)}},Ue.prototype._prepareSorting=function(t,e){if(!this._maxCount)return null;var i=this._hosts[0];if(!i)return null;var n=-1,o="";"number"==typeof t?n=t:"string"==typeof t?(o=t,n=this._getColumnIndex(o)):t&&"object"==typeof t&&((o=t.colId||t.field)?n=this._getColumnIndex(o):"number"==typeof t.colIndex&&(n=t.colIndex),e||(e=t.sortOrder||t.order||null));var r="",s=null;if(n>=0){r=this.getColumnSortingField(n);var a=this._getSortOptions(n);a&&(s=a.sortLogic)}else o&&(r=o);var l=this.getSortPriority(n,r),u=l>=0?this._sortStates[l]:null,h=u?u.sortOrder:"n",p="n";if(null==e){var d=this.getSortingSequence(r),c=d.indexOf(h);p=d[c=c<0?0:(c+1)%d.length]}else p=Ue._toSortOrder(e);if(u){if(h===p)return this.updateSortSymbols(),null;this._sortStates.splice(l,1),this._clearSortSymbols(u)}if("a"===p||"d"===p){if(n<0&&!r)return null;if(!u){u={};var _=i.getColumnId(n);_&&(u.colId=_)}u.field=r,u.sortLogic=s||null,this._sortStates.push(u)}u&&("n"!==h?u.prevOrder=h:delete u.prevOrder,u.order=p,u.sortOrder=p);var f=[];if(this._maxCount>0)for(;this._sortStates.length>this._maxCount;){var g=this._clearSortSymbols(this._sortStates.shift());null!==g&&f.push(g)}return{colIndex:n,sortedField:r,sortOrder:p||"n",prevOrder:h,clearedSortColIndexes:f}},Ue.prototype._sortColumn=function(t,e){if(t){this._sortDataView(e),this.updateSortSymbols();var i=null;if(Array.isArray(t)){for(var n=t.length,o=0;o<n;++o){var r=t[o];r&&(i?(i.colIndices||(i.colIndices=[],i.sortedFields=[],i.sortOrders=[],i.prevOrders=[]),i.colIndices.push(r.colIndex),i.sortedFields.push(r.sortedField),i.sortOrders.push(r.sortOrder),i.prevOrders.push(r.prevOrder)):i=r)}i=t[0]}else i=t;this._dispatch("columnSorted",i)}},Ue.prototype._onColumnAdded=function(t){var e=this,i=t.colIndex,n=t.context||{},o=!!e._sortableColumns,r=n.field,s=n.sortBy;null!=s&&(o=!!s,r=s),null!=n.sortable&&(o=!!n.sortable);var a=n.sortLogic||n.sortingLogic||n.sorter;a||(a=e._sortLogic[r]),"function"!=typeof a&&(a=null);var l=n.sortingSequence;null!=l&&r&&e.setSortingSequence(l,r),o?e.setColumnSortingField(i,r,a,n.rowSorting):e.disableColumnSorting(i,!0);var u=n.sortOrder||n.sort;null!=u&&"n"!==(u=Ue._toSortOrder(u))&&(e.clearSortState(),e.sortColumn(i,u))},Ue.prototype._onColumnRemoved=function(t){var e=this._sortStates.length;if(e){var i=t.colId;if(i)for(var n=0;n<e;++n){var o=this._sortStates[n];if(o.colId===i){this._sortStates.splice(n,1),this._clearSortSymbols(o),this._sortDataView();break}}}},Ue._toRowDefField=function(t){return"ROW_DEF"},Ue.prototype._sortDataView=function(t){if(t=t||{},this._dispatch("preDataSorting",t),this._dataSorting){var e=this._sortStates.length;this._userManagedLogic&&e>1&&(e=1);var i=null,n=null,o=null;if(e){i=new Array(e),n=new Array(e);for(var r=0;r<e;++r)i[r]=this._sortStates[r].sortOrder,n[r]=this._sortStates[r].sortLogic;o=this._rowDefMode?this._sortStates.map(Ue._toRowDefField):this.getColumnSortingFields(),this._userManagedLogic&&o.length>1&&(o=o.slice(0,1))}for(var s=this._hosts.length;--s>=0;){var a=this._hosts[s].getDataSource();if(a){var l=1==t.isUserAction;a.sort(o,i,n,l)}}}},Ue.prototype._clearSortSymbols=function(t){var e=t.targetCells;if(!e)return null;for(var i=null,n=e.length;--n>=0;){var o,r=e[n];r.removeClass("sorting"),r.removeClass("sortable"),r.removeFloatingIcon("sort-symbol"),r.removeFloatingIcon("priority-symbol"),null==i&&(o=r.getSection())&&(i=o.getColumnIndex(r.getParent()))}return e.length=0,i},Ue.prototype._updateSortableIndicator=function(t){var e=this,i=e._hosts[t];if(i&&!this._frozenIndicator){var n=i.getSection("title");if(null!=n)for(var o=n.getColumnCount();--o>=0;)for(var r=n.getRowCount(),s=0;s<r;s++){var a=n.getCell(o,s,!0);if(a&&(a.removeClass("sorting"),a.removeClass("sortable"),a.removeClass("asc"),a.removeClass("desc"),a.removeClass("edge-indicator"),a.removeFloatingIcon("sort-symbol"),a.removeFloatingIcon("priority-symbol"),a.removeFloatingIcon("sortable-indicator"),s===r-1&&e._isCellSortable(n,o,s))){a.addClass("sortable");var l,u,h=e.getSortPriority(o),p=e._sortStates[h];if(p&&"n"!==p.sortOrder){var d;if(p.targetCells||(p.targetCells=[]),p.targetCells[t]=a,"a"===p.sortOrder?a.addClass("asc"):a.addClass("desc"),a.addClass("sorting"),e._solarTheme)"a"===p.sortOrder?(d="▲",u=Ue._icons.ascending):(d="▼",u=Ue._icons.descending),(l=e._createIconElem(u,d)).className="sort-symbol",a.insertFloatingIcon(l,0);else a.addClass("edge-indicator");e._sortStates.length>1&&((l=document.createElement("span")).className="priority-symbol",l.textContent=h+1,a.insertFloatingIcon(l,1))}else e._sortableIndicator&&(u=Ue._icons.sortable,(l=e._createIconElem(u,"◊")).className="sortable-indicator",a.insertFloatingIcon(l,0))}}}},Ue.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},Ue.prototype._getColumnIndex=function(t){if(null!=t){var e=this._hosts[0];if(e)return"number"==typeof t?t:"string"==typeof t?e.getColumnIndex(t):e.getColumnIndex(t.colId)}return-1},Ue.prototype._getColumnId=function(t){var e=this._hosts[0];return e&&null!=t?e.getColumnId(t):""},Ue.prototype._getSortOptions=function(t){var e=this._hosts[0];return e&&e.getColumnData(t).sortableTitle||null},Ue.prototype._newSortOptions=function(t){var e=this._hosts[0],i=null;if(e&&t>=0){var n=e.getColumnData(t);(i=n.sortableTitle)||(i=n.sortableTitle={})}return i||{}},Ue.prototype._isCellSortable=function(t,e,i){var n=this._getSortOptions(e);if(n){if(n.disabled)return!1;var o=n.field;if(null!=o&&!o)return!1}var r=t.getCell(e,i,!0);return!r.hasClass("no-sort")&&(r===t.getCell(e,t.getRowCount()-1,!0)&&!r.getParent().classList.contains("collapsed"))},Ue._proto=Ue.prototype;let qe=function(t){return t?t.getRowData():null},Xe={ROW_DEF:1,SUB_ID:1},je=function(t){return!t.isAutoGenerated()},Ke=function(t){return!t.autoGenerated},Je=function(t,e,i,n){return(t.getData(n)-e.getData(n))*i},Qe=function(t,e,i){let n=t.getParent();if(!n)return 0;let o=e.getParent();if(!o)return 0;if(n!==o)return 0;let r=t.getData("CHILD_ORDER");if(null==r)return 0;let s=e.getData("CHILD_ORDER");return null==s?0:(r-s)*i},Ze=function(t){return t?t.getName():""},$e=function(t,e){return t.getField()===e||t.getId()===e},ti=function(t,e){return!!(t&&e&&t.id&&e.id)&&t.id===e.id},ei=function(t,e){let i=this;if(i._onDataChanged=i._onDataChanged.bind(i),i._onQuote2PostUpdate=i._onQuote2PostUpdate.bind(i),i._onDataComposed=i._onDataComposed.bind(i),i._onSubSegmentChanged=i._onSubSegmentChanged.bind(i),i._recalculateFormulas=i._recalculateFormulas.bind(i),i._updateStreamingData=i._updateStreamingData.bind(i),i.updateColumnTitle=i.updateColumnTitle.bind(i),i._populateTimeSeriesChildren=i._populateTimeSeriesChildren.bind(i),i._onPostSectionDataBinding=i._onPostSectionDataBinding.bind(i),i._asyncClearDataUpdates=i._asyncClearDataUpdates.bind(i),i._clearDataUpdates=i._clearDataUpdates.bind(i),i._onPreDataSorting=i._onPreDataSorting.bind(i),i._mainSorter=i._mainSorter.bind(i),i._updateRowData=i._updateRowData.bind(i),i._onFormulaDataChanged=i._onFormulaDataChanged.bind(i),i._onFormulaDataRequired=i._onFormulaDataRequired.bind(i),i._addMemberOfChain=i._addMemberOfChain.bind(i),i._onColumnAdded=i._onColumnAdded.bind(i),i._onRowExpansionBinding=i._onRowExpansionBinding.bind(i),i._onColumnHeaderBinding=i._onColumnHeaderBinding.bind(i),i._getRowId=i._getRowId.bind(i),i._onFieldLoadedError=i._onFieldLoadedError.bind(i),i._snapshotFillerDataChanged=i._snapshotFillerDataChanged.bind(i),i._onPollingInterval=i._onPollingInterval.bind(i),i._streamingConflator=new o(50,i._updateStreamingData),i._formulaConflator=new o(300,i._onFormulaDataChanged),i._chainConflator=new o(100,i._addMemberOfChain),i._columnTitleConflator=new o(0,i.updateColumnTitle),i._timeSeriesChildConflator=new o(0,i._populateTimeSeriesChildren),i._defaultColumnOptions={},i._topNode=t||n.div(),i._topNode.classList.add("rt-grid"),i._grid=new Pe,i._grid._wrapper=this,i._sorter=new We,i._sorter.setContext("grid",this),i._sorter.setContext("core",i._grid),i._dateTimeUtil=B,i._grid.listen("columnAdded",i._onColumnAdded),e){if(e.dataView){i._sharedDataSource=!0,i._dv=e.dataView,i._dt=i._dv.getDataTable(),i._mainGrid=e.grid;let t=i._mainGrid.getCoreGrid();i._stp=t.getPlugin("SortableTitlePlugin")}e.SortableTitle&&(i._stp=e.SortableTitle),!1===e.topSection&&(i._topSection=!1)}i._sharedDataSource||(i._dc=new ut,i._dc.listen("dataChanged",i._onDataChanged),i._dc.listen("dataComposed",i._onDataComposed),i._dc.addStaticFields([yt,"SUB_ID"]),i._dt=new ft,i._dt.setSortingLogic(i._mainSorter),i._dt.setClassificationSource(i._dc),i._dt.listen("subSegmentChanged",i._onSubSegmentChanged),i._dv=new Ce(i._dt),i._dv.listen("pageIndexChanged",i._dispatch.bind(i,"pageIndexChanged")),i._dv.listen("pageCountChanged",i._dispatch.bind(i,"pageCountChanged"))),i._grid.setDataSource(i._dv),i._stp?(i._sharedSorter=!0,i._stp.listen("preDataSorting",i._onPreDataSorting),i._grid.loadPlugin(i._stp)):(i._stp=new Ue({userManagedLogic:!0,sortableColumns:!0,disableDoubleClickToSort:!0,ROW_DEF:!0}),i._stp.listen("preDataSorting",i._onPreDataSorting),i._grid.loadPlugin(i._stp,e)),i._grid.listen("beforeContentBinding",i._dispatch.bind(i,"beforeContentBinding")),i._grid.listen("preSectionRender",i._onColumnHeaderBinding),i._grid.listen("postSectionDataBinding",i._onPostSectionDataBinding),i._grid.listen("firstRendered",i._dispatch.bind(i,"firstRendered")),i._grid.listen("afterContentBinding",i._dispatch.bind(i,"afterContentBinding")),i._grid.enableRowHighlighting(!0),i._addGridSections(),i._grid.setParent(i._topNode),i._snapshot=new kt,i._snapshot.addEventListener("adcDataReceived",i._dispatch.bind(i,"adcDataReceived")),i._snapshot.addEventListener("dataChanged",this._snapshotFillerDataChanged),i._connector=new He,i._connector.addEventListener("ricAdded",i._onRicAdded.bind(i)),i._connector.addEventListener("ricRemoved",i._onRicRemoved.bind(i)),i._connector.addEventListener("fieldAdded",i._onFieldAdded.bind(i)),i._connector.addEventListener("fieldRemoved",i._onFieldRemoved.bind(i)),i.initialize(e),Ve.applyStyle(i._grid)};r.inherits(ei,a),ei.prototype._topNode=null,ei.prototype._mainGrid=null,ei.prototype._grid=null,ei.prototype._dc=null,ei.prototype._dt=null,ei.prototype._dv=null,ei.prototype._sharedDataSource=!1,ei.prototype._sharedSorter=!1,ei.prototype._subs=null,ei.prototype._stp=null,ei.prototype._columnSorter=null,ei.prototype._streamingConflator=null,ei.prototype._snapshot=null,ei.prototype._connector=null,ei.prototype._sorter=null,ei.prototype._fnEngine=null,ei.prototype._formulaConflator=null,ei.prototype._chainMembers=null,ei.prototype._chainConflator=null,ei.prototype._clientWidth=NaN,ei.prototype._autoLayoutTimer=0,ei.prototype._defaultColumnOptions=null,ei.prototype._RTK=null,ei.prototype._ADCOptions=null,ei.prototype._synapse=null,ei.prototype._autoDateConversion=!1,ei.prototype._textSelect=!1,ei.prototype._lang=null,ei.prototype._dateTimeUtil=null,ei.prototype._initializing=!1,ei.prototype._pollingInterval=0,ei.prototype._pollingTimerId=0,ei.prototype._lastPollingRequest=0,ei.prototype._pollingEnabled=!0,ei.prototype._fieldCaching=!1,ei.prototype._timeSeriesExpansion=!0,ei.prototype._childDataField="",ei.prototype._topSection=!0,ei.prototype.dispose=function(){this.removeAllEventListeners(),this._autoLayoutTimer&&(clearInterval(this._autoLayoutTimer),this._autoLayoutTimer=0),this._pollingTimerId&&(clearTimeout(this._pollingTimerId),this._pollingTimerId=0),this.removeAllColumns(),this.removeAllRows(),this._sorter.dispose(),this._grid.dispose(),this._connector.reset(),this._sharedDataSource||(this._dt&&this._dt.dispose(),this._dv&&this._dv.dispose()),this._mainGrid=this._dt=this._dv=null,this._subs&&(this._subs.dispose(),this._subs=null)},ei.prototype.getElement=function(){return this._topNode},ei.prototype.removeEventListeners=ei.prototype.removeAllEventListeners,ei.prototype.listen=ei.prototype.addEventListener,ei.prototype.initSubscription=function(){if(!this._dc||this._dc.getSubscriptions())return;let t,e,i;if(t=window.JET,this._RTK?e=this._RTK.Quotes:t&&(e=t.Quotes2),e&&(i=e.create()),!i)return;i.filter&&i.filter(-2,-1),this._subs=i,this._subs.start(),this._dc.setSubscriptions(i),this._subs.addEventListener("postUpdate",this._onQuote2PostUpdate);let n=this._getAllRowDefinitions(),o=n.length;for(let t=0;t<o;++t){let e=n[t];e&&e.subscribeForUpdates()}},ei.prototype.updateLayout=function(){this._grid.updateLayout(),this._stp.updateSortSymbols()},ei.prototype._updateRowData=function(t){if(t>=0){let e=this._dv.getRowId(t);e&&this._dt.setRowData(e,{})}else this._dt.dispatchGlobalChange()},ei.prototype.updateRowData=ei.prototype._updateRowData,ei.prototype._addGridSections=function(){let t=this._grid.addSection("title");0==this._topSection?t.setRowCount(0):t.setRowCount(1),this._grid.addSection("content");let e=this._grid.getSectionSettings("title");e.disableDataBinding();let i=this._grid.getSectionSettings("content");i.setAutoSyncRowCount(!0),i.setParent(e)},ei.prototype.addHeaderSection=function(t){let e=this._grid.getAllSections("title"),i=this._grid.addSectionAt(e.length,"title",t);if(i){i.setRowCount(1),this._grid.getSectionSettings(i).disableDataBinding()}return i},ei.prototype.addFooterSection=function(t){let e=this._grid.addSection("footer",t);if(e){e.setRowCount(1),this._grid.getSectionSettings(e).disableDataBinding()}return e},ei.prototype.setParent=function(t){n.appendChild(t,this._topNode),this.updateLayout()},ei.prototype.insertBefore=function(t){if(t){let e=t.parentNode;e&&(e.insertBefore(this._topNode,t),this.updateLayout())}},ei.prototype.getRelativePosition=function(t){return this._grid.getRelativePosition(t)},ei.prototype.getCoreGrid=function(){return this._grid},ei.prototype.initialize=function(t){if(!t)return void this.initSubscription();let e=this;e._initializing=!0;let i=e._grid;i.resetInternalState();let n=(t=i.normalizeConfig(t)).plugins||t.extensions,o=t.fields||t.columns;t.defaultColumnOptions&&(e._defaultColumnOptions=t.defaultColumnOptions,e._defaultColumnSetup(e._defaultColumnOptions,o)),e._processExtension(n,"beforeInit",[i.getElement(),t]),t.textSelect&&(e._textSelect=!0,i.addClass("tr-text-select")),t.RTK&&(e._RTK=t.RTK,e._snapshot.setRTK(e._RTK)),t.ADC&&(e._ADCOptions=t.ADC,e._snapshot.setADCOptions(e._ADCOptions)),t.synapse&&(e._synapse=t.synapse,Tt.setSynapseConfig(e._synapse)),t.fieldCaching&&(e._fieldCaching=t.fieldCaching),null!=t.timeSeriesExpansion&&(e._timeSeriesExpansion=t.timeSeriesExpansion,Tt.disableTimeSeriesExpansion(!e._timeSeriesExpansion)),t.icons&&t.icons.rowGrouping&&t.icons.rowGrouping.expander&&(Ve.chainIcon=t.icons.rowGrouping.expander),t.formulaEngine&&(e._fnEngine=new tt,e._fnEngine.addEventListener("dataChanged",e._onFormulaDataChanged),e._fnEngine.addEventListener("dataRequired",e._onFormulaDataRequired));let r=t.borders;null!=r&&i.toggleBorders(r);let s=t.gridlines;null!=s&&i.toggleGridlines(s);let a=t.verticalLines;null!=a&&i.toggleVerticalLines(a);let l=t.contentVerticalLines;null!=l&&i.toggleContentVerticalLines(l);let u=t.horizontalLines;null!=u&&i.toggleHorizontalLines(u),t.pageSize&&e._dv.setPageSize(+t.pageSize);let h=+t.rowHeight;h&&i.setDefaultRowHeight(h);let p=+t.headerRowHeight;p&&i.getSection("title").setDefaultRowHeight(p);let d=t.autoLayoutUpdate;!e._autoLayoutTimer&&d&&"0"!==d&&"false"!==d&&(e._autoLayoutTimer=setInterval(e._onAutoLayoutUpdate.bind(e),2e3));let c=t.rowHighlighting;null!=c&&i.enableRowHighlighting(!!c);let f=t.rowExpansionBinding;"function"==typeof f&&(i.listen("rowExpansionBinding",e._onRowExpansionBinding),e.listen("rowExpansionBinding",f)),this.addListener(t,"dataComposed"),this.addListener(t,"beforeContentBinding"),this.addListener(t,"firstRendered"),this.addListener(t,"afterContentBinding"),t.autoDateConversion&&(e._autoDateConversion=!0),t.stepScroll&&i.setRowScrollingStep(1),t.linearWheelScrolling&&i.getVScrollbar().setMouseWheelSpeed("linear"),null!=t.autoHideScrollbar&&i.autoHideScrollbars(!!t.autoHideScrollbar),null!=t.scrollbarParent&&e._setScrollbarParent(t.scrollbarParent);let g=t.adcPollingInterval;null!=g&&(e._pollingInterval=g?+g:0),e.setColumns(o);let m=!0;null!=t.rowVirtualRendering&&(m=t.rowVirtualRendering),null!=t.rowVirtualization&&(m=t.rowVirtualization),i.enableRowVirtualization(!!m);let v=!1;null!=t.columnVirtualRendering&&(v=t.columnVirtualRendering),null!=t.columnVirtualization&&(v=t.columnVirtualization),i.enableColumnVirtualization(!!v),null==t.scrollbar||t.scrollbar?e._topNode.style.overflow="hidden":(i.freezeSection(null),e._topNode.style.overflow="");let C=t.topFreezingCount;if("number"==typeof C){C=C>0?C:0;let t=C-1;i.freezeSection(t)}else!1===C&&i.freezeSection(null);let S=t.bottomFreezingCount;if("number"==typeof S&&(S=S>0?S:0,i.freezeFooter(S)),e.addDataFields(t.dataFields),t[yt]=!0,Array.isArray(n)){for(let o=0;o<n.length;++o){let r=n[o],s=null;if(r){let e=r.name;s=e?i.loadPlugin(e,r):i.loadPlugin(r,t)}if(s&&s.setGridWrapper){"function"==typeof s.getGridApi&&s.getGridApi()||s.setGridWrapper("realTimeGrid",e)}}e._initializing=!1}let w=t.lang;null!=w&&(e._lang=w,e._dateTimeUtil.setLocale(w)),null!=t.childDataField&&(this._childDataField=Rt._childDataField=t.childDataField);let b=t.rows;b||(b=t.rics||null);let R=t.bodies;if(!R&&(R=[],t.body&&R.push(t.body),b)){for(let t=0;t<b.length;t++)"string"==typeof b[t]&&(b[t]={ric:b[t]});R.push({rows:b})}let I=t.staticDataRows||t.dataModel;if(b&&I){let t,i,n=I.data?I.data:I,o=I.fields||e.getColumnFields(),r=b.length;for(let e=0;e<r;e++)b[e].values?(t=y(b[e].values,o),i=y(n[e],o),b[e].values=_(t,i)):b[e].values=n[e];n=n.slice(r,n.length),I.data?I.data=n:I=n}for(let t=0;t<R.length;++t)e.insertRows(R[t].rows);e.addStaticDataRows(I),t.contentBottomPadding&&i.setBottomPaddingSection(t.contentBottomPadding);let D=t.contentRightPadding;D&&("number"!=typeof D&&(D=6),i.reserveRightSpace(D));let x=t.dataConflationRate;null!=x&&i.setDataConflationRate(x);let A=i.getPluginList().map(i.getPlugin.bind(i));e._processExtension(A,"afterInit"),e.initSubscription()},ei.prototype.getConfigObject=function(t){let e=t||{},i=e.columns;i||(i=e.columns=[]);let n,o,r,s=this._grid;for(s.getConfigObject&&s.getConfigObject(e),!1===e.columnVirtualization&&delete e.columnVirtualization,!0===e.rowVirtualization&&delete e.rowVirtualization,!0===e.rowHighlighting&&delete e.rowHighlighting,!1===e.contentVerticalLines&&delete e.contentVerticalLines,!1===e.borders&&delete e.borders,o=this.getColumnCount(),n=0;n<o;++n){let t=i[n];t||(t=i[n]={});let e=this.getColumnDefinition(n);e.getConfigObject(t);let o=Tt.getFieldProperty(e.getField(),"timeSeriesParent");o&&!r&&(r=o,t.field=o,delete t.name,delete t.autoGenerated),!o&&r&&(r=null)}e.columns=i=i.filter(Ke),""===this._topNode.style.overflow&&(e.scrollbar=!1);let a=this._dv.getPageSize();a>0&&(e.pageSize=a),a=s.getDefaultRowHeight(),28!==a&&(e.rowHeight=a),a=s.getSection("title").getDefaultRowHeight(),28!==a&&(e.headerRowHeight=a),this._autoLayoutTimer&&(e.autoLayoutUpdate=!0),a=g(this._defaultColumnOptions),a||(e.defaultColumnOptions=this._defaultColumnOptions),this._autoDateConversion&&(e.autoDateConversion=!0),this._textSelect&&(e.textSelect=!0),this._lang&&(e.lang=this._lang),this._fnEngine&&(e.formulaEngine=!0),this._pollingInterval&&(e.adcPollingInterval=this._pollingInterval),this._fieldCaching&&(e.fieldCaching=this._fieldCaching),1!=this._timeSeriesExpansion&&(e.timeSeriesExpansion=this._timeSeriesExpansion),this._childDataField&&(e.childDataField=this._childDataField);let l,u,h=this.getAllRowDefinitions(),p=e.rows=[];for(o=h.length,n=0;n<o;n++)l=h[n],u=l.getConfigObject(),p.push(u);let d,c,_=s.getPlugins();for(let t in _)if(d=_[t],"function"==typeof d.getRowConfigObject)for(o=p.length,n=0;n<o;n++)l=h[n],c=p[n],d.getRowConfigObject(c,l.getRowId());return e},ei.prototype.setDateTimeUtil=function(t){this._dateTimeUtil!==t&&(this._dateTimeUtil=t,this._dateTimeUtil.setLocale(this._lang))},ei.prototype.setLocale=function(t){t&&this._lang!==t&&(this._lang=t,this._dateTimeUtil.setLocale(t),this._grid.requestRowRefresh())},ei.prototype._defaultColumnSetup=function(t,e){let i=e.length;for(let n=0;n<i;n++){let i=e[n];if("object"==typeof i)for(let e in t)null==i[e]&&(i[e]=t[e])}},ei.prototype._processExtension=function(t,e,i){if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n][e]&&t[n][e].apply(t[n],i)},ei.prototype._onRicAdded=function(t){let e=t.addedRics;this._snapshot.addFields(t.fields);let i=e.length;for(let t=0;t<i;++t){let i=e[t],n=this._connector.getRowDefByRic(i),o=n?n.length:0;for(let t=0;t<o;++t){n[t].getSymbol()===i&&this._snapshot.addRic(i)}}this._dispatch(t.type,t)},ei.prototype._onRicRemoved=function(t){this._dispatch(t.type,t)},ei.prototype._onFieldAdded=function(t){let e=t.rowDefs,i=t.addedFields;for(let t in e)this._snapshot.addRic(e[t].getSymbol());if(this._snapshot.addFields(i),this._subs){let t=i.filter(Tt.isRealTimeField);t.length>0&&this._subs.addFields(t)}this._dispatch(t.type,t)},ei.prototype._onFieldRemoved=function(t){let e=t.removedFields;this._subs&&this._subs.removeFields(e),this._dispatch(t.type,t)},ei.prototype.insertColumn=function(t,e){let i=this.getColumnCount();(null==e||e>i)&&(e=i);let n=this._initializing?{}:f(this._defaultColumnOptions);if("string"==typeof t)n.field=t;else for(let e in t)n[e]=t[e];this._fnEngine&&(n.formulaEngine=this._fnEngine);let o=new Pt(n,this);n.COL_DEF=o,this._grid.insertColumn(e,n)},ei.prototype._updateTimeSeriesFields=function(t){let e,i,n,o,r,s,a=t.data,l={};for(let t in a){for(e in a[t])l[e]=!0;this.setRicData(t,a[t])}let u={};for(n in l)i=t.childrenFieldToParent[n],u[i]?u[i].push(n):u[i]=[n];for(i in u){let t,n,a=u[i];for(o=this.getColumnIndex(i),r=this._getColumnDefinition(o),n=a.length,t=0;t<n;t++)e=a[t],s=this.getColumnIndex(e),s<0&&(o=this.getColumnIndex(i),r=this._getColumnDefinition(o),this._cloneTimeSeriesColumn(r,e,o),Tt.addTimeSeriesChild(i,e));this.removeColumn(i)}},ei.prototype._populateTimeSeriesChildren=function(t){if(this._timeSeriesChildConflator.conflate(t))return;let e,i,n,o,r,s=this._timeSeriesChildConflator.popAllData();for(e=0;e<s.length;e++){if(t=s[e],r=this.getColumnIndex(t),!t)continue;let a=t.getField(),l=Tt.getTimeSeriesChildren(a);if(!l)return;if(n=l.length,n<1)return;for(i=0;i<n;i++)r=this.getColumnIndex(t),o=l[i],this._cloneTimeSeriesColumn(t,o,r)}},ei.prototype._cloneTimeSeriesColumn=function(t,e,i){let n,o;n=t.getConfigObject(),o=f(n),o.field=e.replace("TR.",""),o.name=e.split("_")[1].split("T")[0],o.parent=t,o.timeSeriesName=t.getName(),o.timeSeriesId=t.getId(),this.insertColumn(o,i++)},ei.prototype.replaceColumn=function(t,e){let i=this.getColumnIndex(e);if(i<0)return;let n={},o=this._grid,r=o._getColumnDef(i),s=o.getColumnScalability(i);if(n.scalable=s,s=o.getColumnCustomLaneSize(i),n.width=s,s=o.getMinimumColumnWidth(i),s>0&&(n.minWidth=s),s=o.getColumnVisibility(i,0),s||(n.hidden=!0),s=r.stationary,s&&(n.stationary=s),s=r.leftPinned,s&&(n.leftPinned=s),s=r.rightPinned,s&&(n.rightPinned=s),"string"==typeof t)n.field=t;else for(let e in t)n[e]=t[e];t.width&&!t.scalable&&(n.scalable=!1),t.scalable&&!t.width&&(n.width=1);let a=this.getColumnDefinition(i);a&&null==n.id&&(n.id=a.getId()),this._grid.startBatch("reset"),this.removeColumn(i),this.insertColumn(n,i),this._grid.stopBatch("reset")},ei.prototype._onFieldLoadedSuccess=function(t,e,i){if(i&&i.id){let n=i;e&&e.getField()===t&&e.isDefaultName()&&n.name&&(e.setName(n.name),this.updateColumnTitle())}},ei.prototype._onFieldLoadedError=function(t){},ei.prototype._onFieldLoaded=function(t,e){if(Tt.isTimeSeries(t)){let t=this.getColumnDefinitionById(e);this._populateTimeSeriesChildren(t)}this._connector.addFields(t,e)},ei.prototype._setScrollbarParent=function(t){t.style.boxSizing="border-box",t.style.overflow="hidden",t.style.position="relative",this._topNode.style.height="100%",this._grid.autoHideScrollbars(!1),this._grid.getVScrollbar().attachToExternalElement(t),this._grid.getHScrollbar().attachToExternalElement(t)},ei.prototype.getFieldInfo=function(t){return Tt.getFieldInfo(t)},ei.prototype.loadFieldInfo=function(t){return Tt.loadFieldInfo(t)},ei.prototype._shouldLoadFieldInfo=function(t){let e=this._RTK||window.JET;return!!e&&(!!this._fieldCaching&&(e=Tt.hasFieldInfo(t),!e&&(e=Tt.isAdc(t)||Tt.isRealTimeField(t),!!e)))},ei.prototype.setColumns=function(t){let e=this._grid,i=t?t.length:0;if(e.startBatch("reset"),this.removeAllColumns(),i>0){let n=!1;i>1&&(n=e.freezeLayout(!0));for(let e=0;e<i;++e)this.insertColumn(t[e],e);i>1&&e.freezeLayout(n)}e.stopBatch("reset")},ei.prototype.restoreColumns=function(t,e){let i=this._grid;i.startBatch("reset");let n,o,r,s=this.getConfigObject().columns,a=s.length,l=t.length,u=e?ti:v,h=[],p=[],d=[];for(n=0;n<a;n++){for(r=!1,o=0;o<l;o++)if(u(s[n],t[o])){p.push(s[n]),r=!0;break}r||h.push(n)}this.removeColumns(h);let c=p.length,_=!1;for(l>1&&(_=this._grid.freezeLayout(!0)),n=0;n<l;n++){for(r=!1,o=0;o<c;o++)if(u(t[n],p[o])){r=!0;let e=this.getColumnIndex(t[n].id||t[n].field);d.push(this.getColumnId(e));break}r||(this.insertColumn(t[n],n),d.push(this.getColumnId(n)))}l>1&&this._grid.freezeLayout(_),i.reorderColumns(d),i.stopBatch("reset")},ei.prototype.setFields=ei.prototype.setColumns,ei.prototype._onColumnAdded=function(t){let e=t.context.COL_DEF;delete t.context.COL_DEF;let i=t.colIndex,n=this._grid._getColumnDef(i);e._setCoreColumnDef(n);let o=this._grid.getColumnData(i);o||(o=this._grid.setColumnData(i,{})),o.COL_DEF=e;let r=e.getUserModel();this._grid.setColumnDataBindingHandler(i,e.getRenderer());let s=r.width;if(void 0!==s){let t;s=+s,t=null!=r.scalable?!!r.scalable:s!=s,this._grid.setColumnWidth(i,s,t)}else this._grid.setColumnWidth(i,1,!0);s=r.minWidth,s>=0&&this._grid.setMinimumColumnWidth(i,s),s=r.hidden,s&&this._grid.hideColumn(i,!0),s=r.textAlign||r.alignment,"string"==typeof s&&this._grid.setColumnAlignment(i,s),r.keepModel||e.clearUserModel(),e.isTextSelect()&&this._grid.enableColumnClass(i,"tr-text-select",!0,"content");let a,l=e.getClasses();for(a=0;a<l.length;a++)this._grid.enableColumnClass(i,l[a]);let u=e.getField();this._grid.setDataColumnName(i,yt);let h,p,d,c,_=e.getAllFields(),f=e.getId(),g=_.length;for(a=0;a<g;a++)h=_[a],this._shouldLoadFieldInfo(h)?(p=h===u?e.getDataType():Pt.getDataType(h),d=Tt.loadFieldInfo(h).then(this._onFieldLoadedSuccess.bind(this,h,e)).catch(this._onFieldLoadedError),p?(e.isTimeSeries()&&this._populateTimeSeriesChildren(e),this._connector.addFields(h,f)):(c=this._onFieldLoaded.bind(this,h,f),d=d.then(c).catch(c))):(e.isTimeSeries()&&this._populateTimeSeriesChildren(e),this._connector.addFields(h,f))},ei.prototype.removeColumn=function(t){let e=this.getColumnIndex(t);if(e<0)return;let i=this.getColumnDefinition(e);i.isRealTimeField()||this._dc&&this._dc.removeStaticFields([i.getField()]),this._grid.removeColumnAt(e),this._connector.removeFields(i),i.dispose()},ei.prototype.removeColumns=function(t){let e=this.getColumnIndices(t),i=e.length;if(i<=1)return void(1===i&&this.removeColumn(e[0]));e.sort(ei._descendingOrder);let n=[],o=this._grid.freezeLayout();for(let t=0;t<i;++t){let i=e[t],o=this.getColumnDefinition(i);o.isRealTimeField()||n.push(o.getField()),o.dispose(),this._grid.removeColumnAt(i),this._connector.removeFields(o)}n.length&&this._dc&&this._dc.removeStaticFields(n),this._grid.freezeLayout(o)},ei.prototype.removeAllColumns=function(){let t=this.getColumnCount();if(!(t<=0)){this._sharedSorter||this.clearSort();for(let e=t;--e>=0;){this._grid.setColumnDataBindingHandler(e,null),this.getColumnDefinition(e).dispose()}this._columnTitleConflator.reset(),this._timeSeriesChildConflator.reset(),this._connector.removeAllFields(),this._grid.setColumnCount(0),this._dc&&this._dc.resetStaticFields()}},ei.prototype.moveColumn=function(t,e){return this._grid.moveColumn(t,e)},ei.prototype.moveColumnById=function(t,e){return this._grid.moveColumnById(t,e)},ei.prototype.reorderColumns=function(t,e){return this._grid.reorderColumns(t,e)},ei.prototype.hideColumn=function(t,e){let i=this.getColumnIndex(t);i<0||this._grid.hideColumn(i,e)},ei.prototype.hideColumns=function(t,e){this._grid.hideColumns(this.getColumnIndices(t),e)},ei.prototype.showAllColumns=function(){this._grid.showAllColumns()},ei._descendingOrder=function(t,e){return e-t},ei.prototype.addDataFields=function(t,e){if(!t)return!1;let i,n,o,r,s,a=Array.isArray(t)?t:[t],l=a.length;for(i=0;i<l;i++)n=a[i],this._shouldLoadFieldInfo(n)?(o=Pt.getDataType(n),r=Tt.loadFieldInfo(n).catch(this._onFieldLoadedError),o?this._connector.addFields(n,e||"grid"):(s=this._onFieldLoaded.bind(this,n,e),r=r.then(s).catch(s))):this._connector.addFields(n,e||"grid");return!0},ei.prototype.removeDataFields=function(t,e){return!!t&&(this._connector.removeFields(t,e||"grid"),!0)},ei.prototype.removeFieldReferrer=function(t){t&&this._connector.removeFieldReferrer(t)},ei.prototype.sortColumn=function(t,e){if("string"==typeof t)return void this._stp.sortColumn(t,e);let i=this.getColumnIndex(t);i<0?this._stp.sortColumn(this.getSortedColumnIndex(),"n"):this._stp.sortColumn(i,e)},ei.prototype.setColumnName=function(t,e){let i=this.getColumnDefinition(t);i&&(i.setName(e),this.updateColumnTitle())},ei.prototype.setColumnRenderer=function(t,e){let i=this.getColumnIndex(t);this.setColumnFormatter(i,e)},ei.prototype.activateColumnRenderer=function(t,e,i){let n=this.getColumnIndex(t);if(null==n)return;let o=this.getColumnDefinition(n);o&&(o.activateRenderer(e,i),this._grid.setColumnDataBindingHandler(n,o.getRenderer()),this._grid.requestRowRefresh())},ei.prototype.setColumnFormatter=function(t,e){if(null==t)return;let i=this.getColumnDefinition(t);if(!i)return;let n=null;if(e&&("object"==typeof e?("function"==typeof e.init&&e.init(i.getConfigObject(),this._grid),n=e.binding):n=e,"function"!=typeof n&&(n=null)),n!==i.getRenderer()){let e=this._grid.getSection("content").getColumn(t);e&&e.clearContent(),this._grid.setColumnDataBindingHandler(t,null),i.setRenderer(n),this._grid.setColumnDataBindingHandler(t,i.getRenderer()),this._grid.requestRowRefresh()}},ei.prototype.setColumnSorter=function(t,e){let i=this.getColumnIndex(t),n=this.getColumnDefinition(i);if(n){n.setSorter(e),this.getSortedColumnIndex()===i&&this._stp.refresh()}},ei.prototype._initDuplicateRicData=function(t){let e=t.getSymbol(),i=this._connector.getRowDefByRic(e);i&&i.length&&function(t,e){let i=qe(t),n=qe(e);for(let t in i)Xe[t]||(n[t]=i[t])}(i[0],t)},ei.prototype.insertRow=function(t,e){if(this._mainGrid)return this._mainGrid.insertRow(t,this._getRowId(e));t&&("string"==typeof t?t={ric:t}:Array.isArray(t.values)&&(t.fields||(t.fields=this.getColumnFields())));let i=new Rt(t);return i.setDataSource(this._dc),this._initDuplicateRicData(i),i.registerToView(this._dv,this._getRowId(e)),t&&t.hidden&&this._dv.hideRow(i.getRowId()),this._connector.addRic(i),i},ei.prototype.insertRows=function(t,e,i){if(this._mainGrid)return void this._mainGrid.insertRows(t,this._getRowId(e));if(!Array.isArray(t))return;let n=this._dt.freeze(),o=i||this.getColumnFields(),r=this._getRowId(e),s=t.length;for(let e=0;e<s;++e){let i=t[e];i&&("string"==typeof i&&(i={ric:i}),i.fields=o),this.insertRow(i,r)}this._dt.freeze(n)},ei.prototype.addStaticDataRows=function(t,e){if(this._mainGrid)this._mainGrid.addStaticDataRows(t,e);else{if(!Array.isArray(t)){let i=t;t=null,i&&(i.fields&&!e&&(e=i.fields),Array.isArray(i.data)&&(t=i.data))}t&&this.insertRows(t.map(ei._dataToRowOptions),null,e)}},ei.prototype.updateDataSet=function(t,e){if(!Array.isArray(t)||0===t.length)return void this.removeAllRows();let i,n,o,r,s=t.length,a={},l=this.getAllRowDefinitions(),u=l.length,h=!1;if(e){for(h=this._dt.freeze(),r=0;r<u;r++)i=l[r],i&&(n=i.getRowData()[e],n||0===n?a[n]=i:this.removeRow(i));let p={},d={};for(r=s-1;r>=0;r--)o=t[r],n=o[e],i=a[n],d[n]=o,o.ROW_ORDER=r,p[n]||(p[n]=!0,i?i.setRowData(o):this.insertRow({values:o}));for(let t in a)a[t]&&!d[t]&&this.removeRow(a[t]);this._dt.sortOnce(yt,"a",Je,"ROW_ORDER"),this._dt.freeze(h)}else{for((s-u>1||u-s>1)&&(h=this._dt.freeze()),r=0;r<u;r++)o=t[r],o?a[r]=l[r]:this.removeRow(l[r]);for(r=0;r<s;r++)o=t[r],i=a[r],i?i.setRowData(o):this.insertRow({values:o});(s-u>1||u-s>1)&&this._dt.freeze(h)}},ei._dataToRowOptions=function(t){return{values:t}},ei.prototype.removeRow=function(t){if(this._mainGrid)return this._mainGrid.removeRow(this._getRowId(t));let e=this._getRowDefinitionByRef(t);return e&&(e.isAutoGenerated()||this._removeRow(e)),e},ei.prototype.removeRows=function(t){let e,i;if(!Array.isArray(t))return e=this.removeRow(t),e?[e]:[];if(this._mainGrid)return this._mainGrid.removeRows(t.map(this._getRowId));let n=[],o=t.length;for(i=0;i<o;++i)e=this._getRowDefinitionByRef(t[i]),e&&(e.isAutoGenerated()||n.push(e));o=n.length;let r=!1;for(o>1&&(r=this._dt.freeze()),i=0;i<o;++i)this._removeRow(n[i]);return o>1&&this._dt.freeze(r),n},ei.prototype.removeAllRows=function(){if(this._sharedDataSource)return;if(!this._dt.getRowCount())return;let t=this._getAllRowDefinitions();this._sharedDataSource||(this._dc.clearAllData(),this._dt.clearAllData(),this._clearDataUpdates()),t.forEach(Rt.dispose),this._streamingConflator.reset(),this._formulaConflator.reset(),this._chainConflator.reset(),this._connector.removeAllRics(),this._grid.getVScrollbar().setScrollTop(0)},ei.prototype._removeRow=function(t){if(this._sharedDataSource)return;this._dispatch("beforeRowRemoved",{});let e=this._connector,i=this._dt,n=t.getDescendants();if(n){for(let t=0;t<n.length;t++)e.removeRic(n[t]);let t=n.map(Rt.toRowId);i.removeRows(t)}e.removeRic(t),i.removeRow(t.getRowId()),t.dispose()},ei.prototype.hideRow=function(t,e){let i=this._getRowId(t);(this._mainGrid||this._grid).hideRow(i,e)},ei.prototype.hideRows=function(t,e){Array.isArray(t)||(t=[t]);let i=t.map(this._getRowId);(this._mainGrid||this._grid).hideRows(i,e)},ei.prototype.showRows=function(t,e){this.hideRows(t,!1===e)},ei.prototype.unhideAllRows=function(){this._grid.unhideAllRows()},ei.prototype.hasHiddenRow=function(){return this._grid.hasHiddenRow()},ei.prototype.setRic=function(t,e,i){if(this._mainGrid)return void this._mainGrid.setRic(this._toRowId(t),e,i);let n=this._getRowDefinitionByRef(t);if(n){var o=i||{};"string"==typeof e?o.ric=e:(e&&!i&&(o=e),e=o.ric?o.ric:"");let t=Rt.extractRowOptions(o),r=n.getSymbol();n.setContent(e,t)&&(this._connector.removeRic(n,r),this._initDuplicateRicData(n),this._connector.addRic(n));let s=o.values;null!=s&&n.setStaticRowData(s,o.fields)}},ei.prototype.unlinkChain=function(t){let e=this._getRowDefinitionByRef(t);e&&e.isChain()&&e.unlinkChain()},ei.prototype.setRowContent=ei.prototype.setRic,ei.prototype.toggleRowExpansion=function(t,e){this._dv.toggleRowExpansion(t,e)},ei.prototype._onRowExpansionBinding=function(t){if(this.hasListener("rowExpansionBinding")){if(t.originalRowId){let e=this._dv.getRowIndex(t.originalRowId);t.originalRowDef=this._getRowDefinitionByIndex(e),t.originalRowData=t.originalRowDef.getRowData()}else t.rowDef=this._getRowDefinitionByIndex(t.rowIndex),t.rowData=t.rowDef.getRowData();this._dispatch("rowExpansionBinding",t)}},ei.prototype.setRics=function(t){this.removeAllRows(),t&&t.length&&this.insertRows(t)},ei.prototype.getRowCount=function(){return this._dv.getRowCount()},ei.prototype.getPageItemCount=function(){return this._dv.getRowCount(!1,!0)},ei.prototype.getDataRowCount=function(){return this._dt.getRowCount()},ei.prototype.getColumnCount=function(){return this._grid.getColumnCount()},ei.prototype.getColumnDataType=function(t){let e=this.getColumnDefinition(t);return e?e.getDataType():""},ei.prototype.getColumnDefinition=function(t){let e=this._grid.getColumnData(t);return e&&e.COL_DEF||null},ei.prototype.getColumnDefinitions=function(){let t=this.getColumnCount(),e=new Array(t);for(let i=0;i<t;i++)e[i]=this.getColumnDefinition(i);return e},ei.prototype.getColumnDefinitionById=function(t){return"string"==typeof t?this.getColumnDefinition(this.getColumnIndex(t)):null},ei.prototype.getColumnDefinitionsById=function(t){let e=Array.isArray(t)?t.length:0;if(e>0){let i,n,o=new Array(e);for(i=0;i<e;i++)n=t[i],o[i]=this.getColumnDefinitionById(n);return o}return null},ei.prototype._getColumnDefinition=function(t){if(t instanceof Pt)return t;if("number"==typeof t)return this.getColumnDefinition(t);if("string"==typeof t){let e=this.getColumnCount();for(let i=0;i<e;++i){let e=this.getColumnDefinition(i);if($e(e,t))return e}}return null},ei.prototype.getRowType=function(t){let e=this.getRowDefinition(t);return e?e.getType():""},ei.prototype.getRowDefinition=function(t){return"number"==typeof t?this._getRowDefinitionByIndex(t):"string"==typeof t?this._getRowDefinitionById(t):null},ei.prototype._getRowDefinitionByIndex=function(t){return this._dv.getDataAt(t,yt)||null},ei.prototype._getRowDefinitionById=function(t){return this._dt.getData(t,yt)||null},ei.prototype._getRowDefinitionByRef=function(t){return t instanceof Rt&&t.getRowId()?t:this.getRowDefinition(t)},ei.prototype.getRowDefinitions=function(){return this._dv.getColumnData(yt,!0)},ei.prototype._getAllRowDefinitions=function(){return this._dt.getColumnData(yt)},ei.prototype.getAllRowDefinitions=function(t){return t?this._getAllRowDefinitions():this._dt.getColumnData(yt).filter(je)},ei.prototype.getRowData=function(t){return qe(this._getRowDefinitionByIndex(t))},ei.prototype.getMultipleRowData=function(t){if("number"==typeof t)return[this.getRowData(t)];let e=null;if(Array.isArray(t)){let i=t,n=i.length,o=new Array(n);e=this.getRowDefinitions();for(let t=0;t<n;++t){let n=i[t];"number"==typeof n?o[t]=qe(e[n]):n&&n.getRowData&&(o[t]=qe(n))}return o}return e=t&&t.getColumnData?t.getColumnData(yt,!1):this.getRowDefinitions(),e.map(qe)},ei.prototype.setRicData=function(t,e){let i=this._connector.getRowDefByRic(t),n=i?i.length:0;for(let o=0;o<n;++o){let n=i[o];n&&n.getSymbol()===t&&n.setRowData(e)}},ei.prototype.setRowData=function(t,e){let i=this._getRowDefinitionByRef(t);i&&i.setRowData(e)},ei.prototype.setStaticRowData=function(t,e){let i=this._getRowDefinitionByRef(t);i&&i.setStaticRowData(e)},ei.prototype.setStaticData=function(t,e,i){let n=this._getRowDefinitionByRef(t);n&&n.setStaticData(e,i)},ei.prototype._getRowId=function(t){return"string"==typeof t?t:"number"==typeof t?this._dv.getRowId(t):t instanceof Rt?t.getRowId():""},ei.prototype.getColumnIndex=function(t){if(t&&t instanceof Pt){let e=this.getColumnCount();for(let i=0;i<e;++i){if(this.getColumnDefinition(i)===t)return i}return-1}return this._grid.getColumnIndex(t)},ei.prototype.getColumnIndices=function(t){let e=[],i=this.getColumnCount(),n=Array.isArray(t)?t:[t],o=n.length;for(let t=0;t<o;++t){let o=this.getColumnIndex(n[t]);o>=0&&o<i&&e.push(o)}return e},ei.prototype.getColumnId=function(t){return this._grid.getColumnId(t)},ei.prototype.getColumnIds=function(){return this._grid.getColumnIds()},ei.prototype.getColumnField=function(t){return this._grid.getColumnField(t)},ei.prototype.getColumnFields=function(){return this._grid.getColumnFields()},ei.prototype.getColumnNames=function(){return this.getColumnDefinitions().map(Ze)},ei.prototype.getAllFields=function(){return this._connector.getAllFields()},ei.prototype.freezeColumn=function(t,e){null==t&&(t=-1),this._grid.freezeColumn(t,e)},ei.prototype.pinColumn=function(t,e){if(Array.isArray(t)){let i=t,n=i.length,o=0;for(let t=0;t<n;++t)o|=this._pinColumn(i[t],e);return!!o}return this._pinColumn(t,e)},ei.prototype._pinColumn=function(t,e){let i=this.getColumnIndex(t),n=this.getColumnCount();if(i<0||i>n)return!1;let o=this._grid.getPinnedLeftColumnCount(),r=this._grid.getPinnedRightColumnCount(),s=this._grid.getStationaryColumnIndex();if(e&&"right"===e.toLowerCase()){let t=this._grid.getFirstPinnedRightIndex();if(i>=t)return!1;if(s>=0&&i<=s)return!1;this.moveColumnById(i,t),r+=1,o-=1}else{if(i<o)return!1;o||s>=0&&(o=s,i>s&&o++),this.moveColumnById(i,o)}return this._grid.freezeColumn(o,r),!0},ei.prototype.unpinColumn=function(t,e){if(Array.isArray(t)){let i=t,n=0;for(let t=i.length;--t>=0;)n|=this._unpinColumn(i[t],e);return!!n}return this._unpinColumn(t,e)},ei.prototype._unpinColumn=function(t,e){let i=this.getColumnIndex(t);if(i<0)return!1;let n=this._grid.getPinnedLeftColumnCount(),o=this._grid.getPinnedRightColumnCount(),r=this.getColumnCount()-o;if(i>=n&&i<r)return!1;let s=null,a=null;if(null!=e){let t=this.getColumnIndex(e);a=this.getColumnId(t),s=this.getColumnId(i)}let l=this._grid.getStationaryColumnIndex();return i<n?(i>l&&this.moveColumnById(i,n),this._grid.freezeColumn(n-2,o)):i>=r&&(i>l&&this.moveColumnById(i,r),this._grid.freezeColumn(n-1,o-1)),i>l&&null!=a&&this.moveColumnById(s,a),!0},ei.prototype.unpinAllColumns=function(){let t=this._grid.getPinnedLeftColumnCount(),e=this._grid.getPinnedRightColumnCount();return!(!t&&!e)&&(this._grid.freezeColumn(-1,0),!0)},ei.prototype._onColumnHeaderBinding=function(t){if("title"!==t.sectionType||t.sectionIndex>0)return;let e=t.fromColIndex,i=t.toColIndex;for(;e<i;)this._renderColumnHeader(e++,t)},ei.prototype._renderColumnHeader=function(t,e){let i=this.getColumnDefinition(t);if(!i)return;let n=i.getHeaderRenderer(),o=e.section,r=o.getRowCount();e.colIndex=t,e.columnDef=i;let s=i.getName(),a=i.getTooltip(),l=i.getHeaderAlignment();for(let i=0;i<r;++i){let r=o.getCell(t,i,!1);r.setContent(s),r.setTooltip(a),r.setStyle("textAlign",l),n&&(e.rowIndex=i,e.cell=r,n(e))}},ei.prototype.updateColumnTitle=function(){if(this._columnTitleConflator.conflate())return;let t=this._grid.getSectionSettings("title");t&&t.rerender()},ei.prototype.isSorting=function(){return this._stp.isSorting()},ei.prototype.getSortedColumnIndex=function(){return this._stp.getSortedColumnIndex()},ei.prototype.getSortOrder=function(){return this._stp.getSortOrder()},ei.prototype.clearSort=function(){this._stp.clearSortState()},ei.prototype._onQuote2PostUpdate=function(t){t.childOrderChange&&(this.isSorting()||this._dt.sortOnce("ROW_DEF","a",Qe))},ei.prototype._onDataChanged=function(t){let e=t.rowData;if(!e)return;let i=e[yt];if(i){if(i.getRowId()){this._dc.getRowData(t.rid)?(i.addUpdate(t)&&(this._dt._hasNewUpdates=!0),this._updateStreamingData()):i.isAutoGenerated()&&(i.setParent(null),this._removeRow(i))}return}let n=e.SUB_ID;if(n){let i=this._getRowDefinitionById(n);i&&i.getRic()!==e.RIC&&(this._chainMembers||(this._chainMembers={}),this._chainMembers[t.rid]||(this._chainMembers[t.rid]=e,this._addMemberOfChain(e)))}},ei.prototype._addMemberOfChain=function(t){if(this._chainConflator.conflate(t))return;let e,i=this._chainConflator.popAllData(),n=i?i.length:0,o=!1;n>1&&(o=this._dt.freeze());let r=[];for(e=0;e<n;++e){let n=(t=i[e]).SUB_ID,o=this._getRowDefinitionById(n);if(o){let e=o.addConstituent(t.RIC,this._dt);e&&r.push(e)}}this._chainMembers=null;let s=r.length;if(s)for(e=s;--e>=0;)this._connector.addRic(r[e]);n>1&&this._dt.freeze(o)},ei.prototype._updateStreamingData=function(){this._streamingConflator.conflate()||this._dt&&(this._dt.classifySegments(),this._dt.dispatchGlobalChange())},ei.prototype._onPreDataSorting=function(t){let e=this._stp.getSortedColumns();if(this._sorter.reset(),Array.isArray(e)){let t=e.length;for(let i=0;i<t;++i){let t=e[i],n=t.field||"",o=t.colIndex,r=o>=0?this.getColumnDefinition(o):null,s=!1,a=null;r&&(n=r.getField(),s=r.isRowSorting(),a=r.getSorter()),this._sorter.addColumnContext(n,a,s,t.sortOrder,o,r)}}this._columnSorter=this._sorter.getSorter()},ei.prototype._mainSorter=function(t,e,i){return this._columnSorter(t,e,i)},ei.prototype._onPostSectionDataBinding=function(t){t.actualUpdate&&this._asyncClearDataUpdates()},ei.prototype._asyncClearDataUpdates=function(){setTimeout(this._clearDataUpdates,0)},ei.prototype._clearDataUpdates=function(){if(!this._dt||!this._dt._hasNewUpdates)return;let t=this._dt.getAllRowIds(!0);for(let e=t.length;--e>=0;){this._dt.getRowData(t[e])[yt].resetUpdates()}},ei.prototype.getDataView=function(){return this._dv},ei.prototype.setPage=function(t){return this._dv.setPage(t)},ei.prototype.setPageSize=function(t){this._dv.setPageSize(t)},ei.prototype.getPageIndex=function(){return this._dv.getPageIndex()},ei.prototype.getPageSize=function(){return this._dv.getPageSize()},ei.prototype.getPageCount=function(){return this._dv.getPageCount()},ei.prototype.toggleChain=function(t){let e=this._getRowDefinitionByRef(t);e&&e.toggleChain()},ei.prototype.setClassification=function(t,e){let i=this._getRowDefinitionByRef(t);return!!i&&this._dt.setSegmentClassification(i.getRowId(),e)},ei.prototype.contains=function(t){return!!t&&this._topNode.contains(t)},ei.prototype.isFocused=function(){let t=document.activeElement;return t&&t.shadowRoot?t.shadowRoot===this._topNode.parentNode:this.contains(t)},ei.prototype.focus=function(){this._grid.focus()},ei.prototype.requestRowRefresh=function(){this._grid.requestRowRefresh()},ei.prototype.updateLayout=function(){this._grid.updateLayout()},ei.prototype.getExtension=function(t){return t?this._grid.getPlugin(t.replace(/Extension/gi,"")):null},ei.prototype._onFormulaDataChanged=function(t){this._formulaConflator.conflate()||(this._recalculateFormulas(),this._updateRowData())},ei.prototype._onFormulaDataRequired=function(t){},ei.prototype._onDataComposed=function(t){let e=t.changes;if(!e)return;let i=t.rowData;if(!i)return;let n=i[yt];if(n&&n.getDataSource()){if(this._autoDateConversion){let t,i,o,r;for(t in e)r=this._getColumnDefinition(t),o=r?r.getDataType():Pt.getDataType(t),"datetime"===o&&(i=e[t],n.setData(t+"_RAW",i),i=B.toDateObject(i),n.setData(t,i))}this.hasListener("dataComposed")&&(t.grid=this,t.rowDef=n,this._dispatch("dataComposed",t)),this._recalculateFormulas(t)}},ei.prototype._onSubSegmentChanged=function(t){let e,i=t.insertionList,n=t.removalList,o=t.removedRows,r=n.length,s=null;for(e=0;e<r;e++){let t=o[n[e]];t&&(s=t[yt],s&&(s.dispose(),t[yt]=null))}let a=i.length;for(e=0;e<a;e++){let t=i[e].getId();s=new Rt({segmentId:t}),s.setDataSource(this._dc),s.registerToView(this._dv)}},ei.prototype._recalculateFormulas=function(t){if(this._fnEngine&&!(this._fnEngine.getFormulaCount()<=0))if(t&&t.rid)this._fnEngine.calculate(t.rowData,t.changes);else{let t=this._dc?this._dc.getAllRowData():null,e=t?t.length:0;for(let i=0;i<e;++i)this._fnEngine.calculate(t[i])}},ei.prototype._snapshotFillerDataChanged=function(t){if(!this._dt)return;let e=t.data;if(t.timeSeries)this._updateTimeSeriesFields(t);else for(let t in e)this.setRicData(t,e[t]);this._lastPollingRequest||(this._lastPollingRequest=1),this._startPolling()},ei.prototype._startPolling=function(){if(this._pollingEnabled&&this._pollingInterval&&this._lastPollingRequest&&!this._pollingTimerId){let t=new Date;this._lastPollingRequest=t.getTime(),this._pollingTimerId=setTimeout(this._onPollingInterval,this._pollingInterval)}},ei.prototype._onPollingInterval=function(){this._pollingTimerId=0,this._pollingEnabled&&this._pollingInterval&&(this.refreshADCData(),this._startPolling())},ei.prototype.activateADCPolling=function(t){if(!1!==t){this._pollingEnabled=!0;let t=new Date;if(this._lastPollingRequest){t.getTime()-this._lastPollingRequest>this._pollingInterval&&this.refreshADCData()}this._startPolling()}else this._pollingEnabled=!1},ei.prototype.refreshADCData=function(){let t=this._snapshot.addFields(this._connector.getAllFields());return!(!t||(t=this._snapshot.addRics(this._connector.getAllRics()),!t))||(this._lastPollingRequest=0,!1)},ei.prototype._onAutoLayoutUpdate=function(){let t=this._topNode.clientWidth;t!==this._clientWidth&&(this._clientWidth=t,this.updateLayout())},ei.prototype.logDT=function(t){let e=this._getAllRowDefinitions();this._logData(e,t)},ei.prototype.logDV=function(t){let e=this.getRowDefinitions();this._logData(e,t)},ei.prototype._logData=function(t,e){e||(e={}),e.colNames||(e.colNames=this.getColumnFields());let i=ut.constructTable(t.map(qe),e);console.table(i)},ei.prototype.replaceRow=function(t,e){let i=this._getRowId(t),n=this._getRowDefinitionById(i);if(n){if(n.isAutoGenerated())return null;let t=n.getConfigObject();if(n.getRowId()===e.rowId)return null;if(v(t,e))return null}let o=this.insertRow(e,i);return n&&this.removeRow(i),o},ei.prototype.scrollToColumn=function(t,e){return this._grid.scrollToColumn(t,e)},ei.prototype.scrollToRow=function(t,e){this._grid.scrollToRow("content",t,e)},ei.prototype.getScrollLeft=function(){return this._grid.getScrollLeft()},ei.prototype.getScrollTop=function(){return this._grid.getScrollTop()},ei.prototype.setScrollLeft=function(t){this._grid.setScrollLeft(t)},ei.prototype.setScrollTop=function(t){this._grid.setScrollTop(t)},ei.prototype.scrollRight=function(t){this._grid.scrollRight(t)},ei.prototype.scrollDown=function(t){this._grid.scrollDown(t)},ei.prototype.getScrollWidth=function(){return this._grid.getScrollWidth()},ei.prototype.getScrollHeight=function(){return this._grid.getScrollHeight()},ei.prototype.getVScrollView=function(){return this._grid.getVScrollView()};var ii={texts:["If a dog and cat had a baby together that grew up and worked a desk job he'd be a Cog in the machine","I'm still upset that Tie Domi didn't name his child Tyson","A tagline for a car company that prides itself on its morals and ethics: Take the High Road","Logan Broger is amazing and a wonderful boy according to Logan's mom","You know the Grammys are a joke when Future doesn't win Best Everything","If you were a member of the Bloods and became paralyzed do you then become a member of the Crips?","Curling is the best sport named after something you do to your hair","You say potatoe, I say starchy carbs","If you work for an ad agency and getting paid for it aren't you the one who is being influenced by advertising?","Are there Out of Stock photos? Gafuffle","I think of a lot of good ideas when going to the bathroom I guess I have a real stream of consciousness","Most streets are two way streets","Why does that make love so special?","A tagline for an airline: Take the High Road","Rumour has it targeted online advertising was developed because the internet was upset that you could read it but it couldn't read you","This is a true fact: I never had a fear of heights until I fell off a roof","A tagline for a special highway that is easy to navigate while under the influence of drugs: Take the High Road","I'm the only person in the world with my name","We need more werkin and less twerkin if you ask me","If Fantasy Hockey actually lived up to its name, every team would have Henrik Lundqvist and Joffrey Lupul on it","I'm in a band that does Metallica covers with our private parts it's called Myphallica","Smiling could easily be misinterpreted for showing your teeth to someone because they said something that made you happy","We say we are walking the dog, but the dog always leads","Tim Horton was a hockey player but is the name of a coffee chain, which means my dream of a goat sanctuary being my legacy is not unrealistic","I started a sensory deprivation chamber business it involves really dark curtains, ear plugs, and a sleeping mask","Do we make money or does money make us? Chezwich","Pantone is a colour but also the singular version of pants","Logan Ipsum will loop at some point","Thank you for using my words in your work","You should listen to my mixtape (check out the rest of my portfolio)","I have never known a Jack that was in good enough shape to name bodybuilding after him","Twitter is the rice of social media","Injuries always keep you OUT of things","For the name of an act as serious as killing someone, assassination literally translates to buttbuttination","Why don't we call glasses duocles","If you wake up with a giant zit, you are really facing your fears when you look in the mirror","Cemeteries are just garbage dumps filled with humans","I have a moral code, but I haven't figured out how to read it yet","I bet most serial killers play the drums","To Catch A Predator would have been a great name for a Steve Irwin show","If the word kerning is kerned poorly, it kind of looks like learning which is appropriate because both are important","North America should be called Russia since people are always moving so fast","I don't need a big house, just a two floor condo you could say I have lofty expectations","Even faithful and simple Sancho is forced to deceive him at certain points","The novel is considered a satire of orthodoxy, veracity and even nationalism","In exploring the individualism of his characters, Cervantes helped move beyond the narrow literary conventions of the chivalric romance literature that he spoofed","which consists of straightforward retelling of a series of acts that redound to the knightly virtues of the hero","The character of Don Quixote became so well known in its time that the word quixotic was quickly adopted by many languages","Characters such as Sancho Panza and Don Quixote's steed, Rocinante, are emblems of Western literary culture","It stands in a unique position between medieval chivalric romance and the modern novel","The former consist of disconnected stories featuring the same characters and settings with little exploration of the inner life of even the main character"]};ii.words=ii.texts.join(" ").split(" ").filter((function(t){return t.length>1})),ii.companyName=["Yost-Prohaska","Wehner, Howe and Brown","Gusikowski-Legros","Wolff-Windler","McGlynn, Douglas and Kilback","MacGyver Group","Spinka, Stracke and Huel","Howell, Wolff and Emmerich","Blick-O'Reilly","Dibbert, Buckridge and Leffler","Skiles, Kuhlman and Johns","Daugherty Group","Reilly, Toy and Bayer","Bradtke, Mohr and Weber","Thompson, Bruen and Friesen","Rempel-Bednar","Kunze LLC","Pfannerstill Group","Moen-Larkin","Larson LLC","Haag-Feest","Hauck-Bartell","Rohan-Kohler","Waters, Homenick and Pagac","Ziemann Group","Reynolds, Turcotte and Bosco","Graham, Morar and Waters","Cassin Inc","Bosco-Terry","Stanton-Blick","Prohaska and Sons","Pouros, Daugherty and Pfannerstill","Bogan-Cormier","O'Kon-Mills","Mueller-Schmeler","Runte-Trantow","Muller Inc","Shanahan, Ryan and Orn","Huel LLC","Shanahan-Zulauf","Emard-Schuster","Muller Inc","Collier, Muller and Yundt","Wehner, Prohaska and Harber","Ondricka-Stehr","Towne LLC","Feil Inc","Braun, Kihn and Treutel","Ebert-MacGyver","Harris LLC"],ii.industry=["Specialty Chemicals","Office Equipment/Supplies/Services","Electric Utilities: Central","Trucking Freight/Courier Services","Auto Parts:O.E.M.","Oil Refining/Marketing","Biotechnology: Biological Products (No Diagnostic Substances)","Computer Software: Programming, Data Processing","Farming/Seeds/Milling","Biotechnology: Laboratory Analytical Instruments","Finance: Consumer Services","Major Banks","Investment Managers","Oilfield Services/Equipment","Paper","Transportation Services"],ii.market=["NYSE","NASDAQ","SET","DJI","HSCEI","HKEX","NIKKEI"],ii.country=[{name:"Afghanistan",code:"AF"},{name:"land Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Cote D'Ivoire",code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:"Korea, Democratic People'S Republic of",code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:"Lao People'S Democratic Republic",code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montenegro",code:"ME"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia",code:"RS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}];var ni=ii,oi=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10],ri={X_RIC_NAME:{type:"string"},CF_NAME:{type:"string",prefix:!0,suffix:" Name"},CF_LAST:{type:"number",min:.01,max:1e3,prec:2},PCTCHNG:{type:"number",min:-1,max:1,prec:2,suffix:"%"},PCTCHNG2:{type:"float",min:-20,max:20,prec:2,suffix:"%"},CF_CURR:{fixedValue:"USD"},INDICATOR:{type:"number",min:0,max:5},CF_TICK:{type:"number",min:1,max:3,changeOnly:!0},PRCTCK_1:{type:"set",members:["⇧","B⇧","↑","B↑","26","1",'"1"',"-1","⇩","B⇩","↓","B↓","27","2",'"2"']},CF_NETCHNG:{type:"number",min:-100,max:100},CF_VOLUME:{type:"number",min:0,max:1e7},RI_FLAG:{type:"set",members:["R","Q","I","_",""]},RI_CODE:{type:"number",min:0,max:2},STATUS:{type:"number",min:0,max:6},YRLOW:{type:"number",min:0,max:20},YRHIGH:{type:"number",min:200,max:2e3},CFLOW:{type:"number",min:0,max:20},CFHIGH:{type:"number",min:200,max:2e3},LOW_YLD:{type:"set",members:[void 0,0,1,2,3,4,5,10,11,15,20]},HIGH_YLD:{type:"set",members:[void 0,200,300,400,500,1e3,1500,2e3]},CF_YIELD:{type:"set",members:[void 0,0,10,20,30,40,50,100,200,300,400,500]},"TR.IPODate":{type:"isoDate",min:Date.now()-63072e6,max:Date.now()},"TR.Volume":{type:"number",min:2e3,max:1e7},"TR.Price52WeekHigh":{type:"number",min:100,max:300,prec:2},"TR.Price52WeekLow":{type:"number",min:1,max:200,prec:2},"TR.InvalidField":{type:"set",members:[void 0]},percent:{type:"number",min:0,max:101},number_1:{type:"number",min:1,max:100},number_2:{type:"number",min:-100,max:100},index4:{type:"number",min:0,max:4},index5:{type:"number",min:0,max:5},index10:{type:"number",min:0,max:10},index100:{type:"number",min:0,max:100},group3:{type:"set",members:["Group_A","Group_B","Group_C"]},group4:{type:"set",members:["Group_1","Group_2","Group_3","Group_4"]},float_1:{type:"float",min:0,max:1,prec:2},float_2:{type:"float",min:0,max:100,prec:2},float_3:{type:"float",min:-1,max:1,prec:2},precision4:{type:"float",min:-10,max:10,prec:4},precision8:{type:"float",min:-100,max:100,prec:8},boolean:{type:"boolean"},date:{type:"date",min:15e11,max:16e11},date1:{type:"function",generate:function(t,e){return null==e?_i(6e11,16e11,e):new Date(1e12+1e9*e)}},ISODate:{type:"isoDateObject",min:Date.now()-63072e6,max:Date.now()},word:{type:"string",min:1,max:1},phrase:{type:"string",min:2,max:5},words:{type:"string",min:1,max:20},words1:{type:"string",min:2,max:8},words2:{type:"string",min:3,max:10},words3:{type:"string",min:5,max:15},sentence:{type:"string",min:8,max:20},id:{type:"function",hash:0,generate:function(t,e){return null==e&&(e=null!=t._id?t._id:-1,t._id=++e),e||0}},companyName:{type:"set",members:ni.companyName},industry:{type:"set",members:ni.industry},market:{type:"set",members:ni.market},country:{type:"set",members:ni.country}},si=function(t,e){if(t){var i=e;"function"==typeof e&&(i={type:"function",generate:e}),ri[t]=i}},ai=function(t){return"number"==typeof t?function(t){var e=1e4*Math.sin(113*t);return(e*=e)-(0|e)}(t):Math.random()},li=function(t,e,i,n){t||(t=0),null==e&&(e=100);var o=(e-t)*ai(n)+t;if(i>0){var r=oi[i];return Math.floor(o*r)/r}return null!=i?Math.floor(o):o},ui=function(t,e,i){return li(t,e+1,0,i)},hi=function(t,e,i){return li(t,e,0,i)},pi=function(t,e){return hi(0,t,e)},di=function(t){return 0===ui(0,1,t)},ci=function(t,e){return t?t[pi(t.length,e)]:String.fromCharCode(ui(65,90,e))},_i=function(t,e,i){(t=t||Date.now()-63072e6)instanceof Date&&(t=t.getTime()),(e=e||Date.now())instanceof Date&&(e=e.getTime());var n=ui(0,(e-t)/1e3,i);return new Date(t+1e3*n)},fi=function(t,e,i){for(var n=t<e?hi(t,e,i):t,o=new Array(n),r=0;r<n;++r){null!=i&&(i*=1.17*(r+1));var s=pi(ni.words.length,i);o[r]=ni.words[s]}return o.join(" ")},gi=function(t,e,i){var n=mi(t,e,i),o=n.value+"";return n.prefix&&("string"==typeof n.prefix?o=n.prefix+o:e.prefix&&(o=e.prefix+" "+o)),n.suffix&&(o+=n.suffix),"string"===n.type&&(n.value=o),n.formattedValue=o,n},yi=function(t,e,i){var n={},o=0;e&&("number"==typeof e?o=n.numRows=e:(n=e,o=e.numRows||e.numRow||e.rowCount,null!=e.seed&&-1===(i=e.seed)&&(i=null))),o||(o=1),t?Array.isArray(t)||(t=[t+""]):t=[""];for(var r=t.length,s=[],a=0;a<o;++a){for(var l=[],u=0;u<r;++u){var h=t[u];l.push(mi(h,e,i).value)}null!=i&&++i,s.push(l)}return{data:s,seed:i,fields:t}},mi=function(t,e,i){var n=function(t){return ri[t]||{}}(t);if(n.type||(n.type="number",si(t,n)),n.fixedValue)return n.value=o,n;null!=i&&(null==n.hash&&(n.hash=function(t){for(var e=0,i=t?t.length:0;--i>=0;)e+=t.charCodeAt(i)*(i+.9879);return e}(t)),i+=n.hash);var o,r=null!=n.min?n.min:100,s=null!=n.max?n.max:1e4;if("string"===n.type)o=null!=n.min||null!=n.max?fi(r,s,i):e&&e.text||"";else if("set"===n.type)o=ci(n.members,i);else if("date"===n.type)o=_i(r,s,i);else if("isoDate"===n.type){o=_i(r,s,i).toISOString().slice(0,10)}else if("isoDateObject"===n.type)o=_i(r,s,i),o=new Date(o.toISOString().slice(0,10));else if("boolean"===n.type)o=di(i);else if("function"===n.type)n.field=t,o=n.generate(n,i);else{var a=null!=n.prec?n.prec:0;o=li(r,s,a,i)}return n.value=o,n},vi=function(t){this._seed=null!=t?t:null};vi.prototype._seed=null,vi.prototype.generate=function(t,e){var i=yi(t,e,this._seed);return this._seed=i.seed,i.data},vi.prototype.generateRecords=function(t,e){var i=yi(t,e,this._seed);this._seed=i.seed;for(var n=(t=i.fields).length,o=i.data,r=o.length;--r>=0;){for(var s=o[r],a={},l=0;l<n;++l){a[t[l]]=s[l]}o[r]=a}return o},vi.prototype.generateQuoteData=function(t,e){var i=gi(t,e,this._seed);return null!=this._seed&&++this._seed,i},vi.prototype.getSeed=function(){return this._seed},vi.prototype.setSeed=function(t){"number"==typeof t&&(this._seed=t)},vi.prototype.randBetween=function(t,e){var i=hi(t,e,this._seed);return null!=this._seed&&++this._seed,i},vi.prototype.randInt=function(t,e){var i=ui(t,e,this._seed);return null!=this._seed&&++this._seed,i},vi.prototype.randIndex=function(t){var e=pi(t,this._seed);return null!=this._seed&&++this._seed,e},vi.prototype.randNumber=function(t,e,i){var n=li(t,e,i,this._seed);return null!=this._seed&&++this._seed,n},vi.prototype.randBoolean=function(){var t=di(this._seed);return null!=this._seed&&++this._seed,t},vi.prototype.randMember=function(t){var e=ci(t,this._seed);return null!=this._seed&&++this._seed,e},vi.prototype.randDate=function(t,e){var i=_i(t,e,this._seed);return null!=this._seed&&++this._seed,i},vi.prototype.randString=function(t,e){var i=fi(t,e,this._seed);return null!=this._seed&&++this._seed,i},vi.seed=null,vi.generate=function(t,e){var i=yi(t,e,vi.seed);return vi.seed=i.seed,i.data},vi.generateRecord=function(t,e,i){Array.isArray(t)||(t=[t+""]);var n={};null!=e&&("number"==typeof e?i=e:e&&(n=e));for(var o=t.length,r={},s=0;s<o;++s){var a=t[s];r[a]=mi(a,n,i).value}return r},vi.generateRecords=function(t,e){var i=yi(t,e,vi.seed);vi.seed=i.seed;for(var n=(t=i.fields).length,o=i.data,r=o.length;--r>=0;){for(var s=o[r],a={},l=0;l<n;++l){a[t[l]]=s[l]}o[r]=a}return o},vi.addFieldInfo=si,vi.randNumber=li,vi.randInt=ui,vi.randBetween=hi,vi.randIndex=pi,vi.randBoolean=di,vi.randMember=ci,vi.randDate=_i,vi.randString=fi,vi.toRecords=function(t,e){if(!Array.isArray(t))return null;Array.isArray(e)||(e=e?[e+""]:[]);for(var i=t.length,n=new Array(i),o=0;o<i;++o)for(var r=n[o]={},s=t[o],a=s&&s.length||0,l=0;l<a;++l){var u=s[l];if(void 0!==u){var h=e[l];h||0===h||(h=l+""),r[h]=u}}return n};var Ci=function(){};Ci.prototype.create=function(t){return new Si(t)};var Si=function(t){this._onRowUpdated=this._onRowUpdated.bind(this),this._fieldMap={},this._prevData={},this.id=null!=t?t+"":"_sub"+Si._runningId++};Si.prototype._rics=null,Si.prototype._isChain=!1,Si.prototype._fieldMap=null,Si.prototype._prevData=null,Si.prototype._updateHandler=null,Si.prototype._updateTimerId=0,Si.prototype._updateInterval=1e3,Si._runningId=0,Si.prototype.formattedFields=function(t){for(var e=t.length;--e>=0;)this._fieldMap[t[e]]=!0;return this},Si.prototype.rawFields=function(t){for(var e=t.length;--e>=0;)this._fieldMap[t[e]]=!0;return this},Si.prototype.chain=function(t){return this._rics=Array.isArray(t)?t[0]:[t],this._isChain=!0,this},Si.prototype.rics=function(t){return this._rics=Array.isArray(t)?t:[t],this},Si.prototype.start=function(){return this._onRowUpdated(),this},Si.prototype.stop=function(){return this._updateTimerId&&(clearInterval(this._updateTimerId),this._updateTimerId=0),this},Si.prototype.onNewRow=function(t){return this},Si.prototype.onUpdate=function(t){return this._updateHandler=t,this},Si.prototype.onRemoveRow=function(t){return this},Si.prototype._onRowUpdated=function(){if(this._updateHandler){var t,e=this._rics?this._rics.length:0;if(1===e)t=this._rics[0],this._updateHandler(this,t,this._getUpdateData(t));else for(var i=0;i<e;++i)pi(3)||(t=this._rics[i],this._updateHandler(this,t,this._getUpdateData(t)));this._updateTimerId||(this._updateTimerId=setInterval(this._onRowUpdated,this._updateInterval))}},Si.prototype._getUpdateData=function(t){var e={id:this.id},i={text:t};for(var n in this._fieldMap){var o=gi(n,i),r=o.value,s=o.formattedValue;o.changeOnly&&this._prevData[n]===r||(this._prevData[n]=r,e[n]={raw:r,formatted:s||r+""})}return e};var wi=function(){this._dict={}};wi.prototype._dict,wi.prototype._count=0,wi.prototype.addItem=function(t,e){if(t&&null!=e){var i=this._dict[t];return i?i.push(e):this._dict[t]=[e],++this._count,!0}return!1},wi.prototype.addItems=function(t,e){if(t){if(!Array.isArray(e))return this.addItem(t,e);var i=e?e.length:0;if(i){var n=this._dict[t];return n||(n=this._dict[t]=[]),Array.prototype.push.apply(n,e),this._count+=i,!0}}return!1},wi.prototype.removeItem=function(t,e){var i=this._dict[t];if(i){var n=i.indexOf(e);if(n>=0)return i.length>1?i.splice(n,1):delete this._dict[t],--this._count,!0}return!1},wi.prototype.removeItemsByKey=function(t){var e=this._dict[t];return!!e&&(delete this._dict[t],this._count-=e.length,!0)},wi.prototype.removeAllItems=function(){return!!this._count&&(this._dict={},this._count=0,!0)},wi.prototype.getItems=function(t){return this._dict[t]||null},wi.prototype.getAllItems=function(){if(this._count>0){var t=[],e=this._dict;for(var i in e)Array.prototype.push.apply(t,e[i]);return t}return null},wi.prototype.getItemCount=function(t){if(t){var e=this._dict[t]||null;return e?e.length:0}return this._count},wi.prototype.getAllKeys=function(){return Object.keys(this._dict)};var bi=function(t,e){return t.ric+"_"+e.ric},Ri=function(t){var e,i,n,o=t;for(e=o.length-1;e>0;e--)i=Math.floor(Math.random()*(e+1)),n=o[e],o[e]=o[i],o[i]=n;return o.forEach(Ii),o=o.sort(Di)},Ii=function(t,e){t.CHILD_ORDER=e},Di=function(t,e){return t.CHILD_ORDER-e.CHILD_ORDER},xi=function(){};xi.prototype._lastSub=null,xi.prototype._configObj=null,xi.prototype.config=function(t){t&&(this._configObj=t),this._lastSub&&this._configObj&&this._lastSub.config(this._configObj)},xi.prototype.create=function(t){return this._lastSub=new Ai(t||this._configObj),this._lastSub},xi.prototype.isSkipHeaderSupported=function(){return!0},xi.prototype.setUpdateInterval=function(t,e){this._lastSub?this._lastSub.setUpdateInterval(t,e):(this._configObj||(this._configObj={}),this._configObj.minInterval=t,this._configObj.maxInterval=e)},xi.prototype.setPercentageDataUpdate=function(t){this._lastSub?this._lastSub.setPercentageDataUpdate(t):(this._configObj||(this._configObj={}),this._configObj.percentageDataUpdate=t)};var Ai=function(t){this._onSubscriptionResponse=this._onSubscriptionResponse.bind(this),this._subMap={},this._dataMap=new wi,this._fields={},this._events={},this._dataGen=new vi,this.config(t)};Ai.prototype._minInterval=750,Ai.prototype._maxInterval=850,Ai.prototype._percentageDataUpdate=.1,Ai.prototype.config=function(t){if(t){var e=t.minInterval;"number"==typeof e&&(this._minInterval=e,this._minInterval>this._maxInterval&&(this._maxInterval=this._minInterval)),"number"==typeof(e=t.maxInterval)&&(this._maxInterval=e,this._minInterval>this._maxInterval&&(this._minInterval=this._maxInterval)),"number"==typeof(e=t.percentageDataUpdate)&&(this._percentageDataUpdate=e/100)}},Ai.prototype.setUpdateInterval=function(t,e){"number"==typeof t&&(this._minInterval=t),"number"==typeof e&&(this._maxInterval=e)},Ai.prototype.setPercentageDataUpdate=function(t){"number"==typeof t&&(this._percentageDataUpdate=Math.round(t/100))},Ai.prototype.setSeed=function(t){this._dataGen.setSeed(t)},Ai.prototype.addRic=function(t,e){return this._addSymbol(t,!1,e)},Ai.prototype.addChain=function(t,e){return this._addSymbol(t,!0,e)},Ai.prototype.addFields=function(t){if(t){"string"==typeof t&&(t=[t]);for(var e=t.length,i=0;i<e;++i)this._fields[t[i]]=!0}},Ai.prototype.removeSubscription=function(t){var e=this._subMap[t];if(e&&(this._dispatch("subscriptionRemoved",{subs:[e]}),delete this._subMap[t],this._dataMap.removeItem(e.ric,e),e.chain)){for(var i=e.children,n=i.length,o=0;o<n;++o){var r=i[o];this._dataMap.removeItem(bi(e,r),r),r.parent=null}e.children=null,e.ricList=null}},Ai.prototype.removeRic=Ai.prototype.removeSubscription,Ai.prototype.removeChain=Ai.prototype.removeSubscription,Ai.prototype.removeAllSubscriptions=function(){var t=this._working;if(this.stop(),this._hasListener("subscriptionRemoved")){var e=[];for(var i in this._subMap)e.push(this._subMap[i]);e.length>0&&this._dispatch("subscriptionRemoved",{subs:e})}this._subMap={},this._dataMap.removeAllItems(),t&&this.start()},Ai.prototype.removeFields=function(t){"string"==typeof t&&(t=[t]);for(var e=t.length,i=0;i<e;++i){var n=t[i];this._fields[n]&&delete this._fields[n]}},Ai.prototype.removeAllFields=function(){var t=!1;for(var e in this._fields){t=!0;break}t&&(this._fields={})},Ai.prototype.start=function(){this._working=!0,this._connect()},Ai.prototype.stop=function(){this._working=!1,this._timerId&&(window.clearTimeout(this._timerId),this._timerId=0)},Ai.prototype.dispose=function(){this.stop(),this._subMap=null,this._dataMap&&(this._dataMap.removeAllItems(),this._dataMap=null),this._fields=null,this._events=null},Ai.prototype.addEventListener=function(t,e){if(e){var i=this._events[t];i?i.indexOf(e)<0&&i.push(e):this._events[t]=[e]}},Ai.prototype.removeEventListener=function(t,e){var i=this._events?this._events[t]:null;if(i){var n=i.indexOf(e);n>=0&&i.splice(n,1)}},Ai.prototype.removeAllEventListeners=function(){this._events={}},Ai.prototype.getSubscription=function(t){return this._subMap[t]||null},Ai.prototype.getRic=function(t){var e=this._subMap[t];return e?e.ric:""},Ai.prototype.getAllFields=function(){return this._fields},Ai.prototype.hasField=function(t){return this._fields[t]||!1},Ai.prototype.filter=function(t,e){return this};var Li=function(t,e){for(var i in t)e[i]=t[i];return e};Ai.prototype._addSymbol=function(t,e,i){if(!t)return null;if(i||0===i)i+="";else do{i="_"+this._runningSubId+++"_"}while(this._subMap[i]);if(this._subMap[i])return window.console.log("WARNING: Cannot add ric with duplicate id"),null;e&&(t=t.replace("0#",""));var n={};n.ric=t,n.chain=e,n.id=i,n.dataId=i+t,this._subMap[i]=n,this._dataMap.addItem(t,n);var o=this._dataMap.getItems(t),r=o.length;this._dispatch("subscriptionAdded",{subs:[n]});var s,a=null,l=0;if(e)if(1===r)for(n.children=[],l=Ai.simpleDigest(t)%10+4,s=0;s<l;++s)(a={}).ric="Child_"+String.fromCharCode(65+s),a.id=i,a.dataId=i+a.ric,a.parent=n,n.children.push(a),a.CHILD_ORDER=s,this._dataMap.addItem(bi(n,a),a);else{var u=o[0].children;for(l=u.length,n.children=new Array(l),s=0;s<l;++s)(a={}).ric=u[s].ric,a.id=i,a.dataId=i+a.ric,a.parent=n,n.children[s]=a,this._dataMap.addItem(bi(n,a),a)}return r>1&&this._working&&setTimeout(this._updateDuplicateSymbol.bind(this,t),10),this._connect(),i},Ai.simpleDigest=function(t){for(var e=t.length,i=0,n=0;n<e;++n)i+=t.charCodeAt(n);return i},Ai.prototype._connect=function(){if(this._working&&!this._timerId){var t=this._dataGen.randInt(this._minInterval,this._maxInterval);this._timerId=window.setTimeout(this._onSubscriptionResponse,t)}},Ai.prototype._onSubscriptionResponse=function(){this._timerId=0;var t=this._dataMap.getAllKeys(),e=t?t.length:0;if(e){var i=(this._percentageDataUpdate-.02)*e;i=i>0?i:1;var n=(this._percentageDataUpdate+.02)*e;n=n<e?n:e;for(var o,r=this._dataGen.randInt(i,n),s=this._fields,a=0;a<r;a++){var l,u,h,p=t[this._dataGen.randIndex(e)],d=this._dataMap.getItems(p),c=d[0],_=c.parent,f=this._dataGen.randBoolean();if(o=void 0,(o=p.match(/\./g))&&o.length>1&&_&&f){var g=_.children,y=(g=Ri(g)).length,m=g.indexOf(c);for(c.CHILD_ORDER=m,l=this._generateQuoteData(c,s),h=d.length,u=0;u<h;++u){for(var v=0;v<y;v++){var C=g[v];if(d[u]===C)l.CHILD_ORDER=C.CHILD_ORDER,this._dispatchDataChanged(d[u],l);else{var S=C.CHILD_ORDER;this._dispatchDataChanged(C,{X_RIC_NAME:C.ric,CHILD_ORDER:S})}}this._dispatchPostUpdate({childOrderChange:!0})}}else for(l=this._generateQuoteData(c,s),h=d.length,u=0;u<h;++u){var w=d[u].CHILD_ORDER;null!=w&&(l.CHILD_ORDER=w),this._dispatchDataChanged(d[u],l)}}this._connect()}else this._connect()},Ai.prototype._dispatchPostUpdate=function(t){this._dispatch("postUpdate",t)},Ai.prototype._generateQuoteData=function(t,e){var i=t.ric,n=t.prevData,o={},r={text:i,prefix:t.parent?t.parent.ric:""};for(var s in e){var a=this._dataGen.generateQuoteData(s,r),l=s+"_FORMATTED";if(n){if(a.changeOnly&&n[s]===a.value)continue;n[s]=a.value,n[l]=a.formattedValue}o[s]=a.value,o[l]=a.formattedValue}return null!=o.X_RIC_NAME&&null!=o.INDICATOR&&o.INDICATOR>0&&(o.X_RIC_NAME="/"+o.X_RIC_NAME),o},Ai.prototype._getChildSubByRic=function(t,e){var i=t.children;if(i)for(var n=i.length,o=0;o<n;++o){var r=i[o];if(r.ric===e)return r}return null},Ai.prototype._updateDuplicateSymbol=function(t){var e=this._dataMap.getItems(t);if(e){var i=e.length;if(!(i<2)){var n,o=e[0],r=o.prevData,s=!!o.chain;if(r)for(n=1;n<i;++n){var a=e[n];a.prevData||this._dispatchDataChanged(a,r)}if(s){var l=o.ricList;if(l){var u=l.length;for(n=1;n<i;++n)for(var h=e[n],p=h.ricList,d=p?p.length:0;d<u;++d){var c=l[d],_=this._getChildSubByRic(o,c),f=this._getChildSubByRic(h,c);_&&f&&_.prevData&&this._dispatchDataChanged(f,_.prevData)}}}}}},Ai.prototype._dispatchDataChanged=function(t,e){var i=Li(e,{}),n={};n.ric=t.ric,n.values=i,n.subId=t.id;var o=t.prevData;if(!o){o={},t.prevData=o,n.type="statusUpdated",i.STATUS=1,i.STATUS_FORMATTED=this._statusMap[1],i.SUB_ID=t.id,Li(i,o);var r=t.parent;if(r){var s=r.ricList;s||(s=r.ricList=[]),r.ricList.push(t.ric)}}this._dispatch("dataChanged",n)},Ai.prototype.onFeedStatusChanged=function(t,e){return window.setTimeout((function(){e([{key:"Q",name:"IDN_RDF",state:"up"}])}),1e3),this},Ai.prototype._hasListener=function(t){var e=this._events[t];return!!e&&e.length>0},Ai.prototype._dispatch=function(t,e){var i=this._events[t];if(i)for(var n=i.length,o=0;o<n;++o)i[o](e)},Ai.prototype._subMap=null,Ai.prototype._fields=null,Ai.prototype._events=null,Ai.prototype._working=!1,Ai.prototype._timerId=0,Ai.prototype._runningSubId=0,Ai.prototype._statusMap={0:"PENDING",1:"OK",2:"STALE",3:"INFO",4:"CLOSED",5:"DELAYED",6:"NOPERM",7:"REACHLIMIT",8:"C_COMPLETE",9:"C_CLOSE",10:"C_EMPTY",11:"C_NOTCHAIN",12:"C_ERR",13:"C_NOBEGIN",14:"C_NOEND"};var Ti=function(){this._data={}};Ti.prototype._data=null,Ti.prototype.clear=function(){this._data={}},Ti.prototype.put=function(t,e){t&&(this._data[t]=e)},Ti.prototype.get=function(t){var e=this._data[t];return null!=e?e:""},Ti.prototype.getAllKeys=function(){return Object.keys(this._data)},Ti.prototype.save=function(){},Ti.prototype.filter=function(t){var e=[];if(t)for(var i in this._data){var n=this._data[i];t(n)&&e.push(n)}return e};var Ei={"TR.NonExistField":!0,"TR.NotExistField":!0,CF_IGNORE_FIELD:!0};var Mi=new vi,Fi={request:function(t,e){if(e)return Promise.resolve(JSON.stringify(e));var i,n,o,r,s,a,l,u,h,p=[];if("Col,date|,Row,In|,va,T,NoEmptyTickers"===t.output){for(a=t.identifiers,l=t.formula.trim().split(/(?=,TR.)/),u=[],h=Ei,i=0;i<l.length;i++)h[n=l[i]]||u.push(n);var d=u.length;p.push([{h:!0,i:"instrument",v:"Instrument"},{h:!0,i:"date",v:"Date"}]);for(var c=0;c<d;c++){var _,f=u[c],g=f.match(/TR.(.*)(?=\()/)[0].replace("TR.",""),y=f.toLowerCase(),m=y.match(/sdate=(.*)[,]/),v=y.match(/edate=(.*)[)]/),C=m?m[1]:B.format(new Date,"YYYY-MM-DD"),S=v[1];C>S&&(_=C,C=S,S=_);var w=(+new Date(S)-+new Date(C))/864e5;for(i=0;i<=w;i++){var b=new Date(new Date(C).setDate(new Date(C).getDate()+i)),R={h:!0,v:B.format(b,"YYYY-MM-DDT00:00:00")};0===c&&p[0].push(R)}var I=a;for(i=0;i<I.length;i++){var D=[I[i],g];for(s=1;s<=w+1;s++){var x=vi.generateRecord(g);D.push(x[g])}p.push(D)}}}else{for(a=t.identifiers,l=Fi.splitFields(t.formula),u=[],h=Ei,i=0;i<l.length;i++)h[n=l[i]]||u.push(n);for(p[0]=[{h:!0,i:"instrument",v:"Instrument"}],i=0;i<u.length;i++)n=u[i],p[0].push({h:!0,r:n.toUpperCase().trim()});var A={};o=a.length;var L=Mi.generate(u,o);for(i=0;i<o;++i){var T=a[i];(r=A[T])||(r=A[T]=L[i]).unshift(T),p.push(r)}if(p.length>0)if(Mi.randInt(1,10)<=3){var E=Mi.randInt(0,p.length-1);o=(r=p[E]).length;var M=new Array(o);for(M[0]=r[0],i=1;i<o;i++)M[i]="";p.splice(E+1,0,M)}}return Promise.resolve(JSON.stringify({rows:p}))},splitFields:function(t){if(!t)return[];var e=t.split(/,(?![^()]*\))/);return e=e.map((function(t){return t.trim()}))}},Pi=new vi,zi={request:function(t,e){if(e)return Promise.resolve(JSON.stringify(e));var i,n,o,r,s=t.instruments,a=t.fields,l=Ei;for(a=[],i=0;i<t.fields.length;i++)l[(n=t.fields[i]).name]||a.push(n);var u={};o=s.length;var h=[],p=Pi.generate(a,o);for(i=0;i<o;++i){var d=s[i];(r=u[d])||(r=u[d]=p[i]).unshift(d),h.push(r)}if(h.length>0&&Pi.randInt(1,10)<=3){var c=Pi.randInt(0,h.length-1);o=(r=h[c]).length;var _=new Array(o);for(_[0]=r[0],i=1;i<o;i++)_[i]="";h.splice(c+1,0,_)}var f=[{displayName:"Instrument"}];for(i=0;i<a.length;i++)n=a[i],f.push({displayName:n.name,field:n.name.toUpperCase()});return Promise.resolve(JSON.stringify({data:h,headers:[f]}))}},Vi=function(t){return"datagrid"===t?Promise.resolve(zi):"adc"===t?Promise.resolve(Fi):Promise.reject(t+" is not supported.")};Vi.setInvalidFields=function(t){if(t&&"string"==typeof t)Ei[t]=!0;else if(Array.isArray(t))for(var e=0;e<t.length;e++)Ei[t[e]]=!0};var ki=function(t){this.Quotes=new Ci,this.Quotes2=new xi,this.Archive=new Ti,this.ContainerDescription=!0,this.Data=Vi,t&&this.Quotes2.config(t)};ki.prototype.init=function(t){return t&&this.Quotes2.config(t),this},ki.prototype.onLoad=function(t){return setTimeout(t,2e3),this},ki.prototype.navigate=function(t){return this},ki.prototype.appHit=function(t,e,i){},ki.prototype.getUserInfo=function(){return Promise.resolve({UUID:"PAXTRA"})},ki.prototype.contextChange=function(t){};var Oi={"⇧":1,"B⇧":1,"↑":1,"B↑":1,26:1,1:1,'"1"':1,"-1":-1,"⇩":-1,"B⇩":-1,"↓":-1,"B↓":-1,27:-1,2:-1,'"2"':-1},Ni={CF_TICK:1,PRCTCK_1:1,BID_TICK:1,ASK_TICK:1},Hi={"||":1,"&&":2,"<":3,">":3,"<=":3,">=":3,"!=":3,"=":3,"==":3,"===":3,"+":4,"-":4,"*":5,"%":6,"/":6,"!":7,"!!":7},Bi={"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"<":function(t,e){return t<e},">":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"!":function(t,e){return!t},"!!":function(t,e){return!!t}},Gi={"+":2,"-":2,"*":2,"/":2,"%":2,"<":2,">":2,"<=":2,">=":2,"==":2,"!=":2,"&&":2,"||":2,"!":1,"!!":1},Wi=function(t,e,i,n){var o={value:e,type:i};return n&&(o.dataType=n),"operator"===i?o.precedence=Hi[e]:"parenthesis"===i&&(o.precedence=0),t.push(o),t.length-1},Ui={_tokens:[],_withString:function(t){return" #"+Wi(Ui._tokens,t.substring(1,t.length-1),"literal","string")+"#"},_withField:function(t){return" #"+Wi(Ui._tokens,t,"literal","variable")+"#"},_withFieldInBrackets:function(t){return Ui._withField(t.substring(1,t.length-1))},_withNegativeNumber:function(t){var e=+t;return e==e?" #"+Wi(Ui._tokens,e,"literal","number")+"#":""},_withPositiveNumber:function(t){return 35===t.charCodeAt(0)?t:Ui._withNegativeNumber(t)},_withOperator:function(t){return Hi[t]?("="!=t&&"==="!=t||(t="=="),"#"+Wi(Ui._tokens,t,"operator")+"#"):""},_withParenthesis:function(t){return"#"+Wi(Ui._tokens,t,"parenthesis")+"#"},_tester:function(t){for(var e=t._rpn,i=e.length,n=0,o=0,r=0;r<i;++r){var s=e[r];if("literal"!==s.type){var a=Gi[s.value];if(!(n>=a))return console.warn("Cannot parse an expression with insufficient number of operands"),!0;n-=a}++n>o&&(o=n)}return 1!==n||(t._stackSize=o,!1)},_filter:function(t,e){for(var i,n=t._rpn,o=new Array(t._stackSize),r=n.length,s=0,a=0;a<r;++a){var l=n[a],u=l.value;"literal"===l.type?i="variable"!==l.dataType?u:e?e[u]:null:1===Gi[u]?(i=Bi[u](o[s-1]),s-=1):(i=Bi[u](o[s-2],o[s-1]),s-=2),o[s++]=i}return!!o[0]},parse:function(t){if("function"==typeof t)return t;if(!t||"string"!=typeof t)return null;var e=t.trim();if(!e)return null;Ui._tokens.length=0,e=(e=(e=(e=(e=(e=(e=(e=e.replace(/".+?"/g,Ui._withString)).replace(/'.+?'/g,Ui._withString)).replace(/\[.+?\]/g,Ui._withFieldInBrackets)).replace(/-[0-9.]+/g,Ui._withNegativeNumber)).replace(/[0-9.#]+/g,Ui._withPositiveNumber)).replace(/[a-zA-Z_]\w*/g,Ui._withField)).replace(/[\-\/+*%!=<>&|]+/g,Ui._withOperator)).replace(/[()]/g,Ui._withParenthesis);var i=Ui._tokens,n=i.length;if(!n)return null;var o,r,s,a=[],l=e.match(/#[0-9]+#/g);for(o=0;o<n;++o){var u=l[o];if("literal"===(s=(r=i[+u.substring(1,u.length-1)]).type)){var h=a[a.length-1];if(h&&"literal"===h.type){if(!(r.value<0&&"number"===r.dataType))return console.warn("Cannot parse an expression with insufficient number of operators"),null;Wi(a,"-","operator"),r.value*=-1}}a.push(r)}Ui._tokens.length=0,n=a.length;var p=[],d=[],c=null,_=!1;for(o=0;o<n;++o)if("literal"===(s=(r=a[o]).type))p.push(r);else if("parenthesis"===s)if("("===r.value)d.push(r);else{for(_=!1;d.length;){if("("===(c=d.pop()).value&&"parenthesis"===c.type){_=!0;break}p.push(c)}_||console.warn("No left parenthesis paired with the right one")}else{for(;d.length&&!(r.precedence>d[d.length-1].precedence);)p.push(d.pop());d.push(r)}for(_=!1;d.length;)"("===(c=d.pop()).value&&"parenthesis"===c.type?_=!0:p.push(c);if(_&&console.warn("No right parenthesis paired with the left one"),!p.length)return null;var f={_rpn:p};return Ui._tester(f)?null:Ui._filter.bind(null,f)}},Yi=function(){this._conditions=[],this._scopes=[],Yi._painters.push(this)};Yi.ColoringTypes={TEXT:1,HEATMAP:2,CONDITIONAL:3},Yi.prototype._coloringType=0,Yi.prototype._conditions=null,Yi.prototype._effectiveStyles=null,Yi.prototype._blinkCondition=null,Yi.prototype._scopes,Yi.prototype._columnStats=null,Yi.prototype._levelColorDisabled=!1,Yi.prototype._blinkingDuration=250,Yi._runningBlinkId=0,Yi._painters=[],Yi._emptyAry=[],Yi._emptyObj={},Yi._bgObj={backgroundColor:"",color:""},Yi._colorObj={color:""},Yi.bgStyles=["backgroundColor","color"],Yi.nonBgStyles=["fontSize","fontWeight","fontStyle","textAlign","textDecoration"],Yi.supportedStyles=Yi.bgStyles.concat(Yi.nonBgStyles),Yi.themeReady=null,Yi.parse=Ui.parse,Yi.prototype.dispose=function(){var t=Yi._painters.indexOf(this);t>=0&&Yi._painters.splice(t,1),this.reset(),this._conditions=null,this._scopes.length=0,this._blinkCondition=null},Yi.prototype.reset=function(){this._setColoringType(0);var t=this._scopes.length;if(t){for(var e=0;e<t;++e){var i=this._scopes[e];Yi._clearBlinkTimer(i)&&i._restorer();var n=i.cell;n&&delete n.blinking,i.cell=null}this._scopes.length=0}this._blinkCondition=null},Yi.prototype.resetColoring=function(){this._setColoringType(0),this._effectiveStyles=null,this._conditions.length=0},Yi.prototype.resetBlinking=function(){this._blinkCondition=null,this._scopes.length=0},Yi.prototype.clearBlinking=function(){this._blinkCondition=null;var t=this._scopes.length;if(t){for(var e=0;e<t;++e){var i=this._scopes[e];Yi._clearBlinkTimer(i)&&i._restorer();var n=i.cell;n&&delete n.blinking,i.cell=null}this._scopes.length=0}},Yi.prototype.resetHeatMap=function(){this._conditions.length=0,this._columnStats=null},Yi.prototype.clearHeatMap=function(){return this._blinkCondition?(this._setColoringType(0),this.resetHeatMap(),!1):(this.dispose(),!0)},Yi.prototype.applyThemeColor=function(){var t=T.getColors();if(this._coloringType===Yi.ColoringTypes.HEATMAP){var e=this._conditions[0];if(e&&(e.textMode?e.baseColor=t.baseText:e.baseColor=t.baseGrid,e.useThemeColor)){var i=t.up,n=t.down,o=t.level===t.baseText?"":t.level;Yi._setUpDownColors(e,i,n,o)}}this._blinkCondition&&this._blinkCondition.useThemeColor&&Yi._setUpDownColors(this._blinkCondition,t.up,t.down,t.level,!0)},Yi.prototype.getConditions=function(){return this._conditions},Yi.prototype.getColoringType=function(){return this._coloringType},Yi.prototype._setColoringType=function(t){this._coloringType!==t&&(this._coloringType=t)},Yi.prototype.setEffectiveStyles=function(t){this._effectiveStyles=t},Yi.prototype.getEffectiveStyles=function(){return this._effectiveStyles},Yi.prototype.setConditions=function(t){this._conditions.length=0,this._setColoringType(Yi.ColoringTypes.CONDITIONAL);for(var e=t.length,i=0;i<e;i++)this._addCondition(t[i])},Yi.prototype.setColumnStats=function(t){this._columnStats=t&&t.getMin?t:null},Yi.prototype.getColumnStats=function(){return this._columnStats},Yi.prototype._addCondition=function(t){var e=t.expression;e&&(t._fn=Ui.parse(e.text||e),this._conditions.push(t))},Yi.prototype.addHeatmap=function(t,e,i,n,o,r){this._setColoringType(Yi.ColoringTypes.HEATMAP);var s={heatmap:!0};return s.field=t,s.expression=Yi._heatMapCondition.bind(s),s.midPoint=e,Yi._setUpDownColors(s,i,n),s.baseColor=o,!0!==r&&"text"!==r||(s.textMode=!0),this._addCondition(s),s},Yi.prototype.addHeatmapWithTheme=function(t,e,i){var n=T.themeColors,o=this.addHeatmap(t,e,n.up,n.down,n.baseGrid,i);return!0!==i&&"text"!==i||(o.baseColor=n.baseText),o.useThemeColor=!0,o},Yi.prototype._addColorText=function(t,e,i,n,o){this._setColoringType(Yi.ColoringTypes.TEXT);var r={};return r.field=e,r.expression=t.bind(null,e),r.upClass=i,r.downClass=n,r.levelClass=o,this._addCondition(r),r},Yi.prototype.addColorText=function(t,e,i,n){return this._addColorText(Ni[t]?Yi._tickColorTextCondition:Yi._colorTextCondition,t,e,i,n)},Yi.prototype.addColorTextWithTheme=function(t){return this.addColorText(t,"positive","negative","neutral")},Yi.prototype.addTickColorText=function(t,e,i){return this.addColorText("CF_TICK",t,e,i)},Yi.prototype.addTickColorTextWithTheme=function(){var t=T.themeColors,e=this.addTickColorText(t.tickUp,t.tickDown,t.level);return e.useThemeColor=!0,e},Yi.prototype.addTickBlink=function(t,e,i,n){return this.addBlink("CF_TICK",t,e,i,n)},Yi.prototype.addTickBlinkWithTheme=function(t){var e=T.themeColors,i=this.addTickBlink(e.tickUp,e.tickDown,e.level,t);return i.useThemeColor=!0,i},Yi.prototype.addBlink=function(t,e,i,n,o){return this._addBlink(Ni[t]?Yi._tickBlinkCondition:Yi._fieldBlinkCondition,t,e,i,n,o)},Yi.prototype.addBlinkWithTheme=function(t,e){var i=T.themeColors,n=this.addBlink(t,i.up,i.down,i.level,e);return n.useThemeColor=!0,n},Yi.prototype._addBlink=function(t,e,i,n,o,r){var s=this._blinkCondition={};return s.blink=!0,s.blinkId=Yi._runningBlinkId++,s.field=e,s._fn=s.expression=t,!0!==r&&"border"!==r||(s.border=!0),Yi._setUpDownColors(s,i,n,o,!0),s},Yi.prototype.renderForPrinting=function(t,e,i,n){if(t){var o=this._getStyles(e,i,n),r=o.cssClass;null!=r?(elem._coloringCssClass&&elem._coloringCssClass!==r&&(elem.classList.remove(elem._coloringCssClass),elem._coloringCssClass=null),r&&(elem.classList.add(r),elem._coloringCssClass=r)):(t._coloringCssClass&&(t.classList.remove(t._coloringCssClass),t._coloringCssClass=null),t.style.backgroundColor=o.backgroundColor||"",t.style.color=o.color||"")}},Yi._colorTextCondition=function(t,e){var i=e[t];if(i||0===i){if(i>0)return 1;if(i<0)return-1}return"u"},Yi._tickColorTextCondition=function(t,e){var i=Oi[e[t]];if(i)return i},Yi._heatMapCondition=function(t,e,i){var n=t[this.field],o=n||0===n?n-this.midPoint:NaN;if(0===o||o!=o)return 0;var r=1;return o>0?(r=i-this.midPoint)<0&&(r=e-this.midPoint):(r=e-this.midPoint)>0&&(r=i-this.midPoint),r<0&&(r=-r),o/r},Yi._tickBlinkCondition=function(t){var e=Oi[t];if(e)return e},Yi._fieldBlinkCondition=function(t,e){return t>e?1:t<e?-1:0},Yi._borderRestorer=function(t){t.blinkTimer=0;var e=t.cell.getElement();e&&(e.style.border="")},Yi._cellRestorer=function(t){t.blinkTimer=0;var e=t.cell.getElement();if(e){var i=t.rowData,n=NaN,o=NaN;if(this._coloringType===Yi.ColoringTypes.HEATMAP){var r=this._columnStats;r&&(n=r.getMin(),o=r.getMax())}var s=this._getStyles(i,n,o),a=s.cssClass;null!=a?(e._coloringCssClass&&e._coloringCssClass!==a&&(e.classList.remove(e._coloringCssClass),e._coloringCssClass=null),a&&(e.classList.add(a),e._coloringCssClass=a),e.style.backgroundColor="",e.style.color=""):(e._coloringCssClass&&(e.classList.remove(e._coloringCssClass),e._coloringCssClass=null),e.style.backgroundColor=s.backgroundColor||"",e.style.color=s.color||"")}},Yi.prototype._getStyles=function(t,e,i){if(!t)return Yi._emptyObj;for(var n=this._conditions.length,o=0;o<n;++o){var r,s=this._conditions[o],a=s._fn;try{var l=a&&a(t,e,i)}catch(t){}if(l)return this._coloringType===Yi.ColoringTypes.HEATMAP?(r=l>0?Yi.blendColor(s.baseColor,s.upColor,l):Yi.blendColor(s.baseColor,s.downColor,-l),s.textMode?(Yi._colorObj.color=Yi.num2Hex(r),Yi._colorObj):(Yi._bgObj.backgroundColor=Yi.num2Hex(r),Yi._bgObj.color=Yi.blackAndWhite(r),Yi._bgObj)):this._coloringType===Yi.ColoringTypes.TEXT?(s.cssClass=l>0?s.upClass:l<0?s.downClass:this._levelColorDisabled?"":s.levelClass,s.cssClass=s.cssClass||"",s):s}return Yi._emptyObj},Yi.blendColor=function(t,e,i){i>1?i=1:i<0&&(i=0);for(var n=Yi.hex2Num(t),o=Yi.hex2Num(e),r=[],s=0;s<3;++s){var a=(o[s]-n[s])*i;r.push(n[s]+a)}return r},Yi.blackAndWhite=function(t){return Math.sqrt(t[0]*t[0]*.241+t[1]*t[1]*.691+t[2]*t[2]*.068)>=135?"#000000":"#FFFFFF"},Yi.rgb2Hex=R,Yi.num2Hex=function(t){return"#"+(16777216+(t[2]|t[1]<<8|t[0]<<16)).toString(16).slice(1)},Yi.num2Rgb=function(t){return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},Yi.hex2Num=function(t){var e=parseInt(t.replace(/[^0-9A-F]/gi,""),16);return[e>>16&255,e>>8&255,255&e]},Yi.hex2Rgb=function(t){if(t){var e=parseInt(t.replace(/[^0-9A-F]/gi,""),16);return"rgb("+(e>>16&255)+", "+(e>>8&255)+", "+(255&e)+")"}return""},Yi.themeChanged=function(){},Yi.setThemeColors=function(){},Yi._onThemeChanged=function(){for(var t=Yi._painters,e=t.length;--e>=0;)t[e].applyThemeColor()},Yi.loadThemeColors=function(){return Yi.themeReady||(Yi.themeReady=T.getThemeColors(Yi._onThemeChanged).then(Yi._onThemeChanged).catch(Yi._onThemeChanged)),Yi.themeReady},Yi.reloadThemeColors=function(){return Yi.themeReady=T.reloadThemeColors().then(Yi._onThemeChanged).catch(Yi._onThemeChanged),Yi.themeReady},Yi.clearCellStyle=function(t,e){var i=t.getElement();if(i){var n=t.blinking;if(n&&(Yi._clearBlinkTimer(n),delete t.blinking,n.cell=null),i._coloringCssClass&&i.classList.remove(i._coloringCssClass),e||(e=Yi.supportedStyles),Array.isArray(e))for(var o=e.length;--o>=0;)i.style[e[o]]="";else for(var r in e)i.style[r]=""}},Yi._setUpDownColors=function(t,e,i,n,o){t.upColor=e,null!=e&&o&&(t.contrastUpColor=Yi.getOppositeColor(e)),t.downColor=i,null!=i&&o&&(t.contrastDownColor=Yi.getOppositeColor(i)),t.levelColor=n,null!=n&&o&&(t.contrastLevelColor=Yi.getOppositeColor(n))},Yi._clearBlinkTimer=function(t,e){return!!t.blinkTimer&&(clearTimeout(t.blinkTimer),t.blinkTimer=0,!0)},Yi.getOppositeColor=function(t){if("string"==typeof t){if("#"===t.charAt(0)){var e=Yi.hex2Num(t);return Yi.blackAndWhite(e)}}else if(Array.isArray(t))return Yi.blackAndWhite(t);return""},Yi.prototype.render=function(t,e,i,n,o){null!=i&&i==i?this._paintCell(t,e,i,n):this._conditions.length&&this._coloringType===Yi.ColoringTypes.CONDITIONAL&&this._paintCell(t,e)},Yi.prototype.renderHeatMap=function(t,e,i,n){this._paintCell(t,e,i,n)},Yi.prototype.renderColoring=function(t,e){this._paintCell(t,e)},Yi.prototype._paintCell=function(t,e,i,n){if(t){var o=t.getElement();if(o){var r,s=this._blinkCondition;if(!(s&&(r=t.blinking)&&r.blinkTimer)||s.border){var a=this._getStyles(e,i,n),l=o.style,u=a.cssClass;o._coloringCssClass&&o._coloringCssClass!==u&&(o.classList.remove(o._coloringCssClass),o._coloringCssClass=null),null!=u?u&&(o.classList.add(u),o._coloringCssClass=u):(a.backgroundColor?l.backgroundColor=a.backgroundColor:this._effectiveStyles&&!this._effectiveStyles.backgroundColor||(l.backgroundColor=""),a.color?l.color=a.color:this._effectiveStyles&&!this._effectiveStyles.color||(l.color=""))}}}},Yi.prototype.blink=function(t,e,i){this._blinkCell(t,i,e)},Yi.prototype.blinkCell=function(t,e,i,n){if(!this._blinkCondition)return!1;var o=this._blinkCondition._fn(e,i);return this._blinkCell(t,n,o)},Yi.prototype._blinkCell=function(t,e,i){if(!t)return!1;if(this._levelColorDisabled&&!i)return!1;var n=t.getElement();if(!n)return!1;var o=this._blinkCondition;if(!o)return!1;var r,s,a=t.blinking;if(a||((a={}).cell=t,t.blinking=a,this._scopes.push(a)),a.blinkId!==o.blinkId){a.blinkId=o.blinkId,a.field=o.field;var l=o.border?Yi._borderRestorer:Yi._cellRestorer;a._restorer=l.bind(this,a)}a.rowData=e,i>0?(r=o.upColor,s=o.contrastUpColor):i<0?(r=o.downColor,s=o.contrastDownColor):(r=o.levelColor,s=o.contrastLevelColor);var u=!0;return o.border?(n.style.border="1px solid "+r,u=!1):(n.style.backgroundColor=r,n.style.color=s),Yi._clearBlinkTimer(a),a.blinkTimer=setTimeout(a._restorer,this._blinkingDuration),u},Yi.prototype.verifyBlinking=function(t,e){var i=t.blinking;i&&i.blinkTimer&&i.rowData!==e&&(i.rowData=e,Yi._clearBlinkTimer(i)&&i._restorer())},Yi.prototype.disableLevelColor=function(t){this._levelColorDisabled=!1!==t},Yi.prototype.setBlinkingDuration=function(t){"number"==typeof t&&(this._blinkingDuration=t)};if(window){var qi=window.tr;qi||(qi=window.tr={});var Xi=qi.rt;Xi||(Xi=qi.rt={});var ji=qi.grid;ji||(ji=qi.grid={}),qi.MockJET||(qi.MockJET=ki),qi.closestElement||(qi.closestElement=n.closestElement),qi.CellPainter||(qi.CellPainter=Yi),Xi.Grid||(Xi.Grid=ei),ji.CellPainter||(ji.CellPainter=Yi)}e.default=ei}]);
1
+ !function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e,i){"use strict";i.r(e),i.d(e,"Grid",(function(){return ei}));let n={create:function(t,e){let i=document.createElement(t);return e&&(i.className=e),i},div:function(t){return n.create("div",t)},text:function(t,e){let i=n.create("span",e);return(t||0===t)&&(i.textContent=t),i},appendChild:function(t,e){if(!t)return null;let i,n;Array.isArray(arguments[1])?(n=arguments[1],i=0):(n=arguments,i=1);let o=n.length;for(;i<o;)t.appendChild(n[i]),++i;return t},buildTree:function(t,e){if(!t)return null;let i=arguments,o=i.length;for(let e=1;e<o;++e){let o=i[e];if(o){let e;Array.isArray(o)?e=n.buildTree.apply(null,o):1===o.nodeType&&(e=o),e&&t.appendChild(e)}}return t},removeParent:function(t){if(!t)return null;let e=t.parentNode;return e&&e.removeChild(t),e},setParent:function(t,e){return t?e?(e.appendChild(t),e):n.removeParent(t):null},removeChildren:function(t,e){if(t){let i=t.childNodes.length;for((null==e||e>i)&&(e=i);--e>=0;)t.removeChild(t.lastChild)}},setContent:function(t,e){if(t)if(e||0===e){let i=e.nodeType;1===i||3===i?e!==t.lastChild&&(n.removeChildren(t),t.appendChild(e)):Array.isArray(e)?(n.removeChildren(t),n.appendChild(t,e)):t.textContent=e}else n.removeChildren(t)},toggleAttribute:function(t,e,i){i?t.setAttribute(e,"string"==typeof i?i:""):null==i?t.hasAttribute(e)?t.removeAttribute(e):t.setAttribute(e,""):t.removeAttribute(e)},toggleClass:function(t,e,i){i?t.classList.add(e):null==i?t.classList.contains(e)?t.classList.remove(e):t.classList.add(e):t.classList.remove(e)},addClasses:function(t,e){if(t){let i=Array.isArray(e)?e:arguments,n=i.length;for(let e=0;e<n;++e){let n=i[e];n&&"string"==typeof n&&t.classList.add(n)}}},removeClasses:function(t,e){if(t){let i=Array.isArray(e)?e:arguments,n=i.length;for(let e=0;e<n;++e){let n=i[e];n&&"string"==typeof n&&t.classList.remove(n)}}},preventDefault:function(t){t.preventDefault(),t.stopPropagation()},stopPropagation:function(t){t.stopPropagation()},getClientPosition:function(t,e){let i=e||{x:0,y:0};if(t.getBoundingClientRect){let e=t.getBoundingClientRect();i.x=e.left,i.y=e.top}else i.x=t.clientX,i.y=t.clientY;return i},getRelativePosition:function(t,e,i){i=n.getClientPosition(t,i);let o=n.getClientPosition(e);return i.x-=o.x,i.y-=o.y,i},closestElement:function(t,e){let i=t;for(;i;){if(i.classList&&i.classList.contains(e))return i;i=i.parentNode||i.host}return null},closestTagName:function(t,e){let i=t;for(;i;){if(i.tagName&&i.tagName==e)return i;i=i.parentNode||i.host}return null}};let o=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)};o.prototype._data,o.prototype._func=null,o.prototype._delay=0,o.prototype._timerId=0,o.prototype._conflated=!1,o.prototype._disabled=!1,o.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},o.prototype.popAllData=function(){if(this._data.length){let t=this._data;return this._data=[],t}return null},o.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},o.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))},o.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},o.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},o.prototype.getData=function(){return this._data},o.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},o.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},o.prototype.getConflatingTime=function(){return this._delay},o.prototype.disable=function(t){this._disabled=!1!==t},o.prototype.isEnabled=function(){return!this._disabled},o.prototype.enable=function(t){this._disabled=!1===t};let r={inherits:function(t,e){function i(){}i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t,t.base=function(t,i,n){i||(i="constructor");let o=arguments.length,r=new Array(o);for(let t=2;t<o;t++)r[t-2]=arguments[t];return e.prototype[i].apply(t,r)}}};var s=r;let l=function(){};l.prototype._events=null,l.prototype._listenerCount=0,l.prototype.addEventListener=function(t,e){if(!t||!e)return;this._events||(this._events={});let i=this._events[t];i?i.indexOf(e)<0&&(i.push(e),++this._listenerCount):(this._events[t]=[e],++this._listenerCount)},l.prototype.removeEventListener=function(t,e){let i=this._events?this._events[t]:null;if(i){let t=i.indexOf(e);t>=0&&(i.splice(t,1),--this._listenerCount)}},l.prototype.removeAllEventListeners=function(){this._events=null,this._listenerCount=0},l.prototype.hasListener=function(t){if(this._listenerCount){if(t){let e=this._events?this._events[t]:null;return!!e&&e.length>0}return!0}return!1},l.prototype.getListener=function(t,e){if(t){let i=this._events?this._events[t]:null;if(i)return e||(e=0),i[e]||null}return null},l.prototype.addListener=function(t,e){let i=t?t[e]:null;"function"==typeof i&&this.addEventListener(e,i)},l.prototype._prepareEventArguments=function(t,e){return e},l.prototype._dispatch=function(t,e){let i=this._events?this._events[t]:null;if(i){e=this._prepareEventArguments(t,e);let n=i.length;for(let t=0;t<n;++t)i[t](e)}};l.preventDefault=function(t){t&&t.preventDefault&&(t.preventDefault(),t.stopPropagation())};var a=l;let u=function(t,e){if(t=t.trim(),this._inputConverter[t]&&(t=this._inputConverter[t]),this._input=t,null!=e&&(this._index=e),null!=this._constants[t])return this._value=this._constants[t],void(this._type=typeof this._value);let i=t.charAt(0),n=t.length>1?t.charAt(t.length-1):"";if('"'===i&&'"'===n)return this._value=t.substring(1,t.length-1),void(this._type="string");if("'"===i&&"'"===n)return this._value=t.substring(1,t.length-1),void(this._type="string");if("("===i&&")"===n)return void this._resolveVariableGroup(t);if("["===i&&"]"===n)return void this._resolveArray(t);if(t.match(/TR\.\w+\(/))return void(this._type="dynamic");let o=t.match(/[\w._]+\(/g);if(o&&1===o.length)return void this._resolveFunction(t,o[0]);let r=t.match(/[\w._♦]+/g);if(r&&r.length>1)return void this._resolveVariableGroup(t);if("♦"===i)return void(this._type="token");let s=Number(t);if(s==s)return this._value=s,void(this._type="number");this._type="dynamic"};u.prototype._input="",u.prototype._index=-1,u.prototype._type="",u.prototype._subVars=null,u.prototype._funcName="",u.prototype._value,u.prototype._valueWithTokenField="",u.prototype._inputConverter={TRUE:"true",FALSE:"false",PI:"Math.PI","TRUE()":"true","FALSE()":"false","PI()":"Math.PI"},u.prototype._constants={true:!0,false:!1,null:null,NaN:NaN,"Math.E":Math.E,"Math.PI":Math.PI,"Math.SQRT2":Math.SQRT2,"Math.SQRT1_2":Math.SQRT1_2,"Math.LN2":Math.LN2,"Math.LN10":Math.LN10,"Math.LOG2E":Math.LOG2E,"Math.LOG10E":Math.LOG10E},u.prototype.getExpression=function(){return"dynamic"===this._type?'this.__D("'+this._input+'", __R)':"group"===this._type?this._value:"function"===this._type?this._subVars?"this.__F["+this._index+"]("+this._subVars.join(", ")+")":"this.__F["+this._index+"]()":"array"===this._type?this._subVars?"["+this._subVars.join(", ")+"]":"[]":this._input},u.prototype.getInputWithTokenField=function(){return"dynamic"===this._type?"♠"+this._input+"♥":"group"===this._type?this._valueWithTokenField:"function"===this._type?this._funcName+"("+this.getChildInputWithToken()+")":"array"===this._type?"["+this.getChildInputWithToken()+"]":this._input},u.prototype.getChildInputWithToken=function(){let t=this._subVars?this._subVars.length:0;if(t<=0)return"";let e=new Array(t);for(let i=0;i<t;++i)e[i]=this._subVars[i].getInputWithTokenField();return e.join(", ")},u.prototype.toString=u.prototype.getExpression,u.prototype.getValue=function(){return this._value},u.prototype.getInput=function(){return this._input},u.prototype.getIndex=function(){return this._index},u.prototype.setIndex=function(t){this._index=t},u.prototype.getFunctionName=function(){return this._funcName},u.prototype.getFieldNames=function(t){if(this._subVars){if(t){let e=this._subVars.length;for(let i=0;i<e;++i)this._subVars[i].getFieldNames(t)}return this._subVars[0].getFieldNames()}return"dynamic"===this._type?(t&&(t[this._input]=!0),this._input):""},u.prototype._resolveVariableGroup=function(t){let e=this._subVars?this._subVars.length:0;return this._type="group",this._value=t.replace(/[\w._♦]+/g,function(t){this._subVars||(this._subVars=[]);let e=new u(t,this._subVars.length);return this._subVars.push(e),e.getExpression()}.bind(this)),this._valueWithTokenField=t.replace(/[\w._♦]+/g,function(t){return this._subVars[e++].getInputWithTokenField()}.bind(this)),this._value},u.prototype._resolveFunction=function(t,e){if(this._type="function",this._funcName=e.substr(0,e.length-1),t=(t=t.replace(e,"")).substr(0,t.length-1)){this._subVars=[];let e=t.split(","),i=e.length;for(let t=0;t<i;++t)this._subVars[t]=new u(e[t],t)}},u.prototype._resolveArray=function(t){if(this._type="array",t=t.substr(1,t.length-1)){this._subVars=[];let e=t.split(","),i=e.length;for(let t=0;t<i;++t)this._subVars[t]=new u(e[t],t)}};var h=u;let p=function(t,e){this._input=t||"",null!=e&&(this._context=e,e._DATA&&(this.__D=e._DATA)),this.__F=[],this._fnTokens=[],this._fields=[],this._fieldMap={},this._dataCache={},this._intervalServices={},this._formulaCount=1,this._onDataCacheChanged=this._onDataCacheChanged.bind(this),this.dispatchDataChanged=this.dispatchDataChanged.bind(this),this._parse(this._input)};s.inherits(p,a),p._isBoundFormula={RECORD:!0,TR:!0,MTXSERIES:!0,NOW:!0,TODAY:!0,ADSTYLEATTRIBUTE:!0,ADBONDDERIV:!0,ADBONDYIELD:!0,BDSETTLE:!0,ACCRUED:!0,CFYLD:!0,DFFORMATDATE:!0,DFADDPERIOD:!0,DFADDWD:!0,DFADDMONTHS:!0,DFADDYEARS:!0,DFADJUSTTOWD:!0,DFLASTWD:!0,DFFINDDATED:!0,DFCOUNTDAYS:!0,DFCOUNTWD:!0,ADFXSWPTODEP:!0,FXCALCPERIOD:!0,OPCALCDERIV:!0,OPIMPLIEDVOL:!0,ADFORMAT:!0,ADHISTORYVALUE:!0},p.prototype._input="",p.prototype._expression="",p.prototype._alias="",p.prototype._main=null,p.prototype.__F=null,p.prototype._fnTokens=null,p.prototype._fields=null,p.prototype._fieldMap=null,p.prototype._reference="",p.prototype._context=null,p.prototype._rtService=null,p.prototype._intervalServices=null,p.prototype._dataCache=null,p.prototype._dataLastError="",p.prototype._inputWithTokenField="",p.prototype._formulaCount=0,p._invalidOps={"+=":!0,"-=":!0,"*=":!0,"/=":!0,"|=":!0,"&=":!0,"^=":!0},p.prototype.dispose=function(){this._rtService&&(this._rtService.dispose(),this._rtService=null);for(let t in this._intervalServices)this._intervalServices[t].removeEventListener("dataChanged",this.dispatchDataChanged);this._intervalServices=null,this.unlistenAll()},p.prototype.calculate=function(t){if(this._main){this._dataLastError="";let e=this._main(t);switch(this._dataLastError){case"Pending data":e=null;break;case"Pending - no erase":e="..."}return e}return null},p.prototype.getFunction=function(){return this._main},p.prototype.getFieldNames=function(){return this._fields},p.prototype._setReference=function(t){this._reference=t},p.prototype.getReference=function(){return this._reference},p.prototype.getExpression=function(){return this._expression},p.prototype.toString=p.prototype.getReference,p.prototype.getInput=function(){return this._input},p.prototype.getAlias=function(){return this._alias||this._input},p.prototype.setAlias=function(t){this._alias=t},p.prototype.addFormulaCount=function(){this._formulaCount++},p.prototype.subtractFormulaCount=function(){return 0==--this._formulaCount},p.prototype.updateContext=function(){if(!this._context)return;let t=this._fnTokens.length;for(let e=0;e<t;++e){let t=this._fnTokens[e].getFunctionName();this.__F[e]=this._context[t]||p._emptyFunction,p._isBoundFormula[t]&&(this.__F[e]=this.__F[e].bind(this))}},p.prototype._logger=function(t){console.log("["+t+"] "+this._fnTokens[t].getFunctionName()+" is executed")},p._emptyFunction=function(){},p.prototype._detectCodeInjection=function(t){let e=!1;if(t.match(/\+\+|--/)&&(e=!0),!e){let i=t.match(/([^=]=+)/g)||[];for(let t=i.length;--t>=0;){let n=i[t],o=n.substring(n.length-2);if(p._invalidOps[o]){e=!0;break}}}return e},p.toUpperCase=function(t){if(!t||"="!==t.charAt(0))return t||"";let e=[],i=[];return t=(t=(t=p.tokenizeQuotes(t,e,i)).toUpperCase()).replace(/TR(\.[\w ]+)+\([^\(\)]*\)(\.[a-zA-Z]+)*/g,p._encloseWithTR),t=p.resolveTokens(t,e,i)},p._encloseWithTR=function(t){return'TR("'+t+'")'},p.tokenizeQuotes=function(t,e,i){let n;e||(e=[]),i||(i=[]);let o=!1,r=[];do{o=!1,t=t.replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,(function(t){return o=!0,n=e.length,e.push(new h(t,n)),r.push(n),"♦"+n+"♦"}))}while(o);return i.push(r),t},p.tokenizeAdcWithParams=function(t,e,i){let n;e||(e=[]),i||(i=[]);let o=!1,r=[];do{o=!1,t=t.replace(/TR\.\w+\([^\)]*\)+/g,(function(t){return o=!0,n=e.length,e.push(new h(t,n)),r.push(n),"♦"+n+"♦"}))}while(o);return i.push(r),t},p.replaceUnwantedCharacters=function(t,e,i){for(;t.indexOf(" ")>=0;)t=t.replace(/ {2}/g," ");return t=(t=(t=t.replace(/\$/g,"")).replace(/\&+/g,(function(t){return"&"===t?"+":t}))).replace(/(<=|>=|!=|!==|===|==|=(?!([\w]*\([^()]*\))))/g,(function(t){return"="===t?"==":t}))},p.prototype._tokenizeParentheses=function(t,e,i){e||(e=[]),i||(i=[]);let n={},o=/[\w._]*(?:=|=[\w]*)?\([^()]*\)/,r=new RegExp(o.source,"g");for(;t.match(o);){let o=[];t=t.replace(r,(function(t,i){"="===t.charAt(0)&&(t=t.substr(1,t.length));let r=n[t];return null==r&&(r=e.length,e.push(new h(t,r)),n[t]=r),o.push(r),"♦"+r+"♦"})),i.push(o)}return t},p.prototype._tokenizeConstants=function(t,e,i){e||(e=[]),i||(i=[]);let n=[];return t=t.replace(/[\w._♦]+/g,(function(t){if("♦"===t.charAt(0))return t;let i=e.length;return e.push(new h(t,i)),n.push(i),"♦"+i+"♦"})),i.push(n),t},p.resolveTokens=function(t,e,i){for(let n=i.length;--n>=0;){let o=i[n],r=o.length;for(let i=0;i<r;++i){let n=o[i],r=e[n];t=t.replace(new RegExp("♦"+n+"♦","g"),(function(){return r.getExpression()}))}}return t},p._getInputWithTokenField=function(t,e,i){for(let n=i.length;--n>=0;){let o=i[n],r=o.length;for(let i=0;i<r;++i){let n=o[i],r=e[n];t=t.replace(new RegExp("♦"+n+"♦","g"),(function(){return r.getInputWithTokenField()}))}}return"="+t},p.prototype._parse=function(t){if(this._expression="",this._main=null,this.__F.length=0,this._fnTokens.length=0,this._fields.length=0,!t)return null;if("="===t.charAt(0)&&(t=t.substr(1)),!(t=(t=(t=(t=t.trim()).replace(/<>/g,"!=")).replace(/‛|‘|’/g,"'")).replace(/‟|“|”/g,'"'))||this._detectCodeInjection(t))return null;let e=[],i=[];t=p.tokenizeQuotes(t,e,i),t=p.tokenizeAdcWithParams(t,e,i),t=p.replaceUnwantedCharacters(t,e,i),t=this._tokenizeParentheses(t,e,i),t=this._tokenizeConstants(t,e,i),this._inputWithTokenField=p._getInputWithTokenField(t,e,i),t=p.resolveTokens(t,e,i);let n={},o=e.length;for(let i=0;i<o;++i){let o=e[i];if(o.getFunctionName()){let e=this._fnTokens.length;t=t.replace(new RegExp("this\\.__F\\["+i+"\\]","g"),"this.__F["+e+"]"),o.setIndex(e),this._fnTokens.push(o)}o.getFieldNames(n)}return this._expression=t,this.updateContext(),this._main=this._createFunction(this._expression),this._main?(this._fieldMap=n,this._fields=Object.keys(n),this._main):null},p.prototype._createFunction=function(t){let e=null;try{e=new Function("__R","return "+t+";"),e=e.bind(this),e({})}catch(t){e=null}return e},p.prototype.__D=function(t,e){return e[t]},p.prototype.addField=function(t,e){return!this._fieldMap[t]&&(!(t.indexOf("undefined")>=0)&&(this._fields.push(t),this._fieldMap[t]=!0,this._dispatch("dataRequired",{field:t,src:e||"adc"}),!0))},p.prototype.changeField=function(t,e){let i=this._fields.indexOf(t);if(i<0)return!1;this._fields.splice(i,1),this._fields.indexOf(e)<0&&this._fields.push(e);let n=this._input,o="♠"+t+"♥",r="♠"+e+"♥";return this._inputWithTokenField=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t===o?r:t})),this._input=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t.substr(1,t.length-2)})),this._expression=this._expression.replace(new RegExp('this\\.__D\\("'+t+'", __R\\)',"g"),'this.__D("'+e+'", __R)'),this._main=this._createFunction(this._expression),this._dispatch("formulaChanged",{oldInput:n,formula:this}),!0},p.prototype.changeFields=function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;let i=this._input;for(let i=t.length;--i>=0;){let n=t[i],o=e[i],r=this._fields.indexOf(n);if(r<0)continue;this._fields.splice(r,1),this._fields.indexOf(o)<0&&this._fields.push(o);let s="♠"+n+"♥",l="♠"+o+"♥";this._inputWithTokenField=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t===s?l:t})),this._input=this._inputWithTokenField.replace(new RegExp("♠[^♠]*♥","g"),(function(t){return t.substr(1,t.length-2)})),this._expression=this._expression.replace(new RegExp('this\\.__D\\("'+n+'", __R\\)',"g"),'this.__D("'+o+'", __R)')}return this._main=this._createFunction(this._expression),this._dispatch("formulaChanged",{oldInput:i,formula:this}),!0},p.prototype.getRealtimeService=function(){return this._rtService},p.prototype.setRealtimeService=function(t){this._rtService&&this._rtService.dispose(),this._rtService=t,this._rtService.addEventListener("dataChanged",this._onDataCacheChanged)},p.prototype.getIntervalService=function(t){return this._intervalServices[t]},p.prototype.setIntervalService=function(t,e){if(!e)return;let i=this._intervalServices[t];i&&i.removeEventListener("dataChanged",this.dispatchDataChanged),this._intervalServices[t]=e,e.addEventListener("dataChanged",this.dispatchDataChanged)},p.prototype.getCachedData=function(t){return this._dataCache[t]},p.prototype.setCachedData=function(t,e){this._dataCache[t]=e},p.prototype.setDataError=function(t){this._dataLastError=t},p.prototype.dispatchDataChanged=function(t){this._dispatch("dataCacheChanged",{})},p.prototype._onDataCacheChanged=function(t){let e=t.ric,i=t.values,n=this._dataCache[e];if(n)for(let t in i)n[t]=i[t];else this._dataCache[e]=i;this._dispatch("dataCacheChanged",{})},p._proto=p.prototype;var d=p;var c={en:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat",Sunday:"Sunday",Monday:"Monday",Tuesday:"Tuesday",Wednesday:"Wednesday",Thursday:"Thursday",Friday:"Friday",Saturday:"Saturday",jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec",January:"January",February:"February",March:"March",April:"April",May:"May",June:"June",July:"July",August:"August",September:"September",October:"October",November:"November",December:"December",am:"am",AM:"AM",pm:"pm",PM:"PM"},de:{sun:"So",mon:"Mo",tue:"Di",wed:"Mi",thu:"Do",fri:"Fr",sat:"Sa",Sunday:"Sonntag",Monday:"Montag",Tuesday:"Dienstag",Wednesday:"Mittwoch",Thursday:"Donnerstag",Friday:"Freitag",Saturday:"Samstag",jan:"Jan",feb:"Feb",mar:"Mrz",apr:"Apr",may:"Mai",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Okt",nov:"Nov",dec:"Dez",January:"Januar",February:"Februar",March:"März",April:"April",May:"Mai",June:"Juni",July:"Juli",August:"August",September:"September",October:"Oktober",November:"November",December:"Dezember",am:"am",AM:"AM",pm:"pm",PM:"PM"},ja:{sun:"日",mon:"月",tue:"火",wed:"水",thu:"木",fri:"金",sat:"土",Sunday:"日曜日",Monday:"月曜日",Tuesday:"火曜日",Wednesday:"水曜日",Thursday:"木曜日",Friday:"金曜日",Saturday:"土曜日",jan:"1月",feb:"2月",mar:"3月",apr:"4月",may:"5月",jun:"6月",jul:"7月",aug:"8月",sep:"9月",oct:"10月",nov:"11月",dec:"12月",January:"1月",February:"2月",March:"3月",April:"4月",May:"5月",June:"6月",July:"7月",August:"8月",September:"9月",October:"10月",November:"11月",December:"12月",am:"午前",AM:"午前",pm:"午後",PM:"午後"},zh:{sun:"周日",mon:"周一",tue:"周二",wed:"周三",thu:"周四",fri:"周五",sat:"周六",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",jan:"1月",feb:"2月",mar:"3月",apr:"4月",may:"5月",jun:"6月",jul:"7月",aug:"8月",sep:"9月",oct:"10月",nov:"11月",dec:"12月",January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月",am:"上午",AM:"上午",pm:"下午",PM:"下午"},"zh-Hant":{sun:"週日",mon:"週一",tue:"週二",wed:"週三",thu:"週四",fri:"週五",sat:"週六",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",jan:"1月",feb:"2月",mar:"3月",apr:"4月",may:"5月",jun:"6月",jul:"7月",aug:"8月",sep:"9月",oct:"10月",nov:"11月",dec:"12月",January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月",am:"上午",AM:"上午",pm:"下午",PM:"下午"}};let _=function(t,e,i){if(!t)return null;if(!e||t===e)return t;let n;if(i){let o=i.length;for(let r=0;r<o;++r)n=i[r],n&&m(t,e,n)}else for(n in e)m(t,e,n);return t},f=function(t,e){return _({},t,e)},g=function(t){for(let e in t)return!1;return!0},y=function(t,e){if(!Array.isArray(t))return t;if(!e)return null;let i=t;t={};let n=i.length;for(let o=0;o<n;++o){let n=e[o];n&&void 0!==i[o]&&(t[n]=i[o])}return t},m=function(t,e,i){let n=e[i];if(null!=n){let e=t[i];Array.isArray(e)?t[i]=e.concat(n):Array.isArray(n)&&e?t[i]=n.concat(e):t[i]=n}},C=function(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if("object"==typeof t){if(Array.isArray(t)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!C(t[i],e[i]))return!1}else{if(Object.keys(t).length!==Object.keys(e).length)return!1;for(let i in t)if(!C(t[i],e[i]))return!1}return!0}return!1},v=function(t){return Array.isArray(t)?"{\n"+t.join("\n")+"\n}":t},S=function(t){return t.replace(/\n+/g,"\n\t").replace(/\n\t}$/,"\n}")},w=function(t,e){if(!t)return null;let i=document.createElement("style");i.textContent="\n"+t+"\n";let n,o=function(t){if(t){let e;if(t.shadowRoot?e=t.shadowRoot:t.getRootNode&&(e=t.getRootNode()),e&&e!==document&&e!==t)return e}return null}(e),r=!0;return o||(r=!1,o=document.head),r&&o.children&&o.children.length&&(n=o.children[0]),n?o.insertBefore(i,n):o.appendChild(i),i},b=function(t,e){e||(e=[]);for(let i in t){let n=t[i];"object"==typeof n?b(n,e):e.push(n)}return e},R=function(t){if(!t||"string"!=typeof t)return"";if("#"===t.charAt(0))return t;let e=t.match(/\d+/g);if(!e||e.length<3)return t;let i="#";for(let t=0;t<3;t++){let n=+e[t];n>=16||(i+="0"),i+=n?n.toString(16).toUpperCase():"0"}return i};let I=function(t,e,i){this.resolve=this.resolve.bind(this),this.reject=this.reject.bind(this),"function"==typeof t&&(this._resolveHandler=t),"function"==typeof e&&(this._rejectHandler=e),null!=i&&(this._ctx=i),this.promise=new Promise(function(t,e){this._resolve=t,this._reject=e}.bind(this))};I.prototype.promise=null,I.prototype._resolve=null,I.prototype._reject=null,I.prototype._resolveHandler=null,I.prototype._rejectHandler=null,I.prototype._ctx=null,I.prototype._fulfilled=!1,I.prototype.resolve=function(t){if(this._resolve){if(this._resolveHandler){let e=this._resolveHandler(t,this._ctx||this);null!=e&&(t=e)}this._resolve(t),this._finally()}},I.prototype.reject=function(t){if(this._reject){if(this._rejectHandler){let e=this._rejectHandler(t,this._ctx||this);null!=e&&(t=e)}this._reject(t),this._finally()}},I.prototype.isFulfilled=function(){return this._fulfilled},I.prototype._finally=function(){this._fulfilled=!0,this._ctx=this._resolveHandler=this._rejectHandler=null,this._resolve=this._reject=null};let D={},x=function(t,e){"attributes"==e.type&&"lang"==e.attributeName&&(t.lang=e.target.lang||"en")},A=function(t,e,i){"attributes"===i.type&&(null!=e?i.attributeName===e&&t(i.target.getAttribute(e)):t(i.target))};D._getNewId=function(){return"observer_"+ ++D._id},D._addObserver=function(t,e,i){let n=i;n||(n={}),n.attributes=!0,D._observer.observe(t,n),D._addListener(t,e)},D._onMutationCallback=function(t){for(let e=0;e<t.length;e++){let i=t[e],n=D._listeners[i.target._observeId];for(let t=0;t<n.length;t++)n[t](i)}},D._addListener=function(t,e){let i=D._listeners;if(i||(i=D._listeners={}),!t._observeId){let e=D._getNewId();t._observeId=e}i[t._observeId]||(i[t._observeId]=[]);let n=i[t._observeId];n.indexOf(e)<0&&n.push(e)},D.addLanguageListener=function(t){t&&(t.lang=document.documentElement.lang||"en",D._addObserver(document.documentElement,x.bind(null,t)))},D.addAttributeListener=function(t,e,i){t&&e&&D._addObserver(t,A.bind(null,e,i))},D._observer=new MutationObserver(D._onMutationCallback),D._listeners={},D._id=0;let L={en:!0,de:!0,ja:!0,zh:!0,"zh-Hant":!0},T={_deferred:null,themeReady:null,_defaultColors:{up:"#39C46E",down:"#F5475B",level:"#C2C2C2",tickUp:"#39C46E",tickDown:"#F5475B",baseGrid:"#1A1A1C",baseText:"#C2C2C2",trackColor:"#FF9933"}};T.themeColors=T._defaultColors,T._components={},T._themeName="",T._elfVersion=0,T._dummyIcon=null,T._iconLoaded=!1,T._profileName=null,T._callbacks=[],T._observed=!1,T._pendingResolve=!1,T._themeLoaded=!1,T._icons={"elf-theme-halo":{rowGrouping:{expander:"down"},sorting:{ascending:"hollow-arrow-up",descending:"hollow-arrow-down",sortable:"sort-up-down"},columnStack:{stack:"map-layers",expand:"right",collapse:"left"}},"elf-theme-solar":{columnStack:{stack:"list",expand:"right",collapse:"left"}}},T._icons["halo-theme"]=T._icons["elf-theme-halo"],T._icons["solar-theme"]=T._icons["elf-theme-solar"],T.getElfVersion=function(){if(!T._elfVersion){let t=0;if(window.EFX_GRID){let e=window.EFX_GRID.version;e=e.split("."),t=+e[0]}else if(window.elf)if(window.elf.version){let e=window.elf.version.match(/\d/);e&&e[0]&&(t=parseInt(e[0],10))}else window.elf.customElements?t=3:window.customElements&&(t=4);else window.Polymer&&(t=1);T._elfVersion=t}return T._elfVersion},T.hasComponent=function(t){let e=T._components[t];if(null==e){e=0;let i=T.getElfVersion();if(t){let n;1===i?(n=document.createElement(t),n.is===t&&(e=i)):i>1&&(window.customElements&&window.customElements.get(t)||document.createElement(t).constructor!==HTMLElement)&&(e=i),T._components[t]=e}}return e},T.toLangString=function(t){if(!t)return"";if("zh-hant"===(t=t.toLowerCase()))return"zh-Hant";let e=t.replace(/-.*/,"");return L[e]?e:""},T.hasTheme=function(t){return t===T.getThemeName()},T.getThemeName=function(t){return T._themeName||(T._themeName=T.getCssVariable("--theme-name",document.documentElement)),T._themeName},T.setThemeName=function(t){T._themeName=t},T.isThemeLoaded=function(){return T._themeLoaded},T.getColors=function(){return T.themeColors},T.isHaloTheme=function(t){return null==t&&(t=T.getThemeName()),!!t&&t.indexOf("halo")>=0},T.injectIcons=function(t,e){if("object"!=typeof t)return;let i=T.getThemeName();t.themeName=i;let n=T.getElfVersion();t.elfVersion=n;let o=T._icons[i];o&&(t.icons=o)},T.getIconList=function(){let t=T._icons[T.getThemeName()];return t?b(t):[]},T._onIconPreloaded=function(){if(T._dummyIcon){let t=T._dummyIcon.parentNode;t&&t.removeChild(T._dummyIcon),T._dummyIcon=null}},T.prepareIconPreloading=function(){if(!T._iconLoaded){T._iconLoaded=!0;let t=T.getIconList();if(t.length){setTimeout(T._onIconPreloaded,10);let e=T._dummyIcon=document.createElement("ef-icon");return e.style.transform="scale(0)",document.body.appendChild(e),t}}return null},T.getCssVariable=function(t,e){let i="",n=e||document.body;return window&&"string"==typeof t&&1===n.nodeType&&t.match(/^--/)&&(i=window.getComputedStyle(n).getPropertyValue(t),i=i.replace(/[\"\']/g,"")),i},T.getCssVariables=function(t,e){let i=e||document.body;if(window&&1===i.nodeType){let e=window.getComputedStyle(i);for(let i in t){let n=t[i];n&&n.match(/^--/)&&(t[i]=e.getPropertyValue(n).replace(/\"/g,""))}}return t||null},T.setRTK=function(t){null!=t&&(T._rtk=t)},T.getMovementColorProfile=function(){return document.documentElement.getAttribute("movement-color-profile")},T._addThemeChangedCallback=function(t){let e=T._callbacks;e.indexOf(t)<0&&e.push(t)},T.reloadThemeColors=function(){return T._deferred&&T._deferred.isFulfilled()?(T._profileName="",T._themeLoaded=!1,T.themeReady=null,T.getThemeColors()):T.themeReady},T.getThemeColors=function(t){if("function"==typeof t&&T._addThemeChangedCallback(t),T.themeReady)return T.themeReady;let e=T._deferred=new I;T.themeReady=e.promise;let i=T.getMovementColorProfile();if(i)i!==T._profileName?setTimeout(T._profileNameRetrieved,100):T._deferred.resolve(T.themeColors);else{let t={providerName:"Configuration",settingName:"RDE_USER_CURRENT_TICK_COLOR"},e=window?window.JET:null;if(T._themeLoaded=!1,T._rtk&&T._rtk.Settings)T._rtk.Settings.getAsync(t).then(T._loadingProfileSuccess).catch(T._loadingProfileFailure);else if(e&&e.Settings)try{e.Settings.read(T._loadingProfileSuccess,t)}catch(t){T._loadingProfileFailure()}else setTimeout(T._profileNameRetrieved,100)}return e.promise};let E=function(t){if(t!==T._profileName){T._retrieveThemeColors(t),T._pendingResolve&&(T._pendingResolve=!1,T._deferred.resolve(T.themeColors));let e=T._callbacks;for(let t=0;t<e.length;t++)e[t]()}};T._loadingProfileSuccess=function(t){t&&document.documentElement.setAttribute("movement-color-profile",t.toLowerCase()),T._observed?T._pendingResolve=!0:T._profileNameRetrieved(t)},T._loadingProfileFailure=function(){T._retrieveThemeColors(),T._observed||(T._observed=!0,D.addAttributeListener(document.documentElement,E,"movement-color-profile")),T._deferred.reject("Failed to get movement color profile from settings.")},T._profileNameRetrieved=function(){let t=T.getMovementColorProfile();T._retrieveThemeColors(t),T._observed||(T._observed=!0,D.addAttributeListener(document.documentElement,E,"movement-color-profile")),T._deferred.resolve(T.themeColors)},T._retrieveThemeColors=function(t){T._themeLoaded=!0,T._profileName=t;let e=T.themeColors=T.getCssVariables({primary:"--color-scheme-primary",secondary:"--color-scheme-secondary",tertiary:"--color-scheme-tertiary",complementary:"--color-scheme-complementary",up:"--color-scheme-positive",down:"--color-scheme-negative",level:"--color-scheme-neutral",tickUp:"--color-scheme-tickup",tickDown:"--color-scheme-tickdown"});e.up||(e.up=T._defaultColors.up,e.down=T._defaultColors.down,e.level=T._defaultColors.level,e.tickUp=T._defaultColors.tickUp,e.tickDown=T._defaultColors.tickDown),e.positive=e.up,e.negative=e.down,e.neutral=e.level;let i=document.createElement("table");i.style.visibility="hidden",i.style.position="fixed",i.style.left="0",i.style.top="0",i.style.width="0";let n=i.insertRow(-1),o=n.insertCell(-1);document.body.appendChild(i);let r=window.getComputedStyle(n);e.tableBg=r.backgroundColor;let s=window.getComputedStyle(o);e.tableText=s.color,e.tableBorder=s.borderColor,e.tableText===e.tableBorder&&(o.className="tr-lg",s=window.getComputedStyle(o),e.tableBg=s.backgroundColor,e.tableText=s.color,e.tableBorder=s.borderColor,e.tableText===e.tableBorder&&(e.tableBg=T._defaultColors.baseGrid,e.tableText=T._defaultColors.baseText,e.tableBorder="")),e.tableBg=R(e.tableBg),e.tableText=R(e.tableText),e.tableBorder=R(e.tableBorder),document.body.removeChild(i),e.baseGrid=e.tableBg,e.baseText=e.tableText,e.trackColor=e.primary||T._defaultColors.trackColor};var M=T;new Date(NaN);const F=Date.UTC(1900,0,1),P=Date.UTC(1900,2,1),z=["sun","mon","tue","wed","thu","fri","sat"],V=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],k=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],O=["January","February","March","April","May","June","July","August","September","October","November","December"];let N=function(t){return t>9?""+t:"0"+t},H={D:function(t,e){return""+t.getDate()},DD:function(t,e){return N(t.getDate())},DDD:function(t,e){return e[z[t.getDay()]]},D_:function(t,e){return e[V[t.getDay()]]},M:function(t,e){return""+(t.getMonth()+1)},MM:function(t,e){return N(t.getMonth()+1)},MMM:function(t,e){return e[k[t.getMonth()]]},M_:function(t,e){return e[O[t.getMonth()]]},YY:function(t,e){return(""+t.getFullYear()).slice(-2)},Y_:function(t,e){return""+t.getFullYear()},H:function(t,e){return""+t.getHours()},H_:function(t,e){return N(t.getHours())},h:function(t,e){let i=t.getHours()%12;return 0===i?"12":""+i},h_:function(t,e){let i=t.getHours()%12;return i=0===i?12:i,N(i)},m:function(t,e){return""+t.getMinutes()},m_:function(t,e){return N(t.getMinutes())},s:function(t,e){return""+t.getSeconds()},s_:function(t,e){return N(t.getSeconds())},S:function(t,e){return~~(t.getMilliseconds()/100)},SS:function(t,e){return N(~~(t.getMilliseconds()/10))},S_:function(t,e){return(i=t.getMilliseconds())>99?""+i:i>9?"0"+i:"00"+i;var i},A:function(t,e){return t.getHours()<12?e.AM:e.PM},a:function(t,e){return t.getHours()<12?e.am:e.pm}},B={_dateTimePattern:"M/D/YY h:mm A",_localeSetting:"en",_activeLocaleMap:null,_activeInput:null,setDateTimePattern:function(t){B._dateTimePattern=t||"M/D/YY h:mm A"},setLocale:function(t){let e=M.toLangString(t);B._localeSetting=c[e]?e:"en"},format:function(t,e,i){let n=null,o="",r=!(!i||"LOCAL"!==i.toUpperCase());if("number"==typeof t)t>1e8?n=new Date(t):(n=B.fromDateNumber(t),r=!0);else if(t instanceof Date)n=new Date(t);else{o=t+"";let e=o.match(/^\d{4}(-\d{2}(-\d{2}(T\d{2}\:\d{2}\:\d{2})?)?)?$/);o=o.replace(/\-/g,"/"),e&&(o=o.replace(/T/g," ")),n=new Date(o)}return B.isInvalidDate(n)?t||"":(r||n.setTime(n.getTime()+6e4*n.getTimezoneOffset()),B.formatDateObject(n,e))},formatDateObject:function(t,e){if(B.isInvalidDate(t))return"";e||(e=B._dateTimePattern),B._activeInput=t,B._activeLocaleMap=c[B._localeSetting]||DateTimeLocale.en;let i=e.replace(/D+|M+|Y+|H+|S+|A+|d+|m+|y+|h+|s+|a+|\[[^\]]*\]+/g,B._parseDatePattern);return B._activeInput=null,i},_lowerCaseDatePatterns:{d:!0,y:!0},_parseDatePattern:function(t){let e=t?t.charAt(0):"";if("["===e)return t.substring(1,t.length-1);let i=H[t];if(!i){let n=t;B._lowerCaseDatePatterns[e]&&(n=t.toUpperCase(),e=e.toUpperCase(),i=H[n]),i||(n=e+"_",i=H[n])}return i?i(B._activeInput,B._activeLocaleMap):t},isValidDate:function(t){if(t&&t.getTime){let e=t.getTime();return e==e}return!1},isInvalidDate:function(t){if(t&&t.getTime){let e=t.getTime();return e!=e}return!0},fromDateNumber:function(t){let e=B.dateNumberToMs(t);if(e==e){let i=B.timeNumberToMs(t);return new Date(e+i)}return new Date(NaN)},dateNumberToMs:function(t){if(!(t=Math.floor(+t))||t<=0||60===t)return NaN;let e=t-25569;return t<60&&e++,864e5*e},timeNumberToMs:function(t){"number"!=typeof t&&(t=+t);let e=t-Math.floor(t);return e?(e<0&&(e=-e),1e3*Math.round(86400*e)):0},toDateObject:function(t){let e=null;if(t instanceof Date)e=t;else if("number"==typeof t)e=t>3e9||t<=0?new Date(t):t>1e5?new Date(1e3*t):B.fromDateNumber(t);else if(t){let i=t+"",n=i.match(/^\d{4}(-\d{2}(-\d{2}(T\d{2}\:\d{2}\:\d{2})?)?)?$/);i=i.replace(/\-/g,"/"),n&&(i=i.replace(/T/g," ")),e=new Date(i)}else e=new Date(NaN);return e},toDateNumber:function(t){return B._millisecondToDateNumber(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()))},toTimeNumber:function(t){return Date.UTC(1970,0,1,t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds())/864e5},_millisecondToDateNumber:function(t){if((t=+t)!=t||t<F)return NaN;{let e=t/864e5+25569;return t<P&&e--,e}},toYYYYMMDD:function(t){let e=t?t.toJSON():"";return e?e.slice(0,10):""}};var G=B;let W={ISEMPTY:function(t){return t!=t||0===t||t?0:1},ISERR:function(t){return t!=t||null==t?1:0},ISNA:function(t){return""===t?1:0},ISNUMBER:function(t){return"number"==typeof t?1:0},ISSTRING:function(t){return"string"==typeof t?1:0},ISNASTRING:function(t){if(t){if(0===t.length)return 1;if(t.constructor===Object){for(let e in t)return 0;return 1}}else if(""===t)return 1;return 0}};var U=W;let Y={AND:function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;for(let e=t.length;--e>=0;)if(!t[e])return 0;return 1},FALSE:function(){return 0},IF:function(t,e,i){return t?e:i},NOT:function(t){return t?0:1},OR:function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;for(let e=t.length;--e>=0;)if(t[e])return 1;return 0},TRUE:function(){return 1}};var q=Y;let X={};X.ABS=Math.abs,X.ACOS=Math.acos,X.ACOSH=function(t){return Math.log(t+Math.sqrt(t*t-1))},X.ASIN=Math.asin,X.ASINH=function(t){return t===-1/0?t:Math.log(t+Math.sqrt(t*t+1))},X.ATAN=Math.atan,X.ATAN2=function(t,e){return Math.atan2(e,t)},X.ATANH=function(t){return Math.log((1+t)/(1-t))/2},X.CEILING=function(t,e){return e||(e=1),t/=e,Math.ceil(t)*e},X.CEIL=X.CEILING,X.COMBIN=function(t,e){let i=X.FACT;return i(t)/(i(e)*i(t-e))},X.COS=Math.cos,X.COSH=function(t){let e=Math.exp(t);return(e+1/e)/2},X.DEGREES=function(t){return t/(Math.PI/180)},X.EVEN=function(t){return(t=Math.ceil(t))%2?t<0?t-1:t+1:t},X.EXP=Math.exp,X.FACT=function(t){if(t<0)return NaN;t=Math.floor(t);let e=1;for(;t>1;)e*=t,--t;return e},X.FACTDOUBLE=function(t){if(t<0)return NaN;t=Math.floor(t);let e=1;for(;t>1;)e*=t,t-=2;return e},X.FLOOR=function(t,e){return e||(e=1),t/=e,Math.floor(t)*e},X.GCD=function(t,e){if(t<0&&(t=-t),e<0&&(e=-e),e>t){let i=t;t=e,e=i}for(;0!=e;){if(0==(t%=e))return e;e%=t}return t},X.INT=Math.floor,X.LCM=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t.length,i=Math.abs(t[0]);for(let n=1;n<e;n++){let e=Math.abs(t[n]),o=i;for(;i&&e;)i>e?i%=e:e%=i;i=Math.abs(o*t[n])/(i+e)}return i},X.LN=Math.log,X.LOG=function(t,e){return null==e&&(e=10),Math.log(t)/Math.log(e)},X.LOG10=function(t){return Math.log(t)/Math.LN10},X.MOD=function(t,e){return t%e},X.ODD=function(t){return(t=Math.ceil(t))%2==0?t<0?t-1:t+1:t},X.POWER=Math.pow,X.PRODUCT=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t[0];if(null==e||e!=e)return NaN;for(let i=t.length;--i>=1;)e*=t[i];return e},X.PROD=X.PRODUCT,X.QUOTIENT=function(t,e){return Math.floor(t/e)},X.RADIANS=function(t){return t*(Math.PI/180)},X.RAND=Math.random,X.RANDBETWEEN=function(t,e){return Math.floor(Math.random()*(e-t+1))+t},X.ROUND=function(t,e){if(!e)return Math.round(t);let i=Math.pow(10,e);return Math.round(t*i)/i},X.ROUNDDOWN=function(t,e){if(!e)return Math.floor(t);let i=Math.pow(10,e);return Math.floor(t*i)/i},X.ROUNDUP=function(t,e){if(!e)return Math.ceil(t);let i=Math.pow(10,e);return Math.ceil(t*i)/i},X.SERIESSUM=function(t,e,i,n){let o=0;for(let r=n.length;--r>=0;)o+=n[r]*Math.pow(t,e+r*i);return o},X.SIGN=function(t){return t>0?1:t<0?-1:0},X.SIN=Math.sin,X.SINH=function(t){let e=Math.exp(t);return(e-1/e)/2},X.SQRT=Math.sqrt,X.SQRTPI=function(t){return Math.sqrt(t*Math.PI)},X.SUM=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let i=t.length;--i>=0;)e+=t[i];return e},X.SUMPRODUCT=function(){let t,e=arguments[0]instanceof Array?arguments[0]:arguments,i=e.length;if(0===i)return 0;let n=[];for(t=0;t<i;++t)n[t]=1;for(t=0;t<i;++t)n[t]*=e[t];let o=0;for(t=0;t<i;++t)o+=n[t];return o},X.SUMSQ=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let i=t.length;--i>=0;){let n=t[i];e+=n*n}return e},X.TAN=Math.tan,X.TANH=function(t){if(t===1/0)return 1;if(t===-1/0)return-1;let e=Math.exp(2*t);return(e-1)/(e+1)},X.TRUNC=function(t,e){if(!e)return Math.floor(t);let i=Math.pow(10,e);return Math.floor(t*i)/i};var j=X;let K={AVERAGE:function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t.length;if(e<=0)return NaN;let i=0;for(let n=e;--n>=0;)i+=t[n];return i/e}};K.AVG=K.AVERAGE,K.COUNT=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let i=t.length;--i>=0;){let n=t[i];null!=n&&n==n&&++e}return e},K.MAX=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;if(t.length<=0)return NaN;let e=t[0];for(let i=t.length;--i>=1;)t[i]>e&&(e=t[i]);return e},K.MIN=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;if(t.length<=0)return NaN;let e=t[0];for(let i=t.length;--i>=1;)t[i]<e&&(e=t[i]);return e},K.STDEV=function(){let t=arguments[0]instanceof Array?arguments[0]:Array.prototype.slice.call(arguments),e=t.length;if(e<=0)return NaN;if(1===e)return 0;let i=K.AVERAGE(t),n=0;for(let o=e;--o>=0;){let e=t[o]-i;n+=e*e}return Math.sqrt(n/(e-1))},K.STDEVP=function(){let t=arguments[0]instanceof Array?arguments[0]:Array.prototype.slice.call(arguments),e=t.length;if(e<=0)return NaN;if(1===e)return 0;let i=K.AVERAGE(t),n=0;for(let o=e;--o>=0;){let e=t[o]-i;n+=e*e}return Math.sqrt(n/e)};var J=K;let Q={},Z=function(t){return t||0===t?t+"":""};Q.EXACT=function(t,e){return(t+="")===(e+="")?1:0},Q.FIND=function(t,e,i){if(!(t=Z(t)))return 0;if(!(e=Z(e)))return 0;return(!(i=+i)||i<0)&&(i=0),e.indexOf(t,i)},Q.LEFT=function(t,e){return(e=+e)||(e=0),e<0&&(e=1),Z(t).substr(0,e)},Q.LENGTH=function(t){return Z(t).length},Q.LEN=Q.LENGTH,Q.LOWER=function(t){return Z(t).toLowerCase()},Q.MID=function(t,e,i){return Z(t).substr(e,i)},Q.REPLACE=function(t,e,i,n){n+="";let o=(t=Z(t)).split("");return o.splice(i,e,n),o.join("")},Q.RIGHT=function(t,e){(e=+e)||(e=0),e<0&&(e=1);let i=(t=Z(t)).length-e;return t.substr(i,e)},Q.TRIM=function(t){return Z(t).trim()},Q.UPPER=function(t){return Z(t).toUpperCase()},Q.VALUE=function(t){return+t},Q.CHAR=function(t){let e=+t;return String.fromCharCode(e)},Q.CLEAN=function(t){let e=Z(t).split("");for(let t=e.length;--t>=0;){let i=e[t].charCodeAt(0);(i<32||i>127)&&(e[t]="")}return e.join("")},Q.CODE=function(t){return Z(t).charCodeAt(0)},Q.PROPER=function(t){let e=(t=Z(t)).split(/[\W_]/g),i=t.match(/[\W_]/g),n=e.length,o="";for(let t=0;t<n;t++){let n=e[t],r=n.length;1===r?o+=n.toUpperCase():0!==r&&(o+=n.charAt(0).toUpperCase()+n.substr(1).toLowerCase());let s=i[t];s&&(o+=s)}return o},Q.REPEAT=function(t,e){if(!(e=+e)||e<0)return"";if(""===(t=Z(t)))return"";let i=t;for(let n=1;n<e;n++)i+=t;return i},Q.STRING=function(t,e){return(t=+t)?(!(e=+e)||e<0?e=0:e>9&&(e=9),t.toFixed(e)):""};var $=Q;let tt=function(){this._context={},tt._addContext(this._context,tt.getContext()),this._context._DATA=this._getData.bind(this),this._setData=this._defaultFormulaDataSetter.bind(this),this._formulas=[],this._formulaMap={},this._referenceMap={}};s.inherits(tt,a),tt.prototype._context=null,tt.prototype._rowData=null,tt.prototype._setData=null,tt.prototype._formulas=null,tt.prototype._formulaMap=null,tt.prototype._referenceMap=null,tt._context=null,tt.getContext=function(){let t=tt._context;return t||(t={},tt._context=t,tt._addContext(t,G),tt._addContext(t,U),tt._addContext(t,q),tt._addContext(t,j),tt._addContext(t,J),tt._addContext(t,$)),t},tt.addContext=function(t){let e=tt.getContext();tt._addContext(e,t)},tt._addContext=function(t,e){for(let i in e)t[i]=e[i]},tt.prototype.setFormulaDataGetter=function(t){"function"==typeof t&&(this._context._DATA=t)},tt.prototype.setFormulaDataSetter=function(t){"function"==typeof t&&(this._setData=t)},tt.prototype._defaultFormulaDataSetter=function(t,e,i,n){if("..."!==e){let o=t.getAlias();i[o]=e,n&&(n[o]=e)}},tt.prototype.addFormula=function(t){let e;return t instanceof d?e=t:(this._rowData={},e=new d(t,this._context),this._rowData=null),e.addEventListener("dataCacheChanged",this._dispatch.bind(this,"dataChanged")),e.addEventListener("dataRequired",this._dispatch.bind(this,"dataRequired")),e.addEventListener("formulaChanged",this._dispatch.bind(this,"formulaChanged")),this._formulas.push(e),e},tt.prototype.mockFormula=function(t){let e;return e=new d(t instanceof d?t.getInput():t,this._context),e},tt.prototype.removeFormula=function(t){let e;if(t instanceof d&&(t=this._formulas.indexOf(t)),"number"==typeof t)e=this._formulas[t],e&&(this._formulas.splice(t,1),e.getReference()&&(delete this._formulaMap[e.getReference()],delete this._referenceMap[e.getReference()]),e.dispose());else if("string"==typeof t&&(e=this._formulaMap[t],e)){let i=this._formulas.indexOf(e);i>=0&&(this._formulas.splice(i,1),delete this._formulaMap[t],delete this._referenceMap[t]),e.dispose()}return e||null},tt.prototype.removeAllFormulas=function(){let t=this._formulas;for(let e=t.length;--e>=0;)delete this._referenceMap[t[e].getReference()];this._formulas.length=0,this._formulaMap={}},tt.prototype.getFormula=function(t){let e;return e="number"==typeof t?this._formulas[t]:this._formulaMap[t],e||null},tt.prototype.getFormulaByExpression=function(t){let e=this._formulas.length;for(let i=0;i<e;++i){let e=this._formulas[i];if(e.getInput()===t)return e}return null},tt.prototype.getAllFormulas=function(){return this._formulas},tt.prototype.getAllFormulaReferences=function(){return this._referenceMap},tt.prototype.getFormulaCount=function(){return this._formulas.length},tt.prototype._generateUniqueReference=function(t){let e=t,i=0;for(;null!=this._referenceMap[e];)e=t+"_"+ ++i;return e},tt.prototype.addReference=function(t,e){if(!t||!e)return"";e=this._generateUniqueReference(e);let i="";if(t instanceof d){if(!this._setFormulaReference(t,e))return"";i=t.getAlias()}else i=t;return this._referenceMap[e]=i,e},tt.prototype.renameReference=function(t,e){if(!e)return this.removeReference(t);if(!t||null==this._referenceMap[t]||t===e)return!1;let i=this._formulaMap[t];if(i&&!this.isValidReference(i,e))return!1;for(let i=this._formulas.length;--i>=0;){let n=this._formulas[i];if(n.changeField(t,e)){let t=n.getReference();t&&(this._referenceMap[t]=n.getAlias())}}return i&&this._setFormulaReference(i,e),this._referenceMap[e]=this._referenceMap[t],delete this._referenceMap[t],!0},tt.prototype.removeReference=function(t){if(!t||null==this._referenceMap[t])return!1;let e=this._formulaMap[t];return null!=e&&(e._setReference(""),delete this._formulaMap[t]),delete this._referenceMap[t],!0},tt.prototype.resolveReference=function(t){return this._referenceMap[t]||t},tt.prototype._getData=function(t,e){if(!this._rowData)return null;let i=this._rowData[this.resolveReference(t)];if(i){let t=Number(i);t==t&&(i=t)}return i},tt.prototype._setFormulaReference=function(t,e){if(this._formulaMap[e])return console.warn("Duplicate formula reference detected."),!1;let i=t.getReference();if(i===e)return!1;e&&(this._formulaMap[e]=t),t._setReference(e);let n=this._sortDependencies(this._formulas,this._formulaMap);return n?(this._formulas=n,delete this._formulaMap[i],!0):(t._setReference(i),delete this._formulaMap[e],!1)},tt.prototype.calculate=function(t,e){this._rowData=t;let i=this._formulas.length;for(let n=0;n<i;++n){let i=this._formulas[n];if(e){let t=null!=e[i.getAlias()];if(!t){let n=i.getFieldNames();for(let i=n.length;--i>=0;)if(null!=e[this.resolveReference(n[i])]){t=!0;break}if(!t)continue}}let o=i.calculate(t);this._setData(i,o,t,e)}this._rowData=null},tt.prototype.isValidReference=function(t,e){if(!e)return!0;if(this._referenceMap[e])return!1;let i=t.getReference(),n=this._createParentChildrenMap(this._formulas);if(i){delete n[i];for(let t in n){let o=n[t],r=o.indexOf(i);-1!==r&&(o=o.slice(0),o.splice(r,1),r=o.indexOf(e),-1===r&&o.push(e),n[t]=o)}}return n[e]=t.getFieldNames(),!!this._sortParentChildrenMap(n)},tt.prototype._sortDependencies=function(t,e){if(1===t.length)return t;let i=this._createParentChildrenMap(t),n=this._sortParentChildrenMap(i);if(!n)return null;let o=t.filter((function(t){return!t.getReference()})),r=[];if(e){for(let t=n.length;--t>=0;){let i=e[n[t]];i&&r.push(i)}o.length>0&&(r=r.concat(o))}return r},tt.prototype._createParentChildrenMap=function(t){let e,i={};for(e=t.length;--e>=0;){let n=t[e],o=n.getReference();o&&(i[o]=n.getFieldNames())}return i},tt.prototype._sortParentChildrenMap=function(t){let e,i,n,o,r,s={};for(r in t){n=t[r],o=n.length;for(let t=0;t<o;++t)i=n[t],s[i]=s[i]+1||1}let l=[];for(r in t)s[r]||l.push(r);let a=[];for(;l.length>0;)for(r=l.shift(),a.push(r),n=t[r],o=n?n.length:0,e=0;e<o;++e)i=n[e],--s[i]>0||l.push(i);for(i in s)if(s[i])return null;return a},tt._proto=tt.prototype;var et,it,nt={};nt.isIE=(et=window.navigator.userAgent).indexOf("MSIE ")>0||et.indexOf("Trident/")>0||et.indexOf("Edge/")>0,nt.isTouchDevice=!!(navigator.maxTouchPoints&&navigator.maxTouchPoints<256||navigator.msMaxTouchPoints&&navigator.msMaxTouchPoints<256),nt.isSafari=(it=navigator.userAgent,!/Chrome|Android|CriOS|FxiOS|EdgiOS/i.test(it)&&/Safari/i.test(it)),nt.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),nt.getElement=function(t){return nt.isElement(t)?t:t&&nt.isFunction(t.getElement)?t.getElement():null},nt.isElement=function(t){return!!t&&1===t.nodeType},nt.isEmpty=function(t,e){return null==t||void 0===t||!e&&""===t||nt.isArray(t)&&0===t.length},nt.isNumber=function(t){return"number"==typeof t&&isFinite(t)},nt.isString=function(t){return"string"==typeof t},nt.isArray=Array.isArray,nt.isFunction=function(t){return"function"==typeof t},nt.getClientPosition=function(t,e){var i=e||{};if(t.getBoundingClientRect){var n=t.getBoundingClientRect();i.x=n.left,i.y=n.top}else i.x=t.clientX,i.y=t.clientY;return i},nt.getRelativePosition=function(t,e,i){i=nt.getClientPosition(t,i);var n=nt.getClientPosition(e);return i.x-=n.x,i.y-=n.y,i},nt.moveArrayItem=function(t,e,i){if(!t)return null;var n=t.length;if(e>=n&&i>=n)return t;var o=t.splice(e,1)[0];return i<n?t.splice(i,0,o):t[i]=o,t},nt.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 n=0,o=0;n<i;)o+=1e5,Array.prototype.push.apply(t,e.slice(n,o)),n=o;return t},nt.insertEmptyItems=function(t,e,i){if(i>0)if(i>1){var n=t.slice(e);t.length=e,t.length+=i,nt.pushArrayItems(t,n)}else t.splice(e,0,null)},nt.cycleArray=function(t,e){if(e>0&&t&&e<t.length){var i=t.splice(0,e);return t.concat(i)}return t||null},nt.lowerBound=function(t,e,i,n,o){(null==i||i<0)&&(i=0),(null==n||n<0||n>t.length)&&(n=t.length),i>n&&(i=n),null==o&&(o=nt._defaultLessComparator);for(var r=0;n>i;)o(t[r=i+n>>1],e)?i=r+1:n=r;return i},nt.upperBound=function(t,e,i,n,o){for(var r=nt.lowerBound(t,e,i,n,o);t[r]===e;)++r;return r},nt.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}))},nt._defaultLessComparator=function(t,e){return t<e},nt._deprecatedFunction=function(){console.warn("Calling deprecated method")},nt.calculatePercent=function(t,e,i){if(!t&&0!==t||!e&&0!==e||!i&&0!==i)return NaN;if(i===t)return 50;var n=(e-t)/(i-t);return n<0?0:n>1?100:100*n},nt.closestElement=function(t,e){for(var i=t;i;){if(i.classList&&i.classList.contains(e))return i;i=i.parentNode||i.host}return null},nt._preventDefault=function(t){t.preventDefault(),t.stopPropagation()};var ot=nt,rt=function(t){this.dispatch=this.dispatch.bind(this),this._listeners=[],this.setSender(t)};rt.prototype.listen=function(t,e){if(t&&ot.isFunction(t)&&this._listeners.indexOf(t)<0)if(null==e)this._listeners.push(t);else{t._priority=e;var i=ot.lowerBound(this._listeners,t,0,this._listeners.length,rt.listenerComparer);this._listeners.splice(i,0,t)}},rt.prototype.unlisten=function(t){if(t){var e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}},rt.prototype.unlistenAll=function(){this._listeners.length=0},rt.prototype.getListenerCount=function(){return this._listeners.length},rt.prototype.hasListener=function(){return this._listeners.length>0},rt.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);null!==this._sender&&(t.sender=null),this._dispatching=!1}},rt.prototype.isDispatching=function(){return this._dispatching},rt.prototype.isEnabled=function(){return this._enabled},rt.prototype.enable=function(t){this._enabled=!1!==t},rt.prototype.disable=function(t){this._enabled=!1===t},rt.prototype.setSender=function(t){this._sender=t||null},rt.prototype.setEventArgExtender=function(t){this._extender=null!=t?t:null},rt.listenerComparer=function(t,e){return null==e._priority||t._priority>=e._priority},rt.prototype._listeners=null,rt.prototype._sender=null,rt.prototype._extender=null,rt.prototype._enabled=!0,rt.prototype._dispatching=!1,rt._proto=rt.prototype;var st=rt,lt=function(){};lt.prototype._customEvents=null,lt.prototype.listen=function(t,e,i){this._customEvents&&this._customEvents[t]&&this._customEvents[t].listen(e,i)},lt.prototype.unlisten=function(t,e){this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlisten(e)},lt.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()},lt.prototype._addEvent=function(t){t&&(this._customEvents||(this._customEvents={}),this._customEvents[t]||(this._customEvents[t]=new st(this)))},lt.prototype._addEvents=function(t){for(var e=Array.isArray(t)?t:arguments,i=e.length,n=0;n<i;++n)this._addEvent(e[n])},lt.prototype._isEventDispatching=function(t){var e=this._customEvents[t];return!!e&&e.isDispatching()},lt.prototype._disableEvent=function(t,e){var i=this._customEvents[t];i&&i.disable(e)},lt.prototype._hasListener=function(t){return!(!this._customEvents||!this._customEvents[t])&&this._customEvents[t].hasListener()},lt.prototype._dispatch=function(t,e){this._customEvents[t].dispatch(e)},lt._proto=lt.prototype;var at=lt,ut=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")};s.inherits(ut,at),ut.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._quotes2=null},ut.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))},ut.prototype.getSubscriptions=function(){return this._quotes2},ut.prototype.addSubscription=function(t,e,i){if(!this.getSubscription(t.id)){var n={s:t,rics:{}};this._subs[t.id]=n,this._quotes2||(t.onNewRow(this._onInsert),t.onUpdate(this._onUpdate),t.onRemoveRow(this._onDelete)),e&&(n.primary=e,i||(i={}),this._onInsert(t,e,i))}},ut.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 n in i)this.setRowData(e+n,null);delete this._subs[e]}},ut.prototype.startAllSubscriptions=function(){if(this._quotes2)this._quotes2.start();else for(var t in this._subs)this._subs[t].s.start()},ut.prototype.stopAllSubscriptions=function(){if(this._quotes2)this._quotes2.stop();else for(var t in this._subs)this._subs[t].s.stop()},ut.prototype.getSubscription=function(t){return this._subs[t]?this._subs[t].s:null},ut.prototype.getPrimaryRic=function(t){var e=this._subs[t];return e?e.primary:""},ut.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})},ut.prototype.clearColumnData=function(t,e){for(var i="string"==typeof t?[t]:t,n=i.length;--n>=0;){var o=i[n];if(o)for(var r in this._rows)delete this._rows[r][o]}e||this._dispatchDataChange({globalChange:!0})},ut.prototype.getData=function(t,e){var i=this.getRowData(t);return i?i[e]:null},ut.prototype.getAllRics=function(){var t={};for(var e in this._subs){var i=this._subs[e].rics;for(var n in i)t[n]||(t[n]=[]),t[n].push(e)}return t},ut.prototype.getAllRowIds=function(){var t=[];for(var e in this._rows)t.push(e);return t},ut.prototype.hasRowId=function(t){return!!this._rows[t]},ut.prototype.getColumnData=function(t){var e=[];for(var i in this._rows)e.push(this._rows[i][t]);return e},ut.prototype.getRowData=function(t){return this._rows[t]||null},ut.prototype.getMultipleRowData=function(t,e,i){var n=t.length;null==i&&(i=n),i>n&&(i=n),e>0||(e=0);for(var o=new Array(n),r=this._rows,s=e;s<i;++s)o[s]=r[t[s]]||null;return o},ut.prototype.getAllRowData=function(){var t=[],e=this._rows;for(var i in e)t.push(e[i]);return t},ut.prototype.setData=function(t,e,i){var n={};return n[e]=i,this.setRowData(t,n)},ut.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},ut.prototype.setRowData=function(t,e,i){var n=this.getRowData(t),o=!1,r=null;if(e)if(n){for(var s in e)n[s]=e[s],o=!0;r=e}else n=e,this._rows[t]=n,o=!0;else n&&(delete this._rows[t],o=!0);if(o&&!this._composing){var l=i||{};l.rid=t,r&&(l.changes=r),l.rowData=n,this._dispatchDataChange(l)}return o},ut.prototype.cloneRowData=function(t){var e=this._rows[t];if(!e)return null;var i={};for(var n in e)0!==n.indexOf("FREE_TEXT")&&(i[n]=e[n]);return i},ut.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},ut.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]])},ut.prototype.resetStaticFields=function(){this._staticFields={}},ut.prototype.getStaticFields=function(){return this._staticFields},ut.prototype.dump=function(t){return ut.constructTable(this.getAllRowData(),t,Object.keys(this._rows))},ut.prototype.log=function(t){console.table(this.dump(t))},ut.prototype.setDataCloudSettings=function(t,e,i,n){null!=t&&(this._userId=t),null!=e&&(this._productId=e),null!=i&&(this._adcUrl=i),n&&(this._lang=n)},ut.prototype.getDataCloudFields=function(){return this._adcFields},ut.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 n=this.getAllRics();return this._batchRequestDataCloud(n,e),!0},ut.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},ut.prototype._dispatchDataChange=function(t){this._composing||(this._composing=!0,this._dispatch("dataComposed",t),this._composing=!1,this._dispatch("dataChanged",t))},ut._defaultPropertyGetter=function(t,e,i){var n=e[i];return n?n[t]:null},ut._defaultGetter=function(t,e){return t[e]},ut.constructTable=function(t,e,i){var n=0,o=t.length,r=o,s=null,l=i||null,a=ut._defaultGetter,u=!1;if(e){if(e.rowCount&&(r=e.rowCount,u=!0),e.colNames){s={};for(var h=e.colNames.length,p=0;p<h;++p)s[e.colNames[p]]=!0;u=!0}e.getter&&(a="string"==typeof e.getter?ut._defaultPropertyGetter.bind(null,e.getter):e.getter,u=!0),e.startIndex&&(n=e.startIndex,u=!0),!1===e.withRowIds&&(l=null)}if(!u&&!l)return t;for(var d=[],c=n;c<o&&!(d.length>=r);++c){var _,f=t[c],g=l?{rid:l[c]}:{};if(f)if(s)for(_ in s)null!=f[_]&&(g[_]=a(f,_));else for(_ in f)g[_]=a(f,_);d.push(g)}return d},ut.prototype._insertRic=function(t,e,i){var n=t+(e=e.replace("0#",""));this._onADCForNewRic(t,e);var o=this.getRowData(n);if(o){var r=o.ROW_DEF;r&&r.isChain()&&(i.SUB_ID=t)}else{var s=i;for(var l in i={},s)i[l]=s[l];i.SUB_ID=t,i.RIC=e}this.setRowData(n,i)},ut.prototype._onQ2DataChanged=function(t){var e=t.subId,i=t.ric,n=t.values;n?this._insertRic(e,i,n):(delete this._subs[e].rics[i],this.setRowData(e+i,null))},ut.prototype._onQ2SubAdded=function(t){for(var e=t.subs,i=t.duplicateSubIds,n=e.length,o=0;o<n;++o){var r=e[o],s=r.ric;if(!(r.id.indexOf("_ci_")>=0)&&(this.addSubscription(r,s),i)){var l=i[o];l&&window.setTimeout(this._onDuplicateRic.bind(this,r.id,this.getRowData(l+s)),10)}}},ut.prototype._onQ2SubRemoved=function(t){for(var e=t.subs,i=e.length,n=0;n<i;++n){var o=e[n];o.id.indexOf("_ci_")>=0||this.removeSubscription(o)}},ut.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)},ut.prototype._onDuplicateRic=function(t,e){var i=this._subs[t];if(i){var n=(i=i.s).ric,o=e.SUB_ID,r=this._cloneRowData(e,n,t);if(r){this._onInsert(i,n,r);var s=i.children;if(s)for(var l=s.length,a=0;a<l;++a)n=s[a],r=this._cloneRowData(o,n,t),this._onInsert(i,n,r)}}},ut.prototype._onInsert=function(t,e,i){var n=t.id;this._quotes2?this._insertRic(n,e,i):(this._onADCForNewRic(n,e),this.setRowData(n+e,i,{subscription:t,ric:e}))},ut.prototype._onUpdate=ut.prototype._onInsert,ut.prototype._onDelete=function(t,e,i){delete this._subs[t.id].rics[e],this.setRowData(t.id+e,null,{subscription:t,ric:e})},ut.prototype._addDataCloudField=function(t,e){this._adcRefMap[t]?++this._adcRefMap[t]:(this._adcFields.push(t),e.push(t),this._adcRefMap[t]=1)},ut.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 n=i.cols,o=i.rows,r=o[0],s=-1,l={},a=0;a<n;++a){var u=r[a];"instrument"===u.i?s=a:u.r&&(l[u.r]=a)}for(var h=o.length,p=1;p<h;++p){var d=o[p],c=d[s],_={};for(var f in l){var g=d[l[f]];null!=g&&null!==g&&null==g.f&&(this._quotes2?(_[f]=g,_[f+"_FORMATTED"]=g):_[f]={formatted:g+"",raw:g})}var y=e.ricMap[c];if(y)for(a=y.length;--a>=0;){var m=y[a];this._subs[m]&&this.setRowData(m+c,_)}}}},ut.prototype._onADCError=function(t){window.console.log(t)},ut.prototype._onBatchRequestADCData=function(t){this._adcTimerId<=0||(this._adcTimerId=-1,this._batchRequestDataCloud(this._adcRicMap,this._adcFields),this._adcRicMap=null)},ut.prototype._batchRequestDataCloud=function(t,e){if(!this._adcUrl)return null;var i=[];for(var n in t)i.push(n);for(;i.length>30;)this._requestDataCloud(t,e,i.splice(0,30));return this._requestDataCloud(t,e,i)},ut.prototype._requestDataCloud=function(t,e,i){if(!i||i.length<=0)return null;if(!e||e.length<=0)return null;var n=new XMLHttpRequest;n.onload=this._onADCUpdate,n.onerror=this._onADCError,n.ricMap=t,n.open("POST",this._adcUrl,!0),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded");var o="formula="+e+"&identifiers="+i;return this._productId&&(o+="&productid="+this._productId),this._userId&&(o+="&uuid="+this._userId),this._lang&&(o+="&lang="+this._lang),n.send(o),n},ut.prototype._cloneRowData=function(t,e,i){var n="string"==typeof t?t:t.SUB_ID,o=this._rows[n+e];if(!o){if("object"!=typeof t)return null;o=t}var r={};for(var s in o)null==this._staticFields[s]&&(r[s]=o[s]);return r.SUB_ID=i,r},ut.prototype._rows,ut.prototype._subs,ut.prototype._quotes2=null,ut.prototype._staticFields=null,ut.prototype._adcFields=null,ut.prototype._adcRefMap=null,ut.prototype._adcTimerId=-1,ut.prototype._adcRicMap=null,ut.prototype._adcUrl="/datacloud/rest/select",ut.prototype._userId="",ut.prototype._productId="",ut.prototype._composing=!1,ut.prototype._lang="",ut._proto=ut.prototype;var ht=ut,pt=function(t,e){this._rid=t,this._children={},this._shared=e};s.inherits(pt,a),pt._subSegSortLogic=function(t,e){return"Uncategorized"===t?1:"Uncategorized"===e||t<e?-1:e<t?1:0},pt._assignSubSegmentOrder=function(t,e){t.setOrder(e+1)},pt.prototype._shared=null,pt.prototype._rid,pt.prototype._children,pt.prototype._childCount=0,pt.prototype._collapsed=!1,pt.prototype._order=0,pt.prototype._disposed=!1,pt.prototype._subSegDef=null,pt.prototype._subSegLevel=0,pt.prototype._subSegMap=null,pt.prototype._subSegNames=null,pt.prototype._subSegName="",pt.prototype._subSegVal,pt.prototype._subSegParent=null,pt.prototype.dispose=function(){if(!this._disposed){this._disposed=!0,this.removeAllEventListeners();var t=this._subSegNames;if(t){for(var e=t.length,i=this._subSegMap,n=0;n<e;++n)i[t[n]].dispose();this._subSegMap=this._subSegNames=null}this._collapsed&&(this._shared.dirtyCollapsingState=!0),this._shared=null,this._subSegParent=this._subSegDef=this._subSegVal=null}},pt.prototype.getId=function(){return this._rid},pt.prototype.getParentId=function(){return this._subSegParent?this._subSegParent.getId():""},pt.prototype.getSubSegmentIds=function(t){var e=this._subSegNames;if(e){t||(t=[]);for(var i=e.length,n=this._subSegMap,o=0;o<i;++o){var r=n[e[o]];t.push(r.getId()),r.getSubSegmentIds(t)}return t}return null},pt.prototype.addChild=function(t,e){if(t){if(this._shared.childToSegment[t]=this._rid,!this._children[t])return this._collapsed&&(this._shared.dirtyCollapsingState=!0),this._children[t]=e||t,++this._childCount,!0;this._children[t]=e||t}return!1},pt.prototype.addChildren=function(t,e){var i,n=Array.isArray(t)?t:[t],o=n.length,r=0;if(null!=e)for(e=Array.isArray(e)?e:[e],i=0;i<o;++i)r|=this.addChild(n[i],e[i]);else for(i=0;i<o;++i)r|=this.addChild(n[i]);return!!r},pt.prototype.containsChild=function(t){return!!this._children[t]},pt.prototype.removeChild=function(t){return!this._subSegLevel&&(!!this._childCount&&(!!this._children[t]&&(delete this._shared.childToSegment[t],delete this._children[t],--this._childCount,this._collapsed&&(this._shared.dirtyCollapsingState=!0),!0)))},pt.prototype.removeChildren=function(t){if(this._subSegLevel)return!1;if(!this._childCount)return!1;for(var e=Array.isArray(t)?t:[t],i=e.length,n=0,o=0;o<i;++o)n|=this.removeChild(e[o]);return!!n},pt.prototype.removeAllChildren=function(){if(this._subSegLevel)return!1;if(!this._childCount)return!1;var t=this._shared.childToSegment,e=this._children;for(var i in e)t[i]&&delete t[i];return this._children={},this._childCount=0,this._collapsed&&(this._shared.dirtyCollapsingState=!0),!0},pt.prototype.getChildIds=function(){return this._childCount?Object.keys(this._children):[]},pt.prototype.getChildren=function(){return this._children},pt.prototype.getChildCount=function(){return this._childCount},pt.prototype.getClassification=function(){return this._subSegDef&&this._subSegDef.classifiers||null},pt.prototype.setClassification=function(t){if(this._subSegLevel)return!1;var e=null;this._subSegDef&&(e=this._subSegDef.classifiers);var i,n=null;t&&("string"==typeof t?n=[t]:Array.isArray(t)&&(n=t));var o=n?n.length:0;if(o){if((e?e.length:0)===o){for(i=0;i<o&&n[i]===e[i];++i);if(i>=o)return!1}return this._subSegDef||(this._subSegDef={root:this,subSegments:null}),this._subSegDef.classifiers=n,!0}return!!e&&(this._subSegDef.classifiers=null,this._subSegDef.subSegments=null,this._subSegDef=null,!0)},pt.prototype.classify=function(t){var e=this._subSegDef?this._subSegDef.classifiers:null,i=e?e.length:0,n=this._subSegNames,o=n?n.length:0;if(!o&&this._subSegLevel>=i)return!1;var r,s=this._shared;this._collapsed&&(s.dirtyCollapsingState=!0);var l="",a={},u=0,h=this._subSegMap,p=null;if(o)for(u=o,r=0;r<u;++r)a[l=n[r]]=1,(p=h[l])._childCount&&(p._children={},p._childCount=0),p._collapsed&&(s.dirtyCollapsingState=!0);var d,c=!this._subSegLevel,_=this._children;if(this._subSegLevel<i&&t){h||(h=this._subSegMap={},n=this._subSegNames=[]);var f=e[this._subSegLevel];for(d in _){var g=_[d],y=t[g],m=y?y[f]:null;s.childToSegment[d]=this._rid,l="Uncategorized",(m||0===m||!1===m)&&(l=m+""),a[l]&&(a[l]=0,--u),(p=h[l])||((p=new pt(this._rid+"/"+l,s))._subSegDef=this._subSegDef,p._subSegLevel=this._subSegLevel+1,p._subSegName=l,p._subSegVal=m,p._subSegParent=this,h[l]=p,n.push(l),this._dispatch("subSegmentAdded",{rid:p.getId(),segment:p})),p.addChild(d,g)}}else if(c)for(d in _)s.childToSegment[d]=this._rid;if(u>0){for(l in u>=n.length&&(n.length=0),a)if(a[l]){p=h[l],delete h[l];var C=n.indexOf(l);C>=0&&n.splice(C,1),this._dispatch("subSegmentRemoved",{rid:p.getId(),segment:p})}n.length||(n=this._subSegMap=this._subSegNames=null)}if(o=n?n.length:0)for(n.sort(pt._subSegSortLogic),r=0;r<o;++r)(p=h[n[r]]).classify(t);if(c&&this._subSegDef)if(o){var v=this._subSegDef.subSegments=[];this.getAllSubSegments(v),v.forEach(pt._assignSubSegmentOrder)}else this._subSegDef.subSegments=null;return!0},pt.prototype.hasSubSegments=function(){return!!this._subSegNames&&!!this._subSegNames.length},pt.prototype.isSubSegment=function(){return!!this._subSegLevel},pt.prototype.getFirstAncestor=function(){return this._subSegLevel&&this._subSegDef&&this._subSegDef.root||null},pt.prototype.getAllSubSegments=function(t){var e=this._subSegNames;if(e){t||(t=[]);for(var i=this._subSegMap,n=e.length,o=0;o<n;++o){var r=i[e[o]];t.push(r),r.getAllSubSegments(t)}}return t||null},pt.prototype.getSegmentLevel=function(){return this._subSegLevel},pt.prototype.setRowData=function(t,e){if(t){var i=t[this._rid];i||(i=t[this._rid]={}),e||(e=t),(i=e[this._rid])||(i=e[this._rid]={});for(var n=this;n&&n.isSubSegment();)n.getSubSegmentName(i),n=n._subSegParent}},pt.prototype.getSubSegmentName=function(t){if(t&&this._subSegLevel){var e=this.getClassification()[this._subSegLevel-1];e&&(t[e]=this._subSegName)}return this._subSegName},pt.prototype.collapse=function(t){return t=!1!==t,this._collapsed!==t&&(this._collapsed=t,this._shared.dirtyCollapsingState=!0,!0)},pt.prototype.expand=function(t){return this.collapse(!1===t)},pt.prototype.isCollapsed=function(){return this._collapsed},pt.prototype.getCollapsingStates=function(t,e){var i=this._subSegNames;if(!this._subSegLevel&&!i&&!this._collapsed)return!1;t||(t={});var n=!1;if(this._subSegLevel&&e&&(t[this._rid]=!0,n=!0),this._childCount){var o=e||this._collapsed;if(i)for(var r=this._subSegMap,s=i.length,l=0;l<s;++l){var a=r[i[l]];t[a.getId()]=!!e,a.getCollapsingStates(t,o)&&(n=!0)}else if(o){var u=this._children;for(var h in u)t[h]=o;n=!0}}return n},pt.prototype.getOrder=function(){if(this._subSegLevel){var t=this.getFirstAncestor();if(t)return t.getOrder()+this._order}return 1e4*this._order},pt.prototype.getLastOrder=function(){if(this._subSegDef){var t=this._subSegDef.subSegments;if(t){var e=t[t.length-1];if(e)return e.getOrder()}}return this.getOrder()},pt.prototype.setOrder=function(t){this._order=t},pt._tabs=null,pt.prototype.log=function(t){var e,i=pt._tabs;if(!i){i=pt._tabs=[];var n="";for(e=0;e<11;++e)i[e]=n,n+=" "}var o=this._collapsed?"+ ":"- ";t.push(i[this._subSegLevel]+o+this._rid);var r=this._subSegNames;if(r){var s=r.length,l=this._subSegMap;for(e=0;e<s;++e)l[r[e]].log(t)}else if(this._childCount){var a=i[this._subSegLevel+1];for(var u in this._children)t.push(a+"- "+u)}return t};var dt=pt,ct=function(){this._onSubSegmentAdded=this._onSubSegmentAdded.bind(this),this._onSubSegmentRemoved=this._onSubSegmentRemoved.bind(this),this._segments={},this._insertionList=[],this._removalList=[],this._shared={childToSegment:{},dirtyCollapsingState:!1}};s.inherits(ct,a),ct.prototype._segments,ct.prototype._segmentCount=0,ct.prototype._collapsedRids=null,ct.prototype._shared,ct.prototype._segmentList=null,ct.prototype._insertionList=null,ct.prototype._removalList=null,ct.prototype._classification=!1,ct.prototype._classifierChanged=!1,ct.prototype.dispose=function(){this.removeAllSegments(),this.removeAllEventListeners(),this._collapsedRids=null,this._segmentList=this._insertionList=this._removalList=null},ct.prototype.addSegment=function(t,e){if(t&&!this._segments[t]){if(this.getParentRowId(t))return console.log("child of a segment cannot be set as a segment separator"),!1;var i=this._segments[t]=new dt(t,this._shared);return i.addEventListener("subSegmentAdded",this._onSubSegmentAdded),i.addEventListener("subSegmentRemoved",this._onSubSegmentRemoved),++this._segmentCount,this._segmentList=null,e&&e.length&&i.addChildren(e),!0}return!1},ct.prototype.addSegments=function(t){for(var e=Array.isArray(t)?t:[t],i=e.length,n=0,o=0;o<i;++o)n|=this.addSegment(e[o]);return!!n},ct.prototype.containsSegment=function(t){return!!this._segments[t]},ct.prototype.getParentRowId=function(t){return this._shared.childToSegment[t]||""},ct.prototype.removeSegment=function(t){var e=this._segments[t];if(e){if(this._segmentCount<=1)return this.removeAllSegments();e.isSubSegment()&&this._removalList.push(e.getId());var i=e.getSubSegmentIds();if(i)for(var n=i.length,o=0;o<n;++o){var r=i[o];this._segments[r]&&(this._removalList.push(r),delete this._segments[r],--this._segmentCount)}return e.removeAllChildren(),e.dispose(),delete this._segments[t],--this._segmentCount,!0}return!1},ct.prototype.removeAllSegments=function(){if(this._segmentCount){for(var t in this._segments)this._segments[t].dispose();return this._segments={},this._segmentCount=0,this._segmentList=null,this._shared.childToSegment={},this._classification=this._classifierChanged=!1,!0}return!1},ct.prototype.getSegmentCount=function(){return this._segmentCount},ct.prototype.getSegment=function(t){return this._segments[t]||null},ct.prototype.getSegmentParent=function(t){var e=this.getParentRowId(t);return e?this.getSegment(e):null},ct.prototype.getSegments=function(){return this._segmentCount?this._segments:null},ct.prototype.getSegmentIds=function(){return Object.keys(this._segments)},ct.prototype.collapseSegment=function(t,e){var i=this._segments[t];return!!i&&i.collapse(e)},ct.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},ct.prototype.expandAllSegments=function(){if(this._segmentCount){var t=this._segments,e=0;for(var i in t)e|=t[i].expand();if(e)return!0}return!1},ct.prototype.isCollapsedSegment=function(t){var e=this._segments[t];return!!e&&e.isCollapsed()},ct.prototype.getCollapsedRows=function(){if(this._shared.dirtyCollapsingState){this._shared.dirtyCollapsingState=!1;var t=null,e=0;if(this._segmentCount){var i=this._segments;for(var n in t={},i){var o=i[n];o.isSubSegment()||o.getCollapsingStates(t)&&++e}}this._collapsedRids=e?t:null}return this._collapsedRids},ct.prototype.addSegmentChild=function(t,e,i){var n=this._segments[t];return!(!n||n.isSubSegment())&&n.addChild(e,i)},ct.prototype.addSegmentChildren=function(t,e,i){var n=this._segments[t];return!(!n||n.isSubSegment())&&n.addChildren(e,i)},ct.prototype.containsSegmentChild=function(t,e){var i=this._segments[t];return!!i&&i.containsChild(e)},ct.prototype.removeSegmentChild=function(t,e){var i=this._segments[t];return!!i&&i.removeChild(e)},ct.prototype.removeSegmentChildren=function(t,e){var i=this._segments[t];return!!i&&i.removeChildren(e)},ct.prototype.removeAllSegmentChildren=function(){this._shared.childToSegment={};var t=this._segments,e=!1;for(var i in t){t[i].removeAllChildren()&&(e=!0)}return e&&this.classify(null),e},ct.prototype.fillSegment=function(t,e){var i=Array.isArray(e)?e.length:0;if(i){var n=this._segments,o=n[t];if(o&&!o.isSubSegment()){var r=e.indexOf(t);if(r>=0){o.removeAllChildren();for(var s=r+1;s<i;++s){var l=e[s];if(n[l])break;o.addChild(l)}}}}},ct.prototype.fillSegments=function(t){this._shared.childToSegment={};for(var e=Array.isArray(t)?t.length:0,i=this._segments,n=null,o=!1,r=0;r<e;++r){var s=t[r],l=i[s];l&&!l.isSubSegment()?(n=l).removeAllChildren():n&&!n.isSubSegment()&&(n.addChild(s),o=!0)}return o},ct.prototype.calcSegmentOrder=function(t){var e=this._segmentList;e?e.length=0:e=this._segmentList=[];for(var i=t?t.length:0,n=this._segments,o=this._segmentCount,r=0,s=0;s<i;++s){var l=n[t[s]];if(l&&(l.isSubSegment()||(this._segmentList.push(l),l.setOrder(++r)),--o<=0))break}},ct.prototype.getSegmentValues=function(t,e){var i=t?t.length:0;if(!i)return null;for(var n=this._segments,o=this._shared.childToSegment,r=null,s=null,l=new Array(i),a=0,u=-10,h=0,p=0;p<i;++p){var d=t[p];if(r=n[d])a=100*r.getOrder(),h=0,r.isSubSegment()||s!==r&&(s=r,u=100*r.getLastOrder());else{var c=o[d];c?(a=100*(r=n[c]).getOrder(),h=1,e&&(u=100*r.getLastOrder())):u?(a=u,h=10):a=h=0}l[p]=a+h}return s?l:null},ct.prototype.logStructure=function(){var t=this._segmentList;if(!t)return"";for(var e=t.length,i=[],n=0;n<e;++n)t[n].log(i);return i.join("\n")},ct.prototype.logRowIdMap=function(){var t=[],e=this._shared.childToSegment;for(var i in e){var n=e[i];t.push(i+" > "+n)}return t.join("\n")},ct.prototype.setSegmentClassification=function(t,e){var i=this._segments[t];return!(!i||!i.setClassification(e))&&(i.getClassification()&&(this._classification=!0),this._classifierChanged=!0,!0)},ct.prototype.hasClassification=function(){return this._classification||this._classifierChanged},ct.prototype.classify=function(t){if(!this._segmentCount)return!1;if(!this.hasClassification())return!1;this._classification=this._classifierChanged=!1;var e=this._segments;for(var i in e){var n=this._segments[i];n.isSubSegment()||(n.getClassification()&&(this._classification=!0),n.classify(t))}return this._insertionList.length||this._removalList.length?(this._dispatch("subSegmentChanged",{insertionList:this._insertionList,removalList:this._removalList}),this._insertionList.length=0,this._removalList.length=0,this._dispatch("classified",{}),!0):(this._dispatch("classified",{}),!1)},ct.prototype._onSubSegmentAdded=function(t){var e=t.rid;if(this._segments[e])console.log("Incorrect logic detected.");else{var i=t.segment;this._insertionList.push(i),this._segments[e]=i,this._segmentCount++,i.addEventListener("subSegmentAdded",this._onSubSegmentAdded),i.addEventListener("subSegmentRemoved",this._onSubSegmentRemoved)}},ct.prototype._onSubSegmentRemoved=function(t){var e=t.rid;this.removeSegment(e)};var _t=ct,ft=function(){ft.base(this,"constructor"),this._removeRows=this._removeRows.bind(this),this._bySegmentSeparator=this._bySegmentSeparator.bind(this),this._onClassifyingTimer=this._onClassifyingTimer.bind(this),this._onSubSegmentChanged=this._onSubSegmentChanged.bind(this),this._prevData={},this._rids=[],this._compMap={},this._addEvent("subSegmentChanged")};s.inherits(ft,ht),ft.prototype._prevData=null,ft.prototype._rids,ft.prototype._frozen=!1,ft.prototype._runningId=0,ft.prototype._compMap=null,ft.prototype._segments=null,ft.prototype._autoSegmentFilling=!1,ft.prototype._removedRows=null,ft.prototype._userSegmentComparer=null,ft.prototype._segmentSortOrder=0,ft.prototype._segmentSortContext=null,ft.prototype._clsSource=null,ft.prototype._classifyingTimer=0,ft.SortLogic,ft.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._classifyingTimer&&(clearTimeout(this._classifyingTimer),this._classifyingTimer=0),this._compMap=null,this._clsSource=null,ft._removeIndexArray(),this._segments&&(this._segments.dispose(),this._segments=null)},ft.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},ft.prototype.getRowId=function(t){return this._rids[t]||""},ft.prototype.getAllRowIds=function(t){return t?this._rids:this._rids.slice(0)},ft.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},ft.prototype.getRowCount=function(){return this._rids.length},ft.prototype.getDataAt=function(t,e){return this.getData(this._rids[t],e)},ft.prototype.getRowDataAt=function(t){return this.getRowData(this._rids[t])},ft.prototype.getPreviousData=function(t,e){var i=this._prevData[t]||null;return i?i[e]:null},ft.prototype.setData=function(t,e,i){if(!this._needFiring())return this._setData(t,e,i);var n={};return n[e]=i,this.setRowData(t,n)},ft.prototype._removeRidFromSegments=function(t){if(this._segments)if(this._segments.getSegment(t)){if(this._segments.removeSegment(t))return this._segments.getSegmentCount()||(this._segments.dispose(),this._segments=null),!0}else{var e=this._segments.getParentRowId(t);e&&this._segments.removeSegmentChild(e,t)}return!1},ft.prototype.setRowData=function(t,e,i){if(!t)return!1;var n=this.getRowData(t),o=!1,r="updated",s=!1;if(e){if(n){var l=this._prevData[t];for(var a in e)l[a]=n[a],n[a]=e[a]}else if(r="inserted",n=e,this._rows[t]=n,this._prevData[t]={},i){var u=i.nextRid,h=u?this.getRowIndex(u):-1;h<0&&(h=i.fallback),null==h||h<0||h>=this._rids.length?this._rids.push(t):(this._rids.splice(h,0,t),s=!this._isLastSegment(h))}else this._rids.push(t);o=!0}else n&&(r="removed",this._prevData[t]=this._rows[t],delete this._rows[t],s=this._removeRidFromSegments(t),ft._removeArrayItem(this._rids,t),o=!0);if(o&&this._needFiring()){if(this._autoFillSegments())this.dispatchGlobalChange();else{var p=i||{};p.rid=t,p.changes=e,p.rowData=n,p.type=r,s&&(p.segmentChanged=!0),this._dispatchDataChange(p)}this.requestClassifying()}return o},ft.prototype.setColumnData=function(t,e,i){var n=e?e.length:0;if(!(n<0)){var o=this._frozen;this.freeze();for(var r=this._generateRids(n,i),s=0;s<n;++s)this._setData(r[s],t,e[s]);this.freeze(o)}},ft.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)}},ft.prototype.setDataFrom2DArray=function(t,e,i){var n=t?t.length:0;if(!(n<0)){var o=this._frozen;this.freeze();for(var r=0,s=this._generateRids(n,i),l=0;l<n;++l){var a=t[l],u=s[l];if(e)for(r=a.length;--r>=0;)this._setData(u,e[r],a[r]);else for(r=a.length;--r>=0;)this._setData(u,""+r,a[r])}this.freeze(o)}},ft.prototype.setDataAt=function(t,e,i){var n=this.getRowId(t);return!!n&&this.setData(n,e,i)},ft.prototype.setRowDataAt=function(t,e,i){var n=this.getRowId(t);return!!n&&this.setRowData(n,e,i)},ft.prototype.addRow=function(t,e){return t||(t={}),e=this._generateUniqueRid(t,e),this.setRowData(e,t),e},ft.prototype.addRows=function(t,e){if(Array.isArray(t)){var i=t.length;if(i)if(1!==i){e||(e=[]);var n=this._frozen;this.freeze();for(var o=0;o<i;++o)this.addRow(t[o],e[o]);this.freeze(n)}else this.addRow(t[0],e?e[0]:null)}},ft.prototype.unshiftRow=function(t,e){return this.insertRow(0,t,e)},ft.prototype.insertRow=function(t,e,i){var n=null;return"number"==typeof t?((n={}).nextRid=this._rids[t],n.fallback=t):t&&((n={}).nextRid=t),e||(e={}),i=this._generateUniqueRid(e,i),this.setRowData(i,e,n),i},ft.prototype.insertAfter=function(t,e,i){var n="string"==typeof t?this.getRowIndex(t):t;return!(n>=0)||n>=this._rids.length-1?this.addRow(e,i):this.insertRow(n+1,e,i)},ft.prototype.removeRow=function(t){"number"==typeof t?this.setRowData(this.getRowId(t),null):this.setRowData(t,null)},ft.prototype.removeRows=function(t){if(1!==t.length){var e,i=!1;for(this._removedRows={},e=t.length;--e>=0;){"number"==typeof(n=t[e])&&(n=this.getRowId(n)),this.getRowData(n)&&(this._prevData[n]=this._rows[n],this._removedRows[n]=1,delete this._rows[n],this._removeRidFromSegments(n),i=!0)}i?(this._rids=this._rids.filter(this._removeRows),this._removedRows=null,this.dispatchGlobalChange()):this._removedRows=null}else{var n=t[0];"number"==typeof n?this.removeRow(n):this.setRowData(n,null)}},ft.prototype._removeRows=function(t){return!this._removedRows[t]},ft._removeArrayItem=function(t,e){var i=t.indexOf(e);return i>=0&&(i>=t.length?t.pop():t.splice(i,1),!0)},ft.prototype.clearAllData=function(t){ft.base(this,"clearAllData",!0),this._prevData={},this._segments&&(this._segments.dispose(),this._segments=null),this._rids.length&&(this._rids.length=0,this.dispatchGlobalChange(t))},ft.prototype.removeAllRows=ft.prototype.clearAllData,ft._ascendingOrder=function(t,e){return t-e},ft.prototype.moveRow=function(t,e,i){var n=null,o="";if(e>=0&&e<this._rids.length||(e=this._rids.length),Array.isArray(t)){var r=t;r.sort(ft._ascendingOrder);for(var s=[],l=r.length;--l>=0;){var a=r[l];(o=this._rids[a])&&(s.unshift(o),this._rids.splice(a,1),a<e&&--e)}s.length&&(this._rids.splice.apply(this._rids,[e,0].concat(s)),n=s)}else t<0&&(t=0),t!==e&&t+1!==e&&(o=this._rids.splice(t,1)[0])&&(t<e&&--e,this._rids.splice(e,0,o),n=o);return n&&(this._segments&&(this._segments.calcSegmentOrder(this._rids),this._sort(null)),this._dispatchPositionChange(i)),n},ft.prototype._moveRow=function(t,e,i){var n=t.length;if(!n)return null;for(var o=new Array(n),r=0;r<n;++r)o[r]=this.getRowIndex(t[r]);var s=e?this.getRowIndex(e):this._rids.length;return n>1?this.moveRow(o,s,i):this.moveRow(o[0],s,i)},ft.prototype.moveRows=function(t,e,i,n){"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 o=t+i-1,r=e;if(e>=t&&(r=e<=o?t:e-i),i>0&&o<=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(n),s}return null},ft.prototype.swapRow=function(t,e){var i=this._rids.length;if(!(t<0||t>=i||e<0||e>=i)){var n=this._rids[t];this._rids[t]=this._rids[e],this._rids[e]=n}},ft.prototype.clearRowData=ft.prototype.removeRow,ft.prototype.clearColumnData=function(t,e){for(var i="string"==typeof t?[t]:t,n=i.length;--n>=0;){var o=i[n];if(o)for(var r in this._rows)delete this._rows[r][o],delete this._prevData[r][o]}this.dispatchGlobalChange(e)},ft.prototype.getDataSource=function(){return null},ft.prototype.setDataSource=function(t){},ft.prototype.getSortingLogics=function(){return this._compMap},ft.prototype.sortOnce=function(t,e,i,n){var o=ft._buildSortContext([],t,e,i||this._compMap,n);return!!this._sort(o)&&(this._dispatchPositionChange(),!0)},ft.prototype.setSortingLogic=function(t){this._compMap._default=t},ft.prototype.setColumnSortingLogic=function(t,e){t&&(this._compMap[t]=e)},ft.prototype.getColumnSortingLogic=function(t){if(t){var e=this._compMap[t];if(e)return e}return this._compMap._default||null},ft.prototype.freeze=function(t){t=!1!==t;var e=this._frozen;return e!==t&&(this._frozen=t,this._autoFillSegments(),this.dispatchGlobalChange()),e},ft.prototype.unfreeze=function(t){return this.freeze(!1===t)},ft.prototype.isFrozen=function(){return this._frozen},ft.prototype.setSegmentSeparator=function(t,e){var i=!1,n=0;if(t&&"string"==typeof t)if(!1!==e){if(this._segments||(this._segments=new _t,this._segments.addEventListener("subSegmentChanged",this._onSubSegmentChanged)),this._autoSegmentFilling){var o=this._segments.getParentRowId(t);o&&this._segments.removeSegmentChild(o,t)}this._segments.addSegment(t)&&(this._segments.calcSegmentOrder(this._rids),i=!0)}else if(this._segments){var r=this._segments.getSegment(t);r&&(n=r.getChildCount(),this._segments.removeSegment(t)&&(i=!0,this._segments.getSegmentCount()||(this._segments=null)))}if(i&&this._needFiring())if(this._autoFillSegments()||n)this.dispatchGlobalChange();else{var s=this._rows[t]||null;s&&this._dispatchDataChange({rid:t,changes:{},rowData:s,type:"updated",segmentChanged:!0})}return i},ft.prototype.unsetAllSegmentSeparators=function(){return!!this._segments&&(this._segments.dispose(),this._segments=null,this.dispatchGlobalChange(),!0)},ft.prototype.hasSegmentation=function(){return!!this._segments},ft.prototype.isSegmentSeparator=function(t){return!!this._segments&&this._segments.containsSegment(t)},ft.prototype.getSegment=function(t){return this._segments?this._segments.getSegment(t):null},ft.prototype.getSegmentParent=function(t){return this._segments?this._segments.getSegmentParent(t):null},ft.prototype.getSegmentLevel=function(t){var e=this.getSegment(t);return e?e.getSegmentLevel()+1:0},ft.prototype.getSegmentParentRowId=function(t){return this._segments?this._segments.getParentRowId(t):""},ft.prototype.getSegmentValues=function(t,e){return this._segments?this._segments.getSegmentValues(t||this._rids,e):null},ft.prototype._isLastSegment=function(t){var e=this._segments;if(e)for(var i=this._rids,n=i.length,o=t+1;o<n;++o)if(e.containsSegment(i[o]))return!1;return!0},ft.prototype._getSegmentSeparators=function(){return this._segments},ft.prototype.enableAutoSegmentFilling=function(t){this._autoSegmentFilling=0!=t,this._autoFillSegments()},ft.prototype._autoFillSegments=function(){return!!this._autoSegmentFilling&&this.fillSegments()},ft.prototype.fillSegment=function(t){this._segments&&(this._segments.fillSegment(t,this._rids),this.dispatchGlobalChange(),this.requestClassifying())},ft.prototype.fillSegments=function(){if(this._segments){var t=this._segments.fillSegments(this._rids);return t&&(this.dispatchGlobalChange(),this.requestClassifying()),t}return!1},ft.prototype.addSegmentChild=function(t,e,i){if(this._segments&&this._segments.addSegmentChild(t,e,i))return this._sort(null),this._dispatchPositionChange(),this.requestClassifying(),!0;return!1},ft.prototype.addSegmentChildren=function(t,e,i){if(this._segments&&this._segments.addSegmentChildren(t,e,i))return this._sort(null),this._dispatchPositionChange(),this.requestClassifying(),!0;return!1},ft.prototype.removeSegmentChild=function(t,e){if(this._segments){var i=this._segments.removeSegmentChild(t,e);return i&&(this.dispatchGlobalChange(),this.requestClassifying()),i}return!1},ft.prototype.removeSegmentChildren=function(t,e){if(this._segments){var i=this._segments.removeSegmentChildren(t,e);return i&&(this.dispatchGlobalChange(),this.requestClassifying()),i}return!1},ft.prototype.removeAllSegmentChildren=function(){if(this._segments){var t=this._segments.removeAllSegmentChildren();return t&&this.dispatchGlobalChange(),t}return!1},ft.prototype.getSegmentIds=function(){return this._segments?this._segments.getSegmentIds():null},ft.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},ft.prototype.sortSeparators=function(t,e,i){var n=!1;if(!this._segments)return!1;if("function"==typeof t)return this.sortSegments(t);var o=ft._buildSortContext([],i,e,t),r=o?o.length:0;if(!r)return n;var s,l,a=0;return r>1?(s=ft._multiColumnSeparatorCompareLogic,l=o,a=1):(s=ft._singleColumnSeparatorCompareLogic,a=(l=o[0])[3]),this._segmentSortOrder=a,this._segmentSortContext=l,n=this.sortSegments(s),this._segmentSortOrder=0,this._segmentSortContext=null,n},ft.prototype.sortSegments=function(t){if(!this._segments)return!1;if("function"!=typeof t)return this._segments.calcSegmentOrder(this._rids),!1;var e,i=this._rids,n=this._segments,o=n.getSegmentCount(),r=[],s=[],l=0,a=i.length,u="",h=null;for(e=0;e<a&&(u=i[e],!((h=n.getSegment(u))&&(s.push(e),r.push(h),++l>=o)));++e);this._userSegmentComparer=t,r.sort(this._bySegmentSeparator),this._userSegmentComparer=null;var p=!1;for(e=0;e<l;++e){var d=s[e];u=i[d];var c=(h=r[e]).getId();u!==c&&(i[d]=c,p=!0)}return!!p&&(this._segments.calcSegmentOrder(i),this._sort(null),this._dispatchPositionChange(),!0)},ft.prototype._bySegmentSeparator=function(t,e){return this._userSegmentComparer(this.getRowData(t.getId()),this.getRowData(e.getId()),this._segmentSortOrder,this._segmentSortContext)},ft.prototype.setClassificationSource=function(t){this._clsSource=null,t&&t._rows&&(this._clsSource=t._rows)},ft.prototype.setSegmentClassification=function(t,e){if(this._segments&&this._segments.setSegmentClassification(t,e))return this.classifySegments();return!1},ft.prototype.classifySegments=function(){return!(!this._segments||!this._rids.length)&&this._segments.classify(this._clsSource||this._rows)},ft.prototype.requestClassifying=function(){this._segments&&!this._classifyingTimer&&this._segments.hasClassification()&&(this._classifyingTimer=setTimeout(this._onClassifyingTimer,10))},ft.prototype._onClassifyingTimer=function(){this._classifyingTimer=0,this.classifySegments()},ft.prototype._onSubSegmentChanged=function(t){var e,i=t.insertionList,n=t.removalList,o=!1,r=this._rows,s=this._clsSource||r,l=this._rids,a=this._prevData,u=n.length,h={};for(e=0;e<u;e++){var p=n[e];r[p]&&(h[p]=a[p]=r[p],delete r[p],ft._removeArrayItem(l,p),o=!0)}var d=i.length;for(e=0;e<d;e++){var c=i[e],_=c.getParentId(),f=c.getId();if(!r[f]){a[f]={},c.setRowData(r,s);var g=l.indexOf(_);g<0||g+1>=l.length?l.push(f):l.splice(g+1,0,f),o=!0}}o&&(t.removedRows=h,this._dispatch("subSegmentChanged",t),this.dispatchGlobalChange())},ft.prototype._sort=function(t){var e=this._rids,i=this.getMultipleRowData(e),n=this.getSegmentValues(e),o=ft._performMultiLevelSorting(i,t,n);return!!o&&(this._rids=ft._reorderItems(e,o),!0)},ft.prototype.dispatchGlobalChange=function(t){!t&&this._needFiring()&&this._dispatchDataChange(ft._globalChangeArg)},ft.prototype._dispatchPositionChange=function(t){!t&&this._needFiring()&&this._dispatch("dataChanged",ft._positionChangeArg)},ft.prototype.dump=function(t){return ht.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},ft.prototype._setData=function(t,e,i){var n=this.getRowData(t);return n||(n={},this._rows[t]=n,this._prevData[t]={},this._rids.push(t)),this._prevData[t][e]=n[e],n[e]=i,!0},ft.prototype._generateRids=function(t,e){var i,n=0;if(e)i=e;else{i=[];for(var o=this._rids.length;n<o&&n<t;)i.push(this._rids[n++])}for(n=i.length;n<t;)i.push(""+n++);return i},ft.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},ft.prototype._needFiring=function(){return!this._frozen&&!this._composing},ft.getSortingDefinitions=ot._deprecatedFunction,ft._globalChangeArg={globalChange:!0},ft._positionChangeArg={globalChange:!0,positionChangeOnly:!0},ft._buildSortContext=function(t,e,i,n,o){var r,s;Array.isArray(e)?(r=e,s=i):(r=[e],s=e?[i]:[0]);var l=null,a=null;"function"==typeof n?l=n:a=n;var u=r.length;t.length=u;for(var h=u;--h>=0;){Array.isArray(a)&&(l=a[h]);var p=t[h];p||(p=t[h]=new Array(5));var d=r[h];p[0]=d,p[1]=null,p[2]=l||a[d]||a._default,p[2]||(p[2]=ft._defaultComparer),p[3]=ft._getSortOrder(s[h]),p[4]=o}return t},ft._multiColumnCompareLogic=function(t,e,i,n){for(var o=n.length,r=0,s=0;s<o;++s){var l=n[s];if(r=ft._singleColumnCompareLogic(t,e,l[3],l))return r}return r},ft._singleColumnCompareLogic=function(t,e,i,n){var o=n[1];return n[2](o[t],o[e],i,n[4])},ft._multiColumnSeparatorCompareLogic=function(t,e,i,n){for(var o=n.length,r=0,s=0;s<o;++s){var l=n[s];if(r=ft._singleColumnSeparatorCompareLogic(t,e,l[3],l))return r}return r},ft._singleColumnSeparatorCompareLogic=function(t,e,i,n){var o=n[0];return n[2](t[o],e[o],i,n[4])},ft._performMultiLevelSorting=function(t,e,i){var n,o=t?t.length:0,r=e?e.length:0;if(!o)return null;for(var s=0;s<r;++s){var l,a=e[s],u=a[1];if((n=a[2]).rowSorting)if(u)for(u.length=o,l=0;l<o;++l)u[l]=t[l];else u=a[1]=t;else{u?u.length=o:u=a[1]=new Array(o);var h=a[0];for(l=0;l<o;++l)u[l]=t[l][h]}}if(i){var p=["ROW_SEGMENT",i,ft._segmentComparer,1,null];e?(e=e.slice()).unshift(p):e=[p],++r}if(!r)return null;var d,c=0;return r>1?(n=ft._multiColumnCompareLogic,d=e,c=1):(n=ft._singleColumnCompareLogic,c=(d=e[0])[3]),ft._mergeSort(o,c,n,d)},ft._mergeSort=function(t,e,i,n){for(var o,r,s,l,a,u=!1,h=1,p=ft._createIndexArray(t),d=p.slice();h<=t;){for(o=a=0;o<t;)if((a=(s=l=(r=a)+h)+h)>t&&(a=t),s<a){for(;;)if(i(p[r],p[s],e,n)<=0){if(d[o++]=p[r],++r>=l){for(;s<a;)d[o++]=p[s],++s;break}}else if(u=!0,d[o++]=p[s],++s>=a){for(;r<l;)d[o++]=p[r],++r;break}}else for(;o<t;)d[o]=p[o],++o;var c=p;p=d,d=c,h<<=1}return u?p:null},ft._reorderItems=function(t,e){if(e){for(var i=t.length;--i>=0;)e[i]=t[e[i]];return e}return t},ft._createIndexArray=function(t){var e=ft._idxAryMap[t];if(!e){ft._idxAryCount>50&&(ft._idxAryMap={},ft._idxAryCount=0),e=ft._idxAryMap[t]=new Array(t),ft._idxAryCount++;for(var i=0;i<t;++i)e[i]=i}return e.slice()},ft._removeIndexArray=function(){ft._idxAryMap={},ft._idxAryCount=0},ft._idxAryMap={},ft._idxAryCount=0,ft._segmentComparer=function(t,e){return t===e?0:t<e?-1:1},ft._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},ft._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},ft._proto=ft.prototype;var gt=ft;const yt="ROW_DEF",mt="CONTENT",Ct="CHAIN",vt="CONSTITUENT",St="GROUP_HEADER",wt="SUBGROUP_HEADER",bt="GROUP_MEMBER";let Rt=function(t){if(this._changes={},t&&t.segmentId)return this._dataId=this._rowId=t.segmentId,this._autoGenerated=!0,void(this._subSegment=!0);this._rowId="_"+Rt._runningId+++"_",this._dataId=this._rowId,t&&(t.asConstituent?this._initializeAsConstituent(t):this.initialize(t))};Rt._runningId=0,Rt._childDataField="CHILD_VALUES",Rt.prototype._userInput="",Rt.prototype._ric="",Rt.prototype._permId="",Rt.prototype._label=null,Rt.prototype._isChain=null,Rt.prototype._realTime=!0,Rt.prototype._rowId="",Rt.prototype._dataId="",Rt.prototype._userId=!1,Rt.prototype._dc=null,Rt.prototype._view=null,Rt.prototype._subId="",Rt.prototype._expanded=null,Rt.prototype._autoGenerated=!1,Rt.prototype._subSegment=!1,Rt.prototype._staticValues=null,Rt.prototype._changes,Rt.prototype._updateCount=0,Rt.prototype._children=null,Rt.prototype._parent=null,Rt.prototype._groupOrder=0,Rt.prototype._depthLevel=0,Rt.prototype._userModel=null,Rt.prototype._info=null,Rt.prototype.dispose=function(){if(!this.isDisposed()){if(this._children&&(this._children.forEach(Rt.dispose),this._children=null),this._staticValues=null,this._parent=null,this._depthLevel=0,this.unsubscribeForUpdates(),this._dc){let t=this.getRowData();t&&(t[yt]=null),this._dc=null}this._view&&(this._view=null),this._rowId=this._dataId="",this._userId=!1,this._userModel=null}},Rt.prototype.isDisposed=function(){return!this._rowId},Rt.prototype.initialize=function(t){if(!t)return;if(!this._autoGenerated){let e=t.rowId;e&&"string"==typeof e&&(this._rowId=this._dataId=e,this._userId=!0)}let e=Rt.extractRowOptions(t),i=t.permId;null!=i&&(this._permId=i),i=t.ric,null!=i&&(this._ric=i),i=t.label,void 0!==i&&(this._label=i),i=t.chainRic,null!=i&&(this._chainRic=i),i=e.asChain,null!==i&&(this._isChain=i),i=t.realTime,null!=i&&(this._realTime=i),i=t.collapsed;let n=e.collapsed;null==i&&n||(this._expanded=!n),i=t.keepModel,i&&(this._userModel=t),i=t.info,i&&(this._info=i);let o=this._ric||this._chainRic;(o||this._permId)&&this.setContent(o,e),i=t.values,void 0!==i&&this.setStaticRowData(i,t.fields)},Rt.prototype._initializeAsConstituent=function(t){this._autoGenerated=!0;let e=t.parent;if(this.setParent(e)&&(this._dataId=t.dataId,this._ric=t.ric,this._dc=e._dc,this._dc)){let t=this.getRowData();t&&(t[yt]=this)}let i=t.values;void 0!==i&&this.setStaticRowData(i,t.fields)},Rt.prototype.setContent=function(t,e){if(this._autoGenerated)return!1;t?"string"!=typeof t&&(t+=""):t="";let i=this._userInput!==t,n=e.permId;if(this._permId!==n&&(this._permId=n||"",i=!0),!i)return!1;if(this.unsubscribeForUpdates()||this._clearStaticData(),this.resetUpdates(),this._userInput=t,"'"===this._userInput.charAt(0))this._ric=this._chainRic="";else{let t=e.asChain,i=!e.collapsed,n=e.chainRic;!0===t?(this._ric=!1===i?this._userInput:this._userInput.replace("0#",""),this._expanded=i):this._ric=this._userInput,this._isChain=null!=t?t:null,this._chainRic=n||""}let o="";if(this._view){if(o=this._view.getSegmentParentRowId(this._rowId),o){if(this._isChain){let t=It(this._view,this._rowId);this._view.removeSegmentChild(o,this._rowId),this._view.moveRow(this._rowId,t),o=""}}else this._view.getSegment(this._rowId)&&this._view.setSegmentSeparator(this._rowId,!1);this._isChain&&this._view.setSegmentSeparator(this._rowId,!0),this.isChainCollapsed()?this._expanded&&this.expandChain():this._expanded||this.collapseChain()}if(this._dataId=this._rowId+this.getSymbol(),o&&this._view.addSegmentChild(o,this._rowId,this._dataId),!this.subscribeForUpdates()&&this._dc){let t={};t[yt]=this,t.X_RIC_NAME=this.getDisplayText(),this.setRowData(t)}return!0},Rt.prototype.getRowId=function(){return this._rowId},Rt.prototype.getConfigObject=function(t){let e=t||{};this._userId&&(e.rowId=this._rowId);let i=this._ric;if(i&&(e.ric=i),this._ric||"'"!==this._userInput.charAt(0)||(e.ric=this._userInput),i=this._realTime,i||(e.realTime=!1),i=this._permId,i&&(e.permId=i),i=this._chainRic,i&&(e.chainRic=i),i=this._label,i&&(e.label=i),i=this._userModel,i&&(e.keepModel=e),i=this._isChain,null!=i&&(e.asChain=i),i=this._expanded,null!=i&&(e.collapsed=!i),i=this._view.isHiddenRow(this._rowId),i&&(e.hidden=i),i=this._info,i&&(e.info=this._info),i=this._getStaticRowData(),i&&(e.values=i),this.isChain()){let t=this.getChildren();if(t){let n=i?i[Rt._childDataField]:{};n||(n={});let o,r,s,l=!1,a=t.length;for(o=0;o<a;o++)r=t[o],s=r._getStaticRowData(),s&&(l=!0,n[r.getRic()]=s);l&&(e.values||(e.values={}),e.values[Rt._childDataField]=n)}}return e},Rt.prototype.getDataId=function(){return this._dataId},Rt.prototype.getType=function(){if(this._isChain)return Ct;if(this._parent)return vt;{let t=this._view;if(!t)return"";{let e=this.getRowId(),i=t.isSegmentSeparator(e),n=t.getSegmentLevel(e);if(i)return 1===n?St:wt;if(t.getSegmentParentRowId(e))return bt}}return mt},Rt.prototype.setDataSource=function(t){if(this._dc=t||null,!this._dc)return;let e=this.getRowData();e||(e={},e[yt]=this,e.X_RIC_NAME=this.getDisplayText(),this.setRowData(e)),this._staticValues&&this.setRowData(this._staticValues),this.subscribeForUpdates()},Rt.prototype.getDataSource=function(){return this._dc},Rt.prototype.getRowData=function(){return this._dc?this._dc.getRowData(this._dataId):{}},Rt.prototype.getData=function(t){return this._dc?this._dc.getData(this._dataId,t):null},Rt.prototype.setStaticRowData=function(t,e){this._clearStaticData(),Array.isArray(t)&&(t=y(t,e)),this._staticValues="object"==typeof t?t:null,this._staticValues&&this.setRowData(t)},Rt.prototype._getStaticRowData=function(){return this._staticValues?f(this._staticValues):null},Rt.prototype.updateRowData=function(t,e){Array.isArray(t)&&(t=y(t,e)),t&&this.setRowData(t)},Rt.prototype.setStaticData=function(t,e){this._staticValues||(this._staticValues={}),this._staticValues[t]=e,this.setData(t,e)},Rt.prototype.setRowData=function(t){this._dc&&this._dc.setRowData(this._dataId,t)},Rt.prototype.setData=function(t,e){this._dc&&this._dc.setData(this._dataId,t,e)},Rt.prototype._clearStaticData=function(){if(this._staticValues){for(let t in this._staticValues)this._staticValues[t]=null;this._dc&&this._dc.setRowData(this._dataId,this._staticValues),this._staticValues=null}},Rt.prototype.getUserInput=function(){return this._userInput},Rt.prototype.getRic=function(){return this._ric},Rt.prototype.getPermId=function(){return this._permId},Rt.prototype.getSymbol=function(){return this._ric||this._permId},Rt.prototype.getDisplayText=function(){return null!=this._label?this._label:this._ric?this._ric:this._permId?this._permId:this._userInput},Rt.prototype.getLabel=function(){return this._label},Rt.prototype.isRowHeader=function(){return"'"===this._userInput.charAt(0)},Rt.prototype.isChain=function(){return this._isChain},Rt.hasChain=function(t){return t.isChain()},Rt.prototype.isChainCollapsed=function(){return!!this._view&&this._view.isSegmentCollapsed(this._rowId)},Rt.prototype.isChainExpanded=function(){return!this.isChainCollapsed()},Rt.prototype.isFixedPosition=function(){return this._isChain&&this.isChainExpanded()},Rt.prototype.isAutoGenerated=function(){return this._autoGenerated},Rt.prototype.isRealTimeRow=function(){return!!this.getRic()&&(!!this._realTime&&(!this._autoGenerated&&!this.isRowHeader()))},Rt.prototype.subscribeForUpdates=function(){if(!this.isRealTimeRow()&&!this.getPermId())return!1;let t=this._dc?this._dc.getSubscriptions():null;if(!t)return!1;let e=this.unsubscribeForUpdates();if(this.isChain()){let e=this._chainRic;if(!e&&(e=this._ric,e.indexOf("0#")<0)){(e.match(/\./g)||[]).length<2&&(e="0#"+e)}this._subId=t.addChain(e,this._rowId)}else this._ric&&(this._subId=t.addRic(this._ric,this._rowId));return e?this._dc.setRowData(this._dataId,e):this._dc.setRowData(this._dataId,{X_RIC_NAME:this.getDisplayText(),ROW_DEF:this}),!0},Rt.prototype.unsubscribeForUpdates=function(){if(!this._subId)return;let t=this._dc.getSubscriptions(),e=this.getRowData();return t.removeSubscription(this._subId),this._subId="",this.resetUpdates(),this._dc.setRowData(this._dataId,null),this._clearStaticData(),e},Rt.prototype.isSubscribing=function(){return!!this._subId},Rt.prototype.addUpdate=function(t){if(t){let e=t.changes;if(e){let t=0;for(let i in e)this._changes[i]=t=1;if(t)return++this._updateCount,!0}}return!1},Rt.prototype.getUpdates=function(){return this._updateCount?this._changes:null},Rt.prototype.resetUpdates=function(){this._updateCount&&(this._changes={},this._updateCount=0)};let It=function(t,e){let i=t.getRowIndex(e);do{if((e=t.getRowId(++i))&&!t.getSegmentParentRowId(e))break}while(e);return e};Rt.prototype.registerToView=function(t,e){if(!t||this._view===t)return;this._view=t;let i=null;if(this._subSegment)return i=this._view.getRowData(this.getRowId()),void(i&&(i[yt]=this));i={},i[yt]=this;let n="";e&&(n=t.getSegmentParentRowId(e),n&&this._isChain&&(e=It(t,e)));let o=t.insertRow(e,i,this.getRowId());o!==this._rowId&&(this._rowId=o,this._userId=!1),this._isChain?(t.setSegmentSeparator(this._rowId),this._expanded||this.collapseChain()):!this._parent&&n&&t.addSegmentChild(n,this._rowId,this._dataId)},Rt.prototype._deregisterFromView=function(t){return this._view?(t&&t.push(this._rowId),this._view=null,this._rowId):""},Rt.deregisterFromView=function(t,e){return e._deregisterFromView(t),t},Rt.prototype._getChildStaticRowData=function(t){if(!this._staticValues)return null;let e=this._staticValues[Rt._childDataField];return e&&e[t]||null},Rt.prototype.addConstituent=function(t){if(!t||this._ric===t)return null;if(!(this._rowId&&this._subId&&this._isChain))return null;let e=null;if(this._children){for(let i=this._children.length;--i>=0;)if(this._children[i]._ric===t){e=this._children[i];break}}else this._children=[];let i=!e;if(i){let i={asConstituent:!0,dataId:this._subId+t,ric:t,parent:this},n=this._getChildStaticRowData(t);n&&(i.values=n),e=new Rt(i)}if(this._view){let t=this.getRowId(),i=e.getData("CHILD_ORDER"),n=this._view.getDataSource(),o=n.getRowIndex(t),r=o+this.getChildCount();null!=i&&(r=o+i+1),e.registerToView(this._view,n.getRowId(r)),this._view.addSegmentChild(t,e.getRowId(),e.getDataId())}return i?e:null},Rt.prototype._toRealTimeRow=function(){this._ric&&(this.isRowHeader()||(this._realTimeField=!0,this._dataId=this._rowId+this._ric,this._autoGenerated=!1,this._parent=null,this._depthLevel=0,this.subscribeForUpdates()))},Rt.prototype.unlinkChain=function(){if(!this._isChain)return;if(this.isChainExpanded()){let t=this.getDescendants(),e=t.length;for(let i=0;i<e;i++)t[i]._toRealTimeRow()}this.unsubscribeForUpdates();let t=this._view;if(t){let e=this.getRowId(),i=t.getSegment(e);i&&i.setClassification(null),t.setSegmentSeparator(e,!1)}this._isChain=this._expanded=!1,this._chainRic="",this._userInput=this._ric,this._children=null,this.subscribeForUpdates()},Rt.prototype.collapseChain=function(){return!(!this._isChain||!this._view)&&(this._expanded=!1,this._view.collapseSegment(this._rowId,!0))},Rt.prototype.expandChain=function(){return!(!this._isChain||!this._view)&&(this._expanded=!0,this._view.collapseSegment(this._rowId,!1))},Rt.prototype.toggleChain=function(){return this._expanded?this.collapseChain():this.expandChain()},Rt.prototype.addChild=function(t){return!!t&&t.setParent(this)},Rt.prototype.getChildren=function(){return this._children},Rt.prototype.getDescendants=function(t){if(t||(t=[]),this._children){let e=this._children,i=e.length;for(let n=0;n<i;++n){let i=e[n];t.push(i),i.getDescendants(t)}}return t},Rt.prototype.getAllDescendantIds=function(){let t=this.getDescendants();return t.length?t.map(Rt.toRowId):null},Rt.prototype.getChildCount=function(){return this._children?this._children.length:0},Rt.prototype.getParent=function(){return this._parent},Rt.prototype.setParent=function(t){if(this._parent===t||t===this)return!1;if(this._parent){let t=this._parent._children.lastIndexOf(this);t>=0&&this._parent._children.splice(t,1),this._parent=null,this._depthLevel=0}return!!t&&(t._children||(t._children=[]),t._children.push(this),this._parent=t,this._depthLevel=t._depthLevel+1,!0)},Rt.prototype.getDepthLevel=function(){return this._depthLevel},Rt.prototype.getGroupOrder=function(){return this._parent?this._parent.getGroupOrder()+.1:this._groupOrder},Rt.prototype.setGroupOrder=function(t){return!this._parent&&this._groupOrder!==t&&(this._groupOrder=t,!0)},Rt.prototype.getUserModel=function(){return this._userModel},Rt.prototype.setRowInfo=function(t){this._info=t},Rt.prototype.getRowInfo=function(){return this._info},Rt.toRowId=function(t){return t.getRowId()},Rt.extractRowOptions=function(t){let e=t.ric,i=t.permId,n=t.chainRic,o=t.collapsed,r=t.asChain;null==r&&n&&(r=!0);let s=null;e&&e.indexOf("0#")>=0&&(null==r&&(r=!0),s=!0);let l={};return l.collapsed=null==o?!s:o,l.ric=e,l.permId=i||"",l.chainRic=n,l.asChain=r,l},Rt.dispose=function(t){t.dispose()};const Dt="/synapse/service/suggestions/suggest/?hits=1&profile="+encodeURIComponent("Field Selector");let xt={};function At(t){t.currentTarget._error={type:t.type}}function Lt(t){let e=t.currentTarget,i=e._defer,n=e._field;if(delete xt._loadingField[n],200===e.status){let t=JSON.parse(e.responseText),o=null,r=t.result&&t.result[0];if(r){let t=r.hits&&r.hits[0];if(t&&t.p){let e=t.p;e.fn.toUpperCase()===n.toUpperCase()&&(o=xt.get(n)||{},o.field=e.fn,o.name=e.fl,o.rank=e.Rank,o.fieldDataType=e.fdt,o.id=e.fid,o.IsMonitorOnlyField=e.fimo,o.IsRealtimePortfolioField=e.firp,o.IsRealtimeField=e.firt,o.source=e.fsrc,o.sourceRank=e.fsrnk,o.description=t.title,xt.set(n,o))}}o?i.resolve(o):i.reject("No definition for "+n)}else e._error?(e._error.field=n,i.reject(e._error)):i.reject({field:n,status:e.status,statusText:e.statusText,request:e})}xt._defs={CF_NAME:{name:"Name",rank:2800003,fieldDataType:"ALPHANUMERIC",id:"6307",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100003,description:"The name of the instrument"},CF_LAST:{name:"Last",rank:2800024,fieldDataType:"PRICE",id:"5364",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100024,description:"The latest trade price or value."},PCTCHNG:{name:"Pct. Chng",rank:2709440,fieldDataType:"PRICE",id:"56",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:9440,description:"Percentage change in the latest trade price or value from the historic close."},CF_NETCHNG:{name:"Net. Chng",rank:2800027,fieldDataType:"PRICE",id:"5367",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100027,description:"Net Change is the difference between latest trade price or value and the historic closing value or settlement price."},CF_CLOSE:{name:"Close",rank:2800023,fieldDataType:"PRICE",id:"5360",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100023,description:"The last trade price, settlement value or closing value."},CF_CURR:{name:"Currency",rank:2800021,fieldDataType:"ENUMERATED",id:"6452",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100021,description:"The currency that the instrument is quoted in"},CF_BID:{name:"Bid",rank:2800025,fieldDataType:"PRICE",id:"5359",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100025,description:"The latest Bid price."},CF_ASK:{name:"Ask",rank:2800026,fieldDataType:"PRICE",id:"5358",IsMonitorOnlyField:!1,IsRealtimePortfolioField:!1,IsRealtimeField:!0,source:"IDN",sourceRank:100026,description:"The latest Ask price."}},xt._timeSeriesChildren={},xt._synapse="",xt._lang="en",xt._timeSeriesExpansion=!0,xt._loadingField={},xt.set=function(t,e){if(xt._defs[t])for(let i in e)xt._defs[t][i]=e[i];else xt._defs[t]=e},xt.get=function(t){return xt._defs[t]||null},xt.getFieldInfo=xt.get,xt.hasFieldInfo=function(t){let e=xt.get(t);return!(!e||!e.field)},xt.getTimeSeriesChildren=function(t){return xt._timeSeriesChildren[t]},xt.addTimeSeriesChild=function(t,e){xt._timeSeriesChildren[t]||(xt._timeSeriesChildren[t]=[]),xt._timeSeriesChildren[t].push(e)},xt.remove=function(t){delete xt._defs[t]},xt.setSynapseConfig=function(t){xt._synapse=t},xt.disableTimeSeriesExpansion=function(t){xt._timeSeriesExpansion=0==t},xt.isFormula=function(t){return"="===t.charAt(0)},xt.isAdc=function(t){return 0===t.indexOf("TR.")},xt.isRealTimeField=function(t){return!!t&&(!xt.isAdc(t)&&(!xt.isFormula(t)&&(!xt.isTimeSeriesChild(t)&&(!xt.isTimeSeries(t)&&!1!==xt.getFieldProperty(t,"IsRealtimeField")))))},xt.isTimeSeriesChild=function(t){return!!xt.getFieldProperty(t,"timeSeriesParent")},xt.isTimeSeries=function(t){if(!t)return!1;if(!xt._timeSeriesExpansion)return!1;let e=xt.getFieldProperty(t,"timeSeries");if(null!=e)return e;return/^TR\.[\w]+\([\w\-\=\,]*(?:EDATE|SDATE)\=+[\w\-\=\,]*[ \w]*\)$/i.test(t)},xt.setFieldProperty=function(t,e,i){xt._defs[t]||(xt._defs[t]={}),xt._defs[t][e]=i},xt.getFieldProperty=function(t,e){let i=xt._defs[t];return i?i[e]:null},xt.loadFieldInfo=function(t){if(xt._loadingField[t])return xt._loadingField[t].promise;let e=new I,i=xt._synapse;if(i)if(xt.hasFieldInfo(t))e.resolve(xt.get(t));else if(i.debug){let i=this._mockOnLoadEndData(t,e);setTimeout(Lt.bind(null,i),1e3)}else if(i.apiKey&&i.contextApp){let n=Dt+"&api-key="+encodeURIComponent(i.apiKey)+"&contextApp="+encodeURIComponent(i.contextApp)+"&language="+encodeURIComponent(xt._lang)+"&query="+encodeURIComponent(t);i.auth&&(n+="&auth="+encodeURIComponent(i.auth));let o=new XMLHttpRequest;o._defer=e,o._field=t,xt._loadingField[t]=e,o.addEventListener("loadend",Lt),o.addEventListener("timeout",At),o.addEventListener("error",At),o.open("GET",n,!0),o.send()}else e.resolve(null);else e.resolve(null);return e.promise},xt._mockOnLoadEndData=function(t,e){let i,n=t.toUpperCase(),o=n.toLowerCase();i=2===o.indexOf("_")?n[3]+o.substring(4):n[0]+o.substring(1);let r=n.indexOf("DATE")>=0?"DATE":"PRICE",s={action:'"'+n+'" SRCH',assetClassifierExplanation:"AssetClassifier is disabled.",assetClassifierStatus:"NOT_INVOKED",result:[{name:"Fields",default:!1,size:1,hits:[{cmd:i,explanation:null,fr:!1,id:"1635614732",navigation:null,p:{Rank:2800024,fdt:r,fid:"5364",fimo:!1,firp:!1,firt:!0,fl:i,fn:n,fsrc:"IDN",fsrnk:100024},position:0,preview:!1,relations:{},score:2840024,source:"87",subtitle:"",symbol:i,title:"title mockup of "+n,vc:"FLD"}],hasMore:!1}],search:"cpurl://apps.cp./apps/SearchAll?Search.Value="+o+"*"};return s=JSON.stringify(s),{currentTarget:{_defer:e,_field:t,status:200,response:s,responseText:s}}},function(){for(let t in xt._defs)xt._defs[t].field=t}();var Tt=xt;let Et={_formulas:{},set:function(t,e){Et._formulas[t]=e},get:function(t){return Et._formulas[t]||""},remove:function(t){delete Et._formulas[t]}};var Mt=Et;const Ft={STRING:"string",BOOLEAN:"boolean",NUMBER:"number",DATE:"datetime",DATETIME:"datetime",TIME:"datetime",ENUMERATED:"string",ALPHANUMERIC:"string",PERCENT:"string",PRICE:"number",DOUBLE:"number",MONEY:"number",INTEGER:"number",FLOAT:"number",SCORE:"number"};let Pt=function(t,e){this._defaultRenderer=this._defaultRenderer.bind(this),this._customRenderer=this._customRenderer.bind(this),this._internalRenderer=this._defaultRenderer,this._internalSorter=this._defaultSorter,this._eventArg={colDef:this},e&&(this._updateContext("grid",e),this._updateContext("core",e.getCoreGrid())),this._classes=[],this._requiredFields=[],this._children=[],t&&(t.parent?this._initializeTimeSeriesChild(t):this.initialize(t))};Pt.prototype._field="",Pt.prototype._dataType="",Pt.prototype._name="",Pt.prototype._defaultName=!0,Pt.prototype._defaultField=!0,Pt.prototype._tooltip=null,Pt.prototype._requiredFields,Pt.prototype._headerRenderer=null,Pt.prototype._headerAlignment="",Pt.prototype._internalRenderer,Pt.prototype._userRenderers=null,Pt.prototype._activatedRenderer=null,Pt.prototype._rendererMap=null,Pt.prototype._userSorter=null,Pt.prototype._sortable=!0,Pt.prototype._eventArg,Pt.prototype._autoGenerated=!1,Pt.prototype._classes,Pt.prototype._fnEngine=null,Pt.prototype._formula=null,Pt.prototype._formulaRef="",Pt.prototype._initialOrder="",Pt.prototype._rowSorting=null,Pt.prototype._textSelect=!1,Pt.prototype._userModel=null,Pt.prototype._parent=null,Pt.prototype._children=null,Pt.prototype._info=null,Pt.prototype._coreColDef=null,Pt.prototype.dispose=function(){this._eventArg={},this._coreColDef=null,this._activatedRenderer=this._rendererMap=null,this.setRenderer(null),this.setSorter(null),this._userModel=null,this._parent=null,this._children=null},Pt.prototype._initializeTimeSeriesChild=function(t){this._autoGenerated=!0;let e=t.parent;this._setParent(e),this.initialize(t)},Pt.prototype.initialize=function(t){if(!t)return;let e,i,n,o,r=t.field,s=Tt.get(r);if(s&&s!==t){let e=t;for(n in t={},s)t[n]=s[n];for(n in e)t[n]=e[n]}if(o=t.formulaEngine,o&&o.addFormula&&(this._fnEngine=o),o=t.formulaReference,o&&(this._formulaRef=o+""),o=t.require||t.requiredFields,null!=o&&("string"==typeof o?this._requiredFields=o.split(" "):Array.isArray(o)&&(this._requiredFields=o.slice())),this._setField(r,t),o=t.name||t.title,null!=o&&(this._name=o,this._defaultName=!1),o=t.dataType,null!=o&&(this._dataType=o),o=t.notRealTimeField,null!=o&&Tt.setFieldProperty(r,"IsRealtimeField",!o),o=t.tooltip,null!=o&&(this._tooltip=o),o=t.headerAlignment||t.titleAlignment,null!=o&&(this._headerAlignment=function(t){if(t){let e=t.charAt(0).toLowerCase();if("l"===e)return"left";if("r"===e)return"right";if("c"===e)return"center"}return""}(o)),o=t.headerBinding||t.headerRenderer,void 0!==o&&(this._headerRenderer=o),o=t.binding||t.renderer,o||(o=t.formatter),void 0!==o)if(o instanceof Array)for(i=o.length,e=0;e<i;++e)this.addRenderer(o[e]);else o?"function"==typeof o?this.setRenderer(o):o.binding&&this.setRenderer(o.binding):this.setRenderer(null);o=t.rowSorting,null!=o&&(this._rowSorting=!!o),o=t.sortLogic||t.sortingLogic||t.sorter,void 0!==o&&this.setSorter(o),o=t.sortable,null!=o&&(this._sortable=!!o),o=t.className||t.class,"string"==typeof o&&(this._classes=o.split(" ")),o=t.sortOrder||t.sort,o&&(this._initialOrder=o),o=t.textSelect,o&&(this._textSelect=o),o=t.info,o&&(this._info=o),this._userModel=t},Pt.prototype.getId=function(){return this._coreColDef&&this._coreColDef.id||""},Pt.prototype.getRequireFields=function(){return this._requiredFields},Pt.prototype.getRequiredFields=Pt.prototype.getRequireFields,Pt.prototype.getRenderer=function(){return this._internalRenderer},Pt.prototype.getHeaderRenderer=function(){return this._headerRenderer},Pt.prototype.getName=function(){return this._defaultName?this._defaultField?"Column "+this.getId():this.getField():this._name},Pt.prototype.isDefaultName=function(){return this._defaultName},Pt.prototype.getFieldDefinition=function(){return Tt.get(this.getField())},Pt.prototype.getFieldDataType=function(){let t=this.getFieldDefinition();return t&&t.fieldDataType?t.fieldDataType:""},Pt.prototype.getDataType=function(){if(this._dataType)return this._dataType;let t=this.getFieldDataType();return t?Ft[t.toUpperCase()]:""},Pt.prototype.setDataType=function(t){let e=Ft[t.toUpperCase()];e&&(t=e),this._dataType=t},Pt.getDataType=function(t){let e=Tt.get(t);if(e){let t=e.fieldDataType?e.fieldDataType.toUpperCase():null;return Ft[t]?Ft[t]:""}return""},Pt.prototype.getTooltip=function(){if(null!=this._tooltip){if("string"==typeof this._tooltip)return this._tooltip;if(!this._tooltip)return""}let t=this.getName();if(t)return t;let e=this.getField();return e||""},Pt.prototype.getField=function(){return this._coreColDef&&this._coreColDef.field||""},Pt.prototype.getAllFields=function(){let t=this.getField();return t?this._requiredFields.concat(t):this._requiredFields.slice()},Pt.prototype.isRealTimeField=function(){return Tt.isRealTimeField(this.getField()||this._field)},Pt.prototype.isTimeSeries=function(){return Tt.isTimeSeries(this.getField())},Pt.prototype.isTimeSeriesChild=function(){return Tt.isTimeSeriesChild(this.getField())},Pt.prototype.isFormulaField=function(){return!!this._formula},Pt.isFormulaField=function(t){return Tt.isFormula(t)},Pt.isAdcField=function(t){return Tt.isAdc(t)},Pt.isRealTimeField=function(t){return Tt.isRealTimeField(t)},Pt.getRealTimeFields=function(t,e){e.isRealTimeField()&&t.push(e.getField());let i=e.getRequiredFields(),n=i.length;for(let e=0;e<n;++e){let n=i[e];Pt.isRealTimeField(n)&&t.push(n)}return t},Pt.prototype.isSortable=function(){return this._sortable},Pt.prototype.isScalable=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnScalability(e)},Pt.prototype.getInitialSortOrder=function(){return this._initialOrder},Pt.prototype.getWidth=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnWidth(e)},Pt.prototype.getMinWidth=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getMinimumColumnWidth(e)},Pt.prototype.getTextAlign=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnAlignment(e)},Pt.prototype.isFieldEmpty=function(){return!this.getField()},Pt.prototype.getHeaderAlignment=function(){return this._headerAlignment||""},Pt.prototype.getClasses=function(){return this._classes},Pt.prototype.getConfigObject=function(t){let e=t||{};if(this._info&&(e.info=this._info),null==e.field&&!this._defaultField){let t=this.getField();t&&(e.field=t)}let i=this.getDataType();i&&(e.dataType=i),this._formulaRef&&(e.formulaReference=this._formulaRef),this._requiredFields&&this._requiredFields.length&&(e.require=this._requiredFields),this._defaultName||(e.name=this.getName()),i=!1===Tt.getFieldProperty(this.getField(),"IsRealtimeField"),i&&(e.notRealTimeField=i),null!=this._tooltip&&(e.tooltip=this._tooltip),null!=this._rowSorting&&(e.rowSorting=this._rowSorting),this._sortable||(e.sortable=!1);let n=this._classes;n&&n.length>0&&(e.className=n.join(" ")),this._textSelect&&(e.textSelect=this._textSelect),this._headerAlignment&&(e.headerAlignment=this._headerAlignment),this._autoGenerated&&(e.autoGenerated=this._autoGenerated);let o=this._eventArg.core,r=this._eventArg.grid.getColumnIndex(this),s=o.getColumnScalability(r),l=o.getColumnCustomLaneSize(r);return!0===s&&1===l||(e.scalable=s,e.width=l),i=o.getMinimumColumnWidth(r),i>0&&(e.minWidth=i),null==e.hidden&&(o.getColumnVisibility(r,0)||(e.hidden=!0)),i=o.getColumnAlignment(r),"default"!==i&&(e.textAlign=i),e},Pt.prototype.isHidden=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return!t.isColumnVisible(e)},Pt.prototype.isTextSelect=function(){return this._textSelect},Pt.prototype.hide=function(t){let e=this._eventArg.core,i=this._eventArg.grid.getColumnIndex(this);e.hideColumn(i,!1!==t)},Pt.prototype.setHeaderRenderer=function(t){this._headerRenderer=t},Pt.prototype.setRenderer=function(t){"function"==typeof t?(this._internalRenderer=this._customRenderer,this._activatedRenderer!==t&&(this._userRenderers?this._userRenderers.length=0:this._userRenderers=[],this._userRenderers.push(t))):(this._internalRenderer=this._defaultRenderer,this._userRenderers=null)},Pt.prototype.getParent=function(){return this._parent},Pt.prototype._setParent=function(t){return this._parent===t||t===this||t&&(this._parent=t,this._parent._addChild(this)),!1},Pt.prototype.getChildren=function(){return this._children},Pt.prototype._addChild=function(t){this===t||this._children.indexOf(t)>-1||this._children.push(t)},Pt.prototype.addRenderer=function(t){t&&(this._userRenderers?this._userRenderers.push(t):this.setRenderer(t))},Pt.prototype.activateRenderer=function(t,e){let i=null;if(null!=t){let n=this._rendererMap;n||(n=this._rendererMap={}),"function"==typeof e?i=n[t]=e:null==e?i=n[t]:e||(i=n[t]=null)}return this._activatedRenderer=i||null,i||(i=this._userRenderers?this._userRenderers[0]:null),this.setRenderer(i),!!this._activatedRenderer},Pt.prototype.getSorter=function(){return this._userSorter},Pt.prototype.setSorter=function(t){this._userSorter="function"==typeof t?t:null},Pt.prototype.isRowSorting=function(){return null==this._rowSorting?!Tt.getFieldProperty(this.getField(),"IsRealtimeField"):!!this._rowSorting},Pt.prototype.isAutoGenerated=function(){return this._autoGenerated},Pt.prototype.setName=function(t){this._name=t,this._defaultName=!1},Pt.prototype._setField=function(t,e){this._defaultField=null==t,t||(t=""),t=t.trim();let i=e?e.formula:"";if(this._fnEngine){let e=t.toUpperCase(),n=i||Mt.get(e);(n||Pt.isFormulaField(t))&&(t=d.toUpperCase(t),this._formula=this._fnEngine.addFormula(n||t),n&&(this._formula.setAlias(t),this._fnEngine.addReference(this._formula,t)),this._retrieveNestedFields(this._formula.getFieldNames())),this._formulaRef&&(this._formulaRef=this._fnEngine.addReference(this._formula||t,this._formulaRef))}this._field=t,Tt.setFieldProperty(t,"timeSeries",!!Tt.isTimeSeries(t));let n=e.parent;e&&n&&Tt.setFieldProperty(t,"timeSeriesParent",n.getField()),this._updateContext("field",t),this.isRealTimeField()&&this._updateContext("formattedField",t+"_FORMATTED")},Pt.prototype._retrieveNestedFields=function(t){if(t)for(let e=t.length;--e>=0;){let i=t[e],n=i.toUpperCase(),o=Mt.get(n);if(o){let t=this._fnEngine.getFormula(i);t?t.addFormulaCount():(t=this._fnEngine.addFormula(o),t.setAlias(i),this._fnEngine.addReference(t,i)),this._retrieveNestedFields(t.getFieldNames())}else this._requiredFields.push(i)}},Pt.prototype._defaultRenderer=function(t){let e=t.dataValue;t.cell.setContent(e?e.getData(this._field):null)},Pt.prototype._customRenderer=function(t){let e=t.dataValue,i=this._eventArg;if(e){let n=e.getRowData();i.rowDef=e,i.rowData=n,i.rowIndex=t.rowIndex,i.data=n?n[this._field]:null}else i.data=null;if(i.colIndex=t.colIndex,i.cell=t.cell,i.section=t.section,this._activatedRenderer)this._activatedRenderer(i);else{let t=this._userRenderers,e=t.length;for(let n=0;n<e;++n)t[n](i)}},Pt.prototype._updateContext=function(t,e){this._eventArg[t]=e},Pt.prototype.getUserModel=function(){return this._userModel},Pt.prototype.clearUserModel=function(){this._userModel=null},Pt.prototype.setColumnInfo=function(t){this._info=t},Pt.prototype.getColumnInfo=function(){return this._info},Pt.prototype._setCoreColumnDef=function(t){this._coreColDef=t||null};var zt=Pt;let Vt=function(){this._onRequest=this._onRequest.bind(this),this._rics={},this._fields={},this._adcOptions={productId:"001"}};r.inherits(Vt,l),Vt.prototype._timerId=0,Vt.prototype._rics,Vt.prototype._fields,Vt.prototype._rtk,Vt.prototype._adcOptions=null,Vt.prototype.setRTK=function(t){this._rtk=t},Vt._mockAdc=null,Vt.setMockAdc=function(t,e){Vt._mockAdc||(Vt._mockAdc={}),Vt._mockAdc[t]=e},Vt.getMockAdc=function(t){return Vt._mockAdc?Vt._mockAdc[t]:null},Vt.clearMockAdc=function(){Vt._mockAdc=null},Vt.prototype.setADCOptions=function(t){let e=t.productId;e&&(this._adcOptions.productId=e)},Vt.prototype.addRic=function(t){t&&!this._rics[t]&&(this._rics[t]=1,this._request())},Vt.prototype.addRics=function(t){let e=t?t.length:0,i=!1;for(let n=0;n<e;++n){let e=t[n];e&&!this._rics[e]&&(this._rics[e]=1,i=!0)}return!!i&&(this._request(),!0)},Vt.prototype.addField=function(t){this._addField(t)&&this._request()},Vt.prototype.addFields=function(t){let e=t.length,i=0;for(let n=0;n<e;++n)i|=this._addField(t[n]);return!!i&&(this._request(),!0)},Vt.prototype._addField=function(t){return Vt.isValidField(t)&&!this._fields[t]?(this._fields[t]=1,1):0},Vt.isValidField=function(t){return!(!t||0!==t.indexOf("TR."))},Vt.prototype._request=function(){this._timerId||(this._timerId=setTimeout(this._onRequest,0))},Vt.prototype._onRequest=function(){this._timerId=0;let t=window.JET;if(this._rtk){if(!this._rtk.Data)return}else if(!t||!t.ContainerDescription||"function"!=typeof t.Data)return;let e,i=Object.keys(this._rics),n=[],o=[];for(let t in this._fields)xt.isTimeSeries(t)?o.push(t):n.push(t);let r,s,l=n.length,a=o.length;if((l||a)&&i.length)if(this._rics={},this._fields={},this._rtk){let t;if(o.length>0){let t=o.join(",");s={method:"select",formula:t,identifiers:i,productId:this._adcOptions.productId,output:"Col,date|,Row,In|,va,T,NoEmptyTickers"},r=this._onRTKTimeSeriesSuccess.bind(this,o);let e=Vt.getMockAdc(s.formula);e?setTimeout((function(){r(e)}),10):this._rtk.Data.Adc.request(s).then(r).catch((function(t){console.log(t)}))}n.length>0&&(t=n.join(","),s={method:"select",formula:t,identifiers:i,productId:this._adcOptions.productId,output:"Col,In,va,T,NoEmptyTickers"},r=this._onRTKSuccess.bind(this,n),this._rtk.Data.Adc.request(s).then(r).catch((function(t){console.log(t)})))}else{let o=[];for(e=0;e<l;e++)o.push({name:n[e]});s={instruments:i,fields:o},r=this._onJETSuccess.bind(this,n),t.Data("datagrid").then((function(t){return t.request(s)})).then(JSON.parse).then(r).catch((function(t){console.log(t)}))}},Vt.prototype._onJETSuccess=function(t,e){this._dispatch("adcDataReceived",e);let i,n,o,r=e.data,s=e.headers&&e.headers[0];if(!Array.isArray(r)||!Array.isArray(s))return;let l=1,a=t.length,u=s.length,h=new Array(u);for(i=0;i<a&&l<u;i++)n=t[i],s[l].field===n.toUpperCase()&&(h[l]=n,l++);let p=r.length,d=h.length,c={};for(i=0;i<p;i++){let t=r[i];if(o=t[0],c[o])continue;let e=c[o]={};for(l=1;l<d;l++){let i=t[l];null!=i&&""!==i&&(n=h[l],e[n]=i)}}let _={};for(o in c){let t=c[o];g(t)||(_[o]=t)}this._dispatch("dataChanged",{data:_})},Vt.prototype._onRTKSuccess=function(t,e){this._dispatch("adcDataReceived",e);let i,n,o,r=e.rows,s=e.rows&&e.rows[0];if(!Array.isArray(r)||!Array.isArray(s))return;let l=1,a=t.length,u=s.length,h=new Array(u);for(i=0;i<a&&l<u;i++)n=t[i],s[l].r.toUpperCase()===n.toUpperCase()&&(h[l]=n,l++);let p=r.length,d=h.length,c={};for(i=1;i<p;i++){let t=r[i];if(o=t[0],c[o])continue;let e=c[o]={};for(l=1;l<d;l++){let i=t[l];null!=i&&""!==i&&"object"!=typeof i&&(n=h[l],e[n]=i)}}let _={};for(o in c){let t=c[o];g(t)||(_[o]=t)}this._dispatch("dataChanged",{data:_})},Vt.prototype._onRTKTimeSeriesSuccess=function(t,e){this._dispatch("adcDataReceived",e);let i=e.rows,n=e.rows&&e.rows[0];if(!Array.isArray(i)||!Array.isArray(n))return;let o=n.slice(2).map(t=>t.v),r={},s=0,l=i.length;for(let e=1;e<l;e++){let n=i[e][1];r[n]||(r[n]=t[s++])}let a={},u={};for(let t=1;t<l;t++){let e=i[t],n=e[0],s=e[1];a[n]||(a[n]={});let l=a[n];if(1===o.length)l[r[s]]=e[2];else for(let t=0;t<o.length;t++){let i=r[s].replace("TR.","")+"_"+o[t],n=e[2+t];null!==n&&(u[i]=r[s],l[i]=n)}}let h={};for(let t in a){let e=a[t];g(e)||(h[t]=e)}let p={data:h};o.length>1&&(p.timeSeries=!0,p.childrenFieldToParent=u),this._dispatch("dataChanged",p)};var kt=Vt;let Ot=function(){this._groupMap={},this._childToParent={}};Ot.prototype._groupMap,Ot.prototype._childToParent,Ot.getGroupId=function(t){return t&&t.id||""},Ot.calcTreeDepth=function(t,e){let i=-1,n=e;for(;n;){if(++i>15){console.log("WARNING: Infinite loop detected during column group creation");break}n=t[n.parentId]}return i},Ot.getLeafDescendants=function(t,e){let i=t[e];if(!i)return null;let n=[],o=[i],r=0,s={};for(;r<o.length;){i=o[r++],s[i.id]=!0;let e=i.children,l=e?e.length:0;for(let r=0;r<l;++r){let l=e[r];i=t[l],i?s[i.id]||o.push(i):n.push(l)}}return n},Ot._cloneObject=function(t){let e=f(t);return Array.isArray(e.children)?e.children=e.children.slice():e.children=[],e},Ot._toGroupDefinition=function(t,e){let i=null;return t&&(i=Array.isArray(t)?{children:t.slice()}:Ot._cloneObject(t),e&&(i.id||(i.name=e),i.id=e)),i},Ot.prototype.toString=function(){let t=this._groupMap,e=[];e.push("=== groupDefs ===");for(let i in t){let n=t[i];e.push(i+": "+JSON.stringify(n,["id","parentId","children"]))}return e.push("=== childToParent ==="),e.push(JSON.stringify(this._childToParent,null,2)),e.push(""),e.join("\n")},Ot.prototype.getGroup=function(t){return t&&this._groupMap[t]||null},Ot.prototype.getDefinition=Ot.prototype.getGroup,Ot.prototype.getGroups=function(){let t=[],e=this._groupMap;for(let i in e)t.push(e[i]);return t},Ot.prototype.getGroupIds=function(){return Object.keys(this._groupMap)},Ot.prototype.getGroupMap=function(){return this._groupMap},Ot.prototype.cloneGroupMap=function(){let t=this._groupMap,e={};for(let i in t){let n=t[i],o=Ot._cloneObject(n);e[i]=o}return e},Ot.prototype.rebuildMap=function(){let t,e,i=this._groupMap,n=this._childToParent={},o=Object.keys(i),r=o.length;for(t=0;t<r;++t){e=o[t];let r=i[e].children,s=r?r.length:0;for(let t=0;t<s;t++)n[r[t]]=e}for(t=0;t<r;++t){e=o[t];let r=n[e];r&&(i[e].parentId=r)}},Ot.prototype.getGroupChildren=function(t){let e=this._groupMap[t];return e?e.children:null},Ot.prototype.getLeafDescendants=function(t){return Ot.getLeafDescendants(this._groupMap,t)},Ot.prototype.getGroupLevel=function(t){return Ot.calcTreeDepth(this._groupMap,this._groupMap[t])},Ot.prototype.getRootGroup=function(t){if(!t)return null;let e=this._groupMap,i=e[t]||null;if(i)for(;i.parentId;){let t=e[i.parentId];if(!t)break;i=t}return i},Ot.prototype.getParentGroup=function(t){return this.getGroup(this._childToParent[t])},Ot.prototype.getParentIds=function(t){if(t&&"string"==typeof t){let e=this._childToParent[t];if(e){let t=[e],i=this._groupMap[e];for(;i&&i.parentId;)i=this._groupMap[i.parentId],i&&t.push(i.id);return t}}return null},Ot.prototype.getParentId=function(t,e){let i=this._childToParent[t];if(null!=e){let t=this.getGroupLevel(i);for(;t>e&&i;)i=this._childToParent[i],t--}return i||""},Ot.prototype.removeAllGroups=function(){for(let t in this._groupMap)return this._groupMap={},this._childToParent={},!0;return!1},Ot.prototype.setGroups=function(t){let e=this._groupMap={},i=t?t.length:0;for(let n=0;n<i;n++){let i=t[n],o=i.id;o&&(e[o]=Ot._cloneObject(i))}this.rebuildMap()},Ot.prototype.addGroup=function(t){let e=Ot.getGroupId(t);return e?this.setGroup(e,t):e},Ot.prototype.removeGroup=function(t){return!!this._groupMap[t]&&(this.removeAllChildren(t),this.unsetParent(t),delete this._groupMap[t],!0)},Ot.prototype.setGroup=function(t,e){if(!t)return"";if(e){let i=Ot._toGroupDefinition(e,t);this._ungroupChildren(i.children),this._groupMap[t]&&this.removeAllChildren(t);let n=this._childToParent[t];n&&(i.parentId=n.id),this._groupMap[t]=i;let o=i.children,r=o.length;for(let e=0;e<r;++e){let i=o[e];this._childToParent[i]=t;let n=this._groupMap[i];n&&(n.parentId=t)}}else if(!this.removeGroup(t))return"";return t},Ot.prototype._ungroupChildren=function(t){if(Array.isArray(t)){let e=t.length;for(let i=0;i<e;++i)this.unsetParent(t[i])}},Ot.prototype.hasGroupChild=function(t,e){let i=this._groupMap[t];if(e&&i){let t=i.children;if(t)return t.indexOf(e)>=0}return!1},Ot.prototype.contains=function(t,e){if(t&&e){if(t===e)return!0;let i=20,n=this._childToParent[e];for(;n&&i;){if(t===n)return!0;--i,n=this._childToParent[n]}}return!1},Ot.prototype.addGroupChild=function(t,e,i){let n=this._groupMap[t];if(e&&n){let o=n.children;if(o&&o.indexOf(e)<0){this.unsetParent(e),this._childToParent[e]=t;let n=this._groupMap[e];return n&&(n.parentId=t),null!=i&&i>=0?o.splice(i,0,e):o.push(e),!0}}return!1},Ot.prototype.removeGroupChild=function(t,e){return null==e?this.unsetParent(t):!!this.hasGroupChild(t,e)&&this.unsetParent(e)},Ot.prototype.unsetParent=function(t){let e=this._childToParent[t];if(!e)return!1;this._childToParent[t]="";let i=this._groupMap[t];i&&(i.parentId="");let n=this._groupMap[e];if(n){let e=n.children;if(e&&e.length){let i=e.indexOf(t);i>=0&&e.splice(i,1)}}return!0},Ot.prototype.removeAllChildren=function(t){let e=this._groupMap[t];if(e){let t=e.children,i=t?t.length:0;if(i){e.children=[];for(let e=0;e<i;++e){let i=t[e];this._childToParent[i]&&(this._childToParent[i]="");let n=this._groupMap[i];n&&(n.parentId="")}return!0}}return!1},Ot.prototype.setGroupChildren=function(t,e){let i=this._groupMap[t];if(i){if(Array.isArray(e)){let n=e.slice();this._ungroupChildren(n),this.removeAllChildren(t),i.children=n;let o=i.id,r=n.length;for(let t=0;t<r;++t){let e=n[t];this._childToParent[e]=o;let i=this._groupMap[e];i&&(i.parentId=o)}return!0}if(!e&&i.children.length)return this.removeAllChildren(t),!0}return!1},Ot.prototype.getGroupName=function(t){let e=this._groupMap[t];return e&&e.name||""},Ot.prototype.setGroupName=function(t,e){let i=this._groupMap[t];return!(!i||i.name===e)&&(i.name=e,!0)};var Nt=function(t){this._element=t||document.createElement("div")};s.inherits(Nt,at),Nt.prototype._element=null,Nt.prototype._content=null,Nt.prototype._textSpan=null,Nt.prototype._nativeEvents=null,Nt._passiveEvents=null,Nt.prototype.getContent=function(t){return t?this._element.children:this._element.lastChild},Nt.prototype.setContent=function(t,e){if(null==t||t!=t?t=null:1!==t.nodeType&&11!==t.nodeType&&(null==t.getElement?(ot.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},Nt.prototype.addContent=function(t){return null==(t=ot.getElement(t))?null:(this._content=this._element.children,this._element.appendChild(t),t)},Nt.prototype.removeContent=function(t){return null!=(t=ot.getElement(t))&&(this._content=this._element.children,this._element.removeChild(t),!0)},Nt.prototype.listen=function(t,e,i){if(this._customEvents&&this._customEvents[t])this._customEvents[t].listen(e,i);else{this._nativeEvents||(this._nativeEvents={});var n=this._nativeEvents[t];if(!n){if(n=new st,this._nativeEvents[t]=n,n.dispatch=n.dispatch.bind(n),!Nt._passiveEvents){var o=!1;try{var r=Object.defineProperty({},"passive",{get:function(){return o=!0,!1}});window.addEventListener("testPassive",null,r),window.removeEventListener("testPassive",null,r)}catch(t){}if(o){var s={passive:!0};Nt._passiveEvents={touchstart:s,touchmove:s}}else Nt._passiveEvents={}}this._element.addEventListener(t,n.dispatch,Nt._passiveEvents[t]||!1)}n.listen(e,i)}},Nt.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)}},Nt.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}},Nt.prototype._unlistenAll=function(t){var e=this._nativeEvents[t];this._element.removeEventListener(t,e.dispatch,!1),e.unlistenAll()},Nt.prototype.dispose=function(){this._dispose()},Nt.prototype._dispose=function(){this.setParent(null),this.unlistenAll(),this._element=this._content=this._textSpan=null,this._customEvents=this._nativeEvents=null},Nt.prototype.setEventArgExtender=function(t,e){if(this._customEvents){var i=this._customEvents[t];i&&i.setEventArgExtender(e)}},Nt.prototype.getElement=function(){return this._element},Nt.prototype.getNextSibling=function(){return this._element.nextSibling},Nt.prototype.getParent=function(){return this._element.parentNode},Nt.prototype.setParent=function(t,e){this._setParent(t,e)},Nt.prototype._setParent=function(t,e){null!==(t=ot.getElement(t))?e?t.insertBefore(this._element,t.firstChild):t.appendChild(this._element):null!==this._element.parentNode&&this._element.parentNode.removeChild(this._element)},Nt.prototype.insertBefore=function(t){this._insertBefore(t)},Nt.prototype._insertBefore=function(t){if(null!=(t=ot.getElement(t))){var e=t.parentNode;null!=e&&e.insertBefore(this._element,t)}else this.setParent(this.getParent())},Nt.prototype.insertAfter=function(t){(t=ot.getElement(t))?t.nextSibling?this.insertBefore(t.nextSibling):this.setParent(t.parentNode):this.setParent(this.getParent(),!0)},Nt.prototype.hasClass=function(t){return!!this._element&&this._element.classList.contains(t)},Nt.prototype.addClass=function(t){this._element&&this._element.classList.add(t)},Nt.prototype.removeClass=function(t){this._element&&this._element.classList.remove(t)},Nt.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))},Nt.prototype.enableClass=function(t,e){!1!==e?this.addClass(t):this.removeClass(t)},Nt.prototype.getClass=function(){return this._element.className},Nt.prototype.setClass=function(t){this._element.className=t},Nt.prototype.getAttribute=function(t){return this._element.getAttribute(t)},Nt.prototype.setAttribute=function(t,e){this._element.setAttribute(t,e)},Nt.prototype.setAttributes=function(t){for(var e in t)this._element.setAttribute(e,t[e])},Nt.prototype.removeAttribute=function(t){this._element.removeAttribute(t)},Nt.prototype.getStyle=function(t){return this._element.style[t]},Nt.prototype.setStyle=function(t,e){this._element.style[t]=e},Nt.prototype.setStyles=function(t){var e=this._element.style;for(var i in t)e[i]=t[i]},Nt.prototype.getId=function(){return this._element.id},Nt.prototype.setId=function(t){this._element.id=t},Nt.prototype.toString=function(){var t=this._element.outerHTML;return t=t.replace(this._element.innerHTML,"")},Nt.prototype.getTextContent=function(){return this._element.textContent},Nt.prototype.setTextContent=function(t){this._element.textContent=t},Nt.prototype.getLeft=function(){return this._element.offsetLeft},Nt.prototype.setLeft=function(t){return this._element.style.left=t+"px",!0},Nt.prototype.getTop=function(){return this._element.offsetTop},Nt.prototype.setTop=function(t){return this._element.style.top=t+"px",!0},Nt.prototype.getWidth=function(){return this._element.offsetWidth},Nt.prototype.setWidth=function(t){return this._element.style.width=t+"px",!0},Nt.prototype.getHeight=function(){return this._element.offsetHeight},Nt.prototype.setHeight=function(t){return t<0&&(t=0),this._element.style.height=t+"px",!0},Nt.prototype.getBoundingClientRect=function(){return this._element.getBoundingClientRect()},Nt.prototype.fillParentWidth=function(t){return null==t&&(t=100),this._element.style.width=t+"%",!0},Nt.prototype.fillParentHeight=function(t){return null==t&&(t=100),this._element.style.height=t+"%",!0},Nt.prototype.getTooltip=function(){return this.getAttribute("title")},Nt.prototype.setTooltip=function(t){t?this.setAttribute("title",t):this.removeAttribute("title")},Nt.prototype.show=function(t){this._element.style.display=!1!==t?"":"none"},Nt.prototype.hide=function(t){this.show(!1===t)},Nt.prototype.isVisible=function(){return"none"!==this._element.style.display},Nt.prototype.enable=function(t){(t=!1!==t)?this.removeAttribute("disabled"):(this.setAttribute("disabled","disabled"),this._element.disabled=!t)},Nt.prototype.disable=function(t){this.enable(!1===t)},Nt.prototype.isEnabled=function(){return!this._element.hasAttribute("disabled")},Nt.prototype.getScrollLeft=function(){return this._element.scrollLeft},Nt.prototype.getScrollTop=function(){return this._element.scrollTop},Nt.prototype.isEndOfHorizontalScroll=function(){return this._element.scrollLeft>=this._element.scrollWidth-this.getWidth()},Nt.prototype.isEndOfVerticalScroll=function(){return this._element.scrollTop>=this._element.scrollHeight-this.getHeight()},Nt._proto=Nt.prototype;var Ht=Nt,Bt=function(){this._items=[],this._element=null};s.inherits(Bt,Ht),Bt.prototype._items=[],Bt.prototype.hasItem=function(){return!!this._items.length},Bt.prototype.containItem=function(t){return this._items.indexOf(t)>-1},Bt.prototype.insertItem=function(t,e){var i=this._items;i.indexOf(t)>-1||(i.push(t),e&&(t._order=e),i.length&&i.sort(Bt._iconComparer),this._updatePanelItems())},Bt.prototype.removeItem=function(t){var e=this._items,i=-1;if(t)for(var n=e.length;--n>=0;){var o=e[n];if("string"==typeof t){if(o.classList.contains(t)){i=n;break}}else if(o===t){i=n;break}}else i=e.length-1;var r=null;return i>-1&&(r=e.splice(i,1)[0]),this._updatePanelItems(),r},Bt.prototype.clearItems=function(){var t=this._items;t.length&&(t.length=0,this._updatePanelItems())},Bt._iconComparer=function(t,e){return t._order?e._order?t._order-e._order:1:e._order?-1:0},Bt.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])}};var Gt=Bt,Wt=function(t,e){this._id=Wt._runningId++,this._element=document.createElement("div"),this._element.className="cell",e&&(this._section=e)};s.inherits(Wt,Ht),Wt.prototype._aligner=null,Wt._runningId=0,Wt.prototype._id=0,Wt.prototype._width=-1,Wt.prototype._height=-1,Wt.prototype._visible=!0,Wt.prototype._rawContent,Wt.prototype._section=null,Wt.prototype._contentLocked=!1,Wt.prototype._collapsedState=0,Wt.prototype._floatingPanel=null,Wt.prototype._frontIcon=null,Wt.prototype.getContent=function(t){return t&&this._element?this._element.children:this._content||null},Wt.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 n=this._setRawContent(t);return null!=e&&this._content&&this._content.setAttribute("title",e),n},Wt.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)))},Wt.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},Wt.prototype.getNextSibling=function(){return null!==this._element?this._element.nextSibling:null},Wt.prototype.getParent=function(){return null!==this._element?this._element.parentNode:null},Wt.prototype.setParent=function(t,e){var i=ot.getElement(t);if(i){if(this.initialize(),1===this._collapsedState)return;var n;!0===e&&(n=i.firstChild),n?i.insertBefore(this._element,n):i.appendChild(this._element)}else this.removeParent()},Wt.prototype.removeParent=function(){var t=this._element;t&&t.parentNode&&t.parentNode.removeChild(t)},Wt.prototype.insertBefore=function(t){var e=ot.getElement(t);if(null!=e){var i=e.parentNode;null!=i&&(this.initialize(),i.insertBefore(this._element,e))}else this.setParent(this.getParent())},Wt.prototype.getTextContent=function(){return this._rawContent?"string"==typeof this._rawContent?this._rawContent:this._rawContent.textContent:""},Wt.prototype.getTextElement=function(){return this._textSpan},Wt.prototype.getWidth=function(){return this._width>=0?this._width:this._element.offsetWidth},Wt.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)},Wt.prototype.getHeight=function(){return this._height>=0?this._height:this._element.offsetHeight},Wt.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)},Wt.prototype.fillParentWidth=function(t){return!1},Wt.prototype.fillParentHeight=function(t){return!1},Wt.prototype.show=function(t){var e=!1!==t;e!==this._visible&&(this._visible=e,this._updateDisplay())},Wt.prototype.isVisible=function(){return this._visible},Wt.prototype.getScrollLeft=function(){return 0},Wt.prototype.getScrollTop=function(){return 0},Wt.prototype.isEndOfHorizontalScroll=function(){return!0},Wt.prototype.isEndOfVerticalScroll=function(){return!0},Wt.prototype.hasElement=function(){return null!==this._element},Wt.prototype.getSection=function(){return this._section},Wt.prototype.initialize=function(){return null==this._aligner&&(ot.isIE?this._aligner=document.createElement("div"):this._aligner=document.createElement("button"),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},Wt.prototype.updateIcon=function(t){if(t){var e=this._frontIcon;if(e){if(e.containItem(t))return;e.clearItems()}this.insertFrontIcon(t,0)}},Wt.prototype.removeIcon=function(){var t=this._frontIcon;t&&(t.clearItems(),this._element.removeChild(t.getElement()),t=this._frontIcon=null)},Wt.prototype.isFrozen=ot._deprecatedFunction,Wt.prototype.freezeLayout=ot._deprecatedFunction,Wt.prototype.setAutoContentClipping=ot._deprecatedFunction,Wt.prototype.setContentTooltip=function(t){return!(null==t||!this._content)&&(this._content.setAttribute("title",t),!0)},Wt.prototype.lockContent=function(t){this._contentLocked=!1!==t},Wt.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 n=this.blinking;n&&(n.blinking>=0&&clearTimeout(n.blinking),n.cell=null,n.styles=null,delete this.blinking),this.removeIcon(),this.setContent(null),this._textSpan&&(this._textSpan.className="text",this._textSpan.textContent="")}},Wt.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)},Wt.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)},Wt.prototype.insertFloatingIcon=function(t,e){if(t){var i=this._floatingPanel;i||(i=this._floatingPanel=new Gt),i.insertItem(t,e),i.addClass("floating-panel");var n=this._element;n.contains(i.getElement())||n.appendChild(i.getElement())}},Wt.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},Wt.prototype.insertFrontIcon=function(t,e){if(t){var i=this._frontIcon;i||(i=this._frontIcon=new Gt),i.insertItem(t,e),i.addClass("front-panel");var n=this._element;n.contains(i.getElement())||n.insertBefore(i.getElement(),n.firstChild)}},Wt.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},Wt.prototype.getCellId=function(){return this._id},Wt.prototype.updatePadding=function(){},Wt.prototype.collapse=function(t,e){var i,n=!1!==t;return i=n?e?2:1:0,this._collapsedState!==i&&(n?e?this.addClass("spanned"):this.setParent(null):2===this._collapsedState&&this.removeClass("spanned"),this._collapsedState=i,!0)},Wt.prototype.isCollapsed=function(){return 0!==this._collapsedState},Wt.prototype.isKeptInDoc=function(){return 1!==this._collapsedState},Wt.prototype.getClientWidth=function(){return this._element?this._element.clientWidth:this.getWidth()},Wt.prototype.getClientHeight=function(){return this._element?this._element.clientHeight:this.getHeight()},Wt.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},Wt.prototype._updateDisplay=function(){var t=!1;this.isVisible()&&this._width&&this._height&&(t=!0),this._element.style.display=t?"":"none"},Wt._proto=Wt.prototype;var Ut=Wt,Yt=function(){this._ends=[],this._cols=[]};Yt.prototype._laneCount=0,Yt.prototype._defaultSize=10,Yt.prototype._defaultScalability=!0,Yt.prototype._homogeneous=!0,Yt.prototype._visibility=!0,Yt.prototype._ends,Yt.prototype._cols,Yt.prototype._bits=[1,2,4,8],Yt.prototype.hitTest=function(t){if(t<0)return-1;if(t>=this.getTrackSize())return~this._laneCount;var e=-1,i=0;if(this._homogeneous){var n=this._defaultSize;i=((e=Math.floor(t/n))+1)*n}else e=ot.upperBound(this._ends,t),i=this._ends[e];return(e>=this._laneCount||t>=i)&&(e=~e),e},Yt.prototype.dispose=function(){this._cols=this._ends=null},Yt.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},Yt.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},Yt.prototype.isHomogeneous=function(){return this._homogeneous},Yt.prototype.isAtMinimumSize=function(t){var e=this._getMinimumScalingSize(t);return(null!=t?this.getLaneSize(t):this.getTrackSize())<=e},Yt.prototype.isFixedSize=function(){for(var t=0;t<this._laneCount;++t)if(this.getLaneScalability(t))return!1;return!0},Yt.prototype.clearLaneCustomizations=function(){this._ends.length=0,this._cols.length=0,this._homogeneous=!0},Yt.prototype.getLaneCount=function(){return this._laneCount},Yt.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))},Yt.prototype.getDefaultLaneSize=function(){return this._defaultSize},Yt.prototype.setDefaultLaneSize=function(t){return t<0&&(t=0),this._defaultSize!==t&&(this._defaultSize=t,this._markDirtyIndex(0),!0)},Yt.prototype.getLaneDefaultSize=function(t){if(t<0||t>=this._laneCount)return-1;var e=this._newColumn(t);return e.defaultSize?e.defaultSize:-1},Yt.prototype.setLaneDefaultSize=function(t,e){t<0||t>=this._laneCount||e>=0&&(this._newColumn(t).defaultSize=e)},Yt.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},Yt.prototype.getDefaultScalability=function(){return this._defaultScalability},Yt.prototype.setDefaultScalability=function(t){return this._defaultScalability!==t&&(this._defaultScalability=t,!0)},Yt.prototype.getTrackSize=function(){return!this._visibility||this._laneCount<=0?0:this._homogeneous?this._laneCount*this._defaultSize:(this._updateEndPoints(),this._ends[this._laneCount-1])},Yt.prototype.setTrackSize=function(t){var e=0,i=0,n=[];for(e=0;e<this._laneCount;++e){var o=this._cols[e];o?o.invisibility||(!1!==this._getLaneScalability(o)?n.push(e):i+=this._getFixedSize(o)):n.push(e)}if(n.length<=0)return null;var r=this._distributeLaneSize(t-i,n),s=!1,l=[];for(e=r.length;--e>=0;){l[e]=0;var a=r[e];if(null!=a){var u=this.getLaneSize(e);this._newColumn(e),this._setCalculatedLaneSize(e,a)&&(l[e]=a-u,s=!0)}}return s?l:null},Yt.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},Yt.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]))},Yt.prototype.getLaneSize=function(t){if(this._visibility){var e=this._cols[t];return e?e.actualSize:this._defaultSize}return 0},Yt.prototype.getCustomLaneSize=function(t){var e=this._cols[t];return e&&null!=e.customSize?e.customSize:this._defaultSize},Yt.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))},Yt.prototype.setLaneProperty=function(t,e,i){if(t<0||t>=this._laneCount)return!1;var n=this._cols[t];return(null==n||n[e]!==i)&&((n=this._newColumn(t))[e]=i,!0)},Yt.prototype.getLaneProperty=function(t,e){var i=this._cols[t];return i&&null!=i[e]?i[e]:null},Yt.prototype.getMinimumLaneSize=function(t){var e=this._cols[t];return e&&null!=e.minSize?e.minSize:0},Yt.prototype.setMinimumLaneSize=function(t,e,i){if(t<0||t>=this._laneCount)return!1;if(e<0&&(e=0),this.getMinimumLaneSize(t)!==e){var n=this._newColumn(t);return n.minSize=e,i&&this.getLaneScalability(t)&&(n.customSize=e),this._setCalculatedLaneSize(t)}return!1},Yt.prototype.isLaneVisible=function(t){var e=this._cols[t];return!e||!e.invisibility},Yt.prototype.showLane=function(t,e){return this.hideLane(t,!1===e)},Yt.prototype.hideLane=function(t,e,i){if(t<0||t>=this._laneCount)return!1;var n=this._newColumn(t),o=!n.invisibility,r=null!=i?this._bits[i]:1;return!1!==e?n.invisibility|=r:n.invisibility&=~r,o!==!n.invisibility&&this._setCalculatedLaneSize(t)},Yt.prototype.getLaneVisibilityBit=function(t,e){if(t>=0&&t<this._laneCount){var i=this._cols[t];if(i){var n=null!=e?this._bits[e]:1;if(i.invisibility&n)return!1}}return!0},Yt.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)},Yt.prototype.getLaneScalability=function(t){var e=this._cols[t];return e&&null!=e.scalability?e.scalability:this._defaultScalability},Yt.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)},Yt.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},Yt.prototype.insertLane=function(t,e){t<0&&(t=0);var i=1;if(ot.isNumber(e)){if(e<=0)return;i=e,e=null}if(t>=this._laneCount&&(t=this._laneCount,!e))this.setLaneCount(this._laneCount+i);else if(this._laneCount+=i,this._markDirtyIndex(t),ot.insertEmptyItems(this._cols,t,i),e)for(var n=t+i,o=t;o<n;++o)this.deserializeLane(o,e)},Yt.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 i=t<e?t:e;this._markDirtyIndex(i),ot.moveArrayItem(this._cols,t,e)}},Yt.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},Yt.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)}},Yt.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}},Yt.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 n=null!=i.minSize?i.minSize:0;e<n&&(e=n)}}else e=0;return i.actualSize!==e&&(i.actualSize=e,this._homogeneous=!1,this._markDirtyIndex(t),!0)},Yt.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 n=this._laneCount;--n>=0;)e+=this._getMinimumScalingSize(n);return e},Yt.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},Yt.prototype._getLaneScalability=function(t){return null==t.scalability?this._defaultScalability:t.scalability},Yt.prototype._distributeLaneSize=function(t,e){if(e.length<=0)return[];t<0&&(t=0);var i=0,n=0,o=0,r=0,s=[],l=[],a=[];for(i=e.length;--i>=0;)s[o=e[i]]=this.getMinimumLaneSize(o),l[o]=this.getCustomLaneSize(o),n+=l[o];for(var u=!0;u;)for(u=!1,i=e.length;--i>=0;){var h=s[o=e[i]],p=l[o];(r=t*p/n)<=h&&(u=!0,a[o]=h,t-=h,n-=p,e.splice(i,1))}var d=e.length-1,c=0,_=0;for(i=d;--i>=0;){r=t*l[o=e[i]]/n;var f=Math.floor(r);(_+=r-f)>=1&&(++f,--_),a[o]=f,c+=f}return a[e[d]]=Math.floor(t-c),a},Yt.prototype._markDirtyIndex=function(t){t<this._ends.length&&(this._ends.length=t)},Yt.prototype._newColumn=function(t){var e=this._cols[t];return e||(this._cols[t]=e={},e.invisibility=0),e},Yt.prototype.copyFrom=function(t,e){if(!this._homogeneous||!t._homogeneous||this._defaultSize!==t._defaultSize){e||(e=0);var i=t.getLaneCount(),n=this.getLaneCount(),o=e+i;o>n&&(o=n);for(var r=0,s=e;s<o;++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)))}}};var qt=Yt,Xt=function(){};Xt.prototype.hitTest=function(t,e,i){},Xt.prototype.hitTestX=function(t){},Xt.prototype.hitTestY=function(t){},Xt.prototype.getDefaultColumnWidth=function(){},Xt.prototype.setDefaultColumnWidth=function(t){},Xt.prototype.getDefaultRowHeight=function(){},Xt.prototype.setDefaultRowHeight=function(t){},Xt.prototype.getColumnWidth=function(t){},Xt.prototype.setColumnWidth=function(t,e){},Xt.prototype.getRowHeight=function(t){},Xt.prototype.setRowHeight=function(t,e){},Xt.prototype.isColumnVisible=function(t){},Xt.prototype.hideColumn=function(t,e){},Xt.prototype.isRowVisible=function(t){},Xt.prototype.hideRow=function(t,e){},Xt.prototype.getMinimumColumnWidth=function(t){},Xt.prototype.setMinimumColumnWidth=function(t,e){},Xt.prototype.getMinimumRowHeight=function(t){},Xt.prototype.setMinimumRowHeight=function(t,e){},Xt.prototype.getCellLeft=function(t){},Xt.prototype.getCellTop=function(t){},Xt.prototype.getCellWidth=function(t,e){},Xt.prototype.getCellHeight=function(t,e){},Xt.prototype.hasCellSpan=function(){},Xt.prototype.getCellRowSpan=function(t,e){},Xt.prototype.setCellRowSpan=function(t,e,i){},Xt.prototype.getCellColSpan=function(t,e){},Xt.prototype.setCellColSpan=function(t,e,i){},Xt.prototype.clearCellSpans=function(){},Xt.prototype.clearColumnSpans=function(t){},Xt.prototype.clearColumnCustomizations=function(){},Xt.prototype.clearRowCustomizations=function(){},Xt.prototype.getColumnScalability=function(t){},Xt.prototype.setColumnScalability=function(t,e){},Xt.prototype.getRowScalability=function(t){},Xt.prototype.setRowScalability=function(t,e){},Xt.prototype.getCell=function(t,e,i){},Xt.prototype.getCellContent=function(t,e){},Xt.prototype.setCellContent=function(t,e,i){},Xt.prototype.getColumn=function(t){},Xt.prototype.getColumnCount=function(){},Xt.prototype.setColumnCount=function(t){},Xt.prototype.getRowCount=function(){},Xt.prototype.setRowCount=function(t,e){},Xt.prototype.getVisibleRowCount=function(){},Xt.prototype.addRow=function(t){},Xt.prototype.removeRow=function(t){},Xt.prototype.setBorders=function(t,e,i,n){},Xt.prototype.getColumnStyle=function(t,e){},Xt.prototype.setColumnStyle=function(t,e,i){},Xt.prototype.enableColumnClass=function(t,e,i){},Xt.prototype.hasColumnClass=function(t,e){},Xt.prototype.enableRowClass=function(t,e,i){},Xt.prototype.setRowStyle=function(t,e,i,n){},Xt.prototype.getRelativePosition=function(t){},Xt.prototype.getContentWidth=function(){},Xt.prototype.getContentHeight=function(){},Xt.prototype.getCellsByRowIndex=function(t){},Xt.prototype.disableHorizontalGridLine=function(t){},Xt.prototype.disableVerticalGridLine=function(t){},Xt.prototype.enableShading=function(t){},Xt.prototype.setTransposedShading=function(t){},Xt.prototype.enableRowHighlighting=function(t){},Xt.prototype.getRowHighlight=function(){},Xt.prototype.setRowHighlight=function(t){},Xt.prototype.getSelectedRows=function(){},Xt.prototype.getSelectedRowCount=function(){},Xt.prototype.isSelectedRow=function(t){},Xt.prototype.getRowAnchor=function(){},Xt.prototype.setRowAnchor=function(t){},Xt.prototype.setSelectedRow=function(t,e){},Xt.prototype.selectSingleRow=function(t){},Xt.prototype.selectRowRange=function(t,e){},Xt.prototype.clearSelectedRows=function(){},Xt.prototype.getFirstSelectedRow=function(){},Xt.prototype.getLastSelectedRow=function(){},Xt.prototype.activateColumn=function(t,e){},Xt.prototype.activateRows=function(t,e,i){},Xt.prototype.moveRowsToTop=function(t){},Xt.prototype.getFirstIndexInView=function(){},Xt.prototype.getLastIndexInView=function(){},Xt.prototype.isInCurrentView=function(t){},Xt.prototype.getFrozenLayout=function(){},Xt.prototype.setFrozenLayout=function(t){},Xt.prototype.insertColumn=function(t,e){},Xt.prototype.removeColumnAt=function(t){},Xt.prototype.moveColumn=function(t,e){},Xt.prototype.enableRowVirtualization=function(t){},Xt.prototype.enableColumnVirtualization=function(t){},Xt.prototype.getColumnIndex=function(t){},Xt.prototype.getCellIndex=function(t,e){},Xt.prototype.getIndex=function(){},Xt.prototype.setIndex=function(t){},Xt.prototype.getRowOffset=function(){},Xt.prototype.setRowOffset=function(t){},Xt.prototype.updateLayout=function(){},Xt.prototype.stretchCell=function(t,e,i,n){},Xt.prototype.unstretchCell=function(t,e){},Xt.prototype.unstretchAllCells=function(){},Xt.prototype.getStretchedCell=function(t,e){},Xt.prototype.getStretchedCells=function(){},Xt.prototype.updateStretchedCells=function(){},Xt.prototype.getColumnHost=function(){},Xt.prototype.setHidingMethod=function(t){},Xt.prototype.getHidingMethod=function(){},Xt.prototype.setColumnVisibility=function(t,e,i){},Xt.prototype.getRowLayout=function(){},Xt.prototype.reserveRightSpace=function(t){},Xt.prototype.getReservedSpace=function(){},Xt.prototype.getComputedStyle=function(){},Xt.prototype.isColumnActive=function(t){},Xt.prototype.setRowAttributes=function(t,e){},Xt.prototype.getContextRow=function(t){},Xt.prototype.selectColumn=function(t,e){},Xt.prototype.isSelectedColumn=function(t){},Xt.prototype.selectCell=function(t,e,i){},Xt.prototype.setCellBounds=function(t,e,i,n){},Xt.prototype.getHorizontalLayout=function(){},Xt.prototype.calculateColumnBounds=function(t,e,i,n){},Xt.prototype.updateColumnBounds=function(t,e,i){},Xt.prototype.updateColumnSeparators=function(){};var jt=function(t){(this._element=document.createElement("div")).className="column",this._cells=[],this._section=t};s.inherits(jt,Ht),jt.prototype._nextSibling=null,jt.prototype._parent=null,jt.prototype._section=null,jt.prototype._cells=null,jt.prototype._cellStart=0,jt.prototype._cellEnd=0,jt.prototype._autoStyleUpdating=!1,jt.prototype._deactivation=!1,jt.prototype._sizeClasses=null,jt.prototype._colLeft=0,jt.prototype._absolute=!1,jt.prototype._scrollFrame=null,jt.prototype._invisibility=0,jt.prototype._bits=[1,2,4,8],jt.prototype._pinned=!0,jt.prototype.clearContent=function(){for(var t=this._cells.length;--t>=0;)this._cells[t].setContent(null)},jt.prototype.setLeft=function(t){return this._colLeft=t,this._absolute&&(this._element.style.left=t+"px"),!0},jt.prototype.enableAbsolutePosition=function(t){(t=!1!==t)!==this._absolute&&(this._absolute=t,this._element.style.left=t?this._colLeft+"px":"")},jt.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},jt.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")},jt.prototype.setStyles=function(t){var e=this._element,i=e.style;for(var n in t)i[n]=t[n];e.style.backgroundColor?e.classList.contains("no-shading")||e.classList.add("no-shading"):e.classList.contains("no-shading")&&e.classList.remove("no-shading")},jt.prototype.show=function(t){this.setVisibility(0,!1!==t)},jt.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 n=this._sizeClasses;if(n){if(n.length>i){for(e=n.length;--e>=i;)this.removeClass(n[e]);n.length=i}i||(this._sizeClasses=null)}if(i)for(n||(n=[],this._sizeClasses=n),e=n.length;e<i;++e)n[e]=jt._sizeClasses[e],this.addClass(n[e]);return this.setVisibility(1,t>0),!0},jt._sizeClasses=["small-col","very-small-col","tiny-col"],jt.prototype.setHeight=function(t){return this._element.style.height=t+"px",this.setVisibility(2,t>0),!0},jt.prototype.getParent=function(){return this._parent},jt.prototype.setParent=function(t,e){if(this._element){this._parent=ot.getElement(t);var i=this._section?this._section.getHidingMethod():"";this._invisibility&&!i||this._setParent(this._parent,e)}},jt.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())},jt.prototype.enableAutoStyleUpdating=function(t){t=!1!==t,this._autoStyleUpdating!==t&&(this._autoStyleUpdating=t)},jt.prototype.setNextSibling=function(t){this._nextSibling=t},jt.prototype.isActive=function(){return!(this._invisibility&this._bits[3])},jt.prototype.disableDeactivation=function(t){this._deactivation=!1!==t,this._deactivation&&(this.isActive()||this.activate())},jt.prototype.activate=function(t){return t=this._pinned||this._deactivation||!1!==t,this.isActive()!==t&&(this.setVisibility(3,t),!0)},jt.prototype.deactivate=function(t){this.activate(!1===t)},jt.prototype.setCellCount=function(t){var e;for(e=this._cells.length;e<t;++e)this._cells.push(new Ut(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)},jt.prototype.getCell=function(t){return this._cells[t]||null},jt.prototype.collapseCells=function(t,e,i,n,o){if(!(e<=0)){var r=!1,s=this._cells[t];s&&!n&&(r|=s.collapse(i,o));for(var l=1;l<e&&(s=this._cells[t+l]);++l)r|=s.collapse(i,o);r&&(i?e>1&&(this._hasCollapsedCells=!0):this.updateCellOrders())}},jt.prototype.uncollapseAllCells=ot._deprecatedFunction,jt.prototype.activateCells=function(t,e){var i,n=this._element;if(this._hasCollapsedCells)t=this._cellEnd,e>this._cellEnd&&(this._cellEnd=e);else if(this._cellStart===t){var o=this._cellEnd-e;if(o>0){for(i=this._cellEnd;--i>=e;)this._cells[i].removeParent();return void(this._cellEnd=e)}if(!(o<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(),n.appendChild(r.getElement()))}},jt.prototype.moveCellsToTop=function(t){if(this.isActive()){for(var e=this._element,i=0;i<t;++i){var n=this._cells[i];n.isKeptInDoc()&&e.appendChild(n.getElement())}this._cells=ot.cycleArray(this._cells,t)}},jt.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}},jt.prototype.hasCollapsedCells=function(){return this._hasCollapsedCells},jt.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},jt.prototype.getSection=function(){return this._section},jt.prototype.log=function(){for(var t=[],e=this._cells.length,i=0;i<e;++i)t.push(this._cells[i].getTextContent());return t},jt.prototype.getVisibility=function(){return!this._invisibility},jt.prototype.setVisibility=function(t,e){var i=!this._invisibility,n=this._bits[t]||1;e?this._invisibility&=~n:this._invisibility|=n;var o=!this._invisibility;if(i!==o)if(this._section?this._section.getHidingMethod():"")this.enableClass("hidden",!o);else if(o){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)},jt.prototype.updateLayout=function(){},jt.prototype.setScrollState=function(t,e,i){this._scrollFrame=t,this.enableAbsolutePosition(i),this.setParent(e||this._section.getColumnHost()),e||this.activate(),this._pinned=!e},jt._proto=jt.prototype;var Kt=jt,Jt=function(){this._items=[]};Jt.prototype._items=null,Jt.prototype.dispose=function(){this._items=null},Jt.prototype.setItemCount=function(t){var e=this._items,i=e.length;if(i!==t)for(e.length=t;i<t;)e[i++]={}},Jt.prototype.getItem=function(t){return this._items[t]||null},Jt.prototype.moveItemsToTop=function(t){this._items=ot.cycleArray(this._items,t)};var Qt=Jt,Zt=function(t,e,i){t.setTop(e.getLaneStart(i)),t.setHeight(e.getLaneSize(i))},$t=function(t,e,i,n){if(i){var o=e.getLaneStart(i);t.setLeft(o),t.setWidth(n-o)}else t.setStyle("left",""),t.setWidth(n)},te=function(t,e,i){this._trackX=t,this._trackY=e,this._section=i,this._cells=[]};te.prototype._trackX,te.prototype._trackY,te.prototype._section,te.prototype._cells,te.prototype._activeCount=0,te.prototype._stretchSize=0,te.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},te.prototype.setStretchSize=function(t){this._stretchSize=t},te.prototype.getStretchSize=function(){return this._stretchSize},te.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 n=e[i];n&&n.dispose()}e.length=t}},te.prototype.getCell=function(t){var e=this._cells[t];return e&&e.getParent()?e:null},te.prototype.getCells=function(){var t=[];if(this._activeCount){for(var e=this._cells,i=e.length,n=0;n<i;++n){var o=e[n];o&&o.getParent()&&t.push(o)}this._activeCount=t.length}return t},te.prototype.getColumnIndex=function(t){if(t){if(!t.getElement)return null!=t._colIndex?t._colIndex:-1;var e=t.getElement();if(e)return null!=e._colIndex?e._colIndex:-1}return-1},te.prototype.getRowIndex=function(t){if(t){if(t.getElement)return t.getParent()?this._cells.indexOf(t):-1;for(var e=this._cells,i=e.length,n=0;n<i;++n){var o=e[n];if(o&&o.getParent()&&o.getElement()===t)return n}}return-1},te.prototype.stretchCell=function(t,e){++this._activeCount,(!e||e<0)&&(e=0);var i=this._cells[t]||null;i||((i=new Ut(null,this._section)).addClass("tr-stretched"),i.stretched=!0,this._cells[t]=i);var n=i.getElement();n.stretched=!0,n._colIndex!==e&&(n._colIndex=e,e>0?n.classList.add("right-stretching"):n.classList.remove("right-stretching")),n._rowIndex!==t&&(n._rowIndex=t);var o=this._stretchSize||this._trackX.getTrackSize();return $t(i,this._trackX,e,o),Zt(i,this._trackY,t),i},te.prototype.unstretchCell=function(t){var e=this._cells[t]||null;return e&&e.setParent(null),e},te.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)}}},te.prototype.updateCells=function(){if(this._activeCount){for(var t=0,e=this._cells,i=e.length,n=this._trackX,o=this._trackY,r=this._stretchSize||n.getTrackSize(),s=0;s<i;++s){var l=e[s];l&&l.getParent()&&(++t,$t(l,n,l.getElement()._colIndex,r),Zt(l,o,s))}this._activeCount=t}},te.prototype.updateXAxis=function(){if(this._activeCount){for(var t=0,e=this._cells,i=e.length,n=this._trackX,o=this._stretchSize||n.getTrackSize(),r=0;r<i;++r){var s=e[r];s&&s.getParent()&&(++t,$t(s,n,s.getElement()._colIndex,o))}this._activeCount=t}},te.prototype.updateYAxis=function(){if(this._activeCount){for(var t=0,e=this._cells,i=e.length,n=this._trackY,o=0;o<i;++o){var r=e[o];r&&r.getParent()&&(++t,Zt(r,n,o))}this._activeCount=t}},te.prototype.moveCellsToTop=function(t){this._activeCount&&(this._cells=ot.cycleArray(this._cells,t),this.updateYAxis())};var ee=te,ie=function(t,e){this.indexX=t,this.indexY=e};ie.prototype.isSpanIndices=function(t,e){return t===this.indexX&&e===this.indexY},ie.prototype.isOccupiedIndices=function(t,e){return t!==this.indexX||e!==this.indexY},ie.prototype.register=function(t,e){this._register(t,e,!0)},ie.prototype.unregister=function(t,e){this._register(t,e,!1)},ie.prototype._register=function(t,e,i){var n=t.indexOf(this);i?n<0&&t.push(this):n>=0&&t.splice(n,1);for(var o=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]=o},ie.prototype.indexX,ie.prototype.indexY,ie.prototype.colSpan=1,ie.prototype.rowSpan=1,ie.prototype.prevColSpan=1,ie.prototype.prevRowSpan=1,ie.prototype.retVal=0;var ne=ie,oe=function(){this._spans=[],this._occupiedMap={}};oe.prototype.removeColumn=function(t){var e=!1;return this.removeSpanByColIndex(t)&&(e=!0),this.shiftColumn(t,-1)&&(e=!0),e},oe.prototype.freezeMapping=function(t){this._frozenMapping=!1!==t,this._frozenMapping||this._mapCellSpans()},oe.prototype._mapCellSpans=function(){var t,e,i=this._spans;for(this._spans=[],this._occupiedMap={},t=i.length;--t>=0;)(e=i[t]).indexX>=0&&e.register(this._spans,this._occupiedMap)},oe.prototype.shiftColumn=function(t,e){if(this._spans.length<=0||0===e)return!1;for(var i=!1,n=this._spans.length;--n>=0;){var o=this._spans[n];o.indexX>=t&&(i=!0,o.indexX+=e)}return!(!i||this._frozenMapping)&&(this._mapCellSpans(),!0)},oe.prototype.removeSpan=function(t,e){if(this._spans.length<=0)return null;var i=t+","+e,n=this._occupiedMap[i];return!n||n.isOccupiedIndices(t,e)?null:(n.unregister(this._spans,this._occupiedMap),n)},oe.prototype.removeSpanByColIndex=function(t,e){var i,n=this._spans.length;if(n<=0)return null;for(var o=e||[],r=0,s=0;s<n;++s)(i=this._spans[s])&&i.indexX===t&&(o.push(i),r++);if(r<=0)return null;for(n=o.length,s=0;s<r;++s)o[n-s-1].unregister(this._spans,this._occupiedMap);return o},oe.prototype.removeSpanStartedFromRowIndex=function(t,e){var i,n=this._spans.length;if(n<=0)return null;for(var o=e||[],r=0,s=0;s<n;++s)(i=this._spans[s])&&i.indexY>=t&&(o.push(i),r++);if(r<=0)return null;for(n=o.length,s=0;s<r;++s)o[n-s-1].unregister(this._spans,this._occupiedMap);return o},oe.prototype.clearAllSpans=function(){if(this._spans.length<=0)return null;var t=this._spans;return this._spans=[],this._occupiedMap={},t},oe.prototype.hasSpan=function(){return this._spans.length>0},oe.prototype.getSpan=function(t,e){var i=this.getOccupyingSpan(t,e);return i&&i.isSpanIndices(t,e)?i:null},oe.prototype.getOccupyingSpan=function(t,e){return this._spans.length<=0?null:this._occupiedMap[t+","+e]||null},oe.prototype.getAllSpans=function(){return this._spans},oe.prototype.getColSpan=function(t,e){var i=this._occupiedMap[t+","+e];return null==i?1:i.isOccupiedIndices(t,e)?i.indexX-t:i.colSpan},oe.prototype.getRowSpan=function(t,e){var i=this._occupiedMap[t+","+e];return null==i?1:i.isOccupiedIndices(t,e)?i.indexY-e:i.rowSpan},oe.prototype.setColSpan=function(t,e,i){return this._updateSpan(t,e,!0,i)},oe.prototype.setRowSpan=function(t,e,i){return this._updateSpan(t,e,!1,i)},oe.prototype._updateSpan=function(t,e,i,n){n<1&&(n=1);var o=this.getSpan(t,e);o&&(o.retVal=0);var r,s,l,a,u,h,p=t,d=e,c=o?o.colSpan:1,_=o?o.rowSpan:1,f=!0;if(i){if(c===n)return o;if(c>n)p=t+n,r=t+c,f=!1;else{if((l=this._occupiedMap[t+","+e])&&l!==o)return o;p=t+c,r=t+n}s=e+_}else{if(_===n)return o;if(_>n)d=e+n,s=e+_,f=!1;else{if((l=this._occupiedMap[t+","+e])&&l!==o)return o;d=e+_,s=e+n}r=t+c}if(f){var g=[];for(u=p;u<r;++u)for(h=d;h<s;++h){if(a=u+","+h,this._occupiedMap[a])return o;g.push(a)}for(null==o&&(o=new ne(t,e),a=t+","+e,this._spans.push(o),this._occupiedMap[a]=o),u=g.length;--u>=0;)this._occupiedMap[g[u]]=o}else{if(i?n+_<=2:n+c<=2){a=t+","+e;var y=this._spans.indexOf(o);this._spans.splice(y,1),this._occupiedMap[a]=null}for(u=p;u<r;++u)for(h=d;h<s;++h)this._occupiedMap[u+","+h]=null}return i?(o.prevColSpan=o.colSpan,o.colSpan=n):(o.prevRowSpan=o.rowSpan,o.rowSpan=n),o.retVal=f?1:-1,o},oe.prototype._spans,oe.prototype._occupiedMap,oe.prototype._frozenMapping=!1;var re=oe,se=function(){this._selections=[]};se.prototype.clone=function(){var t=new se;return t._selections=this._selections.concat(),t._count=this._count,t._anchor=this._anchor,t._firstIndex=this._firstIndex,t._lastIndex=this._lastIndex,t},se.prototype.toString=function(){return this._selections.join(", ")},se.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))},se.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)},se.prototype.deselectFrom=function(t){if(this._lastIndex<t)return!1;if(this._firstIndex>=t)return this.clearAllSelections(),!0;for(var e=this._lastIndex,i=this._selections,n=t;n<=e;++n)i[n]&&(i[t]=!1,--this._count);return this._anchor>=t&&(this._anchor=-1),this._lastIndex=this._findPrevSelection(t),!0},se.prototype.toggleSelection=function(t){this._selections[t]?this.deselect(t):this.select(t)},se.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)},se.prototype.selectRange=function(t,e){if(0!==e)if(t<0&&(t=0),1!==e&&-1!==e){var i=t,n=i+e;if(e<0&&(i=(n=i+1)+e),!(i>=n)){this._anchor=t,(this._firstIndex<0||i<this._firstIndex)&&(this._firstIndex=i),(this._lastIndex<0||n>=this._lastIndex)&&(this._lastIndex=n-1);for(var o=i;o<n;++o)this._select(o)}}else this.select(t)},se.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 n=0;for(n=t;n<i;++n)this._selections[n]&&(this._selections[n]=!1,--this._count)}}else this.deselect(t)},se.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 n=t;n<i;++n)if(this._selections[n])return!0;return!1},se.prototype.getSelection=function(t){return!0===this._selections[t]},se.prototype.setSelection=function(t,e){return!1!==e?this.select(t):this.deselect(t)},se.prototype.getSelectionAnchor=function(){return this._anchor},se.prototype.setSelectionAnchor=function(t){this._anchor=t},se.prototype.getSelectionCount=function(){return this._count},se.prototype.getFirstSelectedIndex=function(){return this._firstIndex},se.prototype.getLastSelectedIndex=function(){return this._lastIndex},se.prototype.getAllSelections=function(){if(this._count>0){for(var t=new Array(this._count),e=0,i=this._selections,n=this._lastIndex,o=this._firstIndex;o<=n;++o)i[o]&&(t[e++]=o);return t}return[]},se.prototype.getConnectedRanges=function(t,e){if(this._count>0){var i=[];(null==t||t<this._firstIndex)&&(t=this._firstIndex),(null==e||e>this._lastIndex)&&(e=this._lastIndex+1);for(var n=null,o=t;o<e;++o)this._selections[o]?n||(n=[o,-1]):n&&(n[1]=o-1,i.push(n),n=null);return n&&(n[1]=this._lastIndex,i.push(n),n=null),i}return[]},se.prototype.getSelectionMap=function(){return this._selections},se.prototype.clearAllSelections=function(){if(this._count>0){return this._selections.length=0,this._count=0,this._anchor=-1,this._firstIndex=-1,this._lastIndex=-1,0}return 0},se.prototype.copyFrom=function(t,e,i,n){if(!(n<=0)){var o=e+i;if(null!=t)if(!1!==t.hasSelection(e,n)){for(var r=0;r<n;++r)t._selections[e+r]?this.select(o+r):this.deselect(o+r);this._anchor=-1,t._anchor>=0&&t._anchor>=e&&t._anchor<e+n&&(this._anchor=t._anchor+i)}else this.deselectRange(o,n);else this.deselectRange(o,n)}},se.prototype._select=function(t){return!this._selections[t]&&(this._selections[t]=!0,++this._count,!0)},se.prototype._findNextSelection=function(t){if(this._lastIndex>=0)for(;++t<=this._lastIndex;)if(this._selections[t])return t;return-1},se.prototype._findPrevSelection=function(t){if(this._firstIndex>=0)for(;--t>=this._firstIndex;)if(this._selections[t])return t;return-1},se.prototype._selections=null,se.prototype._count=0,se.prototype._anchor=-1,se.prototype._firstIndex=-1,se.prototype._lastIndex=-1;var le=se,ae=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)};ae.prototype._func=null,ae.prototype._delay=0,ae.prototype._timerId=0,ae.prototype._pending=!1,ae.prototype.start=function(){this._func&&(this._timerId?this._pending=!0:this._timerId=setInterval(this._onInterval,this._delay))},ae.prototype.dispose=function(){this._timerId&&(clearInterval(this._timerId),this._timerId=0),this._func=null},ae.prototype._onInterval=function(){this._pending?this._pending=!1:(this._func(),clearInterval(this._timerId),this._timerId=0)},ae._proto=ae.prototype;var ue=ae,he=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 ue(t._onRestingPosition,300),t._element.addEventListener("scroll",t._onTrackScroll),t._element.addEventListener("mouseover",t._flash),t._element.appendChild(t._trackContent),t.disableKeyboardInput(!1),t._onThicknessChanged=t._dispatch.bind(t,"thicknessChanged"),he._queryNativeTrackThickness(t._onThicknessChanged),t._updateEffectiveArea()||t.listen("thicknessChanged",t._updateEffectiveArea)};s.inherits(he,Ht),he.prototype._vertical=!0,he.prototype._step=0,he.prototype._parentNode=null,he.prototype._hostClassName="",he.prototype._trackContent=null,he.prototype._panes=null,he.prototype._paneSliders=null,he.prototype._enabled=!0,he.prototype._active=!1,he.prototype._isFrozen=!1,he.prototype._otherScrollbar=null,he.prototype._autoHideScrollbar=!0,he.prototype._trackSize=120,he.prototype._tContentSize=0,he.prototype._tScrollVal=0,he.prototype._tPercentVal=0,he.prototype._paneSize=0,he.prototype._pContentSize=0,he.prototype._pScrollVal=0,he.prototype._footerCount=0,he.prototype._fadingId=0,he.prototype._postponeFading=!1,he.prototype._layoutChanged=!1,he.prototype._contentDirty=!0,he.prototype._layoutDirty=!0,he.prototype._touchInput=!0,he.prototype._swiping=!1,he.prototype._touchDrag=!1,he.prototype._startPos,he.prototype._endPos,he.prototype._smoothing=!0,he.prototype._smoothingId=0,he.prototype._smoothingSpeed=0,he.prototype._wheelScrolling="",he.prototype._mouseWheelLogic=null,he.prototype._onThicknessChanged=null,he._trackThickness=0,he._queryTimeout=0,he._queryStarted=!1,he._outerDummy=null,he._innerDummy=null,he._listeners=null,he.prototype._updateEffectiveArea=function(){var t=this.getTrackThickness();if(t){var e=this._vertical?"width":"height";this._element.style[e]=t+1+"px"}return!!t},he._queryNativeTrackThickness=function(t){if(he._queryStarted||he._repeatQuery(),t&&he._trackThickness<=0){var e=he._listeners;e||(e=he._listeners=[]),e.push(t)}},he._repeatQuery=function(){he._queryStarted=!0,he._retrieveNativeTrackThinkness()||(he._queryTimeout+=100,he._queryTimeout<3e3?setTimeout(he._repeatQuery,he._queryTimeout):(he._trackThickness=13,he._clearStaticResources()))},he._retrieveNativeTrackThinkness=function(){if(he._trackThickness>0)return!0;var t=he._innerDummy,e=he._outerDummy;t||((t=he._innerDummy=document.createElement("p")).style.width="100%",t.style.height="200px",(e=he._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 n=t.offsetWidth;return i==n&&(n=e.clientWidth),document.body.removeChild(e),(he._trackThickness=i-n)>0&&(he._clearStaticResources(),!0)},he._clearStaticResources=function(){he._innerDummy=he._outerDummy=null;var t=he._listeners;if(t){he._listeners=null;for(var e={},i=t.length;--i>=0;)t[i](e)}},he.updateTrackThickness=function(){he._trackThickness=0,he._queryTimeout=0,he._queryStarted=!1,he._queryNativeTrackThickness()},he.prototype.dispose=function(){var t=he._listeners;if(t){var e=t.indexOf(this._onThicknessChanged);e>=0&&(t.splice(e,1),this._onThicknessChanged=null)}this.unlistenAll(),this._smoothingId&&(clearInterval(this._smoothingId),this._smoothingId=0),this._active=this._layoutChanged=!1,this._dispose();for(var i=this._panes.length;--i>=0;)this._panes[i].dispose(),this._paneSliders[i].dispose();this._reverter.dispose()},he.prototype.getContent=function(t){return this._paneSliders[0].getContent(t)},he.prototype.getParent=function(){return this._parentNode},he.prototype.setParent=function(t,e){var i=ot.getElement(t),n=this._parentNode!==i;n&&this._parentNode&&(this.removeWheelListener(this._parentNode),this._parentNode.classList.remove(this._hostClassName)),this.isActive()?(this._setParent(i,e),this._parentNode=this._element.parentNode,this._parentNode&&this._parentNode.classList.add(this._hostClassName)):this._parentNode=i,n&&this.addWheelListener(this._parentNode)},he.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"},he.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()},he.prototype._onEnablingStateChange=function(){var t=this;t._enabled?t._dispatch("enabled",{}):t._dispatch("disabled",{})},he.prototype.isActive=function(){return this._active},he.prototype.isEnabled=function(){return this._enabled},he.prototype.enable=function(t){t=!1!==t,this._enabled!=t&&(this._enabled=t,this._updateLayout(),this._onEnablingStateChange())},he.prototype.disable=function(t){this.enable(!1===t)},he.prototype.getTrackSize=function(){return this._trackSize},he.prototype.getPaneSize=function(){return this._paneSize},he.prototype.getContentSize=function(){return this._pContentSize},he.prototype.getTrackThickness=function(){return he._trackThickness},he.prototype.getScrollGap=function(){return this._pContentSize-this.getPaneSize()},he.prototype.setTrackSize=function(t,e){this._trackSize=t>0?t:0,this._paneSize=e>0?e:0},he.prototype.calculateContentSize=function(){return 0},he.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)},he.prototype.invalidate=function(t,e){this._contentDirty=!0,this._layoutDirty=!0,null!=e&&(this._pScrollVal=e),t&&this.update()},he.prototype.invalidateContent=function(){this._contentDirty=!0},he.prototype.isScrollPosValid=function(t){var e=t-this.getPaneSize(),i=this._pScrollVal;return 0===i||i>0&&e>0&&i<e},he.prototype.flash=function(){this.update(),this._flash()},he.prototype._scroll=function(t){this._scrollTo(this._pScrollVal+t)},he.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",{})}},he.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)},he.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},he.prototype._setTrackScrollVal=function(t){var e=this._getTrackGap(),i=0;if(e>0){if(t>0){var n=this.getScrollGap();i=e===n?t:t/n*e,i=Math.round(i)}i>=e&&(i=e)}if(i!==this._tScrollVal){this._tScrollVal=i,this._tPercentVal=e?i/e:0;var o=this._element;return this._vertical?o.scrollTop=i:o.scrollLeft=i,!0}return!1},he.prototype._getTrackGap=function(){var t=this._tContentSize-this.getTrackSize();return t>0?t:0},he.prototype._getScrollValue=function(){return this._pScrollVal},he.prototype._isEndOfScroll=function(){return!this._active||this._pScrollVal>=this.getScrollGap()},he.prototype._isStartOfScroll=function(){return!this._pScrollVal},he.prototype._isOnEdge=function(t){return t<0&&this._isStartOfScroll()||t>0&&this._isEndOfScroll()},he.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)))},he.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)}},he.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))},he.prototype.disableTouchInput=function(t){this._touchInput=!1===t},he.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))},he.prototype.getAutoHide=function(){return this._autoHideScrollbar},he.prototype.setOtherScrollbar=function(t){this._otherScrollbar=t},he.prototype.setFooterCount=function(t){this._footerCount=t},he.prototype._calcActiveState=function(){if(this._enabled&&this.getTrackSize()>20){var t=this.getPaneSize();if(t>0)return this._pContentSize-t>0}return!1},he.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 n=this._panes.length;--n>=0;)this._panes[n].setWidth(i)}this._scrollTo(this._pScrollVal,!0)}},he.prototype.resetPaneSize=function(){for(var t=this._vertical?"height":"width",e=this._panes.length;--e>=0;)this._panes[e].setStyle(t,"")},he._preventVScrolling=function(t){t.currentTarget.scrollTop=0},he._preventHScrolling=function(t){t.currentTarget.scrollLeft=0},he.prototype._addPaneAt=function(t){null==t&&(t=this._panes.length);var e=this._panes[t];if(!e){if((e=new Ht(document.createElement("div"))).setClass("grid-pane"),this._vertical?(e.addClass("sections"),e.listen("scroll",he._preventVScrolling)):(e.addClass("columns"),e.listen("scroll",he._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 n=new Ht(document.createElement("div"));n.setClass("grid-pane-slider"),n.setParent(e),this._panes[t]=e,this._paneSliders[t]=n}return e},he.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))},he.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))},he.prototype._onRestingPosition=function(){this._setSliderPosition(-this._pScrollVal,!0)},he.prototype._setSliderPosition=function(t,e){var i="",n="",o=this._vertical?"top":"left";t&&(e?n=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[o]=t+"px":(l.transform=i,l[o]=n)}e?this._dispatch("scrollEnd",{}):this._dispatch("scrollStart",{})},he.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)}},he.prototype._onKeyDown=function(t){if(this._isFrozen)ot._preventDefault(t);else if(this._active){if(this._vertical?38===t.keyCode||40===t.keyCode:37===t.keyCode||39===t.keyCode){var e=this.getScrollGap(),i=Math.round(.07*e);i<10?i=10:i>100&&(i=100),37!==t.keyCode&&38!==t.keyCode||(i*=-1),this._scroll(i),ot._preventDefault(t)}}},he.prototype._onTouchStart=function(t){this._isFrozen?ot._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))},he.prototype._onTouchMove=function(t){var e=this;if(e._isFrozen)ot._preventDefault(t);else if(e._swiping&&e._active&&e._touchInput&&!(t.touches&&t.touches.length>1)){var i=e._startPos,n=e._endPos;e._getTouchInfo(t,n);var o=this._vertical?i.y-n.y:i.x-n.x;if(!(o>-5&&o<5||e._isOnEdge(o))){if(e._touchDrag)e._scrollTo(i.scrollValue+o);else n.timeStamp-i.timeStamp>30&&(e._touchDrag=!0);t.cancelable&&t.preventDefault()}}},he.prototype._onTouchEnd=function(t){if(this._isFrozen)ot._preventDefault(t);else if(this._swiping=!1,this._touchDrag&&(this._touchDrag=!1,t.cancelable&&t.preventDefault(),this._smoothing&&!this._smoothingId)){var e=this._startPos,i=this._getTouchInfo(t,this._endPos),n=i.timeStamp-e.timeStamp,o=this._vertical?e.y-i.y:e.x-i.x;this._smoothingSpeed=30*o/n,(this._smoothingSpeed>10||this._smoothingSpeed<-10)&&(this._smoothingId=setInterval(this._smoothScroll,25))}},he.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},he.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)},he.prototype.disableMouseWheel=function(t){!1===t?this.setMouseWheelLogic(this._mouseWheelLogic||this._onMouseWheel):this.setMouseWheelLogic(null)},he.prototype.setMouseWheelLogic=function(t){this.removeWheelListener(this._parentNode),this._mouseWheelLogic=t,this._mouseWheelLogic&&this.addWheelListener(this._parentNode)},he.prototype.addWheelListener=function(t){t&&this._mouseWheelLogic&&t.addEventListener("wheel",this._mouseWheelLogic,!1)},he.prototype.removeWheelListener=function(t){t&&this._mouseWheelLogic&&t.removeEventListener("wheel",this._mouseWheelLogic,!1)},he.prototype.setMouseWheelSpeed=function(t){this._wheelScrolling="string"==typeof t?t:""},he.prototype.getMouseWheelSpeed=function(){return this._wheelScrolling},he.prototype.getDefaultMouseWheelLogic=function(){return this._onMouseWheel},he.prototype._onMouseWheel=function(t){if(!t.target.opened)if(this._isFrozen)ot._preventDefault(t);else if(!t.ctrlKey&&!t.altKey&&this.isActive()){var e=this._vertical?t.deltaY:t.deltaX;if(e&&!this._isOnEdge(e)){if(ot._preventDefault(t),t.deltaMode&&(e=e>0?100:-100),"linear"!=this._wheelScrolling){var i=this.getContentSize();i>=4e3&&(e*=1+i/4e3|0)}this.update(),this._scroll(e)}}},he.prototype.setScrollingStep=function(t){this._step=t>0?t:0},he.prototype.freezeScrolling=function(t){var e=this._isFrozen;return this._isFrozen=!1!==t,e},he.prototype.restoreTrackPosition=function(){var t=this._element;this._vertical&&(t.scrollTop=this._tScrollVal,t.scrollTop&&(this._tScrollVal=t.scrollTop))},he._proto=he.prototype;var pe=he,de=function(){var t=this;t._vertical=!1,t._onDeactivated=t._onDeactivated.bind(t),t._onActivated=t._onActivated.bind(t),t._hostClassName="hscrollbar-host",de.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)};s.inherits(de,pe),de.prototype._pinnedLeftColumnCount=0,de.prototype._pinnedRightColumnCount=0,de.prototype.setScrollContent=function(t,e,i,n){this._clearAllPanes();var o=e.length;if(!(o<=0)){this._pinnedLeftColumnCount=i>=0?i:0,this._pinnedRightColumnCount=n>0?n:0;var r=e[0],s=r.getColumnCount(),l=s-n;(!l||l<0)&&(l=s);for(var a=0;a<o;++a){r=e[a];var u,h,p=this._addPaneAt(a),d=this._paneSliders[a],c=p.getElement(),_=d.getElement();for(u=0;u<i;++u)(h=r.getColumn(u)).setScrollState(c,null,!1);p.setParent(r.getColumnHost());var f=[],g=[];for(u=i;u<l;++u)(h=r.getColumn(u)).setScrollState(null,_,this.isActive()),f.push(h),g.push(h.getElement());for(u=l;u<s;++u)(h=r.getColumn(u)).setScrollState(null,null,!1);var y=r.getReservedSpace();y&&(this._pinnedRightColumnCount||(d.addContent(y),g.push(y)),r._updateRightSpaceStyle()),r._updateLayers(),d._titleSection=r.hasClass("title"),d._columns=f,d._content=g}this.invalidateContent()}},de.prototype.setWidth=function(t){return this.setTrackSize(t,t),!0},de.prototype.getWidth=function(){return this.getPaneSize()},de.prototype.getScrollLeft=function(){return this._getScrollValue()},de.prototype.setScrollLeft=function(t){this.update(),this._scrollTo(t)},de.prototype.getPinnedLeftColumnCount=function(){return this.isEnabled()?this._pinnedLeftColumnCount:0},de.prototype.getPinnedRightColumnCount=function(){return this.isEnabled()?this._pinnedRightColumnCount:0},de.prototype.setPaneLeft=function(t){for(var e=t&&this.isActive()?-t+"px":"",i=this._panes.length;--i>=0;)this._paneSliders[i].setStyle("marginLeft",e)},de.prototype.isEndOfHorizontalScroll=function(){return this._isEndOfScroll()},de.prototype.getContentWidth=function(){var t=this._paneSliders[0],e=0;if(t)for(var i=t._content,n=i.length;--n>=0;){var o=i[n],r=o?o.style.width:0;r&&(e+=parseFloat(r))}return e},de.prototype.calculateContentSize=function(){return this.getContentWidth()},de.prototype.getTrackSize=function(){return this._footerCount<=0&&this._otherScrollbar&&this._otherScrollbar.isActive()&&!this._pinnedRightColumnCount?this._trackSize-this.getTrackThickness():this._trackSize},de.prototype._onActivated=function(t){this._updateActivation(!0)},de.prototype._onDeactivated=function(t){this._updateActivation(!1)},de.prototype._updateActivation=function(t){for(var e=this._paneSliders.length,i=0;i<e;++i)for(var n=this._paneSliders[i]._columns,o=n?n.length:0,r=0;r<o;++r){var s=n[r];s.getElement()&&s.enableAbsolutePosition(t)}},de._proto=de.prototype;var ce=de,_e=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 qt,e._trackY=new qt,e._trackX.setDefaultLaneSize(100),e._trackY.setDefaultLaneSize(32),e._cellSpans=new re,e._element=document.createElement("div"),e._element.className="tr-lg tr-even-shading",e._ctxRows=new Qt,e._columns=[],e._cells=[],e._highlightedCells=[],e._stretchedCells=new ee(e._trackX,e._trackY,e),e._selectionList=new le,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")};s.inherits(_e,Ht),_e.prototype._index=-1,_e.prototype._availableRowCount=0,_e.prototype._activeRow=0,_e.prototype._activeRowEnd=0,_e.prototype._colCount=0,_e.prototype._rowCount=0,_e.prototype._hiddenRowCount=0,_e.prototype._trackX,_e.prototype._trackY,_e.prototype._cellSpans,_e.prototype._columns,_e.prototype._firstColumn,_e.prototype._lastColumn,_e.prototype._rightSpace,_e.prototype._rightSpaceSize=0,_e.prototype._frozenLayout=!1,_e.prototype._rowHighlightEnabled=!1,_e.prototype._rowHighlightIndex=-1,_e.prototype._highlightedCells,_e.prototype._coverLayer=null,_e.prototype._stretchedCells=null,_e.prototype._ctx=null,_e.prototype._selectionList,_e.prototype._colVir=!1,_e.prototype._initialized=!1,_e.prototype._hidingMethod="",_e.prototype._virOwner=null,_e.prototype._transformIETimer=0,_e.prototype._ctxRows,_e.prototype._boundLayer=null,_e.prototype._colBounds=null,_e.prototype._colBoundCache=null,_e.prototype._colSelDirty=!1,_e.prototype._hscrollbar=null,_e.prototype._leftColumnSeparator=null,_e.prototype._rightColumnSeparator=null,_e.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._colBounds=this._colBoundCache=null,this._colSelDirty=!1,this._highlightedCells.length=0,this._ctx=null,this._hscrollbar=null,this._dispose()},_e.prototype.getWidth=function(){return this.isVisible()?this._getWidth():0},_e.prototype._getWidth=function(){return this.getContentWidth()+this._rightSpaceSize},_e.prototype.setWidth=function(t){return!(t<0)&&(null!=this._trackX.setTrackSize(t-this._rightSpaceSize)&&(this._syncLayoutToColumns(0),!0))},_e.prototype.getHeight=function(){return this.isVisible()?this.getContentHeight():0},_e.prototype.setHeight=function(t){return!(t<0)&&(null==this._trackY.setTrackSize(t)||this._syncLayoutToRows(0,this._rowCount),!0)},_e.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._trackY.show(t),this.setFrozenLayout(!1===t),this._dispatchRowHeightChangedEvent(0,this._rowCount)},_e.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 n=this._trackX.hitTest(t);if(n<0)return null;var o=this._trackY.hitTest(e);if(o<0)return null;var r={};if(r.colIndex=n,r.rowIndex=o,!0!==i){var s=this._cellSpans.getOccupyingSpan(n,o);s&&(r.colIndex=s.indexX,r.rowIndex=s.indexY)}return r},_e.prototype.hitTestX=function(t){return t<0?-1:t>=this.getContentWidth()?~this._colCount:this._trackX.hitTest(t)},_e.prototype.hitTestY=function(t){return t<0?-1:t>=this.getHeight()?~this._rowCount:this._trackY.hitTest(t)},_e.prototype.getDefaultColumnWidth=function(){return this._trackX.getDefaultLaneSize()},_e.prototype.setDefaultColumnWidth=function(t){this._trackX.getDefaultLaneSize()!==t&&(this._trackX.setDefaultLaneSize(t),this._syncLayoutToColumns(0))},_e.prototype.getDefaultRowHeight=function(){return this._trackY.getDefaultLaneSize()},_e.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)}},_e.prototype.getColumnWidth=function(t){return this._trackX.getLaneSize(t)},_e.prototype.setColumnWidth=function(t,e){return!!this._setColumnWidth(t,e)&&(this._syncLayoutToColumns(t),!0)},_e.prototype._setColumnWidth=function(t,e){return this._trackX.setLaneSize(t,e)},_e.prototype._updateColumnLayout=function(){this._syncLayoutToColumns(0)},_e.prototype._startBindingSession=function(t){},_e.prototype._getTempRowHeights=function(){return null},_e.prototype.getRowHeight=function(t){return this._trackY.getLaneSize(t)},_e.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},_e.prototype._updateRowHeights=function(t,e){for(var i=0,n=0;n<this._rowCount;++n){var o=t.getLaneSize(e);i|=this._trackY.setLaneSize(n,o),++e}return this._syncLayoutToRows(0,this._rowCount),i},_e.prototype.isColumnVisible=function(t){return this._trackX.isLaneVisible(t)},_e.prototype.hideColumn=function(t,e){return this.setColumnVisibility(t,!1===e,0)},_e.prototype.isRowVisible=function(t){return this._trackY.isLaneVisible(t)},_e.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)},_e.prototype.getMinimumColumnWidth=function(t){return this._trackX.getMinimumLaneSize(t)},_e.prototype.setMinimumColumnWidth=function(t,e){return!!this._trackX.setMinimumLaneSize(t,e)&&(this._syncLayoutToColumns(t),!0)},_e.prototype.getMinimumRowHeight=function(t){return this._trackY.getMinimumLaneSize(t)},_e.prototype.setMinimumRowHeight=function(t,e){return!!this._trackY.setMinimumLaneSize(t,e)&&(this._syncLayoutToRows(t,this._rowCount),this._dispatchRowHeightChangedEvent(t,t+1),!0)},_e.prototype.getCellLeft=function(t){return this._trackX.getLaneStart(t)},_e.prototype.getCellTop=function(t){return this._trackY.getLaneStart(t)},_e.prototype.getCellWidth=function(t,e){var i=this._cellSpans.getOccupyingSpan(t,e);if(i){var n=this._trackX.getLaneStart(i.indexX);return this._trackX.getLaneEnd(i.indexX+i.colSpan-1)-n}return this.getColumnWidth(t)},_e.prototype.getCellHeight=function(t,e){var i=this._cellSpans.getOccupyingSpan(t,e);if(i){var n=this._trackY.getLaneStart(i.indexY);return this._trackY.getLaneEnd(i.indexY+i.rowSpan-1)-n}return this.getRowHeight(e)},_e.prototype.hasCellSpan=function(){return this._cellSpans.hasSpan()},_e.prototype.getCellRowSpan=function(t,e){return this._cellSpans.getRowSpan(t,e)},_e.prototype.setCellRowSpan=function(t,e,i){var n=this._cellSpans.setRowSpan(t,e,i);if(this._updateCellSpanSize(t,e,n),n)return n.retVal>=0?this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,!0):n.colSpan>1?(this._updateCellSpanClass(t,e,n.colSpan,n.prevRowSpan,!1),this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,!0)):this._updateCellSpanClass(t,e,n.colSpan,n.prevRowSpan,!1),0!==n.retVal;var o=this._getCell(t,e);return o&&o._rowSpan>1&&this._updateCellSpanClass(t,e,o._colSpan,o._rowSpan,!1),!1},_e.prototype.getCellColSpan=function(t,e){return this._cellSpans.getColSpan(t,e)},_e.prototype.setCellColSpan=function(t,e,i){var n=this._cellSpans.setColSpan(t,e,i);if(this._updateCellSpanSize(t,e,n),n)return n.retVal>=0?this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,!0):n.colSpan>1?(this._updateCellSpanClass(t,e,n.prevColSpan,n.rowSpan,!1),this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,!0)):this._updateCellSpanClass(t,e,n.prevColSpan,n.rowSpan,!1),0!==n.retVal;var o=this._getCell(t,e);return o&&o._colSpan>1&&this._updateCellSpanClass(t,e,o._colSpan,o._rowSpan,!1),!1},_e.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},_e.prototype.clearColumnSpans=function(t){var e=this._cellSpans.removeSpanByColIndex(t);if(null==e)return!1;for(var i=e.length;--i>=0;){var n=e[i];this._updateCellSpan(n.indexX,n.indexY,n,!1)}return!0},_e.prototype.clearColumnCustomizations=function(){this._trackX.clearLaneCustomizations(),this._syncLayoutToColumns(0)},_e.prototype.clearRowCustomizations=function(){this._trackY.clearLaneCustomizations(),this._syncLayoutToRows(0,this._rowCount)},_e.prototype.getColumnScalability=function(t){return this._trackX.getLaneScalability(t)},_e.prototype.setColumnScalability=function(t,e){return this._trackX.setLaneScalability(t,e)},_e.prototype.getRowScalability=function(t){return this._trackY.getLaneScalability(t)},_e.prototype.setRowScalability=function(t,e){return this._trackY.setLaneScalability(t,e)},_e.prototype.getCell=function(t,e,i){if(i&&this._cellSpans.hasSpan()){var n=this._cellSpans.getColSpan(t,e),o=this._cellSpans.getRowSpan(t,e);n<0&&(t+=n),o<0&&(e+=o)}return this._getCell(t,e)},_e.prototype.getCellContent=function(t,e){var i=this.getCell(t,e);return null!==i?i.getContent():null},_e.prototype.setCellContent=function(t,e,i){var n=this.getCell(t,e);return null==n?(window.console.log("Error: Accessing nonexistent cell in Grid's Table"),null):n.setContent(i)},_e.prototype.getColumnCount=function(){return this._colCount},_e.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,n=null;if(e>t)for(i=e;--i>=t;)(n=this._columns.pop()).dispose(),n===this._firstColumn&&(this._firstColumn=null),n===this._lastColumn&&(this._lastColumn=null);else for(i=e;i<t;++i)n=this._newColumn(i);for(this._updateColumnIndices(),i=e;i<t;++i)this._columns[i].activate(!this._colVir);t<=0&&this._selectionList.clearAllSelections()}},_e.prototype.getRowCount=function(){return this._rowCount},_e.prototype.setRowCount=function(t,e){if(t<0&&(t=0),this._rowCount!==t){var i,n=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(n>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 o=t;o<n;++o)this._selectionList.deselect(o);else this._selectionList.clearAllSelections();else this._syncLayoutToRows(n,t);var r={};r.prevCount=n,r.rowCount=this._rowCount,this._dispatch("rowCountChanged",r),n<t&&this._insertCells(0,this._rowCount)}},_e.prototype.getVisibleRowCount=function(){return this._rowCount-this._hiddenRowCount},_e.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))},_e.prototype.removeRow=function(t){t<=0||(t>this._rowCount&&(t=this._rowCount),this.setRowCount(this._rowCount-t))},_e.prototype.setBorders=function(t,e,i,n){},_e.prototype.getColumnStyle=function(t,e){var i=this._columns[t];return i?i.getStyle(e):null},_e.prototype.setColumnStyle=function(t,e,i){var n=this._columns[t];n&&n.setStyle(e,i)},_e.prototype.enableColumnClass=function(t,e,i){var n=this._columns[t];n&&n.enableClass(e,i)},_e.prototype.hasColumnClass=function(t,e){var i=this._columns[t];return!!i&&i.hasClass(e)},_e.prototype.enableRowClass=function(t,e,i){if(t>=0&&t<this._rowCount)for(var n=0;n<this._colCount;++n)this._columns[n].getCell(t).enableClass(e,i)},_e.prototype.setRowStyle=function(t,e,i,n){if(t>=0&&t<this._rowCount){i&&(null==n||n)||(i="");for(var o=0;o<this._colCount;++o)this._columns[o].getCell(t).setStyle(e,i)}},_e.prototype.getRelativePosition=function(t){return ot.getRelativePosition(t,this._element)},_e.prototype.getContentWidth=function(){return this._trackX.getTrackSize()},_e.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},_e.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},_e.prototype.disableHorizontalGridLine=function(t){this.enableClass("no-horizontal-grid-line",!1!==t)},_e.prototype.disableVerticalGridLine=function(t){this.enableClass("no-vertical-grid-line",!1!==t)},_e.prototype.enableShading=function(t){!1!==t?this.addClass("tr-even-shading"):(this.removeClass("tr-even-shading"),this.removeClass("tr-odd-shading"))},_e.prototype.setTransposedShading=function(t){this.enableClass("transposed-shading",!1!==t)},_e.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)))},_e.prototype.getRowHighlight=function(){return this._rowHighlightIndex},_e.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 n=this._colCount;--n>=0;){var o=this._columns[n].getCell(t);this._highlightedCells[n]=o,o.addClass("highlighted-row")}var r=this.getStretchedCell(t);r&&(this._highlightedCells.push(r),r.addClass("highlighted-row"))}else this._highlightedCells.length=0;if(this._hasListener("rowHighlighted")){var s={};s.prevRowIndex=e,s.rowIndex=t,this._dispatch("rowHighlighted",s)}}},_e.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},_e.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},_e.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},_e.prototype.setSelectedRow=function(t,e){t<0||t>=this._rowCount||(this._selectionList.setSelection(t,e),this._updateSelectionUI(t))},_e.prototype.selectSingleRow=function(t){t<0||t>=this._rowCount||(this.clearSelectedRows(),this._selectionList.select(t),this._addSelectionUI(t))},_e.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)}},_e.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},_e.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},_e.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},_e.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},_e.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},_e.prototype.activateColumn=function(t,e){var i=this._columns[t];if(i){var n=i.activate(e);if(e&&n&&this._rightSpace){var o=this._rightSpace.parentNode;o&&o.appendChild(this._rightSpace)}}},_e.prototype.activateRows=function(){this._onEnterDocument()},_e.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)},_e.prototype.getFirstIndexInView=function(){return 0},_e.prototype.getLastIndexInView=function(){return this._availableRowCount-1},_e.prototype.isInCurrentView=function(t){return 0!==this._rowCount&&(t>=0&&t<this._rowCount)},_e.prototype.getFrozenLayout=function(){return this._frozenLayout},_e.prototype.setFrozenLayout=function(t){this.isVisible()||(t=!0),this._frozenLayout!==t&&(this._frozenLayout=t,this._cellSpans.freezeMapping(this._frozenLayout),this._frozenLayout||(this._syncLayoutToColumns(0),this._syncLayoutToRows(0,this._rowCount),this._dispatchRowHeightChangedEvent(0,this._rowCount)))},_e.prototype.getColumn=function(t){return this._columns[t]||null},_e.prototype.insertColumn=function(t,e){t<0?t=0:t>this._colCount&&(t=this._colCount);var i=t<this._colCount,n=this._cellSpans.getAllSpans();this._updateCellSpans(n,!1),this._trackX.insertLane(t,e),this._colCount=this._trackX.getLaneCount();var o=this._newColumn(t);if(this._updateColumnIndices(),this._cellSpans.shiftColumn(t,1)&&(n=this._cellSpans.getAllSpans()),this._updateCellSpans(n,!0),this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._selectionList.getSelectionCount())for(var r=this._selectionList.getAllSelections(),s=r.length;--s>=0;){var l=o.getCell(r[s]);l&&l.addClass("selected-row")}return o.activate(i||!this._colVir),o},_e.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 n=this._columns.splice(t,1)[0];return n.dispose(),e.control=n,this._updateColumnIndices(),this._cellSpans.removeColumn(t)&&(i=this._cellSpans.getAllSpans()),this._updateCellSpans(i,!0),this._syncLayoutToColumns(t),t>=this._colCount&&this._updateCssWidth(),e},_e.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 i=this._cellSpans.getAllSpans();this._updateCellSpans(i,!1),this._trackX.moveLane(t,e);var n=this._columns[t];if(ot.moveArrayItem(this._columns,t,e),n.getElement().offsetParent){for(var o=e+1,r=this._columns[o]||null;r&&!r.getElement().offsetParent;)r=this._columns[++o];n.insertBefore(r)}this._updateColumnIndices(),this._updateCellSpans(i,!0);var s=t<e?t:e;this._syncLayoutToColumns(s)}},_e.prototype.enableRowVirtualization=function(){console.log("WARNING: This function is deprecated")},_e.prototype.enableColumnVirtualization=function(t){this._colVir=!1!==t},_e.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},_e.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},_e.prototype.getIndex=function(){return this._index},_e.prototype.setIndex=function(t){this._index=t},_e.prototype.getRowOffset=function(){return this._rowOffset},_e.prototype.setRowOffset=function(t){this._rowOffset=t},_e.prototype.updateLayout=function(){this._calculateViewSize(!0),this._stretchedCells.updateCells(),this._updateRightSpaceStyle()},_e.prototype.stretchCell=function(t,e,i,n){var o=-1;if("number"==typeof t?(o=t,null==e&&(e=0)):t&&(t.stretched?(o=this._stretchedCells.getColumnIndex(t),null==e&&(e=this._stretchedCells.getRowIndex(t))):t.getParent&&(o=this.getColumnIndex(t.getParent()))),o<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,n?o:0)).setParent(s)}else r=this._stretchedCells.unstretchCell(e);if(r){var l=this._selectionList.getSelection(e);r.enableClass("selected-row",l)}return r},_e.prototype.unstretchCell=function(t,e){return this.stretchCell(t,e,!1)},_e.prototype.unstretchAllCells=function(){this._stretchedCells.unstretchAllCells()},_e.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},_e.prototype.getStretchedCells=function(){return this._stretchedCells.getCells()},_e.prototype.updateStretchedCells=function(){this._updateLayers();var t=this._coverLayer?this._coverLayer.children.length:0;return!(t<=0)&&(this._calculateViewSize(!0),this._stretchedCells.updateCells(),!!t)},_e.prototype._calculateViewSize=function(t){if(this._frozenLayout)return this._stretchedCells.getStretchSize();var e=this._ctx,i=t?0:this._stretchedCells.getStretchSize();if(!i&&e&&e.getWidth){var n=this.getContentWidth();return(i=e.getWidth())?(n<i&&(i=n),this._stretchedCells.setStretchSize(i),i):n}return i},_e.prototype._enableStretchCellClass=function(t,e,i){var n=this.getStretchedCell(t);n&&n.enableClass(e,i)},_e.prototype._getViewSize=function(){return this._calculateViewSize()},_e.prototype.getColumnHost=function(){return this._element},_e.prototype.setHidingMethod=function(t){this._hidingMethod=t},_e.prototype.getHidingMethod=function(){return this._hidingMethod},_e.prototype.setColumnVisibility=function(t,e,i){return!!this._trackX.hideLane(t,!e,i)&&(this._syncLayoutToColumns(t),!0)},_e.prototype.getRowLayout=function(){return this._trackY},_e.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},_e.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")}},_e.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)},_e.prototype.getReservedSpace=function(){return this._rightSpace},_e.prototype.getComputedStyle=function(){var t=this._element;return t.offsetParent?getComputedStyle(t):null},_e.prototype.isColumnActive=function(t){var e=this._columns[t];return!!e&&e.isActive()},_e.prototype.setRowAttributes=function(t,e){if(!(t<0||t>=this._rowCount))for(var i=0;i<this._colCount;++i)for(var n=e(i),o=n.length;--o>=0;){var r=n[o],s=this._columns[i].getCell(t);s&&(r.remove?s.removeAttribute(r.attribute):s.setAttribute(r.attribute,r.value))}},_e.prototype.getContextRow=function(t){return this._ctxRows.getItem(t)},_e.prototype.selectColumn=function(t,e){(this.enableColumnClass(t,"selected-column",e),e)&&(this._colSelDirty=!0,this._boundLayer||(this._initBoundLayer(),this._updateLayers()))},_e.prototype.isSelectedColumn=function(t){return this.hasColumnClass(t,"selected-column")},_e.prototype.selectCell=function(t,e,i){var n=this._getCell(t,e);n&&n.enableClass("selection",i)},_e.prototype.setCellBounds=function(t,e,i,n){},_e.prototype.getHorizontalLayout=function(){return this._trackX},_e.prototype.calculateColumnBounds=function(t,e,i,n){var o=0,r=0,s=!1,l=!1,a=this._trackX.getLaneCount();if(t>=0&&(o=this._trackX.getLaneStart(t),r=this._trackX.getLaneEnd(e)),o<r){var u,h,p=0,d=0,c=0,_=0;this._hscrollbar&&(d=this._hscrollbar.getScrollLeft(),c=this._hscrollbar.getPinnedLeftColumnCount(),_=this._hscrollbar.getPinnedRightColumnCount()),u=h=this._trackX.getTrackSize(),c&&(p=this._trackX.getLaneStart(c)),_&&(a-=_,u=this._getViewSize()-h+this._trackX.getLaneStart(a)),t>=c&&t<a?(o-=d)<p?(o=p,s=!0):o>u&&(o=u,s=!0):t>=a&&(o=this._getViewSize()-h+this._trackX.getLaneStart(t)),e>=c&&e<a?(r-=d)<p?(r=p,l=!0):r>u&&(r=u,l=!0):e>=a&&(r=this._getViewSize()-h+this._trackX.getLaneEnd(e))}i[0]=o,i[1]=r,n[0]=s,n[1]=l},_e.prototype.updateColumnBounds=function(t,e,i){if(this._colSelDirty){var n=this._colBounds,o=this._colBoundCache;n||(n=this._colBounds=[]),o||(o=this._colBoundCache=[]);var r,s=t.length,l=null,a=null,u=n.length;for(r=s;r<u;++r)(l=(a=n[r]).parentNode)&&l.removeChild(a);if(n.length=u=s,s)for(r=0;r<s;++r){var h=t[r],p=e[r],d=h[0],c=h[1];(a=o[r])||((a=o[r]=document.createElement("div")).className="selection-bound column-bound"),a.style.left=d+"px",a.style.width=c-d+"px",i=i||0,a.style.top=i+"px",a.style.height=this._trackY.getTrackSize()-i+"px",a.classList.toggle("no-left-bound",p[0]),a.classList.toggle("no-right-bound",p[1]),this._boundLayer&&(n[r]||(n[r]=a,this._boundLayer.appendChild(a)))}else this._colSelDirty=!1}},_e.prototype.updateColumnSeparators=function(){var t=this._hscrollbar.getPinnedLeftColumnCount(),e=this._hscrollbar.getPinnedRightColumnCount();!t&&!e||this._boundLayer||this._initBoundLayer();var i=!1;this._hscrollbar&&(i=this._hscrollbar.isActive());var n=this._boundLayer,o=this._leftColumnSeparator;if(i&&t){o||(o=this._leftColumnSeparator=this._createColumnSeparator()),o.parentNode||(n.children.length?n.insertBefore(o,n.children[0]):n.appendChild(o));var r=this._trackX.getLaneStart(t);o.style.left=r-1+"px",o.style.height=this._trackY.getTrackSize()+"px"}else o&&o.parentNode&&this._boundLayer.removeChild(o);if(o=this._rightColumnSeparator,i&&e){o||(o=this._rightColumnSeparator=this._createColumnSeparator()),o.parentNode||(n.children.length?n.insertBefore(o,n.children[0]):n.appendChild(o));var s=this.getColumnCount(),l=this._trackX.getLaneEnd(s-1)-this._trackX.getLaneStart(s-e),a=this._getViewSize();o.style.left=a-l-this._rightSpaceSize+"px",o.style.height=this._trackY.getTrackSize()+"px"}else o&&o.parentNode&&this._boundLayer.removeChild(o)},_e.prototype._createColumnSeparator=function(){var t=document.createElement("div");return t.classList.add("column-separator"),t},_e.prototype._initBoundLayer=function(){var t=this._boundLayer;return t||((t=this._boundLayer=document.createElement("div")).className="cover-layer",this._element.appendChild(t)),t},_e.prototype._getCell=function(t,e){var i=this._columns[t];return i?i.getCell(e):null},_e.prototype._insertCells=function(t,e){this._activeRow=t,this._activeRowEnd=e;for(var i=this._trackY.getLaneStart(t),n=0;n<this._colCount;++n){var o=this._columns[n];o.hasCollapsedCells()||o.setTop(i),o.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)}},_e.prototype._newColumn=function(t){var e=new Kt(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 n=this._columns[t+1];e.insertBefore(n)}return e},_e.prototype._updateCssWidth=function(){this._frozenLayout||(this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._element.style.width=this._getWidth()+"px")},_e.prototype._updateViewHeight=function(){if(!this._frozenLayout){var t=this.getContentHeight();this._element.style.height=t+"px",this._rightSpace&&(this._rightSpace.style.height=t+"px")}},_e.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 n=null,o=this._columns.length;--o>=0;){var r=this._columns[o];r.setNextSibling(n),n=r}},_e.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},_e.prototype._syncLayoutToRows=function(t,e){if(!this._frozenLayout){for(var i=t;i<e;++i)for(var n=this._trackY.isAtDefaultSize(i)?-1:this._trackY.getLaneSize(i),o=0;o<this._colCount;++o)this._columns[o].getCell(i).setHeight(n);this._stretchedCells.updateYAxis(),t?this._updateCellSpanLayout(this._cellSpans.getAllSpans()):this._updateCellSpans(this._cellSpans.getAllSpans(),!0),this._updateViewHeight()}},_e.prototype._dispatchRowHeightChangedEvent=function(t,e){if(this._hasListener("rowHeightChanged")&&!(t>=e)){var i={};i.rowIndex=t,i.changeLength=e-t,this._dispatch("rowHeightChanged",i)}},_e.prototype._updateCellSpanSize=function(t,e,i){var n=this._getCell(t,e);if(null!=n)if(i&&i.colSpan>1?(n.setWidth(this.getCellWidth(t,e)),this._columns[t].disableDeactivation()):n.setWidth(-1),i&&i.rowSpan>1)n.setHeight(this.getCellHeight(t,e));else{var o=this._trackY.isAtDefaultSize(e)?-1:this._trackY.getLaneSize(e);n.setHeight(o)}},_e.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)}},_e.prototype._updateCellSpan=function(t,e,i,n){this._updateCellSpanSize(t,e,n?i:null),this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,n)},_e.prototype._updateCellSpanClass=function(t,e,i,n,o){for(var r,s=0;s<i&&(r=this._columns[t+s]);++s)r.collapseCells(e,n,o,0===s,s>0);var l=this._getCell(t,e);l&&(l._colSpan=o?i:1,l._rowSpan=o?n:1)},_e.prototype._updateCellSpans=function(t,e){if(null!=t)for(var i=t.length;--i>=0;){var n=t[i];this._updateCellSpan(n.indexX,n.indexY,n,e)}},_e.prototype._onMouseMove=function(t){var e=t.target,i=ot.closestElement(e,"cell"),n=this._stretchedCells.getColumnIndex(i);if(n<0){var o=ot.closestElement(e,"column");n=this.getColumnIndex(o)}var r=this.getCellIndex(n,i);this.setRowHighlight(r)},_e.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)},_e.prototype._updateSelectionUI=function(t){var e=this._selectionList.getSelection(t);this._enableStretchCellClass(t,"selected-row",e),this.enableRowClass(t,"selected-row",e)},_e.prototype._addSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!0),this.enableRowClass(t,"selected-row",!0)},_e.prototype._removeSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!1),this.enableRowClass(t,"selected-row",!1)},_e.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}},_e.prototype._setContext=function(t){this._ctx=t},_e.prototype._getContext=function(){return this._ctx},_e.prototype._resetTransformIETimer=function(){ot.isIE&&(this._transformIETimer||(this.enableClass("reset-transform"),this._transformIETimer=setTimeout(this._onResetTransformIE,20)))},_e.prototype._onResetTransformIE=function(){this._transformIETimer=0,this.enableClass("reset-transform",!1)},_e._proto=_e.prototype;var fe=_e,ge=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)};ge.prototype.dispose=function(){this._dt&&(this._dt.unlisten("dataChanged",this._onDataChanged),this._dt=null)},ge.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())},ge.prototype.setField=function(t){this._field!==t&&(this._field=t,this._requestRecalculation())},ge.prototype.disableOnDemandMode=function(t){var e=!1===t;this._onDemandMode!==e&&(this._onDemandMode=e,this._requestRecalculation())},ge.prototype.setColumnDataGetter=function(t){this._colDataGetter!==t&&(this._colDataGetter=t,this._requestRecalculation())},ge.prototype.getColumnDataGetter=function(){return this._colDataGetter},ge.prototype.getSum=function(){return this._updateStats(),this._sum},ge.prototype.getDataCount=function(){return this._updateStats(),this._count},ge.prototype.getMin=function(){return this._updateStats(),this._min},ge.prototype.getMax=function(){return this._updateStats(),this._max},ge.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},ge.prototype.getAverage=function(){return this._updateStats(),this._sum/this._count},ge.prototype.getMean=ge.prototype.getAverage,ge.prototype.getMidRange=function(){return this._updateStats(),.5*(this._max+this._min)},ge.prototype.getCachedColumnData=function(){return this._dirty?this._recalculate():this._cacheData||(this._cacheData=this._getColData()),this._cacheData},ge.prototype.markDirty=function(){return!!this._onDemandMode&&(this._dirty=!0,this._dirty)},ge.prototype._getColData=function(){return this._colDataGetter?this._colDataGetter(this._field,this._dt):this._dt.getColumnData(this._field)},ge.prototype._requestRecalculation=function(){this.markDirty()||this._recalculate()},ge.prototype._updateStats=function(){this._dirty&&this._recalculate()},ge.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,n=ge._isDataNumeric,o=0;o<e;)if(n(i=+t[o++])){this._sum=this._min=this._max=i,++this._count;break}for(;o<e;)n(i=+t[o])&&(this._sum+=i,i<this._min?this._min=i:i>this._max&&(this._max=i),++this._count),++o}}},ge.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()}},ge.prototype._updateRowData=function(t){var e=this._dt.getPreviousData(t,this._field),i=this._dt.getData(t,this._field);if(e!==i){var n=ge._isDataNumeric(i);if(ge._isDataNumeric(e)){if(this._min===e&&(!n||i>this._min))return void this._recalculate();if(this._max===e&&(!n||i<this._max))return void this._recalculate();this._sum-=e,--this._count}n&&(this._sum+=i,i>=this._min||(this._min=i),i<=this._max||(this._max=i),++this._count)}},ge._isDataNumeric=function(t){return"number"==typeof t&&t==t},ge.prototype.addRef=function(t){return t&&this._refs.indexOf(t)<0&&this._refs.push(t),this._refs.length},ge.prototype.deRef=function(t){if(t){var e=this._refs.indexOf(t);e>=0&&this._refs.splice(e,1)}return this._refs.length},ge.prototype.getRefCount=function(){return this._refs.length},ge.prototype._dt=null,ge.prototype._field="",ge.prototype._onDemandMode=!0,ge.prototype._dirty=!0,ge.prototype._cacheData=null,ge.prototype._sum=0,ge.prototype._min=NaN,ge.prototype._max=NaN,ge.prototype._count=0,ge.prototype._colDataGetter=null,ge.prototype._refs;var ye=ge,me=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")};s.inherits(me,at),me.prototype._dv=null,me.prototype._dt=null,me.prototype._wrapIndex=0,me.prototype._rids,me.prototype._dataConflator=null,me.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))}},me.prototype._onWrapSizeChanged=function(t){this._refreshRids(t.rids)&&this._dispatch("dataChanged",gt._globalChangeArg)},me.prototype._refreshRids=function(t){var e=!1;if(this._dv&&Array.isArray(t)){var i=this.getWrapSize();if(i>0){var n=i*this._wrapIndex;n<t.length?(e=!0,this._rids=t.slice(n,n+i)):this._rids.length&&(e=!0,this._rids.length=0)}}return e},me.prototype.dispose=function(){this._dv&&(this.unlistenAll(),this._dv.unlisten("dataChanged",this._onDataChanged),this._dv.unlisten("wrapSizeChanged",this._onWrapSizeChanged),this._dt=this._dv=null)},me.prototype.getData=function(t,e){return this._dt.getData(t,e)},me.prototype.getRowData=function(t){return this._dt.getRowData(t)},me.prototype.getColumnData=function(t,e){for(var i=this.getAllRowIds(!0,e),n=[],o=i.length,r=0;r<o;++r){var s=this._dt.getRowData(i[r]);s?n.push(s[t]):e&&n.push(null)}return n},me.prototype.getRowId=function(t){return this._rids[t]||""},me.prototype._toRowId=function(t){return"number"==typeof t?this._rids[t]||"":t||""},me.prototype._toRowIds=function(t){for(var e=Array.isArray(t)?t.length:0,i=new Array(e),n=this._rids,o=0;o<e;++o){var r=t[o];i[o]="number"==typeof r?n[r]||"":r||""}return i},me.prototype.getAllRowIds=function(t,e){return t?this._rids:this._rids.slice(0)},me.prototype.getVisibleRowIds=function(t){return t?this._rids:this._rids.slice(0)},me.prototype.getSortedRowIds=function(t){return t?this._rids:this._rids.slice(0)},me.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},me.prototype.getRowCount=function(){return this._rids.length},me.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},me.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},me.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},me.prototype.getMultipleRowData=function(t,e,i){return this._dt.getMultipleRowData(t,e,i)},me.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},me.prototype.setData=function(t,e,i){return!!this._dt&&this._dt.setData(t,e,i)},me.prototype.setRowData=function(t,e,i){return this._dv.setRowData(t,e,i)},me.prototype.setColumnData=function(t,e,i){this._dt&&this._dt.setColumnData(t,e,i)},me.prototype.setDataAt=function(t,e,i){var n=this.getRowId(t);return!(!n||!this._dt)&&this._dt.setData(n,e,i)},me.prototype.setRowDataAt=function(t,e,i){var n=this.getRowId(t);return this.setRowData(n,e,i)},me.prototype.insertRow=function(t,e,i){var n=this._toRowId(t);return this._dv.insertRow(n,e,i)},me.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},me.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},me.prototype.moveRow=function(t,e){var i=this._toRowId(e),n=Array.isArray(t)?t:[t],o=this._toRowIds(n);return this._dv.moveRow(o,i)},me.prototype.getDataTable=function(){return this._dt},me.prototype.getDataSource=function(){return this._dv},me.prototype.setDataSource=function(t){},me.prototype.setConflationRate=function(t){this._dv.setConflationRate(t)},me.prototype.getConflationRate=function(){return this._dv.getConflationRate()},me.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},me.prototype.sort=function(t,e,i,n){this._dv.sort(t,e,i,n)},me.prototype.sortOnce=function(t,e){this._dv.sortOnce(t,e)},me.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},me.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},me.prototype.isSorting=function(){return this._dv.isSorting()},me.prototype.hideRow=function(t,e){this.showRows([t],!1===e)},me.prototype.hideRows=function(t,e){this.showRows(t,!1===e)},me.prototype.showRows=function(t,e){var i=this._toRowIds(t);this._dv.showRows(i,e)},me.prototype.unhideAllRows=function(){this._dv.unhideAllRows()},me.prototype.hasHiddenRow=function(){return this._dv.hasHiddenRow()},me.prototype.filterIn=function(t,e,i){return this._dv.filterIn(t,e,i)},me.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},me.prototype.filterInOnce=function(t,e,i){this._dv.filterInOnce(t,e,i)},me.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},me.prototype.clearFilter=function(){this._dv.clearFilter()},me.prototype.disablePageCorrection=function(t){},me.prototype.setPage=function(t){return!1},me.prototype.gotoPage=me.prototype.setPage,me.prototype.nextPage=function(){return!1},me.prototype.previousPage=function(){return!1},me.prototype.prevPage=me.prototype.previousPage,me.prototype.lastPage=function(){return!1},me.prototype.firstPage=function(){return!1},me.prototype.getCurrentPage=function(){return 1},me.prototype.getPageIndex=me.prototype.getCurrentPage,me.prototype.isOnLastPage=function(){return!0},me.prototype.isOnFirstPage=function(){return!0},me.prototype.getPageSize=function(){return 0},me.prototype.getPageCount=function(){return 1},me.prototype.getTotalPages=me.prototype.getPageCount,me.prototype.setPageSize=function(t){},me.prototype.groupBy=function(t,e){this._dv.groupBy(t,e)},me.prototype.addGroup=function(t){this._dv.addGroup(t)},me.prototype.sortGroups=function(t){this._dv.sortGroups(t)},me.prototype.moveGroup=function(t,e){this._dv.moveGroup(t,e)},me.prototype.setPredefinedGroups=function(t){this._dv.setPredefinedGroups(t)},me.prototype.addFooter=function(t){this._dv.addFooter(t)},me.prototype.removeFooter=function(){this._dv.removeFooter()},me.prototype.enableMultiGroup=function(t){this._dv.enableMultiGroup(t)},me.prototype.getGroupByRowId=function(t){return this._dv.getGroupByRowId(t)},me.prototype.getGroup=function(t){return this._dv.getGroup(t)},me.prototype.getAllGroups=function(t){return this._dv.getAllGroups(t)},me.prototype.getGroupList=function(){return this._dv.getGroupList()},me.prototype.getGroupId=function(){return this._dv.getGroupId()},me.prototype.getGroupValue=function(){return this._dv.getGroupValue()},me.prototype.getGroupRowId=function(){return this._dv.getGroupRowId()},me.prototype.getFooterRowIndex=function(t){return this._dv.getFooterRowIndex(t)},me.prototype.getFooterRowIds=function(){return this._dv.getFooterRowIds()},me.prototype.hasGroup=function(){return this._dv.hasGroup()},me.prototype.getGroupRows=function(){return null},me.prototype.getGroupLevel=function(t){var e=this._toRowId(t);return this._dv.getGroupLevel(e)},me.prototype.enableColumnStats=function(t,e,i){return this._dv.enableColumnStats(t,e,i)},me.prototype.getColumnStats=function(t){return this._dv.getColumnStats(t)},me.prototype.hide=function(t){return this._dv.hide(t)},me.prototype.isHidden=function(){return this._dv.isHidden()},me.prototype.isHiddenRow=function(t){return this._dv.isHiddenRow(t)},me.prototype.collapse=function(t){this._dv.collapse(t)},me.prototype.collapseAllGroups=function(t){this._dv.collapseAllGroups(t)},me.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},me.prototype.isCollapsed=function(){return this._dv.isCollapsed()},me.prototype.enableContentAsHeader=function(t){this._dv.enableContentAsHeader(t)},me.prototype.getVisibleRowCount=function(){return this._rids.length},me.prototype.isRowDataInGroup=function(t,e){return this._dv.isRowDataInGroup(t,e)},me.prototype.isRowIdInGroup=function(t,e){return this._dv.isRowIdInGroup(t,e)},me.prototype.addRowExpansion=function(t,e){this._dv.addRowExpansion(t,e)},me.prototype.removeRowExpansion=function(t){this._dv.removeRowExpansion(t)},me.prototype.toggleRowExpansion=function(t,e,i){var n=this._toRowId(t);this._dv.toggleRowExpansion(n,e,i)},me.prototype.removeAllRowExpansions=function(){this._dv.removeAllRowExpansions()},me.prototype.getRowsWithExpansion=function(t,e){return this._dv.getRowsWithExpansion(t,e)},me.prototype.getExpansionParents=function(t,e){return this._dv.getExpansionParents(t,e)},me.prototype.isRowExpansion=function(t){return this._dv.isRowExpansion(t)},me.prototype.hasRowExpansion=function(t){return this._dv.hasRowExpansion(t)},me.prototype.getRowExpansionId=function(t,e){return this._dv.getRowExpansionId(t,e)},me.prototype.getRowExpansionIndex=function(t){return this._dv.getRowExpansionIndex(t)},me.prototype.searchAll=function(t,e){return this._dv.searchAll(t,e)},me.prototype.searchPrev=function(t,e){var i=this._toRowId(t);return this._dv.searchPrev(i,e)},me.prototype.searchNext=function(t,e){var i=this._toRowId(t);return this._dv.searchNext(i,e)},me.prototype.stall=function(t){return this._dv.stall(t)},me.prototype.enableAutoGroupRemoval=function(t){return this._dv.enableAutoGroupRemoval(t)},me.prototype.enableAutoGroupHiding=function(t){return this._dv.enableAutoGroupHiding(t)},me.prototype.synchronizeRowOrder=function(){this._dv.synchronizeRowOrder()},me.prototype.setSegmentSeparator=function(t,e){var i=this._toRowId(t);return this._dv.setSegmentSeparator(i,e)},me.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},me.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},me.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},me.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},me.prototype.collapseSegment=function(t,e){var i=this._toRowId(t);return this._dv.collapseSegment(i,e)},me.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},me.prototype.expandAllSegments=function(){return this._dv.expandAllSegments()},me.prototype.setSegmentCollapsingLogic=function(){},me.prototype.isSegmentCollapsed=function(t){var e=this._toRowId(t);return this._dv.isSegmentCollapsed(e)},me.prototype.fillSegment=function(t){var e=this._toRowId(t);this._dv.fillSegment(e)},me.prototype.fillSegments=function(){this._dv.fillSegments()},me.prototype.addSegmentChild=function(t,e){var i=this._toRowId(t),n=this._toRowId(e);return this._dv.addSegmentChild(i,n)},me.prototype.addSegmentChildren=function(t,e){var i=this._toRowId(t),n=this._toRowIds(e);return this._dv.addSegmentChildren(i,n)},me.prototype.removeSegmentChild=function(t,e){var i=this._toRowId(t),n=this._toRowId(e);return this._dv.removeSegmentChild(i,n)},me.prototype.removeSegmentChildren=function(t,e){var i=this._toRowId(t),n=this._toRowIds(e);return this._dv.removeSegmentChildren(i,n)},me.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},me.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},me.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},me.prototype.sortSegments=function(t){this._dt.sortSegments(t)},me.prototype.getWrapSize=function(){return this._dv.getWrapSize()},me.prototype.getWrappedViews=function(){return this._dv.getWrappedViews()},me.prototype.wrapView=function(t){this._dv.wrapView(t)},me.prototype.dump=function(t){return DataCache.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},me.prototype.log=function(t){console.table(this.dump(t))},me.prototype.isRowFiltered=function(t,e){return this._dv.isRowFiltered(t,e)};var Ce=me,ve=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._byRemovalMap=e._byRemovalMap.bind(e),e._rids=[],e._sortingDefs=[],e._columnStats={},e._shared={},e._conflator=new o(this._onDataChanged,0),e._conflator.disable(),e._addEvents("dataChanged","preDisposed","pageIndexChanged","pageCountChanged","groupAdded","beforeGroupAdded","groupCriteriaChanged","beforeFiltering","wrapCountChanged","wrapSizeChanged"),e.setDataSource(t)};s.inherits(ve,at),ve.prototype._rids,ve.prototype._groupView=null,ve.prototype._pageView=null,ve.prototype._expansionView=null,ve.prototype._hiddenRids=null,ve.prototype._collapsedRids=null,ve.prototype._excludedRids=null,ve.prototype._emptySegmentFiltering=!1,ve.prototype._separatorFiltering=!1,ve.prototype._expansionMap=null,ve.prototype._expansionChildren=null,ve.prototype._expansionCount=0,ve.prototype._dt=null,ve.prototype._parent=null,ve.prototype._shared=null,ve.prototype._sortingDefs=null,ve.prototype._userFilter=null,ve.prototype._filteringOut=!1,ve.prototype._refreshTimerId=0,ve.prototype._groupSortingLogic=null,ve.prototype._pageCorrection=!0,ve.prototype._pageSize=0,ve.prototype._pageIndex=1,ve.prototype._lastPageIndex=0,ve.prototype._groupCriteria=null,ve.prototype._preDefGroups=null,ve.prototype._preDefGroupsDirty=!1,ve.prototype._groupMembers=null,ve.prototype._groupList=null,ve.prototype._groupRows=null,ve.prototype._groupId="",ve.prototype._groupColor="",ve.prototype._groupValue,ve.prototype._groupRowId="",ve.prototype._footerRowIds=null,ve.prototype._groupLevel=0,ve.prototype._groupViewDirty=!1,ve.prototype._columnStats,ve.prototype._hidden=!1,ve.prototype._hiddenHeaderRow=!1,ve.prototype._collapsed=!1,ve.prototype._collapsible=!0,ve.prototype._showOnlyFirstMember=!1,ve.prototype._beingAdded=!1,ve.prototype._conflator=null,ve.prototype._wrappedViews=null,ve.prototype._wrapSize=0,ve.prototype._wrapTimerId=0,ve.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}},ve.prototype.getData=function(t,e){return this._dt.getData(t,e)},ve.prototype.getRowData=function(t){return this._dt.getRowData(t)},ve.prototype.getColumnData=function(t,e){for(var i=this.getAllRowIds(!0,e),n=[],o=i.length,r=0;r<o;++r){var s=this._dt.getRowData(i[r]);s?n.push(s[t]):e&&n.push(null)}return n},ve.prototype.getRowId=function(t){return this._rebuildRowIdsFromChildren(),this._getRids()[t]||""},ve.prototype._toRowId=function(t){return"number"==typeof t?(this._rebuildRowIdsFromChildren(),this._getRids()[t]||""):t||""},ve.prototype._toRowIds=function(t){for(var e=Array.isArray(t)?t.length:0,i=new Array(e),n=this._getRids(),o=0;o<e;++o){var r=t[o];"number"==typeof r?(this._rebuildRowIdsFromChildren(),i[o]=n[r]||""):i[o]=r||""}return i},ve.prototype.getAllRowIds=function(t,e){this._rebuildRowIdsFromChildren();var i=e?this._getRids():this._pageView||this._rids;return t?i:i.slice(0)},ve.prototype.getVisibleRowIds=function(t){this._rebuildRowIdsFromChildren();var e=this._getRids();return t?e:e.slice(0)},ve.prototype.getSortedRowIds=function(t){return this._rebuildRowIdsFromChildren(),t?this._rids:this._rids.slice(0)},ve.prototype.getRowIndex=function(t){return this._rebuildRowIdsFromChildren(),this._getRids().indexOf(t)},ve.prototype.getRowCount=function(){return this._getRids().length},ve.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},ve.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},ve.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},ve.prototype.getMultipleRowData=function(t,e,i){return this._dt.getMultipleRowData(t,e,i)},ve.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},ve.prototype.setData=function(t,e,i){return!!this._dt&&this._dt.setData(t,e,i)},ve.prototype.setRowData=function(t,e,i){return!(!t||!this._dt||this.isRowExpansion(t))&&this._dt.setRowData(t,e,i)},ve.prototype.setColumnData=function(t,e,i){this._dt&&this._dt.setColumnData(t,e,i)},ve.prototype.setDataAt=function(t,e,i){var n=this.getRowId(t);return!(!n||!this._dt)&&this._dt.setData(n,e,i)},ve.prototype.setRowDataAt=function(t,e,i){var n=this.getRowId(t);return this.setRowData(n,e,i)},ve.prototype.insertRow=function(t,e,i){this._rebuildRowIdsFromChildren();var n=this._toRowId(t);return this._dt?this._dt.insertRow(n,e,i):""},ve.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},ve.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},ve.prototype.moveRow=function(t,e){var i=this._toRowId(e),n=Array.isArray(t)?t:[t],o=this._toRowIds(n);return this._dt.hasSegmentation()&&this.synchronizeRowOrder(),this._dt._moveRow(o,i)},ve.prototype.swapRow=ot._deprecatedFunction,ve.prototype.getDataTable=function(){return this._dt},ve.prototype.getDataSource=function(){return this._parent},ve.prototype.setDataSource=function(t){if(t){if(this._groupLevel>0)return;this._setParent(t),this._onDataChanged(gt._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={}},ve.prototype.setConflationRate=function(t){this._conflator.disable(!t),this._conflator.setConflatingTime(t)},ve.prototype.getConflationRate=function(){return this._conflator.getConflatingTime()},ve.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)},ve.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},ve.prototype.sort=function(t,e,i,n){if(this._groupLevel>0)window.console.log("ERROR: Sub-group cannot be sorted individually");else{var o=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]=o[a]||o._default}if(gt._buildSortContext(r,t,e,i||o),1===r.length&&0===r[0][3]&&(r.length=0),!(s<=0&&r.length<=0||this._shared.stalledRids)){var u=!1;this._groupMembers||r.length<=0||n?(u=!0,this._updateRowIds()):u=this._sort(),u&&this._dispatchDataChange(gt._positionChangeArg)}}},ve.prototype.sortOnce=function(t,e){this.sort(t,e),this._sortingDefs.length=0},ve.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},ve.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},ve.prototype.getColumnSortingLogic=function(t){return this._dt?this._dt.getColumnSortingLogic(t):null},ve.prototype.isSorting=function(){return this._sortingDefs.length>0},ve.prototype.hideRow=function(t,e){this.hideRows([t],e)},ve.prototype.hideRows=function(t,e){e=!1!==e;var i=this._hiddenRids;if(e)i||(i=this._hiddenRids={});else if(!i)return;for(var n=this._toRowIds(t),o=!1,r=n.length;--r>=0;){var s=n[r];s&&(e?i[s]||(i[s]=!0,o=!0):i[s]&&(delete i[s],o=!0))}if(o){if(!e){var l=!1;for(var a in i){l=!0;break}l||(i=this._hiddenRids=null)}this._refreshAndNotify()}},ve.prototype.showRows=function(t,e){this.hideRows(t,!1===e)},ve.prototype.unhideAllRows=function(){this._hiddenRids&&(this._hiddenRids=null,this._refreshAndNotify())},ve.prototype.hasHiddenRow=function(){return!!this._hiddenRids},ve.prototype.filterIn=function(t,e,i){var n=this._getFilterLogic(t,e),o=!0===i;return!!(this._userFilter!==n||"function"==typeof t||n&&o!==this._filteringOut)&&(this._shared.filterLogic=n,this._userFilter=n,this._filteringOut=o,this._refreshAndNotify(),!0)},ve.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},ve.prototype.filterInOnce=function(t,e,i){var n=this._getFilterLogic(t,e),o={};if(this._getRemovalMap(o,n,!0===i)){var r=this._removeRowIds(o);this._updatePageCount()||this._transformView(r)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(Object.keys(o))}},ve.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},ve.prototype._removeRowIds=function(t){var e=ve._removeArrayItems(this._rids,t);if(this._groupView&&(e=ve._removeArrayItems(this._groupView,t)),this._groupMembers)for(var i=this._groupList.length,n=0;n<i;++n){var o=this._groupList[n];this._groupMembers[o]._removeRowIds(t)}return e},ve.prototype.clearFilter=function(){this._userFilter&&(this._userFilter=null,this._shared.filterLogic=null,this._refreshAndNotify())},ve.prototype.disablePageCorrection=function(t){this._pageCorrection=!1===t},ve.prototype.setPage=function(t){var e=this._setPage(t);return e&&this._dispatchGlobalChange(),e},ve.prototype.gotoPage=ve.prototype.setPage,ve.prototype.nextPage=function(){return this.gotoPage(this._pageIndex+1)},ve.prototype.previousPage=function(){return this.gotoPage(this._pageIndex-1)},ve.prototype.prevPage=ve.prototype.previousPage,ve.prototype.lastPage=function(){return this.gotoPage(this._lastPageIndex)},ve.prototype.firstPage=function(){return this.gotoPage(0)},ve.prototype.getCurrentPage=function(){return this._pageIndex},ve.prototype.getPageIndex=ve.prototype.getCurrentPage,ve.prototype.isOnLastPage=function(){return this._pageIndex===this._lastPageIndex},ve.prototype.isOnFirstPage=function(){return 1===this._pageIndex},ve.prototype.getPageSize=function(){return this._pageSize},ve.prototype.getPageCount=function(){return this._lastPageIndex},ve.prototype.getTotalPages=ve.prototype.getPageCount,ve.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())},ve.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 n,o,r;if(null!=e&&this._setPredefinedGroups(e),t&&0===this._groupLevel)for(this._groupCriteria=[],o=(r=Array.isArray(t)?t:[t]).length,n=0;n<o;++n){var s=r[n];"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(o=this._footerRowIds.length,n=0;n<o;++n)delete this._groupRows[this._footerRowIds[n]];this._footerRowIds=null}this._groupRows=null}this._groupValue=null}this._groupLevel=0,this._updateRowIds(),this._dispatch("groupCriteriaChanged",{}),this._dispatchGlobalChange()},ve.prototype.addGroup=function(t){if(this._groupMembers)if(isArray(t))for(var e=t,i=e.length,n=0;n<i;++n)this._addGroup(e[n]);else this._addGroup(t)},ve.prototype.sortGroups=function(t){if(this._groupMembers&&(this._groupSortingLogic=null==t?ve._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()}},ve.prototype.moveGroup=function(t,e){var i=this.getGroup(t);if(i){var n=i.getDataSource(),o=i.getGroupId(),r=n._groupList.indexOf(o);r!==e&&r+1!==e&&(n._groupList.splice(r,1),r<e&&--e,n._groupList.splice(e,0,o),this._requestRebuildingRowIds(!1))}},ve.prototype.setPredefinedGroups=function(t){this._setPredefinedGroups(t),this._groupMembers&&this._refreshAndNotify()},ve.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}},ve.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)}},ve.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)}},ve.prototype.enableMultiGroup=function(t){this._shared.multiGroupRow=!1!==t},ve.prototype.getGroupByRowId=function(t){return this._groupRows&&this._groupRows[t]||null},ve.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 n=e;return(i=this._groupRows[n])||this._getGroupByContentRowId(n)},ve.prototype._getGroupByContentRowId=function(t){if(this._groupMembers)for(var e=0;e<this._groupList.length;e++){var i=this._groupList[e],n=this._groupMembers[i]._getGroupByContentRowId(t);if(n)return n}else if(-1!==this._rids.indexOf(t))return this;return null},ve.prototype.getAllGroups=function(t){if(t||(t=[]),this._groupMembers)for(var e=this._groupList.length,i=0;i<e;++i){var n=this._groupList[i],o=this._groupMembers[n];t.push(o),o.getAllGroups(t)}return t},ve.prototype.getGroupList=function(){return this._groupList},ve.prototype.getGroupId=function(){return this._groupId},ve.prototype.getGroupValue=function(){return this._groupValue},ve.prototype.getGroupRowId=function(){return this._groupRowId},ve.prototype.getFooterRowIndex=function(t){if(this._footerRowIds)for(var e=this._footerRowIds.length;--e>=0;)if(this._footerRowIds[e]===t)return e;return-1},ve.prototype.getFooterRowIds=function(){return this._footerRowIds},ve.prototype.hasGroup=function(){return!!this._groupMembers},ve.prototype.getGroupRows=function(){return null},ve.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(),n=i[t];n;){var o=this._groupRows[n];if(o)return o._groupLevel;n=i[--t]}}return this._groupLevel},ve.prototype.enableColumnStats=function(t,e,i){if(!t)return null;var n=!1!==e,o=this._columnStats[t];if(n?(o||(o=new ye(this,t),this._columnStats[t]=o),o.addRef(i)):o&&(o.deRef(i)||(o.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 o||null},ve.prototype.getColumnStats=function(t){return this._columnStats[t]||null},ve.prototype.hide=function(t){var e=!1!==t;return this._hidden!==e&&(this._hidden=e,this._refreshAndNotify(),!0)},ve.prototype.isHidden=function(){return this._hidden},ve.prototype.isHiddenRow=function(t){return!!this._hiddenRids&&!0===this._hiddenRids[t]},ve.prototype._isHeaderRowShown=function(){return!this._hiddenHeaderRow&&((!this._shared.filterLogic||0!==this._rids.length)&&(!this._shared.autoGroupHiding||null!=this._groupValue))},ve.prototype._setCollapse=function(t){if(this._shared.contentAsHeader){if(this._hiddenHeaderRow&&this._showOnlyFirstMember!==t)return this._showOnlyFirstMember=t,!0}else if(this._isHeaderRowShown()&&this._collapsible&&this._collapsed!==t)return this._collapsed=t,!0;return!1},ve.prototype.collapse=function(t){this._setCollapse(!1!==t)&&(this._shared.contentAsHeader?this._hiddenHeaderRow&&this._requestRebuildingRowIds(this._showOnlyFirstMember):this._groupLevel>0&&this._requestRebuildingRowIds(this._collapsed))},ve.prototype.collapseAllGroups=function(t){var e=this.getAllGroups(),i=e.length;if(i){for(var n=!1!==t,o=0;o<i;++o){e[o]._setCollapse(n)}this._requestRebuildingRowIds(!1)}},ve.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},ve.prototype.isCollapsed=function(){return this._collapsed||this._showOnlyFirstMember},ve.prototype.enableContentAsHeader=function(t){this._shared.contentAsHeader=!1!==t},ve.prototype.setDefaultCollapse=function(t){this._shared.defaultCollapse=!!t},ve.prototype.getDefaultCollapse=function(){return!!this._shared.defaultCollapse},ve.prototype.isCollapsible=function(){return this._collapsible},ve.prototype.disableCollapsing=function(t){this._collapsible=!(!1!==t)},ve.prototype.setGroupColor=function(t){1===this._groupLevel&&(this._groupColor=t)},ve.prototype.getGroupColor=function(){return 0===this._groupLevel?"":1===this._groupLevel?this._groupColor:this._parent.getGroupColor()},ve.prototype._getFirstHiddenRids=function(){if(this._shared.contentAsHeader&&this._showOnlyFirstMember){var t=this._rids;if(Array.isArray(t)&&t.length)return[t[0]]}return null},ve.prototype.getVisibleRowCount=function(){return this._collapsed?0:(this._rebuildRowIdsFromChildren(),this._getRids().length)},ve.prototype.isRowDataInGroup=function(t,e){var i=this._groupCriteria,n=this._groupLevel;if(!e||e===this.getGroupId())return this._isAllowedInGroup(null,t);for(var o=n;o<i.length;o++)if(i[o](t).indexOf(e)>=0)return!0;return!1},ve.prototype.isRowIdInGroup=function(t,e){var i=this.getRowData(t);return!!i&&this.isRowDataInGroup(i,e)},ve._getDataViewExpansionId=function(t,e){return t+"_ex"+e},ve.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 n=0;this._expansionMap?n=this._expansionMap[t]||0:(this._expansionMap={},this._expansionChildren={});var o=n+e;this._expansionMap[t]=o;for(var r=n;r<o;r++)this._expansionChildren[ve._getDataViewExpansionId(t,r)]=t;if(n||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)}}}},ve.prototype.removeRowExpansion=function(t){if(this._expansionMap){var e=this._expansionMap[t];if(e){for(var i=new Array(e),n=0;n<e;++n)i[n]=ve._getDataViewExpansionId(t,n),delete this._expansionChildren[i[n]];delete this._expansionMap[t],this._expansionCount--,this._groupViewDirty||this._updateExpansionView()&&(1===e?this._dispatchRowRemoved(i[0]):this._dispatchMultiRowRemoved(i))}}},ve.prototype.toggleRowExpansion=function(t,e,i){var n=this._toRowId(t);(e=null!=e?!0===e:!this.hasRowExpansion(n))?this.addRowExpansion(n,i):this.removeRowExpansion(n)},ve.prototype.removeAllRowExpansions=function(){this._expansionMap&&(this._expansionMap=null,this._expansionCount=0,this._expansionView=null,this._expansionChildren=null,this._refreshAndNotify())},ve.prototype.getRowsWithExpansion=function(t,e){if(!this._expansionMap)return[];var i=this._expansionView,n=i.length;(null==e||e>n)&&(e=n),t>0||(t=0);for(var o=this._expansionCount,r=new Array(n),s=t;s<e;++s){var l=i[s];if(this._expansionMap[l]&&(r[s]=l,--o<=0))break}return r},ve.prototype.getExpansionParents=function(t,e){var i=[];if(this._expansionMap){var n=this._expansionView,o=n.length;(null==e||e>o)&&(e=o),(!t||t<0)&&(t=0);for(var r=t;r<e;++r)i[r]=this._expansionChildren[n[r]]||""}return i},ve.prototype.getExpansionParentByRowId=function(t){return this._expansionChildren&&this._expansionChildren[t]||""},ve.prototype.isRowExpansion=function(t){return!!this._expansionChildren&&!!this._expansionChildren[t]},ve.prototype.hasRowExpansion=function(t){return!!this._expansionMap&&!!this._expansionMap[t]},ve.prototype.getRowExpansionCount=function(t){return this._expansionMap&&this._expansionMap[t]||0},ve.prototype.getRowExpansionId=function(t,e){if(this._expansionMap&&(e||(e=0),e<(this._expansionMap[t]||0)))return ve._getDataViewExpansionId(t,e);return""},ve.prototype.getRowExpansionIndex=function(t){if(t){var e=t.match(/_ex(\d+)$/);if(e)return+e[1]}return-1},ve.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,n=this._expansionView?this._expansionView.length:0;this._expansionView?this._expansionView.length=i:this._expansionView=new Array(i);for(var o=this._expansionCount,r=0,s=0;r<i;++r){var l=e[r];if(this._expansionView[s++]=l,o){var a=t[l]||0;if(a){for(var u=0;u<a;++u)this._expansionView[s++]=ve._getDataViewExpansionId(l,u);--o}}}return n!==this._expansionView.length}return!1},ve.prototype._transformView=function(t){var e=this._updatePaginationView(t);return!!(e|=this._updateExpansionView())},ve.prototype.searchAll=function(t,e){e||(e=[]),this._rebuildRowIdsFromChildren();for(var i=this._getRids(),n=i.length,o=0;o<n;++o){var r=i[o],s=this._dt.getRowData(r);s&&t(s)&&e.push(r)}return e},ve.prototype.searchPrev=function(t,e){this._rebuildRowIdsFromChildren();var i=this._getRids(),n=-1;"number"==typeof t?this._dt.getRowData(i[t])&&(n=t):n=i.indexOf(t);var o=-1,r=i.length;return n>0&&(o=this._searchRow(i,e,n-1,-1,-1))>=0||n>=0&&(o=this._searchRow(i,e,r-1,n,-1))>=0?o:-1},ve.prototype.searchNext=function(t,e){this._rebuildRowIdsFromChildren();var i=this._getRids(),n=-1;if("number"==typeof t?this._dt.getRowData(i[t])&&(n=t):n=i.indexOf(t),n<0)return-1;var o=-1,r=i.length;return n<r-1&&(o=this._searchRow(i,e,n+1,r,1))>=0||n>0&&(o=this._searchRow(i,e,0,n,1))>=0?o:-1},ve.prototype._searchRow=function(t,e,i,n,o){for(;i!==n;){var r=t[i],s=this._dt.getRowData(r);if(s&&e(s))return i;i+=o}return-1},ve.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 n=this._getRids(),o=n.length;--o>=0;)i[n[o]]=1}else this._shared.stalledRids=null,this._refreshAndNotify();return!0},ve.prototype.enableAutoGroupRemoval=function(t){return t=!1!==t,!!this._shared.autoGroupRemoval!==t&&(this._shared.autoGroupRemoval=t,this._triggerGroupRefreshing(),!0)},ve.prototype.enableAutoGroupHiding=function(t){return t=!1!==t,!!this._shared.autoGroupHiding!==t&&(this._shared.autoGroupHiding=t,this._triggerGroupRefreshing(),!0)},ve.prototype.synchronizeRowOrder=function(){this.isSorting()&&this._dt._sort(this._sortingDefs)},ve.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))},ve.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},ve.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},ve.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},ve.prototype.getSegment=function(t){return this._dt.getSegment(t)},ve.prototype.getSegmentParent=function(t){return this._dt.getSegmentParent(t)},ve.prototype.getSegmentLevel=function(t){return this._dt.getSegmentLevel(t)},ve.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},ve.prototype.collapseSegment=function(t,e){e=!1!==e;var i=this._dt._getSegmentSeparators();if(i){var n=this._toRowId(t);if(i.collapseSegment(n,e))return this._refreshAndNotify(),!0}return!1},ve.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},ve.prototype.expandAllSegments=function(){var t=this._dt._getSegmentSeparators();return!(!t||!t.expandAllSegments())&&(this._refreshAndNotify(),!0)},ve.prototype.setSegmentCollapsingLogic=function(){},ve.prototype.isSegmentCollapsed=function(t){var e=this._dt._getSegmentSeparators();return!!e&&e.isCollapsedSegment(this._toRowId(t))},ve.prototype.fillSegment=function(t){this._dt.fillSegment(this._toRowId(t))},ve.prototype.fillSegments=function(){this._dt.fillSegments()},ve.prototype.addSegmentChild=function(t,e,i){if(this._dt._getSegmentSeparators()){var n=this._toRowId(t),o=this._toRowId(e);return this._dt.addSegmentChild(n,o,i)}return!1},ve.prototype.addSegmentChildren=function(t,e,i){if(this._dt._getSegmentSeparators()){var n=this._toRowId(t),o=this._toRowIds(e);return this._dt.addSegmentChildren(n,o,i)}return!1},ve.prototype.removeSegmentChild=function(t,e){if(this._dt._getSegmentSeparators()){var i=this._toRowId(t),n=this._toRowId(e);return this._dt.removeSegmentChild(i,n)}return!1},ve.prototype.removeSegmentChildren=function(t,e){if(this._dt._getSegmentSeparators()){var i=this._toRowId(t),n=this._toRowIds(e);return this._dt.removeSegmentChildren(i,n)}return!1},ve.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},ve.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},ve.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},ve.prototype.sortSeparators=function(t,e,i){this._dt.sortSeparators(t,e,i)},ve.prototype.sortSegments=function(t){this._dt.sortSegments(t)},ve.prototype.enableEmptySegmentFiltering=function(t){t=!1!==t,this._emptySegmentFiltering!==t&&(this._emptySegmentFiltering=t,this._userFilter&&this._refreshAndNotify())},ve.prototype.enableSeparatorFiltering=function(t){t=!1!==t,this._separatorFiltering!==t&&(this._separatorFiltering=t,this._userFilter&&this._refreshAndNotify())},ve.prototype.setSegmentClassification=function(t,e){return this._dt.setSegmentClassification(this._toRowId(t),e)},ve.prototype._getSharedObject=function(){return this._shared},ve.prototype.getWrapSize=function(){return this._wrapSize},ve.prototype.getWrappedViews=function(){return this._wrappedViews},ve.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()},ve.prototype._updateWrapCount=function(){this._wrapTimerId=0;var t,e=this._wrapSize,i=this._wrappedViews,n=i?i.length:0,o=0;if(e){var r=this.getVisibleRowIds(!0),s=r.length;if(n<(o=Math.ceil(s/e)))for(i||(i=this._wrappedViews=[]),t=n;t<o;++t)this._wrappedViews[t]=new Ce({dataView:this,wrapIndex:t,rids:r})}if(o<n){for(t=n;--t>=o;)this._wrappedViews[t].dispose();this._wrappedViews.length=o}e||(this._wrappedViews=null),n!==o&&this._dispatch("wrapCountChanged",{prevCount:n,newCount:o})},ve.prototype.dump=function(t){this._rebuildRowIdsFromChildren();var e=this._getRids();return ht.constructTable(this.getMultipleRowData(e),t,e)},ve.prototype.log=function(t){console.table(this.dump(t))},ve.prototype._getRids=function(){return this._expansionView||this._pageView||this._groupView||this._rids},ve.prototype._updateRowIds=function(t){if(this._groupViewDirty=!1,this._parent&&!this._hidden){if(!this._shared.stalledRids){this._rids=t||this._parent.getAllRowIds(),this._dispatch("beforeFiltering",{}),this._excludedRids={};var e=0;e+=ve._copyObjectKeys(this._excludedRids,this._hiddenRids);var i=this._dt._getSegmentSeparators(),n=i?i.getSegments():null,o=this._getRemovalMap(this._excludedRids,this._userFilter,this._filteringOut,this._separatorFiltering?null:n);if(e+=o,this._collapsedRids=null,i&&(o&&this._emptySegmentFiltering&&(e+=this._getEmptySegments(this._excludedRids,n)),this._collapsedRids=i.getCollapsedRows(),e+=ve._copyObjectKeys(this._excludedRids,this._collapsedRids)),this._groupLevel>0&&!t&&(e+=this._getRemovalMap(this._excludedRids,this._groupFilterLogic,!1)),e&&(this._rids=this._rids.filter(this._byRemovalMap)),this._excludedRids=null,this._groupMembers)this._populateGroups();else{var r=this._updatePageCount();this._sort()||r||this._transformView()}}}else this._resetAllViews()},ve.prototype._onDataChanged=function(t){if(!this._conflator.conflate(t)){var e=this._conflator.popAllData()||[t],i=e.length;if(1===i){var n=e[0];if(n.globalChange)return this._updateRowIds(),void this._dispatchDataChange(n);var o=n.type;"inserted"===o?this._onRowInserted(n):"removed"===o?this._onRowRemoved(n):this._onRowUpdated(n)}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})}}},ve.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,n=this._resolveGroupId(t.rowData),o=n.length;o>1&&(this._shared.multiGroupRow=!0);for(var r=0;r<o;r++)if(i=n[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 u,h=t.nextRid;u=this.isSorting()&&!t.segmentChanged?this._addDataRow(l):this._addDataRow(l,h,t.fallback);var p=this._updatePageCount(),d=this._sort();return d&&(t.globalChange=!0),t.globalChange?d||p||this._transformView():(t={rid:l,rowData:a,type:"inserted"},null!=h&&(t.nextRid=h,t.fallback=u),this._transformView(u)&&(t.globalChange=!0)),this._dispatchDataChange(t),1},ve.prototype._onRowRemoved=function(t){if(this._shared.stalledRids)return 0;if(t.segmentChanged&&this.isSorting())return this._refreshAndNotify(),1;var e,i=0,n=t.rids;if(this._groupMembers){var o,r,s=t.rowData;if(!n&&s){for(o=this._resolveGroupId(s),e=0;e<o.length;e++)r=o[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,u,h=NaN,p=null;if(i=0,n){for(p=[],e=n.length;--e>=0;)a=n[e],(u=this._removeDataRow(a))>=0&&(p.push(a),u>=h||(h=u));i=p.length}else a=t.rid,(u=this._removeDataRow(a))>=0&&(p=[a],h=u,i=1);i>0&&(this._updatePageCount()||this._transformView(h)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(p),this._shared.autoGroupRemoval&&this._groupRows&&this._rids.length<=0&&this._triggerGroupRefreshing(),this._hiddenHeaderRow&&this._requestRebuildingRowIds(!0));return i},ve.prototype._onRowUpdated=function(t){var e,i,n=t.rid,o=t.rowData;if(this.isRowFiltered(n,o))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(n,o)||(l=1):r[4]&&(l=4),this._groupLevel>0){if(1===l)ve._removeArrayItem(this._rids,n)>=0&&this._groupView&&ve._removeArrayItem(this._groupView,n),this._shared.multiGroupRow&&(this._groupViewDirty=!0);else if(2===l){if(!this._hidden)this._rids.indexOf(n)<0&&this._rids.push(n),this._groupViewDirty=!0,this._resolveGroupId(o).length>1&&(this._shared.multiGroupRow=!0)}}else{var a=r[1]&&r[2]||r[4];if(this._shared.multiGroupRow||!a){var u=this._resolveGroupId(o);for(e=0;e<u.length;e++){i=u[e];var h=this._addGroup(i);h&&(h._onRowInserted(t),l=1)}}!a&&!this._hidden&&this._rids.indexOf(n)<0&&this._addDataRow(n),4===l?this._shared.multiGroupRow?this._dispatchGlobalChange():this._dispatchDataChange(t):(this._groupViewDirty=!0,this._dispatchGlobalChange())}return l}return this._isAllowedInGroup(n,o)?this._rids.indexOf(n)<0?(this._onRowInserted(t),2):(this._shared.stalledRids||this._sort()&&(t.globalChange=!0),this._dispatchDataChange(t),4):this._onRowRemoved(t)?1:0},ve.prototype._onGroupAdded=function(t){if(!this._hidden){var e=t.newGroup,i=e.getGroupRowId();this._groupView.push(i),this._groupViewDirty=!0,this._dispatch("groupAdded",t),ot.pushArrayItems(this._groupView,e.getFooterRowIds())}},ve.prototype._onBeforeGroupAdded=function(t){this._dispatch("beforeGroupAdded",t)},ve.prototype._requestRebuildingRowIds=function(t){this._groupMembers&&(this._groupViewDirty=!0),this._groupLevel>0?this._parent._requestRebuildingRowIds(t):(t?this._rebuildRowIdsFromChildren():this._updateRowIds(),this._dispatchGlobalChange())},ve.prototype._refreshAndNotify=function(){this._updateRowIds(),this._dispatchGlobalChange()},ve.prototype._onRefreshTimeout=function(){this._refreshTimerId=0,this._refreshAndNotify()},ve.prototype._addDataRow=function(t,e,i){var n=this._getRowIndex(this._rids,e,i);return this._insertItems(this._rids,n,t),this._groupView?this._groupMembers?(this._groupViewDirty=!0,this._insertItems(this._groupView,-1,t)):n<0?this._insertItems(this._groupView,-1,t):(n=this._getRowIndex(this._groupView,e,i),this._insertItems(this._groupView,n,t)):n>=0?n:this._rids.length-1},ve.prototype._insertItems=function(t,e,i){return e<0?(e=t.length,t.push(i)):t.splice(e,0,i),e},ve.prototype._getRowIndex=function(t,e,i){if(null==e)return-1;var n=this._rids.indexOf(e);return n>=0?n:null==i||i>=t.length?-1:i},ve.prototype._removeDataRow=function(t){var e=ve._removeArrayItem(this._rids,t);return this._groupView&&e>=0&&(e=ve._removeArrayItem(this._groupView,t)),e},ve._removeArrayItem=function(t,e){var i=t.indexOf(e);return i>=0&&t.splice(i,1),i},ve._removeArrayItems=function(t,e){for(var i=NaN,n=0,o=t.length;--o>=0;)e[t[o]]?++n:n&&(i=o+1,t.splice(i,n),n=0);return n&&(t.splice(0,n),i=0),i},ve._copyObjectKeys=function(t,e){if(e){var i=0;for(var n in e)t[n]=1,++i;return i}return 0},ve.prototype._isAllowedInGroup=function(t,e){if(this._groupLevel>0)for(var i=this,n=this._groupLevel;--n>=0;){if(!i._groupFilterLogic(t,e))return!1;i=i.getDataSource()}return!0},ve.prototype.isRowFiltered=function(t,e){return this._shared.stalledRids?!this._shared.stalledRids[t]:!(!this._hiddenRids||!this._hiddenRids[t])||(!(!this._collapsedRids||!this._collapsedRids[t])||!(!this._userFilter||this._userFilter(t,e)!==this._filteringOut))},ve.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,!0),n=gt._performMultiLevelSorting(e,this._sortingDefs,i);if(n)return this._rids=gt._reorderItems(t,n),this._transformView(),!0}return!1},ve.prototype._byRemovalMap=function(t){return!this._excludedRids[t]},ve.prototype._getRemovalMap=function(t,e,i,n){if(!e)return 0;var o,r,s,l=this._rids,a=this._dt,u=0,h=l.length;if(n)for(r=h;--r>=0;)n[o=l[r]]||((s=a.getRowData(o))?e(o,s)===i&&(t[o]=1,++u):(t[o]=1,++u));else for(r=h;--r>=0;)o=l[r],(s=a.getRowData(o))?e(o,s)===i&&(t[o]=1,++u):(t[o]=1,++u);return u},ve.prototype._getEmptySegments=function(t,e){var i=this._dt._getSegmentSeparators(),n=0;for(var o in e){var r=i.getSegment(o);if(r){var s=r.getChildren(),l=!0;for(var a in s)if(!t[a]){l=!1;break}l&&(t[o]=1,++n)}}return n},ve.prototype._getFilterLogic=function(t,e){return null!=t?"function"==typeof t?t:"string"==typeof t?ve._defaultFilterLogic.bind(null,t,e):ve._defaultFilterLogic.bind(null,t+"",e):null},ve.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)},ve.prototype._updatePaginationView=function(t){var e=!1;if(this._pageView){t||(t=0);var i=this._pageSize*(this._pageIndex-1),n=this._pageSize+i;if(t<n){var o=this._groupView||this._rids;n>o.length&&(n=o.length);var r=n-i;this._pageView.length=r>=0?r:0;for(var s=i;s<n;++s)this._pageView[s-i]=o[s];e=!0}}return e},ve.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)},ve.prototype._dispatchRowRemoved=function(t){t&&this._dispatchDataChange({type:"removed",rid:t})},ve.prototype._dispatchMultiRowRemoved=function(t){if(t){var e=t.length;1===e?this._dispatchRowRemoved(t[0]):e>1&&this._dispatchDataChange({type:"removed",rids:t})}},ve.prototype._dispatchGlobalChange=function(){this._dispatchDataChange(gt._globalChangeArg)},ve.prototype._dispatchDataChange=function(t){this._dispatch("dataChanged",t),this._wrapSize&&!this._wrapTimerId&&(this._wrapTimerId=setTimeout(this._updateWrapCount))},ve.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 n=this.enableColumnStats(i),o=this._parent.getColumnStats(i);n&&o&&n.setColumnDataGetter(o.getColumnDataGetter())}}},ve.prototype._populateGroups=function(){var t,e,i,n,o,r,s=this._rids;this._rids=[];var l={},a=[];for(e=s.length,t=0;t<e;++t){var u=s[t],h=this._dt.getRowData(u);if(h){(r=(o=this._resolveGroupId(h)).length)>1&&(this._shared.multiGroupRow=!0);for(var p=0;p<r;p++){var d=l[n=o[p]];d?d.push(u):(d=[u],l[n]=d,a.push(n))}}}if(this._shared.autoGroupRemoval)for(t=e=this._groupList.length;--t>=0;)l[n=this._groupList[t]]||(i=this._groupMembers[n])&&!i._predefinedGroup&&this._removeGroupMember(t,n);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;)n=this._groupList[t],(i=this._groupMembers[n])&&i._predefinedGroup&&(c?c.indexOf(i._groupId)<0&&this._removeGroupMember(t,n):this._removeGroupMember(t,n));if(c)for(e=c.length,t=0;t<e;++t){var _=this._addGroup(c[t]);_&&(_._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)n=this._groupList[t],(i=this._groupMembers[n])._updateRowIds(l[n]),i._markColumnStatsDirty();this._groupViewDirty=!0,this._rebuildRowIdsFromChildren()},ve.prototype._removeGroupMember=function(t,e){var i=this._groupMembers[e];i&&(this._groupList.splice(t,1),delete this._groupMembers[e],i.dispose())},ve.prototype._defaultGroupCriteria=function(t,e){var i=e[t];return Array.isArray(i)?i.map((function(t){return t+""})):[i+""]},ve.prototype._groupFilterLogic=function(t,e){return this._groupCriteria[this._groupLevel-1](e).indexOf(this._groupId)>=0},ve.prototype._internalGroupSortingLogic=function(t,e){var i=this._groupMembers[t],n=this._groupMembers[e];return this._groupSortingLogic(t,e,i,n)},ve.prototype._addGroup=function(t){var e=t+"";if(!e)return null;var i=this._groupMembers[e];if(i)return null;var n,o=(this._groupRowId||"_grp")+"_"+e;if(this._hasListener("beforeGroupAdded")&&(n={dataView:this,newGroupId:e,newGroupValue:t,newGroupRowId:o,newGroupLevel:this._groupLevel+1},this._dispatch("beforeGroupAdded",n),n.cancel))return null;i=new ve;var r=this._shared.defaultCollapse;return null!=r&&(i._collapsed=r),i._groupId=e,"string"==typeof t?"null"==t?i._groupValue=null:"undefined"!=t&&(i._groupValue=t):i._groupValue=t,n&&!0===n.hideHeaderRow&&(i._hiddenHeaderRow=!0),i._groupRowId=o,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},ve.prototype._triggerGroupRefreshing=function(){this._groupLevel>0?this._parent&&this._parent._triggerGroupRefreshing():this._groupRows&&!this._refreshTimerId&&(this._refreshTimerId=setTimeout(this._onRefreshTimeout,100))},ve.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 i=this._groupList[e],n=this._groupMembers[i];if(n._rebuildRowIdsFromChildren(),ot.pushArrayItems(this._rids,n._rids),!this._collapsed&&this._groupView&&(n._isHeaderRowShown()&&this._groupView.push(n._groupRowId),!n._collapsed)){var o=n._getFirstHiddenRids()||n._groupView||n._rids;ot.pushArrayItems(this._groupView,o),ot.pushArrayItems(this._groupView,n._footerRowIds)}}this._groupViewDirty=!1,this._updatePageCount()||this._transformView()}},ve.prototype._resolveGroupId=function(t){return this._groupCriteria[this._groupLevel](t)},ve.prototype._markColumnStatsDirty=function(){for(var t in this._columnStats)this._columnStats[t].markDirty()},ve._defaultFilterLogic=function(t,e,i,n){return n[t]===e},ve._defaultGroupSortingLogic=function(t,e){return t==e?0:t<e?-1:1};var Se=ve,we=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)};we.prototype._data,we.prototype._func=null,we.prototype._delay=0,we.prototype._timerId=0,we.prototype._conflated=!1,we.prototype._disabled=!1,we.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},we.prototype.popAllData=function(){if(this._data.length){var t=this._data;return this._data=[],t}return null},we.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},we.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))},we.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},we.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},we.prototype.getData=function(){return this._data},we.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},we.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},we.prototype.disable=function(t){this._disabled=!1!==t},we.prototype.isEnabled=function(){return!this._disabled},we.prototype.enable=function(t){this._disabled=!1===t},we._proto=we.prototype;var be=we,Re=function(t){var e=this;e._onDataChanged=e._onDataChanged.bind(e),e.extendEventArg=e.extendEventArg.bind(e),e._dataChangedConflator=new be(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")};s.inherits(Re,at),Re._runningId=0,Re.prototype._id="",Re.prototype._type="",Re.prototype._grid=null,Re.prototype._snapshot=null,Re.prototype._dataView=null,Re.prototype._dataArg=null,Re.prototype._autoSyncRowCount,Re.prototype._bindingEnabled=!0,Re.prototype._parent=null,Re.prototype._children=null,Re.prototype._dataChangedConflator,Re.prototype.getId=function(){return this._id},Re.prototype.setId=function(t){return this._id=t||"section"+Re._runningId++,this._grid.setAttribute("id",this._id),this._id},Re.prototype.getSection=function(){return this._snapshot||this._grid},Re.prototype.getSectionName=function(){return this._grid.getId()},Re.prototype.getIndex=function(){return this._grid.getIndex()},Re.prototype.getType=function(){return this._type},Re.prototype.setType=function(t){this._type!==t&&(this._type&&this._grid.removeClass(this._type),this._type=t||"",t&&this._grid.addClass(t))},Re.prototype.getDataSource=function(){return this._dataView},Re.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))},Re.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},Re.prototype.getData=function(t,e){return this._dataView?(e=this._getRowId(e),this._dataView.getData(e,t)):null},Re.prototype.setData=function(t,e,i){return!!this._dataView&&(e=this._getRowId(e),this._dataView.setData(e,t,i),!0)},Re.prototype.getRowData=function(t){return this._dataView?(t=this._getRowId(t),this._dataView.getRowData(t)):null},Re.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)},Re.prototype.activateColumns=function(t,e,i){if("content"===this._type)for(var n=i+1;--n>=e;){var o=t[n];null!=o&&this._grid.activateColumn(n,o)}},Re.prototype.getChildren=function(){return this._children},Re.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))},Re.prototype.getParent=function(){return this._parent},Re.prototype.getDataChangedConflator=function(){return this._dataChangedConflator},Re.prototype.disableConflation=function(t){this._dataChangedConflator.disable(t)},Re.prototype.disableDataBinding=function(t){this._bindingEnabled=!1===t},Re.prototype.getAutoSyncRowCount=function(){return null!=this._autoSyncRowCount?this._autoSyncRowCount:"content"===this._type},Re.prototype.setAutoSyncRowCount=function(t){if(this._autoSyncRowCount=t,this.getAutoSyncRowCount()){var e=this._dataView?this._dataView.getVisibleRowCount():0;this._grid.setRowCount(e)}},Re.prototype.isDataBindable=function(){return!(!this._bindingEnabled||!this._dataView)},Re.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},Re.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},Re.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},Re.prototype.extendDataEventArg=function(t,e,i){var n,o;if(t||(t={}),t.firstUpdate=e,t.lastUpdate=i,this._snapshot?(n=0,o=this._grid.getRowCount()):(n=this._grid.getFirstIndexInView(),o=this._grid.getLastIndexInView()+1),t.fromRowIndex=e>n?e:n,this._dataView){var r=this._dataView.getVisibleRowCount();t.dataRowCount=r,o>r&&(o=r)}return t.toRowIndex=i+1<o?i+1:o,this.extendEventArg(t),t},Re.prototype.setIndex=function(t){this._grid.setIndex(t)},Re.prototype.getRowOffset=function(){return this._grid.getRowOffset()},Re.prototype.setRowOffset=function(t){this._grid.setRowOffset(t)},Re.prototype.enableColumnVirtualization=function(t){t=!1!==t,"content"===this._type&&this._grid.enableColumnVirtualization(t)},Re.prototype.isBinding=function(){return this._isEventDispatching("dataChanged")},Re.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))}},Re.prototype._dispatchDataChanged=function(t,e){var i=this.getAutoSyncRowCount(),n=this._dataView?this._dataView.getVisibleRowCount():0,o=this._grid.getRowCount();i?n!==o&&this._grid.setRowCount(n,!0):n>o&&(e=o-1),this.updateRowData(t,e,this._dataArg),this._dataArg=null},Re.prototype.updateRowData=function(t,e,i){this.isDataBindable()&&(this._grid._getTempRowHeights()&&(t=this._grid.getFirstIndexInView(),e=this._grid.getLastIndexInView()+1),(i=this.extendDataEventArg(i,t,e)).fromRowIndex<i.toRowIndex&&this._dispatch("dataChanged",i))},Re.prototype.rerender=function(){this.isDataBindable()?this.updateRowData():this._dispatch("rowAvailable",this.extendEventArg())},Re.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())}},Re.prototype._getRowId=function(t){return ot.isNumber(t)?this._dataView.getRowId(t):t},Re.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 n=i.length;--n>=0;)e.updatedRids[i[n]]=!0;else t.rid&&(e.updatedRids[t.rid]=!0);"updated"!==t.type&&(e.indexShifted=!0,"removed"===t.type&&(e.dataRemoved=!0))}},Re.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))},Re._proto=Re.prototype;var Ie=Re,De=function(t){this._layout=t,this._arg={},this._addEvent("indexChanged")};s.inherits(De,at),De.prototype._layout,De.prototype._viewSize=0,De.prototype._viewOffset=0,De.prototype._startOffsetCount=0,De.prototype._endOffsetCount=0,De.prototype._bufferSize=0,De.prototype._arg=null,De.prototype._enabled=!0,De.prototype._active=!0,De.prototype._virtualizable=!1,De.prototype._getMinIndex=function(){return this._startOffsetCount},De.prototype._getMaxIndex=function(){var t=this._layout.getLaneCount()-this._endOffsetCount;return t>this._startOffsetCount?t:this._startOffsetCount},De.prototype.getContentStart=function(t){return this._layout.getLaneStart(t)},De.prototype.getContentInViewCount=function(){var t=this.getFirstIndexInView(),e=this.getLastIndexInView();return t>=0&&t<e?e-t+1:0},De.prototype._getContentSizeInBounds=function(){var t=this._getMinIndex(),e=this._getMaxIndex();return this._layout.getLaneStart(e)-this._layout.getLaneStart(t)},De.prototype.getViewSize=function(){return this._viewSize},De.prototype.getViewOffset=function(){var t=this._getMinIndex();return this._viewOffset+this._layout.getLaneStart(t)},De.prototype.getIndexOffset=function(){return this._startOffsetCount},De.prototype.isVirtualizable=function(){return this._virtualizable},De.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)},De.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},De.prototype.getPrevFirstIndexInView=function(){return null!=this._arg.prevFirstIndex?this._arg.prevFirstIndex:-1},De.prototype.getPrevLastIndexInView=function(){return null!=this._arg.prevLastIndex?this._arg.prevLastIndex:-1},De.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(),n=this._arg.prevFirstIndex!==e||this._arg.prevLastIndex!==i;return(t||n)&&(this._arg.firstIndex=e,this._arg.lastIndex=i,this._dispatch("indexChanged",this._arg),this._arg.prevFirstIndex=e,this._arg.prevLastIndex=i),n},De.prototype.isEnabled=function(){return this._enabled},De.prototype.enable=function(t){t=!1!==t,this._enabled!==t&&(this._enabled=t,this.validateVirtualization(),this.update(!0))},De.prototype.disable=function(t){this.enable(!1===t)},De.prototype.isActive=function(){return this._active},De.prototype.activate=function(t){t=!1!==t,this._active!==t&&(this._active=t,this.validateVirtualization(),this.update(!0))},De.prototype.deactivate=function(t){this.activate(!1===t)},De.prototype.getBufferSize=function(){return this._bufferSize},De.prototype.setContentLayout=function(t){this._layout!==t&&(this._layout=t,this.validateVirtualization())},De.prototype.setViewSize=function(t){t<0&&(t=0),this._viewSize!==t&&(this._viewSize=t,this.validateVirtualization())},De.prototype.setViewOffset=function(t){this._viewOffset=t>0?t:0,this.update()},De.prototype.setViewBounds=function(t,e){this._startOffsetCount=t>0?t:0,this._endOffsetCount=e>0?e:0,this.validateVirtualization()},De.prototype.setBufferSize=function(t){t<0&&(t=0),this._bufferSize!==t&&(this._bufferSize=t,this.validateVirtualization())},De.prototype.validateVirtualization=function(){this._virtualizable=!1,this._enabled&&this._active&&this._viewSize>0&&this._getContentSizeInBounds()>this._viewSize&&(this._virtualizable=!0)},De._proto=De.prototype;var xe=De,Ae=function(){var t=this;t._vertical=!0,t._hostClassName="vscrollbar-host",Ae.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")};s.inherits(Ae,pe),Ae.prototype.setScrollContent=function(t,e,i){this._clearAllPanes();var n=e.length;if(!(n<=0)){for(var o=this._panes[0],r=this._paneSliders[0],s=0;s<i;)e[s++].setParent(t);o.setParent(t);for(var l=n-this._footerCount;s<l;)e[s++].setParent(r);for(;s<n;)e[s++].setParent(t);this.invalidateContent()}},Ae.prototype.setHeight=function(t){return this.setTrackSize(t,t),!0},Ae.prototype.getHeight=function(){return this.getPaneSize()},Ae.prototype.getScrollTop=function(){return this._getScrollValue()},Ae.prototype.setScrollTop=function(t){this.update(),this._scrollTo(t)},Ae.prototype.isEndOfVerticalScroll=function(){return this._isEndOfScroll()},Ae.prototype.getContentHeight=function(){for(var t=this._paneSliders[0].getContent(!0),e=0,i=t.length;--i>=0;)e+=t[i].offsetHeight;return e},Ae.prototype.calculateContentSize=function(){return this.getContentHeight()},Ae.prototype.getPane=function(){return this._panes[0]},Ae.prototype._onScroll=function(t){this._dispatch("contentScrolled",t)},Ae._proto=Ae.prototype;var Le=Ae,Te=function(t,e){return t>e?e:t<0?0:t},Ee=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 fe(t),e._grid.setParent(e._element),e._layoutY=new qt,e._selectionList=new le,e._reverter=new ue(e._onRestingPosition,200),e._addEvent("rowHighlighted"),e._addEvent("rowCountChanged"),e._addEvent("rowHeightChanged"),e._addEvent("rowAvailable")};s.inherits(Ee,Ht),Ee.prototype._index=-1,Ee.prototype._rowOffset=0,Ee.prototype._firstIndex=0,Ee.prototype._grid,Ee.prototype._layoutY,Ee.prototype._selectionList=null,Ee.prototype._reverter=null,Ee.prototype._rowBounds=null,Ee.prototype._rowBoundCache=null,Ee.prototype._rowSelDirty=!1,Ee.prototype._cellBound=null,Ee.prototype._cbLftIdx=0,Ee.prototype._cbRgtIdx=0,Ee.prototype._cbTopIdx=0,Ee.prototype._cbBtmIdx=0,Ee.prototype._rowBoundTimer=0,Ee.prototype._boundLayer=null,Ee.prototype._hscrollbar=null,Ee.prototype._session="A",Ee.prototype._tempRowHeights=null,Ee.prototype.getWidth=function(){return this.isVisible()?this._grid.getWidth():0},Ee.prototype.getHeight=function(){return this.isVisible()?this._element.offsetHeight:0},Ee.prototype.dispose=function(){this.setRowCount(0),this.unlistenAll(),this._hscrollbar=null,this._grid.dispose(),this._dispose(),this._reverter.dispose(),this._rowBounds=this._rowBoundCache=null,this._rowSelDirty=!1,this._rowBoundTimer&&(clearTimeout(this._rowBoundTimer),this._rowBoundTimer=0)},Ee.prototype.setWidth=function(t){return this._grid.setWidth(t)},Ee.prototype.setHeight=function(t){return console.log("unsupported"),!1},Ee.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._dispatchRowHeightChangedEvent(0,this._layoutY.getLaneCount())},Ee.prototype.hitTest=function(t,e){var i=[];return i.colIndex=this._grid.hitTestX(t),i.rowIndex=this._layoutY.hitTest(e),i},Ee.prototype.hitTestX=function(t){return this._grid.hitTestX(t)},Ee.prototype.hitTestY=function(t){return this._layoutY.hitTest(t)},Ee.prototype.getDefaultColumnWidth=function(){return this._grid.getDefaultColumnWidth()},Ee.prototype.setDefaultColumnWidth=function(t){this._grid.setDefaultColumnWidth(t)},Ee.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},Ee.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()))},Ee.prototype.getColumnWidth=function(t){return this._grid.getColumnWidth(t)},Ee.prototype.setColumnWidth=function(t,e){return this._grid.setColumnWidth(t,e)},Ee.prototype._setColumnWidth=function(t,e){return this._grid._setColumnWidth(t,e)},Ee.prototype._updateColumnLayout=function(){this._grid._updateColumnLayout()},Ee.prototype._startBindingSession=function(t){if(this._isBinding=t,!t){if(this._tempRowHeights){var e=this.getDefaultRowHeight(),i=!0,n=[];for(var o in this._tempRowHeights){var r=+o,s=this._layoutY.getLaneProperty(r,"sizeSession");s&&s!=this._session&&(this.setRowHeight(r,e),this._layoutY.setLaneProperty(r,"sizeSession",null),n.push(r))}for(var l=n.length,a=0;a<l;a++)delete this._tempRowHeights[n[a]];if(l)for(var u in this._tempRowHeights){i=null!=u;break}i||(this._tempRowHeights=null)}this._session="A"===this._session?"B":"A"}},Ee.prototype._getTempRowHeights=function(){return this._tempRowHeights},Ee.prototype.getRowHeight=function(t){return this._layoutY.getLaneSize(t)},Ee.prototype.setRowHeight=function(t,e){return this._isBinding&&e!=this.getDefaultRowHeight()&&(this._layoutY.setLaneProperty(t,"sizeSession",this._session),this._tempRowHeights||(this._tempRowHeights=[]),this._tempRowHeights[t]=!0),!!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))},Ee.prototype.isColumnVisible=function(t){return this._grid.isColumnVisible(t)},Ee.prototype.hideColumn=function(t,e){return this._grid.hideColumn(t,e)},Ee.prototype.isRowVisible=function(t){return this._grid.isRowVisible(t-this._firstIndex)},Ee.prototype.hideRow=function(t,e){return this._grid.hideRow(t-this._firstIndex,e)},Ee.prototype.getMinimumColumnWidth=function(t){return this._grid.getMinimumColumnWidth(t)},Ee.prototype.setMinimumColumnWidth=function(t,e){return this._grid.setMinimumColumnWidth(t,e)},Ee.prototype.getMinimumRowHeight=function(t){return this._layoutY.getMinimumLaneSize(t)},Ee.prototype.setMinimumRowHeight=function(t,e){return console.log("unsupported"),!1},Ee.prototype.getCellLeft=function(t){return this._grid.getCellLeft(t)},Ee.prototype.getCellTop=function(t){return this._layoutY.getLaneStart(t)},Ee.prototype.getCellWidth=function(t,e){return this._grid.getCellWidth(t,0)},Ee.prototype.getCellHeight=function(t,e){return this._layoutY.getLaneSize(e)},Ee.prototype.hasCellSpan=function(){return this._grid.hasCellSpan()},Ee.prototype.getCellRowSpan=function(t,e){return this._grid.getCellRowSpan(t,e-this._firstIndex)},Ee.prototype.setCellRowSpan=function(t,e,i){return this._grid.setCellRowSpan(t,e-this._firstIndex,i)},Ee.prototype.getCellColSpan=function(t,e){return this._grid.getCellColSpan(t,e-this._firstIndex)},Ee.prototype.setCellColSpan=function(t,e,i){return this._grid.setCellColSpan(t,e-this._firstIndex,i)},Ee.prototype.clearCellSpans=function(){return this._grid.clearCellSpans()},Ee.prototype.clearColumnSpans=function(t){return this._grid.clearColumnSpans(t)},Ee.prototype.clearColumnCustomizations=function(){this._grid.clearColumnCustomizations()},Ee.prototype.clearRowCustomizations=function(){this._layoutY.clearLaneCustomizations(),this._grid.clearRowCustomizations()},Ee.prototype.getColumnScalability=function(t){return this._grid.getColumnScalability(t)},Ee.prototype.setColumnScalability=function(t,e){return this._grid.setColumnScalability(t,e)},Ee.prototype.getRowScalability=function(t){return this._layoutY.getLaneScalability(t)},Ee.prototype.setRowScalability=function(t,e){return console.log("unsupported"),!1},Ee.prototype.getCell=function(t,e,i){return this._grid.getCell(t,e-this._firstIndex,i)},Ee.prototype.getCellContent=function(t,e){return this._grid.getCellContent(t,e-this._firstIndex)},Ee.prototype.setCellContent=function(t,e,i){return this._grid.setCellContent(t,e-this._firstIndex,i)},Ee.prototype.getColumnCount=function(){return this._grid.getColumnCount()},Ee.prototype.setColumnCount=function(t){this._grid.setColumnCount(t)},Ee.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},Ee.prototype.setRowCount=function(t,e){var i=this._layoutY.getLaneCount();i!==t&&(this._layoutY.setLaneCount(t),this._tempRowHeights&&(this._tempRowHeights.length=t),this._element.style.height=this._layoutY.getTrackSize()+"px",this._requestUpdatingRowBounds(),this._dispatch("rowCountChanged",{rowCount:t,prevCount:i,noBinding:e}))},Ee.prototype.getVisibleRowCount=function(){return this.getRowCount()},Ee.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))},Ee.prototype.removeRow=function(t){if(!(t<=0)){var e=this._layoutY.getLaneCount();t>e&&(t=e),this.setRowCount(e-t)}},Ee.prototype.setBorders=function(t,e,i,n){this._grid.setBorders(t,e,i,n)},Ee.prototype.getColumnStyle=function(t,e){return this._grid.getColumnStyle(t,e)},Ee.prototype.setColumnStyle=function(t,e,i){this._grid.setColumnStyle(t,e,i)},Ee.prototype.enableColumnClass=function(t,e,i){this._grid.enableColumnClass(t,e,i)},Ee.prototype.hasColumnClass=function(t,e){return this._grid.hasColumnClass(t,e)},Ee.prototype.enableRowClass=function(t,e,i){this._grid.enableRowClass(t-this._firstIndex,e,i)},Ee.prototype.setRowStyle=function(t,e,i,n){this._grid.setRowStyle(t-this._firstIndex,e,i,n)},Ee.prototype.getContentWidth=function(){return this._grid.getContentWidth()},Ee.prototype.getContentHeight=function(){return this._layoutY.getTrackSize()},Ee.prototype.getCellsByRowIndex=function(t){return this._grid.getCellsByRowIndex(t-this._firstIndex)},Ee.prototype.disableHorizontalGridLine=function(t){this._grid.disableHorizontalGridLine(t)},Ee.prototype.disableVerticalGridLine=function(t){this._grid.disableVerticalGridLine(t)},Ee.prototype.enableShading=function(t){this._grid.enableShading(t)},Ee.prototype.setTransposedShading=function(t){this._grid.setTransposedShading(t)},Ee.prototype.enableRowHighlighting=function(t){this._grid.enableRowHighlighting(t)},Ee.prototype.getRowHighlight=function(){var t=this._grid.getRowHighlight();return t>=0&&(t+=this._firstIndex),t},Ee.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)}},Ee.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},Ee.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},Ee.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},Ee.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._rowSelDirty=!0,this._initBoundLayer()),this._requestUpdatingRowBounds()},Ee.prototype.selectSingleRow=function(t){this._selectionList.clearAllSelections(),this._grid.clearSelectedRows(),this.setSelectedRow(t)},Ee.prototype.selectRowRange=function(t,e){this._selectionList.selectRange(t,e),this._updateRowSelection(),this._rowSelDirty=!0,this._initBoundLayer(),this._requestUpdatingRowBounds()},Ee.prototype.clearSelectedRows=function(){var t=this._selectionList.clearAllSelections();return this._grid.clearSelectedRows(),this._requestUpdatingRowBounds(),t},Ee.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},Ee.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},Ee.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},Ee.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},Ee.prototype.activateColumn=function(t,e){this._grid.activateColumn(t,e)},Ee.prototype.activateRows=function(t,e,i){var n=this._layoutY.getLaneCount();t||(t=this._rowOffset),e||0===e||(e=t+n),(t-=this._rowOffset)<0&&(t=0),(e-=this._rowOffset)<0&&(e=0);var o=this._getInnerRowCount(),r=this._firstIndex,s=0;(s=t-(1&t))<0?s=0:s>n&&(s=n);var l=e+(1&e)-s;l+2===o&&(l=o),l<0?l=0:l+s>n&&(l=n-s),this._firstIndex=s;var a=s+l,u=this._layoutY.getLaneStart(s),h=this._grid.getElement();h&&(h.style.transform=u?"translateY("+u+"px)":"",h.style.top="",this._reverter.start()),this._grid._onEnterDocument();var p=!1;if(l!==o){if(this._grid.setRowCount(l),l>o){var d={};d.prevRowIndex=s+o,d.rowIndex=s+l,i&&(d.noDataUpdate=!0),this._dispatch("rowAvailable",d)}p=!0}if(i){if(!p){this._grid.clearSelectedRows();var c=r+o;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()},Ee.prototype.moveRowsToTop=function(t){this._grid.moveRowsToTop(t)},Ee.prototype.getFirstIndexInView=function(){return this._firstIndex},Ee.prototype.getLastIndexInView=function(){var t=this._firstIndex+this._getInnerRowCount()-1,e=this._grid._getContext().getDataSource(),i=e?e.getRowCount()-1:-1;return t>i?i:t},Ee.prototype.isInCurrentView=function(t){return this._firstIndex<=t&&t<this._firstIndex+this._getInnerRowCount()},Ee.prototype.getFrozenLayout=function(){return this._grid.getFrozenLayout()},Ee.prototype.setFrozenLayout=function(t){this._grid.setFrozenLayout(t)},Ee.prototype.getColumn=function(t){return this._grid.getColumn(t)},Ee.prototype.insertColumn=function(t,e){return this._grid.insertColumn(t,e)},Ee.prototype.removeColumnAt=function(t){return this._grid.removeColumnAt(t)},Ee.prototype.moveColumn=function(t,e){this._grid.moveColumn(t,e)},Ee.prototype.enableRowVirtualization=function(t){},Ee.prototype.enableColumnVirtualization=function(t){this._grid.enableColumnVirtualization(t)},Ee.prototype.getColumnIndex=function(t){return this._grid.getColumnIndex(t)},Ee.prototype.getCellIndex=function(t,e){var i=this._grid.getCellIndex(t,e);return i<0?-1:i+this._firstIndex},Ee.prototype.getIndex=function(){return this._index},Ee.prototype.setIndex=function(t){this._index=t},Ee.prototype.setRowOffset=function(t){this._rowOffset=t},Ee.prototype.getRowOffset=function(){return this._rowOffset},Ee.prototype.updateLayout=function(){this._grid.updateLayout()},Ee.prototype.stretchCell=function(t,e,i,n){var o=this._grid.stretchCell(t,null!=e?e-this._firstIndex:null,i,n);if(o){var r=o.getElement();0===e?r.classList.add("top"):r.classList.remove("top")}return o},Ee.prototype.unstretchCell=function(t,e){return this._grid.unstretchCell(t,null!=e?e-this._firstIndex:null)},Ee.prototype.unstretchAllCells=function(){this._grid.unstretchAllCells()},Ee.prototype.getStretchedCell=function(t,e){return this._grid.getStretchedCell(t,null!=e?e-this._firstIndex:null)},Ee.prototype.getStretchedCells=function(){return this._grid.getStretchedCells()},Ee.prototype.updateStretchedCells=function(){return this._grid.updateStretchedCells()},Ee.prototype.getColumnHost=function(){return this._grid.getElement()},Ee.prototype.setHidingMethod=function(t){this._grid.setHidingMethod(t)},Ee.prototype.getHidingMethod=function(){return this._grid.getHidingMethod()},Ee.prototype.setColumnVisibility=function(t,e,i){return this._grid.setColumnVisibility(t,e,i)},Ee.prototype.getRowLayout=function(){return this._layoutY},Ee.prototype.reserveRightSpace=function(t){return this._grid.reserveRightSpace(t)},Ee.prototype.getReservedSpace=function(){return this._grid.getReservedSpace()},Ee.prototype.getComputedStyle=function(){return this._grid.getComputedStyle()},Ee.prototype.isColumnActive=function(t){return this._grid.isColumnActive(t)},Ee.prototype.setRowAttributes=function(t,e){return this._grid.setRowAttributes(t,e)},Ee.prototype.getContextRow=function(t){return this._grid.getContextRow(t-this._firstIndex)},Ee.prototype.selectColumn=function(t,e){this._grid.selectColumn(t,e)},Ee.prototype.isSelectedColumn=function(t){return this._grid.isSelectedColumn(t)},Ee.prototype.selectCell=function(t,e,i){this._grid.selectCell(t,e-this._firstIndex,i)},Ee.prototype.setCellBounds=function(t,e,i,n){var o=this._cellBound;o||((o=this._cellBound=document.createElement("div")).className="selection-bound"),this._initBoundLayer();var r=t+i,s=e+n,l=this.getColumnCount(),a=this._layoutY.getLaneCount();this._cbLftIdx=Te(t,l),this._cbRgtIdx=Te(r,l),this._cbTopIdx=Te(e,a),this._cbBtmIdx=Te(s,a),this._updateCellBounds()},Ee.prototype.getHorizontalLayout=function(){return this._grid.getHorizontalLayout()},Ee.prototype.calculateColumnBounds=function(t,e,i,n){this._grid.calculateColumnBounds(t,e,i,n)},Ee.prototype._updateCellBounds=function(){var t=this._cellBound;if(t){var e,i,n,o,r=this.getHorizontalLayout(),s=this._layoutY,l=this._cbLftIdx,a=this._cbRgtIdx,u=this._cbTopIdx,h=this._cbBtmIdx;e=i=n=o=0,l<a&&u<h&&(e=r.getLaneStart(l),i=r.getLaneEnd(a-1),n=s.getLaneStart(u),o=s.getLaneEnd(h-1));var p=i-e,d=o-n,c=[!1,!1];if(p>0&&d>0&&this._hscrollbar){var _=[0,0];this.calculateColumnBounds(l,a-1,_,c),p=(i=_[1])-(e=_[0])}if(p>0)t.style.left=e+"px",t.style.top=n+"px",t.style.width=p+"px",t.style.height=d+"px",t.classList.toggle("no-left-bound",c[0]),t.classList.toggle("no-right-bound",c[1]),this._boundLayer&&this._boundLayer.appendChild(t);else{var f=t.parentNode;f&&f.removeChild(t)}}},Ee.prototype.updateColumnBounds=function(t,e,i){this._grid.updateColumnBounds(t,e,i),this._updateRowBounds()},Ee.prototype.updateColumnSeparators=function(){this._grid.updateColumnSeparators()},Ee.prototype._initBoundLayer=function(){var t=this._boundLayer;t||((t=this._boundLayer=document.createElement("div")).className="cover-layer",this._element.appendChild(t))},Ee.prototype._requestUpdatingRowBounds=function(){this._rowBoundTimer||(this._rowBoundTimer=setTimeout(this._updateRowBounds,10))},Ee.prototype._updateRowBounds=function(){if(this._rowBoundTimer=0,this._updateCellBounds(),this._rowSelDirty){var t=this._rowBounds,e=this._rowBoundCache;t||(t=this._rowBounds=[]),e||(e=this._rowBoundCache=[]);var i=this._selectionList,n=this._layoutY.getLaneCount();i.deselectFrom(n);var o,r=i.getConnectedRanges(),s=r.length,l=null,a=null,u=t.length;for(o=s;o<u;++o)(l=(a=t[o]).parentNode)&&l.removeChild(a);if(t.length=u=s,s){var h=0,p=0,d=0,c=!1;this._hscrollbar&&(h=this._hscrollbar.getScrollLeft(),p=this._hscrollbar.getPinnedLeftColumnCount(),d=this._hscrollbar.getPinnedRightColumnCount(),c=this._hscrollbar.isEndOfHorizontalScroll());var _=!p&&h>0,f=!d&&!c,g=this._grid._getViewSize();for(o=0;o<s;++o){var y=r[o],m=y[0],C=y[1],v=this._layoutY.getLaneStart(m),S=this._layoutY.getLaneEnd(C);(a=e[o])||((a=e[o]=document.createElement("div")).className="selection-bound"),a.style.top=v+"px",a.style.height=S-v+"px",a.style.width=g+"px",a.classList.toggle("no-left-bound",_),a.classList.toggle("no-right-bound",f),this._boundLayer&&(t[o]||(t[o]=a,this._boundLayer.appendChild(a)))}}else{i.getSelectionCount()||(this._rowSelDirty=!1)}}},Ee.prototype._getInnerRowCount=function(){return this._grid.getRowCount()},Ee.prototype._updateRowSelection=function(){this._grid.clearSelectedRows();var t=this._selectionList,e=t.getSelectionCount();if(!(e<=0)){var i,n=this._firstIndex,o=n+this._getInnerRowCount();if(1===e)n<=(i=t.getFirstSelectedIndex())&&i<o&&this._grid.setSelectedRow(i-n,!0);else if(e>=o-n)for(i=n;i<o;++i)t.getSelection(i)&&this._grid.setSelectedRow(i-n,!0);else for(var r=t.getAllSelections(),s=0;s<e;++s)n<=(i=r[s])&&i<o&&this._grid.setSelectedRow(i-n,!0)}},Ee.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},Ee.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":""}},Ee.prototype._updateRightSpaceStyle=function(){this._grid._updateRightSpaceStyle()},Ee.prototype._updateLayers=function(){this._grid._updateLayers()},Ee.prototype._setContext=function(t){this._grid._setContext(t)},Ee.prototype._getContext=function(){return this._grid._getContext()},Ee._proto=Ee.prototype;var Me=Ee,Fe=function(t,e){return t-e},Pe=function(t){Pe._sectionType||(Pe._sectionType={},Pe._sectionType.title=!0,Pe._sectionType.header=!0,Pe._sectionType.content=!0,Pe._sectionType.footer=!0);var e=this;if(e.getColumnId=e.getColumnId.bind(e),e.getColumnIndex=e.getColumnIndex.bind(e),e._onMouseMove=e._onMouseMove.bind(e),e._onRowHightlighted=e._onRowHightlighted.bind(e),e._onGridClicked=e._onGridClicked.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._onSyncHScroll=e._onSyncHScroll.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),e._requestScrollbarUpdate=e._requestScrollbarUpdate.bind(e),t)for(var i=t.childNodes.length;--i>=0;)ot.isElement(t.childNodes[i])||t.removeChild(t.childNodes[i]);e._element=t||document.createElement("div"),e._element.classList.add("tr-grid"),e._layoutX=new qt,e._layoutY=new qt,e._layoutX.setDefaultLaneSize(100),e._layoutY.setDefaultLaneSize(32),e._settings=[],e._plugins={},e._columnDefs=[],e._sectionStarts=[],e._rowHeightException="title",e._rowVirtualizer=new xe(e._layoutY),e._rowVirtualizer.deactivate(),e._rowVirtualizer.setViewSize(360),e._colVirtualizer=new xe(e._layoutX),e._colVirtualizer.enable(!1),e._colVirtualizer.deactivate(),e._colVirtualizer.setViewSize(400),e._vscrollbar=new Le,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 ce,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),ot.isMobile||ot.isTouchDevice?e._element.addEventListener("touchmove",this._onMouseMove,!1):e._element.addEventListener("mousemove",this._onMouseMove,!1),ot.isSafari&&e._element.addEventListener("click",this._onGridClicked),window.addEventListener("resize",e._onWindowResize,!1),e._rowVirtualizer.listen("indexChanged",e._onRowInViewChanged),e._colVirtualizer.listen("indexChanged",e._onColInViewChanged),e._rowHeightConflator=new be(e._onRowHeightChanged,50),e._vScrollbarConflator=new be(e._updateVScrollbar,200),e._columnBoundConflator=new be(e._updateColumnBounds,10),e._columnPositionConflator=new be(e._dispatchColumnPositionChanged,10),e._rowPositionConflator=new be(e._dispatchRowPositionChanged,10),e._addEvents("sectionAdded","columnAdded","columnRemoved","columnMoved","columnVisibilityChanged","columnAlignmentChanged","widthChanged","dataSourceChanged","postDataSourceChanged","preSectionRender","postSectionRender","beforeContentBinding","preSectionDataBinding","postSectionDataBinding","firstRendered","afterContentBinding","rowExpansionBinding","rowHighlighted","preForcedUpdate","rowAdded","rowRemoved","columnPositionChanged","rowPositionChanged","beforeColumnBoundUpdate","beforeBatchOperation","afterBatchOperation","pinningChanged");var n=Pe.map;n||(n={},Pe.map=n);var o=e._element;o._control=e;var r=o.id||o.name;r&&!n[r]||(r="_grid"+Pe._runningGridId),e._id=r,n[r]=e,Pe._runningGridId++;var s=document.createElement("input");s.style.position="absolute",s.style.width="0",s.style.height="0",s.style.padding="0",s.style.border="0",s.value="0",e._hiddenInput=s,o.insertBefore(s,o.firstChild),Object.defineProperty(e,"zoomFactor",{set:function(t){!t||t<0||this._zoomFactor!==t&&(this._zoomFactor=t,e._updateLayout())},get:function(){return this._zoomFactor}})};s.inherits(Pe,Ht),Pe.SectionReference,Pe.MouseInfo,Pe.BatchInfo,Pe.CellReference,Pe.ColumnOptions,Pe._runningGridId=0,Pe._runningColumnId=0,Pe._sectionType,Pe.prototype._plugins,Pe.prototype._dataSource=null,Pe.prototype._layoutX,Pe.prototype._layoutY,Pe.prototype._vscrollbar,Pe.prototype._hscrollbar,Pe.prototype._tempFrozenSectionRef="",Pe.prototype._startVScrollbarIndex=-1,Pe.prototype._hScrollbarEnabled=!0,Pe.prototype._pinnedLeftColumnCount=0,Pe.prototype._pinnedRightColumnCount=0,Pe.prototype._frozenFooterCount=0,Pe.prototype._fixFrozenTopSections=!1,Pe.prototype._fixFrozenBottomSection=!1,Pe.prototype._sectionStarts,Pe.prototype._settings,Pe.prototype._firstSettings,Pe.prototype._lastSettings,Pe.prototype._fitContentWidth=!1,Pe.prototype._columnDefs,Pe.prototype._rowVirtualizer,Pe.prototype._colVirtualizer,Pe.prototype._autoSetDataSource=!0,Pe.prototype._renderingHandler=null,Pe.prototype._dataBindingHandler=null,Pe.prototype._frozenLayout=!1,Pe.prototype._noBinding=!1,Pe.prototype._rowHeightSync=!0,Pe.prototype._rowHighlighting=!1,Pe.prototype._dispatchingDataChanged=!1,Pe.prototype._rowHeightException="",Pe.prototype._rowScrollingStep=0,Pe.prototype._zoomFactor=1,Pe.prototype._reservedSpace=0,Pe.prototype._hidingMethod="",Pe.prototype._rowHeightConflator=null,Pe.prototype._vScrollbarConflator=null,Pe.prototype._columnBoundConflator=null,Pe.prototype._rowRefreshTimer=0,Pe.prototype._layoutUpdating=!1,Pe.prototype._hiddenInput,Pe.prototype._bottomPadding=6,Pe.prototype._bottomPaddingSect=null,Pe.prototype._preserveProportion=!1,Pe.prototype._preserveGridSize=!1,Pe.prototype._rowHeightTimerId=0,Pe.prototype._groupDefs=null,Pe.prototype._batches=null,Pe.prototype._firstRendered=!1,Pe.prototype._hasPendingRowChange=!1,Pe.getVersion=function(){return"5.1.95"},Pe.prototype.dispose=function(){var t=this._id,e=Pe.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 n=this._getColumnDef(i);n.renderingHandler=n.dataBindingHandler=null}for(var o in this._plugins){var r=this._plugins[o];r.unload&&r.unload(this)}this.removeAllSections();var s=this._vscrollbar._mainScrollbar;s&&(s.unlisten("scroll",this._onSyncVScroll),this._vscrollbar._mainScrollbar=null),(s=this._hscrollbar._mainScrollbar)&&(s.unlisten("scroll",this._onSyncHScroll),this._hscrollbar._mainScrollbar=null),this._vscrollbar.dispose(),this._hscrollbar.dispose(),this._rowHeightConflator.dispose(),this._vScrollbarConflator.dispose(),this._columnBoundConflator.dispose(),this._columnPositionConflator.dispose(),this._rowPositionConflator.dispose(),this._layoutX.dispose(),this._layoutY.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")},Pe.prototype.isDisposed=function(){return this._disposed},Pe.prototype.setParent=function(t,e){this._setParent(t,e),this._onParentChange()},Pe.prototype.insertBefore=function(t){this._insertBefore(t),this._onParentChange()},Pe.prototype._onParentChange=function(){var t=this.getParent()||this.getElement();this._vscrollbar._mainScrollbar||this._vscrollbar.setParent(t),this._hscrollbar.setParent(t),this._updateLayout()},Pe.prototype.getConfigObject=function(t){var e=t||{},i=this.getColumnCount();e.columns||(e.columns=[]);for(var n=0;n<i;n++){var o=e.columns[n];o||(o=e.columns[n]={});var r=this._getColumnDef(n);r.userId&&(o.id=r.userId),r.field&&(o.field=r.field),r.styles&&(o.styles=r.styles),r.stationary&&(o.stationary=r.stationary),r.leftPinned&&(o.leftPinned=r.leftPinned),r.rightPinned&&(o.rightPinned=r.rightPinned)}e.rowVirtualization=this.isRowVirtualizationEnabled(),e.columnVirtualization=this.isColumnVirtualizationEnabled(),e.rowHighlighting=this._rowHighlighting,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);var s=this._vscrollbar.getAutoHide();!0!==s&&(e.autoHideScrollbar=s);var l=this._vscrollbar.getMouseWheelSpeed();l&&(e.linearWheelScrolling=l),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.hasClass("no-content-vertical-line")&&(e.contentVerticalLines=!1),this._bottomPaddingSect&&(e.contentBottomPadding=this._bottomPadding),this._reservedSpace>0&&(e.contentRightPadding=this._reservedSpace);var a=this.getDataConflationRate();for(var u in a&&(e.dataConflationRate=a),this._plugins){var h=this._plugins[u];"function"==typeof h.getConfigObject&&h.getConfigObject(e)}return e},Pe.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)},Pe.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",!1!==t&&this.updateLayout()},Pe.prototype.getContentWidth=function(){return this._layoutX.getTrackSize()},Pe.prototype.getSectionCount=function(){return this._settings.length},Pe.prototype._updateFrozenTopSections=function(){if(!this._fixFrozenTopSections){var t=this._getTopSectionCount();this._freezeTopSectionAt(t-1)}},Pe.prototype._updateFrozenBottomSections=function(){if(!this._fixFrozenBottomSection){var t=this._getBottomSectionCount();this._setFrozenFooter(t)}},Pe.prototype._getTopSectionCount=function(){for(var t=this._settings,e=t.length,i=0,n=0;n<e;n++){var o=t[n].getType();if("header"!==o&&"title"!==o)break;i++}return i},Pe.prototype._getBottomSectionCount=function(){for(var t=this._settings,e=0,i=t.length-1;i>=0;i--){if("footer"!==t[i].getType())break;e++}return e},Pe.prototype.addSection=function(t,e){return this.addSectionAt(this.getSectionCount(),t,e)},Pe.prototype.addSectionAt=function(t,e,i){var n=this._settings.length;t<0&&(t=0),t>n&&(t=n);var o=this._toSectionType(e),r="bottomPadding"===i,s=this._newSection(r?"footer":o,i);if(!s)return null;var l=s.getSection();if(r&&(s.setAutoSyncRowCount(!1),this._bottomPaddingSect=l),t>=n?(this._putToLast(l),this._settings.push(s)):(this._settings.splice(t,0,s),l.insertBefore(this._settings[t+1].getSection())),this._updateSectionIndices(t),this._autoSetDataSource&&s.setDataSource(this._dataSource),"footer"===(o=s.getType())?this._updateFrozenBottomSections():"header"!==o&&"title"!==o||this._updateFrozenTopSections(),this._onColumnCountChanged(),this._onSectionCountChanged(!0),this._colVirtualizer.isEnabled()){var a=this._getColActivationList(),u=this.getColumnCount();s.activateColumns(a,0,u-1)}if(this._hasListener("sectionAdded")){var h=s.extendEventArg();this._dispatch("sectionAdded",h)}return l},Pe.prototype.removeSection=function(t){var e=this.getSection(t);return null!==e?this.removeSectionAt(e.getIndex()):null},Pe.prototype.removeSectionAt=function(t){var e=this._settings.length;if(t>=0&&t<e){var i=this._settings[t],n=i.getIndex(),o=i.getSection(),r=i.getType();return o.setRowCount(0),this._settings.splice(t,1),this._updateSectionIndices(n),"footer"===r?(this._updateFrozenBottomSections(),this._onColumnCountChanged()):"header"!==r&&"title"!==r||this._updateFrozenTopSections(),this._onSectionCountChanged(),i.dispose(),o}return null},Pe.prototype.removeLastSection=function(){return this.removeSectionAt(this._settings.length-1)},Pe.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()},Pe.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)},Pe.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 n=null,o=e;--o>=0;){var r=this._settings[o];if(r.getSection()===t){n=r;break}}if(o>=0)return this._putToLast(t),this._settings.splice(o,1),this._settings.push(n),n.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},Pe.prototype.moveSection=function(t,e){var i=this.getSectionCount();if(t<0)t=0;else if(t>=i)return;if(e<0?e=0:e>=i&&(e=i-1),t!==e){var n=this._settings[t],o=this._settings[e];ot.moveArrayItem(this._settings,t,e),o?n.getSection().insertBefore(o.getSection()):this._putToLast(n.getSection()),this._updateSectionIndices(t<=e?t:e),this._syncRowHeights(),this._onSectionCountChanged(),this._frozenLayout||this._rowVirtualizer.update(!0)}},Pe.prototype.getSection=function(t){var e=this.getSectionSettings(t);return null!==e?e.getSection():null},Pe.prototype.getSectionSettings=function(t){if(ot.isString(t)){if(Pe._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 i=-1;if(null!=t.getIndex?i=t.getIndex():ot.isNumber(t)&&(i=t),i>=0&&i<this._settings.length)return this._settings[i]}return null},Pe.prototype.getAllSections=function(t){if(null==t)return this._getAllSections();for(var e=this.getAllSectionSettings(t),i=e,n=i.length;--n>=0;)i[n]=e[n].getSection();return i},Pe.prototype.getAllSectionSettings=function(t){if(!t)return this._settings;var e=this._settings.length,i=[];t=this._toSectionType(t);for(var n=0;n<e;++n){var o=this._settings[n];t===o.getType()&&i.push(o)}return i},Pe.prototype.getSectionIndex=function(t){if(ot.isNumber(t))return t;if(t instanceof MouseEvent){var e=ot.getRelativePosition(t,this._element),i={};return this._hitTestY(e.y,i),i.sectionIndex}var n=this.getSection(t);return null==n?-1:n.getIndex()},Pe.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},Pe.prototype.getPreviousSection=function(t,e){null==t&&(t=this._settings.length);var i=this._getNextSection(-1,t,e);return null!==i?i.getSection():null},Pe.prototype.getNextSection=function(t,e){var i=this._getNextSection(1,t,e);return null!==i?i.getSection():null},Pe.prototype.getLastSection=function(){return this.getSection(this._settings.length-1)},Pe.prototype.getCell=function(t,e,i,n){var o=this.getSection(t);return o?o.getCell(e,i,n):null},Pe.prototype.getCellInfo=function(t){if(!t)return null;var e=t.colIndex,i=t.rowIndex,n=t.sectionName,o=null;if(null==e||null==i)(o=this.getRelativePosition(t)).hit||(o=null);else{n||(n="content");var r=this.getSectionSettings(n);if(r)r.getSection().getCell(e,i)&&((o={}).colIndex=e,o.rowIndex=i,r.extendEventArg(o))}return o},Pe.prototype.getNextCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?e:1)},Pe.prototype.getPrevCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?-e:-1)},Pe.prototype._getNextCellInRow=function(t,e){var i=this.getCellInfo(t);if(i){var n=i.colIndex+e,o=i.rowIndex,r=i.section;i.colIndex=n,i.cell=r.getCell(n,o)}return i},Pe.prototype.getNextCell=function(t){var e=this.getNextCellInRow(t);if(e&&!e.cell){var i=e.section,n=e.colIndex=0,o=e.rowIndex;e.rowIndex=++o,e.cell=i.getCell(n,o)}return e},Pe.prototype.getPrevCell=function(t){var e=this.getPrevCellInRow(t);if(e&&!e.cell){var i=e.section,n=e.colIndex=i.getColumnCount()-1,o=e.rowIndex;e.rowIndex=--o,e.cell=i.getCell(n,o)}return e},Pe.prototype.getColumnCount=function(){return this._layoutX.getLaneCount()},Pe.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)},Pe.prototype.insertColumn=function(t,e){var i=this.getColumnCount();t<i||(t=i),this._layoutX.insertLane(t);for(var n=this._settings.length;--n>=0;){this._settings[n].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)},Pe.prototype.insertColumns=function(t,e){var i=this.getColumnCount();t<i||(t=i);var n,o=0;if(Array.isArray(e)){if(1===(o=e.length))return void this.insertColumn(t,e[0]);n=e}else{if("number"!=typeof e)return void this.insertColumn(t,e);if(1===(o=e))return void this.insertColumn(t,null)}if(!(o<=0)){var r=this.freezeLayout(),s=[t,0].concat(new Array(o));Array.prototype.splice.apply(this._columnDefs,s);for(var l=0;l<o;l++){var a=t+l;this._layoutX.insertLane(a);for(var u=this._settings.length;--u>=0;){this._settings[u].getSection().insertColumn(a)}var h=n&&n[l];this._deserializeColumn(a,h)}this._dispatchColumnAddedEvent(t,o,t<i,n),this.freezeLayout(r)}},Pe.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 n=this._layoutX.removeLaneAt(t),o=this._settings.length,r=0;r<o;++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=n,this._hasListener("columnRemoved")){var u={atTheMiddle:!0};u.colIndex=t,u.columns="deprecated",u.columnData=a.columnData,u.colId=a.id||"",this._dispatchColumnEvent("columnRemoved",u)}return t<=i&&i===this._colVirtualizer.getLastIndexInView()&&this._colVirtualizer.update(),a},Pe.prototype.removeAllColumns=function(){this.getColumnCount()>0&&(this._pinnedLeftColumnCount=0,this._pinnedRightColumnCount=0,this.setColumnCount(0))},Pe.prototype.getStationaryColumnIndex=function(){for(var t=this.getColumnCount()-1;t>=0;t--)if(this._getColumnDef(t).stationary)return t;return-1},Pe.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 n=0;n<t.length;n++)if(t[n]<=i)return!1}return!0},Pe.prototype.isColumnMovable=function(t){var e=this.getStationaryColumnIndex();return!(e>-1&&t<=e)},Pe.prototype.moveColumn=function(t,e){if("number"==typeof t)return this._moveColumn(t,e);if(!Array.isArray(t))return!1;var i,n=t.length,o=[],r=0,s=this.getColumnCount(),l={};for(i=0;i<n;++i)(r=t[i])>=0&&r<s&&null==l[r]&&(l[r]=1,o.push(r));if(e<0?e=0:e>=s&&(e=s-1),!(n=o.length))return!1;if(1===n)return this._moveColumn(o[0],e);if(!this.isColumnMoveAllowed(o,e))return!1;if(o.sort(Fe),l[e]){var a=!0;for(r=o[0],i=1;i<n;++i)if(++r!==o[i]){a=!1;break}if(a)return!1}var u,h,p=this.freezeLayout(!0),d=0;for(i=0;i<n;++i)(u=o[i])>=e&&(h=e+d,this._moveColumn(u,h),++d);var c=n-d;for(h=d?e-1:e,i=0;i<c;++i)u=o[i]-i,this._moveColumn(u,h);return this.freezeLayout(p),!0},Pe.prototype._moveColumn=function(t,e){var i=this.getColumnCount();if(t<0?t=0:t>=i&&(t=i-1),e<0?e=0:e>=i&&(e=i-1),t===e)return!1;if(!this.isColumnMoveAllowed(t,e))return!1;var n=-1;this._colVirtualizer.isVirtualizable()&&(n=this._colVirtualizer.getLastIndexInView());var o=this.getColumnId(t);this._layoutX.moveLane(t,e);for(var r=this._settings.length,s=0;s<r;++s){this._settings[s].getSection().moveColumn(t,e)}var l=this._columnDefs[t],a=this._countPinnedLeftColumns(),u=this._countPinnedRightColumns();if(ot.moveArrayItem(this._columnDefs,t,e),this._hScrollbarEnabled&&(t<a?e>=i-u?this.freezeColumn(a-2,u+1):e>=a&&this.freezeColumn(a-2,u):l.rightPinned?e<a?this.freezeColumn(a,u-1):e<i-u&&this.freezeColumn(a-1,u-1):e<a?this.freezeColumn(a,u):e>=i-u&&this.freezeColumn(a-1,u+1)),this._hasListener("columnMoved")){var h={};h.fromColIndex=t,h.toColIndex=e,h.colId=o,this._dispatchColumnEvent("columnMoved",h)}return n===this._colVirtualizer.getLastIndexInView()&&(t<=n&&e>n||e<=n&&t>n)&&this._colVirtualizer.update(),this._updateColumnBounds(),this._updateColumnSeparators(),!0},Pe.prototype.moveColumnById=function(t,e){var i=this.getColumnCount(),n=this.getColumnIndex(t);if(n<0||n>=i)return!1;var o=null!=e?this.getColumnIndex(e):-1;return o<0&&(o=i),this._moveColumnByIndex(n,o)},Pe.prototype._moveColumnByIndex=function(t,e){return t<e&&--e,t!==e&&this.moveColumn(t,e)},Pe.prototype.reorderColumns=function(t,e){var i="";"number"==typeof e?i=this.getColumnId(e):e&&(i=e),this.startBatch("move");var n=0;if(Array.isArray(t)){var o=t.length;if(o>1){var r,s,l,a,u=this.getColumnIds(),h=u.length,p=[],d=!1;for(r=0;r<o;++r){var c=t[r];"number"==typeof c?(l=c,s=u[c]||""):(s=c,l=u.indexOf(s)),s&&l>=0&&(p.push(s),i===s&&(d=!0))}if(o=p.length,d){if((a=this.getColumnIndex(i))>=0)for(;++a<h&&(i=u[a],!(p.indexOf(i)<0)););(a<0||a>=h)&&(i="")}for(r=o;--r>=0;)s=p[r],l=this.getColumnIndex(s),(a=this.getColumnIndex(i))<0&&(a=h),n|=this._moveColumnByIndex(l,a),i=s}else n=this.moveColumnById(t[0],i)}else null!=t&&(n=this.moveColumnById(t,i));return this.stopBatch("move"),!!n},Pe.prototype.getColumnLayout=function(){return this._layoutX},Pe.prototype.updateColumnLayout=function(){this._syncLayoutToColumns(0,this.getColumnCount())},Pe.prototype._deserializeColumn=function(t,e){if(e){var i,n=e.layout||e,o=e.width;null!=o&&(n.size=o),null!=(o=e.scalable)&&(n.scalable=o),null!=(o=e.minWidth)&&(n.minSize=o),null==n.scalable&&(n.scalable=null==n.size),this._layoutX.deserializeLane(t,n);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.id;a&&"string"==typeof a&&(l.id=a,l.userId=a);var u=e.field;u&&"string"==typeof u&&(l.field=u);var h=e.dataColumnName;null!=h&&(l.dataColumnName=h),null!=(h=e.stationary)&&(l.stationary=!!h),null!=(h=e.leftPinned)&&(l.leftPinned=!!h),null!=(h=e.rightPinned)&&(l.rightPinned=!!h),this.setColumnRenderingHandler(t,e.renderingHandler),this.setColumnDataBindingHandler(t,e.dataBindingHandler),(h=e.columnData)&&this.setColumnData(t,h);var p=e.formatter||e.binding;if(Array.isArray(p)&&(p=p[0]),p&&"function"!=typeof p){var d=p.init;"function"==typeof d&&d(e,this)}}},Pe.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)},Pe.prototype.removeRow=function(t){var e=this.getLastSection();null!=e&&(null==t&&(t=1),e.removeRow(t))},Pe.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},Pe.prototype.setSectionRowCount=function(t,e){var i=this.getSection(t);null!=i&&i.setRowCount(e)},Pe.prototype.getRowIndex=function(t,e){return this._sectionStarts[t]+e},Pe.prototype.getRelativeIndex=ot._deprecatedFunction,Pe.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},Pe.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},Pe.prototype.setDefaultRowHeight=function(t,e){if(this._layoutY.setDefaultLaneSize(t)){this._rowHeightSync=!1;var i=this._layoutY.getDefaultLaneSize();this._rowHeightException=e?"":"title";for(var n=this._settings.length,o=0;o<n;++o){var r=this._settings[o];r.getType()!==this._rowHeightException&&"bottomPadding"!==r.getId()&&r.getSection().setDefaultRowHeight(i)}this._syncRowHeights(),this._rowHeightSync=!0,this.setRowScrollingStep(this._rowScrollingStep),this._updateColumnSeparators()}},Pe.prototype.getDataSource=function(){return this._dataSource},Pe.prototype.setDataConflationRate=function(t){this._dataSource.setConflationRate(t)},Pe.prototype.getDataConflationRate=function(){return this._dataSource.getConflationRate()},Pe.prototype.setDataSource=function(t){t&&t instanceof gt&&(t=new Se(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,n=0;n<i;++n)this._settings[n].setDataSource(t);return this._dispatch("postDataSourceChanged",e),this._dataSource},Pe.prototype.setColumnTemplate=ot._deprecatedFunction,Pe.prototype.getColumnTemplate=ot._deprecatedFunction,Pe.prototype.getColumnRenderEvent=ot._deprecatedFunction,Pe.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)}}},Pe.prototype.setColumnStyle=function(t,e,i,n){if(e){var o;ot.isNumber(t)||(t=0,console.log("WARNING: the first parameter for setColumnStyle must be column index")),null==n?o=this._getNestedColumnDef(t,"styles"):(n=this._toSectionType(n),o=this._getNestedColumnDef(t,n,"styles")),o[e]=i;for(var r=this._settings.length;--r>=0;){var s=this._settings[r];if(null==n||n===s.getType())s.getSection().setColumnStyle(t,e,i)}}},Pe.prototype.enableColumnClass=function(t,e,i,n){var o;"number"!=typeof t&&(t=0),null==n?o=this._getNestedColumnDef(t,"classes"):(n=this._toSectionType(n),o=this._getNestedColumnDef(t,n,"classes"));var r=!1;if((i=!1!==i)?o[e]||(r=o[e]=!0):o[e]&&(delete o[e],r=!0),r)for(var s=this._settings.length;--s>=0;){var l=this._settings[s];null!=n&&n!==l.getType()||l.getSection().enableColumnClass(t,e,i)}return r},Pe.prototype.hasColumnClass=function(t,e,i){var n;return null==i?n=this._getNestedColumnDef(t,"classes"):(i=this._toSectionType(i),n=this._getNestedColumnDef(t,i,"classes")),!(!n||!n[e])},Pe.prototype.setColumnAlignment=function(t,e){var i=e?e.charAt(0).toLowerCase():"",n=0;n|=this.enableColumnClass(t,"tr-align-left","l"===i),n|=this.enableColumnClass(t,"tr-align-right","r"===i),(n|=this.enableColumnClass(t,"tr-align-center","c"===i))&&this._dispatch("columnAlignmentChanged",{colIndex:t,alignment:i})},Pe.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"},Pe.prototype.getColumnLeft=function(t){var e=this._columnDefs[t];if(e&&e.rightPinned){for(var i=this.getElement().clientWidth,n=this._layoutX.getTrackSize(),o=n<i?n:i,r=this.getColumnCount()-1;r>=t;--r)o-=this._layoutX.getLaneSize(r);return o}return this._hScrollbarEnabled&&t>=this._pinnedLeftColumnCount?this._layoutX.getLaneStart(t)-this._hscrollbar.getScrollLeft():this._layoutX.getLaneStart(t)},Pe.prototype.getColumnRight=function(t){return this.getColumnLeft(t)+this._layoutX.getLaneSize(t)},Pe.prototype.getColumnWidth=function(t){return this._layoutX.getLaneSize(t)},Pe.prototype.getColumnCustomLaneSize=function(t){return this._layoutX.getCustomLaneSize(t)},Pe.prototype._calculateColumnWidths=function(t,e){if(!this._preserveGridSize)return e;var i,n=0,o={},r=t.length,s=new Array(r);for(i=0;i<r;i++)o[t[i]]=!0,s[i]=e[i],n+=e[i];var l=0,a=0,u=this.getColumnCount(),h=this._layoutX;for(i=0;i<u;i++)o[i]||h.isLaneVisible(i)&&(h.getLaneScalability(i)?(l+=h.getMinimumLaneSize(i),a++):l+=h.getLaneSize(i));var p=this.getContentWidth(),d=n+l-p;if(a<1||d>0){for(h.resetLaneToDefaultSize(),h.setTrackSize(p-this._reservedSpace),l=0,i=0;i<u;i++)o[i]||h.isLaneVisible(i)&&(h.getLaneScalability(i)?l+=h.getMinimumLaneSize(i):l+=h.getLaneSize(i));if((d=n+l-p)>0)for(d/=r,i=0;i<r;i++)s[i]-=d}return s},Pe.prototype.setColumnWidth=function(t,e,i){var n=this._calculateColumnWidths([t],[e]),o=this._setColumnWidth(t,n[0],i);return o&&this._syncLayoutToColumns(t,t+1),o},Pe.prototype.setColumnWidths=function(t,e){var i,n=0,o=[],r=[],s=[];for(i=t.length;--i>=0;){var l=t[i];null!=l&&(o.push(i),r.push(l));var a=Array.isArray(e)?e[i]:e;s.push(a)}var u=this._calculateColumnWidths(o,r);for(i=0;i<u.length;i++)n|=this._setColumnWidth(o[i],u[i],s[i]);return n&&this._syncLayoutToColumns(0,t.length),!!n},Pe.prototype.isColumnVisible=function(t){return this._layoutX.isLaneVisible(t)},Pe.prototype.hideColumn=function(t,e){var i=!1===e;this.setColumnVisibility(t,i,0)},Pe.prototype.hideColumns=function(t,e){var i=Array.isArray(t)?t.length:0,n=[],o=this.getColumnCount();e=!1!==e;for(var r=0;r<i;++r){var s=t[r];s>=0&&s<o&&this._layoutX.hideLane(s,e,0)&&n.push(s)}if(n.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){var l={};l.colIndices=n,l.hidden=e,this._dispatch("columnVisibilityChanged",l)}},Pe.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 n={};n.colIndices=t,n.hidden=!1,this._dispatch("columnVisibilityChanged",n)}},Pe.prototype.getMinimumColumnWidth=function(t){return this._layoutX.getMinimumLaneSize(t)},Pe.prototype.setMinimumColumnWidth=function(t,e){this._layoutX.setMinimumLaneSize(t,e)&&this._syncLayoutToColumns(t,t+1)},Pe.prototype.setMinimumColumnWidths=function(t,e){for(var i=0,n=NaN,o=NaN,r=t.length;--r>=0;){var s=t[r];null!=s&&(o||(o=r),n=r,i|=this._layoutX.setMinimumLaneSize(r,s,e))}return i&&this._syncLayoutToColumns(n,o+1),!!i},Pe.prototype.getColumnScalability=function(t){return this._layoutX.getLaneScalability(t)},Pe.prototype.setColumnScalability=function(t,e){var i=!1;return ot.isNumber(t)?(e=!1!==e,(i=this._layoutX.setLaneScalability(t,e))&&this._syncLayoutToColumns(t,t+1)):this.setDefaultColumnScalable(t),i},Pe.prototype.setDefaultColumnScalable=function(t){this._layoutX.setDefaultScalability(!!t)},Pe.prototype.resetColumnWidths=function(){var t=this._layoutX.resetLaneToDefaultSize();return t&&this._syncLayoutToColumns(0,this.getColumnCount()),t},Pe.prototype.setColumnDefaultWidth=function(t,e){this._layoutX.setLaneDefaultSize(t,e)},Pe.prototype.preserveProportion=function(t){this._preserveProportion=!0===t},Pe.prototype.isProportionPreserved=function(){return this._preserveProportion},Pe.prototype.preserveGridSize=function(t){this._preserveGridSize=!0===t},Pe.prototype.getColumnData=function(t){return this._getColumnDef(t).columnData},Pe.prototype.setColumnData=function(t,e){return this._getColumnDef(t).columnData=e||{},e},Pe.prototype.newColumnData=Pe.prototype.getColumnData,Pe.prototype.setAlwaysRenderColumn=function(t,e){this.getColumnData(t).alwaysRender=!1!==e},Pe.prototype._isAlwaysRenderColumn=function(t){return!0===this.getColumnData(t).alwaysRender},Pe.prototype.getFitContentWidth=function(){return this._fitContentWidth},Pe.prototype.setFitContentWidth=function(t){this._fitContentWidth!==t&&(this._fitContentWidth=t,this.enableClass("fit-width",this._fitContentWidth))},Pe.prototype.loadPlugin=function(t,e){var i=null;if("string"==typeof t){var n=window.tr,o=n?n.grid:null;if(!o)return null;if(o[t])i=new o[t];else{if(!o[t+"Plugin"])return null;i=new o[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},Pe.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},Pe.prototype.getPlugin=function(t){var e=this._plugins[t];return e||(e=this._plugins[t+"Plugin"]),e||null},Pe.prototype.getPlugins=function(){var t=[];for(var e in this._plugins)t.push(this._plugins[e]);return t},Pe.prototype.getPluginList=function(){var t=[];for(var e in this._plugins)t.push(e);return t},Pe.prototype.freezeSection=function(t){this._fixFrozenTopSections=!0,this._freezeTopSectionAt(t)},Pe.prototype.resetSectionFreezing=function(){this._fixFrozenTopSections=!1,this._updateFrozenTopSections()},Pe.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()},Pe.prototype.freezeFooter=function(t){this._fixFrozenBottomSection=!0,this._frozenFooterCount!==t&&(this._setFrozenFooter(t),this._onSectionCountChanged())},Pe.prototype._setFrozenFooter=function(t){this._frozenFooterCount!==t&&(this._frozenFooterCount=t,this._vscrollbar.setFooterCount(t),this._hscrollbar.setFooterCount(t))},Pe.prototype.getFooterCount=function(){return this._frozenFooterCount},Pe.prototype.freezeColumn=function(t,e){var i,n=this.getColumnCount(),o=0,r=0,s=!1;if(t||0===t)for(this._hScrollbarEnabled=!0,o=t>=0?t+1:0,this._pinnedLeftColumnCount!==o&&(s=!0,this._pinnedLeftColumnCount=o),i=0;i<n;++i)this._getColumnDef(i).leftPinned=--o>=0;else this._hScrollbarEnabled=!1;if(null!=e)for(r=e>0?e:0,this._pinnedRightColumnCount!==r&&(s=!0,this._pinnedRightColumnCount=r),i=n;--i>=0;)this._getColumnDef(i).rightPinned=--r>=0;this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),this._updateColumnSeparators(),s&&(this._isEventDispatching("pinningChanged")||this._dispatch("pinningChanged",{}))},Pe.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},Pe.prototype._countPinnedRightColumns=function(){var t=0;if(this._hScrollbarEnabled){var e,i=this._columnDefs.length;for(e=0;e<i;++e){var n=this._columnDefs[e];if(n&&n.rightPinned)break}t=i-e}return this._pinnedRightColumnCount=t,t},Pe.prototype.isPinnedColumn=function(t){return t<this.getFrozenColumnCount()||t>=this.getFirstPinnedRightIndex()},Pe.prototype.getFrozenColumnCount=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:0},Pe.prototype.getPinnedLeftColumnCount=Pe.prototype.getFrozenColumnCount,Pe.prototype.getPinnedRightColumnCount=function(){return this._pinnedRightColumnCount},Pe.prototype.getFirstPinnedRightIndex=function(){return this.getColumnCount()-this._pinnedRightColumnCount},Pe.prototype.updateLayout=function(){this._disposed||this._layoutUpdating||(this._layoutUpdating=!0,this._dispatch("preForcedUpdate",{}),this._updateLayout(),this._colVirtualizer.isEnabled()&&this._activateColumns(),this._layoutUpdating=!1)},Pe.prototype.updateScrollbars=function(t,e){e&&this._updateScrollbarWidth(!0,!1),t&&this._updateScrollbarHeight(!0,!1)},Pe.prototype.freezeLayout=function(t){t=!1!==t;var e=this._frozenLayout;if(e!==t){this._frozenLayout=t;var i,n=this.getPlugin("SortableTitlePlugin");this._frozenLayout&&n&&n.freezeIndicator(!0),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);if(!this._frozenLayout)this._syncLayoutToColumns(0,this.getColumnCount()),this._disableEvent("widthChanged",!1),this._dispatch("widthChanged",{}),this._syncRowHeights()||this._rowVirtualizer.update(!0),n&&n.freezeIndicator(!1);this._rowHeightSync=!0}return e},Pe.prototype.unfreezeLayout=function(t){this.freezeLayout(!1===t)},Pe.prototype.isLayoutFrozen=function(){return this._frozenLayout},Pe.prototype.showBorders=ot._deprecatedFunction,Pe.prototype.hideBorders=ot._deprecatedFunction,Pe.prototype.toggleBorders=function(t){this.toggleClass("no-borders",null!=t?!t:null)},Pe.prototype.toggleGridlines=function(t){this.toggleClass("no-gridlines",null!=t?!t:null)},Pe.prototype.toggleVerticalLines=function(t){this.toggleClass("no-vertical-grid-line",null!=t?!t:null)},Pe.prototype.toggleHorizontalLines=function(t){this.toggleClass("no-horizontal-grid-line",null!=t?!t:null)},Pe.prototype.toggleContentVerticalLines=function(t){this.toggleClass("no-content-vertical-line",null!=t?!t:null)},Pe.prototype.getDataColumnMap=function(){for(var t=[],e=this.getColumnCount();--e>=0;)t[e]=this.getDataColumnName(e);return t},Pe.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)},Pe.prototype.getDataColumnName=function(t){return this._getColumnDef(t).dataColumnName||""},Pe.prototype.setDataColumnName=function(t,e){this._getColumnDef(t).dataColumnName=e},Pe.prototype.setDefaultRenderingHandler=function(t){this._renderingHandler="function"==typeof t?t:null},Pe.prototype.setDefaultDataBindingHandler=function(t){this._dataBindingHandler="function"==typeof t?t:null},Pe.prototype.setColumnRenderingHandler=function(t,e){this._getColumnDef(t).renderingHandler="function"==typeof e?e:null},Pe.prototype.setColumnDataBindingHandler=function(t,e){this._getColumnDef(t).dataBindingHandler="function"==typeof e?e:null},Pe.prototype.getColumnRenderingHandler=function(t){return this._getColumnDef(t).renderingHandler||null},Pe.prototype.getColumnDataBindingHandler=function(t){return this._getColumnDef(t).dataBindingHandler||null},Pe.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)}},Pe.prototype._getTarget=function(t){var e=t.target;if(e){var i=null;return this._element.contains(e)||(i=t.composedPath?t.composedPath():t.path),i?i[0]||null:e}return t.getElement?t.getElement():ot.isElement(t)?t:null},Pe.prototype.getRelativePosition=function(t,e){if(!t)return{};var i=e||{},n=this._getTarget(t);t.target?ot.getRelativePosition(t,this.getElement(),i):n&&ot.getRelativePosition(n,this.getElement(),i),1!==this._zoomFactor&&(i.x/=this._zoomFactor,i.y/=this._zoomFactor),i.hit=!1,i.grid=this,i.clientX=t.clientX,i.clientY=t.clientY,i.zoomFactor=this._zoomFactor;var o=ot.closestElement(n,"cell");if(!o)return i;i.cellElement=o;var r=ot.closestElement(o,"column");i.columnElement=r;var s=null;if(!(s=r?ot.closestElement(r,"tr-lg"):ot.closestElement(o,"tr-lg")))return i;i.sectionName=s.id||ot.closestElement(s,"tr-vlg").id;var l=this.getSectionSettings(i.sectionName);if(!l)return i;l.extendEventArg(i);var a=l.getSection(),u=a.getColumnIndex(r||o);return u<0?i:(i.colIndex=u,!1===this._hitTestY(-1,i)||(o.stretched?i.cell=a.getStretchedCell(u,i.rowIndex):i.cell=a.getCell(u,i.rowIndex),i.hit=!0),i)},Pe.prototype.getVScrollbar=function(){return this._vscrollbar},Pe.prototype.getHScrollbar=function(){return this._hscrollbar},Pe.prototype.autoHideScrollbars=function(t){t=null==t||t,this._vscrollbar.setAutoHide(t),this._hscrollbar.setAutoHide(t)},Pe.prototype.getVScrollStartIndex=function(){return this._startVScrollbarIndex},Pe.prototype.getHScrollStartIndex=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:-1},Pe.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 n=this._hScrollbarEnabled?this._layoutX.getLaneStart(this._pinnedLeftColumnCount):0,o=this._hscrollbar.getScrollLeft(),r=o+n,s=this._hscrollbar.getWidth(),l=this._layoutX.hitTest(r),a=this._layoutX.getLaneStart(t),u=this._layoutX.getLaneSize(t);if(e||u>=s||t<=l){var h=a-n;if(o!==h)return this._hscrollbar.setScrollLeft(h),!0}else{var p=r+s;if(t>=this._layoutX.hitTest(p-.1)){var d=o+(a+u)-p;return this._hscrollbar.setScrollLeft(d),!0}}return!1},Pe.prototype.getScrollLeft=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getScrollLeft():0},Pe.prototype.setScrollLeft=function(t){this._updateScrollbar(this._hscrollbar)&&this._hscrollbar.setScrollLeft(t)},Pe.prototype.scrollRight=function(t){this.setScrollLeft(this._hscrollbar.getScrollLeft()+t)},Pe.prototype.getScrollWidth=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getContentWidth():0},Pe.prototype.getYScrollVal=function(t,e,i){if(!this._updateScrollbar(this._vscrollbar))return null;var n=null;t&&(n=this.getSection(t));var o=this._layoutY.getLaneCount(),r=n?n.getRowOffset():this._sectionStarts[this._startVScrollbarIndex];r&&(e+=r),e<=0?e=0:e>=o&&(e=o-1);var s=this._layoutY.getLaneStart(r),l=this._vscrollbar.getScrollTop()+s,a=n?n.getFirstIndexInView():this._layoutY.hitTest(l),u=-1;if(i)u=e;else if(e<=a)(u=e-3)<0&&(u=0);else{var h=l+this._vscrollbar.getHeight(),p=n?n.getLastIndexInView():this._layoutY.hitTest(h-.1);if(e>=p)(u=e-(p-a)+3)<0&&(u=0)}return u>=0?this._layoutY.getLaneStart(u)-s:null},Pe.prototype.scrollToRow=function(t,e,i){var n=this.getYScrollVal(t,e,i);null!==n&&this._vscrollbar.setScrollTop(n)},Pe.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),n=this._vscrollbar.getScrollTop()+i,o=this._vscrollbar.getHeight(),r=n+o,s=this._layoutY.hitTest(n),l=this._layoutY.hitTest(r-.1),a=this._layoutY.getLaneStart(s),u=this._layoutY.getLaneEnd(l),h=n-o,p=h<=i?e:this._layoutY.hitTest(h)+1,d=r+o,c=d>=this._layoutY.getTrackSize()?t-1:this._layoutY.hitTest(d-.1)-1;s-=e,l-=e;var _={};return _.viewTop=n-i,_.viewBottom=r-i,_.topRowIndex=s,_.bottomRowIndex=l,_.firstFullRow=a<n?s+1:s,_.lastFullRow=u>r?l-1:l,_.prevPageRowIndex=p-e,_.nextPageRowIndex=c-e,_},Pe.prototype.getScrollTop=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getScrollTop():0},Pe.prototype.setScrollTop=function(t){this._updateScrollbar(this._vscrollbar)&&this._vscrollbar.setScrollTop(t)},Pe.prototype.scrollDown=function(t){this.setScrollTop(this._vscrollbar.getScrollTop()+t)},Pe.prototype.getScrollHeight=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getContentHeight():0},Pe.prototype.restoreScrollbars=function(){this._vscrollbar.restoreTrackPosition()},Pe.prototype.enableAutoSetDataSource=function(t){this._autoSetDataSource=t},Pe.prototype.getRowVirtualizer=function(){return this._rowVirtualizer},Pe.prototype.getColumnVirtualizer=function(){return this._colVirtualizer},Pe.prototype.enableRowVirtualization=function(t){this._rowVirtualizer.enable(t),this._rowVirtualizer.isEnabled()&&this._vscrollbar.isEnabled()?this._rowVirtualizer.activate():this._rowVirtualizer.deactivate()},Pe.prototype.isRowVirtualizationEnabled=function(){return this._rowVirtualizer.isEnabled()},Pe.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)}},Pe.prototype.isColumnVirtualizationEnabled=function(){return this._colVirtualizer.isEnabled()},Pe.prototype.setRowScrollingStep=function(t){this._rowScrollingStep=t>0?t:0,this._vscrollbar.setScrollingStep(this._layoutY.getDefaultLaneSize()*this._rowScrollingStep)},Pe.prototype.getVMouseWheelHandler=function(){return this._vscrollbar.getDefaultMouseWheelLogic()},Pe.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)},Pe.prototype.synchronizeHScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);var e=t.getHScrollbar();e._mainScrollbar=this._hscrollbar,e.setStyle("visibility","hidden"),e.setStyle("pointerEvents","none"),e.disableMouseWheel(),e.attachToExternalElement(this._hscrollbar.getParent()),this._hscrollbar.listen("scroll",t._onSyncHScroll)},Pe.prototype.updateRowData=function(t,e,i,n){var o=this.getSectionSettings(t||"content");o&&o.updateRowData(e,i,n)},Pe.prototype.rerender=function(){for(var t=this._settings.length,e=0;e<t;e++)this._settings[e].rerender()},Pe.prototype.requestRowRefresh=function(){this._rowRefreshTimer||(this._rowRefreshTimer=setTimeout(this._onRowRefresh,100))},Pe.prototype._requestScrollbarUpdate=function(){this._updateScrollbarHeight(!0,!0),this._rowHeightTimerId=0},Pe.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())}},Pe.prototype._onRowRefresh=function(){this._rowRefreshTimer=0,this.updateRowData()},Pe.prototype.disableLazyRendering=function(t){console.log("WARNING: This function is deprecated.")},Pe.prototype.getData=function(t,e,i){var n=this.getSectionSettings(t);if(!n)return null;var o=this._toDataColumnName(e);return n.getData(o,i)},Pe.prototype.setData=function(t,e,i,n){var o=this.getSectionSettings(t);if(o&&o.isDataBindable()){var r=this._toDataColumnName(e);return o.setData(r,i,n)}return!1},Pe.prototype.removeRowData=function(t,e){var i=this.getSectionSettings(t);return!(!i||!i.isDataBindable())&&i.removeRowData(e)},Pe.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)}},Pe.prototype.getHorizontalLayout=function(){return this._layoutX},Pe.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 n={};n.colIndex=t,n.hidden=!e,this._dispatch("columnVisibilityChanged",n)}return!0}return!1},Pe.prototype.getColumnVisibility=function(t,e){return this._layoutX.getLaneVisibilityBit(t,e)},Pe.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},Pe.prototype.getHiddenInput=function(){return this._hiddenInput},Pe.prototype.focus=function(){var t=this._hiddenInput,e=document.activeElement;if(t&&t!==e){var i=window.pageXOffset,n=window.pageYOffset;if(t.setActive)try{t.setActive()}catch(e){t.focus({preventScroll:!0})}else t.focus({preventScroll:!0});n===window.pageYOffset&&i===window.pageXOffset||window.scrollTo(i,n)}},Pe.prototype.isBinding=function(){return this._dispatchingDataChanged},Pe.prototype.hideRow=function(t,e){this._dataSource.hideRow(t,e)},Pe.prototype.hideRows=function(t,e){Array.isArray(t)?this._dataSource.hideRows(t,e):this._dataSource.hideRow(t,e)},Pe.prototype.showRows=function(t,e){Array.isArray(t)?this._dataSource.showRows(t,e):this._dataSource.showRows([t],e)},Pe.prototype.unhideAllRows=function(){this._dataSource.unhideAllRows()},Pe.prototype.hasHiddenRow=function(){return this._dataSource.hasHiddenRow()},Pe.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 n=0;n<e;++n)i.setCellContent(n,0,t[n]);this.addSection("content");var o=this.getSectionSettings("title");o.disableDataBinding();var r=this.getSectionSettings("content");r.setAutoSyncRowCount(!0),r.setParent(o),this._dataBindingHandler||this.setDefaultDataBindingHandler(Pe._defaultDataBinding)},Pe._defaultDataBinding=function(t){t.cell.setContent(t.dataValue)},Pe.prototype.selectColumn=function(t,e){for(var i=this._settings.length;--i>=0;)this._settings[i].getSection().selectColumn(t,e);this._updateColumnBounds()},Pe.prototype.isSelectedColumn=function(t){var e=this._settings[0]||null;return!!e&&e.getSection().isSelectedColumn(t)},Pe.prototype._updateColumnBounds=function(){if(!this._columnBoundConflator.conflate()){var t=this._settings.length;if(t){var e,i=[],n=null,o=this.getColumnCount(),r=[];for(e=0;e<o;e++)this.isSelectedColumn(e)?(r.push(e),n||(n=[e,-1])):n&&(n[1]=e-1,i.push(n),n=null);n&&(n[1]=o-1,i.push(n),n=null);var s={selectedColumns:r,selectionRanges:i};this._dispatch("beforeColumnBoundUpdate",s);var l=i.length,a=[],u=[],h=this._settings[0],p=h.getSection();for(e=0;e<l;++e){n=i[e];var d=[0,0],c=[!1,!1];p.calculateColumnBounds(n[0],n[1],d,c),d[0]<d[1]&&(a.push(d),u.push(c))}var _=0,f=-1;for(null!=s.topBoundRowIndex&&(f=+s.topBoundRowIndex),f>=0&&"title"===h.getType()&&(_=this._layoutY.getLaneStart(f)),p.updateColumnBounds(a,u,_),e=1;e<t;e++)(p=this._settings[e].getSection()).updateColumnBounds(a,u)}}},Pe.prototype._updateColumnSeparators=function(){var t=this._settings.length;if(t)for(var e=0;e<t;e++){var i=this._settings[e].getSection();i&&i.updateColumnSeparators()}},Pe.prototype.getColumnRect=function(t,e){var i=this.getElement().clientWidth,n=i,o=this._hscrollbar;o.isActive()&&(n=o.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:n,gridWidth:i}},Pe.prototype.getRowRect=function(t,e){var i=this._layoutX.getTrackSize(),n=this.getElement().clientWidth;i=i<n?i:n;var o=this.getSection("content"),r=o?o.getRowOffset():1,s=this._layoutY,l=s.getLaneStart(r),a=0,u=o.getHeight(),h=this._vscrollbar;h.isActive()&&(a=h.getScrollTop(),u=h.getTrackSize());var p=u+l,d=s.getLaneStart(t+r)-a,c=s.getLaneEnd(e+r)-a;return d<l?d=l:d>p&&(d=p),c<l?c=l:c>p&&(c=p),{top:d-=l,left:0,width:i,height:(c-=l)-d,scrollViewSize:u,scrollViewTop:l,scrollViewBottom:p}},Pe.prototype.normalizeConfig=function(t){t||(t={});var e,i,n=t.columns,o=n?n.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=o;--e>=0;)--s>=0&&(i=n[e])&&(i.rightPinned=!0);return null!=r&&(delete t.columnFreezing,delete t.freezeColumn,r>=0&&n&&(i=n[r])&&(i.leftPinned=!0)),t},Pe.prototype.setColumnGrouping=function(t){this._groupDefs=t||null},Pe.prototype.getColumnGroupParentId=function(t){if(this._groupDefs){var e="number"==typeof t?this.getColumnId(t):t;return this._groupDefs.getParentId(e)}return""},Pe.prototype.getColumnGroupChildIds=function(t){if(this._groupDefs){var e=this._groupDefs.getLeafDescendants(t);if(e&&e.length>0)return e}return null},Pe.prototype.getValidColumnList=function(t,e){var i=[];if(!t)return i;e||(e=this.createColumnMap(t));for(var n=this.getColumnCount(),o=0;o<n;++o){var r=this._getColumnDef(o).id;null!=e[r]&&i.push({index:o,id:r})}return i},Pe.prototype.createColumnMap=function(t){t||(t=this.getColumnIds());for(var e={},i=t.length,n=0;n<i;n++){var o=t[n];"number"==typeof o&&(o=this.getColumnId(o)),o&&(e[o]=!0)}return e},Pe.prototype.startBatch=function(t){return!!t&&(this._batches||(this._batches={}),this._batches[t]=t,"reset"===t&&this._disableEvent("columnVisibilityChanged",!0),this._dispatch("beforeBatchOperation",{batches:this._batches,batchType:t}),!0)},Pe.prototype.stopBatch=function(t){return!!t&&(this._dispatch("afterBatchOperation",{batches:this._batches,batchType:t}),"reset"===t&&this._disableEvent("columnVisibilityChanged",!1),delete this._batches[t],g(this._batches)&&(this._batches=null),!0)},Pe.prototype._dispatchColumnEvent=function(t,e){var i=this._batches;i&&(e.batches=i),this._dispatch(t,e)},Pe.prototype._dispatchColumnPositionChanged=function(){this._columnPositionConflator.conflate()||this._dispatch("columnPositionChanged",{sender:this})},Pe.prototype._dispatchRowPositionChanged=function(){this._rowPositionConflator.conflate()||this._dispatch("rowPositionChanged",{sender:this})},Pe.prototype._getAllSections=function(){for(var t=[],e=this._settings.length,i=0;i<e;i++)t.push(this._settings[i].getSection());return t},Pe.prototype._getNextSection=function(t,e,i){var n=this.getSectionIndex(e)+t;if(null==i)return this.getSectionSettings(n);i=this._toSectionType(i);for(var o=this._settings.length;n>=0&&n<o;){var r=this._settings[n];if(i===r.getType())return r;n+=t}return null},Pe.prototype._toSectionType=function(t){if(Pe._sectionType[t])return t;if(ot.isString(t))switch(t.charAt(0).toLowerCase()){case"t":return"title";case"h":case"s":return"header";case"f":return"footer"}return"content"},Pe.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 n={horizontalScrollbar:this._hscrollbar},o="content"===t?new Me(n):new fe(n);o._setContext(this);var r=new Ie(o);r.setId(e),r.setType(t),r.listen("dataChanged",this._onSectionDataChanged),r.listen("rowAvailable",this._onRowAvailable);var s="content"===t&&this._rowHighlighting;return o.enableRowHighlighting(s),o.enableShading(!1),o.setHidingMethod(this._hidingMethod),r.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),r},Pe.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)}},Pe.prototype._syncStyleToSectionColumns=function(t,e){for(var i,n=this._columnDefs.length;--n>=0;){var o=this._getColumnDef(n),r=o.styles;for(i in r)t.setColumnStyle(n,i,r[i]);var s=o.classes;for(i in s)t.enableColumnClass(n,i,!0);var l=o[e];if(l){for(i in r=l.styles)t.setColumnStyle(n,i,r[i]);for(i in s=l.classes)t.enableColumnClass(n,i,!0)}}},Pe.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)},Pe.prototype._syncSectionRowHeights=function(t){this._layoutY.copyFrom(t.getRowLayout(),this._sectionStarts[t.getIndex()])},Pe.prototype._setColumnWidth=function(t,e,i){var n=!1,o=this._layoutX;if(null!=i)n=o.setLaneScalability(t,!!i);else{var r=o.getLaneScalability(t);if(this._preserveProportion){if(r){for(var s=this.getColumnCount(),l=0,a=0,u=0;u<s;++u)if(o.getLaneScalability(u)){var h=o.getLaneSize(u);l+=o.getCustomLaneSize(u),a+=h}(!(e=(e*l-e*o.getCustomLaneSize(t))/(a-e))||e<0)&&(e=l)}}else n=o.setLaneScalability(t,!1)}return n=o.setLaneSize(t,e)||n},Pe.prototype._dispatchColumnAddedEvent=function(t,e,i,n){var o={};if(this._hasListener("columnAdded"))if(o.atTheMiddle=i,1===e)o.colIndex=t,o.context=n,this._dispatchColumnEvent("columnAdded",o);else for(var r=Array.isArray(n)?n:[],s=0;s<e;++s)o.colIndex=t+s,o.context=r[s],this._dispatchColumnEvent("columnAdded",o);this._frozenLayout&&(o.noDataUpdate=!0),this._dispatchColumnRenderEvent(o,t,t+e,0,this._settings.length,NaN,NaN)},Pe.prototype._dispatchColumnRenderEvent=function(t,e,i,n,o,r,s){if(n<o){var l;if(t.sender=this,t.fromColIndex=e,t.toColIndex=i,this._hasListener("preSectionRender"))for(l=n;l<o;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("preSectionRender",t);for(var a=e;a<i;++a){var u=this.getColumnRenderingHandler(a)||this._renderingHandler;if(u)for(t.colIndex=a,t.dataColumnName=this.getDataColumnName(a),l=n;l<o;++l){var h=this._settings[l];h.extendRenderEventArg(t,r,s);for(var p=h.getSection(),d=t.fromRowIndex,c=t.toRowIndex,_=d;_<c;++_)t.rowIndex=_,t.cell=p.getCell(a,_,!1),u(t)}}if(this._hasListener("postSectionRender"))for(l=n;l<o;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("postSectionRender",t);if(!t.noDataUpdate&&!this._noBinding)for(l=n;l<o;++l)this.updateRowData(this._settings[l],r,s-1)}},Pe.prototype._dispatchRowExpansionBinding=function(t){if(this._hasListener("rowExpansionBinding")){var e=t.dataSource;if(e&&e.getDataSource()){var i=t.fromRowIndex,n=t.toRowIndex,o=e.getVisibleRowIds(!0),r=t.section;t.rowData=null,t.cell=null;for(var s=!1,l=n-1;l>=i;--l){var a=e.getRowId(l);if(!s){var u=e.getRowExpansionCount(a);if(u>0){l=l+u+1,s=!0;continue}}var h=r.getContextRow(l),p=e.getExpansionParentByRowId(a);if(p)t.originalRowData=e.getRowData(p),t.originalRowId=p,t.rowExpansion=h.rowExpansion=!0;else{if(!h.rowExpansion)continue;t.originalRowData=null,t.originalRowId=null,t.rowExpansion=h.rowExpansion=!1}t.rowId=o[l],t.rowIndex=l,this._dispatch("rowExpansionBinding",t)}t.originalRowData=null,t.originalRowId=null,t.rowExpansion=!1}}},Pe.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 n=this._settings.length;--n>=0;){this._settings[n].getSection().setColumnCount(i)}var o=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=o[s-i];r.colIndex=s,r.columnData=l?l.columnData:null,this._dispatchColumnEvent("columnRemoved",r)}}},Pe.prototype._onSectionDataChanged=function(t){if(!this._dispatchingDataChanged){var e=this._layoutX.getLaneCount();if(this._dispatchingDataChanged=!!e,e){var i,n,o=t.fromRowIndex,r=t.toRowIndex,s=t.section,l=t.dataSource,a=l&&l.getDataSource()?1:0;s._startBindingSession(!0),a&&(i=l.getVisibleRowIds(!0),n=l.getMultipleRowData(i,o,r),t.dataRows=n);var u="content"===t.sectionType;u&&this._dispatch("beforeContentBinding",t),this._dispatch("preSectionDataBinding",t);for(var h=this.getDataColumnMap(),p=0;p<e;++p)if(s.isColumnActive(p)&&(this.isColumnVisible(p)||this._isAlwaysRenderColumn(p))){var d=this.getColumnDataBindingHandler(p)||this._dataBindingHandler;if(d){var c=h[p];t.dataColumnName=c,t.colIndex=p;for(var _=o;_<r;++_){if(a){var f=n[_];t.rowData=f,t.rowId=i[_],t.dataValue=f?f[c]:null}t.rowIndex=_,t.cell=s.getCell(p,_,!1),d(t)}}}this._dispatch("postSectionDataBinding",t),this._dispatchRowExpansionBinding(t),u&&(this._firstRendered||(this._dispatch("firstRendered",t),this._firstRendered=!0),this._dispatch("afterContentBinding",t)),s._startBindingSession(!1),this._dispatchingDataChanged=!1}}},Pe.prototype.resetInternalState=function(){this._firstRendered=!1},Pe.prototype._updateScrollbar=function(t){return!!t&&(t.isEnabled()&&t.update(),t.isActive())},Pe.prototype._onVScroll=function(t){this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop()),this._dispatchRowPositionChanged()},Pe.prototype._onHScroll=function(t){var e=this._hscrollbar.getScrollLeft();this._colVirtualizer.setViewOffset(e),this._updateColumnBounds(),this._dispatchColumnPositionChanged()},Pe.prototype._onVScrollEnabled=function(){this._updateScrollbarHeight(!0,!1),this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.activate(),this._vscrollbar.getAutoHide()||this._updateVScrollbar()},Pe.prototype._onVScrollDisabled=function(){this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.deactivate()},Pe.prototype._onRowInViewChanged=function(t){for(var e=t.firstIndex,i=t.lastIndex+1,n=this._settings.length,o=[0,0],r=0;r<n;++r){var s=this._settings[r],l=s.getSection();l&&!l.getFrozenLayout()&&(l.activateRows(e,i,o),this.updateRowData(s,o[0],o[1]-1))}},Pe.prototype._onColInViewChanged=function(t){if(this.getColumnCount()){var e=t.prevFirstIndex,i=t.prevLastIndex,n=t.firstIndex,o=t.lastIndex,r=e<n?e:n,s=i>o?i:o;this._activateColumns(n,o,r,s);for(var l=this.getSectionCount(),a=0;a<l;++a){var u=this._settings[a];this.updateRowData(u)}}},Pe.prototype._activateColumns=function(t,e,i,n){null==i&&(i=0),null==n&&(n=this.getColumnCount()-1);for(var o=this._getColActivationList(t,e,i,n),r=this.getSectionCount();--r>=0;){this._settings[r].activateColumns(o,i,n)}},Pe.prototype._getColActivationList=function(t,e,i,n){null==i&&(i=0);var o=this.getColumnCount();null==n&&(n=o-1),null==t&&(t=this._colVirtualizer.getFirstIndexInView()),null==e&&(e=this._colVirtualizer.getLastIndexInView());for(var r=this.getHScrollStartIndex(),s=this.getFirstPinnedRightIndex(),l=new Array(n+1),a=i;a<=n;++a)l[a]=a<r||a>=t&&a<=e||a>=s;return l},Pe.prototype._getColumnDef=function(t){if(t>=0){var e=this._columnDefs[t];return e||(e=this._columnDefs[t]={id:""+Pe._runningColumnId++,columnData:{}}),e}return{columnData:{}}},Pe.prototype._getNestedColumnDef=function(t,e,i){var n=this._getColumnDef(t);if(e){var o=n;(n=o[e])||(n=o[e]={}),i&&((n=(o=n)[i])||(n=o[i]={}))}return n},Pe.prototype.getColumnId=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).id||""},Pe.prototype._getColumnId=Pe.prototype.getColumnId,Pe.prototype.getColumnIds=function(){for(var t=this.getColumnCount(),e=new Array(t),i=0;i<t;++i)e[i]=this._getColumnDef(i).id||"";return e},Pe.prototype.setColumnField=function(t,e){this._getColumnDef(t).field=e||""},Pe.prototype.getColumnField=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).field||""},Pe.prototype.getColumnFields=function(){for(var t=this.getColumnCount(),e=new Array(t),i=0;i<t;++i)e[i]=this._getColumnDef(i).field||"";return e},Pe.prototype.getColumnIndex=function(t){if("number"==typeof t)return t;if(t)for(var e=t,i=this.getColumnCount(),n=0;n<i;++n){var o=this._getColumnDef(n);if(e===o.id||e===o.field)return n}return-1},Pe.prototype.getColumnIndices=function(t){for(var e=[],i=this.getColumnCount(),n=Array.isArray(t)?t:[t],o=n.length,r=0;r<o;++r){var s=this.getColumnIndex(n[r]);s>=0&&s<i&&e.push(s)}return e},Pe.prototype.getColumnIndexMap=function(){for(var t=this.getColumnCount(),e={},i="",n=0;n<t;++n){var o=this._getColumnDef(n);(i=o.field)&&(e[i]=n),(i=o.id)&&(e[i]=n)}return e},Pe.prototype._onWindowResize=function(){this._updateLayout(),this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop())},Pe.prototype._onMouseMove=function(){this._vscrollbar.flash(),this._hscrollbar.flash()},Pe.prototype._onGridClicked=function(){if(!window.getSelection().toString()){var t=document.activeElement;this._element.contains(t)||this.focus()}},Pe.prototype._onRowHightlighted=function(t){if(this._hasListener("rowHighlighted")){var e=t.sender,i=this.getSectionSettings(e.getId());if(null!=i){i.extendEventArg(t);var n=i.getDataSource();null!==n&&(t.rowId=n.getRowId(t.rowIndex),t.dataRow=n.getRowData(t.rowId)),this._dispatch("rowHighlighted",t)}}},Pe.prototype._onRowCountChanged=function(t){if(!this._disposed){var e=t.sender,i=t.prevCount,n=t.rowCount,o=e.getIndex(),r=this._updateSectionIndices(o),s=0;if(i>n)this._layoutY.removeLaneAt(r,i-n),this._layoutY.isHomogeneous()||this._syncSectionRowHeights(e);else{var l=this._layoutY.getDefaultLaneSize(),a=e.getDefaultRowHeight();if(this._layoutY.insertLane(r+i,n-i),a!==l)for(s=i;s<n;++s)this._layoutY.setLaneSize(r+s,a)}var u=t.noBinding,h=o<=this._startVScrollbarIndex||o>=this._getFooterStartIndex(),p=this._frozenFooterCount>0,d=this._updateScrollbarHeight(h,p,u);u&&(this._hasPendingRowChange=!0),this._frozenLayout||d||(this._rowVirtualizer.isVirtualizable()?e.activateRows(this._rowVirtualizer.getFirstIndexInView(),this._rowVirtualizer.getLastIndexInView()):e.activateRows()),this._hasPendingRowChange=!1,p||this._updateVScrollbar(),this._updateColumnSeparators(),i<n?this._dispatch("rowAdded",t):i>n&&this._dispatch("rowRemoved",t)}},Pe.prototype._onRowHeightChanged=function(t){if(this._rowHeightSync&&!this._disposed&&!this._rowHeightConflator.conflate(t)){for(var e=this._rowHeightConflator.popAllData(),i=e.length,n=NaN,o=0;o<i;++o){var r=e[o],s=r.section;if(this._containsSection(s))for(var l=s.getIndex(),a=r.rowIndex,u=this.getRowIndex(l,a),h=r.changeLength,p=0;p<h;++p)this._layoutY.setLaneSize(u+p,s.getRowHeight(a+p))&&(l>=n||(n=l))}this._rowHeightConflator._needScrollbarUpdate?(this._rowHeightConflator._needScrollbarUpdate=!1,this._updateScrollbarHeight(!0,!0)):n>=0&&(this._dispatchingDataChanged?this._rowHeightTimerId||(this._rowHeightTimerId=setTimeout(this._requestScrollbarUpdate,0)):this._updateScrollbarHeight(n<this._startVScrollbarIndex,n>=this._startVScrollbarIndex)),this._updateColumnSeparators(),this._dispatchRowPositionChanged()}},Pe.prototype._containsSection=function(t){for(var e=this._settings.length;--e>=0;)if(this._settings[e].getSection()===t)return!0;return!1},Pe.prototype._onRowAvailable=function(t){if(!this._hasPendingRowChange){var e=t.sectionIndex;this._dispatchColumnRenderEvent(t,0,this.getColumnCount(),e,e+1,t.prevRowIndex,t.rowIndex)}},Pe.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()}},Pe.prototype._onColumnCountChanged=function(){if(!this._frozenLayout&&!this._disposed){var t=this._countPinnedLeftColumns(),e=this._countPinnedRightColumns();this._updateColumnBounds(),this._updateColumnSeparators(),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()}},Pe.prototype._onSyncVScroll=function(t){this._vscrollbar.setScrollTop(t.scrollTop)},Pe.prototype._onSyncHScroll=function(t){this._hscrollbar.setScrollLeft(t.scrollLeft)},Pe.prototype._getFooterStartIndex=function(){return this.getSectionCount()-this._frozenFooterCount},Pe.prototype._getVScrollStart=function(){return this._getSectionSize(0,this._startVScrollbarIndex)},Pe.prototype._getFooterSize=function(){return this._frozenFooterCount>0?this._getSectionSize(this._getFooterStartIndex()):0},Pe.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]),n=t+e;return(e>0?this._layoutY.getLaneStart(this._sectionStarts[n]):0)-i},Pe.prototype._updateScrollbarHeight=function(t,e,i){if(!this._vscrollbar.isEnabled())return!1;var n=e,o=t&&this._startVScrollbarIndex>=0,r=this._rowHeightConflator.isConflating();if(r&&(this._rowHeightConflator._needScrollbarUpdate=!0,n=!1),o&&!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 u=this._getVScrollStart(),h=this._getFooterSize();a!==s&&(u+=s.clientTop),this._vscrollbar.resetPaneSize();var p=a.clientHeight-(u+h)*this._zoomFactor;this._vscrollbar.setTop(u*this._zoomFactor),this._vscrollbar.setTrackSize(p,p/this._zoomFactor);var d=this._layoutY.getDefaultLaneSize(),c=12*d;p>c&&(c=(Math.ceil(p/d)+4)*d),this._rowVirtualizer.setViewSize(c/this._zoomFactor),this._rowVirtualizer.setViewBounds(this._startVScrollbarIndex,this.getFooterCount())}else this._rowVirtualizer.validateVirtualization();var _=!1;return i||(_=this._rowVirtualizer.update()),this._vscrollbar.invalidate(n),_},Pe.prototype._updateScrollbarWidth=function(t,e){if(!this._frozenLayout){if(t&&this._hScrollbarEnabled){var i=this.getElement(),n=this._hscrollbar.getParent();n||(n=this.getParent()||i,this._hscrollbar.setParent(n));var o=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=n!==i?i.clientLeft:0,u=n.clientWidth-(o+a+s)*this._zoomFactor;l>0&&(u-=this._reservedSpace),this._hscrollbar.setPaneLeft(o),this._hscrollbar.setLeft((o+a)*this._zoomFactor),this._hscrollbar.setTrackSize(u,u/this._zoomFactor);var h=4*this._layoutX.getDefaultLaneSize();u>h&&(h=u),this._colVirtualizer.setViewSize(h/this._zoomFactor),this._colVirtualizer.setViewBounds(this._pinnedLeftColumnCount,l)}else this._colVirtualizer.validateVirtualization();this._colVirtualizer.update(),this._hscrollbar.invalidate(e)}},Pe.prototype._hitTestY=function(t,e){var i;if(e.sectionSettings)i=e.sectionSettings;else{var n,o=(n="number"==e.rowIndex?e.rowIndex:this._layoutY.hitTest(t))>=0?n:~n,r=ot.upperBound(this._sectionStarts,o)-1;if(e.sectionIndex=r,!(i=this._settings[r]))return!1;i.extendEventArg(e)}var s=i.getSection();return null!=e.colIndex&&e.cellElement?e.rowIndex=s.getCellIndex(e.colIndex,e.cellElement):e.rowIndex=n+s.getRowOffset(),!0},Pe.prototype._syncLayoutToColumns=function(t,e,i){if(!this._frozenLayout){var n=this._layoutX.getLaneCount(),o=this.fillParentWidth(100);(o||null==t||null==e)&&(t=0,e=n,o=!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=o||t<this.getHScrollStartIndex()||e>this.getFirstPinnedRightIndex();this._updateScrollbarWidth(a,!0),this._updateColumnBounds(),this._updateColumnSeparators(),this._dispatchColumnPositionChanged(),(s||i)&&this._dispatch("widthChanged",{from:t,to:e,colChanged:t})}}},Pe.prototype._syncLayoutToSectionColumns=function(t,e,i){null==e&&(e=0),null==i&&(i=this._layoutX.getLaneCount());for(var n=0,o=e;o<i;++o)n|=t._setColumnWidth(o,this._layoutX.getLaneSize(o));return!(!n||this._frozenLayout)&&(t._updateColumnLayout(),!0)},Pe.prototype._toDataColumnName=function(t){return ot.isNumber(t)?this.getDataColumnName(t):t},Pe.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 n=this._settings[e-1]||null;n!==this._lastSettings&&(this._lastSettings&&this._lastSettings.getSection().removeClass("last"),this._lastSettings=n,this._lastSettings&&this._lastSettings.getSection().addClass("last")),this._sectionStarts.length=e+1,this._sectionStarts[0]=0;for(var o=t;o<e;++o){var r=this._settings[o].getSection();r.setIndex(o),r.setRowOffset(this._sectionStarts[o]),this._sectionStarts[o+1]=this._sectionStarts[o]+r.getRowCount()}return this._sectionStarts[t]},Pe.prototype._updateLayout=function(){var t=this.getElement();if(!this._disposed&&t.offsetParent){this._syncLayoutToColumns(),this._updateScrollbarHeight(!0,!0),this._updateScrollbarWidth(!0,!0);for(var e=this.getSectionCount(),i=0;i<e;++i){this._settings[i].getSection().updateLayout()}this._updateColumnSeparators()}},Pe.prototype._updateVScrollbar=function(){!this._disposed&&this._vscrollbar.isEnabled()&&(this._vScrollbarConflator.conflate()||this._vscrollbar.update())},Pe._proto=Pe.prototype;let ze={chainIcon:""};ze.styles=function(t){if(t){let e="";if(Array.isArray(t)){e=t.map(v).join("\n").replace(/{\s*{/g,"{").replace(/\s+{/g," {")}else e="string"==typeof t?t:t+"";if(e)return e.replace(/{[\w\W]*?}/g,S)}return""}([".tr-grid .chain-icon",["cursor: pointer;"],".tr-grid .chain-icon .fallback-arrow",["vertical-align: middle;","font-size: 7px;","line-height: 1;","display: inline-block;","transform: scaleX(1.5);","font-family: Arial;"],".tr-grid .closed .chain-icon",["transform: translate(0px, -1px) rotate(-90deg);"]]),ze.applyStyle=function(t){t&&!t._rowGroupingStyles&&(t._rowGroupingStyles=!0,w(ze.styles,t.getElement()))};var Ve=ze;let ke=function(){this._counter={},this._session={},this._referers={}};ke.prototype._counter=null,ke.prototype._session=null,ke.prototype._referers=null,ke.prototype.reset=function(){this._counter={},this._referers={},this.newSession()},ke.prototype.newSession=function(){this._session={}},ke.prototype.getAllReferences=function(){return Object.keys(this._counter)},ke.prototype.getAllReferers=function(){return Object.keys(this._referers)},ke.prototype.getAllReferrers=ke.prototype.getAllReferers,ke.prototype.getSession=function(){let t=[],e=[];for(let i in this._session){let n=this._session[i];n>0?t.push(i):n<0&&e.push(i)}return{newEntries:t.filter(Boolean),removedEntries:e.filter(Boolean)}},ke.prototype.addReference=function(t,e){if(t){if(e){let i=this._referers[e];if(i){if(i[t])return!1}else i=this._referers[e]={};i[t]=1}if(!this._counter[t])return this._counter[t]=1,-1===this._session[t]?this._session[t]=0:this._session[t]=1,!0;++this._counter[t]}return!1},ke.prototype.addRef=ke.prototype.addReference,ke.prototype.removeReference=function(t,e,i){if(!t)return!1;let n=this._counter[t];if(!n)return!1;if(null==i)i=1;else if(i<0)i=n;else if(!i)return!1;if(e){let i=this._referers[e];if(!i)return!1;if(!i[t])return!1;delete i[t]}return n-=i,!n||n<0?(delete this._counter[t],1===this._session[t]?this._session[t]=0:this._session[t]=-1,!0):(this._counter[t]=n,!1)},ke.prototype.release=ke.prototype.removeReference,ke.prototype.addReferences=function(t,e){if(!t)return 0;let i=0;if(Array.isArray(t)){let n=t.length;for(let o=0;o<n;++o)this.addReference(t[o],e)&&++i}else if("string"==typeof t)this.addReference(t,e)&&++i;else for(let n in t)this.addReference(n,e)&&++i;return i},ke.prototype.removeReferer=function(t){let e=0;if(t){let i=this._referers[t];if(i){for(let n in i)this.removeReference(n,t)&&++e;delete this._referers[t]}}return e},ke.prototype.removeReferrer=ke.prototype.removeReferer,ke.prototype.log=function(){console.log(this._counter)};var Oe=ke;let Ne=function(){let t=this;t._commitRicsChanges=t._commitRicsChanges.bind(this),t._commitFieldsChanges=t._commitFieldsChanges.bind(this),t._fieldChangedConflator=new o(0,t._commitFieldsChanges),t._ricChangedConflator=new o(0,t._commitRicsChanges),t._fields=new Oe,t._rics=new Oe,t._rowDefMap={}};r.inherits(Ne,l),Ne.prototype._fieldChangedConflator=null,Ne.prototype._ricChangedConflator=null,Ne.prototype._rowDefMap=null,Ne.prototype._rics=null,Ne.prototype._fields=null,Ne.prototype.getAllRics=function(){return this._rics.getAllReferences()},Ne.prototype.getAllRowDefs=function(){let t=[];for(let e in this._rowDefMap)t=t.concat(this._rowDefMap[e]);return t},Ne.prototype.getAllFields=function(){return this._fields.getAllReferences()},Ne.prototype.getRowDefByRic=function(t){return this._rowDefMap[t]||null},Ne.prototype.addRic=function(t){let e=t?t.getSymbol():"";if(!e)return!1;let i=this._rowDefMap,n=i[e];n?n.indexOf(t)<0&&n.push(t):n=i[e]=[t];let o=this._rics.addReference(e,t.getRowId());return this._commitRicsChanges(),o},Ne.prototype.removeRic=function(t,e){if(e||(e=t?t.getSymbol():""),!e)return;let i=this._rowDefMap[e];if(i){let e=i.indexOf(t);e>=0&&i.splice(e,1)}this._rics.removeReference(e,t.getRowId()),this._commitRicsChanges()},Ne.prototype.removeAllRics=function(){let t=this._rics.getAllReferers();for(let e in t)this._rics.removeReferer(t[e]);this._rowDefMap={},this._commitRicsChanges()},Ne.prototype._commitRicsChanges=function(){if(this._ricChangedConflator.conflate())return;let t=this._rics,e=t.getSession(),i=e.removedEntries,n=e.newEntries;i.length&&this._doDispatch({type:"ricRemoved",removedRics:i}),n.length&&this._doDispatch({type:"ricAdded",addedRics:n}),t.newSession()},Ne.prototype.addFields=function(t,e){if(!t)return;let i=this._fields;t instanceof zt?i.addReferences(t.getAllFields(),t.getId()):i.addReferences(t,e),this._commitFieldsChanges()},Ne.prototype.removeFields=function(t,e){t&&(t instanceof zt?this._fields.removeReferer(t.getId()):this._fields.removeReference(t,e),this._commitFieldsChanges())},Ne.prototype.removeFieldReferrer=function(t){this._fields.removeReferer(t),this._commitFieldsChanges()},Ne.prototype.removeAllFields=function(){let t=this._fields.getAllReferers();for(let e in t)this._fields.removeReferer(t[e]);this._commitFieldsChanges()},Ne.prototype._commitFieldsChanges=function(){if(this._fieldChangedConflator.conflate())return;let t=this._fields,e=t.getSession(),i=e.removedEntries,n=e.newEntries;i.length&&this._doDispatch({type:"fieldRemoved",removedFields:i}),n.length&&this._doDispatch({type:"fieldAdded",addedFields:n}),t.newSession()},Ne.prototype._doDispatch=function(t){let e=this;t.fields=e.getAllFields(),t.rics=e.getAllRics(),t.rowDefs=e.getAllRowDefs(),e._dispatch(t.type,t)},Ne.prototype.reset=function(){let t=this;t._rowDefMap={},t._fields.reset(),t._rics.reset(),t._fieldChangedConflator.reset(),t._ricChangedConflator.reset()};var He=Ne;let Be=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},Ge=function(){this._defaultSorter=this._defaultSorter.bind(this),this._dataSorter=this._dataSorter.bind(this),this._rowDefSorter=this._rowDefSorter.bind(this),this._multiColumnsSorter=this._multiColumnsSorter.bind(this),this._globalContext={},this._sortParams=[],this._ctxCaches=[]};Ge.prototype._globalContext,Ge.prototype._sortParams,Ge.prototype._ctxCaches,Ge.prototype._primaryParams,Ge.prototype.dispose=function(){this._globalContext={},this._sortParams.length=0,this._ctxCaches.length=0,this._primaryParams=null},Ge.prototype.getSorter=function(){this._primaryParams=null;let t=this._sortParams.length;if(1===t){let t=this._primaryParams=this._sortParams[0];if(t[1]){return t[3]?this._rowDefSorter:this._dataSorter}return this._defaultSorter}return t>1?this._multiColumnsSorter:Ge._noSorting},Ge.prototype.reset=function(){this._sortParams.length&&(this._sortParams.length=0)},Ge.prototype.setContext=function(t,e){this._globalContext[t]=e},Ge.prototype.addColumnContext=function(t,e,i,n,o,r){t||(t="");let s=this._sortParams.length,l=this._ctxCaches[s];l||(l=this._ctxCaches[s]=f(this._globalContext));let a=0;"a"===n?a=1:"d"===n&&(a=-1);let u=[t,"function"==typeof e?e:null,l,i,a];l.colIndex=o,l.field=t,l.formattedField=t+"_FORMATTED",l.colDef=r,this._sortParams.push(u)},Ge._noSorting=function(t,e,i){return 0},Ge.prototype._defaultSorter=function(t,e,i){let n=this._primaryParams[0];return Be(t.getData(n),e.getData(n),i)},Ge.prototype._dataSorter=function(t,e,i){let n=this._primaryParams,o=n[0];return(0,n[1])(t.getData(o),e.getData(o),i,n[2])},Ge.prototype._rowDefSorter=function(t,e,i){let n=this._primaryParams;return(0,n[1])(t,e,i,n[2])},Ge.prototype._multiColumnsSorter=function(t,e,i){let n=this._sortParams,o=n.length;for(let i=0;i<o;++i){let o=n[i],r=o[0],s=o[1],l=o[2],a=o[3],u=o[4],h=0;if(h=s?a?s(t,e,u,l):s(t.getData(r),e.getData(r),u,l):Be(t.getData(r),e.getData(r),u),h)return h}return 0};var We=Ge,Ue=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})};s.inherits(Ue,at),Ue.prototype._hosts=null,Ue.prototype._sortStates,Ue.prototype._maxCount=1,Ue.prototype._dataSorting=!0,Ue.prototype._dblClickAllowed=!1,Ue.prototype._clickTimer=0,Ue.prototype._delayInterval=0,Ue.prototype._lastMouseDown=0,Ue.prototype._initialSort=null,Ue.prototype._mode="",Ue.prototype._sortableColumns=!0,Ue.prototype._sortableIndicator=!1,Ue.prototype._solarTheme=!1,Ue.prototype._sortLogic,Ue.prototype._userManagedLogic=!1,Ue.prototype._disabled=!1,Ue.prototype._frozenIndicator=!1,Ue.prototype._rowDefMode=!1,Ue._icons={},Ue.prototype._sortingSequence,Ue.prototype._sortingSequenceMap=null;Ue.prototype.getName=function(){return"SortableTitlePlugin"},Ue.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))},Ue.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))},Ue.prototype.afterInit=function(){var t=this;t.setSortLogics(t._sortLogic);var e=t._initialSort;null!=e&&(Array.isArray(e)?1===t._maxCount?t.sortColumns(e.slice(0,1)):t.sortColumns(e):t.sortColumns([e]))},Ue.prototype.config=function(t){if(t){var e=this,i=t.icons;null!=i&&i.sorting&&(Ue._icons=i.sorting);var n=t.themeName;!n||n.indexOf("solar")>=0?e._solarTheme=!0:e._solarTheme=!1,e._initialSort=e._initialSortByColumnField(t);var o=t.sorting;if(o){o.ROW_DEF&&(this._rowDefMode=!0),o.userManagedLogic&&(e._userManagedLogic=!0);var r=o.multiColumn||o.multicolumn;if(null!=r&&(!0===r&&(r=-1),!1===r&&(r=1),e.setSortableColumnCount("number"==typeof r&&r>0?r:-1)),null!=(r=o.sortableIndicator)&&(e._sortableIndicator=r),null!=(r=o.disabled)&&(e._disabled=!!r),null!=(r=o.threeStatesSorting)&&e.disableTwoStateSorting(r),null!=(r=o.sortingSequence)&&Array.isArray(r)&&(e._sortingSequence=r),null!=(r=o.mode)&&(e._mode=r,"manual"===r&&e.disableDataSorting()),null!=(r=o.indicatorOnly)&&e.disableDataSorting(r),null!=(r=o.disableDoubleClickToSort)&&e.disableDoubleClickToSort(r),"function"==typeof(r=o.columnSorted)&&e.listen("columnSorted",r),"function"==typeof(r=o.preClicked)&&e.listen("preClicked",r),"function"==typeof(r=o.clicked)&&e.listen("clicked",r),"function"==typeof(r=o.preDataSorting)&&e.listen("preDataSorting",r),null!=(r=o.sortableColumns)&&(e._sortableColumns=r),"object"==typeof(r=o.initialSort)&&(e._initialSort=r),"object"==typeof(r=o.sortLogic))for(var s in r)"function"==typeof r[s]&&(e._sortLogic[s]=r[s])}}},Ue.prototype.getConfigObject=function(t){var e=t||{},i=e.columns;i||(i=e.columns=[]);var n=this._hosts[0];if(!n)return e;var o,r,s,l,a,u=this.getSortedColumns();if(1===this._maxCount&&null!=u)for(s=u.length,r=0;r<s;r++){var h=u[r],p=h.colIndex;(o=i[p])||(o=i[p]={}),o.sortOrder=h.sortOrder}for(s=n.getColumnCount(),r=0;r<s;++r)(o=i[r])||(o=i[r]={}),(l=this._getSortOptions(r))&&(this._sortableColumns?l.disabled&&(o.sortable=!1):l.disabled||(o.sortable=!0),(a=l.field)&&(null!=o.field&&o.field!==a&&(o.sortBy=a),this._sortingSequenceMap&&this._sortingSequenceMap[a]&&(o.sortingSequence=this._sortingSequenceMap[a])));var d=e.sorting;d||(d=e.sorting={});var c=u;null!=c&&(d.initialSort=c),!1!==(c=this._sortableIndicator)&&(d.sortableIndicator=c),1!==this._maxCount&&(d.multiColumn=-1===this._maxCount||this._maxCount),this._dblClickAllowed&&(d.disableDoubleClickToSort=!this._dblClickAllowed),!0!==(c=this._sortableColumns)&&(d.sortableColumns=c),!0!==(c=this._dataSorting)&&(d.indicatorOnly=c),this._disabled&&(d.disabled=!0);var _=this._sortingSequence,f=!0;return 2===_.length&&"a"===_[0]&&"d"===_[1]&&(f=!1),f&&(d.sortingSequence=_.slice()),g(e.sorting)&&delete e.sorting,e},Ue.prototype.getColumnMenu=function(t,e){e||(e={});var i=e.menus;i||(i=e.menus=[]);var n=i[0];n||(n=i[0]={menuItems:[]});var o=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"===o,click:this._onItemSortingClicked},{indexScore:2,label:"Descending",radioMode:!0,value:{colIndex:t,order:"d"},selected:"d"===o,click:this._onItemSortingClicked},{indexScore:1,label:"Un-Sort",radioMode:!0,value:{colIndex:t,order:"n"},selected:"n"===o,click:this._onItemSortingClicked}]}};return n.menuItems.push(r),e},Ue.prototype._onItemSortingClicked=function(t){this._hosts[0].getPlugin("ColumnMenuPlugin").hide();var e=t.currentTarget.value,i=e.colIndex,n=e.sortOrder;this.sortColumn(i,n)},Ue.prototype.getIcons=function(){return Ue._icons},Ue.prototype.setSortLogics=function(t){if(null!=t){var e=this._hosts[0];if(e){var i=e.getDataSource();for(var n in t)this._setSortLogic(i,n,t[n])}}},Ue.prototype.setSortLogic=function(t,e){if("string"==typeof t){var i=this._hosts[0];if(i){var n=i.getDataSource();this._setSortLogic(n,t,e)}}},Ue.prototype._setSortLogic=function(t,e,i){t&&"string"==typeof e&&("*"===e?t.setSortingLogic(i):t.setColumnSortingLogic(e,i))},Ue.prototype.getSortOrder=function(t){var e=null!=t?this.getSortPriority(t):0,i=this._sortStates[e];return(i?i.sortOrder:"")||"n"},Ue.prototype.getSortedColumnIndex=function(t){return this._getColumnIndex(this._sortStates[t||0])},Ue.prototype.getSortPriority=function(t,e){var i=this._hosts[0];if(i){var n,o=this._sortStates.length;if(t>=0){var r=i.getColumnId(t);if(r)for(n=0;n<o;++n)if(this._sortStates[n].colId===r)return n}else if(e)for(n=0;n<o;++n){var s=this._sortStates[n];if(s.colId===e)return n;if(s.field===e)return n}}return-1},Ue.prototype.isColumnSorted=function(t){return this.getSortPriority(t)>=0},Ue.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 n=this.getSortedColumnIndex(i),o=this._sortStates[i],r={},s="";n>=0&&(r.colIndex=n,s=this._getColumnId(n)),s&&(r.colId=s);var l=o.field||"";l&&(r.field=l),r.sortOrder=o.sortOrder||"n",e[i]=r}return e},Ue.prototype.isSorting=function(){return!!this._sortStates.length},Ue.prototype.sortColumn=function(t,e,i){this._sortColumn(this._prepareSorting(t,e),i)},Ue.prototype.sortColumns=function(t,e){if(Array.isArray(t)){for(var i=t.length,n=new Array(i),o=0;o<i;o++)n[o]=this._prepareSorting(t[o]);this._sortColumn(n,e)}},Ue.prototype.clearSortState=function(t){this._popSortState(0,t)&&this.updateSortSymbols()},Ue.prototype.refresh=function(){this._sortStates.length&&(this._sortDataView(),this.updateSortSymbols())},Ue.prototype.restoreUserActions=Ue.prototype.refresh,Ue.prototype.setSortableColumnCount=function(t){this._maxCount=t||1,this._popSortState(this._maxCount)},Ue.prototype.getSortingStates=function(){return this._sortStates},Ue.prototype.updateSortSymbols=function(){if(!this._disabled)for(var t=this._hosts.length;--t>=0;)this._updateSortableIndicator(t)},Ue.prototype.getDataColumnMap=function(){var t=this._hosts[0],e=[];if(t)for(var i=t.getColumnCount(),n=0;n<i;++n)e[n]=this.getColumnSortingField(n);return e},Ue.prototype.getDataColumnNames=Ue.prototype.getDataColumnMap,Ue.prototype.setDataColumnMap=function(t){if(Array.isArray(t))for(var e=t.length;--e>=0;)this.setColumnSortingField(e,t[e])},Ue.prototype.setDataColumnNames=Ue.prototype.setDataColumnMap,Ue.prototype.getColumnSortingField=function(t){var e=this._getSortOptions(t),i=e?e.field:null;if(null==i&&!this._rowDefMode){var n=this._hosts[0];n&&((i=n.getColumnField(t))||(i=n.getDataColumnName(t)),i&&e&&(e.field=i))}return i||""},Ue.prototype.setColumnSortingField=function(t,e,i,n){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,n&&i&&(i.rowSorting=!0))}};var Ye=function(t){return t.field||""};Ue.prototype.getColumnSortingFields=function(){return this._sortStates.map(Ye)},Ue.prototype.setFirstSortOrder=function(t,e){"a"!==(e=e?Ue._toSortOrder(e):"a")&&"d"!==e&&(e="a");for(var i=null,n=(i=Array.isArray(t)?t:[t]).length,o=0;o<n;++o){var r=i[o],s=this.getSortingSequence(r).slice(),l=s.indexOf(e);l>=0&&s.splice(l,1),s.unshift(e),this.setSortingSequence(s,r)}},Ue.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")},Ue.prototype.freezeIndicator=function(t){var e=this._frozenIndicator;if(this._frozenIndicator=!1!==t,e&&!this._frozenIndicator)for(var i=this._hosts.length;--i>=0;)this._updateSortableIndicator(i)},Ue.prototype.disableSortSymbols=function(t){},Ue.prototype.disableDataSorting=function(t){this._dataSorting=!1===t},Ue.prototype.disableDoubleClickToSort=function(t){this._dblClickAllowed=!t},Ue.prototype.disableCellClick=function(t,e){t&&t.enableClass("no-sort",!1!==e)},Ue.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,n=0;n<i;++n)this._disableColumnSorting(t[n]||0,e)},Ue.prototype._disableColumnSorting=function(t,e){var i=this._newSortOptions(t);i.disabled!==e&&(i.disabled=e)},Ue.prototype.setClickDelayInterval=function(t){this._delayInterval=null!=t?t:500},Ue.prototype._initialSortByColumnField=function(t){for(var e=t.columns,i=e?e.length:0,n=0;n<i;n++){var o=e[n].defaultSort;if(o)return{colIndex:n,sortOrder:o}}return null},Ue.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))}},Ue.prototype._onUIUpdated=function(t){"title"===t.sectionType&&this.updateSortSymbols()},Ue.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 n=t.colIndex,o=t.section,r=t.rowIndex;return!!this._isCellSortable(o,n,r)},Ue.prototype._proceedSorting=function(t){if(this._clickTimer=0,this._canClickToSort(t)){var e=t.colIndex;this.sortColumn(e,null,{isUserAction:!0});var i=t.grid;if(i&&i.focus&&i.focus(),this._hasListener("clicked")){var n={};n.colIndex=e,n.sortOrder=this.getSortOrder(e),n.dataColumnName=this.getColumnSortingField(e),this._dispatch("clicked",n)}}},Ue.prototype._onMouseDown=function(t){t.button||(this._lastMouseDown=t.timeStamp)},Ue.prototype._getPlugin=function(t){var e=this._hosts[0];return e?e.getPlugin(t):null},Ue.prototype._onClickTitle=function(t,e){if(!this._disabled)if(2!==e.detail||this._dblClickAllowed){if(!(e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)&&e.timeStamp-this._lastMouseDown<500){var i=t.getRelativePosition(e);if(i.hit){var n=this._getPlugin("ColumnSelectionPlugin");if(n&&n.isEnabled()){var o=i.colIndex;if(!n.isSelectedColumn(o))return}i.target=e.target,this._delayInterval>0?this._clickTimer||(this._clickTimer=setTimeout(this._proceedSorting.bind(this,i),this._delayInterval)):this._proceedSorting(i)}}}else this._clickTimer&&(clearTimeout(this._clickTimer),this._clickTimer=0)},Ue.prototype._popSortState=function(t,e){if(t<0||this._sortStates.length<=t)return!1;for(var i=!1,n=this._sortStates.length;--n>=t;)this._clearSortSymbols(this._sortStates[n]),i=!0;return this._sortStates.length=t,this._sortDataView(e),i},Ue._toSortOrder=function(t){return!t||"string"!=typeof t||"d"!==(t=t.charAt(0).toLowerCase())&&"a"!==t?"n":t},Ue.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},Ue.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 n=t.map(Ue._toSortOrder);i?(this._sortingSequenceMap||(this._sortingSequenceMap={}),this._sortingSequenceMap[i]=n):this._sortingSequence=n}else i?this._sortingSequenceMap&&delete this._sortingSequenceMap[i]:this._sortingSequence=this._sortingSequence.length>2?["a","d","n"]:["a","d"]},Ue.prototype.clearAllColumnSortingSequences=function(){this._sortingSequenceMap=null},Ue.prototype.sortSeparators=function(t){var e=this._hosts[0].getDataSource();if(t)e.sortSeparators(t);else{for(var i=e.getSortingLogics(),n=[],o=[],r=this._sortStates.length,s=Ue._toRowDefField(),l=0;l<r;l++){var a=this._sortStates[l],u=this._rowDefMode?s:a.field;n.push(a.sortOrder),o.push(u)}e.sortSeparators(i,n,o)}},Ue.prototype._prepareSorting=function(t,e){if(!this._maxCount)return null;var i=this._hosts[0];if(!i)return null;var n=-1,o="";"number"==typeof t?n=t:"string"==typeof t?(o=t,n=this._getColumnIndex(o)):t&&"object"==typeof t&&((o=t.colId||t.field)?n=this._getColumnIndex(o):"number"==typeof t.colIndex&&(n=t.colIndex),e||(e=t.sortOrder||t.order||null));var r="",s=null;if(n>=0){r=this.getColumnSortingField(n);var l=this._getSortOptions(n);l&&(s=l.sortLogic)}else o&&(r=o);var a=this.getSortPriority(n,r),u=a>=0?this._sortStates[a]:null,h=u?u.sortOrder:"n",p="n";if(null==e){var d=this.getSortingSequence(r),c=d.indexOf(h);p=d[c=c<0?0:(c+1)%d.length]}else p=Ue._toSortOrder(e);if(u){if(h===p)return this.updateSortSymbols(),null;this._sortStates.splice(a,1),this._clearSortSymbols(u)}if("a"===p||"d"===p){if(n<0&&!r)return null;if(!u){u={};var _=i.getColumnId(n);_&&(u.colId=_)}u.field=r,u.sortLogic=s||null,this._sortStates.push(u)}u&&("n"!==h?u.prevOrder=h:delete u.prevOrder,u.order=p,u.sortOrder=p);var f=[];if(this._maxCount>0)for(;this._sortStates.length>this._maxCount;){var g=this._clearSortSymbols(this._sortStates.shift());null!==g&&f.push(g)}return{colIndex:n,sortedField:r,sortOrder:p||"n",prevOrder:h,clearedSortColIndexes:f}},Ue.prototype._sortColumn=function(t,e){if(t){this._sortDataView(e),this.updateSortSymbols();var i=null;if(Array.isArray(t)){for(var n=t.length,o=0;o<n;++o){var r=t[o];r&&(i?(i.colIndices||(i.colIndices=[],i.sortedFields=[],i.sortOrders=[],i.prevOrders=[]),i.colIndices.push(r.colIndex),i.sortedFields.push(r.sortedField),i.sortOrders.push(r.sortOrder),i.prevOrders.push(r.prevOrder)):i=r)}i=t[0]}else i=t;this._dispatch("columnSorted",i)}},Ue.prototype._onColumnAdded=function(t){var e=this,i=t.colIndex,n=t.context||{},o=!!e._sortableColumns,r=n.field,s=n.sortBy;null!=s&&(o=!!s,r=s),null!=n.sortable&&(o=!!n.sortable);var l=n.sortLogic||n.sortingLogic||n.sorter;l||(l=e._sortLogic[r]),"function"!=typeof l&&(l=null);var a=n.sortingSequence;null!=a&&r&&e.setSortingSequence(a,r),o?e.setColumnSortingField(i,r,l,n.rowSorting):e.disableColumnSorting(i,!0);var u=n.sortOrder||n.sort;null!=u&&"n"!==(u=Ue._toSortOrder(u))&&(e.clearSortState(),e.sortColumn(i,u))},Ue.prototype._onColumnRemoved=function(t){var e=this._sortStates.length;if(e){var i=t.colId;if(i)for(var n=0;n<e;++n){var o=this._sortStates[n];if(o.colId===i){this._sortStates.splice(n,1),this._clearSortSymbols(o),this._sortDataView();break}}}},Ue._toRowDefField=function(t){return"ROW_DEF"},Ue.prototype._sortDataView=function(t){if(t=t||{},this._dispatch("preDataSorting",t),this._dataSorting){var e=this._sortStates.length;this._userManagedLogic&&e>1&&(e=1);var i=null,n=null,o=null;if(e){i=new Array(e),n=new Array(e);for(var r=0;r<e;++r)i[r]=this._sortStates[r].sortOrder,n[r]=this._sortStates[r].sortLogic;o=this._rowDefMode?this._sortStates.map(Ue._toRowDefField):this.getColumnSortingFields(),this._userManagedLogic&&o.length>1&&(o=o.slice(0,1))}for(var s=this._hosts.length;--s>=0;){var l=this._hosts[s].getDataSource();if(l){var a=1==t.isUserAction;l.sort(o,i,n,a)}}}},Ue.prototype._clearSortSymbols=function(t){var e=t.targetCells;if(!e)return null;for(var i=null,n=e.length;--n>=0;){var o,r=e[n];r.removeClass("sorting"),r.removeClass("sortable"),r.removeFloatingIcon("sort-symbol"),r.removeFloatingIcon("priority-symbol"),null==i&&(o=r.getSection())&&(i=o.getColumnIndex(r.getParent()))}return e.length=0,i},Ue.prototype._updateSortableIndicator=function(t){var e=this,i=e._hosts[t];if(i&&!this._frozenIndicator){var n=i.getSection("title");if(null!=n)for(var o=n.getColumnCount();--o>=0;)for(var r=n.getRowCount(),s=0;s<r;s++){var l=n.getCell(o,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(n,o,s))){l.addClass("sortable");var a,u,h=e.getSortPriority(o),p=e._sortStates[h];if(p&&"n"!==p.sortOrder){var d;if(p.targetCells||(p.targetCells=[]),p.targetCells[t]=l,"a"===p.sortOrder?l.addClass("asc"):l.addClass("desc"),l.addClass("sorting"),e._solarTheme)"a"===p.sortOrder?(d="▲",u=Ue._icons.ascending):(d="▼",u=Ue._icons.descending),(a=e._createIconElem(u,d)).className="sort-symbol",l.insertFloatingIcon(a,0);else l.addClass("edge-indicator");e._sortStates.length>1&&((a=document.createElement("span")).className="priority-symbol",a.textContent=h+1,l.insertFloatingIcon(a,1))}else e._sortableIndicator&&(u=Ue._icons.sortable,(a=e._createIconElem(u,"◊")).className="sortable-indicator",l.insertFloatingIcon(a,0))}}}},Ue.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},Ue.prototype._getColumnIndex=function(t){if(null!=t){var e=this._hosts[0];if(e)return"number"==typeof t?t:"string"==typeof t?e.getColumnIndex(t):e.getColumnIndex(t.colId)}return-1},Ue.prototype._getColumnId=function(t){var e=this._hosts[0];return e&&null!=t?e.getColumnId(t):""},Ue.prototype._getSortOptions=function(t){var e=this._hosts[0];return e&&e.getColumnData(t).sortableTitle||null},Ue.prototype._newSortOptions=function(t){var e=this._hosts[0],i=null;if(e&&t>=0){var n=e.getColumnData(t);(i=n.sortableTitle)||(i=n.sortableTitle={})}return i||{}},Ue.prototype._isCellSortable=function(t,e,i){var n=this._getSortOptions(e);if(n){if(n.disabled)return!1;var o=n.field;if(null!=o&&!o)return!1}var r=t.getCell(e,i,!0);return!r.hasClass("no-sort")&&(r===t.getCell(e,t.getRowCount()-1,!0)&&!r.getParent().classList.contains("collapsed"))},Ue._proto=Ue.prototype;let qe=function(t){return t?t.getRowData():null},Xe={ROW_DEF:1,SUB_ID:1},je=function(t){return!t.isAutoGenerated()},Ke=function(t){return!t.autoGenerated},Je=function(t,e,i,n){return(t.getData(n)-e.getData(n))*i},Qe=function(t,e,i){let n=t.getParent();if(!n)return 0;let o=e.getParent();if(!o)return 0;if(n!==o)return 0;let r=t.getData("CHILD_ORDER");if(null==r)return 0;let s=e.getData("CHILD_ORDER");return null==s?0:(r-s)*i},Ze=function(t){return t?t.getName():""},$e=function(t,e){return t.getField()===e||t.getId()===e},ti=function(t,e){return!!(t&&e&&t.id&&e.id)&&t.id===e.id},ei=function(t,e){let i=this;if(i._onDataChanged=i._onDataChanged.bind(i),i._onQuote2PostUpdate=i._onQuote2PostUpdate.bind(i),i._onDataComposed=i._onDataComposed.bind(i),i._onSubSegmentChanged=i._onSubSegmentChanged.bind(i),i._recalculateFormulas=i._recalculateFormulas.bind(i),i._updateStreamingData=i._updateStreamingData.bind(i),i.updateColumnTitle=i.updateColumnTitle.bind(i),i._populateTimeSeriesChildren=i._populateTimeSeriesChildren.bind(i),i._onPostSectionDataBinding=i._onPostSectionDataBinding.bind(i),i._asyncClearDataUpdates=i._asyncClearDataUpdates.bind(i),i._clearDataUpdates=i._clearDataUpdates.bind(i),i._onPreDataSorting=i._onPreDataSorting.bind(i),i._mainSorter=i._mainSorter.bind(i),i._updateRowData=i._updateRowData.bind(i),i._onFormulaDataChanged=i._onFormulaDataChanged.bind(i),i._onFormulaDataRequired=i._onFormulaDataRequired.bind(i),i._addMemberOfChain=i._addMemberOfChain.bind(i),i._onColumnAdded=i._onColumnAdded.bind(i),i._onRowExpansionBinding=i._onRowExpansionBinding.bind(i),i._onColumnHeaderBinding=i._onColumnHeaderBinding.bind(i),i._getRowId=i._getRowId.bind(i),i._onFieldLoadedError=i._onFieldLoadedError.bind(i),i._snapshotFillerDataChanged=i._snapshotFillerDataChanged.bind(i),i._onPollingInterval=i._onPollingInterval.bind(i),i._streamingConflator=new o(50,i._updateStreamingData),i._formulaConflator=new o(300,i._onFormulaDataChanged),i._chainConflator=new o(100,i._addMemberOfChain),i._columnTitleConflator=new o(0,i.updateColumnTitle),i._timeSeriesChildConflator=new o(0,i._populateTimeSeriesChildren),i._defaultColumnOptions={},i._topNode=t||n.div(),i._topNode.classList.add("rt-grid"),i._grid=new Pe,i._grid._wrapper=this,i._sorter=new We,i._sorter.setContext("grid",this),i._sorter.setContext("core",i._grid),i._dateTimeUtil=B,i._grid.listen("columnAdded",i._onColumnAdded),e){if(e.dataView){i._sharedDataSource=!0,i._dv=e.dataView,i._dt=i._dv.getDataTable(),i._mainGrid=e.grid;let t=i._mainGrid.getCoreGrid();i._stp=t.getPlugin("SortableTitlePlugin")}e.SortableTitle&&(i._stp=e.SortableTitle),!1===e.topSection&&(i._topSection=!1)}i._sharedDataSource||(i._dc=new ut,i._dc.listen("dataChanged",i._onDataChanged),i._dc.listen("dataComposed",i._onDataComposed),i._dc.addStaticFields([yt,"SUB_ID"]),i._dt=new ft,i._dt.setSortingLogic(i._mainSorter),i._dt.setClassificationSource(i._dc),i._dt.listen("subSegmentChanged",i._onSubSegmentChanged),i._dv=new ve(i._dt),i._dv.listen("pageIndexChanged",i._dispatch.bind(i,"pageIndexChanged")),i._dv.listen("pageCountChanged",i._dispatch.bind(i,"pageCountChanged"))),i._grid.setDataSource(i._dv),i._stp?(i._sharedSorter=!0,i._stp.listen("preDataSorting",i._onPreDataSorting),i._grid.loadPlugin(i._stp)):(i._stp=new Ue({userManagedLogic:!0,sortableColumns:!0,disableDoubleClickToSort:!0,ROW_DEF:!0}),i._stp.listen("preDataSorting",i._onPreDataSorting),i._grid.loadPlugin(i._stp,e)),i._grid.listen("beforeContentBinding",i._dispatch.bind(i,"beforeContentBinding")),i._grid.listen("preSectionRender",i._onColumnHeaderBinding),i._grid.listen("postSectionDataBinding",i._onPostSectionDataBinding),i._grid.listen("firstRendered",i._dispatch.bind(i,"firstRendered")),i._grid.listen("afterContentBinding",i._dispatch.bind(i,"afterContentBinding")),i._grid.enableRowHighlighting(!0),i._addGridSections(),i._grid.setParent(i._topNode),i._snapshot=new kt,i._snapshot.addEventListener("adcDataReceived",i._dispatch.bind(i,"adcDataReceived")),i._snapshot.addEventListener("dataChanged",this._snapshotFillerDataChanged),i._connector=new He,i._connector.addEventListener("ricAdded",i._onRicAdded.bind(i)),i._connector.addEventListener("ricRemoved",i._onRicRemoved.bind(i)),i._connector.addEventListener("fieldAdded",i._onFieldAdded.bind(i)),i._connector.addEventListener("fieldRemoved",i._onFieldRemoved.bind(i)),i.initialize(e),Ve.applyStyle(i._grid)};r.inherits(ei,l),ei.prototype._topNode=null,ei.prototype._mainGrid=null,ei.prototype._grid=null,ei.prototype._dc=null,ei.prototype._dt=null,ei.prototype._dv=null,ei.prototype._sharedDataSource=!1,ei.prototype._sharedSorter=!1,ei.prototype._subs=null,ei.prototype._stp=null,ei.prototype._columnSorter=null,ei.prototype._streamingConflator=null,ei.prototype._snapshot=null,ei.prototype._connector=null,ei.prototype._sorter=null,ei.prototype._fnEngine=null,ei.prototype._formulaConflator=null,ei.prototype._chainMembers=null,ei.prototype._chainConflator=null,ei.prototype._clientWidth=NaN,ei.prototype._autoLayoutTimer=0,ei.prototype._defaultColumnOptions=null,ei.prototype._RTK=null,ei.prototype._ADCOptions=null,ei.prototype._synapse=null,ei.prototype._autoDateConversion=!1,ei.prototype._textSelect=!1,ei.prototype._lang=null,ei.prototype._dateTimeUtil=null,ei.prototype._initializing=!1,ei.prototype._pollingInterval=0,ei.prototype._pollingTimerId=0,ei.prototype._lastPollingRequest=0,ei.prototype._pollingEnabled=!0,ei.prototype._fieldCaching=!1,ei.prototype._timeSeriesExpansion=!0,ei.prototype._childDataField="",ei.prototype._topSection=!0,ei.prototype.dispose=function(){this.removeAllEventListeners(),this._autoLayoutTimer&&(clearInterval(this._autoLayoutTimer),this._autoLayoutTimer=0),this._pollingTimerId&&(clearTimeout(this._pollingTimerId),this._pollingTimerId=0),this.removeAllColumns(),this.removeAllRows(),this._sorter.dispose(),this._grid.dispose(),this._connector.reset(),this._sharedDataSource||(this._dt&&this._dt.dispose(),this._dv&&this._dv.dispose()),this._mainGrid=this._dt=this._dv=null,this._subs&&(this._subs.dispose(),this._subs=null)},ei.prototype.getElement=function(){return this._topNode},ei.prototype.removeEventListeners=ei.prototype.removeAllEventListeners,ei.prototype.listen=ei.prototype.addEventListener,ei.prototype.initSubscription=function(){if(!this._dc||this._dc.getSubscriptions())return;let t,e,i;if(t=window.JET,this._RTK?e=this._RTK.Quotes:t&&(e=t.Quotes2),e&&(i=e.create()),!i)return;i.filter&&i.filter(-2,-1),this._subs=i,this._subs.start(),this._dc.setSubscriptions(i),this._subs.addEventListener("postUpdate",this._onQuote2PostUpdate);let n=this._getAllRowDefinitions(),o=n.length;for(let t=0;t<o;++t){let e=n[t];e&&e.subscribeForUpdates()}},ei.prototype.updateLayout=function(){this._grid.updateLayout(),this._stp.updateSortSymbols()},ei.prototype._updateRowData=function(t){if(t>=0){let e=this._dv.getRowId(t);e&&this._dt.setRowData(e,{})}else this._dt.dispatchGlobalChange()},ei.prototype.updateRowData=ei.prototype._updateRowData,ei.prototype._addGridSections=function(){let t=this._grid.addSection("title");0==this._topSection?t.setRowCount(0):t.setRowCount(1),this._grid.addSection("content");let e=this._grid.getSectionSettings("title");e.disableDataBinding();let i=this._grid.getSectionSettings("content");i.setAutoSyncRowCount(!0),i.setParent(e)},ei.prototype.addHeaderSection=function(t){let e=this._grid.getAllSections("title"),i=this._grid.addSectionAt(e.length,"title",t);if(i){i.setRowCount(1),this._grid.getSectionSettings(i).disableDataBinding()}return i},ei.prototype.addFooterSection=function(t){let e=this._grid.addSection("footer",t);if(e){e.setRowCount(1),this._grid.getSectionSettings(e).disableDataBinding()}return e},ei.prototype.setParent=function(t){n.appendChild(t,this._topNode),this.updateLayout()},ei.prototype.insertBefore=function(t){if(t){let e=t.parentNode;e&&(e.insertBefore(this._topNode,t),this.updateLayout())}},ei.prototype.getRelativePosition=function(t){return this._grid.getRelativePosition(t)},ei.prototype.getCoreGrid=function(){return this._grid},ei.prototype.initialize=function(t){if(!t)return void this.initSubscription();let e=this;e._initializing=!0;let i=e._grid;i.resetInternalState();let n=(t=i.normalizeConfig(t)).plugins||t.extensions,o=t.fields||t.columns;t.defaultColumnOptions&&(e._defaultColumnOptions=t.defaultColumnOptions,e._defaultColumnSetup(e._defaultColumnOptions,o)),e._processExtension(n,"beforeInit",[i.getElement(),t]),t.textSelect&&(e._textSelect=!0,i.addClass("tr-text-select")),t.RTK&&(e._RTK=t.RTK,e._snapshot.setRTK(e._RTK)),t.ADC&&(e._ADCOptions=t.ADC,e._snapshot.setADCOptions(e._ADCOptions)),t.synapse&&(e._synapse=t.synapse,Tt.setSynapseConfig(e._synapse)),t.fieldCaching&&(e._fieldCaching=t.fieldCaching),null!=t.timeSeriesExpansion&&(e._timeSeriesExpansion=t.timeSeriesExpansion,Tt.disableTimeSeriesExpansion(!e._timeSeriesExpansion)),t.icons&&t.icons.rowGrouping&&t.icons.rowGrouping.expander&&(Ve.chainIcon=t.icons.rowGrouping.expander),t.formulaEngine&&(e._fnEngine=new tt,e._fnEngine.addEventListener("dataChanged",e._onFormulaDataChanged),e._fnEngine.addEventListener("dataRequired",e._onFormulaDataRequired));let r=t.borders;null!=r&&i.toggleBorders(r);let s=t.gridlines;null!=s&&i.toggleGridlines(s);let l=t.verticalLines;null!=l&&i.toggleVerticalLines(l);let a=t.contentVerticalLines;null!=a&&i.toggleContentVerticalLines(a);let u=t.horizontalLines;null!=u&&i.toggleHorizontalLines(u),t.pageSize&&e._dv.setPageSize(+t.pageSize);let h=+t.rowHeight;h&&i.setDefaultRowHeight(h);let p=+t.headerRowHeight;p&&i.getSection("title").setDefaultRowHeight(p);let d=t.autoLayoutUpdate;!e._autoLayoutTimer&&d&&"0"!==d&&"false"!==d&&(e._autoLayoutTimer=setInterval(e._onAutoLayoutUpdate.bind(e),2e3));let c=t.rowHighlighting;null!=c&&i.enableRowHighlighting(!!c);let f=t.rowExpansionBinding;"function"==typeof f&&(i.listen("rowExpansionBinding",e._onRowExpansionBinding),e.listen("rowExpansionBinding",f)),this.addListener(t,"dataComposed"),this.addListener(t,"beforeContentBinding"),this.addListener(t,"firstRendered"),this.addListener(t,"afterContentBinding"),t.autoDateConversion&&(e._autoDateConversion=!0),t.stepScroll&&i.setRowScrollingStep(1),t.linearWheelScrolling&&i.getVScrollbar().setMouseWheelSpeed("linear"),null!=t.autoHideScrollbar&&i.autoHideScrollbars(!!t.autoHideScrollbar),null!=t.scrollbarParent&&e._setScrollbarParent(t.scrollbarParent);let g=t.adcPollingInterval;null!=g&&(e._pollingInterval=g?+g:0),e.setColumns(o);let m=!0;null!=t.rowVirtualRendering&&(m=t.rowVirtualRendering),null!=t.rowVirtualization&&(m=t.rowVirtualization),i.enableRowVirtualization(!!m);let C=!1;null!=t.columnVirtualRendering&&(C=t.columnVirtualRendering),null!=t.columnVirtualization&&(C=t.columnVirtualization),i.enableColumnVirtualization(!!C),null==t.scrollbar||t.scrollbar?e._topNode.style.overflow="hidden":(i.freezeSection(null),e._topNode.style.overflow="");let v=t.topFreezingCount;if("number"==typeof v){v=v>0?v:0;let t=v-1;i.freezeSection(t)}else!1===v&&i.freezeSection(null);let S=t.bottomFreezingCount;if("number"==typeof S&&(S=S>0?S:0,i.freezeFooter(S)),e.addDataFields(t.dataFields),t[yt]=!0,Array.isArray(n)){for(let o=0;o<n.length;++o){let r=n[o],s=null;if(r){let e=r.name;s=e?i.loadPlugin(e,r):i.loadPlugin(r,t)}if(s&&s.setGridWrapper){"function"==typeof s.getGridApi&&s.getGridApi()||s.setGridWrapper("realTimeGrid",e)}}e._initializing=!1}let w=t.lang;null!=w&&(e._lang=w,e._dateTimeUtil.setLocale(w)),null!=t.childDataField&&(this._childDataField=Rt._childDataField=t.childDataField);let b=t.rows;b||(b=t.rics||null);let R=t.bodies;if(!R&&(R=[],t.body&&R.push(t.body),b)){for(let t=0;t<b.length;t++)"string"==typeof b[t]&&(b[t]={ric:b[t]});R.push({rows:b})}let I=t.staticDataRows||t.dataModel;if(b&&I){let t,i,n=I.data?I.data:I,o=I.fields||e.getColumnFields(),r=b.length;for(let e=0;e<r;e++)b[e].values?(t=y(b[e].values,o),i=y(n[e],o),b[e].values=_(t,i)):b[e].values=n[e];n=n.slice(r,n.length),I.data?I.data=n:I=n}for(let t=0;t<R.length;++t)e.insertRows(R[t].rows);e.addStaticDataRows(I),t.contentBottomPadding&&i.setBottomPaddingSection(t.contentBottomPadding);let D=t.contentRightPadding;D&&("number"!=typeof D&&(D=6),i.reserveRightSpace(D));let x=t.dataConflationRate;null!=x&&i.setDataConflationRate(x);let A=i.getPluginList().map(i.getPlugin.bind(i));e._processExtension(A,"afterInit"),e.initSubscription()},ei.prototype.getConfigObject=function(t){let e=t||{},i=e.columns;i||(i=e.columns=[]);let n,o,r,s=this._grid;for(s.getConfigObject&&s.getConfigObject(e),!1===e.columnVirtualization&&delete e.columnVirtualization,!0===e.rowVirtualization&&delete e.rowVirtualization,!0===e.rowHighlighting&&delete e.rowHighlighting,!1===e.contentVerticalLines&&delete e.contentVerticalLines,!1===e.borders&&delete e.borders,o=this.getColumnCount(),n=0;n<o;++n){let t=i[n];t||(t=i[n]={});let e=this.getColumnDefinition(n);e.getConfigObject(t);let o=Tt.getFieldProperty(e.getField(),"timeSeriesParent");o&&!r&&(r=o,t.field=o,delete t.name,delete t.autoGenerated),!o&&r&&(r=null)}e.columns=i=i.filter(Ke),""===this._topNode.style.overflow&&(e.scrollbar=!1);let l=this._dv.getPageSize();l>0&&(e.pageSize=l),l=s.getDefaultRowHeight(),28!==l&&(e.rowHeight=l),l=s.getSection("title").getDefaultRowHeight(),28!==l&&(e.headerRowHeight=l),this._autoLayoutTimer&&(e.autoLayoutUpdate=!0),l=g(this._defaultColumnOptions),l||(e.defaultColumnOptions=this._defaultColumnOptions),this._autoDateConversion&&(e.autoDateConversion=!0),this._textSelect&&(e.textSelect=!0),this._lang&&(e.lang=this._lang),this._fnEngine&&(e.formulaEngine=!0),this._pollingInterval&&(e.adcPollingInterval=this._pollingInterval),this._fieldCaching&&(e.fieldCaching=this._fieldCaching),1!=this._timeSeriesExpansion&&(e.timeSeriesExpansion=this._timeSeriesExpansion),this._childDataField&&(e.childDataField=this._childDataField);let a,u,h=this.getAllRowDefinitions(),p=e.rows=[];for(o=h.length,n=0;n<o;n++)a=h[n],u=a.getConfigObject(),p.push(u);let d,c,_=s.getPlugins();for(let t in _)if(d=_[t],"function"==typeof d.getRowConfigObject)for(o=p.length,n=0;n<o;n++)a=h[n],c=p[n],d.getRowConfigObject(c,a.getRowId());return e},ei.prototype.setDateTimeUtil=function(t){this._dateTimeUtil!==t&&(this._dateTimeUtil=t,this._dateTimeUtil.setLocale(this._lang))},ei.prototype.setLocale=function(t){t&&this._lang!==t&&(this._lang=t,this._dateTimeUtil.setLocale(t),this._grid.requestRowRefresh())},ei.prototype._defaultColumnSetup=function(t,e){let i=e.length;for(let n=0;n<i;n++){let i=e[n];if("object"==typeof i)for(let e in t)null==i[e]&&(i[e]=t[e])}},ei.prototype._processExtension=function(t,e,i){if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n][e]&&t[n][e].apply(t[n],i)},ei.prototype._onRicAdded=function(t){let e=t.addedRics;this._snapshot.addFields(t.fields);let i=e.length;for(let t=0;t<i;++t){let i=e[t],n=this._connector.getRowDefByRic(i),o=n?n.length:0;for(let t=0;t<o;++t){n[t].getSymbol()===i&&this._snapshot.addRic(i)}}this._dispatch(t.type,t)},ei.prototype._onRicRemoved=function(t){this._dispatch(t.type,t)},ei.prototype._onFieldAdded=function(t){let e=t.rowDefs,i=t.addedFields;for(let t in e)this._snapshot.addRic(e[t].getSymbol());if(this._snapshot.addFields(i),this._subs){let t=i.filter(Tt.isRealTimeField);t.length>0&&this._subs.addFields(t)}this._dispatch(t.type,t)},ei.prototype._onFieldRemoved=function(t){let e=t.removedFields;this._subs&&this._subs.removeFields(e),this._dispatch(t.type,t)},ei.prototype.insertColumn=function(t,e){let i=this.getColumnCount();(null==e||e>i)&&(e=i);let n=this._initializing?{}:f(this._defaultColumnOptions);if("string"==typeof t)n.field=t;else for(let e in t)n[e]=t[e];this._fnEngine&&(n.formulaEngine=this._fnEngine);let o=new Pt(n,this);n.COL_DEF=o,this._grid.insertColumn(e,n)},ei.prototype._updateTimeSeriesFields=function(t){let e,i,n,o,r,s,l=t.data,a={};for(let t in l){for(e in l[t])a[e]=!0;this.setRicData(t,l[t])}let u={};for(n in a)i=t.childrenFieldToParent[n],u[i]?u[i].push(n):u[i]=[n];for(i in u){let t,n,l=u[i];for(o=this.getColumnIndex(i),r=this._getColumnDefinition(o),n=l.length,t=0;t<n;t++)e=l[t],s=this.getColumnIndex(e),s<0&&(o=this.getColumnIndex(i),r=this._getColumnDefinition(o),this._cloneTimeSeriesColumn(r,e,o),Tt.addTimeSeriesChild(i,e));this.removeColumn(i)}},ei.prototype._populateTimeSeriesChildren=function(t){if(this._timeSeriesChildConflator.conflate(t))return;let e,i,n,o,r,s=this._timeSeriesChildConflator.popAllData();for(e=0;e<s.length;e++){if(t=s[e],r=this.getColumnIndex(t),!t)continue;let l=t.getField(),a=Tt.getTimeSeriesChildren(l);if(!a)return;if(n=a.length,n<1)return;for(i=0;i<n;i++)r=this.getColumnIndex(t),o=a[i],this._cloneTimeSeriesColumn(t,o,r)}},ei.prototype._cloneTimeSeriesColumn=function(t,e,i){let n,o;n=t.getConfigObject(),o=f(n),o.field=e.replace("TR.",""),o.name=e.split("_")[1].split("T")[0],o.parent=t,o.timeSeriesName=t.getName(),o.timeSeriesId=t.getId(),this.insertColumn(o,i++)},ei.prototype.replaceColumn=function(t,e){let i=this.getColumnIndex(e);if(i<0)return;let n={},o=this._grid,r=o._getColumnDef(i),s=o.getColumnScalability(i);if(n.scalable=s,s=o.getColumnCustomLaneSize(i),n.width=s,s=o.getMinimumColumnWidth(i),s>0&&(n.minWidth=s),s=o.getColumnVisibility(i,0),s||(n.hidden=!0),s=r.stationary,s&&(n.stationary=s),s=r.leftPinned,s&&(n.leftPinned=s),s=r.rightPinned,s&&(n.rightPinned=s),"string"==typeof t)n.field=t;else for(let e in t)n[e]=t[e];t.width&&!t.scalable&&(n.scalable=!1),t.scalable&&!t.width&&(n.width=1);let l=this.getColumnDefinition(i);l&&null==n.id&&(n.id=l.getId()),this._grid.startBatch("reset"),this.removeColumn(i),this.insertColumn(n,i),this._grid.stopBatch("reset")},ei.prototype._onFieldLoadedSuccess=function(t,e,i){if(i&&i.id){let n=i;e&&e.getField()===t&&e.isDefaultName()&&n.name&&(e.setName(n.name),this.updateColumnTitle())}},ei.prototype._onFieldLoadedError=function(t){},ei.prototype._onFieldLoaded=function(t,e){if(Tt.isTimeSeries(t)){let t=this.getColumnDefinitionById(e);this._populateTimeSeriesChildren(t)}this._connector.addFields(t,e)},ei.prototype._setScrollbarParent=function(t){t.style.boxSizing="border-box",t.style.overflow="hidden",t.style.position="relative",this._topNode.style.height="100%",this._grid.autoHideScrollbars(!1),this._grid.getVScrollbar().attachToExternalElement(t),this._grid.getHScrollbar().attachToExternalElement(t)},ei.prototype.getFieldInfo=function(t){return Tt.getFieldInfo(t)},ei.prototype.loadFieldInfo=function(t){return Tt.loadFieldInfo(t)},ei.prototype._shouldLoadFieldInfo=function(t){let e=this._RTK||window.JET;return!!e&&(!!this._fieldCaching&&(e=Tt.hasFieldInfo(t),!e&&(e=Tt.isAdc(t)||Tt.isRealTimeField(t),!!e)))},ei.prototype.setColumns=function(t){let e=this._grid,i=t?t.length:0;if(e.startBatch("reset"),this.removeAllColumns(),i>0){let n=!1;i>1&&(n=e.freezeLayout(!0));for(let e=0;e<i;++e)this.insertColumn(t[e],e);i>1&&e.freezeLayout(n)}e.stopBatch("reset")},ei.prototype.restoreColumns=function(t,e){let i=this._grid;i.startBatch("reset");let n,o,r,s=this.getConfigObject().columns,l=s.length,a=t.length,u=e?ti:C,h=[],p=[],d=[];for(n=0;n<l;n++){for(r=!1,o=0;o<a;o++)if(u(s[n],t[o])){p.push(s[n]),r=!0;break}r||h.push(n)}this.removeColumns(h);let c=p.length,_=!1;for(a>1&&(_=this._grid.freezeLayout(!0)),n=0;n<a;n++){for(r=!1,o=0;o<c;o++)if(u(t[n],p[o])){r=!0;let e=this.getColumnIndex(t[n].id||t[n].field);d.push(this.getColumnId(e));break}r||(this.insertColumn(t[n],n),d.push(this.getColumnId(n)))}a>1&&this._grid.freezeLayout(_),i.reorderColumns(d),i.stopBatch("reset")},ei.prototype.setFields=ei.prototype.setColumns,ei.prototype._onColumnAdded=function(t){let e=t.context.COL_DEF;delete t.context.COL_DEF;let i=t.colIndex,n=this._grid._getColumnDef(i);e._setCoreColumnDef(n);let o=this._grid.getColumnData(i);o||(o=this._grid.setColumnData(i,{})),o.COL_DEF=e;let r=e.getUserModel();this._grid.setColumnDataBindingHandler(i,e.getRenderer());let s=r.width;if(void 0!==s){let t;s=+s,t=null!=r.scalable?!!r.scalable:s!=s,this._grid.setColumnWidth(i,s,t)}else this._grid.setColumnWidth(i,1,!0);s=r.minWidth,s>=0&&this._grid.setMinimumColumnWidth(i,s),s=r.hidden,s&&this._grid.hideColumn(i,!0),s=r.textAlign||r.alignment,"string"==typeof s&&this._grid.setColumnAlignment(i,s),r.keepModel||e.clearUserModel(),e.isTextSelect()&&this._grid.enableColumnClass(i,"tr-text-select",!0,"content");let l,a=e.getClasses();for(l=0;l<a.length;l++)this._grid.enableColumnClass(i,a[l]);let u=e.getField();this._grid.setDataColumnName(i,yt);let h,p,d,c,_=e.getAllFields(),f=e.getId(),g=_.length;for(l=0;l<g;l++)h=_[l],this._shouldLoadFieldInfo(h)?(p=h===u?e.getDataType():Pt.getDataType(h),d=Tt.loadFieldInfo(h).then(this._onFieldLoadedSuccess.bind(this,h,e)).catch(this._onFieldLoadedError),p?(e.isTimeSeries()&&this._populateTimeSeriesChildren(e),this._connector.addFields(h,f)):(c=this._onFieldLoaded.bind(this,h,f),d=d.then(c).catch(c))):(e.isTimeSeries()&&this._populateTimeSeriesChildren(e),this._connector.addFields(h,f))},ei.prototype.removeColumn=function(t){let e=this.getColumnIndex(t);if(e<0)return;let i=this.getColumnDefinition(e);i.isRealTimeField()||this._dc&&this._dc.removeStaticFields([i.getField()]),this._grid.removeColumnAt(e),this._connector.removeFields(i),i.dispose()},ei.prototype.removeColumns=function(t){let e=this.getColumnIndices(t),i=e.length;if(i<=1)return void(1===i&&this.removeColumn(e[0]));e.sort(ei._descendingOrder);let n=[],o=this._grid.freezeLayout();for(let t=0;t<i;++t){let i=e[t],o=this.getColumnDefinition(i);o.isRealTimeField()||n.push(o.getField()),o.dispose(),this._grid.removeColumnAt(i),this._connector.removeFields(o)}n.length&&this._dc&&this._dc.removeStaticFields(n),this._grid.freezeLayout(o)},ei.prototype.removeAllColumns=function(){let t=this.getColumnCount();if(!(t<=0)){this._sharedSorter||this.clearSort();for(let e=t;--e>=0;){this._grid.setColumnDataBindingHandler(e,null),this.getColumnDefinition(e).dispose()}this._columnTitleConflator.reset(),this._timeSeriesChildConflator.reset(),this._connector.removeAllFields(),this._grid.setColumnCount(0),this._dc&&this._dc.resetStaticFields()}},ei.prototype.moveColumn=function(t,e){return this._grid.moveColumn(t,e)},ei.prototype.moveColumnById=function(t,e){return this._grid.moveColumnById(t,e)},ei.prototype.reorderColumns=function(t,e){return this._grid.reorderColumns(t,e)},ei.prototype.hideColumn=function(t,e){let i=this.getColumnIndex(t);i<0||this._grid.hideColumn(i,e)},ei.prototype.hideColumns=function(t,e){this._grid.hideColumns(this.getColumnIndices(t),e)},ei.prototype.showAllColumns=function(){this._grid.showAllColumns()},ei._descendingOrder=function(t,e){return e-t},ei.prototype.addDataFields=function(t,e){if(!t)return!1;let i,n,o,r,s,l=Array.isArray(t)?t:[t],a=l.length;for(i=0;i<a;i++)n=l[i],this._shouldLoadFieldInfo(n)?(o=Pt.getDataType(n),r=Tt.loadFieldInfo(n).catch(this._onFieldLoadedError),o?this._connector.addFields(n,e||"grid"):(s=this._onFieldLoaded.bind(this,n,e),r=r.then(s).catch(s))):this._connector.addFields(n,e||"grid");return!0},ei.prototype.removeDataFields=function(t,e){return!!t&&(this._connector.removeFields(t,e||"grid"),!0)},ei.prototype.removeFieldReferrer=function(t){t&&this._connector.removeFieldReferrer(t)},ei.prototype.sortColumn=function(t,e){if("string"==typeof t)return void this._stp.sortColumn(t,e);let i=this.getColumnIndex(t);i<0?this._stp.sortColumn(this.getSortedColumnIndex(),"n"):this._stp.sortColumn(i,e)},ei.prototype.setColumnName=function(t,e){let i=this.getColumnDefinition(t);i&&(i.setName(e),this.updateColumnTitle())},ei.prototype.setColumnRenderer=function(t,e){let i=this.getColumnIndex(t);this.setColumnFormatter(i,e)},ei.prototype.activateColumnRenderer=function(t,e,i){let n=this.getColumnIndex(t);if(null==n)return;let o=this.getColumnDefinition(n);o&&(o.activateRenderer(e,i),this._grid.setColumnDataBindingHandler(n,o.getRenderer()),this._grid.requestRowRefresh())},ei.prototype.setColumnFormatter=function(t,e){if(null==t)return;let i=this.getColumnDefinition(t);if(!i)return;let n=null;if(e&&("object"==typeof e?("function"==typeof e.init&&e.init(i.getConfigObject(),this._grid),n=e.binding):n=e,"function"!=typeof n&&(n=null)),n!==i.getRenderer()){let e=this._grid.getSection("content").getColumn(t);e&&e.clearContent(),this._grid.setColumnDataBindingHandler(t,null),i.setRenderer(n),this._grid.setColumnDataBindingHandler(t,i.getRenderer()),this._grid.requestRowRefresh()}},ei.prototype.setColumnSorter=function(t,e){let i=this.getColumnIndex(t),n=this.getColumnDefinition(i);if(n){n.setSorter(e),this.getSortedColumnIndex()===i&&this._stp.refresh()}},ei.prototype._initDuplicateRicData=function(t){let e=t.getSymbol(),i=this._connector.getRowDefByRic(e);i&&i.length&&function(t,e){let i=qe(t),n=qe(e);for(let t in i)Xe[t]||(n[t]=i[t])}(i[0],t)},ei.prototype.insertRow=function(t,e){if(this._mainGrid)return this._mainGrid.insertRow(t,this._getRowId(e));t&&("string"==typeof t?t={ric:t}:Array.isArray(t.values)&&(t.fields||(t.fields=this.getColumnFields())));let i=new Rt(t);return i.setDataSource(this._dc),this._initDuplicateRicData(i),i.registerToView(this._dv,this._getRowId(e)),t&&t.hidden&&this._dv.hideRow(i.getRowId()),this._connector.addRic(i),i},ei.prototype.insertRows=function(t,e,i){if(this._mainGrid)return void this._mainGrid.insertRows(t,this._getRowId(e));if(!Array.isArray(t))return;let n=this._dt.freeze(),o=i||this.getColumnFields(),r=this._getRowId(e),s=t.length;for(let e=0;e<s;++e){let i=t[e];i&&("string"==typeof i&&(i={ric:i}),i.fields=o),this.insertRow(i,r)}this._dt.freeze(n)},ei.prototype.addStaticDataRows=function(t,e){if(this._mainGrid)this._mainGrid.addStaticDataRows(t,e);else{if(!Array.isArray(t)){let i=t;t=null,i&&(i.fields&&!e&&(e=i.fields),Array.isArray(i.data)&&(t=i.data))}t&&this.insertRows(t.map(ei._dataToRowOptions),null,e)}},ei.prototype.updateDataSet=function(t,e){if(!Array.isArray(t)||0===t.length)return void this.removeAllRows();let i,n,o,r,s=t.length,l={},a=this.getAllRowDefinitions(),u=a.length,h=!1;if(e){for(h=this._dt.freeze(),r=0;r<u;r++)i=a[r],i&&(n=i.getRowData()[e],n||0===n?l[n]=i:this.removeRow(i));let p={},d={};for(r=s-1;r>=0;r--)o=t[r],n=o[e],i=l[n],d[n]=o,o.ROW_ORDER=r,p[n]||(p[n]=!0,i?i.setRowData(o):this.insertRow({values:o}));for(let t in l)l[t]&&!d[t]&&this.removeRow(l[t]);this._dt.sortOnce(yt,"a",Je,"ROW_ORDER"),this._dt.freeze(h)}else{for((s-u>1||u-s>1)&&(h=this._dt.freeze()),r=0;r<u;r++)o=t[r],o?l[r]=a[r]:this.removeRow(a[r]);for(r=0;r<s;r++)o=t[r],i=l[r],i?i.setRowData(o):this.insertRow({values:o});(s-u>1||u-s>1)&&this._dt.freeze(h)}},ei._dataToRowOptions=function(t){return{values:t}},ei.prototype.removeRow=function(t){if(this._mainGrid)return this._mainGrid.removeRow(this._getRowId(t));let e=this._getRowDefinitionByRef(t);return e&&(e.isAutoGenerated()||this._removeRow(e)),e},ei.prototype.removeRows=function(t){let e,i;if(!Array.isArray(t))return e=this.removeRow(t),e?[e]:[];if(this._mainGrid)return this._mainGrid.removeRows(t.map(this._getRowId));let n=[],o=t.length;for(i=0;i<o;++i)e=this._getRowDefinitionByRef(t[i]),e&&(e.isAutoGenerated()||n.push(e));o=n.length;let r=!1;for(o>1&&(r=this._dt.freeze()),i=0;i<o;++i)this._removeRow(n[i]);return o>1&&this._dt.freeze(r),n},ei.prototype.removeAllRows=function(){if(this._sharedDataSource)return;if(!this._dt.getRowCount())return;let t=this._getAllRowDefinitions();this._sharedDataSource||(this._dc.clearAllData(),this._dt.clearAllData(),this._clearDataUpdates()),t.forEach(Rt.dispose),this._streamingConflator.reset(),this._formulaConflator.reset(),this._chainConflator.reset(),this._connector.removeAllRics(),this._grid.getVScrollbar().setScrollTop(0)},ei.prototype._removeRow=function(t){if(this._sharedDataSource)return;this._dispatch("beforeRowRemoved",{});let e=this._connector,i=this._dt,n=t.getDescendants();if(n){for(let t=0;t<n.length;t++)e.removeRic(n[t]);let t=n.map(Rt.toRowId);i.removeRows(t)}e.removeRic(t),i.removeRow(t.getRowId()),t.dispose()},ei.prototype.hideRow=function(t,e){let i=this._getRowId(t);(this._mainGrid||this._grid).hideRow(i,e)},ei.prototype.hideRows=function(t,e){Array.isArray(t)||(t=[t]);let i=t.map(this._getRowId);(this._mainGrid||this._grid).hideRows(i,e)},ei.prototype.showRows=function(t,e){this.hideRows(t,!1===e)},ei.prototype.unhideAllRows=function(){this._grid.unhideAllRows()},ei.prototype.hasHiddenRow=function(){return this._grid.hasHiddenRow()},ei.prototype.setRic=function(t,e,i){if(this._mainGrid)return void this._mainGrid.setRic(this._toRowId(t),e,i);let n=this._getRowDefinitionByRef(t);if(n){var o=i||{};"string"==typeof e?o.ric=e:(e&&!i&&(o=e),e=o.ric?o.ric:"");let t=Rt.extractRowOptions(o),r=n.getSymbol();n.setContent(e,t)&&(this._connector.removeRic(n,r),this._initDuplicateRicData(n),this._connector.addRic(n));let s=o.values;null!=s&&n.setStaticRowData(s,o.fields)}},ei.prototype.unlinkChain=function(t){let e=this._getRowDefinitionByRef(t);e&&e.isChain()&&e.unlinkChain()},ei.prototype.setRowContent=ei.prototype.setRic,ei.prototype.toggleRowExpansion=function(t,e){this._dv.toggleRowExpansion(t,e)},ei.prototype._onRowExpansionBinding=function(t){if(this.hasListener("rowExpansionBinding")){if(t.originalRowId){let e=this._dv.getRowIndex(t.originalRowId);t.originalRowDef=this._getRowDefinitionByIndex(e),t.originalRowData=t.originalRowDef.getRowData()}else t.rowDef=this._getRowDefinitionByIndex(t.rowIndex),t.rowData=t.rowDef.getRowData();this._dispatch("rowExpansionBinding",t)}},ei.prototype.setRics=function(t){this.removeAllRows(),t&&t.length&&this.insertRows(t)},ei.prototype.getRowCount=function(){return this._dv.getRowCount()},ei.prototype.getPageItemCount=function(){return this._dv.getRowCount(!1,!0)},ei.prototype.getDataRowCount=function(){return this._dt.getRowCount()},ei.prototype.getColumnCount=function(){return this._grid.getColumnCount()},ei.prototype.getColumnDataType=function(t){let e=this.getColumnDefinition(t);return e?e.getDataType():""},ei.prototype.getColumnDefinition=function(t){let e=this._grid.getColumnData(t);return e&&e.COL_DEF||null},ei.prototype.getColumnDefinitions=function(){let t=this.getColumnCount(),e=new Array(t);for(let i=0;i<t;i++)e[i]=this.getColumnDefinition(i);return e},ei.prototype.getColumnDefinitionById=function(t){return"string"==typeof t?this.getColumnDefinition(this.getColumnIndex(t)):null},ei.prototype.getColumnDefinitionsById=function(t){let e=Array.isArray(t)?t.length:0;if(e>0){let i,n,o=new Array(e);for(i=0;i<e;i++)n=t[i],o[i]=this.getColumnDefinitionById(n);return o}return null},ei.prototype._getColumnDefinition=function(t){if(t instanceof Pt)return t;if("number"==typeof t)return this.getColumnDefinition(t);if("string"==typeof t){let e=this.getColumnCount();for(let i=0;i<e;++i){let e=this.getColumnDefinition(i);if($e(e,t))return e}}return null},ei.prototype.getRowType=function(t){let e=this.getRowDefinition(t);return e?e.getType():""},ei.prototype.getRowDefinition=function(t){return"number"==typeof t?this._getRowDefinitionByIndex(t):"string"==typeof t?this._getRowDefinitionById(t):null},ei.prototype._getRowDefinitionByIndex=function(t){return this._dv.getDataAt(t,yt)||null},ei.prototype._getRowDefinitionById=function(t){return this._dt.getData(t,yt)||null},ei.prototype._getRowDefinitionByRef=function(t){return t instanceof Rt&&t.getRowId()?t:this.getRowDefinition(t)},ei.prototype.getRowDefinitions=function(){return this._dv.getColumnData(yt,!0)},ei.prototype._getAllRowDefinitions=function(){return this._dt.getColumnData(yt)},ei.prototype.getAllRowDefinitions=function(t){return t?this._getAllRowDefinitions():this._dt.getColumnData(yt).filter(je)},ei.prototype.getRowData=function(t){return qe(this._getRowDefinitionByIndex(t))},ei.prototype.getMultipleRowData=function(t){if("number"==typeof t)return[this.getRowData(t)];let e=null;if(Array.isArray(t)){let i=t,n=i.length,o=new Array(n);e=this.getRowDefinitions();for(let t=0;t<n;++t){let n=i[t];"number"==typeof n?o[t]=qe(e[n]):n&&n.getRowData&&(o[t]=qe(n))}return o}return e=t&&t.getColumnData?t.getColumnData(yt,!1):this.getRowDefinitions(),e.map(qe)},ei.prototype.setRicData=function(t,e){let i=this._connector.getRowDefByRic(t),n=i?i.length:0;for(let o=0;o<n;++o){let n=i[o];n&&n.getSymbol()===t&&n.setRowData(e)}},ei.prototype.setRowData=function(t,e){let i=this._getRowDefinitionByRef(t);i&&i.setRowData(e)},ei.prototype.setStaticRowData=function(t,e){let i=this._getRowDefinitionByRef(t);i&&i.setStaticRowData(e)},ei.prototype.setStaticData=function(t,e,i){let n=this._getRowDefinitionByRef(t);n&&n.setStaticData(e,i)},ei.prototype._getRowId=function(t){return"string"==typeof t?t:"number"==typeof t?this._dv.getRowId(t):t instanceof Rt?t.getRowId():""},ei.prototype.getColumnIndex=function(t){if(t&&t instanceof Pt){let e=this.getColumnCount();for(let i=0;i<e;++i){if(this.getColumnDefinition(i)===t)return i}return-1}return this._grid.getColumnIndex(t)},ei.prototype.getColumnIndices=function(t){let e=[],i=this.getColumnCount(),n=Array.isArray(t)?t:[t],o=n.length;for(let t=0;t<o;++t){let o=this.getColumnIndex(n[t]);o>=0&&o<i&&e.push(o)}return e},ei.prototype.getColumnId=function(t){return this._grid.getColumnId(t)},ei.prototype.getColumnIds=function(){return this._grid.getColumnIds()},ei.prototype.getColumnField=function(t){return this._grid.getColumnField(t)},ei.prototype.getColumnFields=function(){return this._grid.getColumnFields()},ei.prototype.getColumnNames=function(){return this.getColumnDefinitions().map(Ze)},ei.prototype.getAllFields=function(){return this._connector.getAllFields()},ei.prototype.freezeColumn=function(t,e){null==t&&(t=-1),this._grid.freezeColumn(t,e)},ei.prototype.pinColumn=function(t,e){if(Array.isArray(t)){let i=t,n=i.length,o=0;for(let t=0;t<n;++t)o|=this._pinColumn(i[t],e);return!!o}return this._pinColumn(t,e)},ei.prototype._pinColumn=function(t,e){let i=this.getColumnIndex(t),n=this.getColumnCount();if(i<0||i>n)return!1;let o=this._grid.getPinnedLeftColumnCount(),r=this._grid.getPinnedRightColumnCount(),s=this._grid.getStationaryColumnIndex();if(e&&"right"===e.toLowerCase()){let t=this._grid.getFirstPinnedRightIndex();if(i>=t)return!1;if(s>=0&&i<=s)return!1;this.moveColumnById(i,t),r+=1,o-=1}else{if(i<o)return!1;o||s>=0&&(o=s,i>s&&o++),this.moveColumnById(i,o)}return this._grid.freezeColumn(o,r),!0},ei.prototype.unpinColumn=function(t,e){if(Array.isArray(t)){let i=t,n=0;for(let t=i.length;--t>=0;)n|=this._unpinColumn(i[t],e);return!!n}return this._unpinColumn(t,e)},ei.prototype._unpinColumn=function(t,e){let i=this.getColumnIndex(t);if(i<0)return!1;let n=this._grid.getPinnedLeftColumnCount(),o=this._grid.getPinnedRightColumnCount(),r=this.getColumnCount()-o;if(i>=n&&i<r)return!1;let s=null,l=null;if(null!=e){let t=this.getColumnIndex(e);l=this.getColumnId(t),s=this.getColumnId(i)}let a=this._grid.getStationaryColumnIndex();return i<n?(i>a&&this.moveColumnById(i,n),this._grid.freezeColumn(n-2,o)):i>=r&&(i>a&&this.moveColumnById(i,r),this._grid.freezeColumn(n-1,o-1)),i>a&&null!=l&&this.moveColumnById(s,l),!0},ei.prototype.unpinAllColumns=function(){let t=this._grid.getPinnedLeftColumnCount(),e=this._grid.getPinnedRightColumnCount();return!(!t&&!e)&&(this._grid.freezeColumn(-1,0),!0)},ei.prototype._onColumnHeaderBinding=function(t){if("title"!==t.sectionType||t.sectionIndex>0)return;let e=t.fromColIndex,i=t.toColIndex;for(;e<i;)this._renderColumnHeader(e++,t)},ei.prototype._renderColumnHeader=function(t,e){let i=this.getColumnDefinition(t);if(!i)return;let n=i.getHeaderRenderer(),o=e.section,r=o.getRowCount();e.colIndex=t,e.columnDef=i;let s=i.getName(),l=i.getTooltip(),a=i.getHeaderAlignment();for(let i=0;i<r;++i){let r=o.getCell(t,i,!1);r.setContent(s),r.setTooltip(l),r.setStyle("textAlign",a),n&&(e.rowIndex=i,e.cell=r,n(e))}},ei.prototype.updateColumnTitle=function(){if(this._columnTitleConflator.conflate())return;let t=this._grid.getSectionSettings("title");t&&t.rerender()},ei.prototype.isSorting=function(){return this._stp.isSorting()},ei.prototype.getSortedColumnIndex=function(){return this._stp.getSortedColumnIndex()},ei.prototype.getSortOrder=function(){return this._stp.getSortOrder()},ei.prototype.clearSort=function(){this._stp.clearSortState()},ei.prototype._onQuote2PostUpdate=function(t){t.childOrderChange&&(this.isSorting()||this._dt.sortOnce("ROW_DEF","a",Qe))},ei.prototype._onDataChanged=function(t){let e=t.rowData;if(!e)return;let i=e[yt];if(i){if(i.getRowId()){this._dc.getRowData(t.rid)?(i.addUpdate(t)&&(this._dt._hasNewUpdates=!0),this._updateStreamingData()):i.isAutoGenerated()&&(i.setParent(null),this._removeRow(i))}return}let n=e.SUB_ID;if(n){let i=this._getRowDefinitionById(n);i&&i.getRic()!==e.RIC&&(this._chainMembers||(this._chainMembers={}),this._chainMembers[t.rid]||(this._chainMembers[t.rid]=e,this._addMemberOfChain(e)))}},ei.prototype._addMemberOfChain=function(t){if(this._chainConflator.conflate(t))return;let e,i=this._chainConflator.popAllData(),n=i?i.length:0,o=!1;n>1&&(o=this._dt.freeze());let r=[];for(e=0;e<n;++e){let n=(t=i[e]).SUB_ID,o=this._getRowDefinitionById(n);if(o){let e=o.addConstituent(t.RIC,this._dt);e&&r.push(e)}}this._chainMembers=null;let s=r.length;if(s)for(e=s;--e>=0;)this._connector.addRic(r[e]);n>1&&this._dt.freeze(o)},ei.prototype._updateStreamingData=function(){this._streamingConflator.conflate()||this._dt&&(this._dt.classifySegments(),this._dt.dispatchGlobalChange())},ei.prototype._onPreDataSorting=function(t){let e=this._stp.getSortedColumns();if(this._sorter.reset(),Array.isArray(e)){let t=e.length;for(let i=0;i<t;++i){let t=e[i],n=t.field||"",o=t.colIndex,r=o>=0?this.getColumnDefinition(o):null,s=!1,l=null;r&&(n=r.getField(),s=r.isRowSorting(),l=r.getSorter()),this._sorter.addColumnContext(n,l,s,t.sortOrder,o,r)}}this._columnSorter=this._sorter.getSorter()},ei.prototype._mainSorter=function(t,e,i){return this._columnSorter(t,e,i)},ei.prototype._onPostSectionDataBinding=function(t){t.actualUpdate&&this._asyncClearDataUpdates()},ei.prototype._asyncClearDataUpdates=function(){setTimeout(this._clearDataUpdates,0)},ei.prototype._clearDataUpdates=function(){if(!this._dt||!this._dt._hasNewUpdates)return;let t=this._dt.getAllRowIds(!0);for(let e=t.length;--e>=0;){this._dt.getRowData(t[e])[yt].resetUpdates()}},ei.prototype.getDataView=function(){return this._dv},ei.prototype.setPage=function(t){return this._dv.setPage(t)},ei.prototype.setPageSize=function(t){this._dv.setPageSize(t)},ei.prototype.getPageIndex=function(){return this._dv.getPageIndex()},ei.prototype.getPageSize=function(){return this._dv.getPageSize()},ei.prototype.getPageCount=function(){return this._dv.getPageCount()},ei.prototype.toggleChain=function(t){let e=this._getRowDefinitionByRef(t);e&&e.toggleChain()},ei.prototype.setClassification=function(t,e){let i=this._getRowDefinitionByRef(t);return!!i&&this._dt.setSegmentClassification(i.getRowId(),e)},ei.prototype.contains=function(t){return!!t&&this._topNode.contains(t)},ei.prototype.isFocused=function(){let t=document.activeElement;return t&&t.shadowRoot?t.shadowRoot===this._topNode.parentNode:this.contains(t)},ei.prototype.focus=function(){this._grid.focus()},ei.prototype.requestRowRefresh=function(){this._grid.requestRowRefresh()},ei.prototype.updateLayout=function(){this._grid.updateLayout()},ei.prototype.getExtension=function(t){return t?this._grid.getPlugin(t.replace(/Extension/gi,"")):null},ei.prototype._onFormulaDataChanged=function(t){this._formulaConflator.conflate()||(this._recalculateFormulas(),this._updateRowData())},ei.prototype._onFormulaDataRequired=function(t){},ei.prototype._onDataComposed=function(t){let e=t.changes;if(!e)return;let i=t.rowData;if(!i)return;let n=i[yt];if(n&&n.getDataSource()){if(this._autoDateConversion){let t,i,o,r;for(t in e)r=this._getColumnDefinition(t),o=r?r.getDataType():Pt.getDataType(t),"datetime"===o&&(i=e[t],n.setData(t+"_RAW",i),i=B.toDateObject(i),n.setData(t,i))}this.hasListener("dataComposed")&&(t.grid=this,t.rowDef=n,this._dispatch("dataComposed",t)),this._recalculateFormulas(t)}},ei.prototype._onSubSegmentChanged=function(t){let e,i=t.insertionList,n=t.removalList,o=t.removedRows,r=n.length,s=null;for(e=0;e<r;e++){let t=o[n[e]];t&&(s=t[yt],s&&(s.dispose(),t[yt]=null))}let l=i.length;for(e=0;e<l;e++){let t=i[e].getId();s=new Rt({segmentId:t}),s.setDataSource(this._dc),s.registerToView(this._dv)}},ei.prototype._recalculateFormulas=function(t){if(this._fnEngine&&!(this._fnEngine.getFormulaCount()<=0))if(t&&t.rid)this._fnEngine.calculate(t.rowData,t.changes);else{let t=this._dc?this._dc.getAllRowData():null,e=t?t.length:0;for(let i=0;i<e;++i)this._fnEngine.calculate(t[i])}},ei.prototype._snapshotFillerDataChanged=function(t){if(!this._dt)return;let e=t.data;if(t.timeSeries)this._updateTimeSeriesFields(t);else for(let t in e)this.setRicData(t,e[t]);this._lastPollingRequest||(this._lastPollingRequest=1),this._startPolling()},ei.prototype._startPolling=function(){if(this._pollingEnabled&&this._pollingInterval&&this._lastPollingRequest&&!this._pollingTimerId){let t=new Date;this._lastPollingRequest=t.getTime(),this._pollingTimerId=setTimeout(this._onPollingInterval,this._pollingInterval)}},ei.prototype._onPollingInterval=function(){this._pollingTimerId=0,this._pollingEnabled&&this._pollingInterval&&(this.refreshADCData(),this._startPolling())},ei.prototype.activateADCPolling=function(t){if(!1!==t){this._pollingEnabled=!0;let t=new Date;if(this._lastPollingRequest){t.getTime()-this._lastPollingRequest>this._pollingInterval&&this.refreshADCData()}this._startPolling()}else this._pollingEnabled=!1},ei.prototype.refreshADCData=function(){let t=this._snapshot.addFields(this._connector.getAllFields());return!(!t||(t=this._snapshot.addRics(this._connector.getAllRics()),!t))||(this._lastPollingRequest=0,!1)},ei.prototype._onAutoLayoutUpdate=function(){let t=this._topNode.clientWidth;t!==this._clientWidth&&(this._clientWidth=t,this.updateLayout())},ei.prototype.logDT=function(t){let e=this._getAllRowDefinitions();this._logData(e,t)},ei.prototype.logDV=function(t){let e=this.getRowDefinitions();this._logData(e,t)},ei.prototype._logData=function(t,e){e||(e={}),e.colNames||(e.colNames=this.getColumnFields());let i=ut.constructTable(t.map(qe),e);console.table(i)},ei.prototype.replaceRow=function(t,e){let i=this._getRowId(t),n=this._getRowDefinitionById(i);if(n){if(n.isAutoGenerated())return null;let t=n.getConfigObject();if(n.getRowId()===e.rowId)return null;if(C(t,e))return null}let o=this.insertRow(e,i);return n&&this.removeRow(i),o},ei.prototype.scrollToColumn=function(t,e){return this._grid.scrollToColumn(t,e)},ei.prototype.scrollToRow=function(t,e){this._grid.scrollToRow("content",t,e)},ei.prototype.getScrollLeft=function(){return this._grid.getScrollLeft()},ei.prototype.getScrollTop=function(){return this._grid.getScrollTop()},ei.prototype.setScrollLeft=function(t){this._grid.setScrollLeft(t)},ei.prototype.setScrollTop=function(t){this._grid.setScrollTop(t)},ei.prototype.scrollRight=function(t){this._grid.scrollRight(t)},ei.prototype.scrollDown=function(t){this._grid.scrollDown(t)},ei.prototype.getScrollWidth=function(){return this._grid.getScrollWidth()},ei.prototype.getScrollHeight=function(){return this._grid.getScrollHeight()},ei.prototype.getVScrollView=function(){return this._grid.getVScrollView()};let ii={texts:["If a dog and cat had a baby together that grew up and worked a desk job he'd be a Cog in the machine","I'm still upset that Tie Domi didn't name his child Tyson","A tagline for a car company that prides itself on its morals and ethics: Take the High Road","Logan Broger is amazing and a wonderful boy according to Logan's mom","You know the Grammys are a joke when Future doesn't win Best Everything","If you were a member of the Bloods and became paralyzed do you then become a member of the Crips?","Curling is the best sport named after something you do to your hair","You say potatoe, I say starchy carbs","If you work for an ad agency and getting paid for it aren't you the one who is being influenced by advertising?","Are there Out of Stock photos? Gafuffle","I think of a lot of good ideas when going to the bathroom I guess I have a real stream of consciousness","Most streets are two way streets","Why does that make love so special?","A tagline for an airline: Take the High Road","Rumour has it targeted online advertising was developed because the internet was upset that you could read it but it couldn't read you","This is a true fact: I never had a fear of heights until I fell off a roof","A tagline for a special highway that is easy to navigate while under the influence of drugs: Take the High Road","I'm the only person in the world with my name","We need more werkin and less twerkin if you ask me","If Fantasy Hockey actually lived up to its name, every team would have Henrik Lundqvist and Joffrey Lupul on it","I'm in a band that does Metallica covers with our private parts it's called Myphallica","Smiling could easily be misinterpreted for showing your teeth to someone because they said something that made you happy","We say we are walking the dog, but the dog always leads","Tim Horton was a hockey player but is the name of a coffee chain, which means my dream of a goat sanctuary being my legacy is not unrealistic","I started a sensory deprivation chamber business it involves really dark curtains, ear plugs, and a sleeping mask","Do we make money or does money make us? Chezwich","Pantone is a colour but also the singular version of pants","Logan Ipsum will loop at some point","Thank you for using my words in your work","You should listen to my mixtape (check out the rest of my portfolio)","I have never known a Jack that was in good enough shape to name bodybuilding after him","Twitter is the rice of social media","Injuries always keep you OUT of things","For the name of an act as serious as killing someone, assassination literally translates to buttbuttination","Why don't we call glasses duocles","If you wake up with a giant zit, you are really facing your fears when you look in the mirror","Cemeteries are just garbage dumps filled with humans","I have a moral code, but I haven't figured out how to read it yet","I bet most serial killers play the drums","To Catch A Predator would have been a great name for a Steve Irwin show","If the word kerning is kerned poorly, it kind of looks like learning which is appropriate because both are important","North America should be called Russia since people are always moving so fast","I don't need a big house, just a two floor condo you could say I have lofty expectations","Even faithful and simple Sancho is forced to deceive him at certain points","The novel is considered a satire of orthodoxy, veracity and even nationalism","In exploring the individualism of his characters, Cervantes helped move beyond the narrow literary conventions of the chivalric romance literature that he spoofed","which consists of straightforward retelling of a series of acts that redound to the knightly virtues of the hero","The character of Don Quixote became so well known in its time that the word quixotic was quickly adopted by many languages","Characters such as Sancho Panza and Don Quixote's steed, Rocinante, are emblems of Western literary culture","It stands in a unique position between medieval chivalric romance and the modern novel","The former consist of disconnected stories featuring the same characters and settings with little exploration of the inner life of even the main character"]};ii.words=ii.texts.join(" ").split(" ").filter((function(t){return t.length>1})),ii.companyName=["Yost-Prohaska","Wehner, Howe and Brown","Gusikowski-Legros","Wolff-Windler","McGlynn, Douglas and Kilback","MacGyver Group","Spinka, Stracke and Huel","Howell, Wolff and Emmerich","Blick-O'Reilly","Dibbert, Buckridge and Leffler","Skiles, Kuhlman and Johns","Daugherty Group","Reilly, Toy and Bayer","Bradtke, Mohr and Weber","Thompson, Bruen and Friesen","Rempel-Bednar","Kunze LLC","Pfannerstill Group","Moen-Larkin","Larson LLC","Haag-Feest","Hauck-Bartell","Rohan-Kohler","Waters, Homenick and Pagac","Ziemann Group","Reynolds, Turcotte and Bosco","Graham, Morar and Waters","Cassin Inc","Bosco-Terry","Stanton-Blick","Prohaska and Sons","Pouros, Daugherty and Pfannerstill","Bogan-Cormier","O'Kon-Mills","Mueller-Schmeler","Runte-Trantow","Muller Inc","Shanahan, Ryan and Orn","Huel LLC","Shanahan-Zulauf","Emard-Schuster","Muller Inc","Collier, Muller and Yundt","Wehner, Prohaska and Harber","Ondricka-Stehr","Towne LLC","Feil Inc","Braun, Kihn and Treutel","Ebert-MacGyver","Harris LLC"],ii.industry=["Specialty Chemicals","Office Equipment/Supplies/Services","Electric Utilities: Central","Trucking Freight/Courier Services","Auto Parts:O.E.M.","Oil Refining/Marketing","Biotechnology: Biological Products (No Diagnostic Substances)","Computer Software: Programming, Data Processing","Farming/Seeds/Milling","Biotechnology: Laboratory Analytical Instruments","Finance: Consumer Services","Major Banks","Investment Managers","Oilfield Services/Equipment","Paper","Transportation Services"],ii.market=["NYSE","NASDAQ","SET","DJI","HSCEI","HKEX","NIKKEI"],ii.country=[{name:"Afghanistan",code:"AF"},{name:"land Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Cote D'Ivoire",code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:"Korea, Democratic People'S Republic of",code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:"Lao People'S Democratic Republic",code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montenegro",code:"ME"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia",code:"RS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}];var ni=ii;let oi=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10],ri={X_RIC_NAME:{type:"string"},CF_NAME:{type:"string",prefix:!0,suffix:" Name"},CF_LAST:{type:"number",min:.01,max:1e3,prec:2},PCTCHNG:{type:"number",min:-1,max:1,prec:2,suffix:"%"},PCTCHNG2:{type:"float",min:-20,max:20,prec:2,suffix:"%"},CF_CURR:{fixedValue:"USD"},INDICATOR:{type:"number",min:0,max:5},CF_TICK:{type:"number",min:1,max:3,changeOnly:!0},PRCTCK_1:{type:"set",members:["⇧","B⇧","↑","B↑","26","1",'"1"',"-1","⇩","B⇩","↓","B↓","27","2",'"2"']},CF_NETCHNG:{type:"number",min:-100,max:100},CF_VOLUME:{type:"number",min:0,max:1e7},RI_FLAG:{type:"set",members:["R","Q","I","_",""]},RI_CODE:{type:"number",min:0,max:2},STATUS:{type:"number",min:0,max:6},YRLOW:{type:"number",min:0,max:20},YRHIGH:{type:"number",min:200,max:2e3},CFLOW:{type:"number",min:0,max:20},CFHIGH:{type:"number",min:200,max:2e3},LOW_YLD:{type:"set",members:[void 0,0,1,2,3,4,5,10,11,15,20]},HIGH_YLD:{type:"set",members:[void 0,200,300,400,500,1e3,1500,2e3]},CF_YIELD:{type:"set",members:[void 0,0,10,20,30,40,50,100,200,300,400,500]},"TR.IPODate":{type:"isoDate",min:Date.now()-63072e6,max:Date.now()},"TR.Volume":{type:"number",min:2e3,max:1e7},"TR.Price52WeekHigh":{type:"number",min:100,max:300,prec:2},"TR.Price52WeekLow":{type:"number",min:1,max:200,prec:2},"TR.InvalidField":{type:"set",members:[void 0]},percent:{type:"number",min:0,max:101},number_1:{type:"number",min:1,max:100},number_2:{type:"number",min:-100,max:100},index4:{type:"number",min:0,max:4},index5:{type:"number",min:0,max:5},index10:{type:"number",min:0,max:10},index100:{type:"number",min:0,max:100},group3:{type:"set",members:["Group_A","Group_B","Group_C"]},group4:{type:"set",members:["Group_1","Group_2","Group_3","Group_4"]},float_1:{type:"float",min:0,max:1,prec:2},float_2:{type:"float",min:0,max:100,prec:2},float_3:{type:"float",min:-1,max:1,prec:2},precision4:{type:"float",min:-10,max:10,prec:4},precision8:{type:"float",min:-100,max:100,prec:8},boolean:{type:"boolean"},date:{type:"date",min:15e11,max:16e11},date1:{type:"function",generate:function(t,e){return null==e?_i(6e11,16e11,e):new Date(1e12+1e9*e)}},ISODate:{type:"isoDateObject",min:Date.now()-63072e6,max:Date.now()},word:{type:"string",min:1,max:1},phrase:{type:"string",min:2,max:5},words:{type:"string",min:1,max:20},words1:{type:"string",min:2,max:8},words2:{type:"string",min:3,max:10},words3:{type:"string",min:5,max:15},sentence:{type:"string",min:8,max:20},id:{type:"function",hash:0,generate:function(t,e){return null==e&&(e=null!=t._id?t._id:-1,t._id=++e),e||0}},companyName:{type:"set",members:ni.companyName},industry:{type:"set",members:ni.industry},market:{type:"set",members:ni.market},country:{type:"set",members:ni.country}},si=function(t,e){if(t){let i=e;"function"==typeof e&&(i={type:"function",generate:e}),ri[t]=i}},li=function(t){return"number"==typeof t?function(t){let e=1e4*Math.sin(113*t);return e*=e,e-(0|e)}(t):Math.random()},ai=function(t,e,i,n){t||(t=0),null==e&&(e=100);let o=(e-t)*li(n)+t;if(i>0){let t=oi[i];return Math.floor(o*t)/t}return null!=i?Math.floor(o):o},ui=function(t,e,i){return ai(t,e+1,0,i)},hi=function(t,e,i){return ai(t,e,0,i)},pi=function(t,e){return hi(0,t,e)},di=function(t){return 0===ui(0,1,t)},ci=function(t,e){if(t){return t[pi(t.length,e)]}return String.fromCharCode(ui(65,90,e))},_i=function(t,e,i){(t=t||Date.now()-63072e6)instanceof Date&&(t=t.getTime()),(e=e||Date.now())instanceof Date&&(e=e.getTime());let n=ui(0,(e-t)/1e3,i);return new Date(t+1e3*n)},fi=function(t,e,i){let n=t<e?hi(t,e,i):t,o=new Array(n);for(let t=0;t<n;++t){null!=i&&(i*=1.17*(t+1));let e=pi(ni.words.length,i);o[t]=ni.words[e]}return o.join(" ")},gi=function(t,e,i){let n=mi(t,e,i),o=n.value+"";return n.prefix&&("string"==typeof n.prefix?o=n.prefix+o:e.prefix&&(o=e.prefix+" "+o)),n.suffix&&(o+=n.suffix),"string"===n.type&&(n.value=o),n.formattedValue=o,n},yi=function(t,e,i){let n={},o=0;e&&("number"==typeof e?o=n.numRows=e:(n=e,o=e.numRows||e.numRow||e.rowCount,null!=e.seed&&-1===(i=e.seed)&&(i=null))),o||(o=1),t?Array.isArray(t)||(t=[t+""]):t=[""];let r=t.length,s=[];for(let n=0;n<o;++n){let n=[];for(let o=0;o<r;++o){let r=t[o];n.push(mi(r,e,i).value)}null!=i&&++i,s.push(n)}return{data:s,seed:i,fields:t}},mi=function(t,e,i){let n=function(t){return ri[t]||{}}(t);if(n.type||(n.type="number",si(t,n)),n.fixedValue)return n.value=o,n;null!=i&&(null==n.hash&&(n.hash=function(t){let e=0,i=t?t.length:0;for(;--i>=0;)e+=t.charCodeAt(i)*(i+.9879);return e}(t)),i+=n.hash);let o,r=null!=n.min?n.min:100,s=null!=n.max?n.max:1e4;if("string"===n.type)o=null!=n.min||null!=n.max?fi(r,s,i):e&&e.text||"";else if("set"===n.type)o=ci(n.members,i);else if("date"===n.type)o=_i(r,s,i);else if("isoDate"===n.type){o=_i(r,s,i).toISOString().slice(0,10)}else if("isoDateObject"===n.type)o=_i(r,s,i),o=new Date(o.toISOString().slice(0,10));else if("boolean"===n.type)o=di(i);else if("function"===n.type)n.field=t,o=n.generate(n,i);else{let t=null!=n.prec?n.prec:0;o=ai(r,s,t,i)}return n.value=o,n},Ci=function(t){this._seed=null!=t?t:null};Ci.prototype._seed=null,Ci.prototype.generate=function(t,e){let i=yi(t,e,this._seed);return this._seed=i.seed,i.data},Ci.prototype.generateRecords=function(t,e){let i=yi(t,e,this._seed);this._seed=i.seed;let n=(t=i.fields).length,o=i.data;for(let e=o.length;--e>=0;){let i=o[e],r={};for(let e=0;e<n;++e){r[t[e]]=i[e]}o[e]=r}return o},Ci.prototype.generateQuoteData=function(t,e){let i=gi(t,e,this._seed);return null!=this._seed&&++this._seed,i},Ci.prototype.getSeed=function(){return this._seed},Ci.prototype.setSeed=function(t){"number"==typeof t&&(this._seed=t)},Ci.prototype.randBetween=function(t,e){let i=hi(t,e,this._seed);return null!=this._seed&&++this._seed,i},Ci.prototype.randInt=function(t,e){let i=ui(t,e,this._seed);return null!=this._seed&&++this._seed,i},Ci.prototype.randIndex=function(t){let e=pi(t,this._seed);return null!=this._seed&&++this._seed,e},Ci.prototype.randNumber=function(t,e,i){let n=ai(t,e,i,this._seed);return null!=this._seed&&++this._seed,n},Ci.prototype.randBoolean=function(){let t=di(this._seed);return null!=this._seed&&++this._seed,t},Ci.prototype.randMember=function(t){let e=ci(t,this._seed);return null!=this._seed&&++this._seed,e},Ci.prototype.randDate=function(t,e){let i=_i(t,e,this._seed);return null!=this._seed&&++this._seed,i},Ci.prototype.randString=function(t,e){let i=fi(t,e,this._seed);return null!=this._seed&&++this._seed,i},Ci.seed=null,Ci.generate=function(t,e){let i=yi(t,e,Ci.seed);return Ci.seed=i.seed,i.data},Ci.generateRecord=function(t,e,i){Array.isArray(t)||(t=[t+""]);let n={};null!=e&&("number"==typeof e?i=e:e&&(n=e));let o=t.length,r={};for(let e=0;e<o;++e){let o=t[e];r[o]=mi(o,n,i).value}return r},Ci.generateRecords=function(t,e){let i=yi(t,e,Ci.seed);Ci.seed=i.seed;let n=(t=i.fields).length,o=i.data;for(let e=o.length;--e>=0;){let i=o[e],r={};for(let e=0;e<n;++e){r[t[e]]=i[e]}o[e]=r}return o},Ci.addFieldInfo=si,Ci.randNumber=ai,Ci.randInt=ui,Ci.randBetween=hi,Ci.randIndex=pi,Ci.randBoolean=di,Ci.randMember=ci,Ci.randDate=_i,Ci.randString=fi,Ci.toRecords=function(t,e){if(!Array.isArray(t))return null;Array.isArray(e)||(e=e?[e+""]:[]);let i=t.length,n=new Array(i);for(let o=0;o<i;++o){let i=n[o]={},r=t[o],s=r&&r.length||0;for(let t=0;t<s;++t){let n=r[t];if(void 0!==n){let o=e[t];o||0===o||(o=t+""),i[o]=n}}}return n};let vi=function(){};vi.prototype.create=function(t){return new Si(t)};let Si=function(t){this._onRowUpdated=this._onRowUpdated.bind(this),this._fieldMap={},this._prevData={},this.id=null!=t?t+"":"_sub"+Si._runningId++};Si.prototype._rics=null,Si.prototype._isChain=!1,Si.prototype._fieldMap=null,Si.prototype._prevData=null,Si.prototype._updateHandler=null,Si.prototype._updateTimerId=0,Si.prototype._updateInterval=1e3,Si._runningId=0,Si.prototype.formattedFields=function(t){for(let e=t.length;--e>=0;)this._fieldMap[t[e]]=!0;return this},Si.prototype.rawFields=function(t){for(let e=t.length;--e>=0;)this._fieldMap[t[e]]=!0;return this},Si.prototype.chain=function(t){return this._rics=Array.isArray(t)?t[0]:[t],this._isChain=!0,this},Si.prototype.rics=function(t){return this._rics=Array.isArray(t)?t:[t],this},Si.prototype.start=function(){return this._onRowUpdated(),this},Si.prototype.stop=function(){return this._updateTimerId&&(clearInterval(this._updateTimerId),this._updateTimerId=0),this},Si.prototype.onNewRow=function(t){return this},Si.prototype.onUpdate=function(t){return this._updateHandler=t,this},Si.prototype.onRemoveRow=function(t){return this},Si.prototype._onRowUpdated=function(){if(!this._updateHandler)return;let t,e=this._rics?this._rics.length:0;if(1===e)t=this._rics[0],this._updateHandler(this,t,this._getUpdateData(t));else for(let i=0;i<e;++i)pi(3)||(t=this._rics[i],this._updateHandler(this,t,this._getUpdateData(t)));this._updateTimerId||(this._updateTimerId=setInterval(this._onRowUpdated,this._updateInterval))},Si.prototype._getUpdateData=function(t){let e={id:this.id},i={text:t};for(let t in this._fieldMap){let n=gi(t,i),o=n.value,r=n.formattedValue;n.changeOnly&&this._prevData[t]===o||(this._prevData[t]=o,e[t]={raw:o,formatted:r||o+""})}return e};let wi=function(){this._dict={}};wi.prototype._dict,wi.prototype._count=0,wi.prototype.addItem=function(t,e){if(t&&null!=e){let i=this._dict[t];return i?i.push(e):this._dict[t]=[e],++this._count,!0}return!1},wi.prototype.addItems=function(t,e){if(t){if(!Array.isArray(e))return this.addItem(t,e);let i=e?e.length:0;if(i){let n=this._dict[t];return n||(n=this._dict[t]=[]),Array.prototype.push.apply(n,e),this._count+=i,!0}}return!1},wi.prototype.removeItem=function(t,e){let i=this._dict[t];if(i){let n=i.indexOf(e);if(n>=0)return i.length>1?i.splice(n,1):delete this._dict[t],--this._count,!0}return!1},wi.prototype.removeItemsByKey=function(t){let e=this._dict[t];return!!e&&(delete this._dict[t],this._count-=e.length,!0)},wi.prototype.removeAllItems=function(){return!!this._count&&(this._dict={},this._count=0,!0)},wi.prototype.getItems=function(t){return this._dict[t]||null},wi.prototype.getAllItems=function(){if(this._count>0){let t=[],e=this._dict;for(let i in e)Array.prototype.push.apply(t,e[i]);return t}return null},wi.prototype.getItemCount=function(t){if(t){let e=this._dict[t]||null;return e?e.length:0}return this._count},wi.prototype.getAllKeys=function(){return Object.keys(this._dict)};let bi=function(t,e){return t.ric+"_"+e.ric},Ri=function(t){let e=t.match(/\./g);return!!e&&e.length>1},Ii=function(t){let e,i,n,o=t;for(e=o.length-1;e>0;e--)i=Math.floor(Math.random()*(e+1)),n=o[e],o[e]=o[i],o[i]=n;return o.forEach(Di),o=o.sort(xi),o},Di=function(t,e){t.CHILD_ORDER=e},xi=function(t,e){return t.CHILD_ORDER-e.CHILD_ORDER},Ai=function(){};Ai.prototype._lastSub=null,Ai.prototype._configObj=null,Ai.prototype.config=function(t){t&&(this._configObj=t),this._lastSub&&this._configObj&&this._lastSub.config(this._configObj)},Ai.prototype.create=function(t){return this._lastSub=new Li(t||this._configObj),this._lastSub},Ai.prototype.isSkipHeaderSupported=function(){return!0},Ai.prototype.setUpdateInterval=function(t,e){this._lastSub?this._lastSub.setUpdateInterval(t,e):(this._configObj||(this._configObj={}),this._configObj.minInterval=t,this._configObj.maxInterval=e)},Ai.prototype.setPercentageDataUpdate=function(t){this._lastSub?this._lastSub.setPercentageDataUpdate(t):(this._configObj||(this._configObj={}),this._configObj.percentageDataUpdate=t)};let Li=function(t){this._onSubscriptionResponse=this._onSubscriptionResponse.bind(this),this._subMap={},this._dataMap=new wi,this._fields={},this._events={},this._dataGen=new Ci,this.config(t)};Li.prototype._minInterval=750,Li.prototype._maxInterval=850,Li.prototype._percentageDataUpdate=.1,Li.prototype.config=function(t){if(!t)return;let e=t.minInterval;"number"==typeof e&&(this._minInterval=e,this._minInterval>this._maxInterval&&(this._maxInterval=this._minInterval)),e=t.maxInterval,"number"==typeof e&&(this._maxInterval=e,this._minInterval>this._maxInterval&&(this._minInterval=this._maxInterval)),e=t.percentageDataUpdate,"number"==typeof e&&(this._percentageDataUpdate=e/100)},Li.prototype.setUpdateInterval=function(t,e){"number"==typeof t&&(this._minInterval=t),"number"==typeof e&&(this._maxInterval=e)},Li.prototype.setPercentageDataUpdate=function(t){"number"==typeof t&&(this._percentageDataUpdate=Math.round(t/100))},Li.prototype.setSeed=function(t){this._dataGen.setSeed(t)},Li.prototype.addRic=function(t,e){return this._addSymbol(t,!1,e)},Li.prototype.addChain=function(t,e){return this._addSymbol(t,!0,e)},Li.prototype.addFields=function(t){if(!t)return;"string"==typeof t&&(t=[t]);let e=t.length;for(let i=0;i<e;++i)this._fields[t[i]]=!0},Li.prototype.removeSubscription=function(t){let e=this._subMap[t];if(e&&(this._dispatch("subscriptionRemoved",{subs:[e]}),delete this._subMap[t],this._dataMap.removeItem(e.ric,e),e.chain)){let t=e.children,i=t.length;for(let n=0;n<i;++n){let i=t[n];this._dataMap.removeItem(bi(e,i),i),i.parent=null}e.children=null,e.ricList=null}},Li.prototype.removeRic=Li.prototype.removeSubscription,Li.prototype.removeChain=Li.prototype.removeSubscription,Li.prototype.removeAllSubscriptions=function(){let t=this._working;if(this.stop(),this._hasListener("subscriptionRemoved")){let t=[];for(let e in this._subMap)t.push(this._subMap[e]);t.length>0&&this._dispatch("subscriptionRemoved",{subs:t})}this._subMap={},this._dataMap.removeAllItems(),t&&this.start()},Li.prototype.removeFields=function(t){"string"==typeof t&&(t=[t]);let e=t.length;for(let i=0;i<e;++i){let e=t[i];this._fields[e]&&delete this._fields[e]}},Li.prototype.removeAllFields=function(){let t=!1;for(let e in this._fields){t=!0;break}t&&(this._fields={})},Li.prototype.start=function(){this._working=!0,this._connect()},Li.prototype.stop=function(){this._working=!1,this._timerId&&(window.clearTimeout(this._timerId),this._timerId=0)},Li.prototype.dispose=function(){this.stop(),this._subMap=null,this._dataMap&&(this._dataMap.removeAllItems(),this._dataMap=null),this._fields=null,this._events=null},Li.prototype.addEventListener=function(t,e){if(!e)return;let i=this._events[t];i?i.indexOf(e)<0&&i.push(e):this._events[t]=[e]},Li.prototype.removeEventListener=function(t,e){let i=this._events?this._events[t]:null;if(!i)return;let n=i.indexOf(e);n>=0&&i.splice(n,1)},Li.prototype.removeAllEventListeners=function(){this._events={}},Li.prototype.getSubscription=function(t){return this._subMap[t]||null},Li.prototype.getRic=function(t){let e=this._subMap[t];return e?e.ric:""},Li.prototype.getAllFields=function(){return this._fields},Li.prototype.hasField=function(t){return this._fields[t]||!1},Li.prototype.filter=function(t,e){return this};let Ti=function(t,e){for(let i in t)e[i]=t[i];return e};Li.prototype._addSymbol=function(t,e,i){if(!t)return null;if(i||0===i)i+="";else do{i="_"+this._runningSubId+++"_"}while(this._subMap[i]);if(this._subMap[i])return window.console.log("WARNING: Cannot add ric with duplicate id"),null;e&&(t=t.replace("0#",""));let n={};n.ric=t,n.chain=e,n.id=i,n.dataId=i+t,this._subMap[i]=n,this._dataMap.addItem(t,n);let o=this._dataMap.getItems(t),r=o.length;this._dispatch("subscriptionAdded",{subs:[n]});let s,l=null,a=0;if(e)if(1===r)for(n.children=[],a=Li.simpleDigest(t)%10+4,s=0;s<a;++s)l={},l.ric="Child_"+String.fromCharCode(65+s),l.id=i,l.dataId=i+l.ric,l.parent=n,n.children.push(l),l.CHILD_ORDER=s,this._dataMap.addItem(bi(n,l),l);else{let t=o[0].children;for(a=t.length,n.children=new Array(a),s=0;s<a;++s)l={},l.ric=t[s].ric,l.id=i,l.dataId=i+l.ric,l.parent=n,n.children[s]=l,this._dataMap.addItem(bi(n,l),l)}return r>1&&this._working&&setTimeout(this._updateDuplicateSymbol.bind(this,t),10),this._connect(),i},Li.simpleDigest=function(t){let e=t.length,i=0;for(let n=0;n<e;++n)i+=t.charCodeAt(n);return i},Li.prototype._connect=function(){if(this._working&&!this._timerId){let t=this._dataGen.randInt(this._minInterval,this._maxInterval);this._timerId=window.setTimeout(this._onSubscriptionResponse,t)}},Li.prototype._onSubscriptionResponse=function(){this._timerId=0;let t=this._dataMap.getAllKeys(),e=t?t.length:0;if(!e)return void this._connect();let i=(this._percentageDataUpdate-.02)*e;i=i>0?i:1;let n=(this._percentageDataUpdate+.02)*e;n=n<e?n:e;let o=this._dataGen.randInt(i,n),r=this._fields;for(let i=0;i<o;i++){let i,n,o,s=t[this._dataGen.randIndex(e)],l=this._dataMap.getItems(s),a=l[0],u=a.parent,h=this._dataGen.randBoolean();if(Ri(s)&&u&&h){let t=u.children;t=Ii(t);let e=t.length,s=t.indexOf(a);for(a.CHILD_ORDER=s,i=this._generateQuoteData(a,r),o=l.length,n=0;n<o;++n){for(let o=0;o<e;o++){let e=t[o];if(l[n]===e)i.CHILD_ORDER=e.CHILD_ORDER,this._dispatchDataChanged(l[n],i);else{let t=e.CHILD_ORDER;this._dispatchDataChanged(e,{X_RIC_NAME:e.ric,CHILD_ORDER:t})}}this._dispatchPostUpdate({childOrderChange:!0})}}else for(i=this._generateQuoteData(a,r),o=l.length,n=0;n<o;++n){let t=l[n].CHILD_ORDER;null!=t&&(i.CHILD_ORDER=t),this._dispatchDataChanged(l[n],i)}}this._connect()},Li.prototype._dispatchPostUpdate=function(t){this._dispatch("postUpdate",t)},Li.prototype._generateQuoteData=function(t,e){let i=t.ric,n=t.prevData,o={},r={text:i,prefix:t.parent?t.parent.ric:""};for(let t in e){let e=this._dataGen.generateQuoteData(t,r),i=t+"_FORMATTED";if(n){if(e.changeOnly&&n[t]===e.value)continue;n[t]=e.value,n[i]=e.formattedValue}o[t]=e.value,o[i]=e.formattedValue}return null!=o.X_RIC_NAME&&null!=o.INDICATOR&&o.INDICATOR>0&&(o.X_RIC_NAME="/"+o.X_RIC_NAME),o},Li.prototype._getChildSubByRic=function(t,e){let i=t.children;if(i){let t=i.length;for(let n=0;n<t;++n){let t=i[n];if(t.ric===e)return t}}return null},Li.prototype._updateDuplicateSymbol=function(t){let e=this._dataMap.getItems(t);if(!e)return;let i=e.length;if(i<2)return;let n,o=e[0],r=o.prevData,s=!!o.chain;if(r)for(n=1;n<i;++n){let t=e[n];t.prevData||this._dispatchDataChanged(t,r)}if(!s)return;let l=o.ricList;if(!l)return;let a=l.length;for(n=1;n<i;++n){let t=e[n],i=t.ricList;for(let e=i?i.length:0;e<a;++e){let i=l[e],n=this._getChildSubByRic(o,i),r=this._getChildSubByRic(t,i);n&&r&&n.prevData&&this._dispatchDataChanged(r,n.prevData)}}},Li.prototype._dispatchDataChanged=function(t,e){let i=Ti(e,{}),n={};n.ric=t.ric,n.values=i,n.subId=t.id;let o=t.prevData;if(!o){o={},t.prevData=o,n.type="statusUpdated",i.STATUS=1,i.STATUS_FORMATTED=this._statusMap[1],i.SUB_ID=t.id,Ti(i,o);let e=t.parent;if(e){let i=e.ricList;i||(i=e.ricList=[]),e.ricList.push(t.ric)}}this._dispatch("dataChanged",n)},Li.prototype.onFeedStatusChanged=function(t,e){return window.setTimeout((function(){e([{key:"Q",name:"IDN_RDF",state:"up"}])}),1e3),this},Li.prototype._hasListener=function(t){let e=this._events[t];return!!e&&e.length>0},Li.prototype._dispatch=function(t,e){let i=this._events[t];if(!i)return;let n=i.length;for(let t=0;t<n;++t)i[t](e)},Li.prototype._subMap=null,Li.prototype._fields=null,Li.prototype._events=null,Li.prototype._working=!1,Li.prototype._timerId=0,Li.prototype._runningSubId=0,Li.prototype._statusMap={0:"PENDING",1:"OK",2:"STALE",3:"INFO",4:"CLOSED",5:"DELAYED",6:"NOPERM",7:"REACHLIMIT",8:"C_COMPLETE",9:"C_CLOSE",10:"C_EMPTY",11:"C_NOTCHAIN",12:"C_ERR",13:"C_NOBEGIN",14:"C_NOEND"};let Ei=function(){this._data={}};Ei.prototype._data=null,Ei.prototype.clear=function(){this._data={}},Ei.prototype.put=function(t,e){t&&(this._data[t]=e)},Ei.prototype.get=function(t){let e=this._data[t];return null!=e?e:""},Ei.prototype.getAllKeys=function(){return Object.keys(this._data)},Ei.prototype.save=function(){},Ei.prototype.filter=function(t){let e=[];if(t)for(let i in this._data){let n=this._data[i];t(n)&&e.push(n)}return e};let Mi={"TR.NonExistField":!0,"TR.NotExistField":!0,CF_IGNORE_FIELD:!0};let Fi=new Ci,Pi={request:function(t,e){if(e)return Promise.resolve(JSON.stringify(e));let i,n,o,r,s,l,a,u,h,p=[];if("Col,date|,Row,In|,va,T,NoEmptyTickers"===t.output){for(l=t.identifiers,a=t.formula.trim().split(/(?=,TR.)/),u=[],h=Mi,i=0;i<a.length;i++)n=a[i],h[n]||u.push(n);let e=u.length;p.push([{h:!0,i:"instrument",v:"Instrument"},{h:!0,i:"date",v:"Date"}]);for(let t=0;t<e;t++){let e,n=u[t],o=/TR.(.*)(?=\()/,r=n.match(o)[0].replace("TR.",""),a=n.toLowerCase(),h=/sdate=(.*)[,]/,d=/edate=(.*)[)]/,c=a.match(h),_=a.match(d),f=c?c[1]:B.format(new Date,"YYYY-MM-DD"),g=_[1];f>g&&(e=f,f=g,g=e);let y=(+new Date(g)-+new Date(f))/864e5;for(i=0;i<=y;i++){let e=new Date(new Date(f).setDate(new Date(f).getDate()+i)),n={h:!0,v:B.format(e,"YYYY-MM-DDT00:00:00")};0===t&&p[0].push(n)}let m=l;for(i=0;i<m.length;i++){let t=[m[i],r];for(s=1;s<=y+1;s++){let e=Ci.generateRecord(r);t.push(e[r])}p.push(t)}}}else{for(l=t.identifiers,a=Pi.splitFields(t.formula),u=[],h=Mi,i=0;i<a.length;i++)n=a[i],h[n]||u.push(n);for(p[0]=[{h:!0,i:"instrument",v:"Instrument"}],i=0;i<u.length;i++)n=u[i],p[0].push({h:!0,r:n.toUpperCase().trim()});let e={};o=l.length;let s=Fi.generate(u,o);for(i=0;i<o;++i){let t=l[i];r=e[t],r||(r=e[t]=s[i],r.unshift(t)),p.push(r)}if(p.length>0){if(Fi.randInt(1,10)<=3){let t=Fi.randInt(0,p.length-1);r=p[t],o=r.length;let e=new Array(o);for(e[0]=r[0],i=1;i<o;i++)e[i]="";p.splice(t+1,0,e)}}}return Promise.resolve(JSON.stringify({rows:p}))},splitFields:function(t){if(!t)return[];let e=t.split(/,(?![^()]*\))/);return e=e.map((function(t){return t.trim()})),e}},zi=new Ci,Vi={request:function(t,e){if(e)return Promise.resolve(JSON.stringify(e));let i,n,o,r,s=t.instruments,l=t.fields,a=Mi;for(l=[],i=0;i<t.fields.length;i++)n=t.fields[i],a[n.name]||l.push(n);let u={};o=s.length;let h=[],p=zi.generate(l,o);for(i=0;i<o;++i){let t=s[i];r=u[t],r||(r=u[t]=p[i],r.unshift(t)),h.push(r)}if(h.length>0){if(zi.randInt(1,10)<=3){let t=zi.randInt(0,h.length-1);r=h[t],o=r.length;let e=new Array(o);for(e[0]=r[0],i=1;i<o;i++)e[i]="";h.splice(t+1,0,e)}}let d=[{displayName:"Instrument"}];for(i=0;i<l.length;i++)n=l[i],d.push({displayName:n.name,field:n.name.toUpperCase()});return Promise.resolve(JSON.stringify({data:h,headers:[d]}))}},ki=function(t){return"datagrid"===t?Promise.resolve(Vi):"adc"===t?Promise.resolve(Pi):Promise.reject(t+" is not supported.")};ki.setInvalidFields=function(t){if(t&&"string"==typeof t)Mi[t]=!0;else if(Array.isArray(t))for(let e=0;e<t.length;e++)Mi[t[e]]=!0};let Oi=function(t){this.Quotes=new vi,this.Quotes2=new Ai,this.Archive=new Ei,this.ContainerDescription=!0,this.Data=ki,t&&this.Quotes2.config(t)};Oi.prototype.init=function(t){return t&&this.Quotes2.config(t),this},Oi.prototype.onLoad=function(t){return setTimeout(t,2e3),this},Oi.prototype.navigate=function(t){return this},Oi.prototype.appHit=function(t,e,i){},Oi.prototype.getUserInfo=function(){return Promise.resolve({UUID:"PAXTRA"})},Oi.prototype.contextChange=function(t){};let Ni={"⇧":1,"B⇧":1,"↑":1,"B↑":1,26:1,1:1,'"1"':1,"-1":-1,"⇩":-1,"B⇩":-1,"↓":-1,"B↓":-1,27:-1,2:-1,'"2"':-1},Hi={CF_TICK:1,PRCTCK_1:1,BID_TICK:1,ASK_TICK:1};let Bi={"||":1,"&&":2,"<":3,">":3,"<=":3,">=":3,"!=":3,"=":3,"==":3,"===":3,"+":4,"-":4,"*":5,"%":6,"/":6,"!":7,"!!":7},Gi={"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"<":function(t,e){return t<e},">":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"!":function(t,e){return!t},"!!":function(t,e){return!!t}},Wi={"+":2,"-":2,"*":2,"/":2,"%":2,"<":2,">":2,"<=":2,">=":2,"==":2,"!=":2,"&&":2,"||":2,"!":1,"!!":1},Ui=function(t,e,i,n){let o={value:e,type:i};return n&&(o.dataType=n),"operator"===i?o.precedence=Bi[e]:"parenthesis"===i&&(o.precedence=0),t.push(o),t.length-1},Yi={_tokens:[],_withString:function(t){return" #"+Ui(Yi._tokens,t.substring(1,t.length-1),"literal","string")+"#"},_withField:function(t){return" #"+Ui(Yi._tokens,t,"literal","variable")+"#"},_withFieldInBrackets:function(t){return Yi._withField(t.substring(1,t.length-1))},_withNegativeNumber:function(t){let e=+t;if(e==e){return" #"+Ui(Yi._tokens,e,"literal","number")+"#"}return""},_withPositiveNumber:function(t){return 35===t.charCodeAt(0)?t:Yi._withNegativeNumber(t)},_withOperator:function(t){if(Bi[t]){return"="!=t&&"==="!=t||(t="=="),"#"+Ui(Yi._tokens,t,"operator")+"#"}return""},_withParenthesis:function(t){return"#"+Ui(Yi._tokens,t,"parenthesis")+"#"},_tester:function(t){let e=t._rpn,i=e.length,n=0,o=0;for(let t=0;t<i;++t){let i=e[t];if("literal"!==i.type){let t=Wi[i.value];if(!(n>=t))return console.warn("Cannot parse an expression with insufficient number of operands"),!0;n-=t}n++,n>o&&(o=n)}return 1!==n||(t._stackSize=o,!1)},_filter:function(t,e){let i,n=t._rpn,o=new Array(t._stackSize),r=n.length,s=0;for(let t=0;t<r;++t){let r=n[t],l=r.value;"literal"===r.type?i="variable"!==r.dataType?l:e?e[l]:null:1===Wi[l]?(i=Gi[l](o[s-1]),s-=1):(i=Gi[l](o[s-2],o[s-1]),s-=2),o[s++]=i}return!!o[0]},parse:function(t){if("function"==typeof t)return t;if(!t||"string"!=typeof t)return null;let e=t.trim();if(!e)return null;Yi._tokens.length=0,e=e.replace(/".+?"/g,Yi._withString),e=e.replace(/'.+?'/g,Yi._withString),e=e.replace(/\[.+?\]/g,Yi._withFieldInBrackets),e=e.replace(/-[0-9.]+/g,Yi._withNegativeNumber),e=e.replace(/[0-9.#]+/g,Yi._withPositiveNumber),e=e.replace(/[a-zA-Z_]\w*/g,Yi._withField),e=e.replace(/[\-\/+*%!=<>&|]+/g,Yi._withOperator),e=e.replace(/[()]/g,Yi._withParenthesis);let i=Yi._tokens,n=i.length;if(!n)return null;let o,r,s,l=[],a=e.match(/#[0-9]+#/g);for(o=0;o<n;++o){let t=a[o];if(r=i[+t.substring(1,t.length-1)],s=r.type,"literal"===s){let t=l[l.length-1];if(t&&"literal"===t.type){if(!(r.value<0&&"number"===r.dataType))return console.warn("Cannot parse an expression with insufficient number of operators"),null;Ui(l,"-","operator"),r.value*=-1}}l.push(r)}Yi._tokens.length=0,n=l.length;let u=[],h=[],p=null,d=!1;for(o=0;o<n;++o)if(r=l[o],s=r.type,"literal"===s)u.push(r);else if("parenthesis"===s)if("("===r.value)h.push(r);else{for(d=!1;h.length;){if(p=h.pop(),"("===p.value&&"parenthesis"===p.type){d=!0;break}u.push(p)}d||console.warn("No left parenthesis paired with the right one")}else{for(;h.length&&!(r.precedence>h[h.length-1].precedence);)u.push(h.pop());h.push(r)}for(d=!1;h.length;)p=h.pop(),"("===p.value&&"parenthesis"===p.type?d=!0:u.push(p);if(d&&console.warn("No right parenthesis paired with the left one"),!u.length)return null;let c={_rpn:u};return Yi._tester(c)?null:Yi._filter.bind(null,c)}};let qi=function(){this._conditions=[],this._scopes=[],qi._painters.push(this)};qi.ColoringTypes={TEXT:1,HEATMAP:2,CONDITIONAL:3},qi.prototype._coloringType=0,qi.prototype._conditions=null,qi.prototype._effectiveStyles=null,qi.prototype._blinkCondition=null,qi.prototype._scopes,qi.prototype._columnStats=null,qi.prototype._levelColorDisabled=!1,qi.prototype._blinkingDuration=250,qi._runningBlinkId=0,qi._painters=[],qi._emptyAry=[],qi._emptyObj={},qi._bgObj={backgroundColor:"",color:""},qi._colorObj={color:""},qi.bgStyles=["backgroundColor","color"],qi.nonBgStyles=["fontSize","fontWeight","fontStyle","textAlign","textDecoration"],qi.supportedStyles=qi.bgStyles.concat(qi.nonBgStyles),qi.themeReady=null,qi.parse=Yi.parse,qi.prototype.dispose=function(){let t=qi._painters.indexOf(this);t>=0&&qi._painters.splice(t,1),this.reset(),this._conditions=null,this._scopes.length=0,this._blinkCondition=null},qi.prototype.reset=function(){this._setColoringType(0);let t=this._scopes.length;if(t){for(let e=0;e<t;++e){let t=this._scopes[e];qi._clearBlinkTimer(t)&&t._restorer();let i=t.cell;i&&delete i.blinking,t.cell=null}this._scopes.length=0}this._blinkCondition=null},qi.prototype.resetColoring=function(){this._setColoringType(0),this._effectiveStyles=null,this._conditions.length=0},qi.prototype.resetBlinking=function(){this._blinkCondition=null,this._scopes.length=0},qi.prototype.clearBlinking=function(){this._blinkCondition=null;let t=this._scopes.length;if(t){for(let e=0;e<t;++e){let t=this._scopes[e];qi._clearBlinkTimer(t)&&t._restorer();let i=t.cell;i&&delete i.blinking,t.cell=null}this._scopes.length=0}},qi.prototype.resetHeatMap=function(){this._conditions.length=0,this._columnStats=null},qi.prototype.clearHeatMap=function(){return this._blinkCondition?(this._setColoringType(0),this.resetHeatMap(),!1):(this.dispose(),!0)},qi.prototype.applyThemeColor=function(){let t=T.getColors();if(this._coloringType===qi.ColoringTypes.HEATMAP){let e=this._conditions[0];if(e&&(e.textMode?e.baseColor=t.baseText:e.baseColor=t.baseGrid,e.useThemeColor)){let i=t.up,n=t.down,o=t.level===t.baseText?"":t.level;qi._setUpDownColors(e,i,n,o)}}this._blinkCondition&&this._blinkCondition.useThemeColor&&qi._setUpDownColors(this._blinkCondition,t.up,t.down,t.level,!0)},qi.prototype.getConditions=function(){return this._conditions},qi.prototype.getColoringType=function(){return this._coloringType},qi.prototype._setColoringType=function(t){this._coloringType!==t&&(this._coloringType=t)},qi.prototype.setEffectiveStyles=function(t){this._effectiveStyles=t},qi.prototype.getEffectiveStyles=function(){return this._effectiveStyles},qi.prototype.setConditions=function(t){this._conditions.length=0,this._setColoringType(qi.ColoringTypes.CONDITIONAL);let e=t.length;for(let i=0;i<e;i++)this._addCondition(t[i])},qi.prototype.setColumnStats=function(t){this._columnStats=t&&t.getMin?t:null},qi.prototype.getColumnStats=function(){return this._columnStats},qi.prototype._addCondition=function(t){let e=t.expression;e&&(t._fn=Yi.parse(e.text||e),this._conditions.push(t))},qi.prototype.addHeatmap=function(t,e,i,n,o,r){this._setColoringType(qi.ColoringTypes.HEATMAP);let s={heatmap:!0};return s.field=t,s.expression=qi._heatMapCondition.bind(s),s.midPoint=e,qi._setUpDownColors(s,i,n),s.baseColor=o,!0!==r&&"text"!==r||(s.textMode=!0),this._addCondition(s),s},qi.prototype.addHeatmapWithTheme=function(t,e,i){let n=T.themeColors,o=this.addHeatmap(t,e,n.up,n.down,n.baseGrid,i);return!0!==i&&"text"!==i||(o.baseColor=n.baseText),o.useThemeColor=!0,o},qi.prototype._addColorText=function(t,e,i,n,o){this._setColoringType(qi.ColoringTypes.TEXT);let r={};return r.field=e,r.expression=t.bind(null,e),r.upClass=i,r.downClass=n,r.levelClass=o,this._addCondition(r),r},qi.prototype.addColorText=function(t,e,i,n){return this._addColorText(Hi[t]?qi._tickColorTextCondition:qi._colorTextCondition,t,e,i,n)},qi.prototype.addColorTextWithTheme=function(t){return this.addColorText(t,"positive","negative","neutral")},qi.prototype.addTickColorText=function(t,e,i){return this.addColorText("CF_TICK",t,e,i)},qi.prototype.addTickColorTextWithTheme=function(){let t=T.themeColors,e=this.addTickColorText(t.tickUp,t.tickDown,t.level);return e.useThemeColor=!0,e},qi.prototype.addTickBlink=function(t,e,i,n){return this.addBlink("CF_TICK",t,e,i,n)},qi.prototype.addTickBlinkWithTheme=function(t){let e=T.themeColors,i=this.addTickBlink(e.tickUp,e.tickDown,e.level,t);return i.useThemeColor=!0,i},qi.prototype.addBlink=function(t,e,i,n,o){return this._addBlink(Hi[t]?qi._tickBlinkCondition:qi._fieldBlinkCondition,t,e,i,n,o)},qi.prototype.addBlinkWithTheme=function(t,e){let i=T.themeColors,n=this.addBlink(t,i.up,i.down,i.level,e);return n.useThemeColor=!0,n},qi.prototype._addBlink=function(t,e,i,n,o,r){let s=this._blinkCondition={};return s.blink=!0,s.blinkId=qi._runningBlinkId++,s.field=e,s._fn=s.expression=t,!0!==r&&"border"!==r||(s.border=!0),qi._setUpDownColors(s,i,n,o,!0),s},qi.prototype.renderForPrinting=function(t,e,i,n){if(!t)return;let o=this._getStyles(e,i,n),r=o.cssClass;null!=r?(elem._coloringCssClass&&elem._coloringCssClass!==r&&(elem.classList.remove(elem._coloringCssClass),elem._coloringCssClass=null),r&&(elem.classList.add(r),elem._coloringCssClass=r)):(t._coloringCssClass&&(t.classList.remove(t._coloringCssClass),t._coloringCssClass=null),t.style.backgroundColor=o.backgroundColor||"",t.style.color=o.color||"")},qi._colorTextCondition=function(t,e){let i=e[t];if(i||0===i){if(i>0)return 1;if(i<0)return-1}return"u"},qi._tickColorTextCondition=function(t,e){return Ni[e[t]]},qi._heatMapCondition=function(t,e,i){let n,o=t[this.field],r=o||0===o?o-this.midPoint:NaN;if(0===r||r!=r)return 0;let s=1;return r>0?(s=i-this.midPoint,s<0&&(s=e-this.midPoint)):(s=e-this.midPoint,s>0&&(s=i-this.midPoint)),s<0&&(s=-s),n=r/s,n},qi._tickBlinkCondition=function(t){return Ni[t]},qi._fieldBlinkCondition=function(t,e){return t>e?1:t<e?-1:0},qi._borderRestorer=function(t){t.blinkTimer=0;let e=t.cell.getElement();e&&(e.style.border="")},qi._cellRestorer=function(t){t.blinkTimer=0;let e=t.cell.getElement();if(e){let i=t.rowData,n=NaN,o=NaN;if(this._coloringType===qi.ColoringTypes.HEATMAP){let t=this._columnStats;t&&(n=t.getMin(),o=t.getMax())}let r=this._getStyles(i,n,o),s=r.cssClass;null!=s?(e._coloringCssClass&&e._coloringCssClass!==s&&(e.classList.remove(e._coloringCssClass),e._coloringCssClass=null),s&&(e.classList.add(s),e._coloringCssClass=s),e.style.backgroundColor="",e.style.color=""):(e._coloringCssClass&&(e.classList.remove(e._coloringCssClass),e._coloringCssClass=null),e.style.backgroundColor=r.backgroundColor||"",e.style.color=r.color||"")}},qi.prototype._getStyles=function(t,e,i){if(!t)return qi._emptyObj;let n=this._conditions.length;for(let o=0;o<n;++o){let n,r=this._conditions[o],s=r._fn;try{n=s&&s(t,e,i)}catch(t){}if(n){if(this._coloringType===qi.ColoringTypes.HEATMAP){let t;return t=n>0?qi.blendColor(r.baseColor,r.upColor,n):qi.blendColor(r.baseColor,r.downColor,-n),r.textMode?(qi._colorObj.color=qi.num2Hex(t),qi._colorObj):(qi._bgObj.backgroundColor=qi.num2Hex(t),qi._bgObj.color=qi.blackAndWhite(t),qi._bgObj)}return this._coloringType===qi.ColoringTypes.TEXT?(r.cssClass=n>0?r.upClass:n<0?r.downClass:this._levelColorDisabled?"":r.levelClass,r.cssClass=r.cssClass||"",r):r}}return qi._emptyObj},qi.blendColor=function(t,e,i){i>1?i=1:i<0&&(i=0);let n=qi.hex2Num(t),o=qi.hex2Num(e),r=[];for(let t=0;t<3;++t){let e=(o[t]-n[t])*i;r.push(n[t]+e)}return r},qi.blackAndWhite=function(t){return Math.sqrt(t[0]*t[0]*.241+t[1]*t[1]*.691+t[2]*t[2]*.068)>=135?"#000000":"#FFFFFF"},qi.rgb2Hex=R,qi.num2Hex=function(t){return"#"+(16777216+(t[2]|t[1]<<8|t[0]<<16)).toString(16).slice(1)},qi.num2Rgb=function(t){return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},qi.hex2Num=function(t){let e=parseInt(t.replace(/[^0-9A-F]/gi,""),16);return[e>>16&255,e>>8&255,255&e]},qi.hex2Rgb=function(t){if(t){let e=parseInt(t.replace(/[^0-9A-F]/gi,""),16);return"rgb("+(e>>16&255)+", "+(e>>8&255)+", "+(255&e)+")"}return""},qi.themeChanged=function(){},qi.setThemeColors=function(){},qi._onThemeChanged=function(){let t=qi._painters;for(let e=t.length;--e>=0;)t[e].applyThemeColor()},qi.loadThemeColors=function(){return qi.themeReady||(qi.themeReady=T.getThemeColors(qi._onThemeChanged).then(qi._onThemeChanged).catch(qi._onThemeChanged)),qi.themeReady},qi.reloadThemeColors=function(){return qi.themeReady=T.reloadThemeColors().then(qi._onThemeChanged).catch(qi._onThemeChanged),qi.themeReady},qi.clearCellStyle=function(t,e){let i=t.getElement();if(!i)return;let n=t.blinking;if(n&&(qi._clearBlinkTimer(n),delete t.blinking,n.cell=null),i._coloringCssClass&&i.classList.remove(i._coloringCssClass),e||(e=qi.supportedStyles),Array.isArray(e))for(let t=e.length;--t>=0;)i.style[e[t]]="";else for(let t in e)i.style[t]=""},qi._setUpDownColors=function(t,e,i,n,o){t.upColor=e,null!=e&&o&&(t.contrastUpColor=qi.getOppositeColor(e)),t.downColor=i,null!=i&&o&&(t.contrastDownColor=qi.getOppositeColor(i)),t.levelColor=n,null!=n&&o&&(t.contrastLevelColor=qi.getOppositeColor(n))},qi._clearBlinkTimer=function(t,e){return!!t.blinkTimer&&(clearTimeout(t.blinkTimer),t.blinkTimer=0,!0)},qi.getOppositeColor=function(t){if("string"==typeof t){if("#"===t.charAt(0)){let e=qi.hex2Num(t);return qi.blackAndWhite(e)}}else if(Array.isArray(t))return qi.blackAndWhite(t);return""},qi.prototype.render=function(t,e,i,n,o){null!=i&&i==i?this._paintCell(t,e,i,n):this._conditions.length&&this._coloringType===qi.ColoringTypes.CONDITIONAL&&this._paintCell(t,e)},qi.prototype.renderHeatMap=function(t,e,i,n){this._paintCell(t,e,i,n)},qi.prototype.renderColoring=function(t,e){this._paintCell(t,e)},qi.prototype._paintCell=function(t,e,i,n){if(!t)return;let o=t.getElement();if(!o)return;let r,s=this._blinkCondition;if(s&&(r=t.blinking,r&&r.blinkTimer&&!s.border))return;let l=this._getStyles(e,i,n),a=o.style,u=l.cssClass;o._coloringCssClass&&o._coloringCssClass!==u&&(o.classList.remove(o._coloringCssClass),o._coloringCssClass=null),null!=u?u&&(o.classList.add(u),o._coloringCssClass=u):(l.backgroundColor?a.backgroundColor=l.backgroundColor:this._effectiveStyles&&!this._effectiveStyles.backgroundColor||(a.backgroundColor=""),l.color?a.color=l.color:this._effectiveStyles&&!this._effectiveStyles.color||(a.color=""))},qi.prototype.blink=function(t,e,i){this._blinkCell(t,i,e)},qi.prototype.blinkCell=function(t,e,i,n){if(!this._blinkCondition)return!1;let o=this._blinkCondition._fn(e,i);return this._blinkCell(t,n,o)},qi.prototype._blinkCell=function(t,e,i){if(!t)return!1;if(this._levelColorDisabled&&!i)return!1;let n=t.getElement();if(!n)return!1;let o=this._blinkCondition;if(!o)return!1;let r,s,l=t.blinking;if(l||(l={},l.cell=t,t.blinking=l,this._scopes.push(l)),l.blinkId!==o.blinkId){l.blinkId=o.blinkId,l.field=o.field;let t=o.border?qi._borderRestorer:qi._cellRestorer;l._restorer=t.bind(this,l)}l.rowData=e,i>0?(r=o.upColor,s=o.contrastUpColor):i<0?(r=o.downColor,s=o.contrastDownColor):(r=o.levelColor,s=o.contrastLevelColor);let a=!0;return o.border?(n.style.border="1px solid "+r,a=!1):(n.style.backgroundColor=r,n.style.color=s),qi._clearBlinkTimer(l),l.blinkTimer=setTimeout(l._restorer,this._blinkingDuration),a},qi.prototype.verifyBlinking=function(t,e){let i=t.blinking;i&&i.blinkTimer&&i.rowData!==e&&(i.rowData=e,qi._clearBlinkTimer(i)&&i._restorer())},qi.prototype.disableLevelColor=function(t){this._levelColorDisabled=!1!==t},qi.prototype.setBlinkingDuration=function(t){"number"==typeof t&&(this._blinkingDuration=t)};if(window){var Xi=window.tr;Xi||(Xi=window.tr={});var ji=Xi.rt;ji||(ji=Xi.rt={});var Ki=Xi.grid;Ki||(Ki=Xi.grid={}),Xi.MockJET||(Xi.MockJET=Oi),Xi.closestElement||(Xi.closestElement=n.closestElement),Xi.CellPainter||(Xi.CellPainter=qi),ji.Grid||(ji.Grid=ei),Ki.CellPainter||(Ki.CellPainter=qi)}e.default=ei}]);