@refinitiv-ui/efx-grid 6.0.164 → 6.0.166
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/core/dist/core.js +8 -6
- package/lib/core/dist/core.min.js +1 -1
- package/lib/core/es6/grid/Core.js +8 -6
- package/lib/grid/index.js +1 -1
- package/lib/rt-grid/dist/rt-grid.js +12 -8
- package/lib/rt-grid/dist/rt-grid.min.js +1 -1
- package/lib/rt-grid/es6/Grid.js +4 -2
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
(()=>{"use strict";let t={create:function(t,e){let n=document.createElement(t);return e&&(n.className=e),n},div:function(e){return t.create("div",e)},text:function(e,n){let i=t.create("span",n);return(e||0===e)&&(i.textContent=e),i},appendChild:function(t,e){if(!t)return null;let n,i;Array.isArray(arguments[1])?(i=arguments[1],n=0):(i=arguments,n=1);let o=i.length;for(;n<o;)t.appendChild(i[n]),++n;return t},buildTree:function(e,n){if(!e)return null;let i=arguments,o=i.length;for(let n=1;n<o;++n){let o=i[n];if(o){let n;Array.isArray(o)?n=t.buildTree.apply(null,o):1===o.nodeType&&(n=o),n&&e.appendChild(n)}}return e},removeParent:function(t){if(!t)return null;let e=t.parentNode;return e&&e.removeChild(t),e},setParent:function(e,n){return e?n?(n.appendChild(e),n):t.removeParent(e):null},removeChildren:function(t,e){if(t){let n=t.childNodes.length;for((null==e||e>n)&&(e=n);--e>=0;)t.removeChild(t.lastChild)}},setContent:function(e,n){if(e)if(n||0===n){let i=n.nodeType;1===i||3===i?n!==e.lastChild&&(t.removeChildren(e),e.appendChild(n)):Array.isArray(n)?(t.removeChildren(e),t.appendChild(e,n)):e.textContent=n}else t.removeChildren(e)},toggleAttribute:function(t,e,n){n?t.setAttribute(e,"string"==typeof n?n:""):null==n?t.hasAttribute(e)?t.removeAttribute(e):t.setAttribute(e,""):t.removeAttribute(e)},toggleClass:function(t,e,n){n?t.classList.add(e):null==n?t.classList.contains(e)?t.classList.remove(e):t.classList.add(e):t.classList.remove(e)},addClasses:function(t,e){if(t){let n=Array.isArray(e)?e:arguments,i=n.length;for(let e=0;e<i;++e){let i=n[e];i&&"string"==typeof i&&t.classList.add(i)}}},removeClasses:function(t,e){if(t){let n=Array.isArray(e)?e:arguments,i=n.length;for(let e=0;e<i;++e){let i=n[e];i&&"string"==typeof i&&t.classList.remove(i)}}},preventDefault:function(t){t.preventDefault(),t.stopPropagation()},stopPropagation:function(t){t.stopPropagation()},getClientPosition:function(t,e){let n=e||{x:0,y:0};if(t.getBoundingClientRect){let e=t.getBoundingClientRect();n.x=e.left,n.y=e.top}else n.x=t.clientX,n.y=t.clientY;return n},getRelativePosition:function(e,n,i){i=t.getClientPosition(e,i);let o=t.getClientPosition(n);return i.x-=o.x,i.y-=o.y,i},closestElement:function(t,e){let n=t;for(;n;){if(n.classList&&n.classList.contains(e))return n;n=n.parentNode||n.host}return null},closestTagName:function(t,e){let n=t;for(;n;){if(n.tagName&&n.tagName==e)return n;n=n.parentNode||n.host}return null}},e=function(t,e,n){this._onConflated=this._onConflated.bind(this),this._data=[],"function"==typeof t?this.setFunction(t,n):"function"==typeof e&&this.setFunction(e,n),"number"==typeof e?this.setConflatingTime(e):"number"==typeof t&&this.setConflatingTime(t)};e.prototype._data,e.prototype._func=null,e.prototype._delay=0,e.prototype._timerId=0,e.prototype._conflated=!1,e.prototype._disabled=!1,e.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},e.prototype.popAllData=function(){if(this._data.length){let t=this._data;return this._data=[],t}return null},e.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},e.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))},e.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},e.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},e.prototype.getData=function(){return this._data},e.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},e.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},e.prototype.getConflatingTime=function(){return this._delay},e.prototype.disable=function(t){this._disabled=!1!==t},e.prototype.isEnabled=function(){return!this._disabled},e.prototype.enable=function(t){this._disabled=!1===t};let n={inherits:function(t,e){function n(){}n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.base=function(t,n,i){n||(n="constructor");let o=arguments.length,r=new Array(o);for(let t=2;t<o;t++)r[t-2]=arguments[t];return e.prototype[n].apply(t,r)}}};const o=n;let r=function(){};r.prototype._events=null,r.prototype._listenerCount=0,r.prototype.addEventListener=function(t,e){if(!t||!e)return;this._events||(this._events={});let n=this._events[t];n?n.indexOf(e)<0&&(n.push(e),++this._listenerCount):(this._events[t]=[e],++this._listenerCount)},r.prototype.removeEventListener=function(t,e){let n=this._events?this._events[t]:null;if(n){let t=n.indexOf(e);t>=0&&(n.splice(t,1),--this._listenerCount)}},r.prototype.removeAllEventListeners=function(){this._events=null,this._listenerCount=0},r.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},r.prototype.getListener=function(t,e){if(t){let n=this._events?this._events[t]:null;if(n)return e||(e=0),n[e]||null}return null},r.prototype.addListener=function(t,e){let n=t?t[e]:null;"function"==typeof n&&this.addEventListener(e,n)},r.prototype._prepareEventArguments=function(t,e){return e},r.prototype._dispatch=function(t,e){let n=this._events?this._events[t]:null;if(n){e=this._prepareEventArguments(t,e);let i=n.length;for(let t=0;t<i;++t)n[t](e)}},r.preventDefault=function(t){t&&t.preventDefault&&(t.preventDefault(),t.stopPropagation())};const s=r;let l=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 n=t.charAt(0),i=t.length>1?t.charAt(t.length-1):"";if('"'===n&&'"'===i)return this._value=t.substring(1,t.length-1),void(this._type="string");if("'"===n&&"'"===i)return this._value=t.substring(1,t.length-1),void(this._type="string");if("("===n&&")"===i)return void this._resolveVariableGroup(t);if("["===n&&"]"===i)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("♦"===n)return void(this._type="token");let s=Number(t);if(s==s)return this._value=s,void(this._type="number");this._type="dynamic"};l.prototype._input="",l.prototype._index=-1,l.prototype._type="",l.prototype._subVars=null,l.prototype._funcName="",l.prototype._value,l.prototype._valueWithTokenField="",l.prototype._inputConverter={TRUE:"true",FALSE:"false",PI:"Math.PI","TRUE()":"true","FALSE()":"false","PI()":"Math.PI"},l.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},l.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},l.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},l.prototype.getChildInputWithToken=function(){let t=this._subVars?this._subVars.length:0;if(t<=0)return"";let e=new Array(t);for(let n=0;n<t;++n)e[n]=this._subVars[n].getInputWithTokenField();return e.join(", ")},l.prototype.toString=l.prototype.getExpression,l.prototype.getValue=function(){return this._value},l.prototype.getInput=function(){return this._input},l.prototype.getIndex=function(){return this._index},l.prototype.setIndex=function(t){this._index=t},l.prototype.getFunctionName=function(){return this._funcName},l.prototype.getFieldNames=function(t){if(this._subVars){if(t){let e=this._subVars.length;for(let n=0;n<e;++n)this._subVars[n].getFieldNames(t)}return this._subVars[0].getFieldNames()}return"dynamic"===this._type?(t&&(t[this._input]=!0),this._input):""},l.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 l(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},l.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(","),n=e.length;for(let t=0;t<n;++t)this._subVars[t]=new l(e[t],t)}},l.prototype._resolveArray=function(t){if(this._type="array",t=t.substr(1,t.length-1)){this._subVars=[];let e=t.split(","),n=e.length;for(let t=0;t<n;++t)this._subVars[t]=new l(e[t],t)}};const a=l;let u=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)};o.inherits(u,s),u._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},u.prototype._input="",u.prototype._expression="",u.prototype._alias="",u.prototype._main=null,u.prototype.__F=null,u.prototype._fnTokens=null,u.prototype._fields=null,u.prototype._fieldMap=null,u.prototype._reference="",u.prototype._context=null,u.prototype._rtService=null,u.prototype._intervalServices=null,u.prototype._dataCache=null,u.prototype._dataLastError="",u.prototype._inputWithTokenField="",u.prototype._formulaCount=0,u._invalidOps={"+=":!0,"-=":!0,"*=":!0,"/=":!0,"|=":!0,"&=":!0,"^=":!0},u.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()},u.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},u.prototype.getFunction=function(){return this._main},u.prototype.getFieldNames=function(){return this._fields},u.prototype._setReference=function(t){this._reference=t},u.prototype.getReference=function(){return this._reference},u.prototype.getExpression=function(){return this._expression},u.prototype.toString=u.prototype.getReference,u.prototype.getInput=function(){return this._input},u.prototype.getAlias=function(){return this._alias||this._input},u.prototype.setAlias=function(t){this._alias=t},u.prototype.addFormulaCount=function(){this._formulaCount++},u.prototype.subtractFormulaCount=function(){return 0==--this._formulaCount},u.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]||u._emptyFunction,u._isBoundFormula[t]&&(this.__F[e]=this.__F[e].bind(this))}},u.prototype._logger=function(t){console.log("["+t+"] "+this._fnTokens[t].getFunctionName()+" is executed")},u._emptyFunction=function(){},u.prototype._detectCodeInjection=function(t){let e=!1;if(t.match(/\+\+|--/)&&(e=!0),!e){let n=t.match(/([^=]=+)/g)||[];for(let t=n.length;--t>=0;){let i=n[t],o=i.substring(i.length-2);if(u._invalidOps[o]){e=!0;break}}}return e},u.toUpperCase=function(t){if(!t||"="!==t.charAt(0))return t||"";let e=[],n=[];return t=(t=(t=u.tokenizeQuotes(t,e,n)).toUpperCase()).replace(/TR(\.[\w ]+)+\([^\(\)]*\)(\.[a-zA-Z]+)*/g,u._encloseWithTR),u.resolveTokens(t,e,n)},u._encloseWithTR=function(t){return'TR("'+t+'")'},u.tokenizeQuotes=function(t,e,n){let i;e||(e=[]),n||(n=[]);let o=!1,r=[];do{o=!1,t=t.replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,(function(t){return o=!0,i=e.length,e.push(new a(t,i)),r.push(i),"♦"+i+"♦"}))}while(o);return n.push(r),t},u.tokenizeAdcWithParams=function(t,e,n){let i;e||(e=[]),n||(n=[]);let o=!1,r=[];do{o=!1,t=t.replace(/TR\.\w+\([^\)]*\)+/g,(function(t){return o=!0,i=e.length,e.push(new a(t,i)),r.push(i),"♦"+i+"♦"}))}while(o);return n.push(r),t},u.replaceUnwantedCharacters=function(t,e,n){for(;t.indexOf(" ")>=0;)t=t.replace(/ {2}/g," ");return(t=(t=t.replace(/\$/g,"")).replace(/\&+/g,(function(t){return"&"===t?"+":t}))).replace(/(<=|>=|!=|!==|===|==|=(?!([\w]*\([^()]*\))))/g,(function(t){return"="===t?"==":t}))},u.prototype._tokenizeParentheses=function(t,e,n){e||(e=[]),n||(n=[]);let i={},o=/[\w._]*(?:=|=[\w]*)?\([^()]*\)/,r=new RegExp(o.source,"g");for(;t.match(o);){let o=[];t=t.replace(r,(function(t,n){"="===t.charAt(0)&&(t=t.substr(1,t.length));let r=i[t];return null==r&&(r=e.length,e.push(new a(t,r)),i[t]=r),o.push(r),"♦"+r+"♦"})),n.push(o)}return t},u.prototype._tokenizeConstants=function(t,e,n){e||(e=[]),n||(n=[]);let i=[];return t=t.replace(/[\w._♦]+/g,(function(t){if("♦"===t.charAt(0))return t;let n=e.length;return e.push(new a(t,n)),i.push(n),"♦"+n+"♦"})),n.push(i),t},u.resolveTokens=function(t,e,n){for(let i=n.length;--i>=0;){let o=n[i],r=o.length;for(let n=0;n<r;++n){let i=o[n],r=e[i];t=t.replace(new RegExp("♦"+i+"♦","g"),(function(){return r.getExpression()}))}}return t},u._getInputWithTokenField=function(t,e,n){for(let i=n.length;--i>=0;){let o=n[i],r=o.length;for(let n=0;n<r;++n){let i=o[n],r=e[i];t=t.replace(new RegExp("♦"+i+"♦","g"),(function(){return r.getInputWithTokenField()}))}}return"="+t},u.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=[],n=[];t=u.tokenizeQuotes(t,e,n),t=u.tokenizeAdcWithParams(t,e,n),t=u.replaceUnwantedCharacters(t,e,n),t=this._tokenizeParentheses(t,e,n),t=this._tokenizeConstants(t,e,n),this._inputWithTokenField=u._getInputWithTokenField(t,e,n),t=u.resolveTokens(t,e,n);let i={},o=e.length;for(let n=0;n<o;++n){let o=e[n];if(o.getFunctionName()){let e=this._fnTokens.length;t=t.replace(new RegExp("this\\.__F\\["+n+"\\]","g"),"this.__F["+e+"]"),o.setIndex(e),this._fnTokens.push(o)}o.getFieldNames(i)}return this._expression=t,this.updateContext(),this._main=this._createFunction(this._expression),this._main?(this._fieldMap=i,this._fields=Object.keys(i),this._main):null},u.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},u.prototype.__D=function(t,e){return e[t]},u.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))},u.prototype.changeField=function(t,e){let n=this._fields.indexOf(t);if(n<0)return!1;this._fields.splice(n,1),this._fields.indexOf(e)<0&&this._fields.push(e);let i=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:i,formula:this}),!0},u.prototype.changeFields=function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;let n=this._input;for(let n=t.length;--n>=0;){let i=t[n],o=e[n],r=this._fields.indexOf(i);if(r<0)continue;this._fields.splice(r,1),this._fields.indexOf(o)<0&&this._fields.push(o);let s="♠"+i+"♥",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\\("'+i+'", __R\\)',"g"),'this.__D("'+o+'", __R)')}return this._main=this._createFunction(this._expression),this._dispatch("formulaChanged",{oldInput:n,formula:this}),!0},u.prototype.getRealtimeService=function(){return this._rtService},u.prototype.setRealtimeService=function(t){this._rtService&&this._rtService.dispose(),this._rtService=t,this._rtService.addEventListener("dataChanged",this._onDataCacheChanged)},u.prototype.getIntervalService=function(t){return this._intervalServices[t]},u.prototype.setIntervalService=function(t,e){if(!e)return;let n=this._intervalServices[t];n&&n.removeEventListener("dataChanged",this.dispatchDataChanged),this._intervalServices[t]=e,e.addEventListener("dataChanged",this.dispatchDataChanged)},u.prototype.getCachedData=function(t){return this._dataCache[t]},u.prototype.setCachedData=function(t,e){this._dataCache[t]=e},u.prototype.setDataError=function(t){this._dataLastError=t},u.prototype.dispatchDataChanged=function(t){this._dispatch("dataCacheChanged",{})},u.prototype._onDataCacheChanged=function(t){let e=t.ric,n=t.values,i=this._dataCache[e];if(i)for(let t in n)i[t]=n[t];else this._dataCache[e]=n;this._dispatch("dataCacheChanged",{})},u._proto=u.prototype;const h=u,p={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 d={};const c=/\d+/g;let _=function(t){if(!t||"string"!=typeof t)return"";if("#"===t.charAt(0))return t;let e=t.match(c);if(!e||e.length<3)return t;let n="#";for(let t=0;t<3;t++){let i=+e[t];i>=16||(n+="0"),n+=i?i.toString(16).toUpperCase():"0"}return n},f=function(t){return"#"+(16777216+(t[2]|t[1]<<8|t[0]<<16)).toString(16).slice(1)},g=function(t){return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},y=function(t){let e=parseInt(t.replace(/[^0-9A-F]/gi,""),16);return[e>>16&255,e>>8&255,255&e]},m=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""},C=function(t){if(!t||t<0)return 0;if(t>=255)return 1;let e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},S=function(t){return.2126*C(t[0])+.7152*C(t[1])+.0722*C(t[2])},w=function(t,e){if(t===e)return 1;let n=t,i=e;return t>e&&(i=t,n=e),(i+.05)/(n+.05)},b=function(t){let e=S(t),n=w(1,e);return w(0,e)>=n?"#000000":"#ffffff"},R=function(t,e,n){n>1?n=1:n<0&&(n=0);let i=y(t),o=y(e),r=[];for(let t=0;t<3;++t){let e=(o[t]-i[t])*n;r.push(i[t]+e)}return r};d.rgb2Hex=_,d.num2Hex=f,d.num2Rgb=g,d.hex2Num=y,d.hex2Rgb=m,d.getColorLuminance=C,d.getRelativeLuminance=S,d.getContrastRatio=w,d.getContrastColor=b,d.blendColor=R;let v=function(t,e,n){if(!t)return null;if(!e||t===e)return t;let i;if(n){let o=n.length;for(let r=0;r<o;++r)i=n[r],i&&A(t,e,i)}else for(i in e)A(t,e,i);return t},I=function(t,e){return v({},t,e)},D=function(t){for(let e in t)return!1;return!0},x=function(t,e){if(!Array.isArray(t))return t;if(!e)return null;let n=t;t={};let i=n.length;for(let o=0;o<i;++o){let i=e[o];i&&void 0!==n[o]&&(t[i]=n[o])}return t},A=function(t,e,n){let i=e[n];if(null!=i){let e=t[n];Array.isArray(e)?t[n]=e.concat(i):Array.isArray(i)&&e?t[n]=i.concat(e):t[n]=i}},T=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 n=0;n<t.length;n++)if(!T(t[n],e[n]))return!1}else{if(Object.keys(t).length!==Object.keys(e).length)return!1;for(let n in t)if(!T(t[n],e[n]))return!1}return!0}return!1},L=function(t){return Array.isArray(t)?"{\n"+t.join("\n")+"\n}":t},E=function(t){return t.replace(/\n+/g,"\n\t").replace(/\n\t}$/,"\n}")},M=function(t,e){e||(e=[]);for(let n in t){let i=t[n];"object"==typeof i?M(i,e):e.push(i)}return e},F=function(t,e,n){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!=n&&(this._ctx=n),this.promise=new Promise(function(t,e){this._resolve=t,this._reject=e}.bind(this))};F.prototype.promise=null,F.prototype._resolve=null,F.prototype._reject=null,F.prototype._resolveHandler=null,F.prototype._rejectHandler=null,F.prototype._ctx=null,F.prototype._fulfilled=!1,F.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()}},F.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()}},F.prototype.isFulfilled=function(){return this._fulfilled},F.prototype._finally=function(){this._fulfilled=!0,this._ctx=this._resolveHandler=this._rejectHandler=null,this._resolve=this._reject=null};let P={},z=function(t,e){"attributes"==e.type&&"lang"==e.attributeName&&(t.lang=e.target.lang||"en")},V=function(t,e,n){"attributes"===n.type&&(null!=e?n.attributeName===e&&t(n.target.getAttribute(e)):t(n.target))};P._getNewId=function(){return"observer_"+ ++P._id},P._addObserver=function(t,e,n){let i=n;i||(i={}),i.attributes=!0,P._observer.observe(t,i),P._addListener(t,e)},P._onMutationCallback=function(t){for(let e=0;e<t.length;e++){let n=t[e],i=P._listeners[n.target._observeId];for(let t=0;t<i.length;t++)i[t](n)}},P._addListener=function(t,e){let n=P._listeners;if(n||(n=P._listeners={}),!t._observeId){let e=P._getNewId();t._observeId=e}n[t._observeId]||(n[t._observeId]=[]);let i=n[t._observeId];i.indexOf(e)<0&&i.push(e)},P.addLanguageListener=function(t){t&&(t.lang=document.documentElement.lang||"en",P._addObserver(document.documentElement,z.bind(null,t)))},P.addAttributeListener=function(t,e,n){t&&e&&P._addObserver(t,V.bind(null,e,n))},P._observer=new MutationObserver(P._onMutationCallback),P._listeners={},P._id=0;let k={en:!0,de:!0,ja:!0,zh:!0,"zh-Hant":!0},N={_deferred:null,themeReady:null,_defaultColors:{up:"#39C46E",down:"#F5475B",level:"#C2C2C2",tickUp:"#39C46E",tickDown:"#F5475B",baseGrid:"#1A1A1C",baseText:"#C2C2C2",trackColor:"#FF9933"}};N.themeColors=N._defaultColors,N._components={},N._themeName="",N._elfVersion=0,N._dummyIcon=null,N._iconLoaded=!1,N._profileName=null,N._callbacks=[],N._observed=!1,N._pendingResolve=!1,N._themeLoaded=!1,N._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"}}},N._icons["halo-theme"]=N._icons["elf-theme-halo"],N._icons["solar-theme"]=N._icons["elf-theme-solar"],N.setElfVersion=function(t){N._elfVersion=t},N.getElfVersion=function(){if(!N._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);N._elfVersion=t}return N._elfVersion},N.hasComponent=function(t){let e=N._components[t];if(null==e){e=0;let n=N.getElfVersion();if(t){let i;1===n?(i=document.createElement(t),i.is===t&&(e=n)):n>1&&(window.customElements&&window.customElements.get(t)||document.createElement(t).constructor!==HTMLElement)&&(e=n),N._components[t]=e}}return e},N.toLangString=function(t){if(!t)return"";if("zh-hant"===(t=t.toLowerCase()))return"zh-Hant";let e=t.replace(/-.*/,"");return k[e]?e:""},N.hasTheme=function(t){return t===N.getThemeName()},N.getThemeName=function(t){return N._themeName||(N._themeName=N.getCssVariable("--theme-name",document.documentElement)),N._themeName},N.setThemeName=function(t){N._themeName=t},N.isThemeLoaded=function(){return N._themeLoaded},N.getColors=function(){return N.themeColors},N.isHaloTheme=function(t){return null==t&&(t=N.getThemeName()),!!t&&t.indexOf("halo")>=0},N.injectIcons=function(t){if("object"!=typeof t)return;let e=N.getThemeName();t.themeName=e;let n=N.getElfVersion();t.elfVersion=n;let i=N._icons[e];i&&(t.icons=i)},N.getIconList=function(){let t=N._icons[N.getThemeName()];return t?M(t):[]},N._onIconPreloaded=function(){if(N._dummyIcon){let t=N._dummyIcon.parentNode;t&&t.removeChild(N._dummyIcon),N._dummyIcon=null}},N.prepareIconPreloading=function(){if(!N._iconLoaded){N._iconLoaded=!0;let t=N.getIconList();if(t.length){setTimeout(N._onIconPreloaded,10);let e=N._dummyIcon=document.createElement("ef-icon");return e.style.transform="scale(0)",document.body.appendChild(e),t}}return null},N.getCssVariable=function(t,e){let n="",i=e||document.body;return window&&"string"==typeof t&&1===i.nodeType&&t.match(/^--/)&&(n=window.getComputedStyle(i).getPropertyValue(t),n=n.replace(/[\"\']/g,"")),n},N.getCssVariables=function(t,e){let n=e||document.body;if(window&&1===n.nodeType){let e=window.getComputedStyle(n);for(let n in t){let i=t[n];i&&i.match(/^--/)&&(t[n]=e.getPropertyValue(i).replace(/\"/g,""))}}return t||null},N.setRTK=function(t){null!=t&&(N._rtk=t)},N.getMovementColorProfile=function(){return document.documentElement.getAttribute("movement-color-profile")},N._addThemeChangedCallback=function(t){let e=N._callbacks;e.indexOf(t)<0&&e.push(t)},N.reloadThemeColors=function(){return N._deferred&&N._deferred.isFulfilled()?(N._profileName="",N._themeLoaded=!1,N.themeReady=null,N.getThemeColors()):N.themeReady},N.getThemeColors=function(t){if("function"==typeof t&&N._addThemeChangedCallback(t),N.themeReady)return N.themeReady;let e=N._deferred=new F;N.themeReady=e.promise;let n=N.getMovementColorProfile();if(n)n!==N._profileName?setTimeout(N._profileNameRetrieved,100):N._deferred.resolve(N.themeColors);else{let t={providerName:"Configuration",settingName:"RDE_USER_CURRENT_TICK_COLOR"},e=window?window.JET:null;if(N._themeLoaded=!1,N._rtk&&N._rtk.Settings)N._rtk.Settings.getAsync(t).then(N._loadingProfileSuccess).catch(N._loadingProfileFailure);else if(e&&e.Settings)try{e.Settings.read(N._loadingProfileSuccess,t)}catch(t){N._loadingProfileFailure()}else setTimeout(N._profileNameRetrieved,100)}return e.promise};let O=function(t){if(t!==N._profileName){N._retrieveThemeColors(t),N._pendingResolve&&(N._pendingResolve=!1,N._deferred.resolve(N.themeColors));let e=N._callbacks;for(let t=0;t<e.length;t++)e[t]()}};N._loadingProfileSuccess=function(t){t&&document.documentElement.setAttribute("movement-color-profile",t.toLowerCase()),N._observed?N._pendingResolve=!0:N._profileNameRetrieved(t)},N._loadingProfileFailure=function(){N._retrieveThemeColors(),N._observed||(N._observed=!0,P.addAttributeListener(document.documentElement,O,"movement-color-profile")),N._deferred.reject("Failed to get movement color profile from settings.")},N._profileNameRetrieved=function(){let t=N.getMovementColorProfile();N._retrieveThemeColors(t),N._observed||(N._observed=!0,P.addAttributeListener(document.documentElement,O,"movement-color-profile")),N._deferred.resolve(N.themeColors)},N._retrieveThemeColors=function(t){N._themeLoaded=!0,N._profileName=t;let e=N.themeColors=N.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=N._defaultColors.up,e.down=N._defaultColors.down,e.level=N._defaultColors.level,e.tickUp=N._defaultColors.tickUp,e.tickDown=N._defaultColors.tickDown),e.positive=e.up,e.negative=e.down,e.neutral=e.level;let n=document.createElement("table");n.style.visibility="hidden",n.style.position="fixed",n.style.left="0",n.style.top="0",n.style.width="0";let i=n.insertRow(-1),o=i.insertCell(-1);document.body.appendChild(n);let r=window.getComputedStyle(i);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=N._defaultColors.baseGrid,e.tableText=N._defaultColors.baseText,e.tableBorder="")),e.tableBg=_(e.tableBg),e.tableText=_(e.tableText),e.tableBorder=_(e.tableBorder),document.body.removeChild(n),e.baseGrid=e.tableBg,e.baseText=e.tableText,e.trackColor=e.primary||N._defaultColors.trackColor};const H=N,B=(new Date(NaN),Date.UTC(1900,0,1)),G=Date.UTC(1900,2,1),W=864e5,U=["sun","mon","tue","wed","thu","fri","sat"],Y=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],X=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],q=["January","February","March","April","May","June","July","August","September","October","November","December"];let j=function(t){return t>9?""+t:"0"+t},K={D:function(t,e){return""+t.getDate()},DD:function(t,e){return j(t.getDate())},DDD:function(t,e){return e[U[t.getDay()]]},D_:function(t,e){return e[Y[t.getDay()]]},M:function(t,e){return""+(t.getMonth()+1)},MM:function(t,e){return j(t.getMonth()+1)},MMM:function(t,e){return e[X[t.getMonth()]]},M_:function(t,e){return e[q[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 j(t.getHours())},h:function(t,e){let n=t.getHours()%12;return 0===n?"12":""+n},h_:function(t,e){let n=t.getHours()%12;return n=0===n?12:n,j(n)},m:function(t,e){return""+t.getMinutes()},m_:function(t,e){return j(t.getMinutes())},s:function(t,e){return""+t.getSeconds()},s_:function(t,e){return j(t.getSeconds())},S:function(t,e){return~~(t.getMilliseconds()/100)},SS:function(t,e){return j(~~(t.getMilliseconds()/10))},S_:function(t,e){return(n=t.getMilliseconds())>99?""+n:n>9?"0"+n:"00"+n;var n},A:function(t,e){return t.getHours()<12?e.AM:e.PM},a:function(t,e){return t.getHours()<12?e.am:e.pm}},J={_dateTimePattern:"M/D/YY h:mm A",_localeSetting:"en",_activeLocaleMap:null,_activeInput:null,setDateTimePattern:function(t){J._dateTimePattern=t||"M/D/YY h:mm A"},setLocale:function(t){let e=H.toLangString(t);J._localeSetting=p[e]?e:"en"},format:function(t,e,n){let i=null,o="",r=!(!n||"LOCAL"!==n.toUpperCase());if("number"==typeof t)t>1e8?i=new Date(t):(i=J.fromDateNumber(t),r=!0);else if(t instanceof Date)i=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," ")),i=new Date(o)}return J.isInvalidDate(i)?t||"":(r||i.setTime(i.getTime()+6e4*i.getTimezoneOffset()),J.formatDateObject(i,e))},formatDateObject:function(t,e){if(J.isInvalidDate(t))return"";e||(e=J._dateTimePattern),J._activeInput=t,J._activeLocaleMap=p[J._localeSetting]||DateTimeLocale.en;let n=e.replace(/D+|M+|Y+|H+|S+|A+|d+|m+|y+|h+|s+|a+|\[[^\]]*\]+/g,J._parseDatePattern);return J._activeInput=null,n},_lowerCaseDatePatterns:{d:!0,y:!0},_parseDatePattern:function(t){let e=t?t.charAt(0):"";if("["===e)return t.substring(1,t.length-1);let n=K[t];if(!n){let i=t;J._lowerCaseDatePatterns[e]&&(i=t.toUpperCase(),e=e.toUpperCase(),n=K[i]),n||(i=e+"_",n=K[i])}return n?n(J._activeInput,J._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=J.dateNumberToMs(t);if(e==e){let n=J.timeNumberToMs(t);return new Date(e+n)}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++,e*W},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):J.fromDateNumber(t);else if(t){let n=t+"",i=n.match(/^\d{4}(-\d{2}(-\d{2}(T\d{2}\:\d{2}\:\d{2})?)?)?$/);n=n.replace(/\-/g,"/"),i&&(n=n.replace(/T/g," ")),e=new Date(n)}else e=new Date(NaN);return e},toDateNumber:function(t){return J._millisecondToDateNumber(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()))},toTimeNumber:function(t){return Date.UTC(1970,0,1,t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds())/W},_millisecondToDateNumber:function(t){if((t=+t)!=t||t<B)return NaN;{let e=t/W+25569;return t<G&&e--,e}},toYYYYMMDD:function(t){let e=t?t.toJSON():"";return e?e.slice(0,10):""}};const Q=J;const Z={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}};const $={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,n){return t?e:n},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}};let tt={};tt.ABS=Math.abs,tt.ACOS=Math.acos,tt.ACOSH=function(t){return Math.log(t+Math.sqrt(t*t-1))},tt.ASIN=Math.asin,tt.ASINH=function(t){return t===-1/0?t:Math.log(t+Math.sqrt(t*t+1))},tt.ATAN=Math.atan,tt.ATAN2=function(t,e){return Math.atan2(e,t)},tt.ATANH=function(t){return Math.log((1+t)/(1-t))/2},tt.CEILING=function(t,e){return e||(e=1),t/=e,Math.ceil(t)*e},tt.CEIL=tt.CEILING,tt.COMBIN=function(t,e){let n=tt.FACT;return n(t)/(n(e)*n(t-e))},tt.COS=Math.cos,tt.COSH=function(t){let e=Math.exp(t);return(e+1/e)/2},tt.DEGREES=function(t){return t/(Math.PI/180)},tt.EVEN=function(t){return(t=Math.ceil(t))%2?t<0?t-1:t+1:t},tt.EXP=Math.exp,tt.FACT=function(t){if(t<0)return NaN;t=Math.floor(t);let e=1;for(;t>1;)e*=t,--t;return e},tt.FACTDOUBLE=function(t){if(t<0)return NaN;t=Math.floor(t);let e=1;for(;t>1;)e*=t,t-=2;return e},tt.FLOOR=function(t,e){return e||(e=1),t/=e,Math.floor(t)*e},tt.GCD=function(t,e){if(t<0&&(t=-t),e<0&&(e=-e),e>t){let n=t;t=e,e=n}for(;0!=e;){if(0==(t%=e))return e;e%=t}return t},tt.INT=Math.floor,tt.LCM=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t.length,n=Math.abs(t[0]);for(let i=1;i<e;i++){let e=Math.abs(t[i]),o=n;for(;n&&e;)n>e?n%=e:e%=n;n=Math.abs(o*t[i])/(n+e)}return n},tt.LN=Math.log,tt.LOG=function(t,e){return null==e&&(e=10),Math.log(t)/Math.log(e)},tt.LOG10=function(t){return Math.log(t)/Math.LN10},tt.MOD=function(t,e){return t%e},tt.ODD=function(t){return(t=Math.ceil(t))%2==0?t<0?t-1:t+1:t},tt.POWER=Math.pow,tt.PRODUCT=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t[0];if(null==e||e!=e)return NaN;for(let n=t.length;--n>=1;)e*=t[n];return e},tt.PROD=tt.PRODUCT,tt.QUOTIENT=function(t,e){return Math.floor(t/e)},tt.RADIANS=function(t){return t*(Math.PI/180)},tt.RAND=Math.random,tt.RANDBETWEEN=function(t,e){return Math.floor(Math.random()*(e-t+1))+t},tt.ROUND=function(t,e){if(!e)return Math.round(t);let n=Math.pow(10,e);return Math.round(t*n)/n},tt.ROUNDDOWN=function(t,e){if(!e)return Math.floor(t);let n=Math.pow(10,e);return Math.floor(t*n)/n},tt.ROUNDUP=function(t,e){if(!e)return Math.ceil(t);let n=Math.pow(10,e);return Math.ceil(t*n)/n},tt.SERIESSUM=function(t,e,n,i){let o=0;for(let r=i.length;--r>=0;)o+=i[r]*Math.pow(t,e+r*n);return o},tt.SIGN=function(t){return t>0?1:t<0?-1:0},tt.SIN=Math.sin,tt.SINH=function(t){let e=Math.exp(t);return(e-1/e)/2},tt.SQRT=Math.sqrt,tt.SQRTPI=function(t){return Math.sqrt(t*Math.PI)},tt.SUM=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let n=t.length;--n>=0;)e+=t[n];return e},tt.SUMPRODUCT=function(){let t,e=arguments[0]instanceof Array?arguments[0]:arguments,n=e.length;if(0===n)return 0;let i=[];for(t=0;t<n;++t)i[t]=1;for(t=0;t<n;++t)i[t]*=e[t];let o=0;for(t=0;t<n;++t)o+=i[t];return o},tt.SUMSQ=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let n=t.length;--n>=0;){let i=t[n];e+=i*i}return e},tt.TAN=Math.tan,tt.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)},tt.TRUNC=function(t,e){if(!e)return Math.floor(t);let n=Math.pow(10,e);return Math.floor(t*n)/n};const et=tt;let nt={AVERAGE:function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t.length;if(e<=0)return NaN;let n=0;for(let i=e;--i>=0;)n+=t[i];return n/e}};nt.AVG=nt.AVERAGE,nt.COUNT=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let n=t.length;--n>=0;){let i=t[n];null!=i&&i==i&&++e}return e},nt.MAX=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;if(t.length<=0)return NaN;let e=t[0];for(let n=t.length;--n>=1;)t[n]>e&&(e=t[n]);return e},nt.MIN=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;if(t.length<=0)return NaN;let e=t[0];for(let n=t.length;--n>=1;)t[n]<e&&(e=t[n]);return e},nt.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 n=nt.AVERAGE(t),i=0;for(let o=e;--o>=0;){let e=t[o]-n;i+=e*e}return Math.sqrt(i/(e-1))},nt.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 n=nt.AVERAGE(t),i=0;for(let o=e;--o>=0;){let e=t[o]-n;i+=e*e}return Math.sqrt(i/e)};const it=nt;let ot={},rt=function(t){return t||0===t?t+"":""};ot.EXACT=function(t,e){return(t+="")==(e+="")?1:0},ot.FIND=function(t,e,n){return(t=rt(t))&&(e=rt(e))?((!(n=+n)||n<0)&&(n=0),e.indexOf(t,n)):0},ot.LEFT=function(t,e){return(e=+e)||(e=0),e<0&&(e=1),rt(t).substr(0,e)},ot.LENGTH=function(t){return rt(t).length},ot.LEN=ot.LENGTH,ot.LOWER=function(t){return rt(t).toLowerCase()},ot.MID=function(t,e,n){return rt(t).substr(e,n)},ot.REPLACE=function(t,e,n,i){i+="";let o=(t=rt(t)).split("");return o.splice(n,e,i),o.join("")},ot.RIGHT=function(t,e){(e=+e)||(e=0),e<0&&(e=1);let n=(t=rt(t)).length-e;return t.substr(n,e)},ot.TRIM=function(t){return rt(t).trim()},ot.UPPER=function(t){return rt(t).toUpperCase()},ot.VALUE=function(t){return+t},ot.CHAR=function(t){let e=+t;return String.fromCharCode(e)},ot.CLEAN=function(t){let e=rt(t).split("");for(let t=e.length;--t>=0;){let n=e[t].charCodeAt(0);(n<32||n>127)&&(e[t]="")}return e.join("")},ot.CODE=function(t){return rt(t).charCodeAt(0)},ot.PROPER=function(t){let e=(t=rt(t)).split(/[\W_]/g),n=t.match(/[\W_]/g),i=e.length,o="";for(let t=0;t<i;t++){let i=e[t],r=i.length;1===r?o+=i.toUpperCase():0!==r&&(o+=i.charAt(0).toUpperCase()+i.substr(1).toLowerCase());let s=n[t];s&&(o+=s)}return o},ot.REPEAT=function(t,e){if(!(e=+e)||e<0)return"";if(""===(t=rt(t)))return"";let n=t;for(let i=1;i<e;i++)n+=t;return n},ot.STRING=function(t,e){return(t=+t)?(!(e=+e)||e<0?e=0:e>9&&(e=9),t.toFixed(e)):""};const st=ot;let lt=function(){this._context={},lt._addContext(this._context,lt.getContext()),this._context._DATA=this._getData.bind(this),this._setData=this._defaultFormulaDataSetter.bind(this),this._formulas=[],this._formulaMap={},this._referenceMap={}};o.inherits(lt,s),lt.prototype._context=null,lt.prototype._rowData=null,lt.prototype._setData=null,lt.prototype._formulas=null,lt.prototype._formulaMap=null,lt.prototype._referenceMap=null,lt._context=null,lt.getContext=function(){let t=lt._context;return t||(t={},lt._context=t,lt._addContext(t,Q),lt._addContext(t,Z),lt._addContext(t,$),lt._addContext(t,et),lt._addContext(t,it),lt._addContext(t,st)),t},lt.addContext=function(t){let e=lt.getContext();lt._addContext(e,t)},lt._addContext=function(t,e){for(let n in e)t[n]=e[n]},lt.prototype.setFormulaDataGetter=function(t){"function"==typeof t&&(this._context._DATA=t)},lt.prototype.setFormulaDataSetter=function(t){"function"==typeof t&&(this._setData=t)},lt.prototype._defaultFormulaDataSetter=function(t,e,n,i){if("..."!==e){let o=t.getAlias();n[o]=e,i&&(i[o]=e)}},lt.prototype.addFormula=function(t){let e;return t instanceof h?e=t:(this._rowData={},e=new h(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},lt.prototype.mockFormula=function(t){let e;return e=new h(t instanceof h?t.getInput():t,this._context),e},lt.prototype.removeFormula=function(t){let e;if(t instanceof h&&(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 n=this._formulas.indexOf(e);n>=0&&(this._formulas.splice(n,1),delete this._formulaMap[t],delete this._referenceMap[t]),e.dispose()}return e||null},lt.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={}},lt.prototype.getFormula=function(t){let e;return e="number"==typeof t?this._formulas[t]:this._formulaMap[t],e||null},lt.prototype.getFormulaByExpression=function(t){let e=this._formulas.length;for(let n=0;n<e;++n){let e=this._formulas[n];if(e.getInput()===t)return e}return null},lt.prototype.getAllFormulas=function(){return this._formulas},lt.prototype.getAllFormulaReferences=function(){return this._referenceMap},lt.prototype.getFormulaCount=function(){return this._formulas.length},lt.prototype._generateUniqueReference=function(t){let e=t,n=0;for(;null!=this._referenceMap[e];)e=t+"_"+ ++n;return e},lt.prototype.addReference=function(t,e){if(!t||!e)return"";e=this._generateUniqueReference(e);let n="";if(t instanceof h){if(!this._setFormulaReference(t,e))return"";n=t.getAlias()}else n=t;return this._referenceMap[e]=n,e},lt.prototype.renameReference=function(t,e){if(!e)return this.removeReference(t);if(!t||null==this._referenceMap[t]||t===e)return!1;let n=this._formulaMap[t];if(n&&!this.isValidReference(n,e))return!1;for(let n=this._formulas.length;--n>=0;){let i=this._formulas[n];if(i.changeField(t,e)){let t=i.getReference();t&&(this._referenceMap[t]=i.getAlias())}}return n&&this._setFormulaReference(n,e),this._referenceMap[e]=this._referenceMap[t],delete this._referenceMap[t],!0},lt.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},lt.prototype.resolveReference=function(t){return this._referenceMap[t]||t},lt.prototype._getData=function(t,e){if(!this._rowData)return null;let n=this._rowData[this.resolveReference(t)];if(n){let t=Number(n);t==t&&(n=t)}return n},lt.prototype._setFormulaReference=function(t,e){if(this._formulaMap[e])return console.warn("Duplicate formula reference detected."),!1;let n=t.getReference();if(n===e)return!1;e&&(this._formulaMap[e]=t),t._setReference(e);let i=this._sortDependencies(this._formulas,this._formulaMap);return i?(this._formulas=i,delete this._formulaMap[n],!0):(t._setReference(n),delete this._formulaMap[e],!1)},lt.prototype.calculate=function(t,e){this._rowData=t;let n=this._formulas.length;for(let i=0;i<n;++i){let n=this._formulas[i];if(e){let t=null!=e[n.getAlias()];if(!t){let i=n.getFieldNames();for(let n=i.length;--n>=0;)if(null!=e[this.resolveReference(i[n])]){t=!0;break}if(!t)continue}}let o=n.calculate(t);this._setData(n,o,t,e)}this._rowData=null},lt.prototype.isValidReference=function(t,e){if(!e)return!0;if(this._referenceMap[e])return!1;let n=t.getReference(),i=this._createParentChildrenMap(this._formulas);if(n){delete i[n];for(let t in i){let o=i[t],r=o.indexOf(n);-1!==r&&(o=o.slice(0),o.splice(r,1),r=o.indexOf(e),-1===r&&o.push(e),i[t]=o)}}return i[e]=t.getFieldNames(),!!this._sortParentChildrenMap(i)},lt.prototype._sortDependencies=function(t,e){if(1===t.length)return t;let n=this._createParentChildrenMap(t),i=this._sortParentChildrenMap(n);if(!i)return null;let o=t.filter((function(t){return!t.getReference()})),r=[];if(e){for(let t=i.length;--t>=0;){let n=e[i[t]];n&&r.push(n)}o.length>0&&(r=r.concat(o))}return r},lt.prototype._createParentChildrenMap=function(t){let e,n={};for(e=t.length;--e>=0;){let i=t[e],o=i.getReference();o&&(n[o]=i.getFieldNames())}return n},lt.prototype._sortParentChildrenMap=function(t){let e,n,i,o,r,s={};for(r in t){i=t[r],o=i.length;for(let t=0;t<o;++t)n=i[t],s[n]=s[n]+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),i=t[r],o=i?i.length:0,e=0;e<o;++e)n=i[e],--s[n]>0||l.push(n);for(n in s)if(s[n])return null;return a},lt._proto=lt.prototype;let at={};at.isIE=function(){let t=window.navigator.userAgent;return t.indexOf("MSIE ")>0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0}(),at.isTouchDevice=!!(navigator.maxTouchPoints&&navigator.maxTouchPoints<256||navigator.msMaxTouchPoints&&navigator.msMaxTouchPoints<256),at.isSafari=function(){let t=navigator.userAgent;return!/Chrome|Android|CriOS|FxiOS|EdgiOS/i.test(t)&&/Safari/i.test(t)}(),at.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),at.getElement=function(t){return at.isElement(t)?t:t&&at.isFunction(t.getElement)?t.getElement():null},at.isElement=function(t){return!!t&&1===t.nodeType},at.isEmpty=function(t,e){return null==t||void 0===t||!e&&""===t||at.isArray(t)&&0===t.length},at.isNumber=function(t){return"number"==typeof t&&isFinite(t)},at.isString=function(t){return"string"==typeof t},at.isArray=Array.isArray,at.isFunction=function(t){return"function"==typeof t},at.getClientPosition=function(t,e){let n=e||{};if(t.getBoundingClientRect){let e=t.getBoundingClientRect();n.x=e.left,n.y=e.top}else n.x=t.clientX,n.y=t.clientY;return n},at.getRelativePosition=function(t,e,n){n=at.getClientPosition(t,n);let i=at.getClientPosition(e);return n.x-=i.x,n.y-=i.y,n},at.moveArrayItem=function(t,e,n){if(!t)return null;let i=t.length;if(e>=i&&n>=i)return t;let o=t.splice(e,1)[0];return n<i?t.splice(n,0,o):t[n]=o,t},at.pushArrayItems=function(t,e){let n=e?e.length:0;if(n>0)if(n<1e5)n>1?Array.prototype.push.apply(t,e):t.push(e[0]);else{let i=0,o=0;for(;i<n;)o+=1e5,Array.prototype.push.apply(t,e.slice(i,o)),i=o}return t},at.insertEmptyItems=function(t,e,n){if(n>0)if(n>1){let i=t.slice(e);t.length=e,t.length+=n,at.pushArrayItems(t,i)}else t.splice(e,0,null)},at.cycleArray=function(t,e){if(e>0&&t&&e<t.length){let n=t.splice(0,e);return t.concat(n)}return t||null},at.lowerBound=function(t,e,n,i,o){(null==n||n<0)&&(n=0),(null==i||i<0||i>t.length)&&(i=t.length),n>i&&(n=i),null==o&&(o=at._defaultLessComparator);let r=0;for(;i>n;)r=n+i>>1,o(t[r],e)?n=r+1:i=r;return n},at.upperBound=function(t,e,n,i,o){let r=at.lowerBound(t,e,n,i,o);for(;t[r]===e;)++r;return r},at.stringFormat=function(t){let e=Array.prototype.slice.call(arguments,1);return t.replace(/{(\d+)}/g,(function(t,n){return null!=e[n]?e[n]:t}))},at._defaultLessComparator=function(t,e){return t<e},at._deprecatedFunction=function(){console.warn("Calling deprecated method")},at.calculatePercent=function(t,e,n){if(!t&&0!==t||!e&&0!==e||!n&&0!==n)return NaN;if(n===t)return 50;let i=(e-t)/(n-t);return i<0?0:i>1?100:100*i},at.closestElement=function(t,e){let n=t;for(;n;){if(n.classList&&n.classList.contains(e))return n;n=n.parentNode||n.host}return null},at._preventDefault=function(t){t.preventDefault(),t.stopPropagation()};const ut=at;let ht=function(t){this.dispatch=this.dispatch.bind(this),this._listeners=[],this.setSender(t)};ht.prototype.listen=function(t,e){if(t&&ut.isFunction(t)&&this._listeners.indexOf(t)<0)if(null==e)this._listeners.push(t);else{t._priority=e;let n=ut.lowerBound(this._listeners,t,0,this._listeners.length,ht.listenerComparer);this._listeners.splice(n,0,t)}},ht.prototype.unlisten=function(t){if(t){let e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}},ht.prototype.unlistenAll=function(){this._listeners.length=0},ht.prototype.getListenerCount=function(){return this._listeners.length},ht.prototype.hasListener=function(){return this._listeners.length>0},ht.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(let e=0;e<this._listeners.length;e++)this._listeners[e](t);null!==this._sender&&(t.sender=null),this._dispatching=!1}},ht.prototype.isDispatching=function(){return this._dispatching},ht.prototype.isEnabled=function(){return this._enabled},ht.prototype.enable=function(t){this._enabled=!1!==t},ht.prototype.disable=function(t){this._enabled=!1===t},ht.prototype.setSender=function(t){this._sender=t||null},ht.prototype.setEventArgExtender=function(t){this._extender=null!=t?t:null},ht.listenerComparer=function(t,e){return null==e._priority||t._priority>=e._priority},ht.prototype._listeners=null,ht.prototype._sender=null,ht.prototype._extender=null,ht.prototype._enabled=!0,ht.prototype._dispatching=!1,ht._proto=ht.prototype;const pt=ht;let dt=function(){};dt.prototype._customEvents=null,dt.prototype.listen=function(t,e,n){this._customEvents&&this._customEvents[t]&&this._customEvents[t].listen(e,n)},dt.prototype.unlisten=function(t,e){this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlisten(e)},dt.prototype.unlistenAll=function(t){if(t)this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(let t in this._customEvents)this._customEvents[t].unlistenAll()},dt.prototype._addEvent=function(t){t&&(this._customEvents||(this._customEvents={}),this._customEvents[t]||(this._customEvents[t]=new pt(this)))},dt.prototype._addEvents=function(t){let e=Array.isArray(t)?t:arguments,n=e.length;for(let t=0;t<n;++t)this._addEvent(e[t])},dt.prototype._isEventDispatching=function(t){let e=this._customEvents[t];return!!e&&e.isDispatching()},dt.prototype._disableEvent=function(t,e){let n=this._customEvents[t];n&&n.disable(e)},dt.prototype._hasListener=function(t){return!(!this._customEvents||!this._customEvents[t])&&this._customEvents[t].hasListener()},dt.prototype._dispatch=function(t,e){this._customEvents[t].dispatch(e)},dt._proto=dt.prototype;const ct=dt;let _t=function(){this._rows={},this._addEvent("dataComposed"),this._addEvent("dataChanged")};o.inherits(_t,ct),_t.prototype._rows,_t.prototype._composing=!1,_t.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0)},_t.prototype.setSubscriptions=function(){},_t.prototype.getSubscriptions=function(){return null},_t.prototype.addSubscription=function(){},_t.prototype.removeSubscription=function(){},_t.prototype.startAllSubscriptions=function(){},_t.prototype.stopAllSubscriptions=function(){},_t.prototype.getSubscription=function(){return null},_t.prototype.getPrimaryRic=function(){return""},_t.prototype.clearAllData=function(t){this._rows={},t||this._dispatchDataChange({globalChange:!0})},_t.prototype.clearColumnData=function(t,e){let n="string"==typeof t?[t]:t;for(let t=n.length;--t>=0;){let e=n[t];if(e)for(let t in this._rows)delete this._rows[t][e]}e||this._dispatchDataChange({globalChange:!0})},_t.prototype.getData=function(t,e){let n=this.getRowData(t);return n?n[e]:null},_t.prototype.getAllRics=function(){return null},_t.prototype.getAllRowIds=function(){let t=[];for(let e in this._rows)t.push(e);return t},_t.prototype.hasRowId=function(t){return!!this._rows[t]},_t.prototype.getColumnData=function(t){let e=[];for(let n in this._rows)e.push(this._rows[n][t]);return e},_t.prototype.getRowData=function(t){return this._rows[t]||null},_t.prototype.getMultipleRowData=function(t,e,n){let i=t.length;null==n&&(n=i),n>i&&(n=i),e>0||(e=0);let o=new Array(i),r=this._rows;for(let i=e;i<n;++i)o[i]=r[t[i]]||null;return o},_t.prototype.getAllRowData=function(){let t=[],e=this._rows;for(let n in e)t.push(e[n]);return t},_t.prototype.setData=function(t,e,n){let i={};return i[e]=n,this.setRowData(t,i)},_t.prototype.hasDataCloudData=function(t){},_t.prototype.setRowData=function(t,e,n){let i=this.getRowData(t),o=!1,r=null;if(e)if(i){for(let t in e)i[t]=e[t],o=!0;r=e}else i=e,this._rows[t]=i,o=!0;else i&&(delete this._rows[t],o=!0);if(o&&!this._composing){let e=n||{};e.rid=t,r&&(e.changes=r),e.rowData=i,this._dispatchDataChange(e)}return o},_t.prototype.cloneRowData=function(t){let e=this._rows[t];if(!e)return null;let n={};for(let t in e)0!==t.indexOf("FREE_TEXT")&&(n[t]=e[t]);return n},_t.prototype._replaceRowId=function(t,e){let n=this._rows;return!!n[t]&&(n[e]=n[t],delete n[t],!0)},_t.prototype.replaceRowIds=function(t){if("object"==typeof t)for(let e in t)this._replaceRowId(e,t[e])},_t.prototype.addStaticFields=function(){},_t.prototype.removeStaticFields=function(){},_t.prototype.resetStaticFields=function(){},_t.prototype.getStaticFields=function(){},_t.prototype.dump=function(t){return _t.constructTable(this.getAllRowData(),t,Object.keys(this._rows))},_t.prototype.log=function(t){console.table(this.dump(t))},_t.prototype.setDataCloudSettings=function(){},_t.prototype.getDataCloudFields=function(){},_t.prototype.addDataCloudFields=function(){},_t.prototype.removeDataCloudField=function(){},_t.prototype._dispatchDataChange=function(t){this._composing||(this._composing=!0,this._dispatch("dataComposed",t),this._composing=!1,this._dispatch("dataChanged",t))},_t._defaultPropertyGetter=function(t,e,n){let i=e[n];return i?i[t]:null},_t._defaultGetter=function(t,e){return t[e]},_t.constructTable=function(t,e,n){let i=0,o=t.length,r=o,s=null,l=n||null,a=_t._defaultGetter,u=!1;if(e){if(e.rowCount&&(r=e.rowCount,u=!0),e.colNames){s={};let t=e.colNames.length;for(let n=0;n<t;++n)s[e.colNames[n]]=!0;u=!0}e.getter&&(a="string"==typeof e.getter?_t._defaultPropertyGetter.bind(null,e.getter):e.getter,u=!0),e.startIndex&&(i=e.startIndex,u=!0),!1===e.withRowIds&&(l=null)}if(!u&&!l)return t;let h=[];for(let e=i;e<o&&!(h.length>=r);++e){let n=t[e],i=l?{rid:l[e]}:{};if(n){let t;if(s)for(t in s)null!=n[t]&&(i[t]=a(n,t));else for(t in n)i[t]=a(n,t)}h.push(i)}return h};const ft=_t;let gt=function(t,e){this._rid=t,this._childIds=[],this._shared=e,e.defaultCollapsing&&(this._collapsed=!0)};o.inherits(gt,s);const yt="Uncategorized";gt._subSegSortLogic=function(t,e){return t===yt?1:e===yt||t<e?-1:e<t?1:0},gt.prototype._shared=null,gt.prototype._rid,gt.prototype._childIds,gt.prototype._childDataIds=null,gt.prototype._collapsed=!1,gt.prototype._order=0,gt.prototype._offsetOrder=0,gt.prototype._depth=0,gt.prototype._disposed=!1,gt.prototype._subSegDef=null,gt.prototype._subSegment=!1,gt.prototype._subSegMap=null,gt.prototype._subSegNames=null,gt.prototype._subSegName="",gt.prototype._subSegVal,gt.prototype.dispose=function(){if(this._disposed)return;this._disposed=!0,this.removeAllEventListeners();let t=this._subSegNames;if(t){let e=t.length,n=this._subSegMap;for(let i=0;i<e;++i)n[t[i]].dispose();this._subSegMap=this._subSegNames=null}this._collapsed&&this.markCollapsingStateDirty(),this._childDataIds=null,this._childIds.length=0,this._shared=null,this._subSegDef=this._subSegVal=null},gt.prototype.getId=function(){return this._rid},gt.prototype.getParentId=function(){return this._shared.childToSegment[this._rid]||""},gt.prototype.getParent=function(){let t=this.getParentId();return t&&this._shared.segments[t]||null},gt.prototype.getSubSegmentIds=function(t){let e=this._subSegNames;if(e){t||(t=[]);let n=e.length,i=this._subSegMap;for(let o=0;o<n;++o){let n=i[e[o]];t.push(n.getId()),n.getSubSegmentIds(t)}return t}return null},gt.prototype.addChild=function(t,e){if(!t)return!1;let n=this._shared.childToSegment[t];if(n){if(n!==this._rid){let e=this._shared.segments[n];e&&!e.hasSubSegments()&&e.removeChild(t),this._shared.childToSegment[t]=this._rid}}else this._shared.childToSegment[t]=this._rid;return null!=e&&(e&&e!==t?(this._childDataIds||(this._childDataIds={}),this._childDataIds[t]=e):this._childDataIds&&delete this._childDataIds[t]),this._childIds.indexOf(t)<0&&(this._collapsed&&(this._shared.dirtyCollapsingState=!0),this._childIds.push(t),!0)},gt.prototype.addChildren=function(t,e){if(!t)return!1;let n=Array.isArray(t)?t:[t],i=n.length;if(!i)return!1;let o,r=0;if(null!=e)for(e=Array.isArray(e)?e:[e],o=0;o<i;++o)r|=this.addChild(n[o],e[o]);else for(o=0;o<i;++o)r|=this.addChild(n[o]);return!!r},gt.prototype.containsChild=function(t){return this._childIds.indexOf(t)>=0},gt.prototype.getChildIndex=function(t){return this._childIds.indexOf(t)},gt.prototype.removeChild=function(t){if(this._subSegment)return!1;if(!this._childIds.length)return!1;let e=this._childIds.indexOf(t);return!(e<0||(this._shared.childToSegment[t]===this._rid&&delete this._shared.childToSegment[t],this._childIds.splice(e,1),this._collapsed&&(this._shared.dirtyCollapsingState=!0),0))},gt.prototype.removeChildren=function(t){if(this._subSegment)return!1;if(!this._childIds.length)return!1;let e=Array.isArray(t)?t:[t],n=e.length,i=0;for(let t=0;t<n;++t)i|=this.removeChild(e[t]);return!!i},gt.prototype.removeAllChildren=function(){if(this._subSegment)return!1;let t=this._childIds.length;if(!this._childIds.length)return!1;let e=this._rid,n=this._shared.childToSegment,i=this._childIds;for(let o=0;o<t;++o){let t=i[o];n[t]===e&&delete n[t]}return this._childIds.length=0,this._childDataIds=null,this._collapsed&&(this._shared.dirtyCollapsingState=!0),!0},gt.prototype.getChildIds=function(){return this._childIds},gt.prototype.getChildren=function(){let t={},e=this._childIds,n=e.length,i=this._childDataIds||{};for(let o=0;o<n;++o){let n=e[o];t[n]=i[n]||n}return t},gt.prototype.getChildCount=function(){return this._childIds.length},gt.prototype.markCollapsingStateDirty=function(){(this._childIds.length||this._subSegDef)&&(this._shared.dirtyCollapsingState=!0)},gt.prototype.getClassification=function(){return this._subSegDef&&this._subSegDef.classifiers||null},gt.prototype.setClassification=function(t){if(this._subSegment)return!1;let e=null;this._subSegDef&&(e=this._subSegDef.classifiers);let n,i=null;t&&("string"==typeof t?i=[t]:Array.isArray(t)&&(i=t));let o=i?i.length:0;if(o){if((e?e.length:0)===o){for(n=0;n<o&&i[n]===e[n];++n);if(n>=o)return!1}return this._subSegDef||(this._subSegDef={root:this,subSegments:null}),this._subSegDef.classifiers=i,!0}return!!e&&(this._subSegDef.classifiers=null,this._subSegDef=null,!0)},gt.prototype.classify=function(t){let e=this._subSegDef?this._subSegDef.classifiers:null,n=e?e.length:0,i=this._subSegNames,o=i?i.length:0;if(!o&&this._depth>=n)return!1;let r,s=this._shared;this._collapsed&&(s.dirtyCollapsingState=!0);let l="",a={},u=0,h=this._subSegMap,p=null;if(o)for(u=o,r=0;r<u;++r)l=i[r],a[l]=1,p=h[l],p._childIds.length&&(p._childIds.length=0),p._collapsed&&(s.dirtyCollapsingState=!0);let d,c=!this._subSegment,_=this._childDataIds||{},f=this._childIds,g=f.length;if(this._depth<n&&t){h||(h=this._subSegMap={},i=this._subSegNames=[]);let n=e[this._depth];for(r=0;r<g;++r){d=f[r];let e=_[d]||d,o=t[e],c=o?o[n]:null;if(s.childToSegment[d]=this._rid,l=yt,(c||0===c||!1===c)&&(l=c+""),a[l]&&(a[l]=0,--u),p=h[l],!p){let t=this._rid+"/"+l;p=new gt(t,s),p._subSegDef=this._subSegDef,p._subSegment=!0,p._depth=this._depth+1,p._subSegName=l,p._subSegVal=c,s.childToSegment[t]=this._rid,h[l]=p,i.push(l),this._dispatch("subSegmentAdded",{rid:t,segment:p})}p.addChild(d,e)}}else if(c)for(r=0;r<g;++r)d=f[r],s.childToSegment[d]=this._rid;if(u>0){for(l in u>=i.length&&(i.length=0),a)if(a[l]){p=h[l],delete h[l];let t=i.indexOf(l);t>=0&&i.splice(t,1),this._dispatch("subSegmentRemoved",{rid:p.getId(),segment:p})}i.length||(i=this._subSegMap=this._subSegNames=null)}if(o=i?i.length:0,o)for(i.sort(gt._subSegSortLogic),r=0;r<o;++r)p=h[i[r]],p.classify(t);return!0},gt.prototype.hasSubSegments=function(){return!!this._subSegNames&&!!this._subSegNames.length},gt.prototype.isSubSegment=function(){return this._subSegment},gt.prototype.isRootSegment=function(){return!this._shared.childToSegment[this._rid]},gt.prototype.getFirstAncestor=function(){let t=null;if(this._subSegment&&this._subSegDef)t=this._subSegDef.root;else if(t=this.getParent(),t){let e=t.getParent();for(;e;)t=e,e=t.getParent()}return t||null},gt.prototype.getAllSubSegments=function(t){let e=this._subSegNames;if(e){t||(t=[]);let n=this._subSegMap,i=e.length;for(let o=0;o<i;++o){let i=n[e[o]];t.push(i),i.getAllSubSegments(t)}}return t||null},gt.prototype.updateTreeStructure=function(t,e,n){let i;t||(t=0,this._subSegment||(this._depth=0)),e||(e=0),n||(n={});let o=this._subSegNames,r=o?o.length:0;if(r){let s=this._subSegMap;for(i=0;i<r;++i){let r=s[o[i]];++t,n[r.getId()]=e+t,r.setOrder(t),t=r.updateTreeStructure(t,e,n)}}else{let o=this._childIds,r=o.length,s=this._shared.segments,l="";for(i=0;i<r;++i){let r=o[i],a=s[r],u=a?a.getId():yt;l!==u&&(++t,l=u),n[r]=e+t,a&&(a._depth=this._depth+1,a.setOrder(t),t=a.updateTreeStructure(t,e,n))}}return this.setLastOrder(t)},gt.prototype.calcSubSegmentOrder=gt.prototype.updateTreeStructure,gt.prototype.getSegmentLevel=function(){return this._depth},gt.prototype.setRowData=function(t,e){if(!t)return;let n=t[this._rid];n||(n=t[this._rid]={}),e||(e=t),n=e[this._rid],n||(n=e[this._rid]={});let i=this;for(;i&&i.isSubSegment();)i.getSubSegmentName(n),i=i.getParent()},gt.prototype.getSubSegmentName=function(t){if(t&&this._subSegment){let e=this.getClassification()[this._depth-1];e&&(t[e]=this._subSegName)}return this._subSegName},gt.prototype.sortSegments=function(t){if(!t||this.hasSubSegments())return!1;let e=this._childIds,n=e.length,i=this._shared.segments;for(let o=0;o<n;++o)if(i[e[o]])return this._childIds.sort(t),!0;return!1},gt.prototype.getFlattenTreeIds=function(t){let e;t||(t=[]),this._subSegment||t.push(this._rid);let n=this._subSegNames;if(n){let i=n.length,o=this._subSegMap;for(e=0;e<i;++e)o[n[e]].getFlattenTreeIds(t)}else{let n=this._childIds,i=n.length,o=this._shared.segments;for(e=0;e<i;++e){let i=n[e],r=o[i];r?r.getFlattenTreeIds(t):t.push(i)}}return t},gt.prototype.collapse=function(t){return t=!1!==t,this._collapsed!==t&&(this._collapsed=t,this.markCollapsingStateDirty(),!0)},gt.prototype.expand=function(t){return this.collapse(!1===t)},gt.prototype.isCollapsed=function(){return this._collapsed},gt.prototype.getCollapsingStates=function(t,e){let n=this._subSegNames,i=this._subSegMap,o=!0;!n&&this._shared&&(n=this._childIds,i=this._shared.segments,o=!1);let r=n?n.length:0;if(!r)return!1;let s=!1,l=!(!e&&!this._collapsed);t||(t={});for(let e=0;e<r;++e){let r="",a=null;o?(a=i[n[e]],r=a.getId()):(r=n[e],a=i[r]),l&&(t[r]=l,s=!0),a&&a.getCollapsingStates(t,l)&&(s=!0)}return s},gt.prototype.getOrder=function(){let t=this.getFirstAncestor();return t?t._order+this._order:this._order},gt.prototype.getLastOrder=function(){let t=this.getFirstAncestor();return t?t.getLastOrder():this._order+this._offsetOrder},gt.prototype.setOrder=function(t){this._order=t},gt.prototype.setLastOrder=function(t){return this._offsetOrder=t},gt._tabs=null,gt.prototype.log=function(t,e){let n;t||(t=[]);let i=gt._tabs;if(!i){i=gt._tabs=[];let t="";for(n=0;n<11;++n)i[n]=t,t+=" "}e||(e=0);let o=this._collapsed?"+ ":"- ";t.push(i[e]+o+this._rid);let r=e+1,s=i[r],l=this._subSegNames,a=this._subSegMap,u=!0;!l&&this._shared&&(l=this._childIds,a=this._shared.segments,u=!1);let h=l?l.length:0;for(n=0;n<h;++n){let e="",i=null;u?(i=a[l[n]],e=i.getId()):(e=l[n],i=a[e]),i?i.log(t,r):t.push(s+"- "+e)}return t};let mt=function(){this._onSubSegmentAdded=this._onSubSegmentAdded.bind(this),this._onSubSegmentRemoved=this._onSubSegmentRemoved.bind(this),this._segments={},this._insertionList=[],this._removalList=[],this._shared={segments:this._segments,childToSegment:{},dirtyCollapsingState:!1,defaultCollapsing:!1}};o.inherits(mt,s),mt.prototype._segments,mt.prototype._segmentCount=0,mt.prototype._collapsedRids=null,mt.prototype._shared,mt.prototype._segmentList=null,mt.prototype._insertionList=null,mt.prototype._removalList=null,mt.prototype._classification=!1,mt.prototype._classifierChanged=!1,mt.prototype._rowOrders=null,mt.prototype.dispose=function(){this.removeAllSegments(),this.removeAllEventListeners(),this._collapsedRids=null,this._segmentList=this._rowOrders=this._insertionList=this._removalList=null},mt.prototype.addSegment=function(t,e){if(t&&!this._segments[t]){let n=this._segments[t]=new gt(t,this._shared);return n.addEventListener("subSegmentAdded",this._onSubSegmentAdded),n.addEventListener("subSegmentRemoved",this._onSubSegmentRemoved),++this._segmentCount,this.invalidateSegmentOrder(),e&&e.length&&n.addChildren(e),!0}return!1},mt.prototype.addSegments=function(t){let e=Array.isArray(t)?t:[t],n=e.length,i=0;for(let t=0;t<n;++t)i|=this.addSegment(e[t]);return!!i},mt.prototype.containsSegment=function(t){return!!this._segments[t]},mt.prototype.getParentRowId=function(t){return this._shared.childToSegment[t]||""},mt.prototype.removeSegment=function(t){let e=this._segments[t];if(!e)return!1;if(this._segmentCount<=1)return this.removeAllSegments();let n=e.isSubSegment();n&&this._removalList.push(e.getId());let i=e.getSubSegmentIds();if(i){let t=i.length;for(let e=0;e<t;++e){let t=i[e];this._segments[t]&&(this._removalList.push(t),delete this._segments[t],--this._segmentCount)}}if(!n){let t=e.getParent();t&&t.addChildren(e.getChildIds())}return e.removeAllChildren(),e.dispose(),delete this._segments[t],--this._segmentCount,this.invalidateSegmentOrder(),!0},mt.prototype.removeAllSegments=function(){if(this._segmentCount){for(let t in this._segments)this._segments[t].dispose();return this._segments={},this._segmentCount=0,this._segmentList=this._rowOrders=null,this._shared.segments=this._segments,this._shared.childToSegment={},this._classification=this._classifierChanged=!1,!0}return!1},mt.prototype.getSegmentCount=function(){return this._segmentCount},mt.prototype.getSegment=function(t){return this._segments[t]||null},mt.prototype.getSegmentParent=function(t){let e=this.getParentRowId(t);return e?this.getSegment(e):null},mt.prototype.getSegments=function(){return this._segmentCount?this._segments:null},mt.prototype.getSegmentIds=function(){return Object.keys(this._segments)},mt.prototype.sortSegments=function(t){let e=[],n=this._segments;for(let i in n){let o=n[i];o.sortSegments(t),o.isRootSegment()&&e.push(o)}return e.sort(t),this.invalidateSegmentOrder(),e},mt.prototype.collapseSegments=function(t,e){let n=0;if(this._segmentCount){let i=t.length;for(let o=0;o<i;o++){let i=this._segments[t[o]];i&&(n|=i.collapse(e))}}return!!n},mt.prototype.collapseSegment=function(t,e){let n=this._segments[t];return!!n&&n.collapse(e)},mt.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},mt.prototype.expandAllSegments=function(){if(this._segmentCount){let t=this._segments,e=0;for(let n in t)e|=t[n].expand();if(e)return!0}return!1},mt.prototype.isCollapsedSegment=function(t){let e=this._segments[t];return!!e&&e.isCollapsed()},mt.prototype.getCollapsedRows=function(){if(this._shared.dirtyCollapsingState){this._shared.dirtyCollapsingState=!1;let t=null,e=0;if(this._segmentCount){let n=this._segments;t={};for(let i in n){let o=n[i];o.isRootSegment()&&o.getCollapsingStates(t)&&++e}}this._collapsedRids=e?t:null}return this._collapsedRids},mt.prototype.invalidateSegmentOrder=function(){return!!this._segmentList&&(this._segmentList=this._rowOrders=null,!0)},mt.prototype.addSegmentChild=function(t,e,n){let i=this._segments[t];return!(!i||i.isSubSegment())&&(this.invalidateSegmentOrder(),i.addChild(e,n))},mt.prototype.addSegmentChildren=function(t,e,n){let i=this._segments[t];return!(!i||i.isSubSegment())&&(this.invalidateSegmentOrder(),i.addChildren(e,n))},mt.prototype.containsSegmentChild=function(t,e){let n=this._segments[t];return!!n&&n.containsChild(e)},mt.prototype.removeSegmentChild=function(t,e){let n=this._segments[t];return!!n&&(this.invalidateSegmentOrder(),n.removeChild(e))},mt.prototype.removeSegmentChildren=function(t,e){let n=this._segments[t];return!!n&&(this.invalidateSegmentOrder(),n.removeChildren(e))},mt.prototype.removeAllSegmentChildren=function(){this._shared.childToSegment={};let t=this._segments,e=!1;for(let n in t)t[n].removeAllChildren()&&(e=!0);return e&&(this.invalidateSegmentOrder(),this.classify(null)),e},mt.prototype.fillSegment=function(t,e){let n=Array.isArray(e)?e.length:0;if(!n)return;let i=this._segments,o=i[t];if(o&&!o.isSubSegment()){let r=e.indexOf(t);if(r>=0){o.removeAllChildren();for(let t=r+1;t<n;++t){let n=e[t];if(i[n])break;o.addChild(n)}this.invalidateSegmentOrder()}}},mt.prototype.fillSegments=function(t){this._shared.childToSegment={};let e=Array.isArray(t)?t.length:0,n=this._segments,i=null,o=!1;for(let r=0;r<e;++r){let e=t[r],s=n[e];s&&!s.isSubSegment()?(i=s,i.removeAllChildren()):i&&!i.isSubSegment()&&(i.addChild(e),o=!0)}return o&&this.invalidateSegmentOrder(),o},mt.prototype.calcSegmentOrder=function(t,e){let n=this._segmentList;if(n){if(e)return;n.length=0}else n=this._segmentList=[];this._rowOrders={};let i=this._rowOrders,o=this._segments,r=this._shared.childToSegment,s=yt,l=t?t.length:0,a=0;for(let e=0;e<l;++e){let n=t[e];if(!r[n]){let t=o[n],e=t?t.getId():yt;s!==e&&(++a,s=e);let r=1e4*a;i[n]=r,t&&(this._segmentList.push(t),t.setOrder(r),t.updateTreeStructure(0,r,i))}}},mt.prototype.getSegmentValues=function(t,e){let n=t?t.length:0;if(!n)return null;let i=this._rowOrders;if(!i)return null;let o=new Array(n),r=0;for(let e=0;e<n;++e){let n=i[t[e]];null!=n?r<n&&(r=n):n=r?r+1e4:0,o[e]=n}return r?o:null},mt.prototype.logStructure=function(){let t=this._segmentList;if(!t)return"";let e=t.length,n=[];for(let i=0;i<e;++i){let e=t[i];e.isRootSegment()&&e.log(n)}return n.join("\n")},mt.prototype.logRowIdMap=function(){let t=[],e=this._segments,n=this._shared.childToSegment;for(let i in n){let o=n[i],r=e[o];r&&r.isSubSegment()||t.push(i+" > "+o)}return t.join("\n")},mt.prototype.setSegmentClassification=function(t,e){let n=this._segments[t];return!(!n||!n.setClassification(e)||(n.getClassification()&&(this._classification=!0),this._classifierChanged=!0,0))},mt.prototype.hasClassification=function(){return this._classification||this._classifierChanged},mt.prototype.classify=function(t){if(!this._segmentCount)return!1;if(!this.hasClassification())return!1;this._classification=this._classifierChanged=!1;let e=this._segments;for(let n in e){let e=this._segments[n];e.isSubSegment()||(e.getClassification()&&(this._classification=!0),e.classify(t))}return this._insertionList.length||this._removalList.length?(this.invalidateSegmentOrder(),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)},mt.prototype._onSubSegmentAdded=function(t){let e=t.rid;if(this._segments[e])console.log("Incorrect logic detected.");else{let n=t.segment;this._insertionList.push(n),this._segments[e]=n,this._segmentCount++,n.addEventListener("subSegmentAdded",this._onSubSegmentAdded),n.addEventListener("subSegmentRemoved",this._onSubSegmentRemoved)}},mt.prototype._onSubSegmentRemoved=function(t){let e=t.rid;this.removeSegment(e)},mt.prototype.setDefaultCollapsing=function(t){let e=!!t;return this._shared.defaultCollapsing!==e&&(this._shared.defaultCollapsing=e,!0)};const Ct=mt;let St=function(){St.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")};o.inherits(St,ft),St.prototype._prevData=null,St.prototype._rids,St.prototype._frozen=!1,St.prototype._runningId=0,St.prototype._compMap=null,St.prototype._segments=null,St.prototype._autoSegmentFilling=!1,St.prototype._removedRows=null,St.prototype._userSegmentComparer=null,St.prototype._segmentSortOrder=0,St.prototype._segmentSortContext=null,St.prototype._clsSource=null,St.prototype._classifyingTimer=0,St.prototype._segmentDefaultCollapsing=!1,St.SortLogic,St.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._classifyingTimer&&(clearTimeout(this._classifyingTimer),this._classifyingTimer=0),this._compMap=null,this._clsSource=null,St._removeIndexArray(),this._segments&&(this._segments.dispose(),this._segments=null)},St.prototype.getColumnData=function(t){let e=new Array(this._rids.length);for(let n=this._rids.length;--n>=0;)e[n]=this._rows[this._rids[n]][t];return e},St.prototype.getRowId=function(t){return this._rids[t]||""},St.prototype.getAllRowIds=function(t){return t?this._rids:this._rids.slice(0)},St.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},St.prototype.getRowCount=function(){return this._rids.length},St.prototype.getDataAt=function(t,e){return this.getData(this._rids[t],e)},St.prototype.getRowDataAt=function(t){return this.getRowData(this._rids[t])},St.prototype.getPreviousData=function(t,e){let n=this._prevData[t]||null;return n?n[e]:null},St.prototype.setData=function(t,e,n){if(!this._needFiring())return this._setData(t,e,n);let i={};return i[e]=n,this.setRowData(t,i)},St.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{let e=this._segments.getParentRowId(t);e&&this._segments.removeSegmentChild(e,t)}return!1},St.prototype.setRowData=function(t,e,n){if(!t)return!1;let i=this.getRowData(t),o=!1,r="updated",s=!1;if(e){if(i){let n=this._prevData[t];for(let t in e)n[t]=i[t],i[t]=e[t]}else if(r="inserted",i=e,this._rows[t]=i,this._prevData[t]={},n){let e=n.nextRid,i=e?this.getRowIndex(e):-1;i<0&&(i=n.fallback),null==i||i<0||i>=this._rids.length?this._rids.push(t):(this._rids.splice(i,0,t),this._segments&&this._segments.invalidateSegmentOrder(),s=!this._isLastSegment(i))}else this._rids.push(t);o=!0}else i&&(r="removed",this._prevData[t]=this._rows[t],delete this._rows[t],s=this._removeRidFromSegments(t),St._removeArrayItem(this._rids,t),o=!0);if(o&&this._needFiring()){if(this._autoFillSegments())this.dispatchGlobalChange();else{let o=n||{};o.rid=t,o.changes=e,o.rowData=i,o.type=r,s&&(o.segmentChanged=!0),this._dispatchDataChange(o)}this.requestClassifying()}return o},St.prototype.setColumnData=function(t,e,n){let i=e?e.length:0;if(i<0)return;let o=this._frozen;this.freeze();let r=this._generateRids(i,n);for(let n=0;n<i;++n)this._setData(r[n],t,e[n]);this.freeze(o)},St.prototype.setDataFromObjectMap=function(t){if(!t)return;if(Array.isArray(t))return void this.addRows(t);let e=this._frozen;this.freeze();for(let e in t)this.setRowData(e,t[e]);this.freeze(e)},St.prototype.setDataFrom2DArray=function(t,e,n){let i=t?t.length:0;if(i<0)return;let o=this._frozen;this.freeze();let r=0,s=this._generateRids(i,n);for(let n=0;n<i;++n){let i=t[n],o=s[n];if(e)for(r=i.length;--r>=0;)this._setData(o,e[r],i[r]);else for(r=i.length;--r>=0;)this._setData(o,""+r,i[r])}this.freeze(o)},St.prototype.setDataAt=function(t,e,n){let i=this.getRowId(t);return!!i&&this.setData(i,e,n)},St.prototype.setRowDataAt=function(t,e,n){let i=this.getRowId(t);return!!i&&this.setRowData(i,e,n)},St.prototype.addRow=function(t,e){return t||(t={}),e=this._generateUniqueRid(t,e),this.setRowData(e,t),e},St.prototype.addRows=function(t,e){if(!Array.isArray(t))return;let n=t.length;if(!n)return;if(1===n)return void this.addRow(t[0],e?e[0]:null);e||(e=[]);let i=this._frozen;this.freeze();for(let i=0;i<n;++i)this.addRow(t[i],e[i]);this.freeze(i)},St.prototype.unshiftRow=function(t,e){return this.insertRow(0,t,e)},St.prototype.insertRow=function(t,e,n){let i=null;return"number"==typeof t?(i={},i.nextRid=this._rids[t],i.fallback=t):t&&(i={},i.nextRid=t),e||(e={}),n=this._generateUniqueRid(e,n),this.setRowData(n,e,i),n},St.prototype.insertAfter=function(t,e,n){let i="string"==typeof t?this.getRowIndex(t):t;return!(i>=0)||i>=this._rids.length-1?this.addRow(e,n):this.insertRow(i+1,e,n)},St.prototype.removeRow=function(t){"number"==typeof t?this.setRowData(this.getRowId(t),null):this.setRowData(t,null)},St.prototype.removeRows=function(t){let e,n;if(1===t.length)return e=t[0],void("number"==typeof e?this.removeRow(e):this.setRowData(e,null));let i=!1;for(this._removedRows={},n=t.length;--n>=0;)e=t[n],"number"==typeof e&&(e=this.getRowId(e)),this.getRowData(e)&&(this._prevData[e]=this._rows[e],this._removedRows[e]=1,delete this._rows[e],this._removeRidFromSegments(e),i=!0);i?(this._rids=this._rids.filter(this._removeRows),this._removedRows=null,this.dispatchGlobalChange()):this._removedRows=null},St.prototype._removeRows=function(t){return!this._removedRows[t]},St._removeArrayItem=function(t,e){let n=t.indexOf(e);return n>=0&&(n>=t.length?t.pop():t.splice(n,1),!0)},St.prototype.clearAllData=function(t){St.base(this,"clearAllData",!0),this._prevData={},this._segments&&(this._segments.dispose(),this._segments=null),this._rids.length&&(this._rids.length=0,this.dispatchGlobalChange(t))},St.prototype.removeAllRows=St.prototype.clearAllData,St._ascendingOrder=function(t,e){return t-e},St.prototype.moveRow=function(t,e,n){let i=null,o="";if(e>=0&&e<this._rids.length||(e=this._rids.length),Array.isArray(t)){let n=t;n.sort(St._ascendingOrder);let r=[];for(let t=n.length;--t>=0;){let i=n[t];o=this._rids[i],o&&(r.unshift(o),this._rids.splice(i,1),i<e&&--e)}r.length&&(this._rids.splice.apply(this._rids,[e,0].concat(r)),i=r)}else t<0&&(t=0),t!==e&&t+1!==e&&(o=this._rids.splice(t,1)[0],o&&(t<e&&--e,this._rids.splice(e,0,o),i=o));return i&&(this._segments&&(this._segments.invalidateSegmentOrder(),this._sort(null)),this._dispatchPositionChange(n)),i},St.prototype._moveRow=function(t,e,n){let i=t.length;if(!i)return null;let o=new Array(i);for(let e=0;e<i;++e)o[e]=this.getRowIndex(t[e]);let r=e?this.getRowIndex(e):this._rids.length;return i>1?this.moveRow(o,r,n):this.moveRow(o[0],r,n)},St.prototype.moveRows=function(t,e,n,i){"string"==typeof t&&(t=this.getRowIndex(t)),"string"==typeof e&&(e=this.getRowIndex(e)),t<0&&(t=0),e<0&&(e=this._rids.length),n||(n=1);let o=t+n-1,r=e;if(e>=t&&(r=e<=o?t:e-n),n>0&&o<=this._rids.length){r>this._rids.length&&(r=this._rids.length);let e=this._rids.splice(t,n),o=[r,0].concat(e);return Array.prototype.splice.apply(this._rids,o),this._segments&&this._sort(null),this._dispatchPositionChange(i),e}return null},St.prototype.swapRow=function(t,e){let n=this._rids.length;if(t<0||t>=n)return;if(e<0||e>=n)return;let i=this._rids[t];this._rids[t]=this._rids[e],this._rids[e]=i},St.prototype._replaceRowId=function(t,e){let n=this._rids,i=n.indexOf(t);return i>=0&&(n[i]=e,this._rows[e]=this._rows[t],delete this._rows[t],this._prevData[e]=this._prevData[t],delete this._prevData[t],!0)},St.prototype.replaceRowIds=function(t){if("object"==typeof t){let e=!1;for(let n in t)e|=this._replaceRowId(n,t[n]);e&&this.dispatchGlobalChange()}},St.prototype.clearRowData=St.prototype.removeRow,St.prototype.clearColumnData=function(t,e){let n="string"==typeof t?[t]:t;for(let t=n.length;--t>=0;){let e=n[t];if(e)for(let t in this._rows)delete this._rows[t][e],delete this._prevData[t][e]}this.dispatchGlobalChange(e)},St.prototype.getDataSource=function(){return null},St.prototype.setDataSource=function(t){},St.prototype.getSortingLogics=function(){return this._compMap},St.prototype.sortOnce=function(t,e,n,i){let o=St._buildSortContext([],t,e,n||this._compMap,i);return!!this._sort(o)&&(this._dispatchPositionChange(),!0)},St.prototype.setSortingLogic=function(t){this._compMap._default=t},St.prototype.setColumnSortingLogic=function(t,e){t&&(this._compMap[t]=e)},St.prototype.getColumnSortingLogic=function(t){if(t){let e=this._compMap[t];if(e)return e}return this._compMap._default||null},St.prototype.freeze=function(t){t=!1!==t;let e=this._frozen;return e!==t&&(this._frozen=t,!t&&this._segments&&this._segments.invalidateSegmentOrder(),this._autoFillSegments(),this.dispatchGlobalChange()),e},St.prototype.unfreeze=function(t){return this.freeze(!1===t)},St.prototype.isFrozen=function(){return this._frozen},St.prototype._initSegmentCollection=function(){this._segments||(this._segments=new Ct,this._segments.setDefaultCollapsing(this._segmentDefaultCollapsing),this._segments.addEventListener("subSegmentChanged",this._onSubSegmentChanged))},St.prototype.setSegmentSeparators=function(t,e){if(!t)return!1;let n=!1!==e,i=0,o=0,r=t.length;for(let e=0;e<r;e++){let r=t[e];if(n){if(this._initSegmentCollection(),this._autoSegmentFilling){let t=this._segments.getParentRowId(r);t&&this._segments.removeSegmentChild(t,r)}i|=this._segments.addSegment(r)}else this._segments&&this._segments.getSegment(r)&&this._segments.removeSegment(r)&&(o=1,this._segments.getSegmentCount()||(this._segments=null))}let s=i||o;return s&&this._needFiring()&&this.dispatchGlobalChange(),!!s},St.prototype.setSegmentSeparator=function(t,e){let n=!1,i=0;if(t&&"string"==typeof t)if(!1!==e){if(this._initSegmentCollection(),this._autoSegmentFilling){let e=this._segments.getParentRowId(t);e&&this._segments.removeSegmentChild(e,t)}let i=e&&e.children?e.children:null;this._segments.addSegment(t,i)&&(n=!0)}else if(this._segments){let e=this._segments.getSegment(t);e&&(i=e.getChildCount(),this._segments.removeSegment(t)&&(n=!0,this._segments.getSegmentCount()||(this._segments=null)))}if(n&&this._needFiring())if(this._autoFillSegments()||i)this.dispatchGlobalChange();else{let e=this._rows[t]||null;e&&this._dispatchDataChange({rid:t,changes:{},rowData:e,type:"updated",segmentChanged:!0})}return n},St.prototype.unsetAllSegmentSeparators=function(){return!!this._segments&&(this._segments.dispose(),this._segments=null,this.dispatchGlobalChange(),!0)},St.prototype.hasSegmentation=function(){return!!this._segments},St.prototype.hasSegmentClassification=function(){return!!this._segments&&this._segments.hasClassification()},St.prototype.isSegmentSeparator=function(t){return!!this._segments&&this._segments.containsSegment(t)},St.prototype.getSegment=function(t){return this._segments?this._segments.getSegment(t):null},St.prototype.getSegmentParent=function(t){return this._segments?this._segments.getSegmentParent(t):null},St.prototype.getSegmentLevel=function(t){let e=this.getSegment(t);return e?e.getSegmentLevel()+1:0},St.prototype.getSegmentParentRowId=function(t){return this._segments?this._segments.getParentRowId(t):""},St.prototype.getSegmentValues=function(t,e){return this._segments?(this._segments.calcSegmentOrder(this._rids,!0),this._segments.getSegmentValues(t||this._rids,e)):null},St.prototype._isLastSegment=function(t){let e=this._segments;if(e){let n=this._rids,i=n.length;for(let o=t+1;o<i;++o)if(e.containsSegment(n[o]))return!1}return!0},St.prototype._getSegmentSeparators=function(){return this._segments},St.prototype.enableAutoSegmentFilling=function(t){this._autoSegmentFilling=0!=t,this._autoFillSegments()},St.prototype._autoFillSegments=function(){return!!this._autoSegmentFilling&&this.fillSegments()},St.prototype.fillSegment=function(t){this._segments&&(this._segments.fillSegment(t,this._rids),this.dispatchGlobalChange(),this.requestClassifying())},St.prototype.fillSegments=function(){if(this._segments){let t=this._segments.fillSegments(this._rids);return t&&(this.dispatchGlobalChange(),this.requestClassifying()),t}return!1},St.prototype._onSegmentChildChanged=function(t){!1!==t&&this._sort(null),this._dispatchPositionChange(),this.requestClassifying()},St.prototype.addSegmentChild=function(t,e,n){return!(!this._segments||!this._segments.addSegmentChild(t,e,n))&&(this._onSegmentChildChanged(),!0)},St.prototype.addSegmentChildren=function(t,e,n){return!(!this._segments||!this._segments.addSegmentChildren(t,e,n))&&(this._onSegmentChildChanged(),!0)},St.prototype.setSegmentChildren=function(t){if(!this._segments)return!1;let e=this._segments.removeAllSegmentChildren(),n=t.length;for(let i=0;i<n;i++){let n=t[i];this._segments.addSegmentChildren(n.segmentId,n.rowIds)&&(e=!0)}return!!e&&(this._onSegmentChildChanged(),!0)},St.prototype.removeSegmentChild=function(t,e){if(this._segments){let n=this._segments.removeSegmentChild(t,e);return n&&this._onSegmentChildChanged(!1),n}return!1},St.prototype.removeSegmentChildren=function(t,e){if(this._segments){let n=this._segments.removeSegmentChildren(t,e);return n&&this._onSegmentChildChanged(!1),n}return!1},St.prototype.removeAllSegmentChildren=function(){if(this._segments){let t=this._segments.removeAllSegmentChildren();return t&&this._onSegmentChildChanged(!1),t}return!1},St.prototype.getSegmentIds=function(){return this._segments?this._segments.getSegmentIds():null},St.prototype.getSegmentChildIds=function(t){if(this._segments){let e=this._segments.getSegment(t);if(e){let t=e.getChildIds();return t.length?t:null}}return null},St.prototype._setSegmentSortContext=function(t,e){this._segmentSortOrder=t,this._segmentSortContext=e},St.prototype.sortSeparators=function(t,e,n){if(!this._segments)return!1;if("function"==typeof t)return this._setSegmentSortContext(St._getSortOrder(e),n),this.sortSegments(t);if(!n)return!1;let i=St._buildSortContext([],n,e,t||this._compMap),o=i.length,r=null;if(o>1)r=St._multiColumnSeparatorCompareLogic,this._setSegmentSortContext(1,i);else{if(1!==o)return!1;r=St._singleColumnSeparatorCompareLogic,this._setSegmentSortContext(i[0][3],i[0])}return this.sortSegments(r)},St.prototype.sortSegments=function(t){if(!this._segments)return!1;if("function"!=typeof t)return!1;this._userSegmentComparer=t;let e=this._segments,n=e.sortSegments(this._bySegmentSeparator);this._userSegmentComparer=null,this._setSegmentSortContext(0,null);let i=this._rids,o=i.slice(),r=i.length;i.length=0;let s=0,l=!1;for(let t=0;t<r;++t){let r=o[t],a=e.getSegment(r);a?a.isRootSegment()&&n[s++].getFlattenTreeIds(i):e.getParentRowId(r)||i.push(r),r!==i[t]&&(l=!0)}return l&&(this._sort(null),this._dispatchPositionChange()),l},St.prototype._bySegmentSeparator=function(t,e){return this._userSegmentComparer(this._getRowDataFromSegment(t),this._getRowDataFromSegment(e),this._segmentSortOrder,this._segmentSortContext)},St.prototype._getRowDataFromSegment=function(t){var e=null;return t&&("string"==typeof t?e=this.getRowData(t):t.getId&&(e=this.getRowData(t.getId()))),e},St.prototype.setClassificationSource=function(t){this._clsSource=null,t&&t._rows&&(this._clsSource=t._rows)},St.prototype.setSegmentClassification=function(t,e){return!(!this._segments||!this._segments.setSegmentClassification(t,e))&&this.classifySegments()},St.prototype.classifySegments=function(){return!(!this._segments||!this._rids.length)&&this._segments.classify(this._clsSource||this._rows)},St.prototype.requestClassifying=function(){this._segments&&!this._classifyingTimer&&this._segments.hasClassification()&&(this._classifyingTimer=setTimeout(this._onClassifyingTimer,10))},St.prototype._onClassifyingTimer=function(){this._classifyingTimer=0,this.classifySegments()},St.prototype._onSubSegmentChanged=function(t){let e,n=t.insertionList,i=t.removalList,o=!1,r=this._rows,s=this._clsSource||r,l=this._rids,a=this._prevData,u=i.length,h={};for(e=0;e<u;e++){let t=i[e];r[t]&&(h[t]=a[t]=r[t],delete r[t],St._removeArrayItem(l,t),o=!0)}let p=n.length;for(e=0;e<p;e++){let t=n[e],i=t.getParentId(),u=t.getId();if(!r[u]){a[u]={},t.setRowData(r,s);let e=l.indexOf(i);e<0||e+1>=l.length?l.push(u):l.splice(e+1,0,u),o=!0}}o&&(t.removedRows=h,this._dispatch("subSegmentChanged",t),this.dispatchGlobalChange())},St.prototype.setSegmentDefaultCollapsing=function(t){return this._segmentDefaultCollapsing!==t&&(this._segmentDefaultCollapsing=t,this._segments&&this._segments.setDefaultCollapsing(t),!0)},St.prototype._sort=function(t){let e=this._rids,n=this.getMultipleRowData(e),i=this.getSegmentValues(e),o=St._performMultiLevelSorting(n,t,i);return!!o&&(this._rids=St._reorderItems(e,o),!0)},St.prototype.dispatchGlobalChange=function(t){!t&&this._needFiring()&&this._dispatchDataChange(St._globalChangeArg)},St.prototype._dispatchPositionChange=function(t){!t&&this._needFiring()&&this._dispatch("dataChanged",St._positionChangeArg)},St.prototype.dump=function(t){return ft.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},St.prototype._setData=function(t,e,n){let i=this.getRowData(t);return i||(i={},this._rows[t]=i,this._prevData[t]={},this._rids.push(t)),this._prevData[t][e]=i[e],i[e]=n,!0},St.prototype._generateRids=function(t,e){let n,i=0;if(e)n=e;else{n=[];let e=this._rids.length;for(;i<e&&i<t;)n.push(this._rids[i++])}for(i=n.length;i<t;)n.push(""+i++);return n},St.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},St.prototype._needFiring=function(){return!this._frozen&&!this._composing},St.getSortingDefinitions=ut._deprecatedFunction,St._globalChangeArg={globalChange:!0},St._positionChangeArg={globalChange:!0,positionChangeOnly:!0},St._buildSortContext=function(t,e,n,i,o){let r,s;Array.isArray(e)?(r=e,s=n):(r=[e],s=e?[n]:[0]);let l=null,a=null;"function"==typeof i?l=i:a=i;let u=r.length;t.length=u;for(let e=u;--e>=0;){Array.isArray(a)&&(l=a[e]);let n=t[e];n||(n=t[e]=new Array(5));let i=r[e];n[0]=i,n[1]=null,n[2]=l||a[i]||a._default,n[2]||(n[2]=St._defaultComparer),n[3]=St._getSortOrder(s[e]),n[4]=o}return t},St._multiColumnCompareLogic=function(t,e,n,i){let o=i.length,r=0;for(let n=0;n<o;++n){let o=i[n];if(r=St._singleColumnCompareLogic(t,e,o[3],o),r)return r}return r},St._singleColumnCompareLogic=function(t,e,n,i){let o=i[1];return i[2](o[t],o[e],n,i[4])},St._multiColumnSeparatorCompareLogic=function(t,e,n,i){let o=i.length,r=0;for(let n=0;n<o;++n){let o=i[n];if(r=St._singleColumnSeparatorCompareLogic(t,e,o[3],o),r)return r}return r},St._singleColumnSeparatorCompareLogic=function(t,e,n,i){let o=i[0];return i[2](t[o],e[o],n,i[4])},St._performMultiLevelSorting=function(t,e,n){let i,o=t?t.length:0,r=e?e.length:0;if(!o)return null;for(let n=0;n<r;++n){let r,s=e[n],l=s[1];if(i=s[2],i.rowSorting)if(l)for(l.length=o,r=0;r<o;++r)l[r]=t[r];else l=s[1]=t;else{l?l.length=o:l=s[1]=new Array(o);let e=s[0];for(r=0;r<o;++r)l[r]=t[r][e]}}if(n){let t=["ROW_SEGMENT",n,St._segmentComparer,1,null];e?(e=e.slice()).unshift(t):e=[t],++r}if(!r)return null;let s,l=0;return r>1?(i=St._multiColumnCompareLogic,s=e,l=1):(i=St._singleColumnCompareLogic,s=e[0],l=s[3]),St._mergeSort(o,l,i,s)},St._mergeSort=function(t,e,n,i){let o,r,s,l,a,u=!1,h=1,p=St._createIndexArray(t),d=p.slice();for(;h<=t;){for(o=a=0;o<t;)if(r=a,l=r+h,s=l,a=s+h,a>t&&(a=t),s<a){for(;;)if(n(p[r],p[s],e,i)<=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;let c=p;p=d,d=c,h<<=1}return u?p:null},St._reorderItems=function(t,e){if(e){for(let n=t.length;--n>=0;)e[n]=t[e[n]];return e}return t},St._createIndexArray=function(t){let e=St._idxAryMap[t];if(!e){St._idxAryCount>50&&(St._idxAryMap={},St._idxAryCount=0),e=St._idxAryMap[t]=new Array(t),St._idxAryCount++;for(let n=0;n<t;++n)e[n]=n}return e.slice()},St._removeIndexArray=function(){St._idxAryMap={},St._idxAryCount=0},St._idxAryMap={},St._idxAryCount=0,St._segmentComparer=function(t,e){return t===e?0:t<e?-1:1},St._defaultComparer=function(t,e,n){return null==t||t!=t?null==e||e!=e?0:1:null==e||e!=e?-1:t<e?-n:e<t?n:0},St._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},St._proto=St.prototype;const wt=St,bt="ROW_DEF";let Rt=function(t){let e={};for(let n in t)e[n]=t[n];return e},vt=function(t){if(this._changes={},t&&t.segmentId)return this._rowId=t.segmentId,this._autoGenerated=!0,void(this._subSegment=!0);this._rowId="_"+vt._runningId+++"_",t&&(t.asConstituent?this._initializeAsConstituent(t):this.initialize(t))};vt._runningId=0,vt._childDataField="CHILD_VALUES",vt.ROW_ID_PATTERN=/^_[^_]+_$/,vt.prototype._userInput="",vt.prototype._ric="",vt.prototype._permId="",vt.prototype._label=null,vt.prototype._isChain=null,vt.prototype._asSegment=!1,vt.prototype._realTime=!0,vt.prototype._rowId="",vt.prototype._userId=!1,vt.prototype._dc=null,vt.prototype._subs=null,vt.prototype._view=null,vt.prototype._subId="",vt.prototype._collapsed=null,vt.prototype._autoGenerated=!1,vt.prototype._subSegment=!1,vt.prototype._staticValues=null,vt.prototype._changes,vt.prototype._updateCount=0,vt.prototype._children=null,vt.prototype._parent=null,vt.prototype._groupOrder=0,vt.prototype._depthLevel=0,vt.prototype._userModel=null,vt.prototype._info=null,vt.prototype.dispose=function(){this.isDisposed()||(this._children&&(this._children.forEach(vt.dispose),this._children=null),this._dc&&(this._dc.setRowData(this._rowId,null),this._dc=null),this._staticValues=null,this._parent=null,this._depthLevel=0,this.unsubscribeForUpdates(),this._subs=null,this._view=null,this._subId=this._rowId="",this._userId=!1,this._autoGenerated=!1,this._userModel=null)},vt.prototype.isDisposed=function(){return!this._rowId},vt.prototype.initialize=function(t){if(!t)return;if(!this._autoGenerated){let e=t.rowId;e&&"string"==typeof e&&(e.match(vt.ROW_ID_PATTERN)?console.warn("Please change the rowId format to avoid duplicated rows' id causing unexpected behavior."):(this._rowId=e,this._userId=!0))}let e=vt.extractRowOptions(t),n=t.permId;null!=n&&(this._permId=n),n=t.ric,null!=n&&(this._ric=n),n=t.label,void 0!==n&&(this._label=n),n=t.chainRic,null!=n&&(this._chainRic=n),n=e.asChain,null!=n&&(this._isChain=!!n),n=t.realTime,null!=n&&(this._realTime=n),n=t.asSegment,null!=n&&(this._asSegment=!!n),(this._isChain||this._asSegment)&&(this._collapsed=e.collapsed),n=t.keepModel,n&&(this._userModel=t),n=t.info,n&&(this._info=n);let i=this._ric||this._chainRic;(i||this._permId)&&this.setContent(i,e),n=t.values,void 0!==n&&this.setStaticRowData(n,t.fields)},vt.prototype._initializeAsConstituent=function(t){this._autoGenerated=!0;let e=t.parent;this.setParent(e)&&(this._ric=t.ric,this._dc=e._dc,this._subId=e._subId),this._staticValues=t.values||null,this.resetRowData()};let It=function(t,e){let n=t.getRowIndex(e);do{if((e=t.getRowId(++n))&&!t.getSegmentParentRowId(e))break}while(e);return e},Dt=function(t,e,n){return!(!t||!t.isSorting())&&((e=!!e)!==n&&(e&&t.synchronizeRowOrder(),t.stallSorting(e)),e)};vt.prototype.setContent=function(t,e){if(this._autoGenerated)return!1;t?"string"!=typeof t&&(t+=""):t="";let n=this._userInput!==t,i=e.permId||"";if(this._permId!==i&&(this._permId=i,n=!0),!n)return!1;let o=e.asChain,r=!0;"'"===t.charAt(0)&&(r=!1,this._ric=this._chainRic="");let s=this._view,l=Dt(s,r&&o,!1);this.unsubscribeForUpdates(),this._userInput=t;let a=e.collapsed;if(r){let n=e.chainRic;this._ric=!0===o?!0===a?t:t.replace("0#",""):t,this._isChain=null!=o?o:null,this._chainRic=n||""}if(s){let t=s.getSegmentParentRowId(this._rowId);if(t){if(this._isChain){let e=It(s,this._rowId);s.removeSegmentChild(t,this._rowId),s.moveRow(this._rowId,e),t=""}}else s.getSegment(this._rowId)&&s.setSegmentSeparator(this._rowId,!1);this._isChain&&s.setSegmentSeparator(this._rowId,!0),a!==this.isChainCollapsed()&&s.collapseSegment(this._rowId,a),this._collapsed=null,Dt(s,!1,l),t&&s.addSegmentChild(t,this._rowId)}return this.subscribeForUpdates(),!0},vt.prototype.getRowId=function(){return this._rowId},vt.prototype.getConfigObject=function(t){let e=t||{};this._userId&&(e.rowId=this._rowId);let n=this._ric;if(n&&(e.ric=n),this._ric||"'"!==this._userInput.charAt(0)||(e.ric=this._userInput),n=this._realTime,n||(e.realTime=!1),n=this._permId,n&&(e.permId=n),n=this._chainRic,n&&(e.chainRic=n),n=this._label,n&&(e.label=n),n=this._userModel,n&&(e.keepModel=e),n=this._isChain,null!=n&&(e.asChain=n),n=this._collapsed,null!=n&&(e.collapsed=n),n=!!this._view&&this._view.isHiddenRow(this._rowId),n&&(e.hidden=n),n=this._info,n&&(e.info=this._info),n=this._cloneStaticRowData(),n&&(e.values=n),this.isChain()){let t=this.getChildren();if(t){let i=n?n[vt._childDataField]:{};i||(i={});let o,r,s,l=!1,a=t.length;for(o=0;o<a;o++)r=t[o],s=r._cloneStaticRowData(),s&&(l=!0,i[r.getRic()]=s);l&&(e.values||(e.values={}),e.values[vt._childDataField]=i)}}return e},vt.prototype.getDataId=function(){return""},vt.prototype.getType=function(){if(this._isChain)return"CHAIN";if(this._parent)return"CONSTITUENT";{let t=this._view;if(!t)return"";{let e=this.getRowId(),n=t.isSegmentSeparator(e),i=t.getSegmentLevel(e);if(n)return 1===i?"GROUP_HEADER":"SUBGROUP_HEADER";if(t.getSegmentParentRowId(e))return"GROUP_MEMBER"}}return"CONTENT"},vt.prototype.setDataSource=function(t,e){this._dc=t||null;let n=!1;if(this._dc)if(this._staticValues){let t=Rt(this._staticValues);n=this.addUpdate(t),this._dc.setRowData(this._rowId,t,{rowDef:this,initialChanges:this.getUpdates()})}else this._dc.setRowData(this._rowId,{});return this._subs=e||null,this.subscribeForUpdates(),n},vt.prototype.getDataSource=function(){return this._dc},vt.prototype.getRowData=function(){return this._dc?this._dc.getRowData(this._rowId):{}},vt.prototype.getData=function(t){return this._dc?this._dc.getData(this._rowId,t):null},vt.prototype.setStaticRowData=function(t,e){this._clearStaticData(),Array.isArray(t)&&(t=x(t,e)),this._staticValues="object"==typeof t?t:null,this._staticValues&&this.setRowData(t)},vt.prototype._cloneStaticRowData=function(){return this._staticValues?Rt(this._staticValues):null},vt.prototype.setStaticData=function(t,e){this._staticValues||(this._staticValues={}),this._staticValues[t]=e,this.setData(t,e)},vt.prototype.updateRowData=function(t,e){Array.isArray(t)&&(t=x(t,e)),t&&this.setRowData(t)},vt.prototype.copyRowData=function(t){if(t&&t!==this){let e=this.getRowData();t.cloneRowData(e,this._staticValues)}},vt.prototype.cloneRowData=function(t,e){let n,i=t||{},o={ROW_DEF:1,SUB_ID:1},r=this._staticValues;for(n in r)o[n]=1;for(n in e)o[n]=1;let s=this.getRowData();for(n in s)o[n]||(i[n]=s[n]);return i},vt.prototype.setRowData=function(t){this._dc&&this._dc.setRowData(this._rowId,t)},vt.prototype.resetRowData=function(){let t=this._dc;if(t){let e=this._rowId;t.setRowData(e,null),t.setRowData(e,{}),this._staticValues&&t.setRowData(e,this._staticValues)}},vt.prototype.setData=function(t,e){this._dc&&this._dc.setData(this._rowId,t,e)},vt.prototype._clearStaticData=function(){let t=this._staticValues;if(t){if(this._dc){let e={};for(let n in t)e[n]=null;this._dc.setRowData(this._rowId,e)}this._staticValues=null}},vt.prototype.getUserInput=function(){return this._userInput},vt.prototype.getRic=function(){return this._ric},vt.prototype.getPermId=function(){return this._permId},vt.prototype.getSymbol=function(){return this._ric||this._permId},vt.prototype.getDisplayText=function(){return null!=this._label?this._label:this._ric?this._ric:this._permId?this._permId:this._userInput},vt.prototype.getLabel=function(){return this._label},vt.prototype.isRowHeader=function(){return"'"===this._userInput.charAt(0)},vt.prototype.isChain=function(){return this._isChain},vt.prototype.isConstituent=function(){return!(!this._autoGenerated||!this._subId||this._rowId===this._subId)},vt.hasChain=function(t){return t.isChain()},vt.prototype.isChainCollapsed=function(){return!!this._view&&this._view.isSegmentCollapsed(this._rowId)},vt.prototype.isChainExpanded=function(){return!this.isChainCollapsed()},vt.prototype.isFixedPosition=function(){return this._isChain&&this.isChainExpanded()},vt.prototype.isAutoGenerated=function(){return this._autoGenerated},vt.prototype.isRealTimeRow=function(){return!(!this.getRic()||!this._realTime||this._autoGenerated||this.isRowHeader())},vt.prototype.subscribeForUpdates=function(t){if(!t&&!this._subs)return!1;if(!this.isRealTimeRow()&&!this.getPermId())return!1;if(this.unsubscribeForUpdates(),t?this._subs=t:t=this._subs,this.isChain()){let e=this._chainRic;!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));let e=this.getDisplayText();return this.setRowData({X_RIC_NAME:e}),!0},vt.prototype.unsubscribeForUpdates=function(t){return this.isSubscribing()&&(this._subs.removeSubscription(this._subId),this._subId="",t||(this.resetUpdates(),this.resetRowData())),null},vt.prototype.isSubscribing=function(){return!(!this._subId||!this._subs)},vt.prototype.getSubId=function(){return this._subId},vt.prototype.addUpdate=function(t){if(t){let e=0;for(let n in t)this._changes[n]=e=1;if(e)return++this._updateCount,!0}return!1},vt.prototype.getUpdates=function(){return this._updateCount?this._changes:null},vt.prototype.resetUpdates=function(){this._updateCount&&(this._changes={},this._updateCount=0)},vt.prototype.registerToView=function(t,e){if(!t||this._view===t)return!1;this._view=t;let n=this._rowId,i=t.getRowData(n);if(i&&i[bt])return console.warn("Duplicate row id detected"),!1;if(this._subSegment)return i&&(i[bt]=this),!0;i={},i[bt]=this;let o="",r=this._isChain||this._asSegment;e&&(o=t.getSegmentParentRowId(e),o)&&(r?e=It(t,e):this.isConstituent()||t.getData(o,bt).isChain()&&(o=null,e=It(t,e)));let s=Dt(t,r,!1);return t.insertRow(e,i,n),r?(t.setSegmentSeparator(n),Dt(t,!1,s),null!=this._collapsed&&(t.collapseSegment(n,this._collapsed),this._collapsed=null)):!this._parent&&o&&t.addSegmentChild(o,n),!0},vt.prototype._deregisterFromView=function(t){return this._view?(t&&t.push(this._rowId),this._view=null,this._rowId):""},vt.deregisterFromView=function(t,e){return e._deregisterFromView(t),t},vt.prototype.getConstituent=function(t){if(this._children&&t)for(let e=this._children.length;--e>=0;)if(this._children[e]._ric===t)return this._children[e];return null},vt.prototype.verifyConstituent=function(t){return!(!this._isChain||!t||this._ric===t||this._ric==="0#"+t)&&this._ric!=="/"+t},vt.prototype.addConstituent=function(t){if(!(this._rowId&&this._subId&&this._isChain))return null;this._children||(this._children=[]);let e={asConstituent:!0,ric:t,parent:this};if(this._staticValues){let n=this._staticValues[vt._childDataField];if(n){let i=n[t];i&&(e.values=i,n[t]=null)}}return new vt(e)},vt.prototype.toRealTimeRow=function(t){if(!this.isConstituent())return;let e=this._parent._subs;this._realTime=!0,this._autoGenerated=!1,this._parent=null,this._depthLevel=0,t&&(this._rowId=t,this._userId=!0),this.subscribeForUpdates(e)},vt.prototype.unlinkChain=function(){if(!this._isChain)return;this.unsubscribeForUpdates(!0);let t=this._view;if(t){let e=this.getRowId(),n=t.getSegment(e);n&&n.setClassification(null),t.setSegmentSeparator(e,!1)}this._isChain=!1,this._chainRic="",this._userInput=this._ric,this._children=null,this.subscribeForUpdates()},vt.prototype.collapseChain=function(){return!(!this._isChain||!this._view)&&this._view.collapseSegment(this._rowId,!0)},vt.prototype.expandChain=function(){return!(!this._isChain||!this._view)&&this._view.collapseSegment(this._rowId,!1)},vt.prototype.toggleChain=function(){return this.isChainExpanded()?this.collapseChain():this.expandChain()},vt.prototype.addChild=function(t){return!!t&&t.setParent(this)},vt.prototype.getChildren=function(){return this._children},vt.prototype.getDescendants=function(t){if(t||(t=[]),this._children){let e=this._children,n=e.length;for(let i=0;i<n;++i){let n=e[i];t.push(n),n.getDescendants(t)}}return t},vt.prototype.getAllDescendantIds=function(){let t=this.getDescendants();return t.length?t.map(vt.toRowId):null},vt.prototype.getChildCount=function(){return this._children?this._children.length:0},vt.prototype.countChildInView=function(){if(this._children){let t=0,e=this._children.length;for(let n=0;n<e;++n)this._children[n]._view&&++t;return t}return 0},vt.prototype.getParent=function(){return this._parent},vt.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)},vt.prototype.getDepthLevel=function(){return this._depthLevel},vt.prototype.getGroupOrder=function(){return this._parent?this._parent.getGroupOrder()+.1:this._groupOrder},vt.prototype.setGroupOrder=function(t){return!this._parent&&this._groupOrder!==t&&(this._groupOrder=t,!0)},vt.prototype.getUserModel=function(){return this._userModel},vt.prototype.setRowInfo=function(t){this._info=t},vt.prototype.getRowInfo=function(){return this._info},vt.toRowId=function(t){return t.getRowId()},vt.extractRowOptions=function(t){let e=t.ric,n=t.permId,i=t.chainRic,o=t.collapsed,r=t.asSegment,s=t.asChain;null==s&&i&&(s=!0);let l=null;e&&e.indexOf("0#")>=0?(null==s&&(s=!0),l=!0):s?l=!1:r&&(l=!0);let a={};return a.collapsed=null==o?!l:o,a.ric=e,a.permId=n||"",a.chainRic=i,a.asChain=s,a},vt.dispose=function(t){t.dispose()};const xt="/synapse/service/suggestions/suggest/?hits=1&profile="+encodeURIComponent("Field Selector"),At=/^TR\.\w+\([\w\-=,]*(?:EDATE|SDATE)=+[\w\-=,]*[ \w]*\)$/i;let Tt={};function Lt(t){t.currentTarget._error={type:t.type}}function Et(t){let e=t.currentTarget,n=e._defer,i=e._field;if(delete Tt._loadingField[i],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()===i.toUpperCase()&&(o=Tt.get(i)||{},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,Tt.set(i,o))}}o?n.resolve(o):n.reject("No definition for "+i)}else e._error?(e._error.field=i,n.reject(e._error)):n.reject({field:i,status:e.status,statusText:e.statusText,request:e})}Tt._defs={},Tt._defaults={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."}},Tt._timeSeriesChildren={},Tt._synapse="",Tt._lang="en",Tt._timeSeriesExpansion=!0,Tt._loadingField={},Tt.set=function(t,e){if(Tt._defs[t])for(let n in e)Tt._defs[t][n]=e[n];else Tt._defs[t]=e},Tt.resetAll=function(){let t=Tt._defs={},e=Tt._defaults;for(let n in e)t[n]=e[n]},Tt.get=function(t){return Tt._defs[t]||null},Tt.getFieldInfo=Tt.get,Tt.hasFieldInfo=function(t){let e=Tt.get(t);return!(!e||!e.field)},Tt.getTimeSeriesChildren=function(t){return Tt._timeSeriesChildren[t]||null},Tt.addTimeSeriesChild=function(t,e){Tt._timeSeriesChildren[t]||(Tt._timeSeriesChildren[t]=[]),Tt._timeSeriesChildren[t].push(e)},Tt.remove=function(t){delete Tt._defs[t]},Tt.setSynapseConfig=function(t){Tt._synapse=t},Tt.disableTimeSeriesExpansion=function(t){Tt._timeSeriesExpansion=!1===t},Tt.isFormula=function(t){return"="===t.charAt(0)},Tt.isAdc=function(t){return 0===t.indexOf("TR.")},Tt.isRealTimeField=function(t){return!(!t||Tt.isAdc(t)||Tt.isFormula(t)||Tt.isTimeSeriesChild(t)||!1===Tt.getFieldProperty(t,"IsRealtimeField"))},Tt.isTimeSeriesChild=function(t){return!!Tt.getFieldProperty(t,"timeSeriesParent")},Tt.isTimeSeries=function(t){if(!t)return!1;if(!Tt._timeSeriesExpansion)return!1;let e=Tt.getFieldProperty(t,"timeSeries");return null!=e?!!e:At.test(t)},Tt.setFieldProperty=function(t,e,n){Tt._defs[t]||(Tt._defs[t]={}),Tt._defs[t][e]=n},Tt.getFieldProperty=function(t,e){let n=Tt._defs[t];return n?n[e]:null},Tt.loadFieldInfo=function(t){if(Tt._loadingField[t])return Tt._loadingField[t].promise;let e=new F,n=Tt._synapse;if(n)if(Tt.hasFieldInfo(t))e.resolve(Tt.get(t));else if(n.debug){let n=this._mockOnLoadEndData(t,e);setTimeout(Et.bind(null,n),1e3)}else if(n.apiKey&&n.contextApp){let i=xt+"&api-key="+encodeURIComponent(n.apiKey)+"&contextApp="+encodeURIComponent(n.contextApp)+"&language="+encodeURIComponent(Tt._lang)+"&query="+encodeURIComponent(t);n.auth&&(i+="&auth="+encodeURIComponent(n.auth));let o=new XMLHttpRequest;o._defer=e,o._field=t,Tt._loadingField[t]=e,o.addEventListener("loadend",Et),o.addEventListener("timeout",Lt),o.addEventListener("error",Lt),o.open("GET",i,!0),o.send()}else e.resolve(null);else e.resolve(null);return e.promise},Tt._mockOnLoadEndData=function(t,e){let n,i=t.toUpperCase(),o=i.toLowerCase();n=2===o.indexOf("_")?i[3]+o.substring(4):i[0]+o.substring(1);let r=i.indexOf("DATE")>=0?"DATE":"PRICE",s={action:'"'+i+'" SRCH',assetClassifierExplanation:"AssetClassifier is disabled.",assetClassifierStatus:"NOT_INVOKED",result:[{name:"Fields",default:!1,size:1,hits:[{cmd:n,explanation:null,fr:!1,id:"1635614732",navigation:null,p:{Rank:2800024,fdt:r,fid:"5364",fimo:!1,firp:!1,firt:!0,fl:n,fn:i,fsrc:"IDN",fsrnk:100024},position:0,preview:!1,relations:{},score:2840024,source:"87",subtitle:"",symbol:n,title:"title mockup of "+i,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 Tt._defaults)Tt._defaults[t].field=t,Tt._defs[t]=Tt._defaults[t]}();const Mt=Tt;let Ft={_formulas:{},set:function(t,e){Ft._formulas[t]=e},get:function(t){return Ft._formulas[t]||""},remove:function(t){delete Ft._formulas[t]}};const Pt=Ft,zt={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"},Vt="COL_DEF";let kt=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))};kt.prototype._field="",kt.prototype._dataType="",kt.prototype._name="",kt.prototype._defaultName=!0,kt.prototype._defaultField=!0,kt.prototype._tooltip=null,kt.prototype._requiredFields,kt.prototype._headerRenderer=null,kt.prototype._headerAlignment="",kt.prototype._internalRenderer,kt.prototype._userRenderers=null,kt.prototype._activatedRenderer=null,kt.prototype._rendererMap=null,kt.prototype._userSorter=null,kt.prototype._sortable=!0,kt.prototype._eventArg,kt.prototype._autoGenerated=!1,kt.prototype._classes,kt.prototype._fnEngine=null,kt.prototype._formula=null,kt.prototype._formulaRef="",kt.prototype._initialOrder="",kt.prototype._rowSorting=null,kt.prototype._textSelect=!1,kt.prototype._userModel=null,kt.prototype._parent=null,kt.prototype._children=null,kt.prototype._info=null,kt.prototype._coreColDef=null,kt.prototype._focusable=!1,kt.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},kt.prototype._initializeTimeSeriesChild=function(t){this._autoGenerated=!0;let e=t.parent;this._setParent(e),this.initialize(t)},kt.prototype.initialize=function(t){if(!t)return;let e,n,i,o,r=t.field,s=Mt.get(r);if(s&&s!==t){let e=t;for(i in t={},s)t[i]=s[i];for(i in e)t[i]=e[i]}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,null==o&&(o=t.title),null!=o&&(this._name="string"==typeof o?o:o+"",this._defaultName=!1),o=t.dataType,null!=o&&(this._dataType=o),o=t.notRealTimeField,null!=o&&Mt.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(n=o.length,e=0;e<n;++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.focusable,null!=o&&(this._focusable=!!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},kt.prototype.getId=function(){return this._coreColDef&&this._coreColDef.id||""},kt.prototype.getRequireFields=function(){return this._requiredFields},kt.prototype.getRequiredFields=kt.prototype.getRequireFields,kt.prototype.getRenderer=function(){return this._internalRenderer},kt.prototype.getHeaderRenderer=function(){return this._headerRenderer},kt.prototype.getName=function(){return this._defaultName?this._defaultField?"Column "+this.getId():this.getField():this._name},kt.prototype.isDefaultName=function(){return this._defaultName},kt.prototype.getFieldDefinition=function(){return Mt.get(this.getField())},kt.prototype.getFieldDataType=function(){let t=this.getFieldDefinition();return t&&t.fieldDataType?t.fieldDataType:""},kt.prototype.getDataType=function(){if(this._dataType)return this._dataType;let t=this.getFieldDataType();return t?zt[t.toUpperCase()]:""},kt.prototype.setDataType=function(t){let e=zt[t.toUpperCase()];e&&(t=e),this._dataType=t},kt.getDataType=function(t){let e=Mt.get(t);if(e){let t=e.fieldDataType?e.fieldDataType.toUpperCase():null;return zt[t]?zt[t]:""}return""},kt.prototype.getTooltipValue=function(){return this._tooltip},kt.prototype.getTooltip=function(){if(null!=this._tooltip){if("string"==typeof this._tooltip)return this._tooltip;if(!this._tooltip)return""}let t=this.getName();return t||(this.getField()||"")},kt.prototype.getField=function(){return this._coreColDef&&this._coreColDef.field||""},kt.prototype.getAllFields=function(){let t=this.getField();return t?this._requiredFields.concat(t):this._requiredFields.slice()},kt.prototype.isRealTimeField=function(){return Mt.isRealTimeField(this.getField()||this._field)},kt.prototype.isTimeSeries=function(){return Mt.isTimeSeries(this.getField())},kt.prototype.isTimeSeriesChild=function(){return Mt.isTimeSeriesChild(this.getField())},kt.prototype.isFormulaField=function(){return!!this._formula},kt.isFormulaField=function(t){return Mt.isFormula(t)},kt.isAdcField=function(t){return Mt.isAdc(t)},kt.isRealTimeField=function(t){return Mt.isRealTimeField(t)},kt.getRealTimeFields=function(t,e){e.isRealTimeField()&&t.push(e.getField());let n=e.getRequiredFields(),i=n.length;for(let e=0;e<i;++e){let i=n[e];kt.isRealTimeField(i)&&t.push(i)}return t},kt.prototype.isSortable=function(){return this._sortable},kt.prototype.isScalable=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnScalability(e)},kt.prototype.getInitialSortOrder=function(){return this._initialOrder},kt.prototype.getWidth=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnWidth(e)},kt.prototype.getMinWidth=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getMinimumColumnWidth(e)},kt.prototype.getTextAlign=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnAlignment(e)},kt.prototype.isFieldEmpty=function(){return!this.getField()},kt.prototype.getHeaderAlignment=function(){return this._headerAlignment||""},kt.prototype.getClasses=function(){return this._classes},kt.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 n=this.getDataType();n&&(e.dataType=n),this._formulaRef&&(e.formulaReference=this._formulaRef),this._requiredFields&&this._requiredFields.length&&(e.require=this._requiredFields),this._defaultName||(e.name=this.getName()),n=!1===Mt.getFieldProperty(this.getField(),"IsRealtimeField"),n&&(e.notRealTimeField=n),null!=this._tooltip&&(e.tooltip=this._tooltip),null!=this._rowSorting&&(e.rowSorting=this._rowSorting),this._sortable||(e.sortable=!1);let i=this._classes;i&&i.length>0&&(e.className=i.join(" ")),this._textSelect&&(e.textSelect=this._textSelect),this._headerAlignment&&(e.headerAlignment=this._headerAlignment),this._autoGenerated&&(e.autoGenerated=this._autoGenerated),this._focusable&&(e.focusable=!0);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),n=o.getMinimumColumnWidth(r),n>0&&(e.minWidth=n),null==e.hidden&&(o.getColumnVisibility(r,0)||(e.hidden=!0)),n=o.getColumnAlignment(r),"default"!==n&&(e.textAlign=n),e},kt.prototype.isHidden=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return!t.isColumnVisible(e)},kt.prototype.isTextSelect=function(){return this._textSelect},kt.prototype.hide=function(t){let e=this._eventArg.core,n=this._eventArg.grid.getColumnIndex(this);e.hideColumn(n,!1!==t)},kt.prototype.setHeaderRenderer=function(t){this._headerRenderer=t},kt.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)},kt.prototype.getParent=function(){return this._parent},kt.prototype._setParent=function(t){return this._parent===t||t===this||t&&(this._parent=t,this._parent._addChild(this)),!1},kt.prototype.getChildren=function(){return this._children},kt.prototype._addChild=function(t){this===t||this._children.indexOf(t)>-1||this._children.push(t)},kt.prototype.addRenderer=function(t){t&&(this._userRenderers?this._userRenderers.push(t):this.setRenderer(t))},kt.prototype.activateRenderer=function(t,e){let n=null;if(null!=t){let i=this._rendererMap;i||(i=this._rendererMap={}),"function"==typeof e?n=i[t]=e:null==e?n=i[t]:e||(n=i[t]=null)}return this._activatedRenderer=n||null,n||(n=this._userRenderers?this._userRenderers[0]:null),this.setRenderer(n),!!this._activatedRenderer},kt.prototype.getSorter=function(){return this._userSorter},kt.prototype.setSorter=function(t){this._userSorter="function"==typeof t?t:null},kt.prototype.isRowSorting=function(){return null==this._rowSorting?!Mt.getFieldProperty(this.getField(),"IsRealtimeField"):!!this._rowSorting},kt.prototype.isAutoGenerated=function(){return this._autoGenerated},kt.prototype.setName=function(t){this._name=t,this._defaultName=!1},kt.prototype._setField=function(t,e){this._defaultField=null==t,t||(t=""),t=t.trim();let n=e?e.formula:"";if(this._fnEngine){let e=t.toUpperCase(),i=n||Pt.get(e);(i||kt.isFormulaField(t))&&(t=h.toUpperCase(t),this._formula=this._fnEngine.addFormula(i||t),i&&(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,Mt.setFieldProperty(t,"timeSeries",!!Mt.isTimeSeries(t));let i=e.parent;e&&i&&Mt.setFieldProperty(t,"timeSeriesParent",i.getField()),this._updateContext("field",t),this.isRealTimeField()&&this._updateContext("formattedField",t+"_FORMATTED")},kt.prototype._retrieveNestedFields=function(t){if(t)for(let e=t.length;--e>=0;){let n=t[e],i=n.toUpperCase(),o=Pt.get(i);if(o){let t=this._fnEngine.getFormula(n);t?t.addFormulaCount():(t=this._fnEngine.addFormula(o),t.setAlias(n),this._fnEngine.addReference(t,n)),this._retrieveNestedFields(t.getFieldNames())}else this._requiredFields.push(n)}},kt.prototype._defaultRenderer=function(t){let e=t.dataValue;t.cell.setContent(e?e.getData(this._field):null)},kt.prototype._customRenderer=function(t){let e=t.dataValue,n=this._eventArg;if(e){let i=e.getRowData();n.rowDef=e,n.rowData=i,n.rowIndex=t.rowIndex,n.data=i?i[this._field]:null}else n.data=null;if(n.colIndex=t.colIndex,n.cell=t.cell,n.section=t.section,this._activatedRenderer)this._activatedRenderer(n);else{let t=this._userRenderers,e=t.length;for(let i=0;i<e;++i)t[i](n)}},kt.prototype._updateContext=function(t,e){this._eventArg[t]=e},kt.prototype.getUserModel=function(){return this._userModel},kt.prototype.clearUserModel=function(){this._userModel=null},kt.prototype.setColumnInfo=function(t){this._info=t},kt.prototype.getColumnInfo=function(){return this._info},kt.prototype._setCoreColumnDef=function(t){this._coreColDef=t||null},kt.prototype.isFocusable=function(){return this._focusable},kt.prototype.getBackgroundColor=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnBackgroundColor(e)},kt.prototype.setBackgroundColor=function(t){let e=this._eventArg.core,n=this._eventArg.grid.getColumnIndex(this);e.setColumnBackgroundColor(n,t)};const Nt=kt;let Ot=function(){this._onRequest=this._onRequest.bind(this),this._rics={},this._fields={},this._adcOptions={productId:"001"}};n.inherits(Ot,r),Ot._mockAdc=null,Ot.prototype._timerId=0,Ot.prototype._rics,Ot.prototype._fields,Ot.prototype._rtk,Ot.prototype._adcOptions=null,Ot.prototype.dispose=function(){this.removeAllEventListeners(),this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._rics=this._fields=this._rtk=this._adcOptions=null},Ot.prototype.setRTK=function(t){this._rtk=t},Ot.setMockAdc=function(t,e){Ot._mockAdc||(Ot._mockAdc={}),Ot._mockAdc[t]=e},Ot.getMockAdc=function(t){return Ot._mockAdc?Ot._mockAdc[t]:null},Ot.clearMockAdc=function(){Ot._mockAdc=null},Ot.prototype.setADCOptions=function(t){let e=t.productId;e&&(this._adcOptions.productId=e)},Ot.prototype.addRic=function(t){t&&!this._rics[t]&&(this._rics[t]=1,this._request())},Ot.prototype.addRics=function(t){let e=t?t.length:0,n=!1;for(let i=0;i<e;++i){let e=t[i];e&&!this._rics[e]&&(this._rics[e]=1,n=!0)}return!!n&&(this._request(),!0)},Ot.prototype.addField=function(t){this._addField(t)&&this._request()},Ot.prototype.addFields=function(t){let e=t.length,n=0;for(let i=0;i<e;++i)n|=this._addField(t[i]);return!!n&&(this._request(),!0)},Ot.prototype._addField=function(t){return Ot.isValidField(t)&&!this._fields[t]?(this._fields[t]=1,1):0},Ot.isValidField=function(t){return!(!t||0!==t.indexOf("TR."))},Ot.prototype._request=function(){this._timerId||(this._timerId=setTimeout(this._onRequest,0))},Ot.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,n=Object.keys(this._rics),i=[],o=[];for(let t in this._fields)Tt.isTimeSeries(t)?o.push(t):i.push(t);let r,s,l=i.length,a=o.length;if((l||a)&&n.length)if(this._rics={},this._fields={},this._rtk){let t;if(o.length>0){let t=o.join(",");s={method:"select",formula:t,identifiers:n,productId:this._adcOptions.productId,output:"Col,date|,Row,In|,va,T,NoEmptyTickers"},r=this._onRTKTimeSeriesSuccess.bind(this,o);let e=Ot.getMockAdc(s.formula);e?setTimeout((function(){r(e)}),10):this._rtk.Data.Adc.request(s).then(r).catch((function(t){console.log(t)}))}i.length>0&&(t=i.join(","),s={method:"select",formula:t,identifiers:n,productId:this._adcOptions.productId,output:"Col,In,va,T,NoEmptyTickers"},r=this._onRTKSuccess.bind(this,i),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:i[e]});s={instruments:n,fields:o},r=this._onJETSuccess.bind(this,i),t.Data("datagrid").then((function(t){return t.request(s)})).then(JSON.parse).then(r).catch((function(t){console.log(t)}))}},Ot.prototype._onJETSuccess=function(t,e){this._dispatch("adcDataReceived",e);let n,i,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(n=0;n<a&&l<u;n++)i=t[n],s[l].field===i.toUpperCase()&&(h[l]=i,l++);let p=r.length,d=h.length,c={};for(n=0;n<p;n++){let t=r[n];if(o=t[0],c[o])continue;let e=c[o]={};for(l=1;l<d;l++){let n=t[l];null!=n&&""!==n&&(i=h[l],e[i]=n)}}let _={};for(o in c){let t=c[o];D(t)||(_[o]=t)}this._dispatch("dataChanged",{data:_})},Ot.prototype._onRTKSuccess=function(t,e){this._dispatch("adcDataReceived",e);let n,i,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(n=0;n<a&&l<u;n++)i=t[n],s[l].r.toUpperCase()===i.toUpperCase()&&(h[l]=i,l++);let p=r.length,d=h.length,c={};for(n=1;n<p;n++){let t=r[n];if(o=t[0],c[o])continue;let e=c[o]={};for(l=1;l<d;l++){let n=t[l];null!=n&&""!==n&&"object"!=typeof n&&(i=h[l],e[i]=n)}}let _={};for(o in c){let t=c[o];D(t)||(_[o]=t)}this._dispatch("dataChanged",{data:_})},Ot.prototype._onRTKTimeSeriesSuccess=function(t,e){this._dispatch("adcDataReceived",e);let n=e.rows,i=e.rows&&e.rows[0];if(!Array.isArray(n)||!Array.isArray(i))return;let o=i.slice(2).map((t=>t.v)),r={},s=0,l=n.length;for(let e=1;e<l;e++){let i=n[e][1];r[i]||(r[i]=t[s++])}let a={},u={};for(let t=1;t<l;t++){let e=n[t],i=e[0],s=e[1];a[i]||(a[i]={});let l=a[i];if(1===o.length)l[r[s]]=e[2];else for(let t=0;t<o.length;t++){let n=r[s].replace("TR.","")+"_"+o[t],i=e[2+t];null!==i&&(u[n]=r[s],l[n]=i)}}let h={};for(let t in a){let e=a[t];D(e)||(h[t]=e)}let p={data:h};o.length>1&&(p.timeSeries=!0,p.childrenFieldToParent=u),this._dispatch("dataChanged",p)};const Ht=Ot;let Bt=function(){this._groupMap={},this._childToParent={}};Bt.prototype._groupMap,Bt.prototype._childToParent,Bt.getGroupId=function(t){return t&&t.id||""},Bt.calcTreeDepth=function(t,e){let n=-1,i=e;for(;i;){if(++n>15){console.log("WARNING: Infinite loop detected during column group creation");break}i=t[i.parentId]}return n},Bt.getLeafDescendants=function(t,e){let n=t[e];if(!n)return null;let i=[],o=[n],r=0,s={};for(;r<o.length;){n=o[r++],s[n.id]=!0;let e=n.children,l=e?e.length:0;for(let r=0;r<l;++r){let l=e[r];n=t[l],n?s[n.id]||o.push(n):i.push(l)}}return i},Bt._cloneObject=function(t){let e=I(t);return Array.isArray(e.children)?e.children=e.children.slice():e.children=[],e},Bt._toGroupDefinition=function(t,e){let n=null;return t&&(n=Array.isArray(t)?{children:t.slice()}:Bt._cloneObject(t),e&&(n.name||(n.name=e),n.id=e)),n},Bt.prototype.toString=function(){let t=this._groupMap,e=[];e.push("=== groupDefs ===");for(let n in t){let i=t[n];e.push(n+": "+JSON.stringify(i,["id","parentId","children"]))}return e.push("=== childToParent ==="),e.push(JSON.stringify(this._childToParent,null,2)),e.push(""),e.join("\n")},Bt.prototype.getGroup=function(t){return t&&this._groupMap[t]||null},Bt.prototype.getDefinition=Bt.prototype.getGroup,Bt.prototype.getGroups=function(){let t=[],e=this._groupMap;for(let n in e)t.push(e[n]);return t},Bt.prototype.getGroupIds=function(){return Object.keys(this._groupMap)},Bt.prototype.getGroupMap=function(){return this._groupMap},Bt.prototype.cloneGroupMap=function(){let t=this._groupMap,e={};for(let n in t){let i=t[n],o=Bt._cloneObject(i);e[n]=o}return e},Bt.prototype.rebuildMap=function(){let t,e,n=this._groupMap,i=this._childToParent={},o=Object.keys(n),r=o.length;for(t=0;t<r;++t){e=o[t];let r=n[e].children,s=r?r.length:0;for(let t=0;t<s;t++)i[r[t]]=e}for(t=0;t<r;++t){e=o[t];let r=i[e];r&&(n[e].parentId=r)}},Bt.prototype.getGroupChildren=function(t){let e=this._groupMap[t];return e?e.children:null},Bt.prototype.getLeafDescendants=function(t){return Bt.getLeafDescendants(this._groupMap,t)},Bt.prototype.getGroupLevel=function(t){return Bt.calcTreeDepth(this._groupMap,this._groupMap[t])},Bt.prototype.getRootGroup=function(t){if(!t)return null;let e=this._groupMap,n=e[t]||null;if(n)for(;n.parentId;){let t=e[n.parentId];if(!t)break;n=t}return n},Bt.prototype.getParentGroup=function(t){return this.getGroup(this._childToParent[t])},Bt.prototype.getParentIds=function(t){if(t&&"string"==typeof t){let e=this._childToParent[t];if(e){let t=[e],n=this._groupMap[e];for(;n&&n.parentId;)n=this._groupMap[n.parentId],n&&t.push(n.id);return t}}return null},Bt.prototype.getParentId=function(t,e){let n=this._childToParent[t];if(null!=e){let t=this.getGroupLevel(n);for(;t>e&&n;)n=this._childToParent[n],t--}return n||""},Bt.prototype.removeAllGroups=function(){for(let t in this._groupMap)return this._groupMap={},this._childToParent={},!0;return!1},Bt.prototype.setGroups=function(t){let e=this._groupMap={},n=t?t.length:0;for(let i=0;i<n;i++){let n=t[i],o=n.id;o&&(e[o]=Bt._cloneObject(n))}this.rebuildMap()},Bt.prototype.addGroup=function(t){let e=Bt.getGroupId(t);return e?this.setGroup(e,t):e},Bt.prototype.removeGroup=function(t){return!!this._groupMap[t]&&(this.removeAllChildren(t),this.unsetParent(t),delete this._groupMap[t],!0)},Bt.prototype.setGroup=function(t,e){if(!t)return"";if(e){let n=Bt._toGroupDefinition(e,t);this._ungroupChildren(n.children),this._groupMap[t]&&this.removeAllChildren(t);let i=this._childToParent[t];i&&(n.parentId=i),this._groupMap[t]=n;let o=n.children,r=o.length;for(let e=0;e<r;++e){let n=o[e];this._childToParent[n]=t;let i=this._groupMap[n];i&&(i.parentId=t)}}else if(!this.removeGroup(t))return"";return t},Bt.prototype._ungroupChildren=function(t){if(Array.isArray(t)){let e=t.length;for(let n=0;n<e;++n)this.unsetParent(t[n])}},Bt.prototype.hasGroupChild=function(t,e){let n=this._groupMap[t];if(e&&n){let t=n.children;if(t)return t.indexOf(e)>=0}return!1},Bt.prototype.contains=function(t,e){if(t&&e){if(t===e)return!0;let n=20,i=this._childToParent[e];for(;i&&n;){if(t===i)return!0;--n,i=this._childToParent[i]}}return!1},Bt.prototype.addGroupChild=function(t,e,n){let i=this._groupMap[t];if(e&&i){let o=i.children;if(o&&o.indexOf(e)<0){this.unsetParent(e),this._childToParent[e]=t;let i=this._groupMap[e];return i&&(i.parentId=t),null!=n&&n>=0?o.splice(n,0,e):o.push(e),!0}}return!1},Bt.prototype.removeGroupChild=function(t,e){return null==e?this.unsetParent(t):!!this.hasGroupChild(t,e)&&this.unsetParent(e)},Bt.prototype.unsetParent=function(t){let e=this._childToParent[t];if(!e)return!1;this._childToParent[t]="";let n=this._groupMap[t];n&&(n.parentId="");let i=this._groupMap[e];if(i){let e=i.children;if(e&&e.length){let n=e.indexOf(t);n>=0&&e.splice(n,1)}}return!0},Bt.prototype.removeAllChildren=function(t){let e=this._groupMap[t];if(e){let t=e.children,n=t?t.length:0;if(n){e.children=[];for(let e=0;e<n;++e){let n=t[e];this._childToParent[n]&&(this._childToParent[n]="");let i=this._groupMap[n];i&&(i.parentId="")}return!0}}return!1},Bt.prototype.setGroupChildren=function(t,e){let n=this._groupMap[t];if(n){if(Array.isArray(e)){let i=e.slice();this._ungroupChildren(i),this.removeAllChildren(t),n.children=i;let o=n.id,r=i.length;for(let t=0;t<r;++t){let e=i[t];this._childToParent[e]=o;let n=this._groupMap[e];n&&(n.parentId=o)}return!0}if(!e&&n.children.length)return this.removeAllChildren(t),!0}return!1},Bt.prototype.getGroupName=function(t){let e=this._groupMap[t];return e&&e.name||""},Bt.prototype.setGroupName=function(t,e){let n=this._groupMap[t];return!(!n||n.name===e||(n.name=e,0))};let Gt=function(t){this._element=t||document.createElement("div")};o.inherits(Gt,ct),Gt.prototype._element=null,Gt.prototype._content=null,Gt.prototype._textSpan=null,Gt.prototype._nativeEvents=null,Gt._passiveEvents=null,Gt.prototype.getContent=function(t){return t?this._element.children:this._element.lastChild},Gt.prototype.setContent=function(t,e){if(null==t||t!=t?t=null:1!==t.nodeType&&11!==t.nodeType&&(null==t.getElement?(ut.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},Gt.prototype.addContent=function(t){return null==(t=ut.getElement(t))?null:(this._content=this._element.children,this._element.appendChild(t),t)},Gt.prototype.removeContent=function(t){return null!=(t=ut.getElement(t))&&(this._content=this._element.children,this._element.removeChild(t),!0)},Gt.prototype.listen=function(t,e,n){if(this._customEvents&&this._customEvents[t])return void this._customEvents[t].listen(e,n);this._nativeEvents||(this._nativeEvents={});let i=this._nativeEvents[t];if(!i){if(i=new pt,this._nativeEvents[t]=i,i.dispatch=i.dispatch.bind(i),!Gt._passiveEvents){let t=!1;try{let e=Object.defineProperty({},"passive",{get:function(){return t=!0,!1}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(t){}if(t){let t={passive:!0};Gt._passiveEvents={touchstart:t,touchmove:t}}else Gt._passiveEvents={}}this._element.addEventListener(t,i.dispatch,Gt._passiveEvents[t]||!1)}i.listen(e,n)},Gt.prototype.unlisten=function(t,e){if(this._customEvents&&this._customEvents[t])this._customEvents[t].unlisten(e);else if(this._nativeEvents){let n=this._nativeEvents[t];n&&n.unlisten(e)}},Gt.prototype.unlistenAll=function(t){if(this._customEvents)if(t)this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(let t in this._customEvents)this._customEvents[t].unlistenAll();if(this._nativeEvents)if(t)this._nativeEvents[t]&&(this._unlistenAll(t),delete this._nativeEvents[t]);else{for(let t in this._nativeEvents)this._unlistenAll(t);this._nativeEvents=null}},Gt.prototype._unlistenAll=function(t){let e=this._nativeEvents[t];this._element.removeEventListener(t,e.dispatch,!1),e.unlistenAll()},Gt.prototype.dispose=function(){this._dispose()},Gt.prototype._dispose=function(){this.setParent(null),this.unlistenAll(),this._element=this._content=this._textSpan=null,this._customEvents=this._nativeEvents=null},Gt.prototype.setEventArgExtender=function(t,e){if(this._customEvents){let n=this._customEvents[t];n&&n.setEventArgExtender(e)}},Gt.prototype.getElement=function(){return this._element},Gt.prototype.getNextSibling=function(){return this._element.nextSibling},Gt.prototype.getParent=function(){return this._element.parentNode},Gt.prototype.setParent=function(t,e){this._setParent(t,e)},Gt.prototype._setParent=function(t,e){null!==(t=ut.getElement(t))?e?t.insertBefore(this._element,t.firstChild):t.appendChild(this._element):null!==this._element.parentNode&&this._element.parentNode.removeChild(this._element)},Gt.prototype.insertBefore=function(t){this._insertBefore(t)},Gt.prototype._insertBefore=function(t){if(null==(t=ut.getElement(t)))return void this.setParent(this.getParent());let e=t.parentNode;null!=e&&e.insertBefore(this._element,t)},Gt.prototype.insertAfter=function(t){(t=ut.getElement(t))?t.nextSibling?this.insertBefore(t.nextSibling):this.setParent(t.parentNode):this.setParent(this.getParent(),!0)},Gt.prototype.hasClass=function(t){return!!this._element&&this._element.classList.contains(t)},Gt.prototype.addClass=function(t){this._element&&this._element.classList.add(t)},Gt.prototype.removeClass=function(t){this._element&&this._element.classList.remove(t)},Gt.prototype.toggleClass=function(t,e){let n=this._element;n&&(null==e&&(e=!n.classList.contains(t)),e?n.classList.add(t):n.classList.remove(t))},Gt.prototype.enableClass=function(t,e){!1!==e?this.addClass(t):this.removeClass(t)},Gt.prototype.getClass=function(){return this._element.className},Gt.prototype.setClass=function(t){this._element.className=t},Gt.prototype.getAttribute=function(t){return this._element.getAttribute(t)},Gt.prototype.hasAttribute=function(t){return this._element.hasAttribute(t)},Gt.prototype.setAttribute=function(t,e){this._element.setAttribute(t,e)},Gt.prototype.setAttributes=function(t){for(let e in t)this._element.setAttribute(e,t[e])},Gt.prototype.removeAttribute=function(t){this._element.removeAttribute(t)},Gt.prototype.getStyle=function(t){return this._element.style[t]},Gt.prototype.setStyle=function(t,e){this._element.style[t]=e},Gt.prototype.setStyles=function(t){let e=this._element.style;for(let n in t)e[n]=t[n]},Gt.prototype.getId=function(){return this._element.id},Gt.prototype.setId=function(t){this._element.id=t},Gt.prototype.toString=function(){let t=this._element.outerHTML;return t=t.replace(this._element.innerHTML,""),t},Gt.prototype.getTextContent=function(){return this._element.textContent},Gt.prototype.setTextContent=function(t){this._element.textContent=t},Gt.prototype.getLeft=function(){return this._element.offsetLeft},Gt.prototype.setLeft=function(t){return this._element.style.left=t+"px",!0},Gt.prototype.getTop=function(){return this._element.offsetTop},Gt.prototype.setTop=function(t){return this._element.style.top=t+"px",!0},Gt.prototype.getWidth=function(){return this._element.offsetWidth},Gt.prototype.setWidth=function(t){return this._element.style.width=t+"px",!0},Gt.prototype.getHeight=function(){return this._element.offsetHeight},Gt.prototype.setHeight=function(t){return t<0&&(t=0),this._element.style.height=t+"px",!0},Gt.prototype.getBoundingClientRect=function(){return this._element.getBoundingClientRect()},Gt.prototype.fillParentWidth=function(t){return null==t&&(t=100),this._element.style.width=t+"%",!0},Gt.prototype.fillParentHeight=function(t){return null==t&&(t=100),this._element.style.height=t+"%",!0},Gt.prototype.getTooltip=function(){return this.getAttribute("title")},Gt.prototype.setTooltip=function(t){t?this.setAttribute("title",t):this.removeAttribute("title")},Gt.prototype.show=function(t){this._element.style.display=!1!==t?"":"none"},Gt.prototype.hide=function(t){this.show(!1===t)},Gt.prototype.isVisible=function(){return"none"!==this._element.style.display},Gt.prototype.enable=function(t){(t=!1!==t)?this.removeAttribute("disabled"):(this.setAttribute("disabled","disabled"),this._element.disabled=!t)},Gt.prototype.disable=function(t){this.enable(!1===t)},Gt.prototype.isEnabled=function(){return!this._element.hasAttribute("disabled")},Gt.prototype.getScrollLeft=function(){return this._element.scrollLeft},Gt.prototype.getScrollTop=function(){return this._element.scrollTop},Gt.prototype.isEndOfHorizontalScroll=function(){return this._element.scrollLeft>=this._element.scrollWidth-this.getWidth()},Gt.prototype.isEndOfVerticalScroll=function(){return this._element.scrollTop>=this._element.scrollHeight-this.getHeight()},Gt._proto=Gt.prototype;const Wt=Gt;let Ut=function(){this._items=[],this._element=null};o.inherits(Ut,Wt),Ut.prototype._items=[],Ut.prototype.hasItem=function(){return!!this._items.length},Ut.prototype.containItem=function(t){return this._items.indexOf(t)>-1},Ut.prototype.insertItem=function(t,e){let n=this._items;n.indexOf(t)>-1||(n.push(t),e&&(t._order=e),n.length&&n.sort(Ut._iconComparer),this._updatePanelItems())},Ut.prototype.removeItem=function(t){let e=this._items,n=-1;if(t)for(let i=e.length;--i>=0;){let o=e[i];if("string"==typeof t){if(o.classList.contains(t)){n=i;break}}else if(o===t){n=i;break}}else n=e.length-1;let i=null;return n>-1&&(i=e.splice(n,1)[0]),this._updatePanelItems(),i},Ut.prototype.clearItems=function(){let t=this._items;t.length&&(t.length=0,this._updatePanelItems())},Ut._iconComparer=function(t,e){return t._order?e._order?t._order-e._order:1:e._order?-1:0},Ut.prototype._updatePanelItems=function(){let 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(let n=0;n<t.length;n++)e.appendChild(t[n])}};const Yt=Ut;let Xt=function(t,e){this._id=Xt._runningId++,this._element=document.createElement("div"),this._element.className="cell",e&&(this._section=e)};o.inherits(Xt,Wt),Xt.prototype._aligner=null,Xt._runningId=0,Xt.prototype._id=0,Xt.prototype._width=-1,Xt.prototype._height=-1,Xt.prototype._visible=!0,Xt.prototype._rawContent,Xt.prototype._section=null,Xt.prototype._contentLocked=!1,Xt.prototype._collapsedState=0,Xt.prototype._floatingPanel=null,Xt.prototype._frontIcon=null,Xt.prototype._tooltipInfo=null,Xt.prototype.getContent=function(t){return t&&this._element?this._element.children:this._content||null},Xt.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){let t=this._aligner.firstChild;t!==this._content&&(this._rawContent=t,this._content=t)}let n=this._setRawContent(t);return null!=e&&this._content&&this._content.setAttribute("title",e),n},Xt.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)))},Xt.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},Xt.prototype.getNextSibling=function(){return null!==this._element?this._element.nextSibling:null},Xt.prototype.getParent=function(){return null!==this._element?this._element.parentNode:null},Xt.prototype.setParent=function(t,e){let n=ut.getElement(t);if(n){if(this.initialize(),1===this._collapsedState)return;let t;!0===e&&(t=n.firstChild),t?n.insertBefore(this._element,t):n.appendChild(this._element)}else this.removeParent()},Xt.prototype.removeParent=function(){let t=this._element;t&&t.parentNode&&t.parentNode.removeChild(t)},Xt.prototype.insertBefore=function(t){let e=ut.getElement(t);if(null==e)return void this.setParent(this.getParent());let n=e.parentNode;null!=n&&(this.initialize(),n.insertBefore(this._element,e))},Xt.prototype.getTextContent=function(){return this._rawContent?"string"==typeof this._rawContent?this._rawContent:this._rawContent.textContent:""},Xt.prototype.getTextElement=function(){return this._textSpan},Xt.prototype.getWidth=function(){return this._width>=0?this._width:this._element.offsetWidth},Xt.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)},Xt.prototype.getHeight=function(){return this._height>=0?this._height:this._element.offsetHeight},Xt.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)},Xt.prototype.fillParentWidth=function(t){return!1},Xt.prototype.fillParentHeight=function(t){return!1},Xt.prototype.show=function(t){let e=!1!==t;e!==this._visible&&(this._visible=e,this._updateDisplay())},Xt.prototype.isVisible=function(){return this._visible},Xt.prototype.getScrollLeft=function(){return 0},Xt.prototype.getScrollTop=function(){return 0},Xt.prototype.isEndOfHorizontalScroll=function(){return!0},Xt.prototype.isEndOfVerticalScroll=function(){return!0},Xt.prototype.hasElement=function(){return null!==this._element},Xt.prototype.getSection=function(){return this._section},Xt.prototype.initialize=function(){return null==this._aligner&&(ut.isIE?this._aligner=document.createElement("div"):this._aligner=document.createElement("button"),this._aligner.className="valigner",this._aligner.role="gridcell",this._frontIcon&&this._element.appendChild(this._frontIcon.getElement()),this._element.appendChild(this._aligner),this._floatingPanel&&this._element.appendChild(this._floatingPanel.getElement())),this._element},Xt.prototype.updateIcon=function(t){if(!t)return;let e=this._frontIcon;if(e){if(e.containItem(t))return;e.clearItems()}this.insertFrontIcon(t,0)},Xt.prototype.removeIcon=function(){let t=this._frontIcon;t&&(t.clearItems(),this._element.removeChild(t.getElement()),t=this._frontIcon=null)},Xt.prototype.isFrozen=ut._deprecatedFunction,Xt.prototype.freezeLayout=ut._deprecatedFunction,Xt.prototype.setAutoContentClipping=ut._deprecatedFunction,Xt.prototype.setContentTooltip=function(t){return!(null==t||!this._content||(this._content.setAttribute("title",t),0))},Xt.prototype.lockContent=function(t){this._contentLocked=!1!==t},Xt.prototype.reset=function(){if(!this._element)return;let 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();let n=this.blinkState;n&&(n.timerId>=0&&clearInterval(n.timerId),delete this.blinkState),delete this.trendState;let i=this.blinking;i&&(i.blinking>=0&&clearTimeout(i.blinking),i.cell=null,i.styles=null,delete this.blinking),this.removeIcon(),this.setContent(null),this._textSpan&&(this._textSpan.className="text",this._textSpan.textContent="")},Xt.prototype.resetClass=function(){let t="cell";this.hasClass("spanned")&&(t+=" spanned"),this.hasClass("selected-row")&&(t+=" selected-row"),this.hasClass("highlighted-row")&&(t+=" highlighted-row"),this.setClass(t)},Xt.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)},Xt.prototype.insertFloatingIcon=function(t,e){if(!t)return;let n=this._floatingPanel;n||(n=this._floatingPanel=new Yt),n.insertItem(t,e),n.addClass("floating-panel");let i=this._element;i.contains(n.getElement())||i.appendChild(n.getElement())},Xt.prototype.removeFloatingIcon=function(t){let e=this._floatingPanel;if(!e)return null;let n=e.removeItem(t);return e.hasItem()||(this._element.removeChild(e.getElement()),this._floatingPanel=null),n},Xt.prototype.insertFrontIcon=function(t,e){if(!t)return;let n=this._frontIcon;n||(n=this._frontIcon=new Yt),n.insertItem(t,e),n.addClass("front-panel");let i=this._element;i.contains(n.getElement())||i.insertBefore(n.getElement(),i.firstChild)},Xt.prototype.removeFrontIcon=function(t){let e=this._frontIcon;if(!e)return null;let n=e.removeItem(t);return e.hasItem()||(n=e.getElement(),this._element.removeChild(n),this._frontIcon=null),n},Xt.prototype.getCellId=function(){return this._id},Xt.prototype.updatePadding=function(){},Xt.prototype.collapse=function(t,e){let n,i=!1!==t;return n=i?e?2:1:0,this._collapsedState!==n&&(i?e?this.addClass("spanned"):this.setParent(null):2===this._collapsedState&&this.removeClass("spanned"),this._collapsedState=n,!0)},Xt.prototype.isCollapsed=function(){return 0!==this._collapsedState},Xt.prototype.isKeptInDoc=function(){return 1!==this._collapsedState},Xt.prototype.getClientWidth=function(){return this._element?this._element.clientWidth:this.getWidth()},Xt.prototype.getClientHeight=function(){return this._element?this._element.clientHeight:this.getHeight()},Xt.prototype.setTooltip=function(t){this.setTooltipInfo("userTooltip",t),this.updateTooltip()},Xt.prototype.setTooltipInfo=function(t,e){let n=this._tooltipInfo;n||(n=this._tooltipInfo={}),n[t]=e},Xt.prototype.updateTooltip=function(){let t=this._tooltipInfo;if(!t)return;let e="",n=null;t.clippedText&&(e=n=t.clippedTextTooltip),null==t.groupHeaderTooltip?!1!==t.columnDefault&&(null!=t.columnDefault?n=t.columnTooltip:e=t.columnTooltip):!1!==t.groupHeaderDefault&&(null!=t.groupHeaderDefault?n=t.groupHeaderTooltip:e=t.groupHeaderTooltip),null!=t.userTooltip&&(n=t.userTooltip),null==n&&(n=e),n?(this.hasAttribute("tooltip")?this.getAttribute("tooltip"):this.getAttribute("title"))!==n&&this.setAttribute("title",n):(this.hasAttribute("title")&&this.removeAttribute("title"),this.hasAttribute("tooltip")&&this.removeAttribute("tooltip"))},Xt.prototype.getTooltipInfo=function(t){return this._tooltipInfo?this._tooltipInfo[t]:null},Xt.prototype._setRawContent=function(t){if(this._rawContent!==t){this._rawContent=t;let 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();let t=this._aligner;for(;t.lastChild;)t.removeChild(t.lastChild);this._content&&t.appendChild(this._content)}}return this._content},Xt.prototype._updateDisplay=function(){let t=!1;this.isVisible()&&this._width&&this._height&&(t=!0),this._element.style.display=t?"":"none"},Xt._proto=Xt.prototype;const qt=Xt;let jt=function(){this._ends=[],this._cols=[]};jt.prototype._laneCount=0,jt.prototype._defaultSize=10,jt.prototype._defaultScalability=!0,jt.prototype._homogeneous=!0,jt.prototype._visibility=!0,jt.prototype._ends,jt.prototype._cols,jt.prototype._bits=[1,2,4,8],jt.prototype.hitTest=function(t){if(t<0)return-1;if(t>=this.getTrackSize())return~this._laneCount;let e=-1,n=0;if(this._homogeneous){let i=this._defaultSize;e=Math.floor(t/i),n=(e+1)*i}else e=ut.upperBound(this._ends,t),n=this._ends[e];return(e>=this._laneCount||t>=n)&&(e=~e),e},jt.prototype.dispose=function(){this._cols=this._ends=null},jt.prototype.isAtDefaultSize=function(t){if(this._homogeneous)return!0;if(null!=t){if(!this._isAtDefaultSize(t))return!1}else{for(let t=this._cols.length;--t>=0;)if(!this._isAtDefaultSize(t))return!1;this._homogeneous=!0}return!0},jt.prototype._isAtDefaultSize=function(t){let 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},jt.prototype.isHomogeneous=function(){return this._homogeneous},jt.prototype.isAtMinimumSize=function(t){let e=this._getMinimumScalingSize(t);return(null!=t?this.getLaneSize(t):this.getTrackSize())<=e},jt.prototype.isFixedSize=function(){for(let t=0;t<this._laneCount;++t)if(this.getLaneScalability(t))return!1;return!0},jt.prototype.clearLaneCustomizations=function(){this._ends.length=0,this._cols.length=0,this._homogeneous=!0},jt.prototype.getLaneCount=function(){return this._laneCount},jt.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))},jt.prototype.getDefaultLaneSize=function(){return this._defaultSize},jt.prototype.setDefaultLaneSize=function(t){return t<0&&(t=0),this._defaultSize!==t&&(this._defaultSize=t,this._markDirtyIndex(0),!0)},jt.prototype.getLaneDefaultSize=function(t){if(t<0||t>=this._laneCount)return-1;let e=this._newColumn(t);return e.defaultSize?e.defaultSize:-1},jt.prototype.setLaneDefaultSize=function(t,e){!(t<0||t>=this._laneCount)&&e>=0&&(this._newColumn(t).defaultSize=e)},jt.prototype.resetLaneToDefaultSize=function(){let t=!1;for(let e=0;e<this._laneCount;++e){let n=this._cols[e];n&&(n.invisibility||(null!=n.defaultSize?(t|=this.setLaneScalability(e,!1),t|=this.setLaneSize(e,n.defaultSize)):(t|=this.setLaneScalability(e,!0),t|=this.setLaneSize(e,1))))}return!!t},jt.prototype.getDefaultScalability=function(){return this._defaultScalability},jt.prototype.setDefaultScalability=function(t){return this._defaultScalability!==t&&(this._defaultScalability=t,!0)},jt.prototype.getTrackSize=function(){return!this._visibility||this._laneCount<=0?0:this._homogeneous?this._laneCount*this._defaultSize:(this._updateEndPoints(),this._ends[this._laneCount-1])},jt.prototype.setTrackSize=function(t){let e=0,n=0,i=[];for(e=0;e<this._laneCount;++e){let t=this._cols[e];t?t.invisibility||(!1!==this._getLaneScalability(t)?i.push(e):n+=this._getFixedSize(t)):i.push(e)}if(i.length<=0)return null;let o=this._distributeLaneSize(t-n,i),r=!1,s=[];for(e=o.length;--e>=0;){s[e]=0;let t=o[e];if(null!=t){let n=this.getLaneSize(e);this._newColumn(e),this._setCalculatedLaneSize(e,t)&&(s[e]=t-n,r=!0)}}return r?s:null},jt.prototype.getLaneStart=function(t){if(t<=0)return 0;if(this._homogeneous)return t*this._defaultSize;this._updateEndPoints();let e=t-this._laneCount,n=0;return e>0&&(t-=e,n=e*this._defaultSize),this._ends[t-1]+n},jt.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]))},jt.prototype.getLaneSize=function(t){if(this._visibility){let e=this._cols[t];return e?e.actualSize:this._defaultSize}return 0},jt.prototype.getCustomLaneSize=function(t){let e=this._cols[t];return e&&null!=e.customSize?e.customSize:this._defaultSize},jt.prototype.setLaneSize=function(t,e){if(t<0||t>=this._laneCount)return!1;if(e<0||e!=e)return!1;let n=this._cols[t];return(null==n||n.customSize!==e)&&(n=this._newColumn(t),n.customSize=e,this._setCalculatedLaneSize(t,e))},jt.prototype.setLaneProperty=function(t,e,n){if(t<0||t>=this._laneCount)return!1;let i=this._cols[t];return(null==i||i[e]!==n)&&(i=this._newColumn(t),i[e]=n,!0)},jt.prototype.getLaneProperty=function(t,e){let n=this._cols[t];return n&&null!=n[e]?n[e]:null},jt.prototype.getMinimumLaneSize=function(t){let e=this._cols[t];return e&&null!=e.minSize?e.minSize:0},jt.prototype.setMinimumLaneSize=function(t,e,n){if(t<0||t>=this._laneCount)return!1;if(e<0&&(e=0),this.getMinimumLaneSize(t)!==e){let i=this._newColumn(t);return i.minSize=e,n&&this.getLaneScalability(t)&&(i.customSize=e),this._setCalculatedLaneSize(t)}return!1},jt.prototype.isLaneVisible=function(t){let e=this._cols[t];return!e||!e.invisibility},jt.prototype.showLane=function(t,e){return this.hideLane(t,!1===e)},jt.prototype.hideLane=function(t,e,n){if(t<0||t>=this._laneCount)return!1;let i=this._newColumn(t),o=!i.invisibility,r=null!=n?this._bits[n]:1;return!1!==e?i.invisibility|=r:i.invisibility&=~r,o!==!i.invisibility&&this._setCalculatedLaneSize(t)},jt.prototype.getLaneVisibilityBit=function(t,e){if(t>=0&&t<this._laneCount){let n=this._cols[t];if(n){let t=null!=e?this._bits[e]:1;if(n.invisibility&t)return!1}}return!0},jt.prototype.show=function(t){if(t=!1!==t,this._visibility!==t)if(this._visibility=t,t)for(let t=0;t<this._laneCount;++t)this._newColumn(t),this._setCalculatedLaneSize(t);else this._markDirtyIndex(0)},jt.prototype.getLaneScalability=function(t){let e=this._cols[t];return e&&null!=e.scalability?e.scalability:this._defaultScalability},jt.prototype.setLaneScalability=function(t,e){if(t<0||t>=this._laneCount)return!1;let n=this._cols[t];return!(n&&n.scalability===e||(n=this._newColumn(t),n.scalability=e,0))},jt.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);let n=this.serializeLane(t);return this._cols.splice(t,e),this._laneCount-=e,n},jt.prototype.insertLane=function(t,e){t<0&&(t=0);let n=1;if(ut.isNumber(e)){if(e<=0)return;n=e,e=null}if(t>=this._laneCount&&(t=this._laneCount,!e))this.setLaneCount(this._laneCount+n);else if(this._laneCount+=n,this._markDirtyIndex(t),ut.insertEmptyItems(this._cols,t,n),e){let i=t+n;for(let n=t;n<i;++n)this.deserializeLane(n,e)}},jt.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)return;let n=t<e?t:e;this._markDirtyIndex(n),ut.moveArrayItem(this._cols,t,e)},jt.prototype.serializeLane=function(t){if(t<0||t>=this._laneCount)return null;let e={};e.index=t;let n=this._cols[t];return n?(e.size=n.customSize,e.minSize=n.minSize,e.visible=!n.invisibility,e.scalable=n.scalability,e):e},jt.prototype.deserializeLane=function(t,e){if(!e)return;if(t<0||t>=this._laneCount)return;let n=e.size;null!=n&&this.setLaneSize(t,n),n=e.minSize,null!=n&&this.setMinimumLaneSize(t,n),n=e.visible,null!=n&&this.showLane(t,n),n=e.scalable,null!=n&&this.setLaneScalability(t,n)},jt.prototype._updateEndPoints=function(){let t=this._ends.length;if(t>=this._laneCount)return;this._ends.length=this._laneCount;let e=0,n=t>0?this._ends[t-1]:0;for(e=t;e<this._laneCount;++e)n+=this.getLaneSize(e),this._ends[e]=n},jt.prototype._setCalculatedLaneSize=function(t,e){let n=this._cols[t];if(this._visibility&&!n.invisibility){if(null==e&&(e=null!=n.customSize?n.customSize:this._defaultSize),!n.scalability){let t=null!=n.minSize?n.minSize:0;e<t&&(e=t)}}else e=0;return n.actualSize!==e&&(n.actualSize=e,this._homogeneous=!1,this._markDirtyIndex(t),!0)},jt.prototype._getMinimumScalingSize=function(t){let e=0;if(null!=t){let e=this._cols[t];if(!e.invisibility&&null!=e.minSize)return!1===this._getLaneScalability(e)&&null!=e.customSize&&e.customSize>e.minSize?e.customSize:e.minSize}else for(let t=this._laneCount;--t>=0;)e+=this._getMinimumScalingSize(t);return e},jt.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},jt.prototype._getLaneScalability=function(t){return null==t.scalability?this._defaultScalability:t.scalability},jt.prototype._distributeLaneSize=function(t,e){if(e.length<=0)return[];t<0&&(t=0);let n=0,i=0,o=0,r=0,s=[],l=[],a=[];for(n=e.length;--n>=0;)o=e[n],s[o]=this.getMinimumLaneSize(o),l[o]=this.getCustomLaneSize(o),i+=l[o];let u=!0;for(;u;)for(u=!1,n=e.length;--n>=0;){o=e[n];let h=s[o],p=l[o];r=t*p/i,r<=h&&(u=!0,a[o]=h,t-=h,i-=p,e.splice(n,1))}let h=e.length-1,p=0,d=0;for(n=h;--n>=0;){o=e[n],r=t*l[o]/i;let s=Math.floor(r);d+=r-s,d>=1&&(++s,--d),a[o]=s,p+=s}return a[e[h]]=Math.floor(t-p),a},jt.prototype._markDirtyIndex=function(t){t<this._ends.length&&(this._ends.length=t)},jt.prototype._newColumn=function(t){let e=this._cols[t];return e||(this._cols[t]=e={},e.invisibility=0),e},jt.prototype.copyFrom=function(t,e){if(this._homogeneous&&t._homogeneous&&this._defaultSize===t._defaultSize)return;e||(e=0);let n=t.getLaneCount(),i=this.getLaneCount(),o=e+n;o>i&&(o=i);let r=0;for(let n=e;n<o;++n){let e=t.getLaneSize(r++),i=this._newColumn(n);i.customSize!==e&&(i.customSize=e,i.actualSize!==e&&(i.actualSize=e,this._homogeneous=!1,this._markDirtyIndex(n)))}};const Kt=jt;let Jt=function(){};Jt.prototype.hitTest=function(t,e,n){},Jt.prototype.hitTestX=function(t){},Jt.prototype.hitTestY=function(t){},Jt.prototype.getDefaultColumnWidth=function(){},Jt.prototype.setDefaultColumnWidth=function(t){},Jt.prototype.getDefaultRowHeight=function(){},Jt.prototype.setDefaultRowHeight=function(t){},Jt.prototype.getColumnWidth=function(t){},Jt.prototype.setColumnWidth=function(t,e){},Jt.prototype.getRowHeight=function(t){},Jt.prototype.setRowHeight=function(t,e){},Jt.prototype.isColumnVisible=function(t){},Jt.prototype.hideColumn=function(t,e){},Jt.prototype.isRowVisible=function(t){},Jt.prototype.hideRow=function(t,e){},Jt.prototype.getMinimumColumnWidth=function(t){},Jt.prototype.setMinimumColumnWidth=function(t,e){},Jt.prototype.getMinimumRowHeight=function(t){},Jt.prototype.setMinimumRowHeight=function(t,e){},Jt.prototype.getCellLeft=function(t){},Jt.prototype.getCellTop=function(t){},Jt.prototype.getCellWidth=function(t,e){},Jt.prototype.getCellHeight=function(t,e){},Jt.prototype.hasCellSpan=function(){},Jt.prototype.getCellRowSpan=function(t,e){},Jt.prototype.setCellRowSpan=function(t,e,n){},Jt.prototype.getCellColSpan=function(t,e){},Jt.prototype.setCellColSpan=function(t,e,n){},Jt.prototype.clearCellSpans=function(){},Jt.prototype.clearColumnSpans=function(t){},Jt.prototype.clearColumnCustomizations=function(){},Jt.prototype.clearRowCustomizations=function(){},Jt.prototype.getColumnScalability=function(t){},Jt.prototype.setColumnScalability=function(t,e){},Jt.prototype.getRowScalability=function(t){},Jt.prototype.setRowScalability=function(t,e){},Jt.prototype.getCell=function(t,e,n){},Jt.prototype.getCellContent=function(t,e){},Jt.prototype.setCellContent=function(t,e,n){},Jt.prototype.getColumn=function(t){},Jt.prototype.getColumnCount=function(){},Jt.prototype.setColumnCount=function(t){},Jt.prototype.getRowCount=function(){},Jt.prototype.setRowCount=function(t,e){},Jt.prototype.getVisibleRowCount=function(){},Jt.prototype.addRow=function(t){},Jt.prototype.removeRow=function(t){},Jt.prototype.setBorders=function(t,e,n,i){},Jt.prototype.getColumnStyle=function(t,e){},Jt.prototype.setColumnStyle=function(t,e,n){},Jt.prototype.enableColumnClass=function(t,e,n){},Jt.prototype.hasColumnClass=function(t,e){},Jt.prototype.enableRowClass=function(t,e,n){},Jt.prototype.setRowStyle=function(t,e,n,i){},Jt.prototype.getRelativePosition=function(t){},Jt.prototype.getContentWidth=function(){},Jt.prototype.getContentHeight=function(){},Jt.prototype.getCellsByRowIndex=function(t){},Jt.prototype.disableHorizontalGridLine=function(t){},Jt.prototype.disableVerticalGridLine=function(t){},Jt.prototype.enableShading=function(t){},Jt.prototype.setTransposedShading=function(t){},Jt.prototype.enableRowHighlighting=function(t){},Jt.prototype.getRowHighlight=function(){},Jt.prototype.setRowHighlight=function(t){},Jt.prototype.getSelectedRows=function(){},Jt.prototype.getSelectedRowCount=function(){},Jt.prototype.isSelectedRow=function(t){},Jt.prototype.getRowAnchor=function(){},Jt.prototype.setRowAnchor=function(t){},Jt.prototype.setSelectedRow=function(t,e){},Jt.prototype.selectSingleRow=function(t){},Jt.prototype.selectRowRange=function(t,e){},Jt.prototype.clearSelectedRows=function(){},Jt.prototype.getFirstSelectedRow=function(){},Jt.prototype.getLastSelectedRow=function(){},Jt.prototype.activateColumn=function(t,e){},Jt.prototype.activateRows=function(t,e,n){},Jt.prototype.moveRowsToTop=function(t){},Jt.prototype.getFirstIndexInView=function(){},Jt.prototype.getLastIndexInView=function(){},Jt.prototype.isInCurrentView=function(t){},Jt.prototype.getFrozenLayout=function(){},Jt.prototype.setFrozenLayout=function(t){},Jt.prototype.insertColumn=function(t,e){},Jt.prototype.removeColumnAt=function(t){},Jt.prototype.moveColumn=function(t,e){},Jt.prototype.enableRowVirtualization=function(t){},Jt.prototype.enableColumnVirtualization=function(t){},Jt.prototype.getColumnIndex=function(t){},Jt.prototype.getCellIndex=function(t,e){},Jt.prototype.getIndex=function(){},Jt.prototype.setIndex=function(t){},Jt.prototype.getRowOffset=function(){},Jt.prototype.setRowOffset=function(t){},Jt.prototype.updateLayout=function(){},Jt.prototype.stretchCell=function(t,e,n,i){},Jt.prototype.unstretchCell=function(t,e){},Jt.prototype.unstretchAllCells=function(){},Jt.prototype.getStretchedCell=function(t,e){},Jt.prototype.getStretchedCells=function(){},Jt.prototype.updateStretchedCells=function(){},Jt.prototype.getColumnHost=function(){},Jt.prototype.setHidingMethod=function(t){},Jt.prototype.getHidingMethod=function(){},Jt.prototype.setColumnVisibility=function(t,e,n){},Jt.prototype.getRowLayout=function(){},Jt.prototype.reserveRightSpace=function(t){},Jt.prototype.getReservedSpace=function(){},Jt.prototype.getComputedStyle=function(){},Jt.prototype.isColumnActive=function(t){},Jt.prototype.setRowAttributes=function(t,e){},Jt.prototype.getContextRow=function(t){},Jt.prototype.selectColumn=function(t,e){},Jt.prototype.isSelectedColumn=function(t){},Jt.prototype.selectCell=function(t,e,n){},Jt.prototype.setCellBounds=function(t,e,n,i){},Jt.prototype.getHorizontalLayout=function(){},Jt.prototype.calculateColumnBounds=function(t,e,n,i){},Jt.prototype.updateColumnBounds=function(t,e,n){},Jt.prototype.updateColumnSeparators=function(){};let Qt=function(t){(this._element=document.createElement("div")).className="column",this._cells=[],this._section=t};o.inherits(Qt,Wt),Qt.prototype._nextSibling=null,Qt.prototype._parent=null,Qt.prototype._section=null,Qt.prototype._cells=null,Qt.prototype._cellStart=0,Qt.prototype._cellEnd=0,Qt.prototype._autoStyleUpdating=!1,Qt.prototype._deactivation=!1,Qt.prototype._sizeClasses=null,Qt.prototype._colLeft=0,Qt.prototype._absolute=!1,Qt.prototype._scrollFrame=null,Qt.prototype._invisibility=0,Qt.prototype._bits=[1,2,4,8],Qt.prototype._pinned=!0,Qt.prototype.clearContent=function(){for(let t=this._cells.length;--t>=0;)this._cells[t].setContent(null)},Qt.prototype.setLeft=function(t){return this._colLeft=t,this._absolute&&(this._element.style.left=t+"px"),!0},Qt.prototype.enableAbsolutePosition=function(t){(t=!1!==t)!==this._absolute&&(this._absolute=t,this._element.style.left=t?this._colLeft+"px":"")},Qt.prototype.dispose=function(){this._dispose();for(let t=this._cells.length;--t>=0;)this._cells[t].dispose();this._scrollFrame=this._nextSibling=this._parent=this._cells=this._section=null},Qt.prototype.setStyle=function(t,e){let n=this._element;n.style[t]=e,n.style.backgroundColor?n.classList.contains("no-shading")||n.classList.add("no-shading"):n.classList.contains("no-shading")&&n.classList.remove("no-shading")},Qt.prototype.setStyles=function(t){let e=this._element,n=e.style;for(let e in t)n[e]=t[e];e.style.backgroundColor?e.classList.contains("no-shading")||e.classList.add("no-shading"):e.classList.contains("no-shading")&&e.classList.remove("no-shading")},Qt.prototype.show=function(t){this.setVisibility(0,!1!==t)},Qt.prototype.setWidth=function(t){this._element.style.width=t+"px";let e,n=0;t>0&&t<=24?n=3:t>24&&t<=40?n=2:t>40&&t<60&&(n=1);let i=this._sizeClasses;if(i){if(i.length>n){for(e=i.length;--e>=n;)this.removeClass(i[e]);i.length=n}n||(this._sizeClasses=null)}if(n)for(i||(i=[],this._sizeClasses=i),e=i.length;e<n;++e)i[e]=Qt._sizeClasses[e],this.addClass(i[e]);return this.setVisibility(1,t>0),!0},Qt._sizeClasses=["small-col","very-small-col","tiny-col"],Qt.prototype.setHeight=function(t){return this._element.style.height=t+"px",this.setVisibility(2,t>0),!0},Qt.prototype.getParent=function(){return this._parent},Qt.prototype.setParent=function(t,e){if(!this._element)return;this._parent=ut.getElement(t);let n=this._section?this._section.getHidingMethod():"";this._invisibility&&!n||this._setParent(this._parent,e)},Qt.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())},Qt.prototype.enableAutoStyleUpdating=function(t){t=!1!==t,this._autoStyleUpdating!==t&&(this._autoStyleUpdating=t)},Qt.prototype.setNextSibling=function(t){this._nextSibling=t},Qt.prototype.isActive=function(){return!(this._invisibility&this._bits[3])},Qt.prototype.disableDeactivation=function(t){this._deactivation=!1!==t,this._deactivation&&(this.isActive()||this.activate())},Qt.prototype.activate=function(t){return t=this._pinned||this._deactivation||!1!==t,this.isActive()!==t&&(this.setVisibility(3,t),!0)},Qt.prototype.deactivate=function(t){this.activate(!1===t)},Qt.prototype.setCellCount=function(t){let e;for(e=this._cells.length;e<t;++e)this._cells.push(new qt(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)},Qt.prototype.getCell=function(t){return this._cells[t]||null},Qt.prototype.collapseCells=function(t,e,n,i,o){if(e<=0)return;let r=!1,s=this._cells[t];s&&!i&&(r|=s.collapse(n,o));for(let i=1;i<e&&(s=this._cells[t+i],s);++i)r|=s.collapse(n,o);r&&(n?e>1&&(this._hasCollapsedCells=!0):this.updateCellOrders())},Qt.prototype.uncollapseAllCells=ut._deprecatedFunction,Qt.prototype.activateCells=function(t,e){let n,i=this._element;if(this._hasCollapsedCells)t=this._cellEnd,e>this._cellEnd&&(this._cellEnd=e);else if(this._cellStart===t){let i=this._cellEnd-e;if(i>0){for(n=this._cellEnd;--n>=e;)this._cells[n].removeParent();return void(this._cellEnd=e)}if(!(i<0))return;t=this._cellEnd,this._cellEnd=e}else{for(n=this._cellEnd;--n>=this._cellStart;)this._cells[n].removeParent();this._cellStart=t,this._cellEnd=e}for(n=t;n<e;++n){let t=this._cells[n];t.isKeptInDoc()&&(t.initialize(),i.appendChild(t.getElement()))}},Qt.prototype.moveCellsToTop=function(t){if(!this.isActive())return;let e=this._element;for(let n=0;n<t;++n){let t=this._cells[n];t.isKeptInDoc()&&e.appendChild(t.getElement())}this._cells=ut.cycleArray(this._cells,t)},Qt.prototype.updateCellOrders=function(){this._hasCollapsedCells=!1;let t=this._element;for(let e=this._cellStart;e<this._cellEnd;++e){let n=this._cells[e];n.isKeptInDoc()?t.appendChild(n.getElement()):this._hasCollapsedCells=!0}},Qt.prototype.hasCollapsedCells=function(){return this._hasCollapsedCells},Qt.prototype.getCellIndex=function(t){if(!t)return-1;for(let e=this._cellStart;e<this._cellEnd;++e)if(this._cells[e].getElement()===t)return e;return-1},Qt.prototype.getSection=function(){return this._section},Qt.prototype.log=function(){let t=[],e=this._cells.length;for(let n=0;n<e;++n)t.push(this._cells[n].getTextContent());return t},Qt.prototype.getVisibility=function(){return!this._invisibility},Qt.prototype.setVisibility=function(t,e){let n=!this._invisibility,i=this._bits[t]||1;e?this._invisibility&=~i:this._invisibility|=i;let o=!this._invisibility;if(n!==o)if(this._section&&this._section.getHidingMethod())this.enableClass("hidden",!o);else if(o){let t=this._parent;if(!t)return;let e=this._nextSibling;for(;e;){if(e._parent!==t){e=null;break}if(!e._invisibility)break;e=e._nextSibling}this.insertBefore(e)}else this._setParent(null)},Qt.prototype.updateLayout=function(){},Qt.prototype.setScrollState=function(t,e,n){this._scrollFrame=t,this.enableAbsolutePosition(n),this.setParent(e||this._section.getColumnHost()),e||this.activate(),this._pinned=!e},Qt._proto=Qt.prototype;const Zt=Qt;let $t=function(){this._items=[]};$t.prototype._items=null,$t.prototype.dispose=function(){this._items=null},$t.prototype.setItemCount=function(t){let e=this._items,n=e.length;if(n!==t)for(e.length=t;n<t;)e[n++]={}},$t.prototype.getItem=function(t){return this._items[t]||null},$t.prototype.moveItemsToTop=function(t){this._items=ut.cycleArray(this._items,t)};const te=$t;let ee=function(t,e,n){t.setTop(e.getLaneStart(n)),t.setHeight(e.getLaneSize(n))},ne=function(t,e,n,i){if(n){let o=e.getLaneStart(n);t.setLeft(o),t.setWidth(i-o)}else t.setStyle("left",""),t.setWidth(i)},ie=function(t,e,n){this._trackX=t,this._trackY=e,this._section=n,this._cells=[]};ie.prototype._trackX,ie.prototype._trackY,ie.prototype._section,ie.prototype._cells,ie.prototype._activeCount=0,ie.prototype._stretchSize=0,ie.prototype.dispose=function(){let t=this._cells;if(this._activeCount){this._activeCount=0;for(let e=t.length;--e>=0;){let n=t[e];n&&n.dispose()}}t.length=0},ie.prototype.setStretchSize=function(t){this._stretchSize=t},ie.prototype.getStretchSize=function(){return this._stretchSize},ie.prototype.setCellCount=function(t){let e=this._cells,n=e.length;if(n<t)for(e.length=t;n<t;)e[n++]=null;else if(n>t){for(;--n>=t;){let t=e[n];t&&t.dispose()}e.length=t}},ie.prototype.getCell=function(t){let e=this._cells[t];return e&&e.getParent()?e:null},ie.prototype.getCells=function(){let t=[];if(this._activeCount){let e=this._cells,n=e.length;for(let i=0;i<n;++i){let n=e[i];n&&n.getParent()&&t.push(n)}this._activeCount=t.length}return t},ie.prototype.getColumnIndex=function(t){if(t){if(!t.getElement)return null!=t._colIndex?t._colIndex:-1;{let e=t.getElement();if(e)return null!=e._colIndex?e._colIndex:-1}}return-1},ie.prototype.getRowIndex=function(t){if(t){if(t.getElement)return t.getParent()?this._cells.indexOf(t):-1;{let e=this._cells,n=e.length;for(let i=0;i<n;++i){let n=e[i];if(n&&n.getParent()&&n.getElement()===t)return i}}}return-1},ie.prototype.stretchCell=function(t,e){++this._activeCount,(!e||e<0)&&(e=0);let n=this._cells[t]||null;n||(n=new qt(null,this._section),n.addClass("tr-stretched"),n.stretched=!0,this._cells[t]=n);let i=n.getElement();i.stretched=!0,i._colIndex!==e&&(i._colIndex=e,e>0?i.classList.add("right-stretching"):i.classList.remove("right-stretching")),i._rowIndex!==t&&(i._rowIndex=t);let o=this._stretchSize||this._trackX.getTrackSize();return ne(n,this._trackX,e,o),ee(n,this._trackY,t),n},ie.prototype.unstretchCell=function(t){let e=this._cells[t]||null;return e&&e.setParent(null),e},ie.prototype.unstretchAllCells=function(){if(this._activeCount){this._activeCount=0;let t=this._cells;for(let e=t.length;--e>=0;){let n=t[e];n&&n.setParent(null)}}},ie.prototype.updateCells=function(){if(this._activeCount){let t=0,e=this._cells,n=e.length,i=this._trackX,o=this._trackY,r=this._stretchSize||i.getTrackSize();for(let s=0;s<n;++s){let n=e[s];n&&n.getParent()&&(++t,ne(n,i,n.getElement()._colIndex,r),ee(n,o,s))}this._activeCount=t}},ie.prototype.updateXAxis=function(){if(this._activeCount){let t=0,e=this._cells,n=e.length,i=this._trackX,o=this._stretchSize||i.getTrackSize();for(let r=0;r<n;++r){let n=e[r];n&&n.getParent()&&(++t,ne(n,i,n.getElement()._colIndex,o))}this._activeCount=t}},ie.prototype.updateYAxis=function(){if(this._activeCount){let t=0,e=this._cells,n=e.length,i=this._trackY;for(let o=0;o<n;++o){let n=e[o];n&&n.getParent()&&(++t,ee(n,i,o))}this._activeCount=t}},ie.prototype.moveCellsToTop=function(t){this._activeCount&&(this._cells=ut.cycleArray(this._cells,t),this.updateYAxis())};const oe=ie;let re=function(t,e){this.indexX=t,this.indexY=e};re.prototype.isSpanIndices=function(t,e){return t===this.indexX&&e===this.indexY},re.prototype.isOccupiedIndices=function(t,e){return t!==this.indexX||e!==this.indexY},re.prototype.register=function(t,e){this._register(t,e,!0)},re.prototype.unregister=function(t,e){this._register(t,e,!1)},re.prototype._register=function(t,e,n){let i=t.indexOf(this);n?i<0&&t.push(this):i>=0&&t.splice(i,1);let o=n?this:null,r=this.indexX+this.colSpan,s=this.indexY+this.rowSpan;for(let t=this.indexX;t<r;++t)for(let n=this.indexY;n<s;++n)e[t+","+n]=o},re.prototype.indexX,re.prototype.indexY,re.prototype.colSpan=1,re.prototype.rowSpan=1,re.prototype.prevColSpan=1,re.prototype.prevRowSpan=1,re.prototype.retVal=0;const se=re;let le=function(){this._spans=[],this._occupiedMap={}};le.prototype.removeColumn=function(t){let e=!1;return this.removeSpanByColIndex(t)&&(e=!0),this.shiftColumn(t,-1)&&(e=!0),e},le.prototype.freezeMapping=function(t){this._frozenMapping=!1!==t,this._frozenMapping||this._mapCellSpans()},le.prototype._mapCellSpans=function(){let t,e,n=this._spans;for(this._spans=[],this._occupiedMap={},t=n.length;--t>=0;)e=n[t],e.indexX>=0&&e.register(this._spans,this._occupiedMap)},le.prototype.shiftColumn=function(t,e){if(this._spans.length<=0||0===e)return!1;let n=!1;for(let i=this._spans.length;--i>=0;){let o=this._spans[i];o.indexX>=t&&(n=!0,o.indexX+=e)}return!(!n||this._frozenMapping||(this._mapCellSpans(),0))},le.prototype.removeSpan=function(t,e){if(this._spans.length<=0)return null;let n=t+","+e,i=this._occupiedMap[n];return!i||i.isOccupiedIndices(t,e)?null:(i.unregister(this._spans,this._occupiedMap),i)},le.prototype.removeSpanByColIndex=function(t,e){let n,i=this._spans.length;if(i<=0)return null;let o,r=e||[],s=0;for(o=0;o<i;++o)n=this._spans[o],n&&n.indexX===t&&(r.push(n),s++);if(s<=0)return null;for(i=r.length,o=0;o<s;++o)r[i-o-1].unregister(this._spans,this._occupiedMap);return r},le.prototype.removeSpanStartedFromRowIndex=function(t,e){let n,i=this._spans.length;if(i<=0)return null;let o,r=e||[],s=0;for(o=0;o<i;++o)n=this._spans[o],n&&n.indexY>=t&&(r.push(n),s++);if(s<=0)return null;for(i=r.length,o=0;o<s;++o)r[i-o-1].unregister(this._spans,this._occupiedMap);return r},le.prototype.clearAllSpans=function(){if(this._spans.length<=0)return null;let t=this._spans;return this._spans=[],this._occupiedMap={},t},le.prototype.hasSpan=function(){return this._spans.length>0},le.prototype.getSpan=function(t,e){let n=this.getOccupyingSpan(t,e);return n&&n.isSpanIndices(t,e)?n:null},le.prototype.getOccupyingSpan=function(t,e){return this._spans.length<=0?null:this._occupiedMap[t+","+e]||null},le.prototype.getAllSpans=function(){return this._spans},le.prototype.getColSpan=function(t,e){let n=this._occupiedMap[t+","+e];return null==n?1:n.isOccupiedIndices(t,e)?n.indexX-t:n.colSpan},le.prototype.getRowSpan=function(t,e){let n=this._occupiedMap[t+","+e];return null==n?1:n.isOccupiedIndices(t,e)?n.indexY-e:n.rowSpan},le.prototype.setColSpan=function(t,e,n){return this._updateSpan(t,e,!0,n)},le.prototype.setRowSpan=function(t,e,n){return this._updateSpan(t,e,!1,n)},le.prototype._updateSpan=function(t,e,n,i){i<1&&(i=1);let o=this.getSpan(t,e);o&&(o.retVal=0);let r,s,l,a,u,h,p=t,d=e,c=o?o.colSpan:1,_=o?o.rowSpan:1,f=!0;if(n){if(c===i)return o;if(c>i)p=t+i,r=t+c,f=!1;else{if(l=this._occupiedMap[t+","+e],l&&l!==o)return o;p=t+c,r=t+i}s=e+_}else{if(_===i)return o;if(_>i)d=e+i,s=e+_,f=!1;else{if(l=this._occupiedMap[t+","+e],l&&l!==o)return o;d=e+_,s=e+i}r=t+c}if(f){let n=[];for(u=p;u<r;++u)for(h=d;h<s;++h){if(a=u+","+h,this._occupiedMap[a])return o;n.push(a)}for(null==o&&(o=new se(t,e),a=t+","+e,this._spans.push(o),this._occupiedMap[a]=o),u=n.length;--u>=0;)this._occupiedMap[n[u]]=o}else{if(n?i+_<=2:i+c<=2){a=t+","+e;let n=this._spans.indexOf(o);this._spans.splice(n,1),this._occupiedMap[a]=null}for(u=p;u<r;++u)for(h=d;h<s;++h)this._occupiedMap[u+","+h]=null}return n?(o.prevColSpan=o.colSpan,o.colSpan=i):(o.prevRowSpan=o.rowSpan,o.rowSpan=i),o.retVal=f?1:-1,o},le.prototype._spans,le.prototype._occupiedMap,le.prototype._frozenMapping=!1;const ae=le;let ue=function(){this._selections=[]};ue.prototype.clone=function(){let t=new ue;return t._selections=this._selections.concat(),t._count=this._count,t._anchor=this._anchor,t._firstIndex=this._firstIndex,t._lastIndex=this._lastIndex,t},ue.prototype.toString=function(){return this._selections.join(", ")},ue.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))},ue.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)},ue.prototype.deselectFrom=function(t){if(this._lastIndex<t)return!1;if(this._firstIndex>=t)return this.clearAllSelections(),!0;let e=this._lastIndex,n=this._selections;for(let i=t;i<=e;++i)n[i]&&(n[t]=!1,--this._count);return this._anchor>=t&&(this._anchor=-1),this._lastIndex=this._findPrevSelection(t),!0},ue.prototype.toggleSelection=function(t){this._selections[t]?this.deselect(t):this.select(t)},ue.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)},ue.prototype.selectRange=function(t,e){if(0===e)return;if(t<0&&(t=0),1===e||-1===e)return void this.select(t);let n=t,i=n+e;if(e<0&&(i=n+1,n=i+e),!(n>=i)){this._anchor=t,(this._firstIndex<0||n<this._firstIndex)&&(this._firstIndex=n),(this._lastIndex<0||i>=this._lastIndex)&&(this._lastIndex=i-1);for(let t=n;t<i;++t)this._select(t)}},ue.prototype.deselectRange=function(t,e){if(this._count<=0)return;if(t<0&&(t=0),1===e||-1===e)return void this.deselect(t);let n=t+e;if(e<0&&(n=t+1,t=n+e),this._firstIndex>=t&&this._lastIndex<n)return void this.clearAllSelections();this._anchor>=t&&this._anchor<n&&(this._anchor=-1),this._firstIndex>=t&&this._firstIndex<n&&(this._firstIndex=this._findNextSelection(n-1)),this._lastIndex>=t&&this._lastIndex<n&&(this._lastIndex=this._findPrevSelection(t));let i=0;for(i=t;i<n;++i)this._selections[i]&&(this._selections[i]=!1,--this._count)},ue.prototype.hasSelection=function(t,e){if(this._count<=0)return!1;let n=t+e;if(e<0&&(n=t+1,t=n+e),n<this._firstIndex||t>this._lastIndex)return!1;for(let e=t;e<n;++e)if(this._selections[e])return!0;return!1},ue.prototype.getSelection=function(t){return!0===this._selections[t]},ue.prototype.setSelection=function(t,e){return!1!==e?this.select(t):this.deselect(t)},ue.prototype.getSelectionAnchor=function(){return this._anchor},ue.prototype.setSelectionAnchor=function(t){this._anchor=t},ue.prototype.getSelectionCount=function(){return this._count},ue.prototype.getFirstSelectedIndex=function(){return this._firstIndex},ue.prototype.getLastSelectedIndex=function(){return this._lastIndex},ue.prototype.getAllSelections=function(){if(this._count>0){let t=new Array(this._count),e=0,n=this._selections,i=this._lastIndex;for(let o=this._firstIndex;o<=i;++o)n[o]&&(t[e++]=o);return t}return[]},ue.prototype.getConnectedRanges=function(t,e){if(this._count>0){let n=[];(null==t||t<this._firstIndex)&&(t=this._firstIndex),(null==e||e>this._lastIndex)&&(e=this._lastIndex+1);let i=null;for(let o=t;o<e;++o)this._selections[o]?i||(i=[o,-1]):i&&(i[1]=o-1,n.push(i),i=null);return i&&(i[1]=this._lastIndex,n.push(i),i=null),n}return[]},ue.prototype.getSelectionMap=function(){return this._selections},ue.prototype.clearAllSelections=function(){if(this._count>0){let t=0;return this._selections.length=0,this._count=0,this._anchor=-1,this._firstIndex=-1,this._lastIndex=-1,t}return 0},ue.prototype.copyFrom=function(t,e,n,i){if(i<=0)return;let o=e+n;if(null!=t)if(!1!==t.hasSelection(e,i)){for(let n=0;n<i;++n)t._selections[e+n]?this.select(o+n):this.deselect(o+n);this._anchor=-1,t._anchor>=0&&t._anchor>=e&&t._anchor<e+i&&(this._anchor=t._anchor+n)}else this.deselectRange(o,i);else this.deselectRange(o,i)},ue.prototype._select=function(t){return!this._selections[t]&&(this._selections[t]=!0,++this._count,!0)},ue.prototype._findNextSelection=function(t){if(this._lastIndex>=0)for(;++t<=this._lastIndex;)if(this._selections[t])return t;return-1},ue.prototype._findPrevSelection=function(t){if(this._firstIndex>=0)for(;--t>=this._firstIndex;)if(this._selections[t])return t;return-1},ue.prototype._selections=null,ue.prototype._count=0,ue.prototype._anchor=-1,ue.prototype._firstIndex=-1,ue.prototype._lastIndex=-1;const he=ue;let pe=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)};pe.prototype._func=null,pe.prototype._delay=0,pe.prototype._timerId=0,pe.prototype._pending=!1,pe.prototype.start=function(){this._func&&(this._timerId?this._pending=!0:this._timerId=setInterval(this._onInterval,this._delay))},pe.prototype.dispose=function(){this._timerId&&(clearInterval(this._timerId),this._timerId=0),this._func=null},pe.prototype._onInterval=function(){this._pending?this._pending=!1:(this._func(),clearInterval(this._timerId),this._timerId=0)},pe._proto=pe.prototype;const de=pe;let ce=function(){let 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 de(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"),ce._queryNativeTrackThickness(t._onThicknessChanged),t._updateEffectiveArea()||t.listen("thicknessChanged",t._updateEffectiveArea)};o.inherits(ce,Wt),ce.prototype._vertical=!0,ce.prototype._step=0,ce.prototype._parentNode=null,ce.prototype._hostClassName="",ce.prototype._trackContent=null,ce.prototype._panes=null,ce.prototype._paneSliders=null,ce.prototype._enabled=!0,ce.prototype._active=!1,ce.prototype._isFrozen=!1,ce.prototype._otherScrollbar=null,ce.prototype._autoHideScrollbar=!0,ce.prototype._trackSize=120,ce.prototype._tContentSize=0,ce.prototype._tScrollVal=0,ce.prototype._tPercentVal=0,ce.prototype._paneSize=0,ce.prototype._pContentSize=0,ce.prototype._pScrollVal=0,ce.prototype._footerCount=0,ce.prototype._fadingId=0,ce.prototype._postponeFading=!1,ce.prototype._layoutChanged=!1,ce.prototype._contentDirty=!0,ce.prototype._layoutDirty=!0,ce.prototype._touchInput=!0,ce.prototype._swiping=!1,ce.prototype._touchDrag=!1,ce.prototype._startPos,ce.prototype._endPos,ce.prototype._smoothing=!0,ce.prototype._smoothingId=0,ce.prototype._smoothingSpeed=0,ce.prototype._wheelScrolling="",ce.prototype._mouseWheelLogic=null,ce.prototype._onThicknessChanged=null,ce._trackThickness=0,ce._queryTimeout=0,ce._queryStarted=!1,ce._outerDummy=null,ce._innerDummy=null,ce._listeners=null,ce.prototype._updateEffectiveArea=function(){let t=this.getTrackThickness();if(t){let e=this._vertical?"width":"height";this._element.style[e]=t+1+"px"}return!!t},ce._queryNativeTrackThickness=function(t){if(ce._queryStarted||ce._repeatQuery(),t&&ce._trackThickness<=0){let e=ce._listeners;e||(e=ce._listeners=[]),e.push(t)}},ce._repeatQuery=function(){ce._queryStarted=!0,ce._retrieveNativeTrackThinkness()||(ce._queryTimeout+=100,ce._queryTimeout<3e3?setTimeout(ce._repeatQuery,ce._queryTimeout):(ce._trackThickness=13,ce._clearStaticResources()))},ce._retrieveNativeTrackThinkness=function(){if(ce._trackThickness>0)return!0;let t=ce._innerDummy,e=ce._outerDummy;t||(t=ce._innerDummy=document.createElement("p"),t.style.width="100%",t.style.height="200px",e=ce._outerDummy=document.createElement("div"),e.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);let n=t.offsetWidth;e.style.overflow="scroll";let i=t.offsetWidth;return n==i&&(i=e.clientWidth),document.body.removeChild(e),(ce._trackThickness=n-i)>0&&(ce._clearStaticResources(),!0)},ce._clearStaticResources=function(){ce._innerDummy=ce._outerDummy=null;let t=ce._listeners;if(t){ce._listeners=null;let e={};for(let n=t.length;--n>=0;)t[n](e)}},ce.updateTrackThickness=function(){ce._trackThickness=0,ce._queryTimeout=0,ce._queryStarted=!1,ce._queryNativeTrackThickness()},ce.prototype.dispose=function(){let t=ce._listeners;if(t){let 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(let t=this._panes.length;--t>=0;)this._panes[t].dispose(),this._paneSliders[t].dispose();this._reverter.dispose()},ce.prototype.getContent=function(t){return this._paneSliders[0].getContent(t)},ce.prototype.getParent=function(){return this._parentNode},ce.prototype.setParent=function(t,e){let n=ut.getElement(t),i=this._parentNode!==n;i&&this._parentNode&&(this.removeWheelListener(this._parentNode),this._parentNode.classList.remove(this._hostClassName)),this.isActive()?(this._setParent(n,e),this._parentNode=this._element.parentNode,this._parentNode&&this._parentNode.classList.add(this._hostClassName)):this._parentNode=n,i&&this.addWheelListener(this._parentNode)},ce.prototype.attachToExternalElement=function(t){this.setParent(t);let 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"},ce.prototype._onActiveStateChange=function(){let 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);let n=e._vertical?"height":"width";for(t=e._panes.length;--t>=0;)e._panes[t].addClass("scroll-disabled"),e._panes[t].setStyle(n,"");e._dispatch("deactivated",{})}e._vertical&&e._otherScrollbar&&e._otherScrollbar.isActive()&&e._otherScrollbar.invalidate()},ce.prototype._onEnablingStateChange=function(){let t=this;t._enabled?t._dispatch("enabled",{}):t._dispatch("disabled",{})},ce.prototype.isActive=function(){return this._active},ce.prototype.isEnabled=function(){return this._enabled},ce.prototype.enable=function(t){t=!1!==t,this._enabled!=t&&(this._enabled=t,this._updateLayout(),this._onEnablingStateChange())},ce.prototype.disable=function(t){this.enable(!1===t)},ce.prototype.getTrackSize=function(){return this._trackSize},ce.prototype.getPaneSize=function(){return this._paneSize},ce.prototype.getContentSize=function(){return this._pContentSize},ce.prototype.getTrackThickness=function(){return ce._trackThickness},ce.prototype.getScrollGap=function(){return this._pContentSize-this.getPaneSize()},ce.prototype.setTrackSize=function(t,e){this._trackSize=t>0?t:0,this._paneSize=e>0?e:0},ce.prototype.calculateContentSize=function(){return 0},ce.prototype.update=function(){if(this._contentDirty){this._contentDirty=!1;let 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)},ce.prototype.invalidate=function(t,e){this._contentDirty=!0,this._layoutDirty=!0,null!=e&&(this._pScrollVal=e),t&&this.update()},ce.prototype.invalidateContent=function(){this._contentDirty=!0},ce.prototype.isScrollPosValid=function(t){let e=t-this.getPaneSize(),n=this._pScrollVal;return 0===n||n>0&&e>0&&n<e},ce.prototype.flash=function(){this.update(),this._flash()},ce.prototype._scroll=function(t){this._scrollTo(this._pScrollVal+t)},ce.prototype._scrollTo=function(t,e){if(!this._active&&!e)return;t=this._calcProperScrollValue(t);let n=!1;this._pScrollVal!==t&&(this._pScrollVal=t,n=!0),this._setTrackScrollVal(t),n?(e&&(this._layoutChanged=!0),this._dispatchScrollEvent(null)):e&&this._dispatch("layoutChanged",{})},ce.prototype._calcProperScrollValue=function(t){if(!t||t-.5<0)return 0;if(this._tPercentVal>=1&&Math.abs(this._pScrollVal-t)<=2)return this._pScrollVal;let e=this.getScrollGap();if(e<=0)return 0;if(t+.5>=e)return e;let n=this._step;if(n){if((t=Math.round(t/n)*n)-n/2<=0)return 0;if(t+n/2>=e)return e}return Math.round(t)},ce.prototype._convertTrackToPane=function(t){t=Math.round(t);let e=this._getTrackGap();this._tPercentVal>=1&&Math.abs(this._tScrollVal-t)<=5&&(t=e),this._tScrollVal=t,this._tPercentVal=e?t/e:0;let n=this.getScrollGap();return e===n?t:this._tPercentVal*n},ce.prototype._setTrackScrollVal=function(t){let e=this._getTrackGap(),n=0;if(e>0){if(t>0){let i=this.getScrollGap();n=e===i?t:t/i*e,n=Math.round(n)}n>=e&&(n=e)}if(n!==this._tScrollVal){this._tScrollVal=n,this._tPercentVal=e?n/e:0;let t=this._element;return this._vertical?t.scrollTop=n:t.scrollLeft=n,!0}return!1},ce.prototype._getTrackGap=function(){let t=this._tContentSize-this.getTrackSize();return t>0?t:0},ce.prototype._getScrollValue=function(){return this._pScrollVal},ce.prototype._isEndOfScroll=function(){return!this._active||this._pScrollVal>=this.getScrollGap()},ce.prototype._isStartOfScroll=function(){return!this._pScrollVal},ce.prototype._isOnEdge=function(t){return t<0&&this._isStartOfScroll()||t>0&&this._isEndOfScroll()},ce.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)))},ce.prototype._clearAllPanes=function(){for(let t=this._panes.length;--t>=0;){this._panes[t].setParent(null);let e=this._paneSliders[t];e._content=e._columns=null;let n=e.getElement();for(;null!==n.firstChild;)n.removeChild(n.firstChild)}},ce.prototype.disableKeyboardInput=function(t){!1===t?(this._element.setAttribute("tabindex","-1"),this._element.addEventListener("keydown",this._onKeyDown,!1)):(this._element.removeAttribute("tabindex"),this._element.removeEventListener("keydown",this._onKeyDown,!1))},ce.prototype.disableTouchInput=function(t){this._touchInput=!1===t},ce.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))},ce.prototype.getAutoHide=function(){return this._autoHideScrollbar},ce.prototype.setOtherScrollbar=function(t){this._otherScrollbar=t},ce.prototype.setFooterCount=function(t){this._footerCount=t},ce.prototype._calcActiveState=function(){if(this._enabled&&this.getTrackSize()>20){let t=this.getPaneSize();if(t>0)return this._pContentSize-t>0}return!1},ce.prototype._updateLayout=function(){let t=this._calcActiveState();if(t!==this._active&&(this._active=t,this._onActiveStateChange()),!this._active)return;let e=this.getTrackSize(),n=this.getPaneSize();if(this._tContentSize=this._pContentSize/n*e,this._vertical)this._trackContent.style.height=this._tContentSize+"px",this._element.style.height=e+"px",this._panes[0].setHeight(n);else{this._trackContent.style.width=this._tContentSize+"px",this._element.style.width=e+"px";for(let t=this._panes.length;--t>=0;)this._panes[t].setWidth(n)}this._scrollTo(this._pScrollVal,!0)},ce.prototype.resetPaneSize=function(){let t=this._vertical?"height":"width";for(let e=this._panes.length;--e>=0;)this._panes[e].setStyle(t,"")},ce._preventVScrolling=function(t){t.currentTarget.scrollTop=0},ce._preventHScrolling=function(t){t.currentTarget.scrollLeft=0},ce.prototype._addPaneAt=function(t){null==t&&(t=this._panes.length);let e=this._panes[t];if(!e){if(e=new Wt(document.createElement("div")),e.setClass("grid-pane"),this._vertical?(e.addClass("sections"),e.listen("scroll",ce._preventVScrolling)):(e.addClass("columns"),e.listen("scroll",ce._preventHScrolling)),this._active||e.addClass("scroll-disabled"),this._paneSize&&this._active){let t=this.getPaneSize();this._vertical?e.setHeight(t):e.setWidth(t)}e.listen("touchstart",this._onTouchStart),e.listen("touchmove",this._onTouchMove),e.listen("touchend",this._onTouchEnd),e.listen("touchcancel",this._onTouchEnd);let n=new Wt(document.createElement("div"));n.setClass("grid-pane-slider"),n.setParent(e),this._panes[t]=e,this._paneSliders[t]=n}return e},ce.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))},ce.prototype._onTrackScroll=function(t){if(!this._element)return;let e=this._vertical?t.target.scrollTop:t.target.scrollLeft,n=this._convertTrackToPane(e);n=this._calcProperScrollValue(n),n!==this._pScrollVal&&(this._pScrollVal=n,this._dispatchScrollEvent(t))},ce.prototype._onRestingPosition=function(){this._setSliderPosition(-this._pScrollVal,!0)},ce.prototype._setSliderPosition=function(t,e){let n="",i="",o=this._vertical?"top":"left";t&&(e?i=t+"px":(n=this._vertical?"translateY":"translateX",n+="("+t+"px)",this._reverter.start()));for(let e=this._paneSliders.length;--e>=0;){let r=this._paneSliders[e],s=r.getElement().style;r._titleSection?s[o]=t+"px":(s.transform=n,s[o]=i)}e?this._dispatch("scrollEnd",{}):this._dispatch("scrollStart",{})},ce.prototype._dispatchScrollEvent=function(t){if(this._setSliderPosition(-this._pScrollVal,!1),this._flash(),!this._isEventDispatching("scroll")){if(!t){let 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)}},ce.prototype._onKeyDown=function(t){if(this._isFrozen)return void ut._preventDefault(t);if(!this._active)return;let e=!1;if(e=this._vertical?38===t.keyCode||40===t.keyCode:37===t.keyCode||39===t.keyCode,e){let e=this.getScrollGap(),n=Math.round(.07*e);n<10?n=10:n>100&&(n=100),37!==t.keyCode&&38!==t.keyCode||(n*=-1),this._scroll(n),ut._preventDefault(t)}},ce.prototype._onTouchStart=function(t){this._isFrozen?ut._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))},ce.prototype._onTouchMove=function(t){let e=this;if(e._isFrozen)return void ut._preventDefault(t);if(!e._swiping||!e._active||!e._touchInput)return;if(t.touches&&t.touches.length>1)return;let n=e._startPos,i=e._endPos;e._getTouchInfo(t,i);let o=this._vertical?n.y-i.y:n.x-i.x;o>-5&&o<5||e._isOnEdge(o)||(e._touchDrag?e._scrollTo(n.scrollValue+o):i.timeStamp-n.timeStamp>30&&(e._touchDrag=!0),t.cancelable&&t.preventDefault())},ce.prototype._onTouchEnd=function(t){if(this._isFrozen)ut._preventDefault(t);else if(this._swiping=!1,this._touchDrag&&(this._touchDrag=!1,t.cancelable&&t.preventDefault(),this._smoothing&&!this._smoothingId)){let e=this._startPos,n=this._getTouchInfo(t,this._endPos),i=n.timeStamp-e.timeStamp,o=this._vertical?e.y-n.y:e.x-n.x;this._smoothingSpeed=30*o/i,(this._smoothingSpeed>10||this._smoothingSpeed<-10)&&(this._smoothingId=setInterval(this._smoothScroll,25))}},ce.prototype._getTouchInfo=function(t,e){let n=t.changedTouches[0];return e||(e={}),e.x=n.pageX,e.y=n.pageY,e.timeStamp=t.timeStamp,e.scrollValue=this._getScrollValue(),e},ce.prototype._smoothScroll=function(){let t=this._smoothingSpeed;t=.9*t|0,this._smoothingSpeed=t,t>1||t<-1?this._scroll(t):(clearInterval(this._smoothingId),this._smoothingId=0)},ce.prototype.disableMouseWheel=function(t){!1===t?this.setMouseWheelLogic(this._mouseWheelLogic||this._onMouseWheel):this.setMouseWheelLogic(null)},ce.prototype.setMouseWheelLogic=function(t){this.removeWheelListener(this._parentNode),this._mouseWheelLogic=t,this._mouseWheelLogic&&this.addWheelListener(this._parentNode)},ce.prototype.addWheelListener=function(t){t&&this._mouseWheelLogic&&t.addEventListener("wheel",this._mouseWheelLogic,!1)},ce.prototype.removeWheelListener=function(t){t&&this._mouseWheelLogic&&t.removeEventListener("wheel",this._mouseWheelLogic,!1)},ce.prototype.setMouseWheelSpeed=function(t){this._wheelScrolling="string"==typeof t?t:""},ce.prototype.getMouseWheelSpeed=function(){return this._wheelScrolling},ce.prototype.getDefaultMouseWheelLogic=function(){return this._onMouseWheel},ce.prototype._onMouseWheel=function(t){if(t.target.opened)return;if(this._isFrozen)return void ut._preventDefault(t);if(t.ctrlKey||t.altKey)return;if(!this.isActive())return;let e=this._vertical?t.deltaY:t.deltaX;if(e&&!this._isOnEdge(e)){if(ut._preventDefault(t),t.deltaMode&&(e=e>0?100:-100),"linear"!=this._wheelScrolling){let t=this.getContentSize();t>=4e3&&(e*=1+t/4e3|0)}this.update(),this._scroll(e)}},ce.prototype.setScrollingStep=function(t){this._step=t>0?t:0},ce.prototype.freezeScrolling=function(t){let e=this._isFrozen;return this._isFrozen=!1!==t,e},ce.prototype.restoreTrackPosition=function(){let t=this._element;this._vertical&&(t.scrollTop=this._tScrollVal,t.scrollTop&&(this._tScrollVal=t.scrollTop))},ce._proto=ce.prototype;const _e=ce;let fe=function(){let t=this;t._vertical=!1,t._onDeactivated=t._onDeactivated.bind(t),t._onActivated=t._onActivated.bind(t),t._hostClassName="hscrollbar-host",fe.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)};o.inherits(fe,_e),fe.prototype._pinnedLeftColumnCount=0,fe.prototype._pinnedRightColumnCount=0,fe.prototype.setScrollContent=function(t,e,n,i){this._clearAllPanes();let o=e.length;if(o<=0)return;this._pinnedLeftColumnCount=n>=0?n:0,this._pinnedRightColumnCount=i>0?i:0;let r=e[0],s=r.getColumnCount(),l=s-i;(!l||l<0)&&(l=s);for(let t=0;t<o;++t){r=e[t];let i,o,a=this._addPaneAt(t),u=this._paneSliders[t],h=a.getElement(),p=u.getElement();for(i=0;i<n;++i)o=r.getColumn(i),o.setScrollState(h,null,!1);let d=r.getColumnHost();a.setParent(d);let c=[],_=[];for(i=n;i<l;++i)o=r.getColumn(i),o.setScrollState(null,p,this.isActive()),c.push(o),_.push(o.getElement());for(i=l;i<s;++i)o=r.getColumn(i),o.setScrollState(null,null,!1);let f=r.getReservedSpace();f&&(this.isActive()&&!this._pinnedRightColumnCount?(u.addContent(f),_.push(f)):d.appendChild(f),r._updateRightSpaceStyle()),r._updateLayers(),u._titleSection=r.hasClass("title"),u._columns=c,u._content=_}this.invalidateContent()},fe.prototype.setWidth=function(t){return this.setTrackSize(t,t),!0},fe.prototype.getWidth=function(){return this.getPaneSize()},fe.prototype.getScrollLeft=function(){return this._getScrollValue()},fe.prototype.setScrollLeft=function(t){this.update(),this._scrollTo(t)},fe.prototype.getPinnedLeftColumnCount=function(){return this.isEnabled()?this._pinnedLeftColumnCount:0},fe.prototype.getPinnedRightColumnCount=function(){return this.isEnabled()?this._pinnedRightColumnCount:0},fe.prototype.setPaneLeft=function(t){let e=t&&this.isActive()?-t+"px":"";for(let t=this._panes.length;--t>=0;)this._paneSliders[t].setStyle("marginLeft",e)},fe.prototype.isEndOfHorizontalScroll=function(){return this._isEndOfScroll()},fe.prototype.getContentWidth=function(){let t=this._paneSliders[0],e=0;if(t){let n=t._content;for(let t=n.length;--t>=0;){let i=n[t],o=i?i.style.width:0;o&&(e+=parseFloat(o))}}return e},fe.prototype.calculateContentSize=function(){return this.getContentWidth()},fe.prototype.getTrackSize=function(){return this._footerCount<=0&&this._otherScrollbar&&this._otherScrollbar.isActive()&&!this._pinnedRightColumnCount?this._trackSize-this.getTrackThickness():this._trackSize},fe.prototype._onActivated=function(t){this._updateActivation(!0)},fe.prototype._onDeactivated=function(t){this._updateActivation(!1)},fe.prototype._updateActivation=function(t){let e=this._paneSliders.length;for(let n=0;n<e;++n){let e=this._paneSliders[n]._columns,i=e?e.length:0;for(let n=0;n<i;++n){let i=e[n];i.getElement()&&i.enableAbsolutePosition(t)}}},fe._proto=fe.prototype;const ge=fe;let ye=function(t,e){return t>e?e:t<0?0:t},me=function(t){this._boundLayer=t.boundLayer,this._layoutX=t.layoutX,this._layoutY=t.layoutY,this._hscrollbar=t.hscrollbar,this._calculateColumnBounds=t.calculateColumnBounds};me.prototype._boundLayer=null,me.prototype._layoutX,me.prototype._layoutY,me.prototype._hscrollbar,me.prototype._calculateColumnBounds,me.prototype._cellBound=null,me.prototype._cbLftIdx=0,me.prototype._cbRgtIdx=0,me.prototype._cbTopIdx=0,me.prototype._cbBtmIdx=0,me.prototype.dispose=function(){let t=this._cellBound;if(t){let e=t.parentNode;e&&e.removeChild(t),this._cellBound=null}this._boundLayer=null,this._layoutX=null,this._layoutY=null,this._hscrollbar=null,this._calculateColumnBounds=null},me.prototype.setCellBounds=function(t,e,n,i,o){let r=this._cellBound;r||(r=this._cellBound=document.createElement("div"),r.className="selection-bound");let s=t+n,l=e+i,a=this._layoutY.getLaneCount();this._cbLftIdx=ye(t,o),this._cbRgtIdx=ye(s,o),this._cbTopIdx=ye(e,a),this._cbBtmIdx=ye(l,a),this.updateCellBounds()},me.prototype.updateCellBounds=function(){let t=this._cellBound;if(!t)return;let e,n,i,o,r=this._layoutX,s=this._layoutY,l=this._cbLftIdx,a=this._cbRgtIdx,u=this._cbTopIdx,h=this._cbBtmIdx;e=n=i=o=0,l<a&&u<h&&(e=r.getLaneStart(l),n=r.getLaneEnd(a-1),i=s.getLaneStart(u),o=s.getLaneEnd(h-1));let p=n-e,d=o-i,c=[!1,!1];if(p>0&&d>0&&this._hscrollbar){let t=[0,0];this._calculateColumnBounds(l,a-1,t,c),e=t[0],n=t[1],p=n-e}if(p>0)t.style.left=e+"px",t.style.top=i+"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{let e=t.parentNode;e&&e.removeChild(t)}},me._proto=me.prototype;const Ce=me;let Se=function(t){let e=this;e._onMouseMove=e._onMouseMove.bind(e),e._onMouseOut=e._onMouseOut.bind(e),e._onResetTransformIE=e._onResetTransformIE.bind(e),e._trackX=new Kt,e._trackY=new Kt,e._trackX.setDefaultLaneSize(100),e._trackY.setDefaultLaneSize(32),e._cellSpans=new ae,e._element=document.createElement("div"),e._element.className="tr-lg tr-even-shading",e._ctxRows=new te,e._columns=[],e._cells=[],e._highlightedCells=[],e._stretchedCells=new oe(e._trackX,e._trackY,e),e._selectionList=new he,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")};o.inherits(Se,Wt),Se.prototype._index=-1,Se.prototype._availableRowCount=0,Se.prototype._activeRow=0,Se.prototype._activeRowEnd=0,Se.prototype._colCount=0,Se.prototype._rowCount=0,Se.prototype._hiddenRowCount=0,Se.prototype._trackX,Se.prototype._trackY,Se.prototype._cellSpans,Se.prototype._columns,Se.prototype._firstColumn,Se.prototype._lastColumn,Se.prototype._rightSpace,Se.prototype._rightSpaceSize=0,Se.prototype._frozenLayout=!1,Se.prototype._rowHighlightEnabled=!1,Se.prototype._rowHighlightIndex=-1,Se.prototype._highlightedCells,Se.prototype._coverLayer=null,Se.prototype._stretchedCells=null,Se.prototype._ctx=null,Se.prototype._selectionList,Se.prototype._colVir=!1,Se.prototype._initialized=!1,Se.prototype._hidingMethod="",Se.prototype._virOwner=null,Se.prototype._transformIETimer=0,Se.prototype._ctxRows,Se.prototype._boundLayer=null,Se.prototype._colBounds=null,Se.prototype._colBoundCache=null,Se.prototype._hscrollbar=null,Se.prototype._leftColumnSeparator=null,Se.prototype._rightColumnSeparator=null,Se.prototype._cellBoundPainter=null,Se.prototype.dispose=function(){this.setRowCount(0),this.unlistenAll(),this._ctxRows.dispose(),this._stretchedCells.dispose();for(let 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._highlightedCells.length=0,this._ctx=null,this._hscrollbar=null,this._cellBoundPainter&&this._cellBoundPainter.dispose(),this._dispose()},Se.prototype.getWidth=function(){return this.isVisible()?this._getWidth():0},Se.prototype._getWidth=function(){return this.getContentWidth()+this._rightSpaceSize},Se.prototype.setWidth=function(t){return!(t<0)&&(null!=this._trackX.setTrackSize(t-this._rightSpaceSize)&&(this._syncLayoutToColumns(0),!0))},Se.prototype.getHeight=function(){return this.isVisible()?this.getContentHeight():0},Se.prototype.setHeight=function(t){return!(t<0)&&(null==this._trackY.setTrackSize(t)||this._syncLayoutToRows(0,this._rowCount),!0)},Se.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._trackY.show(t),this.setFrozenLayout(!1===t),this._dispatchRowHeightChangedEvent(0,this._rowCount)},Se.prototype.hitTest=function(t,e,n){if(t<0)return null;if(e<0)return null;if(t>=this.getContentWidth())return null;if(e>=this.getHeight())return null;let i=this._trackX.hitTest(t);if(i<0)return null;let o=this._trackY.hitTest(e);if(o<0)return null;let r={};if(r.colIndex=i,r.rowIndex=o,!0!==n){let t=this._cellSpans.getOccupyingSpan(i,o);t&&(r.colIndex=t.indexX,r.rowIndex=t.indexY)}return r},Se.prototype.hitTestX=function(t){return t<0?-1:t>=this.getContentWidth()?~this._colCount:this._trackX.hitTest(t)},Se.prototype.hitTestY=function(t){return t<0?-1:t>=this.getHeight()?~this._rowCount:this._trackY.hitTest(t)},Se.prototype.getDefaultColumnWidth=function(){return this._trackX.getDefaultLaneSize()},Se.prototype.setDefaultColumnWidth=function(t){this._trackX.getDefaultLaneSize()!==t&&(this._trackX.setDefaultLaneSize(t),this._syncLayoutToColumns(0))},Se.prototype.getDefaultRowHeight=function(){return this._trackY.getDefaultLaneSize()},Se.prototype.setDefaultRowHeight=function(t){if(this._trackY.getDefaultLaneSize()!==t){this._trackY.setDefaultLaneSize(t);for(let e=0;e<this._colCount;++e)this._columns[e].setHeight(t);this._syncLayoutToRows(0,this._rowCount),this._dispatchRowHeightChangedEvent(0,this._rowCount)}},Se.prototype.getColumnWidth=function(t){return this._trackX.getLaneSize(t)},Se.prototype.setColumnWidth=function(t,e){return!!this._setColumnWidth(t,e)&&(this._syncLayoutToColumns(t),!0)},Se.prototype._setColumnWidth=function(t,e){return this._trackX.setLaneSize(t,e)},Se.prototype._updateColumnLayout=function(){this._syncLayoutToColumns(0)},Se.prototype._startBindingSession=function(t){},Se.prototype._getTempRowHeights=function(){return null},Se.prototype.getRowHeight=function(t){return this._trackY.getLaneSize(t)},Se.prototype.setRowHeight=function(t,e){if(t<0||t>=this._rowCount)return!1;let n=this._trackY.setLaneSize(t,e);return this._syncLayoutToRows(t,t+1),n&&this._dispatchRowHeightChangedEvent(t,t+1),this._resetTransformIETimer(),n},Se.prototype._updateRowHeights=function(t,e){let n=0;for(let i=0;i<this._rowCount;++i){let o=t.getLaneSize(e);n|=this._trackY.setLaneSize(i,o),++e}return this._syncLayoutToRows(0,this._rowCount),n},Se.prototype.isColumnVisible=function(t){return this._trackX.isLaneVisible(t)},Se.prototype.hideColumn=function(t,e){return this.setColumnVisibility(t,!1===e,0)},Se.prototype.isRowVisible=function(t){return this._trackY.isLaneVisible(t)},Se.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)},Se.prototype.getMinimumColumnWidth=function(t){return this._trackX.getMinimumLaneSize(t)},Se.prototype.setMinimumColumnWidth=function(t,e){return!!this._trackX.setMinimumLaneSize(t,e)&&(this._syncLayoutToColumns(t),!0)},Se.prototype.getMinimumRowHeight=function(t){return this._trackY.getMinimumLaneSize(t)},Se.prototype.setMinimumRowHeight=function(t,e){return!!this._trackY.setMinimumLaneSize(t,e)&&(this._syncLayoutToRows(t,this._rowCount),this._dispatchRowHeightChangedEvent(t,t+1),!0)},Se.prototype.getCellLeft=function(t){return this._trackX.getLaneStart(t)},Se.prototype.getCellTop=function(t){return this._trackY.getLaneStart(t)},Se.prototype.getCellWidth=function(t,e){let n=this._cellSpans.getOccupyingSpan(t,e);if(n){let t=this._trackX.getLaneStart(n.indexX);return this._trackX.getLaneEnd(n.indexX+n.colSpan-1)-t}return this.getColumnWidth(t)},Se.prototype.getCellHeight=function(t,e){let n=this._cellSpans.getOccupyingSpan(t,e);if(n){let t=this._trackY.getLaneStart(n.indexY);return this._trackY.getLaneEnd(n.indexY+n.rowSpan-1)-t}return this.getRowHeight(e)},Se.prototype.hasCellSpan=function(){return this._cellSpans.hasSpan()},Se.prototype.getCellRowSpan=function(t,e){return this._cellSpans.getRowSpan(t,e)},Se.prototype.setCellRowSpan=function(t,e,n){let i=this._cellSpans.setRowSpan(t,e,n);if(this._updateCellSpanSize(t,e,i),i)return i.retVal>=0?this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,!0):i.colSpan>1?(this._updateCellSpanClass(t,e,i.colSpan,i.prevRowSpan,!1),this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,!0)):this._updateCellSpanClass(t,e,i.colSpan,i.prevRowSpan,!1),0!==i.retVal;let o=this._getCell(t,e);return o&&o._rowSpan>1&&this._updateCellSpanClass(t,e,o._colSpan,o._rowSpan,!1),!1},Se.prototype.getCellColSpan=function(t,e){return this._cellSpans.getColSpan(t,e)},Se.prototype.setCellColSpan=function(t,e,n){let i=this._cellSpans.setColSpan(t,e,n);if(this._updateCellSpanSize(t,e,i),i)return i.retVal>=0?this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,!0):i.colSpan>1?(this._updateCellSpanClass(t,e,i.prevColSpan,i.rowSpan,!1),this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,!0)):this._updateCellSpanClass(t,e,i.prevColSpan,i.rowSpan,!1),0!==i.retVal;let o=this._getCell(t,e);return o&&o._colSpan>1&&this._updateCellSpanClass(t,e,o._colSpan,o._rowSpan,!1),!1},Se.prototype.clearCellSpans=function(){let t=this._cellSpans.clearAllSpans();if(null==t)return!1;for(let e=t.length;--e>=0;){let n=t[e];this._updateCellSpan(n.indexX,n.indexY,n,!1)}return!0},Se.prototype.clearColumnSpans=function(t){let e=this._cellSpans.removeSpanByColIndex(t);if(null==e)return!1;for(let t=e.length;--t>=0;){let n=e[t];this._updateCellSpan(n.indexX,n.indexY,n,!1)}return!0},Se.prototype.clearColumnCustomizations=function(){this._trackX.clearLaneCustomizations(),this._syncLayoutToColumns(0)},Se.prototype.clearRowCustomizations=function(){this._trackY.clearLaneCustomizations(),this._syncLayoutToRows(0,this._rowCount)},Se.prototype.getColumnScalability=function(t){return this._trackX.getLaneScalability(t)},Se.prototype.setColumnScalability=function(t,e){return this._trackX.setLaneScalability(t,e)},Se.prototype.getRowScalability=function(t){return this._trackY.getLaneScalability(t)},Se.prototype.setRowScalability=function(t,e){return this._trackY.setLaneScalability(t,e)},Se.prototype.getCell=function(t,e,n){if(n&&this._cellSpans.hasSpan()){let n=this._cellSpans.getColSpan(t,e),i=this._cellSpans.getRowSpan(t,e);n<0&&(t+=n),i<0&&(e+=i)}return this._getCell(t,e)},Se.prototype.getCellContent=function(t,e){let n=this.getCell(t,e);return null!==n?n.getContent():null},Se.prototype.setCellContent=function(t,e,n){let i=this.getCell(t,e);return null==i?(window.console.log("Error: Accessing nonexistent cell in Grid's Table"),null):i.setContent(n)},Se.prototype.getColumnCount=function(){return this._colCount},Se.prototype.setColumnCount=function(t){if(t<0&&(t=0),this._colCount===t)return;let e=this._colCount;this._trackX.setLaneCount(t),this._colCount=this._trackX.getLaneCount();let n=0,i=null;if(e>t)for(n=e;--n>=t;)i=this._columns.pop(),i.dispose(),i===this._firstColumn&&(this._firstColumn=null),i===this._lastColumn&&(this._lastColumn=null);else for(n=e;n<t;++n)i=this._newColumn(n);for(this._updateColumnIndices(),n=e;n<t;++n)this._columns[n].activate(!this._colVir);t<=0&&this._selectionList.clearAllSelections()},Se.prototype.getRowCount=function(){return this._rowCount},Se.prototype.setRowCount=function(t,e){if(t<0&&(t=0),this._rowCount===t)return;let n,i=this._rowCount;for(this._trackY.setLaneCount(t),this._rowCount=this._trackY.getLaneCount(),this._ctxRows.setItemCount(t),this._stretchedCells.setCellCount(t),n=0;n<this._colCount;++n)this._columns[n].setCellCount(t);if(i>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(let e=t;e<i;++e)this._selectionList.deselect(e);else this._selectionList.clearAllSelections();else this._syncLayoutToRows(i,t);let o={};o.prevCount=i,o.rowCount=this._rowCount,this._dispatch("rowCountChanged",o),i<t&&this._insertCells(0,this._rowCount)},Se.prototype.getVisibleRowCount=function(){return this._rowCount-this._hiddenRowCount},Se.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))},Se.prototype.removeRow=function(t){t<=0||(t>this._rowCount&&(t=this._rowCount),this.setRowCount(this._rowCount-t))},Se.prototype.setBorders=function(t,e,n,i){},Se.prototype.getColumnStyle=function(t,e){let n=this._columns[t];return n?n.getStyle(e):null},Se.prototype.setColumnStyle=function(t,e,n){let i=this._columns[t];i&&i.setStyle(e,n)},Se.prototype.enableColumnClass=function(t,e,n){let i=this._columns[t];i&&i.enableClass(e,n)},Se.prototype.hasColumnClass=function(t,e){let n=this._columns[t];return!!n&&n.hasClass(e)},Se.prototype.enableRowClass=function(t,e,n){if(t>=0&&t<this._rowCount)for(let i=0;i<this._colCount;++i)this._columns[i].getCell(t).enableClass(e,n)},Se.prototype.setRowStyle=function(t,e,n,i){if(t>=0&&t<this._rowCount){n&&(null==i||i)||(n="");for(let i=0;i<this._colCount;++i)this._columns[i].getCell(t).setStyle(e,n)}},Se.prototype.getRelativePosition=function(t){return ut.getRelativePosition(t,this._element)},Se.prototype.getContentWidth=function(){return this._trackX.getTrackSize()},Se.prototype.getContentHeight=function(){let t=this._trackY.getTrackSize();if(t<=0&&this._colCount*this.getVisibleRowCount()>0){let t=this._columns[0],e=t.getCell(this._rowCount-1);return e.getTop()+e.getHeight()-t.getCell(0).getTop()}return t},Se.prototype.getCellsByRowIndex=function(t){if(t<0||t>=this._rowCount)return null;let e=new Array(this._colCount);for(let n=0;n<this._colCount;++n)e[n]=this._columns[n].getCell(t);return e},Se.prototype.disableHorizontalGridLine=function(t){this.enableClass("no-horizontal-grid-line",!1!==t)},Se.prototype.disableVerticalGridLine=function(t){this.enableClass("no-vertical-grid-line",!1!==t)},Se.prototype.enableShading=function(t){!1!==t?this.addClass("tr-even-shading"):(this.removeClass("tr-even-shading"),this.removeClass("tr-odd-shading"))},Se.prototype.setTransposedShading=function(t){this.enableClass("transposed-shading",!1!==t)},Se.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)))},Se.prototype.getRowHighlight=function(){return this._rowHighlightIndex},Se.prototype.setRowHighlight=function(t){if((!this._rowHighlightEnabled||t<-1||t>=this._rowCount)&&(t=-1),this._rowHighlightIndex===t)return;let e=this._rowHighlightIndex;this._rowHighlightIndex=t;for(let t=this._highlightedCells.length;--t>=0;)this._highlightedCells[t].removeClass("highlighted-row");if(t>=0&&t<this._rowCount){this._highlightedCells.length=this._colCount;for(let e=this._colCount;--e>=0;){let n=this._columns[e].getCell(t);this._highlightedCells[e]=n,n.addClass("highlighted-row")}let e=this.getStretchedCell(t);e&&(this._highlightedCells.push(e),e.addClass("highlighted-row"))}else this._highlightedCells.length=0;if(this._hasListener("rowHighlighted")){let n={};n.prevRowIndex=e,n.rowIndex=t,this._dispatch("rowHighlighted",n)}},Se.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},Se.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},Se.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},Se.prototype.setSelectedRow=function(t,e){t<0||t>=this._rowCount||(this._selectionList.setSelection(t,e),this._updateSelectionUI(t))},Se.prototype.selectSingleRow=function(t){t<0||t>=this._rowCount||(this.clearSelectedRows(),this._selectionList.select(t),this._addSelectionUI(t))},Se.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(let n=0;n<e;++n)this._addSelectionUI(n+t)}},Se.prototype.clearSelectedRows=function(){let t=this._selectionList.getSelectionCount();if(t){let e=this._selectionList.getAllSelections();this._selectionList.clearAllSelections();for(let n=0;n<t;++n)this._removeSelectionUI(e[n]);return t}return 0},Se.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},Se.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},Se.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},Se.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},Se.prototype.activateColumn=function(t,e){let n=this._columns[t];if(n){let t=n.activate(e);if(e&&t&&this._rightSpace){let t=this._rightSpace.parentNode;t&&t.appendChild(this._rightSpace)}}},Se.prototype.activateRows=function(){this._onEnterDocument()},Se.prototype.moveRowsToTop=function(t){this._ctxRows.moveItemsToTop(t),this._stretchedCells.moveCellsToTop(t);for(let e=0;e<this._colCount;++e)this._columns[e].moveCellsToTop(t)},Se.prototype.getFirstIndexInView=function(){return 0},Se.prototype.getLastIndexInView=function(){return this._availableRowCount-1},Se.prototype.isInCurrentView=function(t){return 0!==this._rowCount&&t>=0&&t<this._rowCount},Se.prototype.getFrozenLayout=function(){return this._frozenLayout},Se.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)))},Se.prototype.getColumn=function(t){return this._columns[t]||null},Se.prototype.insertColumn=function(t,e){t<0?t=0:t>this._colCount&&(t=this._colCount);let n=t<this._colCount,i=this._cellSpans.getAllSpans();this._updateCellSpans(i,!1),this._trackX.insertLane(t,e),this._colCount=this._trackX.getLaneCount();let o=this._newColumn(t);if(this._updateColumnIndices(),this._cellSpans.shiftColumn(t,1)&&(i=this._cellSpans.getAllSpans()),this._updateCellSpans(i,!0),this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._selectionList.getSelectionCount()){let t=this._selectionList.getAllSelections();for(let e=t.length;--e>=0;){let n=o.getCell(t[e]);n&&n.addClass("selected-row")}}return o.activate(n||!this._colVir),o},Se.prototype.removeColumnAt=function(t){let e=this._trackX.removeLaneAt(t);if(null==e)return null;let n=this._cellSpans.getAllSpans();this._updateCellSpans(n,!1),this._colCount=this._trackX.getLaneCount();let i=this._columns.splice(t,1)[0];return i.dispose(),e.control=i,this._updateColumnIndices(),this._cellSpans.removeColumn(t)&&(n=this._cellSpans.getAllSpans()),this._updateCellSpans(n,!0),this._syncLayoutToColumns(t),t>=this._colCount&&this._updateCssWidth(),e},Se.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)return;let n=this._cellSpans.getAllSpans();this._updateCellSpans(n,!1),this._trackX.moveLane(t,e);let i=this._columns[t];if(ut.moveArrayItem(this._columns,t,e),i.getElement().offsetParent){let t=e+1,n=this._columns[t]||null;for(;n&&!n.getElement().offsetParent;)n=this._columns[++t];i.insertBefore(n)}this._updateColumnIndices(),this._updateCellSpans(n,!0);let o=t<e?t:e;this._syncLayoutToColumns(o)},Se.prototype.enableRowVirtualization=function(){console.log("WARNING: This function is deprecated")},Se.prototype.enableColumnVirtualization=function(t){this._colVir=!1!==t},Se.prototype.getColumnIndex=function(t){if(t){if(t.stretched)return this._stretchedCells.getColumnIndex(t);let e=this._columns.length;for(let n=0;n<e;++n)if(this._columns[n].getElement()===t)return n}return-1},Se.prototype.getCellIndex=function(t,e){if(e){if(e.stretched)return this._stretchedCells.getRowIndex(e);let n=this._columns[t];if(n)return n.getCellIndex(e)}return-1},Se.prototype.getIndex=function(){return this._index},Se.prototype.setIndex=function(t){this._index=t},Se.prototype.getRowOffset=function(){return this._rowOffset},Se.prototype.setRowOffset=function(t){this._rowOffset=t},Se.prototype.updateLayout=function(){this._calculateViewSize(!0),this._stretchedCells.updateCells(),this._updateRightSpaceStyle()},Se.prototype.stretchCell=function(t,e,n,i){let 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;let r=null;if(!1!==n){let t=this._coverLayer;t||(t=this._coverLayer=document.createElement("div"),t.className="cover-layer",this._updateLayers()),this._calculateViewSize(),r=this._stretchedCells.stretchCell(e,i?o:0),r.setParent(t)}else r=this._stretchedCells.unstretchCell(e);if(r){let t=this._selectionList.getSelection(e);r.enableClass("selected-row",t)}return r},Se.prototype.unstretchCell=function(t,e){return this.stretchCell(t,e,!1)},Se.prototype.unstretchAllCells=function(){this._stretchedCells.unstretchAllCells()},Se.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},Se.prototype.getStretchedCells=function(){return this._stretchedCells.getCells()},Se.prototype.updateStretchedCells=function(){this._updateLayers();let t=this._coverLayer?this._coverLayer.children.length:0;return!(t<=0||(this._calculateViewSize(!0),this._stretchedCells.updateCells(),!t))},Se.prototype._calculateViewSize=function(t){if(this._frozenLayout)return this._stretchedCells.getStretchSize();let e=this._ctx,n=t?0:this._stretchedCells.getStretchSize();if(!n&&e&&e.getWidth){let t=this.getContentWidth();return n=e.getWidth()-this._rightSpaceSize,n?(t<n&&(n=t),this._stretchedCells.setStretchSize(n),n):t}return n},Se.prototype._enableStretchCellClass=function(t,e,n){let i=this.getStretchedCell(t);i&&i.enableClass(e,n)},Se.prototype._getViewSize=function(){return this._calculateViewSize()},Se.prototype.getColumnHost=function(){return this._element},Se.prototype.setHidingMethod=function(t){this._hidingMethod=t},Se.prototype.getHidingMethod=function(){return this._hidingMethod},Se.prototype.setColumnVisibility=function(t,e,n){return!!this._trackX.hideLane(t,!e,n)&&(this._syncLayoutToColumns(t),!0)},Se.prototype.getRowLayout=function(){return this._trackY},Se.prototype.reserveRightSpace=function(t){if(t&&t>0){if(!this._rightSpace){let t=this._rightSpace=document.createElement("div");t.className="tr-reserved-space",t.style.height=this.getContentHeight()+"px",this._updateLayers()}this._rightSpace.style.width=t+"px",this._rightSpaceSize=t,this._updateCssWidth()}else if(this._rightSpace){let t=this._rightSpace.parentNode;t&&t.removeChild(this._rightSpace),this._rightSpace=null,this._rightSpaceSize=0,this._updateCssWidth()}return this._rightSpace},Se.prototype._updateRightSpaceStyle=function(){let t=this._rightSpace;if(!t)return;let e=!1,n=0;this._hscrollbar&&(e=this._hscrollbar.isActive(),n=this._hscrollbar.getPinnedRightColumnCount()),e&&!n?(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")},Se.prototype._updateLayers=function(){if(this._rightSpace){let 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)},Se.prototype.getReservedSpace=function(){return this._rightSpace},Se.prototype.getComputedStyle=function(){let t=this._element;return t.offsetParent?getComputedStyle(t):null},Se.prototype.isColumnActive=function(t){let e=this._columns[t];return!!e&&e.isActive()},Se.prototype.setRowAttributes=function(t,e){if(!(t<0||t>=this._rowCount))for(let n=0;n<this._colCount;++n){let i=e(n);for(let e=i.length;--e>=0;){let o=i[e],r=this._columns[n].getCell(t);r&&(o.remove?r.removeAttribute(o.attribute):r.setAttribute(o.attribute,o.value))}}},Se.prototype.getContextRow=function(t){return this._ctxRows.getItem(t)},Se.prototype.selectColumn=function(t,e){this.enableColumnClass(t,"selected-column",e),e&&(this._boundLayer||(this._initBoundLayer(),this._updateLayers()))},Se.prototype.isSelectedColumn=function(t){return this.hasColumnClass(t,"selected-column")},Se.prototype.selectCell=function(t,e,n){let i=this._getCell(t,e);i&&i.enableClass("selection",n)},Se.prototype.setCellBounds=function(t,e,n,i){let o=this._initBoundLayer(),r=this._cellBoundPainter;r||(r=this._cellBoundPainter=new Ce({boundLayer:o,layoutX:this._trackX,layoutY:this._trackY,hscrollbar:this._hscrollbar,calculateColumnBounds:this.calculateColumnBounds.bind(this)}));let s=this.getColumnCount();r.setCellBounds(t,e,n,i,s)},Se.prototype.getHorizontalLayout=function(){return this._trackX},Se.prototype.calculateColumnBounds=function(t,e,n,i){let 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){let n,i,u=0,h=0,p=0,d=0;this._hscrollbar&&(h=this._hscrollbar.getScrollLeft(),p=this._hscrollbar.getPinnedLeftColumnCount(),d=this._hscrollbar.getPinnedRightColumnCount()),n=i=this._trackX.getTrackSize(),p&&(u=this._trackX.getLaneStart(p)),d&&(a-=d,n=this._getViewSize()-i+this._trackX.getLaneStart(a)),t>=p&&t<a?(o-=h,o<u?(o=u,s=!0):o>n&&(o=n,s=!0)):t>=a&&(o=this._getViewSize()-i+this._trackX.getLaneStart(t)),e>=p&&e<a?(r-=h,r<u?(r=u,l=!0):r>n&&(r=n,l=!0)):e>=a&&(r=this._getViewSize()-i+this._trackX.getLaneEnd(e))}n[0]=o,n[1]=r,i[0]=s,i[1]=l},Se.prototype.updateColumnBounds=function(t,e,n){let i=this._colBounds,o=this._colBoundCache;i||(i=this._colBounds=[]),o||(o=this._colBoundCache=[]);let r,s=t.length,l=null,a=null,u=i.length;for(r=s;r<u;++r)a=i[r],l=a.parentNode,l&&l.removeChild(a);if(i.length=u=s,s)for(r=0;r<s;++r){let s=t[r],l=e[r],u=s[0],h=s[1];a=o[r],a||(a=o[r]=document.createElement("div"),a.className="selection-bound column-bound"),a.style.left=u+"px",a.style.width=h-u+"px",n=n||0,a.style.top=n+"px",a.style.height=this._trackY.getTrackSize()-n+"px",a.classList.toggle("no-left-bound",l[0]),a.classList.toggle("no-right-bound",l[1]),this._boundLayer&&(i[r]||(i[r]=a,this._boundLayer.appendChild(a)))}},Se.prototype.updateColumnSeparators=function(){let t=this._hscrollbar.getPinnedLeftColumnCount(),e=this._hscrollbar.getPinnedRightColumnCount();!t&&!e||this._boundLayer||this._initBoundLayer();let n=!1;this._hscrollbar&&(n=this._hscrollbar.isActive());let i=this._boundLayer,o=this._leftColumnSeparator;if(n&&t){o||(o=this._leftColumnSeparator=this._createColumnSeparator()),o.parentNode||(i.children.length?i.insertBefore(o,i.children[0]):i.appendChild(o));let e=this._trackX.getLaneStart(t);o.style.left=e-1+"px",o.style.height=this._trackY.getTrackSize()+"px"}else o&&o.parentNode&&this._boundLayer.removeChild(o);if(o=this._rightColumnSeparator,n&&e){o||(o=this._rightColumnSeparator=this._createColumnSeparator()),o.parentNode||(i.children.length?i.insertBefore(o,i.children[0]):i.appendChild(o));let t=this.getColumnCount(),n=this._trackX.getLaneEnd(t-1)-this._trackX.getLaneStart(t-e),r=this._getViewSize();o.style.left=r-n+"px",o.style.height=this._trackY.getTrackSize()+"px"}else o&&o.parentNode&&this._boundLayer.removeChild(o)},Se.prototype._createColumnSeparator=function(){let t=document.createElement("div");return t.classList.add("column-separator"),t},Se.prototype._initBoundLayer=function(){let t=this._boundLayer;return t||(t=this._boundLayer=document.createElement("div"),t.className="cover-layer",this._element.appendChild(t)),t},Se.prototype._getCell=function(t,e){let n=this._columns[t];return n?n.getCell(e):null},Se.prototype._insertCells=function(t,e){this._activeRow=t,this._activeRowEnd=e;let n=this._trackY.getLaneStart(t);for(let i=0;i<this._colCount;++i){let o=this._columns[i];o.hasCollapsedCells()||o.setTop(n),o.activateCells(t,e)}if(this._rightSpace&&(this._rightSpace.style.top=n+"px"),e>this._availableRowCount){let t={};t.prevRowIndex=this._availableRowCount,t.rowIndex=e,this._availableRowCount=e,this._dispatch("rowAvailable",t)}},Se.prototype._newColumn=function(t){let e=new Zt(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(let t=0;t<this._rowCount;++t)this._trackY.isAtDefaultSize(t)||e.getCell(t).setHeight(this._trackY.getLaneSize(t));if(t>=this._columns.length)this._columns.push(e),e.setParent(this._element);else{this._columns.splice(t,0,e);let n=this._columns[t+1];e.insertBefore(n)}return e},Se.prototype._updateCssWidth=function(){this._frozenLayout||(this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._element.style.width=this._getWidth()+"px")},Se.prototype._updateViewHeight=function(){if(this._frozenLayout)return;let t=this.getContentHeight();this._element.style.height=t+"px",this._rightSpace&&(this._rightSpace.style.height=t+"px")},Se.prototype._updateColumnIndices=function(){let 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"));let n=this._columns[t-1];n!==this._lastColumn&&(this._lastColumn&&this._lastColumn.removeClass("last"),this._lastColumn=n,this._lastColumn&&this._lastColumn.addClass("last"));let i=null;for(let t=this._columns.length;--t>=0;){let e=this._columns[t];e.setNextSibling(i),i=e}},Se.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(let e=t;e<this._colCount;++e){let t=this._columns[e];t.setLeft(this._trackX.getLaneStart(e)),t.setWidth(this._trackX.getLaneSize(e))}return this._updateCellSpanLayout(this._cellSpans.getAllSpans()),this._updateCssWidth(),!0},Se.prototype._syncLayoutToRows=function(t,e){if(!this._frozenLayout){for(let n=t;n<e;++n){let t=this._trackY.isAtDefaultSize(n)?-1:this._trackY.getLaneSize(n);for(let e=0;e<this._colCount;++e)this._columns[e].getCell(n).setHeight(t)}this._stretchedCells.updateYAxis(),t?this._updateCellSpanLayout(this._cellSpans.getAllSpans()):this._updateCellSpans(this._cellSpans.getAllSpans(),!0),this._updateViewHeight()}},Se.prototype._dispatchRowHeightChangedEvent=function(t,e){if(!this._hasListener("rowHeightChanged"))return;if(t>=e)return;let n={};n.rowIndex=t,n.changeLength=e-t,this._dispatch("rowHeightChanged",n)},Se.prototype._updateCellSpanSize=function(t,e,n){let i=this._getCell(t,e);if(null!=i)if(n&&n.colSpan>1?(i.setWidth(this.getCellWidth(t,e)),this._columns[t].disableDeactivation()):i.setWidth(-1),n&&n.rowSpan>1)i.setHeight(this.getCellHeight(t,e));else{let t=this._trackY.isAtDefaultSize(e)?-1:this._trackY.getLaneSize(e);i.setHeight(t)}},Se.prototype._updateCellSpanLayout=function(t){if(null!=t)for(let e=t.length;--e>=0;){let n=t[e];this._updateCellSpanSize(n.indexX,n.indexY,n)}},Se.prototype._updateCellSpan=function(t,e,n,i){this._updateCellSpanSize(t,e,i?n:null),this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,i)},Se.prototype._updateCellSpanClass=function(t,e,n,i,o){let r;for(let s=0;s<n&&(r=this._columns[t+s],r);++s)r.collapseCells(e,i,o,0===s,s>0);let s=this._getCell(t,e);s&&(s._colSpan=o?n:1,s._rowSpan=o?i:1)},Se.prototype._updateCellSpans=function(t,e){if(null!=t)for(let n=t.length;--n>=0;){let i=t[n];this._updateCellSpan(i.indexX,i.indexY,i,e)}},Se.prototype._onMouseMove=function(t){let e=t.target,n=ut.closestElement(e,"cell"),i=this._stretchedCells.getColumnIndex(n);if(i<0){let t=ut.closestElement(e,"column");i=this.getColumnIndex(t)}let o=this.getCellIndex(i,n);this.setRowHighlight(o)},Se.prototype._onMouseOut=function(t){let e=t.relatedTarget;if(e){let t=this._element;for(;null!==e.parentNode;)if(e=e.parentNode,e===t)return}this.setRowHighlight(-1)},Se.prototype._getEventHandlers=function(){return{mouseout:this._onMouseOut,mousemove:this._onMouseMove}},Se.prototype._updateSelectionUI=function(t){let e=this._selectionList.getSelection(t);this._enableStretchCellClass(t,"selected-row",e),this.enableRowClass(t,"selected-row",e)},Se.prototype._addSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!0),this.enableRowClass(t,"selected-row",!0)},Se.prototype._removeSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!1),this.enableRowClass(t,"selected-row",!1)},Se.prototype._onEnterDocument=function(){if(!this._initialized&&this.getParent()){for(let t=0;t<this._colCount;++t)this._columns[t].enableAutoStyleUpdating();this._syncLayoutToColumns(0),this._initialized=!0}},Se.prototype._setContext=function(t){this._ctx=t},Se.prototype._getContext=function(){return this._ctx},Se.prototype._resetTransformIETimer=function(){ut.isIE&&(this._transformIETimer||(this.enableClass("reset-transform"),this._transformIETimer=setTimeout(this._onResetTransformIE,20)))},Se.prototype._onResetTransformIE=function(){this._transformIETimer=0,this.enableClass("reset-transform",!1)},Se._proto=Se.prototype;const we=Se;let be=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)};be.prototype.dispose=function(){this._dt&&(this._dt.unlisten("dataChanged",this._onDataChanged),this._dt=null)},be.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())},be.prototype.setField=function(t){this._field!==t&&(this._field=t,this._requestRecalculation())},be.prototype.disableOnDemandMode=function(t){let e=!1===t;this._onDemandMode!==e&&(this._onDemandMode=e,this._requestRecalculation())},be.prototype.setColumnDataGetter=function(t){this._colDataGetter!==t&&(this._colDataGetter=t,this._requestRecalculation())},be.prototype.getColumnDataGetter=function(){return this._colDataGetter},be.prototype.getSum=function(){return this._updateStats(),this._sum},be.prototype.getDataCount=function(){return this._updateStats(),this._count},be.prototype.getMin=function(){return this._updateStats(),this._min},be.prototype.getMax=function(){return this._updateStats(),this._max},be.prototype.getAbsoluteMax=function(){this._updateStats();let t=this._max>=0?this._max:-this._max,e=this._min>=0?this._min:-this._min;return t>=e?t:e},be.prototype.getAverage=function(){return this._updateStats(),this._sum/this._count},be.prototype.getMean=be.prototype.getAverage,be.prototype.getMidRange=function(){return this._updateStats(),.5*(this._max+this._min)},be.prototype.getCachedColumnData=function(){return this._dirty?this._recalculate():this._cacheData||(this._cacheData=this._getColData()),this._cacheData},be.prototype.markDirty=function(){return!!this._onDemandMode&&(this._dirty=!0,this._dirty)},be.prototype._getColData=function(){return this._colDataGetter?this._colDataGetter(this._field,this._dt):this._dt.getColumnData(this._field)},be.prototype._requestRecalculation=function(){this.markDirty()||this._recalculate()},be.prototype._updateStats=function(){this._dirty&&this._recalculate()},be.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)return;let t=this._cacheData=this._getColData(),e=t.length;if(!e)return;let n,i=be._isDataNumeric,o=0;for(;o<e;)if(n=+t[o++],i(n)){this._sum=this._min=this._max=n,++this._count;break}for(;o<e;)n=+t[o],i(n)&&(this._sum+=n,n<this._min?this._min=n:n>this._max&&(this._max=n),++this._count),++o},be.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;let 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()}},be.prototype._updateRowData=function(t){let e=this._dt.getPreviousData(t,this._field),n=this._dt.getData(t,this._field);if(e===n)return;let i=be._isDataNumeric(n);if(be._isDataNumeric(e)){if(this._min===e&&(!i||n>this._min))return void this._recalculate();if(this._max===e&&(!i||n<this._max))return void this._recalculate();this._sum-=e,--this._count}i&&(this._sum+=n,n>=this._min||(this._min=n),n<=this._max||(this._max=n),++this._count)},be._isDataNumeric=function(t){return"number"==typeof t&&t==t},be.prototype.addRef=function(t){return t&&this._refs.indexOf(t)<0&&this._refs.push(t),this._refs.length},be.prototype.deRef=function(t){if(t){let e=this._refs.indexOf(t);e>=0&&this._refs.splice(e,1)}return this._refs.length},be.prototype.getRefCount=function(){return this._refs.length},be.prototype._dt=null,be.prototype._field="",be.prototype._onDemandMode=!0,be.prototype._dirty=!0,be.prototype._cacheData=null,be.prototype._sum=0,be.prototype._min=NaN,be.prototype._max=NaN,be.prototype._count=0,be.prototype._colDataGetter=null,be.prototype._refs;const Re=be;let ve=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")};o.inherits(ve,ct),ve.prototype._dv=null,ve.prototype._dt=null,ve.prototype._wrapIndex=0,ve.prototype._rids,ve.prototype._dataConflator=null,ve.prototype._onDataChanged=function(t){if(this._dv){let e=this._dv.getVisibleRowIds(!0);this._refreshRids(e)&&(t.globalChange||(t.globalChange=!0),this._dispatch("dataChanged",t))}},ve.prototype._onWrapSizeChanged=function(t){this._refreshRids(t.rids)&&this._dispatch("dataChanged",wt._globalChangeArg)},ve.prototype._refreshRids=function(t){let e=!1;if(this._dv&&Array.isArray(t)){let n=this.getWrapSize();if(n>0){let i=n*this._wrapIndex;i<t.length?(e=!0,this._rids=t.slice(i,i+n)):this._rids.length&&(e=!0,this._rids.length=0)}}return e},ve.prototype.dispose=function(){this._dv&&(this.unlistenAll(),this._dv.unlisten("dataChanged",this._onDataChanged),this._dv.unlisten("wrapSizeChanged",this._onWrapSizeChanged),this._dt=this._dv=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){let n=this.getAllRowIds(!0,e),i=[],o=n.length;for(let r=0;r<o;++r){let o=this._dt.getRowData(n[r]);o?i.push(o[t]):e&&i.push(null)}return i},ve.prototype.getRowId=function(t){return this._rids[t]||""},ve.prototype._toRowId=function(t){return"number"==typeof t?this._rids[t]||"":t||""},ve.prototype._toRowIds=function(t){let e=Array.isArray(t)?t.length:0,n=new Array(e),i=this._rids;for(let o=0;o<e;++o){let e=t[o];n[o]="number"==typeof e?i[e]||"":e||""}return n},ve.prototype.getAllRowIds=function(t,e){return t?this._rids:this._rids.slice(0)},ve.prototype.getVisibleRowIds=function(t){return t?this._rids:this._rids.slice(0)},ve.prototype.getSortedRowIds=function(t){return t?this._rids:this._rids.slice(0)},ve.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},ve.prototype.getRowCount=function(){return this._rids.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,n){return this._dt.getMultipleRowData(t,e,n)},ve.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},ve.prototype.setData=function(t,e,n){return!!this._dt&&this._dt.setData(t,e,n)},ve.prototype.setRowData=function(t,e,n){return this._dv.setRowData(t,e,n)},ve.prototype.setColumnData=function(t,e,n){this._dt&&this._dt.setColumnData(t,e,n)},ve.prototype.setDataAt=function(t,e,n){let i=this.getRowId(t);return!(!i||!this._dt)&&this._dt.setData(i,e,n)},ve.prototype.setRowDataAt=function(t,e,n){let i=this.getRowId(t);return this.setRowData(i,e,n)},ve.prototype.insertRow=function(t,e,n){let i=this._toRowId(t);return this._dv.insertRow(i,e,n)},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){let n=this._toRowId(e),i=Array.isArray(t)?t:[t],o=this._toRowIds(i);return this._dv.moveRow(o,n)},ve.prototype.getDataTable=function(){return this._dt},ve.prototype.getDataSource=function(){return this._dv},ve.prototype.setDataSource=function(t){},ve.prototype.setConflationRate=function(t){this._dv.setConflationRate(t)},ve.prototype.getConflationRate=function(){return this._dv.getConflationRate()},ve.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},ve.prototype.sort=function(t,e,n,i){this._dv.sort(t,e,n,i)},ve.prototype.sortOnce=function(t,e){this._dv.sortOnce(t,e)},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.isSorting=function(){return this._dv.isSorting()},ve.prototype.hideRow=function(t,e){this.showRows([t],!1===e)},ve.prototype.hideRows=function(t,e){this.showRows(t,!1===e)},ve.prototype.showRows=function(t,e){let n=this._toRowIds(t);this._dv.showRows(n,e)},ve.prototype.unhideAllRows=function(){this._dv.unhideAllRows()},ve.prototype.hasHiddenRow=function(){return this._dv.hasHiddenRow()},ve.prototype.filterIn=function(t,e,n){return this._dv.filterIn(t,e,n)},ve.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},ve.prototype.filterInOnce=function(t,e,n){this._dv.filterInOnce(t,e,n)},ve.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},ve.prototype.clearFilter=function(){this._dv.clearFilter()},ve.prototype.disablePageCorrection=function(t){},ve.prototype.setPage=function(t){return!1},ve.prototype.gotoPage=ve.prototype.setPage,ve.prototype.nextPage=function(){return!1},ve.prototype.previousPage=function(){return!1},ve.prototype.prevPage=ve.prototype.previousPage,ve.prototype.lastPage=function(){return!1},ve.prototype.firstPage=function(){return!1},ve.prototype.getCurrentPage=function(){return 1},ve.prototype.getPageIndex=ve.prototype.getCurrentPage,ve.prototype.isOnLastPage=function(){return!0},ve.prototype.isOnFirstPage=function(){return!0},ve.prototype.getPageSize=function(){return 0},ve.prototype.getPageCount=function(){return 1},ve.prototype.getTotalPages=ve.prototype.getPageCount,ve.prototype.setPageSize=function(t){},ve.prototype.groupBy=function(t,e){this._dv.groupBy(t,e)},ve.prototype.addGroup=function(t){this._dv.addGroup(t)},ve.prototype.sortGroups=function(t){this._dv.sortGroups(t)},ve.prototype.moveGroup=function(t,e){this._dv.moveGroup(t,e)},ve.prototype.setPredefinedGroups=function(t){this._dv.setPredefinedGroups(t)},ve.prototype.addFooter=function(t){this._dv.addFooter(t)},ve.prototype.removeFooter=function(){this._dv.removeFooter()},ve.prototype.enableMultiGroup=function(t){this._dv.enableMultiGroup(t)},ve.prototype.getGroupByRowId=function(t){return this._dv.getGroupByRowId(t)},ve.prototype.getGroup=function(t){return this._dv.getGroup(t)},ve.prototype.getAllGroups=function(t){return this._dv.getAllGroups(t)},ve.prototype.getGroupList=function(){return this._dv.getGroupList()},ve.prototype.getGroupId=function(){return this._dv.getGroupId()},ve.prototype.getGroupValue=function(){return this._dv.getGroupValue()},ve.prototype.getGroupRowId=function(){return this._dv.getGroupRowId()},ve.prototype.getFooterRowIndex=function(t){return this._dv.getFooterRowIndex(t)},ve.prototype.getFooterRowIds=function(){return this._dv.getFooterRowIds()},ve.prototype.hasGroup=function(){return this._dv.hasGroup()},ve.prototype.getGroupRows=function(){return null},ve.prototype.getGroupLevel=function(t){let e=this._toRowId(t);return this._dv.getGroupLevel(e)},ve.prototype.enableColumnStats=function(t,e,n){return this._dv.enableColumnStats(t,e,n)},ve.prototype.getColumnStats=function(t){return this._dv.getColumnStats(t)},ve.prototype.hide=function(t){return this._dv.hide(t)},ve.prototype.isHidden=function(){return this._dv.isHidden()},ve.prototype.isHiddenRow=function(t){return this._dv.isHiddenRow(t)},ve.prototype.collapse=function(t){this._dv.collapse(t)},ve.prototype.collapseAllGroups=function(t){this._dv.collapseAllGroups(t)},ve.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},ve.prototype.isCollapsed=function(){return this._dv.isCollapsed()},ve.prototype.enableContentAsHeader=function(t){this._dv.enableContentAsHeader(t)},ve.prototype.getVisibleRowCount=function(){return this._rids.length},ve.prototype.isRowDataInGroup=function(t,e){return this._dv.isRowDataInGroup(t,e)},ve.prototype.isRowIdInGroup=function(t,e){return this._dv.isRowIdInGroup(t,e)},ve.prototype.addRowExpansion=function(t,e){this._dv.addRowExpansion(t,e)},ve.prototype.removeRowExpansion=function(t){this._dv.removeRowExpansion(t)},ve.prototype.toggleRowExpansion=function(t,e,n){let i=this._toRowId(t);this._dv.toggleRowExpansion(i,e,n)},ve.prototype.removeAllRowExpansions=function(){this._dv.removeAllRowExpansions()},ve.prototype.getRowsWithExpansion=function(t,e){return this._dv.getRowsWithExpansion(t,e)},ve.prototype.getExpansionParents=function(t,e){return this._dv.getExpansionParents(t,e)},ve.prototype.isRowExpansion=function(t){return this._dv.isRowExpansion(t)},ve.prototype.hasRowExpansion=function(t){return this._dv.hasRowExpansion(t)},ve.prototype.getRowExpansionId=function(t,e){return this._dv.getRowExpansionId(t,e)},ve.prototype.getRowExpansionIndex=function(t){return this._dv.getRowExpansionIndex(t)},ve.prototype.searchAll=function(t,e){return this._dv.searchAll(t,e)},ve.prototype.searchPrev=function(t,e){let n=this._toRowId(t);return this._dv.searchPrev(n,e)},ve.prototype.searchNext=function(t,e){let n=this._toRowId(t);return this._dv.searchNext(n,e)},ve.prototype.stall=function(t){return this._dv.stall(t)},ve.prototype.enableAutoGroupRemoval=function(t){return this._dv.enableAutoGroupRemoval(t)},ve.prototype.enableAutoGroupHiding=function(t){return this._dv.enableAutoGroupHiding(t)},ve.prototype.synchronizeRowOrder=function(){this._dv.synchronizeRowOrder()},ve.prototype.setSegmentSeparator=function(t,e){let n=this._toRowId(t);return this._dv.setSegmentSeparator(n,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.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},ve.prototype.collapseSegment=function(t,e){let n=this._toRowId(t);return this._dv.collapseSegment(n,e)},ve.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},ve.prototype.expandAllSegments=function(){return this._dv.expandAllSegments()},ve.prototype.setSegmentCollapsingLogic=function(){},ve.prototype.isSegmentCollapsed=function(t){let e=this._toRowId(t);return this._dv.isSegmentCollapsed(e)},ve.prototype.fillSegment=function(t){let e=this._toRowId(t);this._dv.fillSegment(e)},ve.prototype.fillSegments=function(){this._dv.fillSegments()},ve.prototype.addSegmentChild=function(t,e){let n=this._toRowId(t),i=this._toRowId(e);return this._dv.addSegmentChild(n,i)},ve.prototype.addSegmentChildren=function(t,e){let n=this._toRowId(t),i=this._toRowIds(e);return this._dv.addSegmentChildren(n,i)},ve.prototype.removeSegmentChild=function(t,e){let n=this._toRowId(t),i=this._toRowId(e);return this._dv.removeSegmentChild(n,i)},ve.prototype.removeSegmentChildren=function(t,e){let n=this._toRowId(t),i=this._toRowIds(e);return this._dv.removeSegmentChildren(n,i)},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.sortSegments=function(t){this._dt.sortSegments(t)},ve.prototype.getWrapSize=function(){return this._dv.getWrapSize()},ve.prototype.getWrappedViews=function(){return this._dv.getWrappedViews()},ve.prototype.wrapView=function(t){this._dv.wrapView(t)},ve.prototype.dump=function(t){return ft.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},ve.prototype.log=function(t){console.table(this.dump(t))},ve.prototype.isRowFiltered=function(t,e){return this._dv.isRowFiltered(t,e)};const Ie=ve;let De=function(t){let n=this;n._groupFilterLogic=n._groupFilterLogic.bind(n),n._internalGroupSortingLogic=n._internalGroupSortingLogic.bind(n),n._onDataChanged=n._onDataChanged.bind(n),n._onGroupAdded=n._onGroupAdded.bind(n),n._onBeforeGroupAdded=n._onBeforeGroupAdded.bind(n),n._onRefreshTimeout=n._onRefreshTimeout.bind(n),n._updateWrapCount=n._updateWrapCount.bind(n),n._byRemovalMap=n._byRemovalMap.bind(n),n._rids=[],n._sortingDefs=[],n._columnStats={},n._shared={},n._conflator=new e(this._onDataChanged,0),n._conflator.disable(),n._addEvents("dataChanged","preDisposed","pageIndexChanged","pageCountChanged","groupAdded","beforeGroupAdded","groupCriteriaChanged","beforeFiltering","wrapCountChanged","wrapSizeChanged"),n.setDataSource(t)};o.inherits(De,ct),De.prototype._rids,De.prototype._groupView=null,De.prototype._pageView=null,De.prototype._expansionView=null,De.prototype._hiddenRids=null,De.prototype._collapsedRids=null,De.prototype._excludedRids=null,De.prototype._emptySegmentFiltering=!1,De.prototype._separatorFiltering=!1,De.prototype._expansionMap=null,De.prototype._expansionChildren=null,De.prototype._expansionCount=0,De.prototype._dt=null,De.prototype._parent=null,De.prototype._shared=null,De.prototype._sortingDefs=null,De.prototype._userFilter=null,De.prototype._filteringOut=!1,De.prototype._refreshTimerId=0,De.prototype._groupSortingLogic=null,De.prototype._pageCorrection=!0,De.prototype._pageSize=0,De.prototype._pageIndex=1,De.prototype._lastPageIndex=0,De.prototype._groupCriteria=null,De.prototype._preDefGroups=null,De.prototype._preDefGroupsDirty=!1,De.prototype._groupMembers=null,De.prototype._groupList=null,De.prototype._groupRows=null,De.prototype._groupId="",De.prototype._groupColor="",De.prototype._groupValue,De.prototype._groupRowId="",De.prototype._footerRowIds=null,De.prototype._groupLevel=0,De.prototype._groupViewDirty=!1,De.prototype._columnStats,De.prototype._hidden=!1,De.prototype._hiddenHeaderRow=!1,De.prototype._collapsed=!1,De.prototype._collapsible=!0,De.prototype._showOnlyFirstMember=!1,De.prototype._beingAdded=!1,De.prototype._conflator=null,De.prototype._wrappedViews=null,De.prototype._wrapSize=0,De.prototype._wrapTimerId=0,De.prototype._stalledSorting=!1,De.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(let t in this._columnStats)this._columnStats[t].dispose();this._columnStats=null}},De.prototype.getData=function(t,e){return this._dt.getData(t,e)},De.prototype.getRowData=function(t){return this._dt.getRowData(t)},De.prototype.getColumnData=function(t,e){let n=this.getAllRowIds(!0,e),i=[],o=n.length;for(let r=0;r<o;++r){let o=this._dt.getRowData(n[r]);o?i.push(o[t]):e&&i.push(null)}return i},De.prototype.getRowId=function(t){return this._rebuildRowIdsFromChildren(),this._getRids()[t]||""},De.prototype._toRowId=function(t){return"number"==typeof t?(this._rebuildRowIdsFromChildren(),this._getRids()[t]||""):t||""},De.prototype._toRowIds=function(t){let e=Array.isArray(t)?t.length:0,n=new Array(e),i=this._getRids();for(let o=0;o<e;++o){let e=t[o];"number"==typeof e?(this._rebuildRowIdsFromChildren(),n[o]=i[e]||""):n[o]=e||""}return n},De.prototype.getAllRowIds=function(t,e){this._rebuildRowIdsFromChildren();let n=e?this._getRids():this._pageView||this._rids;return t?n:n.slice(0)},De.prototype.getVisibleRowIds=function(t){this._rebuildRowIdsFromChildren();let e=this._getRids();return t?e:e.slice(0)},De.prototype.getSortedRowIds=function(t){return this._rebuildRowIdsFromChildren(),t?this._rids:this._rids.slice(0)},De.prototype.getRowIndex=function(t){return this._rebuildRowIdsFromChildren(),this._getRids().indexOf(t)},De.prototype.getRowCount=function(){return this._getRids().length},De.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},De.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},De.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},De.prototype.getMultipleRowData=function(t,e,n){return this._dt.getMultipleRowData(t,e,n)},De.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},De.prototype.setData=function(t,e,n){return!!this._dt&&this._dt.setData(t,e,n)},De.prototype.setRowData=function(t,e,n){return!(!t||!this._dt||this.isRowExpansion(t))&&this._dt.setRowData(t,e,n)},De.prototype.setColumnData=function(t,e,n){this._dt&&this._dt.setColumnData(t,e,n)},De.prototype.setDataAt=function(t,e,n){let i=this.getRowId(t);return!(!i||!this._dt)&&this._dt.setData(i,e,n)},De.prototype.setRowDataAt=function(t,e,n){let i=this.getRowId(t);return this.setRowData(i,e,n)},De.prototype.insertRow=function(t,e,n){this._rebuildRowIdsFromChildren();let i=this._toRowId(t);return this._dt?this._dt.insertRow(i,e,n):""},De.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},De.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},De.prototype.moveRow=function(t,e){let n=this._toRowId(e),i=Array.isArray(t)?t:[t],o=this._toRowIds(i);return this._dt.hasSegmentation()&&this.synchronizeRowOrder(),this._dt._moveRow(o,n)},De.prototype.swapRow=ut._deprecatedFunction,De.prototype.getDataTable=function(){return this._dt},De.prototype.getDataSource=function(){return this._parent},De.prototype.setDataSource=function(t){if(t){if(this._groupLevel>0)return;this._setParent(t),this._onDataChanged(wt._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={}},De.prototype.setConflationRate=function(t){this._conflator.disable(!t),this._conflator.setConflatingTime(t)},De.prototype.getConflationRate=function(){return this._conflator.getConflatingTime()},De.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)},De.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},De.prototype.sort=function(t,e,n,i){if(this._groupLevel>0)return void window.console.log("ERROR: Sub-group cannot be sorted individually");let o=this.getSortingLogics(),r=this._sortingDefs,s=r.length;if(Array.isArray(n))for(let e=n.length;--e>=0;)if("function"!=typeof n[e]){let i=Array.isArray(t)?t[e]:t;n[e]=o[i]||o._default}if(wt._buildSortContext(r,t,e,n||o),1===r.length&&0===r[0][3]&&(r.length=0),s<=0&&r.length<=0)return;if(this._shared.stalledRids)return;let l=!1;this._groupMembers||r.length<=0||i?(l=!0,this._updateRowIds()):l=this._sort(),l&&this._dispatchDataChange(wt._positionChangeArg)},De.prototype.sortOnce=function(t,e){this.sort(t,e),this._sortingDefs.length=0},De.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},De.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},De.prototype.getColumnSortingLogic=function(t){return this._dt?this._dt.getColumnSortingLogic(t):null},De.prototype.isSorting=function(){return this._sortingDefs.length>0},De.prototype.hideRow=function(t,e){this.hideRows([t],e)},De.prototype.hideRows=function(t,e){e=!1!==e;let n=this._hiddenRids;if(e)n||(n=this._hiddenRids={});else if(!n)return;let i=this._toRowIds(t),o=!1;for(let t=i.length;--t>=0;){let r=i[t];r&&(e?n[r]||(n[r]=!0,o=!0):n[r]&&(delete n[r],o=!0))}if(o){if(!e){let t=!1;for(let e in n){t=!0;break}t||(n=this._hiddenRids=null)}this._refreshAndNotify()}},De.prototype.showRows=function(t,e){this.hideRows(t,!1===e)},De.prototype.unhideAllRows=function(){this._hiddenRids&&(this._hiddenRids=null,this._refreshAndNotify())},De.prototype.hasHiddenRow=function(){return!!this._hiddenRids},De.prototype.filterIn=function(t,e,n){let i=this._getFilterLogic(t,e),o=!0===n;return!!(this._userFilter!==i||"function"==typeof t||i&&o!==this._filteringOut)&&(this._shared.filterLogic=i,this._userFilter=i,this._filteringOut=o,this._refreshAndNotify(),!0)},De.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},De.prototype.filterInOnce=function(t,e,n){let i=this._getFilterLogic(t,e),o={};if(!this._getRemovalMap(o,i,!0===n))return;let r=this._removeRowIds(o);this._updatePageCount()||this._transformView(r)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(Object.keys(o))},De.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},De.prototype._removeRowIds=function(t){let e=De._removeArrayItems(this._rids,t);if(this._groupView&&(e=De._removeArrayItems(this._groupView,t)),this._groupMembers){let e=this._groupList.length;for(let n=0;n<e;++n){let e=this._groupList[n];this._groupMembers[e]._removeRowIds(t)}}return e},De.prototype.clearFilter=function(){this._userFilter&&(this._userFilter=null,this._shared.filterLogic=null,this._refreshAndNotify())},De.prototype.disablePageCorrection=function(t){this._pageCorrection=!1===t},De.prototype.setPage=function(t){let e=this._setPage(t);return e&&this._dispatchGlobalChange(),e},De.prototype.gotoPage=De.prototype.setPage,De.prototype.nextPage=function(){return this.gotoPage(this._pageIndex+1)},De.prototype.previousPage=function(){return this.gotoPage(this._pageIndex-1)},De.prototype.prevPage=De.prototype.previousPage,De.prototype.lastPage=function(){return this.gotoPage(this._lastPageIndex)},De.prototype.firstPage=function(){return this.gotoPage(0)},De.prototype.getCurrentPage=function(){return this._pageIndex},De.prototype.getPageIndex=De.prototype.getCurrentPage,De.prototype.isOnLastPage=function(){return this._pageIndex===this._lastPageIndex},De.prototype.isOnFirstPage=function(){return 1===this._pageIndex},De.prototype.getPageSize=function(){return this._pageSize},De.prototype.getPageCount=function(){return this._lastPageIndex},De.prototype.getTotalPages=De.prototype.getPageCount,De.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())},De.prototype.groupBy=function(t,e){if(this._shared.multiGroupRow=!1,this._groupCriteria){if(this._groupList&&this._groupList.length>0){for(let t in this._groupMembers)this._groupMembers[t].dispose();this._groupMembers={},this._groupList.length=0}this._groupCriteria=null}let n,i;if(null!=e&&this._setPredefinedGroups(e),t&&0===this._groupLevel){let e;for(this._groupCriteria=[],e=Array.isArray(t)?t:[t],i=e.length,n=0;n<i;++n){let t=e[n];"string"==typeof t?this._groupCriteria.push(this._defaultGroupCriteria.bind(this,t)):t&&this._groupCriteria.push(t)}}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(i=this._footerRowIds.length,n=0;n<i;++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()},De.prototype.addGroup=function(t){if(this._groupMembers)if(isArray(t)){let e=t,n=e.length;for(let t=0;t<n;++t)this._addGroup(e[t])}else this._addGroup(t)},De.prototype.sortGroups=function(t){if(this._groupMembers&&(this._groupSortingLogic=null==t?De._defaultGroupSortingLogic:t||null,this._groupSortingLogic)){this._groupList.sort(this._internalGroupSortingLogic);for(let t=this._groupList.length;--t>=0;){let e=this._groupList[t];this._groupMembers[e].sortGroups(this._groupSortingLogic)}this._groupViewDirty=!0,this._groupLevel<=0&&this._dispatchGlobalChange()}},De.prototype.moveGroup=function(t,e){let n=this.getGroup(t);if(!n)return;let i=n.getDataSource(),o=n.getGroupId(),r=i._groupList.indexOf(o);r!==e&&r+1!==e&&(i._groupList.splice(r,1),r<e&&--e,i._groupList.splice(e,0,o),this._requestRebuildingRowIds(!1))},De.prototype.setPredefinedGroups=function(t){this._setPredefinedGroups(t),this._groupMembers&&this._refreshAndNotify()},De.prototype._setPredefinedGroups=function(t){if(this._preDefGroups===t)return;this._preDefGroups&&(this._preDefGroups.length=0);let e=!1;if(t)for(let n=t.length;--n>=0;)if(Array.isArray(t[n])){e=!0;break}e?this._preDefGroups=t:Array.isArray(t)?this._preDefGroups=[t]:this._preDefGroups=null,this._preDefGroupsDirty=!0},De.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(let e=0;e<t;++e){let t=this._groupRowId+"_footer"+(this._footerRowIds.length||"");this._footerRowIds.push(t),this._groupRows[t]=this}this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},De.prototype.removeFooter=function(){if(this._footerRowIds){let t=this._footerRowIds.length;for(let e=0;e<t;++e)delete this._groupRows[this._footerRowIds[e]];this._footerRowIds=null,this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},De.prototype.enableMultiGroup=function(t){this._shared.multiGroupRow=!1!==t},De.prototype.getGroupByRowId=function(t){return this._groupRows&&this._groupRows[t]||null},De.prototype.getGroup=function(t){if(!this._groupMembers)return null;let e;if("number"==typeof t){if(e=this._groupList[t],!e)return null}else e=t+"";let n=this._groupMembers[e];if(n)return n;let i=e;return n=this._groupRows[i],n||this._getGroupByContentRowId(i)},De.prototype._getGroupByContentRowId=function(t){if(this._groupMembers)for(let e=0;e<this._groupList.length;e++){let n=this._groupList[e],i=this._groupMembers[n]._getGroupByContentRowId(t);if(i)return i}else if(-1!==this._rids.indexOf(t))return this;return null},De.prototype.getAllGroups=function(t){if(t||(t=[]),this._groupMembers){let e=this._groupList.length;for(let n=0;n<e;++n){let e=this._groupList[n],i=this._groupMembers[e];t.push(i),i.getAllGroups(t)}}return t},De.prototype.getGroupList=function(){return this._groupList},De.prototype.getGroupId=function(){return this._groupId},De.prototype.getGroupValue=function(){return this._groupValue},De.prototype.getGroupRowId=function(){return this._groupRowId},De.prototype.getFooterRowIndex=function(t){if(this._footerRowIds)for(let e=this._footerRowIds.length;--e>=0;)if(this._footerRowIds[e]===t)return e;return-1},De.prototype.getFooterRowIds=function(){return this._footerRowIds},De.prototype.hasGroup=function(){return!!this._groupMembers},De.prototype.getGroupRows=function(){return null},De.prototype.getGroupLevel=function(t){if(null!=t&&this._groupRows){if("number"!=typeof t){let e=this.getGroup(t);return e?e._groupLevel:-1}{this._rebuildRowIdsFromChildren();let e=this._getRids(),n=e[t];for(;n;){let i=this._groupRows[n];if(i)return i._groupLevel;n=e[--t]}}}return this._groupLevel},De.prototype.enableColumnStats=function(t,e,n){if(!t)return null;let i=!1!==e,o=this._columnStats[t];if(i?(o||(o=new Re(this,t),this._columnStats[t]=o),o.addRef(n)):o&&(o.deRef(n)||(o.dispose(),delete this._columnStats[t])),this._groupMembers)for(let i=this._groupList.length;--i>=0;){let o=this._groupList[i];this._groupMembers[o].enableColumnStats(t,e,n)}return o||null},De.prototype.getColumnStats=function(t){return this._columnStats[t]||null},De.prototype.hide=function(t){let e=!1!==t;return this._hidden!==e&&(this._hidden=e,this._refreshAndNotify(),!0)},De.prototype.isHidden=function(){return this._hidden},De.prototype.isHiddenRow=function(t){return!!this._hiddenRids&&!0===this._hiddenRids[t]},De.prototype._isHeaderRowShown=function(){return!(this._hiddenHeaderRow||this._shared.filterLogic&&0===this._rids.length||this._shared.autoGroupHiding&&null==this._groupValue)},De.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},De.prototype.collapse=function(t){this._setCollapse(!1!==t)&&(this._shared.contentAsHeader?this._hiddenHeaderRow&&this._requestRebuildingRowIds(this._showOnlyFirstMember):this._groupLevel>0&&this._requestRebuildingRowIds(this._collapsed))},De.prototype.collapseAllGroups=function(t){let e=this.getAllGroups(),n=e.length;if(n){let i=!1!==t;for(let t=0;t<n;++t)e[t]._setCollapse(i);this._requestRebuildingRowIds(!1)}},De.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},De.prototype.isCollapsed=function(){return this._collapsed||this._showOnlyFirstMember},De.prototype.enableContentAsHeader=function(t){this._shared.contentAsHeader=!1!==t},De.prototype.setDefaultCollapse=function(t){this._shared.defaultCollapse=!!t},De.prototype.getDefaultCollapse=function(){return!!this._shared.defaultCollapse},De.prototype.isCollapsible=function(){return this._collapsible},De.prototype.disableCollapsing=function(t){this._collapsible=!(!1!==t)},De.prototype.setGroupColor=function(t){1===this._groupLevel&&(this._groupColor=t)},De.prototype.getGroupColor=function(){return 0===this._groupLevel?"":1===this._groupLevel?this._groupColor:this._parent.getGroupColor()},De.prototype._getFirstHiddenRids=function(){if(this._shared.contentAsHeader&&this._showOnlyFirstMember){let t=this._rids;if(Array.isArray(t)&&t.length)return[t[0]]}return null},De.prototype.getVisibleRowCount=function(){return this._collapsed?0:(this._rebuildRowIdsFromChildren(),this._getRids().length)},De.prototype.isRowDataInGroup=function(t,e){let n=this._groupCriteria,i=this._groupLevel;if(!e||e===this.getGroupId())return this._isAllowedInGroup(null,t);for(let o=i;o<n.length;o++)if(n[o](t).indexOf(e)>=0)return!0;return!1},De.prototype.isRowIdInGroup=function(t,e){let n=this.getRowData(t);return!!n&&this.isRowDataInGroup(n,e)},De._getDataViewExpansionId=function(t,e){return t+"_ex"+e},De.prototype.addRowExpansion=function(t,e){if(this._groupLevel>0)return;if(!e||e<0){if(null!=e)return;e=1}let n=this._rids.indexOf(t);if(n<0)return;let i=0;this._expansionMap?i=this._expansionMap[t]||0:(this._expansionMap={},this._expansionChildren={});let o=i+e;this._expansionMap[t]=o;for(let e=i;e<o;e++)this._expansionChildren[De._getDataViewExpansionId(t,e)]=t;if(i||this._expansionCount++,!this._groupViewDirty&&this._updateExpansionView()){let e={};e.rid=t,e.type="inserted",e.nextRid=this._rids[n+1],e.fallback=n,this._dispatchDataChange(e)}},De.prototype.removeRowExpansion=function(t){if(!this._expansionMap)return;let e=this._expansionMap[t];if(!e)return;let n=new Array(e);for(let i=0;i<e;++i)n[i]=De._getDataViewExpansionId(t,i),delete this._expansionChildren[n[i]];delete this._expansionMap[t],this._expansionCount--,this._groupViewDirty||this._updateExpansionView()&&(1===e?this._dispatchRowRemoved(n[0]):this._dispatchMultiRowRemoved(n))},De.prototype.toggleRowExpansion=function(t,e,n){let i=this._toRowId(t);(e=null!=e?!0===e:!this.hasRowExpansion(i))?this.addRowExpansion(i,n):this.removeRowExpansion(i)},De.prototype.removeAllRowExpansions=function(){this._expansionMap&&(this._expansionMap=null,this._expansionCount=0,this._expansionView=null,this._expansionChildren=null,this._refreshAndNotify())},De.prototype.getRowsWithExpansion=function(t,e){if(!this._expansionMap)return[];let n=this._expansionView,i=n.length;(null==e||e>i)&&(e=i),t>0||(t=0);let o=this._expansionCount,r=new Array(i);for(let i=t;i<e;++i){let t=n[i];if(this._expansionMap[t]&&(r[i]=t,--o<=0))break}return r},De.prototype.getExpansionParents=function(t,e){let n=[];if(this._expansionMap){let i=this._expansionView,o=i.length;(null==e||e>o)&&(e=o),(!t||t<0)&&(t=0);for(let o=t;o<e;++o)n[o]=this._expansionChildren[i[o]]||""}return n},De.prototype.getExpansionParentByRowId=function(t){return this._expansionChildren&&this._expansionChildren[t]||""},De.prototype.isRowExpansion=function(t){return!!this._expansionChildren&&!!this._expansionChildren[t]},De.prototype.hasRowExpansion=function(t){return!!this._expansionMap&&!!this._expansionMap[t]},De.prototype.getRowExpansionCount=function(t){return this._expansionMap&&this._expansionMap[t]||0},De.prototype.getRowExpansionId=function(t,e){return this._expansionMap&&(e||(e=0),e<(this._expansionMap[t]||0))?De._getDataViewExpansionId(t,e):""},De.prototype.getRowExpansionIndex=function(t){if(t){let e=t.match(/_ex(\d+)$/);if(e)return+e[1]}return-1},De.prototype._updateExpansionView=function(){let 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;let e=this._pageView||this._groupView||this._rids,n=e.length,i=this._expansionView?this._expansionView.length:0;this._expansionView?this._expansionView.length=n:this._expansionView=new Array(n);let o=this._expansionCount;for(let i=0,r=0;i<n;++i){let n=e[i];if(this._expansionView[r++]=n,o){let e=t[n]||0;if(e){for(let t=0;t<e;++t)this._expansionView[r++]=De._getDataViewExpansionId(n,t);--o}}}return i!==this._expansionView.length}return!1},De.prototype._transformView=function(t){let e=this._updatePaginationView(t);return e|=this._updateExpansionView(),!!e},De.prototype.searchAll=function(t,e){e||(e=[]),this._rebuildRowIdsFromChildren();let n=this._getRids(),i=n.length;for(let o=0;o<i;++o){let i=n[o],r=this._dt.getRowData(i);r&&t(r)&&e.push(i)}return e},De.prototype.searchPrev=function(t,e){this._rebuildRowIdsFromChildren();let n=this._getRids(),i=-1;"number"==typeof t?this._dt.getRowData(n[t])&&(i=t):i=n.indexOf(t);let o=-1,r=n.length;return i>0&&(o=this._searchRow(n,e,i-1,-1,-1),o>=0)||i>=0&&(o=this._searchRow(n,e,r-1,i,-1),o>=0)?o:-1},De.prototype.searchNext=function(t,e){this._rebuildRowIdsFromChildren();let n=this._getRids(),i=-1;if("number"==typeof t?this._dt.getRowData(n[t])&&(i=t):i=n.indexOf(t),i<0)return-1;let o=-1,r=n.length;return i<r-1&&(o=this._searchRow(n,e,i+1,r,1),o>=0)||i>0&&(o=this._searchRow(n,e,0,i,1),o>=0)?o:-1},De.prototype._searchRow=function(t,e,n,i,o){for(;n!==i;){let i=t[n],r=this._dt.getRowData(i);if(r&&e(r))return n;n+=o}return-1},De.prototype.stall=function(t){let e=!1!==t;if(!!this._shared.stalledRids===e)return!1;if(e){let t={};this._shared.stalledRids=t;let e=this._getRids();for(let n=e.length;--n>=0;)t[e[n]]=1}else this._shared.stalledRids=null,this._refreshAndNotify();return!0},De.prototype.stallSorting=function(t){let e=!1!==t;return this._stalledSorting!==e&&(this._stalledSorting=e,!e&&this.isSorting()&&this._sort()&&this._dispatchDataChange(wt._positionChangeArg),!0)},De.prototype.enableAutoGroupRemoval=function(t){return t=!1!==t,!!this._shared.autoGroupRemoval!==t&&(this._shared.autoGroupRemoval=t,this._triggerGroupRefreshing(),!0)},De.prototype.enableAutoGroupHiding=function(t){return t=!1!==t,!!this._shared.autoGroupHiding!==t&&(this._shared.autoGroupHiding=t,this._triggerGroupRefreshing(),!0)},De.prototype.synchronizeRowOrder=function(){!this._stalledSorting&&this.isSorting()&&this._dt._sort(this._sortingDefs)},De.prototype.setSegmentSeparators=function(t,e){return!!t&&((e=!1!==e)&&this.synchronizeRowOrder(),this._dt.setSegmentSeparators(t,e))},De.prototype.setSegmentSeparator=function(t,e){let n="";return"number"==typeof t?n=this.getRowId(t):"string"==typeof t&&(n=t),!!n&&(!1!==e&&this.synchronizeRowOrder(),this._dt.setSegmentSeparator(n,e))},De.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},De.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},De.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},De.prototype.getSegment=function(t){return this._dt.getSegment(t)},De.prototype.getSegmentParent=function(t){return this._dt.getSegmentParent(t)},De.prototype.getSegmentLevel=function(t){return this._dt.getSegmentLevel(t)},De.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},De.prototype.collapseSegment=function(t,e){e=!1!==e;let n=this._dt._getSegmentSeparators();if(n){let i=this._toRowId(t);if(n.collapseSegment(i,e))return this._refreshAndNotify(),!0}return!1},De.prototype.collapseSegments=function(t,e){e=!1!==e;let n=this._dt._getSegmentSeparators();return!(!n||!n.collapseSegments(t,e)||(this._refreshAndNotify(),0))},De.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},De.prototype.expandAllSegments=function(){let t=this._dt._getSegmentSeparators();return!(!t||!t.expandAllSegments()||(this._refreshAndNotify(),0))},De.prototype.setSegmentCollapsingLogic=function(){},De.prototype.isSegmentCollapsed=function(t){let e=this._dt._getSegmentSeparators();return!!e&&e.isCollapsedSegment(this._toRowId(t))},De.prototype.fillSegment=function(t){this._dt.fillSegment(this._toRowId(t))},De.prototype.fillSegments=function(){this._dt.fillSegments()},De.prototype.addSegmentChild=function(t,e,n){if(this._dt._getSegmentSeparators()){let i=this._toRowId(t),o=this._toRowId(e);return this._dt.addSegmentChild(i,o,n)}return!1},De.prototype.addSegmentChildren=function(t,e,n){if(this._dt._getSegmentSeparators()){let i=this._toRowId(t),o=this._toRowIds(e);return this._dt.addSegmentChildren(i,o,n)}return!1},De.prototype.setSegmentChildren=function(t){return!!this._dt._getSegmentSeparators()&&this._dt.setSegmentChildren(t)},De.prototype.removeSegmentChild=function(t,e){if(this._dt._getSegmentSeparators()){let n=this._toRowId(t),i=this._toRowId(e);return this._dt.removeSegmentChild(n,i)}return!1},De.prototype.removeSegmentChildren=function(t,e){if(this._dt._getSegmentSeparators()){let n=this._toRowId(t),i=this._toRowIds(e);return this._dt.removeSegmentChildren(n,i)}return!1},De.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},De.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},De.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},De.prototype.sortSeparators=function(t,e,n){let i=this._sortingDefs;if(i.length)n||(n=i[0][0]),e||(e=i[0][3]);else if(!t)return;this._dt.sortSeparators(t,e,n)},De.prototype.sortSegments=function(t){this._dt.sortSegments(t)},De.prototype.enableEmptySegmentFiltering=function(t){t=!1!==t,this._emptySegmentFiltering!==t&&(this._emptySegmentFiltering=t,this._userFilter&&this._refreshAndNotify())},De.prototype.enableSeparatorFiltering=function(t){t=!1!==t,this._separatorFiltering!==t&&(this._separatorFiltering=t,this._userFilter&&this._refreshAndNotify())},De.prototype.setSegmentClassification=function(t,e){return this._dt.setSegmentClassification(this._toRowId(t),e)},De.prototype.setSegmentDefaultCollapsing=function(t){return this._dt.setSegmentDefaultCollapsing(t)},De.prototype._getSharedObject=function(){return this._shared},De.prototype.getWrapSize=function(){return this._wrapSize},De.prototype.getWrappedViews=function(){return this._wrappedViews},De.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()},De.prototype._updateWrapCount=function(){this._wrapTimerId=0;let t,e=this._wrapSize,n=this._wrappedViews,i=n?n.length:0,o=0;if(e){let r=this.getVisibleRowIds(!0),s=r.length;if(o=Math.ceil(s/e),i<o)for(n||(n=this._wrappedViews=[]),t=i;t<o;++t)this._wrappedViews[t]=new Ie({dataView:this,wrapIndex:t,rids:r})}if(o<i){for(t=i;--t>=o;)this._wrappedViews[t].dispose();this._wrappedViews.length=o}e||(this._wrappedViews=null),i!==o&&this._dispatch("wrapCountChanged",{prevCount:i,newCount:o})},De.prototype.dump=function(t){this._rebuildRowIdsFromChildren();let e=this._getRids();return ft.constructTable(this.getMultipleRowData(e),t,e)},De.prototype.log=function(t){console.table(this.dump(t))},De.prototype._getRids=function(){return this._expansionView||this._pageView||this._groupView||this._rids},De.prototype._updateRowIds=function(t){if(this._groupViewDirty=!1,!this._parent||this._hidden)return void this._resetAllViews();if(this._shared.stalledRids)return;this._rids=t||this._parent.getAllRowIds(),this._dispatch("beforeFiltering",{}),this._excludedRids={};let e=0;e+=De._copyValidObjectKeys(this._excludedRids,this._hiddenRids);let n=this._dt._getSegmentSeparators(),i=n?n.getSegments():null,o=this._getRemovalMap(this._excludedRids,this._userFilter,this._filteringOut,this._separatorFiltering?null:i);if(e+=o,this._collapsedRids=null,n&&(o&&this._emptySegmentFiltering&&(e+=this._getEmptySegments(this._excludedRids,i)),this._collapsedRids=n.getCollapsedRows(),e+=De._copyValidObjectKeys(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{let t=this._updatePageCount();this._sort()||t||this._transformView()}},De.prototype._onDataChanged=function(t){if(this._conflator.conflate(t))return;let e=this._conflator.popAllData()||[t],n=e.length;if(1===n){let t=e[0];if(t.globalChange)return this._updateRowIds(),void this._dispatchDataChange(t);let n=t.type;"inserted"===n?this._onRowInserted(t):"removed"===n?this._onRowRemoved(t):this._onRowUpdated(t)}else{this._updateRowIds();let t=!0;for(let i=0;i<n;i++)if(!e[i].positionChangeOnly){t=!1;break}this._dispatchDataChange({globalChange:!0,positionChangeOnly:t,events:e})}},De.prototype._onRowInserted=function(t){if(this._shared.stalledRids)return 0;if(this.isRowFiltered(t.rid,t.rowData))return 0;let e=0;if(this._groupMembers){let n,i=this._resolveGroupId(t.rowData),o=i.length;o>1&&(this._shared.multiGroupRow=!0);for(let r=0;r<o;r++)if(n=i[r],this._groupMembers[n])e=this._groupMembers[n]._onRowInserted(t);else{let i=this._addGroup(n);i&&(t.globalChange=!0,i._onRowInserted(t),e=1)}t.globalChange&&(this._groupViewDirty=!0)}if(this._hidden)return e;let n=t.rid,i=t.rowData;if(!this._isAllowedInGroup(n,i))return e;let o,r=t.nextRid;o=this.isSorting()&&!t.segmentChanged?this._addDataRow(n):this._addDataRow(n,r,t.fallback);let s=this._updatePageCount(),l=this._sort();return l&&(t.globalChange=!0),t.globalChange?l||s||this._transformView():(t={rid:n,rowData:i,type:"inserted"},null!=r&&(t.nextRid=r,t.fallback=o),this._transformView(o)&&(t.globalChange=!0)),this._dispatchDataChange(t),1},De.prototype._onRowRemoved=function(t){if(this._shared.stalledRids)return 0;if(t.segmentChanged&&this.isSorting())return this._refreshAndNotify(),1;let e,n=0,i=t.rids;if(this._groupMembers){let o,r,s=t.rowData;if(!i&&s){for(o=this._resolveGroupId(s),e=0;e<o.length;e++)r=o[e],this._groupMembers[r]&&(n+=this._groupMembers[r]._onRowRemoved(t));n>1&&(this._groupViewDirty=!0)}else{let i=this._groupList.length;for(e=0;e<i;++e)r=this._groupList[e],n+=this._groupMembers[r]._onRowRemoved(t)}}let o,r,s=NaN,l=null;if(n=0,i){for(l=[],e=i.length;--e>=0;)o=i[e],r=this._removeDataRow(o),r>=0&&(l.push(o),r>=s||(s=r));n=l.length}else o=t.rid,r=this._removeDataRow(o),r>=0&&(l=[o],s=r,n=1);return n>0&&(this._updatePageCount()||this._transformView(s)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(l),this._shared.autoGroupRemoval&&this._groupRows&&this._rids.length<=0&&this._triggerGroupRefreshing(),this._hiddenHeaderRow&&this._requestRebuildingRowIds(!0)),n},De.prototype._onRowUpdated=function(t){let e,n,i=t.rid,o=t.rowData;if(this.isRowFiltered(i,o))return this._onRowRemoved(t)?1:0;if(this._groupMembers){let r=[],s=this._groupList.length;for(e=0;e<s;++e)n=this._groupList[e],r[this._groupMembers[n]._onRowUpdated(t)]=!0;t.globalChange&&(this._groupViewDirty=!0);let l=0;if(r[2]?l=2:r[1]?this._isAllowedInGroup(i,o)||(l=1):r[4]&&(l=4),this._groupLevel>0)1===l?(De._removeArrayItem(this._rids,i)>=0&&this._groupView&&De._removeArrayItem(this._groupView,i),this._shared.multiGroupRow&&(this._groupViewDirty=!0)):2!==l||this._hidden||(this._rids.indexOf(i)<0&&this._rids.push(i),this._groupViewDirty=!0,this._resolveGroupId(o).length>1&&(this._shared.multiGroupRow=!0));else{let s=r[1]&&r[2]||r[4];if(this._shared.multiGroupRow||!s){let i=this._resolveGroupId(o);for(e=0;e<i.length;e++){n=i[e];let o=this._addGroup(n);o&&(o._onRowInserted(t),l=1)}}!s&&!this._hidden&&this._rids.indexOf(i)<0&&this._addDataRow(i),4===l?this._shared.multiGroupRow?this._dispatchGlobalChange():this._dispatchDataChange(t):(this._groupViewDirty=!0,this._dispatchGlobalChange())}return l}return this._isAllowedInGroup(i,o)?this._rids.indexOf(i)<0?(this._onRowInserted(t),2):(this._shared.stalledRids||this._sort()&&(t.globalChange=!0),this._dispatchDataChange(t),4):this._onRowRemoved(t)?1:0},De.prototype._onGroupAdded=function(t){if(!this._hidden){let e=t.newGroup,n=e.getGroupRowId();this._groupView.push(n),this._groupViewDirty=!0,this._dispatch("groupAdded",t),ut.pushArrayItems(this._groupView,e.getFooterRowIds())}},De.prototype._onBeforeGroupAdded=function(t){this._dispatch("beforeGroupAdded",t)},De.prototype._requestRebuildingRowIds=function(t){this._groupMembers&&(this._groupViewDirty=!0),this._groupLevel>0?this._parent._requestRebuildingRowIds(t):(t?this._rebuildRowIdsFromChildren():this._updateRowIds(),this._dispatchGlobalChange())},De.prototype._refreshAndNotify=function(){this._updateRowIds(),this._dispatchGlobalChange()},De.prototype._onRefreshTimeout=function(){this._refreshTimerId=0,this._refreshAndNotify()},De.prototype._addDataRow=function(t,e,n){let i=this._getRowIndex(this._rids,e,n);return this._insertItems(this._rids,i,t),this._groupView?this._groupMembers?(this._groupViewDirty=!0,this._insertItems(this._groupView,-1,t)):i<0?this._insertItems(this._groupView,-1,t):(i=this._getRowIndex(this._groupView,e,n),this._insertItems(this._groupView,i,t)):i>=0?i:this._rids.length-1},De.prototype._insertItems=function(t,e,n){return e<0?(e=t.length,t.push(n)):t.splice(e,0,n),e},De.prototype._getRowIndex=function(t,e,n){if(null==e)return-1;let i=this._rids.indexOf(e);return i>=0?i:null==n||n>=t.length?-1:n},De.prototype._removeDataRow=function(t){let e=De._removeArrayItem(this._rids,t);return this._groupView&&e>=0&&(e=De._removeArrayItem(this._groupView,t)),e},De._removeArrayItem=function(t,e){let n=t.indexOf(e);return n>=0&&t.splice(n,1),n},De._removeArrayItems=function(t,e){let n=NaN,i=0;for(let o=t.length;--o>=0;)e[t[o]]?++i:i&&(n=o+1,t.splice(n,i),i=0);return i&&(t.splice(0,i),n=0),n},De._copyValidObjectKeys=function(t,e){if(e){let n=0;for(let i in e)e[i]&&(t[i]=1,++n);return n}return 0},De.prototype._isAllowedInGroup=function(t,e){if(this._groupLevel>0){let n=this;for(let i=this._groupLevel;--i>=0;){if(!n._groupFilterLogic(t,e))return!1;n=n.getDataSource()}}return!0},De.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)},De.prototype._sort=function(){if(this._groupMembers)return!1;if(this._stalledSorting)return!1;if(this._dt._getSegmentSeparators()||this.isSorting()){let t=this._rids,e=this._dt.getMultipleRowData(t),n=this._dt.getSegmentValues(t,!0),i=wt._performMultiLevelSorting(e,this._sortingDefs,n);if(i)return this._rids=wt._reorderItems(t,i),this._transformView(),!0}return!1},De.prototype._byRemovalMap=function(t){return!this._excludedRids[t]},De.prototype._getRemovalMap=function(t,e,n,i){if(!e)return 0;let o,r,s,l=this._rids,a=this._dt,u=0,h=l.length;if(i)for(r=h;--r>=0;)o=l[r],i[o]||(s=a.getRowData(o),s?e(o,s)===n&&(t[o]=1,++u):(t[o]=1,++u));else for(r=h;--r>=0;)o=l[r],s=a.getRowData(o),s?e(o,s)===n&&(t[o]=1,++u):(t[o]=1,++u);return u},De.prototype._getEmptySegments=function(t,e){let n=this._dt._getSegmentSeparators(),i=0;for(let o in e){let e=n.getSegment(o);if(e){let n=e.getChildren(),r=!0;for(let e in n)if(!t[e]){r=!1;break}r&&(t[o]=1,++i)}}return i},De.prototype._getFilterLogic=function(t,e){return null!=t?"function"==typeof t?t:"string"==typeof t?De._defaultFilterLogic.bind(null,t,e):De._defaultFilterLogic.bind(null,t+"",e):null},De.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)},De.prototype._updatePaginationView=function(t){let e=!1;if(this._pageView){t||(t=0);let n=this._pageSize*(this._pageIndex-1),i=this._pageSize+n;if(t<i){let t=this._groupView||this._rids;i>t.length&&(i=t.length);let o=i-n;this._pageView.length=o>=0?o:0;for(let e=n;e<i;++e)this._pageView[e-n]=t[e];e=!0}}return e},De.prototype._updatePageCount=function(){let t=1;if(this._pageSize>0){let e=this._groupView||this._rids,n=e.length>0?e.length:0;t=Math.ceil(n/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)},De.prototype._dispatchRowRemoved=function(t){t&&this._dispatchDataChange({type:"removed",rid:t})},De.prototype._dispatchMultiRowRemoved=function(t){if(t){let e=t.length;1===e?this._dispatchRowRemoved(t[0]):e>1&&this._dispatchDataChange({type:"removed",rids:t})}},De.prototype._dispatchGlobalChange=function(){this._dispatchDataChange(wt._globalChangeArg)},De.prototype._dispatchDataChange=function(t){this._dispatch("dataChanged",t),this._wrapSize&&!this._wrapTimerId&&(this._wrapTimerId=setTimeout(this._updateWrapCount))},De.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;let t=this._parent._columnStats;if(t)for(let e in t){let t=this.enableColumnStats(e),n=this._parent.getColumnStats(e);t&&n&&t.setColumnDataGetter(n.getColumnDataGetter())}}},De.prototype._populateGroups=function(){let t,e,n,i,o,r,s=this._rids;this._rids=[];let l={},a=[];for(e=s.length,t=0;t<e;++t){let e=s[t],n=this._dt.getRowData(e);if(n){o=this._resolveGroupId(n),r=o.length,r>1&&(this._shared.multiGroupRow=!0);for(let t=0;t<r;t++){i=o[t];let n=l[i];n?n.push(e):(n=[e],l[i]=n,a.push(i))}}}if(this._shared.autoGroupRemoval)for(e=this._groupList.length,t=e;--t>=0;)i=this._groupList[t],l[i]||(n=this._groupMembers[i],n&&!n._predefinedGroup&&this._removeGroupMember(t,i));let u=null;if(this._preDefGroups&&this._groupLevel<this._preDefGroups.length&&(u=this._preDefGroups[this._groupLevel]),e=this._groupList.length,this._preDefGroupsDirty)for(this._preDefGroupsDirty=!1,t=e;--t>=0;)i=this._groupList[t],n=this._groupMembers[i],n&&n._predefinedGroup&&(u?u.indexOf(n._groupId)<0&&this._removeGroupMember(t,i):this._removeGroupMember(t,i));if(u)for(e=u.length,t=0;t<e;++t){let e=this._addGroup(u[t]);e&&(e._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)i=this._groupList[t],n=this._groupMembers[i],n._updateRowIds(l[i]),n._markColumnStatsDirty();this._groupViewDirty=!0,this._rebuildRowIdsFromChildren()},De.prototype._removeGroupMember=function(t,e){let n=this._groupMembers[e];n&&(this._groupList.splice(t,1),delete this._groupMembers[e],n.dispose())},De.prototype._defaultGroupCriteria=function(t,e){let n=e[t];return Array.isArray(n)?n.map((function(t){return t+""})):[n+""]},De.prototype._groupFilterLogic=function(t,e){return this._groupCriteria[this._groupLevel-1](e).indexOf(this._groupId)>=0},De.prototype._internalGroupSortingLogic=function(t,e){let n=this._groupMembers[t],i=this._groupMembers[e];return this._groupSortingLogic(t,e,n,i)},De.prototype._addGroup=function(t){let e=t+"";if(!e)return null;let n=this._groupMembers[e];if(n)return null;let i,o=(this._groupRowId||"_grp")+"_"+e;if(this._hasListener("beforeGroupAdded")&&(i={dataView:this,newGroupId:e,newGroupValue:t,newGroupRowId:o,newGroupLevel:this._groupLevel+1},this._dispatch("beforeGroupAdded",i),i.cancel))return null;n=new De;let r=this._shared.defaultCollapse;return null!=r&&(n._collapsed=r),n._groupId=e,"string"==typeof t?"null"==t?n._groupValue=null:"undefined"!=t&&(n._groupValue=t):n._groupValue=t,i&&!0===i.hideHeaderRow&&(n._hiddenHeaderRow=!0),n._groupRowId=o,n._groupLevel=this._groupLevel+1,n._groupCriteria=this._groupCriteria,n._preDefGroups=this._preDefGroups,n._groupLevel<n._groupCriteria.length&&(n._groupMembers={},n._groupList=[],n._groupView=[]),n._groupRows=this._groupRows,n._setParent(this),n._sortingDefs=this._sortingDefs,this._groupMembers[e]=n,this._groupList.push(e),this._groupRows[n._groupRowId]=n,this._hidden||(n._isHeaderRowShown()&&this._groupView.push(n._groupRowId),this._groupViewDirty=!0,n._beingAdded=!0,this._dispatch("groupAdded",{dataView:this,newGroup:n}),n._beingAdded=!1),n.listen("groupAdded",this._onGroupAdded),this._hasListener("beforeGroupAdded")&&n.listen("beforeGroupAdded",this._onBeforeGroupAdded),n},De.prototype._triggerGroupRefreshing=function(){this._groupLevel>0?this._parent&&this._parent._triggerGroupRefreshing():this._groupRows&&!this._refreshTimerId&&(this._refreshTimerId=setTimeout(this._onRefreshTimeout,100))},De.prototype._rebuildRowIdsFromChildren=function(){if(this._groupViewDirty){if(this._rids.length=0,this._groupView&&(this._groupView.length=0),!this._hidden){let t=this._groupList.length;for(let e=0;e<t;++e){let t=this._groupList[e],n=this._groupMembers[t];if(n._rebuildRowIdsFromChildren(),ut.pushArrayItems(this._rids,n._rids),!this._collapsed&&this._groupView&&(n._isHeaderRowShown()&&this._groupView.push(n._groupRowId),!n._collapsed)){let t=n._getFirstHiddenRids()||n._groupView||n._rids;ut.pushArrayItems(this._groupView,t),ut.pushArrayItems(this._groupView,n._footerRowIds)}}}this._groupViewDirty=!1,this._updatePageCount()||this._transformView()}},De.prototype._resolveGroupId=function(t){return this._groupCriteria[this._groupLevel](t)},De.prototype._markColumnStatsDirty=function(){for(let t in this._columnStats)this._columnStats[t].markDirty()},De._defaultFilterLogic=function(t,e,n,i){return i[t]===e},De._defaultGroupSortingLogic=function(t,e){return t==e?0:t<e?-1:1};const xe=De;let Ae=function(t,e,n){this._onConflated=this._onConflated.bind(this),this._data=[],"function"==typeof t?this.setFunction(t,n):"function"==typeof e&&this.setFunction(e,n),"number"==typeof e?this.setConflatingTime(e):"number"==typeof t&&this.setConflatingTime(t)};Ae.prototype._data,Ae.prototype._func=null,Ae.prototype._delay=0,Ae.prototype._timerId=0,Ae.prototype._conflated=!1,Ae.prototype._disabled=!1,Ae.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},Ae.prototype.popAllData=function(){if(this._data.length){let t=this._data;return this._data=[],t}return null},Ae.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},Ae.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))},Ae.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},Ae.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},Ae.prototype.getData=function(){return this._data},Ae.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},Ae.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},Ae.prototype.disable=function(t){this._disabled=!1!==t},Ae.prototype.isEnabled=function(){return!this._disabled},Ae.prototype.enable=function(t){this._disabled=!1===t},Ae._proto=Ae.prototype;const Te=Ae;let Le=function(t){let e=this;e._onDataChanged=e._onDataChanged.bind(e),e.extendEventArg=e.extendEventArg.bind(e),e._dataChangedConflator=new Te(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")};o.inherits(Le,ct),Le._runningId=0,Le.prototype._id="",Le.prototype._type="",Le.prototype._grid=null,Le.prototype._snapshot=null,Le.prototype._dataView=null,Le.prototype._dataArg=null,Le.prototype._autoSyncRowCount,Le.prototype._bindingEnabled=!0,Le.prototype._parent=null,Le.prototype._children=null,Le.prototype._dataChangedConflator,Le.prototype.getId=function(){return this._id},Le.prototype.setId=function(t){return this._id=t||"section"+Le._runningId++,this._grid.setAttribute("id",this._id),this._id},Le.prototype.getSection=function(){return this._snapshot||this._grid},Le.prototype.getSectionName=function(){return this._grid.getId()},Le.prototype.getIndex=function(){return this._grid.getIndex()},Le.prototype.getType=function(){return this._type},Le.prototype.setType=function(t){this._type!==t&&(this._type&&this._grid.removeClass(this._type),this._type=t||"",t&&this._grid.addClass(t))},Le.prototype.getDataSource=function(){return this._dataView},Le.prototype.setDataSource=function(t){let 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))},Le.prototype.getRootDataSource=function(){if(!this._dataView)return null;let t=this._dataView.getDataSource();if(!t)return null;for(;t.getDataSource();)t=t.getDataSource();return t},Le.prototype.getData=function(t,e){return this._dataView?(e=this._getRowId(e),this._dataView.getData(e,t)):null},Le.prototype.setData=function(t,e,n){return!!this._dataView&&(e=this._getRowId(e),this._dataView.setData(e,t,n),!0)},Le.prototype.getRowData=function(t){return this._dataView?(t=this._getRowId(t),this._dataView.getRowData(t)):null},Le.prototype.removeRowData=function(t){if(!this._dataView)return!1;let e=this.getRootDataSource();if(!e)return!1;t=this._getRowId(t);let n=e.getRowIndex(t);return!(n<0||(e.removeRow(n),0))},Le.prototype.activateColumns=function(t,e,n){if("content"===this._type)for(let i=n+1;--i>=e;){let e=t[i];null!=e&&this._grid.activateColumn(i,e)}},Le.prototype.getChildren=function(){return this._children},Le.prototype.setParent=function(t){if(this._parent){let t=this._parent._children.indexOf(this);t>=0&&(this._parent._children.splice(t,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))},Le.prototype.getParent=function(){return this._parent},Le.prototype.getDataChangedConflator=function(){return this._dataChangedConflator},Le.prototype.disableConflation=function(t){this._dataChangedConflator.disable(t)},Le.prototype.disableDataBinding=function(t){this._bindingEnabled=!1===t},Le.prototype.getAutoSyncRowCount=function(){return null!=this._autoSyncRowCount?this._autoSyncRowCount:"content"===this._type},Le.prototype.setAutoSyncRowCount=function(t){if(this._autoSyncRowCount=t,this.getAutoSyncRowCount()){let t=this._dataView?this._dataView.getVisibleRowCount():0;this._grid.setRowCount(t)}},Le.prototype.isDataBindable=function(){return!(!this._bindingEnabled||!this._dataView)},Le.prototype.dispose=function(){let 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},Le.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},Le.prototype.extendRenderEventArg=function(t,e,n){return t=this.extendEventArg(t),e>=0||(this._snapshot?(e=0,n=this._grid.getRowCount()):(e=this._grid.getFirstIndexInView(),n=this._grid.getLastIndexInView()+1)),t.fromRowIndex=e,t.toRowIndex=n,t},Le.prototype.extendDataEventArg=function(t,e,n){let i,o;if(t||(t={}),t.firstUpdate=e,t.lastUpdate=n,this._snapshot?(i=0,o=this._grid.getRowCount()):(i=this._grid.getFirstIndexInView(),o=this._grid.getLastIndexInView()+1),t.fromRowIndex=e>i?e:i,this._dataView){let e=this._dataView.getVisibleRowCount();t.dataRowCount=e,o>e&&(o=e)}return t.toRowIndex=n+1<o?n+1:o,this.extendEventArg(t),t},Le.prototype.setIndex=function(t){this._grid.setIndex(t)},Le.prototype.getRowOffset=function(){return this._grid.getRowOffset()},Le.prototype.setRowOffset=function(t){this._grid.setRowOffset(t)},Le.prototype.enableColumnVirtualization=function(t){t=!1!==t,"content"===this._type&&this._grid.enableColumnVirtualization(t)},Le.prototype.isBinding=function(){return this._isEventDispatching("dataChanged")},Le.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))}},Le.prototype._dispatchDataChanged=function(t,e){let n=this.getAutoSyncRowCount(),i=this._dataView?this._dataView.getVisibleRowCount():0,o=this._grid.getRowCount();n?i!==o&&this._grid.setRowCount(i,!0):i>o&&(e=o-1),this.updateRowData(t,e,this._dataArg),this._dataArg=null},Le.prototype.updateRowData=function(t,e,n){this.isDataBindable()&&(this._grid._getTempRowHeights()&&(t=this._grid.getFirstIndexInView(),e=this._grid.getLastIndexInView()+1),(n=this.extendDataEventArg(n,t,e)).fromRowIndex<n.toRowIndex&&this._dispatch("dataChanged",n))},Le.prototype.rerender=function(){this.isDataBindable()?this.updateRowData():this._dispatch("rowAvailable",this.extendEventArg())},Le.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())}},Le.prototype._getRowId=function(t){return ut.isNumber(t)?this._dataView.getRowId(t):t},Le.prototype._mergeEvent=function(t){let e=this._dataArg;if(e||(e=this._dataArg={},e.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)return;if(t.globalChange)return e.globalChange=!0,e.firstUpdate=0,void(e.lastUpdate=NaN);let n=t.rids;if(n)for(let t=n.length;--t>=0;)e.updatedRids[n[t]]=!0;else t.rid&&(e.updatedRids[t.rid]=!0);"updated"!==t.type&&(e.indexShifted=!0,"removed"===t.type&&(e.dataRemoved=!0))},Le.prototype._calculateChangeIndices=function(){if(!this.isDataBindable()||this._dataArg.globalChange)return;let t,e;if(this._dataArg.indexShifted){if(this._dataArg.dataRemoved)this._dataArg.firstUpdate=0;else for(t in this._dataArg.updatedRids)e=this._dataView.getRowIndex(t),e>=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),e>=0&&(this._dataArg.firstUpdate<=e||(this._dataArg.firstUpdate=e),this._dataArg.lastUpdate>=e||(this._dataArg.lastUpdate=e))},Le._proto=Le.prototype;const Ee=Le;let Me=function(t){this._layout=t,this._arg={},this._addEvent("indexChanged")};o.inherits(Me,ct),Me.prototype._layout,Me.prototype._viewSize=0,Me.prototype._viewOffset=0,Me.prototype._startOffsetCount=0,Me.prototype._endOffsetCount=0,Me.prototype._bufferSize=0,Me.prototype._arg=null,Me.prototype._enabled=!0,Me.prototype._active=!0,Me.prototype._virtualizable=!1,Me.prototype._getMinIndex=function(){return this._startOffsetCount},Me.prototype._getMaxIndex=function(){let t=this._layout.getLaneCount()-this._endOffsetCount;return t>this._startOffsetCount?t:this._startOffsetCount},Me.prototype.getContentStart=function(t){return this._layout.getLaneStart(t)},Me.prototype.getContentInViewCount=function(){let t=this.getFirstIndexInView(),e=this.getLastIndexInView();return t>=0&&t<e?e-t+1:0},Me.prototype._getContentSizeInBounds=function(){let t=this._getMinIndex(),e=this._getMaxIndex();return this._layout.getLaneStart(e)-this._layout.getLaneStart(t)},Me.prototype.getViewSize=function(){return this._viewSize},Me.prototype.getViewOffset=function(){let t=this._getMinIndex();return this._viewOffset+this._layout.getLaneStart(t)},Me.prototype.getIndexOffset=function(){return this._startOffsetCount},Me.prototype.isVirtualizable=function(){return this._virtualizable},Me.prototype.getFirstIndexInView=function(){if(!this._virtualizable)return 0;let t=this.getViewOffset(),e=this._layout.getTrackSize();return t>=e&&(t=e-this._viewSize),t<0?0:this._layout.hitTest(t)},Me.prototype.getLastIndexInView=function(){if(this._virtualizable){let 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},Me.prototype.getPrevFirstIndexInView=function(){return null!=this._arg.prevFirstIndex?this._arg.prevFirstIndex:-1},Me.prototype.getPrevLastIndexInView=function(){return null!=this._arg.prevLastIndex?this._arg.prevLastIndex:-1},Me.prototype.update=function(t){if(!(!0===t||this._enabled&&this._active))return!1;if(this._isEventDispatching("indexChanged"))return!1;let e=this.getFirstIndexInView(),n=this.getLastIndexInView(),i=this._arg.prevFirstIndex!==e||this._arg.prevLastIndex!==n;return(t||i)&&(this._arg.firstIndex=e,this._arg.lastIndex=n,this._dispatch("indexChanged",this._arg),this._arg.prevFirstIndex=e,this._arg.prevLastIndex=n),i},Me.prototype.isEnabled=function(){return this._enabled},Me.prototype.enable=function(t){t=!1!==t,this._enabled!==t&&(this._enabled=t,this.validateVirtualization(),this.update(!0))},Me.prototype.disable=function(t){this.enable(!1===t)},Me.prototype.isActive=function(){return this._active},Me.prototype.activate=function(t){t=!1!==t,this._active!==t&&(this._active=t,this.validateVirtualization(),this.update(!0))},Me.prototype.deactivate=function(t){this.activate(!1===t)},Me.prototype.getBufferSize=function(){return this._bufferSize},Me.prototype.setContentLayout=function(t){this._layout!==t&&(this._layout=t,this.validateVirtualization())},Me.prototype.setViewSize=function(t){t<0&&(t=0),this._viewSize!==t&&(this._viewSize=t,this.validateVirtualization())},Me.prototype.setViewOffset=function(t){this._viewOffset=t>0?t:0,this.update()},Me.prototype.setViewBounds=function(t,e){this._startOffsetCount=t>0?t:0,this._endOffsetCount=e>0?e:0,this.validateVirtualization()},Me.prototype.setBufferSize=function(t){t<0&&(t=0),this._bufferSize!==t&&(this._bufferSize=t,this.validateVirtualization())},Me.prototype.validateVirtualization=function(){this._virtualizable=!1,this._enabled&&this._active&&this._viewSize>0&&this._getContentSizeInBounds()>this._viewSize&&(this._virtualizable=!0)},Me._proto=Me.prototype;const Fe=Me;let Pe=function(){let t=this;t._vertical=!0,t._hostClassName="vscrollbar-host",Pe.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")};o.inherits(Pe,_e),Pe.prototype.setScrollContent=function(t,e,n){this._clearAllPanes();let i,o=e.length;if(o<=0)return;let r=this._panes[0],s=this._paneSliders[0],l=0;for(;l<n;)i=e[l++],i.setParent(t);r.setParent(t);let a=o-this._footerCount;for(;l<a;)i=e[l++],i.setParent(s);for(;l<o;)i=e[l++],i.setParent(t);this.invalidateContent()},Pe.prototype.setHeight=function(t){return this.setTrackSize(t,t),!0},Pe.prototype.getHeight=function(){return this.getPaneSize()},Pe.prototype.getScrollTop=function(){return this._getScrollValue()},Pe.prototype.setScrollTop=function(t){this.update(),this._scrollTo(t)},Pe.prototype.isEndOfVerticalScroll=function(){return this._isEndOfScroll()},Pe.prototype.getContentHeight=function(){let t=this._paneSliders[0].getContent(!0),e=0;for(let n=t.length;--n>=0;)e+=t[n].offsetHeight;return e},Pe.prototype.calculateContentSize=function(){return this.getContentHeight()},Pe.prototype.getPane=function(){return this._panes[0]},Pe.prototype._onScroll=function(t){this._dispatch("contentScrolled",t)},Pe._proto=Pe.prototype;const ze=Pe;let Ve=function(t){let 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 we(t),e._grid.setParent(e._element),e._layoutY=new Kt,e._selectionList=new he,e._reverter=new de(e._onRestingPosition,200),e._addEvent("rowHighlighted"),e._addEvent("rowCountChanged"),e._addEvent("rowHeightChanged"),e._addEvent("rowAvailable")};o.inherits(Ve,Wt),Ve.prototype._index=-1,Ve.prototype._rowOffset=0,Ve.prototype._firstIndex=0,Ve.prototype._grid,Ve.prototype._layoutY,Ve.prototype._selectionList=null,Ve.prototype._reverter=null,Ve.prototype._rowBounds=null,Ve.prototype._rowBoundCache=null,Ve.prototype._rowSelDirty=!1,Ve.prototype._cellBoundPainter=null,Ve.prototype._rowBoundTimer=0,Ve.prototype._boundLayer=null,Ve.prototype._hscrollbar=null,Ve.prototype._session="A",Ve.prototype._tempRowHeights=null,Ve.prototype.getWidth=function(){return this.isVisible()?this._grid.getWidth():0},Ve.prototype.getHeight=function(){return this.isVisible()?this._element.offsetHeight:0},Ve.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),this._cellBoundPainter&&this._cellBoundPainter.dispose()},Ve.prototype.setWidth=function(t){return this._grid.setWidth(t)},Ve.prototype.setHeight=function(t){return!1},Ve.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._dispatchRowHeightChangedEvent(0,this._layoutY.getLaneCount())},Ve.prototype.hitTest=function(t,e){let n=[];return n.colIndex=this._grid.hitTestX(t),n.rowIndex=this._layoutY.hitTest(e),n},Ve.prototype.hitTestX=function(t){return this._grid.hitTestX(t)},Ve.prototype.hitTestY=function(t){return this._layoutY.hitTest(t)},Ve.prototype.getDefaultColumnWidth=function(){return this._grid.getDefaultColumnWidth()},Ve.prototype.setDefaultColumnWidth=function(t){this._grid.setDefaultColumnWidth(t)},Ve.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},Ve.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()))},Ve.prototype.getColumnWidth=function(t){return this._grid.getColumnWidth(t)},Ve.prototype.setColumnWidth=function(t,e){return this._grid.setColumnWidth(t,e)},Ve.prototype._setColumnWidth=function(t,e){return this._grid._setColumnWidth(t,e)},Ve.prototype._updateColumnLayout=function(){this._grid._updateColumnLayout()},Ve.prototype._startBindingSession=function(t){if(this._isBinding=t,!t){if(this._tempRowHeights){let t=this.getDefaultRowHeight(),e=!0,n=[];for(let e in this._tempRowHeights){let i=+e,o=this._layoutY.getLaneProperty(i,"sizeSession");o&&o!=this._session&&(this.setRowHeight(i,t),this._layoutY.setLaneProperty(i,"sizeSession",null),n.push(i))}let i=n.length;for(let t=0;t<i;t++)delete this._tempRowHeights[n[t]];if(i)for(let t in this._tempRowHeights){e=null!=t;break}e||(this._tempRowHeights=null)}this._session="A"===this._session?"B":"A"}},Ve.prototype._getTempRowHeights=function(){return this._tempRowHeights},Ve.prototype.getRowHeight=function(t){return this._layoutY.getLaneSize(t)},Ve.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))},Ve.prototype.isColumnVisible=function(t){return this._grid.isColumnVisible(t)},Ve.prototype.hideColumn=function(t,e){return this._grid.hideColumn(t,e)},Ve.prototype.isRowVisible=function(t){return this._grid.isRowVisible(t-this._firstIndex)},Ve.prototype.hideRow=function(t,e){return this._grid.hideRow(t-this._firstIndex,e)},Ve.prototype.getMinimumColumnWidth=function(t){return this._grid.getMinimumColumnWidth(t)},Ve.prototype.setMinimumColumnWidth=function(t,e){return this._grid.setMinimumColumnWidth(t,e)},Ve.prototype.getMinimumRowHeight=function(t){return this._layoutY.getMinimumLaneSize(t)},Ve.prototype.setMinimumRowHeight=function(t,e){return!1},Ve.prototype.getCellLeft=function(t){return this._grid.getCellLeft(t)},Ve.prototype.getCellTop=function(t){return this._layoutY.getLaneStart(t)},Ve.prototype.getCellWidth=function(t,e){return this._grid.getCellWidth(t,0)},Ve.prototype.getCellHeight=function(t,e){return this._layoutY.getLaneSize(e)},Ve.prototype.hasCellSpan=function(){return this._grid.hasCellSpan()},Ve.prototype.getCellRowSpan=function(t,e){return this._grid.getCellRowSpan(t,e-this._firstIndex)},Ve.prototype.setCellRowSpan=function(t,e,n){return this._grid.setCellRowSpan(t,e-this._firstIndex,n)},Ve.prototype.getCellColSpan=function(t,e){return this._grid.getCellColSpan(t,e-this._firstIndex)},Ve.prototype.setCellColSpan=function(t,e,n){return this._grid.setCellColSpan(t,e-this._firstIndex,n)},Ve.prototype.clearCellSpans=function(){return this._grid.clearCellSpans()},Ve.prototype.clearColumnSpans=function(t){return this._grid.clearColumnSpans(t)},Ve.prototype.clearColumnCustomizations=function(){this._grid.clearColumnCustomizations()},Ve.prototype.clearRowCustomizations=function(){this._layoutY.clearLaneCustomizations(),this._grid.clearRowCustomizations()},Ve.prototype.getColumnScalability=function(t){return this._grid.getColumnScalability(t)},Ve.prototype.setColumnScalability=function(t,e){return this._grid.setColumnScalability(t,e)},Ve.prototype.getRowScalability=function(t){return this._layoutY.getLaneScalability(t)},Ve.prototype.setRowScalability=function(t,e){return!1},Ve.prototype.getCell=function(t,e,n){return this._grid.getCell(t,e-this._firstIndex,n)},Ve.prototype.getCellContent=function(t,e){return this._grid.getCellContent(t,e-this._firstIndex)},Ve.prototype.setCellContent=function(t,e,n){return this._grid.setCellContent(t,e-this._firstIndex,n)},Ve.prototype.getColumnCount=function(){return this._grid.getColumnCount()},Ve.prototype.setColumnCount=function(t){this._grid.setColumnCount(t)},Ve.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},Ve.prototype.setRowCount=function(t,e){let n=this._layoutY.getLaneCount();n!==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:n,noBinding:e}))},Ve.prototype.getVisibleRowCount=function(){return this.getRowCount()},Ve.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))},Ve.prototype.removeRow=function(t){if(t<=0)return;let e=this._layoutY.getLaneCount();t>e&&(t=e),this.setRowCount(e-t)},Ve.prototype.setBorders=function(t,e,n,i){this._grid.setBorders(t,e,n,i)},Ve.prototype.getColumnStyle=function(t,e){return this._grid.getColumnStyle(t,e)},Ve.prototype.setColumnStyle=function(t,e,n){this._grid.setColumnStyle(t,e,n)},Ve.prototype.enableColumnClass=function(t,e,n){this._grid.enableColumnClass(t,e,n)},Ve.prototype.hasColumnClass=function(t,e){return this._grid.hasColumnClass(t,e)},Ve.prototype.enableRowClass=function(t,e,n){this._grid.enableRowClass(t-this._firstIndex,e,n)},Ve.prototype.setRowStyle=function(t,e,n,i){this._grid.setRowStyle(t-this._firstIndex,e,n,i)},Ve.prototype.getContentWidth=function(){return this._grid.getContentWidth()},Ve.prototype.getContentHeight=function(){return this._layoutY.getTrackSize()},Ve.prototype.getCellsByRowIndex=function(t){return this._grid.getCellsByRowIndex(t-this._firstIndex)},Ve.prototype.disableHorizontalGridLine=function(t){this._grid.disableHorizontalGridLine(t)},Ve.prototype.disableVerticalGridLine=function(t){this._grid.disableVerticalGridLine(t)},Ve.prototype.enableShading=function(t){this._grid.enableShading(t)},Ve.prototype.setTransposedShading=function(t){this._grid.setTransposedShading(t)},Ve.prototype.enableRowHighlighting=function(t){this._grid.enableRowHighlighting(t)},Ve.prototype.getRowHighlight=function(){let t=this._grid.getRowHighlight();return t>=0&&(t+=this._firstIndex),t},Ve.prototype.setRowHighlight=function(t){let e=this._grid.getRowHighlight();this._grid.setRowHighlight(t-this._firstIndex),this._hasListener("rowHighlighted")&&(t=this._grid.getRowHighlight(),this._dispatch("rowHighlighted",{prevRowIndex:e>=0?e+this._firstIndex:e,rowIndex:t>=0?t+this._firstIndex:t}))},Ve.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},Ve.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},Ve.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},Ve.prototype.setSelectedRow=function(t,e){this._selectionList.setSelection(t,e);let n=this._selectionList.getSelection(t);this._grid.setSelectedRow(t-this._firstIndex,n),n&&(this._rowSelDirty=!0,this._initBoundLayer()),this._requestUpdatingRowBounds()},Ve.prototype.selectSingleRow=function(t){this._selectionList.clearAllSelections(),this._grid.clearSelectedRows(),this.setSelectedRow(t)},Ve.prototype.selectRowRange=function(t,e){this._selectionList.selectRange(t,e),this._updateRowSelection(),this._rowSelDirty=!0,this._initBoundLayer(),this._requestUpdatingRowBounds()},Ve.prototype.clearSelectedRows=function(){let t=this._selectionList.clearAllSelections();return this._grid.clearSelectedRows(),this._requestUpdatingRowBounds(),t},Ve.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},Ve.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},Ve.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},Ve.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},Ve.prototype.activateColumn=function(t,e){this._grid.activateColumn(t,e)},Ve.prototype.activateRows=function(t,e,n){let i=this._layoutY.getLaneCount();t||(t=this._rowOffset),e||0===e||(e=t+i),(t-=this._rowOffset)<0&&(t=0),(e-=this._rowOffset)<0&&(e=0);let o=this._getInnerRowCount(),r=this._firstIndex,s=0;s=t-(1&t),s<0?s=0:s>i&&(s=i);let l=e+(1&e)-s;l+2===o&&(l=o),l<0?l=0:l+s>i&&(l=i-s),this._firstIndex=s;let 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();let p=!1;if(l!==o){if(this._grid.setRowCount(l),l>o){let t={};t.prevRowIndex=s+o,t.rowIndex=s+l,n&&(t.noDataUpdate=!0),this._dispatch("rowAvailable",t)}p=!0}if(n){if(!p){this._grid.clearSelectedRows();let t=r+o;s<r&&r<a&&t>=a?(this.moveRowsToTop(a-r),n[0]=s,n[1]=r):r<s&&s<t&&a>=t?(this.moveRowsToTop(s-r),n[0]=t,n[1]=a):s===r&&a===t?(n[0]=0,n[1]=0):p=!0}p&&(n[0]=s,n[1]=a)}this._layoutY.isHomogeneous()||this._grid._updateRowHeights(this._layoutY,s),this._updateRowSelection()},Ve.prototype.moveRowsToTop=function(t){this._grid.moveRowsToTop(t)},Ve.prototype.getFirstIndexInView=function(){return this._firstIndex},Ve.prototype.getLastIndexInView=function(){let t=this._firstIndex+this._getInnerRowCount()-1,e=this._grid._getContext().getDataSource(),n=e?e.getRowCount()-1:-1;return t>n?n:t},Ve.prototype.isInCurrentView=function(t){return this._firstIndex<=t&&t<this._firstIndex+this._getInnerRowCount()},Ve.prototype.getFrozenLayout=function(){return this._grid.getFrozenLayout()},Ve.prototype.setFrozenLayout=function(t){this._grid.setFrozenLayout(t)},Ve.prototype.getColumn=function(t){return this._grid.getColumn(t)},Ve.prototype.insertColumn=function(t,e){return this._grid.insertColumn(t,e)},Ve.prototype.removeColumnAt=function(t){return this._grid.removeColumnAt(t)},Ve.prototype.moveColumn=function(t,e){this._grid.moveColumn(t,e)},Ve.prototype.enableRowVirtualization=function(t){},Ve.prototype.enableColumnVirtualization=function(t){this._grid.enableColumnVirtualization(t)},Ve.prototype.getColumnIndex=function(t){return this._grid.getColumnIndex(t)},Ve.prototype.getCellIndex=function(t,e){let n=this._grid.getCellIndex(t,e);return n<0?-1:n+this._firstIndex},Ve.prototype.getIndex=function(){return this._index},Ve.prototype.setIndex=function(t){this._index=t},Ve.prototype.setRowOffset=function(t){this._rowOffset=t},Ve.prototype.getRowOffset=function(){return this._rowOffset},Ve.prototype.updateLayout=function(){this._grid.updateLayout()},Ve.prototype.stretchCell=function(t,e,n,i){let o=this._grid.stretchCell(t,null!=e?e-this._firstIndex:null,n,i);if(o){let t=o.getElement();0===e?t.classList.add("top"):t.classList.remove("top")}return o},Ve.prototype.unstretchCell=function(t,e){return this._grid.unstretchCell(t,null!=e?e-this._firstIndex:null)},Ve.prototype.unstretchAllCells=function(){this._grid.unstretchAllCells()},Ve.prototype.getStretchedCell=function(t,e){return this._grid.getStretchedCell(t,null!=e?e-this._firstIndex:null)},Ve.prototype.getStretchedCells=function(){return this._grid.getStretchedCells()},Ve.prototype.updateStretchedCells=function(){return this._grid.updateStretchedCells()},Ve.prototype.getColumnHost=function(){return this._grid.getElement()},Ve.prototype.setHidingMethod=function(t){this._grid.setHidingMethod(t)},Ve.prototype.getHidingMethod=function(){return this._grid.getHidingMethod()},Ve.prototype.setColumnVisibility=function(t,e,n){return this._grid.setColumnVisibility(t,e,n)},Ve.prototype.getRowLayout=function(){return this._layoutY},Ve.prototype.reserveRightSpace=function(t){return this._grid.reserveRightSpace(t)},Ve.prototype.getReservedSpace=function(){return this._grid.getReservedSpace()},Ve.prototype.getComputedStyle=function(){return this._grid.getComputedStyle()},Ve.prototype.isColumnActive=function(t){return this._grid.isColumnActive(t)},Ve.prototype.setRowAttributes=function(t,e){return this._grid.setRowAttributes(t,e)},Ve.prototype.getContextRow=function(t){return this._grid.getContextRow(t-this._firstIndex)},Ve.prototype.selectColumn=function(t,e){this._grid.selectColumn(t,e)},Ve.prototype.isSelectedColumn=function(t){return this._grid.isSelectedColumn(t)},Ve.prototype.selectCell=function(t,e,n){this._grid.selectCell(t,e-this._firstIndex,n)},Ve.prototype.setCellBounds=function(t,e,n,i){let o=this._initBoundLayer(),r=this._cellBoundPainter;r||(r=this._cellBoundPainter=new Ce({boundLayer:o,layoutX:this.getHorizontalLayout(),layoutY:this._layoutY,hscrollbar:this._hscrollbar,calculateColumnBounds:this.calculateColumnBounds.bind(this)}));let s=this.getColumnCount();r.setCellBounds(t,e,n,i,s)},Ve.prototype.getHorizontalLayout=function(){return this._grid.getHorizontalLayout()},Ve.prototype.calculateColumnBounds=function(t,e,n,i){this._grid.calculateColumnBounds(t,e,n,i)},Ve.prototype.updateColumnBounds=function(t,e,n){this._grid.updateColumnBounds(t,e,n),this._updateRowBounds()},Ve.prototype.updateColumnSeparators=function(){this._grid.updateColumnSeparators()},Ve.prototype._initBoundLayer=function(){let t=this._boundLayer;return t||(t=this._boundLayer=document.createElement("div"),t.className="cover-layer",this._element.appendChild(t)),t},Ve.prototype._requestUpdatingRowBounds=function(){this._rowBoundTimer||(this._rowBoundTimer=setTimeout(this._updateRowBounds,10))},Ve.prototype._updateRowBounds=function(){this._rowBoundTimer=0;let t=this._cellBoundPainter;if(t&&t.updateCellBounds(),!this._rowSelDirty)return;let e=this._rowBounds,n=this._rowBoundCache;e||(e=this._rowBounds=[]),n||(n=this._rowBoundCache=[]);let i=this._selectionList,o=this._layoutY.getLaneCount();i.deselectFrom(o);let r,s=i.getConnectedRanges(),l=s.length,a=null,u=null,h=e.length;for(r=l;r<h;++r)u=e[r],a=u.parentNode,a&&a.removeChild(u);if(e.length=h=l,!l)return void(i.getSelectionCount()||(this._rowSelDirty=!1));let p=0,d=0,c=0,_=!1;this._hscrollbar&&(p=this._hscrollbar.getScrollLeft(),d=this._hscrollbar.getPinnedLeftColumnCount(),c=this._hscrollbar.getPinnedRightColumnCount(),_=this._hscrollbar.isEndOfHorizontalScroll());let f=!d&&p>0,g=!c&&!_,y=this._grid._getViewSize();for(r=0;r<l;++r){let t=s[r],i=t[0],o=t[1],l=this._layoutY.getLaneStart(i),a=this._layoutY.getLaneEnd(o);u=n[r],u||(u=n[r]=document.createElement("div"),u.className="selection-bound"),u.style.top=l+"px",u.style.height=a-l+"px",u.style.width=y+"px",u.classList.toggle("no-left-bound",f),u.classList.toggle("no-right-bound",g),this._boundLayer&&(e[r]||(e[r]=u,this._boundLayer.appendChild(u)))}},Ve.prototype._getInnerRowCount=function(){return this._grid.getRowCount()},Ve.prototype._updateRowSelection=function(){this._grid.clearSelectedRows();let t,e=this._selectionList,n=e.getSelectionCount();if(n<=0)return;let i=this._firstIndex,o=i+this._getInnerRowCount();if(1===n)t=e.getFirstSelectedIndex(),i<=t&&t<o&&this._grid.setSelectedRow(t-i,!0);else if(n>=o-i)for(t=i;t<o;++t)e.getSelection(t)&&this._grid.setSelectedRow(t-i,!0);else{let r=e.getAllSelections();for(let e=0;e<n;++e)t=r[e],i<=t&&t<o&&this._grid.setSelectedRow(t-i,!0)}},Ve.prototype._dispatchRowHeightChangedEvent=function(t,e){if(t>=e)return!1;let n={};return n.rowIndex=t,n.changeLength=e-t,this._dispatch("rowHeightChanged",n),!0},Ve.prototype._onRestingPosition=function(){let t=this._grid.getElement();if(t){let e=this._layoutY.getLaneStart(this._firstIndex);t.style.transform="",t.style.top=e?e+"px":""}},Ve.prototype._updateRightSpaceStyle=function(){this._grid._updateRightSpaceStyle()},Ve.prototype._updateLayers=function(){this._grid._updateLayers()},Ve.prototype._setContext=function(t){this._grid._setContext(t)},Ve.prototype._getContext=function(){return this._grid._getContext()},Ve._proto=Ve.prototype;const ke=Ve;let Ne=function(t,e){return t-e},Oe=function(){let t=document.createElement("input"),e=t.style;return e.position="absolute",e.width=e.height=e.padding=e.border="0",t.value="0",t.role="grid",t.readOnly=!0,t},He=function(t){if(t){if(!t.getRootNode)return document.activeElement;{let e=t.getRootNode();if(e&&e!==t)return e.activeElement||null}}return null},Be=function(t){Be._sectionType||(Be._sectionType={},Be._sectionType.title=!0,Be._sectionType.header=!0,Be._sectionType.content=!0,Be._sectionType.footer=!0);let 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._onKeyDown=e._onKeyDown.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(let e=t.childNodes.length;--e>=0;)ut.isElement(t.childNodes[e])||t.removeChild(t.childNodes[e]);e._element=t||document.createElement("div"),e._element.classList.add("tr-grid"),e._layoutX=new Kt,e._layoutY=new Kt,e._layoutX.setDefaultLaneSize(100),e._layoutY.setDefaultLaneSize(32),e._settings=[],e._plugins={},e._columnDefs=[],e._sectionStarts=[],e._rowHeightException="title",e._rowVirtualizer=new Fe(e._layoutY),e._rowVirtualizer.deactivate(),e._rowVirtualizer.setViewSize(360),e._colVirtualizer=new Fe(e._layoutX),e._colVirtualizer.enable(!1),e._colVirtualizer.deactivate(),e._colVirtualizer.setViewSize(400),e._vscrollbar=new ze,e._vscrollbar.disable(),e._vscrollbar.setParent(e.getParent()||e.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 ge,e._hscrollbar.disable(),e._hscrollbar.setParent(e.getParent()||e.getElement()),e._hscrollbar.listen("scroll",e._onHScroll),e._hscrollbar.listen("layoutChanged",e._onHScroll),e._hscrollbar.listen("activated",e.updateLayout),e._hscrollbar.listen("deactivated",e.updateLayout),e._hscrollbar.setOtherScrollbar(e._vscrollbar),e._vscrollbar.setOtherScrollbar(e._hscrollbar),e._element.addEventListener("keydown",e._onKeyDown),ut.isMobile||ut.isTouchDevice?e._element.addEventListener("touchmove",e._onMouseMove,!1):e._element.addEventListener("mousemove",e._onMouseMove,!1),ut.isSafari&&e._element.addEventListener("click",e._onGridClicked),window.addEventListener("resize",e._onWindowResize,!1),e._rowVirtualizer.listen("indexChanged",e._onRowInViewChanged),e._colVirtualizer.listen("indexChanged",e._onColInViewChanged),e._rowHeightConflator=new Te(e._onRowHeightChanged,50),e._vScrollbarConflator=new Te(e._updateVScrollbar,200),e._columnBoundConflator=new Te(e.updateColumnBounds,10),e._columnPositionConflator=new Te(e._dispatchColumnPositionChanged,10),e._rowPositionConflator=new Te(e._dispatchRowPositionChanged,10),e._firstHiddenInput=Oe(),e._firstHiddenInput.className="first-input",e._lastHiddenInput=Oe(),e._lastHiddenInput.className="last-input",e._element.insertBefore(e._firstHiddenInput,e._element.firstChild),e._element.appendChild(e._lastHiddenInput),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","tabNavigation");let n=Be.map;n||(n={},Be.map=n),e._element._control=e;let i=e._element.id||e._element.name;i&&!n[i]||(i="_grid"+Be._runningGridId),e._id=i,n[i]=e,Be._runningGridId++,Object.defineProperty(e,"zoomFactor",{set:function(t){!t||t<0||this._zoomFactor!==t&&(this._zoomFactor=t,e._updateLayout())},get:function(){return this._zoomFactor}})};o.inherits(Be,Wt),Be.SectionReference,Be.MouseInfo,Be.BatchInfo,Be.CellReference,Be.ColumnOptions,Be._runningGridId=0,Be._runningColumnId=0,Be._sectionType,Be.prototype._plugins,Be.prototype._dataSource=null,Be.prototype._layoutX,Be.prototype._layoutY,Be.prototype._vscrollbar,Be.prototype._hscrollbar,Be.prototype._tempFrozenSectionRef="",Be.prototype._startVScrollbarIndex=-1,Be.prototype._hScrollbarEnabled=!0,Be.prototype._pinnedLeftColumnCount=0,Be.prototype._pinnedRightColumnCount=0,Be.prototype._frozenFooterCount=0,Be.prototype._fixFrozenTopSections=!1,Be.prototype._fixFrozenBottomSection=!1,Be.prototype._sectionStarts,Be.prototype._settings,Be.prototype._firstSettings,Be.prototype._lastSettings,Be.prototype._fitContentWidth=!1,Be.prototype._columnDefs,Be.prototype._rowVirtualizer,Be.prototype._colVirtualizer,Be.prototype._autoSetDataSource=!0,Be.prototype._renderingHandler=null,Be.prototype._dataBindingHandler=null,Be.prototype._frozenLayout=!1,Be.prototype._noBinding=!1,Be.prototype._rowHeightSync=!0,Be.prototype._rowHighlighting=!1,Be.prototype._dispatchingDataChanged=!1,Be.prototype._rowHeightException="",Be.prototype._rowScrollingStep=0,Be.prototype._zoomFactor=1,Be.prototype._reservedSpace=0,Be.prototype._hidingMethod="",Be.prototype._rowHeightConflator=null,Be.prototype._vScrollbarConflator=null,Be.prototype._columnBoundConflator=null,Be.prototype._rowRefreshTimer=0,Be.prototype._layoutUpdating=!1,Be.prototype._firstHiddenInput,Be.prototype._lastHiddenInput,Be.prototype._bottomPadding=6,Be.prototype._bottomPaddingSect=null,Be.prototype._preserveProportion=!1,Be.prototype._preserveGridSize=!1,Be.prototype._rowHeightTimerId=0,Be.prototype._groupDefs=null,Be.prototype._batches=null,Be.prototype._firstRendered=!1,Be.prototype._hasPendingRowChange=!1,Be.getVersion=function(){return"5.2.2"},Be.prototype.dispose=function(){let t=this._id,e=Be.map;if(!e[t])return void console.log("WARNING: Core grid is disposed twice");e[t]=null,this._disposed=!0,this._rowRefreshTimer&&(clearTimeout(this._rowRefreshTimer),this._rowRefreshTimer=0),this.unlistenAll(),window.removeEventListener("resize",this._onWindowResize,!1);for(let t=this._columnDefs.length;--t>=0;){let e=this._getColumnDef(t);e.renderingHandler=e.dataBindingHandler=null}for(let t in this._plugins){let e=this._plugins[t];e.unload&&e.unload(this)}this.removeAllSections();let n=this._vscrollbar._mainScrollbar;n&&(n.unlisten("scroll",this._onSyncVScroll),this._vscrollbar._mainScrollbar=null),n=this._hscrollbar._mainScrollbar,n&&(n.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();let i=this._element;i&&(i._control&&delete i._control,i.removeChild(this._firstHiddenInput),i.removeChild(this._lastHiddenInput)),this._dispose(),this._columnDefs.length=0,delete this._plugins},Be.prototype.isDisposed=function(){return this._disposed},Be.prototype.setParent=function(t,e){this._setParent(t,e),this._onParentChange()},Be.prototype.insertBefore=function(t){this._insertBefore(t),this._onParentChange()},Be.prototype._onParentChange=function(){let t=this.getParent()||this.getElement();this._vscrollbar._mainScrollbar||this._vscrollbar.setParent(t),this._hscrollbar.setParent(t),this._updateLayout()},Be.prototype.getConfigObject=function(t){let e=t||{},n=this.getColumnCount();e.columns||(e.columns=[]);for(let t=0;t<n;t++){let n=e.columns[t];n||(n=e.columns[t]={});let i=this._getColumnDef(t);i.userId&&(n.id=i.userId),i.field&&(n.field=i.field),i.styles&&(n.styles=i.styles),i.stationary&&(n.stationary=i.stationary),i.leftPinned&&(n.leftPinned=i.leftPinned),i.rightPinned&&(n.rightPinned=i.rightPinned),i.backgroundColor&&(n.backgroundColor=i.backgroundColor)}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);let i=this._vscrollbar.getAutoHide();!0!==i&&(e.autoHideScrollbar=i);let o=this._vscrollbar.getMouseWheelSpeed();o&&(e.linearWheelScrolling=o),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);let r=this.getDataConflationRate();r&&(e.dataConflationRate=r);for(let t in this._plugins){let n=this._plugins[t];"function"==typeof n.getConfigObject&&n.getConfigObject(e)}return e},Be.prototype.fillParentWidth=function(t){if(this._fitContentWidth)return!1;if(this._layoutX.isFixedSize())return!1;let e=this._element,n=(0|e.getBoundingClientRect().width)-e.clientLeft;return null!==this._layoutX.setTrackSize(n-this._reservedSpace)},Be.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",!1!==t&&this.updateLayout()},Be.prototype.getContentWidth=function(){return this._layoutX.getTrackSize()},Be.prototype.getSectionCount=function(){return this._settings.length},Be.prototype._updateFrozenTopSections=function(){if(!this._fixFrozenTopSections){let t=this._getTopSectionCount();this._freezeTopSectionAt(t-1)}},Be.prototype._updateFrozenBottomSections=function(){if(!this._fixFrozenBottomSection){let t=this._getBottomSectionCount();this._setFrozenFooter(t)}},Be.prototype._getTopSectionCount=function(){let t=this._settings,e=t.length,n=0;for(let i=0;i<e;i++){let e=t[i].getType();if("header"!==e&&"title"!==e)break;n++}return n},Be.prototype._getBottomSectionCount=function(){let t=this._settings,e=0;for(let n=t.length-1;n>=0&&"footer"===t[n].getType();n--)e++;return e},Be.prototype.addSection=function(t,e){return this.addSectionAt(this.getSectionCount(),t,e)},Be.prototype.addSectionAt=function(t,e,n){let i=this._settings.length;t<0&&(t=0),t>i&&(t=i);let o=this._toSectionType(e),r="bottomPadding"===n,s=this._newSection(r?"footer":o,n);if(!s)return null;let l=s.getSection();if(r&&(s.setAutoSyncRowCount(!1),this._bottomPaddingSect=l),t>=i?(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),o=s.getType(),"footer"===o?this._updateFrozenBottomSections():"header"!==o&&"title"!==o||this._updateFrozenTopSections(),this._onColumnCountChanged(),this._onSectionCountChanged(!0),this._colVirtualizer.isEnabled()){let t=this._getColActivationList(),e=this.getColumnCount();s.activateColumns(t,0,e-1)}if(this._hasListener("sectionAdded")){let t=s.extendEventArg();this._dispatch("sectionAdded",t)}return l},Be.prototype.removeSection=function(t){let e=this.getSection(t);return null!==e?this.removeSectionAt(e.getIndex()):null},Be.prototype.removeSectionAt=function(t){let e=this._settings.length;if(t>=0&&t<e){let e=this._settings[t],n=e.getIndex(),i=e.getSection(),o=e.getType();return i.setRowCount(0),this._settings.splice(t,1),this._updateSectionIndices(n),"footer"===o?(this._updateFrozenBottomSections(),this._onColumnCountChanged()):"header"!==o&&"title"!==o||this._updateFrozenTopSections(),this._onSectionCountChanged(),e.dispose(),i}return null},Be.prototype.removeLastSection=function(){return this.removeSectionAt(this._settings.length-1)},Be.prototype.removeAllSections=function(){let t=this._settings.length;for(let 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()},Be.prototype.setBottomPaddingSection=function(t){let 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)},Be.prototype._updatePaddingBottomSect=function(){let t=this._bottomPaddingSect;if(t){let e=this._settings.length-1;if(e>0){let n=this._settings[e];if(n.getSection()!==t){let o=null;for(let n=e;--n>=0;){let e=this._settings[n];if(e.getSection()===t){o=e;break}}if(i>=0)return this._putToLast(t),this._settings.splice(i,1),this._settings.push(o),o.setType("footer"===n.getType()?"footer":"content"),!0;this._bottomPaddingSect=null}else{let t=this._settings[e-1];t&&n.setType("footer"===t.getType()?"footer":"content")}}}return!1},Be.prototype.moveSection=function(t,e){let n=this.getSectionCount();if(t<0)t=0;else if(t>=n)return;if(e<0?e=0:e>=n&&(e=n-1),t===e)return;let i=this._settings[t],o=this._settings[e];ut.moveArrayItem(this._settings,t,e),o?i.getSection().insertBefore(o.getSection()):this._putToLast(i.getSection()),this._updateSectionIndices(t<=e?t:e),this._syncRowHeights(),this._onSectionCountChanged(),this._frozenLayout||this._rowVirtualizer.update(!0)},Be.prototype.getSection=function(t){let e=this.getSectionSettings(t);return null!==e?e.getSection():null},Be.prototype.getSectionSettings=function(t){if(ut.isString(t)){if(Be._sectionType[t])return this._getNextSection(1,null,t);for(let e=this._settings.length;--e>=0;)if(this._settings[e].getId()===t)return this._settings[e]}else if(null!=t){let e=-1;if(null!=t.getIndex?e=t.getIndex():ut.isNumber(t)&&(e=t),e>=0&&e<this._settings.length)return this._settings[e]}return null},Be.prototype.getAllSections=function(t){if(null==t)return this._getAllSections();let e=this.getAllSectionSettings(t),n=e;for(let t=n.length;--t>=0;)n[t]=e[t].getSection();return n},Be.prototype.getAllSectionSettings=function(t){if(!t)return this._settings;let e=this._settings.length,n=[];t=this._toSectionType(t);for(let i=0;i<e;++i){let e=this._settings[i];t===e.getType()&&n.push(e)}return n},Be.prototype.getSectionIndex=function(t){if(ut.isNumber(t))return t;if(t instanceof MouseEvent){let e=ut.getRelativePosition(t,this._element),n={};return this._hitTestY(e.y,n),n.sectionIndex}let e=this.getSection(t);return null==e?-1:e.getIndex()},Be.prototype.getSectionTop=function(t){let e=this.getSection(t);if(null==e)return 0;let n=this._layoutY.getLaneStart(e.getRowOffset());return this._startVScrollbarIndex>=0&&e.getIndex()>=this._startVScrollbarIndex&&(n-=this._vscrollbar.getScrollTop()),n},Be.prototype.getPreviousSection=function(t,e){null==t&&(t=this._settings.length);let n=this._getNextSection(-1,t,e);return null!==n?n.getSection():null},Be.prototype.getNextSection=function(t,e){let n=this._getNextSection(1,t,e);return null!==n?n.getSection():null},Be.prototype.getLastSection=function(){return this.getSection(this._settings.length-1)},Be.prototype.getCell=function(t,e,n,i){let o=this.getSection(t);return o?o.getCell(e,n,i):null},Be.prototype.getCellInfo=function(t){if(!t)return null;let e=t.colIndex,n=t.rowIndex,i=t.sectionName,o=null;if(null==e||null==n)o=this.getRelativePosition(t),o.hit||(o=null);else{i||(i="content");let t=this.getSectionSettings(i);t&&t.getSection().getCell(e,n)&&(o={},o.colIndex=e,o.rowIndex=n,t.extendEventArg(o))}return o},Be.prototype.getNextCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?e:1)},Be.prototype.getPrevCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?-e:-1)},Be.prototype._getNextCellInRow=function(t,e){let n=this.getCellInfo(t);if(n){let t=n.colIndex+e,i=n.rowIndex,o=n.section;n.colIndex=t,n.cell=o.getCell(t,i)}return n},Be.prototype.getNextCell=function(t){let e=this.getNextCellInRow(t);if(e&&!e.cell){let t=e.section,n=e.colIndex=0,i=e.rowIndex;e.rowIndex=++i,e.cell=t.getCell(n,i)}return e},Be.prototype.getPrevCell=function(t){let e=this.getPrevCellInRow(t);if(e&&!e.cell){let t=e.section,n=e.colIndex=t.getColumnCount()-1,i=e.rowIndex;e.rowIndex=--i,e.cell=t.getCell(n,i)}return e},Be.prototype.getColumnCount=function(){return this._layoutX.getLaneCount()},Be.prototype.setColumnCount=function(t){let e=this._layoutX.getLaneCount();if(t>=e){this._layoutX.setLaneCount(t);for(let e=this._settings.length;--e>=0;)this._settings[e].getSection().setColumnCount(t);this._onColumnCountChanged(),this._syncLayoutToColumns(e,t),this._dispatchColumnAddedEvent(e,t-e,!1)}else this._removeColumn(e-t)},Be.prototype.insertColumn=function(t,e){let n=this.getColumnCount();t<n||(t=n),this._layoutX.insertLane(t);for(let e=this._settings.length;--e>=0;)this._settings[e].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<n,e)},Be.prototype.insertColumns=function(t,e){let n=this.getColumnCount();t<n||(t=n);let i,o=0;if(Array.isArray(e)){if(o=e.length,1===o)return void this.insertColumn(t,e[0]);i=e}else{if("number"!=typeof e)return void this.insertColumn(t,e);if(o=e,1===o)return void this.insertColumn(t,null)}if(o<=0)return;let r=this.freezeLayout(),s=[t,0].concat(new Array(o));Array.prototype.splice.apply(this._columnDefs,s);for(let e=0;e<o;e++){let n=t+e;this._layoutX.insertLane(n);for(let t=this._settings.length;--t>=0;)this._settings[t].getSection().insertColumn(n);let o=i&&i[e];this._deserializeColumn(n,o)}this._dispatchColumnAddedEvent(t,o,t<n,i),this.freezeLayout(r)},Be.prototype.removeColumnAt=function(t){let e=this.getColumnCount();if(t<0||t>=e)return null;let n=-1;this._colVirtualizer.isVirtualizable()&&(n=this._colVirtualizer.getLastIndexInView());let i=this._layoutX.removeLaneAt(t),o=this._settings.length;for(let e=0;e<o;++e)this._settings[e].getSection().removeColumnAt(t);let r=this._pinnedLeftColumnCount,s=this._pinnedRightColumnCount,l=this._columnDefs.splice(t,1)[0];if(this._onColumnCountChanged(),(t<r||t>=e-s)&&this._updateScrollbarWidth(!0,!0),this._syncLayoutToColumns(t,e-1,!0),l||(l={}),l.layout=i,this._hasListener("columnRemoved")){let e={atTheMiddle:!0};e.colIndex=t,e.columns="deprecated",e.columnData=l.columnData,e.colId=l.id||"",this._dispatchColumnEvent("columnRemoved",e)}return t<=n&&n===this._colVirtualizer.getLastIndexInView()&&this._colVirtualizer.update(),l},Be.prototype.removeAllColumns=function(){this.getColumnCount()>0&&(this._pinnedLeftColumnCount=0,this._pinnedRightColumnCount=0,this.setColumnCount(0))},Be.prototype.getStationaryColumnIndex=function(){for(let t=this.getColumnCount()-1;t>=0;t--)if(this._getColumnDef(t).stationary)return t;return-1},Be.prototype.isColumnMoveAllowed=function(t,e){if(Array.isArray(t)||(t=[t]),0===t.length||null==e)return!1;let n=this.getStationaryColumnIndex();if(n>-1){if(e<=n)return!1;for(let e=0;e<t.length;e++)if(t[e]<=n)return!1}return!0},Be.prototype.isColumnMovable=function(t){let e=this.getStationaryColumnIndex();return!(e>-1&&t<=e)},Be.prototype.moveColumn=function(t,e){if("number"==typeof t)return this._moveColumn(t,e);if(!Array.isArray(t))return!1;let n,i=t.length,o=[],r=0,s=this.getColumnCount(),l={};for(n=0;n<i;++n)r=t[n],r>=0&&r<s&&null==l[r]&&(l[r]=1,o.push(r));if(e<0?e=0:e>=s&&(e=s-1),i=o.length,!i)return!1;if(1===i)return this._moveColumn(o[0],e);if(!this.isColumnMoveAllowed(o,e))return!1;if(o.sort(Ne),l[e]){let t=!0;for(r=o[0],n=1;n<i;++n)if(++r!==o[n]){t=!1;break}if(t)return!1}let a,u,h=this.freezeLayout(!0),p=0;for(n=0;n<i;++n)a=o[n],a>=e&&(u=e+p,this._moveColumn(a,u),++p);let d=i-p;for(u=p?e-1:e,n=0;n<d;++n)a=o[n]-n,this._moveColumn(a,u);return this.freezeLayout(h),!0},Be.prototype._moveColumn=function(t,e){let n=this.getColumnCount();if(t<0?t=0:t>=n&&(t=n-1),e<0?e=0:e>=n&&(e=n-1),t===e)return!1;if(!this.isColumnMoveAllowed(t,e))return!1;let i=-1;this._colVirtualizer.isVirtualizable()&&(i=this._colVirtualizer.getLastIndexInView());let o=this.getColumnId(t);this._layoutX.moveLane(t,e);let r=this._settings.length;for(let n=0;n<r;++n)this._settings[n].getSection().moveColumn(t,e);let s=this._columnDefs[t],l=this._countPinnedLeftColumns(),a=this._countPinnedRightColumns();if(ut.moveArrayItem(this._columnDefs,t,e),this._hScrollbarEnabled&&(t<l?e>=n-a?this.freezeColumn(l-2,a+1):e>=l&&this.freezeColumn(l-2,a):s.rightPinned?e<l?this.freezeColumn(l,a-1):e<n-a&&this.freezeColumn(l-1,a-1):e<l?this.freezeColumn(l,a):e>=n-a&&this.freezeColumn(l-1,a+1)),!this._frozenLayout&&this._colVirtualizer.isEnabled()){let n=this._colVirtualizer.getFirstIndexInView();t<n&&e<n||t>i&&e>i||this._activateColumns(n,i,n,i)}if(this._hasListener("columnMoved")){let n={};n.fromColIndex=t,n.toColIndex=e,n.colId=o,this._dispatchColumnEvent("columnMoved",n)}return i===this._colVirtualizer.getLastIndexInView()&&(t<=i&&e>i||e<=i&&t>i)&&this._colVirtualizer.update(),this.updateColumnBounds(),this._updateColumnSeparators(),!0},Be.prototype.moveColumnById=function(t,e){let n=this.getColumnCount(),i=this.getColumnIndex(t);if(i<0||i>=n)return!1;let o=null!=e?this.getColumnIndex(e):-1;return o<0&&(o=n),this._moveColumnByIndex(i,o)},Be.prototype._moveColumnByIndex=function(t,e){return t<e&&--e,t!==e&&this.moveColumn(t,e)},Be.prototype.reorderColumns=function(t,e){let n="";"number"==typeof e?n=this.getColumnId(e):e&&(n=e),this.startBatch("move");let i=0;if(Array.isArray(t)){let e=t.length;if(e>1){let o,r,s,l,a=this.getColumnIds(),u=a.length,h=[],p=!1;for(o=0;o<e;++o){let e=t[o];"number"==typeof e?(s=e,r=a[e]||""):(r=e,s=a.indexOf(r)),r&&s>=0&&(h.push(r),n===r&&(p=!0))}if(e=h.length,p){if(l=this.getColumnIndex(n),l>=0)for(;++l<u&&(n=a[l],!(h.indexOf(n)<0)););(l<0||l>=u)&&(n="")}for(o=e;--o>=0;)r=h[o],s=this.getColumnIndex(r),l=this.getColumnIndex(n),l<0&&(l=u),i|=this._moveColumnByIndex(s,l),n=r}else i=this.moveColumnById(t[0],n)}else null!=t&&(i=this.moveColumnById(t,n));return this.stopBatch("move"),!!i},Be.prototype.getColumnLayout=function(){return this._layoutX},Be.prototype.updateColumnLayout=function(){this._syncLayoutToColumns(0,this.getColumnCount())},Be.prototype._deserializeColumn=function(t,e){if(!e)return;let n,i=e.layout||e,o=e.width;null!=o&&(i.size=o),o=e.scalable,null!=o&&(i.scalable=o),o=e.minWidth,null!=o&&(i.minSize=o),null==i.scalable&&(i.scalable=null==i.size),this._layoutX.deserializeLane(t,i);let r=e.styles;for(n in r)this.setColumnStyle(t,n,r[n]);let s=e.classes;for(n in s)this.enableColumnClass(t,n,s[n]);let l=this._getColumnDef(t),a=e.id;a&&"string"==typeof a&&(l.id=a,l.userId=a);let u=e.field;u&&"string"==typeof u&&(l.field=u);let h=e.dataColumnName;null!=h&&(l.dataColumnName=h),h=e.stationary,null!=h&&(l.stationary=!!h),h=e.leftPinned,null!=h&&(l.leftPinned=!!h),h=e.rightPinned,null!=h&&(l.rightPinned=!!h),h=e.backgroundColor,null!=h&&this.setColumnBackgroundColor(t,h),this.setColumnRenderingHandler(t,e.renderingHandler),this.setColumnDataBindingHandler(t,e.dataBindingHandler),h=e.columnData,h&&this.setColumnData(t,h);let p=e.binding||e.formatter;if(Array.isArray(p)&&(p=p[0]),p&&"function"!=typeof p){let t=p.init;"function"==typeof t&&t(e,this)}},Be.prototype.addRow=function(t){if(null==t)t=1;else if(t<=0)return;this.getColumnCount()<=0&&this.setColumnCount(1);let e=this.getLastSection();null==e&&(e=this.addSection()),e.addRow(t)},Be.prototype.removeRow=function(t){let e=this.getLastSection();null!=e&&(null==t&&(t=1),e.removeRow(t))},Be.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},Be.prototype.setSectionRowCount=function(t,e){let n=this.getSection(t);null!=n&&n.setRowCount(e)},Be.prototype.getRowIndex=function(t,e){return this._sectionStarts[t]+e},Be.prototype.getRelativeIndex=ut._deprecatedFunction,Be.prototype.removeAllRows=function(){let t=this._settings.length;for(let e=0;e<t;++e)this._settings[e].getSection().setRowCount(0),this._sectionStarts[e]=0;this._sectionStarts[t]=0},Be.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},Be.prototype.setDefaultRowHeight=function(t,e){if(this._layoutY.setDefaultLaneSize(t)){this._rowHeightSync=!1;let t=this._layoutY.getDefaultLaneSize();this._rowHeightException=e?"":"title";let n=this._settings.length;for(let e=0;e<n;++e){let n=this._settings[e];n.getType()!==this._rowHeightException&&"bottomPadding"!==n.getId()&&n.getSection().setDefaultRowHeight(t)}this._syncRowHeights(),this._rowHeightSync=!0,this.setRowScrollingStep(this._rowScrollingStep),this._updateColumnSeparators()}},Be.prototype.getDataSource=function(){return this._dataSource},Be.prototype.setDataConflationRate=function(t){this._dataSource.setConflationRate(t)},Be.prototype.getDataConflationRate=function(){return this._dataSource.getConflationRate()},Be.prototype.setDataSource=function(t){t&&t instanceof wt&&(t=new xe(t));let e={};if(e.prevDataSource=this._dataSource,this._dataSource=t||null,e.dataSource=this._dataSource,this._dispatch("dataSourceChanged",e),this._autoSetDataSource){let e=this._settings.length;for(let n=0;n<e;++n)this._settings[n].setDataSource(t)}return this._dispatch("postDataSourceChanged",e),this._dataSource},Be.prototype.setColumnTemplate=ut._deprecatedFunction,Be.prototype.getColumnTemplate=ut._deprecatedFunction,Be.prototype.getColumnRenderEvent=ut._deprecatedFunction,Be.prototype.getColumnDataBindingEvent=function(t){console.log("getColumnDataBindingEvent() is deprecated. Use setColumnDataBindingHandler() instead");let e=this;return{listen:function(n){e.setColumnDataBindingHandler(t,n)},unlisten:function(){e.setColumnDataBindingHandler(t,null)}}},Be.prototype.setColumnStyle=function(t,e,n,i){if(!e)return;let o;ut.isNumber(t)||(t=0,console.log("WARNING: the first parameter for setColumnStyle must be column index")),null==i?o=this._getNestedColumnDef(t,"styles"):(i=this._toSectionType(i),o=this._getNestedColumnDef(t,i,"styles")),o[e]=n;for(let o=this._settings.length;--o>=0;){let r=this._settings[o];null!=i&&i!==r.getType()||r.getSection().setColumnStyle(t,e,n)}},Be.prototype.getColumnBackgroundColor=function(t){return this._getColumnDef(t).backgroundColor||""},Be.prototype.setColumnBackgroundColor=function(t,e){if(null==t||"number"!=typeof t)return;let n=this._getColumnDef(t);if(n.backgroundColor===e)return;n.backgroundColor=e,e=null!=e?e:"";let i=this._settings.length;for(let n=0;n<i;++n){let i=this._settings[n],o=i.getSection();o&&("content"!==i.getType()?this._applyCellsBackgroundColor(o,t,e):o.getColumn(t).setStyle("backgroundColor",e))}},Be.prototype._applyCellsBackgroundColor=function(t,e,n){let i=t.getRowCount();for(let o=0;o<i;o++){if(t.getCellColSpan(e,o)>1)continue;let i=t.getCell(e,o);i&&i.setStyle("backgroundColor",n)}},Be.prototype.applyColumnsBackgroundColor=function(t){if(!t)return;let e=t.getColumnCount();for(let n=0;n<e;n++){let e=this._getColumnDef(n).backgroundColor||"";this._applyCellsBackgroundColor(t,n,e)}},Be.prototype.enableColumnClass=function(t,e,n,i){let o;"number"!=typeof t&&(t=0),null==i?o=this._getNestedColumnDef(t,"classes"):(i=this._toSectionType(i),o=this._getNestedColumnDef(t,i,"classes"));let r=!1;if((n=!1!==n)?o[e]||(r=o[e]=!0):o[e]&&(delete o[e],r=!0),r)for(let o=this._settings.length;--o>=0;){let r=this._settings[o];null!=i&&i!==r.getType()||r.getSection().enableColumnClass(t,e,n)}return r},Be.prototype.hasColumnClass=function(t,e,n){let i;return null==n?i=this._getNestedColumnDef(t,"classes"):(n=this._toSectionType(n),i=this._getNestedColumnDef(t,n,"classes")),!(!i||!i[e])},Be.prototype.setColumnAlignment=function(t,e){let n=e?e.charAt(0).toLowerCase():"",i=0;i|=this.enableColumnClass(t,"tr-align-left","l"===n),i|=this.enableColumnClass(t,"tr-align-right","r"===n),i|=this.enableColumnClass(t,"tr-align-center","c"===n),i&&this._dispatch("columnAlignmentChanged",{colIndex:t,alignment:n})},Be.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"},Be.prototype.getColumnLeft=function(t){let e=this._columnDefs[t];if(e&&e.rightPinned){let e=this.getElement().clientWidth,n=this._layoutX.getTrackSize(),i=n<e?n:e;for(let e=this.getColumnCount()-1;e>=t;--e)i-=this._layoutX.getLaneSize(e);return i}return this._hScrollbarEnabled&&t>=this._pinnedLeftColumnCount?this._layoutX.getLaneStart(t)-this._hscrollbar.getScrollLeft():this._layoutX.getLaneStart(t)},Be.prototype.getColumnRight=function(t){return this.getColumnLeft(t)+this._layoutX.getLaneSize(t)},Be.prototype.getColumnWidth=function(t){return this._layoutX.getLaneSize(t)},Be.prototype.getColumnCustomLaneSize=function(t){return this._layoutX.getCustomLaneSize(t)},Be.prototype._calculateColumnWidths=function(t,e){if(!this._preserveGridSize)return e;let n,i=0,o={},r=t.length,s=new Array(r);for(n=0;n<r;n++)o[t[n]]=!0,s[n]=e[n],i+=e[n];let l=0,a=0,u=this.getColumnCount(),h=this._layoutX;for(n=0;n<u;n++)o[n]||h.isLaneVisible(n)&&(h.getLaneScalability(n)?(l+=h.getMinimumLaneSize(n),a++):l+=h.getLaneSize(n));let p=this.getContentWidth(),d=i+l-p;if(a<1||d>0){for(h.resetLaneToDefaultSize(),h.setTrackSize(p-this._reservedSpace),l=0,n=0;n<u;n++)o[n]||h.isLaneVisible(n)&&(h.getLaneScalability(n)?l+=h.getMinimumLaneSize(n):l+=h.getLaneSize(n));if(d=i+l-p,d>0)for(d/=r,n=0;n<r;n++)s[n]-=d}return s},Be.prototype.setColumnWidth=function(t,e,n){let i=this._calculateColumnWidths([t],[e]),o=this._setColumnWidth(t,i[0],n);return o&&this._syncLayoutToColumns(t,t+1),o},Be.prototype.setColumnWidths=function(t,e){let n,i=0,o=[],r=[],s=[];for(n=t.length;--n>=0;){let i=t[n];null!=i&&(o.push(n),r.push(i));let l=Array.isArray(e)?e[n]:e;s.push(l)}let l=this._calculateColumnWidths(o,r);for(n=0;n<l.length;n++)i|=this._setColumnWidth(o[n],l[n],s[n]);return i&&this._syncLayoutToColumns(0,t.length),!!i},Be.prototype.isColumnVisible=function(t){return this._layoutX.isLaneVisible(t)},Be.prototype.hideColumn=function(t,e){let n=!1===e;this.setColumnVisibility(t,n,0)},Be.prototype.hideColumns=function(t,e){let n=Array.isArray(t)?t.length:0,i=[],o=this.getColumnCount();e=!1!==e;for(let r=0;r<n;++r){let n=t[r];n>=0&&n<o&&this._layoutX.hideLane(n,e,0)&&i.push(n)}if(i.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){let t={};t.colIndices=i,t.hidden=e,this._dispatch("columnVisibilityChanged",t)}},Be.prototype.showAllColumns=function(){let t=[],e=this.getColumnCount();for(let n=0;n<e;++n)this._layoutX.hideLane(n,!1,0)&&t.push(n);if(t.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){let e={};e.colIndices=t,e.hidden=!1,this._dispatch("columnVisibilityChanged",e)}},Be.prototype.getMinimumColumnWidth=function(t){return this._layoutX.getMinimumLaneSize(t)},Be.prototype.setMinimumColumnWidth=function(t,e){this._layoutX.setMinimumLaneSize(t,e)&&this._syncLayoutToColumns(t,t+1)},Be.prototype.setMinimumColumnWidths=function(t,e){let n=0,i=NaN,o=NaN;for(let r=t.length;--r>=0;){let s=t[r];null!=s&&(o||(o=r),i=r,n|=this._layoutX.setMinimumLaneSize(r,s,e))}return n&&this._syncLayoutToColumns(i,o+1),!!n},Be.prototype.getColumnScalability=function(t){return this._layoutX.getLaneScalability(t)},Be.prototype.setColumnScalability=function(t,e){let n=!1;return ut.isNumber(t)?(e=!1!==e,n=this._layoutX.setLaneScalability(t,e),n&&this._syncLayoutToColumns(t,t+1)):this.setDefaultColumnScalable(t),n},Be.prototype.setDefaultColumnScalable=function(t){this._layoutX.setDefaultScalability(!!t)},Be.prototype.resetColumnWidths=function(){let t=this._layoutX.resetLaneToDefaultSize();return t&&this._syncLayoutToColumns(0,this.getColumnCount()),t},Be.prototype.setColumnDefaultWidth=function(t,e){this._layoutX.setLaneDefaultSize(t,e)},Be.prototype.preserveProportion=function(t){this._preserveProportion=!0===t},Be.prototype.isProportionPreserved=function(){return this._preserveProportion},Be.prototype.preserveGridSize=function(t){this._preserveGridSize=!0===t},Be.prototype.getColumnData=function(t){return this._getColumnDef(t).columnData},Be.prototype.setColumnData=function(t,e){return this._getColumnDef(t).columnData=e||{},e},Be.prototype.newColumnData=Be.prototype.getColumnData,Be.prototype.setAlwaysRenderColumn=function(t,e){this.getColumnData(t).alwaysRender=!1!==e},Be.prototype._isAlwaysRenderColumn=function(t){return!0===this.getColumnData(t).alwaysRender},Be.prototype.getFitContentWidth=function(){return this._fitContentWidth},Be.prototype.setFitContentWidth=function(t){this._fitContentWidth!==t&&(this._fitContentWidth=t,this.enableClass("fit-width",this._fitContentWidth))},Be.prototype.loadPlugin=function(t,e){let n=null;if("string"==typeof t){let e=window.tr,i=e?e.grid:null;if(!i)return null;if(i[t])n=new i[t];else{if(!i[t+"Plugin"])return null;n=new i[t+"Plugin"]}}else n=t;if(!n||!n.getName)return null;let i=n.getName();if(!i)return null;let o=this._plugins[i];if(o){if(o===n)return o;console.log("WARNING: Two of the same "+i+"s cannot be loaded on a single grid. The existing plugin is replaced."),this.unloadPlugin(i)}return n.initialize&&n.initialize(this,e),this._plugins[i]=n,n},Be.prototype.unloadPlugin=function(t){let e;if(t){let n="";"string"==typeof t?n=t:t.getName&&(n=t.getName()),e=this._plugins[n],e||(n+="Plugin",e=this._plugins[n]),e&&(e.unload&&e.unload(this),delete this._plugins[n])}return e||null},Be.prototype.getPlugin=function(t){let e=this._plugins[t];return e||(e=this._plugins[t+"Plugin"]),e||null},Be.prototype.getPlugins=function(){let t=[];for(let e in this._plugins)t.push(this._plugins[e]);return t},Be.prototype.getPluginList=function(){let t=[];for(let e in this._plugins)t.push(e);return t},Be.prototype.freezeSection=function(t){this._fixFrozenTopSections=!0,this._freezeTopSectionAt(t)},Be.prototype.resetSectionFreezing=function(){this._fixFrozenTopSections=!1,this._updateFrozenTopSections()},Be.prototype._freezeTopSectionAt=function(t){if("number"==typeof t){let e=t+1;if(e===this._startVScrollbarIndex)return;this._startVScrollbarIndex=e}else this._startVScrollbarIndex=-1,"string"==typeof t&&(this._tempFrozenSectionRef=t);this._onSectionCountChanged()},Be.prototype.freezeFooter=function(t){this._fixFrozenBottomSection=!0,this._frozenFooterCount!==t&&(this._setFrozenFooter(t),this._onSectionCountChanged())},Be.prototype._setFrozenFooter=function(t){this._frozenFooterCount!==t&&(this._frozenFooterCount=t,this._vscrollbar.setFooterCount(t),this._hscrollbar.setFooterCount(t))},Be.prototype.getFooterCount=function(){return this._frozenFooterCount},Be.prototype.freezeColumn=function(t,e){let n,i,o=this.getColumnCount(),r=0,s=0,l=!1;if(t||0===t)for(this._hScrollbarEnabled=!0,r=t>=0?t+1:0,this._pinnedLeftColumnCount!==r&&(l=!0,this._pinnedLeftColumnCount=r),n=0;n<o;++n)i=this._getColumnDef(n),i.leftPinned=--r>=0;else this._hScrollbarEnabled=!1;if(null!=e)for(s=e>0?e:0,this._pinnedRightColumnCount!==s&&(l=!0,this._pinnedRightColumnCount=s),n=o;--n>=0;)i=this._getColumnDef(n),i.rightPinned=--s>=0;this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),this._updateColumnSeparators(),l&&(this._isEventDispatching("pinningChanged")||this._dispatch("pinningChanged",{}))},Be.prototype._countPinnedLeftColumns=function(){let t=0;if(this._hScrollbarEnabled)for(let e=this._columnDefs.length;--e>=0;){let n=this._columnDefs[e];if(n&&n.leftPinned){t=e+1;break}}return this._pinnedLeftColumnCount=t,t},Be.prototype._countPinnedRightColumns=function(){let t=0;if(this._hScrollbarEnabled){let e,n=this._columnDefs.length;for(e=0;e<n;++e){let t=this._columnDefs[e];if(t&&t.rightPinned)break}t=n-e}return this._pinnedRightColumnCount=t,t},Be.prototype.isPinnedColumn=function(t){return t<this.getFrozenColumnCount()||t>=this.getFirstPinnedRightIndex()},Be.prototype.getFrozenColumnCount=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:0},Be.prototype.getPinnedLeftColumnCount=Be.prototype.getFrozenColumnCount,Be.prototype.getPinnedRightColumnCount=function(){return this._pinnedRightColumnCount},Be.prototype.getFirstPinnedRightIndex=function(){return this.getColumnCount()-this._pinnedRightColumnCount},Be.prototype.updateLayout=function(){this._disposed||this._layoutUpdating||(this._layoutUpdating=!0,this._dispatch("preForcedUpdate",{}),this._updateLayout(),this._colVirtualizer.isEnabled()&&this._activateColumns(),this._layoutUpdating=!1)},Be.prototype.updateScrollbars=function(t,e){e&&this._updateScrollbarWidth(!0,!1),t&&this._updateScrollbarHeight(!0,!1)},Be.prototype.freezeLayout=function(t){t=!1!==t;let e=this._frozenLayout;if(e!==t){this._frozenLayout=t;let e,n,i=this.getPlugin("SortableTitlePlugin");this._frozenLayout&&i&&i.freezeIndicator(!0),this._frozenLayout||(this._disableEvent("widthChanged"),this._onSectionCountChanged(),this._onColumnCountChanged(),this._colVirtualizer.isEnabled()&&this._activateColumns()),this._rowHeightSync=!1;let o=this._settings.length;for(e=0;e<o;e++)n=this._settings[e].getSection(),n.setFrozenLayout(this._frozenLayout);this._frozenLayout||(this._syncLayoutToColumns(0,this.getColumnCount()),this._disableEvent("widthChanged",!1),this._dispatch("widthChanged",{}),this._syncRowHeights()||this._rowVirtualizer.update(!0),i&&i.freezeIndicator(!1)),this._rowHeightSync=!0}return e},Be.prototype.unfreezeLayout=function(t){this.freezeLayout(!1===t)},Be.prototype.isLayoutFrozen=function(){return this._frozenLayout},Be.prototype.showBorders=ut._deprecatedFunction,Be.prototype.hideBorders=ut._deprecatedFunction,Be.prototype.toggleBorders=function(t){this.toggleClass("no-borders",null!=t?!t:null)},Be.prototype.toggleGridlines=function(t){this.toggleClass("no-gridlines",null!=t?!t:null)},Be.prototype.toggleVerticalLines=function(t){this.toggleClass("no-vertical-grid-line",null!=t?!t:null)},Be.prototype.toggleHorizontalLines=function(t){this.toggleClass("no-horizontal-grid-line",null!=t?!t:null)},Be.prototype.toggleContentVerticalLines=function(t){this.toggleClass("no-content-vertical-line",null!=t?!t:null)},Be.prototype.getDataColumnMap=function(){let t=[];for(let e=this.getColumnCount();--e>=0;)t[e]=this.getDataColumnName(e);return t},Be.prototype.setDataColumnMap=function(t){let e,n;if(t)for(e=t.length;--e>=0;)n=this._getColumnDef(e),n.dataColumnName=t[e];else for(e=this._columnDefs.length;--e>=0;)n=this._columnDefs[e],n&&null!=n.dataColumnName&&(n.dataColumnName=null)},Be.prototype.getDataColumnName=function(t){return this._getColumnDef(t).dataColumnName||""},Be.prototype.setDataColumnName=function(t,e){this._getColumnDef(t).dataColumnName=e},Be.prototype.setDefaultRenderingHandler=function(t){this._renderingHandler="function"==typeof t?t:null},Be.prototype.setDefaultDataBindingHandler=function(t){this._dataBindingHandler="function"==typeof t?t:null},Be.prototype.setColumnRenderingHandler=function(t,e){this._getColumnDef(t).renderingHandler="function"==typeof e?e:null},Be.prototype.setColumnDataBindingHandler=function(t,e){this._getColumnDef(t).dataBindingHandler="function"==typeof e?e:null},Be.prototype.getColumnRenderingHandler=function(t){return this._getColumnDef(t).renderingHandler||null},Be.prototype.getColumnDataBindingHandler=function(t){return this._getColumnDef(t).dataBindingHandler||null},Be.prototype.enableRowHighlighting=function(t){if(null==t&&(t=!0),this._rowHighlighting!==t){this._rowHighlighting=t;let e=this.getAllSections("content");for(let t=e.length;--t>=0;)e[t].enableRowHighlighting(this._rowHighlighting)}},Be.prototype._getTarget=function(t){let e=t.target;if(e){let n=null;return this._element.contains(e)||(n=t.composedPath?t.composedPath():t.path),n?n[0]||null:e}return t.getElement?t.getElement():ut.isElement(t)?t:null},Be.prototype.getRelativePosition=function(t,e){if(!t)return{};let n=e||{},i=this._getTarget(t);t.target?ut.getRelativePosition(t,this.getElement(),n):i&&ut.getRelativePosition(i,this.getElement(),n),1!==this._zoomFactor&&(n.x/=this._zoomFactor,n.y/=this._zoomFactor),n.hit=!1,n.grid=this,n.clientX=t.clientX,n.clientY=t.clientY,n.zoomFactor=this._zoomFactor;let o=ut.closestElement(i,"cell");if(!o)return n;n.cellElement=o;let r=ut.closestElement(o,"column");n.columnElement=r;let s=null;if(s=r?ut.closestElement(r,"tr-lg"):ut.closestElement(o,"tr-lg"),!s)return n;n.sectionName=s.id||ut.closestElement(s,"tr-vlg").id;let l=this.getSectionSettings(n.sectionName);if(!l)return n;l.extendEventArg(n);let a=l.getSection(),u=a.getColumnIndex(r||o);return u<0||(n.colIndex=u,!1===this._hitTestY(-1,n)||(o.stretched?n.cell=a.getStretchedCell(u,n.rowIndex):n.cell=a.getCell(u,n.rowIndex),n.hit=!0)),n},Be.prototype.getVScrollbar=function(){return this._vscrollbar},Be.prototype.getHScrollbar=function(){return this._hscrollbar},Be.prototype.autoHideScrollbars=function(t){t=null==t||t,this._vscrollbar.setAutoHide(t),this._hscrollbar.setAutoHide(t)},Be.prototype.getVScrollStartIndex=function(){return this._startVScrollbarIndex},Be.prototype.getHScrollStartIndex=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:-1},Be.prototype.scrollToColumn=function(t,e){if(!this._updateScrollbar(this._hscrollbar))return!1;let n=this._layoutX.getLaneCount();if(t<=0?t=0:t>=n&&(t=n-1),this.isPinnedColumn(t))return!1;let i=this._hScrollbarEnabled?this._layoutX.getLaneStart(this._pinnedLeftColumnCount):0,o=this._hscrollbar.getScrollLeft(),r=o+i,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){let t=a-i;if(o!==t)return this._hscrollbar.setScrollLeft(t),!0}else{let e=r+s;if(t>=this._layoutX.hitTest(e-.1)){let t=o+(a+u)-e;return this._hscrollbar.setScrollLeft(t),!0}}return!1},Be.prototype.getScrollLeft=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getScrollLeft():0},Be.prototype.setScrollLeft=function(t){this._updateScrollbar(this._hscrollbar)&&this._hscrollbar.setScrollLeft(t)},Be.prototype.scrollRight=function(t){this.setScrollLeft(this._hscrollbar.getScrollLeft()+t)},Be.prototype.getScrollWidth=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getContentWidth():0},Be.prototype.getYScrollVal=function(t,e,n){if(!this._updateScrollbar(this._vscrollbar))return null;let i=null;t&&(i=this.getSection(t));let o=i?i.getRowOffset():this._sectionStarts[this._startVScrollbarIndex],r=this._layoutY.getLaneStart(this._startVScrollbarIndex),s=this._layoutY.getLaneCount();if(e<=0?e=0:e>=s&&(e=s-1),n)return this._layoutY.getLaneStart(e+o)-r;let l=this.getVerticalViewInfo();if(e<l.firstFullRow){let t=e-2;return t<0&&(t=0),this._layoutY.getLaneStart(t+o)-r}return e>l.lastFullRow?this._layoutY.getLaneStart(e+o+2+1)-l.viewHeight-r:null},Be.prototype.scrollToRow=function(t,e,n){let i=this.getYScrollVal(t,e,n);null!==i&&this._vscrollbar.setScrollTop(i)},Be.prototype.getVerticalViewInfo=function(){let t=this._sectionStarts[this._startVScrollbarIndex],e=this._layoutY.getLaneStart(t),n=this._vscrollbar.getHeight(),i=this._vscrollbar.getScrollTop()+e,o=i+n,r=this._layoutY.hitTest(i)-t,s=this._layoutY.hitTest(o-.1);return s<0&&(s=this._layoutY.getLaneCount()-1),s-=t,{topRowIndex:r,firstFullRow:this._layoutY.getLaneStart(r+t)<i?r+1:r,lastFullRow:this._layoutY.getLaneEnd(s+t)>o?s-1:s,bottomRowIndex:s,viewHeight:n,viewTop:i,viewBottom:o}},Be.prototype.getVScrollView=function(){if(!this._updateScrollbar(this._vscrollbar))return null;let t=this._layoutY.getLaneCount();if(0===t)return null;let e=this._sectionStarts[this._startVScrollbarIndex],n=this._layoutY.getLaneStart(e),i=this._vscrollbar.getScrollTop()+n,o=this._vscrollbar.getHeight(),r=i+o,s=this._layoutY.hitTest(i),l=this._layoutY.hitTest(r-.1),a=this._layoutY.getLaneStart(s+e),u=this._layoutY.getLaneEnd(l+e),h=i-o,p=h<=n?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;let _={};return _.viewTop=i-n,_.viewBottom=r-n,_.topRowIndex=s,_.bottomRowIndex=l,_.firstFullRow=a<i?s+1:s,_.lastFullRow=u>r?l-1:l,_.prevPageRowIndex=p-e,_.nextPageRowIndex=c-e,_},Be.prototype.getScrollTop=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getScrollTop():0},Be.prototype.setScrollTop=function(t){this._updateScrollbar(this._vscrollbar)&&this._vscrollbar.setScrollTop(t)},Be.prototype.scrollDown=function(t){this.setScrollTop(this._vscrollbar.getScrollTop()+t)},Be.prototype.getScrollHeight=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getContentHeight():0},Be.prototype.restoreScrollbars=function(){this._vscrollbar.restoreTrackPosition()},Be.prototype.enableAutoSetDataSource=function(t){this._autoSetDataSource=t},Be.prototype.getRowVirtualizer=function(){return this._rowVirtualizer},Be.prototype.getColumnVirtualizer=function(){return this._colVirtualizer},Be.prototype.enableRowVirtualization=function(t){this._rowVirtualizer.enable(t),this._rowVirtualizer.isEnabled()&&this._vscrollbar.isEnabled()?this._rowVirtualizer.activate():this._rowVirtualizer.deactivate()},Be.prototype.isRowVirtualizationEnabled=function(){return this._rowVirtualizer.isEnabled()},Be.prototype.enableColumnVirtualization=function(t){this._colVirtualizer.enable(t);let e=this._colVirtualizer.isEnabled();for(let t=this._settings.length;--t>=0;)this._settings[t].enableColumnVirtualization(e)},Be.prototype.isColumnVirtualizationEnabled=function(){return this._colVirtualizer.isEnabled()},Be.prototype.setRowScrollingStep=function(t){this._rowScrollingStep=t>0?t:0,this._vscrollbar.setScrollingStep(this._layoutY.getDefaultLaneSize()*this._rowScrollingStep)},Be.prototype.getVMouseWheelHandler=function(){return this._vscrollbar.getDefaultMouseWheelLogic()},Be.prototype.synchronizeVScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);let 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)},Be.prototype.synchronizeHScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);let 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)},Be.prototype.updateRowData=function(t,e,n,i){let o=this.getSectionSettings(t||"content");o&&o.updateRowData(e,n,i)},Be.prototype.rerender=function(){let t=this._settings.length;for(let e=0;e<t;e++)this._settings[e].rerender()},Be.prototype.requestRowRefresh=function(){this._rowRefreshTimer||(this._rowRefreshTimer=setTimeout(this._onRowRefresh,100))},Be.prototype._requestScrollbarUpdate=function(){this._updateScrollbarHeight(!0,!0),this._rowHeightTimerId=0},Be.prototype.deactivateRendering=function(t){if((t=!1!==t)==this._noBinding)return;this._noBinding=t;let e=this.getSectionSettings("content");e&&(e.disableDataBinding(t),t||this.requestRowRefresh())},Be.prototype._onRowRefresh=function(){this._rowRefreshTimer=0,this.updateRowData()},Be.prototype.disableLazyRendering=function(t){console.log("WARNING: This function is deprecated.")},Be.prototype.getData=function(t,e,n){let i=this.getSectionSettings(t);if(!i)return null;let o=this._toDataColumnName(e);return i.getData(o,n)},Be.prototype.setData=function(t,e,n,i){let o=this.getSectionSettings(t);if(o&&o.isDataBindable()){let t=this._toDataColumnName(e);return o.setData(t,n,i)}return!1},Be.prototype.removeRowData=function(t,e){let n=this.getSectionSettings(t);return!(!n||!n.isDataBindable())&&n.removeRowData(e)},Be.prototype.setHidingMethod=function(t){if(t||(t=""),this._hidingMethod!==t){this._hidingMethod=t;let e=this.getAllSections();for(let n=e.length;--n>=0;)e[n].setHidingMethod(t)}},Be.prototype.getHorizontalLayout=function(){return this._layoutX},Be.prototype.setColumnVisibility=function(t,e,n){if(this._layoutX.hideLane(t,!e,n)){if(this._syncLayoutToColumns(t,t+1),e&&this.requestRowRefresh(),this._hasListener("columnVisibilityChanged")){let n={};n.colIndex=t,n.hidden=!e,this._dispatch("columnVisibilityChanged",n)}return!0}return!1},Be.prototype.getColumnVisibility=function(t,e){return this._layoutX.getLaneVisibilityBit(t,e)},Be.prototype.reserveRightSpace=function(t){if(this._reservedSpace!==t){this._reservedSpace=t;for(let e=this._settings.length;--e>=0;)this._settings[e].getSection().reserveRightSpace(t);return this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),!0}return!1},Be.prototype.getHiddenInput=function(t){return t?this._firstHiddenInput:this._lastHiddenInput},Be.prototype.focus=function(){let t=this._lastHiddenInput,e=He(t);if(t&&t!==e){let e=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&&e===window.pageXOffset||window.scrollTo(e,n)}},Be.prototype.isBinding=function(){return this._dispatchingDataChanged},Be.prototype.hideRow=function(t,e){this._dataSource.hideRow(t,e)},Be.prototype.hideRows=function(t,e){Array.isArray(t)?this._dataSource.hideRows(t,e):this._dataSource.hideRow(t,e)},Be.prototype.showRows=function(t,e){Array.isArray(t)?this._dataSource.showRows(t,e):this._dataSource.showRows([t],e)},Be.prototype.unhideAllRows=function(){this._dataSource.unhideAllRows()},Be.prototype.hasHiddenRow=function(){return this._dataSource.hasHiddenRow()},Be.prototype.initSimpleTable=function(t){let e=0;if(t||this.getColumnCount()||(t=["Default"]),t){e=t.length,this.setColumnCount(e),this.setDataColumnMap(t);for(let n=0;n<e;++n)this.setColumnField(n,t[n])}let n=this.addSection("title");if(n.addRow(1),!this._renderingHandler)for(let i=0;i<e;++i)n.setCellContent(i,0,t[i]);this.addSection("content");let i=this.getSectionSettings("title");i.disableDataBinding();let o=this.getSectionSettings("content");o.setAutoSyncRowCount(!0),o.setParent(i),this._dataBindingHandler||this.setDefaultDataBindingHandler(Be._defaultDataBinding)},Be._defaultDataBinding=function(t){t.cell.setContent(t.dataValue)},Be.prototype.selectColumn=function(t,e){for(let n=this._settings.length;--n>=0;)this._settings[n].getSection().selectColumn(t,e);this.updateColumnBounds()},Be.prototype.isSelectedColumn=function(t){let e=this._settings[0]||null;return!!e&&e.getSection().isSelectedColumn(t)},Be.prototype.updateColumnBounds=function(){if(this._columnBoundConflator.conflate())return;let t=this._settings.length;if(!t)return;let e,n=[],i=null,o=this.getColumnCount(),r=[];for(e=0;e<o;e++)this.isSelectedColumn(e)?(r.push(e),i||(i=[e,-1])):i&&(i[1]=e-1,n.push(i),i=null);i&&(i[1]=o-1,n.push(i),i=null);let s={selectedColumns:r,selectionRanges:n};this._dispatch("beforeColumnBoundUpdate",s);let l=n.length,a=[],u=[],h=this._settings[0],p=h.getSection();for(e=0;e<l;++e){i=n[e];let t=[0,0],o=[!1,!1];p.calculateColumnBounds(i[0],i[1],t,o),t[0]<t[1]&&(a.push(t),u.push(o))}let d=0,c=-1;for(null!=s.topBoundRowIndex&&(c=+s.topBoundRowIndex),c>=0&&"title"===h.getType()&&(d=this._layoutY.getLaneStart(c)),p.updateColumnBounds(a,u,d),e=1;e<t;e++)p=this._settings[e].getSection(),p.updateColumnBounds(a,u)},Be.prototype._updateColumnSeparators=function(){let t=this._settings.length;if(t)for(let e=0;e<t;e++){let t=this._settings[e].getSection();t&&t.updateColumnSeparators()}},Be.prototype.getColumnRect=function(t,e){let n=this.getElement().clientWidth,i=n,o=this._hscrollbar;o.isActive()&&(i=o.getTrackSize());let r=0,s=0;if(this._settings.length){let n=[0,0];this._settings[0].getSection().calculateColumnBounds(t,e,n,[]),r=n[0],s=n[1]-r}return{top:0,left:r,width:s,height:this._layoutY.getTrackSize(),leftPinnedIndex:this._pinnedLeftColumnCount-1,rightPinnedIndex:this.getFirstPinnedRightIndex(),scrollViewSize:i,gridWidth:n}},Be.prototype.getRowRect=function(t,e){let n=this._layoutX.getTrackSize(),i=this.getElement().clientWidth;n=n<i?n:i;let 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());let 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),d-=l,c-=l,{top:d,left:0,width:n,height:c-d,scrollViewSize:u,scrollViewTop:l,scrollViewBottom:p}},Be.prototype.normalizeConfig=function(t){t||(t={});let e,n,i=t.columns,o=i?i.length:0,r=t.columnFreezing;null==r&&(r=t.freezeColumn);let 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&&(n=i[e],n&&(n.rightPinned=!0));return null!=r&&(delete t.columnFreezing,delete t.freezeColumn,r>=0&&i&&(n=i[r],n&&(n.leftPinned=!0))),t},Be.prototype.setColumnGrouping=function(t){this._groupDefs=t||null},Be.prototype.getColumnGroupParentId=function(t){if(this._groupDefs){let e="number"==typeof t?this.getColumnId(t):t;return this._groupDefs.getParentId(e)}return""},Be.prototype.getColumnGroupChildIds=function(t){if(this._groupDefs){let e=this._groupDefs.getLeafDescendants(t);if(e&&e.length>0)return e}return null},Be.prototype.getValidColumnList=function(t,e){let n=[];if(!t)return n;e||(e=this.createColumnMap(t));let i=this.getColumnCount();for(let t=0;t<i;++t){let i=this._getColumnDef(t).id;null!=e[i]&&n.push({index:t,id:i})}return n},Be.prototype.createColumnMap=function(t){t||(t=this.getColumnIds());let e={},n=t.length;for(let i=0;i<n;i++){let n=t[i];"number"==typeof n&&(n=this.getColumnId(n)),n&&(e[n]=!0)}return e},Be.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)},Be.prototype.stopBatch=function(t){return!!t&&(this._dispatch("afterBatchOperation",{batches:this._batches,batchType:t}),"reset"===t&&this._disableEvent("columnVisibilityChanged",!1),delete this._batches[t],D(this._batches)&&(this._batches=null),!0)},Be.prototype._dispatchColumnEvent=function(t,e){let n=this._batches;n&&(e.batches=n),this._dispatch(t,e)},Be.prototype._dispatchColumnPositionChanged=function(){this._columnPositionConflator.conflate()||this._dispatch("columnPositionChanged",{sender:this})},Be.prototype._dispatchRowPositionChanged=function(){this._rowPositionConflator.conflate()||this._dispatch("rowPositionChanged",{sender:this})},Be.prototype._getAllSections=function(){let t=[],e=this._settings.length;for(let n=0;n<e;n++)t.push(this._settings[n].getSection());return t},Be.prototype._getNextSection=function(t,e,n){let i=this.getSectionIndex(e)+t;if(null==n)return this.getSectionSettings(i);n=this._toSectionType(n);let o=this._settings.length;for(;i>=0&&i<o;){let e=this._settings[i];if(n===e.getType())return e;i+=t}return null},Be.prototype._toSectionType=function(t){if(Be._sectionType[t])return t;if(ut.isString(t))switch(t.charAt(0).toLowerCase()){case"t":return"title";case"h":case"s":return"header";case"f":return"footer"}return"content"},Be.prototype._newSection=function(t,e){if(e)for(let t=this._settings.length;--t>=0;)if(this._settings[t].getId()===e)return null;t=this._toSectionType(t);let n={horizontalScrollbar:this._hscrollbar},i="content"===t?new ke(n):new we(n);i._setContext(this);let o=new Ee(i);o.setId(e),o.setType(t),o.listen("dataChanged",this._onSectionDataChanged),o.listen("rowAvailable",this._onRowAvailable);let r="content"===t&&this._rowHighlighting;return i.enableRowHighlighting(r),i.enableShading(!1),i.setHidingMethod(this._hidingMethod),o.enableColumnVirtualization(this._colVirtualizer.isEnabled()),i.setColumnCount(this._layoutX.getLaneCount()),i.reserveRightSpace(this._reservedSpace),this._syncLayoutToSectionColumns(i),this._syncStyleToSectionColumns(i,t),t!==this._rowHeightException&&i.setDefaultRowHeight(this._layoutY.getDefaultLaneSize()),i.listen("rowHighlighted",this._onRowHightlighted),i.listen("rowCountChanged",this._onRowCountChanged),i.listen("rowHeightChanged",this._onRowHeightChanged),o},Be.prototype._putToLast=function(t){if(0===this._settings.length)t.insertBefore(this._lastHiddenInput);else{let e=this.getLastSection().getElement().nextSibling;null!==e?t.insertBefore(e):t.insertBefore(this._lastHiddenInput)}},Be.prototype._syncStyleToSectionColumns=function(t,e){let n;for(let i=this._columnDefs.length;--i>=0;){let o=this._getColumnDef(i),r=o.styles;for(n in r)t.setColumnStyle(i,n,r[n]);let s=o.classes;for(n in s)t.enableColumnClass(i,n,!0);let l=o[e];if(l){for(n in r=l.styles,r)t.setColumnStyle(i,n,r[n]);for(n in s=l.classes,s)t.enableColumnClass(i,n,!0)}}},Be.prototype._syncRowHeights=function(){let t=this._settings.length;for(let e=0;e<t;++e)this._syncSectionRowHeights(this._settings[e].getSection());return!this._frozenLayout&&this._updateScrollbarHeight(!0,!0)},Be.prototype._syncSectionRowHeights=function(t){this._layoutY.copyFrom(t.getRowLayout(),this._sectionStarts[t.getIndex()])},Be.prototype._setColumnWidth=function(t,e,n){let i=!1,o=this._layoutX;if(null!=n)i=o.setLaneScalability(t,!!n);else{let n=o.getLaneScalability(t);if(this._preserveProportion){if(n){let n=this.getColumnCount(),i=0,r=0;for(let t=0;t<n;++t){if(!o.getLaneScalability(t))continue;let e=o.getLaneSize(t);i+=o.getCustomLaneSize(t),r+=e}(!(e=(e*i-e*o.getCustomLaneSize(t))/(r-e))||e<0)&&(e=i)}}else i=o.setLaneScalability(t,!1)}return i=o.setLaneSize(t,e)||i,i},Be.prototype._dispatchColumnAddedEvent=function(t,e,n,i){let o={};if(this._hasListener("columnAdded"))if(o.atTheMiddle=n,1===e)o.colIndex=t,o.context=i,this._dispatchColumnEvent("columnAdded",o);else{let n=Array.isArray(i)?i:[];for(let i=0;i<e;++i)o.colIndex=t+i,o.context=n[i],this._dispatchColumnEvent("columnAdded",o)}this._frozenLayout&&(o.noDataUpdate=!0),this._dispatchColumnRenderEvent(o,t,t+e,0,this._settings.length,NaN,NaN)},Be.prototype._dispatchColumnRenderEvent=function(t,e,n,i,o,r,s){if(!(i<o))return;let l;if(t.sender=this,t.fromColIndex=e,t.toColIndex=n,this._hasListener("preSectionRender"))for(l=i;l<o;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("preSectionRender",t);for(let a=e;a<n;++a){let e=this.getColumnRenderingHandler(a)||this._renderingHandler;if(e)for(t.colIndex=a,t.dataColumnName=this.getDataColumnName(a),l=i;l<o;++l){let n=this._settings[l];n.extendRenderEventArg(t,r,s);let i=n.getSection(),o=t.fromRowIndex,u=t.toRowIndex;for(let n=o;n<u;++n)t.rowIndex=n,t.cell=i.getCell(a,n,!1),e(t)}}if(this._hasListener("postSectionRender"))for(l=i;l<o;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("postSectionRender",t);if(!t.noDataUpdate&&!this._noBinding)for(l=i;l<o;++l)this.updateRowData(this._settings[l],r,s-1)},Be.prototype._dispatchRowExpansionBinding=function(t){if(!this._hasListener("rowExpansionBinding"))return;let e=t.dataSource;if(!e||!e.getDataSource())return;let n=t.fromRowIndex,i=t.toRowIndex,o=e.getVisibleRowIds(!0),r=t.section;t.rowData=null,t.cell=null;let s=!1;for(let l=i-1;l>=n;--l){let n=e.getRowId(l);if(!s){let t=e.getRowExpansionCount(n);if(t>0){l=l+t+1,s=!0;continue}}let i=r.getContextRow(l);if(!i)continue;let a=e.getExpansionParentByRowId(n);if(a)t.originalRowData=e.getRowData(a),t.originalRowId=a,t.rowExpansion=i.rowExpansion=!0;else{if(!i.rowExpansion)continue;t.originalRowData=null,t.originalRowId=null,t.rowExpansion=i.rowExpansion=!1}t.rowId=o[l],t.rowIndex=l,this._dispatch("rowExpansionBinding",t)}t.originalRowData=null,t.originalRowId=null,t.rowExpansion=!1},Be.prototype._removeColumn=function(t){let e=this._layoutX.getLaneCount();if(t>e&&(t=e),t<=0)return;let n=e-t;this._layoutX.setLaneCount(n);for(let t=this._settings.length;--t>=0;)this._settings[t].getSection().setColumnCount(n);let i=this._columnDefs.slice(n);if(this._columnDefs.length=n,this._onColumnCountChanged(),this._syncLayoutToColumns(n,0,!0),this._hasListener("columnRemoved")){let t={};for(let o=e;--o>=n;){let e=i[o-n];t.colIndex=o,t.columnData=e?e.columnData:null,this._dispatchColumnEvent("columnRemoved",t)}}},Be.prototype._onSectionDataChanged=function(t){if(this._dispatchingDataChanged)return;let e=this._layoutX.getLaneCount();if(this._dispatchingDataChanged=!!e,!e)return;let n,i,o=t.fromRowIndex,r=t.toRowIndex,s=t.section,l=t.dataSource,a=l&&l.getDataSource()?1:0;s._startBindingSession(!0),a&&(n=l.getVisibleRowIds(!0),i=l.getMultipleRowData(n,o,r),t.dataRows=i);let u="content"===t.sectionType;u&&this._dispatch("beforeContentBinding",t),this._dispatch("preSectionDataBinding",t);let h=this.getDataColumnMap();for(let l=0;l<e;++l)if(s.isColumnActive(l)&&(this.isColumnVisible(l)||this._isAlwaysRenderColumn(l))){let e=this.getColumnDataBindingHandler(l)||this._dataBindingHandler;if(e){let u=h[l];t.dataColumnName=u,t.colIndex=l;for(let h=o;h<r;++h){let o=a?i[h]:null;o&&(t.rowData=o,t.rowId=n[h],t.dataValue=o?o[u]:null,t.rowIndex=h,t.cell=s.getCell(l,h,!1),e(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},Be.prototype.resetInternalState=function(){this._firstRendered=!1},Be.prototype._updateScrollbar=function(t){return!!t&&(t.isEnabled()&&t.update(),t.isActive())},Be.prototype._onVScroll=function(t){this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop()),this._dispatchRowPositionChanged()},Be.prototype._onHScroll=function(t){let e=this._hscrollbar.getScrollLeft();this._colVirtualizer.setViewOffset(e),this.updateColumnBounds(),this._dispatchColumnPositionChanged()},Be.prototype._onVScrollEnabled=function(){this._updateScrollbarHeight(!0,!1),this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.activate(),this._vscrollbar.getAutoHide()||this._updateVScrollbar()},Be.prototype._onVScrollDisabled=function(){this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.deactivate()},Be.prototype._onRowInViewChanged=function(t){let e=t.firstIndex,n=t.lastIndex+1,i=this._settings.length,o=[0,0];for(let t=0;t<i;++t){let i=this._settings[t],r=i.getSection();r&&!r.getFrozenLayout()&&(r.activateRows(e,n,o),this.updateRowData(i,o[0],o[1]-1))}},Be.prototype._onColInViewChanged=function(t){if(!this.getColumnCount())return;let e=t.prevFirstIndex,n=t.prevLastIndex,i=t.firstIndex,o=t.lastIndex,r=e<i?e:i,s=n>o?n:o;this._activateColumns(i,o,r,s);let l=this.getSectionCount();for(let t=0;t<l;++t){let e=this._settings[t];this.updateRowData(e)}},Be.prototype._activateColumns=function(t,e,n,i){null==n&&(n=0),null==i&&(i=this.getColumnCount()-1);let o=this._getColActivationList(t,e,n,i);for(let t=this.getSectionCount();--t>=0;)this._settings[t].activateColumns(o,n,i)},Be.prototype._getColActivationList=function(t,e,n,i){null==n&&(n=0);let o=this.getColumnCount();null==i&&(i=o-1),null==t&&(t=this._colVirtualizer.getFirstIndexInView()),null==e&&(e=this._colVirtualizer.getLastIndexInView());let r=this.getHScrollStartIndex(),s=this.getFirstPinnedRightIndex(),l=new Array(i+1);for(let o=n;o<=i;++o)l[o]=o<r||o>=t&&o<=e||o>=s;return l},Be.prototype._getColumnDef=function(t){if(t>=0){let e=this._columnDefs[t];return e||(e=this._columnDefs[t]={id:""+Be._runningColumnId++,columnData:{}}),e}return{columnData:{}}},Be.prototype._getNestedColumnDef=function(t,e,n){let i=this._getColumnDef(t);if(e){let t=i;i=t[e],i||(i=t[e]={}),n&&(t=i,i=t[n],i||(i=t[n]={}))}return i},Be.prototype.getColumnId=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).id||""},Be.prototype._getColumnId=Be.prototype.getColumnId,Be.prototype.getColumnIds=function(){let t=this.getColumnCount(),e=new Array(t);for(let n=0;n<t;++n)e[n]=this._getColumnDef(n).id||"";return e},Be.prototype.setColumnField=function(t,e){this._getColumnDef(t).field=e||""},Be.prototype.getColumnField=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).field||""},Be.prototype.getColumnFields=function(){let t=this.getColumnCount(),e=new Array(t);for(let n=0;n<t;++n)e[n]=this._getColumnDef(n).field||"";return e},Be.prototype.getColumnIndex=function(t){if("number"==typeof t)return t;if(t){let e=t,n=-1,i=this.getColumnCount();for(let t=0;t<i;++t){let i=this._getColumnDef(t);if(e===i.id)return t;e===i.field&&n<0&&(n=t)}return n}return-1},Be.prototype.getColumnIndices=function(t){let e=[],n=this.getColumnCount(),i=Array.isArray(t)?t:[t],o=i.length;for(let t=0;t<o;++t){let o=this.getColumnIndex(i[t]);o>=0&&o<n&&e.push(o)}return e},Be.prototype.getColumnIndexMap=function(){let t=this.getColumnCount(),e={},n="";for(let i=0;i<t;++i){let t=this._getColumnDef(i);n=t.field,n&&(e[n]=i),n=t.id,n&&(e[n]=i)}return e},Be.prototype._onWindowResize=function(){this._updateLayout(),this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop())},Be.prototype._onMouseMove=function(){this._vscrollbar.flash(),this._hscrollbar.flash()},Be.prototype._onGridClicked=function(){window.getSelection().toString()||this._element.contains(He(this._element))||this.focus()},Be.prototype._onKeyDown=function(t){if(!function(t){return 9===t.keyCode&&!t.ctrlKey&&!t.altKey&&!t.metaKey}(t))return;let e=He(this._element),n=!1;this._firstHiddenInput===e?n=-1:this._lastHiddenInput===e&&(n=1),this._dispatch("tabNavigation",{activeElement:e,firstHiddenInput:this._firstHiddenInput,lastHiddenInput:this._lastHiddenInput,onTheEdge:n,shiftKey:t.shiftKey,event:t}),n&&!t.defaultPrevented&&(n>0&&t.shiftKey?this._firstHiddenInput.focus():n<0&&!t.shiftKey&&this._lastHiddenInput.focus())},Be.prototype._onRowHightlighted=function(t){if(!this._hasListener("rowHighlighted"))return;let e=t.sender,n=this.getSectionSettings(e.getId());if(null==n)return;n.extendEventArg(t);let i=n.getDataSource();null!==i&&(t.rowId=i.getRowId(t.rowIndex),t.dataRow=i.getRowData(t.rowId)),this._dispatch("rowHighlighted",t)},Be.prototype._onRowCountChanged=function(t){if(this._disposed)return;let e=t.sender,n=t.prevCount,i=t.rowCount,o=e.getIndex(),r=this._updateSectionIndices(o),s=0;if(n>i)this._layoutY.removeLaneAt(r,n-i),this._layoutY.isHomogeneous()||this._syncSectionRowHeights(e);else{let t=this._layoutY.getDefaultLaneSize(),o=e.getDefaultRowHeight();if(this._layoutY.insertLane(r+n,i-n),o!==t)for(s=n;s<i;++s)this._layoutY.setLaneSize(r+s,o)}let l=t.noBinding,a=o<=this._startVScrollbarIndex||o>=this._getFooterStartIndex(),u=this._frozenFooterCount>0,h=this._updateScrollbarHeight(a,u,l);l&&(this._hasPendingRowChange=!0),this._frozenLayout||h||(this._rowVirtualizer.isVirtualizable()?e.activateRows(this._rowVirtualizer.getFirstIndexInView(),this._rowVirtualizer.getLastIndexInView()):e.activateRows()),this._hasPendingRowChange=!1,u||this._updateVScrollbar(),this._updateColumnSeparators(),n<i?("content"!==this.getSectionSettings(e).getType()&&this.applyColumnsBackgroundColor(e),this._dispatch("rowAdded",t)):n>i&&this._dispatch("rowRemoved",t)},Be.prototype._onRowHeightChanged=function(t){if(!this._rowHeightSync)return;if(this._disposed)return;if(this._rowHeightConflator.conflate(t))return;let e=this._rowHeightConflator.popAllData(),n=e.length,i=NaN;for(let t=0;t<n;++t){let n=e[t],o=n.section;if(!this._containsSection(o))continue;let r=o.getIndex(),s=n.rowIndex,l=this.getRowIndex(r,s),a=n.changeLength;for(let t=0;t<a;++t)this._layoutY.setLaneSize(l+t,o.getRowHeight(s+t))&&(r>=i||(i=r))}this._rowHeightConflator._needScrollbarUpdate?(this._rowHeightConflator._needScrollbarUpdate=!1,this._updateScrollbarHeight(!0,!0)):i>=0&&(this._dispatchingDataChanged?this._rowHeightTimerId||(this._rowHeightTimerId=setTimeout(this._requestScrollbarUpdate,0)):this._updateScrollbarHeight(i<this._startVScrollbarIndex,i>=this._startVScrollbarIndex)),this._updateColumnSeparators(),this._dispatchRowPositionChanged()},Be.prototype._containsSection=function(t){for(let e=this._settings.length;--e>=0;)if(this._settings[e].getSection()===t)return!0;return!1},Be.prototype._onRowAvailable=function(t){if(this._hasPendingRowChange)return;let e=t.sectionIndex;this._dispatchColumnRenderEvent(t,0,this.getColumnCount(),e,e+1,t.prevRowIndex,t.rowIndex)},Be.prototype._onSectionCountChanged=function(t){if(!this._frozenLayout){if(this._tempFrozenSectionRef){let t=this.getNextSection(this._tempFrozenSectionRef);null!==t&&(this._startVScrollbarIndex=t.getIndex(),this._tempFrozenSectionRef="")}this._startVScrollbarIndex>=0&&this._startVScrollbarIndex<this._getFooterStartIndex()?(this._vscrollbar.enable(),this._vscrollbar.setScrollContent(this,this._getAllSections(),this._startVScrollbarIndex),this._element.appendChild(this._lastHiddenInput),t||this._updateScrollbarHeight(!0,!0),this._syncLayoutToColumns()):this._vscrollbar.disable()}},Be.prototype._onColumnCountChanged=function(){if(this._frozenLayout||this._disposed)return;let 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()},Be.prototype._onSyncVScroll=function(t){this._vscrollbar.setScrollTop(t.scrollTop)},Be.prototype._onSyncHScroll=function(t){this._hscrollbar.setScrollLeft(t.scrollLeft)},Be.prototype._getFooterStartIndex=function(){return this.getSectionCount()-this._frozenFooterCount},Be.prototype._getVScrollStart=function(){return this._getSectionSize(0,this._startVScrollbarIndex)},Be.prototype._getFooterSize=function(){return this._frozenFooterCount>0?this._getSectionSize(this._getFooterStartIndex()):0},Be.prototype._getSectionSize=function(t,e){if(t){if(t<0)return 0}else t=0;null==e&&(e=this.getSectionCount()-t);let n=this._layoutY.getLaneStart(this._sectionStarts[t]),i=t+e;return(e>0?this._layoutY.getLaneStart(this._sectionStarts[i]):0)-n},Be.prototype._updateScrollbarHeight=function(t,e,n){if(!this._vscrollbar.isEnabled())return!1;let i=e,o=t&&this._startVScrollbarIndex>=0,r=this._rowHeightConflator.isConflating();if(r&&(this._rowHeightConflator._needScrollbarUpdate=!0,i=!1),o&&!r){let t=this.getElement();if(!t)return!1;let e=this.getParent(),n=this._vscrollbar.getParent();n?n!==e&&n.firstElementChild&&(n=n.firstElementChild):(n=t,this._vscrollbar.setParent(n));let i=this._getVScrollStart(),o=this._getFooterSize();n!==t&&(i+=t.clientTop),this._vscrollbar.resetPaneSize();let r=n.clientHeight-(i+o)*this._zoomFactor;this._vscrollbar.setTop(i*this._zoomFactor),this._vscrollbar.setTrackSize(r,r/this._zoomFactor);let s=this._layoutY.getDefaultLaneSize(),l=12*s;r>l&&(l=(Math.ceil(r/s)+4)*s),this._rowVirtualizer.setViewSize(l/this._zoomFactor);let a=this._sectionStarts[this._startVScrollbarIndex],u=this.getFooterCount(),h=0;if(u){let t=this.getSectionCount();h=this._sectionStarts[t]-this._sectionStarts[t-u]}this._rowVirtualizer.setViewBounds(a,h)}else this._rowVirtualizer.validateVirtualization();let s=!1;return n||(s=this._rowVirtualizer.update()),this._vscrollbar.invalidate(i),s},Be.prototype._updateScrollbarWidth=function(t,e){if(!this._frozenLayout){if(t&&this._hScrollbarEnabled){let t=this.getElement(),e=this._hscrollbar.getParent();e||(e=this.getParent()||t,this._hscrollbar.setParent(e));let n=this._layoutX.getLaneStart(this._pinnedLeftColumnCount),i=this._layoutX.getLaneCount(),o=0,r=this._countPinnedRightColumns();r&&(o=this._layoutX.getLaneStart(i)-this._layoutX.getLaneStart(i-r));let s=e!==t?t.clientLeft:0,l=e.clientWidth-(n+s+o)*this._zoomFactor;r>0&&(l-=this._reservedSpace),this._hscrollbar.setPaneLeft(n),this._hscrollbar.setLeft((n+s)*this._zoomFactor),this._hscrollbar.setTrackSize(l,l/this._zoomFactor);let a=4*this._layoutX.getDefaultLaneSize();l>a&&(a=l),this._colVirtualizer.setViewSize(a/this._zoomFactor),this._colVirtualizer.setViewBounds(this._pinnedLeftColumnCount,r)}else this._colVirtualizer.validateVirtualization();this._colVirtualizer.update(),this._hscrollbar.invalidate(e)}},Be.prototype._hitTestY=function(t,e){let n;if(e.sectionSettings)n=e.sectionSettings;else{let i;i="number"==e.rowIndex?e.rowIndex:this._layoutY.hitTest(t);let o=i>=0?i:~i,r=ut.upperBound(this._sectionStarts,o)-1;if(e.sectionIndex=r,n=this._settings[r],!n)return!1;n.extendEventArg(e)}let i=n.getSection();return null!=e.colIndex&&e.cellElement?e.rowIndex=i.getCellIndex(e.colIndex,e.cellElement):e.rowIndex=rowIndex+i.getRowOffset(),!0},Be.prototype._syncLayoutToColumns=function(t,e,n){if(this._frozenLayout)return;let i=this._layoutX.getLaneCount(),o=this.fillParentWidth(100);(o||null==t||null==e)&&(t=0,e=i,o=!0);let r=this._settings.length;if(r<=0)return;let s=!1;if(t<e)for(let n=0;n<r;++n)s=this._syncLayoutToSectionColumns(this._settings[n].getSection(),t,e)||s;let l=o||t<this.getHScrollStartIndex()||e>this.getFirstPinnedRightIndex();this._updateScrollbarWidth(l,!0),this.updateColumnBounds(),this._updateColumnSeparators(),this._dispatchColumnPositionChanged(),(s||n)&&this._dispatch("widthChanged",{from:t,to:e,colChanged:t})},Be.prototype._syncLayoutToSectionColumns=function(t,e,n){null==e&&(e=0),null==n&&(n=this._layoutX.getLaneCount());let i=0;for(let o=e;o<n;++o)i|=t._setColumnWidth(o,this._layoutX.getLaneSize(o));return!(!i||this._frozenLayout||(t._updateColumnLayout(),0))},Be.prototype._toDataColumnName=function(t){return ut.isNumber(t)?this.getDataColumnName(t):t},Be.prototype._updateSectionIndices=function(t){this._updatePaddingBottomSect()&&--t,t<0&&(t=0);let e=this._settings.length,n=this._settings[0]||null;n!==this._firstSettings&&(this._firstSettings&&this._firstSettings.getSection().removeClass("first"),this._firstSettings=n,this._firstSettings&&this._firstSettings.getSection().addClass("first"));let i=this._settings[e-1]||null;i!==this._lastSettings&&(this._lastSettings&&this._lastSettings.getSection().removeClass("last"),this._lastSettings=i,this._lastSettings&&this._lastSettings.getSection().addClass("last")),this._sectionStarts.length=e+1,this._sectionStarts[0]=0;for(let n=t;n<e;++n){let t=this._settings[n].getSection();t.setIndex(n),t.setRowOffset(this._sectionStarts[n]),this._sectionStarts[n+1]=this._sectionStarts[n]+t.getRowCount()}return this._sectionStarts[t]},Be.prototype._updateLayout=function(){let t=this.getElement();if(this._disposed||!t.offsetParent)return;this._syncLayoutToColumns(),this._updateScrollbarHeight(!0,!0),this._updateScrollbarWidth(!0,!0);let e=this.getSectionCount();for(let t=0;t<e;++t)this._settings[t].getSection().updateLayout();this._updateColumnSeparators()},Be.prototype._updateVScrollbar=function(){!this._disposed&&this._vscrollbar.isEnabled()&&(this._vScrollbarConflator.conflate()||this._vscrollbar.update())},Be._proto=Be.prototype;let Ge={chainIcon:""};Ge.styles=function(t){if(t){let e="";if(e=Array.isArray(t)?t.map(L).join("\n").replace(/{\s*{/g,"{").replace(/\s+{/g," {"):"string"==typeof t?t:t+"",e)return e.replace(/{[\w\W]*?}/g,E)}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);"]]),Ge.applyStyle=function(t){t&&!t._rowGroupingStyles&&(t._rowGroupingStyles=!0,function(t,e){if(!t)return null;let n=document.createElement("style");n.textContent="\n"+t+"\n";let i,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;o||(r=!1,o=document.head),r&&o.children&&o.children.length&&(i=o.children[0]),i?o.insertBefore(n,i):o.appendChild(n)}(Ge.styles,t.getElement()))};const We=Ge;let Ue=function(){this._counter={},this._session={},this._referers={}};Ue.prototype._counter=null,Ue.prototype._session=null,Ue.prototype._referers=null,Ue.prototype.reset=function(){this._counter={},this._referers={},this.newSession()},Ue.prototype.newSession=function(){this._session={}},Ue.prototype.getAllReferences=function(){return Object.keys(this._counter)},Ue.prototype.hasReference=function(){for(const t in this._counter)return!0;return!1},Ue.prototype.getAllReferers=function(){return Object.keys(this._referers)},Ue.prototype.getAllReferrers=Ue.prototype.getAllReferers,Ue.prototype.getSession=function(){let t=[],e=[];for(let n in this._session){let i=this._session[n];i>0?t.push(n):i<0&&e.push(n)}return{newEntries:t.filter(Boolean),removedEntries:e.filter(Boolean)}},Ue.prototype.addReference=function(t,e){if(t){if(e){let n=this._referers[e];if(n){if(n[t])return!1}else n=this._referers[e]={};n[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},Ue.prototype.addRef=Ue.prototype.addReference,Ue.prototype.removeReference=function(t,e,n){if(!t)return!1;let i=this._counter[t];if(!i)return!1;if(null==n)n=1;else if(n<0)n=i;else if(!n)return!1;if(e){let n=this._referers[e];if(!n)return!1;if(!n[t])return!1;delete n[t]}return i-=n,!i||i<0?(delete this._counter[t],1===this._session[t]?this._session[t]=0:this._session[t]=-1,!0):(this._counter[t]=i,!1)},Ue.prototype.release=Ue.prototype.removeReference,Ue.prototype.addReferences=function(t,e){if(!t)return 0;let n=0;if(Array.isArray(t)){let i=t.length;for(let o=0;o<i;++o)this.addReference(t[o],e)&&++n}else if("string"==typeof t)this.addReference(t,e)&&++n;else for(let i in t)this.addReference(i,e)&&++n;return n},Ue.prototype.removeReferer=function(t){let e=0;if(t){let n=this._referers[t];if(n){for(let i in n)this.removeReference(i,t)&&++e;delete this._referers[t]}}return e},Ue.prototype.removeReferrer=Ue.prototype.removeReferer,Ue.prototype.log=function(){console.log(this._counter)};const Ye=Ue;let Xe=function(){let t=this;t._commitRicsChanges=t._commitRicsChanges.bind(t),t._commitFieldsChanges=t._commitFieldsChanges.bind(t),t._fieldChangedConflator=new e(0,t._commitFieldsChanges),t._ricChangedConflator=new e(0,t._commitRicsChanges),t._fields=new Ye,t._rics=new Ye,t._rowDefMap={}};n.inherits(Xe,r),Xe.prototype._fieldChangedConflator=null,Xe.prototype._ricChangedConflator=null,Xe.prototype._rowDefMap=null,Xe.prototype._rics=null,Xe.prototype._fields=null,Xe.prototype.dispose=function(){this.removeAllEventListeners(),this._rowDefMap=this._fields=this._rics=null,this._fieldChangedConflator.reset(),this._ricChangedConflator.reset()},Xe.prototype.getAllRics=function(){return this._rics.getAllReferences()},Xe.prototype.hasRic=function(){return this._rics.hasReference()},Xe.prototype.getAllRowDefs=function(){let t=[];for(let e in this._rowDefMap)t=t.concat(this._rowDefMap[e]);return t},Xe.prototype.getAllFields=function(){return this._fields.getAllReferences()},Xe.prototype.getRowDefByRic=function(t){return this._rowDefMap[t]||null},Xe.prototype.addRic=function(t){let e=t?t.getSymbol():"";if(!e)return!1;let n=this._rowDefMap,i=n[e];i?i.indexOf(t)<0&&i.push(t):i=n[e]=[t];let o=this._rics.addReference(e,t.getRowId());return this._commitRicsChanges(),o},Xe.prototype.removeRic=function(t,e){if(e||(e=t?t.getSymbol():""),!e)return;let n=this._rowDefMap[e];if(n){let e=n.indexOf(t);e>=0&&n.splice(e,1)}this._rics.removeReference(e,t.getRowId()),this._commitRicsChanges()},Xe.prototype.removeAllRics=function(){let t=this._rics.getAllReferers();for(let e in t)this._rics.removeReferer(t[e]);this._rowDefMap={},this._commitRicsChanges()},Xe.prototype._commitRicsChanges=function(){if(this._ricChangedConflator.conflate())return;let t=this._rics,e=t.getSession(),n=e.removedEntries,i=e.newEntries;n.length&&this._doDispatch({type:"ricRemoved",removedRics:n}),i.length&&this._doDispatch({type:"ricAdded",addedRics:i}),t.newSession()},Xe.prototype.addFields=function(t,e){if(!t)return;let n=this._fields;t instanceof Nt?n.addReferences(t.getAllFields(),t.getId()):n.addReferences(t,e),this._commitFieldsChanges()},Xe.prototype.removeFields=function(t,e){t&&(t instanceof Nt?this._fields.removeReferer(t.getId()):this._fields.removeReference(t,e),this._commitFieldsChanges())},Xe.prototype.removeFieldReferrer=function(t){this._fields.removeReferer(t),this._commitFieldsChanges()},Xe.prototype.removeAllFields=function(){let t=this._fields.getAllReferers();for(let e in t)this._fields.removeReferer(t[e]);this._commitFieldsChanges()},Xe.prototype._commitFieldsChanges=function(){if(this._fieldChangedConflator.conflate())return;let t=this._fields,e=t.getSession(),n=e.removedEntries,i=e.newEntries;n.length&&this._doDispatch({type:"fieldRemoved",removedFields:n}),i.length&&this._doDispatch({type:"fieldAdded",addedFields:i}),t.newSession()},Xe.prototype._doDispatch=function(t){let e=this;t.fields=e.getAllFields(),t.rics=e.getAllRics(),t.rowDefs=e.getAllRowDefs(),e._dispatch(t.type,t)},Xe.prototype.reset=function(){let t=this;t._rowDefMap={},t._fields.reset(),t._rics.reset(),t._fieldChangedConflator.reset(),t._ricChangedConflator.reset()};const qe=Xe;let je=function(t,e,n){return null==t||t!=t?null==e||e!=e?0:1:null==e||e!=e?-1:t<e?-n:e<t?n:0},Ke=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=[]};Ke.prototype._globalContext,Ke.prototype._sortParams,Ke.prototype._ctxCaches,Ke.prototype._primaryParams,Ke.prototype.dispose=function(){this._globalContext={},this._sortParams.length=0,this._ctxCaches.length=0,this._primaryParams=null},Ke.prototype.getSorter=function(){this._primaryParams=null;let t=this._sortParams.length;if(1===t){let t=this._primaryParams=this._sortParams[0];return t[1]?t[3]?this._rowDefSorter:this._dataSorter:this._defaultSorter}return t>1?this._multiColumnsSorter:Ke._noSorting},Ke.prototype.reset=function(){this._sortParams.length&&(this._sortParams.length=0)},Ke.prototype.setContext=function(t,e){this._globalContext[t]=e},Ke.prototype.addColumnContext=function(t,e,n,i,o,r){t||(t="");let s=this._sortParams.length,l=this._ctxCaches[s];l||(l=this._ctxCaches[s]=I(this._globalContext));let a=0;"a"===i?a=1:"d"===i&&(a=-1);let u=[t,"function"==typeof e?e:null,l,n,a];l.colIndex=o,l.field=t,l.formattedField=t+"_FORMATTED",l.colDef=r,this._sortParams.push(u)},Ke._noSorting=function(t,e,n){return 0},Ke.prototype._defaultSorter=function(t,e,n){let i=this._primaryParams[0];return je(t.getData(i),e.getData(i),n)},Ke.prototype._dataSorter=function(t,e,n){let i=this._primaryParams,o=i[0];return(0,i[1])(t.getData(o),e.getData(o),n,i[2])},Ke.prototype._rowDefSorter=function(t,e,n){let i=this._primaryParams;return(0,i[1])(t,e,n,i[2])},Ke.prototype._multiColumnsSorter=function(t,e,n){let i=this._sortParams,o=i.length;for(let n=0;n<o;++n){let o=i[n],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):je(t.getData(r),e.getData(r),u),h)return h}return 0};const Je=Ke,Qe="ROW_DEF";let Ze=function(t){let 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._rowDefSorter=e._rowDefSorter.bind(e),e._hosts=[],e._sortLogic={},e._addEvents("preClicked","clicked","preDataSorting","columnSorted"),e._sortStates=[],e._sortingSequence=["a","d"],t&&e.config({sorting:t})};o.inherits(Ze,ct),Ze.prototype._hosts=null,Ze.prototype._sortStates,Ze.prototype._maxCount=1,Ze.prototype._dataSorting=!0,Ze.prototype._dblClickAllowed=!1,Ze.prototype._clickTimer=0,Ze.prototype._delayInterval=0,Ze.prototype._lastMouseDown=0,Ze.prototype._initialSort=null,Ze.prototype._mode="",Ze.prototype._sortableColumns=!0,Ze.prototype._sortableIndicator=!1,Ze.prototype._solarTheme=!1,Ze.prototype._sortLogic,Ze.prototype._userManagedLogic=!1,Ze.prototype._disabled=!1,Ze.prototype._frozenIndicator=!1,Ze.prototype._rowDefMode=!1,Ze.prototype._userComparer=null,Ze._icons={},Ze.prototype._sortingSequence,Ze.prototype._sortingSequenceMap=null,Ze.prototype.getName=function(){return"SortableTitlePlugin"},Ze.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))},Ze.prototype.unload=function(t){let 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))},Ze.prototype.afterInit=function(){let t=this;t.setSortLogics(t._sortLogic);let e=t._initialSort;null!=e&&(Array.isArray(e)?1===t._maxCount?t.sortColumns(e.slice(0,1)):t.sortColumns(e):t.sortColumns([e]))},Ze.prototype.config=function(t){if(!t)return;let e=this,n=t.icons;null!=n&&n.sorting&&(Ze._icons=n.sorting);let i=t.themeName;!i||i.indexOf("solar")>=0?e._solarTheme=!0:e._solarTheme=!1,e._initialSort=e._initialSortByColumnField(t);let o=t.sorting;if(!o)return;o.ROW_DEF&&(this._rowDefMode=!0),o.userManagedLogic&&(e._userManagedLogic=!0);let 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)),r=o.sortableIndicator,null!=r&&(e._sortableIndicator=r),r=o.disabled,null!=r&&(e._disabled=!!r),r=o.threeStatesSorting,null!=r&&e.disableTwoStateSorting(r),r=o.sortingSequence,null!=r&&Array.isArray(r)&&(e._sortingSequence=r),r=o.mode,null!=r&&(e._mode=r,"manual"===r&&e.disableDataSorting()),r=o.indicatorOnly,null!=r&&e.disableDataSorting(r),r=o.disableDoubleClickToSort,null!=r&&e.disableDoubleClickToSort(r),r=o.columnSorted,"function"==typeof r&&e.listen("columnSorted",r),r=o.preClicked,"function"==typeof r&&e.listen("preClicked",r),r=o.clicked,"function"==typeof r&&e.listen("clicked",r),r=o.preDataSorting,"function"==typeof r&&e.listen("preDataSorting",r),r=o.sortableColumns,null!=r&&(e._sortableColumns=r),r=o.initialSort,"object"==typeof r&&(e._initialSort=r),r=o.sortLogic,"object"==typeof r)for(let t in r)"function"==typeof r[t]&&(e._sortLogic[t]=r[t])},Ze.prototype.getConfigObject=function(t){let e=t||{},n=e.columns;n||(n=e.columns=[]);let i=this._hosts[0];if(!i)return e;let o,r,s,l,a,u=this.getSortedColumns();if(1===this._maxCount&&null!=u)for(s=u.length,r=0;r<s;r++){let t=u[r],e=t.colIndex;o=n[e],o||(o=n[e]={}),o.sortOrder=t.sortOrder}for(s=i.getColumnCount(),r=0;r<s;++r)o=n[r],o||(o=n[r]={}),l=this._getSortOptions(r),l&&(this._sortableColumns?l.disabled&&(o.sortable=!1):l.disabled||(o.sortable=!0),a=l.field,a&&(null!=o.field&&o.field!==a&&(o.sortBy=a),this._sortingSequenceMap&&this._sortingSequenceMap[a]&&(o.sortingSequence=this._sortingSequenceMap[a])));let h=e.sorting;h||(h=e.sorting={});let p=u;null!=p&&(h.initialSort=p),p=this._sortableIndicator,!1!==p&&(h.sortableIndicator=p),1!==this._maxCount&&(h.multiColumn=-1===this._maxCount||this._maxCount),this._dblClickAllowed&&(h.disableDoubleClickToSort=!this._dblClickAllowed),p=this._sortableColumns,!0!==p&&(h.sortableColumns=p),p=this._dataSorting,!0!==p&&(h.indicatorOnly=p),this._disabled&&(h.disabled=!0);let d=this._sortingSequence,c=!0;return 2===d.length&&"a"===d[0]&&"d"===d[1]&&(c=!1),c&&(h.sortingSequence=d.slice()),D(e.sorting)&&delete e.sorting,e},Ze.prototype.getColumnMenu=function(t,e){e||(e={});let n=e.menus;n||(n=e.menus=[]);let i=n[0];i||(i=n[0]={menuItems:[]});let 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 i.menuItems.push(r),e},Ze.prototype._onItemSortingClicked=function(t){this._hosts[0].getPlugin("ColumnMenuPlugin").hide();let e=t.currentTarget.value,n=e.colIndex,i=e.sortOrder;this.sortColumn(n,i)},Ze.prototype.getIcons=function(){return Ze._icons},Ze.prototype.setSortLogics=function(t){if(null!=t){let e=this._hosts[0];if(e){let n=e.getDataSource();for(let e in t)this._setSortLogic(n,e,t[e])}}},Ze.prototype.setSortLogic=function(t,e){if("string"==typeof t){let n=this._hosts[0];if(n){let i=n.getDataSource();this._setSortLogic(i,t,e)}}},Ze.prototype._setSortLogic=function(t,e,n){t&&"string"==typeof e&&("*"===e?t.setSortingLogic(n):t.setColumnSortingLogic(e,n))},Ze.prototype.getSortOrder=function(t){let e=null!=t?this.getSortPriority(t):0,n=this._sortStates[e];return(n?n.sortOrder:"")||"n"},Ze.prototype.getSortedColumnIndex=function(t){return this._getColumnIndex(this._sortStates[t||0])},Ze.prototype.getSortPriority=function(t,e){let n=this._hosts[0];if(n){let i,o=this._sortStates.length;if(t>=0){let e=n.getColumnId(t);if(e)for(i=0;i<o;++i)if(this._sortStates[i].colId===e)return i}else if(e)for(i=0;i<o;++i){let t=this._sortStates[i];if(t.colId===e)return i;if(t.field===e)return i}}return-1},Ze.prototype.isColumnSorted=function(t){return this.getSortPriority(t)>=0},Ze.prototype.getSortedColumns=function(){let t=this._sortStates.length;if(t<=0)return null;let e=new Array(t);for(let n=0;n<t;++n){let t=this.getSortedColumnIndex(n),i=this._sortStates[n],o={},r="";t>=0&&(o.colIndex=t,r=this._getColumnId(t)),r&&(o.colId=r);let s=i.field||"";s&&(o.field=s),o.sortOrder=i.sortOrder||"n",e[n]=o}return e},Ze.prototype.isSorting=function(){return!!this._sortStates.length},Ze.prototype.sortColumn=function(t,e,n){let i=this._prepareSorting(t,e);if(this._sortColumn(i,n),n&&n.isUserAction){let t={};t.colIndex=i.colIndex,t.sortOrder=this.getSortOrder(i.colIndex),t.dataColumnName=this.getColumnSortingField(i.colIndex),this._dispatch("clicked",t)}},Ze.prototype.sortColumns=function(t,e){if(Array.isArray(t)){let n=t.length,i=new Array(n);for(let e=0;e<n;e++)i[e]=this._prepareSorting(t[e]);this._sortColumn(i,e)}},Ze.prototype.clearSortState=function(t){this._popSortState(0,t)&&this.updateSortSymbols()},Ze.prototype.refresh=function(){this._sortStates.length&&(this._sortDataView(),this.updateSortSymbols())},Ze.prototype.restoreUserActions=Ze.prototype.refresh,Ze.prototype.setSortableColumnCount=function(t){this._maxCount=t||1,this._popSortState(this._maxCount)},Ze.prototype.getSortingStates=function(){return this._sortStates},Ze.prototype.updateSortSymbols=function(){if(!this._disabled)for(let t=this._hosts.length;--t>=0;)this._updateSortableIndicator(t)},Ze.prototype.getDataColumnMap=function(){let t=this._hosts[0],e=[];if(t){let n=t.getColumnCount();for(let t=0;t<n;++t)e[t]=this.getColumnSortingField(t)}return e},Ze.prototype.getDataColumnNames=Ze.prototype.getDataColumnMap,Ze.prototype.setDataColumnMap=function(t){if(Array.isArray(t))for(let e=t.length;--e>=0;)this.setColumnSortingField(e,t[e])},Ze.prototype.setDataColumnNames=Ze.prototype.setDataColumnMap,Ze.prototype.getColumnSortingField=function(t){let e=this._getSortOptions(t),n=e?e.field:null;if(null==n&&!this._rowDefMode){let i=this._hosts[0];i&&(n=i.getColumnField(t),n||(n=i.getDataColumnName(t)),n&&e&&(e.field=n))}return n||""},Ze.prototype.setColumnSortingField=function(t,e,n,i){if("number"==typeof t&&null!=e){let o=this._newSortOptions(t);e||(e=""),o.field!==e&&(o.field=e),null==n||this._userManagedLogic||o.sortLogic!==n&&(o.sortLogic=n||null,i&&n&&(n.rowSorting=!0))}};let $e=function(t){return t.field||""};Ze.prototype.getColumnSortingFields=function(){return this._sortStates.map($e)},Ze.prototype.setFirstSortOrder=function(t,e){"a"!==(e=e?Ze._toSortOrder(e):"a")&&"d"!==e&&(e="a");let n=null;n=Array.isArray(t)?t:[t];let i=n.length;for(let t=0;t<i;++t){let i=n[t],o=this.getSortingSequence(i).slice(),r=o.indexOf(e);r>=0&&o.splice(r,1),o.unshift(e),this.setSortingSequence(o,i)}},Ze.prototype.disableTwoStateSorting=function(t){let e=this._sortingSequence.indexOf("n");!1===t?e>=0&&this._sortingSequence.splice(e,1):e<0&&this._sortingSequence.push("n")},Ze.prototype.freezeIndicator=function(t){let e=this._frozenIndicator;if(this._frozenIndicator=!1!==t,e&&!this._frozenIndicator)for(let t=this._hosts.length;--t>=0;)this._updateSortableIndicator(t)},Ze.prototype.disableSortSymbols=function(t){},Ze.prototype.disableDataSorting=function(t){this._dataSorting=!1===t},Ze.prototype.disableDoubleClickToSort=function(t){this._dblClickAllowed=!t},Ze.prototype.disableCellClick=function(t,e){t&&t.enableClass("no-sort",!1!==e)},Ze.prototype.disableColumnSorting=function(t,e){if(e=!1!==e,"number"==typeof t)this._disableColumnSorting(t,e);else if(Array.isArray(t)){let n=t.length;for(let i=0;i<n;++i)this._disableColumnSorting(t[i]||0,e)}},Ze.prototype._disableColumnSorting=function(t,e){let n=this._newSortOptions(t);n.disabled!==e&&(n.disabled=e)},Ze.prototype.setClickDelayInterval=function(t){this._delayInterval=null!=t?t:500},Ze.prototype._initialSortByColumnField=function(t){let e=t.columns,n=e?e.length:0;for(let t=0;t<n;t++){let n=e[t].defaultSort;if(n)return{colIndex:t,sortOrder:n}}return null},Ze.prototype._onSectionAdded=function(t){if("title"!==t.sectionType)return;let e=t.section;0===e.getIndex()&&(e.listen("mousedown",this._onMouseDown),e.listen("click",this._onClickTitle.bind(this,t.sender),0))},Ze.prototype._onUIUpdated=function(t){"title"===t.sectionType&&this.updateSortSymbols()},Ze.prototype._canClickToSort=function(t){if(this._disabled)return!1;let e=t.grid;if(!e||!e.getElement())return!1;let n=this._getPlugin("CellEditingPlugin");if(n&&n.isEditing())return!1;if(this._dispatch("preClicked",t),t.cancel)return!1;let i=t.colIndex,o=t.section,r=t.rowIndex;return!!this._isCellSortable(o,i,r)},Ze.prototype._proceedSorting=function(t){if(this._clickTimer=0,this._canClickToSort(t)){let e=t.colIndex;this.sortColumn(e,null,{isUserAction:!0});let n=t.grid;n&&n.focus&&n.focus()}},Ze.prototype._onMouseDown=function(t){t.button||(this._lastMouseDown=t.timeStamp)},Ze.prototype._getPlugin=function(t){let e=this._hosts[0];return e?e.getPlugin(t):null},Ze.prototype.clickTitleByMouse=function(t,e){this._onClickTitle(t,e)},Ze.prototype._onClickTitle=function(t,e){if(this._disabled)return;if(2===e.detail&&!this._dblClickAllowed)return void(this._clickTimer&&(clearTimeout(this._clickTimer),this._clickTimer=0));if(e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)return;if(!(e.timeStamp-this._lastMouseDown<500))return;let n=t.getRelativePosition(e);if(!n.hit)return;let i=this._getPlugin("ColumnSelectionPlugin");if(i&&i.isEnabled()){let t=n.colIndex;if(!i.isSelectedColumn(t))return}n.target=e.target,this._delayInterval>0?this._clickTimer||(this._clickTimer=setTimeout(this._proceedSorting.bind(this,n),this._delayInterval)):this._proceedSorting(n)},Ze.prototype._popSortState=function(t,e){if(t<0||this._sortStates.length<=t)return!1;let n=!1;for(let e=this._sortStates.length;--e>=t;)this._clearSortSymbols(this._sortStates[e]),n=!0;return this._sortStates.length=t,this._sortDataView(e),n},Ze._toSortOrder=function(t){return!t||"string"!=typeof t||"d"!==(t=t.charAt(0).toLowerCase())&&"a"!==t?"n":t},Ze.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},Ze.prototype.setSortingSequence=function(t,e){if(Array.isArray(t))t.length||(t=null);else if(t)return;let n;if(null!=e&&("string"==typeof e?n=e:"number"==typeof e&&(n=this.getColumnSortingField(e))),t){let e=t.map(Ze._toSortOrder);n?(this._sortingSequenceMap||(this._sortingSequenceMap={}),this._sortingSequenceMap[n]=e):this._sortingSequence=e}else n?this._sortingSequenceMap&&delete this._sortingSequenceMap[n]:this._sortingSequence=this._sortingSequence.length>2?["a","d","n"]:["a","d"]},Ze.prototype.clearAllColumnSortingSequences=function(){this._sortingSequenceMap=null},Ze.prototype._rowDefSorter=function(t,e,n,i){return this._userComparer(t[Qe].getRowData(),e[Qe].getRowData(),n,i)},Ze.prototype.sortSeparators=function(t){let e=this._hosts[0].getDataSource();if(t)this._rowDefMode?(this._userComparer=t,e.sortSeparators(this._rowDefSorter),this._userComparer=null):e.sortSeparators(t);else{let t=e.getSortingLogics(),n=[],i=[],o=this._sortStates.length;for(let t=0;t<o;t++){let e=this._sortStates[t],o=this._rowDefMode?Qe:e.field;n.push(e.sortOrder),i.push(o)}e.sortSeparators(t,n,i)}},Ze.prototype._prepareSorting=function(t,e){if(!this._maxCount)return null;let n=this._hosts[0];if(!n)return null;let i=-1,o="";"number"==typeof t?i=t:"string"==typeof t?(o=t,i=this._getColumnIndex(o)):t&&"object"==typeof t&&(o=t.colId||t.field,o?i=this._getColumnIndex(o):"number"==typeof t.colIndex&&(i=t.colIndex),e||(e=t.sortOrder||t.order||null));let r="",s=null;if(i>=0){r=this.getColumnSortingField(i);let t=this._getSortOptions(i);t&&(s=t.sortLogic)}else o&&(r=o);let l=this.getSortPriority(i,r),a=l>=0?this._sortStates[l]:null,u=a?a.sortOrder:"n",h="n";if(null==e){let t=this.getSortingSequence(r),e=t.indexOf(u);e=e<0?0:(e+1)%t.length,h=t[e]}else h=Ze._toSortOrder(e);if(a){if(u===h)return this.updateSortSymbols(),null;this._sortStates.splice(l,1),this._clearSortSymbols(a)}if("a"===h||"d"===h){if(i<0&&!r)return null;if(!a){a={};let t=n.getColumnId(i);t&&(a.colId=t)}a.field=r,a.sortLogic=s||null,this._sortStates.push(a)}a&&("n"!==u?a.prevOrder=u:delete a.prevOrder,a.order=h,a.sortOrder=h);let p=[];if(this._maxCount>0)for(;this._sortStates.length>this._maxCount;){let t=this._clearSortSymbols(this._sortStates.shift());null!==t&&p.push(t)}return{colIndex:i,sortedField:r,sortOrder:h||"n",prevOrder:u,clearedSortColIndexes:p}},Ze.prototype._sortColumn=function(t,e){if(!t)return;this._sortDataView(e),this.updateSortSymbols();let n=null;if(Array.isArray(t)){let e=t.length;for(let i=0;i<e;++i){let e=t[i];e&&(n?(n.colIndices||(n.colIndices=[],n.sortedFields=[],n.sortOrders=[],n.prevOrders=[]),n.colIndices.push(e.colIndex),n.sortedFields.push(e.sortedField),n.sortOrders.push(e.sortOrder),n.prevOrders.push(e.prevOrder)):n=e)}n=t[0]}else n=t;this._dispatch("columnSorted",n)},Ze.prototype._onColumnAdded=function(t){let e=this,n=t.colIndex,i=t.context||{},o=!!e._sortableColumns,r=i.field,s=i.sortBy;null!=s&&(o=!!s,r=s),null!=i.sortable&&(o=!!i.sortable);let l=i.sortLogic||i.sortingLogic||i.sorter;l||(l=e._sortLogic[r]),"function"!=typeof l&&(l=null);let a=i.sortingSequence;null!=a&&r&&e.setSortingSequence(a,r),o?e.setColumnSortingField(n,r,l,i.rowSorting):e.disableColumnSorting(n,!0);let u=i.sortOrder||i.sort;null!=u&&(u=Ze._toSortOrder(u),"n"!==u&&(e.clearSortState(),e.sortColumn(n,u)))},Ze.prototype._onColumnRemoved=function(t){let e=this._sortStates.length;if(!e)return;let n=t.colId;if(n)for(let t=0;t<e;++t){let e=this._sortStates[t];if(e.colId===n){this._sortStates.splice(t,1),this._clearSortSymbols(e),this._sortDataView();break}}},Ze._toRowDefField=function(){return Qe},Ze.prototype._sortDataView=function(t){if(t=t||{},this._dispatch("preDataSorting",t),!this._dataSorting)return;let e=this._sortStates.length;this._userManagedLogic&&e>1&&(e=1);let n=null,i=null,o=null;if(e){n=new Array(e),i=new Array(e);for(let t=0;t<e;++t)n[t]=this._sortStates[t].sortOrder,i[t]=this._sortStates[t].sortLogic;o=this._rowDefMode?this._sortStates.map(Ze._toRowDefField):this.getColumnSortingFields(),this._userManagedLogic&&o.length>1&&(o=o.slice(0,1))}for(let e=this._hosts.length;--e>=0;){let r=this._hosts[e].getDataSource();if(r){let e=1==t.isUserAction;r.sort(o,n,i,e)}}},Ze.prototype._clearSortSymbols=function(t){let e=t.targetCells;if(!e)return null;let n=null;for(let t=e.length;--t>=0;){let i,o=e[t];o.removeClass("sorting"),o.removeClass("sortable"),o.removeFloatingIcon("sort-symbol"),o.removeFloatingIcon("priority-symbol"),null==n&&(i=o.getSection())&&(n=i.getColumnIndex(o.getParent()))}return e.length=0,n},Ze.prototype._updateSortableIndicator=function(t){let e=this,n=e._hosts[t];if(!n||this._frozenIndicator)return;let i=n.getSection("title");if(null!=i)for(let n=i.getColumnCount();--n>=0;){let o=i.getRowCount();for(let r=0;r<o;r++){let s=i.getCell(n,r,!0);if(!s)continue;if(s.removeClass("sorting"),s.removeClass("sortable"),s.removeClass("asc"),s.removeClass("desc"),s.removeClass("edge-indicator"),s.removeFloatingIcon("sort-symbol"),s.removeFloatingIcon("priority-symbol"),s.removeFloatingIcon("sortable-indicator"),r!==o-1)continue;if(!e._isCellSortable(i,n,r))continue;s.addClass("sortable");let l,a,u=e.getSortPriority(n),h=e._sortStates[u];if(h&&"n"!==h.sortOrder){if(h.targetCells||(h.targetCells=[]),h.targetCells[t]=s,"a"===h.sortOrder?s.addClass("asc"):s.addClass("desc"),s.addClass("sorting"),e._solarTheme){let t;"a"===h.sortOrder?(t="▲",a=Ze._icons.ascending):(t="▼",a=Ze._icons.descending),l=e._createIconElem(a,t),l.className="sort-symbol",s.insertFloatingIcon(l,0)}else s.addClass("edge-indicator");e._sortStates.length>1&&(l=document.createElement("span"),l.className="priority-symbol",l.textContent=u+1,s.insertFloatingIcon(l,1))}else e._sortableIndicator&&(a=Ze._icons.sortable,l=e._createIconElem(a,"◊"),l.className="sortable-indicator",s.insertFloatingIcon(l,0))}}},Ze.prototype._createIconElem=function(t,e){let n;return t&&"string"==typeof t?(n=document.createElement("ef-icon"),n.setAttribute("icon",t)):(n=document.createElement("span"),n.textContent=e),n},Ze.prototype._getColumnIndex=function(t){if(null!=t){let e=this._hosts[0];if(e)return"number"==typeof t?t:"string"==typeof t?e.getColumnIndex(t):e.getColumnIndex(t.colId)}return-1},Ze.prototype._getColumnId=function(t){let e=this._hosts[0];return e&&null!=t?e.getColumnId(t):""},Ze.prototype._getSortOptions=function(t){let e=this._hosts[0];return e&&e.getColumnData(t).sortableTitle||null},Ze.prototype._newSortOptions=function(t){let e=this._hosts[0],n=null;if(e&&t>=0){let i=e.getColumnData(t);n=i.sortableTitle,n||(n=i.sortableTitle={})}return n||{}},Ze.prototype._isCellSortable=function(t,e,n){let i=this._getSortOptions(e);if(i){if(i.disabled)return!1;let t=i.field;if(null!=t&&!t)return!1}let o=t.getCell(e,n,!0);return!o.hasClass("no-sort")&&o===t.getCell(e,t.getRowCount()-1,!0)&&!o.getParent().classList.contains("collapsed")},Ze._proto=Ze.prototype;let tn=function(t){return t?t.getRowData():null},en=function(t){return!t.isAutoGenerated()},nn=function(t){return!t.autoGenerated},on=function(t,e,n,i){return(t.getData(i)-e.getData(i))*n},rn=function(t,e,n){let i=t.getParent();if(!i)return 0;let o=e.getParent();if(!o)return 0;if(i!==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)*n},sn=function(t){return t?t.getName():""},ln=function(t,e){return t.getField()===e||t.getId()===e},an=function(t,e){return!!(t&&e&&t.id&&e.id)&&t.id===e.id},un=function(t){t&&t.preventDefault()},hn=function(t){return t&&clearTimeout(t),0},pn=function(n,i){let o=this;if(o._onDataChanged=o._onDataChanged.bind(o),o._onQuote2PostUpdate=o._onQuote2PostUpdate.bind(o),o._onQ2DataChanged=o._onQ2DataChanged.bind(o),o._onDataComposed=o._onDataComposed.bind(o),o._onSubSegmentChanged=o._onSubSegmentChanged.bind(o),o._recalculateFormulas=o._recalculateFormulas.bind(o),o.updateColumnTitle=o.updateColumnTitle.bind(o),o._populateTimeSeriesChildren=o._populateTimeSeriesChildren.bind(o),o._onPostSectionDataBinding=o._onPostSectionDataBinding.bind(o),o._asyncClearDataUpdates=o._asyncClearDataUpdates.bind(o),o._clearDataUpdates=o._clearDataUpdates.bind(o),o._onPreDataSorting=o._onPreDataSorting.bind(o),o._mainSorter=o._mainSorter.bind(o),o._updateRowData=o._updateRowData.bind(o),o._onFormulaDataChanged=o._onFormulaDataChanged.bind(o),o._onFormulaDataRequired=o._onFormulaDataRequired.bind(o),o._registerConstituents=o._registerConstituents.bind(o),o._onColumnAdded=o._onColumnAdded.bind(o),o._onRowExpansionBinding=o._onRowExpansionBinding.bind(o),o._onColumnHeaderBinding=o._onColumnHeaderBinding.bind(o),o._getRowId=o._getRowId.bind(o),o._onFieldLoadedError=o._onFieldLoadedError.bind(o),o._snapshotFillerDataChanged=o._snapshotFillerDataChanged.bind(o),o._onPollingInterval=o._onPollingInterval.bind(o),o._onTabNavigation=o._onTabNavigation.bind(o),o._requestScroll=o._requestScroll.bind(o),o._onVScroll=o._onVScroll.bind(o),o._selfScrollToRow=o._selfScrollToRow.bind(o),o._dcConflator=new e(50,o._onDataChanged),o._formulaConflator=new e(300,o._onFormulaDataChanged),o._chainConflator=new e(100,o._registerConstituents),o._columnTitleConflator=new e(0,o.updateColumnTitle),o._timeSeriesChildConflator=new e(0,o._populateTimeSeriesChildren),o._defaultColumnOptions={},o._topNode=n||t.div(),o._topNode.classList.add("rt-grid"),o._grid=new Be,o._grid._wrapper=this,o._sorter=new Je,o._sorter.setContext("grid",this),o._sorter.setContext("core",o._grid),o._dateTimeUtil=J,o._grid.listen("columnAdded",o._onColumnAdded),i){if(i.dataView){o._sharedDataSource=!0,o._dv=i.dataView,o._dt=o._dv.getDataTable(),o._mainGrid=i.grid;let t=o._mainGrid.getCoreGrid();o._stp=t.getPlugin("SortableTitlePlugin")}i.SortableTitle&&(o._stp=i.SortableTitle),!1===i.topSection&&(o._topSection=!1)}o._sharedDataSource||(o._dc=new _t,o._dc.listen("dataChanged",o._onDataChanged),o._dc.listen("dataComposed",o._onDataComposed),o._dt=new St,o._dt.setSortingLogic(o._mainSorter),o._dt.setClassificationSource(o._dc),o._dt.listen("subSegmentChanged",o._onSubSegmentChanged),o._dv=new De(o._dt),o._dv.listen("pageIndexChanged",o._dispatch.bind(o,"pageIndexChanged")),o._dv.listen("pageCountChanged",o._dispatch.bind(o,"pageCountChanged"))),o._grid.setDataSource(o._dv),o._stp?(o._sharedSorter=!0,o._stp.listen("preDataSorting",o._onPreDataSorting),o._grid.loadPlugin(o._stp)):(o._stp=new Ze({userManagedLogic:!0,sortableColumns:!0,disableDoubleClickToSort:!0,ROW_DEF:!0}),o._stp.listen("preDataSorting",o._onPreDataSorting),o._grid.loadPlugin(o._stp,i)),o._grid.listen("beforeContentBinding",o._dispatch.bind(o,"beforeContentBinding")),o._grid.listen("preSectionRender",o._onColumnHeaderBinding),o._grid.listen("postSectionDataBinding",o._onPostSectionDataBinding),o._grid.listen("firstRendered",o._dispatch.bind(o,"firstRendered")),o._grid.listen("afterContentBinding",o._dispatch.bind(o,"afterContentBinding")),o._grid.listen("tabNavigation",o._onTabNavigation),o._grid.getVScrollbar().listen("scroll",o._onVScroll),o._grid.enableRowHighlighting(!0),o._addGridSections(),o._grid.setParent(o._topNode),o._snapshot=new Ht,o._snapshot.addEventListener("adcDataReceived",o._dispatch.bind(o,"adcDataReceived")),o._snapshot.addEventListener("dataChanged",this._snapshotFillerDataChanged),o._connector=new qe,o._connector.addEventListener("ricAdded",o._onRicAdded.bind(o)),o._connector.addEventListener("ricRemoved",o._onRicRemoved.bind(o)),o._connector.addEventListener("fieldAdded",o._onFieldAdded.bind(o)),o._connector.addEventListener("fieldRemoved",o._onFieldRemoved.bind(o)),o.initialize(i),We.applyStyle(o._grid)};n.inherits(pn,r),pn.prototype._topNode=null,pn.prototype._mainGrid=null,pn.prototype._grid=null,pn.prototype._dc=null,pn.prototype._dt=null,pn.prototype._dv=null,pn.prototype._sharedDataSource=!1,pn.prototype._sharedSorter=!1,pn.prototype._subs=null,pn.prototype._stp=null,pn.prototype._columnSorter=null,pn.prototype._dcConflator=null,pn.prototype._snapshot=null,pn.prototype._connector=null,pn.prototype._sorter=null,pn.prototype._fnEngine=null,pn.prototype._formulaConflator=null,pn.prototype._chainConflator=null,pn.prototype._constituentMap=null,pn.prototype._clientWidth=NaN,pn.prototype._autoLayoutTimer=0,pn.prototype._defaultColumnOptions=null,pn.prototype._RTK=null,pn.prototype._ADCOptions=null,pn.prototype._synapse=null,pn.prototype._autoDateConversion=!1,pn.prototype._textSelect=!1,pn.prototype._lang=null,pn.prototype._dateTimeUtil=null,pn.prototype._initializing=!1,pn.prototype._pollingInterval=0,pn.prototype._pollingTimerId=0,pn.prototype._lastPollingRequest=0,pn.prototype._pollingEnabled=!0,pn.prototype._fieldCaching=!1,pn.prototype._timeSeriesExpansion=!0,pn.prototype._childDataField="",pn.prototype._topSection=!0,pn.prototype._focusingArgs=null,pn.prototype._hasNewUpdates=!1,pn.prototype.dispose=function(){this.removeAllEventListeners(),this._autoLayoutTimer&&(clearInterval(this._autoLayoutTimer),this._autoLayoutTimer=0),this._pollingTimerId=hn(this._pollingTimerId),this.removeAllColumns(),this.removeAllRows(),this._sorter.dispose(),this._grid.dispose(),this._snapshot.dispose(),this._connector.dispose(),this._connector=null,this._sharedDataSource||(this._subs&&(this._subs.removeEventListener("postUpdate",this._onQuote2PostUpdate),this._subs.removeEventListener("dataChanged",this._onQ2DataChanged),this._subs.dispose()),this._dc&&this._dc.dispose(),this._dt&&this._dt.dispose(),this._dv&&this._dv.dispose()),this._mainGrid=this._dc=this._dt=this._dv=this._subs=null,this._focusingArgs&&(hn(this._focusingArgs.id),hn(this._focusingArgs.timeoutId),this._focusingArgs=null)},pn.prototype.getElement=function(){return this._topNode},pn.prototype.removeEventListeners=pn.prototype.removeAllEventListeners,pn.prototype.listen=pn.prototype.addEventListener,pn.prototype.initSubscription=function(){if(this._subs)return;if(this._sharedDataSource)return void(this._subs=this._mainGrid._subs);let t,e,n;if(t=window.JET,this._RTK?e=this._RTK.Quotes:t&&(e=t.Quotes2),e&&(n=e.create(),this._RTK&&this._RTK.prefetchWorkaround&&n.addRic("DUMMY.WORKAROUND","DUMMY.WORKAROUND")),!n)return;n.filter&&n.filter(-2,-1),this._subs=n,this._subs.start(),this._subs.addEventListener("postUpdate",this._onQuote2PostUpdate),this._subs.addEventListener("dataChanged",this._onQ2DataChanged);let i=this._getAllRowDefinitions(),o=i.length;for(let t=0;t<o;++t){let e=i[t];e&&e.subscribeForUpdates(n)}},pn.prototype.updateLayout=function(){this._grid.updateLayout(),this._stp.updateSortSymbols()},pn.prototype._updateRowData=function(t){if(t>=0){let e=this._dv.getRowId(t);e&&this._dt.setRowData(e,{})}else this._dt.dispatchGlobalChange()},pn.prototype.updateRowData=pn.prototype._updateRowData,pn.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 n=this._grid.getSectionSettings("content");n.setAutoSyncRowCount(!0),n.setParent(e)},pn.prototype.addHeaderSection=function(t){let e=this._grid.getAllSections("title"),n=this._grid.addSectionAt(e.length,"title",t);return n&&(n.setRowCount(1),this._grid.getSectionSettings(n).disableDataBinding()),n},pn.prototype.addFooterSection=function(t){let e=this._grid.addSection("footer",t);return e&&(e.setRowCount(1),this._grid.getSectionSettings(e).disableDataBinding()),e},pn.prototype.setParent=function(e){t.appendChild(e,this._topNode),this.updateLayout()},pn.prototype.insertBefore=function(t){if(t){let e=t.parentNode;e&&(e.insertBefore(this._topNode,t),this.updateLayout())}},pn.prototype.getRelativePosition=function(t){return this._grid.getRelativePosition(t)},pn.prototype.getCoreGrid=function(){return this._grid},pn.prototype.initialize=function(t){if(!t)return void this.initSubscription();let e=this;e._initializing=!0;let n=e._grid;n.resetInternalState();let i=(t=n.normalizeConfig(t)).plugins||t.extensions,o=t.fields||t.columns;t.defaultColumnOptions&&(e._defaultColumnOptions=t.defaultColumnOptions,e._defaultColumnSetup(e._defaultColumnOptions,o)),e._processExtension(i,"beforeInit",[n.getElement(),t]),t.textSelect&&(e._textSelect=!0,n.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,Mt.setSynapseConfig(e._synapse)),t.fieldCaching&&(e._fieldCaching=t.fieldCaching),null!=t.timeSeriesExpansion&&(e._timeSeriesExpansion=t.timeSeriesExpansion,Mt.disableTimeSeriesExpansion(!e._timeSeriesExpansion)),t.icons&&t.icons.rowGrouping&&t.icons.rowGrouping.expander&&(We.chainIcon=t.icons.rowGrouping.expander),t.formulaEngine&&(e._fnEngine=new lt,e._fnEngine.addEventListener("dataChanged",e._onFormulaDataChanged),e._fnEngine.addEventListener("dataRequired",e._onFormulaDataRequired));let r=t.borders;null!=r&&n.toggleBorders(r);let s=t.gridlines;null!=s&&n.toggleGridlines(s);let l=t.verticalLines;null!=l&&n.toggleVerticalLines(l);let a=t.contentVerticalLines;null!=a&&n.toggleContentVerticalLines(a);let u=t.horizontalLines;null!=u&&n.toggleHorizontalLines(u),t.pageSize&&e._dv.setPageSize(+t.pageSize);let h=+t.rowHeight;h&&n.setDefaultRowHeight(h);let p=+t.headerRowHeight;p&&n.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&&n.enableRowHighlighting(!!c);let _=t.rowExpansionBinding;"function"==typeof _&&(n.listen("rowExpansionBinding",e._onRowExpansionBinding),e.listen("rowExpansionBinding",_)),this.addListener(t,"dataComposed"),this.addListener(t,"beforeContentBinding"),this.addListener(t,"firstRendered"),this.addListener(t,"afterContentBinding"),this.addListener(t,"tabNavigation"),t.autoDateConversion&&(e._autoDateConversion=!0),t.stepScroll&&n.setRowScrollingStep(1),t.linearWheelScrolling&&n.getVScrollbar().setMouseWheelSpeed("linear"),null!=t.autoHideScrollbar&&n.autoHideScrollbars(!!t.autoHideScrollbar),null!=t.scrollbarParent&&e._setScrollbarParent(t.scrollbarParent);let f=t.adcPollingInterval;null!=f&&(e._pollingInterval=f?+f:0),e.setColumns(o);let g=!0;null!=t.rowVirtualRendering&&(g=t.rowVirtualRendering),null!=t.rowVirtualization&&(g=t.rowVirtualization),n.enableRowVirtualization(!!g);let y=!1;null!=t.columnVirtualRendering&&(y=t.columnVirtualRendering),null!=t.columnVirtualization&&(y=t.columnVirtualization),n.enableColumnVirtualization(!!y),null==t.scrollbar||t.scrollbar?e._topNode.style.overflow="hidden":(n.freezeSection(null),e._topNode.style.overflow="");let m=t.topFreezingCount;if("number"==typeof m){m=m>0?m:0;let t=m-1;n.freezeSection(t)}else!1===m&&n.freezeSection(null);let C=t.bottomFreezingCount;if("number"==typeof C&&(C=C>0?C:0,n.freezeFooter(C)),e.addDataFields(t.dataFields),t[bt]=!0,Array.isArray(i)){for(let o=0;o<i.length;++o){let r=i[o],s=null;if(r){let e=r.name;s=e?n.loadPlugin(e,r):n.loadPlugin(r,t)}s&&s.setGridWrapper&&("function"==typeof s.getGridApi&&s.getGridApi()||s.setGridWrapper("realTimeGrid",e))}e._initializing=!1}let S=t.lang;null!=S&&(e._lang=S,e._dateTimeUtil.setLocale(S)),null!=t.childDataField&&(this._childDataField=vt._childDataField=t.childDataField);let w=t.rows;w||(w=t.rics||null);let b=t.bodies;if(!b&&(b=[],t.body&&b.push(t.body),w)){for(let t=0;t<w.length;t++)"string"==typeof w[t]&&(w[t]={ric:w[t]});b.push({rows:w})}let R=t.staticDataRows||t.dataModel;if(w&&R){let t,n,i=R.data?R.data:R,o=R.fields||e.getColumnFields(),r=w.length;for(let e=0;e<r;e++)w[e].values?(t=x(w[e].values,o),n=x(i[e],o),w[e].values=v(t,n)):w[e].values=i[e];i=i.slice(r,i.length),R.data?R.data=i:R=i}for(let t=0;t<b.length;++t)e.insertRows(b[t].rows);e.addStaticDataRows(R),t.contentBottomPadding&&n.setBottomPaddingSection(t.contentBottomPadding);let I=t.contentRightPadding;I&&("number"!=typeof I&&(I=6),n.reserveRightSpace(I));let D=t.dataConflationRate;null!=D&&n.setDataConflationRate(D);let A=n.getPluginList().map(n.getPlugin.bind(n));e._processExtension(A,"afterInit"),e.initSubscription()},pn.prototype.getConfigObject=function(t){let e=t||{},n=e.columns;n||(n=e.columns=[]);let i,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(),i=0;i<o;++i){let t=n[i];t||(t=n[i]={});let e=this.getColumnDefinition(i);e.getConfigObject(t);let o=Mt.getFieldProperty(e.getField(),"timeSeriesParent");o&&!r&&(r=o,t.field=o,delete t.name,delete t.autoGenerated),!o&&r&&(r=null)}e.columns=n=n.filter(nn),""===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=D(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,i=0;i<o;i++)a=h[i],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,i=0;i<o;i++)a=h[i],c=p[i],d.getRowConfigObject(c,a.getRowId());return e},pn.prototype.setDateTimeUtil=function(t){this._dateTimeUtil!==t&&(this._dateTimeUtil=t,this._dateTimeUtil.setLocale(this._lang))},pn.prototype.setLocale=function(t){t&&this._lang!==t&&(this._lang=t,this._dateTimeUtil.setLocale(t),this._grid.requestRowRefresh())},pn.prototype._defaultColumnSetup=function(t,e){let n=e.length;for(let i=0;i<n;i++){let n=e[i];if("object"==typeof n)for(let e in t)null==n[e]&&(n[e]=t[e])}},pn.prototype._processExtension=function(t,e,n){if(Array.isArray(t))for(let i=0;i<t.length;i++)t[i][e]&&t[i][e].apply(t[i],n)},pn.prototype._onRicAdded=function(t){let e=t.addedRics;this._snapshot.addFields(t.fields);let n=e.length;for(let t=0;t<n;++t){let n=e[t],i=this._connector.getRowDefByRic(n),o=i?i.length:0;for(let t=0;t<o;++t)i[t].getSymbol()===n&&this._snapshot.addRic(n)}this._dispatch(t.type,t)},pn.prototype._onRicRemoved=function(t){this._dispatch(t.type,t)},pn.prototype._onFieldAdded=function(t){let e=t.rowDefs,n=t.addedFields;for(let t in e)this._snapshot.addRic(e[t].getSymbol());if(this._snapshot.addFields(n),this._subs){let t=n.filter(Mt.isRealTimeField);t.length>0&&this._subs.addFields(t)}this._dispatch(t.type,t)},pn.prototype._onFieldRemoved=function(t){let e=t.removedFields;this._subs&&this._subs.removeFields(e),this._dispatch(t.type,t)},pn.prototype.insertColumn=function(t,e){let n=this.getColumnCount();(null==e||e>n)&&(e=n);let i=this._initializing?{}:I(this._defaultColumnOptions);if("string"==typeof t)i.field=t;else for(let e in t)i[e]=t[e];this._fnEngine&&(i.formulaEngine=this._fnEngine);let o=new kt(i,this);i[Vt]=o,this._grid.insertColumn(e,i)},pn.prototype._updateTimeSeriesFields=function(t){let e,n,i,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(i in a)n=t.childrenFieldToParent[i],u[n]?u[n].push(i):u[n]=[i];for(n in u){let t,i,l=u[n];for(o=this.getColumnIndex(n),r=this._getColumnDefinition(o),i=l.length,t=0;t<i;t++)e=l[t],s=this.getColumnIndex(e),s<0&&(o=this.getColumnIndex(n),r=this._getColumnDefinition(o),this._cloneTimeSeriesColumn(r,e,o),Mt.addTimeSeriesChild(n,e));this.removeColumn(n)}},pn.prototype._populateTimeSeriesChildren=function(t){if(this._timeSeriesChildConflator.conflate(t))return;let e,n,i,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=Mt.getTimeSeriesChildren(l);if(!a)return;if(i=a.length,i<1)return;for(n=0;n<i;n++)r=this.getColumnIndex(t),o=a[n],this._cloneTimeSeriesColumn(t,o,r)}},pn.prototype._cloneTimeSeriesColumn=function(t,e,n){let i,o;i=t.getConfigObject(),o=I(i),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,n++)},pn.prototype.replaceColumn=function(t,e){let n=this.getColumnIndex(e);if(n<0)return;let i={},o=this._grid,r=o._getColumnDef(n),s=o.getColumnScalability(n);if(i.scalable=s,s=o.getColumnCustomLaneSize(n),i.width=s,s=o.getMinimumColumnWidth(n),s>0&&(i.minWidth=s),s=o.getColumnVisibility(n,0),s||(i.hidden=!0),s=r.stationary,s&&(i.stationary=s),s=r.leftPinned,s&&(i.leftPinned=s),s=r.rightPinned,s&&(i.rightPinned=s),"string"==typeof t)i.field=t;else for(let e in t)i[e]=t[e];t.width&&!t.scalable&&(i.scalable=!1),t.scalable&&!t.width&&(i.width=1);let l=this.getColumnDefinition(n);l&&null==i.id&&(i.id=l.getId()),this._grid.startBatch("reset"),this.removeColumn(n),this.insertColumn(i,n),this._grid.stopBatch("reset")},pn.prototype._onFieldLoadedSuccess=function(t,e,n){if(this._connector&&n&&n.id){let i=n;e&&e.getField()===t&&e.isDefaultName()&&i.name&&(e.setName(i.name),this.updateColumnTitle())}},pn.prototype._onFieldLoadedError=function(t){},pn.prototype._onFieldLoaded=function(t,e){if(this._connector){if(Mt.isTimeSeries(t)){let t=this.getColumnDefinitionById(e);this._populateTimeSeriesChildren(t)}this._connector.addFields(t,e)}},pn.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)},pn.prototype.getFieldInfo=function(t){return Mt.getFieldInfo(t)},pn.prototype.loadFieldInfo=function(t){return Mt.loadFieldInfo(t)},pn.prototype._shouldLoadFieldInfo=function(t){let e=this._RTK||window.JET;return!(!e||!this._fieldCaching||(e=Mt.hasFieldInfo(t),e||(e=Mt.isAdc(t)||Mt.isRealTimeField(t),!e)))},pn.prototype.setColumns=function(t){let e=this._grid,n=t?t.length:0;if(e.startBatch("reset"),this.removeAllColumns(),n>0){let i=!1;n>1&&(i=e.freezeLayout(!0));for(let e=0;e<n;++e)this.insertColumn(t[e],e);n>1&&e.freezeLayout(i)}e.stopBatch("reset")},pn.prototype.restoreColumns=function(t,e){let n=this._grid;n.startBatch("reset");let i,o,r,s=this.getConfigObject().columns,l=s.length,a=t.length,u=e?an:T,h=[],p=[],d=[];for(i=0;i<l;i++){for(r=!1,o=0;o<a;o++)if(u(s[i],t[o])){p.push(s[i]),r=!0;break}r||h.push(i)}this.removeColumns(h);let c=p.length,_=!1;for(a>1&&(_=this._grid.freezeLayout(!0)),i=0;i<a;i++){for(r=!1,o=0;o<c;o++)if(u(t[i],p[o])){r=!0;let e=this.getColumnIndex(t[i].id||t[i].field);d.push(this.getColumnId(e));break}r||(this.insertColumn(t[i],i),d.push(this.getColumnId(i)))}a>1&&this._grid.freezeLayout(_),n.reorderColumns(d),n.stopBatch("reset")},pn.prototype.setFields=pn.prototype.setColumns,pn.prototype._onColumnAdded=function(t){let e=t.context[Vt];delete t.context[Vt];let n=t.colIndex,i=this._grid._getColumnDef(n);e._setCoreColumnDef(i);let o=this._grid.getColumnData(n);o||(o=this._grid.setColumnData(n,{})),o[Vt]=e;let r=e.getUserModel();this._grid.setColumnDataBindingHandler(n,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(n,s,t)}else this._grid.setColumnWidth(n,1,!0);s=r.minWidth,s>=0&&this._grid.setMinimumColumnWidth(n,s),s=r.hidden,s&&this._grid.hideColumn(n,!0),s=r.textAlign||r.alignment,"string"==typeof s&&this._grid.setColumnAlignment(n,s),r.keepModel||e.clearUserModel(),e.isTextSelect()&&this._grid.enableColumnClass(n,"tr-text-select",!0,"content");let l,a=e.getClasses();for(l=0;l<a.length;l++)this._grid.enableColumnClass(n,a[l]);let u=e.getField();this._grid.setDataColumnName(n,bt);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():kt.getDataType(h),d=Mt.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))},pn.prototype.removeColumn=function(t){let e=this.getColumnIndex(t);if(e<0)return;let n=this.getColumnDefinition(e);this._grid.removeColumnAt(e),this._connector.removeFields(n),n.dispose()},pn.prototype.removeColumns=function(t){let e=this.getColumnIndices(t),n=e.length;if(n<=1)return void(1===n&&this.removeColumn(e[0]));e.sort(pn._descendingOrder);let i=this._grid.freezeLayout();for(let t=0;t<n;++t){let n=e[t],i=this.getColumnDefinition(n);i.dispose(),this._grid.removeColumnAt(n),this._connector.removeFields(i)}this._grid.freezeLayout(i)},pn.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)}},pn.prototype.moveColumn=function(t,e){return this._grid.moveColumn(t,e)},pn.prototype.moveColumnById=function(t,e){return this._grid.moveColumnById(t,e)},pn.prototype.reorderColumns=function(t,e){return this._grid.reorderColumns(t,e)},pn.prototype.hideColumn=function(t,e){let n=this.getColumnIndex(t);n<0||this._grid.hideColumn(n,e)},pn.prototype.hideColumns=function(t,e){this._grid.hideColumns(this.getColumnIndices(t),e)},pn.prototype.showAllColumns=function(){this._grid.showAllColumns()},pn._descendingOrder=function(t,e){return e-t},pn.prototype.addDataFields=function(t,e){if(!t)return!1;let n,i,o,r,s,l=Array.isArray(t)?t:[t],a=l.length;for(n=0;n<a;n++)i=l[n],this._shouldLoadFieldInfo(i)?(o=kt.getDataType(i),r=Mt.loadFieldInfo(i).catch(this._onFieldLoadedError),o?this._connector.addFields(i,e||"grid"):(s=this._onFieldLoaded.bind(this,i,e),r=r.then(s).catch(s))):this._connector.addFields(i,e||"grid");return!0},pn.prototype.removeDataFields=function(t,e){return!!t&&(this._connector.removeFields(t,e||"grid"),!0)},pn.prototype.removeFieldReferrer=function(t){t&&this._connector.removeFieldReferrer(t)},pn.prototype.sortColumn=function(t,e){if("string"==typeof t)return void this._stp.sortColumn(t,e);let n=this.getColumnIndex(t);n<0?this._stp.sortColumn(this.getSortedColumnIndex(),"n"):this._stp.sortColumn(n,e)},pn.prototype.setColumnName=function(t,e){let n=this.getColumnDefinition(t);n&&(n.setName(e),this.updateColumnTitle())},pn.prototype.getColumnBackgroundColor=function(t){let e=this.getColumnDefinition(t);return e?e.getBackgroundColor():""},pn.prototype.setColumnBackgroundColor=function(t,e){let n=this.getColumnDefinition(t);n&&n.setBackgroundColor(e)},pn.prototype.setColumnRenderer=function(t,e){let n=this.getColumnIndex(t);this.setColumnFormatter(n,e)},pn.prototype.activateColumnRenderer=function(t,e,n){let i=this.getColumnIndex(t);if(null==i)return;let o=this.getColumnDefinition(i);o&&(o.activateRenderer(e,n),this._grid.setColumnDataBindingHandler(i,o.getRenderer()),this._grid.requestRowRefresh())},pn.prototype.setColumnFormatter=function(t,e){if(null==t)return;let n=this.getColumnDefinition(t);if(!n)return;let i=null;if(e&&("object"==typeof e?("function"==typeof e.init&&e.init(n.getConfigObject(),this._grid),i=e.binding):i=e,"function"!=typeof i&&(i=null)),i!==n.getRenderer()){let e=this._grid.getSection("content").getColumn(t);e&&e.clearContent(),this._grid.setColumnDataBindingHandler(t,null),n.setRenderer(i),this._grid.setColumnDataBindingHandler(t,n.getRenderer()),this._grid.requestRowRefresh()}},pn.prototype.setColumnSorter=function(t,e){let n=this.getColumnIndex(t),i=this.getColumnDefinition(n);i&&(i.setSorter(e),this.getSortedColumnIndex()===n&&this._stp.refresh())},pn.prototype._initDuplicateRicData=function(t){if(!t)return;let e=this._connector.getRowDefByRic(t.getSymbol());if(e&&e.length>0){let n=e[0];if(t.copyRowData(n),t.isChain()){let e=n.getChildren();e&&e.length>0&&setTimeout(this._cloneChain.bind(this,t),0)}}},pn.prototype._cloneChain=function(t){let e=this._connector.getRowDefByRic(t.getSymbol()),n=e?e[0]:null,i=n?n.getChildren():null,o=i?i.length:0;if(o<0)return;let r=t.getSubId();if(!r)return;let s={subId:r};for(let t=0;t<o;t++){let e=i[t];s.ric=e.getRic(),s.values=e.cloneRowData(),s.values.SUB_ID=r,this._onQ2DataChanged(s)}},pn.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 n=new vt(t);return n.setDataSource(this._dc,this._subs)&&(this._hasNewUpdates=!0),n.registerToView(this._dv,this._getRowId(e)),this._initDuplicateRicData(n),t&&t.hidden&&this._dv.hideRow(n.getRowId()),this._connector.addRic(n),n},pn.prototype.insertSegmentSeparator=function(t,e){return t||(t={}),"object"==typeof t?(t.asSegment=!0,this.insertRow(t,e)):null},pn.prototype.insertRows=function(t,e,n){if(this._mainGrid)return void this._mainGrid.insertRows(t,this._getRowId(e));if(!Array.isArray(t))return;let i=this._dt.freeze(),o=n||this.getColumnFields(),r=this._getRowId(e),s=t.length;for(let e=0;e<s;++e){let n=t[e];n&&("string"==typeof n&&(n={ric:n}),n.fields=o),this.insertRow(n,r)}this._dt.freeze(i)},pn.prototype.addStaticDataRows=function(t,e){if(this._mainGrid)this._mainGrid.addStaticDataRows(t,e);else{if(!Array.isArray(t)){let n=t;t=null,n&&(n.fields&&!e&&(e=n.fields),Array.isArray(n.data)&&(t=n.data))}t&&this.insertRows(t.map(pn._dataToRowOptions),null,e)}},pn.prototype.updateDataSet=function(t,e){if(!Array.isArray(t)||0===t.length)return void this.removeAllRows();let n,i,o,r,s=t.length,l="ROW_ORDER",a={},u=this.getAllRowDefinitions(),h=u.length,p=!1;if(e){for(p=this._dt.freeze(),r=0;r<h;r++)n=u[r],n&&(i=n.getRowData()[e],i||0===i?a[i]=n:this.removeRow(n));let d={},c={};for(r=s-1;r>=0;r--)o=t[r],i=o[e],n=a[i],c[i]=o,o[l]=r,d[i]||(d[i]=!0,n?n.setRowData(o):this.insertRow({values:o}));for(let t in a)a[t]&&!c[t]&&this.removeRow(a[t]);this._dt.sortOnce(bt,"a",on,l),this._dt.freeze(p)}else{for((s-h>1||h-s>1)&&(p=this._dt.freeze()),r=0;r<h;r++)o=t[r],o?a[r]=u[r]:this.removeRow(u[r]);for(r=0;r<s;r++)o=t[r],n=a[r],n?n.setRowData(o):this.insertRow({values:o});(s-h>1||h-s>1)&&this._dt.freeze(p)}},pn._dataToRowOptions=function(t){return{values:t}},pn.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},pn.prototype.removeRows=function(t){let e,n;if(!Array.isArray(t))return e=this.removeRow(t),e?[e]:[];if(this._mainGrid)return this._mainGrid.removeRows(t.map(this._getRowId));let i=[],o=t.length;for(n=0;n<o;++n)e=this._getRowDefinitionByRef(t[n]),e&&(e.isAutoGenerated()||i.push(e));o=i.length;let r=!1;for(o>1&&(r=this._dt.freeze()),n=0;n<o;++n)this._removeRow(i[n]);return o>1&&this._dt.freeze(r),i},pn.prototype.removeAllRows=function(){if(this._sharedDataSource)return;if(!this._dt.getRowCount())return;let t=this._getAllRowDefinitions();this._dc.clearAllData(),this._dt.clearAllData(),this._dt.setClassificationSource(this._dc),this._clearDataUpdates(),t.forEach(vt.dispose),this._dcConflator.reset(),this._formulaConflator.reset(),this._chainConflator.reset(),this._constituentMap=null,this._connector.removeAllRics(),this._grid.getVScrollbar().setScrollTop(0)},pn.prototype._removeRow=function(t){if(this._sharedDataSource)return;this._dispatch("beforeRowRemoved",{});let e=t.getDescendants();e&&this._removeConstituentRows(e),this._connector.removeRic(t),this._dt.removeRow(t.getRowId()),t.dispose()},pn.prototype._removeConstituentRows=function(t){let e=this._connector,n=[];for(let i=0;i<t.length;i++){let o=t[i];n.push(o.getRowId()),e.removeRic(o),o.dispose()}this._dt.removeRows(n)},pn.prototype.hideRow=function(t,e){let n=this._getRowId(t);(this._mainGrid||this._grid).hideRow(n,e)},pn.prototype.hideRows=function(t,e){Array.isArray(t)||(t=[t]);let n=t.map(this._getRowId);(this._mainGrid||this._grid).hideRows(n,e)},pn.prototype.showRows=function(t,e){this.hideRows(t,!1===e)},pn.prototype.unhideAllRows=function(){this._grid.unhideAllRows()},pn.prototype.hasHiddenRow=function(){return this._grid.hasHiddenRow()},pn.prototype.setRic=function(t,e,n){if(this._mainGrid)return this._mainGrid.setRic(this._toRowId(t),e,n);let i=this._getRowDefinitionByRef(t);if(i){let t=n||{};"string"==typeof e?t.ric=e:(e&&!n&&(t=e),e=t.ric?t.ric:"");let o=vt.extractRowOptions(t),r=i.getSymbol();i.setContent(e,o)&&(this._connector.removeRic(i,r),this._initDuplicateRicData(i),this._connector.addRic(i));let s=t.values;null!=s&&i.setStaticRowData(s,t.fields)}return i},pn.prototype.unlinkChain=function(t){let e=this._getRowDefinitionByRef(t);if(!e)return;if(!e.isChain())return;let n=e.getDescendants();if(n){let t=n.length,i={};for(let e=0;e<t;e++)i[n[e].getRic()]="";let o=e.isChainCollapsed(),r={chain:e,collapsed:o,ridMap:i};if(this._dispatch("beforeUnlinked",r),o)this._removeConstituentRows(n);else{let e=!1,o={};for(let r=0;r<t;r++){let t=n[r],s=i[t.getRic()];s&&(s.match(vt.ROW_ID_PATTERN)?(console.warn("Please change the rowId format to avoid duplicated rows' id causing unexpected behavior."),s=""):(e=!0,o[t.getRowId()]=s)),t.toRealTimeRow(s)}e&&(this._dc.replaceRowIds(o),this._dt.replaceRowIds(o))}}e.unlinkChain()},pn.prototype.setRowContent=pn.prototype.setRic,pn.prototype.toggleRowExpansion=function(t,e){this._dv.toggleRowExpansion(t,e)},pn.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)}},pn.prototype.setRics=function(t){this.removeAllRows(),t&&t.length&&this.insertRows(t)},pn.prototype.getRowCount=function(){return this._dv.getRowCount()},pn.prototype.getPageItemCount=function(){return this._dv.getRowCount(!1,!0)},pn.prototype.getDataRowCount=function(){return this._dt.getRowCount()},pn.prototype.getColumnCount=function(){return this._grid.getColumnCount()},pn.prototype.getColumnDataType=function(t){let e=this.getColumnDefinition(t);return e?e.getDataType():""},pn.prototype.getColumnDefinition=function(t){let e=this._grid.getColumnData(t);return e&&e[Vt]||null},pn.prototype.getColumnDefinitions=function(){let t=this.getColumnCount(),e=new Array(t);for(let n=0;n<t;n++)e[n]=this.getColumnDefinition(n);return e},pn.prototype.getColumnDefinitionById=function(t){return"string"==typeof t?this.getColumnDefinition(this.getColumnIndex(t)):null},pn.prototype.getColumnDefinitionsById=function(t){let e=Array.isArray(t)?t.length:0;if(e>0){let n,i,o=new Array(e);for(n=0;n<e;n++)i=t[n],o[n]=this.getColumnDefinitionById(i);return o}return null},pn.prototype._getColumnDefinition=function(t){if(t instanceof kt)return t;if("number"==typeof t)return this.getColumnDefinition(t);if("string"==typeof t){let e=this.getColumnCount();for(let n=0;n<e;++n){let e=this.getColumnDefinition(n);if(ln(e,t))return e}}return null},pn.prototype.getRowType=function(t){let e=this.getRowDefinition(t);return e?e.getType():""},pn.prototype.getRowDefinition=function(t){return"number"==typeof t?this._getRowDefinitionByIndex(t):"string"==typeof t?this._getRowDefinitionById(t):null},pn.prototype._getRowDefinitionByIndex=function(t){return this._dv.getDataAt(t,bt)||null},pn.prototype._getRowDefinitionById=function(t){return this._dt.getData(t,bt)||null},pn.prototype._getRowDefinitionByRef=function(t){return t instanceof vt&&t.getRowId()?t:this.getRowDefinition(t)},pn.prototype.getRowDefinitions=function(){return this._dv.getColumnData(bt,!0)},pn.prototype._getAllRowDefinitions=function(){return this._dt.getColumnData(bt)},pn.prototype.getAllRowDefinitions=function(t){return t?this._getAllRowDefinitions():this._dt.getColumnData(bt).filter(en)},pn.prototype.getRowData=function(t){return tn(this._getRowDefinitionByIndex(t))},pn.prototype.getMultipleRowData=function(t){if("number"==typeof t)return[this.getRowData(t)];let e=null;if(Array.isArray(t)){let n=t,i=n.length,o=new Array(i);e=this.getRowDefinitions();for(let t=0;t<i;++t){let i=n[t];"number"==typeof i?o[t]=tn(e[i]):i&&i.getRowData&&(o[t]=tn(i))}return o}return e=t&&t.getColumnData?t.getColumnData(bt,!1):this.getRowDefinitions(),e.map(tn)},pn.prototype.setRicData=function(t,e){let n=this._connector.getRowDefByRic(t),i=n?n.length:0;for(let o=0;o<i;++o){let i=n[o];i&&i.getSymbol()===t&&i.setRowData(e)}},pn.prototype.getAllRics=function(){return this._connector.getAllRics()},pn.prototype.hasRic=function(){return this._connector.hasRic()},pn.prototype.getRic=function(t){return this.getRowDefinition(t).getRic()},pn.prototype.setRowData=function(t,e){let n=this._getRowDefinitionByRef(t);n&&n.setRowData(e)},pn.prototype.setStaticRowData=function(t,e){let n=this._getRowDefinitionByRef(t);n&&n.setStaticRowData(e)},pn.prototype.setStaticData=function(t,e,n){let i=this._getRowDefinitionByRef(t);i&&i.setStaticData(e,n)},pn.prototype._getRowId=function(t){return"string"==typeof t?t:"number"==typeof t?this._dv.getRowId(t):t instanceof vt?t.getRowId():""},pn.prototype.clearColumnData=function(t){let e=this.getColumnIndices(t),n=e.length;if(!n)return;let i={};for(let t=0;t<n;++t){let n=e[t],o=this.getColumnField(n);o&&(i[o]=null)}let o=this.getAllRowDefinitions(),r=o.length;for(let t=0;t<r;++t)o[t].setRowData(i)},pn.prototype.getColumnIndex=function(t){if(t instanceof kt){let e=this.getColumnCount();for(let n=0;n<e;++n)if(this.getColumnDefinition(n)===t)return n;return-1}return this._grid.getColumnIndex(t)},pn.prototype.getColumnIndices=function(t){let e=[];if(t||0===t){let n=this.getColumnCount(),i=Array.isArray(t)?t:[t],o=i.length;for(let t=0;t<o;++t){let o=this.getColumnIndex(i[t]);o>=0&&o<n&&e.push(o)}}return e},pn.prototype.getColumnId=function(t){return this._grid.getColumnId(t)},pn.prototype.getColumnIds=function(){return this._grid.getColumnIds()},pn.prototype.getColumnField=function(t){return this._grid.getColumnField(t)},pn.prototype.getColumnFields=function(){return this._grid.getColumnFields()},pn.prototype.getColumnNames=function(){return this.getColumnDefinitions().map(sn)},pn.prototype.getAllFields=function(){return this._connector.getAllFields()},pn.prototype.freezeColumn=function(t,e){null==t&&(t=-1),this._grid.freezeColumn(t,e)},pn.prototype.pinColumn=function(t,e){if(Array.isArray(t)){let n=t,i=n.length,o=0;for(let t=0;t<i;++t)o|=this._pinColumn(n[t],e);return!!o}return this._pinColumn(t,e)},pn.prototype._pinColumn=function(t,e){let n=this.getColumnIndex(t),i=this.getColumnCount();if(n<0||n>i)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(n>=t)return!1;if(s>=0&&n<=s)return!1;this.moveColumnById(n,t),r+=1,o-=1}else{if(n<o)return!1;o||s>=0&&(o=s,n>s&&o++),this.moveColumnById(n,o)}return this._grid.freezeColumn(o,r),!0},pn.prototype.unpinColumn=function(t,e){if(Array.isArray(t)){let n=t,i=0;for(let t=n.length;--t>=0;)i|=this._unpinColumn(n[t],e);return!!i}return this._unpinColumn(t,e)},pn.prototype._unpinColumn=function(t,e){let n=this.getColumnIndex(t);if(n<0)return!1;let i=this._grid.getPinnedLeftColumnCount(),o=this._grid.getPinnedRightColumnCount(),r=this.getColumnCount()-o;if(n>=i&&n<r)return!1;let s=null,l=null;if(null!=e){let t=this.getColumnIndex(e);l=this.getColumnId(t),s=this.getColumnId(n)}let a=this._grid.getStationaryColumnIndex();return n<i?(n>a&&this.moveColumnById(n,i),this._grid.freezeColumn(i-2,o)):n>=r&&(n>a&&this.moveColumnById(n,r),this._grid.freezeColumn(i-1,o-1)),n>a&&null!=l&&this.moveColumnById(s,l),!0},pn.prototype.unpinAllColumns=function(){let t=this._grid.getPinnedLeftColumnCount(),e=this._grid.getPinnedRightColumnCount();return!(!t&&!e||(this._grid.freezeColumn(-1,0),0))},pn.prototype._onColumnHeaderBinding=function(t){if("title"!==t.sectionType||t.sectionIndex>0)return;let e=t.fromColIndex,n=t.toColIndex;for(;e<n;)this._renderColumnHeader(e++,t)},pn.prototype._renderColumnHeader=function(t,e){let n=this.getColumnDefinition(t);if(!n)return;let i=n.getHeaderRenderer(),o=e.section,r=o.getRowCount();e.colIndex=t,e.columnDef=n;let s=n.getName(),l=n.getTooltip(),a=n.getHeaderAlignment(),u=n.getTooltipValue();for(let n=0;n<r;++n){let r=o.getCell(t,n,!1);r.setContent(s),r.setTooltipInfo("columnDefault",u),r.setTooltipInfo("columnTooltip",l),r.updateTooltip(),r.setStyle("textAlign",a),i&&(e.rowIndex=n,e.cell=r,i(e))}},pn.prototype.updateColumnTitle=function(){if(this._columnTitleConflator.conflate())return;let t=this._grid.getSectionSettings("title");t&&t.rerender()},pn.prototype.isSorting=function(){return this._stp.isSorting()},pn.prototype.getSortedColumnIndex=function(){return this._stp.getSortedColumnIndex()},pn.prototype.getSortOrder=function(){return this._stp.getSortOrder()},pn.prototype.clearSort=function(){this._stp.clearSortState()},pn.prototype.getSortingStates=function(){let t=[],e=this._stp.getSortingStates(),n=e.length;for(let i=0;i<n;i++){let n=e[i],o=this._stp.getSortedColumnIndex(i);t.push({colId:this.getColumnId(o),colIndex:o,order:n.sortOrder})}return t},pn.prototype._onQuote2PostUpdate=function(t){t.childOrderChange&&(this.isSorting()||this._dt.sortOnce("ROW_DEF","a",rn))},pn.prototype._onQ2DataChanged=function(t){let e=this._getRowDefinitionById(t.subId);if(!e)return;let n=t.ric,i=t.values;if(i){let t=null;if(e.verifyConstituent(n)){let i=e,o=i.getConstituent(n);if(o)e=o;else{if(e=o=i.addConstituent(n),!o)return;t=this._connector.getRowDefByRic(n),this._connector.addRic(o),this._constituentMap||(this._constituentMap={}),this._constituentMap[o.getRowId()]=o,this._registerConstituents(o)}}t&&t.length&&t[0].cloneRowData(i,i),e.setRowData(i)}else{let t=e.getConstituent(n);t&&(t.setParent(null),this._removeRow(t))}},pn.prototype._registerConstituents=function(t){if(this._chainConflator.conflate(t))return;this._constituentMap=null;let e=this._dv,n=e?e.getDataSource():null;if(!n)return;let i,o=this._chainConflator.popAllData(),r=o?o.length:0,s=[],l={};for(i=0;i<r;++i){let t=o[i],e=t.getParent();if(!e)break;let n=e.getRowId(),r=l[n];null==r&&(r=l[n]=e.countChildInView()),s.push(t)}if(r=s.length,!r)return;let a=!1;for(r>1&&(a=this._dt.freeze()),i=0;i<r;++i){let t=s[i],o=t.getParent().getRowId(),r=l[o];e.addSegmentChild(o,t.getRowId());let a=n.getRowIndex(o)+1,u=t.getData("CHILD_ORDER");a+=null!=u&&u<r?u:r;let h=n.getRowId(a);t.registerToView(e,h),l[o]=r+1}r>1&&this._dt.freeze(a)},pn.prototype._onDataChanged=function(t){if(this._dt){if(t){if(t.initialChanges&&!this._dt.hasSegmentClassification())return;if(t.rid&&t.changes){let e=this._getRowDefinitionById(t.rid);e&&e.addUpdate(t.changes)&&(this._hasNewUpdates=!0)}}this._dcConflator.conflate()||(this._dt.classifySegments(),this._dt.dispatchGlobalChange())}},pn.prototype._onPreDataSorting=function(t){let e=this._stp.getSortedColumns();if(this._sorter.reset(),Array.isArray(e)){let t=e.length;for(let n=0;n<t;++n){let t=e[n],i=t.field||"",o=t.colIndex,r=o>=0?this.getColumnDefinition(o):null,s=!1,l=null;r&&(i=r.getField(),s=r.isRowSorting(),l=r.getSorter()),this._sorter.addColumnContext(i,l,s,t.sortOrder,o,r)}}this._columnSorter=this._sorter.getSorter()},pn.prototype._mainSorter=function(t,e,n){return this._columnSorter(t,e,n)},pn.prototype._onPostSectionDataBinding=function(t){t.actualUpdate&&this._asyncClearDataUpdates()},pn.prototype._asyncClearDataUpdates=function(){setTimeout(this._clearDataUpdates,0)},pn.prototype._clearDataUpdates=function(){if(!this._dt||!this._hasNewUpdates)return;this._hasNewUpdates=!1;let t=this._dt.getAllRowIds(!0);for(let e=t.length;--e>=0;)this._dt.getRowData(t[e])[bt].resetUpdates()},pn.prototype.getDataView=function(){return this._dv},pn.prototype.setPage=function(t){return this._dv.setPage(t)},pn.prototype.setPageSize=function(t){this._dv.setPageSize(t)},pn.prototype.getPageIndex=function(){return this._dv.getPageIndex()},pn.prototype.getPageSize=function(){return this._dv.getPageSize()},pn.prototype.getPageCount=function(){return this._dv.getPageCount()},pn.prototype.toggleChain=function(t){let e=this._getRowDefinitionByRef(t);e&&e.toggleChain()},pn.prototype.setClassification=function(t,e){let n=this._getRowDefinitionByRef(t);return!!n&&this._dt.setSegmentClassification(n.getRowId(),e)},pn.prototype.contains=function(t){return!!t&&this._topNode.contains(t)},pn.prototype.isFocused=function(){let t=document.activeElement;return t&&t.shadowRoot?t.shadowRoot===this._topNode.parentNode:this.contains(t)},pn.prototype.focus=function(){this._grid.focus()},pn.prototype.requestRowRefresh=function(){this._grid.requestRowRefresh()},pn.prototype.updateLayout=function(){this._grid.updateLayout()},pn.prototype.getExtension=function(t){return t?this._grid.getPlugin(t.replace(/Extension/gi,"")):null},pn.prototype._onFormulaDataChanged=function(t){this._formulaConflator.conflate()||(this._recalculateFormulas(),this._updateRowData())},pn.prototype._onFormulaDataRequired=function(t){},pn.prototype._onDataComposed=function(t){let e=t.changes;if(!e){if(!t.initialChanges)return;e=t.changes=t.initialChanges}let n=t.rowData;if(!n)return;let i=t.rid,o=t.rowDef||this._getRowDefinitionById(i);if(!o){if(o=this._constituentMap?this._constituentMap[i]:null,!o)return;if(o.isDisposed())return void(this._constituentMap[i]=null)}if(this._autoDateConversion){let t;for(let i in e){let e=this._getColumnDefinition(i);if(t=e?e.getDataType():kt.getDataType(i),"datetime"===t){let t=n[i];o.setData(i+"_RAW",t),t=J.toDateObject(t),o.setData(i,t)}}}this.hasListener("dataComposed")&&(t.grid=this,t.rowDef=o,this._dispatch("dataComposed",t)),this._recalculateFormulas(t)},pn.prototype._onSubSegmentChanged=function(t){let e,n=t.insertionList,i=t.removalList,o=t.removedRows,r=i.length,s=null;for(e=0;e<r;e++){let t=o[i[e]];t&&(s=t[bt],s&&(s.dispose(),t[bt]=null))}let l=n.length;for(e=0;e<l;e++){let t=n[e].getId();s=new vt({segmentId:t}),s.setDataSource(this._dc)&&(this._hasNewUpdates=!0),s.registerToView(this._dv)}},pn.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 n=0;n<e;++n)this._fnEngine.calculate(t[n])}},pn.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()},pn.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)}},pn.prototype._onPollingInterval=function(){this._pollingTimerId=0,this._pollingEnabled&&this._pollingInterval&&(this.refreshADCData(),this._startPolling())},pn.prototype.activateADCPolling=function(t){if(!1!==t){this._pollingEnabled=!0;let t=new Date;this._lastPollingRequest&&t.getTime()-this._lastPollingRequest>this._pollingInterval&&this.refreshADCData(),this._startPolling()}else this._pollingEnabled=!1},pn.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)},pn.prototype._onAutoLayoutUpdate=function(){let t=this._topNode.clientWidth;t!==this._clientWidth&&(this._clientWidth=t,this.updateLayout())},pn.prototype.logDT=function(t){let e=this._getAllRowDefinitions();this._logData(e,t)},pn.prototype.logDV=function(t){let e=this.getRowDefinitions();this._logData(e,t)},pn.prototype._logData=function(t,e){e||(e={}),e.colNames||(e.colNames=this.getColumnFields());let n=_t.constructTable(t.map(tn),e);console.table(n)},pn.prototype.replaceRow=function(t,e){let n=this._getRowId(t),i=this._getRowDefinitionById(n);if(i){if(i.isAutoGenerated())return null;let t=i.getConfigObject();if(i.getRowId()===e.rowId)return null;if(T(t,e))return null}let o=this.insertRow(e,n);return i&&this.removeRow(n),o},pn.prototype.scrollToColumn=function(t,e){return this._grid.scrollToColumn(t,e)},pn.prototype.scrollToRow=function(t,e){this._grid.scrollToRow("content",t,e)},pn.prototype.getScrollLeft=function(){return this._grid.getScrollLeft()},pn.prototype.getScrollTop=function(){return this._grid.getScrollTop()},pn.prototype.setScrollLeft=function(t){this._grid.setScrollLeft(t)},pn.prototype.setScrollTop=function(t){this._grid.setScrollTop(t)},pn.prototype.scrollRight=function(t){this._grid.scrollRight(t)},pn.prototype.scrollDown=function(t){this._grid.scrollDown(t)},pn.prototype.getScrollWidth=function(){return this._grid.getScrollWidth()},pn.prototype.getScrollHeight=function(){return this._grid.getScrollHeight()},pn.prototype.getVScrollView=function(){return this._grid.getVScrollView()},pn.prototype._focusCell=function(t,e){if(t){let n=t.getContent();if(n){let i=null;if(this.hasListener("tabNavigation")){let o={shiftKey:e.shiftKey,activeElement:e.activeElement,cellContent:n,cell:t,colIndex:e.colIndex,rowIndex:e.rowIndex,field:e.fields?e.fields[e.colIndex]:""};this._dispatch("tabNavigation",o),i=o.nextFocusableElement}else"SPAN"!==n.tagName&&(i=n);if(i&&i!==e.activeElement&&!i.disabled)return i.focus(),!0}}return!1},pn.prototype._onVScroll=function(){let t=this._focusingArgs;if(t){t.timeoutId=hn(t.timeoutId),this._focusingArgs=null;let e=this._grid.getCell("content",t.colIndex,t.rowIndex);this._focusCell(e,t)||(t.shiftKey?this._focusPrevCellContent(t):this._focusNextCellContent(t))}},pn.prototype._onScrollTimeout=function(){this._focusingArgs=null},pn.prototype._selfScrollToRow=function(){let t=this._focusingArgs;t&&(t.id=0,this.scrollToRow(t.rowIndex))},pn.prototype._requestScroll=function(t){this._focusingArgs||(this._focusingArgs=t,t.event=null,t.id=setTimeout(this._selfScrollToRow,0),t.timeoutId=setTimeout(this._onScrollTimeout,100))},pn.prototype._focusNextCellContent=function(t){let e=t.colIndex,n=t.rowIndex;if(n<0||null==n)return;let i,o=t.focusableColIndices,r=o.length,s=0;if(e>=0)for(i=1;i<r&&!(e<o[i]);i++)s=i;let l=this._grid,a=l.getSection("content"),u=l.getVerticalViewInfo().lastFullRow,h=this.getRowCount();t.fields=l.getColumnFields();for(let e=n;e<h;e++){for(t.rowIndex=e,i=s;i<r;i++){let n=o[i];if(t.colIndex=n,e>u)return un(t.event),void this._requestScroll(t);{let i=a.getCell(n,e);if(this._focusCell(i,t))return void un(t.event)}}s=0}this._grid.getHiddenInput().focus()},pn.prototype._focusPrevCellContent=function(t){let e=t.colIndex,n=t.rowIndex;if(n<0||null==n)return;let i,o=t.focusableColIndices,r=o.length,s=r-1;if(e>=0)for(i=r-1;--i>=0&&!(e>o[i]);)s=i;let l=this._grid,a=l.getSection("content"),u=l.getVerticalViewInfo().firstFullRow;t.fields=this.getColumnFields();for(let e=n;e>=0;e--){for(t.rowIndex=e,i=s;i>=0;i--){let n=o[i];if(t.colIndex=n,e<u)return un(t.event),void this._requestScroll(t);{let i=a.getCell(n,e);if(this._focusCell(i,t))return void un(t.event)}}s=r-1}this._grid.getHiddenInput(!0).focus()},pn.prototype._onTabNavigation=function(t){if(this._focusingArgs)return;let e=this.getColumnDefinitions(),n=e.length,i=[];for(let t=0;t<n;t++)e[t].isFocusable()&&i.push(t);if(!i.length)return;let o=t.event,r=this.getRelativePosition(o),s=r.rowIndex;if(t.onTheEdge){let t=this._grid.getVerticalViewInfo();s=o.shiftKey?t.lastFullRow:t.firstFullRow}let l={event:o,shiftKey:o.shiftKey,colIndex:r.colIndex,rowIndex:s,focusableColIndices:i,activeElement:t.activeElement};o.shiftKey?this._focusPrevCellContent(l):this._focusNextCellContent(l)},pn.prototype._getEventHandlers=function(){return{tabNavigation:this._onTabNavigation,q2DataChanged:this._onQ2DataChanged}};let dn={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"]};dn.words=dn.texts.join(" ").split(" ").filter((function(t){return t.length>1})),dn.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"],dn.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"],dn.market=["NYSE","NASDAQ","SET","DJI","HSCEI","HKEX","NIKKEI"],dn.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"}];const cn=dn;let _n=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10],fn={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:{type:"set",members:["USD","GBP","EUR","JPY","THB"]},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},CHILD_ORDER:{type:"set",ignore:!0,members:[void 0]},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,null,NaN]},falsyValues:{type:"set",members:[void 0,null,NaN,0,!1,""]},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?Rn(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:cn.companyName},industry:{type:"set",members:cn.industry},market:{type:"set",members:cn.market},country:{type:"set",members:cn.country}},gn=function(t,e){if(t){let n=e;"function"==typeof e&&(n={type:"function",generate:e}),fn[t]=n}},yn=function(t,e,n,i){t||(t=0),null==e&&(e=100);let o=(e-t)*function(t){return"number"==typeof t?function(t){let e=1e4*Math.sin(113*t);return e*=e,e-(0|e)}(t):Math.random()}(i)+t;if(n>0){let t=_n[n];return Math.floor(o*t)/t}return null!=n?Math.floor(o):o},mn=function(t,e,n){return yn(t,e+1,0,n)},Cn=function(t,e,n){return yn(t,e,0,n)},Sn=function(t,e){return Cn(0,t,e)},wn=function(t){return 0===mn(0,1,t)},bn=function(t,e){var n=t&&t.length||0;return n?1===n?t[0]:t[Sn(n,e)]:String.fromCharCode(mn(65,90,e))},Rn=function(t,e,n){(t=t||Date.now()-63072e6)instanceof Date&&(t=t.getTime()),(e=e||Date.now())instanceof Date&&(e=e.getTime());let i=mn(0,(e-t)/1e3,n);return new Date(t+1e3*i)},vn=function(t,e,n){let i=t<e?Cn(t,e,n):t,o=new Array(i);for(let t=0;t<i;++t){null!=n&&(n*=1.17*(t+1));let e=Sn(cn.words.length,n);o[t]=cn.words[e]}return o.join(" ")},In=function(t,e,n){let i=xn(t,e,n),o=i.value+"";return i.prefix&&("string"==typeof i.prefix?o=i.prefix+o:e.prefix&&(o=e.prefix+" "+o)),i.suffix&&(o+=i.suffix),"string"===i.type&&(i.value=o),i.formattedValue=o,i},Dn=function(t,e,n){let i={},o=0;e&&("number"==typeof e?o=i.numRows=e:(i=e,o=e.numRows||e.numRow||e.rowCount,null!=e.seed&&-1===(n=e.seed)&&(n=null))),o||(o=1),t?Array.isArray(t)||(t=[t+""]):t=[""];let r=t.length,s=[];for(let i=0;i<o;++i){let i=[];for(let o=0;o<r;++o){let r=t[o];i.push(xn(r,e,n).value)}null!=n&&++n,s.push(i)}return{data:s,seed:n,fields:t}},xn=function(t,e,n){let i,o=function(t){return fn[t]||{}}(t);if(o.type||(o.type="number",gn(t,o)),void 0!==o.fixedValue)return o.value=o.fixedValue,o;null!=n&&(null==o.hash&&(o.hash=function(t){let e=0,n=t?t.length:0;for(;--n>=0;)e+=t.charCodeAt(n)*(n+.9879);return e}(t)),n+=o.hash);let r=null!=o.min?o.min:100,s=null!=o.max?o.max:1e4;if("string"===o.type)i=null!=o.min||null!=o.max?vn(r,s,n):e&&e.text||"";else if("set"===o.type)i=bn(o.members,n);else if("date"===o.type)i=Rn(r,s,n);else if("isoDate"===o.type)i=Rn(r,s,n).toISOString().slice(0,10);else if("isoDateObject"===o.type)i=Rn(r,s,n),i=new Date(i.toISOString().slice(0,10));else if("boolean"===o.type)i=wn(n);else if("function"===o.type)o.field=t,i=o.generate(o,n);else{let t=null!=o.prec?o.prec:0;i=yn(r,s,t,n)}return o.value=i,o},An=function(t){this._seed=null!=t?t:null};An.prototype._seed=null,An.prototype.generate=function(t,e){let n=Dn(t,e,this._seed);return this._seed=n.seed,n.data},An.prototype.generateRecords=function(t,e){let n=Dn(t,e,this._seed);this._seed=n.seed;let i=(t=n.fields).length,o=n.data;for(let e=o.length;--e>=0;){let n=o[e],r={};for(let e=0;e<i;++e)r[t[e]]=n[e];o[e]=r}return o},An.prototype.generateQuoteData=function(t,e){let n=In(t,e,this._seed);return null!=this._seed&&++this._seed,n},An.prototype.getSeed=function(){return this._seed},An.prototype.setSeed=function(t){"number"==typeof t&&(this._seed=t)},An.prototype.randBetween=function(t,e){let n=Cn(t,e,this._seed);return null!=this._seed&&++this._seed,n},An.prototype.randInt=function(t,e){let n=mn(t,e,this._seed);return null!=this._seed&&++this._seed,n},An.prototype.randIndex=function(t){let e=Sn(t,this._seed);return null!=this._seed&&++this._seed,e},An.prototype.randNumber=function(t,e,n){let i=yn(t,e,n,this._seed);return null!=this._seed&&++this._seed,i},An.prototype.randBoolean=function(){let t=wn(this._seed);return null!=this._seed&&++this._seed,t},An.prototype.randMember=function(t){let e=bn(t,this._seed);return null!=this._seed&&++this._seed,e},An.prototype.randDate=function(t,e){let n=Rn(t,e,this._seed);return null!=this._seed&&++this._seed,n},An.prototype.randString=function(t,e){let n=vn(t,e,this._seed);return null!=this._seed&&++this._seed,n},An.seed=null,An.generate=function(t,e){let n=Dn(t,e,An.seed);return An.seed=n.seed,n.data},An.generateRecord=function(t,e,n){Array.isArray(t)||(t=[t+""]);let i={};null!=e&&("number"==typeof e?n=e:e&&(i=e));let o=t.length,r={};for(let e=0;e<o;++e){let o=t[e];r[o]=xn(o,i,n).value}return r},An.generateRecords=function(t,e){let n=Dn(t,e,An.seed);An.seed=n.seed;let i=(t=n.fields).length,o=n.data;for(let e=o.length;--e>=0;){let n=o[e],r={};for(let e=0;e<i;++e)r[t[e]]=n[e];o[e]=r}return o},An.addFieldInfo=gn,An.randNumber=yn,An.randInt=mn,An.randBetween=Cn,An.randIndex=Sn,An.randBoolean=wn,An.randMember=bn,An.randDate=Rn,An.randString=vn,An.toRecords=function(t,e){if(!Array.isArray(t))return null;Array.isArray(e)||(e=e?[e+""]:[]);let n=t.length,i=new Array(n);for(let o=0;o<n;++o){let n=i[o]={},r=t[o],s=r&&r.length||0;for(let t=0;t<s;++t){let i=r[t];if(void 0!==i){let o=e[t];o||0===o||(o=t+""),n[o]=i}}}return i};let Tn=function(){};Tn.prototype.create=function(t){return new Ln(t)};let Ln=function(t){this._onRowUpdated=this._onRowUpdated.bind(this),this._fieldMap={},this._prevData={},this.id=null!=t?t+"":"_sub"+Ln._runningId++};Ln.prototype._rics=null,Ln.prototype._isChain=!1,Ln.prototype._fieldMap=null,Ln.prototype._prevData=null,Ln.prototype._updateHandler=null,Ln.prototype._updateTimerId=0,Ln.prototype._updateInterval=1e3,Ln._runningId=0,Ln.prototype.formattedFields=function(t){for(let e=t.length;--e>=0;)this._fieldMap[t[e]]=!0;return this},Ln.prototype.rawFields=function(t){for(let e=t.length;--e>=0;)this._fieldMap[t[e]]=!0;return this},Ln.prototype.chain=function(t){return this._rics=Array.isArray(t)?t[0]:[t],this._isChain=!0,this},Ln.prototype.rics=function(t){return this._rics=Array.isArray(t)?t:[t],this},Ln.prototype.start=function(){return this._onRowUpdated(),this},Ln.prototype.stop=function(){return this._updateTimerId&&(clearInterval(this._updateTimerId),this._updateTimerId=0),this},Ln.prototype.onNewRow=function(t){return this},Ln.prototype.onUpdate=function(t){return this._updateHandler=t,this},Ln.prototype.onRemoveRow=function(t){return this},Ln.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 n=0;n<e;++n)Sn(3)||(t=this._rics[n],this._updateHandler(this,t,this._getUpdateData(t)));this._updateTimerId||(this._updateTimerId=setInterval(this._onRowUpdated,this._updateInterval))},Ln.prototype._getUpdateData=function(t){let e={id:this.id},n={text:t};for(let t in this._fieldMap){let i=In(t,n),o=i.value,r=i.formattedValue;i.changeOnly&&this._prevData[t]===o||(this._prevData[t]=o,e[t]={raw:o,formatted:r||o+""})}return e};let En=function(){this._dict={}};En.prototype._dict,En.prototype._count=0,En.prototype.addItem=function(t,e){if(t&&null!=e){let n=this._dict[t];return n?n.push(e):this._dict[t]=[e],++this._count,!0}return!1},En.prototype.addItems=function(t,e){if(t){if(!Array.isArray(e))return this.addItem(t,e);let n=e?e.length:0;if(n){let i=this._dict[t];return i||(i=this._dict[t]=[]),Array.prototype.push.apply(i,e),this._count+=n,!0}}return!1},En.prototype.removeItem=function(t,e){let n=this._dict[t];if(n){let i=n.indexOf(e);if(i>=0)return n.length>1?n.splice(i,1):delete this._dict[t],--this._count,!0}return!1},En.prototype.removeItemsByKey=function(t){let e=this._dict[t];return!!e&&(delete this._dict[t],this._count-=e.length,!0)},En.prototype.removeAllItems=function(){return!!this._count&&(this._dict={},this._count=0,!0)},En.prototype.getItems=function(t){return this._dict[t]||null},En.prototype.getAllItems=function(){if(this._count>0){let t=[],e=this._dict;for(let n in e)Array.prototype.push.apply(t,e[n]);return t}return null},En.prototype.getItemCount=function(t){if(t){let e=this._dict[t]||null;return e?e.length:0}return this._count},En.prototype.getAllKeys=function(){return Object.keys(this._dict)};let Mn=function(t,e){return t.ric+"_"+e.ric},Fn=function(t){let e=t.match(/\./g);return!!e&&e.length>1},Pn=function(t){let e,n,i,o=t;for(e=o.length-1;e>0;e--)n=Math.floor(Math.random()*(e+1)),i=o[e],o[e]=o[n],o[n]=i;return o.forEach(zn),o=o.sort(Vn),o},zn=function(t,e){t.CHILD_ORDER=e},Vn=function(t,e){return t.CHILD_ORDER-e.CHILD_ORDER},kn=function(){};kn.prototype._lastSub=null,kn.prototype._configObj=null,kn.prototype.config=function(t){t&&(this._configObj=t),this._lastSub&&this._configObj&&this._lastSub.config(this._configObj)},kn.prototype.create=function(t){return this._lastSub=new Nn(t||this._configObj),this._lastSub},kn.prototype.isSkipHeaderSupported=function(){return!0},kn.prototype.setUpdateInterval=function(t,e){this._lastSub?this._lastSub.setUpdateInterval(t,e):(this._configObj||(this._configObj={}),this._configObj.minInterval=t,this._configObj.maxInterval=e)},kn.prototype.setPercentageDataUpdate=function(t){this._lastSub?this._lastSub.setPercentageDataUpdate(t):(this._configObj||(this._configObj={}),this._configObj.percentageDataUpdate=t)};let Nn=function(t){this._onSubscriptionResponse=this._onSubscriptionResponse.bind(this),this._subMap={},this._dataMap=new En,this._fields={},this._events={},this._dataGen=new An,this.config(t)};Nn.prototype._minInterval=750,Nn.prototype._maxInterval=850,Nn.prototype._percentageDataUpdate=.1,Nn.prototype._percentageOrderChange=1,Nn.prototype._constituentCache=!1,Nn.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),e=t.percentageOrderChange,"number"==typeof e&&(this._percentageOrderChange=e/100);let n=t.constituentCache;null!=n&&(this._constituentCache=n)},Nn.prototype.setUpdateInterval=function(t,e){"number"==typeof t&&(this._minInterval=t),"number"==typeof e&&(this._maxInterval=e)},Nn.prototype.setPercentageDataUpdate=function(t){"number"==typeof t&&(this._percentageDataUpdate=Math.round(t/100))},Nn.prototype.setPercentageOrderChanged=function(t){"number"==typeof t&&(this._percentageOrderChange=Math.round(t/100))},Nn.prototype.setSeed=function(t){this._dataGen.setSeed(t)},Nn.prototype.addRic=function(t,e){return this._addSymbol(t,!1,e)},Nn.prototype.addChain=function(t,e){return this._addSymbol(t,!0,e)},Nn.prototype.addFields=function(t){if(!t)return;"string"==typeof t&&(t=[t]);let e=t.length;for(let n=0;n<e;++n)this._fields[t[n]]=!0},Nn.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,n=t.length;for(let i=0;i<n;++i){let n=t[i];this._dataMap.removeItem(Mn(e,n),n),n.parent=null}e.children=null,e.ricList=null}},Nn.prototype.removeRic=Nn.prototype.removeSubscription,Nn.prototype.removeChain=Nn.prototype.removeSubscription,Nn.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()},Nn.prototype.removeFields=function(t){"string"==typeof t&&(t=[t]);let e=t.length;for(let n=0;n<e;++n){let e=t[n];this._fields[e]&&delete this._fields[e]}},Nn.prototype.removeAllFields=function(){let t=!1;for(let e in this._fields){t=!0;break}t&&(this._fields={})},Nn.prototype.start=function(){this._working=!0,this._connect()},Nn.prototype.stop=function(){this._working=!1,this._timerId&&(window.clearTimeout(this._timerId),this._timerId=0)},Nn.prototype.dispose=function(){this.stop(),this._subMap=null,this._dataMap&&(this._dataMap.removeAllItems(),this._dataMap=null),this._fields=null,this._events=null},Nn.prototype.addEventListener=function(t,e){if(!e)return;let n=this._events[t];n?n.indexOf(e)<0&&n.push(e):this._events[t]=[e]},Nn.prototype.removeEventListener=function(t,e){let n=this._events?this._events[t]:null;if(!n)return;let i=n.indexOf(e);i>=0&&n.splice(i,1)},Nn.prototype.removeAllEventListeners=function(){this._events={}},Nn.prototype.getSubscription=function(t){return this._subMap[t]||null},Nn.prototype.getRic=function(t){let e=this._subMap[t];return e?e.ric:""},Nn.prototype.getAllFields=function(){return this._fields},Nn.prototype.hasField=function(t){return this._fields[t]||!1},Nn.prototype.filter=function(t,e){return this};let On=function(t,e){for(let n in t)e[n]=t[n];return e};Nn.prototype._addSymbol=function(t,e,n){if(!t)return null;if(n||0===n)n+="";else do{n="_"+this._runningSubId+++"_"}while(this._subMap[n]);if(this._subMap[n])return window.console.log("WARNING: Cannot add ric with duplicate id"),null;e&&(t=t.replace("0#",""));let i={};i.ric=t,i.chain=e,i.id=n,i.dataId=n+t,this._subMap[n]=i,this._dataMap.addItem(t,i);let o=this._dataMap.getItems(t),r=o.length;this._dispatch("subscriptionAdded",{subs:[i]});let s,l=null,a=0;if(e)if(1===r)for(i.children=[],a=Nn.simpleDigest(t)%10+4,s=0;s<a;++s)l={},l.ric="Child_"+String.fromCharCode(65+s),l.id=n,l.dataId=n+l.ric,l.parent=i,i.children.push(l),l.CHILD_ORDER=s,this._dataMap.addItem(Mn(i,l),l);else{let t=o[0].children;for(a=t.length,i.children=new Array(a),s=0;s<a;++s)l={},l.ric=t[s].ric,l.id=n,l.dataId=n+l.ric,l.parent=i,i.children[s]=l,this._dataMap.addItem(Mn(i,l),l)}return r>1&&this._working&&setTimeout(this._updateDuplicateSymbol.bind(this,t),10),this._connect(),n},Nn.simpleDigest=function(t){let e=t.length,n=0;for(let i=0;i<e;++i)n+=t.charCodeAt(i);return n},Nn.prototype._connect=function(){if(this._working&&!this._timerId){let t=this._dataGen.randInt(this._minInterval,this._maxInterval);this._timerId=window.setTimeout(this._onSubscriptionResponse,t)}},Nn.prototype._onSubscriptionResponse=function(){this._timerId=0;let t=this._dataMap.getAllKeys(),e=t?t.length:0;if(!e)return void this._connect();let n=(this._percentageDataUpdate-.02)*e;n=n>0?n:1;let i=(this._percentageDataUpdate+.02)*e;i=i<e?i:e;let o,r=this._dataGen.randInt(n,i),s=this._fields,l=0;for(let n=0;n<r;n++){let n,i=t[this._dataGen.randIndex(e)],r=this._dataMap.getItems(i),a=r.length,u=r[0],h=u.parent,p=this._dataGen.randInt(0,100)<100*this._percentageOrderChange,d=this._generateQuoteData(u,s);if(Fn(i)&&h&&p){let t=h.children,e=t.length;t=Pn(t);let i=t.indexOf(u);for(u.CHILD_ORDER=i,d.CHILD_ORDER=i,o=!0,n=0;n<a;++n){this._dispatchDataChanged(r[n],d);for(let n=0;n<e;n++)n!==i&&this._dispatchDataChanged(t[n],{X_RIC_NAME:t[n].ric,CHILD_ORDER:n})}}else{if(a>1){let t=u.CHILD_ORDER;null!=t&&(d.CHILD_ORDER=t)}for(n=0;n<a;++n)this._dispatchDataChanged(r[n],d),l++}}let a={};null!=o&&(a.childOrderChange=o),null!=l&&(a.updateCount=l),this._dispatchPostUpdate(a),this._connect()},Nn.prototype._dispatchPostUpdate=function(t){this._dispatch("postUpdate",t)},Nn.prototype._generateQuoteData=function(t,e){let n=t.ric,i=t.prevData,o={},r={text:n,prefix:t.parent?t.parent.ric:""};for(let t in e){let e=this._dataGen.generateQuoteData(t,r);if(e.ignore)continue;let n=t+"_FORMATTED";if(i){if(e.changeOnly&&i[t]===e.value)continue;i[t]=e.value,i[n]=e.formattedValue}o[t]=e.value,o[n]=e.formattedValue}return null!=o.X_RIC_NAME&&null!=o.INDICATOR&&o.INDICATOR>0&&(o.X_RIC_NAME="/"+o.X_RIC_NAME),o},Nn.prototype._getChildSubByRic=function(t,e){let n=t.children;if(n){let t=n.length;for(let i=0;i<t;++i){let t=n[i];if(t.ric===e)return t}}return null},Nn.prototype._updateDuplicateSymbol=function(t){let e=this._dataMap.getItems(t);if(!e)return;let n=e.length;if(n<2)return;let i,o=e[0],r=o.prevData,s=!!o.chain;if(r)for(i=1;i<n;++i){let t=e[i];t.prevData||this._dispatchDataChanged(t,r)}if(!s)return;if(!this._constituentCache)return;let l=o.ricList;if(!l)return;let a=l.length;for(i=1;i<n;++i){let t=e[i],n=t.ricList;for(let e=n?n.length:0;e<a;++e){let n=l[e],i=this._getChildSubByRic(o,n),r=this._getChildSubByRic(t,n);i&&r&&i.prevData&&this._dispatchDataChanged(r,i.prevData)}}},Nn.prototype._dispatchDataChanged=function(t,e){let n=On(e,{}),i={};i.ric=t.ric,i.values=n,i.subId=t.id;let o=t.prevData;if(!o){o={},t.prevData=o,i.type="statusUpdated",n.STATUS=1,n.STATUS_FORMATTED=this._statusMap[1],n.SUB_ID=t.id,On(n,o);let e=t.parent;if(e){let n=e.ricList;n||(n=e.ricList=[]),e.ricList.push(t.ric)}}this._dispatch("dataChanged",i)},Nn.prototype.onFeedStatusChanged=function(t,e){return window.setTimeout((function(){e([{key:"Q",name:"IDN_RDF",state:"up"}])}),1e3),this},Nn.prototype._hasListener=function(t){let e=this._events[t];return!!e&&e.length>0},Nn.prototype._dispatch=function(t,e){let n=this._events[t];if(!n)return;let i=n.length;for(let t=0;t<i;++t)n[t](e)},Nn.prototype._subMap=null,Nn.prototype._fields=null,Nn.prototype._events=null,Nn.prototype._working=!1,Nn.prototype._timerId=0,Nn.prototype._runningSubId=0,Nn.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 Hn=function(){this._data={}};Hn.prototype._data=null,Hn.prototype.clear=function(){this._data={}},Hn.prototype.put=function(t,e){t&&(this._data[t]=e)},Hn.prototype.get=function(t){let e=this._data[t];return null!=e?e:""},Hn.prototype.getAllKeys=function(){return Object.keys(this._data)},Hn.prototype.save=function(){},Hn.prototype.filter=function(t){let e=[];if(t)for(let n in this._data){let i=this._data[n];t(i)&&e.push(i)}return e};let Bn={"TR.NonExistField":!0,"TR.NotExistField":!0,CF_IGNORE_FIELD:!0},Gn=new An,Wn={request:function(t,e){if(e)return Promise.resolve(JSON.stringify(e));let n,i,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=Bn,n=0;n<a.length;n++)i=a[n],h[i]||u.push(i);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,i=u[t],o=/TR.(.*)(?=\()/,r=i.match(o)[0].replace("TR.",""),a=i.toLowerCase(),h=/sdate=(.*)[,]/,d=/edate=(.*)[)]/,c=a.match(h),_=a.match(d),f=c?c[1]:J.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(n=0;n<=y;n++){let e=new Date(new Date(f).setDate(new Date(f).getDate()+n)),i={h:!0,v:J.format(e,"YYYY-MM-DDT00:00:00")};0===t&&p[0].push(i)}let m=l;for(n=0;n<m.length;n++){let t=[m[n],r];for(s=1;s<=y+1;s++){let e=An.generateRecord(r);t.push(e[r])}p.push(t)}}}else{for(l=t.identifiers,a=Wn.splitFields(t.formula),u=[],h=Bn,n=0;n<a.length;n++)i=a[n],h[i]||u.push(i);for(p[0]=[{h:!0,i:"instrument",v:"Instrument"}],n=0;n<u.length;n++)i=u[n],p[0].push({h:!0,r:i.toUpperCase().trim()});let e={};o=l.length;let s=Gn.generate(u,o);for(n=0;n<o;++n){let t=l[n];r=e[t],r||(r=e[t]=s[n],r.unshift(t)),p.push(r)}if(p.length>0&&Gn.randInt(1,10)<=3){let t=Gn.randInt(0,p.length-1);r=p[t],o=r.length;let e=new Array(o);for(e[0]=r[0],n=1;n<o;n++)e[n]="";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}},Un=new An,Yn={request:function(t,e){if(e)return Promise.resolve(JSON.stringify(e));let n,i,o,r,s=t.instruments,l=t.fields,a=Bn;for(l=[],n=0;n<t.fields.length;n++)i=t.fields[n],a[i.name]||l.push(i);let u={};o=s.length;let h=[],p=Un.generate(l,o);for(n=0;n<o;++n){let t=s[n];r=u[t],r||(r=u[t]=p[n],r.unshift(t)),h.push(r)}if(h.length>0&&Un.randInt(1,10)<=3){let t=Un.randInt(0,h.length-1);r=h[t],o=r.length;let e=new Array(o);for(e[0]=r[0],n=1;n<o;n++)e[n]="";h.splice(t+1,0,e)}let d=[{displayName:"Instrument"}];for(n=0;n<l.length;n++)i=l[n],d.push({displayName:i.name,field:i.name.toUpperCase()});return Promise.resolve(JSON.stringify({data:h,headers:[d]}))}},Xn=function(t){return"datagrid"===t?Promise.resolve(Yn):"adc"===t?Promise.resolve(Wn):Promise.reject(t+" is not supported.")};Xn.setInvalidFields=function(t){if(t&&"string"==typeof t)Bn[t]=!0;else if(Array.isArray(t))for(let e=0;e<t.length;e++)Bn[t[e]]=!0};let qn=function(t){this.Quotes=new Tn,this.Quotes2=new kn,this.Archive=new Hn,this.ContainerDescription=!0,this.Data=Xn,t&&this.Quotes2.config(t)};qn.prototype.init=function(t){return t&&this.Quotes2.config(t),this},qn.prototype.onLoad=function(t){return setTimeout(t,2e3),this},qn.prototype.navigate=function(t){return this},qn.prototype.appHit=function(t,e,n){},qn.prototype.getUserInfo=function(){return Promise.resolve({UUID:"PAXTRA"})},qn.prototype.contextChange=function(t){};let jn={"⇧":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},Kn={CF_TICK:1,PRCTCK_1:1,BID_TICK:1,ASK_TICK:1},Jn={"||":1,"&&":2,"<":3,">":3,"<=":3,">=":3,"!=":3,"=":3,"==":3,"===":3,"+":4,"-":4,"*":5,"%":6,"/":6,"!":7,"!!":7},Qn={"+":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}},Zn={"+":2,"-":2,"*":2,"/":2,"%":2,"<":2,">":2,"<=":2,">=":2,"==":2,"!=":2,"&&":2,"||":2,"!":1,"!!":1},$n=function(t,e,n,i){let o={value:e,type:n};return i&&(o.dataType=i),"operator"===n?o.precedence=Jn[e]:"parenthesis"===n&&(o.precedence=0),t.push(o),t.length-1},ti={_tokens:[],_withString:function(t){return" #"+$n(ti._tokens,t.substring(1,t.length-1),"literal","string")+"#"},_withField:function(t){return" #"+$n(ti._tokens,t,"literal","variable")+"#"},_withFieldInBrackets:function(t){return ti._withField(t.substring(1,t.length-1))},_withNegativeNumber:function(t){let e=+t;return e==e?" #"+$n(ti._tokens,e,"literal","number")+"#":""},_withPositiveNumber:function(t){return 35===t.charCodeAt(0)?t:ti._withNegativeNumber(t)},_withOperator:function(t){return Jn[t]?("="!=t&&"==="!=t||(t="=="),"#"+$n(ti._tokens,t,"operator")+"#"):""},_withParenthesis:function(t){return"#"+$n(ti._tokens,t,"parenthesis")+"#"},_tester:function(t){let e=t._rpn,n=e.length,i=0,o=0;for(let t=0;t<n;++t){let n=e[t];if("literal"!==n.type){let t=Zn[n.value];if(!(i>=t))return console.warn("Cannot parse an expression with insufficient number of operands"),!0;i-=t}i++,i>o&&(o=i)}return 1!==i||(t._stackSize=o,!1)},_filter:function(t,e){let n,i=t._rpn,o=new Array(t._stackSize),r=i.length,s=0;for(let t=0;t<r;++t){let r=i[t],l=r.value;"literal"===r.type?n="variable"!==r.dataType?l:e?e[l]:null:1===Zn[l]?(n=Qn[l](o[s-1]),s-=1):(n=Qn[l](o[s-2],o[s-1]),s-=2),o[s++]=n}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;ti._tokens.length=0,e=e.replace(/".+?"/g,ti._withString),e=e.replace(/'.+?'/g,ti._withString),e=e.replace(/\[.+?\]/g,ti._withFieldInBrackets),e=e.replace(/-[0-9.]+/g,ti._withNegativeNumber),e=e.replace(/[0-9.#]+/g,ti._withPositiveNumber),e=e.replace(/[a-zA-Z_]\w*/g,ti._withField),e=e.replace(/[\-\/+*%!=<>&|]+/g,ti._withOperator),e=e.replace(/[()]/g,ti._withParenthesis);let n=ti._tokens,i=n.length;if(!i)return null;let o,r,s,l=[],a=e.match(/#[0-9]+#/g);for(o=0;o<i;++o){let t=a[o];if(r=n[+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;$n(l,"-","operator"),r.value*=-1}}l.push(r)}ti._tokens.length=0,i=l.length;let u=[],h=[],p=null,d=!1;for(o=0;o<i;++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 ti._tester(c)?null:ti._filter.bind(null,c)}},ei=function(){this._conditions=[],this._scopes=[],ei._painters.push(this)},ni=function(t,e){null!=t._coloringCssClass&&t._coloringCssClass!==e&&(t.classList.remove(t._coloringCssClass),t._coloringCssClass=null)};if(ei.ColoringTypes={TEXT:1,HEATMAP:2,CONDITIONAL:3},ei.prototype._coloringType=0,ei.prototype._conditions=null,ei.prototype._effectiveStyles=null,ei.prototype._blinkCondition=null,ei.prototype._scopes,ei.prototype._columnStats=null,ei.prototype._blinkingDuration=250,ei._runningBlinkId=0,ei._painters=[],ei._emptyAry=[],ei._emptyObj={},ei._bgObj={backgroundColor:"",color:""},ei._colorObj={color:""},ei.bgStyles=["backgroundColor","color"],ei.nonBgStyles=["fontSize","fontWeight","fontStyle","textAlign","textDecoration"],ei.supportedStyles=ei.bgStyles.concat(ei.nonBgStyles),ei.themeReady=null,ei._contrastColors={},ei.parse=ti.parse,ei.prototype.dispose=function(){let t=ei._painters.indexOf(this);t>=0&&ei._painters.splice(t,1),this.reset(),this._conditions=null,this._scopes.length=0,this._blinkCondition=null},ei.prototype.reset=function(){this._setColoringType(0),this.clearBlinking()},ei.prototype.resetColoring=function(){this._setColoringType(0),this._effectiveStyles=null,this._conditions.length=0},ei.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];ei._clearBlinkTimer(t)&&t._restorer();let n=t.cell;n&&delete n.blinking,t.cell=null}this._scopes.length=0}},ei.prototype.resetBlinking=ei.prototype.clearBlinking,ei.prototype.clearHeatMap=function(){return this._blinkCondition?(this._setColoringType(0),this.resetHeatMap(),!1):(this.dispose(),!0)},ei.prototype.resetHeatMap=function(){this._conditions.length=0,this._columnStats=null},ei.prototype.applyThemeColor=function(){let t=N.getColors();if(this._coloringType===ei.ColoringTypes.HEATMAP){let e=this._conditions[0];if(e&&(e.textMode?e.baseColor=t.baseText:e.baseColor=t.baseGrid,e.useThemeColor)){let n=t.up,i=t.down,o=t.level===t.baseText?"":t.level;ei._setUpDownColors(e,n,i,o)}}this._blinkCondition&&this._blinkCondition.useThemeColor&&ei._setUpDownColors(this._blinkCondition,t.up,t.down,t.level,!0)},ei.prototype.getConditions=function(){return this._conditions},ei.prototype.getColoringType=function(){return this._coloringType},ei.prototype._setColoringType=function(t){this._coloringType!==t&&(this._coloringType=t)},ei.prototype.setEffectiveStyles=function(t){this._effectiveStyles=t},ei.prototype.getEffectiveStyles=function(){return this._effectiveStyles},ei.prototype.setConditions=function(t){this._conditions.length=0,this._setColoringType(ei.ColoringTypes.CONDITIONAL);let e=t?t.length:0;for(let n=0;n<e;n++)this._addCondition(t[n])},ei.prototype.setColumnStats=function(t){this._columnStats=t&&t.getMin?t:null},ei.prototype.getColumnStats=function(){return this._columnStats},ei.prototype._addCondition=function(t){let e=t.expression;e&&(t._fn=ti.parse(e.text||e),this._conditions.push(t))},ei.prototype.addHeatmap=function(t,e,n,i,o,r){this._setColoringType(ei.ColoringTypes.HEATMAP);let s={heatmap:!0};return s.field=t,s.expression=ei._heatMapCondition.bind(s),s.midPoint=e,ei._setUpDownColors(s,n,i),s.baseColor=o,!0!==r&&"text"!==r||(s.textMode=!0),this._addCondition(s),s},ei.prototype.addHeatmapWithTheme=function(t,e,n){let i=N.themeColors,o=this.addHeatmap(t,e,i.up,i.down,i.baseGrid,n);return!0!==n&&"text"!==n||(o.baseColor=i.baseText),o.useThemeColor=!0,o},ei.prototype._addColorText=function(t,e,n,i,o){this._setColoringType(ei.ColoringTypes.TEXT);let r={};return r.field=e,r.expression=t.bind(null,e),r.upClass=n,r.downClass=i,r.levelClass=o,this._addCondition(r),r},ei.prototype.addColorText=function(t,e,n,i){return this._addColorText(Kn[t]?ei._tickColorTextCondition:ei._colorTextCondition,t,e,n,i)},ei.prototype.addColorTextWithTheme=function(t){return this.addColorText(t,"positive","negative","neutral")},ei.prototype.addTickColorText=function(t,e,n){return this.addColorText("CF_TICK",t,e,n)},ei.prototype.addTickColorTextWithTheme=function(){let t=N.themeColors,e=this.addTickColorText(t.tickUp,t.tickDown,t.level);return e.useThemeColor=!0,e},ei.prototype.addTickBlink=function(t,e,n,i){return this.addBlink("CF_TICK",t,e,n,i)},ei.prototype.addTickBlinkWithTheme=function(t){let e=N.themeColors,n=this.addTickBlink(e.tickUp,e.tickDown,e.level,t);return n.useThemeColor=!0,n},ei.prototype.addBlink=function(t,e,n,i,o){return this._addBlink(Kn[t]?ei._tickBlinkCondition:ei._fieldBlinkCondition,t,e,n,i,o)},ei.prototype.addBlinkWithTheme=function(t,e){let n=N.themeColors,i=this.addBlink(t,n.up,n.down,n.level,e);return i.useThemeColor=!0,i},ei.prototype._addBlink=function(t,e,n,i,o,r){let s=this._blinkCondition={};return s.blink=!0,s.blinkId=ei._runningBlinkId++,s.field=e,s._fn=s.expression=t,!0!==r&&"border"!==r||(s.border=!0),ei._setUpDownColors(s,n,i,o,!0),s},ei.prototype.renderForPrinting=function(t,e,n,i){if(!t)return;let o=this._getStyles(e,n,i),r=o.cssClass;ni(t,r),null!=r?r&&(t.classList.add(r),t._coloringCssClass=r):(t.style.backgroundColor=o.backgroundColor||"",t.style.color=o.color||"")},ei._colorTextCondition=function(t,e){let n=e[t];if(n||0===n){if(n>0)return 1;if(n<0)return-1}return"u"},ei._tickColorTextCondition=function(t,e){return jn[e[t]]},ei._heatMapCondition=function(t,e,n){let i,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=n-this.midPoint,s<0&&(s=e-this.midPoint)):(s=e-this.midPoint,s>0&&(s=n-this.midPoint)),s<0&&(s=-s),i=r/s,i},ei._tickBlinkCondition=function(t){return jn[t]},ei._fieldBlinkCondition=function(t,e){return t>e?1:t<e?-1:0},ei._borderRestorer=function(t){t.blinkTimer=0;let e=t.cell.getElement();e&&(e.style.border="")},ei._cellRestorer=function(t){t.blinkTimer=0;let e=t.cell.getElement();if(e){let n=t.rowData,i=NaN,o=NaN;if(this._coloringType===ei.ColoringTypes.HEATMAP){let t=this._columnStats;t&&(i=t.getMin(),o=t.getMax())}let r=this._getStyles(n,i,o),s=r.cssClass;ni(e,s),null!=s?(s&&(e.classList.add(s),e._coloringCssClass=s),e.style.backgroundColor="",e.style.color=""):(e.style.backgroundColor=r.backgroundColor||"",e.style.color=r.color||"")}},ei.prototype._getStyles=function(t,e,n){if(!t)return ei._emptyObj;let i=this._conditions.length;for(let o=0;o<i;++o){let i,r=this._conditions[o],s=r._fn;try{i=s&&s(t,e,n)}catch(t){}if(i){if(this._coloringType===ei.ColoringTypes.HEATMAP){let t;return t=i>0?R(r.baseColor,r.upColor,i):R(r.baseColor,r.downColor,-i),r.textMode?(ei._colorObj.color=f(t),ei._colorObj):(ei._bgObj.backgroundColor=f(t),ei._bgObj.color=b(t),ei._bgObj)}return this._coloringType===ei.ColoringTypes.TEXT?(i>0?r.cssClass=r.upClass:i<0?r.cssClass=r.downClass:0===i&&(r.cssClass=r.levelClass),r.cssClass||(r.cssClass=""),r):r}}return ei._emptyObj},ei.blendColor=R,ei.blackAndWhite=b,ei.rgb2Hex=_,ei.num2Hex=f,ei.num2Rgb=g,ei.hex2Num=y,ei.hex2Rgb=m,ei.themeChanged=function(){},ei.setThemeColors=function(){},ei._onThemeChanged=function(){let t=ei._painters;for(let e=t.length;--e>=0;)t[e].applyThemeColor()},ei.loadThemeColors=function(){return ei.themeReady||(ei.themeReady=N.getThemeColors(ei._onThemeChanged).then(ei._onThemeChanged).catch(ei._onThemeChanged)),ei.themeReady},ei.reloadThemeColors=function(){return ei.themeReady=N.reloadThemeColors().then(ei._onThemeChanged).catch(ei._onThemeChanged),ei.themeReady},ei.clearCellStyle=function(t,e){let n=t.getElement();if(!n)return;let i=t.blinking;if(i&&(ei._clearBlinkTimer(i),delete t.blinking,i.cell=null),ni(n),e||(e=ei.supportedStyles),Array.isArray(e))for(let t=e.length;--t>=0;)n.style[e[t]]="";else for(let t in e)n.style[t]=""},ei._setUpDownColors=function(t,e,n,i,o){t.upColor=e,null!=e&&o&&(t.contrastUpColor=ei.getOppositeColor(e)),t.downColor=n,null!=n&&o&&(t.contrastDownColor=ei.getOppositeColor(n)),t.levelColor=i,null!=i&&o&&(t.contrastLevelColor=ei.getOppositeColor(i))},ei._clearBlinkTimer=function(t,e){return!!t.blinkTimer&&(clearTimeout(t.blinkTimer),t.blinkTimer=0,!0)},ei.getOppositeColor=function(t){if("string"==typeof t){if("#"===t.charAt(0)){let e=ei._contrastColors[t];if(!e){let n=y(t);e=ei._contrastColors[t]=b(n)}return e}}else if(Array.isArray(t))return b(t);return""},ei.prototype.render=function(t,e,n,i){null!=n&&n==n?this._paintCell(t,e,n,i):this._conditions.length&&this._coloringType===ei.ColoringTypes.CONDITIONAL&&this._paintCell(t,e)},ei.prototype.renderHeatMap=function(t,e,n,i){this._paintCell(t,e,n,i)},ei.prototype.renderColoring=function(t,e){this._paintCell(t,e)},ei.prototype._paintCell=function(t,e,n,i){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,n,i),a=o.style,u=l.cssClass;ni(o,u),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=""))},ei.prototype._prepareScope=function(t){let e=t.blinking;e||(e={},e.cell=t,t.blinking=e,this._scopes.push(e));let n=this._blinkCondition;if(e.blinkId!==n.blinkId){e.blinkId=n.blinkId,e.field=n.field;let t=n.border?ei._borderRestorer:ei._cellRestorer;e._restorer=t.bind(this,e)}return e},ei.prototype.blink=function(t,e,n){if(!t)return!1;let i=t.getElement();if(!i)return!1;let o=this._blinkCondition;if(!o)return!1;let r,s,l=this._prepareScope(t);return l.rowData=n,e>0?(r=o.upColor,s=o.contrastUpColor):e<0?(r=o.downColor,s=o.contrastDownColor):(r=o.levelColor,s=o.contrastLevelColor),this._blink(l,i,r,s),!0},ei.prototype.flash=function(t,e,n){if(!t)return!1;let i=t.getElement();if(!i)return!1;if(!this._blinkCondition)return!1;let o=this._prepareScope(t);return o.rowData=n,"string"!=typeof e&&(e=N.themeColors.level),this._blink(o,i,e,ei.getOppositeColor(e)),!0},ei.prototype._blink=function(t,e,n,i){return ei._clearBlinkTimer(t),t.blinkTimer=setTimeout(t._restorer,this._blinkingDuration),this._blinkCondition.border?(e.style.border="1px solid "+n,!1):(e.style.backgroundColor=n,e.style.color=i,!0)},ei.prototype.blinkCell=function(t,e,n,i){if(!this._blinkCondition)return!1;let o=this._blinkCondition._fn(e,n);return this.blink(t,o,i)},ei.prototype.calcBlinkSignal=function(t,e){return this._blinkCondition?this._blinkCondition._fn(t,e):0},ei.prototype.verifyBlinking=function(t,e){let n=t.blinking;n&&n.blinkTimer&&n.rowData!==e&&(n.rowData=e,ei._clearBlinkTimer(n)&&n._restorer())},ei.prototype.disableLevelColor=function(t){},ei.prototype.setBlinkingDuration=function(t){"number"==typeof t&&(this._blinkingDuration=t)},window){var ii=window.tr;ii||(ii=window.tr={});var oi=ii.rt;oi||(oi=ii.rt={});var ri=ii.grid;ri||(ri=ii.grid={}),ii.MockJET||(ii.MockJET=qn),ii.closestElement||(ii.closestElement=t.closestElement),ii.CellPainter||(ii.CellPainter=ei),oi.Grid||(oi.Grid=pn),ri.CellPainter||(ri.CellPainter=ei)}})();
|
1
|
+
(()=>{"use strict";let t={create:function(t,e){let n=document.createElement(t);return e&&(n.className=e),n},div:function(e){return t.create("div",e)},text:function(e,n){let i=t.create("span",n);return(e||0===e)&&(i.textContent=e),i},appendChild:function(t,e){if(!t)return null;let n,i;Array.isArray(arguments[1])?(i=arguments[1],n=0):(i=arguments,n=1);let o=i.length;for(;n<o;)t.appendChild(i[n]),++n;return t},buildTree:function(e,n){if(!e)return null;let i=arguments,o=i.length;for(let n=1;n<o;++n){let o=i[n];if(o){let n;Array.isArray(o)?n=t.buildTree.apply(null,o):1===o.nodeType&&(n=o),n&&e.appendChild(n)}}return e},removeParent:function(t){if(!t)return null;let e=t.parentNode;return e&&e.removeChild(t),e},setParent:function(e,n){return e?n?(n.appendChild(e),n):t.removeParent(e):null},removeChildren:function(t,e){if(t){let n=t.childNodes.length;for((null==e||e>n)&&(e=n);--e>=0;)t.removeChild(t.lastChild)}},setContent:function(e,n){if(e)if(n||0===n){let i=n.nodeType;1===i||3===i?n!==e.lastChild&&(t.removeChildren(e),e.appendChild(n)):Array.isArray(n)?(t.removeChildren(e),t.appendChild(e,n)):e.textContent=n}else t.removeChildren(e)},toggleAttribute:function(t,e,n){n?t.setAttribute(e,"string"==typeof n?n:""):null==n?t.hasAttribute(e)?t.removeAttribute(e):t.setAttribute(e,""):t.removeAttribute(e)},toggleClass:function(t,e,n){n?t.classList.add(e):null==n?t.classList.contains(e)?t.classList.remove(e):t.classList.add(e):t.classList.remove(e)},addClasses:function(t,e){if(t){let n=Array.isArray(e)?e:arguments,i=n.length;for(let e=0;e<i;++e){let i=n[e];i&&"string"==typeof i&&t.classList.add(i)}}},removeClasses:function(t,e){if(t){let n=Array.isArray(e)?e:arguments,i=n.length;for(let e=0;e<i;++e){let i=n[e];i&&"string"==typeof i&&t.classList.remove(i)}}},preventDefault:function(t){t.preventDefault(),t.stopPropagation()},stopPropagation:function(t){t.stopPropagation()},getClientPosition:function(t,e){let n=e||{x:0,y:0};if(t.getBoundingClientRect){let e=t.getBoundingClientRect();n.x=e.left,n.y=e.top}else n.x=t.clientX,n.y=t.clientY;return n},getRelativePosition:function(e,n,i){i=t.getClientPosition(e,i);let o=t.getClientPosition(n);return i.x-=o.x,i.y-=o.y,i},closestElement:function(t,e){let n=t;for(;n;){if(n.classList&&n.classList.contains(e))return n;n=n.parentNode||n.host}return null},closestTagName:function(t,e){let n=t;for(;n;){if(n.tagName&&n.tagName==e)return n;n=n.parentNode||n.host}return null}},e=function(t,e,n){this._onConflated=this._onConflated.bind(this),this._data=[],"function"==typeof t?this.setFunction(t,n):"function"==typeof e&&this.setFunction(e,n),"number"==typeof e?this.setConflatingTime(e):"number"==typeof t&&this.setConflatingTime(t)};e.prototype._data,e.prototype._func=null,e.prototype._delay=0,e.prototype._timerId=0,e.prototype._conflated=!1,e.prototype._disabled=!1,e.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},e.prototype.popAllData=function(){if(this._data.length){let t=this._data;return this._data=[],t}return null},e.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},e.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))},e.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},e.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},e.prototype.getData=function(){return this._data},e.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},e.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},e.prototype.getConflatingTime=function(){return this._delay},e.prototype.disable=function(t){this._disabled=!1!==t},e.prototype.isEnabled=function(){return!this._disabled},e.prototype.enable=function(t){this._disabled=!1===t};let n={inherits:function(t,e){function n(){}n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.base=function(t,n,i){n||(n="constructor");let o=arguments.length,r=new Array(o);for(let t=2;t<o;t++)r[t-2]=arguments[t];return e.prototype[n].apply(t,r)}}};const o=n;let r=function(){};r.prototype._events=null,r.prototype._listenerCount=0,r.prototype.addEventListener=function(t,e){if(!t||!e)return;this._events||(this._events={});let n=this._events[t];n?n.indexOf(e)<0&&(n.push(e),++this._listenerCount):(this._events[t]=[e],++this._listenerCount)},r.prototype.removeEventListener=function(t,e){let n=this._events?this._events[t]:null;if(n){let t=n.indexOf(e);t>=0&&(n.splice(t,1),--this._listenerCount)}},r.prototype.removeAllEventListeners=function(){this._events=null,this._listenerCount=0},r.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},r.prototype.getListener=function(t,e){if(t){let n=this._events?this._events[t]:null;if(n)return e||(e=0),n[e]||null}return null},r.prototype.addListener=function(t,e){let n=t?t[e]:null;"function"==typeof n&&this.addEventListener(e,n)},r.prototype._prepareEventArguments=function(t,e){return e},r.prototype._dispatch=function(t,e){let n=this._events?this._events[t]:null;if(n){e=this._prepareEventArguments(t,e);let i=n.length;for(let t=0;t<i;++t)n[t](e)}},r.preventDefault=function(t){t&&t.preventDefault&&(t.preventDefault(),t.stopPropagation())};const s=r;let l=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 n=t.charAt(0),i=t.length>1?t.charAt(t.length-1):"";if('"'===n&&'"'===i)return this._value=t.substring(1,t.length-1),void(this._type="string");if("'"===n&&"'"===i)return this._value=t.substring(1,t.length-1),void(this._type="string");if("("===n&&")"===i)return void this._resolveVariableGroup(t);if("["===n&&"]"===i)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("♦"===n)return void(this._type="token");let s=Number(t);if(s==s)return this._value=s,void(this._type="number");this._type="dynamic"};l.prototype._input="",l.prototype._index=-1,l.prototype._type="",l.prototype._subVars=null,l.prototype._funcName="",l.prototype._value,l.prototype._valueWithTokenField="",l.prototype._inputConverter={TRUE:"true",FALSE:"false",PI:"Math.PI","TRUE()":"true","FALSE()":"false","PI()":"Math.PI"},l.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},l.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},l.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},l.prototype.getChildInputWithToken=function(){let t=this._subVars?this._subVars.length:0;if(t<=0)return"";let e=new Array(t);for(let n=0;n<t;++n)e[n]=this._subVars[n].getInputWithTokenField();return e.join(", ")},l.prototype.toString=l.prototype.getExpression,l.prototype.getValue=function(){return this._value},l.prototype.getInput=function(){return this._input},l.prototype.getIndex=function(){return this._index},l.prototype.setIndex=function(t){this._index=t},l.prototype.getFunctionName=function(){return this._funcName},l.prototype.getFieldNames=function(t){if(this._subVars){if(t){let e=this._subVars.length;for(let n=0;n<e;++n)this._subVars[n].getFieldNames(t)}return this._subVars[0].getFieldNames()}return"dynamic"===this._type?(t&&(t[this._input]=!0),this._input):""},l.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 l(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},l.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(","),n=e.length;for(let t=0;t<n;++t)this._subVars[t]=new l(e[t],t)}},l.prototype._resolveArray=function(t){if(this._type="array",t=t.substr(1,t.length-1)){this._subVars=[];let e=t.split(","),n=e.length;for(let t=0;t<n;++t)this._subVars[t]=new l(e[t],t)}};const a=l;let u=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)};o.inherits(u,s),u._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},u.prototype._input="",u.prototype._expression="",u.prototype._alias="",u.prototype._main=null,u.prototype.__F=null,u.prototype._fnTokens=null,u.prototype._fields=null,u.prototype._fieldMap=null,u.prototype._reference="",u.prototype._context=null,u.prototype._rtService=null,u.prototype._intervalServices=null,u.prototype._dataCache=null,u.prototype._dataLastError="",u.prototype._inputWithTokenField="",u.prototype._formulaCount=0,u._invalidOps={"+=":!0,"-=":!0,"*=":!0,"/=":!0,"|=":!0,"&=":!0,"^=":!0},u.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()},u.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},u.prototype.getFunction=function(){return this._main},u.prototype.getFieldNames=function(){return this._fields},u.prototype._setReference=function(t){this._reference=t},u.prototype.getReference=function(){return this._reference},u.prototype.getExpression=function(){return this._expression},u.prototype.toString=u.prototype.getReference,u.prototype.getInput=function(){return this._input},u.prototype.getAlias=function(){return this._alias||this._input},u.prototype.setAlias=function(t){this._alias=t},u.prototype.addFormulaCount=function(){this._formulaCount++},u.prototype.subtractFormulaCount=function(){return 0==--this._formulaCount},u.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]||u._emptyFunction,u._isBoundFormula[t]&&(this.__F[e]=this.__F[e].bind(this))}},u.prototype._logger=function(t){console.log("["+t+"] "+this._fnTokens[t].getFunctionName()+" is executed")},u._emptyFunction=function(){},u.prototype._detectCodeInjection=function(t){let e=!1;if(t.match(/\+\+|--/)&&(e=!0),!e){let n=t.match(/([^=]=+)/g)||[];for(let t=n.length;--t>=0;){let i=n[t],o=i.substring(i.length-2);if(u._invalidOps[o]){e=!0;break}}}return e},u.toUpperCase=function(t){if(!t||"="!==t.charAt(0))return t||"";let e=[],n=[];return t=(t=(t=u.tokenizeQuotes(t,e,n)).toUpperCase()).replace(/TR(\.[\w ]+)+\([^\(\)]*\)(\.[a-zA-Z]+)*/g,u._encloseWithTR),u.resolveTokens(t,e,n)},u._encloseWithTR=function(t){return'TR("'+t+'")'},u.tokenizeQuotes=function(t,e,n){let i;e||(e=[]),n||(n=[]);let o=!1,r=[];do{o=!1,t=t.replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,(function(t){return o=!0,i=e.length,e.push(new a(t,i)),r.push(i),"♦"+i+"♦"}))}while(o);return n.push(r),t},u.tokenizeAdcWithParams=function(t,e,n){let i;e||(e=[]),n||(n=[]);let o=!1,r=[];do{o=!1,t=t.replace(/TR\.\w+\([^\)]*\)+/g,(function(t){return o=!0,i=e.length,e.push(new a(t,i)),r.push(i),"♦"+i+"♦"}))}while(o);return n.push(r),t},u.replaceUnwantedCharacters=function(t,e,n){for(;t.indexOf(" ")>=0;)t=t.replace(/ {2}/g," ");return(t=(t=t.replace(/\$/g,"")).replace(/\&+/g,(function(t){return"&"===t?"+":t}))).replace(/(<=|>=|!=|!==|===|==|=(?!([\w]*\([^()]*\))))/g,(function(t){return"="===t?"==":t}))},u.prototype._tokenizeParentheses=function(t,e,n){e||(e=[]),n||(n=[]);let i={},o=/[\w._]*(?:=|=[\w]*)?\([^()]*\)/,r=new RegExp(o.source,"g");for(;t.match(o);){let o=[];t=t.replace(r,(function(t,n){"="===t.charAt(0)&&(t=t.substr(1,t.length));let r=i[t];return null==r&&(r=e.length,e.push(new a(t,r)),i[t]=r),o.push(r),"♦"+r+"♦"})),n.push(o)}return t},u.prototype._tokenizeConstants=function(t,e,n){e||(e=[]),n||(n=[]);let i=[];return t=t.replace(/[\w._♦]+/g,(function(t){if("♦"===t.charAt(0))return t;let n=e.length;return e.push(new a(t,n)),i.push(n),"♦"+n+"♦"})),n.push(i),t},u.resolveTokens=function(t,e,n){for(let i=n.length;--i>=0;){let o=n[i],r=o.length;for(let n=0;n<r;++n){let i=o[n],r=e[i];t=t.replace(new RegExp("♦"+i+"♦","g"),(function(){return r.getExpression()}))}}return t},u._getInputWithTokenField=function(t,e,n){for(let i=n.length;--i>=0;){let o=n[i],r=o.length;for(let n=0;n<r;++n){let i=o[n],r=e[i];t=t.replace(new RegExp("♦"+i+"♦","g"),(function(){return r.getInputWithTokenField()}))}}return"="+t},u.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=[],n=[];t=u.tokenizeQuotes(t,e,n),t=u.tokenizeAdcWithParams(t,e,n),t=u.replaceUnwantedCharacters(t,e,n),t=this._tokenizeParentheses(t,e,n),t=this._tokenizeConstants(t,e,n),this._inputWithTokenField=u._getInputWithTokenField(t,e,n),t=u.resolveTokens(t,e,n);let i={},o=e.length;for(let n=0;n<o;++n){let o=e[n];if(o.getFunctionName()){let e=this._fnTokens.length;t=t.replace(new RegExp("this\\.__F\\["+n+"\\]","g"),"this.__F["+e+"]"),o.setIndex(e),this._fnTokens.push(o)}o.getFieldNames(i)}return this._expression=t,this.updateContext(),this._main=this._createFunction(this._expression),this._main?(this._fieldMap=i,this._fields=Object.keys(i),this._main):null},u.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},u.prototype.__D=function(t,e){return e[t]},u.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))},u.prototype.changeField=function(t,e){let n=this._fields.indexOf(t);if(n<0)return!1;this._fields.splice(n,1),this._fields.indexOf(e)<0&&this._fields.push(e);let i=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:i,formula:this}),!0},u.prototype.changeFields=function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;let n=this._input;for(let n=t.length;--n>=0;){let i=t[n],o=e[n],r=this._fields.indexOf(i);if(r<0)continue;this._fields.splice(r,1),this._fields.indexOf(o)<0&&this._fields.push(o);let s="♠"+i+"♥",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\\("'+i+'", __R\\)',"g"),'this.__D("'+o+'", __R)')}return this._main=this._createFunction(this._expression),this._dispatch("formulaChanged",{oldInput:n,formula:this}),!0},u.prototype.getRealtimeService=function(){return this._rtService},u.prototype.setRealtimeService=function(t){this._rtService&&this._rtService.dispose(),this._rtService=t,this._rtService.addEventListener("dataChanged",this._onDataCacheChanged)},u.prototype.getIntervalService=function(t){return this._intervalServices[t]},u.prototype.setIntervalService=function(t,e){if(!e)return;let n=this._intervalServices[t];n&&n.removeEventListener("dataChanged",this.dispatchDataChanged),this._intervalServices[t]=e,e.addEventListener("dataChanged",this.dispatchDataChanged)},u.prototype.getCachedData=function(t){return this._dataCache[t]},u.prototype.setCachedData=function(t,e){this._dataCache[t]=e},u.prototype.setDataError=function(t){this._dataLastError=t},u.prototype.dispatchDataChanged=function(t){this._dispatch("dataCacheChanged",{})},u.prototype._onDataCacheChanged=function(t){let e=t.ric,n=t.values,i=this._dataCache[e];if(i)for(let t in n)i[t]=n[t];else this._dataCache[e]=n;this._dispatch("dataCacheChanged",{})},u._proto=u.prototype;const h=u,p={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 d={};const c=/\d+/g;let _=function(t){if(!t||"string"!=typeof t)return"";if("#"===t.charAt(0))return t;let e=t.match(c);if(!e||e.length<3)return t;let n="#";for(let t=0;t<3;t++){let i=+e[t];i>=16||(n+="0"),n+=i?i.toString(16).toUpperCase():"0"}return n},f=function(t){return"#"+(16777216+(t[2]|t[1]<<8|t[0]<<16)).toString(16).slice(1)},g=function(t){return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},y=function(t){let e=parseInt(t.replace(/[^0-9A-F]/gi,""),16);return[e>>16&255,e>>8&255,255&e]},m=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""},C=function(t){if(!t||t<0)return 0;if(t>=255)return 1;let e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},S=function(t){return.2126*C(t[0])+.7152*C(t[1])+.0722*C(t[2])},w=function(t,e){if(t===e)return 1;let n=t,i=e;return t>e&&(i=t,n=e),(i+.05)/(n+.05)},b=function(t){let e=S(t),n=w(1,e);return w(0,e)>=n?"#000000":"#ffffff"},R=function(t,e,n){n>1?n=1:n<0&&(n=0);let i=y(t),o=y(e),r=[];for(let t=0;t<3;++t){let e=(o[t]-i[t])*n;r.push(i[t]+e)}return r};d.rgb2Hex=_,d.num2Hex=f,d.num2Rgb=g,d.hex2Num=y,d.hex2Rgb=m,d.getColorLuminance=C,d.getRelativeLuminance=S,d.getContrastRatio=w,d.getContrastColor=b,d.blendColor=R;let v=function(t,e,n){if(!t)return null;if(!e||t===e)return t;let i;if(n){let o=n.length;for(let r=0;r<o;++r)i=n[r],i&&A(t,e,i)}else for(i in e)A(t,e,i);return t},I=function(t,e){return v({},t,e)},D=function(t){for(let e in t)return!1;return!0},x=function(t,e){if(!Array.isArray(t))return t;if(!e)return null;let n=t;t={};let i=n.length;for(let o=0;o<i;++o){let i=e[o];i&&void 0!==n[o]&&(t[i]=n[o])}return t},A=function(t,e,n){let i=e[n];if(null!=i){let e=t[n];Array.isArray(e)?t[n]=e.concat(i):Array.isArray(i)&&e?t[n]=i.concat(e):t[n]=i}},T=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 n=0;n<t.length;n++)if(!T(t[n],e[n]))return!1}else{if(Object.keys(t).length!==Object.keys(e).length)return!1;for(let n in t)if(!T(t[n],e[n]))return!1}return!0}return!1},L=function(t){return Array.isArray(t)?"{\n"+t.join("\n")+"\n}":t},E=function(t){return t.replace(/\n+/g,"\n\t").replace(/\n\t}$/,"\n}")},M=function(t,e){e||(e=[]);for(let n in t){let i=t[n];"object"==typeof i?M(i,e):e.push(i)}return e},F=function(t,e,n){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!=n&&(this._ctx=n),this.promise=new Promise(function(t,e){this._resolve=t,this._reject=e}.bind(this))};F.prototype.promise=null,F.prototype._resolve=null,F.prototype._reject=null,F.prototype._resolveHandler=null,F.prototype._rejectHandler=null,F.prototype._ctx=null,F.prototype._fulfilled=!1,F.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()}},F.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()}},F.prototype.isFulfilled=function(){return this._fulfilled},F.prototype._finally=function(){this._fulfilled=!0,this._ctx=this._resolveHandler=this._rejectHandler=null,this._resolve=this._reject=null};let P={},z=function(t,e){"attributes"==e.type&&"lang"==e.attributeName&&(t.lang=e.target.lang||"en")},V=function(t,e,n){"attributes"===n.type&&(null!=e?n.attributeName===e&&t(n.target.getAttribute(e)):t(n.target))};P._getNewId=function(){return"observer_"+ ++P._id},P._addObserver=function(t,e,n){let i=n;i||(i={}),i.attributes=!0,P._observer.observe(t,i),P._addListener(t,e)},P._onMutationCallback=function(t){for(let e=0;e<t.length;e++){let n=t[e],i=P._listeners[n.target._observeId];for(let t=0;t<i.length;t++)i[t](n)}},P._addListener=function(t,e){let n=P._listeners;if(n||(n=P._listeners={}),!t._observeId){let e=P._getNewId();t._observeId=e}n[t._observeId]||(n[t._observeId]=[]);let i=n[t._observeId];i.indexOf(e)<0&&i.push(e)},P.addLanguageListener=function(t){t&&(t.lang=document.documentElement.lang||"en",P._addObserver(document.documentElement,z.bind(null,t)))},P.addAttributeListener=function(t,e,n){t&&e&&P._addObserver(t,V.bind(null,e,n))},P._observer=new MutationObserver(P._onMutationCallback),P._listeners={},P._id=0;let k={en:!0,de:!0,ja:!0,zh:!0,"zh-Hant":!0},N={_deferred:null,themeReady:null,_defaultColors:{up:"#39C46E",down:"#F5475B",level:"#C2C2C2",tickUp:"#39C46E",tickDown:"#F5475B",baseGrid:"#1A1A1C",baseText:"#C2C2C2",trackColor:"#FF9933"}};N.themeColors=N._defaultColors,N._components={},N._themeName="",N._elfVersion=0,N._dummyIcon=null,N._iconLoaded=!1,N._profileName=null,N._callbacks=[],N._observed=!1,N._pendingResolve=!1,N._themeLoaded=!1,N._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"}}},N._icons["halo-theme"]=N._icons["elf-theme-halo"],N._icons["solar-theme"]=N._icons["elf-theme-solar"],N.setElfVersion=function(t){N._elfVersion=t},N.getElfVersion=function(){if(!N._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);N._elfVersion=t}return N._elfVersion},N.hasComponent=function(t){let e=N._components[t];if(null==e){e=0;let n=N.getElfVersion();if(t){let i;1===n?(i=document.createElement(t),i.is===t&&(e=n)):n>1&&(window.customElements&&window.customElements.get(t)||document.createElement(t).constructor!==HTMLElement)&&(e=n),N._components[t]=e}}return e},N.toLangString=function(t){if(!t)return"";if("zh-hant"===(t=t.toLowerCase()))return"zh-Hant";let e=t.replace(/-.*/,"");return k[e]?e:""},N.hasTheme=function(t){return t===N.getThemeName()},N.getThemeName=function(t){return N._themeName||(N._themeName=N.getCssVariable("--theme-name",document.documentElement)),N._themeName},N.setThemeName=function(t){N._themeName=t},N.isThemeLoaded=function(){return N._themeLoaded},N.getColors=function(){return N.themeColors},N.isHaloTheme=function(t){return null==t&&(t=N.getThemeName()),!!t&&t.indexOf("halo")>=0},N.injectIcons=function(t){if("object"!=typeof t)return;let e=N.getThemeName();t.themeName=e;let n=N.getElfVersion();t.elfVersion=n;let i=N._icons[e];i&&(t.icons=i)},N.getIconList=function(){let t=N._icons[N.getThemeName()];return t?M(t):[]},N._onIconPreloaded=function(){if(N._dummyIcon){let t=N._dummyIcon.parentNode;t&&t.removeChild(N._dummyIcon),N._dummyIcon=null}},N.prepareIconPreloading=function(){if(!N._iconLoaded){N._iconLoaded=!0;let t=N.getIconList();if(t.length){setTimeout(N._onIconPreloaded,10);let e=N._dummyIcon=document.createElement("ef-icon");return e.style.transform="scale(0)",document.body.appendChild(e),t}}return null},N.getCssVariable=function(t,e){let n="",i=e||document.body;return window&&"string"==typeof t&&1===i.nodeType&&t.match(/^--/)&&(n=window.getComputedStyle(i).getPropertyValue(t),n=n.replace(/[\"\']/g,"")),n},N.getCssVariables=function(t,e){let n=e||document.body;if(window&&1===n.nodeType){let e=window.getComputedStyle(n);for(let n in t){let i=t[n];i&&i.match(/^--/)&&(t[n]=e.getPropertyValue(i).replace(/\"/g,""))}}return t||null},N.setRTK=function(t){null!=t&&(N._rtk=t)},N.getMovementColorProfile=function(){return document.documentElement.getAttribute("movement-color-profile")},N._addThemeChangedCallback=function(t){let e=N._callbacks;e.indexOf(t)<0&&e.push(t)},N.reloadThemeColors=function(){return N._deferred&&N._deferred.isFulfilled()?(N._profileName="",N._themeLoaded=!1,N.themeReady=null,N.getThemeColors()):N.themeReady},N.getThemeColors=function(t){if("function"==typeof t&&N._addThemeChangedCallback(t),N.themeReady)return N.themeReady;let e=N._deferred=new F;N.themeReady=e.promise;let n=N.getMovementColorProfile();if(n)n!==N._profileName?setTimeout(N._profileNameRetrieved,100):N._deferred.resolve(N.themeColors);else{let t={providerName:"Configuration",settingName:"RDE_USER_CURRENT_TICK_COLOR"},e=window?window.JET:null;if(N._themeLoaded=!1,N._rtk&&N._rtk.Settings)N._rtk.Settings.getAsync(t).then(N._loadingProfileSuccess).catch(N._loadingProfileFailure);else if(e&&e.Settings)try{e.Settings.read(N._loadingProfileSuccess,t)}catch(t){N._loadingProfileFailure()}else setTimeout(N._profileNameRetrieved,100)}return e.promise};let O=function(t){if(t!==N._profileName){N._retrieveThemeColors(t),N._pendingResolve&&(N._pendingResolve=!1,N._deferred.resolve(N.themeColors));let e=N._callbacks;for(let t=0;t<e.length;t++)e[t]()}};N._loadingProfileSuccess=function(t){t&&document.documentElement.setAttribute("movement-color-profile",t.toLowerCase()),N._observed?N._pendingResolve=!0:N._profileNameRetrieved(t)},N._loadingProfileFailure=function(){N._retrieveThemeColors(),N._observed||(N._observed=!0,P.addAttributeListener(document.documentElement,O,"movement-color-profile")),N._deferred.reject("Failed to get movement color profile from settings.")},N._profileNameRetrieved=function(){let t=N.getMovementColorProfile();N._retrieveThemeColors(t),N._observed||(N._observed=!0,P.addAttributeListener(document.documentElement,O,"movement-color-profile")),N._deferred.resolve(N.themeColors)},N._retrieveThemeColors=function(t){N._themeLoaded=!0,N._profileName=t;let e=N.themeColors=N.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=N._defaultColors.up,e.down=N._defaultColors.down,e.level=N._defaultColors.level,e.tickUp=N._defaultColors.tickUp,e.tickDown=N._defaultColors.tickDown),e.positive=e.up,e.negative=e.down,e.neutral=e.level;let n=document.createElement("table");n.style.visibility="hidden",n.style.position="fixed",n.style.left="0",n.style.top="0",n.style.width="0";let i=n.insertRow(-1),o=i.insertCell(-1);document.body.appendChild(n);let r=window.getComputedStyle(i);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=N._defaultColors.baseGrid,e.tableText=N._defaultColors.baseText,e.tableBorder="")),e.tableBg=_(e.tableBg),e.tableText=_(e.tableText),e.tableBorder=_(e.tableBorder),document.body.removeChild(n),e.baseGrid=e.tableBg,e.baseText=e.tableText,e.trackColor=e.primary||N._defaultColors.trackColor};const H=N,B=(new Date(NaN),Date.UTC(1900,0,1)),G=Date.UTC(1900,2,1),W=864e5,U=["sun","mon","tue","wed","thu","fri","sat"],Y=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],X=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],q=["January","February","March","April","May","June","July","August","September","October","November","December"];let j=function(t){return t>9?""+t:"0"+t},K={D:function(t,e){return""+t.getDate()},DD:function(t,e){return j(t.getDate())},DDD:function(t,e){return e[U[t.getDay()]]},D_:function(t,e){return e[Y[t.getDay()]]},M:function(t,e){return""+(t.getMonth()+1)},MM:function(t,e){return j(t.getMonth()+1)},MMM:function(t,e){return e[X[t.getMonth()]]},M_:function(t,e){return e[q[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 j(t.getHours())},h:function(t,e){let n=t.getHours()%12;return 0===n?"12":""+n},h_:function(t,e){let n=t.getHours()%12;return n=0===n?12:n,j(n)},m:function(t,e){return""+t.getMinutes()},m_:function(t,e){return j(t.getMinutes())},s:function(t,e){return""+t.getSeconds()},s_:function(t,e){return j(t.getSeconds())},S:function(t,e){return~~(t.getMilliseconds()/100)},SS:function(t,e){return j(~~(t.getMilliseconds()/10))},S_:function(t,e){return(n=t.getMilliseconds())>99?""+n:n>9?"0"+n:"00"+n;var n},A:function(t,e){return t.getHours()<12?e.AM:e.PM},a:function(t,e){return t.getHours()<12?e.am:e.pm}},J={_dateTimePattern:"M/D/YY h:mm A",_localeSetting:"en",_activeLocaleMap:null,_activeInput:null,setDateTimePattern:function(t){J._dateTimePattern=t||"M/D/YY h:mm A"},setLocale:function(t){let e=H.toLangString(t);J._localeSetting=p[e]?e:"en"},format:function(t,e,n){let i=null,o="",r=!(!n||"LOCAL"!==n.toUpperCase());if("number"==typeof t)t>1e8?i=new Date(t):(i=J.fromDateNumber(t),r=!0);else if(t instanceof Date)i=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," ")),i=new Date(o)}return J.isInvalidDate(i)?t||"":(r||i.setTime(i.getTime()+6e4*i.getTimezoneOffset()),J.formatDateObject(i,e))},formatDateObject:function(t,e){if(J.isInvalidDate(t))return"";e||(e=J._dateTimePattern),J._activeInput=t,J._activeLocaleMap=p[J._localeSetting]||DateTimeLocale.en;let n=e.replace(/D+|M+|Y+|H+|S+|A+|d+|m+|y+|h+|s+|a+|\[[^\]]*\]+/g,J._parseDatePattern);return J._activeInput=null,n},_lowerCaseDatePatterns:{d:!0,y:!0},_parseDatePattern:function(t){let e=t?t.charAt(0):"";if("["===e)return t.substring(1,t.length-1);let n=K[t];if(!n){let i=t;J._lowerCaseDatePatterns[e]&&(i=t.toUpperCase(),e=e.toUpperCase(),n=K[i]),n||(i=e+"_",n=K[i])}return n?n(J._activeInput,J._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=J.dateNumberToMs(t);if(e==e){let n=J.timeNumberToMs(t);return new Date(e+n)}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++,e*W},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):J.fromDateNumber(t);else if(t){let n=t+"",i=n.match(/^\d{4}(-\d{2}(-\d{2}(T\d{2}\:\d{2}\:\d{2})?)?)?$/);n=n.replace(/\-/g,"/"),i&&(n=n.replace(/T/g," ")),e=new Date(n)}else e=new Date(NaN);return e},toDateNumber:function(t){return J._millisecondToDateNumber(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()))},toTimeNumber:function(t){return Date.UTC(1970,0,1,t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds())/W},_millisecondToDateNumber:function(t){if((t=+t)!=t||t<B)return NaN;{let e=t/W+25569;return t<G&&e--,e}},toYYYYMMDD:function(t){let e=t?t.toJSON():"";return e?e.slice(0,10):""}};const Q=J;const Z={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}};const $={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,n){return t?e:n},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}};let tt={};tt.ABS=Math.abs,tt.ACOS=Math.acos,tt.ACOSH=function(t){return Math.log(t+Math.sqrt(t*t-1))},tt.ASIN=Math.asin,tt.ASINH=function(t){return t===-1/0?t:Math.log(t+Math.sqrt(t*t+1))},tt.ATAN=Math.atan,tt.ATAN2=function(t,e){return Math.atan2(e,t)},tt.ATANH=function(t){return Math.log((1+t)/(1-t))/2},tt.CEILING=function(t,e){return e||(e=1),t/=e,Math.ceil(t)*e},tt.CEIL=tt.CEILING,tt.COMBIN=function(t,e){let n=tt.FACT;return n(t)/(n(e)*n(t-e))},tt.COS=Math.cos,tt.COSH=function(t){let e=Math.exp(t);return(e+1/e)/2},tt.DEGREES=function(t){return t/(Math.PI/180)},tt.EVEN=function(t){return(t=Math.ceil(t))%2?t<0?t-1:t+1:t},tt.EXP=Math.exp,tt.FACT=function(t){if(t<0)return NaN;t=Math.floor(t);let e=1;for(;t>1;)e*=t,--t;return e},tt.FACTDOUBLE=function(t){if(t<0)return NaN;t=Math.floor(t);let e=1;for(;t>1;)e*=t,t-=2;return e},tt.FLOOR=function(t,e){return e||(e=1),t/=e,Math.floor(t)*e},tt.GCD=function(t,e){if(t<0&&(t=-t),e<0&&(e=-e),e>t){let n=t;t=e,e=n}for(;0!=e;){if(0==(t%=e))return e;e%=t}return t},tt.INT=Math.floor,tt.LCM=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t.length,n=Math.abs(t[0]);for(let i=1;i<e;i++){let e=Math.abs(t[i]),o=n;for(;n&&e;)n>e?n%=e:e%=n;n=Math.abs(o*t[i])/(n+e)}return n},tt.LN=Math.log,tt.LOG=function(t,e){return null==e&&(e=10),Math.log(t)/Math.log(e)},tt.LOG10=function(t){return Math.log(t)/Math.LN10},tt.MOD=function(t,e){return t%e},tt.ODD=function(t){return(t=Math.ceil(t))%2==0?t<0?t-1:t+1:t},tt.POWER=Math.pow,tt.PRODUCT=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t[0];if(null==e||e!=e)return NaN;for(let n=t.length;--n>=1;)e*=t[n];return e},tt.PROD=tt.PRODUCT,tt.QUOTIENT=function(t,e){return Math.floor(t/e)},tt.RADIANS=function(t){return t*(Math.PI/180)},tt.RAND=Math.random,tt.RANDBETWEEN=function(t,e){return Math.floor(Math.random()*(e-t+1))+t},tt.ROUND=function(t,e){if(!e)return Math.round(t);let n=Math.pow(10,e);return Math.round(t*n)/n},tt.ROUNDDOWN=function(t,e){if(!e)return Math.floor(t);let n=Math.pow(10,e);return Math.floor(t*n)/n},tt.ROUNDUP=function(t,e){if(!e)return Math.ceil(t);let n=Math.pow(10,e);return Math.ceil(t*n)/n},tt.SERIESSUM=function(t,e,n,i){let o=0;for(let r=i.length;--r>=0;)o+=i[r]*Math.pow(t,e+r*n);return o},tt.SIGN=function(t){return t>0?1:t<0?-1:0},tt.SIN=Math.sin,tt.SINH=function(t){let e=Math.exp(t);return(e-1/e)/2},tt.SQRT=Math.sqrt,tt.SQRTPI=function(t){return Math.sqrt(t*Math.PI)},tt.SUM=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let n=t.length;--n>=0;)e+=t[n];return e},tt.SUMPRODUCT=function(){let t,e=arguments[0]instanceof Array?arguments[0]:arguments,n=e.length;if(0===n)return 0;let i=[];for(t=0;t<n;++t)i[t]=1;for(t=0;t<n;++t)i[t]*=e[t];let o=0;for(t=0;t<n;++t)o+=i[t];return o},tt.SUMSQ=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let n=t.length;--n>=0;){let i=t[n];e+=i*i}return e},tt.TAN=Math.tan,tt.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)},tt.TRUNC=function(t,e){if(!e)return Math.floor(t);let n=Math.pow(10,e);return Math.floor(t*n)/n};const et=tt;let nt={AVERAGE:function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=t.length;if(e<=0)return NaN;let n=0;for(let i=e;--i>=0;)n+=t[i];return n/e}};nt.AVG=nt.AVERAGE,nt.COUNT=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments,e=0;for(let n=t.length;--n>=0;){let i=t[n];null!=i&&i==i&&++e}return e},nt.MAX=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;if(t.length<=0)return NaN;let e=t[0];for(let n=t.length;--n>=1;)t[n]>e&&(e=t[n]);return e},nt.MIN=function(){let t=arguments[0]instanceof Array?arguments[0]:arguments;if(t.length<=0)return NaN;let e=t[0];for(let n=t.length;--n>=1;)t[n]<e&&(e=t[n]);return e},nt.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 n=nt.AVERAGE(t),i=0;for(let o=e;--o>=0;){let e=t[o]-n;i+=e*e}return Math.sqrt(i/(e-1))},nt.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 n=nt.AVERAGE(t),i=0;for(let o=e;--o>=0;){let e=t[o]-n;i+=e*e}return Math.sqrt(i/e)};const it=nt;let ot={},rt=function(t){return t||0===t?t+"":""};ot.EXACT=function(t,e){return(t+="")==(e+="")?1:0},ot.FIND=function(t,e,n){return(t=rt(t))&&(e=rt(e))?((!(n=+n)||n<0)&&(n=0),e.indexOf(t,n)):0},ot.LEFT=function(t,e){return(e=+e)||(e=0),e<0&&(e=1),rt(t).substr(0,e)},ot.LENGTH=function(t){return rt(t).length},ot.LEN=ot.LENGTH,ot.LOWER=function(t){return rt(t).toLowerCase()},ot.MID=function(t,e,n){return rt(t).substr(e,n)},ot.REPLACE=function(t,e,n,i){i+="";let o=(t=rt(t)).split("");return o.splice(n,e,i),o.join("")},ot.RIGHT=function(t,e){(e=+e)||(e=0),e<0&&(e=1);let n=(t=rt(t)).length-e;return t.substr(n,e)},ot.TRIM=function(t){return rt(t).trim()},ot.UPPER=function(t){return rt(t).toUpperCase()},ot.VALUE=function(t){return+t},ot.CHAR=function(t){let e=+t;return String.fromCharCode(e)},ot.CLEAN=function(t){let e=rt(t).split("");for(let t=e.length;--t>=0;){let n=e[t].charCodeAt(0);(n<32||n>127)&&(e[t]="")}return e.join("")},ot.CODE=function(t){return rt(t).charCodeAt(0)},ot.PROPER=function(t){let e=(t=rt(t)).split(/[\W_]/g),n=t.match(/[\W_]/g),i=e.length,o="";for(let t=0;t<i;t++){let i=e[t],r=i.length;1===r?o+=i.toUpperCase():0!==r&&(o+=i.charAt(0).toUpperCase()+i.substr(1).toLowerCase());let s=n[t];s&&(o+=s)}return o},ot.REPEAT=function(t,e){if(!(e=+e)||e<0)return"";if(""===(t=rt(t)))return"";let n=t;for(let i=1;i<e;i++)n+=t;return n},ot.STRING=function(t,e){return(t=+t)?(!(e=+e)||e<0?e=0:e>9&&(e=9),t.toFixed(e)):""};const st=ot;let lt=function(){this._context={},lt._addContext(this._context,lt.getContext()),this._context._DATA=this._getData.bind(this),this._setData=this._defaultFormulaDataSetter.bind(this),this._formulas=[],this._formulaMap={},this._referenceMap={}};o.inherits(lt,s),lt.prototype._context=null,lt.prototype._rowData=null,lt.prototype._setData=null,lt.prototype._formulas=null,lt.prototype._formulaMap=null,lt.prototype._referenceMap=null,lt._context=null,lt.getContext=function(){let t=lt._context;return t||(t={},lt._context=t,lt._addContext(t,Q),lt._addContext(t,Z),lt._addContext(t,$),lt._addContext(t,et),lt._addContext(t,it),lt._addContext(t,st)),t},lt.addContext=function(t){let e=lt.getContext();lt._addContext(e,t)},lt._addContext=function(t,e){for(let n in e)t[n]=e[n]},lt.prototype.setFormulaDataGetter=function(t){"function"==typeof t&&(this._context._DATA=t)},lt.prototype.setFormulaDataSetter=function(t){"function"==typeof t&&(this._setData=t)},lt.prototype._defaultFormulaDataSetter=function(t,e,n,i){if("..."!==e){let o=t.getAlias();n[o]=e,i&&(i[o]=e)}},lt.prototype.addFormula=function(t){let e;return t instanceof h?e=t:(this._rowData={},e=new h(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},lt.prototype.mockFormula=function(t){let e;return e=new h(t instanceof h?t.getInput():t,this._context),e},lt.prototype.removeFormula=function(t){let e;if(t instanceof h&&(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 n=this._formulas.indexOf(e);n>=0&&(this._formulas.splice(n,1),delete this._formulaMap[t],delete this._referenceMap[t]),e.dispose()}return e||null},lt.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={}},lt.prototype.getFormula=function(t){let e;return e="number"==typeof t?this._formulas[t]:this._formulaMap[t],e||null},lt.prototype.getFormulaByExpression=function(t){let e=this._formulas.length;for(let n=0;n<e;++n){let e=this._formulas[n];if(e.getInput()===t)return e}return null},lt.prototype.getAllFormulas=function(){return this._formulas},lt.prototype.getAllFormulaReferences=function(){return this._referenceMap},lt.prototype.getFormulaCount=function(){return this._formulas.length},lt.prototype._generateUniqueReference=function(t){let e=t,n=0;for(;null!=this._referenceMap[e];)e=t+"_"+ ++n;return e},lt.prototype.addReference=function(t,e){if(!t||!e)return"";e=this._generateUniqueReference(e);let n="";if(t instanceof h){if(!this._setFormulaReference(t,e))return"";n=t.getAlias()}else n=t;return this._referenceMap[e]=n,e},lt.prototype.renameReference=function(t,e){if(!e)return this.removeReference(t);if(!t||null==this._referenceMap[t]||t===e)return!1;let n=this._formulaMap[t];if(n&&!this.isValidReference(n,e))return!1;for(let n=this._formulas.length;--n>=0;){let i=this._formulas[n];if(i.changeField(t,e)){let t=i.getReference();t&&(this._referenceMap[t]=i.getAlias())}}return n&&this._setFormulaReference(n,e),this._referenceMap[e]=this._referenceMap[t],delete this._referenceMap[t],!0},lt.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},lt.prototype.resolveReference=function(t){return this._referenceMap[t]||t},lt.prototype._getData=function(t,e){if(!this._rowData)return null;let n=this._rowData[this.resolveReference(t)];if(n){let t=Number(n);t==t&&(n=t)}return n},lt.prototype._setFormulaReference=function(t,e){if(this._formulaMap[e])return console.warn("Duplicate formula reference detected."),!1;let n=t.getReference();if(n===e)return!1;e&&(this._formulaMap[e]=t),t._setReference(e);let i=this._sortDependencies(this._formulas,this._formulaMap);return i?(this._formulas=i,delete this._formulaMap[n],!0):(t._setReference(n),delete this._formulaMap[e],!1)},lt.prototype.calculate=function(t,e){this._rowData=t;let n=this._formulas.length;for(let i=0;i<n;++i){let n=this._formulas[i];if(e){let t=null!=e[n.getAlias()];if(!t){let i=n.getFieldNames();for(let n=i.length;--n>=0;)if(null!=e[this.resolveReference(i[n])]){t=!0;break}if(!t)continue}}let o=n.calculate(t);this._setData(n,o,t,e)}this._rowData=null},lt.prototype.isValidReference=function(t,e){if(!e)return!0;if(this._referenceMap[e])return!1;let n=t.getReference(),i=this._createParentChildrenMap(this._formulas);if(n){delete i[n];for(let t in i){let o=i[t],r=o.indexOf(n);-1!==r&&(o=o.slice(0),o.splice(r,1),r=o.indexOf(e),-1===r&&o.push(e),i[t]=o)}}return i[e]=t.getFieldNames(),!!this._sortParentChildrenMap(i)},lt.prototype._sortDependencies=function(t,e){if(1===t.length)return t;let n=this._createParentChildrenMap(t),i=this._sortParentChildrenMap(n);if(!i)return null;let o=t.filter((function(t){return!t.getReference()})),r=[];if(e){for(let t=i.length;--t>=0;){let n=e[i[t]];n&&r.push(n)}o.length>0&&(r=r.concat(o))}return r},lt.prototype._createParentChildrenMap=function(t){let e,n={};for(e=t.length;--e>=0;){let i=t[e],o=i.getReference();o&&(n[o]=i.getFieldNames())}return n},lt.prototype._sortParentChildrenMap=function(t){let e,n,i,o,r,s={};for(r in t){i=t[r],o=i.length;for(let t=0;t<o;++t)n=i[t],s[n]=s[n]+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),i=t[r],o=i?i.length:0,e=0;e<o;++e)n=i[e],--s[n]>0||l.push(n);for(n in s)if(s[n])return null;return a},lt._proto=lt.prototype;let at={};at.isIE=function(){let t=window.navigator.userAgent;return t.indexOf("MSIE ")>0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0}(),at.isTouchDevice=!!(navigator.maxTouchPoints&&navigator.maxTouchPoints<256||navigator.msMaxTouchPoints&&navigator.msMaxTouchPoints<256),at.isSafari=function(){let t=navigator.userAgent;return!/Chrome|Android|CriOS|FxiOS|EdgiOS/i.test(t)&&/Safari/i.test(t)}(),at.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),at.getElement=function(t){return at.isElement(t)?t:t&&at.isFunction(t.getElement)?t.getElement():null},at.isElement=function(t){return!!t&&1===t.nodeType},at.isEmpty=function(t,e){return null==t||void 0===t||!e&&""===t||at.isArray(t)&&0===t.length},at.isNumber=function(t){return"number"==typeof t&&isFinite(t)},at.isString=function(t){return"string"==typeof t},at.isArray=Array.isArray,at.isFunction=function(t){return"function"==typeof t},at.getClientPosition=function(t,e){let n=e||{};if(t.getBoundingClientRect){let e=t.getBoundingClientRect();n.x=e.left,n.y=e.top}else n.x=t.clientX,n.y=t.clientY;return n},at.getRelativePosition=function(t,e,n){n=at.getClientPosition(t,n);let i=at.getClientPosition(e);return n.x-=i.x,n.y-=i.y,n},at.moveArrayItem=function(t,e,n){if(!t)return null;let i=t.length;if(e>=i&&n>=i)return t;let o=t.splice(e,1)[0];return n<i?t.splice(n,0,o):t[n]=o,t},at.pushArrayItems=function(t,e){let n=e?e.length:0;if(n>0)if(n<1e5)n>1?Array.prototype.push.apply(t,e):t.push(e[0]);else{let i=0,o=0;for(;i<n;)o+=1e5,Array.prototype.push.apply(t,e.slice(i,o)),i=o}return t},at.insertEmptyItems=function(t,e,n){if(n>0)if(n>1){let i=t.slice(e);t.length=e,t.length+=n,at.pushArrayItems(t,i)}else t.splice(e,0,null)},at.cycleArray=function(t,e){if(e>0&&t&&e<t.length){let n=t.splice(0,e);return t.concat(n)}return t||null},at.lowerBound=function(t,e,n,i,o){(null==n||n<0)&&(n=0),(null==i||i<0||i>t.length)&&(i=t.length),n>i&&(n=i),null==o&&(o=at._defaultLessComparator);let r=0;for(;i>n;)r=n+i>>1,o(t[r],e)?n=r+1:i=r;return n},at.upperBound=function(t,e,n,i,o){let r=at.lowerBound(t,e,n,i,o);for(;t[r]===e;)++r;return r},at.stringFormat=function(t){let e=Array.prototype.slice.call(arguments,1);return t.replace(/{(\d+)}/g,(function(t,n){return null!=e[n]?e[n]:t}))},at._defaultLessComparator=function(t,e){return t<e},at._deprecatedFunction=function(){console.warn("Calling deprecated method")},at.calculatePercent=function(t,e,n){if(!t&&0!==t||!e&&0!==e||!n&&0!==n)return NaN;if(n===t)return 50;let i=(e-t)/(n-t);return i<0?0:i>1?100:100*i},at.closestElement=function(t,e){let n=t;for(;n;){if(n.classList&&n.classList.contains(e))return n;n=n.parentNode||n.host}return null},at._preventDefault=function(t){t.preventDefault(),t.stopPropagation()};const ut=at;let ht=function(t){this.dispatch=this.dispatch.bind(this),this._listeners=[],this.setSender(t)};ht.prototype.listen=function(t,e){if(t&&ut.isFunction(t)&&this._listeners.indexOf(t)<0)if(null==e)this._listeners.push(t);else{t._priority=e;let n=ut.lowerBound(this._listeners,t,0,this._listeners.length,ht.listenerComparer);this._listeners.splice(n,0,t)}},ht.prototype.unlisten=function(t){if(t){let e=this._listeners.indexOf(t);e>=0&&this._listeners.splice(e,1)}},ht.prototype.unlistenAll=function(){this._listeners.length=0},ht.prototype.getListenerCount=function(){return this._listeners.length},ht.prototype.hasListener=function(){return this._listeners.length>0},ht.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(let e=0;e<this._listeners.length;e++)this._listeners[e](t);null!==this._sender&&(t.sender=null),this._dispatching=!1}},ht.prototype.isDispatching=function(){return this._dispatching},ht.prototype.isEnabled=function(){return this._enabled},ht.prototype.enable=function(t){this._enabled=!1!==t},ht.prototype.disable=function(t){this._enabled=!1===t},ht.prototype.setSender=function(t){this._sender=t||null},ht.prototype.setEventArgExtender=function(t){this._extender=null!=t?t:null},ht.listenerComparer=function(t,e){return null==e._priority||t._priority>=e._priority},ht.prototype._listeners=null,ht.prototype._sender=null,ht.prototype._extender=null,ht.prototype._enabled=!0,ht.prototype._dispatching=!1,ht._proto=ht.prototype;const pt=ht;let dt=function(){};dt.prototype._customEvents=null,dt.prototype.listen=function(t,e,n){this._customEvents&&this._customEvents[t]&&this._customEvents[t].listen(e,n)},dt.prototype.unlisten=function(t,e){this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlisten(e)},dt.prototype.unlistenAll=function(t){if(t)this._customEvents&&this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(let t in this._customEvents)this._customEvents[t].unlistenAll()},dt.prototype._addEvent=function(t){t&&(this._customEvents||(this._customEvents={}),this._customEvents[t]||(this._customEvents[t]=new pt(this)))},dt.prototype._addEvents=function(t){let e=Array.isArray(t)?t:arguments,n=e.length;for(let t=0;t<n;++t)this._addEvent(e[t])},dt.prototype._isEventDispatching=function(t){let e=this._customEvents[t];return!!e&&e.isDispatching()},dt.prototype._disableEvent=function(t,e){let n=this._customEvents[t];n&&n.disable(e)},dt.prototype._hasListener=function(t){return!(!this._customEvents||!this._customEvents[t])&&this._customEvents[t].hasListener()},dt.prototype._dispatch=function(t,e){this._customEvents[t].dispatch(e)},dt._proto=dt.prototype;const ct=dt;let _t=function(){this._rows={},this._addEvent("dataComposed"),this._addEvent("dataChanged")};o.inherits(_t,ct),_t.prototype._rows,_t.prototype._composing=!1,_t.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0)},_t.prototype.setSubscriptions=function(){},_t.prototype.getSubscriptions=function(){return null},_t.prototype.addSubscription=function(){},_t.prototype.removeSubscription=function(){},_t.prototype.startAllSubscriptions=function(){},_t.prototype.stopAllSubscriptions=function(){},_t.prototype.getSubscription=function(){return null},_t.prototype.getPrimaryRic=function(){return""},_t.prototype.clearAllData=function(t){this._rows={},t||this._dispatchDataChange({globalChange:!0})},_t.prototype.clearColumnData=function(t,e){let n="string"==typeof t?[t]:t;for(let t=n.length;--t>=0;){let e=n[t];if(e)for(let t in this._rows)delete this._rows[t][e]}e||this._dispatchDataChange({globalChange:!0})},_t.prototype.getData=function(t,e){let n=this.getRowData(t);return n?n[e]:null},_t.prototype.getAllRics=function(){return null},_t.prototype.getAllRowIds=function(){let t=[];for(let e in this._rows)t.push(e);return t},_t.prototype.hasRowId=function(t){return!!this._rows[t]},_t.prototype.getColumnData=function(t){let e=[];for(let n in this._rows)e.push(this._rows[n][t]);return e},_t.prototype.getRowData=function(t){return this._rows[t]||null},_t.prototype.getMultipleRowData=function(t,e,n){let i=t.length;null==n&&(n=i),n>i&&(n=i),e>0||(e=0);let o=new Array(i),r=this._rows;for(let i=e;i<n;++i)o[i]=r[t[i]]||null;return o},_t.prototype.getAllRowData=function(){let t=[],e=this._rows;for(let n in e)t.push(e[n]);return t},_t.prototype.setData=function(t,e,n){let i={};return i[e]=n,this.setRowData(t,i)},_t.prototype.hasDataCloudData=function(t){},_t.prototype.setRowData=function(t,e,n){let i=this.getRowData(t),o=!1,r=null;if(e)if(i){for(let t in e)i[t]=e[t],o=!0;r=e}else i=e,this._rows[t]=i,o=!0;else i&&(delete this._rows[t],o=!0);if(o&&!this._composing){let e=n||{};e.rid=t,r&&(e.changes=r),e.rowData=i,this._dispatchDataChange(e)}return o},_t.prototype.cloneRowData=function(t){let e=this._rows[t];if(!e)return null;let n={};for(let t in e)0!==t.indexOf("FREE_TEXT")&&(n[t]=e[t]);return n},_t.prototype._replaceRowId=function(t,e){let n=this._rows;return!!n[t]&&(n[e]=n[t],delete n[t],!0)},_t.prototype.replaceRowIds=function(t){if("object"==typeof t)for(let e in t)this._replaceRowId(e,t[e])},_t.prototype.addStaticFields=function(){},_t.prototype.removeStaticFields=function(){},_t.prototype.resetStaticFields=function(){},_t.prototype.getStaticFields=function(){},_t.prototype.dump=function(t){return _t.constructTable(this.getAllRowData(),t,Object.keys(this._rows))},_t.prototype.log=function(t){console.table(this.dump(t))},_t.prototype.setDataCloudSettings=function(){},_t.prototype.getDataCloudFields=function(){},_t.prototype.addDataCloudFields=function(){},_t.prototype.removeDataCloudField=function(){},_t.prototype._dispatchDataChange=function(t){this._composing||(this._composing=!0,this._dispatch("dataComposed",t),this._composing=!1,this._dispatch("dataChanged",t))},_t._defaultPropertyGetter=function(t,e,n){let i=e[n];return i?i[t]:null},_t._defaultGetter=function(t,e){return t[e]},_t.constructTable=function(t,e,n){let i=0,o=t.length,r=o,s=null,l=n||null,a=_t._defaultGetter,u=!1;if(e){if(e.rowCount&&(r=e.rowCount,u=!0),e.colNames){s={};let t=e.colNames.length;for(let n=0;n<t;++n)s[e.colNames[n]]=!0;u=!0}e.getter&&(a="string"==typeof e.getter?_t._defaultPropertyGetter.bind(null,e.getter):e.getter,u=!0),e.startIndex&&(i=e.startIndex,u=!0),!1===e.withRowIds&&(l=null)}if(!u&&!l)return t;let h=[];for(let e=i;e<o&&!(h.length>=r);++e){let n=t[e],i=l?{rid:l[e]}:{};if(n){let t;if(s)for(t in s)null!=n[t]&&(i[t]=a(n,t));else for(t in n)i[t]=a(n,t)}h.push(i)}return h};const ft=_t;let gt=function(t,e){this._rid=t,this._childIds=[],this._shared=e,e.defaultCollapsing&&(this._collapsed=!0)};o.inherits(gt,s);const yt="Uncategorized";gt._subSegSortLogic=function(t,e){return t===yt?1:e===yt||t<e?-1:e<t?1:0},gt.prototype._shared=null,gt.prototype._rid,gt.prototype._childIds,gt.prototype._childDataIds=null,gt.prototype._collapsed=!1,gt.prototype._order=0,gt.prototype._offsetOrder=0,gt.prototype._depth=0,gt.prototype._disposed=!1,gt.prototype._subSegDef=null,gt.prototype._subSegment=!1,gt.prototype._subSegMap=null,gt.prototype._subSegNames=null,gt.prototype._subSegName="",gt.prototype._subSegVal,gt.prototype.dispose=function(){if(this._disposed)return;this._disposed=!0,this.removeAllEventListeners();let t=this._subSegNames;if(t){let e=t.length,n=this._subSegMap;for(let i=0;i<e;++i)n[t[i]].dispose();this._subSegMap=this._subSegNames=null}this._collapsed&&this.markCollapsingStateDirty(),this._childDataIds=null,this._childIds.length=0,this._shared=null,this._subSegDef=this._subSegVal=null},gt.prototype.getId=function(){return this._rid},gt.prototype.getParentId=function(){return this._shared.childToSegment[this._rid]||""},gt.prototype.getParent=function(){let t=this.getParentId();return t&&this._shared.segments[t]||null},gt.prototype.getSubSegmentIds=function(t){let e=this._subSegNames;if(e){t||(t=[]);let n=e.length,i=this._subSegMap;for(let o=0;o<n;++o){let n=i[e[o]];t.push(n.getId()),n.getSubSegmentIds(t)}return t}return null},gt.prototype.addChild=function(t,e){if(!t)return!1;let n=this._shared.childToSegment[t];if(n){if(n!==this._rid){let e=this._shared.segments[n];e&&!e.hasSubSegments()&&e.removeChild(t),this._shared.childToSegment[t]=this._rid}}else this._shared.childToSegment[t]=this._rid;return null!=e&&(e&&e!==t?(this._childDataIds||(this._childDataIds={}),this._childDataIds[t]=e):this._childDataIds&&delete this._childDataIds[t]),this._childIds.indexOf(t)<0&&(this._collapsed&&(this._shared.dirtyCollapsingState=!0),this._childIds.push(t),!0)},gt.prototype.addChildren=function(t,e){if(!t)return!1;let n=Array.isArray(t)?t:[t],i=n.length;if(!i)return!1;let o,r=0;if(null!=e)for(e=Array.isArray(e)?e:[e],o=0;o<i;++o)r|=this.addChild(n[o],e[o]);else for(o=0;o<i;++o)r|=this.addChild(n[o]);return!!r},gt.prototype.containsChild=function(t){return this._childIds.indexOf(t)>=0},gt.prototype.getChildIndex=function(t){return this._childIds.indexOf(t)},gt.prototype.removeChild=function(t){if(this._subSegment)return!1;if(!this._childIds.length)return!1;let e=this._childIds.indexOf(t);return!(e<0||(this._shared.childToSegment[t]===this._rid&&delete this._shared.childToSegment[t],this._childIds.splice(e,1),this._collapsed&&(this._shared.dirtyCollapsingState=!0),0))},gt.prototype.removeChildren=function(t){if(this._subSegment)return!1;if(!this._childIds.length)return!1;let e=Array.isArray(t)?t:[t],n=e.length,i=0;for(let t=0;t<n;++t)i|=this.removeChild(e[t]);return!!i},gt.prototype.removeAllChildren=function(){if(this._subSegment)return!1;let t=this._childIds.length;if(!this._childIds.length)return!1;let e=this._rid,n=this._shared.childToSegment,i=this._childIds;for(let o=0;o<t;++o){let t=i[o];n[t]===e&&delete n[t]}return this._childIds.length=0,this._childDataIds=null,this._collapsed&&(this._shared.dirtyCollapsingState=!0),!0},gt.prototype.getChildIds=function(){return this._childIds},gt.prototype.getChildren=function(){let t={},e=this._childIds,n=e.length,i=this._childDataIds||{};for(let o=0;o<n;++o){let n=e[o];t[n]=i[n]||n}return t},gt.prototype.getChildCount=function(){return this._childIds.length},gt.prototype.markCollapsingStateDirty=function(){(this._childIds.length||this._subSegDef)&&(this._shared.dirtyCollapsingState=!0)},gt.prototype.getClassification=function(){return this._subSegDef&&this._subSegDef.classifiers||null},gt.prototype.setClassification=function(t){if(this._subSegment)return!1;let e=null;this._subSegDef&&(e=this._subSegDef.classifiers);let n,i=null;t&&("string"==typeof t?i=[t]:Array.isArray(t)&&(i=t));let o=i?i.length:0;if(o){if((e?e.length:0)===o){for(n=0;n<o&&i[n]===e[n];++n);if(n>=o)return!1}return this._subSegDef||(this._subSegDef={root:this,subSegments:null}),this._subSegDef.classifiers=i,!0}return!!e&&(this._subSegDef.classifiers=null,this._subSegDef=null,!0)},gt.prototype.classify=function(t){let e=this._subSegDef?this._subSegDef.classifiers:null,n=e?e.length:0,i=this._subSegNames,o=i?i.length:0;if(!o&&this._depth>=n)return!1;let r,s=this._shared;this._collapsed&&(s.dirtyCollapsingState=!0);let l="",a={},u=0,h=this._subSegMap,p=null;if(o)for(u=o,r=0;r<u;++r)l=i[r],a[l]=1,p=h[l],p._childIds.length&&(p._childIds.length=0),p._collapsed&&(s.dirtyCollapsingState=!0);let d,c=!this._subSegment,_=this._childDataIds||{},f=this._childIds,g=f.length;if(this._depth<n&&t){h||(h=this._subSegMap={},i=this._subSegNames=[]);let n=e[this._depth];for(r=0;r<g;++r){d=f[r];let e=_[d]||d,o=t[e],c=o?o[n]:null;if(s.childToSegment[d]=this._rid,l=yt,(c||0===c||!1===c)&&(l=c+""),a[l]&&(a[l]=0,--u),p=h[l],!p){let t=this._rid+"/"+l;p=new gt(t,s),p._subSegDef=this._subSegDef,p._subSegment=!0,p._depth=this._depth+1,p._subSegName=l,p._subSegVal=c,s.childToSegment[t]=this._rid,h[l]=p,i.push(l),this._dispatch("subSegmentAdded",{rid:t,segment:p})}p.addChild(d,e)}}else if(c)for(r=0;r<g;++r)d=f[r],s.childToSegment[d]=this._rid;if(u>0){for(l in u>=i.length&&(i.length=0),a)if(a[l]){p=h[l],delete h[l];let t=i.indexOf(l);t>=0&&i.splice(t,1),this._dispatch("subSegmentRemoved",{rid:p.getId(),segment:p})}i.length||(i=this._subSegMap=this._subSegNames=null)}if(o=i?i.length:0,o)for(i.sort(gt._subSegSortLogic),r=0;r<o;++r)p=h[i[r]],p.classify(t);return!0},gt.prototype.hasSubSegments=function(){return!!this._subSegNames&&!!this._subSegNames.length},gt.prototype.isSubSegment=function(){return this._subSegment},gt.prototype.isRootSegment=function(){return!this._shared.childToSegment[this._rid]},gt.prototype.getFirstAncestor=function(){let t=null;if(this._subSegment&&this._subSegDef)t=this._subSegDef.root;else if(t=this.getParent(),t){let e=t.getParent();for(;e;)t=e,e=t.getParent()}return t||null},gt.prototype.getAllSubSegments=function(t){let e=this._subSegNames;if(e){t||(t=[]);let n=this._subSegMap,i=e.length;for(let o=0;o<i;++o){let i=n[e[o]];t.push(i),i.getAllSubSegments(t)}}return t||null},gt.prototype.updateTreeStructure=function(t,e,n){let i;t||(t=0,this._subSegment||(this._depth=0)),e||(e=0),n||(n={});let o=this._subSegNames,r=o?o.length:0;if(r){let s=this._subSegMap;for(i=0;i<r;++i){let r=s[o[i]];++t,n[r.getId()]=e+t,r.setOrder(t),t=r.updateTreeStructure(t,e,n)}}else{let o=this._childIds,r=o.length,s=this._shared.segments,l="";for(i=0;i<r;++i){let r=o[i],a=s[r],u=a?a.getId():yt;l!==u&&(++t,l=u),n[r]=e+t,a&&(a._depth=this._depth+1,a.setOrder(t),t=a.updateTreeStructure(t,e,n))}}return this.setLastOrder(t)},gt.prototype.calcSubSegmentOrder=gt.prototype.updateTreeStructure,gt.prototype.getSegmentLevel=function(){return this._depth},gt.prototype.setRowData=function(t,e){if(!t)return;let n=t[this._rid];n||(n=t[this._rid]={}),e||(e=t),n=e[this._rid],n||(n=e[this._rid]={});let i=this;for(;i&&i.isSubSegment();)i.getSubSegmentName(n),i=i.getParent()},gt.prototype.getSubSegmentName=function(t){if(t&&this._subSegment){let e=this.getClassification()[this._depth-1];e&&(t[e]=this._subSegName)}return this._subSegName},gt.prototype.sortSegments=function(t){if(!t||this.hasSubSegments())return!1;let e=this._childIds,n=e.length,i=this._shared.segments;for(let o=0;o<n;++o)if(i[e[o]])return this._childIds.sort(t),!0;return!1},gt.prototype.getFlattenTreeIds=function(t){let e;t||(t=[]),this._subSegment||t.push(this._rid);let n=this._subSegNames;if(n){let i=n.length,o=this._subSegMap;for(e=0;e<i;++e)o[n[e]].getFlattenTreeIds(t)}else{let n=this._childIds,i=n.length,o=this._shared.segments;for(e=0;e<i;++e){let i=n[e],r=o[i];r?r.getFlattenTreeIds(t):t.push(i)}}return t},gt.prototype.collapse=function(t){return t=!1!==t,this._collapsed!==t&&(this._collapsed=t,this.markCollapsingStateDirty(),!0)},gt.prototype.expand=function(t){return this.collapse(!1===t)},gt.prototype.isCollapsed=function(){return this._collapsed},gt.prototype.getCollapsingStates=function(t,e){let n=this._subSegNames,i=this._subSegMap,o=!0;!n&&this._shared&&(n=this._childIds,i=this._shared.segments,o=!1);let r=n?n.length:0;if(!r)return!1;let s=!1,l=!(!e&&!this._collapsed);t||(t={});for(let e=0;e<r;++e){let r="",a=null;o?(a=i[n[e]],r=a.getId()):(r=n[e],a=i[r]),l&&(t[r]=l,s=!0),a&&a.getCollapsingStates(t,l)&&(s=!0)}return s},gt.prototype.getOrder=function(){let t=this.getFirstAncestor();return t?t._order+this._order:this._order},gt.prototype.getLastOrder=function(){let t=this.getFirstAncestor();return t?t.getLastOrder():this._order+this._offsetOrder},gt.prototype.setOrder=function(t){this._order=t},gt.prototype.setLastOrder=function(t){return this._offsetOrder=t},gt._tabs=null,gt.prototype.log=function(t,e){let n;t||(t=[]);let i=gt._tabs;if(!i){i=gt._tabs=[];let t="";for(n=0;n<11;++n)i[n]=t,t+=" "}e||(e=0);let o=this._collapsed?"+ ":"- ";t.push(i[e]+o+this._rid);let r=e+1,s=i[r],l=this._subSegNames,a=this._subSegMap,u=!0;!l&&this._shared&&(l=this._childIds,a=this._shared.segments,u=!1);let h=l?l.length:0;for(n=0;n<h;++n){let e="",i=null;u?(i=a[l[n]],e=i.getId()):(e=l[n],i=a[e]),i?i.log(t,r):t.push(s+"- "+e)}return t};let mt=function(){this._onSubSegmentAdded=this._onSubSegmentAdded.bind(this),this._onSubSegmentRemoved=this._onSubSegmentRemoved.bind(this),this._segments={},this._insertionList=[],this._removalList=[],this._shared={segments:this._segments,childToSegment:{},dirtyCollapsingState:!1,defaultCollapsing:!1}};o.inherits(mt,s),mt.prototype._segments,mt.prototype._segmentCount=0,mt.prototype._collapsedRids=null,mt.prototype._shared,mt.prototype._segmentList=null,mt.prototype._insertionList=null,mt.prototype._removalList=null,mt.prototype._classification=!1,mt.prototype._classifierChanged=!1,mt.prototype._rowOrders=null,mt.prototype.dispose=function(){this.removeAllSegments(),this.removeAllEventListeners(),this._collapsedRids=null,this._segmentList=this._rowOrders=this._insertionList=this._removalList=null},mt.prototype.addSegment=function(t,e){if(t&&!this._segments[t]){let n=this._segments[t]=new gt(t,this._shared);return n.addEventListener("subSegmentAdded",this._onSubSegmentAdded),n.addEventListener("subSegmentRemoved",this._onSubSegmentRemoved),++this._segmentCount,this.invalidateSegmentOrder(),e&&e.length&&n.addChildren(e),!0}return!1},mt.prototype.addSegments=function(t){let e=Array.isArray(t)?t:[t],n=e.length,i=0;for(let t=0;t<n;++t)i|=this.addSegment(e[t]);return!!i},mt.prototype.containsSegment=function(t){return!!this._segments[t]},mt.prototype.getParentRowId=function(t){return this._shared.childToSegment[t]||""},mt.prototype.removeSegment=function(t){let e=this._segments[t];if(!e)return!1;if(this._segmentCount<=1)return this.removeAllSegments();let n=e.isSubSegment();n&&this._removalList.push(e.getId());let i=e.getSubSegmentIds();if(i){let t=i.length;for(let e=0;e<t;++e){let t=i[e];this._segments[t]&&(this._removalList.push(t),delete this._segments[t],--this._segmentCount)}}if(!n){let t=e.getParent();t&&t.addChildren(e.getChildIds())}return e.removeAllChildren(),e.dispose(),delete this._segments[t],--this._segmentCount,this.invalidateSegmentOrder(),!0},mt.prototype.removeAllSegments=function(){if(this._segmentCount){for(let t in this._segments)this._segments[t].dispose();return this._segments={},this._segmentCount=0,this._segmentList=this._rowOrders=null,this._shared.segments=this._segments,this._shared.childToSegment={},this._classification=this._classifierChanged=!1,!0}return!1},mt.prototype.getSegmentCount=function(){return this._segmentCount},mt.prototype.getSegment=function(t){return this._segments[t]||null},mt.prototype.getSegmentParent=function(t){let e=this.getParentRowId(t);return e?this.getSegment(e):null},mt.prototype.getSegments=function(){return this._segmentCount?this._segments:null},mt.prototype.getSegmentIds=function(){return Object.keys(this._segments)},mt.prototype.sortSegments=function(t){let e=[],n=this._segments;for(let i in n){let o=n[i];o.sortSegments(t),o.isRootSegment()&&e.push(o)}return e.sort(t),this.invalidateSegmentOrder(),e},mt.prototype.collapseSegments=function(t,e){let n=0;if(this._segmentCount){let i=t.length;for(let o=0;o<i;o++){let i=this._segments[t[o]];i&&(n|=i.collapse(e))}}return!!n},mt.prototype.collapseSegment=function(t,e){let n=this._segments[t];return!!n&&n.collapse(e)},mt.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},mt.prototype.expandAllSegments=function(){if(this._segmentCount){let t=this._segments,e=0;for(let n in t)e|=t[n].expand();if(e)return!0}return!1},mt.prototype.isCollapsedSegment=function(t){let e=this._segments[t];return!!e&&e.isCollapsed()},mt.prototype.getCollapsedRows=function(){if(this._shared.dirtyCollapsingState){this._shared.dirtyCollapsingState=!1;let t=null,e=0;if(this._segmentCount){let n=this._segments;t={};for(let i in n){let o=n[i];o.isRootSegment()&&o.getCollapsingStates(t)&&++e}}this._collapsedRids=e?t:null}return this._collapsedRids},mt.prototype.invalidateSegmentOrder=function(){return!!this._segmentList&&(this._segmentList=this._rowOrders=null,!0)},mt.prototype.addSegmentChild=function(t,e,n){let i=this._segments[t];return!(!i||i.isSubSegment())&&(this.invalidateSegmentOrder(),i.addChild(e,n))},mt.prototype.addSegmentChildren=function(t,e,n){let i=this._segments[t];return!(!i||i.isSubSegment())&&(this.invalidateSegmentOrder(),i.addChildren(e,n))},mt.prototype.containsSegmentChild=function(t,e){let n=this._segments[t];return!!n&&n.containsChild(e)},mt.prototype.removeSegmentChild=function(t,e){let n=this._segments[t];return!!n&&(this.invalidateSegmentOrder(),n.removeChild(e))},mt.prototype.removeSegmentChildren=function(t,e){let n=this._segments[t];return!!n&&(this.invalidateSegmentOrder(),n.removeChildren(e))},mt.prototype.removeAllSegmentChildren=function(){this._shared.childToSegment={};let t=this._segments,e=!1;for(let n in t)t[n].removeAllChildren()&&(e=!0);return e&&(this.invalidateSegmentOrder(),this.classify(null)),e},mt.prototype.fillSegment=function(t,e){let n=Array.isArray(e)?e.length:0;if(!n)return;let i=this._segments,o=i[t];if(o&&!o.isSubSegment()){let r=e.indexOf(t);if(r>=0){o.removeAllChildren();for(let t=r+1;t<n;++t){let n=e[t];if(i[n])break;o.addChild(n)}this.invalidateSegmentOrder()}}},mt.prototype.fillSegments=function(t){this._shared.childToSegment={};let e=Array.isArray(t)?t.length:0,n=this._segments,i=null,o=!1;for(let r=0;r<e;++r){let e=t[r],s=n[e];s&&!s.isSubSegment()?(i=s,i.removeAllChildren()):i&&!i.isSubSegment()&&(i.addChild(e),o=!0)}return o&&this.invalidateSegmentOrder(),o},mt.prototype.calcSegmentOrder=function(t,e){let n=this._segmentList;if(n){if(e)return;n.length=0}else n=this._segmentList=[];this._rowOrders={};let i=this._rowOrders,o=this._segments,r=this._shared.childToSegment,s=yt,l=t?t.length:0,a=0;for(let e=0;e<l;++e){let n=t[e];if(!r[n]){let t=o[n],e=t?t.getId():yt;s!==e&&(++a,s=e);let r=1e4*a;i[n]=r,t&&(this._segmentList.push(t),t.setOrder(r),t.updateTreeStructure(0,r,i))}}},mt.prototype.getSegmentValues=function(t,e){let n=t?t.length:0;if(!n)return null;let i=this._rowOrders;if(!i)return null;let o=new Array(n),r=0;for(let e=0;e<n;++e){let n=i[t[e]];null!=n?r<n&&(r=n):n=r?r+1e4:0,o[e]=n}return r?o:null},mt.prototype.logStructure=function(){let t=this._segmentList;if(!t)return"";let e=t.length,n=[];for(let i=0;i<e;++i){let e=t[i];e.isRootSegment()&&e.log(n)}return n.join("\n")},mt.prototype.logRowIdMap=function(){let t=[],e=this._segments,n=this._shared.childToSegment;for(let i in n){let o=n[i],r=e[o];r&&r.isSubSegment()||t.push(i+" > "+o)}return t.join("\n")},mt.prototype.setSegmentClassification=function(t,e){let n=this._segments[t];return!(!n||!n.setClassification(e)||(n.getClassification()&&(this._classification=!0),this._classifierChanged=!0,0))},mt.prototype.hasClassification=function(){return this._classification||this._classifierChanged},mt.prototype.classify=function(t){if(!this._segmentCount)return!1;if(!this.hasClassification())return!1;this._classification=this._classifierChanged=!1;let e=this._segments;for(let n in e){let e=this._segments[n];e.isSubSegment()||(e.getClassification()&&(this._classification=!0),e.classify(t))}return this._insertionList.length||this._removalList.length?(this.invalidateSegmentOrder(),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)},mt.prototype._onSubSegmentAdded=function(t){let e=t.rid;if(this._segments[e])console.log("Incorrect logic detected.");else{let n=t.segment;this._insertionList.push(n),this._segments[e]=n,this._segmentCount++,n.addEventListener("subSegmentAdded",this._onSubSegmentAdded),n.addEventListener("subSegmentRemoved",this._onSubSegmentRemoved)}},mt.prototype._onSubSegmentRemoved=function(t){let e=t.rid;this.removeSegment(e)},mt.prototype.setDefaultCollapsing=function(t){let e=!!t;return this._shared.defaultCollapsing!==e&&(this._shared.defaultCollapsing=e,!0)};const Ct=mt;let St=function(){St.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")};o.inherits(St,ft),St.prototype._prevData=null,St.prototype._rids,St.prototype._frozen=!1,St.prototype._runningId=0,St.prototype._compMap=null,St.prototype._segments=null,St.prototype._autoSegmentFilling=!1,St.prototype._removedRows=null,St.prototype._userSegmentComparer=null,St.prototype._segmentSortOrder=0,St.prototype._segmentSortContext=null,St.prototype._clsSource=null,St.prototype._classifyingTimer=0,St.prototype._segmentDefaultCollapsing=!1,St.SortLogic,St.prototype.dispose=function(){this.unlistenAll(),this.clearAllData(!0),this._classifyingTimer&&(clearTimeout(this._classifyingTimer),this._classifyingTimer=0),this._compMap=null,this._clsSource=null,St._removeIndexArray(),this._segments&&(this._segments.dispose(),this._segments=null)},St.prototype.getColumnData=function(t){let e=new Array(this._rids.length);for(let n=this._rids.length;--n>=0;)e[n]=this._rows[this._rids[n]][t];return e},St.prototype.getRowId=function(t){return this._rids[t]||""},St.prototype.getAllRowIds=function(t){return t?this._rids:this._rids.slice(0)},St.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},St.prototype.getRowCount=function(){return this._rids.length},St.prototype.getDataAt=function(t,e){return this.getData(this._rids[t],e)},St.prototype.getRowDataAt=function(t){return this.getRowData(this._rids[t])},St.prototype.getPreviousData=function(t,e){let n=this._prevData[t]||null;return n?n[e]:null},St.prototype.setData=function(t,e,n){if(!this._needFiring())return this._setData(t,e,n);let i={};return i[e]=n,this.setRowData(t,i)},St.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{let e=this._segments.getParentRowId(t);e&&this._segments.removeSegmentChild(e,t)}return!1},St.prototype.setRowData=function(t,e,n){if(!t)return!1;let i=this.getRowData(t),o=!1,r="updated",s=!1;if(e){if(i){let n=this._prevData[t];for(let t in e)n[t]=i[t],i[t]=e[t]}else if(r="inserted",i=e,this._rows[t]=i,this._prevData[t]={},n){let e=n.nextRid,i=e?this.getRowIndex(e):-1;i<0&&(i=n.fallback),null==i||i<0||i>=this._rids.length?this._rids.push(t):(this._rids.splice(i,0,t),this._segments&&this._segments.invalidateSegmentOrder(),s=!this._isLastSegment(i))}else this._rids.push(t);o=!0}else i&&(r="removed",this._prevData[t]=this._rows[t],delete this._rows[t],s=this._removeRidFromSegments(t),St._removeArrayItem(this._rids,t),o=!0);if(o&&this._needFiring()){if(this._autoFillSegments())this.dispatchGlobalChange();else{let o=n||{};o.rid=t,o.changes=e,o.rowData=i,o.type=r,s&&(o.segmentChanged=!0),this._dispatchDataChange(o)}this.requestClassifying()}return o},St.prototype.setColumnData=function(t,e,n){let i=e?e.length:0;if(i<0)return;let o=this._frozen;this.freeze();let r=this._generateRids(i,n);for(let n=0;n<i;++n)this._setData(r[n],t,e[n]);this.freeze(o)},St.prototype.setDataFromObjectMap=function(t){if(!t)return;if(Array.isArray(t))return void this.addRows(t);let e=this._frozen;this.freeze();for(let e in t)this.setRowData(e,t[e]);this.freeze(e)},St.prototype.setDataFrom2DArray=function(t,e,n){let i=t?t.length:0;if(i<0)return;let o=this._frozen;this.freeze();let r=0,s=this._generateRids(i,n);for(let n=0;n<i;++n){let i=t[n],o=s[n];if(e)for(r=i.length;--r>=0;)this._setData(o,e[r],i[r]);else for(r=i.length;--r>=0;)this._setData(o,""+r,i[r])}this.freeze(o)},St.prototype.setDataAt=function(t,e,n){let i=this.getRowId(t);return!!i&&this.setData(i,e,n)},St.prototype.setRowDataAt=function(t,e,n){let i=this.getRowId(t);return!!i&&this.setRowData(i,e,n)},St.prototype.addRow=function(t,e){return t||(t={}),e=this._generateUniqueRid(t,e),this.setRowData(e,t),e},St.prototype.addRows=function(t,e){if(!Array.isArray(t))return;let n=t.length;if(!n)return;if(1===n)return void this.addRow(t[0],e?e[0]:null);e||(e=[]);let i=this._frozen;this.freeze();for(let i=0;i<n;++i)this.addRow(t[i],e[i]);this.freeze(i)},St.prototype.unshiftRow=function(t,e){return this.insertRow(0,t,e)},St.prototype.insertRow=function(t,e,n){let i=null;return"number"==typeof t?(i={},i.nextRid=this._rids[t],i.fallback=t):t&&(i={},i.nextRid=t),e||(e={}),n=this._generateUniqueRid(e,n),this.setRowData(n,e,i),n},St.prototype.insertAfter=function(t,e,n){let i="string"==typeof t?this.getRowIndex(t):t;return!(i>=0)||i>=this._rids.length-1?this.addRow(e,n):this.insertRow(i+1,e,n)},St.prototype.removeRow=function(t){"number"==typeof t?this.setRowData(this.getRowId(t),null):this.setRowData(t,null)},St.prototype.removeRows=function(t){let e,n;if(1===t.length)return e=t[0],void("number"==typeof e?this.removeRow(e):this.setRowData(e,null));let i=!1;for(this._removedRows={},n=t.length;--n>=0;)e=t[n],"number"==typeof e&&(e=this.getRowId(e)),this.getRowData(e)&&(this._prevData[e]=this._rows[e],this._removedRows[e]=1,delete this._rows[e],this._removeRidFromSegments(e),i=!0);i?(this._rids=this._rids.filter(this._removeRows),this._removedRows=null,this.dispatchGlobalChange()):this._removedRows=null},St.prototype._removeRows=function(t){return!this._removedRows[t]},St._removeArrayItem=function(t,e){let n=t.indexOf(e);return n>=0&&(n>=t.length?t.pop():t.splice(n,1),!0)},St.prototype.clearAllData=function(t){St.base(this,"clearAllData",!0),this._prevData={},this._segments&&(this._segments.dispose(),this._segments=null),this._rids.length&&(this._rids.length=0,this.dispatchGlobalChange(t))},St.prototype.removeAllRows=St.prototype.clearAllData,St._ascendingOrder=function(t,e){return t-e},St.prototype.moveRow=function(t,e,n){let i=null,o="";if(e>=0&&e<this._rids.length||(e=this._rids.length),Array.isArray(t)){let n=t;n.sort(St._ascendingOrder);let r=[];for(let t=n.length;--t>=0;){let i=n[t];o=this._rids[i],o&&(r.unshift(o),this._rids.splice(i,1),i<e&&--e)}r.length&&(this._rids.splice.apply(this._rids,[e,0].concat(r)),i=r)}else t<0&&(t=0),t!==e&&t+1!==e&&(o=this._rids.splice(t,1)[0],o&&(t<e&&--e,this._rids.splice(e,0,o),i=o));return i&&(this._segments&&(this._segments.invalidateSegmentOrder(),this._sort(null)),this._dispatchPositionChange(n)),i},St.prototype._moveRow=function(t,e,n){let i=t.length;if(!i)return null;let o=new Array(i);for(let e=0;e<i;++e)o[e]=this.getRowIndex(t[e]);let r=e?this.getRowIndex(e):this._rids.length;return i>1?this.moveRow(o,r,n):this.moveRow(o[0],r,n)},St.prototype.moveRows=function(t,e,n,i){"string"==typeof t&&(t=this.getRowIndex(t)),"string"==typeof e&&(e=this.getRowIndex(e)),t<0&&(t=0),e<0&&(e=this._rids.length),n||(n=1);let o=t+n-1,r=e;if(e>=t&&(r=e<=o?t:e-n),n>0&&o<=this._rids.length){r>this._rids.length&&(r=this._rids.length);let e=this._rids.splice(t,n),o=[r,0].concat(e);return Array.prototype.splice.apply(this._rids,o),this._segments&&this._sort(null),this._dispatchPositionChange(i),e}return null},St.prototype.swapRow=function(t,e){let n=this._rids.length;if(t<0||t>=n)return;if(e<0||e>=n)return;let i=this._rids[t];this._rids[t]=this._rids[e],this._rids[e]=i},St.prototype._replaceRowId=function(t,e){let n=this._rids,i=n.indexOf(t);return i>=0&&(n[i]=e,this._rows[e]=this._rows[t],delete this._rows[t],this._prevData[e]=this._prevData[t],delete this._prevData[t],!0)},St.prototype.replaceRowIds=function(t){if("object"==typeof t){let e=!1;for(let n in t)e|=this._replaceRowId(n,t[n]);e&&this.dispatchGlobalChange()}},St.prototype.clearRowData=St.prototype.removeRow,St.prototype.clearColumnData=function(t,e){let n="string"==typeof t?[t]:t;for(let t=n.length;--t>=0;){let e=n[t];if(e)for(let t in this._rows)delete this._rows[t][e],delete this._prevData[t][e]}this.dispatchGlobalChange(e)},St.prototype.getDataSource=function(){return null},St.prototype.setDataSource=function(t){},St.prototype.getSortingLogics=function(){return this._compMap},St.prototype.sortOnce=function(t,e,n,i){let o=St._buildSortContext([],t,e,n||this._compMap,i);return!!this._sort(o)&&(this._dispatchPositionChange(),!0)},St.prototype.setSortingLogic=function(t){this._compMap._default=t},St.prototype.setColumnSortingLogic=function(t,e){t&&(this._compMap[t]=e)},St.prototype.getColumnSortingLogic=function(t){if(t){let e=this._compMap[t];if(e)return e}return this._compMap._default||null},St.prototype.freeze=function(t){t=!1!==t;let e=this._frozen;return e!==t&&(this._frozen=t,!t&&this._segments&&this._segments.invalidateSegmentOrder(),this._autoFillSegments(),this.dispatchGlobalChange()),e},St.prototype.unfreeze=function(t){return this.freeze(!1===t)},St.prototype.isFrozen=function(){return this._frozen},St.prototype._initSegmentCollection=function(){this._segments||(this._segments=new Ct,this._segments.setDefaultCollapsing(this._segmentDefaultCollapsing),this._segments.addEventListener("subSegmentChanged",this._onSubSegmentChanged))},St.prototype.setSegmentSeparators=function(t,e){if(!t)return!1;let n=!1!==e,i=0,o=0,r=t.length;for(let e=0;e<r;e++){let r=t[e];if(n){if(this._initSegmentCollection(),this._autoSegmentFilling){let t=this._segments.getParentRowId(r);t&&this._segments.removeSegmentChild(t,r)}i|=this._segments.addSegment(r)}else this._segments&&this._segments.getSegment(r)&&this._segments.removeSegment(r)&&(o=1,this._segments.getSegmentCount()||(this._segments=null))}let s=i||o;return s&&this._needFiring()&&this.dispatchGlobalChange(),!!s},St.prototype.setSegmentSeparator=function(t,e){let n=!1,i=0;if(t&&"string"==typeof t)if(!1!==e){if(this._initSegmentCollection(),this._autoSegmentFilling){let e=this._segments.getParentRowId(t);e&&this._segments.removeSegmentChild(e,t)}let i=e&&e.children?e.children:null;this._segments.addSegment(t,i)&&(n=!0)}else if(this._segments){let e=this._segments.getSegment(t);e&&(i=e.getChildCount(),this._segments.removeSegment(t)&&(n=!0,this._segments.getSegmentCount()||(this._segments=null)))}if(n&&this._needFiring())if(this._autoFillSegments()||i)this.dispatchGlobalChange();else{let e=this._rows[t]||null;e&&this._dispatchDataChange({rid:t,changes:{},rowData:e,type:"updated",segmentChanged:!0})}return n},St.prototype.unsetAllSegmentSeparators=function(){return!!this._segments&&(this._segments.dispose(),this._segments=null,this.dispatchGlobalChange(),!0)},St.prototype.hasSegmentation=function(){return!!this._segments},St.prototype.hasSegmentClassification=function(){return!!this._segments&&this._segments.hasClassification()},St.prototype.isSegmentSeparator=function(t){return!!this._segments&&this._segments.containsSegment(t)},St.prototype.getSegment=function(t){return this._segments?this._segments.getSegment(t):null},St.prototype.getSegmentParent=function(t){return this._segments?this._segments.getSegmentParent(t):null},St.prototype.getSegmentLevel=function(t){let e=this.getSegment(t);return e?e.getSegmentLevel()+1:0},St.prototype.getSegmentParentRowId=function(t){return this._segments?this._segments.getParentRowId(t):""},St.prototype.getSegmentValues=function(t,e){return this._segments?(this._segments.calcSegmentOrder(this._rids,!0),this._segments.getSegmentValues(t||this._rids,e)):null},St.prototype._isLastSegment=function(t){let e=this._segments;if(e){let n=this._rids,i=n.length;for(let o=t+1;o<i;++o)if(e.containsSegment(n[o]))return!1}return!0},St.prototype._getSegmentSeparators=function(){return this._segments},St.prototype.enableAutoSegmentFilling=function(t){this._autoSegmentFilling=0!=t,this._autoFillSegments()},St.prototype._autoFillSegments=function(){return!!this._autoSegmentFilling&&this.fillSegments()},St.prototype.fillSegment=function(t){this._segments&&(this._segments.fillSegment(t,this._rids),this.dispatchGlobalChange(),this.requestClassifying())},St.prototype.fillSegments=function(){if(this._segments){let t=this._segments.fillSegments(this._rids);return t&&(this.dispatchGlobalChange(),this.requestClassifying()),t}return!1},St.prototype._onSegmentChildChanged=function(t){!1!==t&&this._sort(null),this._dispatchPositionChange(),this.requestClassifying()},St.prototype.addSegmentChild=function(t,e,n){return!(!this._segments||!this._segments.addSegmentChild(t,e,n))&&(this._onSegmentChildChanged(),!0)},St.prototype.addSegmentChildren=function(t,e,n){return!(!this._segments||!this._segments.addSegmentChildren(t,e,n))&&(this._onSegmentChildChanged(),!0)},St.prototype.setSegmentChildren=function(t){if(!this._segments)return!1;let e=this._segments.removeAllSegmentChildren(),n=t.length;for(let i=0;i<n;i++){let n=t[i];this._segments.addSegmentChildren(n.segmentId,n.rowIds)&&(e=!0)}return!!e&&(this._onSegmentChildChanged(),!0)},St.prototype.removeSegmentChild=function(t,e){if(this._segments){let n=this._segments.removeSegmentChild(t,e);return n&&this._onSegmentChildChanged(!1),n}return!1},St.prototype.removeSegmentChildren=function(t,e){if(this._segments){let n=this._segments.removeSegmentChildren(t,e);return n&&this._onSegmentChildChanged(!1),n}return!1},St.prototype.removeAllSegmentChildren=function(){if(this._segments){let t=this._segments.removeAllSegmentChildren();return t&&this._onSegmentChildChanged(!1),t}return!1},St.prototype.getSegmentIds=function(){return this._segments?this._segments.getSegmentIds():null},St.prototype.getSegmentChildIds=function(t){if(this._segments){let e=this._segments.getSegment(t);if(e){let t=e.getChildIds();return t.length?t:null}}return null},St.prototype._setSegmentSortContext=function(t,e){this._segmentSortOrder=t,this._segmentSortContext=e},St.prototype.sortSeparators=function(t,e,n){if(!this._segments)return!1;if("function"==typeof t)return this._setSegmentSortContext(St._getSortOrder(e),n),this.sortSegments(t);if(!n)return!1;let i=St._buildSortContext([],n,e,t||this._compMap),o=i.length,r=null;if(o>1)r=St._multiColumnSeparatorCompareLogic,this._setSegmentSortContext(1,i);else{if(1!==o)return!1;r=St._singleColumnSeparatorCompareLogic,this._setSegmentSortContext(i[0][3],i[0])}return this.sortSegments(r)},St.prototype.sortSegments=function(t){if(!this._segments)return!1;if("function"!=typeof t)return!1;this._userSegmentComparer=t;let e=this._segments,n=e.sortSegments(this._bySegmentSeparator);this._userSegmentComparer=null,this._setSegmentSortContext(0,null);let i=this._rids,o=i.slice(),r=i.length;i.length=0;let s=0,l=!1;for(let t=0;t<r;++t){let r=o[t],a=e.getSegment(r);a?a.isRootSegment()&&n[s++].getFlattenTreeIds(i):e.getParentRowId(r)||i.push(r),r!==i[t]&&(l=!0)}return l&&(this._sort(null),this._dispatchPositionChange()),l},St.prototype._bySegmentSeparator=function(t,e){return this._userSegmentComparer(this._getRowDataFromSegment(t),this._getRowDataFromSegment(e),this._segmentSortOrder,this._segmentSortContext)},St.prototype._getRowDataFromSegment=function(t){var e=null;return t&&("string"==typeof t?e=this.getRowData(t):t.getId&&(e=this.getRowData(t.getId()))),e},St.prototype.setClassificationSource=function(t){this._clsSource=null,t&&t._rows&&(this._clsSource=t._rows)},St.prototype.setSegmentClassification=function(t,e){return!(!this._segments||!this._segments.setSegmentClassification(t,e))&&this.classifySegments()},St.prototype.classifySegments=function(){return!(!this._segments||!this._rids.length)&&this._segments.classify(this._clsSource||this._rows)},St.prototype.requestClassifying=function(){this._segments&&!this._classifyingTimer&&this._segments.hasClassification()&&(this._classifyingTimer=setTimeout(this._onClassifyingTimer,10))},St.prototype._onClassifyingTimer=function(){this._classifyingTimer=0,this.classifySegments()},St.prototype._onSubSegmentChanged=function(t){let e,n=t.insertionList,i=t.removalList,o=!1,r=this._rows,s=this._clsSource||r,l=this._rids,a=this._prevData,u=i.length,h={};for(e=0;e<u;e++){let t=i[e];r[t]&&(h[t]=a[t]=r[t],delete r[t],St._removeArrayItem(l,t),o=!0)}let p=n.length;for(e=0;e<p;e++){let t=n[e],i=t.getParentId(),u=t.getId();if(!r[u]){a[u]={},t.setRowData(r,s);let e=l.indexOf(i);e<0||e+1>=l.length?l.push(u):l.splice(e+1,0,u),o=!0}}o&&(t.removedRows=h,this._dispatch("subSegmentChanged",t),this.dispatchGlobalChange())},St.prototype.setSegmentDefaultCollapsing=function(t){return this._segmentDefaultCollapsing!==t&&(this._segmentDefaultCollapsing=t,this._segments&&this._segments.setDefaultCollapsing(t),!0)},St.prototype._sort=function(t){let e=this._rids,n=this.getMultipleRowData(e),i=this.getSegmentValues(e),o=St._performMultiLevelSorting(n,t,i);return!!o&&(this._rids=St._reorderItems(e,o),!0)},St.prototype.dispatchGlobalChange=function(t){!t&&this._needFiring()&&this._dispatchDataChange(St._globalChangeArg)},St.prototype._dispatchPositionChange=function(t){!t&&this._needFiring()&&this._dispatch("dataChanged",St._positionChangeArg)},St.prototype.dump=function(t){return ft.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},St.prototype._setData=function(t,e,n){let i=this.getRowData(t);return i||(i={},this._rows[t]=i,this._prevData[t]={},this._rids.push(t)),this._prevData[t][e]=i[e],i[e]=n,!0},St.prototype._generateRids=function(t,e){let n,i=0;if(e)n=e;else{n=[];let e=this._rids.length;for(;i<e&&i<t;)n.push(this._rids[i++])}for(i=n.length;i<t;)n.push(""+i++);return n},St.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},St.prototype._needFiring=function(){return!this._frozen&&!this._composing},St.getSortingDefinitions=ut._deprecatedFunction,St._globalChangeArg={globalChange:!0},St._positionChangeArg={globalChange:!0,positionChangeOnly:!0},St._buildSortContext=function(t,e,n,i,o){let r,s;Array.isArray(e)?(r=e,s=n):(r=[e],s=e?[n]:[0]);let l=null,a=null;"function"==typeof i?l=i:a=i;let u=r.length;t.length=u;for(let e=u;--e>=0;){Array.isArray(a)&&(l=a[e]);let n=t[e];n||(n=t[e]=new Array(5));let i=r[e];n[0]=i,n[1]=null,n[2]=l||a[i]||a._default,n[2]||(n[2]=St._defaultComparer),n[3]=St._getSortOrder(s[e]),n[4]=o}return t},St._multiColumnCompareLogic=function(t,e,n,i){let o=i.length,r=0;for(let n=0;n<o;++n){let o=i[n];if(r=St._singleColumnCompareLogic(t,e,o[3],o),r)return r}return r},St._singleColumnCompareLogic=function(t,e,n,i){let o=i[1];return i[2](o[t],o[e],n,i[4])},St._multiColumnSeparatorCompareLogic=function(t,e,n,i){let o=i.length,r=0;for(let n=0;n<o;++n){let o=i[n];if(r=St._singleColumnSeparatorCompareLogic(t,e,o[3],o),r)return r}return r},St._singleColumnSeparatorCompareLogic=function(t,e,n,i){let o=i[0];return i[2](t[o],e[o],n,i[4])},St._performMultiLevelSorting=function(t,e,n){let i,o=t?t.length:0,r=e?e.length:0;if(!o)return null;for(let n=0;n<r;++n){let r,s=e[n],l=s[1];if(i=s[2],i.rowSorting)if(l)for(l.length=o,r=0;r<o;++r)l[r]=t[r];else l=s[1]=t;else{l?l.length=o:l=s[1]=new Array(o);let e=s[0];for(r=0;r<o;++r)l[r]=t[r][e]}}if(n){let t=["ROW_SEGMENT",n,St._segmentComparer,1,null];e?(e=e.slice()).unshift(t):e=[t],++r}if(!r)return null;let s,l=0;return r>1?(i=St._multiColumnCompareLogic,s=e,l=1):(i=St._singleColumnCompareLogic,s=e[0],l=s[3]),St._mergeSort(o,l,i,s)},St._mergeSort=function(t,e,n,i){let o,r,s,l,a,u=!1,h=1,p=St._createIndexArray(t),d=p.slice();for(;h<=t;){for(o=a=0;o<t;)if(r=a,l=r+h,s=l,a=s+h,a>t&&(a=t),s<a){for(;;)if(n(p[r],p[s],e,i)<=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;let c=p;p=d,d=c,h<<=1}return u?p:null},St._reorderItems=function(t,e){if(e){for(let n=t.length;--n>=0;)e[n]=t[e[n]];return e}return t},St._createIndexArray=function(t){let e=St._idxAryMap[t];if(!e){St._idxAryCount>50&&(St._idxAryMap={},St._idxAryCount=0),e=St._idxAryMap[t]=new Array(t),St._idxAryCount++;for(let n=0;n<t;++n)e[n]=n}return e.slice()},St._removeIndexArray=function(){St._idxAryMap={},St._idxAryCount=0},St._idxAryMap={},St._idxAryCount=0,St._segmentComparer=function(t,e){return t===e?0:t<e?-1:1},St._defaultComparer=function(t,e,n){return null==t||t!=t?null==e||e!=e?0:1:null==e||e!=e?-1:t<e?-n:e<t?n:0},St._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},St._proto=St.prototype;const wt=St,bt="ROW_DEF";let Rt=function(t){let e={};for(let n in t)e[n]=t[n];return e},vt=function(t){if(this._changes={},t&&t.segmentId)return this._rowId=t.segmentId,this._autoGenerated=!0,void(this._subSegment=!0);this._rowId="_"+vt._runningId+++"_",t&&(t.asConstituent?this._initializeAsConstituent(t):this.initialize(t))};vt._runningId=0,vt._childDataField="CHILD_VALUES",vt.ROW_ID_PATTERN=/^_[^_]+_$/,vt.prototype._userInput="",vt.prototype._ric="",vt.prototype._permId="",vt.prototype._label=null,vt.prototype._isChain=null,vt.prototype._asSegment=!1,vt.prototype._realTime=!0,vt.prototype._rowId="",vt.prototype._userId=!1,vt.prototype._dc=null,vt.prototype._subs=null,vt.prototype._view=null,vt.prototype._subId="",vt.prototype._collapsed=null,vt.prototype._autoGenerated=!1,vt.prototype._subSegment=!1,vt.prototype._staticValues=null,vt.prototype._changes,vt.prototype._updateCount=0,vt.prototype._children=null,vt.prototype._parent=null,vt.prototype._groupOrder=0,vt.prototype._depthLevel=0,vt.prototype._userModel=null,vt.prototype._info=null,vt.prototype.dispose=function(){this.isDisposed()||(this._children&&(this._children.forEach(vt.dispose),this._children=null),this._dc&&(this._dc.setRowData(this._rowId,null),this._dc=null),this._staticValues=null,this._parent=null,this._depthLevel=0,this.unsubscribeForUpdates(),this._subs=null,this._view=null,this._subId=this._rowId="",this._userId=!1,this._autoGenerated=!1,this._userModel=null)},vt.prototype.isDisposed=function(){return!this._rowId},vt.prototype.initialize=function(t){if(!t)return;if(!this._autoGenerated){let e=t.rowId;e&&"string"==typeof e&&(e.match(vt.ROW_ID_PATTERN)?console.warn("Please change the rowId format to avoid duplicated rows' id causing unexpected behavior."):(this._rowId=e,this._userId=!0))}let e=vt.extractRowOptions(t),n=t.permId;null!=n&&(this._permId=n),n=t.ric,null!=n&&(this._ric=n),n=t.label,void 0!==n&&(this._label=n),n=t.chainRic,null!=n&&(this._chainRic=n),n=e.asChain,null!=n&&(this._isChain=!!n),n=t.realTime,null!=n&&(this._realTime=n),n=t.asSegment,null!=n&&(this._asSegment=!!n),(this._isChain||this._asSegment)&&(this._collapsed=e.collapsed),n=t.keepModel,n&&(this._userModel=t),n=t.info,n&&(this._info=n);let i=this._ric||this._chainRic;(i||this._permId)&&this.setContent(i,e),n=t.values,void 0!==n&&this.setStaticRowData(n,t.fields)},vt.prototype._initializeAsConstituent=function(t){this._autoGenerated=!0;let e=t.parent;this.setParent(e)&&(this._ric=t.ric,this._dc=e._dc,this._subId=e._subId),this._staticValues=t.values||null,this.resetRowData()};let It=function(t,e){let n=t.getRowIndex(e);do{if((e=t.getRowId(++n))&&!t.getSegmentParentRowId(e))break}while(e);return e},Dt=function(t,e,n){return!(!t||!t.isSorting())&&((e=!!e)!==n&&(e&&t.synchronizeRowOrder(),t.stallSorting(e)),e)};vt.prototype.setContent=function(t,e){if(this._autoGenerated)return!1;t?"string"!=typeof t&&(t+=""):t="";let n=this._userInput!==t,i=e.permId||"";if(this._permId!==i&&(this._permId=i,n=!0),!n)return!1;let o=e.asChain,r=!0;"'"===t.charAt(0)&&(r=!1,this._ric=this._chainRic="");let s=this._view,l=Dt(s,r&&o,!1);this.unsubscribeForUpdates(),this._userInput=t;let a=e.collapsed;if(r){let n=e.chainRic;this._ric=!0===o?!0===a?t:t.replace("0#",""):t,this._isChain=null!=o?o:null,this._chainRic=n||""}if(s){let t=s.getSegmentParentRowId(this._rowId);if(t){if(this._isChain){let e=It(s,this._rowId);s.removeSegmentChild(t,this._rowId),s.moveRow(this._rowId,e),t=""}}else s.getSegment(this._rowId)&&s.setSegmentSeparator(this._rowId,!1);this._isChain&&s.setSegmentSeparator(this._rowId,!0),a!==this.isChainCollapsed()&&s.collapseSegment(this._rowId,a),this._collapsed=null,Dt(s,!1,l),t&&s.addSegmentChild(t,this._rowId)}return this.subscribeForUpdates(),!0},vt.prototype.getRowId=function(){return this._rowId},vt.prototype.getConfigObject=function(t){let e=t||{};this._userId&&(e.rowId=this._rowId);let n=this._ric;if(n&&(e.ric=n),this._ric||"'"!==this._userInput.charAt(0)||(e.ric=this._userInput),n=this._realTime,n||(e.realTime=!1),n=this._permId,n&&(e.permId=n),n=this._chainRic,n&&(e.chainRic=n),n=this._label,n&&(e.label=n),n=this._userModel,n&&(e.keepModel=e),n=this._isChain,null!=n&&(e.asChain=n),n=this._collapsed,null!=n&&(e.collapsed=n),n=!!this._view&&this._view.isHiddenRow(this._rowId),n&&(e.hidden=n),n=this._info,n&&(e.info=this._info),n=this._cloneStaticRowData(),n&&(e.values=n),this.isChain()){let t=this.getChildren();if(t){let i=n?n[vt._childDataField]:{};i||(i={});let o,r,s,l=!1,a=t.length;for(o=0;o<a;o++)r=t[o],s=r._cloneStaticRowData(),s&&(l=!0,i[r.getRic()]=s);l&&(e.values||(e.values={}),e.values[vt._childDataField]=i)}}return e},vt.prototype.getDataId=function(){return""},vt.prototype.getType=function(){if(this._isChain)return"CHAIN";if(this._parent)return"CONSTITUENT";{let t=this._view;if(!t)return"";{let e=this.getRowId(),n=t.isSegmentSeparator(e),i=t.getSegmentLevel(e);if(n)return 1===i?"GROUP_HEADER":"SUBGROUP_HEADER";if(t.getSegmentParentRowId(e))return"GROUP_MEMBER"}}return"CONTENT"},vt.prototype.setDataSource=function(t,e){this._dc=t||null;let n=!1;if(this._dc)if(this._staticValues){let t=Rt(this._staticValues);n=this.addUpdate(t),this._dc.setRowData(this._rowId,t,{rowDef:this,initialChanges:this.getUpdates()})}else this._dc.setRowData(this._rowId,{});return this._subs=e||null,this.subscribeForUpdates(),n},vt.prototype.getDataSource=function(){return this._dc},vt.prototype.getRowData=function(){return this._dc?this._dc.getRowData(this._rowId):{}},vt.prototype.getData=function(t){return this._dc?this._dc.getData(this._rowId,t):null},vt.prototype.setStaticRowData=function(t,e){this._clearStaticData(),Array.isArray(t)&&(t=x(t,e)),this._staticValues="object"==typeof t?t:null,this._staticValues&&this.setRowData(t)},vt.prototype._cloneStaticRowData=function(){return this._staticValues?Rt(this._staticValues):null},vt.prototype.setStaticData=function(t,e){this._staticValues||(this._staticValues={}),this._staticValues[t]=e,this.setData(t,e)},vt.prototype.updateRowData=function(t,e){Array.isArray(t)&&(t=x(t,e)),t&&this.setRowData(t)},vt.prototype.copyRowData=function(t){if(t&&t!==this){let e=this.getRowData();t.cloneRowData(e,this._staticValues)}},vt.prototype.cloneRowData=function(t,e){let n,i=t||{},o={ROW_DEF:1,SUB_ID:1},r=this._staticValues;for(n in r)o[n]=1;for(n in e)o[n]=1;let s=this.getRowData();for(n in s)o[n]||(i[n]=s[n]);return i},vt.prototype.setRowData=function(t){this._dc&&this._dc.setRowData(this._rowId,t)},vt.prototype.resetRowData=function(){let t=this._dc;if(t){let e=this._rowId;t.setRowData(e,null),t.setRowData(e,{}),this._staticValues&&t.setRowData(e,this._staticValues)}},vt.prototype.setData=function(t,e){this._dc&&this._dc.setData(this._rowId,t,e)},vt.prototype._clearStaticData=function(){let t=this._staticValues;if(t){if(this._dc){let e={};for(let n in t)e[n]=null;this._dc.setRowData(this._rowId,e)}this._staticValues=null}},vt.prototype.getUserInput=function(){return this._userInput},vt.prototype.getRic=function(){return this._ric},vt.prototype.getPermId=function(){return this._permId},vt.prototype.getSymbol=function(){return this._ric||this._permId},vt.prototype.getDisplayText=function(){return null!=this._label?this._label:this._ric?this._ric:this._permId?this._permId:this._userInput},vt.prototype.getLabel=function(){return this._label},vt.prototype.isRowHeader=function(){return"'"===this._userInput.charAt(0)},vt.prototype.isChain=function(){return this._isChain},vt.prototype.isConstituent=function(){return!(!this._autoGenerated||!this._subId||this._rowId===this._subId)},vt.hasChain=function(t){return t.isChain()},vt.prototype.isChainCollapsed=function(){return!!this._view&&this._view.isSegmentCollapsed(this._rowId)},vt.prototype.isChainExpanded=function(){return!this.isChainCollapsed()},vt.prototype.isFixedPosition=function(){return this._isChain&&this.isChainExpanded()},vt.prototype.isAutoGenerated=function(){return this._autoGenerated},vt.prototype.isRealTimeRow=function(){return!(!this.getRic()||!this._realTime||this._autoGenerated||this.isRowHeader())},vt.prototype.subscribeForUpdates=function(t){if(!t&&!this._subs)return!1;if(!this.isRealTimeRow()&&!this.getPermId())return!1;if(this.unsubscribeForUpdates(),t?this._subs=t:t=this._subs,this.isChain()){let e=this._chainRic;!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));let e=this.getDisplayText();return this.setRowData({X_RIC_NAME:e}),!0},vt.prototype.unsubscribeForUpdates=function(t){return this.isSubscribing()&&(this._subs.removeSubscription(this._subId),this._subId="",t||(this.resetUpdates(),this.resetRowData())),null},vt.prototype.isSubscribing=function(){return!(!this._subId||!this._subs)},vt.prototype.getSubId=function(){return this._subId},vt.prototype.addUpdate=function(t){if(t){let e=0;for(let n in t)this._changes[n]=e=1;if(e)return++this._updateCount,!0}return!1},vt.prototype.getUpdates=function(){return this._updateCount?this._changes:null},vt.prototype.resetUpdates=function(){this._updateCount&&(this._changes={},this._updateCount=0)},vt.prototype.registerToView=function(t,e){if(!t||this._view===t)return!1;this._view=t;let n=this._rowId,i=t.getRowData(n);if(i&&i[bt])return console.warn("Duplicate row id detected"),!1;if(this._subSegment)return i&&(i[bt]=this),!0;i={},i[bt]=this;let o="",r=this._isChain||this._asSegment;e&&(o=t.getSegmentParentRowId(e),o)&&(r?e=It(t,e):this.isConstituent()||t.getData(o,bt).isChain()&&(o=null,e=It(t,e)));let s=Dt(t,r,!1);return t.insertRow(e,i,n),r?(t.setSegmentSeparator(n),Dt(t,!1,s),null!=this._collapsed&&(t.collapseSegment(n,this._collapsed),this._collapsed=null)):!this._parent&&o&&t.addSegmentChild(o,n),!0},vt.prototype._deregisterFromView=function(t){return this._view?(t&&t.push(this._rowId),this._view=null,this._rowId):""},vt.deregisterFromView=function(t,e){return e._deregisterFromView(t),t},vt.prototype.getConstituent=function(t){if(this._children&&t)for(let e=this._children.length;--e>=0;)if(this._children[e]._ric===t)return this._children[e];return null},vt.prototype.verifyConstituent=function(t){return!(!this._isChain||!t||this._ric===t||this._ric==="0#"+t)&&this._ric!=="/"+t},vt.prototype.addConstituent=function(t){if(!(this._rowId&&this._subId&&this._isChain))return null;this._children||(this._children=[]);let e={asConstituent:!0,ric:t,parent:this};if(this._staticValues){let n=this._staticValues[vt._childDataField];if(n){let i=n[t];i&&(e.values=i,n[t]=null)}}return new vt(e)},vt.prototype.toRealTimeRow=function(t){if(!this.isConstituent())return;let e=this._parent._subs;this._realTime=!0,this._autoGenerated=!1,this._parent=null,this._depthLevel=0,t&&(this._rowId=t,this._userId=!0),this.subscribeForUpdates(e)},vt.prototype.unlinkChain=function(){if(!this._isChain)return;this.unsubscribeForUpdates(!0);let t=this._view;if(t){let e=this.getRowId(),n=t.getSegment(e);n&&n.setClassification(null),t.setSegmentSeparator(e,!1)}this._isChain=!1,this._chainRic="",this._userInput=this._ric,this._children=null,this.subscribeForUpdates()},vt.prototype.collapseChain=function(){return!(!this._isChain||!this._view)&&this._view.collapseSegment(this._rowId,!0)},vt.prototype.expandChain=function(){return!(!this._isChain||!this._view)&&this._view.collapseSegment(this._rowId,!1)},vt.prototype.toggleChain=function(){return this.isChainExpanded()?this.collapseChain():this.expandChain()},vt.prototype.addChild=function(t){return!!t&&t.setParent(this)},vt.prototype.getChildren=function(){return this._children},vt.prototype.getDescendants=function(t){if(t||(t=[]),this._children){let e=this._children,n=e.length;for(let i=0;i<n;++i){let n=e[i];t.push(n),n.getDescendants(t)}}return t},vt.prototype.getAllDescendantIds=function(){let t=this.getDescendants();return t.length?t.map(vt.toRowId):null},vt.prototype.getChildCount=function(){return this._children?this._children.length:0},vt.prototype.countChildInView=function(){if(this._children){let t=0,e=this._children.length;for(let n=0;n<e;++n)this._children[n]._view&&++t;return t}return 0},vt.prototype.getParent=function(){return this._parent},vt.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)},vt.prototype.getDepthLevel=function(){return this._depthLevel},vt.prototype.getGroupOrder=function(){return this._parent?this._parent.getGroupOrder()+.1:this._groupOrder},vt.prototype.setGroupOrder=function(t){return!this._parent&&this._groupOrder!==t&&(this._groupOrder=t,!0)},vt.prototype.getUserModel=function(){return this._userModel},vt.prototype.setRowInfo=function(t){this._info=t},vt.prototype.getRowInfo=function(){return this._info},vt.toRowId=function(t){return t.getRowId()},vt.extractRowOptions=function(t){let e=t.ric,n=t.permId,i=t.chainRic,o=t.collapsed,r=t.asSegment,s=t.asChain;null==s&&i&&(s=!0);let l=null;e&&e.indexOf("0#")>=0?(null==s&&(s=!0),l=!0):s?l=!1:r&&(l=!0);let a={};return a.collapsed=null==o?!l:o,a.ric=e,a.permId=n||"",a.chainRic=i,a.asChain=s,a},vt.dispose=function(t){t.dispose()};const xt="/synapse/service/suggestions/suggest/?hits=1&profile="+encodeURIComponent("Field Selector"),At=/^TR\.\w+\([\w\-=,]*(?:EDATE|SDATE)=+[\w\-=,]*[ \w]*\)$/i;let Tt={};function Lt(t){t.currentTarget._error={type:t.type}}function Et(t){let e=t.currentTarget,n=e._defer,i=e._field;if(delete Tt._loadingField[i],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()===i.toUpperCase()&&(o=Tt.get(i)||{},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,Tt.set(i,o))}}o?n.resolve(o):n.reject("No definition for "+i)}else e._error?(e._error.field=i,n.reject(e._error)):n.reject({field:i,status:e.status,statusText:e.statusText,request:e})}Tt._defs={},Tt._defaults={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."}},Tt._timeSeriesChildren={},Tt._synapse="",Tt._lang="en",Tt._timeSeriesExpansion=!0,Tt._loadingField={},Tt.set=function(t,e){if(Tt._defs[t])for(let n in e)Tt._defs[t][n]=e[n];else Tt._defs[t]=e},Tt.resetAll=function(){let t=Tt._defs={},e=Tt._defaults;for(let n in e)t[n]=e[n]},Tt.get=function(t){return Tt._defs[t]||null},Tt.getFieldInfo=Tt.get,Tt.hasFieldInfo=function(t){let e=Tt.get(t);return!(!e||!e.field)},Tt.getTimeSeriesChildren=function(t){return Tt._timeSeriesChildren[t]||null},Tt.addTimeSeriesChild=function(t,e){Tt._timeSeriesChildren[t]||(Tt._timeSeriesChildren[t]=[]),Tt._timeSeriesChildren[t].push(e)},Tt.remove=function(t){delete Tt._defs[t]},Tt.setSynapseConfig=function(t){Tt._synapse=t},Tt.disableTimeSeriesExpansion=function(t){Tt._timeSeriesExpansion=!1===t},Tt.isFormula=function(t){return"="===t.charAt(0)},Tt.isAdc=function(t){return 0===t.indexOf("TR.")},Tt.isRealTimeField=function(t){return!(!t||Tt.isAdc(t)||Tt.isFormula(t)||Tt.isTimeSeriesChild(t)||!1===Tt.getFieldProperty(t,"IsRealtimeField"))},Tt.isTimeSeriesChild=function(t){return!!Tt.getFieldProperty(t,"timeSeriesParent")},Tt.isTimeSeries=function(t){if(!t)return!1;if(!Tt._timeSeriesExpansion)return!1;let e=Tt.getFieldProperty(t,"timeSeries");return null!=e?!!e:At.test(t)},Tt.setFieldProperty=function(t,e,n){Tt._defs[t]||(Tt._defs[t]={}),Tt._defs[t][e]=n},Tt.getFieldProperty=function(t,e){let n=Tt._defs[t];return n?n[e]:null},Tt.loadFieldInfo=function(t){if(Tt._loadingField[t])return Tt._loadingField[t].promise;let e=new F,n=Tt._synapse;if(n)if(Tt.hasFieldInfo(t))e.resolve(Tt.get(t));else if(n.debug){let n=this._mockOnLoadEndData(t,e);setTimeout(Et.bind(null,n),1e3)}else if(n.apiKey&&n.contextApp){let i=xt+"&api-key="+encodeURIComponent(n.apiKey)+"&contextApp="+encodeURIComponent(n.contextApp)+"&language="+encodeURIComponent(Tt._lang)+"&query="+encodeURIComponent(t);n.auth&&(i+="&auth="+encodeURIComponent(n.auth));let o=new XMLHttpRequest;o._defer=e,o._field=t,Tt._loadingField[t]=e,o.addEventListener("loadend",Et),o.addEventListener("timeout",Lt),o.addEventListener("error",Lt),o.open("GET",i,!0),o.send()}else e.resolve(null);else e.resolve(null);return e.promise},Tt._mockOnLoadEndData=function(t,e){let n,i=t.toUpperCase(),o=i.toLowerCase();n=2===o.indexOf("_")?i[3]+o.substring(4):i[0]+o.substring(1);let r=i.indexOf("DATE")>=0?"DATE":"PRICE",s={action:'"'+i+'" SRCH',assetClassifierExplanation:"AssetClassifier is disabled.",assetClassifierStatus:"NOT_INVOKED",result:[{name:"Fields",default:!1,size:1,hits:[{cmd:n,explanation:null,fr:!1,id:"1635614732",navigation:null,p:{Rank:2800024,fdt:r,fid:"5364",fimo:!1,firp:!1,firt:!0,fl:n,fn:i,fsrc:"IDN",fsrnk:100024},position:0,preview:!1,relations:{},score:2840024,source:"87",subtitle:"",symbol:n,title:"title mockup of "+i,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 Tt._defaults)Tt._defaults[t].field=t,Tt._defs[t]=Tt._defaults[t]}();const Mt=Tt;let Ft={_formulas:{},set:function(t,e){Ft._formulas[t]=e},get:function(t){return Ft._formulas[t]||""},remove:function(t){delete Ft._formulas[t]}};const Pt=Ft,zt={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"},Vt="COL_DEF";let kt=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))};kt.prototype._field="",kt.prototype._dataType="",kt.prototype._name="",kt.prototype._defaultName=!0,kt.prototype._defaultField=!0,kt.prototype._tooltip=null,kt.prototype._requiredFields,kt.prototype._headerRenderer=null,kt.prototype._headerAlignment="",kt.prototype._internalRenderer,kt.prototype._userRenderers=null,kt.prototype._activatedRenderer=null,kt.prototype._rendererMap=null,kt.prototype._userSorter=null,kt.prototype._sortable=!0,kt.prototype._eventArg,kt.prototype._autoGenerated=!1,kt.prototype._classes,kt.prototype._fnEngine=null,kt.prototype._formula=null,kt.prototype._formulaRef="",kt.prototype._initialOrder="",kt.prototype._rowSorting=null,kt.prototype._textSelect=!1,kt.prototype._userModel=null,kt.prototype._parent=null,kt.prototype._children=null,kt.prototype._info=null,kt.prototype._coreColDef=null,kt.prototype._focusable=!1,kt.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},kt.prototype._initializeTimeSeriesChild=function(t){this._autoGenerated=!0;let e=t.parent;this._setParent(e),this.initialize(t)},kt.prototype.initialize=function(t){if(!t)return;let e,n,i,o,r=t.field,s=Mt.get(r);if(s&&s!==t){let e=t;for(i in t={},s)t[i]=s[i];for(i in e)t[i]=e[i]}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,null==o&&(o=t.title),null!=o&&(this._name="string"==typeof o?o:o+"",this._defaultName=!1),o=t.dataType,null!=o&&(this._dataType=o),o=t.notRealTimeField,null!=o&&Mt.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(n=o.length,e=0;e<n;++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.focusable,null!=o&&(this._focusable=!!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},kt.prototype.getId=function(){return this._coreColDef&&this._coreColDef.id||""},kt.prototype.getRequireFields=function(){return this._requiredFields},kt.prototype.getRequiredFields=kt.prototype.getRequireFields,kt.prototype.getRenderer=function(){return this._internalRenderer},kt.prototype.getHeaderRenderer=function(){return this._headerRenderer},kt.prototype.getName=function(){return this._defaultName?this._defaultField?"Column "+this.getId():this.getField():this._name},kt.prototype.isDefaultName=function(){return this._defaultName},kt.prototype.getFieldDefinition=function(){return Mt.get(this.getField())},kt.prototype.getFieldDataType=function(){let t=this.getFieldDefinition();return t&&t.fieldDataType?t.fieldDataType:""},kt.prototype.getDataType=function(){if(this._dataType)return this._dataType;let t=this.getFieldDataType();return t?zt[t.toUpperCase()]:""},kt.prototype.setDataType=function(t){let e=zt[t.toUpperCase()];e&&(t=e),this._dataType=t},kt.getDataType=function(t){let e=Mt.get(t);if(e){let t=e.fieldDataType?e.fieldDataType.toUpperCase():null;return zt[t]?zt[t]:""}return""},kt.prototype.getTooltipValue=function(){return this._tooltip},kt.prototype.getTooltip=function(){if(null!=this._tooltip){if("string"==typeof this._tooltip)return this._tooltip;if(!this._tooltip)return""}let t=this.getName();return t||(this.getField()||"")},kt.prototype.getField=function(){return this._coreColDef&&this._coreColDef.field||""},kt.prototype.getAllFields=function(){let t=this.getField();return t?this._requiredFields.concat(t):this._requiredFields.slice()},kt.prototype.isRealTimeField=function(){return Mt.isRealTimeField(this.getField()||this._field)},kt.prototype.isTimeSeries=function(){return Mt.isTimeSeries(this.getField())},kt.prototype.isTimeSeriesChild=function(){return Mt.isTimeSeriesChild(this.getField())},kt.prototype.isFormulaField=function(){return!!this._formula},kt.isFormulaField=function(t){return Mt.isFormula(t)},kt.isAdcField=function(t){return Mt.isAdc(t)},kt.isRealTimeField=function(t){return Mt.isRealTimeField(t)},kt.getRealTimeFields=function(t,e){e.isRealTimeField()&&t.push(e.getField());let n=e.getRequiredFields(),i=n.length;for(let e=0;e<i;++e){let i=n[e];kt.isRealTimeField(i)&&t.push(i)}return t},kt.prototype.isSortable=function(){return this._sortable},kt.prototype.isScalable=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnScalability(e)},kt.prototype.getInitialSortOrder=function(){return this._initialOrder},kt.prototype.getWidth=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnWidth(e)},kt.prototype.getMinWidth=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getMinimumColumnWidth(e)},kt.prototype.getTextAlign=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnAlignment(e)},kt.prototype.isFieldEmpty=function(){return!this.getField()},kt.prototype.getHeaderAlignment=function(){return this._headerAlignment||""},kt.prototype.getClasses=function(){return this._classes},kt.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 n=this.getDataType();n&&(e.dataType=n),this._formulaRef&&(e.formulaReference=this._formulaRef),this._requiredFields&&this._requiredFields.length&&(e.require=this._requiredFields),this._defaultName||(e.name=this.getName()),n=!1===Mt.getFieldProperty(this.getField(),"IsRealtimeField"),n&&(e.notRealTimeField=n),null!=this._tooltip&&(e.tooltip=this._tooltip),null!=this._rowSorting&&(e.rowSorting=this._rowSorting),this._sortable||(e.sortable=!1);let i=this._classes;i&&i.length>0&&(e.className=i.join(" ")),this._textSelect&&(e.textSelect=this._textSelect),this._headerAlignment&&(e.headerAlignment=this._headerAlignment),this._autoGenerated&&(e.autoGenerated=this._autoGenerated),this._focusable&&(e.focusable=!0);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),n=o.getMinimumColumnWidth(r),n>0&&(e.minWidth=n),null==e.hidden&&(o.getColumnVisibility(r,0)||(e.hidden=!0)),n=o.getColumnAlignment(r),"default"!==n&&(e.textAlign=n),e},kt.prototype.isHidden=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return!t.isColumnVisible(e)},kt.prototype.isTextSelect=function(){return this._textSelect},kt.prototype.hide=function(t){let e=this._eventArg.core,n=this._eventArg.grid.getColumnIndex(this);e.hideColumn(n,!1!==t)},kt.prototype.setHeaderRenderer=function(t){this._headerRenderer=t},kt.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)},kt.prototype.getParent=function(){return this._parent},kt.prototype._setParent=function(t){return this._parent===t||t===this||t&&(this._parent=t,this._parent._addChild(this)),!1},kt.prototype.getChildren=function(){return this._children},kt.prototype._addChild=function(t){this===t||this._children.indexOf(t)>-1||this._children.push(t)},kt.prototype.addRenderer=function(t){t&&(this._userRenderers?this._userRenderers.push(t):this.setRenderer(t))},kt.prototype.activateRenderer=function(t,e){let n=null;if(null!=t){let i=this._rendererMap;i||(i=this._rendererMap={}),"function"==typeof e?n=i[t]=e:null==e?n=i[t]:e||(n=i[t]=null)}return this._activatedRenderer=n||null,n||(n=this._userRenderers?this._userRenderers[0]:null),this.setRenderer(n),!!this._activatedRenderer},kt.prototype.getSorter=function(){return this._userSorter},kt.prototype.setSorter=function(t){this._userSorter="function"==typeof t?t:null},kt.prototype.isRowSorting=function(){return null==this._rowSorting?!Mt.getFieldProperty(this.getField(),"IsRealtimeField"):!!this._rowSorting},kt.prototype.isAutoGenerated=function(){return this._autoGenerated},kt.prototype.setName=function(t){this._name=t,this._defaultName=!1},kt.prototype._setField=function(t,e){this._defaultField=null==t,t||(t=""),t=t.trim();let n=e?e.formula:"";if(this._fnEngine){let e=t.toUpperCase(),i=n||Pt.get(e);(i||kt.isFormulaField(t))&&(t=h.toUpperCase(t),this._formula=this._fnEngine.addFormula(i||t),i&&(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,Mt.setFieldProperty(t,"timeSeries",!!Mt.isTimeSeries(t));let i=e.parent;e&&i&&Mt.setFieldProperty(t,"timeSeriesParent",i.getField()),this._updateContext("field",t),this.isRealTimeField()&&this._updateContext("formattedField",t+"_FORMATTED")},kt.prototype._retrieveNestedFields=function(t){if(t)for(let e=t.length;--e>=0;){let n=t[e],i=n.toUpperCase(),o=Pt.get(i);if(o){let t=this._fnEngine.getFormula(n);t?t.addFormulaCount():(t=this._fnEngine.addFormula(o),t.setAlias(n),this._fnEngine.addReference(t,n)),this._retrieveNestedFields(t.getFieldNames())}else this._requiredFields.push(n)}},kt.prototype._defaultRenderer=function(t){let e=t.dataValue;t.cell.setContent(e?e.getData(this._field):null)},kt.prototype._customRenderer=function(t){let e=t.dataValue,n=this._eventArg;if(e){let i=e.getRowData();n.rowDef=e,n.rowData=i,n.rowIndex=t.rowIndex,n.data=i?i[this._field]:null}else n.data=null;if(n.colIndex=t.colIndex,n.cell=t.cell,n.section=t.section,this._activatedRenderer)this._activatedRenderer(n);else{let t=this._userRenderers,e=t.length;for(let i=0;i<e;++i)t[i](n)}},kt.prototype._updateContext=function(t,e){this._eventArg[t]=e},kt.prototype.getUserModel=function(){return this._userModel},kt.prototype.clearUserModel=function(){this._userModel=null},kt.prototype.setColumnInfo=function(t){this._info=t},kt.prototype.getColumnInfo=function(){return this._info},kt.prototype._setCoreColumnDef=function(t){this._coreColDef=t||null},kt.prototype.isFocusable=function(){return this._focusable},kt.prototype.getBackgroundColor=function(){let t=this._eventArg.core,e=this._eventArg.grid.getColumnIndex(this);return t.getColumnBackgroundColor(e)},kt.prototype.setBackgroundColor=function(t){let e=this._eventArg.core,n=this._eventArg.grid.getColumnIndex(this);e.setColumnBackgroundColor(n,t)};const Nt=kt;let Ot=function(){this._onRequest=this._onRequest.bind(this),this._rics={},this._fields={},this._adcOptions={productId:"001"}};n.inherits(Ot,r),Ot._mockAdc=null,Ot.prototype._timerId=0,Ot.prototype._rics,Ot.prototype._fields,Ot.prototype._rtk,Ot.prototype._adcOptions=null,Ot.prototype.dispose=function(){this.removeAllEventListeners(),this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._rics=this._fields=this._rtk=this._adcOptions=null},Ot.prototype.setRTK=function(t){this._rtk=t},Ot.setMockAdc=function(t,e){Ot._mockAdc||(Ot._mockAdc={}),Ot._mockAdc[t]=e},Ot.getMockAdc=function(t){return Ot._mockAdc?Ot._mockAdc[t]:null},Ot.clearMockAdc=function(){Ot._mockAdc=null},Ot.prototype.setADCOptions=function(t){let e=t.productId;e&&(this._adcOptions.productId=e)},Ot.prototype.addRic=function(t){t&&!this._rics[t]&&(this._rics[t]=1,this._request())},Ot.prototype.addRics=function(t){let e=t?t.length:0,n=!1;for(let i=0;i<e;++i){let e=t[i];e&&!this._rics[e]&&(this._rics[e]=1,n=!0)}return!!n&&(this._request(),!0)},Ot.prototype.addField=function(t){this._addField(t)&&this._request()},Ot.prototype.addFields=function(t){let e=t.length,n=0;for(let i=0;i<e;++i)n|=this._addField(t[i]);return!!n&&(this._request(),!0)},Ot.prototype._addField=function(t){return Ot.isValidField(t)&&!this._fields[t]?(this._fields[t]=1,1):0},Ot.isValidField=function(t){return!(!t||0!==t.indexOf("TR."))},Ot.prototype._request=function(){this._timerId||(this._timerId=setTimeout(this._onRequest,0))},Ot.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,n=Object.keys(this._rics),i=[],o=[];for(let t in this._fields)Tt.isTimeSeries(t)?o.push(t):i.push(t);let r,s,l=i.length,a=o.length;if((l||a)&&n.length)if(this._rics={},this._fields={},this._rtk){let t;if(o.length>0){let t=o.join(",");s={method:"select",formula:t,identifiers:n,productId:this._adcOptions.productId,output:"Col,date|,Row,In|,va,T,NoEmptyTickers"},r=this._onRTKTimeSeriesSuccess.bind(this,o);let e=Ot.getMockAdc(s.formula);e?setTimeout((function(){r(e)}),10):this._rtk.Data.Adc.request(s).then(r).catch((function(t){console.log(t)}))}i.length>0&&(t=i.join(","),s={method:"select",formula:t,identifiers:n,productId:this._adcOptions.productId,output:"Col,In,va,T,NoEmptyTickers"},r=this._onRTKSuccess.bind(this,i),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:i[e]});s={instruments:n,fields:o},r=this._onJETSuccess.bind(this,i),t.Data("datagrid").then((function(t){return t.request(s)})).then(JSON.parse).then(r).catch((function(t){console.log(t)}))}},Ot.prototype._onJETSuccess=function(t,e){this._dispatch("adcDataReceived",e);let n,i,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(n=0;n<a&&l<u;n++)i=t[n],s[l].field===i.toUpperCase()&&(h[l]=i,l++);let p=r.length,d=h.length,c={};for(n=0;n<p;n++){let t=r[n];if(o=t[0],c[o])continue;let e=c[o]={};for(l=1;l<d;l++){let n=t[l];null!=n&&""!==n&&(i=h[l],e[i]=n)}}let _={};for(o in c){let t=c[o];D(t)||(_[o]=t)}this._dispatch("dataChanged",{data:_})},Ot.prototype._onRTKSuccess=function(t,e){this._dispatch("adcDataReceived",e);let n,i,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(n=0;n<a&&l<u;n++)i=t[n],s[l].r.toUpperCase()===i.toUpperCase()&&(h[l]=i,l++);let p=r.length,d=h.length,c={};for(n=1;n<p;n++){let t=r[n];if(o=t[0],c[o])continue;let e=c[o]={};for(l=1;l<d;l++){let n=t[l];null!=n&&""!==n&&"object"!=typeof n&&(i=h[l],e[i]=n)}}let _={};for(o in c){let t=c[o];D(t)||(_[o]=t)}this._dispatch("dataChanged",{data:_})},Ot.prototype._onRTKTimeSeriesSuccess=function(t,e){this._dispatch("adcDataReceived",e);let n=e.rows,i=e.rows&&e.rows[0];if(!Array.isArray(n)||!Array.isArray(i))return;let o=i.slice(2).map((t=>t.v)),r={},s=0,l=n.length;for(let e=1;e<l;e++){let i=n[e][1];r[i]||(r[i]=t[s++])}let a={},u={};for(let t=1;t<l;t++){let e=n[t],i=e[0],s=e[1];a[i]||(a[i]={});let l=a[i];if(1===o.length)l[r[s]]=e[2];else for(let t=0;t<o.length;t++){let n=r[s].replace("TR.","")+"_"+o[t],i=e[2+t];null!==i&&(u[n]=r[s],l[n]=i)}}let h={};for(let t in a){let e=a[t];D(e)||(h[t]=e)}let p={data:h};o.length>1&&(p.timeSeries=!0,p.childrenFieldToParent=u),this._dispatch("dataChanged",p)};const Ht=Ot;let Bt=function(){this._groupMap={},this._childToParent={}};Bt.prototype._groupMap,Bt.prototype._childToParent,Bt.getGroupId=function(t){return t&&t.id||""},Bt.calcTreeDepth=function(t,e){let n=-1,i=e;for(;i;){if(++n>15){console.log("WARNING: Infinite loop detected during column group creation");break}i=t[i.parentId]}return n},Bt.getLeafDescendants=function(t,e){let n=t[e];if(!n)return null;let i=[],o=[n],r=0,s={};for(;r<o.length;){n=o[r++],s[n.id]=!0;let e=n.children,l=e?e.length:0;for(let r=0;r<l;++r){let l=e[r];n=t[l],n?s[n.id]||o.push(n):i.push(l)}}return i},Bt._cloneObject=function(t){let e=I(t);return Array.isArray(e.children)?e.children=e.children.slice():e.children=[],e},Bt._toGroupDefinition=function(t,e){let n=null;return t&&(n=Array.isArray(t)?{children:t.slice()}:Bt._cloneObject(t),e&&(n.name||(n.name=e),n.id=e)),n},Bt.prototype.toString=function(){let t=this._groupMap,e=[];e.push("=== groupDefs ===");for(let n in t){let i=t[n];e.push(n+": "+JSON.stringify(i,["id","parentId","children"]))}return e.push("=== childToParent ==="),e.push(JSON.stringify(this._childToParent,null,2)),e.push(""),e.join("\n")},Bt.prototype.getGroup=function(t){return t&&this._groupMap[t]||null},Bt.prototype.getDefinition=Bt.prototype.getGroup,Bt.prototype.getGroups=function(){let t=[],e=this._groupMap;for(let n in e)t.push(e[n]);return t},Bt.prototype.getGroupIds=function(){return Object.keys(this._groupMap)},Bt.prototype.getGroupMap=function(){return this._groupMap},Bt.prototype.cloneGroupMap=function(){let t=this._groupMap,e={};for(let n in t){let i=t[n],o=Bt._cloneObject(i);e[n]=o}return e},Bt.prototype.rebuildMap=function(){let t,e,n=this._groupMap,i=this._childToParent={},o=Object.keys(n),r=o.length;for(t=0;t<r;++t){e=o[t];let r=n[e].children,s=r?r.length:0;for(let t=0;t<s;t++)i[r[t]]=e}for(t=0;t<r;++t){e=o[t];let r=i[e];r&&(n[e].parentId=r)}},Bt.prototype.getGroupChildren=function(t){let e=this._groupMap[t];return e?e.children:null},Bt.prototype.getLeafDescendants=function(t){return Bt.getLeafDescendants(this._groupMap,t)},Bt.prototype.getGroupLevel=function(t){return Bt.calcTreeDepth(this._groupMap,this._groupMap[t])},Bt.prototype.getRootGroup=function(t){if(!t)return null;let e=this._groupMap,n=e[t]||null;if(n)for(;n.parentId;){let t=e[n.parentId];if(!t)break;n=t}return n},Bt.prototype.getParentGroup=function(t){return this.getGroup(this._childToParent[t])},Bt.prototype.getParentIds=function(t){if(t&&"string"==typeof t){let e=this._childToParent[t];if(e){let t=[e],n=this._groupMap[e];for(;n&&n.parentId;)n=this._groupMap[n.parentId],n&&t.push(n.id);return t}}return null},Bt.prototype.getParentId=function(t,e){let n=this._childToParent[t];if(null!=e){let t=this.getGroupLevel(n);for(;t>e&&n;)n=this._childToParent[n],t--}return n||""},Bt.prototype.removeAllGroups=function(){for(let t in this._groupMap)return this._groupMap={},this._childToParent={},!0;return!1},Bt.prototype.setGroups=function(t){let e=this._groupMap={},n=t?t.length:0;for(let i=0;i<n;i++){let n=t[i],o=n.id;o&&(e[o]=Bt._cloneObject(n))}this.rebuildMap()},Bt.prototype.addGroup=function(t){let e=Bt.getGroupId(t);return e?this.setGroup(e,t):e},Bt.prototype.removeGroup=function(t){return!!this._groupMap[t]&&(this.removeAllChildren(t),this.unsetParent(t),delete this._groupMap[t],!0)},Bt.prototype.setGroup=function(t,e){if(!t)return"";if(e){let n=Bt._toGroupDefinition(e,t);this._ungroupChildren(n.children),this._groupMap[t]&&this.removeAllChildren(t);let i=this._childToParent[t];i&&(n.parentId=i),this._groupMap[t]=n;let o=n.children,r=o.length;for(let e=0;e<r;++e){let n=o[e];this._childToParent[n]=t;let i=this._groupMap[n];i&&(i.parentId=t)}}else if(!this.removeGroup(t))return"";return t},Bt.prototype._ungroupChildren=function(t){if(Array.isArray(t)){let e=t.length;for(let n=0;n<e;++n)this.unsetParent(t[n])}},Bt.prototype.hasGroupChild=function(t,e){let n=this._groupMap[t];if(e&&n){let t=n.children;if(t)return t.indexOf(e)>=0}return!1},Bt.prototype.contains=function(t,e){if(t&&e){if(t===e)return!0;let n=20,i=this._childToParent[e];for(;i&&n;){if(t===i)return!0;--n,i=this._childToParent[i]}}return!1},Bt.prototype.addGroupChild=function(t,e,n){let i=this._groupMap[t];if(e&&i){let o=i.children;if(o&&o.indexOf(e)<0){this.unsetParent(e),this._childToParent[e]=t;let i=this._groupMap[e];return i&&(i.parentId=t),null!=n&&n>=0?o.splice(n,0,e):o.push(e),!0}}return!1},Bt.prototype.removeGroupChild=function(t,e){return null==e?this.unsetParent(t):!!this.hasGroupChild(t,e)&&this.unsetParent(e)},Bt.prototype.unsetParent=function(t){let e=this._childToParent[t];if(!e)return!1;this._childToParent[t]="";let n=this._groupMap[t];n&&(n.parentId="");let i=this._groupMap[e];if(i){let e=i.children;if(e&&e.length){let n=e.indexOf(t);n>=0&&e.splice(n,1)}}return!0},Bt.prototype.removeAllChildren=function(t){let e=this._groupMap[t];if(e){let t=e.children,n=t?t.length:0;if(n){e.children=[];for(let e=0;e<n;++e){let n=t[e];this._childToParent[n]&&(this._childToParent[n]="");let i=this._groupMap[n];i&&(i.parentId="")}return!0}}return!1},Bt.prototype.setGroupChildren=function(t,e){let n=this._groupMap[t];if(n){if(Array.isArray(e)){let i=e.slice();this._ungroupChildren(i),this.removeAllChildren(t),n.children=i;let o=n.id,r=i.length;for(let t=0;t<r;++t){let e=i[t];this._childToParent[e]=o;let n=this._groupMap[e];n&&(n.parentId=o)}return!0}if(!e&&n.children.length)return this.removeAllChildren(t),!0}return!1},Bt.prototype.getGroupName=function(t){let e=this._groupMap[t];return e&&e.name||""},Bt.prototype.setGroupName=function(t,e){let n=this._groupMap[t];return!(!n||n.name===e||(n.name=e,0))};let Gt=function(t){this._element=t||document.createElement("div")};o.inherits(Gt,ct),Gt.prototype._element=null,Gt.prototype._content=null,Gt.prototype._textSpan=null,Gt.prototype._nativeEvents=null,Gt._passiveEvents=null,Gt.prototype.getContent=function(t){return t?this._element.children:this._element.lastChild},Gt.prototype.setContent=function(t,e){if(null==t||t!=t?t=null:1!==t.nodeType&&11!==t.nodeType&&(null==t.getElement?(ut.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},Gt.prototype.addContent=function(t){return null==(t=ut.getElement(t))?null:(this._content=this._element.children,this._element.appendChild(t),t)},Gt.prototype.removeContent=function(t){return null!=(t=ut.getElement(t))&&(this._content=this._element.children,this._element.removeChild(t),!0)},Gt.prototype.listen=function(t,e,n){if(this._customEvents&&this._customEvents[t])return void this._customEvents[t].listen(e,n);this._nativeEvents||(this._nativeEvents={});let i=this._nativeEvents[t];if(!i){if(i=new pt,this._nativeEvents[t]=i,i.dispatch=i.dispatch.bind(i),!Gt._passiveEvents){let t=!1;try{let e=Object.defineProperty({},"passive",{get:function(){return t=!0,!1}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch(t){}if(t){let t={passive:!0};Gt._passiveEvents={touchstart:t,touchmove:t}}else Gt._passiveEvents={}}this._element.addEventListener(t,i.dispatch,Gt._passiveEvents[t]||!1)}i.listen(e,n)},Gt.prototype.unlisten=function(t,e){if(this._customEvents&&this._customEvents[t])this._customEvents[t].unlisten(e);else if(this._nativeEvents){let n=this._nativeEvents[t];n&&n.unlisten(e)}},Gt.prototype.unlistenAll=function(t){if(this._customEvents)if(t)this._customEvents[t]&&this._customEvents[t].unlistenAll();else for(let t in this._customEvents)this._customEvents[t].unlistenAll();if(this._nativeEvents)if(t)this._nativeEvents[t]&&(this._unlistenAll(t),delete this._nativeEvents[t]);else{for(let t in this._nativeEvents)this._unlistenAll(t);this._nativeEvents=null}},Gt.prototype._unlistenAll=function(t){let e=this._nativeEvents[t];this._element.removeEventListener(t,e.dispatch,!1),e.unlistenAll()},Gt.prototype.dispose=function(){this._dispose()},Gt.prototype._dispose=function(){this.setParent(null),this.unlistenAll(),this._element=this._content=this._textSpan=null,this._customEvents=this._nativeEvents=null},Gt.prototype.setEventArgExtender=function(t,e){if(this._customEvents){let n=this._customEvents[t];n&&n.setEventArgExtender(e)}},Gt.prototype.getElement=function(){return this._element},Gt.prototype.getNextSibling=function(){return this._element.nextSibling},Gt.prototype.getParent=function(){return this._element.parentNode},Gt.prototype.setParent=function(t,e){this._setParent(t,e)},Gt.prototype._setParent=function(t,e){null!==(t=ut.getElement(t))?e?t.insertBefore(this._element,t.firstChild):t.appendChild(this._element):null!==this._element.parentNode&&this._element.parentNode.removeChild(this._element)},Gt.prototype.insertBefore=function(t){this._insertBefore(t)},Gt.prototype._insertBefore=function(t){if(null==(t=ut.getElement(t)))return void this.setParent(this.getParent());let e=t.parentNode;null!=e&&e.insertBefore(this._element,t)},Gt.prototype.insertAfter=function(t){(t=ut.getElement(t))?t.nextSibling?this.insertBefore(t.nextSibling):this.setParent(t.parentNode):this.setParent(this.getParent(),!0)},Gt.prototype.hasClass=function(t){return!!this._element&&this._element.classList.contains(t)},Gt.prototype.addClass=function(t){this._element&&this._element.classList.add(t)},Gt.prototype.removeClass=function(t){this._element&&this._element.classList.remove(t)},Gt.prototype.toggleClass=function(t,e){let n=this._element;n&&(null==e&&(e=!n.classList.contains(t)),e?n.classList.add(t):n.classList.remove(t))},Gt.prototype.enableClass=function(t,e){!1!==e?this.addClass(t):this.removeClass(t)},Gt.prototype.getClass=function(){return this._element.className},Gt.prototype.setClass=function(t){this._element.className=t},Gt.prototype.getAttribute=function(t){return this._element.getAttribute(t)},Gt.prototype.hasAttribute=function(t){return this._element.hasAttribute(t)},Gt.prototype.setAttribute=function(t,e){this._element.setAttribute(t,e)},Gt.prototype.setAttributes=function(t){for(let e in t)this._element.setAttribute(e,t[e])},Gt.prototype.removeAttribute=function(t){this._element.removeAttribute(t)},Gt.prototype.getStyle=function(t){return this._element.style[t]},Gt.prototype.setStyle=function(t,e){this._element.style[t]=e},Gt.prototype.setStyles=function(t){let e=this._element.style;for(let n in t)e[n]=t[n]},Gt.prototype.getId=function(){return this._element.id},Gt.prototype.setId=function(t){this._element.id=t},Gt.prototype.toString=function(){let t=this._element.outerHTML;return t=t.replace(this._element.innerHTML,""),t},Gt.prototype.getTextContent=function(){return this._element.textContent},Gt.prototype.setTextContent=function(t){this._element.textContent=t},Gt.prototype.getLeft=function(){return this._element.offsetLeft},Gt.prototype.setLeft=function(t){return this._element.style.left=t+"px",!0},Gt.prototype.getTop=function(){return this._element.offsetTop},Gt.prototype.setTop=function(t){return this._element.style.top=t+"px",!0},Gt.prototype.getWidth=function(){return this._element.offsetWidth},Gt.prototype.setWidth=function(t){return this._element.style.width=t+"px",!0},Gt.prototype.getHeight=function(){return this._element.offsetHeight},Gt.prototype.setHeight=function(t){return t<0&&(t=0),this._element.style.height=t+"px",!0},Gt.prototype.getBoundingClientRect=function(){return this._element.getBoundingClientRect()},Gt.prototype.fillParentWidth=function(t){return null==t&&(t=100),this._element.style.width=t+"%",!0},Gt.prototype.fillParentHeight=function(t){return null==t&&(t=100),this._element.style.height=t+"%",!0},Gt.prototype.getTooltip=function(){return this.getAttribute("title")},Gt.prototype.setTooltip=function(t){t?this.setAttribute("title",t):this.removeAttribute("title")},Gt.prototype.show=function(t){this._element.style.display=!1!==t?"":"none"},Gt.prototype.hide=function(t){this.show(!1===t)},Gt.prototype.isVisible=function(){return"none"!==this._element.style.display},Gt.prototype.enable=function(t){(t=!1!==t)?this.removeAttribute("disabled"):(this.setAttribute("disabled","disabled"),this._element.disabled=!t)},Gt.prototype.disable=function(t){this.enable(!1===t)},Gt.prototype.isEnabled=function(){return!this._element.hasAttribute("disabled")},Gt.prototype.getScrollLeft=function(){return this._element.scrollLeft},Gt.prototype.getScrollTop=function(){return this._element.scrollTop},Gt.prototype.isEndOfHorizontalScroll=function(){return this._element.scrollLeft>=this._element.scrollWidth-this.getWidth()},Gt.prototype.isEndOfVerticalScroll=function(){return this._element.scrollTop>=this._element.scrollHeight-this.getHeight()},Gt._proto=Gt.prototype;const Wt=Gt;let Ut=function(){this._items=[],this._element=null};o.inherits(Ut,Wt),Ut.prototype._items=[],Ut.prototype.hasItem=function(){return!!this._items.length},Ut.prototype.containItem=function(t){return this._items.indexOf(t)>-1},Ut.prototype.insertItem=function(t,e){let n=this._items;n.indexOf(t)>-1||(n.push(t),e&&(t._order=e),n.length&&n.sort(Ut._iconComparer),this._updatePanelItems())},Ut.prototype.removeItem=function(t){let e=this._items,n=-1;if(t)for(let i=e.length;--i>=0;){let o=e[i];if("string"==typeof t){if(o.classList.contains(t)){n=i;break}}else if(o===t){n=i;break}}else n=e.length-1;let i=null;return n>-1&&(i=e.splice(n,1)[0]),this._updatePanelItems(),i},Ut.prototype.clearItems=function(){let t=this._items;t.length&&(t.length=0,this._updatePanelItems())},Ut._iconComparer=function(t,e){return t._order?e._order?t._order-e._order:1:e._order?-1:0},Ut.prototype._updatePanelItems=function(){let 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(let n=0;n<t.length;n++)e.appendChild(t[n])}};const Yt=Ut;let Xt=function(t,e){this._id=Xt._runningId++,this._element=document.createElement("div"),this._element.className="cell",e&&(this._section=e)};o.inherits(Xt,Wt),Xt.prototype._aligner=null,Xt._runningId=0,Xt.prototype._id=0,Xt.prototype._width=-1,Xt.prototype._height=-1,Xt.prototype._visible=!0,Xt.prototype._rawContent,Xt.prototype._section=null,Xt.prototype._contentLocked=!1,Xt.prototype._collapsedState=0,Xt.prototype._floatingPanel=null,Xt.prototype._frontIcon=null,Xt.prototype._tooltipInfo=null,Xt.prototype.getContent=function(t){return t&&this._element?this._element.children:this._content||null},Xt.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){let t=this._aligner.firstChild;t!==this._content&&(this._rawContent=t,this._content=t)}let n=this._setRawContent(t);return null!=e&&this._content&&this._content.setAttribute("title",e),n},Xt.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)))},Xt.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},Xt.prototype.getNextSibling=function(){return null!==this._element?this._element.nextSibling:null},Xt.prototype.getParent=function(){return null!==this._element?this._element.parentNode:null},Xt.prototype.setParent=function(t,e){let n=ut.getElement(t);if(n){if(this.initialize(),1===this._collapsedState)return;let t;!0===e&&(t=n.firstChild),t?n.insertBefore(this._element,t):n.appendChild(this._element)}else this.removeParent()},Xt.prototype.removeParent=function(){let t=this._element;t&&t.parentNode&&t.parentNode.removeChild(t)},Xt.prototype.insertBefore=function(t){let e=ut.getElement(t);if(null==e)return void this.setParent(this.getParent());let n=e.parentNode;null!=n&&(this.initialize(),n.insertBefore(this._element,e))},Xt.prototype.getTextContent=function(){return this._rawContent?"string"==typeof this._rawContent?this._rawContent:this._rawContent.textContent:""},Xt.prototype.getTextElement=function(){return this._textSpan},Xt.prototype.getWidth=function(){return this._width>=0?this._width:this._element.offsetWidth},Xt.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)},Xt.prototype.getHeight=function(){return this._height>=0?this._height:this._element.offsetHeight},Xt.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)},Xt.prototype.fillParentWidth=function(t){return!1},Xt.prototype.fillParentHeight=function(t){return!1},Xt.prototype.show=function(t){let e=!1!==t;e!==this._visible&&(this._visible=e,this._updateDisplay())},Xt.prototype.isVisible=function(){return this._visible},Xt.prototype.getScrollLeft=function(){return 0},Xt.prototype.getScrollTop=function(){return 0},Xt.prototype.isEndOfHorizontalScroll=function(){return!0},Xt.prototype.isEndOfVerticalScroll=function(){return!0},Xt.prototype.hasElement=function(){return null!==this._element},Xt.prototype.getSection=function(){return this._section},Xt.prototype.initialize=function(){return null==this._aligner&&(ut.isIE?this._aligner=document.createElement("div"):this._aligner=document.createElement("button"),this._aligner.className="valigner",this._aligner.role="gridcell",this._frontIcon&&this._element.appendChild(this._frontIcon.getElement()),this._element.appendChild(this._aligner),this._floatingPanel&&this._element.appendChild(this._floatingPanel.getElement())),this._element},Xt.prototype.updateIcon=function(t){if(!t)return;let e=this._frontIcon;if(e){if(e.containItem(t))return;e.clearItems()}this.insertFrontIcon(t,0)},Xt.prototype.removeIcon=function(){let t=this._frontIcon;t&&(t.clearItems(),this._element.removeChild(t.getElement()),t=this._frontIcon=null)},Xt.prototype.isFrozen=ut._deprecatedFunction,Xt.prototype.freezeLayout=ut._deprecatedFunction,Xt.prototype.setAutoContentClipping=ut._deprecatedFunction,Xt.prototype.setContentTooltip=function(t){return!(null==t||!this._content||(this._content.setAttribute("title",t),0))},Xt.prototype.lockContent=function(t){this._contentLocked=!1!==t},Xt.prototype.reset=function(){if(!this._element)return;let 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();let n=this.blinkState;n&&(n.timerId>=0&&clearInterval(n.timerId),delete this.blinkState),delete this.trendState;let i=this.blinking;i&&(i.blinking>=0&&clearTimeout(i.blinking),i.cell=null,i.styles=null,delete this.blinking),this.removeIcon(),this.setContent(null),this._textSpan&&(this._textSpan.className="text",this._textSpan.textContent="")},Xt.prototype.resetClass=function(){let t="cell";this.hasClass("spanned")&&(t+=" spanned"),this.hasClass("selected-row")&&(t+=" selected-row"),this.hasClass("highlighted-row")&&(t+=" highlighted-row"),this.setClass(t)},Xt.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)},Xt.prototype.insertFloatingIcon=function(t,e){if(!t)return;let n=this._floatingPanel;n||(n=this._floatingPanel=new Yt),n.insertItem(t,e),n.addClass("floating-panel");let i=this._element;i.contains(n.getElement())||i.appendChild(n.getElement())},Xt.prototype.removeFloatingIcon=function(t){let e=this._floatingPanel;if(!e)return null;let n=e.removeItem(t);return e.hasItem()||(this._element.removeChild(e.getElement()),this._floatingPanel=null),n},Xt.prototype.insertFrontIcon=function(t,e){if(!t)return;let n=this._frontIcon;n||(n=this._frontIcon=new Yt),n.insertItem(t,e),n.addClass("front-panel");let i=this._element;i.contains(n.getElement())||i.insertBefore(n.getElement(),i.firstChild)},Xt.prototype.removeFrontIcon=function(t){let e=this._frontIcon;if(!e)return null;let n=e.removeItem(t);return e.hasItem()||(n=e.getElement(),this._element.removeChild(n),this._frontIcon=null),n},Xt.prototype.getCellId=function(){return this._id},Xt.prototype.updatePadding=function(){},Xt.prototype.collapse=function(t,e){let n,i=!1!==t;return n=i?e?2:1:0,this._collapsedState!==n&&(i?e?this.addClass("spanned"):this.setParent(null):2===this._collapsedState&&this.removeClass("spanned"),this._collapsedState=n,!0)},Xt.prototype.isCollapsed=function(){return 0!==this._collapsedState},Xt.prototype.isKeptInDoc=function(){return 1!==this._collapsedState},Xt.prototype.getClientWidth=function(){return this._element?this._element.clientWidth:this.getWidth()},Xt.prototype.getClientHeight=function(){return this._element?this._element.clientHeight:this.getHeight()},Xt.prototype.setTooltip=function(t){this.setTooltipInfo("userTooltip",t),this.updateTooltip()},Xt.prototype.setTooltipInfo=function(t,e){let n=this._tooltipInfo;n||(n=this._tooltipInfo={}),n[t]=e},Xt.prototype.updateTooltip=function(){let t=this._tooltipInfo;if(!t)return;let e="",n=null;t.clippedText&&(e=n=t.clippedTextTooltip),null==t.groupHeaderTooltip?!1!==t.columnDefault&&(null!=t.columnDefault?n=t.columnTooltip:e=t.columnTooltip):!1!==t.groupHeaderDefault&&(null!=t.groupHeaderDefault?n=t.groupHeaderTooltip:e=t.groupHeaderTooltip),null!=t.userTooltip&&(n=t.userTooltip),null==n&&(n=e),n?(this.hasAttribute("tooltip")?this.getAttribute("tooltip"):this.getAttribute("title"))!==n&&this.setAttribute("title",n):(this.hasAttribute("title")&&this.removeAttribute("title"),this.hasAttribute("tooltip")&&this.removeAttribute("tooltip"))},Xt.prototype.getTooltipInfo=function(t){return this._tooltipInfo?this._tooltipInfo[t]:null},Xt.prototype._setRawContent=function(t){if(this._rawContent!==t){this._rawContent=t;let 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();let t=this._aligner;for(;t.lastChild;)t.removeChild(t.lastChild);this._content&&t.appendChild(this._content)}}return this._content},Xt.prototype._updateDisplay=function(){let t=!1;this.isVisible()&&this._width&&this._height&&(t=!0),this._element.style.display=t?"":"none"},Xt._proto=Xt.prototype;const qt=Xt;let jt=function(){this._ends=[],this._cols=[]};jt.prototype._laneCount=0,jt.prototype._defaultSize=10,jt.prototype._defaultScalability=!0,jt.prototype._homogeneous=!0,jt.prototype._visibility=!0,jt.prototype._ends,jt.prototype._cols,jt.prototype._bits=[1,2,4,8],jt.prototype.hitTest=function(t){if(t<0)return-1;if(t>=this.getTrackSize())return~this._laneCount;let e=-1,n=0;if(this._homogeneous){let i=this._defaultSize;e=Math.floor(t/i),n=(e+1)*i}else e=ut.upperBound(this._ends,t),n=this._ends[e];return(e>=this._laneCount||t>=n)&&(e=~e),e},jt.prototype.dispose=function(){this._cols=this._ends=null},jt.prototype.isAtDefaultSize=function(t){if(this._homogeneous)return!0;if(null!=t){if(!this._isAtDefaultSize(t))return!1}else{for(let t=this._cols.length;--t>=0;)if(!this._isAtDefaultSize(t))return!1;this._homogeneous=!0}return!0},jt.prototype._isAtDefaultSize=function(t){let 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},jt.prototype.isHomogeneous=function(){return this._homogeneous},jt.prototype.isAtMinimumSize=function(t){let e=this._getMinimumScalingSize(t);return(null!=t?this.getLaneSize(t):this.getTrackSize())<=e},jt.prototype.isFixedSize=function(){for(let t=0;t<this._laneCount;++t)if(this.getLaneScalability(t))return!1;return!0},jt.prototype.clearLaneCustomizations=function(){this._ends.length=0,this._cols.length=0,this._homogeneous=!0},jt.prototype.getLaneCount=function(){return this._laneCount},jt.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))},jt.prototype.getDefaultLaneSize=function(){return this._defaultSize},jt.prototype.setDefaultLaneSize=function(t){return t<0&&(t=0),this._defaultSize!==t&&(this._defaultSize=t,this._markDirtyIndex(0),!0)},jt.prototype.getLaneDefaultSize=function(t){if(t<0||t>=this._laneCount)return-1;let e=this._newColumn(t);return e.defaultSize?e.defaultSize:-1},jt.prototype.setLaneDefaultSize=function(t,e){!(t<0||t>=this._laneCount)&&e>=0&&(this._newColumn(t).defaultSize=e)},jt.prototype.resetLaneToDefaultSize=function(){let t=!1;for(let e=0;e<this._laneCount;++e){let n=this._cols[e];n&&(n.invisibility||(null!=n.defaultSize?(t|=this.setLaneScalability(e,!1),t|=this.setLaneSize(e,n.defaultSize)):(t|=this.setLaneScalability(e,!0),t|=this.setLaneSize(e,1))))}return!!t},jt.prototype.getDefaultScalability=function(){return this._defaultScalability},jt.prototype.setDefaultScalability=function(t){return this._defaultScalability!==t&&(this._defaultScalability=t,!0)},jt.prototype.getTrackSize=function(){return!this._visibility||this._laneCount<=0?0:this._homogeneous?this._laneCount*this._defaultSize:(this._updateEndPoints(),this._ends[this._laneCount-1])},jt.prototype.setTrackSize=function(t){let e=0,n=0,i=[];for(e=0;e<this._laneCount;++e){let t=this._cols[e];t?t.invisibility||(!1!==this._getLaneScalability(t)?i.push(e):n+=this._getFixedSize(t)):i.push(e)}if(i.length<=0)return null;let o=this._distributeLaneSize(t-n,i),r=!1,s=[];for(e=o.length;--e>=0;){s[e]=0;let t=o[e];if(null!=t){let n=this.getLaneSize(e);this._newColumn(e),this._setCalculatedLaneSize(e,t)&&(s[e]=t-n,r=!0)}}return r?s:null},jt.prototype.getLaneStart=function(t){if(t<=0)return 0;if(this._homogeneous)return t*this._defaultSize;this._updateEndPoints();let e=t-this._laneCount,n=0;return e>0&&(t-=e,n=e*this._defaultSize),this._ends[t-1]+n},jt.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]))},jt.prototype.getLaneSize=function(t){if(this._visibility){let e=this._cols[t];return e?e.actualSize:this._defaultSize}return 0},jt.prototype.getCustomLaneSize=function(t){let e=this._cols[t];return e&&null!=e.customSize?e.customSize:this._defaultSize},jt.prototype.setLaneSize=function(t,e){if(t<0||t>=this._laneCount)return!1;if(e<0||e!=e)return!1;let n=this._cols[t];return(null==n||n.customSize!==e)&&(n=this._newColumn(t),n.customSize=e,this._setCalculatedLaneSize(t,e))},jt.prototype.setLaneProperty=function(t,e,n){if(t<0||t>=this._laneCount)return!1;let i=this._cols[t];return(null==i||i[e]!==n)&&(i=this._newColumn(t),i[e]=n,!0)},jt.prototype.getLaneProperty=function(t,e){let n=this._cols[t];return n&&null!=n[e]?n[e]:null},jt.prototype.getMinimumLaneSize=function(t){let e=this._cols[t];return e&&null!=e.minSize?e.minSize:0},jt.prototype.setMinimumLaneSize=function(t,e,n){if(t<0||t>=this._laneCount)return!1;if(e<0&&(e=0),this.getMinimumLaneSize(t)!==e){let i=this._newColumn(t);return i.minSize=e,n&&this.getLaneScalability(t)&&(i.customSize=e),this._setCalculatedLaneSize(t)}return!1},jt.prototype.isLaneVisible=function(t){let e=this._cols[t];return!e||!e.invisibility},jt.prototype.showLane=function(t,e){return this.hideLane(t,!1===e)},jt.prototype.hideLane=function(t,e,n){if(t<0||t>=this._laneCount)return!1;let i=this._newColumn(t),o=!i.invisibility,r=null!=n?this._bits[n]:1;return!1!==e?i.invisibility|=r:i.invisibility&=~r,o!==!i.invisibility&&this._setCalculatedLaneSize(t)},jt.prototype.getLaneVisibilityBit=function(t,e){if(t>=0&&t<this._laneCount){let n=this._cols[t];if(n){let t=null!=e?this._bits[e]:1;if(n.invisibility&t)return!1}}return!0},jt.prototype.show=function(t){if(t=!1!==t,this._visibility!==t)if(this._visibility=t,t)for(let t=0;t<this._laneCount;++t)this._newColumn(t),this._setCalculatedLaneSize(t);else this._markDirtyIndex(0)},jt.prototype.getLaneScalability=function(t){let e=this._cols[t];return e&&null!=e.scalability?e.scalability:this._defaultScalability},jt.prototype.setLaneScalability=function(t,e){if(t<0||t>=this._laneCount)return!1;let n=this._cols[t];return!(n&&n.scalability===e||(n=this._newColumn(t),n.scalability=e,0))},jt.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);let n=this.serializeLane(t);return this._cols.splice(t,e),this._laneCount-=e,n},jt.prototype.insertLane=function(t,e){t<0&&(t=0);let n=1;if(ut.isNumber(e)){if(e<=0)return;n=e,e=null}if(t>=this._laneCount&&(t=this._laneCount,!e))this.setLaneCount(this._laneCount+n);else if(this._laneCount+=n,this._markDirtyIndex(t),ut.insertEmptyItems(this._cols,t,n),e){let i=t+n;for(let n=t;n<i;++n)this.deserializeLane(n,e)}},jt.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)return;let n=t<e?t:e;this._markDirtyIndex(n),ut.moveArrayItem(this._cols,t,e)},jt.prototype.serializeLane=function(t){if(t<0||t>=this._laneCount)return null;let e={};e.index=t;let n=this._cols[t];return n?(e.size=n.customSize,e.minSize=n.minSize,e.visible=!n.invisibility,e.scalable=n.scalability,e):e},jt.prototype.deserializeLane=function(t,e){if(!e)return;if(t<0||t>=this._laneCount)return;let n=e.size;null!=n&&this.setLaneSize(t,n),n=e.minSize,null!=n&&this.setMinimumLaneSize(t,n),n=e.visible,null!=n&&this.showLane(t,n),n=e.scalable,null!=n&&this.setLaneScalability(t,n)},jt.prototype._updateEndPoints=function(){let t=this._ends.length;if(t>=this._laneCount)return;this._ends.length=this._laneCount;let e=0,n=t>0?this._ends[t-1]:0;for(e=t;e<this._laneCount;++e)n+=this.getLaneSize(e),this._ends[e]=n},jt.prototype._setCalculatedLaneSize=function(t,e){let n=this._cols[t];if(this._visibility&&!n.invisibility){if(null==e&&(e=null!=n.customSize?n.customSize:this._defaultSize),!n.scalability){let t=null!=n.minSize?n.minSize:0;e<t&&(e=t)}}else e=0;return n.actualSize!==e&&(n.actualSize=e,this._homogeneous=!1,this._markDirtyIndex(t),!0)},jt.prototype._getMinimumScalingSize=function(t){let e=0;if(null!=t){let e=this._cols[t];if(!e.invisibility&&null!=e.minSize)return!1===this._getLaneScalability(e)&&null!=e.customSize&&e.customSize>e.minSize?e.customSize:e.minSize}else for(let t=this._laneCount;--t>=0;)e+=this._getMinimumScalingSize(t);return e},jt.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},jt.prototype._getLaneScalability=function(t){return null==t.scalability?this._defaultScalability:t.scalability},jt.prototype._distributeLaneSize=function(t,e){if(e.length<=0)return[];t<0&&(t=0);let n=0,i=0,o=0,r=0,s=[],l=[],a=[];for(n=e.length;--n>=0;)o=e[n],s[o]=this.getMinimumLaneSize(o),l[o]=this.getCustomLaneSize(o),i+=l[o];let u=!0;for(;u;)for(u=!1,n=e.length;--n>=0;){o=e[n];let h=s[o],p=l[o];r=t*p/i,r<=h&&(u=!0,a[o]=h,t-=h,i-=p,e.splice(n,1))}let h=e.length-1,p=0,d=0;for(n=h;--n>=0;){o=e[n],r=t*l[o]/i;let s=Math.floor(r);d+=r-s,d>=1&&(++s,--d),a[o]=s,p+=s}return a[e[h]]=Math.floor(t-p),a},jt.prototype._markDirtyIndex=function(t){t<this._ends.length&&(this._ends.length=t)},jt.prototype._newColumn=function(t){let e=this._cols[t];return e||(this._cols[t]=e={},e.invisibility=0),e},jt.prototype.copyFrom=function(t,e){if(this._homogeneous&&t._homogeneous&&this._defaultSize===t._defaultSize)return;e||(e=0);let n=t.getLaneCount(),i=this.getLaneCount(),o=e+n;o>i&&(o=i);let r=0;for(let n=e;n<o;++n){let e=t.getLaneSize(r++),i=this._newColumn(n);i.customSize!==e&&(i.customSize=e,i.actualSize!==e&&(i.actualSize=e,this._homogeneous=!1,this._markDirtyIndex(n)))}};const Kt=jt;let Jt=function(){};Jt.prototype.hitTest=function(t,e,n){},Jt.prototype.hitTestX=function(t){},Jt.prototype.hitTestY=function(t){},Jt.prototype.getDefaultColumnWidth=function(){},Jt.prototype.setDefaultColumnWidth=function(t){},Jt.prototype.getDefaultRowHeight=function(){},Jt.prototype.setDefaultRowHeight=function(t){},Jt.prototype.getColumnWidth=function(t){},Jt.prototype.setColumnWidth=function(t,e){},Jt.prototype.getRowHeight=function(t){},Jt.prototype.setRowHeight=function(t,e){},Jt.prototype.isColumnVisible=function(t){},Jt.prototype.hideColumn=function(t,e){},Jt.prototype.isRowVisible=function(t){},Jt.prototype.hideRow=function(t,e){},Jt.prototype.getMinimumColumnWidth=function(t){},Jt.prototype.setMinimumColumnWidth=function(t,e){},Jt.prototype.getMinimumRowHeight=function(t){},Jt.prototype.setMinimumRowHeight=function(t,e){},Jt.prototype.getCellLeft=function(t){},Jt.prototype.getCellTop=function(t){},Jt.prototype.getCellWidth=function(t,e){},Jt.prototype.getCellHeight=function(t,e){},Jt.prototype.hasCellSpan=function(){},Jt.prototype.getCellRowSpan=function(t,e){},Jt.prototype.setCellRowSpan=function(t,e,n){},Jt.prototype.getCellColSpan=function(t,e){},Jt.prototype.setCellColSpan=function(t,e,n){},Jt.prototype.clearCellSpans=function(){},Jt.prototype.clearColumnSpans=function(t){},Jt.prototype.clearColumnCustomizations=function(){},Jt.prototype.clearRowCustomizations=function(){},Jt.prototype.getColumnScalability=function(t){},Jt.prototype.setColumnScalability=function(t,e){},Jt.prototype.getRowScalability=function(t){},Jt.prototype.setRowScalability=function(t,e){},Jt.prototype.getCell=function(t,e,n){},Jt.prototype.getCellContent=function(t,e){},Jt.prototype.setCellContent=function(t,e,n){},Jt.prototype.getColumn=function(t){},Jt.prototype.getColumnCount=function(){},Jt.prototype.setColumnCount=function(t){},Jt.prototype.getRowCount=function(){},Jt.prototype.setRowCount=function(t,e){},Jt.prototype.getVisibleRowCount=function(){},Jt.prototype.addRow=function(t){},Jt.prototype.removeRow=function(t){},Jt.prototype.setBorders=function(t,e,n,i){},Jt.prototype.getColumnStyle=function(t,e){},Jt.prototype.setColumnStyle=function(t,e,n){},Jt.prototype.enableColumnClass=function(t,e,n){},Jt.prototype.hasColumnClass=function(t,e){},Jt.prototype.enableRowClass=function(t,e,n){},Jt.prototype.setRowStyle=function(t,e,n,i){},Jt.prototype.getRelativePosition=function(t){},Jt.prototype.getContentWidth=function(){},Jt.prototype.getContentHeight=function(){},Jt.prototype.getCellsByRowIndex=function(t){},Jt.prototype.disableHorizontalGridLine=function(t){},Jt.prototype.disableVerticalGridLine=function(t){},Jt.prototype.enableShading=function(t){},Jt.prototype.setTransposedShading=function(t){},Jt.prototype.enableRowHighlighting=function(t){},Jt.prototype.getRowHighlight=function(){},Jt.prototype.setRowHighlight=function(t){},Jt.prototype.getSelectedRows=function(){},Jt.prototype.getSelectedRowCount=function(){},Jt.prototype.isSelectedRow=function(t){},Jt.prototype.getRowAnchor=function(){},Jt.prototype.setRowAnchor=function(t){},Jt.prototype.setSelectedRow=function(t,e){},Jt.prototype.selectSingleRow=function(t){},Jt.prototype.selectRowRange=function(t,e){},Jt.prototype.clearSelectedRows=function(){},Jt.prototype.getFirstSelectedRow=function(){},Jt.prototype.getLastSelectedRow=function(){},Jt.prototype.activateColumn=function(t,e){},Jt.prototype.activateRows=function(t,e,n){},Jt.prototype.moveRowsToTop=function(t){},Jt.prototype.getFirstIndexInView=function(){},Jt.prototype.getLastIndexInView=function(){},Jt.prototype.isInCurrentView=function(t){},Jt.prototype.getFrozenLayout=function(){},Jt.prototype.setFrozenLayout=function(t){},Jt.prototype.insertColumn=function(t,e){},Jt.prototype.removeColumnAt=function(t){},Jt.prototype.moveColumn=function(t,e){},Jt.prototype.enableRowVirtualization=function(t){},Jt.prototype.enableColumnVirtualization=function(t){},Jt.prototype.getColumnIndex=function(t){},Jt.prototype.getCellIndex=function(t,e){},Jt.prototype.getIndex=function(){},Jt.prototype.setIndex=function(t){},Jt.prototype.getRowOffset=function(){},Jt.prototype.setRowOffset=function(t){},Jt.prototype.updateLayout=function(){},Jt.prototype.stretchCell=function(t,e,n,i){},Jt.prototype.unstretchCell=function(t,e){},Jt.prototype.unstretchAllCells=function(){},Jt.prototype.getStretchedCell=function(t,e){},Jt.prototype.getStretchedCells=function(){},Jt.prototype.updateStretchedCells=function(){},Jt.prototype.getColumnHost=function(){},Jt.prototype.setHidingMethod=function(t){},Jt.prototype.getHidingMethod=function(){},Jt.prototype.setColumnVisibility=function(t,e,n){},Jt.prototype.getRowLayout=function(){},Jt.prototype.reserveRightSpace=function(t){},Jt.prototype.getReservedSpace=function(){},Jt.prototype.getComputedStyle=function(){},Jt.prototype.isColumnActive=function(t){},Jt.prototype.setRowAttributes=function(t,e){},Jt.prototype.getContextRow=function(t){},Jt.prototype.selectColumn=function(t,e){},Jt.prototype.isSelectedColumn=function(t){},Jt.prototype.selectCell=function(t,e,n){},Jt.prototype.setCellBounds=function(t,e,n,i){},Jt.prototype.getHorizontalLayout=function(){},Jt.prototype.calculateColumnBounds=function(t,e,n,i){},Jt.prototype.updateColumnBounds=function(t,e,n){},Jt.prototype.updateColumnSeparators=function(){};let Qt=function(t){(this._element=document.createElement("div")).className="column",this._cells=[],this._section=t};o.inherits(Qt,Wt),Qt.prototype._nextSibling=null,Qt.prototype._parent=null,Qt.prototype._section=null,Qt.prototype._cells=null,Qt.prototype._cellStart=0,Qt.prototype._cellEnd=0,Qt.prototype._autoStyleUpdating=!1,Qt.prototype._deactivation=!1,Qt.prototype._sizeClasses=null,Qt.prototype._colLeft=0,Qt.prototype._absolute=!1,Qt.prototype._scrollFrame=null,Qt.prototype._invisibility=0,Qt.prototype._bits=[1,2,4,8],Qt.prototype._pinned=!0,Qt.prototype.clearContent=function(){for(let t=this._cells.length;--t>=0;)this._cells[t].setContent(null)},Qt.prototype.setLeft=function(t){return this._colLeft=t,this._absolute&&(this._element.style.left=t+"px"),!0},Qt.prototype.enableAbsolutePosition=function(t){(t=!1!==t)!==this._absolute&&(this._absolute=t,this._element.style.left=t?this._colLeft+"px":"")},Qt.prototype.dispose=function(){this._dispose();for(let t=this._cells.length;--t>=0;)this._cells[t].dispose();this._scrollFrame=this._nextSibling=this._parent=this._cells=this._section=null},Qt.prototype.setStyle=function(t,e){let n=this._element;n.style[t]=e,n.style.backgroundColor?n.classList.contains("no-shading")||n.classList.add("no-shading"):n.classList.contains("no-shading")&&n.classList.remove("no-shading")},Qt.prototype.setStyles=function(t){let e=this._element,n=e.style;for(let e in t)n[e]=t[e];e.style.backgroundColor?e.classList.contains("no-shading")||e.classList.add("no-shading"):e.classList.contains("no-shading")&&e.classList.remove("no-shading")},Qt.prototype.show=function(t){this.setVisibility(0,!1!==t)},Qt.prototype.setWidth=function(t){this._element.style.width=t+"px";let e,n=0;t>0&&t<=24?n=3:t>24&&t<=40?n=2:t>40&&t<60&&(n=1);let i=this._sizeClasses;if(i){if(i.length>n){for(e=i.length;--e>=n;)this.removeClass(i[e]);i.length=n}n||(this._sizeClasses=null)}if(n)for(i||(i=[],this._sizeClasses=i),e=i.length;e<n;++e)i[e]=Qt._sizeClasses[e],this.addClass(i[e]);return this.setVisibility(1,t>0),!0},Qt._sizeClasses=["small-col","very-small-col","tiny-col"],Qt.prototype.setHeight=function(t){return this._element.style.height=t+"px",this.setVisibility(2,t>0),!0},Qt.prototype.getParent=function(){return this._parent},Qt.prototype.setParent=function(t,e){if(!this._element)return;this._parent=ut.getElement(t);let n=this._section?this._section.getHidingMethod():"";this._invisibility&&!n||this._setParent(this._parent,e)},Qt.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())},Qt.prototype.enableAutoStyleUpdating=function(t){t=!1!==t,this._autoStyleUpdating!==t&&(this._autoStyleUpdating=t)},Qt.prototype.setNextSibling=function(t){this._nextSibling=t},Qt.prototype.isActive=function(){return!(this._invisibility&this._bits[3])},Qt.prototype.disableDeactivation=function(t){this._deactivation=!1!==t,this._deactivation&&(this.isActive()||this.activate())},Qt.prototype.activate=function(t){return t=this._pinned||this._deactivation||!1!==t,this.isActive()!==t&&(this.setVisibility(3,t),!0)},Qt.prototype.deactivate=function(t){this.activate(!1===t)},Qt.prototype.setCellCount=function(t){let e;for(e=this._cells.length;e<t;++e)this._cells.push(new qt(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)},Qt.prototype.getCell=function(t){return this._cells[t]||null},Qt.prototype.collapseCells=function(t,e,n,i,o){if(e<=0)return;let r=!1,s=this._cells[t];s&&!i&&(r|=s.collapse(n,o));for(let i=1;i<e&&(s=this._cells[t+i],s);++i)r|=s.collapse(n,o);r&&(n?e>1&&(this._hasCollapsedCells=!0):this.updateCellOrders())},Qt.prototype.uncollapseAllCells=ut._deprecatedFunction,Qt.prototype.activateCells=function(t,e){let n,i=this._element;if(this._hasCollapsedCells)t=this._cellEnd,e>this._cellEnd&&(this._cellEnd=e);else if(this._cellStart===t){let i=this._cellEnd-e;if(i>0){for(n=this._cellEnd;--n>=e;)this._cells[n].removeParent();return void(this._cellEnd=e)}if(!(i<0))return;t=this._cellEnd,this._cellEnd=e}else{for(n=this._cellEnd;--n>=this._cellStart;)this._cells[n].removeParent();this._cellStart=t,this._cellEnd=e}for(n=t;n<e;++n){let t=this._cells[n];t.isKeptInDoc()&&(t.initialize(),i.appendChild(t.getElement()))}},Qt.prototype.moveCellsToTop=function(t){if(!this.isActive())return;let e=this._element;for(let n=0;n<t;++n){let t=this._cells[n];t.isKeptInDoc()&&e.appendChild(t.getElement())}this._cells=ut.cycleArray(this._cells,t)},Qt.prototype.updateCellOrders=function(){this._hasCollapsedCells=!1;let t=this._element;for(let e=this._cellStart;e<this._cellEnd;++e){let n=this._cells[e];n.isKeptInDoc()?t.appendChild(n.getElement()):this._hasCollapsedCells=!0}},Qt.prototype.hasCollapsedCells=function(){return this._hasCollapsedCells},Qt.prototype.getCellIndex=function(t){if(!t)return-1;for(let e=this._cellStart;e<this._cellEnd;++e)if(this._cells[e].getElement()===t)return e;return-1},Qt.prototype.getSection=function(){return this._section},Qt.prototype.log=function(){let t=[],e=this._cells.length;for(let n=0;n<e;++n)t.push(this._cells[n].getTextContent());return t},Qt.prototype.getVisibility=function(){return!this._invisibility},Qt.prototype.setVisibility=function(t,e){let n=!this._invisibility,i=this._bits[t]||1;e?this._invisibility&=~i:this._invisibility|=i;let o=!this._invisibility;if(n!==o)if(this._section&&this._section.getHidingMethod())this.enableClass("hidden",!o);else if(o){let t=this._parent;if(!t)return;let e=this._nextSibling;for(;e;){if(e._parent!==t){e=null;break}if(!e._invisibility)break;e=e._nextSibling}this.insertBefore(e)}else this._setParent(null)},Qt.prototype.updateLayout=function(){},Qt.prototype.setScrollState=function(t,e,n){this._scrollFrame=t,this.enableAbsolutePosition(n),this.setParent(e||this._section.getColumnHost()),e||this.activate(),this._pinned=!e},Qt._proto=Qt.prototype;const Zt=Qt;let $t=function(){this._items=[]};$t.prototype._items=null,$t.prototype.dispose=function(){this._items=null},$t.prototype.setItemCount=function(t){let e=this._items,n=e.length;if(n!==t)for(e.length=t;n<t;)e[n++]={}},$t.prototype.getItem=function(t){return this._items[t]||null},$t.prototype.moveItemsToTop=function(t){this._items=ut.cycleArray(this._items,t)};const te=$t;let ee=function(t,e,n){t.setTop(e.getLaneStart(n)),t.setHeight(e.getLaneSize(n))},ne=function(t,e,n,i){if(n){let o=e.getLaneStart(n);t.setLeft(o),t.setWidth(i-o)}else t.setStyle("left",""),t.setWidth(i)},ie=function(t,e,n){this._trackX=t,this._trackY=e,this._section=n,this._cells=[]};ie.prototype._trackX,ie.prototype._trackY,ie.prototype._section,ie.prototype._cells,ie.prototype._activeCount=0,ie.prototype._stretchSize=0,ie.prototype.dispose=function(){let t=this._cells;if(this._activeCount){this._activeCount=0;for(let e=t.length;--e>=0;){let n=t[e];n&&n.dispose()}}t.length=0},ie.prototype.setStretchSize=function(t){this._stretchSize=t},ie.prototype.getStretchSize=function(){return this._stretchSize},ie.prototype.setCellCount=function(t){let e=this._cells,n=e.length;if(n<t)for(e.length=t;n<t;)e[n++]=null;else if(n>t){for(;--n>=t;){let t=e[n];t&&t.dispose()}e.length=t}},ie.prototype.getCell=function(t){let e=this._cells[t];return e&&e.getParent()?e:null},ie.prototype.getCells=function(){let t=[];if(this._activeCount){let e=this._cells,n=e.length;for(let i=0;i<n;++i){let n=e[i];n&&n.getParent()&&t.push(n)}this._activeCount=t.length}return t},ie.prototype.getColumnIndex=function(t){if(t){if(!t.getElement)return null!=t._colIndex?t._colIndex:-1;{let e=t.getElement();if(e)return null!=e._colIndex?e._colIndex:-1}}return-1},ie.prototype.getRowIndex=function(t){if(t){if(t.getElement)return t.getParent()?this._cells.indexOf(t):-1;{let e=this._cells,n=e.length;for(let i=0;i<n;++i){let n=e[i];if(n&&n.getParent()&&n.getElement()===t)return i}}}return-1},ie.prototype.stretchCell=function(t,e){++this._activeCount,(!e||e<0)&&(e=0);let n=this._cells[t]||null;n||(n=new qt(null,this._section),n.addClass("tr-stretched"),n.stretched=!0,this._cells[t]=n);let i=n.getElement();i.stretched=!0,i._colIndex!==e&&(i._colIndex=e,e>0?i.classList.add("right-stretching"):i.classList.remove("right-stretching")),i._rowIndex!==t&&(i._rowIndex=t);let o=this._stretchSize||this._trackX.getTrackSize();return ne(n,this._trackX,e,o),ee(n,this._trackY,t),n},ie.prototype.unstretchCell=function(t){let e=this._cells[t]||null;return e&&e.setParent(null),e},ie.prototype.unstretchAllCells=function(){if(this._activeCount){this._activeCount=0;let t=this._cells;for(let e=t.length;--e>=0;){let n=t[e];n&&n.setParent(null)}}},ie.prototype.updateCells=function(){if(this._activeCount){let t=0,e=this._cells,n=e.length,i=this._trackX,o=this._trackY,r=this._stretchSize||i.getTrackSize();for(let s=0;s<n;++s){let n=e[s];n&&n.getParent()&&(++t,ne(n,i,n.getElement()._colIndex,r),ee(n,o,s))}this._activeCount=t}},ie.prototype.updateXAxis=function(){if(this._activeCount){let t=0,e=this._cells,n=e.length,i=this._trackX,o=this._stretchSize||i.getTrackSize();for(let r=0;r<n;++r){let n=e[r];n&&n.getParent()&&(++t,ne(n,i,n.getElement()._colIndex,o))}this._activeCount=t}},ie.prototype.updateYAxis=function(){if(this._activeCount){let t=0,e=this._cells,n=e.length,i=this._trackY;for(let o=0;o<n;++o){let n=e[o];n&&n.getParent()&&(++t,ee(n,i,o))}this._activeCount=t}},ie.prototype.moveCellsToTop=function(t){this._activeCount&&(this._cells=ut.cycleArray(this._cells,t),this.updateYAxis())};const oe=ie;let re=function(t,e){this.indexX=t,this.indexY=e};re.prototype.isSpanIndices=function(t,e){return t===this.indexX&&e===this.indexY},re.prototype.isOccupiedIndices=function(t,e){return t!==this.indexX||e!==this.indexY},re.prototype.register=function(t,e){this._register(t,e,!0)},re.prototype.unregister=function(t,e){this._register(t,e,!1)},re.prototype._register=function(t,e,n){let i=t.indexOf(this);n?i<0&&t.push(this):i>=0&&t.splice(i,1);let o=n?this:null,r=this.indexX+this.colSpan,s=this.indexY+this.rowSpan;for(let t=this.indexX;t<r;++t)for(let n=this.indexY;n<s;++n)e[t+","+n]=o},re.prototype.indexX,re.prototype.indexY,re.prototype.colSpan=1,re.prototype.rowSpan=1,re.prototype.prevColSpan=1,re.prototype.prevRowSpan=1,re.prototype.retVal=0;const se=re;let le=function(){this._spans=[],this._occupiedMap={}};le.prototype.removeColumn=function(t){let e=!1;return this.removeSpanByColIndex(t)&&(e=!0),this.shiftColumn(t,-1)&&(e=!0),e},le.prototype.freezeMapping=function(t){this._frozenMapping=!1!==t,this._frozenMapping||this._mapCellSpans()},le.prototype._mapCellSpans=function(){let t,e,n=this._spans;for(this._spans=[],this._occupiedMap={},t=n.length;--t>=0;)e=n[t],e.indexX>=0&&e.register(this._spans,this._occupiedMap)},le.prototype.shiftColumn=function(t,e){if(this._spans.length<=0||0===e)return!1;let n=!1;for(let i=this._spans.length;--i>=0;){let o=this._spans[i];o.indexX>=t&&(n=!0,o.indexX+=e)}return!(!n||this._frozenMapping||(this._mapCellSpans(),0))},le.prototype.removeSpan=function(t,e){if(this._spans.length<=0)return null;let n=t+","+e,i=this._occupiedMap[n];return!i||i.isOccupiedIndices(t,e)?null:(i.unregister(this._spans,this._occupiedMap),i)},le.prototype.removeSpanByColIndex=function(t,e){let n,i=this._spans.length;if(i<=0)return null;let o,r=e||[],s=0;for(o=0;o<i;++o)n=this._spans[o],n&&n.indexX===t&&(r.push(n),s++);if(s<=0)return null;for(i=r.length,o=0;o<s;++o)r[i-o-1].unregister(this._spans,this._occupiedMap);return r},le.prototype.removeSpanStartedFromRowIndex=function(t,e){let n,i=this._spans.length;if(i<=0)return null;let o,r=e||[],s=0;for(o=0;o<i;++o)n=this._spans[o],n&&n.indexY>=t&&(r.push(n),s++);if(s<=0)return null;for(i=r.length,o=0;o<s;++o)r[i-o-1].unregister(this._spans,this._occupiedMap);return r},le.prototype.clearAllSpans=function(){if(this._spans.length<=0)return null;let t=this._spans;return this._spans=[],this._occupiedMap={},t},le.prototype.hasSpan=function(){return this._spans.length>0},le.prototype.getSpan=function(t,e){let n=this.getOccupyingSpan(t,e);return n&&n.isSpanIndices(t,e)?n:null},le.prototype.getOccupyingSpan=function(t,e){return this._spans.length<=0?null:this._occupiedMap[t+","+e]||null},le.prototype.getAllSpans=function(){return this._spans},le.prototype.getColSpan=function(t,e){let n=this._occupiedMap[t+","+e];return null==n?1:n.isOccupiedIndices(t,e)?n.indexX-t:n.colSpan},le.prototype.getRowSpan=function(t,e){let n=this._occupiedMap[t+","+e];return null==n?1:n.isOccupiedIndices(t,e)?n.indexY-e:n.rowSpan},le.prototype.setColSpan=function(t,e,n){return this._updateSpan(t,e,!0,n)},le.prototype.setRowSpan=function(t,e,n){return this._updateSpan(t,e,!1,n)},le.prototype._updateSpan=function(t,e,n,i){i<1&&(i=1);let o=this.getSpan(t,e);o&&(o.retVal=0);let r,s,l,a,u,h,p=t,d=e,c=o?o.colSpan:1,_=o?o.rowSpan:1,f=!0;if(n){if(c===i)return o;if(c>i)p=t+i,r=t+c,f=!1;else{if(l=this._occupiedMap[t+","+e],l&&l!==o)return o;p=t+c,r=t+i}s=e+_}else{if(_===i)return o;if(_>i)d=e+i,s=e+_,f=!1;else{if(l=this._occupiedMap[t+","+e],l&&l!==o)return o;d=e+_,s=e+i}r=t+c}if(f){let n=[];for(u=p;u<r;++u)for(h=d;h<s;++h){if(a=u+","+h,this._occupiedMap[a])return o;n.push(a)}for(null==o&&(o=new se(t,e),a=t+","+e,this._spans.push(o),this._occupiedMap[a]=o),u=n.length;--u>=0;)this._occupiedMap[n[u]]=o}else{if(n?i+_<=2:i+c<=2){a=t+","+e;let n=this._spans.indexOf(o);this._spans.splice(n,1),this._occupiedMap[a]=null}for(u=p;u<r;++u)for(h=d;h<s;++h)this._occupiedMap[u+","+h]=null}return n?(o.prevColSpan=o.colSpan,o.colSpan=i):(o.prevRowSpan=o.rowSpan,o.rowSpan=i),o.retVal=f?1:-1,o},le.prototype._spans,le.prototype._occupiedMap,le.prototype._frozenMapping=!1;const ae=le;let ue=function(){this._selections=[]};ue.prototype.clone=function(){let t=new ue;return t._selections=this._selections.concat(),t._count=this._count,t._anchor=this._anchor,t._firstIndex=this._firstIndex,t._lastIndex=this._lastIndex,t},ue.prototype.toString=function(){return this._selections.join(", ")},ue.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))},ue.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)},ue.prototype.deselectFrom=function(t){if(this._lastIndex<t)return!1;if(this._firstIndex>=t)return this.clearAllSelections(),!0;let e=this._lastIndex,n=this._selections;for(let i=t;i<=e;++i)n[i]&&(n[t]=!1,--this._count);return this._anchor>=t&&(this._anchor=-1),this._lastIndex=this._findPrevSelection(t),!0},ue.prototype.toggleSelection=function(t){this._selections[t]?this.deselect(t):this.select(t)},ue.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)},ue.prototype.selectRange=function(t,e){if(0===e)return;if(t<0&&(t=0),1===e||-1===e)return void this.select(t);let n=t,i=n+e;if(e<0&&(i=n+1,n=i+e),!(n>=i)){this._anchor=t,(this._firstIndex<0||n<this._firstIndex)&&(this._firstIndex=n),(this._lastIndex<0||i>=this._lastIndex)&&(this._lastIndex=i-1);for(let t=n;t<i;++t)this._select(t)}},ue.prototype.deselectRange=function(t,e){if(this._count<=0)return;if(t<0&&(t=0),1===e||-1===e)return void this.deselect(t);let n=t+e;if(e<0&&(n=t+1,t=n+e),this._firstIndex>=t&&this._lastIndex<n)return void this.clearAllSelections();this._anchor>=t&&this._anchor<n&&(this._anchor=-1),this._firstIndex>=t&&this._firstIndex<n&&(this._firstIndex=this._findNextSelection(n-1)),this._lastIndex>=t&&this._lastIndex<n&&(this._lastIndex=this._findPrevSelection(t));let i=0;for(i=t;i<n;++i)this._selections[i]&&(this._selections[i]=!1,--this._count)},ue.prototype.hasSelection=function(t,e){if(this._count<=0)return!1;let n=t+e;if(e<0&&(n=t+1,t=n+e),n<this._firstIndex||t>this._lastIndex)return!1;for(let e=t;e<n;++e)if(this._selections[e])return!0;return!1},ue.prototype.getSelection=function(t){return!0===this._selections[t]},ue.prototype.setSelection=function(t,e){return!1!==e?this.select(t):this.deselect(t)},ue.prototype.getSelectionAnchor=function(){return this._anchor},ue.prototype.setSelectionAnchor=function(t){this._anchor=t},ue.prototype.getSelectionCount=function(){return this._count},ue.prototype.getFirstSelectedIndex=function(){return this._firstIndex},ue.prototype.getLastSelectedIndex=function(){return this._lastIndex},ue.prototype.getAllSelections=function(){if(this._count>0){let t=new Array(this._count),e=0,n=this._selections,i=this._lastIndex;for(let o=this._firstIndex;o<=i;++o)n[o]&&(t[e++]=o);return t}return[]},ue.prototype.getConnectedRanges=function(t,e){if(this._count>0){let n=[];(null==t||t<this._firstIndex)&&(t=this._firstIndex),(null==e||e>this._lastIndex)&&(e=this._lastIndex+1);let i=null;for(let o=t;o<e;++o)this._selections[o]?i||(i=[o,-1]):i&&(i[1]=o-1,n.push(i),i=null);return i&&(i[1]=this._lastIndex,n.push(i),i=null),n}return[]},ue.prototype.getSelectionMap=function(){return this._selections},ue.prototype.clearAllSelections=function(){if(this._count>0){let t=0;return this._selections.length=0,this._count=0,this._anchor=-1,this._firstIndex=-1,this._lastIndex=-1,t}return 0},ue.prototype.copyFrom=function(t,e,n,i){if(i<=0)return;let o=e+n;if(null!=t)if(!1!==t.hasSelection(e,i)){for(let n=0;n<i;++n)t._selections[e+n]?this.select(o+n):this.deselect(o+n);this._anchor=-1,t._anchor>=0&&t._anchor>=e&&t._anchor<e+i&&(this._anchor=t._anchor+n)}else this.deselectRange(o,i);else this.deselectRange(o,i)},ue.prototype._select=function(t){return!this._selections[t]&&(this._selections[t]=!0,++this._count,!0)},ue.prototype._findNextSelection=function(t){if(this._lastIndex>=0)for(;++t<=this._lastIndex;)if(this._selections[t])return t;return-1},ue.prototype._findPrevSelection=function(t){if(this._firstIndex>=0)for(;--t>=this._firstIndex;)if(this._selections[t])return t;return-1},ue.prototype._selections=null,ue.prototype._count=0,ue.prototype._anchor=-1,ue.prototype._firstIndex=-1,ue.prototype._lastIndex=-1;const he=ue;let pe=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)};pe.prototype._func=null,pe.prototype._delay=0,pe.prototype._timerId=0,pe.prototype._pending=!1,pe.prototype.start=function(){this._func&&(this._timerId?this._pending=!0:this._timerId=setInterval(this._onInterval,this._delay))},pe.prototype.dispose=function(){this._timerId&&(clearInterval(this._timerId),this._timerId=0),this._func=null},pe.prototype._onInterval=function(){this._pending?this._pending=!1:(this._func(),clearInterval(this._timerId),this._timerId=0)},pe._proto=pe.prototype;const de=pe;let ce=function(){let 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 de(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"),ce._queryNativeTrackThickness(t._onThicknessChanged),t._updateEffectiveArea()||t.listen("thicknessChanged",t._updateEffectiveArea)};o.inherits(ce,Wt),ce.prototype._vertical=!0,ce.prototype._step=0,ce.prototype._parentNode=null,ce.prototype._hostClassName="",ce.prototype._trackContent=null,ce.prototype._panes=null,ce.prototype._paneSliders=null,ce.prototype._enabled=!0,ce.prototype._active=!1,ce.prototype._isFrozen=!1,ce.prototype._otherScrollbar=null,ce.prototype._autoHideScrollbar=!0,ce.prototype._trackSize=120,ce.prototype._tContentSize=0,ce.prototype._tScrollVal=0,ce.prototype._tPercentVal=0,ce.prototype._paneSize=0,ce.prototype._pContentSize=0,ce.prototype._pScrollVal=0,ce.prototype._footerCount=0,ce.prototype._fadingId=0,ce.prototype._postponeFading=!1,ce.prototype._layoutChanged=!1,ce.prototype._contentDirty=!0,ce.prototype._layoutDirty=!0,ce.prototype._touchInput=!0,ce.prototype._swiping=!1,ce.prototype._touchDrag=!1,ce.prototype._startPos,ce.prototype._endPos,ce.prototype._smoothing=!0,ce.prototype._smoothingId=0,ce.prototype._smoothingSpeed=0,ce.prototype._wheelScrolling="",ce.prototype._mouseWheelLogic=null,ce.prototype._onThicknessChanged=null,ce._trackThickness=0,ce._queryTimeout=0,ce._queryStarted=!1,ce._outerDummy=null,ce._innerDummy=null,ce._listeners=null,ce.prototype._updateEffectiveArea=function(){let t=this.getTrackThickness();if(t){let e=this._vertical?"width":"height";this._element.style[e]=t+1+"px"}return!!t},ce._queryNativeTrackThickness=function(t){if(ce._queryStarted||ce._repeatQuery(),t&&ce._trackThickness<=0){let e=ce._listeners;e||(e=ce._listeners=[]),e.push(t)}},ce._repeatQuery=function(){ce._queryStarted=!0,ce._retrieveNativeTrackThinkness()||(ce._queryTimeout+=100,ce._queryTimeout<3e3?setTimeout(ce._repeatQuery,ce._queryTimeout):(ce._trackThickness=13,ce._clearStaticResources()))},ce._retrieveNativeTrackThinkness=function(){if(ce._trackThickness>0)return!0;let t=ce._innerDummy,e=ce._outerDummy;t||(t=ce._innerDummy=document.createElement("p"),t.style.width="100%",t.style.height="200px",e=ce._outerDummy=document.createElement("div"),e.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);let n=t.offsetWidth;e.style.overflow="scroll";let i=t.offsetWidth;return n==i&&(i=e.clientWidth),document.body.removeChild(e),(ce._trackThickness=n-i)>0&&(ce._clearStaticResources(),!0)},ce._clearStaticResources=function(){ce._innerDummy=ce._outerDummy=null;let t=ce._listeners;if(t){ce._listeners=null;let e={};for(let n=t.length;--n>=0;)t[n](e)}},ce.updateTrackThickness=function(){ce._trackThickness=0,ce._queryTimeout=0,ce._queryStarted=!1,ce._queryNativeTrackThickness()},ce.prototype.dispose=function(){let t=ce._listeners;if(t){let 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(let t=this._panes.length;--t>=0;)this._panes[t].dispose(),this._paneSliders[t].dispose();this._reverter.dispose()},ce.prototype.getContent=function(t){return this._paneSliders[0].getContent(t)},ce.prototype.getParent=function(){return this._parentNode},ce.prototype.setParent=function(t,e){let n=ut.getElement(t),i=this._parentNode!==n;i&&this._parentNode&&(this.removeWheelListener(this._parentNode),this._parentNode.classList.remove(this._hostClassName)),this.isActive()?(this._setParent(n,e),this._parentNode=this._element.parentNode,this._parentNode&&this._parentNode.classList.add(this._hostClassName)):this._parentNode=n,i&&this.addWheelListener(this._parentNode)},ce.prototype.attachToExternalElement=function(t){this.setParent(t);let 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"},ce.prototype._onActiveStateChange=function(){let 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);let n=e._vertical?"height":"width";for(t=e._panes.length;--t>=0;)e._panes[t].addClass("scroll-disabled"),e._panes[t].setStyle(n,"");e._dispatch("deactivated",{})}e._vertical&&e._otherScrollbar&&e._otherScrollbar.isActive()&&e._otherScrollbar.invalidate()},ce.prototype._onEnablingStateChange=function(){let t=this;t._enabled?t._dispatch("enabled",{}):t._dispatch("disabled",{})},ce.prototype.isActive=function(){return this._active},ce.prototype.isEnabled=function(){return this._enabled},ce.prototype.enable=function(t){t=!1!==t,this._enabled!=t&&(this._enabled=t,this._updateLayout(),this._onEnablingStateChange())},ce.prototype.disable=function(t){this.enable(!1===t)},ce.prototype.getTrackSize=function(){return this._trackSize},ce.prototype.getPaneSize=function(){return this._paneSize},ce.prototype.getContentSize=function(){return this._pContentSize},ce.prototype.getTrackThickness=function(){return ce._trackThickness},ce.prototype.getScrollGap=function(){return this._pContentSize-this.getPaneSize()},ce.prototype.setTrackSize=function(t,e){this._trackSize=t>0?t:0,this._paneSize=e>0?e:0},ce.prototype.calculateContentSize=function(){return 0},ce.prototype.update=function(){if(this._contentDirty){this._contentDirty=!1;let 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)},ce.prototype.invalidate=function(t,e){this._contentDirty=!0,this._layoutDirty=!0,null!=e&&(this._pScrollVal=e),t&&this.update()},ce.prototype.invalidateContent=function(){this._contentDirty=!0},ce.prototype.isScrollPosValid=function(t){let e=t-this.getPaneSize(),n=this._pScrollVal;return 0===n||n>0&&e>0&&n<e},ce.prototype.flash=function(){this.update(),this._flash()},ce.prototype._scroll=function(t){this._scrollTo(this._pScrollVal+t)},ce.prototype._scrollTo=function(t,e){if(!this._active&&!e)return;t=this._calcProperScrollValue(t);let n=!1;this._pScrollVal!==t&&(this._pScrollVal=t,n=!0),this._setTrackScrollVal(t),n?(e&&(this._layoutChanged=!0),this._dispatchScrollEvent(null)):e&&this._dispatch("layoutChanged",{})},ce.prototype._calcProperScrollValue=function(t){if(!t||t-.5<0)return 0;if(this._tPercentVal>=1&&Math.abs(this._pScrollVal-t)<=2)return this._pScrollVal;let e=this.getScrollGap();if(e<=0)return 0;if(t+.5>=e)return e;let n=this._step;if(n){if((t=Math.round(t/n)*n)-n/2<=0)return 0;if(t+n/2>=e)return e}return Math.round(t)},ce.prototype._convertTrackToPane=function(t){t=Math.round(t);let e=this._getTrackGap();this._tPercentVal>=1&&Math.abs(this._tScrollVal-t)<=5&&(t=e),this._tScrollVal=t,this._tPercentVal=e?t/e:0;let n=this.getScrollGap();return e===n?t:this._tPercentVal*n},ce.prototype._setTrackScrollVal=function(t){let e=this._getTrackGap(),n=0;if(e>0){if(t>0){let i=this.getScrollGap();n=e===i?t:t/i*e,n=Math.round(n)}n>=e&&(n=e)}if(n!==this._tScrollVal){this._tScrollVal=n,this._tPercentVal=e?n/e:0;let t=this._element;return this._vertical?t.scrollTop=n:t.scrollLeft=n,!0}return!1},ce.prototype._getTrackGap=function(){let t=this._tContentSize-this.getTrackSize();return t>0?t:0},ce.prototype._getScrollValue=function(){return this._pScrollVal},ce.prototype._isEndOfScroll=function(){return!this._active||this._pScrollVal>=this.getScrollGap()},ce.prototype._isStartOfScroll=function(){return!this._pScrollVal},ce.prototype._isOnEdge=function(t){return t<0&&this._isStartOfScroll()||t>0&&this._isEndOfScroll()},ce.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)))},ce.prototype._clearAllPanes=function(){for(let t=this._panes.length;--t>=0;){this._panes[t].setParent(null);let e=this._paneSliders[t];e._content=e._columns=null;let n=e.getElement();for(;null!==n.firstChild;)n.removeChild(n.firstChild)}},ce.prototype.disableKeyboardInput=function(t){!1===t?(this._element.setAttribute("tabindex","-1"),this._element.addEventListener("keydown",this._onKeyDown,!1)):(this._element.removeAttribute("tabindex"),this._element.removeEventListener("keydown",this._onKeyDown,!1))},ce.prototype.disableTouchInput=function(t){this._touchInput=!1===t},ce.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))},ce.prototype.getAutoHide=function(){return this._autoHideScrollbar},ce.prototype.setOtherScrollbar=function(t){this._otherScrollbar=t},ce.prototype.setFooterCount=function(t){this._footerCount=t},ce.prototype._calcActiveState=function(){if(this._enabled&&this.getTrackSize()>20){let t=this.getPaneSize();if(t>0)return this._pContentSize-t>0}return!1},ce.prototype._updateLayout=function(){let t=this._calcActiveState();if(t!==this._active&&(this._active=t,this._onActiveStateChange()),!this._active)return;let e=this.getTrackSize(),n=this.getPaneSize();if(this._tContentSize=this._pContentSize/n*e,this._vertical)this._trackContent.style.height=this._tContentSize+"px",this._element.style.height=e+"px",this._panes[0].setHeight(n);else{this._trackContent.style.width=this._tContentSize+"px",this._element.style.width=e+"px";for(let t=this._panes.length;--t>=0;)this._panes[t].setWidth(n)}this._scrollTo(this._pScrollVal,!0)},ce.prototype.resetPaneSize=function(){let t=this._vertical?"height":"width";for(let e=this._panes.length;--e>=0;)this._panes[e].setStyle(t,"")},ce._preventVScrolling=function(t){t.currentTarget.scrollTop=0},ce._preventHScrolling=function(t){t.currentTarget.scrollLeft=0},ce.prototype._addPaneAt=function(t){null==t&&(t=this._panes.length);let e=this._panes[t];if(!e){if(e=new Wt(document.createElement("div")),e.setClass("grid-pane"),this._vertical?(e.addClass("sections"),e.listen("scroll",ce._preventVScrolling)):(e.addClass("columns"),e.listen("scroll",ce._preventHScrolling)),this._active||e.addClass("scroll-disabled"),this._paneSize&&this._active){let t=this.getPaneSize();this._vertical?e.setHeight(t):e.setWidth(t)}e.listen("touchstart",this._onTouchStart),e.listen("touchmove",this._onTouchMove),e.listen("touchend",this._onTouchEnd),e.listen("touchcancel",this._onTouchEnd);let n=new Wt(document.createElement("div"));n.setClass("grid-pane-slider"),n.setParent(e),this._panes[t]=e,this._paneSliders[t]=n}return e},ce.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))},ce.prototype._onTrackScroll=function(t){if(!this._element)return;let e=this._vertical?t.target.scrollTop:t.target.scrollLeft,n=this._convertTrackToPane(e);n=this._calcProperScrollValue(n),n!==this._pScrollVal&&(this._pScrollVal=n,this._dispatchScrollEvent(t))},ce.prototype._onRestingPosition=function(){this._setSliderPosition(-this._pScrollVal,!0)},ce.prototype._setSliderPosition=function(t,e){let n="",i="",o=this._vertical?"top":"left";t&&(e?i=t+"px":(n=this._vertical?"translateY":"translateX",n+="("+t+"px)",this._reverter.start()));for(let e=this._paneSliders.length;--e>=0;){let r=this._paneSliders[e],s=r.getElement().style;r._titleSection?s[o]=t+"px":(s.transform=n,s[o]=i)}e?this._dispatch("scrollEnd",{}):this._dispatch("scrollStart",{})},ce.prototype._dispatchScrollEvent=function(t){if(this._setSliderPosition(-this._pScrollVal,!1),this._flash(),!this._isEventDispatching("scroll")){if(!t){let 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)}},ce.prototype._onKeyDown=function(t){if(this._isFrozen)return void ut._preventDefault(t);if(!this._active)return;let e=!1;if(e=this._vertical?38===t.keyCode||40===t.keyCode:37===t.keyCode||39===t.keyCode,e){let e=this.getScrollGap(),n=Math.round(.07*e);n<10?n=10:n>100&&(n=100),37!==t.keyCode&&38!==t.keyCode||(n*=-1),this._scroll(n),ut._preventDefault(t)}},ce.prototype._onTouchStart=function(t){this._isFrozen?ut._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))},ce.prototype._onTouchMove=function(t){let e=this;if(e._isFrozen)return void ut._preventDefault(t);if(!e._swiping||!e._active||!e._touchInput)return;if(t.touches&&t.touches.length>1)return;let n=e._startPos,i=e._endPos;e._getTouchInfo(t,i);let o=this._vertical?n.y-i.y:n.x-i.x;o>-5&&o<5||e._isOnEdge(o)||(e._touchDrag?e._scrollTo(n.scrollValue+o):i.timeStamp-n.timeStamp>30&&(e._touchDrag=!0),t.cancelable&&t.preventDefault())},ce.prototype._onTouchEnd=function(t){if(this._isFrozen)ut._preventDefault(t);else if(this._swiping=!1,this._touchDrag&&(this._touchDrag=!1,t.cancelable&&t.preventDefault(),this._smoothing&&!this._smoothingId)){let e=this._startPos,n=this._getTouchInfo(t,this._endPos),i=n.timeStamp-e.timeStamp,o=this._vertical?e.y-n.y:e.x-n.x;this._smoothingSpeed=30*o/i,(this._smoothingSpeed>10||this._smoothingSpeed<-10)&&(this._smoothingId=setInterval(this._smoothScroll,25))}},ce.prototype._getTouchInfo=function(t,e){let n=t.changedTouches[0];return e||(e={}),e.x=n.pageX,e.y=n.pageY,e.timeStamp=t.timeStamp,e.scrollValue=this._getScrollValue(),e},ce.prototype._smoothScroll=function(){let t=this._smoothingSpeed;t=.9*t|0,this._smoothingSpeed=t,t>1||t<-1?this._scroll(t):(clearInterval(this._smoothingId),this._smoothingId=0)},ce.prototype.disableMouseWheel=function(t){!1===t?this.setMouseWheelLogic(this._mouseWheelLogic||this._onMouseWheel):this.setMouseWheelLogic(null)},ce.prototype.setMouseWheelLogic=function(t){this.removeWheelListener(this._parentNode),this._mouseWheelLogic=t,this._mouseWheelLogic&&this.addWheelListener(this._parentNode)},ce.prototype.addWheelListener=function(t){t&&this._mouseWheelLogic&&t.addEventListener("wheel",this._mouseWheelLogic,!1)},ce.prototype.removeWheelListener=function(t){t&&this._mouseWheelLogic&&t.removeEventListener("wheel",this._mouseWheelLogic,!1)},ce.prototype.setMouseWheelSpeed=function(t){this._wheelScrolling="string"==typeof t?t:""},ce.prototype.getMouseWheelSpeed=function(){return this._wheelScrolling},ce.prototype.getDefaultMouseWheelLogic=function(){return this._onMouseWheel},ce.prototype._onMouseWheel=function(t){if(t.target.opened)return;if(this._isFrozen)return void ut._preventDefault(t);if(t.ctrlKey||t.altKey)return;if(!this.isActive())return;let e=this._vertical?t.deltaY:t.deltaX;if(e&&!this._isOnEdge(e)){if(ut._preventDefault(t),t.deltaMode&&(e=e>0?100:-100),"linear"!=this._wheelScrolling){let t=this.getContentSize();t>=4e3&&(e*=1+t/4e3|0)}this.update(),this._scroll(e)}},ce.prototype.setScrollingStep=function(t){this._step=t>0?t:0},ce.prototype.freezeScrolling=function(t){let e=this._isFrozen;return this._isFrozen=!1!==t,e},ce.prototype.restoreTrackPosition=function(){let t=this._element;this._vertical&&(t.scrollTop=this._tScrollVal,t.scrollTop&&(this._tScrollVal=t.scrollTop))},ce._proto=ce.prototype;const _e=ce;let fe=function(){let t=this;t._vertical=!1,t._onDeactivated=t._onDeactivated.bind(t),t._onActivated=t._onActivated.bind(t),t._hostClassName="hscrollbar-host",fe.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)};o.inherits(fe,_e),fe.prototype._pinnedLeftColumnCount=0,fe.prototype._pinnedRightColumnCount=0,fe.prototype.setScrollContent=function(t,e,n,i){this._clearAllPanes();let o=e.length;if(o<=0)return;this._pinnedLeftColumnCount=n>=0?n:0,this._pinnedRightColumnCount=i>0?i:0;let r=e[0],s=r.getColumnCount(),l=s-i;(!l||l<0)&&(l=s);for(let t=0;t<o;++t){r=e[t];let i,o,a=this._addPaneAt(t),u=this._paneSliders[t],h=a.getElement(),p=u.getElement();for(i=0;i<n;++i)o=r.getColumn(i),o.setScrollState(h,null,!1);let d=r.getColumnHost();a.setParent(d);let c=[],_=[];for(i=n;i<l;++i)o=r.getColumn(i),o.setScrollState(null,p,this.isActive()),c.push(o),_.push(o.getElement());for(i=l;i<s;++i)o=r.getColumn(i),o.setScrollState(null,null,!1);let f=r.getReservedSpace();f&&(this.isActive()&&!this._pinnedRightColumnCount?(u.addContent(f),_.push(f)):d.appendChild(f),r._updateRightSpaceStyle()),r._updateLayers(),u._titleSection=r.hasClass("title"),u._columns=c,u._content=_}this.invalidateContent()},fe.prototype.setWidth=function(t){return this.setTrackSize(t,t),!0},fe.prototype.getWidth=function(){return this.getPaneSize()},fe.prototype.getScrollLeft=function(){return this._getScrollValue()},fe.prototype.setScrollLeft=function(t){this.update(),this._scrollTo(t)},fe.prototype.getPinnedLeftColumnCount=function(){return this.isEnabled()?this._pinnedLeftColumnCount:0},fe.prototype.getPinnedRightColumnCount=function(){return this.isEnabled()?this._pinnedRightColumnCount:0},fe.prototype.setPaneLeft=function(t){let e=t&&this.isActive()?-t+"px":"";for(let t=this._panes.length;--t>=0;)this._paneSliders[t].setStyle("marginLeft",e)},fe.prototype.isEndOfHorizontalScroll=function(){return this._isEndOfScroll()},fe.prototype.getContentWidth=function(){let t=this._paneSliders[0],e=0;if(t){let n=t._content;for(let t=n.length;--t>=0;){let i=n[t],o=i?i.style.width:0;o&&(e+=parseFloat(o))}}return e},fe.prototype.calculateContentSize=function(){return this.getContentWidth()},fe.prototype.getTrackSize=function(){return this._footerCount<=0&&this._otherScrollbar&&this._otherScrollbar.isActive()&&!this._pinnedRightColumnCount?this._trackSize-this.getTrackThickness():this._trackSize},fe.prototype._onActivated=function(t){this._updateActivation(!0)},fe.prototype._onDeactivated=function(t){this._updateActivation(!1)},fe.prototype._updateActivation=function(t){let e=this._paneSliders.length;for(let n=0;n<e;++n){let e=this._paneSliders[n]._columns,i=e?e.length:0;for(let n=0;n<i;++n){let i=e[n];i.getElement()&&i.enableAbsolutePosition(t)}}},fe._proto=fe.prototype;const ge=fe;let ye=function(t,e){return t>e?e:t<0?0:t},me=function(t){this._boundLayer=t.boundLayer,this._layoutX=t.layoutX,this._layoutY=t.layoutY,this._hscrollbar=t.hscrollbar,this._calculateColumnBounds=t.calculateColumnBounds};me.prototype._boundLayer=null,me.prototype._layoutX,me.prototype._layoutY,me.prototype._hscrollbar,me.prototype._calculateColumnBounds,me.prototype._cellBound=null,me.prototype._cbLftIdx=0,me.prototype._cbRgtIdx=0,me.prototype._cbTopIdx=0,me.prototype._cbBtmIdx=0,me.prototype.dispose=function(){let t=this._cellBound;if(t){let e=t.parentNode;e&&e.removeChild(t),this._cellBound=null}this._boundLayer=null,this._layoutX=null,this._layoutY=null,this._hscrollbar=null,this._calculateColumnBounds=null},me.prototype.setCellBounds=function(t,e,n,i,o){let r=this._cellBound;r||(r=this._cellBound=document.createElement("div"),r.className="selection-bound");let s=t+n,l=e+i,a=this._layoutY.getLaneCount();this._cbLftIdx=ye(t,o),this._cbRgtIdx=ye(s,o),this._cbTopIdx=ye(e,a),this._cbBtmIdx=ye(l,a),this.updateCellBounds()},me.prototype.updateCellBounds=function(){let t=this._cellBound;if(!t)return;let e,n,i,o,r=this._layoutX,s=this._layoutY,l=this._cbLftIdx,a=this._cbRgtIdx,u=this._cbTopIdx,h=this._cbBtmIdx;e=n=i=o=0,l<a&&u<h&&(e=r.getLaneStart(l),n=r.getLaneEnd(a-1),i=s.getLaneStart(u),o=s.getLaneEnd(h-1));let p=n-e,d=o-i,c=[!1,!1];if(p>0&&d>0&&this._hscrollbar){let t=[0,0];this._calculateColumnBounds(l,a-1,t,c),e=t[0],n=t[1],p=n-e}if(p>0)t.style.left=e+"px",t.style.top=i+"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{let e=t.parentNode;e&&e.removeChild(t)}},me._proto=me.prototype;const Ce=me;let Se=function(t){let e=this;e._onMouseMove=e._onMouseMove.bind(e),e._onMouseOut=e._onMouseOut.bind(e),e._onResetTransformIE=e._onResetTransformIE.bind(e),e._trackX=new Kt,e._trackY=new Kt,e._trackX.setDefaultLaneSize(100),e._trackY.setDefaultLaneSize(32),e._cellSpans=new ae,e._element=document.createElement("div"),e._element.className="tr-lg tr-even-shading",e._ctxRows=new te,e._columns=[],e._cells=[],e._highlightedCells=[],e._stretchedCells=new oe(e._trackX,e._trackY,e),e._selectionList=new he,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")};o.inherits(Se,Wt),Se.prototype._index=-1,Se.prototype._availableRowCount=0,Se.prototype._activeRow=0,Se.prototype._activeRowEnd=0,Se.prototype._colCount=0,Se.prototype._rowCount=0,Se.prototype._hiddenRowCount=0,Se.prototype._trackX,Se.prototype._trackY,Se.prototype._cellSpans,Se.prototype._columns,Se.prototype._firstColumn,Se.prototype._lastColumn,Se.prototype._rightSpace,Se.prototype._rightSpaceSize=0,Se.prototype._frozenLayout=!1,Se.prototype._rowHighlightEnabled=!1,Se.prototype._rowHighlightIndex=-1,Se.prototype._highlightedCells,Se.prototype._coverLayer=null,Se.prototype._stretchedCells=null,Se.prototype._ctx=null,Se.prototype._selectionList,Se.prototype._colVir=!1,Se.prototype._initialized=!1,Se.prototype._hidingMethod="",Se.prototype._virOwner=null,Se.prototype._transformIETimer=0,Se.prototype._ctxRows,Se.prototype._boundLayer=null,Se.prototype._colBounds=null,Se.prototype._colBoundCache=null,Se.prototype._hscrollbar=null,Se.prototype._leftColumnSeparator=null,Se.prototype._rightColumnSeparator=null,Se.prototype._cellBoundPainter=null,Se.prototype.dispose=function(){this.setRowCount(0),this.unlistenAll(),this._ctxRows.dispose(),this._stretchedCells.dispose();for(let 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._highlightedCells.length=0,this._ctx=null,this._hscrollbar=null,this._cellBoundPainter&&this._cellBoundPainter.dispose(),this._dispose()},Se.prototype.getWidth=function(){return this.isVisible()?this._getWidth():0},Se.prototype._getWidth=function(){return this.getContentWidth()+this._rightSpaceSize},Se.prototype.setWidth=function(t){return!(t<0)&&(null!=this._trackX.setTrackSize(t-this._rightSpaceSize)&&(this._syncLayoutToColumns(0),!0))},Se.prototype.getHeight=function(){return this.isVisible()?this.getContentHeight():0},Se.prototype.setHeight=function(t){return!(t<0)&&(null==this._trackY.setTrackSize(t)||this._syncLayoutToRows(0,this._rowCount),!0)},Se.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._trackY.show(t),this.setFrozenLayout(!1===t),this._dispatchRowHeightChangedEvent(0,this._rowCount)},Se.prototype.hitTest=function(t,e,n){if(t<0)return null;if(e<0)return null;if(t>=this.getContentWidth())return null;if(e>=this.getHeight())return null;let i=this._trackX.hitTest(t);if(i<0)return null;let o=this._trackY.hitTest(e);if(o<0)return null;let r={};if(r.colIndex=i,r.rowIndex=o,!0!==n){let t=this._cellSpans.getOccupyingSpan(i,o);t&&(r.colIndex=t.indexX,r.rowIndex=t.indexY)}return r},Se.prototype.hitTestX=function(t){return t<0?-1:t>=this.getContentWidth()?~this._colCount:this._trackX.hitTest(t)},Se.prototype.hitTestY=function(t){return t<0?-1:t>=this.getHeight()?~this._rowCount:this._trackY.hitTest(t)},Se.prototype.getDefaultColumnWidth=function(){return this._trackX.getDefaultLaneSize()},Se.prototype.setDefaultColumnWidth=function(t){this._trackX.getDefaultLaneSize()!==t&&(this._trackX.setDefaultLaneSize(t),this._syncLayoutToColumns(0))},Se.prototype.getDefaultRowHeight=function(){return this._trackY.getDefaultLaneSize()},Se.prototype.setDefaultRowHeight=function(t){if(this._trackY.getDefaultLaneSize()!==t){this._trackY.setDefaultLaneSize(t);for(let e=0;e<this._colCount;++e)this._columns[e].setHeight(t);this._syncLayoutToRows(0,this._rowCount),this._dispatchRowHeightChangedEvent(0,this._rowCount)}},Se.prototype.getColumnWidth=function(t){return this._trackX.getLaneSize(t)},Se.prototype.setColumnWidth=function(t,e){return!!this._setColumnWidth(t,e)&&(this._syncLayoutToColumns(t),!0)},Se.prototype._setColumnWidth=function(t,e){return this._trackX.setLaneSize(t,e)},Se.prototype._updateColumnLayout=function(){this._syncLayoutToColumns(0)},Se.prototype._startBindingSession=function(t){},Se.prototype._getTempRowHeights=function(){return null},Se.prototype.getRowHeight=function(t){return this._trackY.getLaneSize(t)},Se.prototype.setRowHeight=function(t,e){if(t<0||t>=this._rowCount)return!1;let n=this._trackY.setLaneSize(t,e);return this._syncLayoutToRows(t,t+1),n&&this._dispatchRowHeightChangedEvent(t,t+1),this._resetTransformIETimer(),n},Se.prototype._updateRowHeights=function(t,e){let n=0;for(let i=0;i<this._rowCount;++i){let o=t.getLaneSize(e);n|=this._trackY.setLaneSize(i,o),++e}return this._syncLayoutToRows(0,this._rowCount),n},Se.prototype.isColumnVisible=function(t){return this._trackX.isLaneVisible(t)},Se.prototype.hideColumn=function(t,e){return this.setColumnVisibility(t,!1===e,0)},Se.prototype.isRowVisible=function(t){return this._trackY.isLaneVisible(t)},Se.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)},Se.prototype.getMinimumColumnWidth=function(t){return this._trackX.getMinimumLaneSize(t)},Se.prototype.setMinimumColumnWidth=function(t,e){return!!this._trackX.setMinimumLaneSize(t,e)&&(this._syncLayoutToColumns(t),!0)},Se.prototype.getMinimumRowHeight=function(t){return this._trackY.getMinimumLaneSize(t)},Se.prototype.setMinimumRowHeight=function(t,e){return!!this._trackY.setMinimumLaneSize(t,e)&&(this._syncLayoutToRows(t,this._rowCount),this._dispatchRowHeightChangedEvent(t,t+1),!0)},Se.prototype.getCellLeft=function(t){return this._trackX.getLaneStart(t)},Se.prototype.getCellTop=function(t){return this._trackY.getLaneStart(t)},Se.prototype.getCellWidth=function(t,e){let n=this._cellSpans.getOccupyingSpan(t,e);if(n){let t=this._trackX.getLaneStart(n.indexX);return this._trackX.getLaneEnd(n.indexX+n.colSpan-1)-t}return this.getColumnWidth(t)},Se.prototype.getCellHeight=function(t,e){let n=this._cellSpans.getOccupyingSpan(t,e);if(n){let t=this._trackY.getLaneStart(n.indexY);return this._trackY.getLaneEnd(n.indexY+n.rowSpan-1)-t}return this.getRowHeight(e)},Se.prototype.hasCellSpan=function(){return this._cellSpans.hasSpan()},Se.prototype.getCellRowSpan=function(t,e){return this._cellSpans.getRowSpan(t,e)},Se.prototype.setCellRowSpan=function(t,e,n){let i=this._cellSpans.setRowSpan(t,e,n);if(this._updateCellSpanSize(t,e,i),i)return i.retVal>=0?this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,!0):i.colSpan>1?(this._updateCellSpanClass(t,e,i.colSpan,i.prevRowSpan,!1),this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,!0)):this._updateCellSpanClass(t,e,i.colSpan,i.prevRowSpan,!1),0!==i.retVal;let o=this._getCell(t,e);return o&&o._rowSpan>1&&this._updateCellSpanClass(t,e,o._colSpan,o._rowSpan,!1),!1},Se.prototype.getCellColSpan=function(t,e){return this._cellSpans.getColSpan(t,e)},Se.prototype.setCellColSpan=function(t,e,n){let i=this._cellSpans.setColSpan(t,e,n);if(this._updateCellSpanSize(t,e,i),i)return i.retVal>=0?this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,!0):i.colSpan>1?(this._updateCellSpanClass(t,e,i.prevColSpan,i.rowSpan,!1),this._updateCellSpanClass(t,e,i.colSpan,i.rowSpan,!0)):this._updateCellSpanClass(t,e,i.prevColSpan,i.rowSpan,!1),0!==i.retVal;let o=this._getCell(t,e);return o&&o._colSpan>1&&this._updateCellSpanClass(t,e,o._colSpan,o._rowSpan,!1),!1},Se.prototype.clearCellSpans=function(){let t=this._cellSpans.clearAllSpans();if(null==t)return!1;for(let e=t.length;--e>=0;){let n=t[e];this._updateCellSpan(n.indexX,n.indexY,n,!1)}return!0},Se.prototype.clearColumnSpans=function(t){let e=this._cellSpans.removeSpanByColIndex(t);if(null==e)return!1;for(let t=e.length;--t>=0;){let n=e[t];this._updateCellSpan(n.indexX,n.indexY,n,!1)}return!0},Se.prototype.clearColumnCustomizations=function(){this._trackX.clearLaneCustomizations(),this._syncLayoutToColumns(0)},Se.prototype.clearRowCustomizations=function(){this._trackY.clearLaneCustomizations(),this._syncLayoutToRows(0,this._rowCount)},Se.prototype.getColumnScalability=function(t){return this._trackX.getLaneScalability(t)},Se.prototype.setColumnScalability=function(t,e){return this._trackX.setLaneScalability(t,e)},Se.prototype.getRowScalability=function(t){return this._trackY.getLaneScalability(t)},Se.prototype.setRowScalability=function(t,e){return this._trackY.setLaneScalability(t,e)},Se.prototype.getCell=function(t,e,n){if(n&&this._cellSpans.hasSpan()){let n=this._cellSpans.getColSpan(t,e),i=this._cellSpans.getRowSpan(t,e);n<0&&(t+=n),i<0&&(e+=i)}return this._getCell(t,e)},Se.prototype.getCellContent=function(t,e){let n=this.getCell(t,e);return null!==n?n.getContent():null},Se.prototype.setCellContent=function(t,e,n){let i=this.getCell(t,e);return null==i?(window.console.log("Error: Accessing nonexistent cell in Grid's Table"),null):i.setContent(n)},Se.prototype.getColumnCount=function(){return this._colCount},Se.prototype.setColumnCount=function(t){if(t<0&&(t=0),this._colCount===t)return;let e=this._colCount;this._trackX.setLaneCount(t),this._colCount=this._trackX.getLaneCount();let n=0,i=null;if(e>t)for(n=e;--n>=t;)i=this._columns.pop(),i.dispose(),i===this._firstColumn&&(this._firstColumn=null),i===this._lastColumn&&(this._lastColumn=null);else for(n=e;n<t;++n)i=this._newColumn(n);for(this._updateColumnIndices(),n=e;n<t;++n)this._columns[n].activate(!this._colVir);t<=0&&this._selectionList.clearAllSelections()},Se.prototype.getRowCount=function(){return this._rowCount},Se.prototype.setRowCount=function(t,e){if(t<0&&(t=0),this._rowCount===t)return;let n,i=this._rowCount;for(this._trackY.setLaneCount(t),this._rowCount=this._trackY.getLaneCount(),this._ctxRows.setItemCount(t),this._stretchedCells.setCellCount(t),n=0;n<this._colCount;++n)this._columns[n].setCellCount(t);if(i>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(let e=t;e<i;++e)this._selectionList.deselect(e);else this._selectionList.clearAllSelections();else this._syncLayoutToRows(i,t);let o={};o.prevCount=i,o.rowCount=this._rowCount,this._dispatch("rowCountChanged",o),i<t&&this._insertCells(0,this._rowCount)},Se.prototype.getVisibleRowCount=function(){return this._rowCount-this._hiddenRowCount},Se.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))},Se.prototype.removeRow=function(t){t<=0||(t>this._rowCount&&(t=this._rowCount),this.setRowCount(this._rowCount-t))},Se.prototype.setBorders=function(t,e,n,i){},Se.prototype.getColumnStyle=function(t,e){let n=this._columns[t];return n?n.getStyle(e):null},Se.prototype.setColumnStyle=function(t,e,n){let i=this._columns[t];i&&i.setStyle(e,n)},Se.prototype.enableColumnClass=function(t,e,n){let i=this._columns[t];i&&i.enableClass(e,n)},Se.prototype.hasColumnClass=function(t,e){let n=this._columns[t];return!!n&&n.hasClass(e)},Se.prototype.enableRowClass=function(t,e,n){if(t>=0&&t<this._rowCount)for(let i=0;i<this._colCount;++i)this._columns[i].getCell(t).enableClass(e,n)},Se.prototype.setRowStyle=function(t,e,n,i){if(t>=0&&t<this._rowCount){n&&(null==i||i)||(n="");for(let i=0;i<this._colCount;++i)this._columns[i].getCell(t).setStyle(e,n)}},Se.prototype.getRelativePosition=function(t){return ut.getRelativePosition(t,this._element)},Se.prototype.getContentWidth=function(){return this._trackX.getTrackSize()},Se.prototype.getContentHeight=function(){let t=this._trackY.getTrackSize();if(t<=0&&this._colCount*this.getVisibleRowCount()>0){let t=this._columns[0],e=t.getCell(this._rowCount-1);return e.getTop()+e.getHeight()-t.getCell(0).getTop()}return t},Se.prototype.getCellsByRowIndex=function(t){if(t<0||t>=this._rowCount)return null;let e=new Array(this._colCount);for(let n=0;n<this._colCount;++n)e[n]=this._columns[n].getCell(t);return e},Se.prototype.disableHorizontalGridLine=function(t){this.enableClass("no-horizontal-grid-line",!1!==t)},Se.prototype.disableVerticalGridLine=function(t){this.enableClass("no-vertical-grid-line",!1!==t)},Se.prototype.enableShading=function(t){!1!==t?this.addClass("tr-even-shading"):(this.removeClass("tr-even-shading"),this.removeClass("tr-odd-shading"))},Se.prototype.setTransposedShading=function(t){this.enableClass("transposed-shading",!1!==t)},Se.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)))},Se.prototype.getRowHighlight=function(){return this._rowHighlightIndex},Se.prototype.setRowHighlight=function(t){if((!this._rowHighlightEnabled||t<-1||t>=this._rowCount)&&(t=-1),this._rowHighlightIndex===t)return;let e=this._rowHighlightIndex;this._rowHighlightIndex=t;for(let t=this._highlightedCells.length;--t>=0;)this._highlightedCells[t].removeClass("highlighted-row");if(t>=0&&t<this._rowCount){this._highlightedCells.length=this._colCount;for(let e=this._colCount;--e>=0;){let n=this._columns[e].getCell(t);this._highlightedCells[e]=n,n.addClass("highlighted-row")}let e=this.getStretchedCell(t);e&&(this._highlightedCells.push(e),e.addClass("highlighted-row"))}else this._highlightedCells.length=0;if(this._hasListener("rowHighlighted")){let n={};n.prevRowIndex=e,n.rowIndex=t,this._dispatch("rowHighlighted",n)}},Se.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},Se.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},Se.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},Se.prototype.setSelectedRow=function(t,e){t<0||t>=this._rowCount||(this._selectionList.setSelection(t,e),this._updateSelectionUI(t))},Se.prototype.selectSingleRow=function(t){t<0||t>=this._rowCount||(this.clearSelectedRows(),this._selectionList.select(t),this._addSelectionUI(t))},Se.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(let n=0;n<e;++n)this._addSelectionUI(n+t)}},Se.prototype.clearSelectedRows=function(){let t=this._selectionList.getSelectionCount();if(t){let e=this._selectionList.getAllSelections();this._selectionList.clearAllSelections();for(let n=0;n<t;++n)this._removeSelectionUI(e[n]);return t}return 0},Se.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},Se.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},Se.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},Se.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},Se.prototype.activateColumn=function(t,e){let n=this._columns[t];if(n){let t=n.activate(e);if(e&&t&&this._rightSpace){let t=this._rightSpace.parentNode;t&&t.appendChild(this._rightSpace)}}},Se.prototype.activateRows=function(){this._onEnterDocument()},Se.prototype.moveRowsToTop=function(t){this._ctxRows.moveItemsToTop(t),this._stretchedCells.moveCellsToTop(t);for(let e=0;e<this._colCount;++e)this._columns[e].moveCellsToTop(t)},Se.prototype.getFirstIndexInView=function(){return 0},Se.prototype.getLastIndexInView=function(){return this._availableRowCount-1},Se.prototype.isInCurrentView=function(t){return 0!==this._rowCount&&t>=0&&t<this._rowCount},Se.prototype.getFrozenLayout=function(){return this._frozenLayout},Se.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)))},Se.prototype.getColumn=function(t){return this._columns[t]||null},Se.prototype.insertColumn=function(t,e){t<0?t=0:t>this._colCount&&(t=this._colCount);let n=t<this._colCount,i=this._cellSpans.getAllSpans();this._updateCellSpans(i,!1),this._trackX.insertLane(t,e),this._colCount=this._trackX.getLaneCount();let o=this._newColumn(t);if(this._updateColumnIndices(),this._cellSpans.shiftColumn(t,1)&&(i=this._cellSpans.getAllSpans()),this._updateCellSpans(i,!0),this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._selectionList.getSelectionCount()){let t=this._selectionList.getAllSelections();for(let e=t.length;--e>=0;){let n=o.getCell(t[e]);n&&n.addClass("selected-row")}}return o.activate(n||!this._colVir),o},Se.prototype.removeColumnAt=function(t){let e=this._trackX.removeLaneAt(t);if(null==e)return null;let n=this._cellSpans.getAllSpans();this._updateCellSpans(n,!1),this._colCount=this._trackX.getLaneCount();let i=this._columns.splice(t,1)[0];return i.dispose(),e.control=i,this._updateColumnIndices(),this._cellSpans.removeColumn(t)&&(n=this._cellSpans.getAllSpans()),this._updateCellSpans(n,!0),this._syncLayoutToColumns(t),t>=this._colCount&&this._updateCssWidth(),e},Se.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)return;let n=this._cellSpans.getAllSpans();this._updateCellSpans(n,!1),this._trackX.moveLane(t,e);let i=this._columns[t];if(ut.moveArrayItem(this._columns,t,e),i.getElement().offsetParent){let t=e+1,n=this._columns[t]||null;for(;n&&!n.getElement().offsetParent;)n=this._columns[++t];i.insertBefore(n)}this._updateColumnIndices(),this._updateCellSpans(n,!0);let o=t<e?t:e;this._syncLayoutToColumns(o)},Se.prototype.enableRowVirtualization=function(){console.log("WARNING: This function is deprecated")},Se.prototype.enableColumnVirtualization=function(t){this._colVir=!1!==t},Se.prototype.getColumnIndex=function(t){if(t){if(t.stretched)return this._stretchedCells.getColumnIndex(t);let e=this._columns.length;for(let n=0;n<e;++n)if(this._columns[n].getElement()===t)return n}return-1},Se.prototype.getCellIndex=function(t,e){if(e){if(e.stretched)return this._stretchedCells.getRowIndex(e);let n=this._columns[t];if(n)return n.getCellIndex(e)}return-1},Se.prototype.getIndex=function(){return this._index},Se.prototype.setIndex=function(t){this._index=t},Se.prototype.getRowOffset=function(){return this._rowOffset},Se.prototype.setRowOffset=function(t){this._rowOffset=t},Se.prototype.updateLayout=function(){this._calculateViewSize(!0),this._stretchedCells.updateCells(),this._updateRightSpaceStyle()},Se.prototype.stretchCell=function(t,e,n,i){let 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;let r=null;if(!1!==n){let t=this._coverLayer;t||(t=this._coverLayer=document.createElement("div"),t.className="cover-layer",this._updateLayers()),this._calculateViewSize(),r=this._stretchedCells.stretchCell(e,i?o:0),r.setParent(t)}else r=this._stretchedCells.unstretchCell(e);if(r){let t=this._selectionList.getSelection(e);r.enableClass("selected-row",t)}return r},Se.prototype.unstretchCell=function(t,e){return this.stretchCell(t,e,!1)},Se.prototype.unstretchAllCells=function(){this._stretchedCells.unstretchAllCells()},Se.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},Se.prototype.getStretchedCells=function(){return this._stretchedCells.getCells()},Se.prototype.updateStretchedCells=function(){this._updateLayers();let t=this._coverLayer?this._coverLayer.children.length:0;return!(t<=0||(this._calculateViewSize(!0),this._stretchedCells.updateCells(),!t))},Se.prototype._calculateViewSize=function(t){if(this._frozenLayout)return this._stretchedCells.getStretchSize();let e=this._ctx,n=t?0:this._stretchedCells.getStretchSize();if(!n&&e&&e.getWidth){let t=this.getContentWidth();return n=e.getWidth()-this._rightSpaceSize,n?(t<n&&(n=t),this._stretchedCells.setStretchSize(n),n):t}return n},Se.prototype._enableStretchCellClass=function(t,e,n){let i=this.getStretchedCell(t);i&&i.enableClass(e,n)},Se.prototype._getViewSize=function(){return this._calculateViewSize()},Se.prototype.getColumnHost=function(){return this._element},Se.prototype.setHidingMethod=function(t){this._hidingMethod=t},Se.prototype.getHidingMethod=function(){return this._hidingMethod},Se.prototype.setColumnVisibility=function(t,e,n){return!!this._trackX.hideLane(t,!e,n)&&(this._syncLayoutToColumns(t),!0)},Se.prototype.getRowLayout=function(){return this._trackY},Se.prototype.reserveRightSpace=function(t){if(t&&t>0){if(!this._rightSpace){let t=this._rightSpace=document.createElement("div");t.className="tr-reserved-space",t.style.height=this.getContentHeight()+"px",this._updateLayers()}this._rightSpace.style.width=t+"px",this._rightSpaceSize=t,this._updateCssWidth()}else if(this._rightSpace){let t=this._rightSpace.parentNode;t&&t.removeChild(this._rightSpace),this._rightSpace=null,this._rightSpaceSize=0,this._updateCssWidth()}return this._rightSpace},Se.prototype._updateRightSpaceStyle=function(){let t=this._rightSpace;if(!t)return;let e=!1,n=0;this._hscrollbar&&(e=this._hscrollbar.isActive(),n=this._hscrollbar.getPinnedRightColumnCount()),e&&!n?(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")},Se.prototype._updateLayers=function(){if(this._rightSpace){let 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)},Se.prototype.getReservedSpace=function(){return this._rightSpace},Se.prototype.getComputedStyle=function(){let t=this._element;return t.offsetParent?getComputedStyle(t):null},Se.prototype.isColumnActive=function(t){let e=this._columns[t];return!!e&&e.isActive()},Se.prototype.setRowAttributes=function(t,e){if(!(t<0||t>=this._rowCount))for(let n=0;n<this._colCount;++n){let i=e(n);for(let e=i.length;--e>=0;){let o=i[e],r=this._columns[n].getCell(t);r&&(o.remove?r.removeAttribute(o.attribute):r.setAttribute(o.attribute,o.value))}}},Se.prototype.getContextRow=function(t){return this._ctxRows.getItem(t)},Se.prototype.selectColumn=function(t,e){this.enableColumnClass(t,"selected-column",e),e&&(this._boundLayer||(this._initBoundLayer(),this._updateLayers()))},Se.prototype.isSelectedColumn=function(t){return this.hasColumnClass(t,"selected-column")},Se.prototype.selectCell=function(t,e,n){let i=this._getCell(t,e);i&&i.enableClass("selection",n)},Se.prototype.setCellBounds=function(t,e,n,i){let o=this._initBoundLayer(),r=this._cellBoundPainter;r||(r=this._cellBoundPainter=new Ce({boundLayer:o,layoutX:this._trackX,layoutY:this._trackY,hscrollbar:this._hscrollbar,calculateColumnBounds:this.calculateColumnBounds.bind(this)}));let s=this.getColumnCount();r.setCellBounds(t,e,n,i,s)},Se.prototype.getHorizontalLayout=function(){return this._trackX},Se.prototype.calculateColumnBounds=function(t,e,n,i){let 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){let n,i,u=0,h=0,p=0,d=0;this._hscrollbar&&(h=this._hscrollbar.getScrollLeft(),p=this._hscrollbar.getPinnedLeftColumnCount(),d=this._hscrollbar.getPinnedRightColumnCount()),n=i=this._trackX.getTrackSize(),p&&(u=this._trackX.getLaneStart(p)),d&&(a-=d,n=this._getViewSize()-i+this._trackX.getLaneStart(a)),t>=p&&t<a?(o-=h,o<u?(o=u,s=!0):o>n&&(o=n,s=!0)):t>=a&&(o=this._getViewSize()-i+this._trackX.getLaneStart(t)),e>=p&&e<a?(r-=h,r<u?(r=u,l=!0):r>n&&(r=n,l=!0)):e>=a&&(r=this._getViewSize()-i+this._trackX.getLaneEnd(e))}n[0]=o,n[1]=r,i[0]=s,i[1]=l},Se.prototype.updateColumnBounds=function(t,e,n){let i=this._colBounds,o=this._colBoundCache;i||(i=this._colBounds=[]),o||(o=this._colBoundCache=[]);let r,s=t.length,l=null,a=null,u=i.length;for(r=s;r<u;++r)a=i[r],l=a.parentNode,l&&l.removeChild(a);if(i.length=u=s,s)for(r=0;r<s;++r){let s=t[r],l=e[r],u=s[0],h=s[1];a=o[r],a||(a=o[r]=document.createElement("div"),a.className="selection-bound column-bound"),a.style.left=u+"px",a.style.width=h-u+"px",n=n||0,a.style.top=n+"px",a.style.height=this._trackY.getTrackSize()-n+"px",a.classList.toggle("no-left-bound",l[0]),a.classList.toggle("no-right-bound",l[1]),this._boundLayer&&(i[r]||(i[r]=a,this._boundLayer.appendChild(a)))}},Se.prototype.updateColumnSeparators=function(){let t=this._hscrollbar.getPinnedLeftColumnCount(),e=this._hscrollbar.getPinnedRightColumnCount();!t&&!e||this._boundLayer||this._initBoundLayer();let n=!1;this._hscrollbar&&(n=this._hscrollbar.isActive());let i=this._boundLayer,o=this._leftColumnSeparator;if(n&&t){o||(o=this._leftColumnSeparator=this._createColumnSeparator()),o.parentNode||(i.children.length?i.insertBefore(o,i.children[0]):i.appendChild(o));let e=this._trackX.getLaneStart(t);o.style.left=e-1+"px",o.style.height=this._trackY.getTrackSize()+"px"}else o&&o.parentNode&&this._boundLayer.removeChild(o);if(o=this._rightColumnSeparator,n&&e){o||(o=this._rightColumnSeparator=this._createColumnSeparator()),o.parentNode||(i.children.length?i.insertBefore(o,i.children[0]):i.appendChild(o));let t=this.getColumnCount(),n=this._trackX.getLaneEnd(t-1)-this._trackX.getLaneStart(t-e),r=this._getViewSize();o.style.left=r-n+"px",o.style.height=this._trackY.getTrackSize()+"px"}else o&&o.parentNode&&this._boundLayer.removeChild(o)},Se.prototype._createColumnSeparator=function(){let t=document.createElement("div");return t.classList.add("column-separator"),t},Se.prototype._initBoundLayer=function(){let t=this._boundLayer;return t||(t=this._boundLayer=document.createElement("div"),t.className="cover-layer",this._element.appendChild(t)),t},Se.prototype._getCell=function(t,e){let n=this._columns[t];return n?n.getCell(e):null},Se.prototype._insertCells=function(t,e){this._activeRow=t,this._activeRowEnd=e;let n=this._trackY.getLaneStart(t);for(let i=0;i<this._colCount;++i){let o=this._columns[i];o.hasCollapsedCells()||o.setTop(n),o.activateCells(t,e)}if(this._rightSpace&&(this._rightSpace.style.top=n+"px"),e>this._availableRowCount){let t={};t.prevRowIndex=this._availableRowCount,t.rowIndex=e,this._availableRowCount=e,this._dispatch("rowAvailable",t)}},Se.prototype._newColumn=function(t){let e=new Zt(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(let t=0;t<this._rowCount;++t)this._trackY.isAtDefaultSize(t)||e.getCell(t).setHeight(this._trackY.getLaneSize(t));if(t>=this._columns.length)this._columns.push(e),e.setParent(this._element);else{this._columns.splice(t,0,e);let n=this._columns[t+1];e.insertBefore(n)}return e},Se.prototype._updateCssWidth=function(){this._frozenLayout||(this._calculateViewSize(!0),this._stretchedCells.updateXAxis(),this._element.style.width=this._getWidth()+"px")},Se.prototype._updateViewHeight=function(){if(this._frozenLayout)return;let t=this.getContentHeight();this._element.style.height=t+"px",this._rightSpace&&(this._rightSpace.style.height=t+"px")},Se.prototype._updateColumnIndices=function(){let 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"));let n=this._columns[t-1];n!==this._lastColumn&&(this._lastColumn&&this._lastColumn.removeClass("last"),this._lastColumn=n,this._lastColumn&&this._lastColumn.addClass("last"));let i=null;for(let t=this._columns.length;--t>=0;){let e=this._columns[t];e.setNextSibling(i),i=e}},Se.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(let e=t;e<this._colCount;++e){let t=this._columns[e];t.setLeft(this._trackX.getLaneStart(e)),t.setWidth(this._trackX.getLaneSize(e))}return this._updateCellSpanLayout(this._cellSpans.getAllSpans()),this._updateCssWidth(),!0},Se.prototype._syncLayoutToRows=function(t,e){if(!this._frozenLayout){for(let n=t;n<e;++n){let t=this._trackY.isAtDefaultSize(n)?-1:this._trackY.getLaneSize(n);for(let e=0;e<this._colCount;++e)this._columns[e].getCell(n).setHeight(t)}this._stretchedCells.updateYAxis(),t?this._updateCellSpanLayout(this._cellSpans.getAllSpans()):this._updateCellSpans(this._cellSpans.getAllSpans(),!0),this._updateViewHeight()}},Se.prototype._dispatchRowHeightChangedEvent=function(t,e){if(!this._hasListener("rowHeightChanged"))return;if(t>=e)return;let n={};n.rowIndex=t,n.changeLength=e-t,this._dispatch("rowHeightChanged",n)},Se.prototype._updateCellSpanSize=function(t,e,n){let i=this._getCell(t,e);if(null!=i)if(n&&n.colSpan>1?(i.setWidth(this.getCellWidth(t,e)),this._columns[t].disableDeactivation()):i.setWidth(-1),n&&n.rowSpan>1)i.setHeight(this.getCellHeight(t,e));else{let t=this._trackY.isAtDefaultSize(e)?-1:this._trackY.getLaneSize(e);i.setHeight(t)}},Se.prototype._updateCellSpanLayout=function(t){if(null!=t)for(let e=t.length;--e>=0;){let n=t[e];this._updateCellSpanSize(n.indexX,n.indexY,n)}},Se.prototype._updateCellSpan=function(t,e,n,i){this._updateCellSpanSize(t,e,i?n:null),this._updateCellSpanClass(t,e,n.colSpan,n.rowSpan,i)},Se.prototype._updateCellSpanClass=function(t,e,n,i,o){let r;for(let s=0;s<n&&(r=this._columns[t+s],r);++s)r.collapseCells(e,i,o,0===s,s>0);let s=this._getCell(t,e);s&&(s._colSpan=o?n:1,s._rowSpan=o?i:1)},Se.prototype._updateCellSpans=function(t,e){if(null!=t)for(let n=t.length;--n>=0;){let i=t[n];this._updateCellSpan(i.indexX,i.indexY,i,e)}},Se.prototype._onMouseMove=function(t){let e=t.target,n=ut.closestElement(e,"cell"),i=this._stretchedCells.getColumnIndex(n);if(i<0){let t=ut.closestElement(e,"column");i=this.getColumnIndex(t)}let o=this.getCellIndex(i,n);this.setRowHighlight(o)},Se.prototype._onMouseOut=function(t){let e=t.relatedTarget;if(e){let t=this._element;for(;null!==e.parentNode;)if(e=e.parentNode,e===t)return}this.setRowHighlight(-1)},Se.prototype._getEventHandlers=function(){return{mouseout:this._onMouseOut,mousemove:this._onMouseMove}},Se.prototype._updateSelectionUI=function(t){let e=this._selectionList.getSelection(t);this._enableStretchCellClass(t,"selected-row",e),this.enableRowClass(t,"selected-row",e)},Se.prototype._addSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!0),this.enableRowClass(t,"selected-row",!0)},Se.prototype._removeSelectionUI=function(t){this._enableStretchCellClass(t,"selected-row",!1),this.enableRowClass(t,"selected-row",!1)},Se.prototype._onEnterDocument=function(){if(!this._initialized&&this.getParent()){for(let t=0;t<this._colCount;++t)this._columns[t].enableAutoStyleUpdating();this._syncLayoutToColumns(0),this._initialized=!0}},Se.prototype._setContext=function(t){this._ctx=t},Se.prototype._getContext=function(){return this._ctx},Se.prototype._resetTransformIETimer=function(){ut.isIE&&(this._transformIETimer||(this.enableClass("reset-transform"),this._transformIETimer=setTimeout(this._onResetTransformIE,20)))},Se.prototype._onResetTransformIE=function(){this._transformIETimer=0,this.enableClass("reset-transform",!1)},Se._proto=Se.prototype;const we=Se;let be=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)};be.prototype.dispose=function(){this._dt&&(this._dt.unlisten("dataChanged",this._onDataChanged),this._dt=null)},be.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())},be.prototype.setField=function(t){this._field!==t&&(this._field=t,this._requestRecalculation())},be.prototype.disableOnDemandMode=function(t){let e=!1===t;this._onDemandMode!==e&&(this._onDemandMode=e,this._requestRecalculation())},be.prototype.setColumnDataGetter=function(t){this._colDataGetter!==t&&(this._colDataGetter=t,this._requestRecalculation())},be.prototype.getColumnDataGetter=function(){return this._colDataGetter},be.prototype.getSum=function(){return this._updateStats(),this._sum},be.prototype.getDataCount=function(){return this._updateStats(),this._count},be.prototype.getMin=function(){return this._updateStats(),this._min},be.prototype.getMax=function(){return this._updateStats(),this._max},be.prototype.getAbsoluteMax=function(){this._updateStats();let t=this._max>=0?this._max:-this._max,e=this._min>=0?this._min:-this._min;return t>=e?t:e},be.prototype.getAverage=function(){return this._updateStats(),this._sum/this._count},be.prototype.getMean=be.prototype.getAverage,be.prototype.getMidRange=function(){return this._updateStats(),.5*(this._max+this._min)},be.prototype.getCachedColumnData=function(){return this._dirty?this._recalculate():this._cacheData||(this._cacheData=this._getColData()),this._cacheData},be.prototype.markDirty=function(){return!!this._onDemandMode&&(this._dirty=!0,this._dirty)},be.prototype._getColData=function(){return this._colDataGetter?this._colDataGetter(this._field,this._dt):this._dt.getColumnData(this._field)},be.prototype._requestRecalculation=function(){this.markDirty()||this._recalculate()},be.prototype._updateStats=function(){this._dirty&&this._recalculate()},be.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)return;let t=this._cacheData=this._getColData(),e=t.length;if(!e)return;let n,i=be._isDataNumeric,o=0;for(;o<e;)if(n=+t[o++],i(n)){this._sum=this._min=this._max=n,++this._count;break}for(;o<e;)n=+t[o],i(n)&&(this._sum+=n,n<this._min?this._min=n:n>this._max&&(this._max=n),++this._count),++o},be.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;let 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()}},be.prototype._updateRowData=function(t){let e=this._dt.getPreviousData(t,this._field),n=this._dt.getData(t,this._field);if(e===n)return;let i=be._isDataNumeric(n);if(be._isDataNumeric(e)){if(this._min===e&&(!i||n>this._min))return void this._recalculate();if(this._max===e&&(!i||n<this._max))return void this._recalculate();this._sum-=e,--this._count}i&&(this._sum+=n,n>=this._min||(this._min=n),n<=this._max||(this._max=n),++this._count)},be._isDataNumeric=function(t){return"number"==typeof t&&t==t},be.prototype.addRef=function(t){return t&&this._refs.indexOf(t)<0&&this._refs.push(t),this._refs.length},be.prototype.deRef=function(t){if(t){let e=this._refs.indexOf(t);e>=0&&this._refs.splice(e,1)}return this._refs.length},be.prototype.getRefCount=function(){return this._refs.length},be.prototype._dt=null,be.prototype._field="",be.prototype._onDemandMode=!0,be.prototype._dirty=!0,be.prototype._cacheData=null,be.prototype._sum=0,be.prototype._min=NaN,be.prototype._max=NaN,be.prototype._count=0,be.prototype._colDataGetter=null,be.prototype._refs;const Re=be;let ve=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")};o.inherits(ve,ct),ve.prototype._dv=null,ve.prototype._dt=null,ve.prototype._wrapIndex=0,ve.prototype._rids,ve.prototype._dataConflator=null,ve.prototype._onDataChanged=function(t){if(this._dv){let e=this._dv.getVisibleRowIds(!0);this._refreshRids(e)&&(t.globalChange||(t.globalChange=!0),this._dispatch("dataChanged",t))}},ve.prototype._onWrapSizeChanged=function(t){this._refreshRids(t.rids)&&this._dispatch("dataChanged",wt._globalChangeArg)},ve.prototype._refreshRids=function(t){let e=!1;if(this._dv&&Array.isArray(t)){let n=this.getWrapSize();if(n>0){let i=n*this._wrapIndex;i<t.length?(e=!0,this._rids=t.slice(i,i+n)):this._rids.length&&(e=!0,this._rids.length=0)}}return e},ve.prototype.dispose=function(){this._dv&&(this.unlistenAll(),this._dv.unlisten("dataChanged",this._onDataChanged),this._dv.unlisten("wrapSizeChanged",this._onWrapSizeChanged),this._dt=this._dv=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){let n=this.getAllRowIds(!0,e),i=[],o=n.length;for(let r=0;r<o;++r){let o=this._dt.getRowData(n[r]);o?i.push(o[t]):e&&i.push(null)}return i},ve.prototype.getRowId=function(t){return this._rids[t]||""},ve.prototype._toRowId=function(t){return"number"==typeof t?this._rids[t]||"":t||""},ve.prototype._toRowIds=function(t){let e=Array.isArray(t)?t.length:0,n=new Array(e),i=this._rids;for(let o=0;o<e;++o){let e=t[o];n[o]="number"==typeof e?i[e]||"":e||""}return n},ve.prototype.getAllRowIds=function(t,e){return t?this._rids:this._rids.slice(0)},ve.prototype.getVisibleRowIds=function(t){return t?this._rids:this._rids.slice(0)},ve.prototype.getSortedRowIds=function(t){return t?this._rids:this._rids.slice(0)},ve.prototype.getRowIndex=function(t){return this._rids.indexOf(t)},ve.prototype.getRowCount=function(){return this._rids.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,n){return this._dt.getMultipleRowData(t,e,n)},ve.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},ve.prototype.setData=function(t,e,n){return!!this._dt&&this._dt.setData(t,e,n)},ve.prototype.setRowData=function(t,e,n){return this._dv.setRowData(t,e,n)},ve.prototype.setColumnData=function(t,e,n){this._dt&&this._dt.setColumnData(t,e,n)},ve.prototype.setDataAt=function(t,e,n){let i=this.getRowId(t);return!(!i||!this._dt)&&this._dt.setData(i,e,n)},ve.prototype.setRowDataAt=function(t,e,n){let i=this.getRowId(t);return this.setRowData(i,e,n)},ve.prototype.insertRow=function(t,e,n){let i=this._toRowId(t);return this._dv.insertRow(i,e,n)},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){let n=this._toRowId(e),i=Array.isArray(t)?t:[t],o=this._toRowIds(i);return this._dv.moveRow(o,n)},ve.prototype.getDataTable=function(){return this._dt},ve.prototype.getDataSource=function(){return this._dv},ve.prototype.setDataSource=function(t){},ve.prototype.setConflationRate=function(t){this._dv.setConflationRate(t)},ve.prototype.getConflationRate=function(){return this._dv.getConflationRate()},ve.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},ve.prototype.sort=function(t,e,n,i){this._dv.sort(t,e,n,i)},ve.prototype.sortOnce=function(t,e){this._dv.sortOnce(t,e)},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.isSorting=function(){return this._dv.isSorting()},ve.prototype.hideRow=function(t,e){this.showRows([t],!1===e)},ve.prototype.hideRows=function(t,e){this.showRows(t,!1===e)},ve.prototype.showRows=function(t,e){let n=this._toRowIds(t);this._dv.showRows(n,e)},ve.prototype.unhideAllRows=function(){this._dv.unhideAllRows()},ve.prototype.hasHiddenRow=function(){return this._dv.hasHiddenRow()},ve.prototype.filterIn=function(t,e,n){return this._dv.filterIn(t,e,n)},ve.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},ve.prototype.filterInOnce=function(t,e,n){this._dv.filterInOnce(t,e,n)},ve.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},ve.prototype.clearFilter=function(){this._dv.clearFilter()},ve.prototype.disablePageCorrection=function(t){},ve.prototype.setPage=function(t){return!1},ve.prototype.gotoPage=ve.prototype.setPage,ve.prototype.nextPage=function(){return!1},ve.prototype.previousPage=function(){return!1},ve.prototype.prevPage=ve.prototype.previousPage,ve.prototype.lastPage=function(){return!1},ve.prototype.firstPage=function(){return!1},ve.prototype.getCurrentPage=function(){return 1},ve.prototype.getPageIndex=ve.prototype.getCurrentPage,ve.prototype.isOnLastPage=function(){return!0},ve.prototype.isOnFirstPage=function(){return!0},ve.prototype.getPageSize=function(){return 0},ve.prototype.getPageCount=function(){return 1},ve.prototype.getTotalPages=ve.prototype.getPageCount,ve.prototype.setPageSize=function(t){},ve.prototype.groupBy=function(t,e){this._dv.groupBy(t,e)},ve.prototype.addGroup=function(t){this._dv.addGroup(t)},ve.prototype.sortGroups=function(t){this._dv.sortGroups(t)},ve.prototype.moveGroup=function(t,e){this._dv.moveGroup(t,e)},ve.prototype.setPredefinedGroups=function(t){this._dv.setPredefinedGroups(t)},ve.prototype.addFooter=function(t){this._dv.addFooter(t)},ve.prototype.removeFooter=function(){this._dv.removeFooter()},ve.prototype.enableMultiGroup=function(t){this._dv.enableMultiGroup(t)},ve.prototype.getGroupByRowId=function(t){return this._dv.getGroupByRowId(t)},ve.prototype.getGroup=function(t){return this._dv.getGroup(t)},ve.prototype.getAllGroups=function(t){return this._dv.getAllGroups(t)},ve.prototype.getGroupList=function(){return this._dv.getGroupList()},ve.prototype.getGroupId=function(){return this._dv.getGroupId()},ve.prototype.getGroupValue=function(){return this._dv.getGroupValue()},ve.prototype.getGroupRowId=function(){return this._dv.getGroupRowId()},ve.prototype.getFooterRowIndex=function(t){return this._dv.getFooterRowIndex(t)},ve.prototype.getFooterRowIds=function(){return this._dv.getFooterRowIds()},ve.prototype.hasGroup=function(){return this._dv.hasGroup()},ve.prototype.getGroupRows=function(){return null},ve.prototype.getGroupLevel=function(t){let e=this._toRowId(t);return this._dv.getGroupLevel(e)},ve.prototype.enableColumnStats=function(t,e,n){return this._dv.enableColumnStats(t,e,n)},ve.prototype.getColumnStats=function(t){return this._dv.getColumnStats(t)},ve.prototype.hide=function(t){return this._dv.hide(t)},ve.prototype.isHidden=function(){return this._dv.isHidden()},ve.prototype.isHiddenRow=function(t){return this._dv.isHiddenRow(t)},ve.prototype.collapse=function(t){this._dv.collapse(t)},ve.prototype.collapseAllGroups=function(t){this._dv.collapseAllGroups(t)},ve.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},ve.prototype.isCollapsed=function(){return this._dv.isCollapsed()},ve.prototype.enableContentAsHeader=function(t){this._dv.enableContentAsHeader(t)},ve.prototype.getVisibleRowCount=function(){return this._rids.length},ve.prototype.isRowDataInGroup=function(t,e){return this._dv.isRowDataInGroup(t,e)},ve.prototype.isRowIdInGroup=function(t,e){return this._dv.isRowIdInGroup(t,e)},ve.prototype.addRowExpansion=function(t,e){this._dv.addRowExpansion(t,e)},ve.prototype.removeRowExpansion=function(t){this._dv.removeRowExpansion(t)},ve.prototype.toggleRowExpansion=function(t,e,n){let i=this._toRowId(t);this._dv.toggleRowExpansion(i,e,n)},ve.prototype.removeAllRowExpansions=function(){this._dv.removeAllRowExpansions()},ve.prototype.getRowsWithExpansion=function(t,e){return this._dv.getRowsWithExpansion(t,e)},ve.prototype.getExpansionParents=function(t,e){return this._dv.getExpansionParents(t,e)},ve.prototype.isRowExpansion=function(t){return this._dv.isRowExpansion(t)},ve.prototype.hasRowExpansion=function(t){return this._dv.hasRowExpansion(t)},ve.prototype.getRowExpansionId=function(t,e){return this._dv.getRowExpansionId(t,e)},ve.prototype.getRowExpansionIndex=function(t){return this._dv.getRowExpansionIndex(t)},ve.prototype.searchAll=function(t,e){return this._dv.searchAll(t,e)},ve.prototype.searchPrev=function(t,e){let n=this._toRowId(t);return this._dv.searchPrev(n,e)},ve.prototype.searchNext=function(t,e){let n=this._toRowId(t);return this._dv.searchNext(n,e)},ve.prototype.stall=function(t){return this._dv.stall(t)},ve.prototype.enableAutoGroupRemoval=function(t){return this._dv.enableAutoGroupRemoval(t)},ve.prototype.enableAutoGroupHiding=function(t){return this._dv.enableAutoGroupHiding(t)},ve.prototype.synchronizeRowOrder=function(){this._dv.synchronizeRowOrder()},ve.prototype.setSegmentSeparator=function(t,e){let n=this._toRowId(t);return this._dv.setSegmentSeparator(n,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.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},ve.prototype.collapseSegment=function(t,e){let n=this._toRowId(t);return this._dv.collapseSegment(n,e)},ve.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},ve.prototype.expandAllSegments=function(){return this._dv.expandAllSegments()},ve.prototype.setSegmentCollapsingLogic=function(){},ve.prototype.isSegmentCollapsed=function(t){let e=this._toRowId(t);return this._dv.isSegmentCollapsed(e)},ve.prototype.fillSegment=function(t){let e=this._toRowId(t);this._dv.fillSegment(e)},ve.prototype.fillSegments=function(){this._dv.fillSegments()},ve.prototype.addSegmentChild=function(t,e){let n=this._toRowId(t),i=this._toRowId(e);return this._dv.addSegmentChild(n,i)},ve.prototype.addSegmentChildren=function(t,e){let n=this._toRowId(t),i=this._toRowIds(e);return this._dv.addSegmentChildren(n,i)},ve.prototype.removeSegmentChild=function(t,e){let n=this._toRowId(t),i=this._toRowId(e);return this._dv.removeSegmentChild(n,i)},ve.prototype.removeSegmentChildren=function(t,e){let n=this._toRowId(t),i=this._toRowIds(e);return this._dv.removeSegmentChildren(n,i)},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.sortSegments=function(t){this._dt.sortSegments(t)},ve.prototype.getWrapSize=function(){return this._dv.getWrapSize()},ve.prototype.getWrappedViews=function(){return this._dv.getWrappedViews()},ve.prototype.wrapView=function(t){this._dv.wrapView(t)},ve.prototype.dump=function(t){return ft.constructTable(this.getMultipleRowData(this._rids),t,this._rids)},ve.prototype.log=function(t){console.table(this.dump(t))},ve.prototype.isRowFiltered=function(t,e){return this._dv.isRowFiltered(t,e)};const Ie=ve;let De=function(t){let n=this;n._groupFilterLogic=n._groupFilterLogic.bind(n),n._internalGroupSortingLogic=n._internalGroupSortingLogic.bind(n),n._onDataChanged=n._onDataChanged.bind(n),n._onGroupAdded=n._onGroupAdded.bind(n),n._onBeforeGroupAdded=n._onBeforeGroupAdded.bind(n),n._onRefreshTimeout=n._onRefreshTimeout.bind(n),n._updateWrapCount=n._updateWrapCount.bind(n),n._byRemovalMap=n._byRemovalMap.bind(n),n._rids=[],n._sortingDefs=[],n._columnStats={},n._shared={},n._conflator=new e(this._onDataChanged,0),n._conflator.disable(),n._addEvents("dataChanged","preDisposed","pageIndexChanged","pageCountChanged","groupAdded","beforeGroupAdded","groupCriteriaChanged","beforeFiltering","wrapCountChanged","wrapSizeChanged"),n.setDataSource(t)};o.inherits(De,ct),De.prototype._rids,De.prototype._groupView=null,De.prototype._pageView=null,De.prototype._expansionView=null,De.prototype._hiddenRids=null,De.prototype._collapsedRids=null,De.prototype._excludedRids=null,De.prototype._emptySegmentFiltering=!1,De.prototype._separatorFiltering=!1,De.prototype._expansionMap=null,De.prototype._expansionChildren=null,De.prototype._expansionCount=0,De.prototype._dt=null,De.prototype._parent=null,De.prototype._shared=null,De.prototype._sortingDefs=null,De.prototype._userFilter=null,De.prototype._filteringOut=!1,De.prototype._refreshTimerId=0,De.prototype._groupSortingLogic=null,De.prototype._pageCorrection=!0,De.prototype._pageSize=0,De.prototype._pageIndex=1,De.prototype._lastPageIndex=0,De.prototype._groupCriteria=null,De.prototype._preDefGroups=null,De.prototype._preDefGroupsDirty=!1,De.prototype._groupMembers=null,De.prototype._groupList=null,De.prototype._groupRows=null,De.prototype._groupId="",De.prototype._groupColor="",De.prototype._groupValue,De.prototype._groupRowId="",De.prototype._footerRowIds=null,De.prototype._groupLevel=0,De.prototype._groupViewDirty=!1,De.prototype._columnStats,De.prototype._hidden=!1,De.prototype._hiddenHeaderRow=!1,De.prototype._collapsed=!1,De.prototype._collapsible=!0,De.prototype._showOnlyFirstMember=!1,De.prototype._beingAdded=!1,De.prototype._conflator=null,De.prototype._wrappedViews=null,De.prototype._wrapSize=0,De.prototype._wrapTimerId=0,De.prototype._stalledSorting=!1,De.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(let t in this._columnStats)this._columnStats[t].dispose();this._columnStats=null}},De.prototype.getData=function(t,e){return this._dt.getData(t,e)},De.prototype.getRowData=function(t){return this._dt.getRowData(t)},De.prototype.getColumnData=function(t,e){let n=this.getAllRowIds(!0,e),i=[],o=n.length;for(let r=0;r<o;++r){let o=this._dt.getRowData(n[r]);o?i.push(o[t]):e&&i.push(null)}return i},De.prototype.getRowId=function(t){return this._rebuildRowIdsFromChildren(),this._getRids()[t]||""},De.prototype._toRowId=function(t){return"number"==typeof t?(this._rebuildRowIdsFromChildren(),this._getRids()[t]||""):t||""},De.prototype._toRowIds=function(t){let e=Array.isArray(t)?t.length:0,n=new Array(e),i=this._getRids();for(let o=0;o<e;++o){let e=t[o];"number"==typeof e?(this._rebuildRowIdsFromChildren(),n[o]=i[e]||""):n[o]=e||""}return n},De.prototype.getAllRowIds=function(t,e){this._rebuildRowIdsFromChildren();let n=e?this._getRids():this._pageView||this._rids;return t?n:n.slice(0)},De.prototype.getVisibleRowIds=function(t){this._rebuildRowIdsFromChildren();let e=this._getRids();return t?e:e.slice(0)},De.prototype.getSortedRowIds=function(t){return this._rebuildRowIdsFromChildren(),t?this._rids:this._rids.slice(0)},De.prototype.getRowIndex=function(t){return this._rebuildRowIdsFromChildren(),this._getRids().indexOf(t)},De.prototype.getRowCount=function(){return this._getRids().length},De.prototype.getDataAt=function(t,e){return this._dt.getData(this.getRowId(t),e)},De.prototype.getRowDataAt=function(t){return this._dt.getRowData(this.getRowId(t))},De.prototype.getPreviousData=function(t,e){return this._dt.getPreviousData(t,e)},De.prototype.getMultipleRowData=function(t,e,n){return this._dt.getMultipleRowData(t,e,n)},De.prototype.getAllRowData=function(){return this.getMultipleRowData(this.getAllRowIds(!0))},De.prototype.setData=function(t,e,n){return!!this._dt&&this._dt.setData(t,e,n)},De.prototype.setRowData=function(t,e,n){return!(!t||!this._dt||this.isRowExpansion(t))&&this._dt.setRowData(t,e,n)},De.prototype.setColumnData=function(t,e,n){this._dt&&this._dt.setColumnData(t,e,n)},De.prototype.setDataAt=function(t,e,n){let i=this.getRowId(t);return!(!i||!this._dt)&&this._dt.setData(i,e,n)},De.prototype.setRowDataAt=function(t,e,n){let i=this.getRowId(t);return this.setRowData(i,e,n)},De.prototype.insertRow=function(t,e,n){this._rebuildRowIdsFromChildren();let i=this._toRowId(t);return this._dt?this._dt.insertRow(i,e,n):""},De.prototype.removeRow=function(t){this._dt&&this._dt.removeRow(this._toRowId(t))},De.prototype.removeRows=function(t){this._dt&&this._dt.removeRows(this._toRowIds(t))},De.prototype.moveRow=function(t,e){let n=this._toRowId(e),i=Array.isArray(t)?t:[t],o=this._toRowIds(i);return this._dt.hasSegmentation()&&this.synchronizeRowOrder(),this._dt._moveRow(o,n)},De.prototype.swapRow=ut._deprecatedFunction,De.prototype.getDataTable=function(){return this._dt},De.prototype.getDataSource=function(){return this._parent},De.prototype.setDataSource=function(t){if(t){if(this._groupLevel>0)return;this._setParent(t),this._onDataChanged(wt._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={}},De.prototype.setConflationRate=function(t){this._conflator.disable(!t),this._conflator.setConflatingTime(t)},De.prototype.getConflationRate=function(){return this._conflator.getConflatingTime()},De.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)},De.prototype.getSortingLogics=function(){return this._dt?this._dt.getSortingLogics():null},De.prototype.sort=function(t,e,n,i){if(this._groupLevel>0)return void window.console.log("ERROR: Sub-group cannot be sorted individually");let o=this.getSortingLogics(),r=this._sortingDefs,s=r.length;if(Array.isArray(n))for(let e=n.length;--e>=0;)if("function"!=typeof n[e]){let i=Array.isArray(t)?t[e]:t;n[e]=o[i]||o._default}if(wt._buildSortContext(r,t,e,n||o),1===r.length&&0===r[0][3]&&(r.length=0),s<=0&&r.length<=0)return;if(this._shared.stalledRids)return;let l=!1;this._groupMembers||r.length<=0||i?(l=!0,this._updateRowIds()):l=this._sort(),l&&this._dispatchDataChange(wt._positionChangeArg)},De.prototype.sortOnce=function(t,e){this.sort(t,e),this._sortingDefs.length=0},De.prototype.setSortingLogic=function(t){this._dt&&this._dt.setSortingLogic(t)},De.prototype.setColumnSortingLogic=function(t,e){this._dt&&this._dt.setColumnSortingLogic(t,e)},De.prototype.getColumnSortingLogic=function(t){return this._dt?this._dt.getColumnSortingLogic(t):null},De.prototype.isSorting=function(){return this._sortingDefs.length>0},De.prototype.hideRow=function(t,e){this.hideRows([t],e)},De.prototype.hideRows=function(t,e){e=!1!==e;let n=this._hiddenRids;if(e)n||(n=this._hiddenRids={});else if(!n)return;let i=this._toRowIds(t),o=!1;for(let t=i.length;--t>=0;){let r=i[t];r&&(e?n[r]||(n[r]=!0,o=!0):n[r]&&(delete n[r],o=!0))}if(o){if(!e){let t=!1;for(let e in n){t=!0;break}t||(n=this._hiddenRids=null)}this._refreshAndNotify()}},De.prototype.showRows=function(t,e){this.hideRows(t,!1===e)},De.prototype.unhideAllRows=function(){this._hiddenRids&&(this._hiddenRids=null,this._refreshAndNotify())},De.prototype.hasHiddenRow=function(){return!!this._hiddenRids},De.prototype.filterIn=function(t,e,n){let i=this._getFilterLogic(t,e),o=!0===n;return!!(this._userFilter!==i||"function"==typeof t||i&&o!==this._filteringOut)&&(this._shared.filterLogic=i,this._userFilter=i,this._filteringOut=o,this._refreshAndNotify(),!0)},De.prototype.filterOut=function(t,e){return this.filterIn(t,e,!0)},De.prototype.filterInOnce=function(t,e,n){let i=this._getFilterLogic(t,e),o={};if(!this._getRemovalMap(o,i,!0===n))return;let r=this._removeRowIds(o);this._updatePageCount()||this._transformView(r)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(Object.keys(o))},De.prototype.filterOutOnce=function(t,e){this.filterInOnce(t,e,!0)},De.prototype._removeRowIds=function(t){let e=De._removeArrayItems(this._rids,t);if(this._groupView&&(e=De._removeArrayItems(this._groupView,t)),this._groupMembers){let e=this._groupList.length;for(let n=0;n<e;++n){let e=this._groupList[n];this._groupMembers[e]._removeRowIds(t)}}return e},De.prototype.clearFilter=function(){this._userFilter&&(this._userFilter=null,this._shared.filterLogic=null,this._refreshAndNotify())},De.prototype.disablePageCorrection=function(t){this._pageCorrection=!1===t},De.prototype.setPage=function(t){let e=this._setPage(t);return e&&this._dispatchGlobalChange(),e},De.prototype.gotoPage=De.prototype.setPage,De.prototype.nextPage=function(){return this.gotoPage(this._pageIndex+1)},De.prototype.previousPage=function(){return this.gotoPage(this._pageIndex-1)},De.prototype.prevPage=De.prototype.previousPage,De.prototype.lastPage=function(){return this.gotoPage(this._lastPageIndex)},De.prototype.firstPage=function(){return this.gotoPage(0)},De.prototype.getCurrentPage=function(){return this._pageIndex},De.prototype.getPageIndex=De.prototype.getCurrentPage,De.prototype.isOnLastPage=function(){return this._pageIndex===this._lastPageIndex},De.prototype.isOnFirstPage=function(){return 1===this._pageIndex},De.prototype.getPageSize=function(){return this._pageSize},De.prototype.getPageCount=function(){return this._lastPageIndex},De.prototype.getTotalPages=De.prototype.getPageCount,De.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())},De.prototype.groupBy=function(t,e){if(this._shared.multiGroupRow=!1,this._groupCriteria){if(this._groupList&&this._groupList.length>0){for(let t in this._groupMembers)this._groupMembers[t].dispose();this._groupMembers={},this._groupList.length=0}this._groupCriteria=null}let n,i;if(null!=e&&this._setPredefinedGroups(e),t&&0===this._groupLevel){let e;for(this._groupCriteria=[],e=Array.isArray(t)?t:[t],i=e.length,n=0;n<i;++n){let t=e[n];"string"==typeof t?this._groupCriteria.push(this._defaultGroupCriteria.bind(this,t)):t&&this._groupCriteria.push(t)}}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(i=this._footerRowIds.length,n=0;n<i;++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()},De.prototype.addGroup=function(t){if(this._groupMembers)if(isArray(t)){let e=t,n=e.length;for(let t=0;t<n;++t)this._addGroup(e[t])}else this._addGroup(t)},De.prototype.sortGroups=function(t){if(this._groupMembers&&(this._groupSortingLogic=null==t?De._defaultGroupSortingLogic:t||null,this._groupSortingLogic)){this._groupList.sort(this._internalGroupSortingLogic);for(let t=this._groupList.length;--t>=0;){let e=this._groupList[t];this._groupMembers[e].sortGroups(this._groupSortingLogic)}this._groupViewDirty=!0,this._groupLevel<=0&&this._dispatchGlobalChange()}},De.prototype.moveGroup=function(t,e){let n=this.getGroup(t);if(!n)return;let i=n.getDataSource(),o=n.getGroupId(),r=i._groupList.indexOf(o);r!==e&&r+1!==e&&(i._groupList.splice(r,1),r<e&&--e,i._groupList.splice(e,0,o),this._requestRebuildingRowIds(!1))},De.prototype.setPredefinedGroups=function(t){this._setPredefinedGroups(t),this._groupMembers&&this._refreshAndNotify()},De.prototype._setPredefinedGroups=function(t){if(this._preDefGroups===t)return;this._preDefGroups&&(this._preDefGroups.length=0);let e=!1;if(t)for(let n=t.length;--n>=0;)if(Array.isArray(t[n])){e=!0;break}e?this._preDefGroups=t:Array.isArray(t)?this._preDefGroups=[t]:this._preDefGroups=null,this._preDefGroupsDirty=!0},De.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(let e=0;e<t;++e){let t=this._groupRowId+"_footer"+(this._footerRowIds.length||"");this._footerRowIds.push(t),this._groupRows[t]=this}this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},De.prototype.removeFooter=function(){if(this._footerRowIds){let t=this._footerRowIds.length;for(let e=0;e<t;++e)delete this._groupRows[this._footerRowIds[e]];this._footerRowIds=null,this._beingAdded||this._requestRebuildingRowIds(this._collapsed)}},De.prototype.enableMultiGroup=function(t){this._shared.multiGroupRow=!1!==t},De.prototype.getGroupByRowId=function(t){return this._groupRows&&this._groupRows[t]||null},De.prototype.getGroup=function(t){if(!this._groupMembers)return null;let e;if("number"==typeof t){if(e=this._groupList[t],!e)return null}else e=t+"";let n=this._groupMembers[e];if(n)return n;let i=e;return n=this._groupRows[i],n||this._getGroupByContentRowId(i)},De.prototype._getGroupByContentRowId=function(t){if(this._groupMembers)for(let e=0;e<this._groupList.length;e++){let n=this._groupList[e],i=this._groupMembers[n]._getGroupByContentRowId(t);if(i)return i}else if(-1!==this._rids.indexOf(t))return this;return null},De.prototype.getAllGroups=function(t){if(t||(t=[]),this._groupMembers){let e=this._groupList.length;for(let n=0;n<e;++n){let e=this._groupList[n],i=this._groupMembers[e];t.push(i),i.getAllGroups(t)}}return t},De.prototype.getGroupList=function(){return this._groupList},De.prototype.getGroupId=function(){return this._groupId},De.prototype.getGroupValue=function(){return this._groupValue},De.prototype.getGroupRowId=function(){return this._groupRowId},De.prototype.getFooterRowIndex=function(t){if(this._footerRowIds)for(let e=this._footerRowIds.length;--e>=0;)if(this._footerRowIds[e]===t)return e;return-1},De.prototype.getFooterRowIds=function(){return this._footerRowIds},De.prototype.hasGroup=function(){return!!this._groupMembers},De.prototype.getGroupRows=function(){return null},De.prototype.getGroupLevel=function(t){if(null!=t&&this._groupRows){if("number"!=typeof t){let e=this.getGroup(t);return e?e._groupLevel:-1}{this._rebuildRowIdsFromChildren();let e=this._getRids(),n=e[t];for(;n;){let i=this._groupRows[n];if(i)return i._groupLevel;n=e[--t]}}}return this._groupLevel},De.prototype.enableColumnStats=function(t,e,n){if(!t)return null;let i=!1!==e,o=this._columnStats[t];if(i?(o||(o=new Re(this,t),this._columnStats[t]=o),o.addRef(n)):o&&(o.deRef(n)||(o.dispose(),delete this._columnStats[t])),this._groupMembers)for(let i=this._groupList.length;--i>=0;){let o=this._groupList[i];this._groupMembers[o].enableColumnStats(t,e,n)}return o||null},De.prototype.getColumnStats=function(t){return this._columnStats[t]||null},De.prototype.hide=function(t){let e=!1!==t;return this._hidden!==e&&(this._hidden=e,this._refreshAndNotify(),!0)},De.prototype.isHidden=function(){return this._hidden},De.prototype.isHiddenRow=function(t){return!!this._hiddenRids&&!0===this._hiddenRids[t]},De.prototype._isHeaderRowShown=function(){return!(this._hiddenHeaderRow||this._shared.filterLogic&&0===this._rids.length||this._shared.autoGroupHiding&&null==this._groupValue)},De.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},De.prototype.collapse=function(t){this._setCollapse(!1!==t)&&(this._shared.contentAsHeader?this._hiddenHeaderRow&&this._requestRebuildingRowIds(this._showOnlyFirstMember):this._groupLevel>0&&this._requestRebuildingRowIds(this._collapsed))},De.prototype.collapseAllGroups=function(t){let e=this.getAllGroups(),n=e.length;if(n){let i=!1!==t;for(let t=0;t<n;++t)e[t]._setCollapse(i);this._requestRebuildingRowIds(!1)}},De.prototype.toggleCollapsedState=function(){this.collapse(!this.isCollapsed())},De.prototype.isCollapsed=function(){return this._collapsed||this._showOnlyFirstMember},De.prototype.enableContentAsHeader=function(t){this._shared.contentAsHeader=!1!==t},De.prototype.setDefaultCollapse=function(t){this._shared.defaultCollapse=!!t},De.prototype.getDefaultCollapse=function(){return!!this._shared.defaultCollapse},De.prototype.isCollapsible=function(){return this._collapsible},De.prototype.disableCollapsing=function(t){this._collapsible=!(!1!==t)},De.prototype.setGroupColor=function(t){1===this._groupLevel&&(this._groupColor=t)},De.prototype.getGroupColor=function(){return 0===this._groupLevel?"":1===this._groupLevel?this._groupColor:this._parent.getGroupColor()},De.prototype._getFirstHiddenRids=function(){if(this._shared.contentAsHeader&&this._showOnlyFirstMember){let t=this._rids;if(Array.isArray(t)&&t.length)return[t[0]]}return null},De.prototype.getVisibleRowCount=function(){return this._collapsed?0:(this._rebuildRowIdsFromChildren(),this._getRids().length)},De.prototype.isRowDataInGroup=function(t,e){let n=this._groupCriteria,i=this._groupLevel;if(!e||e===this.getGroupId())return this._isAllowedInGroup(null,t);for(let o=i;o<n.length;o++)if(n[o](t).indexOf(e)>=0)return!0;return!1},De.prototype.isRowIdInGroup=function(t,e){let n=this.getRowData(t);return!!n&&this.isRowDataInGroup(n,e)},De._getDataViewExpansionId=function(t,e){return t+"_ex"+e},De.prototype.addRowExpansion=function(t,e){if(this._groupLevel>0)return;if(!e||e<0){if(null!=e)return;e=1}let n=this._rids.indexOf(t);if(n<0)return;let i=0;this._expansionMap?i=this._expansionMap[t]||0:(this._expansionMap={},this._expansionChildren={});let o=i+e;this._expansionMap[t]=o;for(let e=i;e<o;e++)this._expansionChildren[De._getDataViewExpansionId(t,e)]=t;if(i||this._expansionCount++,!this._groupViewDirty&&this._updateExpansionView()){let e={};e.rid=t,e.type="inserted",e.nextRid=this._rids[n+1],e.fallback=n,this._dispatchDataChange(e)}},De.prototype.removeRowExpansion=function(t){if(!this._expansionMap)return;let e=this._expansionMap[t];if(!e)return;let n=new Array(e);for(let i=0;i<e;++i)n[i]=De._getDataViewExpansionId(t,i),delete this._expansionChildren[n[i]];delete this._expansionMap[t],this._expansionCount--,this._groupViewDirty||this._updateExpansionView()&&(1===e?this._dispatchRowRemoved(n[0]):this._dispatchMultiRowRemoved(n))},De.prototype.toggleRowExpansion=function(t,e,n){let i=this._toRowId(t);(e=null!=e?!0===e:!this.hasRowExpansion(i))?this.addRowExpansion(i,n):this.removeRowExpansion(i)},De.prototype.removeAllRowExpansions=function(){this._expansionMap&&(this._expansionMap=null,this._expansionCount=0,this._expansionView=null,this._expansionChildren=null,this._refreshAndNotify())},De.prototype.getRowsWithExpansion=function(t,e){if(!this._expansionMap)return[];let n=this._expansionView,i=n.length;(null==e||e>i)&&(e=i),t>0||(t=0);let o=this._expansionCount,r=new Array(i);for(let i=t;i<e;++i){let t=n[i];if(this._expansionMap[t]&&(r[i]=t,--o<=0))break}return r},De.prototype.getExpansionParents=function(t,e){let n=[];if(this._expansionMap){let i=this._expansionView,o=i.length;(null==e||e>o)&&(e=o),(!t||t<0)&&(t=0);for(let o=t;o<e;++o)n[o]=this._expansionChildren[i[o]]||""}return n},De.prototype.getExpansionParentByRowId=function(t){return this._expansionChildren&&this._expansionChildren[t]||""},De.prototype.isRowExpansion=function(t){return!!this._expansionChildren&&!!this._expansionChildren[t]},De.prototype.hasRowExpansion=function(t){return!!this._expansionMap&&!!this._expansionMap[t]},De.prototype.getRowExpansionCount=function(t){return this._expansionMap&&this._expansionMap[t]||0},De.prototype.getRowExpansionId=function(t,e){return this._expansionMap&&(e||(e=0),e<(this._expansionMap[t]||0))?De._getDataViewExpansionId(t,e):""},De.prototype.getRowExpansionIndex=function(t){if(t){let e=t.match(/_ex(\d+)$/);if(e)return+e[1]}return-1},De.prototype._updateExpansionView=function(){let 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;let e=this._pageView||this._groupView||this._rids,n=e.length,i=this._expansionView?this._expansionView.length:0;this._expansionView?this._expansionView.length=n:this._expansionView=new Array(n);let o=this._expansionCount;for(let i=0,r=0;i<n;++i){let n=e[i];if(this._expansionView[r++]=n,o){let e=t[n]||0;if(e){for(let t=0;t<e;++t)this._expansionView[r++]=De._getDataViewExpansionId(n,t);--o}}}return i!==this._expansionView.length}return!1},De.prototype._transformView=function(t){let e=this._updatePaginationView(t);return e|=this._updateExpansionView(),!!e},De.prototype.searchAll=function(t,e){e||(e=[]),this._rebuildRowIdsFromChildren();let n=this._getRids(),i=n.length;for(let o=0;o<i;++o){let i=n[o],r=this._dt.getRowData(i);r&&t(r)&&e.push(i)}return e},De.prototype.searchPrev=function(t,e){this._rebuildRowIdsFromChildren();let n=this._getRids(),i=-1;"number"==typeof t?this._dt.getRowData(n[t])&&(i=t):i=n.indexOf(t);let o=-1,r=n.length;return i>0&&(o=this._searchRow(n,e,i-1,-1,-1),o>=0)||i>=0&&(o=this._searchRow(n,e,r-1,i,-1),o>=0)?o:-1},De.prototype.searchNext=function(t,e){this._rebuildRowIdsFromChildren();let n=this._getRids(),i=-1;if("number"==typeof t?this._dt.getRowData(n[t])&&(i=t):i=n.indexOf(t),i<0)return-1;let o=-1,r=n.length;return i<r-1&&(o=this._searchRow(n,e,i+1,r,1),o>=0)||i>0&&(o=this._searchRow(n,e,0,i,1),o>=0)?o:-1},De.prototype._searchRow=function(t,e,n,i,o){for(;n!==i;){let i=t[n],r=this._dt.getRowData(i);if(r&&e(r))return n;n+=o}return-1},De.prototype.stall=function(t){let e=!1!==t;if(!!this._shared.stalledRids===e)return!1;if(e){let t={};this._shared.stalledRids=t;let e=this._getRids();for(let n=e.length;--n>=0;)t[e[n]]=1}else this._shared.stalledRids=null,this._refreshAndNotify();return!0},De.prototype.stallSorting=function(t){let e=!1!==t;return this._stalledSorting!==e&&(this._stalledSorting=e,!e&&this.isSorting()&&this._sort()&&this._dispatchDataChange(wt._positionChangeArg),!0)},De.prototype.enableAutoGroupRemoval=function(t){return t=!1!==t,!!this._shared.autoGroupRemoval!==t&&(this._shared.autoGroupRemoval=t,this._triggerGroupRefreshing(),!0)},De.prototype.enableAutoGroupHiding=function(t){return t=!1!==t,!!this._shared.autoGroupHiding!==t&&(this._shared.autoGroupHiding=t,this._triggerGroupRefreshing(),!0)},De.prototype.synchronizeRowOrder=function(){!this._stalledSorting&&this.isSorting()&&this._dt._sort(this._sortingDefs)},De.prototype.setSegmentSeparators=function(t,e){return!!t&&((e=!1!==e)&&this.synchronizeRowOrder(),this._dt.setSegmentSeparators(t,e))},De.prototype.setSegmentSeparator=function(t,e){let n="";return"number"==typeof t?n=this.getRowId(t):"string"==typeof t&&(n=t),!!n&&(!1!==e&&this.synchronizeRowOrder(),this._dt.setSegmentSeparator(n,e))},De.prototype.unsetAllSegmentSeparators=function(){return this._dt.unsetAllSegmentSeparators()},De.prototype.hasSegmentation=function(){return this._dt.hasSegmentation()},De.prototype.isSegmentSeparator=function(t){return this._dt.isSegmentSeparator(t)},De.prototype.getSegment=function(t){return this._dt.getSegment(t)},De.prototype.getSegmentParent=function(t){return this._dt.getSegmentParent(t)},De.prototype.getSegmentLevel=function(t){return this._dt.getSegmentLevel(t)},De.prototype.getSegmentParentRowId=function(t){return this._dt.getSegmentParentRowId(t)},De.prototype.collapseSegment=function(t,e){e=!1!==e;let n=this._dt._getSegmentSeparators();if(n){let i=this._toRowId(t);if(n.collapseSegment(i,e))return this._refreshAndNotify(),!0}return!1},De.prototype.collapseSegments=function(t,e){e=!1!==e;let n=this._dt._getSegmentSeparators();return!(!n||!n.collapseSegments(t,e)||(this._refreshAndNotify(),0))},De.prototype.expandSegment=function(t,e){return this.collapseSegment(t,!1===e)},De.prototype.expandAllSegments=function(){let t=this._dt._getSegmentSeparators();return!(!t||!t.expandAllSegments()||(this._refreshAndNotify(),0))},De.prototype.setSegmentCollapsingLogic=function(){},De.prototype.isSegmentCollapsed=function(t){let e=this._dt._getSegmentSeparators();return!!e&&e.isCollapsedSegment(this._toRowId(t))},De.prototype.fillSegment=function(t){this._dt.fillSegment(this._toRowId(t))},De.prototype.fillSegments=function(){this._dt.fillSegments()},De.prototype.addSegmentChild=function(t,e,n){if(this._dt._getSegmentSeparators()){let i=this._toRowId(t),o=this._toRowId(e);return this._dt.addSegmentChild(i,o,n)}return!1},De.prototype.addSegmentChildren=function(t,e,n){if(this._dt._getSegmentSeparators()){let i=this._toRowId(t),o=this._toRowIds(e);return this._dt.addSegmentChildren(i,o,n)}return!1},De.prototype.setSegmentChildren=function(t){return!!this._dt._getSegmentSeparators()&&this._dt.setSegmentChildren(t)},De.prototype.removeSegmentChild=function(t,e){if(this._dt._getSegmentSeparators()){let n=this._toRowId(t),i=this._toRowId(e);return this._dt.removeSegmentChild(n,i)}return!1},De.prototype.removeSegmentChildren=function(t,e){if(this._dt._getSegmentSeparators()){let n=this._toRowId(t),i=this._toRowIds(e);return this._dt.removeSegmentChildren(n,i)}return!1},De.prototype.removeAllSegmentChildren=function(){return this._dt.removeAllSegmentChildren()},De.prototype.getSegmentIds=function(){return this._dt.getSegmentIds()},De.prototype.getSegmentChildIds=function(t){return this._dt.getSegmentChildIds(this._toRowId(t))},De.prototype.sortSeparators=function(t,e,n){let i=this._sortingDefs;if(i.length)n||(n=i[0][0]),e||(e=i[0][3]);else if(!t)return;this._dt.sortSeparators(t,e,n)},De.prototype.sortSegments=function(t){this._dt.sortSegments(t)},De.prototype.enableEmptySegmentFiltering=function(t){t=!1!==t,this._emptySegmentFiltering!==t&&(this._emptySegmentFiltering=t,this._userFilter&&this._refreshAndNotify())},De.prototype.enableSeparatorFiltering=function(t){t=!1!==t,this._separatorFiltering!==t&&(this._separatorFiltering=t,this._userFilter&&this._refreshAndNotify())},De.prototype.setSegmentClassification=function(t,e){return this._dt.setSegmentClassification(this._toRowId(t),e)},De.prototype.setSegmentDefaultCollapsing=function(t){return this._dt.setSegmentDefaultCollapsing(t)},De.prototype._getSharedObject=function(){return this._shared},De.prototype.getWrapSize=function(){return this._wrapSize},De.prototype.getWrappedViews=function(){return this._wrappedViews},De.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()},De.prototype._updateWrapCount=function(){this._wrapTimerId=0;let t,e=this._wrapSize,n=this._wrappedViews,i=n?n.length:0,o=0;if(e){let r=this.getVisibleRowIds(!0),s=r.length;if(o=Math.ceil(s/e),i<o)for(n||(n=this._wrappedViews=[]),t=i;t<o;++t)this._wrappedViews[t]=new Ie({dataView:this,wrapIndex:t,rids:r})}if(o<i){for(t=i;--t>=o;)this._wrappedViews[t].dispose();this._wrappedViews.length=o}e||(this._wrappedViews=null),i!==o&&this._dispatch("wrapCountChanged",{prevCount:i,newCount:o})},De.prototype.dump=function(t){this._rebuildRowIdsFromChildren();let e=this._getRids();return ft.constructTable(this.getMultipleRowData(e),t,e)},De.prototype.log=function(t){console.table(this.dump(t))},De.prototype._getRids=function(){return this._expansionView||this._pageView||this._groupView||this._rids},De.prototype._updateRowIds=function(t){if(this._groupViewDirty=!1,!this._parent||this._hidden)return void this._resetAllViews();if(this._shared.stalledRids)return;this._rids=t||this._parent.getAllRowIds(),this._dispatch("beforeFiltering",{}),this._excludedRids={};let e=0;e+=De._copyValidObjectKeys(this._excludedRids,this._hiddenRids);let n=this._dt._getSegmentSeparators(),i=n?n.getSegments():null,o=this._getRemovalMap(this._excludedRids,this._userFilter,this._filteringOut,this._separatorFiltering?null:i);if(e+=o,this._collapsedRids=null,n&&(o&&this._emptySegmentFiltering&&(e+=this._getEmptySegments(this._excludedRids,i)),this._collapsedRids=n.getCollapsedRows(),e+=De._copyValidObjectKeys(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{let t=this._updatePageCount();this._sort()||t||this._transformView()}},De.prototype._onDataChanged=function(t){if(this._conflator.conflate(t))return;let e=this._conflator.popAllData()||[t],n=e.length;if(1===n){let t=e[0];if(t.globalChange)return this._updateRowIds(),void this._dispatchDataChange(t);let n=t.type;"inserted"===n?this._onRowInserted(t):"removed"===n?this._onRowRemoved(t):this._onRowUpdated(t)}else{this._updateRowIds();let t=!0;for(let i=0;i<n;i++)if(!e[i].positionChangeOnly){t=!1;break}this._dispatchDataChange({globalChange:!0,positionChangeOnly:t,events:e})}},De.prototype._onRowInserted=function(t){if(this._shared.stalledRids)return 0;if(this.isRowFiltered(t.rid,t.rowData))return 0;let e=0;if(this._groupMembers){let n,i=this._resolveGroupId(t.rowData),o=i.length;o>1&&(this._shared.multiGroupRow=!0);for(let r=0;r<o;r++)if(n=i[r],this._groupMembers[n])e=this._groupMembers[n]._onRowInserted(t);else{let i=this._addGroup(n);i&&(t.globalChange=!0,i._onRowInserted(t),e=1)}t.globalChange&&(this._groupViewDirty=!0)}if(this._hidden)return e;let n=t.rid,i=t.rowData;if(!this._isAllowedInGroup(n,i))return e;let o,r=t.nextRid;o=this.isSorting()&&!t.segmentChanged?this._addDataRow(n):this._addDataRow(n,r,t.fallback);let s=this._updatePageCount(),l=this._sort();return l&&(t.globalChange=!0),t.globalChange?l||s||this._transformView():(t={rid:n,rowData:i,type:"inserted"},null!=r&&(t.nextRid=r,t.fallback=o),this._transformView(o)&&(t.globalChange=!0)),this._dispatchDataChange(t),1},De.prototype._onRowRemoved=function(t){if(this._shared.stalledRids)return 0;if(t.segmentChanged&&this.isSorting())return this._refreshAndNotify(),1;let e,n=0,i=t.rids;if(this._groupMembers){let o,r,s=t.rowData;if(!i&&s){for(o=this._resolveGroupId(s),e=0;e<o.length;e++)r=o[e],this._groupMembers[r]&&(n+=this._groupMembers[r]._onRowRemoved(t));n>1&&(this._groupViewDirty=!0)}else{let i=this._groupList.length;for(e=0;e<i;++e)r=this._groupList[e],n+=this._groupMembers[r]._onRowRemoved(t)}}let o,r,s=NaN,l=null;if(n=0,i){for(l=[],e=i.length;--e>=0;)o=i[e],r=this._removeDataRow(o),r>=0&&(l.push(o),r>=s||(s=r));n=l.length}else o=t.rid,r=this._removeDataRow(o),r>=0&&(l=[o],s=r,n=1);return n>0&&(this._updatePageCount()||this._transformView(s)?this._dispatchGlobalChange():this._dispatchMultiRowRemoved(l),this._shared.autoGroupRemoval&&this._groupRows&&this._rids.length<=0&&this._triggerGroupRefreshing(),this._hiddenHeaderRow&&this._requestRebuildingRowIds(!0)),n},De.prototype._onRowUpdated=function(t){let e,n,i=t.rid,o=t.rowData;if(this.isRowFiltered(i,o))return this._onRowRemoved(t)?1:0;if(this._groupMembers){let r=[],s=this._groupList.length;for(e=0;e<s;++e)n=this._groupList[e],r[this._groupMembers[n]._onRowUpdated(t)]=!0;t.globalChange&&(this._groupViewDirty=!0);let l=0;if(r[2]?l=2:r[1]?this._isAllowedInGroup(i,o)||(l=1):r[4]&&(l=4),this._groupLevel>0)1===l?(De._removeArrayItem(this._rids,i)>=0&&this._groupView&&De._removeArrayItem(this._groupView,i),this._shared.multiGroupRow&&(this._groupViewDirty=!0)):2!==l||this._hidden||(this._rids.indexOf(i)<0&&this._rids.push(i),this._groupViewDirty=!0,this._resolveGroupId(o).length>1&&(this._shared.multiGroupRow=!0));else{let s=r[1]&&r[2]||r[4];if(this._shared.multiGroupRow||!s){let i=this._resolveGroupId(o);for(e=0;e<i.length;e++){n=i[e];let o=this._addGroup(n);o&&(o._onRowInserted(t),l=1)}}!s&&!this._hidden&&this._rids.indexOf(i)<0&&this._addDataRow(i),4===l?this._shared.multiGroupRow?this._dispatchGlobalChange():this._dispatchDataChange(t):(this._groupViewDirty=!0,this._dispatchGlobalChange())}return l}return this._isAllowedInGroup(i,o)?this._rids.indexOf(i)<0?(this._onRowInserted(t),2):(this._shared.stalledRids||this._sort()&&(t.globalChange=!0),this._dispatchDataChange(t),4):this._onRowRemoved(t)?1:0},De.prototype._onGroupAdded=function(t){if(!this._hidden){let e=t.newGroup,n=e.getGroupRowId();this._groupView.push(n),this._groupViewDirty=!0,this._dispatch("groupAdded",t),ut.pushArrayItems(this._groupView,e.getFooterRowIds())}},De.prototype._onBeforeGroupAdded=function(t){this._dispatch("beforeGroupAdded",t)},De.prototype._requestRebuildingRowIds=function(t){this._groupMembers&&(this._groupViewDirty=!0),this._groupLevel>0?this._parent._requestRebuildingRowIds(t):(t?this._rebuildRowIdsFromChildren():this._updateRowIds(),this._dispatchGlobalChange())},De.prototype._refreshAndNotify=function(){this._updateRowIds(),this._dispatchGlobalChange()},De.prototype._onRefreshTimeout=function(){this._refreshTimerId=0,this._refreshAndNotify()},De.prototype._addDataRow=function(t,e,n){let i=this._getRowIndex(this._rids,e,n);return this._insertItems(this._rids,i,t),this._groupView?this._groupMembers?(this._groupViewDirty=!0,this._insertItems(this._groupView,-1,t)):i<0?this._insertItems(this._groupView,-1,t):(i=this._getRowIndex(this._groupView,e,n),this._insertItems(this._groupView,i,t)):i>=0?i:this._rids.length-1},De.prototype._insertItems=function(t,e,n){return e<0?(e=t.length,t.push(n)):t.splice(e,0,n),e},De.prototype._getRowIndex=function(t,e,n){if(null==e)return-1;let i=this._rids.indexOf(e);return i>=0?i:null==n||n>=t.length?-1:n},De.prototype._removeDataRow=function(t){let e=De._removeArrayItem(this._rids,t);return this._groupView&&e>=0&&(e=De._removeArrayItem(this._groupView,t)),e},De._removeArrayItem=function(t,e){let n=t.indexOf(e);return n>=0&&t.splice(n,1),n},De._removeArrayItems=function(t,e){let n=NaN,i=0;for(let o=t.length;--o>=0;)e[t[o]]?++i:i&&(n=o+1,t.splice(n,i),i=0);return i&&(t.splice(0,i),n=0),n},De._copyValidObjectKeys=function(t,e){if(e){let n=0;for(let i in e)e[i]&&(t[i]=1,++n);return n}return 0},De.prototype._isAllowedInGroup=function(t,e){if(this._groupLevel>0){let n=this;for(let i=this._groupLevel;--i>=0;){if(!n._groupFilterLogic(t,e))return!1;n=n.getDataSource()}}return!0},De.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)},De.prototype._sort=function(){if(this._groupMembers)return!1;if(this._stalledSorting)return!1;if(this._dt._getSegmentSeparators()||this.isSorting()){let t=this._rids,e=this._dt.getMultipleRowData(t),n=this._dt.getSegmentValues(t,!0),i=wt._performMultiLevelSorting(e,this._sortingDefs,n);if(i)return this._rids=wt._reorderItems(t,i),this._transformView(),!0}return!1},De.prototype._byRemovalMap=function(t){return!this._excludedRids[t]},De.prototype._getRemovalMap=function(t,e,n,i){if(!e)return 0;let o,r,s,l=this._rids,a=this._dt,u=0,h=l.length;if(i)for(r=h;--r>=0;)o=l[r],i[o]||(s=a.getRowData(o),s?e(o,s)===n&&(t[o]=1,++u):(t[o]=1,++u));else for(r=h;--r>=0;)o=l[r],s=a.getRowData(o),s?e(o,s)===n&&(t[o]=1,++u):(t[o]=1,++u);return u},De.prototype._getEmptySegments=function(t,e){let n=this._dt._getSegmentSeparators(),i=0;for(let o in e){let e=n.getSegment(o);if(e){let n=e.getChildren(),r=!0;for(let e in n)if(!t[e]){r=!1;break}r&&(t[o]=1,++i)}}return i},De.prototype._getFilterLogic=function(t,e){return null!=t?"function"==typeof t?t:"string"==typeof t?De._defaultFilterLogic.bind(null,t,e):De._defaultFilterLogic.bind(null,t+"",e):null},De.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)},De.prototype._updatePaginationView=function(t){let e=!1;if(this._pageView){t||(t=0);let n=this._pageSize*(this._pageIndex-1),i=this._pageSize+n;if(t<i){let t=this._groupView||this._rids;i>t.length&&(i=t.length);let o=i-n;this._pageView.length=o>=0?o:0;for(let e=n;e<i;++e)this._pageView[e-n]=t[e];e=!0}}return e},De.prototype._updatePageCount=function(){let t=1;if(this._pageSize>0){let e=this._groupView||this._rids,n=e.length>0?e.length:0;t=Math.ceil(n/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)},De.prototype._dispatchRowRemoved=function(t){t&&this._dispatchDataChange({type:"removed",rid:t})},De.prototype._dispatchMultiRowRemoved=function(t){if(t){let e=t.length;1===e?this._dispatchRowRemoved(t[0]):e>1&&this._dispatchDataChange({type:"removed",rids:t})}},De.prototype._dispatchGlobalChange=function(){this._dispatchDataChange(wt._globalChangeArg)},De.prototype._dispatchDataChange=function(t){this._dispatch("dataChanged",t),this._wrapSize&&!this._wrapTimerId&&(this._wrapTimerId=setTimeout(this._updateWrapCount))},De.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;let t=this._parent._columnStats;if(t)for(let e in t){let t=this.enableColumnStats(e),n=this._parent.getColumnStats(e);t&&n&&t.setColumnDataGetter(n.getColumnDataGetter())}}},De.prototype._populateGroups=function(){let t,e,n,i,o,r,s=this._rids;this._rids=[];let l={},a=[];for(e=s.length,t=0;t<e;++t){let e=s[t],n=this._dt.getRowData(e);if(n){o=this._resolveGroupId(n),r=o.length,r>1&&(this._shared.multiGroupRow=!0);for(let t=0;t<r;t++){i=o[t];let n=l[i];n?n.push(e):(n=[e],l[i]=n,a.push(i))}}}if(this._shared.autoGroupRemoval)for(e=this._groupList.length,t=e;--t>=0;)i=this._groupList[t],l[i]||(n=this._groupMembers[i],n&&!n._predefinedGroup&&this._removeGroupMember(t,i));let u=null;if(this._preDefGroups&&this._groupLevel<this._preDefGroups.length&&(u=this._preDefGroups[this._groupLevel]),e=this._groupList.length,this._preDefGroupsDirty)for(this._preDefGroupsDirty=!1,t=e;--t>=0;)i=this._groupList[t],n=this._groupMembers[i],n&&n._predefinedGroup&&(u?u.indexOf(n._groupId)<0&&this._removeGroupMember(t,i):this._removeGroupMember(t,i));if(u)for(e=u.length,t=0;t<e;++t){let e=this._addGroup(u[t]);e&&(e._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)i=this._groupList[t],n=this._groupMembers[i],n._updateRowIds(l[i]),n._markColumnStatsDirty();this._groupViewDirty=!0,this._rebuildRowIdsFromChildren()},De.prototype._removeGroupMember=function(t,e){let n=this._groupMembers[e];n&&(this._groupList.splice(t,1),delete this._groupMembers[e],n.dispose())},De.prototype._defaultGroupCriteria=function(t,e){let n=e[t];return Array.isArray(n)?n.map((function(t){return t+""})):[n+""]},De.prototype._groupFilterLogic=function(t,e){return this._groupCriteria[this._groupLevel-1](e).indexOf(this._groupId)>=0},De.prototype._internalGroupSortingLogic=function(t,e){let n=this._groupMembers[t],i=this._groupMembers[e];return this._groupSortingLogic(t,e,n,i)},De.prototype._addGroup=function(t){let e=t+"";if(!e)return null;let n=this._groupMembers[e];if(n)return null;let i,o=(this._groupRowId||"_grp")+"_"+e;if(this._hasListener("beforeGroupAdded")&&(i={dataView:this,newGroupId:e,newGroupValue:t,newGroupRowId:o,newGroupLevel:this._groupLevel+1},this._dispatch("beforeGroupAdded",i),i.cancel))return null;n=new De;let r=this._shared.defaultCollapse;return null!=r&&(n._collapsed=r),n._groupId=e,"string"==typeof t?"null"==t?n._groupValue=null:"undefined"!=t&&(n._groupValue=t):n._groupValue=t,i&&!0===i.hideHeaderRow&&(n._hiddenHeaderRow=!0),n._groupRowId=o,n._groupLevel=this._groupLevel+1,n._groupCriteria=this._groupCriteria,n._preDefGroups=this._preDefGroups,n._groupLevel<n._groupCriteria.length&&(n._groupMembers={},n._groupList=[],n._groupView=[]),n._groupRows=this._groupRows,n._setParent(this),n._sortingDefs=this._sortingDefs,this._groupMembers[e]=n,this._groupList.push(e),this._groupRows[n._groupRowId]=n,this._hidden||(n._isHeaderRowShown()&&this._groupView.push(n._groupRowId),this._groupViewDirty=!0,n._beingAdded=!0,this._dispatch("groupAdded",{dataView:this,newGroup:n}),n._beingAdded=!1),n.listen("groupAdded",this._onGroupAdded),this._hasListener("beforeGroupAdded")&&n.listen("beforeGroupAdded",this._onBeforeGroupAdded),n},De.prototype._triggerGroupRefreshing=function(){this._groupLevel>0?this._parent&&this._parent._triggerGroupRefreshing():this._groupRows&&!this._refreshTimerId&&(this._refreshTimerId=setTimeout(this._onRefreshTimeout,100))},De.prototype._rebuildRowIdsFromChildren=function(){if(this._groupViewDirty){if(this._rids.length=0,this._groupView&&(this._groupView.length=0),!this._hidden){let t=this._groupList.length;for(let e=0;e<t;++e){let t=this._groupList[e],n=this._groupMembers[t];if(n._rebuildRowIdsFromChildren(),ut.pushArrayItems(this._rids,n._rids),!this._collapsed&&this._groupView&&(n._isHeaderRowShown()&&this._groupView.push(n._groupRowId),!n._collapsed)){let t=n._getFirstHiddenRids()||n._groupView||n._rids;ut.pushArrayItems(this._groupView,t),ut.pushArrayItems(this._groupView,n._footerRowIds)}}}this._groupViewDirty=!1,this._updatePageCount()||this._transformView()}},De.prototype._resolveGroupId=function(t){return this._groupCriteria[this._groupLevel](t)},De.prototype._markColumnStatsDirty=function(){for(let t in this._columnStats)this._columnStats[t].markDirty()},De._defaultFilterLogic=function(t,e,n,i){return i[t]===e},De._defaultGroupSortingLogic=function(t,e){return t==e?0:t<e?-1:1};const xe=De;let Ae=function(t,e,n){this._onConflated=this._onConflated.bind(this),this._data=[],"function"==typeof t?this.setFunction(t,n):"function"==typeof e&&this.setFunction(e,n),"number"==typeof e?this.setConflatingTime(e):"number"==typeof t&&this.setConflatingTime(t)};Ae.prototype._data,Ae.prototype._func=null,Ae.prototype._delay=0,Ae.prototype._timerId=0,Ae.prototype._conflated=!1,Ae.prototype._disabled=!1,Ae.prototype.reset=function(){return this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this.popAllData()},Ae.prototype.popAllData=function(){if(this._data.length){let t=this._data;return this._data=[],t}return null},Ae.prototype.dispose=function(){this._timerId&&(clearTimeout(this._timerId),this._timerId=0),this._data.length&&(this._data.length=0),this._func=null},Ae.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))},Ae.prototype.isConflating=function(){return this._timerId>0&&!this._conflated&&!this._disabled},Ae.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},Ae.prototype.getData=function(){return this._data},Ae.prototype.setFunction=function(t,e){this._func=t,this._func=t?e?t.bind(e):t:null},Ae.prototype.setConflatingTime=function(t){this._delay=t||0,this._delay<0&&(this._delay=0)},Ae.prototype.disable=function(t){this._disabled=!1!==t},Ae.prototype.isEnabled=function(){return!this._disabled},Ae.prototype.enable=function(t){this._disabled=!1===t},Ae._proto=Ae.prototype;const Te=Ae;let Le=function(t){let e=this;e._onDataChanged=e._onDataChanged.bind(e),e.extendEventArg=e.extendEventArg.bind(e),e._dataChangedConflator=new Te(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")};o.inherits(Le,ct),Le._runningId=0,Le.prototype._id="",Le.prototype._type="",Le.prototype._grid=null,Le.prototype._snapshot=null,Le.prototype._dataView=null,Le.prototype._dataArg=null,Le.prototype._autoSyncRowCount,Le.prototype._bindingEnabled=!0,Le.prototype._parent=null,Le.prototype._children=null,Le.prototype._dataChangedConflator,Le.prototype.getId=function(){return this._id},Le.prototype.setId=function(t){return this._id=t||"section"+Le._runningId++,this._grid.setAttribute("id",this._id),this._id},Le.prototype.getSection=function(){return this._snapshot||this._grid},Le.prototype.getSectionName=function(){return this._grid.getId()},Le.prototype.getIndex=function(){return this._grid.getIndex()},Le.prototype.getType=function(){return this._type},Le.prototype.setType=function(t){this._type!==t&&(this._type&&this._grid.removeClass(this._type),this._type=t||"",t&&this._grid.addClass(t))},Le.prototype.getDataSource=function(){return this._dataView},Le.prototype.setDataSource=function(t){let 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))},Le.prototype.getRootDataSource=function(){if(!this._dataView)return null;let t=this._dataView.getDataSource();if(!t)return null;for(;t.getDataSource();)t=t.getDataSource();return t},Le.prototype.getData=function(t,e){return this._dataView?(e=this._getRowId(e),this._dataView.getData(e,t)):null},Le.prototype.setData=function(t,e,n){return!!this._dataView&&(e=this._getRowId(e),this._dataView.setData(e,t,n),!0)},Le.prototype.getRowData=function(t){return this._dataView?(t=this._getRowId(t),this._dataView.getRowData(t)):null},Le.prototype.removeRowData=function(t){if(!this._dataView)return!1;let e=this.getRootDataSource();if(!e)return!1;t=this._getRowId(t);let n=e.getRowIndex(t);return!(n<0||(e.removeRow(n),0))},Le.prototype.activateColumns=function(t,e,n){if("content"===this._type)for(let i=n+1;--i>=e;){let e=t[i];null!=e&&this._grid.activateColumn(i,e)}},Le.prototype.getChildren=function(){return this._children},Le.prototype.setParent=function(t){if(this._parent){let t=this._parent._children.indexOf(this);t>=0&&(this._parent._children.splice(t,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))},Le.prototype.getParent=function(){return this._parent},Le.prototype.getDataChangedConflator=function(){return this._dataChangedConflator},Le.prototype.disableConflation=function(t){this._dataChangedConflator.disable(t)},Le.prototype.disableDataBinding=function(t){this._bindingEnabled=!1===t},Le.prototype.getAutoSyncRowCount=function(){return null!=this._autoSyncRowCount?this._autoSyncRowCount:"content"===this._type},Le.prototype.setAutoSyncRowCount=function(t){if(this._autoSyncRowCount=t,this.getAutoSyncRowCount()){let t=this._dataView?this._dataView.getVisibleRowCount():0;this._grid.setRowCount(t)}},Le.prototype.isDataBindable=function(){return!(!this._bindingEnabled||!this._dataView)},Le.prototype.dispose=function(){let 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},Le.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},Le.prototype.extendRenderEventArg=function(t,e,n){return t=this.extendEventArg(t),e>=0||(this._snapshot?(e=0,n=this._grid.getRowCount()):(e=this._grid.getFirstIndexInView(),n=this._grid.getLastIndexInView()+1)),t.fromRowIndex=e,t.toRowIndex=n,t},Le.prototype.extendDataEventArg=function(t,e,n){let i,o;if(t||(t={}),t.firstUpdate=e,t.lastUpdate=n,this._snapshot?(i=0,o=this._grid.getRowCount()):(i=this._grid.getFirstIndexInView(),o=this._grid.getLastIndexInView()+1),t.fromRowIndex=e>i?e:i,this._dataView){let e=this._dataView.getVisibleRowCount();t.dataRowCount=e,o>e&&(o=e)}return t.toRowIndex=n+1<o?n+1:o,this.extendEventArg(t),t},Le.prototype.setIndex=function(t){this._grid.setIndex(t)},Le.prototype.getRowOffset=function(){return this._grid.getRowOffset()},Le.prototype.setRowOffset=function(t){this._grid.setRowOffset(t)},Le.prototype.enableColumnVirtualization=function(t){t=!1!==t,"content"===this._type&&this._grid.enableColumnVirtualization(t)},Le.prototype.isBinding=function(){return this._isEventDispatching("dataChanged")},Le.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))}},Le.prototype._dispatchDataChanged=function(t,e){let n=this.getAutoSyncRowCount(),i=this._dataView?this._dataView.getVisibleRowCount():0,o=this._grid.getRowCount();n?i!==o&&this._grid.setRowCount(i,!0):i>o&&(e=o-1),this.updateRowData(t,e,this._dataArg),this._dataArg=null},Le.prototype.updateRowData=function(t,e,n){this.isDataBindable()&&(this._grid._getTempRowHeights()&&(t=this._grid.getFirstIndexInView(),e=this._grid.getLastIndexInView()+1),(n=this.extendDataEventArg(n,t,e)).fromRowIndex<n.toRowIndex&&this._dispatch("dataChanged",n))},Le.prototype.rerender=function(){this.isDataBindable()?this.updateRowData():this._dispatch("rowAvailable",this.extendEventArg())},Le.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())}},Le.prototype._getRowId=function(t){return ut.isNumber(t)?this._dataView.getRowId(t):t},Le.prototype._mergeEvent=function(t){let e=this._dataArg;if(e||(e=this._dataArg={},e.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)return;if(t.globalChange)return e.globalChange=!0,e.firstUpdate=0,void(e.lastUpdate=NaN);let n=t.rids;if(n)for(let t=n.length;--t>=0;)e.updatedRids[n[t]]=!0;else t.rid&&(e.updatedRids[t.rid]=!0);"updated"!==t.type&&(e.indexShifted=!0,"removed"===t.type&&(e.dataRemoved=!0))},Le.prototype._calculateChangeIndices=function(){if(!this.isDataBindable()||this._dataArg.globalChange)return;let t,e;if(this._dataArg.indexShifted){if(this._dataArg.dataRemoved)this._dataArg.firstUpdate=0;else for(t in this._dataArg.updatedRids)e=this._dataView.getRowIndex(t),e>=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),e>=0&&(this._dataArg.firstUpdate<=e||(this._dataArg.firstUpdate=e),this._dataArg.lastUpdate>=e||(this._dataArg.lastUpdate=e))},Le._proto=Le.prototype;const Ee=Le;let Me=function(t){this._layout=t,this._arg={},this._addEvent("indexChanged")};o.inherits(Me,ct),Me.prototype._layout,Me.prototype._viewSize=0,Me.prototype._viewOffset=0,Me.prototype._startOffsetCount=0,Me.prototype._endOffsetCount=0,Me.prototype._bufferSize=0,Me.prototype._arg=null,Me.prototype._enabled=!0,Me.prototype._active=!0,Me.prototype._virtualizable=!1,Me.prototype._getMinIndex=function(){return this._startOffsetCount},Me.prototype._getMaxIndex=function(){let t=this._layout.getLaneCount()-this._endOffsetCount;return t>this._startOffsetCount?t:this._startOffsetCount},Me.prototype.getContentStart=function(t){return this._layout.getLaneStart(t)},Me.prototype.getContentInViewCount=function(){let t=this.getFirstIndexInView(),e=this.getLastIndexInView();return t>=0&&t<e?e-t+1:0},Me.prototype._getContentSizeInBounds=function(){let t=this._getMinIndex(),e=this._getMaxIndex();return this._layout.getLaneStart(e)-this._layout.getLaneStart(t)},Me.prototype.getViewSize=function(){return this._viewSize},Me.prototype.getViewOffset=function(){let t=this._getMinIndex();return this._viewOffset+this._layout.getLaneStart(t)},Me.prototype.getIndexOffset=function(){return this._startOffsetCount},Me.prototype.isVirtualizable=function(){return this._virtualizable},Me.prototype.getFirstIndexInView=function(){if(!this._virtualizable)return 0;let t=this.getViewOffset(),e=this._layout.getTrackSize();return t>=e&&(t=e-this._viewSize),t<0?0:this._layout.hitTest(t)},Me.prototype.getLastIndexInView=function(){if(this._virtualizable){let 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},Me.prototype.getPrevFirstIndexInView=function(){return null!=this._arg.prevFirstIndex?this._arg.prevFirstIndex:-1},Me.prototype.getPrevLastIndexInView=function(){return null!=this._arg.prevLastIndex?this._arg.prevLastIndex:-1},Me.prototype.update=function(t){if(!(!0===t||this._enabled&&this._active))return!1;if(this._isEventDispatching("indexChanged"))return!1;let e=this.getFirstIndexInView(),n=this.getLastIndexInView(),i=this._arg.prevFirstIndex!==e||this._arg.prevLastIndex!==n;return(t||i)&&(this._arg.firstIndex=e,this._arg.lastIndex=n,this._dispatch("indexChanged",this._arg),this._arg.prevFirstIndex=e,this._arg.prevLastIndex=n),i},Me.prototype.isEnabled=function(){return this._enabled},Me.prototype.enable=function(t){t=!1!==t,this._enabled!==t&&(this._enabled=t,this.validateVirtualization(),this.update(!0))},Me.prototype.disable=function(t){this.enable(!1===t)},Me.prototype.isActive=function(){return this._active},Me.prototype.activate=function(t){t=!1!==t,this._active!==t&&(this._active=t,this.validateVirtualization(),this.update(!0))},Me.prototype.deactivate=function(t){this.activate(!1===t)},Me.prototype.getBufferSize=function(){return this._bufferSize},Me.prototype.setContentLayout=function(t){this._layout!==t&&(this._layout=t,this.validateVirtualization())},Me.prototype.setViewSize=function(t){t<0&&(t=0),this._viewSize!==t&&(this._viewSize=t,this.validateVirtualization())},Me.prototype.setViewOffset=function(t){this._viewOffset=t>0?t:0,this.update()},Me.prototype.setViewBounds=function(t,e){this._startOffsetCount=t>0?t:0,this._endOffsetCount=e>0?e:0,this.validateVirtualization()},Me.prototype.setBufferSize=function(t){t<0&&(t=0),this._bufferSize!==t&&(this._bufferSize=t,this.validateVirtualization())},Me.prototype.validateVirtualization=function(){this._virtualizable=!1,this._enabled&&this._active&&this._viewSize>0&&this._getContentSizeInBounds()>this._viewSize&&(this._virtualizable=!0)},Me._proto=Me.prototype;const Fe=Me;let Pe=function(){let t=this;t._vertical=!0,t._hostClassName="vscrollbar-host",Pe.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")};o.inherits(Pe,_e),Pe.prototype.setScrollContent=function(t,e,n){this._clearAllPanes();let i,o=e.length;if(o<=0)return;let r=this._panes[0],s=this._paneSliders[0],l=0;for(;l<n;)i=e[l++],i.setParent(t);r.setParent(t);let a=o-this._footerCount;for(;l<a;)i=e[l++],i.setParent(s);for(;l<o;)i=e[l++],i.setParent(t);this.invalidateContent()},Pe.prototype.setHeight=function(t){return this.setTrackSize(t,t),!0},Pe.prototype.getHeight=function(){return this.getPaneSize()},Pe.prototype.getScrollTop=function(){return this._getScrollValue()},Pe.prototype.setScrollTop=function(t){this.update(),this._scrollTo(t)},Pe.prototype.isEndOfVerticalScroll=function(){return this._isEndOfScroll()},Pe.prototype.getContentHeight=function(){let t=this._paneSliders[0].getContent(!0),e=0;for(let n=t.length;--n>=0;)e+=t[n].offsetHeight;return e},Pe.prototype.calculateContentSize=function(){return this.getContentHeight()},Pe.prototype.getPane=function(){return this._panes[0]},Pe.prototype._onScroll=function(t){this._dispatch("contentScrolled",t)},Pe._proto=Pe.prototype;const ze=Pe;let Ve=function(t){let 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 we(t),e._grid.setParent(e._element),e._layoutY=new Kt,e._selectionList=new he,e._reverter=new de(e._onRestingPosition,200),e._addEvent("rowHighlighted"),e._addEvent("rowCountChanged"),e._addEvent("rowHeightChanged"),e._addEvent("rowAvailable")};o.inherits(Ve,Wt),Ve.prototype._index=-1,Ve.prototype._rowOffset=0,Ve.prototype._firstIndex=0,Ve.prototype._grid,Ve.prototype._layoutY,Ve.prototype._selectionList=null,Ve.prototype._reverter=null,Ve.prototype._rowBounds=null,Ve.prototype._rowBoundCache=null,Ve.prototype._rowSelDirty=!1,Ve.prototype._cellBoundPainter=null,Ve.prototype._rowBoundTimer=0,Ve.prototype._boundLayer=null,Ve.prototype._hscrollbar=null,Ve.prototype._session="A",Ve.prototype._tempRowHeights=null,Ve.prototype.getWidth=function(){return this.isVisible()?this._grid.getWidth():0},Ve.prototype.getHeight=function(){return this.isVisible()?this._element.offsetHeight:0},Ve.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),this._cellBoundPainter&&this._cellBoundPainter.dispose()},Ve.prototype.setWidth=function(t){return this._grid.setWidth(t)},Ve.prototype.setHeight=function(t){return!1},Ve.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",this._dispatchRowHeightChangedEvent(0,this._layoutY.getLaneCount())},Ve.prototype.hitTest=function(t,e){let n=[];return n.colIndex=this._grid.hitTestX(t),n.rowIndex=this._layoutY.hitTest(e),n},Ve.prototype.hitTestX=function(t){return this._grid.hitTestX(t)},Ve.prototype.hitTestY=function(t){return this._layoutY.hitTest(t)},Ve.prototype.getDefaultColumnWidth=function(){return this._grid.getDefaultColumnWidth()},Ve.prototype.setDefaultColumnWidth=function(t){this._grid.setDefaultColumnWidth(t)},Ve.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},Ve.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()))},Ve.prototype.getColumnWidth=function(t){return this._grid.getColumnWidth(t)},Ve.prototype.setColumnWidth=function(t,e){return this._grid.setColumnWidth(t,e)},Ve.prototype._setColumnWidth=function(t,e){return this._grid._setColumnWidth(t,e)},Ve.prototype._updateColumnLayout=function(){this._grid._updateColumnLayout()},Ve.prototype._startBindingSession=function(t){if(this._isBinding=t,!t){if(this._tempRowHeights){let t=this.getDefaultRowHeight(),e=!0,n=[];for(let e in this._tempRowHeights){let i=+e,o=this._layoutY.getLaneProperty(i,"sizeSession");o&&o!=this._session&&(this.setRowHeight(i,t),this._layoutY.setLaneProperty(i,"sizeSession",null),n.push(i))}let i=n.length;for(let t=0;t<i;t++)delete this._tempRowHeights[n[t]];if(i)for(let t in this._tempRowHeights){e=null!=t;break}e||(this._tempRowHeights=null)}this._session="A"===this._session?"B":"A"}},Ve.prototype._getTempRowHeights=function(){return this._tempRowHeights},Ve.prototype.getRowHeight=function(t){return this._layoutY.getLaneSize(t)},Ve.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))},Ve.prototype.isColumnVisible=function(t){return this._grid.isColumnVisible(t)},Ve.prototype.hideColumn=function(t,e){return this._grid.hideColumn(t,e)},Ve.prototype.isRowVisible=function(t){return this._grid.isRowVisible(t-this._firstIndex)},Ve.prototype.hideRow=function(t,e){return this._grid.hideRow(t-this._firstIndex,e)},Ve.prototype.getMinimumColumnWidth=function(t){return this._grid.getMinimumColumnWidth(t)},Ve.prototype.setMinimumColumnWidth=function(t,e){return this._grid.setMinimumColumnWidth(t,e)},Ve.prototype.getMinimumRowHeight=function(t){return this._layoutY.getMinimumLaneSize(t)},Ve.prototype.setMinimumRowHeight=function(t,e){return!1},Ve.prototype.getCellLeft=function(t){return this._grid.getCellLeft(t)},Ve.prototype.getCellTop=function(t){return this._layoutY.getLaneStart(t)},Ve.prototype.getCellWidth=function(t,e){return this._grid.getCellWidth(t,0)},Ve.prototype.getCellHeight=function(t,e){return this._layoutY.getLaneSize(e)},Ve.prototype.hasCellSpan=function(){return this._grid.hasCellSpan()},Ve.prototype.getCellRowSpan=function(t,e){return this._grid.getCellRowSpan(t,e-this._firstIndex)},Ve.prototype.setCellRowSpan=function(t,e,n){return this._grid.setCellRowSpan(t,e-this._firstIndex,n)},Ve.prototype.getCellColSpan=function(t,e){return this._grid.getCellColSpan(t,e-this._firstIndex)},Ve.prototype.setCellColSpan=function(t,e,n){return this._grid.setCellColSpan(t,e-this._firstIndex,n)},Ve.prototype.clearCellSpans=function(){return this._grid.clearCellSpans()},Ve.prototype.clearColumnSpans=function(t){return this._grid.clearColumnSpans(t)},Ve.prototype.clearColumnCustomizations=function(){this._grid.clearColumnCustomizations()},Ve.prototype.clearRowCustomizations=function(){this._layoutY.clearLaneCustomizations(),this._grid.clearRowCustomizations()},Ve.prototype.getColumnScalability=function(t){return this._grid.getColumnScalability(t)},Ve.prototype.setColumnScalability=function(t,e){return this._grid.setColumnScalability(t,e)},Ve.prototype.getRowScalability=function(t){return this._layoutY.getLaneScalability(t)},Ve.prototype.setRowScalability=function(t,e){return!1},Ve.prototype.getCell=function(t,e,n){return this._grid.getCell(t,e-this._firstIndex,n)},Ve.prototype.getCellContent=function(t,e){return this._grid.getCellContent(t,e-this._firstIndex)},Ve.prototype.setCellContent=function(t,e,n){return this._grid.setCellContent(t,e-this._firstIndex,n)},Ve.prototype.getColumnCount=function(){return this._grid.getColumnCount()},Ve.prototype.setColumnCount=function(t){this._grid.setColumnCount(t)},Ve.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},Ve.prototype.setRowCount=function(t,e){let n=this._layoutY.getLaneCount();n!==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:n,noBinding:e}))},Ve.prototype.getVisibleRowCount=function(){return this.getRowCount()},Ve.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))},Ve.prototype.removeRow=function(t){if(t<=0)return;let e=this._layoutY.getLaneCount();t>e&&(t=e),this.setRowCount(e-t)},Ve.prototype.setBorders=function(t,e,n,i){this._grid.setBorders(t,e,n,i)},Ve.prototype.getColumnStyle=function(t,e){return this._grid.getColumnStyle(t,e)},Ve.prototype.setColumnStyle=function(t,e,n){this._grid.setColumnStyle(t,e,n)},Ve.prototype.enableColumnClass=function(t,e,n){this._grid.enableColumnClass(t,e,n)},Ve.prototype.hasColumnClass=function(t,e){return this._grid.hasColumnClass(t,e)},Ve.prototype.enableRowClass=function(t,e,n){this._grid.enableRowClass(t-this._firstIndex,e,n)},Ve.prototype.setRowStyle=function(t,e,n,i){this._grid.setRowStyle(t-this._firstIndex,e,n,i)},Ve.prototype.getContentWidth=function(){return this._grid.getContentWidth()},Ve.prototype.getContentHeight=function(){return this._layoutY.getTrackSize()},Ve.prototype.getCellsByRowIndex=function(t){return this._grid.getCellsByRowIndex(t-this._firstIndex)},Ve.prototype.disableHorizontalGridLine=function(t){this._grid.disableHorizontalGridLine(t)},Ve.prototype.disableVerticalGridLine=function(t){this._grid.disableVerticalGridLine(t)},Ve.prototype.enableShading=function(t){this._grid.enableShading(t)},Ve.prototype.setTransposedShading=function(t){this._grid.setTransposedShading(t)},Ve.prototype.enableRowHighlighting=function(t){this._grid.enableRowHighlighting(t)},Ve.prototype.getRowHighlight=function(){let t=this._grid.getRowHighlight();return t>=0&&(t+=this._firstIndex),t},Ve.prototype.setRowHighlight=function(t){let e=this._grid.getRowHighlight();this._grid.setRowHighlight(t-this._firstIndex),this._hasListener("rowHighlighted")&&(t=this._grid.getRowHighlight(),this._dispatch("rowHighlighted",{prevRowIndex:e>=0?e+this._firstIndex:e,rowIndex:t>=0?t+this._firstIndex:t}))},Ve.prototype.getSelectedRows=function(){return this.getSelectedRowCount()>0?this._selectionList.getAllSelections():null},Ve.prototype.getSelectedRowCount=function(){return this._selectionList.getSelectionCount()},Ve.prototype.isSelectedRow=function(t){return this._selectionList.getSelection(t)},Ve.prototype.setSelectedRow=function(t,e){this._selectionList.setSelection(t,e);let n=this._selectionList.getSelection(t);this._grid.setSelectedRow(t-this._firstIndex,n),n&&(this._rowSelDirty=!0,this._initBoundLayer()),this._requestUpdatingRowBounds()},Ve.prototype.selectSingleRow=function(t){this._selectionList.clearAllSelections(),this._grid.clearSelectedRows(),this.setSelectedRow(t)},Ve.prototype.selectRowRange=function(t,e){this._selectionList.selectRange(t,e),this._updateRowSelection(),this._rowSelDirty=!0,this._initBoundLayer(),this._requestUpdatingRowBounds()},Ve.prototype.clearSelectedRows=function(){let t=this._selectionList.clearAllSelections();return this._grid.clearSelectedRows(),this._requestUpdatingRowBounds(),t},Ve.prototype.getFirstSelectedRow=function(){return this._selectionList.getFirstSelectedIndex()},Ve.prototype.getLastSelectedRow=function(){return this._selectionList.getLastSelectedIndex()},Ve.prototype.getRowAnchor=function(){return this._selectionList.getSelectionAnchor()},Ve.prototype.setRowAnchor=function(t){this._selectionList.setSelectionAnchor(t)},Ve.prototype.activateColumn=function(t,e){this._grid.activateColumn(t,e)},Ve.prototype.activateRows=function(t,e,n){let i=this._layoutY.getLaneCount();t||(t=this._rowOffset),e||0===e||(e=t+i),(t-=this._rowOffset)<0&&(t=0),(e-=this._rowOffset)<0&&(e=0);let o=this._getInnerRowCount(),r=this._firstIndex,s=0;s=t-(1&t),s<0?s=0:s>i&&(s=i);let l=e+(1&e)-s;l+2===o&&(l=o),l<0?l=0:l+s>i&&(l=i-s),this._firstIndex=s;let 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();let p=!1;if(l!==o){if(this._grid.setRowCount(l),l>o){let t={};t.prevRowIndex=s+o,t.rowIndex=s+l,n&&(t.noDataUpdate=!0),this._dispatch("rowAvailable",t)}p=!0}if(n){if(!p){this._grid.clearSelectedRows();let t=r+o;s<r&&r<a&&t>=a?(this.moveRowsToTop(a-r),n[0]=s,n[1]=r):r<s&&s<t&&a>=t?(this.moveRowsToTop(s-r),n[0]=t,n[1]=a):s===r&&a===t?(n[0]=0,n[1]=0):p=!0}p&&(n[0]=s,n[1]=a)}this._layoutY.isHomogeneous()||this._grid._updateRowHeights(this._layoutY,s),this._updateRowSelection()},Ve.prototype.moveRowsToTop=function(t){this._grid.moveRowsToTop(t)},Ve.prototype.getFirstIndexInView=function(){return this._firstIndex},Ve.prototype.getLastIndexInView=function(){let t=this._firstIndex+this._getInnerRowCount()-1,e=this._grid._getContext().getDataSource(),n=e?e.getRowCount()-1:-1;return t>n?n:t},Ve.prototype.isInCurrentView=function(t){return this._firstIndex<=t&&t<this._firstIndex+this._getInnerRowCount()},Ve.prototype.getFrozenLayout=function(){return this._grid.getFrozenLayout()},Ve.prototype.setFrozenLayout=function(t){this._grid.setFrozenLayout(t)},Ve.prototype.getColumn=function(t){return this._grid.getColumn(t)},Ve.prototype.insertColumn=function(t,e){return this._grid.insertColumn(t,e)},Ve.prototype.removeColumnAt=function(t){return this._grid.removeColumnAt(t)},Ve.prototype.moveColumn=function(t,e){this._grid.moveColumn(t,e)},Ve.prototype.enableRowVirtualization=function(t){},Ve.prototype.enableColumnVirtualization=function(t){this._grid.enableColumnVirtualization(t)},Ve.prototype.getColumnIndex=function(t){return this._grid.getColumnIndex(t)},Ve.prototype.getCellIndex=function(t,e){let n=this._grid.getCellIndex(t,e);return n<0?-1:n+this._firstIndex},Ve.prototype.getIndex=function(){return this._index},Ve.prototype.setIndex=function(t){this._index=t},Ve.prototype.setRowOffset=function(t){this._rowOffset=t},Ve.prototype.getRowOffset=function(){return this._rowOffset},Ve.prototype.updateLayout=function(){this._grid.updateLayout()},Ve.prototype.stretchCell=function(t,e,n,i){let o=this._grid.stretchCell(t,null!=e?e-this._firstIndex:null,n,i);if(o){let t=o.getElement();0===e?t.classList.add("top"):t.classList.remove("top")}return o},Ve.prototype.unstretchCell=function(t,e){return this._grid.unstretchCell(t,null!=e?e-this._firstIndex:null)},Ve.prototype.unstretchAllCells=function(){this._grid.unstretchAllCells()},Ve.prototype.getStretchedCell=function(t,e){return this._grid.getStretchedCell(t,null!=e?e-this._firstIndex:null)},Ve.prototype.getStretchedCells=function(){return this._grid.getStretchedCells()},Ve.prototype.updateStretchedCells=function(){return this._grid.updateStretchedCells()},Ve.prototype.getColumnHost=function(){return this._grid.getElement()},Ve.prototype.setHidingMethod=function(t){this._grid.setHidingMethod(t)},Ve.prototype.getHidingMethod=function(){return this._grid.getHidingMethod()},Ve.prototype.setColumnVisibility=function(t,e,n){return this._grid.setColumnVisibility(t,e,n)},Ve.prototype.getRowLayout=function(){return this._layoutY},Ve.prototype.reserveRightSpace=function(t){return this._grid.reserveRightSpace(t)},Ve.prototype.getReservedSpace=function(){return this._grid.getReservedSpace()},Ve.prototype.getComputedStyle=function(){return this._grid.getComputedStyle()},Ve.prototype.isColumnActive=function(t){return this._grid.isColumnActive(t)},Ve.prototype.setRowAttributes=function(t,e){return this._grid.setRowAttributes(t,e)},Ve.prototype.getContextRow=function(t){return this._grid.getContextRow(t-this._firstIndex)},Ve.prototype.selectColumn=function(t,e){this._grid.selectColumn(t,e)},Ve.prototype.isSelectedColumn=function(t){return this._grid.isSelectedColumn(t)},Ve.prototype.selectCell=function(t,e,n){this._grid.selectCell(t,e-this._firstIndex,n)},Ve.prototype.setCellBounds=function(t,e,n,i){let o=this._initBoundLayer(),r=this._cellBoundPainter;r||(r=this._cellBoundPainter=new Ce({boundLayer:o,layoutX:this.getHorizontalLayout(),layoutY:this._layoutY,hscrollbar:this._hscrollbar,calculateColumnBounds:this.calculateColumnBounds.bind(this)}));let s=this.getColumnCount();r.setCellBounds(t,e,n,i,s)},Ve.prototype.getHorizontalLayout=function(){return this._grid.getHorizontalLayout()},Ve.prototype.calculateColumnBounds=function(t,e,n,i){this._grid.calculateColumnBounds(t,e,n,i)},Ve.prototype.updateColumnBounds=function(t,e,n){this._grid.updateColumnBounds(t,e,n),this._updateRowBounds()},Ve.prototype.updateColumnSeparators=function(){this._grid.updateColumnSeparators()},Ve.prototype._initBoundLayer=function(){let t=this._boundLayer;return t||(t=this._boundLayer=document.createElement("div"),t.className="cover-layer",this._element.appendChild(t)),t},Ve.prototype._requestUpdatingRowBounds=function(){this._rowBoundTimer||(this._rowBoundTimer=setTimeout(this._updateRowBounds,10))},Ve.prototype._updateRowBounds=function(){this._rowBoundTimer=0;let t=this._cellBoundPainter;if(t&&t.updateCellBounds(),!this._rowSelDirty)return;let e=this._rowBounds,n=this._rowBoundCache;e||(e=this._rowBounds=[]),n||(n=this._rowBoundCache=[]);let i=this._selectionList,o=this._layoutY.getLaneCount();i.deselectFrom(o);let r,s=i.getConnectedRanges(),l=s.length,a=null,u=null,h=e.length;for(r=l;r<h;++r)u=e[r],a=u.parentNode,a&&a.removeChild(u);if(e.length=h=l,!l)return void(i.getSelectionCount()||(this._rowSelDirty=!1));let p=0,d=0,c=0,_=!1;this._hscrollbar&&(p=this._hscrollbar.getScrollLeft(),d=this._hscrollbar.getPinnedLeftColumnCount(),c=this._hscrollbar.getPinnedRightColumnCount(),_=this._hscrollbar.isEndOfHorizontalScroll());let f=!d&&p>0,g=!c&&!_,y=this._grid._getViewSize();for(r=0;r<l;++r){let t=s[r],i=t[0],o=t[1],l=this._layoutY.getLaneStart(i),a=this._layoutY.getLaneEnd(o);u=n[r],u||(u=n[r]=document.createElement("div"),u.className="selection-bound"),u.style.top=l+"px",u.style.height=a-l+"px",u.style.width=y+"px",u.classList.toggle("no-left-bound",f),u.classList.toggle("no-right-bound",g),this._boundLayer&&(e[r]||(e[r]=u,this._boundLayer.appendChild(u)))}},Ve.prototype._getInnerRowCount=function(){return this._grid.getRowCount()},Ve.prototype._updateRowSelection=function(){this._grid.clearSelectedRows();let t,e=this._selectionList,n=e.getSelectionCount();if(n<=0)return;let i=this._firstIndex,o=i+this._getInnerRowCount();if(1===n)t=e.getFirstSelectedIndex(),i<=t&&t<o&&this._grid.setSelectedRow(t-i,!0);else if(n>=o-i)for(t=i;t<o;++t)e.getSelection(t)&&this._grid.setSelectedRow(t-i,!0);else{let r=e.getAllSelections();for(let e=0;e<n;++e)t=r[e],i<=t&&t<o&&this._grid.setSelectedRow(t-i,!0)}},Ve.prototype._dispatchRowHeightChangedEvent=function(t,e){if(t>=e)return!1;let n={};return n.rowIndex=t,n.changeLength=e-t,this._dispatch("rowHeightChanged",n),!0},Ve.prototype._onRestingPosition=function(){let t=this._grid.getElement();if(t){let e=this._layoutY.getLaneStart(this._firstIndex);t.style.transform="",t.style.top=e?e+"px":""}},Ve.prototype._updateRightSpaceStyle=function(){this._grid._updateRightSpaceStyle()},Ve.prototype._updateLayers=function(){this._grid._updateLayers()},Ve.prototype._setContext=function(t){this._grid._setContext(t)},Ve.prototype._getContext=function(){return this._grid._getContext()},Ve._proto=Ve.prototype;const ke=Ve;let Ne=function(t,e){return t-e},Oe=function(){let t=document.createElement("input"),e=t.style;return e.position="absolute",e.width=e.height=e.padding=e.border="0",t.value="0",t.role="grid",t.readOnly=!0,t},He=function(t){if(t){if(!t.getRootNode)return document.activeElement;{let e=t.getRootNode();if(e&&e!==t)return e.activeElement||null}}return null},Be=function(t){Be._sectionType||(Be._sectionType={},Be._sectionType.title=!0,Be._sectionType.header=!0,Be._sectionType.content=!0,Be._sectionType.footer=!0);let 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._onKeyDown=e._onKeyDown.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(let e=t.childNodes.length;--e>=0;)ut.isElement(t.childNodes[e])||t.removeChild(t.childNodes[e]);e._element=t||document.createElement("div"),e._element.classList.add("tr-grid"),e._layoutX=new Kt,e._layoutY=new Kt,e._layoutX.setDefaultLaneSize(100),e._layoutY.setDefaultLaneSize(32),e._settings=[],e._plugins={},e._columnDefs=[],e._sectionStarts=[],e._rowHeightException="title",e._rowVirtualizer=new Fe(e._layoutY),e._rowVirtualizer.deactivate(),e._rowVirtualizer.setViewSize(360),e._colVirtualizer=new Fe(e._layoutX),e._colVirtualizer.enable(!1),e._colVirtualizer.deactivate(),e._colVirtualizer.setViewSize(400),e._vscrollbar=new ze,e._vscrollbar.disable(),e._vscrollbar.setParent(e.getParent()||e.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 ge,e._hscrollbar.disable(),e._hscrollbar.setParent(e.getParent()||e.getElement()),e._hscrollbar.listen("scroll",e._onHScroll),e._hscrollbar.listen("layoutChanged",e._onHScroll),e._hscrollbar.listen("activated",e.updateLayout),e._hscrollbar.listen("deactivated",e.updateLayout),e._hscrollbar.setOtherScrollbar(e._vscrollbar),e._vscrollbar.setOtherScrollbar(e._hscrollbar),e._element.addEventListener("keydown",e._onKeyDown),ut.isMobile||ut.isTouchDevice?e._element.addEventListener("touchmove",e._onMouseMove,!1):e._element.addEventListener("mousemove",e._onMouseMove,!1),ut.isSafari&&e._element.addEventListener("click",e._onGridClicked),window.addEventListener("resize",e._onWindowResize,!1),e._rowVirtualizer.listen("indexChanged",e._onRowInViewChanged),e._colVirtualizer.listen("indexChanged",e._onColInViewChanged),e._rowHeightConflator=new Te(e._onRowHeightChanged,50),e._vScrollbarConflator=new Te(e._updateVScrollbar,200),e._columnBoundConflator=new Te(e.updateColumnBounds,10),e._columnPositionConflator=new Te(e._dispatchColumnPositionChanged,10),e._rowPositionConflator=new Te(e._dispatchRowPositionChanged,10),e._firstHiddenInput=Oe(),e._firstHiddenInput.className="first-input",e._lastHiddenInput=Oe(),e._lastHiddenInput.className="last-input",e._element.insertBefore(e._firstHiddenInput,e._element.firstChild),e._element.appendChild(e._lastHiddenInput),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","tabNavigation");let n=Be.map;n||(n={},Be.map=n),e._element._control=e;let i=e._element.id||e._element.name;i&&!n[i]||(i="_grid"+Be._runningGridId),e._id=i,n[i]=e,Be._runningGridId++,Object.defineProperty(e,"zoomFactor",{set:function(t){!t||t<0||this._zoomFactor!==t&&(this._zoomFactor=t,e._updateLayout())},get:function(){return this._zoomFactor}})};o.inherits(Be,Wt),Be.SectionReference,Be.MouseInfo,Be.BatchInfo,Be.CellReference,Be.ColumnOptions,Be._runningGridId=0,Be._runningColumnId=0,Be._sectionType,Be.prototype._plugins,Be.prototype._dataSource=null,Be.prototype._layoutX,Be.prototype._layoutY,Be.prototype._vscrollbar,Be.prototype._hscrollbar,Be.prototype._tempFrozenSectionRef="",Be.prototype._startVScrollbarIndex=-1,Be.prototype._hScrollbarEnabled=!0,Be.prototype._pinnedLeftColumnCount=0,Be.prototype._pinnedRightColumnCount=0,Be.prototype._frozenFooterCount=0,Be.prototype._fixFrozenTopSections=!1,Be.prototype._fixFrozenBottomSection=!1,Be.prototype._sectionStarts,Be.prototype._settings,Be.prototype._firstSettings,Be.prototype._lastSettings,Be.prototype._fitContentWidth=!1,Be.prototype._columnDefs,Be.prototype._rowVirtualizer,Be.prototype._colVirtualizer,Be.prototype._autoSetDataSource=!0,Be.prototype._renderingHandler=null,Be.prototype._dataBindingHandler=null,Be.prototype._frozenLayout=!1,Be.prototype._noBinding=!1,Be.prototype._rowHeightSync=!0,Be.prototype._rowHighlighting=!1,Be.prototype._dispatchingDataChanged=!1,Be.prototype._rowHeightException="",Be.prototype._rowScrollingStep=0,Be.prototype._zoomFactor=1,Be.prototype._reservedSpace=0,Be.prototype._hidingMethod="",Be.prototype._rowHeightConflator=null,Be.prototype._vScrollbarConflator=null,Be.prototype._columnBoundConflator=null,Be.prototype._rowRefreshTimer=0,Be.prototype._layoutUpdating=!1,Be.prototype._firstHiddenInput,Be.prototype._lastHiddenInput,Be.prototype._bottomPadding=6,Be.prototype._bottomPaddingSect=null,Be.prototype._preserveProportion=!1,Be.prototype._preserveGridSize=!1,Be.prototype._rowHeightTimerId=0,Be.prototype._groupDefs=null,Be.prototype._batches=null,Be.prototype._firstRendered=!1,Be.prototype._hasPendingRowChange=!1,Be.getVersion=function(){return"5.2.3"},Be.prototype.dispose=function(){let t=this._id,e=Be.map;if(!e[t])return void console.log("WARNING: Core grid is disposed twice");e[t]=null,this._disposed=!0,this._rowRefreshTimer&&(clearTimeout(this._rowRefreshTimer),this._rowRefreshTimer=0),this.unlistenAll(),window.removeEventListener("resize",this._onWindowResize,!1);for(let t=this._columnDefs.length;--t>=0;){let e=this._getColumnDef(t);e.renderingHandler=e.dataBindingHandler=null}for(let t in this._plugins){let e=this._plugins[t];e.unload&&e.unload(this)}this.removeAllSections();let n=this._vscrollbar._mainScrollbar;n&&(n.unlisten("scroll",this._onSyncVScroll),this._vscrollbar._mainScrollbar=null),n=this._hscrollbar._mainScrollbar,n&&(n.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();let i=this._element;i&&(i._control&&delete i._control,i.removeChild(this._firstHiddenInput),i.removeChild(this._lastHiddenInput)),this._dispose(),this._columnDefs.length=0,delete this._plugins},Be.prototype.isDisposed=function(){return this._disposed},Be.prototype.setParent=function(t,e){this._setParent(t,e),this._onParentChange()},Be.prototype.insertBefore=function(t){this._insertBefore(t),this._onParentChange()},Be.prototype._onParentChange=function(){let t=this.getParent()||this.getElement();this._vscrollbar._mainScrollbar||this._vscrollbar.setParent(t),this._hscrollbar.setParent(t),this._updateLayout()},Be.prototype.getConfigObject=function(t){let e=t||{},n=this.getColumnCount();e.columns||(e.columns=[]);for(let t=0;t<n;t++){let n=e.columns[t];n||(n=e.columns[t]={});let i=this._getColumnDef(t);i.userId&&(n.id=i.userId),i.field&&(n.field=i.field),i.styles&&(n.styles=i.styles),i.stationary&&(n.stationary=i.stationary),i.leftPinned&&(n.leftPinned=i.leftPinned),i.rightPinned&&(n.rightPinned=i.rightPinned),i.backgroundColor&&(n.backgroundColor=i.backgroundColor)}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);let i=this._vscrollbar.getAutoHide();!0!==i&&(e.autoHideScrollbar=i);let o=this._vscrollbar.getMouseWheelSpeed();o&&(e.linearWheelScrolling=o),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);let r=this.getDataConflationRate();r&&(e.dataConflationRate=r);for(let t in this._plugins){let n=this._plugins[t];"function"==typeof n.getConfigObject&&n.getConfigObject(e)}return e},Be.prototype.fillParentWidth=function(t){if(this._fitContentWidth)return!1;if(this._layoutX.isFixedSize())return!1;let e=this._element,n=(0|e.getBoundingClientRect().width)-e.clientLeft;return null!==this._layoutX.setTrackSize(n-this._reservedSpace)},Be.prototype.show=function(t){this._element.style.display=!1!==t?"":"none",!1!==t&&this.updateLayout()},Be.prototype.getContentWidth=function(){return this._layoutX.getTrackSize()},Be.prototype.getSectionCount=function(){return this._settings.length},Be.prototype._updateFrozenTopSections=function(){if(!this._fixFrozenTopSections){let t=this._getTopSectionCount();this._freezeTopSectionAt(t-1)}},Be.prototype._updateFrozenBottomSections=function(){if(!this._fixFrozenBottomSection){let t=this._getBottomSectionCount();this._setFrozenFooter(t)}},Be.prototype._getTopSectionCount=function(){let t=this._settings,e=t.length,n=0;for(let i=0;i<e;i++){let e=t[i].getType();if("header"!==e&&"title"!==e)break;n++}return n},Be.prototype._getBottomSectionCount=function(){let t=this._settings,e=0;for(let n=t.length-1;n>=0&&"footer"===t[n].getType();n--)e++;return e},Be.prototype.addSection=function(t,e){return this.addSectionAt(this.getSectionCount(),t,e)},Be.prototype.addSectionAt=function(t,e,n){let i=this._settings.length;t<0&&(t=0),t>i&&(t=i);let o=this._toSectionType(e),r="bottomPadding"===n,s=this._newSection(r?"footer":o,n);if(!s)return null;let l=s.getSection();if(r&&(s.setAutoSyncRowCount(!1),this._bottomPaddingSect=l),t>=i?(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),o=s.getType(),"footer"===o?this._updateFrozenBottomSections():"header"!==o&&"title"!==o||this._updateFrozenTopSections(),this._onColumnCountChanged(),this._onSectionCountChanged(!0),this._colVirtualizer.isEnabled()){let t=this._getColActivationList(),e=this.getColumnCount();s.activateColumns(t,0,e-1)}if(this._hasListener("sectionAdded")){let t=s.extendEventArg();this._dispatch("sectionAdded",t)}return l},Be.prototype.removeSection=function(t){let e=this.getSection(t);return null!==e?this.removeSectionAt(e.getIndex()):null},Be.prototype.removeSectionAt=function(t){let e=this._settings.length;if(t>=0&&t<e){let e=this._settings[t],n=e.getIndex(),i=e.getSection(),o=e.getType();return i.setRowCount(0),this._settings.splice(t,1),this._updateSectionIndices(n),"footer"===o?(this._updateFrozenBottomSections(),this._onColumnCountChanged()):"header"!==o&&"title"!==o||this._updateFrozenTopSections(),this._onSectionCountChanged(),e.dispose(),i}return null},Be.prototype.removeLastSection=function(){return this.removeSectionAt(this._settings.length-1)},Be.prototype.removeAllSections=function(){let t=this._settings.length;for(let 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()},Be.prototype.setBottomPaddingSection=function(t){let 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)},Be.prototype._updatePaddingBottomSect=function(){let t=this._bottomPaddingSect;if(t){let e=this._settings.length-1;if(e>0){let n=this._settings[e];if(n.getSection()!==t){let o=null;for(let n=e;--n>=0;){let e=this._settings[n];if(e.getSection()===t){o=e;break}}if(i>=0)return this._putToLast(t),this._settings.splice(i,1),this._settings.push(o),o.setType("footer"===n.getType()?"footer":"content"),!0;this._bottomPaddingSect=null}else{let t=this._settings[e-1];t&&n.setType("footer"===t.getType()?"footer":"content")}}}return!1},Be.prototype.moveSection=function(t,e){let n=this.getSectionCount();if(t<0)t=0;else if(t>=n)return;if(e<0?e=0:e>=n&&(e=n-1),t===e)return;let i=this._settings[t],o=this._settings[e];ut.moveArrayItem(this._settings,t,e),o?i.getSection().insertBefore(o.getSection()):this._putToLast(i.getSection()),this._updateSectionIndices(t<=e?t:e),this._syncRowHeights(),this._onSectionCountChanged(),this._frozenLayout||this._rowVirtualizer.update(!0)},Be.prototype.getSection=function(t){let e=this.getSectionSettings(t);return null!==e?e.getSection():null},Be.prototype.getSectionSettings=function(t){if(ut.isString(t)){if(Be._sectionType[t])return this._getNextSection(1,null,t);for(let e=this._settings.length;--e>=0;)if(this._settings[e].getId()===t)return this._settings[e]}else if(null!=t){let e=-1;if(null!=t.getIndex?e=t.getIndex():ut.isNumber(t)&&(e=t),e>=0&&e<this._settings.length)return this._settings[e]}return null},Be.prototype.getAllSections=function(t){if(null==t)return this._getAllSections();let e=this.getAllSectionSettings(t),n=e;for(let t=n.length;--t>=0;)n[t]=e[t].getSection();return n},Be.prototype.getAllSectionSettings=function(t){if(!t)return this._settings;let e=this._settings.length,n=[];t=this._toSectionType(t);for(let i=0;i<e;++i){let e=this._settings[i];t===e.getType()&&n.push(e)}return n},Be.prototype.getSectionIndex=function(t){if(ut.isNumber(t))return t;if(t instanceof MouseEvent){let e=ut.getRelativePosition(t,this._element),n={};return this._hitTestY(e.y,n),n.sectionIndex}let e=this.getSection(t);return null==e?-1:e.getIndex()},Be.prototype.getSectionTop=function(t){let e=this.getSection(t);if(null==e)return 0;let n=this._layoutY.getLaneStart(e.getRowOffset());return this._startVScrollbarIndex>=0&&e.getIndex()>=this._startVScrollbarIndex&&(n-=this._vscrollbar.getScrollTop()),n},Be.prototype.getPreviousSection=function(t,e){null==t&&(t=this._settings.length);let n=this._getNextSection(-1,t,e);return null!==n?n.getSection():null},Be.prototype.getNextSection=function(t,e){let n=this._getNextSection(1,t,e);return null!==n?n.getSection():null},Be.prototype.getLastSection=function(){return this.getSection(this._settings.length-1)},Be.prototype.getCell=function(t,e,n,i){let o=this.getSection(t);return o?o.getCell(e,n,i):null},Be.prototype.getCellInfo=function(t){if(!t)return null;let e=t.colIndex,n=t.rowIndex,i=t.sectionName,o=null;if(null==e||null==n)o=this.getRelativePosition(t),o.hit||(o=null);else{i||(i="content");let t=this.getSectionSettings(i);if(t){let i=t.getSection();e>=0&&e<i.getColumnCount()&&n>=0&&n<i.getRowCount()&&(o={colIndex:e,rowIndex:n},t.extendEventArg(o))}}return o},Be.prototype.getNextCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?e:1)},Be.prototype.getPrevCellInRow=function(t,e){return this._getNextCellInRow(t,null!=e?-e:-1)},Be.prototype._getNextCellInRow=function(t,e){let n=this.getCellInfo(t);if(n){let t=n.colIndex+e,i=n.rowIndex,o=n.section;n.colIndex=t,n.cell=o.getCell(t,i)}return n},Be.prototype.getNextCell=function(t){let e=this.getNextCellInRow(t);if(e&&!e.cell){let t=e.section,n=e.colIndex=0,i=e.rowIndex;e.rowIndex=++i,e.cell=t.getCell(n,i)}return e},Be.prototype.getPrevCell=function(t){let e=this.getPrevCellInRow(t);if(e&&!e.cell){let t=e.section,n=e.colIndex=t.getColumnCount()-1,i=e.rowIndex;e.rowIndex=--i,e.cell=t.getCell(n,i)}return e},Be.prototype.getColumnCount=function(){return this._layoutX.getLaneCount()},Be.prototype.setColumnCount=function(t){let e=this._layoutX.getLaneCount();if(t>=e){this._layoutX.setLaneCount(t);for(let e=this._settings.length;--e>=0;)this._settings[e].getSection().setColumnCount(t);this._onColumnCountChanged(),this._syncLayoutToColumns(e,t),this._dispatchColumnAddedEvent(e,t-e,!1)}else this._removeColumn(e-t)},Be.prototype.insertColumn=function(t,e){let n=this.getColumnCount();t<n||(t=n),this._layoutX.insertLane(t);for(let e=this._settings.length;--e>=0;)this._settings[e].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<n,e)},Be.prototype.insertColumns=function(t,e){let n=this.getColumnCount();t<n||(t=n);let i,o=0;if(Array.isArray(e)){if(o=e.length,1===o)return void this.insertColumn(t,e[0]);i=e}else{if("number"!=typeof e)return void this.insertColumn(t,e);if(o=e,1===o)return void this.insertColumn(t,null)}if(o<=0)return;let r=this.freezeLayout(),s=[t,0].concat(new Array(o));Array.prototype.splice.apply(this._columnDefs,s);for(let e=0;e<o;e++){let n=t+e;this._layoutX.insertLane(n);for(let t=this._settings.length;--t>=0;)this._settings[t].getSection().insertColumn(n);let o=i&&i[e];this._deserializeColumn(n,o)}this._dispatchColumnAddedEvent(t,o,t<n,i),this.freezeLayout(r)},Be.prototype.removeColumnAt=function(t){let e=this.getColumnCount();if(t<0||t>=e)return null;let n=-1;this._colVirtualizer.isVirtualizable()&&(n=this._colVirtualizer.getLastIndexInView());let i=this._layoutX.removeLaneAt(t),o=this._settings.length;for(let e=0;e<o;++e)this._settings[e].getSection().removeColumnAt(t);let r=this._pinnedLeftColumnCount,s=this._pinnedRightColumnCount,l=this._columnDefs.splice(t,1)[0];if(this._onColumnCountChanged(),(t<r||t>=e-s)&&this._updateScrollbarWidth(!0,!0),this._syncLayoutToColumns(t,e-1,!0),l||(l={}),l.layout=i,this._hasListener("columnRemoved")){let e={atTheMiddle:!0};e.colIndex=t,e.columns="deprecated",e.columnData=l.columnData,e.colId=l.id||"",this._dispatchColumnEvent("columnRemoved",e)}return t<=n&&n===this._colVirtualizer.getLastIndexInView()&&this._colVirtualizer.update(),l},Be.prototype.removeAllColumns=function(){this.getColumnCount()>0&&(this._pinnedLeftColumnCount=0,this._pinnedRightColumnCount=0,this.setColumnCount(0))},Be.prototype.getStationaryColumnIndex=function(){for(let t=this.getColumnCount()-1;t>=0;t--)if(this._getColumnDef(t).stationary)return t;return-1},Be.prototype.isColumnMoveAllowed=function(t,e){if(Array.isArray(t)||(t=[t]),0===t.length||null==e)return!1;let n=this.getStationaryColumnIndex();if(n>-1){if(e<=n)return!1;for(let e=0;e<t.length;e++)if(t[e]<=n)return!1}return!0},Be.prototype.isColumnMovable=function(t){let e=this.getStationaryColumnIndex();return!(e>-1&&t<=e)},Be.prototype.moveColumn=function(t,e){if("number"==typeof t)return this._moveColumn(t,e);if(!Array.isArray(t))return!1;let n,i=t.length,o=[],r=0,s=this.getColumnCount(),l={};for(n=0;n<i;++n)r=t[n],r>=0&&r<s&&null==l[r]&&(l[r]=1,o.push(r));if(e<0?e=0:e>=s&&(e=s-1),i=o.length,!i)return!1;if(1===i)return this._moveColumn(o[0],e);if(!this.isColumnMoveAllowed(o,e))return!1;if(o.sort(Ne),l[e]){let t=!0;for(r=o[0],n=1;n<i;++n)if(++r!==o[n]){t=!1;break}if(t)return!1}let a,u,h=this.freezeLayout(!0),p=0;for(n=0;n<i;++n)a=o[n],a>=e&&(u=e+p,this._moveColumn(a,u),++p);let d=i-p;for(u=p?e-1:e,n=0;n<d;++n)a=o[n]-n,this._moveColumn(a,u);return this.freezeLayout(h),!0},Be.prototype._moveColumn=function(t,e){let n=this.getColumnCount();if(t<0?t=0:t>=n&&(t=n-1),e<0?e=0:e>=n&&(e=n-1),t===e)return!1;if(!this.isColumnMoveAllowed(t,e))return!1;let i=-1;this._colVirtualizer.isVirtualizable()&&(i=this._colVirtualizer.getLastIndexInView());let o=this.getColumnId(t);this._layoutX.moveLane(t,e);let r=this._settings.length;for(let n=0;n<r;++n)this._settings[n].getSection().moveColumn(t,e);let s=this._columnDefs[t],l=this._countPinnedLeftColumns(),a=this._countPinnedRightColumns();if(ut.moveArrayItem(this._columnDefs,t,e),this._hScrollbarEnabled&&(t<l?e>=n-a?this.freezeColumn(l-2,a+1):e>=l&&this.freezeColumn(l-2,a):s.rightPinned?e<l?this.freezeColumn(l,a-1):e<n-a&&this.freezeColumn(l-1,a-1):e<l?this.freezeColumn(l,a):e>=n-a&&this.freezeColumn(l-1,a+1)),!this._frozenLayout&&this._colVirtualizer.isEnabled()){let n=this._colVirtualizer.getFirstIndexInView();t<n&&e<n||t>i&&e>i||this._activateColumns(n,i,n,i)}if(this._hasListener("columnMoved")){let n={};n.fromColIndex=t,n.toColIndex=e,n.colId=o,this._dispatchColumnEvent("columnMoved",n)}return i===this._colVirtualizer.getLastIndexInView()&&(t<=i&&e>i||e<=i&&t>i)&&this._colVirtualizer.update(),this.updateColumnBounds(),this._updateColumnSeparators(),!0},Be.prototype.moveColumnById=function(t,e){let n=this.getColumnCount(),i=this.getColumnIndex(t);if(i<0||i>=n)return!1;let o=null!=e?this.getColumnIndex(e):-1;return o<0&&(o=n),this._moveColumnByIndex(i,o)},Be.prototype._moveColumnByIndex=function(t,e){return t<e&&--e,t!==e&&this.moveColumn(t,e)},Be.prototype.reorderColumns=function(t,e){let n="";"number"==typeof e?n=this.getColumnId(e):e&&(n=e),this.startBatch("move");let i=0;if(Array.isArray(t)){let e=t.length;if(e>1){let o,r,s,l,a=this.getColumnIds(),u=a.length,h=[],p=!1;for(o=0;o<e;++o){let e=t[o];"number"==typeof e?(s=e,r=a[e]||""):(r=e,s=a.indexOf(r)),r&&s>=0&&(h.push(r),n===r&&(p=!0))}if(e=h.length,p){if(l=this.getColumnIndex(n),l>=0)for(;++l<u&&(n=a[l],!(h.indexOf(n)<0)););(l<0||l>=u)&&(n="")}for(o=e;--o>=0;)r=h[o],s=this.getColumnIndex(r),l=this.getColumnIndex(n),l<0&&(l=u),i|=this._moveColumnByIndex(s,l),n=r}else i=this.moveColumnById(t[0],n)}else null!=t&&(i=this.moveColumnById(t,n));return this.stopBatch("move"),!!i},Be.prototype.getColumnLayout=function(){return this._layoutX},Be.prototype.updateColumnLayout=function(){this._syncLayoutToColumns(0,this.getColumnCount())},Be.prototype._deserializeColumn=function(t,e){if(!e)return;let n,i=e.layout||e,o=e.width;null!=o&&(i.size=o),o=e.scalable,null!=o&&(i.scalable=o),o=e.minWidth,null!=o&&(i.minSize=o),null==i.scalable&&(i.scalable=null==i.size),this._layoutX.deserializeLane(t,i);let r=e.styles;for(n in r)this.setColumnStyle(t,n,r[n]);let s=e.classes;for(n in s)this.enableColumnClass(t,n,s[n]);let l=this._getColumnDef(t),a=e.id;a&&"string"==typeof a&&(l.id=a,l.userId=a);let u=e.field;u&&"string"==typeof u&&(l.field=u);let h=e.dataColumnName;null!=h&&(l.dataColumnName=h),h=e.stationary,null!=h&&(l.stationary=!!h),h=e.leftPinned,null!=h&&(l.leftPinned=!!h),h=e.rightPinned,null!=h&&(l.rightPinned=!!h),h=e.backgroundColor,null!=h&&this.setColumnBackgroundColor(t,h),this.setColumnRenderingHandler(t,e.renderingHandler),this.setColumnDataBindingHandler(t,e.dataBindingHandler),h=e.columnData,h&&this.setColumnData(t,h);let p=e.binding||e.formatter;if(Array.isArray(p)&&(p=p[0]),p&&"function"!=typeof p){let t=p.init;"function"==typeof t&&t(e,this)}},Be.prototype.addRow=function(t){if(null==t)t=1;else if(t<=0)return;this.getColumnCount()<=0&&this.setColumnCount(1);let e=this.getLastSection();null==e&&(e=this.addSection()),e.addRow(t)},Be.prototype.removeRow=function(t){let e=this.getLastSection();null!=e&&(null==t&&(t=1),e.removeRow(t))},Be.prototype.getRowCount=function(){return this._layoutY.getLaneCount()},Be.prototype.setSectionRowCount=function(t,e){let n=this.getSection(t);null!=n&&n.setRowCount(e)},Be.prototype.getRowIndex=function(t,e){return this._sectionStarts[t]+e},Be.prototype.getRelativeIndex=ut._deprecatedFunction,Be.prototype.removeAllRows=function(){let t=this._settings.length;for(let e=0;e<t;++e)this._settings[e].getSection().setRowCount(0),this._sectionStarts[e]=0;this._sectionStarts[t]=0},Be.prototype.getDefaultRowHeight=function(){return this._layoutY.getDefaultLaneSize()},Be.prototype.setDefaultRowHeight=function(t,e){if(this._layoutY.setDefaultLaneSize(t)){this._rowHeightSync=!1;let t=this._layoutY.getDefaultLaneSize();this._rowHeightException=e?"":"title";let n=this._settings.length;for(let e=0;e<n;++e){let n=this._settings[e];n.getType()!==this._rowHeightException&&"bottomPadding"!==n.getId()&&n.getSection().setDefaultRowHeight(t)}this._syncRowHeights(),this._rowHeightSync=!0,this.setRowScrollingStep(this._rowScrollingStep),this._updateColumnSeparators()}},Be.prototype.getDataSource=function(){return this._dataSource},Be.prototype.setDataConflationRate=function(t){this._dataSource.setConflationRate(t)},Be.prototype.getDataConflationRate=function(){return this._dataSource.getConflationRate()},Be.prototype.setDataSource=function(t){t&&t instanceof wt&&(t=new xe(t));let e={};if(e.prevDataSource=this._dataSource,this._dataSource=t||null,e.dataSource=this._dataSource,this._dispatch("dataSourceChanged",e),this._autoSetDataSource){let e=this._settings.length;for(let n=0;n<e;++n)this._settings[n].setDataSource(t)}return this._dispatch("postDataSourceChanged",e),this._dataSource},Be.prototype.setColumnTemplate=ut._deprecatedFunction,Be.prototype.getColumnTemplate=ut._deprecatedFunction,Be.prototype.getColumnRenderEvent=ut._deprecatedFunction,Be.prototype.getColumnDataBindingEvent=function(t){console.log("getColumnDataBindingEvent() is deprecated. Use setColumnDataBindingHandler() instead");let e=this;return{listen:function(n){e.setColumnDataBindingHandler(t,n)},unlisten:function(){e.setColumnDataBindingHandler(t,null)}}},Be.prototype.setColumnStyle=function(t,e,n,i){if(!e)return;let o;ut.isNumber(t)||(t=0,console.log("WARNING: the first parameter for setColumnStyle must be column index")),null==i?o=this._getNestedColumnDef(t,"styles"):(i=this._toSectionType(i),o=this._getNestedColumnDef(t,i,"styles")),o[e]=n;for(let o=this._settings.length;--o>=0;){let r=this._settings[o];null!=i&&i!==r.getType()||r.getSection().setColumnStyle(t,e,n)}},Be.prototype.getColumnBackgroundColor=function(t){return this._getColumnDef(t).backgroundColor||""},Be.prototype.setColumnBackgroundColor=function(t,e){if(null==t||"number"!=typeof t)return;let n=this._getColumnDef(t);if(n.backgroundColor===e)return;n.backgroundColor=e,e=null!=e?e:"";let i=this._settings.length;for(let n=0;n<i;++n){let i=this._settings[n],o=i.getSection();o&&("content"!==i.getType()?this._applyCellsBackgroundColor(o,t,e):o.getColumn(t).setStyle("backgroundColor",e))}},Be.prototype._applyCellsBackgroundColor=function(t,e,n){let i=t.getRowCount();for(let o=0;o<i;o++){if(t.getCellColSpan(e,o)>1)continue;let i=t.getCell(e,o);i&&i.setStyle("backgroundColor",n)}},Be.prototype.applyColumnsBackgroundColor=function(t){if(!t)return;let e=t.getColumnCount();for(let n=0;n<e;n++){let e=this._getColumnDef(n).backgroundColor||"";this._applyCellsBackgroundColor(t,n,e)}},Be.prototype.enableColumnClass=function(t,e,n,i){let o;"number"!=typeof t&&(t=0),null==i?o=this._getNestedColumnDef(t,"classes"):(i=this._toSectionType(i),o=this._getNestedColumnDef(t,i,"classes"));let r=!1;if((n=!1!==n)?o[e]||(r=o[e]=!0):o[e]&&(delete o[e],r=!0),r)for(let o=this._settings.length;--o>=0;){let r=this._settings[o];null!=i&&i!==r.getType()||r.getSection().enableColumnClass(t,e,n)}return r},Be.prototype.hasColumnClass=function(t,e,n){let i;return null==n?i=this._getNestedColumnDef(t,"classes"):(n=this._toSectionType(n),i=this._getNestedColumnDef(t,n,"classes")),!(!i||!i[e])},Be.prototype.setColumnAlignment=function(t,e){let n=e?e.charAt(0).toLowerCase():"",i=0;i|=this.enableColumnClass(t,"tr-align-left","l"===n),i|=this.enableColumnClass(t,"tr-align-right","r"===n),i|=this.enableColumnClass(t,"tr-align-center","c"===n),i&&this._dispatch("columnAlignmentChanged",{colIndex:t,alignment:n})},Be.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"},Be.prototype.getColumnLeft=function(t){let e=this._columnDefs[t];if(e&&e.rightPinned){let e=this.getElement().clientWidth,n=this._layoutX.getTrackSize(),i=n<e?n:e;for(let e=this.getColumnCount()-1;e>=t;--e)i-=this._layoutX.getLaneSize(e);return i}return this._hScrollbarEnabled&&t>=this._pinnedLeftColumnCount?this._layoutX.getLaneStart(t)-this._hscrollbar.getScrollLeft():this._layoutX.getLaneStart(t)},Be.prototype.getColumnRight=function(t){return this.getColumnLeft(t)+this._layoutX.getLaneSize(t)},Be.prototype.getColumnWidth=function(t){return this._layoutX.getLaneSize(t)},Be.prototype.getColumnCustomLaneSize=function(t){return this._layoutX.getCustomLaneSize(t)},Be.prototype._calculateColumnWidths=function(t,e){if(!this._preserveGridSize)return e;let n,i=0,o={},r=t.length,s=new Array(r);for(n=0;n<r;n++)o[t[n]]=!0,s[n]=e[n],i+=e[n];let l=0,a=0,u=this.getColumnCount(),h=this._layoutX;for(n=0;n<u;n++)o[n]||h.isLaneVisible(n)&&(h.getLaneScalability(n)?(l+=h.getMinimumLaneSize(n),a++):l+=h.getLaneSize(n));let p=this.getContentWidth(),d=i+l-p;if(a<1||d>0){for(h.resetLaneToDefaultSize(),h.setTrackSize(p-this._reservedSpace),l=0,n=0;n<u;n++)o[n]||h.isLaneVisible(n)&&(h.getLaneScalability(n)?l+=h.getMinimumLaneSize(n):l+=h.getLaneSize(n));if(d=i+l-p,d>0)for(d/=r,n=0;n<r;n++)s[n]-=d}return s},Be.prototype.setColumnWidth=function(t,e,n){let i=this._calculateColumnWidths([t],[e]),o=this._setColumnWidth(t,i[0],n);return o&&this._syncLayoutToColumns(t,t+1),o},Be.prototype.setColumnWidths=function(t,e){let n,i=0,o=[],r=[],s=[];for(n=t.length;--n>=0;){let i=t[n];null!=i&&(o.push(n),r.push(i));let l=Array.isArray(e)?e[n]:e;s.push(l)}let l=this._calculateColumnWidths(o,r);for(n=0;n<l.length;n++)i|=this._setColumnWidth(o[n],l[n],s[n]);return i&&this._syncLayoutToColumns(0,t.length),!!i},Be.prototype.isColumnVisible=function(t){return this._layoutX.isLaneVisible(t)},Be.prototype.hideColumn=function(t,e){let n=!1===e;this.setColumnVisibility(t,n,0)},Be.prototype.hideColumns=function(t,e){let n=Array.isArray(t)?t.length:0,i=[],o=this.getColumnCount();e=!1!==e;for(let r=0;r<n;++r){let n=t[r];n>=0&&n<o&&this._layoutX.hideLane(n,e,0)&&i.push(n)}if(i.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){let t={};t.colIndices=i,t.hidden=e,this._dispatch("columnVisibilityChanged",t)}},Be.prototype.showAllColumns=function(){let t=[],e=this.getColumnCount();for(let n=0;n<e;++n)this._layoutX.hideLane(n,!1,0)&&t.push(n);if(t.length&&(this._syncLayoutToColumns(),this.requestRowRefresh(),this._hasListener("columnVisibilityChanged"))){let e={};e.colIndices=t,e.hidden=!1,this._dispatch("columnVisibilityChanged",e)}},Be.prototype.getMinimumColumnWidth=function(t){return this._layoutX.getMinimumLaneSize(t)},Be.prototype.setMinimumColumnWidth=function(t,e){this._layoutX.setMinimumLaneSize(t,e)&&this._syncLayoutToColumns(t,t+1)},Be.prototype.setMinimumColumnWidths=function(t,e){let n=0,i=NaN,o=NaN;for(let r=t.length;--r>=0;){let s=t[r];null!=s&&(o||(o=r),i=r,n|=this._layoutX.setMinimumLaneSize(r,s,e))}return n&&this._syncLayoutToColumns(i,o+1),!!n},Be.prototype.getColumnScalability=function(t){return this._layoutX.getLaneScalability(t)},Be.prototype.setColumnScalability=function(t,e){let n=!1;return ut.isNumber(t)?(e=!1!==e,n=this._layoutX.setLaneScalability(t,e),n&&this._syncLayoutToColumns(t,t+1)):this.setDefaultColumnScalable(t),n},Be.prototype.setDefaultColumnScalable=function(t){this._layoutX.setDefaultScalability(!!t)},Be.prototype.resetColumnWidths=function(){let t=this._layoutX.resetLaneToDefaultSize();return t&&this._syncLayoutToColumns(0,this.getColumnCount()),t},Be.prototype.setColumnDefaultWidth=function(t,e){this._layoutX.setLaneDefaultSize(t,e)},Be.prototype.preserveProportion=function(t){this._preserveProportion=!0===t},Be.prototype.isProportionPreserved=function(){return this._preserveProportion},Be.prototype.preserveGridSize=function(t){this._preserveGridSize=!0===t},Be.prototype.getColumnData=function(t){return this._getColumnDef(t).columnData},Be.prototype.setColumnData=function(t,e){return this._getColumnDef(t).columnData=e||{},e},Be.prototype.newColumnData=Be.prototype.getColumnData,Be.prototype.setAlwaysRenderColumn=function(t,e){this.getColumnData(t).alwaysRender=!1!==e},Be.prototype._isAlwaysRenderColumn=function(t){return!0===this.getColumnData(t).alwaysRender},Be.prototype.getFitContentWidth=function(){return this._fitContentWidth},Be.prototype.setFitContentWidth=function(t){this._fitContentWidth!==t&&(this._fitContentWidth=t,this.enableClass("fit-width",this._fitContentWidth))},Be.prototype.loadPlugin=function(t,e){let n=null;if("string"==typeof t){let e=window.tr,i=e?e.grid:null;if(!i)return null;if(i[t])n=new i[t];else{if(!i[t+"Plugin"])return null;n=new i[t+"Plugin"]}}else n=t;if(!n||!n.getName)return null;let i=n.getName();if(!i)return null;let o=this._plugins[i];if(o){if(o===n)return o;console.log("WARNING: Two of the same "+i+"s cannot be loaded on a single grid. The existing plugin is replaced."),this.unloadPlugin(i)}return n.initialize&&n.initialize(this,e),this._plugins[i]=n,n},Be.prototype.unloadPlugin=function(t){let e;if(t){let n="";"string"==typeof t?n=t:t.getName&&(n=t.getName()),e=this._plugins[n],e||(n+="Plugin",e=this._plugins[n]),e&&(e.unload&&e.unload(this),delete this._plugins[n])}return e||null},Be.prototype.getPlugin=function(t){let e=this._plugins[t];return e||(e=this._plugins[t+"Plugin"]),e||null},Be.prototype.getPlugins=function(){let t=[];for(let e in this._plugins)t.push(this._plugins[e]);return t},Be.prototype.getPluginList=function(){let t=[];for(let e in this._plugins)t.push(e);return t},Be.prototype.freezeSection=function(t){this._fixFrozenTopSections=!0,this._freezeTopSectionAt(t)},Be.prototype.resetSectionFreezing=function(){this._fixFrozenTopSections=!1,this._updateFrozenTopSections()},Be.prototype._freezeTopSectionAt=function(t){if("number"==typeof t){let e=t+1;if(e===this._startVScrollbarIndex)return;this._startVScrollbarIndex=e}else this._startVScrollbarIndex=-1,"string"==typeof t&&(this._tempFrozenSectionRef=t);this._onSectionCountChanged()},Be.prototype.freezeFooter=function(t){this._fixFrozenBottomSection=!0,this._frozenFooterCount!==t&&(this._setFrozenFooter(t),this._onSectionCountChanged())},Be.prototype._setFrozenFooter=function(t){this._frozenFooterCount!==t&&(this._frozenFooterCount=t,this._vscrollbar.setFooterCount(t),this._hscrollbar.setFooterCount(t))},Be.prototype.getFooterCount=function(){return this._frozenFooterCount},Be.prototype.freezeColumn=function(t,e){let n,i,o=this.getColumnCount(),r=0,s=0,l=!1;if(t||0===t)for(this._hScrollbarEnabled=!0,r=t>=0?t+1:0,this._pinnedLeftColumnCount!==r&&(l=!0,this._pinnedLeftColumnCount=r),n=0;n<o;++n)i=this._getColumnDef(n),i.leftPinned=--r>=0;else this._hScrollbarEnabled=!1;if(null!=e)for(s=e>0?e:0,this._pinnedRightColumnCount!==s&&(l=!0,this._pinnedRightColumnCount=s),n=o;--n>=0;)i=this._getColumnDef(n),i.rightPinned=--s>=0;this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),this._updateColumnSeparators(),l&&(this._isEventDispatching("pinningChanged")||this._dispatch("pinningChanged",{}))},Be.prototype._countPinnedLeftColumns=function(){let t=0;if(this._hScrollbarEnabled)for(let e=this._columnDefs.length;--e>=0;){let n=this._columnDefs[e];if(n&&n.leftPinned){t=e+1;break}}return this._pinnedLeftColumnCount=t,t},Be.prototype._countPinnedRightColumns=function(){let t=0;if(this._hScrollbarEnabled){let e,n=this._columnDefs.length;for(e=0;e<n;++e){let t=this._columnDefs[e];if(t&&t.rightPinned)break}t=n-e}return this._pinnedRightColumnCount=t,t},Be.prototype.isPinnedColumn=function(t){return t<this.getFrozenColumnCount()||t>=this.getFirstPinnedRightIndex()},Be.prototype.getFrozenColumnCount=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:0},Be.prototype.getPinnedLeftColumnCount=Be.prototype.getFrozenColumnCount,Be.prototype.getPinnedRightColumnCount=function(){return this._pinnedRightColumnCount},Be.prototype.getFirstPinnedRightIndex=function(){return this.getColumnCount()-this._pinnedRightColumnCount},Be.prototype.updateLayout=function(){this._disposed||this._layoutUpdating||(this._layoutUpdating=!0,this._dispatch("preForcedUpdate",{}),this._updateLayout(),this._colVirtualizer.isEnabled()&&this._activateColumns(),this._layoutUpdating=!1)},Be.prototype.updateScrollbars=function(t,e){e&&this._updateScrollbarWidth(!0,!1),t&&this._updateScrollbarHeight(!0,!1)},Be.prototype.freezeLayout=function(t){t=!1!==t;let e=this._frozenLayout;if(e!==t){this._frozenLayout=t;let e,n,i=this.getPlugin("SortableTitlePlugin");this._frozenLayout&&i&&i.freezeIndicator(!0),this._frozenLayout||(this._disableEvent("widthChanged"),this._onSectionCountChanged(),this._onColumnCountChanged(),this._colVirtualizer.isEnabled()&&this._activateColumns()),this._rowHeightSync=!1;let o=this._settings.length;for(e=0;e<o;e++)n=this._settings[e].getSection(),n.setFrozenLayout(this._frozenLayout);this._frozenLayout||(this._syncLayoutToColumns(0,this.getColumnCount()),this._disableEvent("widthChanged",!1),this._dispatch("widthChanged",{}),this._syncRowHeights()||this._rowVirtualizer.update(!0),i&&i.freezeIndicator(!1)),this._rowHeightSync=!0}return e},Be.prototype.unfreezeLayout=function(t){this.freezeLayout(!1===t)},Be.prototype.isLayoutFrozen=function(){return this._frozenLayout},Be.prototype.showBorders=ut._deprecatedFunction,Be.prototype.hideBorders=ut._deprecatedFunction,Be.prototype.toggleBorders=function(t){this.toggleClass("no-borders",null!=t?!t:null)},Be.prototype.toggleGridlines=function(t){this.toggleClass("no-gridlines",null!=t?!t:null)},Be.prototype.toggleVerticalLines=function(t){this.toggleClass("no-vertical-grid-line",null!=t?!t:null)},Be.prototype.toggleHorizontalLines=function(t){this.toggleClass("no-horizontal-grid-line",null!=t?!t:null)},Be.prototype.toggleContentVerticalLines=function(t){this.toggleClass("no-content-vertical-line",null!=t?!t:null)},Be.prototype.getDataColumnMap=function(){let t=[];for(let e=this.getColumnCount();--e>=0;)t[e]=this.getDataColumnName(e);return t},Be.prototype.setDataColumnMap=function(t){let e,n;if(t)for(e=t.length;--e>=0;)n=this._getColumnDef(e),n.dataColumnName=t[e];else for(e=this._columnDefs.length;--e>=0;)n=this._columnDefs[e],n&&null!=n.dataColumnName&&(n.dataColumnName=null)},Be.prototype.getDataColumnName=function(t){return this._getColumnDef(t).dataColumnName||""},Be.prototype.setDataColumnName=function(t,e){this._getColumnDef(t).dataColumnName=e},Be.prototype.setDefaultRenderingHandler=function(t){this._renderingHandler="function"==typeof t?t:null},Be.prototype.setDefaultDataBindingHandler=function(t){this._dataBindingHandler="function"==typeof t?t:null},Be.prototype.setColumnRenderingHandler=function(t,e){this._getColumnDef(t).renderingHandler="function"==typeof e?e:null},Be.prototype.setColumnDataBindingHandler=function(t,e){this._getColumnDef(t).dataBindingHandler="function"==typeof e?e:null},Be.prototype.getColumnRenderingHandler=function(t){return this._getColumnDef(t).renderingHandler||null},Be.prototype.getColumnDataBindingHandler=function(t){return this._getColumnDef(t).dataBindingHandler||null},Be.prototype.enableRowHighlighting=function(t){if(null==t&&(t=!0),this._rowHighlighting!==t){this._rowHighlighting=t;let e=this.getAllSections("content");for(let t=e.length;--t>=0;)e[t].enableRowHighlighting(this._rowHighlighting)}},Be.prototype._getTarget=function(t){let e=t.target;if(e){let n=null;return this._element.contains(e)||(n=t.composedPath?t.composedPath():t.path),n?n[0]||null:e}return t.getElement?t.getElement():ut.isElement(t)?t:null},Be.prototype.getRelativePosition=function(t,e){if(!t)return{};let n=e||{},i=this._getTarget(t);t.target?ut.getRelativePosition(t,this.getElement(),n):i&&ut.getRelativePosition(i,this.getElement(),n),1!==this._zoomFactor&&(n.x/=this._zoomFactor,n.y/=this._zoomFactor),n.hit=!1,n.grid=this,n.clientX=t.clientX,n.clientY=t.clientY,n.zoomFactor=this._zoomFactor;let o=ut.closestElement(i,"cell");if(!o)return n;n.cellElement=o;let r=ut.closestElement(o,"column");n.columnElement=r;let s=null;if(s=r?ut.closestElement(r,"tr-lg"):ut.closestElement(o,"tr-lg"),!s)return n;n.sectionName=s.id||ut.closestElement(s,"tr-vlg").id;let l=this.getSectionSettings(n.sectionName);if(!l)return n;l.extendEventArg(n);let a=l.getSection(),u=a.getColumnIndex(r||o);return u<0||(n.colIndex=u,!1===this._hitTestY(-1,n)||(o.stretched?n.cell=a.getStretchedCell(u,n.rowIndex):n.cell=a.getCell(u,n.rowIndex),n.hit=!0)),n},Be.prototype.getVScrollbar=function(){return this._vscrollbar},Be.prototype.getHScrollbar=function(){return this._hscrollbar},Be.prototype.autoHideScrollbars=function(t){t=null==t||t,this._vscrollbar.setAutoHide(t),this._hscrollbar.setAutoHide(t)},Be.prototype.getVScrollStartIndex=function(){return this._startVScrollbarIndex},Be.prototype.getHScrollStartIndex=function(){return this._hScrollbarEnabled?this._pinnedLeftColumnCount:-1},Be.prototype.scrollToColumn=function(t,e){if(!this._updateScrollbar(this._hscrollbar))return!1;let n=this._layoutX.getLaneCount();if(t<=0?t=0:t>=n&&(t=n-1),this.isPinnedColumn(t))return!1;let i=this._hScrollbarEnabled?this._layoutX.getLaneStart(this._pinnedLeftColumnCount):0,o=this._hscrollbar.getScrollLeft(),r=o+i,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){let t=a-i;if(o!==t)return this._hscrollbar.setScrollLeft(t),!0}else{let e=r+s;if(t>=this._layoutX.hitTest(e-.1)){let t=o+(a+u)-e;return this._hscrollbar.setScrollLeft(t),!0}}return!1},Be.prototype.getScrollLeft=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getScrollLeft():0},Be.prototype.setScrollLeft=function(t){this._updateScrollbar(this._hscrollbar)&&this._hscrollbar.setScrollLeft(t)},Be.prototype.scrollRight=function(t){this.setScrollLeft(this._hscrollbar.getScrollLeft()+t)},Be.prototype.getScrollWidth=function(){return this._updateScrollbar(this._hscrollbar)?this._hscrollbar.getContentWidth():0},Be.prototype.getYScrollVal=function(t,e,n){if(!this._updateScrollbar(this._vscrollbar))return null;let i=null;t&&(i=this.getSection(t));let o=i?i.getRowOffset():this._sectionStarts[this._startVScrollbarIndex],r=this._layoutY.getLaneStart(this._startVScrollbarIndex),s=this._layoutY.getLaneCount();if(e<=0?e=0:e>=s&&(e=s-1),n)return this._layoutY.getLaneStart(e+o)-r;let l=this.getVerticalViewInfo();if(e<l.firstFullRow){let t=e-2;return t<0&&(t=0),this._layoutY.getLaneStart(t+o)-r}return e>l.lastFullRow?this._layoutY.getLaneStart(e+o+2+1)-l.viewHeight-r:null},Be.prototype.scrollToRow=function(t,e,n){let i=this.getYScrollVal(t,e,n);null!==i&&this._vscrollbar.setScrollTop(i)},Be.prototype.getVerticalViewInfo=function(){let t=this._sectionStarts[this._startVScrollbarIndex],e=this._layoutY.getLaneStart(t),n=this._vscrollbar.getHeight(),i=this._vscrollbar.getScrollTop()+e,o=i+n,r=this._layoutY.hitTest(i)-t,s=this._layoutY.hitTest(o-.1);return s<0&&(s=this._layoutY.getLaneCount()-1),s-=t,{topRowIndex:r,firstFullRow:this._layoutY.getLaneStart(r+t)<i?r+1:r,lastFullRow:this._layoutY.getLaneEnd(s+t)>o?s-1:s,bottomRowIndex:s,viewHeight:n,viewTop:i,viewBottom:o}},Be.prototype.getVScrollView=function(){if(!this._updateScrollbar(this._vscrollbar))return null;let t=this._layoutY.getLaneCount();if(0===t)return null;let e=this._sectionStarts[this._startVScrollbarIndex],n=this._layoutY.getLaneStart(e),i=this._vscrollbar.getScrollTop()+n,o=this._vscrollbar.getHeight(),r=i+o,s=this._layoutY.hitTest(i),l=this._layoutY.hitTest(r-.1),a=this._layoutY.getLaneStart(s+e),u=this._layoutY.getLaneEnd(l+e),h=i-o,p=h<=n?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;let _={};return _.viewTop=i-n,_.viewBottom=r-n,_.topRowIndex=s,_.bottomRowIndex=l,_.firstFullRow=a<i?s+1:s,_.lastFullRow=u>r?l-1:l,_.prevPageRowIndex=p-e,_.nextPageRowIndex=c-e,_},Be.prototype.getScrollTop=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getScrollTop():0},Be.prototype.setScrollTop=function(t){this._updateScrollbar(this._vscrollbar)&&this._vscrollbar.setScrollTop(t)},Be.prototype.scrollDown=function(t){this.setScrollTop(this._vscrollbar.getScrollTop()+t)},Be.prototype.getScrollHeight=function(){return this._updateScrollbar(this._vscrollbar)?this._vscrollbar.getContentHeight():0},Be.prototype.restoreScrollbars=function(){this._vscrollbar.restoreTrackPosition()},Be.prototype.enableAutoSetDataSource=function(t){this._autoSetDataSource=t},Be.prototype.getRowVirtualizer=function(){return this._rowVirtualizer},Be.prototype.getColumnVirtualizer=function(){return this._colVirtualizer},Be.prototype.enableRowVirtualization=function(t){this._rowVirtualizer.enable(t),this._rowVirtualizer.isEnabled()&&this._vscrollbar.isEnabled()?this._rowVirtualizer.activate():this._rowVirtualizer.deactivate()},Be.prototype.isRowVirtualizationEnabled=function(){return this._rowVirtualizer.isEnabled()},Be.prototype.enableColumnVirtualization=function(t){this._colVirtualizer.enable(t);let e=this._colVirtualizer.isEnabled();for(let t=this._settings.length;--t>=0;)this._settings[t].enableColumnVirtualization(e)},Be.prototype.isColumnVirtualizationEnabled=function(){return this._colVirtualizer.isEnabled()},Be.prototype.setRowScrollingStep=function(t){this._rowScrollingStep=t>0?t:0,this._vscrollbar.setScrollingStep(this._layoutY.getDefaultLaneSize()*this._rowScrollingStep)},Be.prototype.getVMouseWheelHandler=function(){return this._vscrollbar.getDefaultMouseWheelLogic()},Be.prototype.synchronizeVScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);let 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)},Be.prototype.synchronizeHScrollbar=function(t){t.unlisten("mousemove",t._onMouseMove),t.listen("mousemove",this._onMouseMove);let 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)},Be.prototype.updateRowData=function(t,e,n,i){let o=this.getSectionSettings(t||"content");o&&o.updateRowData(e,n,i)},Be.prototype.rerender=function(){let t=this._settings.length;for(let e=0;e<t;e++)this._settings[e].rerender()},Be.prototype.requestRowRefresh=function(){this._rowRefreshTimer||(this._rowRefreshTimer=setTimeout(this._onRowRefresh,100))},Be.prototype._requestScrollbarUpdate=function(){this._updateScrollbarHeight(!0,!0),this._rowHeightTimerId=0},Be.prototype.deactivateRendering=function(t){if((t=!1!==t)==this._noBinding)return;this._noBinding=t;let e=this.getSectionSettings("content");e&&(e.disableDataBinding(t),t||this.requestRowRefresh())},Be.prototype._onRowRefresh=function(){this._rowRefreshTimer=0,this.updateRowData()},Be.prototype.disableLazyRendering=function(t){console.log("WARNING: This function is deprecated.")},Be.prototype.getData=function(t,e,n){let i=this.getSectionSettings(t);if(!i)return null;let o=this._toDataColumnName(e);return i.getData(o,n)},Be.prototype.setData=function(t,e,n,i){let o=this.getSectionSettings(t);if(o&&o.isDataBindable()){let t=this._toDataColumnName(e);return o.setData(t,n,i)}return!1},Be.prototype.removeRowData=function(t,e){let n=this.getSectionSettings(t);return!(!n||!n.isDataBindable())&&n.removeRowData(e)},Be.prototype.setHidingMethod=function(t){if(t||(t=""),this._hidingMethod!==t){this._hidingMethod=t;let e=this.getAllSections();for(let n=e.length;--n>=0;)e[n].setHidingMethod(t)}},Be.prototype.getHorizontalLayout=function(){return this._layoutX},Be.prototype.setColumnVisibility=function(t,e,n){if(this._layoutX.hideLane(t,!e,n)){if(this._syncLayoutToColumns(t,t+1),e&&this.requestRowRefresh(),this._hasListener("columnVisibilityChanged")){let n={};n.colIndex=t,n.hidden=!e,this._dispatch("columnVisibilityChanged",n)}return!0}return!1},Be.prototype.getColumnVisibility=function(t,e){return this._layoutX.getLaneVisibilityBit(t,e)},Be.prototype.reserveRightSpace=function(t){if(this._reservedSpace!==t){this._reservedSpace=t;for(let e=this._settings.length;--e>=0;)this._settings[e].getSection().reserveRightSpace(t);return this._onColumnCountChanged(),this._updateScrollbarWidth(!0,!0),!0}return!1},Be.prototype.getHiddenInput=function(t){return t?this._firstHiddenInput:this._lastHiddenInput},Be.prototype.focus=function(){let t=this._lastHiddenInput,e=He(t);if(t&&t!==e){let e=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&&e===window.pageXOffset||window.scrollTo(e,n)}},Be.prototype.isBinding=function(){return this._dispatchingDataChanged},Be.prototype.hideRow=function(t,e){this._dataSource.hideRow(t,e)},Be.prototype.hideRows=function(t,e){Array.isArray(t)?this._dataSource.hideRows(t,e):this._dataSource.hideRow(t,e)},Be.prototype.showRows=function(t,e){Array.isArray(t)?this._dataSource.showRows(t,e):this._dataSource.showRows([t],e)},Be.prototype.unhideAllRows=function(){this._dataSource.unhideAllRows()},Be.prototype.hasHiddenRow=function(){return this._dataSource.hasHiddenRow()},Be.prototype.initSimpleTable=function(t){let e=0;if(t||this.getColumnCount()||(t=["Default"]),t){e=t.length,this.setColumnCount(e),this.setDataColumnMap(t);for(let n=0;n<e;++n)this.setColumnField(n,t[n])}let n=this.addSection("title");if(n.addRow(1),!this._renderingHandler)for(let i=0;i<e;++i)n.setCellContent(i,0,t[i]);this.addSection("content");let i=this.getSectionSettings("title");i.disableDataBinding();let o=this.getSectionSettings("content");o.setAutoSyncRowCount(!0),o.setParent(i),this._dataBindingHandler||this.setDefaultDataBindingHandler(Be._defaultDataBinding)},Be._defaultDataBinding=function(t){t.cell.setContent(t.dataValue)},Be.prototype.selectColumn=function(t,e){for(let n=this._settings.length;--n>=0;)this._settings[n].getSection().selectColumn(t,e);this.updateColumnBounds()},Be.prototype.isSelectedColumn=function(t){let e=this._settings[0]||null;return!!e&&e.getSection().isSelectedColumn(t)},Be.prototype.updateColumnBounds=function(){if(this._columnBoundConflator.conflate())return;let t=this._settings.length;if(!t)return;let e,n=[],i=null,o=this.getColumnCount(),r=[];for(e=0;e<o;e++)this.isSelectedColumn(e)?(r.push(e),i||(i=[e,-1])):i&&(i[1]=e-1,n.push(i),i=null);i&&(i[1]=o-1,n.push(i),i=null);let s={selectedColumns:r,selectionRanges:n};this._dispatch("beforeColumnBoundUpdate",s);let l=n.length,a=[],u=[],h=this._settings[0],p=h.getSection();for(e=0;e<l;++e){i=n[e];let t=[0,0],o=[!1,!1];p.calculateColumnBounds(i[0],i[1],t,o),t[0]<t[1]&&(a.push(t),u.push(o))}let d=0,c=-1;for(null!=s.topBoundRowIndex&&(c=+s.topBoundRowIndex),c>=0&&"title"===h.getType()&&(d=this._layoutY.getLaneStart(c)),p.updateColumnBounds(a,u,d),e=1;e<t;e++)p=this._settings[e].getSection(),p.updateColumnBounds(a,u)},Be.prototype._updateColumnSeparators=function(){let t=this._settings.length;if(t)for(let e=0;e<t;e++){let t=this._settings[e].getSection();t&&t.updateColumnSeparators()}},Be.prototype.getColumnRect=function(t,e){let n=this.getElement().clientWidth,i=n,o=this._hscrollbar;o.isActive()&&(i=o.getTrackSize());let r=0,s=0;if(this._settings.length){let n=[0,0];this._settings[0].getSection().calculateColumnBounds(t,e,n,[]),r=n[0],s=n[1]-r}return{top:0,left:r,width:s,height:this._layoutY.getTrackSize(),leftPinnedIndex:this._pinnedLeftColumnCount-1,rightPinnedIndex:this.getFirstPinnedRightIndex(),scrollViewSize:i,gridWidth:n}},Be.prototype.getRowRect=function(t,e){let n=this._layoutX.getTrackSize(),i=this.getElement().clientWidth;n=n<i?n:i;let 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());let 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),d-=l,c-=l,{top:d,left:0,width:n,height:c-d,scrollViewSize:u,scrollViewTop:l,scrollViewBottom:p}},Be.prototype.normalizeConfig=function(t){t||(t={});let e,n,i=t.columns,o=i?i.length:0,r=t.columnFreezing;null==r&&(r=t.freezeColumn);let 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&&(n=i[e],n&&(n.rightPinned=!0));return null!=r&&(delete t.columnFreezing,delete t.freezeColumn,r>=0&&i&&(n=i[r],n&&(n.leftPinned=!0))),t},Be.prototype.setColumnGrouping=function(t){this._groupDefs=t||null},Be.prototype.getColumnGroupParentId=function(t){if(this._groupDefs){let e="number"==typeof t?this.getColumnId(t):t;return this._groupDefs.getParentId(e)}return""},Be.prototype.getColumnGroupChildIds=function(t){if(this._groupDefs){let e=this._groupDefs.getLeafDescendants(t);if(e&&e.length>0)return e}return null},Be.prototype.getValidColumnList=function(t,e){let n=[];if(!t)return n;e||(e=this.createColumnMap(t));let i=this.getColumnCount();for(let t=0;t<i;++t){let i=this._getColumnDef(t).id;null!=e[i]&&n.push({index:t,id:i})}return n},Be.prototype.createColumnMap=function(t){t||(t=this.getColumnIds());let e={},n=t.length;for(let i=0;i<n;i++){let n=t[i];"number"==typeof n&&(n=this.getColumnId(n)),n&&(e[n]=!0)}return e},Be.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)},Be.prototype.stopBatch=function(t){return!!t&&(this._dispatch("afterBatchOperation",{batches:this._batches,batchType:t}),"reset"===t&&this._disableEvent("columnVisibilityChanged",!1),delete this._batches[t],D(this._batches)&&(this._batches=null),!0)},Be.prototype._dispatchColumnEvent=function(t,e){let n=this._batches;n&&(e.batches=n),this._dispatch(t,e)},Be.prototype._dispatchColumnPositionChanged=function(){this._columnPositionConflator.conflate()||this._dispatch("columnPositionChanged",{sender:this})},Be.prototype._dispatchRowPositionChanged=function(){this._rowPositionConflator.conflate()||this._dispatch("rowPositionChanged",{sender:this})},Be.prototype._getAllSections=function(){let t=[],e=this._settings.length;for(let n=0;n<e;n++)t.push(this._settings[n].getSection());return t},Be.prototype._getNextSection=function(t,e,n){let i=this.getSectionIndex(e)+t;if(null==n)return this.getSectionSettings(i);n=this._toSectionType(n);let o=this._settings.length;for(;i>=0&&i<o;){let e=this._settings[i];if(n===e.getType())return e;i+=t}return null},Be.prototype._toSectionType=function(t){if(Be._sectionType[t])return t;if(ut.isString(t))switch(t.charAt(0).toLowerCase()){case"t":return"title";case"h":case"s":return"header";case"f":return"footer"}return"content"},Be.prototype._newSection=function(t,e){if(e)for(let t=this._settings.length;--t>=0;)if(this._settings[t].getId()===e)return null;t=this._toSectionType(t);let n={horizontalScrollbar:this._hscrollbar},i="content"===t?new ke(n):new we(n);i._setContext(this);let o=new Ee(i);o.setId(e),o.setType(t),o.listen("dataChanged",this._onSectionDataChanged),o.listen("rowAvailable",this._onRowAvailable);let r="content"===t&&this._rowHighlighting;return i.enableRowHighlighting(r),i.enableShading(!1),i.setHidingMethod(this._hidingMethod),o.enableColumnVirtualization(this._colVirtualizer.isEnabled()),i.setColumnCount(this._layoutX.getLaneCount()),i.reserveRightSpace(this._reservedSpace),this._syncLayoutToSectionColumns(i),this._syncStyleToSectionColumns(i,t),t!==this._rowHeightException&&i.setDefaultRowHeight(this._layoutY.getDefaultLaneSize()),i.listen("rowHighlighted",this._onRowHightlighted),i.listen("rowCountChanged",this._onRowCountChanged),i.listen("rowHeightChanged",this._onRowHeightChanged),o},Be.prototype._putToLast=function(t){if(0===this._settings.length)t.insertBefore(this._lastHiddenInput);else{let e=this.getLastSection().getElement().nextSibling;null!==e?t.insertBefore(e):t.insertBefore(this._lastHiddenInput)}},Be.prototype._syncStyleToSectionColumns=function(t,e){let n;for(let i=this._columnDefs.length;--i>=0;){let o=this._getColumnDef(i),r=o.styles;for(n in r)t.setColumnStyle(i,n,r[n]);let s=o.classes;for(n in s)t.enableColumnClass(i,n,!0);let l=o[e];if(l){for(n in r=l.styles,r)t.setColumnStyle(i,n,r[n]);for(n in s=l.classes,s)t.enableColumnClass(i,n,!0)}}},Be.prototype._syncRowHeights=function(){let t=this._settings.length;for(let e=0;e<t;++e)this._syncSectionRowHeights(this._settings[e].getSection());return!this._frozenLayout&&this._updateScrollbarHeight(!0,!0)},Be.prototype._syncSectionRowHeights=function(t){this._layoutY.copyFrom(t.getRowLayout(),this._sectionStarts[t.getIndex()])},Be.prototype._setColumnWidth=function(t,e,n){let i=!1,o=this._layoutX;if(null!=n)i=o.setLaneScalability(t,!!n);else{let n=o.getLaneScalability(t);if(this._preserveProportion){if(n){let n=this.getColumnCount(),i=0,r=0;for(let t=0;t<n;++t){if(!o.getLaneScalability(t))continue;let e=o.getLaneSize(t);i+=o.getCustomLaneSize(t),r+=e}(!(e=(e*i-e*o.getCustomLaneSize(t))/(r-e))||e<0)&&(e=i)}}else i=o.setLaneScalability(t,!1)}return i=o.setLaneSize(t,e)||i,i},Be.prototype._dispatchColumnAddedEvent=function(t,e,n,i){let o={};if(this._hasListener("columnAdded"))if(o.atTheMiddle=n,1===e)o.colIndex=t,o.context=i,this._dispatchColumnEvent("columnAdded",o);else{let n=Array.isArray(i)?i:[];for(let i=0;i<e;++i)o.colIndex=t+i,o.context=n[i],this._dispatchColumnEvent("columnAdded",o)}this._frozenLayout&&(o.noDataUpdate=!0),this._dispatchColumnRenderEvent(o,t,t+e,0,this._settings.length,NaN,NaN)},Be.prototype._dispatchColumnRenderEvent=function(t,e,n,i,o,r,s){if(!(i<o))return;let l;if(t.sender=this,t.fromColIndex=e,t.toColIndex=n,this._hasListener("preSectionRender"))for(l=i;l<o;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("preSectionRender",t);for(let a=e;a<n;++a){let e=this.getColumnRenderingHandler(a)||this._renderingHandler;if(e)for(t.colIndex=a,t.dataColumnName=this.getDataColumnName(a),l=i;l<o;++l){let n=this._settings[l];n.extendRenderEventArg(t,r,s);let i=n.getSection(),o=t.fromRowIndex,u=t.toRowIndex;for(let n=o;n<u;++n)t.rowIndex=n,t.cell=i.getCell(a,n,!1),e(t)}}if(this._hasListener("postSectionRender"))for(l=i;l<o;++l)this._settings[l].extendRenderEventArg(t,r,s),this._dispatch("postSectionRender",t);if(!t.noDataUpdate&&!this._noBinding)for(l=i;l<o;++l)this.updateRowData(this._settings[l],r,s-1)},Be.prototype._dispatchRowExpansionBinding=function(t){if(!this._hasListener("rowExpansionBinding"))return;let e=t.dataSource;if(!e||!e.getDataSource())return;let n=t.fromRowIndex,i=t.toRowIndex,o=e.getVisibleRowIds(!0),r=t.section;t.rowData=null,t.cell=null;let s=!1;for(let l=i-1;l>=n;--l){let n=e.getRowId(l);if(!s){let t=e.getRowExpansionCount(n);if(t>0){l=l+t+1,s=!0;continue}}let i=r.getContextRow(l);if(!i)continue;let a=e.getExpansionParentByRowId(n);if(a)t.originalRowData=e.getRowData(a),t.originalRowId=a,t.rowExpansion=i.rowExpansion=!0;else{if(!i.rowExpansion)continue;t.originalRowData=null,t.originalRowId=null,t.rowExpansion=i.rowExpansion=!1}t.rowId=o[l],t.rowIndex=l,this._dispatch("rowExpansionBinding",t)}t.originalRowData=null,t.originalRowId=null,t.rowExpansion=!1},Be.prototype._removeColumn=function(t){let e=this._layoutX.getLaneCount();if(t>e&&(t=e),t<=0)return;let n=e-t;this._layoutX.setLaneCount(n);for(let t=this._settings.length;--t>=0;)this._settings[t].getSection().setColumnCount(n);let i=this._columnDefs.slice(n);if(this._columnDefs.length=n,this._onColumnCountChanged(),this._syncLayoutToColumns(n,0,!0),this._hasListener("columnRemoved")){let t={};for(let o=e;--o>=n;){let e=i[o-n];t.colIndex=o,t.columnData=e?e.columnData:null,this._dispatchColumnEvent("columnRemoved",t)}}},Be.prototype._onSectionDataChanged=function(t){if(this._dispatchingDataChanged)return;let e=this._layoutX.getLaneCount();if(this._dispatchingDataChanged=!!e,!e)return;let n,i,o=t.fromRowIndex,r=t.toRowIndex,s=t.section,l=t.dataSource,a=l&&l.getDataSource()?1:0;s._startBindingSession(!0),a&&(n=l.getVisibleRowIds(!0),i=l.getMultipleRowData(n,o,r),t.dataRows=i);let u="content"===t.sectionType;u&&this._dispatch("beforeContentBinding",t),this._dispatch("preSectionDataBinding",t);let h=this.getDataColumnMap();for(let l=0;l<e;++l)if(s.isColumnActive(l)&&(this.isColumnVisible(l)||this._isAlwaysRenderColumn(l))){let e=this.getColumnDataBindingHandler(l)||this._dataBindingHandler;if(e){let u=h[l];t.dataColumnName=u,t.colIndex=l;for(let h=o;h<r;++h){let o=a?i[h]:null;o&&(t.rowData=o,t.rowId=n[h],t.dataValue=o?o[u]:null,t.rowIndex=h,t.cell=s.getCell(l,h,!1),e(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},Be.prototype.resetInternalState=function(){this._firstRendered=!1},Be.prototype._updateScrollbar=function(t){return!!t&&(t.isEnabled()&&t.update(),t.isActive())},Be.prototype._onVScroll=function(t){this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop()),this._dispatchRowPositionChanged()},Be.prototype._onHScroll=function(t){let e=this._hscrollbar.getScrollLeft();this._colVirtualizer.setViewOffset(e),this.updateColumnBounds(),this._dispatchColumnPositionChanged()},Be.prototype._onVScrollEnabled=function(){this._updateScrollbarHeight(!0,!1),this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.activate(),this._vscrollbar.getAutoHide()||this._updateVScrollbar()},Be.prototype._onVScrollDisabled=function(){this._rowVirtualizer.isEnabled()&&this._rowVirtualizer.deactivate()},Be.prototype._onRowInViewChanged=function(t){let e=t.firstIndex,n=t.lastIndex+1,i=this._settings.length,o=[0,0];for(let t=0;t<i;++t){let i=this._settings[t],r=i.getSection();r&&!r.getFrozenLayout()&&(r.activateRows(e,n,o),this.updateRowData(i,o[0],o[1]-1))}},Be.prototype._onColInViewChanged=function(t){if(!this.getColumnCount())return;let e=t.prevFirstIndex,n=t.prevLastIndex,i=t.firstIndex,o=t.lastIndex,r=e<i?e:i,s=n>o?n:o;this._activateColumns(i,o,r,s);let l=this.getSectionCount();for(let t=0;t<l;++t){let e=this._settings[t];this.updateRowData(e)}},Be.prototype._activateColumns=function(t,e,n,i){null==n&&(n=0),null==i&&(i=this.getColumnCount()-1);let o=this._getColActivationList(t,e,n,i);for(let t=this.getSectionCount();--t>=0;)this._settings[t].activateColumns(o,n,i)},Be.prototype._getColActivationList=function(t,e,n,i){null==n&&(n=0);let o=this.getColumnCount();null==i&&(i=o-1),null==t&&(t=this._colVirtualizer.getFirstIndexInView()),null==e&&(e=this._colVirtualizer.getLastIndexInView());let r=this.getHScrollStartIndex(),s=this.getFirstPinnedRightIndex(),l=new Array(i+1);for(let o=n;o<=i;++o)l[o]=o<r||o>=t&&o<=e||o>=s;return l},Be.prototype._getColumnDef=function(t){if(t>=0){let e=this._columnDefs[t];return e||(e=this._columnDefs[t]={id:""+Be._runningColumnId++,columnData:{}}),e}return{columnData:{}}},Be.prototype._getNestedColumnDef=function(t,e,n){let i=this._getColumnDef(t);if(e){let t=i;i=t[e],i||(i=t[e]={}),n&&(t=i,i=t[n],i||(i=t[n]={}))}return i},Be.prototype.getColumnId=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).id||""},Be.prototype._getColumnId=Be.prototype.getColumnId,Be.prototype.getColumnIds=function(){let t=this.getColumnCount(),e=new Array(t);for(let n=0;n<t;++n)e[n]=this._getColumnDef(n).id||"";return e},Be.prototype.setColumnField=function(t,e){this._getColumnDef(t).field=e||""},Be.prototype.getColumnField=function(t){return t>=0&&t<this.getColumnCount()&&this._getColumnDef(t).field||""},Be.prototype.getColumnFields=function(){let t=this.getColumnCount(),e=new Array(t);for(let n=0;n<t;++n)e[n]=this._getColumnDef(n).field||"";return e},Be.prototype.getColumnIndex=function(t){if("number"==typeof t)return t;if(t){let e=t,n=-1,i=this.getColumnCount();for(let t=0;t<i;++t){let i=this._getColumnDef(t);if(e===i.id)return t;e===i.field&&n<0&&(n=t)}return n}return-1},Be.prototype.getColumnIndices=function(t){let e=[],n=this.getColumnCount(),i=Array.isArray(t)?t:[t],o=i.length;for(let t=0;t<o;++t){let o=this.getColumnIndex(i[t]);o>=0&&o<n&&e.push(o)}return e},Be.prototype.getColumnIndexMap=function(){let t=this.getColumnCount(),e={},n="";for(let i=0;i<t;++i){let t=this._getColumnDef(i);n=t.field,n&&(e[n]=i),n=t.id,n&&(e[n]=i)}return e},Be.prototype._onWindowResize=function(){this._updateLayout(),this._rowVirtualizer.setViewOffset(this._vscrollbar.getScrollTop())},Be.prototype._onMouseMove=function(){this._vscrollbar.flash(),this._hscrollbar.flash()},Be.prototype._onGridClicked=function(){window.getSelection().toString()||this._element.contains(He(this._element))||this.focus()},Be.prototype._onKeyDown=function(t){if(!function(t){return 9===t.keyCode&&!t.ctrlKey&&!t.altKey&&!t.metaKey}(t))return;let e=He(this._element),n=!1;this._firstHiddenInput===e?n=-1:this._lastHiddenInput===e&&(n=1),this._dispatch("tabNavigation",{activeElement:e,firstHiddenInput:this._firstHiddenInput,lastHiddenInput:this._lastHiddenInput,onTheEdge:n,shiftKey:t.shiftKey,event:t}),n&&!t.defaultPrevented&&(n>0&&t.shiftKey?this._firstHiddenInput.focus():n<0&&!t.shiftKey&&this._lastHiddenInput.focus())},Be.prototype._onRowHightlighted=function(t){if(!this._hasListener("rowHighlighted"))return;let e=t.sender,n=this.getSectionSettings(e.getId());if(null==n)return;n.extendEventArg(t);let i=n.getDataSource();null!==i&&(t.rowId=i.getRowId(t.rowIndex),t.dataRow=i.getRowData(t.rowId)),this._dispatch("rowHighlighted",t)},Be.prototype._onRowCountChanged=function(t){if(this._disposed)return;let e=t.sender,n=t.prevCount,i=t.rowCount,o=e.getIndex(),r=this._updateSectionIndices(o),s=0;if(n>i)this._layoutY.removeLaneAt(r,n-i),this._layoutY.isHomogeneous()||this._syncSectionRowHeights(e);else{let t=this._layoutY.getDefaultLaneSize(),o=e.getDefaultRowHeight();if(this._layoutY.insertLane(r+n,i-n),o!==t)for(s=n;s<i;++s)this._layoutY.setLaneSize(r+s,o)}let l=t.noBinding,a=o<=this._startVScrollbarIndex||o>=this._getFooterStartIndex(),u=this._frozenFooterCount>0,h=this._updateScrollbarHeight(a,u,l);l&&(this._hasPendingRowChange=!0),this._frozenLayout||h||(this._rowVirtualizer.isVirtualizable()?e.activateRows(this._rowVirtualizer.getFirstIndexInView(),this._rowVirtualizer.getLastIndexInView()):e.activateRows()),this._hasPendingRowChange=!1,u||this._updateVScrollbar(),this._updateColumnSeparators(),n<i?("content"!==this.getSectionSettings(e).getType()&&this.applyColumnsBackgroundColor(e),this._dispatch("rowAdded",t)):n>i&&this._dispatch("rowRemoved",t)},Be.prototype._onRowHeightChanged=function(t){if(!this._rowHeightSync)return;if(this._disposed)return;if(this._rowHeightConflator.conflate(t))return;let e=this._rowHeightConflator.popAllData(),n=e.length,i=NaN;for(let t=0;t<n;++t){let n=e[t],o=n.section;if(!this._containsSection(o))continue;let r=o.getIndex(),s=n.rowIndex,l=this.getRowIndex(r,s),a=n.changeLength;for(let t=0;t<a;++t)this._layoutY.setLaneSize(l+t,o.getRowHeight(s+t))&&(r>=i||(i=r))}this._rowHeightConflator._needScrollbarUpdate?(this._rowHeightConflator._needScrollbarUpdate=!1,this._updateScrollbarHeight(!0,!0)):i>=0&&(this._dispatchingDataChanged?this._rowHeightTimerId||(this._rowHeightTimerId=setTimeout(this._requestScrollbarUpdate,0)):this._updateScrollbarHeight(i<this._startVScrollbarIndex,i>=this._startVScrollbarIndex)),this._updateColumnSeparators(),this._dispatchRowPositionChanged()},Be.prototype._containsSection=function(t){for(let e=this._settings.length;--e>=0;)if(this._settings[e].getSection()===t)return!0;return!1},Be.prototype._onRowAvailable=function(t){if(this._hasPendingRowChange)return;let e=t.sectionIndex;this._dispatchColumnRenderEvent(t,0,this.getColumnCount(),e,e+1,t.prevRowIndex,t.rowIndex)},Be.prototype._onSectionCountChanged=function(t){if(!this._frozenLayout){if(this._tempFrozenSectionRef){let t=this.getNextSection(this._tempFrozenSectionRef);null!==t&&(this._startVScrollbarIndex=t.getIndex(),this._tempFrozenSectionRef="")}this._startVScrollbarIndex>=0&&this._startVScrollbarIndex<this._getFooterStartIndex()?(this._vscrollbar.enable(),this._vscrollbar.setScrollContent(this,this._getAllSections(),this._startVScrollbarIndex),this._element.appendChild(this._lastHiddenInput),t||this._updateScrollbarHeight(!0,!0),this._syncLayoutToColumns()):this._vscrollbar.disable()}},Be.prototype._onColumnCountChanged=function(){if(this._frozenLayout||this._disposed)return;let 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()},Be.prototype._onSyncVScroll=function(t){this._vscrollbar.setScrollTop(t.scrollTop)},Be.prototype._onSyncHScroll=function(t){this._hscrollbar.setScrollLeft(t.scrollLeft)},Be.prototype._getFooterStartIndex=function(){return this.getSectionCount()-this._frozenFooterCount},Be.prototype._getVScrollStart=function(){return this._getSectionSize(0,this._startVScrollbarIndex)},Be.prototype._getFooterSize=function(){return this._frozenFooterCount>0?this._getSectionSize(this._getFooterStartIndex()):0},Be.prototype._getSectionSize=function(t,e){if(t){if(t<0)return 0}else t=0;null==e&&(e=this.getSectionCount()-t);let n=this._layoutY.getLaneStart(this._sectionStarts[t]),i=t+e;return(e>0?this._layoutY.getLaneStart(this._sectionStarts[i]):0)-n},Be.prototype._updateScrollbarHeight=function(t,e,n){if(!this._vscrollbar.isEnabled())return!1;let i=e,o=t&&this._startVScrollbarIndex>=0,r=this._rowHeightConflator.isConflating();if(r&&(this._rowHeightConflator._needScrollbarUpdate=!0,i=!1),o&&!r){let t=this.getElement();if(!t)return!1;let e=this.getParent(),n=this._vscrollbar.getParent();n?n!==e&&n.firstElementChild&&(n=n.firstElementChild):(n=t,this._vscrollbar.setParent(n));let i=this._getVScrollStart(),o=this._getFooterSize();n!==t&&(i+=t.clientTop),this._vscrollbar.resetPaneSize();let r=n.clientHeight-(i+o)*this._zoomFactor;this._vscrollbar.setTop(i*this._zoomFactor),this._vscrollbar.setTrackSize(r,r/this._zoomFactor);let s=this._layoutY.getDefaultLaneSize(),l=12*s;r>l&&(l=(Math.ceil(r/s)+4)*s),this._rowVirtualizer.setViewSize(l/this._zoomFactor);let a=this._sectionStarts[this._startVScrollbarIndex],u=this.getFooterCount(),h=0;if(u){let t=this.getSectionCount();h=this._sectionStarts[t]-this._sectionStarts[t-u]}this._rowVirtualizer.setViewBounds(a,h)}else this._rowVirtualizer.validateVirtualization();let s=!1;return n||(s=this._rowVirtualizer.update()),this._vscrollbar.invalidate(i),s},Be.prototype._updateScrollbarWidth=function(t,e){if(!this._frozenLayout){if(t&&this._hScrollbarEnabled){let t=this.getElement(),e=this._hscrollbar.getParent();e||(e=this.getParent()||t,this._hscrollbar.setParent(e));let n=this._layoutX.getLaneStart(this._pinnedLeftColumnCount),i=this._layoutX.getLaneCount(),o=0,r=this._countPinnedRightColumns();r&&(o=this._layoutX.getLaneStart(i)-this._layoutX.getLaneStart(i-r));let s=e!==t?t.clientLeft:0,l=e.clientWidth-(n+s+o)*this._zoomFactor;r>0&&(l-=this._reservedSpace),this._hscrollbar.setPaneLeft(n),this._hscrollbar.setLeft((n+s)*this._zoomFactor),this._hscrollbar.setTrackSize(l,l/this._zoomFactor);let a=4*this._layoutX.getDefaultLaneSize();l>a&&(a=l),this._colVirtualizer.setViewSize(a/this._zoomFactor),this._colVirtualizer.setViewBounds(this._pinnedLeftColumnCount,r)}else this._colVirtualizer.validateVirtualization();this._colVirtualizer.update(),this._hscrollbar.invalidate(e)}},Be.prototype._hitTestY=function(t,e){let n;if(e.sectionSettings)n=e.sectionSettings;else{let i;i="number"==e.rowIndex?e.rowIndex:this._layoutY.hitTest(t);let o=i>=0?i:~i,r=ut.upperBound(this._sectionStarts,o)-1;if(e.sectionIndex=r,n=this._settings[r],!n)return!1;n.extendEventArg(e)}let i=n.getSection();return null!=e.colIndex&&e.cellElement?e.rowIndex=i.getCellIndex(e.colIndex,e.cellElement):e.rowIndex=rowIndex+i.getRowOffset(),!0},Be.prototype._syncLayoutToColumns=function(t,e,n){if(this._frozenLayout)return;let i=this._layoutX.getLaneCount(),o=this.fillParentWidth(100);(o||null==t||null==e)&&(t=0,e=i,o=!0);let r=this._settings.length;if(r<=0)return;let s=!1;if(t<e)for(let n=0;n<r;++n)s=this._syncLayoutToSectionColumns(this._settings[n].getSection(),t,e)||s;let l=o||t<this.getHScrollStartIndex()||e>this.getFirstPinnedRightIndex();this._updateScrollbarWidth(l,!0),this.updateColumnBounds(),this._updateColumnSeparators(),this._dispatchColumnPositionChanged(),(s||n)&&this._dispatch("widthChanged",{from:t,to:e,colChanged:t})},Be.prototype._syncLayoutToSectionColumns=function(t,e,n){null==e&&(e=0),null==n&&(n=this._layoutX.getLaneCount());let i=0;for(let o=e;o<n;++o)i|=t._setColumnWidth(o,this._layoutX.getLaneSize(o));return!(!i||this._frozenLayout||(t._updateColumnLayout(),0))},Be.prototype._toDataColumnName=function(t){return ut.isNumber(t)?this.getDataColumnName(t):t},Be.prototype._updateSectionIndices=function(t){this._updatePaddingBottomSect()&&--t,t<0&&(t=0);let e=this._settings.length,n=this._settings[0]||null;n!==this._firstSettings&&(this._firstSettings&&this._firstSettings.getSection().removeClass("first"),this._firstSettings=n,this._firstSettings&&this._firstSettings.getSection().addClass("first"));let i=this._settings[e-1]||null;i!==this._lastSettings&&(this._lastSettings&&this._lastSettings.getSection().removeClass("last"),this._lastSettings=i,this._lastSettings&&this._lastSettings.getSection().addClass("last")),this._sectionStarts.length=e+1,this._sectionStarts[0]=0;for(let n=t;n<e;++n){let t=this._settings[n].getSection();t.setIndex(n),t.setRowOffset(this._sectionStarts[n]),this._sectionStarts[n+1]=this._sectionStarts[n]+t.getRowCount()}return this._sectionStarts[t]},Be.prototype._updateLayout=function(){let t=this.getElement();if(this._disposed||!t.offsetParent)return;this._syncLayoutToColumns(),this._updateScrollbarHeight(!0,!0),this._updateScrollbarWidth(!0,!0);let e=this.getSectionCount();for(let t=0;t<e;++t)this._settings[t].getSection().updateLayout();this._updateColumnSeparators()},Be.prototype._updateVScrollbar=function(){!this._disposed&&this._vscrollbar.isEnabled()&&(this._vScrollbarConflator.conflate()||this._vscrollbar.update())},Be._proto=Be.prototype;let Ge={chainIcon:""};Ge.styles=function(t){if(t){let e="";if(e=Array.isArray(t)?t.map(L).join("\n").replace(/{\s*{/g,"{").replace(/\s+{/g," {"):"string"==typeof t?t:t+"",e)return e.replace(/{[\w\W]*?}/g,E)}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);"]]),Ge.applyStyle=function(t){t&&!t._rowGroupingStyles&&(t._rowGroupingStyles=!0,function(t,e){if(!t)return null;let n=document.createElement("style");n.textContent="\n"+t+"\n";let i,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;o||(r=!1,o=document.head),r&&o.children&&o.children.length&&(i=o.children[0]),i?o.insertBefore(n,i):o.appendChild(n)}(Ge.styles,t.getElement()))};const We=Ge;let Ue=function(){this._counter={},this._session={},this._referers={}};Ue.prototype._counter=null,Ue.prototype._session=null,Ue.prototype._referers=null,Ue.prototype.reset=function(){this._counter={},this._referers={},this.newSession()},Ue.prototype.newSession=function(){this._session={}},Ue.prototype.getAllReferences=function(){return Object.keys(this._counter)},Ue.prototype.hasReference=function(){for(const t in this._counter)return!0;return!1},Ue.prototype.getAllReferers=function(){return Object.keys(this._referers)},Ue.prototype.getAllReferrers=Ue.prototype.getAllReferers,Ue.prototype.getSession=function(){let t=[],e=[];for(let n in this._session){let i=this._session[n];i>0?t.push(n):i<0&&e.push(n)}return{newEntries:t.filter(Boolean),removedEntries:e.filter(Boolean)}},Ue.prototype.addReference=function(t,e){if(t){if(e){let n=this._referers[e];if(n){if(n[t])return!1}else n=this._referers[e]={};n[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},Ue.prototype.addRef=Ue.prototype.addReference,Ue.prototype.removeReference=function(t,e,n){if(!t)return!1;let i=this._counter[t];if(!i)return!1;if(null==n)n=1;else if(n<0)n=i;else if(!n)return!1;if(e){let n=this._referers[e];if(!n)return!1;if(!n[t])return!1;delete n[t]}return i-=n,!i||i<0?(delete this._counter[t],1===this._session[t]?this._session[t]=0:this._session[t]=-1,!0):(this._counter[t]=i,!1)},Ue.prototype.release=Ue.prototype.removeReference,Ue.prototype.addReferences=function(t,e){if(!t)return 0;let n=0;if(Array.isArray(t)){let i=t.length;for(let o=0;o<i;++o)this.addReference(t[o],e)&&++n}else if("string"==typeof t)this.addReference(t,e)&&++n;else for(let i in t)this.addReference(i,e)&&++n;return n},Ue.prototype.removeReferer=function(t){let e=0;if(t){let n=this._referers[t];if(n){for(let i in n)this.removeReference(i,t)&&++e;delete this._referers[t]}}return e},Ue.prototype.removeReferrer=Ue.prototype.removeReferer,Ue.prototype.log=function(){console.log(this._counter)};const Ye=Ue;let Xe=function(){let t=this;t._commitRicsChanges=t._commitRicsChanges.bind(t),t._commitFieldsChanges=t._commitFieldsChanges.bind(t),t._fieldChangedConflator=new e(0,t._commitFieldsChanges),t._ricChangedConflator=new e(0,t._commitRicsChanges),t._fields=new Ye,t._rics=new Ye,t._rowDefMap={}};n.inherits(Xe,r),Xe.prototype._fieldChangedConflator=null,Xe.prototype._ricChangedConflator=null,Xe.prototype._rowDefMap=null,Xe.prototype._rics=null,Xe.prototype._fields=null,Xe.prototype.dispose=function(){this.removeAllEventListeners(),this._rowDefMap=this._fields=this._rics=null,this._fieldChangedConflator.reset(),this._ricChangedConflator.reset()},Xe.prototype.getAllRics=function(){return this._rics.getAllReferences()},Xe.prototype.hasRic=function(){return this._rics.hasReference()},Xe.prototype.getAllRowDefs=function(){let t=[];for(let e in this._rowDefMap)t=t.concat(this._rowDefMap[e]);return t},Xe.prototype.getAllFields=function(){return this._fields.getAllReferences()},Xe.prototype.getRowDefByRic=function(t){return this._rowDefMap[t]||null},Xe.prototype.addRic=function(t){let e=t?t.getSymbol():"";if(!e)return!1;let n=this._rowDefMap,i=n[e];i?i.indexOf(t)<0&&i.push(t):i=n[e]=[t];let o=this._rics.addReference(e,t.getRowId());return this._commitRicsChanges(),o},Xe.prototype.removeRic=function(t,e){if(e||(e=t?t.getSymbol():""),!e)return;let n=this._rowDefMap[e];if(n){let e=n.indexOf(t);e>=0&&n.splice(e,1)}this._rics.removeReference(e,t.getRowId()),this._commitRicsChanges()},Xe.prototype.removeAllRics=function(){let t=this._rics.getAllReferers();for(let e in t)this._rics.removeReferer(t[e]);this._rowDefMap={},this._commitRicsChanges()},Xe.prototype._commitRicsChanges=function(){if(this._ricChangedConflator.conflate())return;let t=this._rics,e=t.getSession(),n=e.removedEntries,i=e.newEntries;n.length&&this._doDispatch({type:"ricRemoved",removedRics:n}),i.length&&this._doDispatch({type:"ricAdded",addedRics:i}),t.newSession()},Xe.prototype.addFields=function(t,e){if(!t)return;let n=this._fields;t instanceof Nt?n.addReferences(t.getAllFields(),t.getId()):n.addReferences(t,e),this._commitFieldsChanges()},Xe.prototype.removeFields=function(t,e){t&&(t instanceof Nt?this._fields.removeReferer(t.getId()):this._fields.removeReference(t,e),this._commitFieldsChanges())},Xe.prototype.removeFieldReferrer=function(t){this._fields.removeReferer(t),this._commitFieldsChanges()},Xe.prototype.removeAllFields=function(){let t=this._fields.getAllReferers();for(let e in t)this._fields.removeReferer(t[e]);this._commitFieldsChanges()},Xe.prototype._commitFieldsChanges=function(){if(this._fieldChangedConflator.conflate())return;let t=this._fields,e=t.getSession(),n=e.removedEntries,i=e.newEntries;n.length&&this._doDispatch({type:"fieldRemoved",removedFields:n}),i.length&&this._doDispatch({type:"fieldAdded",addedFields:i}),t.newSession()},Xe.prototype._doDispatch=function(t){let e=this;t.fields=e.getAllFields(),t.rics=e.getAllRics(),t.rowDefs=e.getAllRowDefs(),e._dispatch(t.type,t)},Xe.prototype.reset=function(){let t=this;t._rowDefMap={},t._fields.reset(),t._rics.reset(),t._fieldChangedConflator.reset(),t._ricChangedConflator.reset()};const qe=Xe;let je=function(t,e,n){return null==t||t!=t?null==e||e!=e?0:1:null==e||e!=e?-1:t<e?-n:e<t?n:0},Ke=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=[]};Ke.prototype._globalContext,Ke.prototype._sortParams,Ke.prototype._ctxCaches,Ke.prototype._primaryParams,Ke.prototype.dispose=function(){this._globalContext={},this._sortParams.length=0,this._ctxCaches.length=0,this._primaryParams=null},Ke.prototype.getSorter=function(){this._primaryParams=null;let t=this._sortParams.length;if(1===t){let t=this._primaryParams=this._sortParams[0];return t[1]?t[3]?this._rowDefSorter:this._dataSorter:this._defaultSorter}return t>1?this._multiColumnsSorter:Ke._noSorting},Ke.prototype.reset=function(){this._sortParams.length&&(this._sortParams.length=0)},Ke.prototype.setContext=function(t,e){this._globalContext[t]=e},Ke.prototype.addColumnContext=function(t,e,n,i,o,r){t||(t="");let s=this._sortParams.length,l=this._ctxCaches[s];l||(l=this._ctxCaches[s]=I(this._globalContext));let a=0;"a"===i?a=1:"d"===i&&(a=-1);let u=[t,"function"==typeof e?e:null,l,n,a];l.colIndex=o,l.field=t,l.formattedField=t+"_FORMATTED",l.colDef=r,this._sortParams.push(u)},Ke._noSorting=function(t,e,n){return 0},Ke.prototype._defaultSorter=function(t,e,n){let i=this._primaryParams[0];return je(t.getData(i),e.getData(i),n)},Ke.prototype._dataSorter=function(t,e,n){let i=this._primaryParams,o=i[0];return(0,i[1])(t.getData(o),e.getData(o),n,i[2])},Ke.prototype._rowDefSorter=function(t,e,n){let i=this._primaryParams;return(0,i[1])(t,e,n,i[2])},Ke.prototype._multiColumnsSorter=function(t,e,n){let i=this._sortParams,o=i.length;for(let n=0;n<o;++n){let o=i[n],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):je(t.getData(r),e.getData(r),u),h)return h}return 0};const Je=Ke,Qe="ROW_DEF";let Ze=function(t){let 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._rowDefSorter=e._rowDefSorter.bind(e),e._hosts=[],e._sortLogic={},e._addEvents("preClicked","clicked","preDataSorting","columnSorted"),e._sortStates=[],e._sortingSequence=["a","d"],t&&e.config({sorting:t})};o.inherits(Ze,ct),Ze.prototype._hosts=null,Ze.prototype._sortStates,Ze.prototype._maxCount=1,Ze.prototype._dataSorting=!0,Ze.prototype._dblClickAllowed=!1,Ze.prototype._clickTimer=0,Ze.prototype._delayInterval=0,Ze.prototype._lastMouseDown=0,Ze.prototype._initialSort=null,Ze.prototype._mode="",Ze.prototype._sortableColumns=!0,Ze.prototype._sortableIndicator=!1,Ze.prototype._solarTheme=!1,Ze.prototype._sortLogic,Ze.prototype._userManagedLogic=!1,Ze.prototype._disabled=!1,Ze.prototype._frozenIndicator=!1,Ze.prototype._rowDefMode=!1,Ze.prototype._userComparer=null,Ze._icons={},Ze.prototype._sortingSequence,Ze.prototype._sortingSequenceMap=null,Ze.prototype.getName=function(){return"SortableTitlePlugin"},Ze.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))},Ze.prototype.unload=function(t){let 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))},Ze.prototype.afterInit=function(){let t=this;t.setSortLogics(t._sortLogic);let e=t._initialSort;null!=e&&(Array.isArray(e)?1===t._maxCount?t.sortColumns(e.slice(0,1)):t.sortColumns(e):t.sortColumns([e]))},Ze.prototype.config=function(t){if(!t)return;let e=this,n=t.icons;null!=n&&n.sorting&&(Ze._icons=n.sorting);let i=t.themeName;!i||i.indexOf("solar")>=0?e._solarTheme=!0:e._solarTheme=!1,e._initialSort=e._initialSortByColumnField(t);let o=t.sorting;if(!o)return;o.ROW_DEF&&(this._rowDefMode=!0),o.userManagedLogic&&(e._userManagedLogic=!0);let 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)),r=o.sortableIndicator,null!=r&&(e._sortableIndicator=r),r=o.disabled,null!=r&&(e._disabled=!!r),r=o.threeStatesSorting,null!=r&&e.disableTwoStateSorting(r),r=o.sortingSequence,null!=r&&Array.isArray(r)&&(e._sortingSequence=r),r=o.mode,null!=r&&(e._mode=r,"manual"===r&&e.disableDataSorting()),r=o.indicatorOnly,null!=r&&e.disableDataSorting(r),r=o.disableDoubleClickToSort,null!=r&&e.disableDoubleClickToSort(r),r=o.columnSorted,"function"==typeof r&&e.listen("columnSorted",r),r=o.preClicked,"function"==typeof r&&e.listen("preClicked",r),r=o.clicked,"function"==typeof r&&e.listen("clicked",r),r=o.preDataSorting,"function"==typeof r&&e.listen("preDataSorting",r),r=o.sortableColumns,null!=r&&(e._sortableColumns=r),r=o.initialSort,"object"==typeof r&&(e._initialSort=r),r=o.sortLogic,"object"==typeof r)for(let t in r)"function"==typeof r[t]&&(e._sortLogic[t]=r[t])},Ze.prototype.getConfigObject=function(t){let e=t||{},n=e.columns;n||(n=e.columns=[]);let i=this._hosts[0];if(!i)return e;let o,r,s,l,a,u=this.getSortedColumns();if(1===this._maxCount&&null!=u)for(s=u.length,r=0;r<s;r++){let t=u[r],e=t.colIndex;o=n[e],o||(o=n[e]={}),o.sortOrder=t.sortOrder}for(s=i.getColumnCount(),r=0;r<s;++r)o=n[r],o||(o=n[r]={}),l=this._getSortOptions(r),l&&(this._sortableColumns?l.disabled&&(o.sortable=!1):l.disabled||(o.sortable=!0),a=l.field,a&&(null!=o.field&&o.field!==a&&(o.sortBy=a),this._sortingSequenceMap&&this._sortingSequenceMap[a]&&(o.sortingSequence=this._sortingSequenceMap[a])));let h=e.sorting;h||(h=e.sorting={});let p=u;null!=p&&(h.initialSort=p),p=this._sortableIndicator,!1!==p&&(h.sortableIndicator=p),1!==this._maxCount&&(h.multiColumn=-1===this._maxCount||this._maxCount),this._dblClickAllowed&&(h.disableDoubleClickToSort=!this._dblClickAllowed),p=this._sortableColumns,!0!==p&&(h.sortableColumns=p),p=this._dataSorting,!0!==p&&(h.indicatorOnly=p),this._disabled&&(h.disabled=!0);let d=this._sortingSequence,c=!0;return 2===d.length&&"a"===d[0]&&"d"===d[1]&&(c=!1),c&&(h.sortingSequence=d.slice()),D(e.sorting)&&delete e.sorting,e},Ze.prototype.getColumnMenu=function(t,e){e||(e={});let n=e.menus;n||(n=e.menus=[]);let i=n[0];i||(i=n[0]={menuItems:[]});let 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 i.menuItems.push(r),e},Ze.prototype._onItemSortingClicked=function(t){this._hosts[0].getPlugin("ColumnMenuPlugin").hide();let e=t.currentTarget.value,n=e.colIndex,i=e.sortOrder;this.sortColumn(n,i)},Ze.prototype.getIcons=function(){return Ze._icons},Ze.prototype.setSortLogics=function(t){if(null!=t){let e=this._hosts[0];if(e){let n=e.getDataSource();for(let e in t)this._setSortLogic(n,e,t[e])}}},Ze.prototype.setSortLogic=function(t,e){if("string"==typeof t){let n=this._hosts[0];if(n){let i=n.getDataSource();this._setSortLogic(i,t,e)}}},Ze.prototype._setSortLogic=function(t,e,n){t&&"string"==typeof e&&("*"===e?t.setSortingLogic(n):t.setColumnSortingLogic(e,n))},Ze.prototype.getSortOrder=function(t){let e=null!=t?this.getSortPriority(t):0,n=this._sortStates[e];return(n?n.sortOrder:"")||"n"},Ze.prototype.getSortedColumnIndex=function(t){return this._getColumnIndex(this._sortStates[t||0])},Ze.prototype.getSortPriority=function(t,e){let n=this._hosts[0];if(n){let i,o=this._sortStates.length;if(t>=0){let e=n.getColumnId(t);if(e)for(i=0;i<o;++i)if(this._sortStates[i].colId===e)return i}else if(e)for(i=0;i<o;++i){let t=this._sortStates[i];if(t.colId===e)return i;if(t.field===e)return i}}return-1},Ze.prototype.isColumnSorted=function(t){return this.getSortPriority(t)>=0},Ze.prototype.getSortedColumns=function(){let t=this._sortStates.length;if(t<=0)return null;let e=new Array(t);for(let n=0;n<t;++n){let t=this.getSortedColumnIndex(n),i=this._sortStates[n],o={},r="";t>=0&&(o.colIndex=t,r=this._getColumnId(t)),r&&(o.colId=r);let s=i.field||"";s&&(o.field=s),o.sortOrder=i.sortOrder||"n",e[n]=o}return e},Ze.prototype.isSorting=function(){return!!this._sortStates.length},Ze.prototype.sortColumn=function(t,e,n){let i=this._prepareSorting(t,e);if(this._sortColumn(i,n),n&&n.isUserAction){let t={};t.colIndex=i.colIndex,t.sortOrder=this.getSortOrder(i.colIndex),t.dataColumnName=this.getColumnSortingField(i.colIndex),this._dispatch("clicked",t)}},Ze.prototype.sortColumns=function(t,e){if(Array.isArray(t)){let n=t.length,i=new Array(n);for(let e=0;e<n;e++)i[e]=this._prepareSorting(t[e]);this._sortColumn(i,e)}},Ze.prototype.clearSortState=function(t){this._popSortState(0,t)&&this.updateSortSymbols()},Ze.prototype.refresh=function(){this._sortStates.length&&(this._sortDataView(),this.updateSortSymbols())},Ze.prototype.restoreUserActions=Ze.prototype.refresh,Ze.prototype.setSortableColumnCount=function(t){this._maxCount=t||1,this._popSortState(this._maxCount)},Ze.prototype.getSortingStates=function(){return this._sortStates},Ze.prototype.updateSortSymbols=function(){if(!this._disabled)for(let t=this._hosts.length;--t>=0;)this._updateSortableIndicator(t)},Ze.prototype.getDataColumnMap=function(){let t=this._hosts[0],e=[];if(t){let n=t.getColumnCount();for(let t=0;t<n;++t)e[t]=this.getColumnSortingField(t)}return e},Ze.prototype.getDataColumnNames=Ze.prototype.getDataColumnMap,Ze.prototype.setDataColumnMap=function(t){if(Array.isArray(t))for(let e=t.length;--e>=0;)this.setColumnSortingField(e,t[e])},Ze.prototype.setDataColumnNames=Ze.prototype.setDataColumnMap,Ze.prototype.getColumnSortingField=function(t){let e=this._getSortOptions(t),n=e?e.field:null;if(null==n&&!this._rowDefMode){let i=this._hosts[0];i&&(n=i.getColumnField(t),n||(n=i.getDataColumnName(t)),n&&e&&(e.field=n))}return n||""},Ze.prototype.setColumnSortingField=function(t,e,n,i){if("number"==typeof t&&null!=e){let o=this._newSortOptions(t);e||(e=""),o.field!==e&&(o.field=e),null==n||this._userManagedLogic||o.sortLogic!==n&&(o.sortLogic=n||null,i&&n&&(n.rowSorting=!0))}};let $e=function(t){return t.field||""};Ze.prototype.getColumnSortingFields=function(){return this._sortStates.map($e)},Ze.prototype.setFirstSortOrder=function(t,e){"a"!==(e=e?Ze._toSortOrder(e):"a")&&"d"!==e&&(e="a");let n=null;n=Array.isArray(t)?t:[t];let i=n.length;for(let t=0;t<i;++t){let i=n[t],o=this.getSortingSequence(i).slice(),r=o.indexOf(e);r>=0&&o.splice(r,1),o.unshift(e),this.setSortingSequence(o,i)}},Ze.prototype.disableTwoStateSorting=function(t){let e=this._sortingSequence.indexOf("n");!1===t?e>=0&&this._sortingSequence.splice(e,1):e<0&&this._sortingSequence.push("n")},Ze.prototype.freezeIndicator=function(t){let e=this._frozenIndicator;if(this._frozenIndicator=!1!==t,e&&!this._frozenIndicator)for(let t=this._hosts.length;--t>=0;)this._updateSortableIndicator(t)},Ze.prototype.disableSortSymbols=function(t){},Ze.prototype.disableDataSorting=function(t){this._dataSorting=!1===t},Ze.prototype.disableDoubleClickToSort=function(t){this._dblClickAllowed=!t},Ze.prototype.disableCellClick=function(t,e){t&&t.enableClass("no-sort",!1!==e)},Ze.prototype.disableColumnSorting=function(t,e){if(e=!1!==e,"number"==typeof t)this._disableColumnSorting(t,e);else if(Array.isArray(t)){let n=t.length;for(let i=0;i<n;++i)this._disableColumnSorting(t[i]||0,e)}},Ze.prototype._disableColumnSorting=function(t,e){let n=this._newSortOptions(t);n.disabled!==e&&(n.disabled=e)},Ze.prototype.setClickDelayInterval=function(t){this._delayInterval=null!=t?t:500},Ze.prototype._initialSortByColumnField=function(t){let e=t.columns,n=e?e.length:0;for(let t=0;t<n;t++){let n=e[t].defaultSort;if(n)return{colIndex:t,sortOrder:n}}return null},Ze.prototype._onSectionAdded=function(t){if("title"!==t.sectionType)return;let e=t.section;0===e.getIndex()&&(e.listen("mousedown",this._onMouseDown),e.listen("click",this._onClickTitle.bind(this,t.sender),0))},Ze.prototype._onUIUpdated=function(t){"title"===t.sectionType&&this.updateSortSymbols()},Ze.prototype._canClickToSort=function(t){if(this._disabled)return!1;let e=t.grid;if(!e||!e.getElement())return!1;let n=this._getPlugin("CellEditingPlugin");if(n&&n.isEditing())return!1;if(this._dispatch("preClicked",t),t.cancel)return!1;let i=t.colIndex,o=t.section,r=t.rowIndex;return!!this._isCellSortable(o,i,r)},Ze.prototype._proceedSorting=function(t){if(this._clickTimer=0,this._canClickToSort(t)){let e=t.colIndex;this.sortColumn(e,null,{isUserAction:!0});let n=t.grid;n&&n.focus&&n.focus()}},Ze.prototype._onMouseDown=function(t){t.button||(this._lastMouseDown=t.timeStamp)},Ze.prototype._getPlugin=function(t){let e=this._hosts[0];return e?e.getPlugin(t):null},Ze.prototype.clickTitleByMouse=function(t,e){this._onClickTitle(t,e)},Ze.prototype._onClickTitle=function(t,e){if(this._disabled)return;if(2===e.detail&&!this._dblClickAllowed)return void(this._clickTimer&&(clearTimeout(this._clickTimer),this._clickTimer=0));if(e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)return;if(!(e.timeStamp-this._lastMouseDown<500))return;let n=t.getRelativePosition(e);if(!n.hit)return;let i=this._getPlugin("ColumnSelectionPlugin");if(i&&i.isEnabled()){let t=n.colIndex;if(!i.isSelectedColumn(t))return}n.target=e.target,this._delayInterval>0?this._clickTimer||(this._clickTimer=setTimeout(this._proceedSorting.bind(this,n),this._delayInterval)):this._proceedSorting(n)},Ze.prototype._popSortState=function(t,e){if(t<0||this._sortStates.length<=t)return!1;let n=!1;for(let e=this._sortStates.length;--e>=t;)this._clearSortSymbols(this._sortStates[e]),n=!0;return this._sortStates.length=t,this._sortDataView(e),n},Ze._toSortOrder=function(t){return!t||"string"!=typeof t||"d"!==(t=t.charAt(0).toLowerCase())&&"a"!==t?"n":t},Ze.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},Ze.prototype.setSortingSequence=function(t,e){if(Array.isArray(t))t.length||(t=null);else if(t)return;let n;if(null!=e&&("string"==typeof e?n=e:"number"==typeof e&&(n=this.getColumnSortingField(e))),t){let e=t.map(Ze._toSortOrder);n?(this._sortingSequenceMap||(this._sortingSequenceMap={}),this._sortingSequenceMap[n]=e):this._sortingSequence=e}else n?this._sortingSequenceMap&&delete this._sortingSequenceMap[n]:this._sortingSequence=this._sortingSequence.length>2?["a","d","n"]:["a","d"]},Ze.prototype.clearAllColumnSortingSequences=function(){this._sortingSequenceMap=null},Ze.prototype._rowDefSorter=function(t,e,n,i){return this._userComparer(t[Qe].getRowData(),e[Qe].getRowData(),n,i)},Ze.prototype.sortSeparators=function(t){let e=this._hosts[0].getDataSource();if(t)this._rowDefMode?(this._userComparer=t,e.sortSeparators(this._rowDefSorter),this._userComparer=null):e.sortSeparators(t);else{let t=e.getSortingLogics(),n=[],i=[],o=this._sortStates.length;for(let t=0;t<o;t++){let e=this._sortStates[t],o=this._rowDefMode?Qe:e.field;n.push(e.sortOrder),i.push(o)}e.sortSeparators(t,n,i)}},Ze.prototype._prepareSorting=function(t,e){if(!this._maxCount)return null;let n=this._hosts[0];if(!n)return null;let i=-1,o="";"number"==typeof t?i=t:"string"==typeof t?(o=t,i=this._getColumnIndex(o)):t&&"object"==typeof t&&(o=t.colId||t.field,o?i=this._getColumnIndex(o):"number"==typeof t.colIndex&&(i=t.colIndex),e||(e=t.sortOrder||t.order||null));let r="",s=null;if(i>=0){r=this.getColumnSortingField(i);let t=this._getSortOptions(i);t&&(s=t.sortLogic)}else o&&(r=o);let l=this.getSortPriority(i,r),a=l>=0?this._sortStates[l]:null,u=a?a.sortOrder:"n",h="n";if(null==e){let t=this.getSortingSequence(r),e=t.indexOf(u);e=e<0?0:(e+1)%t.length,h=t[e]}else h=Ze._toSortOrder(e);if(a){if(u===h)return this.updateSortSymbols(),null;this._sortStates.splice(l,1),this._clearSortSymbols(a)}if("a"===h||"d"===h){if(i<0&&!r)return null;if(!a){a={};let t=n.getColumnId(i);t&&(a.colId=t)}a.field=r,a.sortLogic=s||null,this._sortStates.push(a)}a&&("n"!==u?a.prevOrder=u:delete a.prevOrder,a.order=h,a.sortOrder=h);let p=[];if(this._maxCount>0)for(;this._sortStates.length>this._maxCount;){let t=this._clearSortSymbols(this._sortStates.shift());null!==t&&p.push(t)}return{colIndex:i,sortedField:r,sortOrder:h||"n",prevOrder:u,clearedSortColIndexes:p}},Ze.prototype._sortColumn=function(t,e){if(!t)return;this._sortDataView(e),this.updateSortSymbols();let n=null;if(Array.isArray(t)){let e=t.length;for(let i=0;i<e;++i){let e=t[i];e&&(n?(n.colIndices||(n.colIndices=[],n.sortedFields=[],n.sortOrders=[],n.prevOrders=[]),n.colIndices.push(e.colIndex),n.sortedFields.push(e.sortedField),n.sortOrders.push(e.sortOrder),n.prevOrders.push(e.prevOrder)):n=e)}n=t[0]}else n=t;this._dispatch("columnSorted",n)},Ze.prototype._onColumnAdded=function(t){let e=this,n=t.colIndex,i=t.context||{},o=!!e._sortableColumns,r=i.field,s=i.sortBy;null!=s&&(o=!!s,r=s),null!=i.sortable&&(o=!!i.sortable);let l=i.sortLogic||i.sortingLogic||i.sorter;l||(l=e._sortLogic[r]),"function"!=typeof l&&(l=null);let a=i.sortingSequence;null!=a&&r&&e.setSortingSequence(a,r),o?e.setColumnSortingField(n,r,l,i.rowSorting):e.disableColumnSorting(n,!0);let u=i.sortOrder||i.sort;null!=u&&(u=Ze._toSortOrder(u),"n"!==u&&(e.clearSortState(),e.sortColumn(n,u)))},Ze.prototype._onColumnRemoved=function(t){let e=this._sortStates.length;if(!e)return;let n=t.colId;if(n)for(let t=0;t<e;++t){let e=this._sortStates[t];if(e.colId===n){this._sortStates.splice(t,1),this._clearSortSymbols(e),this._sortDataView();break}}},Ze._toRowDefField=function(){return Qe},Ze.prototype._sortDataView=function(t){if(t=t||{},this._dispatch("preDataSorting",t),!this._dataSorting)return;let e=this._sortStates.length;this._userManagedLogic&&e>1&&(e=1);let n=null,i=null,o=null;if(e){n=new Array(e),i=new Array(e);for(let t=0;t<e;++t)n[t]=this._sortStates[t].sortOrder,i[t]=this._sortStates[t].sortLogic;o=this._rowDefMode?this._sortStates.map(Ze._toRowDefField):this.getColumnSortingFields(),this._userManagedLogic&&o.length>1&&(o=o.slice(0,1))}for(let e=this._hosts.length;--e>=0;){let r=this._hosts[e].getDataSource();if(r){let e=1==t.isUserAction;r.sort(o,n,i,e)}}},Ze.prototype._clearSortSymbols=function(t){let e=t.targetCells;if(!e)return null;let n=null;for(let t=e.length;--t>=0;){let i,o=e[t];o.removeClass("sorting"),o.removeClass("sortable"),o.removeFloatingIcon("sort-symbol"),o.removeFloatingIcon("priority-symbol"),null==n&&(i=o.getSection())&&(n=i.getColumnIndex(o.getParent()))}return e.length=0,n},Ze.prototype._updateSortableIndicator=function(t){let e=this,n=e._hosts[t];if(!n||this._frozenIndicator)return;let i=n.getSection("title");if(null!=i)for(let n=i.getColumnCount();--n>=0;){let o=i.getRowCount();for(let r=0;r<o;r++){let s=i.getCell(n,r,!0);if(!s)continue;if(s.removeClass("sorting"),s.removeClass("sortable"),s.removeClass("asc"),s.removeClass("desc"),s.removeClass("edge-indicator"),s.removeFloatingIcon("sort-symbol"),s.removeFloatingIcon("priority-symbol"),s.removeFloatingIcon("sortable-indicator"),r!==o-1)continue;if(!e._isCellSortable(i,n,r))continue;s.addClass("sortable");let l,a,u=e.getSortPriority(n),h=e._sortStates[u];if(h&&"n"!==h.sortOrder){if(h.targetCells||(h.targetCells=[]),h.targetCells[t]=s,"a"===h.sortOrder?s.addClass("asc"):s.addClass("desc"),s.addClass("sorting"),e._solarTheme){let t;"a"===h.sortOrder?(t="▲",a=Ze._icons.ascending):(t="▼",a=Ze._icons.descending),l=e._createIconElem(a,t),l.className="sort-symbol",s.insertFloatingIcon(l,0)}else s.addClass("edge-indicator");e._sortStates.length>1&&(l=document.createElement("span"),l.className="priority-symbol",l.textContent=u+1,s.insertFloatingIcon(l,1))}else e._sortableIndicator&&(a=Ze._icons.sortable,l=e._createIconElem(a,"◊"),l.className="sortable-indicator",s.insertFloatingIcon(l,0))}}},Ze.prototype._createIconElem=function(t,e){let n;return t&&"string"==typeof t?(n=document.createElement("ef-icon"),n.setAttribute("icon",t)):(n=document.createElement("span"),n.textContent=e),n},Ze.prototype._getColumnIndex=function(t){if(null!=t){let e=this._hosts[0];if(e)return"number"==typeof t?t:"string"==typeof t?e.getColumnIndex(t):e.getColumnIndex(t.colId)}return-1},Ze.prototype._getColumnId=function(t){let e=this._hosts[0];return e&&null!=t?e.getColumnId(t):""},Ze.prototype._getSortOptions=function(t){let e=this._hosts[0];return e&&e.getColumnData(t).sortableTitle||null},Ze.prototype._newSortOptions=function(t){let e=this._hosts[0],n=null;if(e&&t>=0){let i=e.getColumnData(t);n=i.sortableTitle,n||(n=i.sortableTitle={})}return n||{}},Ze.prototype._isCellSortable=function(t,e,n){let i=this._getSortOptions(e);if(i){if(i.disabled)return!1;let t=i.field;if(null!=t&&!t)return!1}let o=t.getCell(e,n,!0);return!o.hasClass("no-sort")&&o===t.getCell(e,t.getRowCount()-1,!0)&&!o.getParent().classList.contains("collapsed")},Ze._proto=Ze.prototype;let tn=function(t){return t?t.getRowData():null},en=function(t){return!t.isAutoGenerated()},nn=function(t){return!t.autoGenerated},on=function(t,e,n,i){return(t.getData(i)-e.getData(i))*n},rn=function(t,e,n){let i=t.getParent();if(!i)return 0;let o=e.getParent();if(!o)return 0;if(i!==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)*n},sn=function(t){return t?t.getName():""},ln=function(t,e){return t.getField()===e||t.getId()===e},an=function(t,e){return!!(t&&e&&t.id&&e.id)&&t.id===e.id},un=function(t){t&&t.preventDefault()},hn=function(t){return t&&clearTimeout(t),0},pn=function(n,i){let o=this;if(o._onDataChanged=o._onDataChanged.bind(o),o._onQuote2PostUpdate=o._onQuote2PostUpdate.bind(o),o._onQ2DataChanged=o._onQ2DataChanged.bind(o),o._onDataComposed=o._onDataComposed.bind(o),o._onSubSegmentChanged=o._onSubSegmentChanged.bind(o),o._recalculateFormulas=o._recalculateFormulas.bind(o),o.updateColumnTitle=o.updateColumnTitle.bind(o),o._populateTimeSeriesChildren=o._populateTimeSeriesChildren.bind(o),o._onPostSectionDataBinding=o._onPostSectionDataBinding.bind(o),o._asyncClearDataUpdates=o._asyncClearDataUpdates.bind(o),o._clearDataUpdates=o._clearDataUpdates.bind(o),o._onPreDataSorting=o._onPreDataSorting.bind(o),o._mainSorter=o._mainSorter.bind(o),o._updateRowData=o._updateRowData.bind(o),o._onFormulaDataChanged=o._onFormulaDataChanged.bind(o),o._onFormulaDataRequired=o._onFormulaDataRequired.bind(o),o._registerConstituents=o._registerConstituents.bind(o),o._onColumnAdded=o._onColumnAdded.bind(o),o._onRowExpansionBinding=o._onRowExpansionBinding.bind(o),o._onColumnHeaderBinding=o._onColumnHeaderBinding.bind(o),o._getRowId=o._getRowId.bind(o),o._onFieldLoadedError=o._onFieldLoadedError.bind(o),o._snapshotFillerDataChanged=o._snapshotFillerDataChanged.bind(o),o._onPollingInterval=o._onPollingInterval.bind(o),o._onTabNavigation=o._onTabNavigation.bind(o),o._requestScroll=o._requestScroll.bind(o),o._onVScroll=o._onVScroll.bind(o),o._selfScrollToRow=o._selfScrollToRow.bind(o),o._dcConflator=new e(50,o._onDataChanged),o._formulaConflator=new e(300,o._onFormulaDataChanged),o._chainConflator=new e(100,o._registerConstituents),o._columnTitleConflator=new e(0,o.updateColumnTitle),o._timeSeriesChildConflator=new e(0,o._populateTimeSeriesChildren),o._defaultColumnOptions={},o._topNode=n||t.div(),o._topNode.classList.add("rt-grid"),o._grid=new Be,o._grid._wrapper=this,o._sorter=new Je,o._sorter.setContext("grid",this),o._sorter.setContext("core",o._grid),o._dateTimeUtil=J,o._grid.listen("columnAdded",o._onColumnAdded),i){if(i.dataView){o._sharedDataSource=!0,o._dv=i.dataView,o._dt=o._dv.getDataTable(),o._mainGrid=i.grid;let t=o._mainGrid.getCoreGrid();o._stp=t.getPlugin("SortableTitlePlugin")}i.SortableTitle&&(o._stp=i.SortableTitle),!1===i.topSection&&(o._topSection=!1)}o._sharedDataSource||(o._dc=new _t,o._dc.listen("dataChanged",o._onDataChanged),o._dc.listen("dataComposed",o._onDataComposed),o._dt=new St,o._dt.setSortingLogic(o._mainSorter),o._dt.setClassificationSource(o._dc),o._dt.listen("subSegmentChanged",o._onSubSegmentChanged),o._dv=new De(o._dt),o._dv.listen("pageIndexChanged",o._dispatch.bind(o,"pageIndexChanged")),o._dv.listen("pageCountChanged",o._dispatch.bind(o,"pageCountChanged"))),o._grid.setDataSource(o._dv),o._stp?(o._sharedSorter=!0,o._stp.listen("preDataSorting",o._onPreDataSorting),o._grid.loadPlugin(o._stp)):(o._stp=new Ze({userManagedLogic:!0,sortableColumns:!0,disableDoubleClickToSort:!0,ROW_DEF:!0}),o._stp.listen("preDataSorting",o._onPreDataSorting),o._grid.loadPlugin(o._stp,i)),o._grid.listen("beforeContentBinding",o._dispatch.bind(o,"beforeContentBinding")),o._grid.listen("preSectionRender",o._onColumnHeaderBinding),o._grid.listen("postSectionDataBinding",o._onPostSectionDataBinding),o._grid.listen("firstRendered",o._dispatch.bind(o,"firstRendered")),o._grid.listen("afterContentBinding",o._dispatch.bind(o,"afterContentBinding")),o._grid.listen("tabNavigation",o._onTabNavigation),o._grid.getVScrollbar().listen("scroll",o._onVScroll),o._grid.enableRowHighlighting(!0),o._addGridSections(),o._grid.setParent(o._topNode),o._snapshot=new Ht,o._snapshot.addEventListener("adcDataReceived",o._dispatch.bind(o,"adcDataReceived")),o._snapshot.addEventListener("dataChanged",this._snapshotFillerDataChanged),o._connector=new qe,o._connector.addEventListener("ricAdded",o._onRicAdded.bind(o)),o._connector.addEventListener("ricRemoved",o._onRicRemoved.bind(o)),o._connector.addEventListener("fieldAdded",o._onFieldAdded.bind(o)),o._connector.addEventListener("fieldRemoved",o._onFieldRemoved.bind(o)),o.initialize(i),We.applyStyle(o._grid)};n.inherits(pn,r),pn.prototype._topNode=null,pn.prototype._mainGrid=null,pn.prototype._grid=null,pn.prototype._dc=null,pn.prototype._dt=null,pn.prototype._dv=null,pn.prototype._sharedDataSource=!1,pn.prototype._sharedSorter=!1,pn.prototype._subs=null,pn.prototype._stp=null,pn.prototype._columnSorter=null,pn.prototype._dcConflator=null,pn.prototype._snapshot=null,pn.prototype._connector=null,pn.prototype._sorter=null,pn.prototype._fnEngine=null,pn.prototype._formulaConflator=null,pn.prototype._chainConflator=null,pn.prototype._constituentMap=null,pn.prototype._clientWidth=NaN,pn.prototype._autoLayoutTimer=0,pn.prototype._defaultColumnOptions=null,pn.prototype._RTK=null,pn.prototype._ADCOptions=null,pn.prototype._synapse=null,pn.prototype._autoDateConversion=!1,pn.prototype._textSelect=!1,pn.prototype._lang=null,pn.prototype._dateTimeUtil=null,pn.prototype._initializing=!1,pn.prototype._pollingInterval=0,pn.prototype._pollingTimerId=0,pn.prototype._lastPollingRequest=0,pn.prototype._pollingEnabled=!0,pn.prototype._fieldCaching=!1,pn.prototype._timeSeriesExpansion=!0,pn.prototype._childDataField="",pn.prototype._topSection=!0,pn.prototype._focusingArgs=null,pn.prototype._hasNewUpdates=!1,pn.prototype.dispose=function(){this.removeAllEventListeners(),this._autoLayoutTimer&&(clearInterval(this._autoLayoutTimer),this._autoLayoutTimer=0),this._pollingTimerId=hn(this._pollingTimerId),this.removeAllColumns(),this.removeAllRows(),this._sorter.dispose(),this._grid.dispose(),this._snapshot.dispose(),this._connector.dispose(),this._connector=null,this._sharedDataSource||(this._subs&&(this._subs.removeEventListener("postUpdate",this._onQuote2PostUpdate),this._subs.removeEventListener("dataChanged",this._onQ2DataChanged),this._subs.dispose()),this._dc&&this._dc.dispose(),this._dt&&this._dt.dispose(),this._dv&&this._dv.dispose()),this._mainGrid=this._dc=this._dt=this._dv=this._subs=null,this._focusingArgs&&(hn(this._focusingArgs.id),hn(this._focusingArgs.timeoutId),this._focusingArgs=null)},pn.prototype.getElement=function(){return this._topNode},pn.prototype.removeEventListeners=pn.prototype.removeAllEventListeners,pn.prototype.listen=pn.prototype.addEventListener,pn.prototype.initSubscription=function(){if(this._subs)return;if(this._sharedDataSource)return void(this._subs=this._mainGrid._subs);let t,e,n;if(t=window.JET,this._RTK?e=this._RTK.Quotes:t&&(e=t.Quotes2),e&&(n=e.create(),this._RTK&&this._RTK.prefetchWorkaround&&n.addRic("DUMMY.WORKAROUND","DUMMY.WORKAROUND")),!n)return;n.filter&&n.filter(-2,-1),this._subs=n,this._subs.start(),this._subs.addEventListener("postUpdate",this._onQuote2PostUpdate),this._subs.addEventListener("dataChanged",this._onQ2DataChanged);let i=this._getAllRowDefinitions(),o=i.length;for(let t=0;t<o;++t){let e=i[t];e&&e.subscribeForUpdates(n)}},pn.prototype.updateLayout=function(){this._grid.updateLayout(),this._stp.updateSortSymbols()},pn.prototype._updateRowData=function(t){if(t>=0){let e=this._dv.getRowId(t);e&&this._dt.setRowData(e,{})}else this._dt.dispatchGlobalChange()},pn.prototype.updateRowData=pn.prototype._updateRowData,pn.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 n=this._grid.getSectionSettings("content");n.setAutoSyncRowCount(!0),n.setParent(e)},pn.prototype.addHeaderSection=function(t){let e=this._grid.getAllSections("title"),n=this._grid.addSectionAt(e.length,"title",t);return n&&(n.setRowCount(1),this._grid.getSectionSettings(n).disableDataBinding()),n},pn.prototype.addFooterSection=function(t){let e=this._grid.addSection("footer",t);return e&&(e.setRowCount(1),this._grid.getSectionSettings(e).disableDataBinding()),e},pn.prototype.setParent=function(e){t.appendChild(e,this._topNode),this.updateLayout()},pn.prototype.insertBefore=function(t){if(t){let e=t.parentNode;e&&(e.insertBefore(this._topNode,t),this.updateLayout())}},pn.prototype.getRelativePosition=function(t){return this._grid.getRelativePosition(t)},pn.prototype.getCoreGrid=function(){return this._grid},pn.prototype.initialize=function(t){if(!t)return void this.initSubscription();let e=this;e._initializing=!0;let n=e._grid;n.resetInternalState();let i=(t=n.normalizeConfig(t)).plugins||t.extensions,o=t.fields||t.columns;t.defaultColumnOptions&&(e._defaultColumnOptions=t.defaultColumnOptions,e._defaultColumnSetup(e._defaultColumnOptions,o)),e._processExtension(i,"beforeInit",[n.getElement(),t]),t.textSelect&&(e._textSelect=!0,n.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,Mt.setSynapseConfig(e._synapse)),t.fieldCaching&&(e._fieldCaching=t.fieldCaching),null!=t.timeSeriesExpansion&&(e._timeSeriesExpansion=t.timeSeriesExpansion,Mt.disableTimeSeriesExpansion(!e._timeSeriesExpansion)),t.icons&&t.icons.rowGrouping&&t.icons.rowGrouping.expander&&(We.chainIcon=t.icons.rowGrouping.expander),t.formulaEngine&&(e._fnEngine=new lt,e._fnEngine.addEventListener("dataChanged",e._onFormulaDataChanged),e._fnEngine.addEventListener("dataRequired",e._onFormulaDataRequired));let r=t.borders;null!=r&&n.toggleBorders(r);let s=t.gridlines;null!=s&&n.toggleGridlines(s);let l=t.verticalLines;null!=l&&n.toggleVerticalLines(l);let a=t.contentVerticalLines;null!=a&&n.toggleContentVerticalLines(a);let u=t.horizontalLines;null!=u&&n.toggleHorizontalLines(u),t.pageSize&&e._dv.setPageSize(+t.pageSize);let h=+t.rowHeight;h&&n.setDefaultRowHeight(h);let p=+t.headerRowHeight;p&&n.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&&n.enableRowHighlighting(!!c);let _=t.rowExpansionBinding;"function"==typeof _&&(n.listen("rowExpansionBinding",e._onRowExpansionBinding),e.listen("rowExpansionBinding",_)),this.addListener(t,"dataComposed"),this.addListener(t,"beforeContentBinding"),this.addListener(t,"firstRendered"),this.addListener(t,"afterContentBinding"),this.addListener(t,"tabNavigation"),t.autoDateConversion&&(e._autoDateConversion=!0),t.stepScroll&&n.setRowScrollingStep(1),t.linearWheelScrolling&&n.getVScrollbar().setMouseWheelSpeed("linear"),null!=t.autoHideScrollbar&&n.autoHideScrollbars(!!t.autoHideScrollbar),null!=t.scrollbarParent&&e._setScrollbarParent(t.scrollbarParent);let f=t.adcPollingInterval;null!=f&&(e._pollingInterval=f?+f:0),e.setColumns(o);let g=!0;null!=t.rowVirtualRendering&&(g=t.rowVirtualRendering),null!=t.rowVirtualization&&(g=t.rowVirtualization),n.enableRowVirtualization(!!g);let y=!1;null!=t.columnVirtualRendering&&(y=t.columnVirtualRendering),null!=t.columnVirtualization&&(y=t.columnVirtualization),n.enableColumnVirtualization(!!y),null==t.scrollbar||t.scrollbar?e._topNode.style.overflow="hidden":(n.freezeSection(null),e._topNode.style.overflow="");let m=t.topFreezingCount;if("number"==typeof m){m=m>0?m:0;let t=m-1;n.freezeSection(t)}else!1===m&&n.freezeSection(null);let C=t.bottomFreezingCount;if("number"==typeof C&&(C=C>0?C:0,n.freezeFooter(C)),e.addDataFields(t.dataFields),t[bt]=!0,Array.isArray(i)){for(let o=0;o<i.length;++o){let r=i[o],s=null;if(r){let e=r.name;s=e?n.loadPlugin(e,r):n.loadPlugin(r,t)}s&&s.setGridWrapper&&("function"==typeof s.getGridApi&&s.getGridApi()||s.setGridWrapper("realTimeGrid",e))}e._initializing=!1}let S=t.lang;null!=S&&(e._lang=S,e._dateTimeUtil.setLocale(S)),null!=t.childDataField&&(this._childDataField=vt._childDataField=t.childDataField);let w=t.rows;w||(w=t.rics||null);let b=t.bodies;if(!b&&(b=[],t.body&&b.push(t.body),w)){for(let t=0;t<w.length;t++)"string"==typeof w[t]&&(w[t]={ric:w[t]});b.push({rows:w})}let R=t.staticDataRows||t.dataModel;if(w&&R){let t,n,i=R.data?R.data:R,o=R.fields||e.getColumnFields(),r=w.length;for(let e=0;e<r;e++)w[e].values?(t=x(w[e].values,o),n=x(i[e],o),w[e].values=v(t,n)):w[e].values=i[e];i=i.slice(r,i.length),R.data?R.data=i:R=i}for(let t=0;t<b.length;++t)e.insertRows(b[t].rows);e.addStaticDataRows(R),t.contentBottomPadding&&n.setBottomPaddingSection(t.contentBottomPadding);let I=t.contentRightPadding;I&&("number"!=typeof I&&(I=6),n.reserveRightSpace(I));let D=t.dataConflationRate;null!=D&&n.setDataConflationRate(D);let A=n.getPluginList().map(n.getPlugin.bind(n));e._processExtension(A,"afterInit"),e.initSubscription()},pn.prototype.getConfigObject=function(t){let e=t||{},n=e.columns;n||(n=e.columns=[]);let i,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(),i=0;i<o;++i){let t=n[i];t||(t=n[i]={});let e=this.getColumnDefinition(i);e.getConfigObject(t);let o=Mt.getFieldProperty(e.getField(),"timeSeriesParent");o&&!r&&(r=o,t.field=o,delete t.name,delete t.autoGenerated),!o&&r&&(r=null)}e.columns=n=n.filter(nn),""===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=D(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,i=0;i<o;i++)a=h[i],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,i=0;i<o;i++)a=h[i],c=p[i],d.getRowConfigObject(c,a.getRowId());return e},pn.prototype.setDateTimeUtil=function(t){this._dateTimeUtil!==t&&(this._dateTimeUtil=t,this._dateTimeUtil.setLocale(this._lang))},pn.prototype.setLocale=function(t){t&&this._lang!==t&&(this._lang=t,this._dateTimeUtil.setLocale(t),this._grid.requestRowRefresh())},pn.prototype._defaultColumnSetup=function(t,e){let n=e.length;for(let i=0;i<n;i++){let n=e[i];if("object"==typeof n)for(let e in t)null==n[e]&&(n[e]=t[e])}},pn.prototype._processExtension=function(t,e,n){if(Array.isArray(t))for(let i=0;i<t.length;i++)t[i][e]&&t[i][e].apply(t[i],n)},pn.prototype._onRicAdded=function(t){let e=t.addedRics;this._snapshot.addFields(t.fields);let n=e.length;for(let t=0;t<n;++t){let n=e[t],i=this._connector.getRowDefByRic(n),o=i?i.length:0;for(let t=0;t<o;++t)i[t].getSymbol()===n&&this._snapshot.addRic(n)}this._dispatch(t.type,t)},pn.prototype._onRicRemoved=function(t){this._dispatch(t.type,t)},pn.prototype._onFieldAdded=function(t){let e=t.rowDefs,n=t.addedFields;for(let t in e)this._snapshot.addRic(e[t].getSymbol());if(this._snapshot.addFields(n),this._subs){let t=n.filter(Mt.isRealTimeField);t.length>0&&this._subs.addFields(t)}this._dispatch(t.type,t)},pn.prototype._onFieldRemoved=function(t){let e=t.removedFields;this._subs&&this._subs.removeFields(e),this._dispatch(t.type,t)},pn.prototype.insertColumn=function(t,e){let n=this.getColumnCount();(null==e||e>n)&&(e=n);let i=this._initializing?{}:I(this._defaultColumnOptions);if("string"==typeof t)i.field=t;else for(let e in t)i[e]=t[e];this._fnEngine&&(i.formulaEngine=this._fnEngine);let o=new kt(i,this);i[Vt]=o,this._grid.insertColumn(e,i)},pn.prototype._updateTimeSeriesFields=function(t){let e,n,i,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(i in a)n=t.childrenFieldToParent[i],u[n]?u[n].push(i):u[n]=[i];for(n in u){let t,i,l=u[n];for(o=this.getColumnIndex(n),r=this._getColumnDefinition(o),i=l.length,t=0;t<i;t++)e=l[t],s=this.getColumnIndex(e),s<0&&(o=this.getColumnIndex(n),r=this._getColumnDefinition(o),this._cloneTimeSeriesColumn(r,e,o),Mt.addTimeSeriesChild(n,e));this.removeColumn(n)}},pn.prototype._populateTimeSeriesChildren=function(t){if(this._timeSeriesChildConflator.conflate(t))return;let e,n,i,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=Mt.getTimeSeriesChildren(l);if(!a)return;if(i=a.length,i<1)return;for(n=0;n<i;n++)r=this.getColumnIndex(t),o=a[n],this._cloneTimeSeriesColumn(t,o,r)}},pn.prototype._cloneTimeSeriesColumn=function(t,e,n){let i,o;i=t.getConfigObject(),o=I(i),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,n++)},pn.prototype.replaceColumn=function(t,e){let n=this.getColumnIndex(e);if(n<0)return;let i={},o=this._grid,r=o._getColumnDef(n),s=o.getColumnScalability(n);if(i.scalable=s,s=o.getColumnCustomLaneSize(n),i.width=s,s=o.getMinimumColumnWidth(n),s>0&&(i.minWidth=s),s=o.getColumnVisibility(n,0),s||(i.hidden=!0),s=r.stationary,s&&(i.stationary=s),s=r.leftPinned,s&&(i.leftPinned=s),s=r.rightPinned,s&&(i.rightPinned=s),"string"==typeof t)i.field=t;else for(let e in t)i[e]=t[e];t.width&&!t.scalable&&(i.scalable=!1),t.scalable&&!t.width&&(i.width=1);let l=this.getColumnDefinition(n);l&&null==i.id&&(i.id=l.getId()),this._grid.startBatch("reset"),this.removeColumn(n),this.insertColumn(i,n),this._grid.stopBatch("reset")},pn.prototype._onFieldLoadedSuccess=function(t,e,n){if(this._connector&&n&&n.id){let i=n;e&&e.getField()===t&&e.isDefaultName()&&i.name&&(e.setName(i.name),this.updateColumnTitle())}},pn.prototype._onFieldLoadedError=function(t){},pn.prototype._onFieldLoaded=function(t,e){if(this._connector){if(Mt.isTimeSeries(t)){let t=this.getColumnDefinitionById(e);this._populateTimeSeriesChildren(t)}this._connector.addFields(t,e)}},pn.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)},pn.prototype.getFieldInfo=function(t){return Mt.getFieldInfo(t)},pn.prototype.loadFieldInfo=function(t){return Mt.loadFieldInfo(t)},pn.prototype._shouldLoadFieldInfo=function(t){let e=this._RTK||window.JET;return!(!e||!this._fieldCaching||(e=Mt.hasFieldInfo(t),e||(e=Mt.isAdc(t)||Mt.isRealTimeField(t),!e)))},pn.prototype.setColumns=function(t){let e=this._grid,n=t?t.length:0;if(e.startBatch("reset"),this.removeAllColumns(),n>0){let i=!1;n>1&&(i=e.freezeLayout(!0));for(let e=0;e<n;++e)this.insertColumn(t[e],e);n>1&&e.freezeLayout(i)}e.stopBatch("reset")},pn.prototype.restoreColumns=function(t,e){let n=this._grid;n.startBatch("reset");let i,o,r,s=this.getConfigObject().columns,l=s.length,a=t.length,u=e?an:T,h=[],p=[],d=[];for(i=0;i<l;i++){for(r=!1,o=0;o<a;o++)if(u(s[i],t[o])){p.push(s[i]),r=!0;break}r||h.push(i)}this.removeColumns(h);let c=p.length,_=!1;for(a>1&&(_=this._grid.freezeLayout(!0)),i=0;i<a;i++){for(r=!1,o=0;o<c;o++)if(u(t[i],p[o])){r=!0;let e=this.getColumnIndex(t[i].id||t[i].field);d.push(this.getColumnId(e));break}r||(this.insertColumn(t[i],i),d.push(this.getColumnId(i)))}a>1&&this._grid.freezeLayout(_),n.reorderColumns(d),n.stopBatch("reset")},pn.prototype.setFields=pn.prototype.setColumns,pn.prototype._onColumnAdded=function(t){let e=t.context[Vt];delete t.context[Vt];let n=t.colIndex,i=this._grid._getColumnDef(n);e._setCoreColumnDef(i);let o=this._grid.getColumnData(n);o||(o=this._grid.setColumnData(n,{})),o[Vt]=e;let r=e.getUserModel();this._grid.setColumnDataBindingHandler(n,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(n,s,t)}else this._grid.setColumnWidth(n,1,!0);s=r.minWidth,s>=0&&this._grid.setMinimumColumnWidth(n,s),s=r.hidden,s&&this._grid.hideColumn(n,!0),s=r.textAlign||r.alignment,"string"==typeof s&&this._grid.setColumnAlignment(n,s),r.keepModel||e.clearUserModel(),e.isTextSelect()&&this._grid.enableColumnClass(n,"tr-text-select",!0,"content");let l,a=e.getClasses();for(l=0;l<a.length;l++)this._grid.enableColumnClass(n,a[l]);let u=e.getField();this._grid.setDataColumnName(n,bt);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():kt.getDataType(h),d=Mt.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))},pn.prototype.removeColumn=function(t){let e=this.getColumnIndex(t);if(e<0)return;let n=this.getColumnDefinition(e);this._grid.removeColumnAt(e),this._connector.removeFields(n),n.dispose()},pn.prototype.removeColumns=function(t){let e=this.getColumnIndices(t),n=e.length;if(n<=1)return void(1===n&&this.removeColumn(e[0]));e.sort(pn._descendingOrder);let i=this._grid.freezeLayout();for(let t=0;t<n;++t){let n=e[t],i=this.getColumnDefinition(n);i.dispose(),this._grid.removeColumnAt(n),this._connector.removeFields(i)}this._grid.freezeLayout(i)},pn.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)}},pn.prototype.moveColumn=function(t,e){return this._grid.moveColumn(t,e)},pn.prototype.moveColumnById=function(t,e){return this._grid.moveColumnById(t,e)},pn.prototype.reorderColumns=function(t,e){return this._grid.reorderColumns(t,e)},pn.prototype.hideColumn=function(t,e){let n=this.getColumnIndex(t);n<0||this._grid.hideColumn(n,e)},pn.prototype.hideColumns=function(t,e){this._grid.hideColumns(this.getColumnIndices(t),e)},pn.prototype.showAllColumns=function(){this._grid.showAllColumns()},pn._descendingOrder=function(t,e){return e-t},pn.prototype.addDataFields=function(t,e){if(!t)return!1;let n,i,o,r,s,l=Array.isArray(t)?t:[t],a=l.length;for(n=0;n<a;n++)i=l[n],this._shouldLoadFieldInfo(i)?(o=kt.getDataType(i),r=Mt.loadFieldInfo(i).catch(this._onFieldLoadedError),o?this._connector.addFields(i,e||"grid"):(s=this._onFieldLoaded.bind(this,i,e),r=r.then(s).catch(s))):this._connector.addFields(i,e||"grid");return!0},pn.prototype.removeDataFields=function(t,e){return!!t&&(this._connector.removeFields(t,e||"grid"),!0)},pn.prototype.removeFieldReferrer=function(t){t&&this._connector.removeFieldReferrer(t)},pn.prototype.sortColumn=function(t,e){if("string"==typeof t)return void this._stp.sortColumn(t,e);let n=this.getColumnIndex(t);n<0?this._stp.sortColumn(this.getSortedColumnIndex(),"n"):this._stp.sortColumn(n,e)},pn.prototype.setColumnName=function(t,e){let n=this.getColumnDefinition(t);n&&(n.setName(e),this.updateColumnTitle())},pn.prototype.getColumnBackgroundColor=function(t){let e=this.getColumnDefinition(t);return e?e.getBackgroundColor():""},pn.prototype.setColumnBackgroundColor=function(t,e){let n=this.getColumnDefinition(t);n&&n.setBackgroundColor(e)},pn.prototype.setColumnRenderer=function(t,e){let n=this.getColumnIndex(t);this.setColumnFormatter(n,e)},pn.prototype.activateColumnRenderer=function(t,e,n){let i=this.getColumnIndex(t);if(null==i)return;let o=this.getColumnDefinition(i);o&&(o.activateRenderer(e,n),this._grid.setColumnDataBindingHandler(i,o.getRenderer()),this._grid.requestRowRefresh())},pn.prototype.setColumnFormatter=function(t,e){if(null==t)return;let n=this.getColumnDefinition(t);if(!n)return;let i=null;if(e&&("object"==typeof e?("function"==typeof e.init&&e.init(n.getConfigObject(),this._grid),i=e.binding):i=e,"function"!=typeof i&&(i=null)),i!==n.getRenderer()){let e=this._grid.getSection("content").getColumn(t);e&&e.clearContent(),this._grid.setColumnDataBindingHandler(t,null),n.setRenderer(i),this._grid.setColumnDataBindingHandler(t,n.getRenderer()),this._grid.requestRowRefresh()}},pn.prototype.setColumnSorter=function(t,e){let n=this.getColumnIndex(t),i=this.getColumnDefinition(n);i&&(i.setSorter(e),this.getSortedColumnIndex()===n&&this._stp.refresh())},pn.prototype._initDuplicateRicData=function(t){if(!t)return;let e=this._connector.getRowDefByRic(t.getSymbol());if(e&&e.length>0){let n=e[0];if(t.copyRowData(n),t.isChain()){let e=n.getChildren();e&&e.length>0&&setTimeout(this._cloneChain.bind(this,t),0)}}},pn.prototype._cloneChain=function(t){let e=this._connector.getRowDefByRic(t.getSymbol()),n=e?e[0]:null,i=n?n.getChildren():null,o=i?i.length:0;if(o<0)return;let r=t.getSubId();if(!r)return;let s={subId:r};for(let t=0;t<o;t++){let e=i[t];s.ric=e.getRic(),s.values=e.cloneRowData(),s.values.SUB_ID=r,this._onQ2DataChanged(s)}},pn.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 n=new vt(t);return n.setDataSource(this._dc,this._subs)&&(this._hasNewUpdates=!0),n.registerToView(this._dv,this._getRowId(e)),this._initDuplicateRicData(n),t&&t.hidden&&this._dv.hideRow(n.getRowId()),this._connector.addRic(n),n},pn.prototype.insertSegmentSeparator=function(t,e){return t||(t={}),"object"==typeof t?(t.asSegment=!0,this.insertRow(t,e)):null},pn.prototype.insertRows=function(t,e,n){if(this._mainGrid)return void this._mainGrid.insertRows(t,this._getRowId(e));if(!Array.isArray(t))return;let i=this._dt.freeze(),o=n||this.getColumnFields(),r=this._getRowId(e),s=t.length;for(let e=0;e<s;++e){let n=t[e];n&&("string"==typeof n&&(n={ric:n}),n.fields=o),this.insertRow(n,r)}this._dt.freeze(i)},pn.prototype.addStaticDataRows=function(t,e){if(this._mainGrid)this._mainGrid.addStaticDataRows(t,e);else{if(!Array.isArray(t)){let n=t;t=null,n&&(n.fields&&!e&&(e=n.fields),Array.isArray(n.data)&&(t=n.data))}t&&this.insertRows(t.map(pn._dataToRowOptions),null,e)}},pn.prototype.updateDataSet=function(t,e){if(!Array.isArray(t)||0===t.length)return void this.removeAllRows();let n,i,o,r,s=t.length,l="ROW_ORDER",a={},u=this.getAllRowDefinitions(),h=u.length,p=!1;if(e){for(p=this._dt.freeze(),r=0;r<h;r++)n=u[r],n&&(i=n.getRowData()[e],i||0===i?a[i]=n:this.removeRow(n));let d={},c={};for(r=s-1;r>=0;r--)o=t[r],i=o[e],n=a[i],c[i]=o,o[l]=r,d[i]||(d[i]=!0,n?n.setRowData(o):this.insertRow({values:o}));for(let t in a)a[t]&&!c[t]&&this.removeRow(a[t]);this._dt.sortOnce(bt,"a",on,l),this._dt.freeze(p)}else{for((s-h>1||h-s>1)&&(p=this._dt.freeze()),r=0;r<h;r++)o=t[r],o?a[r]=u[r]:this.removeRow(u[r]);for(r=0;r<s;r++)o=t[r],n=a[r],n?n.setRowData(o):this.insertRow({values:o});(s-h>1||h-s>1)&&this._dt.freeze(p)}},pn._dataToRowOptions=function(t){return{values:t}},pn.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},pn.prototype.removeRows=function(t){let e,n;if(!Array.isArray(t))return e=this.removeRow(t),e?[e]:[];if(this._mainGrid)return this._mainGrid.removeRows(t.map(this._getRowId));let i=[],o=t.length;for(n=0;n<o;++n)e=this._getRowDefinitionByRef(t[n]),e&&(e.isAutoGenerated()||i.push(e));o=i.length;let r=!1;for(o>1&&(r=this._dt.freeze()),n=0;n<o;++n)this._removeRow(i[n]);return o>1&&this._dt.freeze(r),i},pn.prototype.removeAllRows=function(){if(this._sharedDataSource)return;if(!this._dt.getRowCount())return;let t=this._getAllRowDefinitions();this._dc.clearAllData(),this._dt.clearAllData(),this._dt.setClassificationSource(this._dc),this._clearDataUpdates(),t.forEach(vt.dispose),this._dcConflator.reset(),this._formulaConflator.reset(),this._chainConflator.reset(),this._constituentMap=null,this._connector.removeAllRics(),this._grid.getVScrollbar().setScrollTop(0)},pn.prototype._removeRow=function(t){if(this._sharedDataSource)return;this._dispatch("beforeRowRemoved",{});let e=t.getDescendants();e&&this._removeConstituentRows(e),this._connector.removeRic(t),this._dt.removeRow(t.getRowId()),t.dispose()},pn.prototype._removeConstituentRows=function(t){let e=this._connector,n=[];for(let i=0;i<t.length;i++){let o=t[i];n.push(o.getRowId()),e.removeRic(o),o.dispose()}this._dt.removeRows(n)},pn.prototype.hideRow=function(t,e){let n=this._getRowId(t);(this._mainGrid||this._grid).hideRow(n,e)},pn.prototype.hideRows=function(t,e){Array.isArray(t)||(t=[t]);let n=t.map(this._getRowId);(this._mainGrid||this._grid).hideRows(n,e)},pn.prototype.showRows=function(t,e){this.hideRows(t,!1===e)},pn.prototype.unhideAllRows=function(){this._grid.unhideAllRows()},pn.prototype.hasHiddenRow=function(){return this._grid.hasHiddenRow()},pn.prototype.setRic=function(t,e,n){if(this._mainGrid)return this._mainGrid.setRic(this._toRowId(t),e,n);let i=this._getRowDefinitionByRef(t);if(i){let t=n||{};"string"==typeof e?t.ric=e:(e&&!n&&(t=e),e=t.ric?t.ric:"");let o=vt.extractRowOptions(t),r=i.getSymbol();i.setContent(e,o)&&(this._connector.removeRic(i,r),this._initDuplicateRicData(i),this._connector.addRic(i));let s=t.values;null!=s&&i.setStaticRowData(s,t.fields)}return i},pn.prototype.unlinkChain=function(t){let e=this._getRowDefinitionByRef(t);if(!e)return;if(!e.isChain())return;let n=e.getDescendants();if(n){let t=n.length,i={};for(let e=0;e<t;e++)i[n[e].getRic()]="";let o=e.isChainCollapsed(),r={chain:e,collapsed:o,ridMap:i};if(this._dispatch("beforeUnlinked",r),o)this._removeConstituentRows(n);else{let e=!1,o={};for(let r=0;r<t;r++){let t=n[r],s=i[t.getRic()];s&&(s.match(vt.ROW_ID_PATTERN)?(console.warn("Please change the rowId format to avoid duplicated rows' id causing unexpected behavior."),s=""):(e=!0,o[t.getRowId()]=s)),t.toRealTimeRow(s)}e&&(this._dc.replaceRowIds(o),this._dt.replaceRowIds(o))}}e.unlinkChain()},pn.prototype.setRowContent=pn.prototype.setRic,pn.prototype.toggleRowExpansion=function(t,e){this._dv.toggleRowExpansion(t,e)},pn.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)}},pn.prototype.setRics=function(t){this.removeAllRows(),t&&t.length&&this.insertRows(t)},pn.prototype.getRowCount=function(){return this._dv.getRowCount()},pn.prototype.getPageItemCount=function(){return this._dv.getRowCount(!1,!0)},pn.prototype.getDataRowCount=function(){return this._dt.getRowCount()},pn.prototype.getColumnCount=function(){return this._grid.getColumnCount()},pn.prototype.getColumnDataType=function(t){let e=this.getColumnDefinition(t);return e?e.getDataType():""},pn.prototype.getColumnDefinition=function(t){let e=this._grid.getColumnData(t);return e&&e[Vt]||null},pn.prototype.getColumnDefinitions=function(){let t=this.getColumnCount(),e=new Array(t);for(let n=0;n<t;n++)e[n]=this.getColumnDefinition(n);return e},pn.prototype.getColumnDefinitionById=function(t){return"string"==typeof t?this.getColumnDefinition(this.getColumnIndex(t)):null},pn.prototype.getColumnDefinitionsById=function(t){let e=Array.isArray(t)?t.length:0;if(e>0){let n,i,o=new Array(e);for(n=0;n<e;n++)i=t[n],o[n]=this.getColumnDefinitionById(i);return o}return null},pn.prototype._getColumnDefinition=function(t){if(t instanceof kt)return t;if("number"==typeof t)return this.getColumnDefinition(t);if("string"==typeof t){let e=this.getColumnCount();for(let n=0;n<e;++n){let e=this.getColumnDefinition(n);if(ln(e,t))return e}}return null},pn.prototype.getRowType=function(t){let e=this.getRowDefinition(t);return e?e.getType():""},pn.prototype.getRowDefinition=function(t){return"number"==typeof t?this._getRowDefinitionByIndex(t):"string"==typeof t?this._getRowDefinitionById(t):null},pn.prototype._getRowDefinitionByIndex=function(t){return this._dv.getDataAt(t,bt)||null},pn.prototype._getRowDefinitionById=function(t){return this._dt.getData(t,bt)||null},pn.prototype._getRowDefinitionByRef=function(t){return t instanceof vt&&t.getRowId()?t:this.getRowDefinition(t)},pn.prototype.getRowDefinitions=function(){return this._dv.getColumnData(bt,!0)},pn.prototype._getAllRowDefinitions=function(){return this._dt.getColumnData(bt)},pn.prototype.getAllRowDefinitions=function(t){return t?this._getAllRowDefinitions():this._dt.getColumnData(bt).filter(en)},pn.prototype.getRowData=function(t){return tn(this._getRowDefinitionByIndex(t))},pn.prototype.getMultipleRowData=function(t){if("number"==typeof t)return[this.getRowData(t)];let e=null;if(Array.isArray(t)){let n=t,i=n.length,o=new Array(i);e=this.getRowDefinitions();for(let t=0;t<i;++t){let i=n[t];"number"==typeof i?o[t]=tn(e[i]):i&&i.getRowData&&(o[t]=tn(i))}return o}return e=t&&t.getColumnData?t.getColumnData(bt,!1):this.getRowDefinitions(),e.map(tn)},pn.prototype.setRicData=function(t,e){let n=this._connector.getRowDefByRic(t),i=n?n.length:0;for(let o=0;o<i;++o){let i=n[o];i&&i.getSymbol()===t&&i.setRowData(e)}},pn.prototype.getAllRics=function(){return this._connector.getAllRics()},pn.prototype.hasRic=function(){return this._connector.hasRic()},pn.prototype.getRic=function(t){return this.getRowDefinition(t).getRic()},pn.prototype.setRowData=function(t,e){let n=this._getRowDefinitionByRef(t);n&&n.setRowData(e)},pn.prototype.setStaticRowData=function(t,e){let n=this._getRowDefinitionByRef(t);n&&n.setStaticRowData(e)},pn.prototype.setStaticData=function(t,e,n){let i=this._getRowDefinitionByRef(t);i&&i.setStaticData(e,n)},pn.prototype._getRowId=function(t){return"string"==typeof t?t:"number"==typeof t?this._dv.getRowId(t):t instanceof vt?t.getRowId():""},pn.prototype.clearColumnData=function(t){let e=this.getColumnIndices(t),n=e.length;if(!n)return;let i={};for(let t=0;t<n;++t){let n=e[t],o=this.getColumnField(n);o&&(i[o]=null)}let o=this.getAllRowDefinitions(),r=o.length;for(let t=0;t<r;++t)o[t].setRowData(i)},pn.prototype.getColumnIndex=function(t){if(t instanceof kt){let e=this.getColumnCount();for(let n=0;n<e;++n)if(this.getColumnDefinition(n)===t)return n;return-1}return this._grid.getColumnIndex(t)},pn.prototype.getColumnIndices=function(t){let e=[];if(t||0===t){let n=this.getColumnCount(),i=Array.isArray(t)?t:[t],o=i.length;for(let t=0;t<o;++t){let o=this.getColumnIndex(i[t]);o>=0&&o<n&&e.push(o)}}return e},pn.prototype.getColumnId=function(t){return this._grid.getColumnId(t)},pn.prototype.getColumnIds=function(){return this._grid.getColumnIds()},pn.prototype.getColumnField=function(t){return this._grid.getColumnField(t)},pn.prototype.getColumnFields=function(){return this._grid.getColumnFields()},pn.prototype.getColumnNames=function(){return this.getColumnDefinitions().map(sn)},pn.prototype.getAllFields=function(){return this._connector.getAllFields()},pn.prototype.freezeColumn=function(t,e){null==t&&(t=-1),this._grid.freezeColumn(t,e)},pn.prototype.pinColumn=function(t,e){if(Array.isArray(t)){let n=t,i=n.length,o=0;for(let t=0;t<i;++t)o|=this._pinColumn(n[t],e);return!!o}return this._pinColumn(t,e)},pn.prototype._pinColumn=function(t,e){let n=this.getColumnIndex(t),i=this.getColumnCount();if(n<0||n>i)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(n>=t)return!1;if(s>=0&&n<=s)return!1;this.moveColumnById(n,t),r+=1,o-=1}else{if(n<o)return!1;o||s>=0&&(o=s,n>s&&o++),this.moveColumnById(n,o)}return this._grid.freezeColumn(o,r),!0},pn.prototype.unpinColumn=function(t,e){if(Array.isArray(t)){let n=t,i=0;for(let t=n.length;--t>=0;)i|=this._unpinColumn(n[t],e);return!!i}return this._unpinColumn(t,e)},pn.prototype._unpinColumn=function(t,e){let n=this.getColumnIndex(t);if(n<0)return!1;let i=this._grid.getPinnedLeftColumnCount(),o=this._grid.getPinnedRightColumnCount(),r=this.getColumnCount()-o;if(n>=i&&n<r)return!1;let s=null,l=null;if(null!=e){let t=this.getColumnIndex(e);l=this.getColumnId(t),s=this.getColumnId(n)}let a=this._grid.getStationaryColumnIndex();return n<i?(n>a&&this.moveColumnById(n,i),this._grid.freezeColumn(i-2,o)):n>=r&&(n>a&&this.moveColumnById(n,r),this._grid.freezeColumn(i-1,o-1)),n>a&&null!=l&&this.moveColumnById(s,l),!0},pn.prototype.unpinAllColumns=function(){let t=this._grid.getPinnedLeftColumnCount(),e=this._grid.getPinnedRightColumnCount();return!(!t&&!e||(this._grid.freezeColumn(-1,0),0))},pn.prototype._onColumnHeaderBinding=function(t){if("title"!==t.sectionType||t.sectionIndex>0)return;let e=t.fromColIndex,n=t.toColIndex;for(;e<n;)this._renderColumnHeader(e++,t)},pn.prototype._renderColumnHeader=function(t,e){let n=this.getColumnDefinition(t);if(!n)return;let i=n.getHeaderRenderer(),o=e.section,r=o.getRowCount();e.colIndex=t,e.columnDef=n;let s=n.getName(),l=n.getTooltip(),a=n.getHeaderAlignment(),u=n.getTooltipValue();for(let n=0;n<r;++n){let r=o.getCell(t,n,!1);r.setContent(s),r.setTooltipInfo("columnDefault",u),r.setTooltipInfo("columnTooltip",l),r.updateTooltip(),r.setStyle("textAlign",a),i&&(e.rowIndex=n,e.cell=r,i(e))}},pn.prototype.updateColumnTitle=function(){if(this._columnTitleConflator.conflate())return;let t=this._grid.getSectionSettings("title");t&&t.rerender()},pn.prototype.isSorting=function(){return this._stp.isSorting()},pn.prototype.getSortedColumnIndex=function(){return this._stp.getSortedColumnIndex()},pn.prototype.getSortOrder=function(){return this._stp.getSortOrder()},pn.prototype.clearSort=function(){this._stp.clearSortState()},pn.prototype.getSortingStates=function(){let t=[],e=this._stp.getSortingStates(),n=e.length;for(let i=0;i<n;i++){let n=e[i],o=this._stp.getSortedColumnIndex(i);t.push({colId:this.getColumnId(o),colIndex:o,order:n.sortOrder})}return t},pn.prototype._onQuote2PostUpdate=function(t){t.childOrderChange&&(this.isSorting()||this._dt.sortOnce("ROW_DEF","a",rn))},pn.prototype._onQ2DataChanged=function(t){let e=this._getRowDefinitionById(t.subId);if(!e)return;let n=t.ric,i=t.values;if(i){let t=null;if(e.verifyConstituent(n)){let i=e,o=i.getConstituent(n);if(o)e=o;else{if(e=o=i.addConstituent(n),!o)return;t=this._connector.getRowDefByRic(n),this._connector.addRic(o),this._constituentMap||(this._constituentMap={}),this._constituentMap[o.getRowId()]=o,this._registerConstituents(o)}}t&&t.length&&t[0].cloneRowData(i,i),e.setRowData(i)}else{let t=e.getConstituent(n);t&&(t.setParent(null),this._removeRow(t))}},pn.prototype._registerConstituents=function(t){if(this._chainConflator.conflate(t))return;this._constituentMap=null;let e=this._dv,n=e?e.getDataSource():null;if(!n)return;let i,o=this._chainConflator.popAllData(),r=o?o.length:0,s=[],l={};for(i=0;i<r;++i){let t=o[i],e=t.getParent();if(!e)break;let n=e.getRowId(),r=l[n];null==r&&(r=l[n]=e.countChildInView()),s.push(t)}if(r=s.length,!r)return;let a=!1;for(r>1&&(a=this._dt.freeze()),i=0;i<r;++i){let t=s[i],o=t.getParent().getRowId(),r=l[o];e.addSegmentChild(o,t.getRowId());let a=n.getRowIndex(o)+1,u=t.getData("CHILD_ORDER");a+=null!=u&&u<r?u:r;let h=n.getRowId(a);t.registerToView(e,h),l[o]=r+1}r>1&&this._dt.freeze(a)},pn.prototype._onDataChanged=function(t){if(this._dt){if(t){if(t.initialChanges&&!this._dt.hasSegmentClassification())return;if(t.rid&&t.changes){let e=this._getRowDefinitionById(t.rid);e&&e.addUpdate(t.changes)&&(this._hasNewUpdates=!0)}}this._dcConflator.conflate()||(this._dt.classifySegments(),this._dt.dispatchGlobalChange())}},pn.prototype._onPreDataSorting=function(t){let e=this._stp.getSortedColumns();if(this._sorter.reset(),Array.isArray(e)){let t=e.length;for(let n=0;n<t;++n){let t=e[n],i=t.field||"",o=t.colIndex,r=o>=0?this.getColumnDefinition(o):null,s=!1,l=null;r&&(i||(i=r.getField()),s=r.isRowSorting(),l=r.getSorter()),this._sorter.addColumnContext(i,l,s,t.sortOrder,o,r)}}this._columnSorter=this._sorter.getSorter()},pn.prototype._mainSorter=function(t,e,n){return this._columnSorter(t,e,n)},pn.prototype._onPostSectionDataBinding=function(t){t.actualUpdate&&this._asyncClearDataUpdates()},pn.prototype._asyncClearDataUpdates=function(){setTimeout(this._clearDataUpdates,0)},pn.prototype._clearDataUpdates=function(){if(!this._dt||!this._hasNewUpdates)return;this._hasNewUpdates=!1;let t=this._dt.getAllRowIds(!0);for(let e=t.length;--e>=0;)this._dt.getRowData(t[e])[bt].resetUpdates()},pn.prototype.getDataView=function(){return this._dv},pn.prototype.setPage=function(t){return this._dv.setPage(t)},pn.prototype.setPageSize=function(t){this._dv.setPageSize(t)},pn.prototype.getPageIndex=function(){return this._dv.getPageIndex()},pn.prototype.getPageSize=function(){return this._dv.getPageSize()},pn.prototype.getPageCount=function(){return this._dv.getPageCount()},pn.prototype.toggleChain=function(t){let e=this._getRowDefinitionByRef(t);e&&e.toggleChain()},pn.prototype.setClassification=function(t,e){let n=this._getRowDefinitionByRef(t);return!!n&&this._dt.setSegmentClassification(n.getRowId(),e)},pn.prototype.contains=function(t){return!!t&&this._topNode.contains(t)},pn.prototype.isFocused=function(){let t=document.activeElement;return t&&t.shadowRoot?t.shadowRoot===this._topNode.parentNode:this.contains(t)},pn.prototype.focus=function(){this._grid.focus()},pn.prototype.requestRowRefresh=function(){this._grid.requestRowRefresh()},pn.prototype.updateLayout=function(){this._grid.updateLayout()},pn.prototype.getExtension=function(t){return t?this._grid.getPlugin(t.replace(/Extension/gi,"")):null},pn.prototype._onFormulaDataChanged=function(t){this._formulaConflator.conflate()||(this._recalculateFormulas(),this._updateRowData())},pn.prototype._onFormulaDataRequired=function(t){},pn.prototype._onDataComposed=function(t){let e=t.changes;if(!e){if(!t.initialChanges)return;e=t.changes=t.initialChanges}let n=t.rowData;if(!n)return;let i=t.rid,o=t.rowDef||this._getRowDefinitionById(i);if(!o){if(o=this._constituentMap?this._constituentMap[i]:null,!o)return;if(o.isDisposed())return void(this._constituentMap[i]=null)}if(this._autoDateConversion){let t;for(let i in e){let e=this._getColumnDefinition(i);if(t=e?e.getDataType():kt.getDataType(i),"datetime"===t){let t=n[i];o.setData(i+"_RAW",t),t=J.toDateObject(t),o.setData(i,t)}}}this.hasListener("dataComposed")&&(t.grid=this,t.rowDef=o,this._dispatch("dataComposed",t)),this._recalculateFormulas(t)},pn.prototype._onSubSegmentChanged=function(t){let e,n=t.insertionList,i=t.removalList,o=t.removedRows,r=i.length,s=null;for(e=0;e<r;e++){let t=o[i[e]];t&&(s=t[bt],s&&(s.dispose(),t[bt]=null))}let l=n.length;for(e=0;e<l;e++){let t=n[e].getId();s=new vt({segmentId:t}),s.setDataSource(this._dc)&&(this._hasNewUpdates=!0),s.registerToView(this._dv)}},pn.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 n=0;n<e;++n)this._fnEngine.calculate(t[n])}},pn.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()},pn.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)}},pn.prototype._onPollingInterval=function(){this._pollingTimerId=0,this._pollingEnabled&&this._pollingInterval&&(this.refreshADCData(),this._startPolling())},pn.prototype.activateADCPolling=function(t){if(!1!==t){this._pollingEnabled=!0;let t=new Date;this._lastPollingRequest&&t.getTime()-this._lastPollingRequest>this._pollingInterval&&this.refreshADCData(),this._startPolling()}else this._pollingEnabled=!1},pn.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)},pn.prototype._onAutoLayoutUpdate=function(){let t=this._topNode.clientWidth;t!==this._clientWidth&&(this._clientWidth=t,this.updateLayout())},pn.prototype.logDT=function(t){let e=this._getAllRowDefinitions();this._logData(e,t)},pn.prototype.logDV=function(t){let e=this.getRowDefinitions();this._logData(e,t)},pn.prototype._logData=function(t,e){e||(e={}),e.colNames||(e.colNames=this.getColumnFields());let n=_t.constructTable(t.map(tn),e);console.table(n)},pn.prototype.replaceRow=function(t,e){let n=this._getRowId(t),i=this._getRowDefinitionById(n);if(i){if(i.isAutoGenerated())return null;let t=i.getConfigObject();if(i.getRowId()===e.rowId)return null;if(T(t,e))return null}let o=this.insertRow(e,n);return i&&this.removeRow(n),o},pn.prototype.scrollToColumn=function(t,e){return this._grid.scrollToColumn(t,e)},pn.prototype.scrollToRow=function(t,e){this._grid.scrollToRow("content",t,e)},pn.prototype.getScrollLeft=function(){return this._grid.getScrollLeft()},pn.prototype.getScrollTop=function(){return this._grid.getScrollTop()},pn.prototype.setScrollLeft=function(t){this._grid.setScrollLeft(t)},pn.prototype.setScrollTop=function(t){this._grid.setScrollTop(t)},pn.prototype.scrollRight=function(t){this._grid.scrollRight(t)},pn.prototype.scrollDown=function(t){this._grid.scrollDown(t)},pn.prototype.getScrollWidth=function(){return this._grid.getScrollWidth()},pn.prototype.getScrollHeight=function(){return this._grid.getScrollHeight()},pn.prototype.getVScrollView=function(){return this._grid.getVScrollView()},pn.prototype._focusCell=function(t,e){if(t){let n=t.getContent();if(n){let i=null;if(this.hasListener("tabNavigation")){let o={shiftKey:e.shiftKey,activeElement:e.activeElement,cellContent:n,cell:t,colIndex:e.colIndex,rowIndex:e.rowIndex,field:e.fields?e.fields[e.colIndex]:""};this._dispatch("tabNavigation",o),i=o.nextFocusableElement}else"SPAN"!==n.tagName&&(i=n);if(i&&i!==e.activeElement&&!i.disabled)return i.focus(),!0}}return!1},pn.prototype._onVScroll=function(){let t=this._focusingArgs;if(t){t.timeoutId=hn(t.timeoutId),this._focusingArgs=null;let e=this._grid.getCell("content",t.colIndex,t.rowIndex);this._focusCell(e,t)||(t.shiftKey?this._focusPrevCellContent(t):this._focusNextCellContent(t))}},pn.prototype._onScrollTimeout=function(){this._focusingArgs=null},pn.prototype._selfScrollToRow=function(){let t=this._focusingArgs;t&&(t.id=0,this.scrollToRow(t.rowIndex))},pn.prototype._requestScroll=function(t){this._focusingArgs||(this._focusingArgs=t,t.event=null,t.id=setTimeout(this._selfScrollToRow,0),t.timeoutId=setTimeout(this._onScrollTimeout,100))},pn.prototype._focusNextCellContent=function(t){let e=t.colIndex,n=t.rowIndex;if(n<0||null==n)return;let i,o=t.focusableColIndices,r=o.length,s=0;if(e>=0)for(i=1;i<r&&!(e<o[i]);i++)s=i;let l=this._grid,a=l.getSection("content"),u=l.getVerticalViewInfo().lastFullRow,h=this.getRowCount();t.fields=l.getColumnFields();for(let e=n;e<h;e++){for(t.rowIndex=e,i=s;i<r;i++){let n=o[i];if(t.colIndex=n,e>u)return un(t.event),void this._requestScroll(t);{let i=a.getCell(n,e);if(this._focusCell(i,t))return void un(t.event)}}s=0}this._grid.getHiddenInput().focus()},pn.prototype._focusPrevCellContent=function(t){let e=t.colIndex,n=t.rowIndex;if(n<0||null==n)return;let i,o=t.focusableColIndices,r=o.length,s=r-1;if(e>=0)for(i=r-1;--i>=0&&!(e>o[i]);)s=i;let l=this._grid,a=l.getSection("content"),u=l.getVerticalViewInfo().firstFullRow;t.fields=this.getColumnFields();for(let e=n;e>=0;e--){for(t.rowIndex=e,i=s;i>=0;i--){let n=o[i];if(t.colIndex=n,e<u)return un(t.event),void this._requestScroll(t);{let i=a.getCell(n,e);if(this._focusCell(i,t))return void un(t.event)}}s=r-1}this._grid.getHiddenInput(!0).focus()},pn.prototype._onTabNavigation=function(t){if(this._focusingArgs)return;let e=this.getColumnDefinitions(),n=e.length,i=[];for(let t=0;t<n;t++)e[t].isFocusable()&&i.push(t);if(!i.length)return;let o=t.event,r=this.getRelativePosition(o),s=r.rowIndex;if(t.onTheEdge){let t=this._grid.getVerticalViewInfo();s=o.shiftKey?t.lastFullRow:t.firstFullRow}let l={event:o,shiftKey:o.shiftKey,colIndex:r.colIndex,rowIndex:s,focusableColIndices:i,activeElement:t.activeElement};o.shiftKey?this._focusPrevCellContent(l):this._focusNextCellContent(l)},pn.prototype._getEventHandlers=function(){return{tabNavigation:this._onTabNavigation,q2DataChanged:this._onQ2DataChanged}};let dn={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"]};dn.words=dn.texts.join(" ").split(" ").filter((function(t){return t.length>1})),dn.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"],dn.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"],dn.market=["NYSE","NASDAQ","SET","DJI","HSCEI","HKEX","NIKKEI"],dn.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"}];const cn=dn;let _n=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10],fn={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:{type:"set",members:["USD","GBP","EUR","JPY","THB"]},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},CHILD_ORDER:{type:"set",ignore:!0,members:[void 0]},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,null,NaN]},falsyValues:{type:"set",members:[void 0,null,NaN,0,!1,""]},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?Rn(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:cn.companyName},industry:{type:"set",members:cn.industry},market:{type:"set",members:cn.market},country:{type:"set",members:cn.country}},gn=function(t,e){if(t){let n=e;"function"==typeof e&&(n={type:"function",generate:e}),fn[t]=n}},yn=function(t,e,n,i){t||(t=0),null==e&&(e=100);let o=(e-t)*function(t){return"number"==typeof t?function(t){let e=1e4*Math.sin(113*t);return e*=e,e-(0|e)}(t):Math.random()}(i)+t;if(n>0){let t=_n[n];return Math.floor(o*t)/t}return null!=n?Math.floor(o):o},mn=function(t,e,n){return yn(t,e+1,0,n)},Cn=function(t,e,n){return yn(t,e,0,n)},Sn=function(t,e){return Cn(0,t,e)},wn=function(t){return 0===mn(0,1,t)},bn=function(t,e){var n=t&&t.length||0;return n?1===n?t[0]:t[Sn(n,e)]:String.fromCharCode(mn(65,90,e))},Rn=function(t,e,n){(t=t||Date.now()-63072e6)instanceof Date&&(t=t.getTime()),(e=e||Date.now())instanceof Date&&(e=e.getTime());let i=mn(0,(e-t)/1e3,n);return new Date(t+1e3*i)},vn=function(t,e,n){let i=t<e?Cn(t,e,n):t,o=new Array(i);for(let t=0;t<i;++t){null!=n&&(n*=1.17*(t+1));let e=Sn(cn.words.length,n);o[t]=cn.words[e]}return o.join(" ")},In=function(t,e,n){let i=xn(t,e,n),o=i.value+"";return i.prefix&&("string"==typeof i.prefix?o=i.prefix+o:e.prefix&&(o=e.prefix+" "+o)),i.suffix&&(o+=i.suffix),"string"===i.type&&(i.value=o),i.formattedValue=o,i},Dn=function(t,e,n){let i={},o=0;e&&("number"==typeof e?o=i.numRows=e:(i=e,o=e.numRows||e.numRow||e.rowCount,null!=e.seed&&-1===(n=e.seed)&&(n=null))),o||(o=1),t?Array.isArray(t)||(t=[t+""]):t=[""];let r=t.length,s=[];for(let i=0;i<o;++i){let i=[];for(let o=0;o<r;++o){let r=t[o];i.push(xn(r,e,n).value)}null!=n&&++n,s.push(i)}return{data:s,seed:n,fields:t}},xn=function(t,e,n){let i,o=function(t){return fn[t]||{}}(t);if(o.type||(o.type="number",gn(t,o)),void 0!==o.fixedValue)return o.value=o.fixedValue,o;null!=n&&(null==o.hash&&(o.hash=function(t){let e=0,n=t?t.length:0;for(;--n>=0;)e+=t.charCodeAt(n)*(n+.9879);return e}(t)),n+=o.hash);let r=null!=o.min?o.min:100,s=null!=o.max?o.max:1e4;if("string"===o.type)i=null!=o.min||null!=o.max?vn(r,s,n):e&&e.text||"";else if("set"===o.type)i=bn(o.members,n);else if("date"===o.type)i=Rn(r,s,n);else if("isoDate"===o.type)i=Rn(r,s,n).toISOString().slice(0,10);else if("isoDateObject"===o.type)i=Rn(r,s,n),i=new Date(i.toISOString().slice(0,10));else if("boolean"===o.type)i=wn(n);else if("function"===o.type)o.field=t,i=o.generate(o,n);else{let t=null!=o.prec?o.prec:0;i=yn(r,s,t,n)}return o.value=i,o},An=function(t){this._seed=null!=t?t:null};An.prototype._seed=null,An.prototype.generate=function(t,e){let n=Dn(t,e,this._seed);return this._seed=n.seed,n.data},An.prototype.generateRecords=function(t,e){let n=Dn(t,e,this._seed);this._seed=n.seed;let i=(t=n.fields).length,o=n.data;for(let e=o.length;--e>=0;){let n=o[e],r={};for(let e=0;e<i;++e)r[t[e]]=n[e];o[e]=r}return o},An.prototype.generateQuoteData=function(t,e){let n=In(t,e,this._seed);return null!=this._seed&&++this._seed,n},An.prototype.getSeed=function(){return this._seed},An.prototype.setSeed=function(t){"number"==typeof t&&(this._seed=t)},An.prototype.randBetween=function(t,e){let n=Cn(t,e,this._seed);return null!=this._seed&&++this._seed,n},An.prototype.randInt=function(t,e){let n=mn(t,e,this._seed);return null!=this._seed&&++this._seed,n},An.prototype.randIndex=function(t){let e=Sn(t,this._seed);return null!=this._seed&&++this._seed,e},An.prototype.randNumber=function(t,e,n){let i=yn(t,e,n,this._seed);return null!=this._seed&&++this._seed,i},An.prototype.randBoolean=function(){let t=wn(this._seed);return null!=this._seed&&++this._seed,t},An.prototype.randMember=function(t){let e=bn(t,this._seed);return null!=this._seed&&++this._seed,e},An.prototype.randDate=function(t,e){let n=Rn(t,e,this._seed);return null!=this._seed&&++this._seed,n},An.prototype.randString=function(t,e){let n=vn(t,e,this._seed);return null!=this._seed&&++this._seed,n},An.seed=null,An.generate=function(t,e){let n=Dn(t,e,An.seed);return An.seed=n.seed,n.data},An.generateRecord=function(t,e,n){Array.isArray(t)||(t=[t+""]);let i={};null!=e&&("number"==typeof e?n=e:e&&(i=e));let o=t.length,r={};for(let e=0;e<o;++e){let o=t[e];r[o]=xn(o,i,n).value}return r},An.generateRecords=function(t,e){let n=Dn(t,e,An.seed);An.seed=n.seed;let i=(t=n.fields).length,o=n.data;for(let e=o.length;--e>=0;){let n=o[e],r={};for(let e=0;e<i;++e)r[t[e]]=n[e];o[e]=r}return o},An.addFieldInfo=gn,An.randNumber=yn,An.randInt=mn,An.randBetween=Cn,An.randIndex=Sn,An.randBoolean=wn,An.randMember=bn,An.randDate=Rn,An.randString=vn,An.toRecords=function(t,e){if(!Array.isArray(t))return null;Array.isArray(e)||(e=e?[e+""]:[]);let n=t.length,i=new Array(n);for(let o=0;o<n;++o){let n=i[o]={},r=t[o],s=r&&r.length||0;for(let t=0;t<s;++t){let i=r[t];if(void 0!==i){let o=e[t];o||0===o||(o=t+""),n[o]=i}}}return i};let Tn=function(){};Tn.prototype.create=function(t){return new Ln(t)};let Ln=function(t){this._onRowUpdated=this._onRowUpdated.bind(this),this._fieldMap={},this._prevData={},this.id=null!=t?t+"":"_sub"+Ln._runningId++};Ln.prototype._rics=null,Ln.prototype._isChain=!1,Ln.prototype._fieldMap=null,Ln.prototype._prevData=null,Ln.prototype._updateHandler=null,Ln.prototype._updateTimerId=0,Ln.prototype._updateInterval=1e3,Ln._runningId=0,Ln.prototype.formattedFields=function(t){for(let e=t.length;--e>=0;)this._fieldMap[t[e]]=!0;return this},Ln.prototype.rawFields=function(t){for(let e=t.length;--e>=0;)this._fieldMap[t[e]]=!0;return this},Ln.prototype.chain=function(t){return this._rics=Array.isArray(t)?t[0]:[t],this._isChain=!0,this},Ln.prototype.rics=function(t){return this._rics=Array.isArray(t)?t:[t],this},Ln.prototype.start=function(){return this._onRowUpdated(),this},Ln.prototype.stop=function(){return this._updateTimerId&&(clearInterval(this._updateTimerId),this._updateTimerId=0),this},Ln.prototype.onNewRow=function(t){return this},Ln.prototype.onUpdate=function(t){return this._updateHandler=t,this},Ln.prototype.onRemoveRow=function(t){return this},Ln.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 n=0;n<e;++n)Sn(3)||(t=this._rics[n],this._updateHandler(this,t,this._getUpdateData(t)));this._updateTimerId||(this._updateTimerId=setInterval(this._onRowUpdated,this._updateInterval))},Ln.prototype._getUpdateData=function(t){let e={id:this.id},n={text:t};for(let t in this._fieldMap){let i=In(t,n),o=i.value,r=i.formattedValue;i.changeOnly&&this._prevData[t]===o||(this._prevData[t]=o,e[t]={raw:o,formatted:r||o+""})}return e};let En=function(){this._dict={}};En.prototype._dict,En.prototype._count=0,En.prototype.addItem=function(t,e){if(t&&null!=e){let n=this._dict[t];return n?n.push(e):this._dict[t]=[e],++this._count,!0}return!1},En.prototype.addItems=function(t,e){if(t){if(!Array.isArray(e))return this.addItem(t,e);let n=e?e.length:0;if(n){let i=this._dict[t];return i||(i=this._dict[t]=[]),Array.prototype.push.apply(i,e),this._count+=n,!0}}return!1},En.prototype.removeItem=function(t,e){let n=this._dict[t];if(n){let i=n.indexOf(e);if(i>=0)return n.length>1?n.splice(i,1):delete this._dict[t],--this._count,!0}return!1},En.prototype.removeItemsByKey=function(t){let e=this._dict[t];return!!e&&(delete this._dict[t],this._count-=e.length,!0)},En.prototype.removeAllItems=function(){return!!this._count&&(this._dict={},this._count=0,!0)},En.prototype.getItems=function(t){return this._dict[t]||null},En.prototype.getAllItems=function(){if(this._count>0){let t=[],e=this._dict;for(let n in e)Array.prototype.push.apply(t,e[n]);return t}return null},En.prototype.getItemCount=function(t){if(t){let e=this._dict[t]||null;return e?e.length:0}return this._count},En.prototype.getAllKeys=function(){return Object.keys(this._dict)};let Mn=function(t,e){return t.ric+"_"+e.ric},Fn=function(t){let e=t.match(/\./g);return!!e&&e.length>1},Pn=function(t){let e,n,i,o=t;for(e=o.length-1;e>0;e--)n=Math.floor(Math.random()*(e+1)),i=o[e],o[e]=o[n],o[n]=i;return o.forEach(zn),o=o.sort(Vn),o},zn=function(t,e){t.CHILD_ORDER=e},Vn=function(t,e){return t.CHILD_ORDER-e.CHILD_ORDER},kn=function(){};kn.prototype._lastSub=null,kn.prototype._configObj=null,kn.prototype.config=function(t){t&&(this._configObj=t),this._lastSub&&this._configObj&&this._lastSub.config(this._configObj)},kn.prototype.create=function(t){return this._lastSub=new Nn(t||this._configObj),this._lastSub},kn.prototype.isSkipHeaderSupported=function(){return!0},kn.prototype.setUpdateInterval=function(t,e){this._lastSub?this._lastSub.setUpdateInterval(t,e):(this._configObj||(this._configObj={}),this._configObj.minInterval=t,this._configObj.maxInterval=e)},kn.prototype.setPercentageDataUpdate=function(t){this._lastSub?this._lastSub.setPercentageDataUpdate(t):(this._configObj||(this._configObj={}),this._configObj.percentageDataUpdate=t)};let Nn=function(t){this._onSubscriptionResponse=this._onSubscriptionResponse.bind(this),this._subMap={},this._dataMap=new En,this._fields={},this._events={},this._dataGen=new An,this.config(t)};Nn.prototype._minInterval=750,Nn.prototype._maxInterval=850,Nn.prototype._percentageDataUpdate=.1,Nn.prototype._percentageOrderChange=1,Nn.prototype._constituentCache=!1,Nn.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),e=t.percentageOrderChange,"number"==typeof e&&(this._percentageOrderChange=e/100);let n=t.constituentCache;null!=n&&(this._constituentCache=n)},Nn.prototype.setUpdateInterval=function(t,e){"number"==typeof t&&(this._minInterval=t),"number"==typeof e&&(this._maxInterval=e)},Nn.prototype.setPercentageDataUpdate=function(t){"number"==typeof t&&(this._percentageDataUpdate=Math.round(t/100))},Nn.prototype.setPercentageOrderChanged=function(t){"number"==typeof t&&(this._percentageOrderChange=Math.round(t/100))},Nn.prototype.setSeed=function(t){this._dataGen.setSeed(t)},Nn.prototype.addRic=function(t,e){return this._addSymbol(t,!1,e)},Nn.prototype.addChain=function(t,e){return this._addSymbol(t,!0,e)},Nn.prototype.addFields=function(t){if(!t)return;"string"==typeof t&&(t=[t]);let e=t.length;for(let n=0;n<e;++n)this._fields[t[n]]=!0},Nn.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,n=t.length;for(let i=0;i<n;++i){let n=t[i];this._dataMap.removeItem(Mn(e,n),n),n.parent=null}e.children=null,e.ricList=null}},Nn.prototype.removeRic=Nn.prototype.removeSubscription,Nn.prototype.removeChain=Nn.prototype.removeSubscription,Nn.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()},Nn.prototype.removeFields=function(t){"string"==typeof t&&(t=[t]);let e=t.length;for(let n=0;n<e;++n){let e=t[n];this._fields[e]&&delete this._fields[e]}},Nn.prototype.removeAllFields=function(){let t=!1;for(let e in this._fields){t=!0;break}t&&(this._fields={})},Nn.prototype.start=function(){this._working=!0,this._connect()},Nn.prototype.stop=function(){this._working=!1,this._timerId&&(window.clearTimeout(this._timerId),this._timerId=0)},Nn.prototype.dispose=function(){this.stop(),this._subMap=null,this._dataMap&&(this._dataMap.removeAllItems(),this._dataMap=null),this._fields=null,this._events=null},Nn.prototype.addEventListener=function(t,e){if(!e)return;let n=this._events[t];n?n.indexOf(e)<0&&n.push(e):this._events[t]=[e]},Nn.prototype.removeEventListener=function(t,e){let n=this._events?this._events[t]:null;if(!n)return;let i=n.indexOf(e);i>=0&&n.splice(i,1)},Nn.prototype.removeAllEventListeners=function(){this._events={}},Nn.prototype.getSubscription=function(t){return this._subMap[t]||null},Nn.prototype.getRic=function(t){let e=this._subMap[t];return e?e.ric:""},Nn.prototype.getAllFields=function(){return this._fields},Nn.prototype.hasField=function(t){return this._fields[t]||!1},Nn.prototype.filter=function(t,e){return this};let On=function(t,e){for(let n in t)e[n]=t[n];return e};Nn.prototype._addSymbol=function(t,e,n){if(!t)return null;if(n||0===n)n+="";else do{n="_"+this._runningSubId+++"_"}while(this._subMap[n]);if(this._subMap[n])return window.console.log("WARNING: Cannot add ric with duplicate id"),null;e&&(t=t.replace("0#",""));let i={};i.ric=t,i.chain=e,i.id=n,i.dataId=n+t,this._subMap[n]=i,this._dataMap.addItem(t,i);let o=this._dataMap.getItems(t),r=o.length;this._dispatch("subscriptionAdded",{subs:[i]});let s,l=null,a=0;if(e)if(1===r)for(i.children=[],a=Nn.simpleDigest(t)%10+4,s=0;s<a;++s)l={},l.ric="Child_"+String.fromCharCode(65+s),l.id=n,l.dataId=n+l.ric,l.parent=i,i.children.push(l),l.CHILD_ORDER=s,this._dataMap.addItem(Mn(i,l),l);else{let t=o[0].children;for(a=t.length,i.children=new Array(a),s=0;s<a;++s)l={},l.ric=t[s].ric,l.id=n,l.dataId=n+l.ric,l.parent=i,i.children[s]=l,this._dataMap.addItem(Mn(i,l),l)}return r>1&&this._working&&setTimeout(this._updateDuplicateSymbol.bind(this,t),10),this._connect(),n},Nn.simpleDigest=function(t){let e=t.length,n=0;for(let i=0;i<e;++i)n+=t.charCodeAt(i);return n},Nn.prototype._connect=function(){if(this._working&&!this._timerId){let t=this._dataGen.randInt(this._minInterval,this._maxInterval);this._timerId=window.setTimeout(this._onSubscriptionResponse,t)}},Nn.prototype._onSubscriptionResponse=function(){this._timerId=0;let t=this._dataMap.getAllKeys(),e=t?t.length:0;if(!e)return void this._connect();let n=(this._percentageDataUpdate-.02)*e;n=n>0?n:1;let i=(this._percentageDataUpdate+.02)*e;i=i<e?i:e;let o,r=this._dataGen.randInt(n,i),s=this._fields,l=0;for(let n=0;n<r;n++){let n,i=t[this._dataGen.randIndex(e)],r=this._dataMap.getItems(i),a=r.length,u=r[0],h=u.parent,p=this._dataGen.randInt(0,100)<100*this._percentageOrderChange,d=this._generateQuoteData(u,s);if(Fn(i)&&h&&p){let t=h.children,e=t.length;t=Pn(t);let i=t.indexOf(u);for(u.CHILD_ORDER=i,d.CHILD_ORDER=i,o=!0,n=0;n<a;++n){this._dispatchDataChanged(r[n],d);for(let n=0;n<e;n++)n!==i&&this._dispatchDataChanged(t[n],{X_RIC_NAME:t[n].ric,CHILD_ORDER:n})}}else{if(a>1){let t=u.CHILD_ORDER;null!=t&&(d.CHILD_ORDER=t)}for(n=0;n<a;++n)this._dispatchDataChanged(r[n],d),l++}}let a={};null!=o&&(a.childOrderChange=o),null!=l&&(a.updateCount=l),this._dispatchPostUpdate(a),this._connect()},Nn.prototype._dispatchPostUpdate=function(t){this._dispatch("postUpdate",t)},Nn.prototype._generateQuoteData=function(t,e){let n=t.ric,i=t.prevData,o={},r={text:n,prefix:t.parent?t.parent.ric:""};for(let t in e){let e=this._dataGen.generateQuoteData(t,r);if(e.ignore)continue;let n=t+"_FORMATTED";if(i){if(e.changeOnly&&i[t]===e.value)continue;i[t]=e.value,i[n]=e.formattedValue}o[t]=e.value,o[n]=e.formattedValue}return null!=o.X_RIC_NAME&&null!=o.INDICATOR&&o.INDICATOR>0&&(o.X_RIC_NAME="/"+o.X_RIC_NAME),o},Nn.prototype._getChildSubByRic=function(t,e){let n=t.children;if(n){let t=n.length;for(let i=0;i<t;++i){let t=n[i];if(t.ric===e)return t}}return null},Nn.prototype._updateDuplicateSymbol=function(t){let e=this._dataMap.getItems(t);if(!e)return;let n=e.length;if(n<2)return;let i,o=e[0],r=o.prevData,s=!!o.chain;if(r)for(i=1;i<n;++i){let t=e[i];t.prevData||this._dispatchDataChanged(t,r)}if(!s)return;if(!this._constituentCache)return;let l=o.ricList;if(!l)return;let a=l.length;for(i=1;i<n;++i){let t=e[i],n=t.ricList;for(let e=n?n.length:0;e<a;++e){let n=l[e],i=this._getChildSubByRic(o,n),r=this._getChildSubByRic(t,n);i&&r&&i.prevData&&this._dispatchDataChanged(r,i.prevData)}}},Nn.prototype._dispatchDataChanged=function(t,e){let n=On(e,{}),i={};i.ric=t.ric,i.values=n,i.subId=t.id;let o=t.prevData;if(!o){o={},t.prevData=o,i.type="statusUpdated",n.STATUS=1,n.STATUS_FORMATTED=this._statusMap[1],n.SUB_ID=t.id,On(n,o);let e=t.parent;if(e){let n=e.ricList;n||(n=e.ricList=[]),e.ricList.push(t.ric)}}this._dispatch("dataChanged",i)},Nn.prototype.onFeedStatusChanged=function(t,e){return window.setTimeout((function(){e([{key:"Q",name:"IDN_RDF",state:"up"}])}),1e3),this},Nn.prototype._hasListener=function(t){let e=this._events[t];return!!e&&e.length>0},Nn.prototype._dispatch=function(t,e){let n=this._events[t];if(!n)return;let i=n.length;for(let t=0;t<i;++t)n[t](e)},Nn.prototype._subMap=null,Nn.prototype._fields=null,Nn.prototype._events=null,Nn.prototype._working=!1,Nn.prototype._timerId=0,Nn.prototype._runningSubId=0,Nn.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 Hn=function(){this._data={}};Hn.prototype._data=null,Hn.prototype.clear=function(){this._data={}},Hn.prototype.put=function(t,e){t&&(this._data[t]=e)},Hn.prototype.get=function(t){let e=this._data[t];return null!=e?e:""},Hn.prototype.getAllKeys=function(){return Object.keys(this._data)},Hn.prototype.save=function(){},Hn.prototype.filter=function(t){let e=[];if(t)for(let n in this._data){let i=this._data[n];t(i)&&e.push(i)}return e};let Bn={"TR.NonExistField":!0,"TR.NotExistField":!0,CF_IGNORE_FIELD:!0},Gn=new An,Wn={request:function(t,e){if(e)return Promise.resolve(JSON.stringify(e));let n,i,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=Bn,n=0;n<a.length;n++)i=a[n],h[i]||u.push(i);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,i=u[t],o=/TR.(.*)(?=\()/,r=i.match(o)[0].replace("TR.",""),a=i.toLowerCase(),h=/sdate=(.*)[,]/,d=/edate=(.*)[)]/,c=a.match(h),_=a.match(d),f=c?c[1]:J.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(n=0;n<=y;n++){let e=new Date(new Date(f).setDate(new Date(f).getDate()+n)),i={h:!0,v:J.format(e,"YYYY-MM-DDT00:00:00")};0===t&&p[0].push(i)}let m=l;for(n=0;n<m.length;n++){let t=[m[n],r];for(s=1;s<=y+1;s++){let e=An.generateRecord(r);t.push(e[r])}p.push(t)}}}else{for(l=t.identifiers,a=Wn.splitFields(t.formula),u=[],h=Bn,n=0;n<a.length;n++)i=a[n],h[i]||u.push(i);for(p[0]=[{h:!0,i:"instrument",v:"Instrument"}],n=0;n<u.length;n++)i=u[n],p[0].push({h:!0,r:i.toUpperCase().trim()});let e={};o=l.length;let s=Gn.generate(u,o);for(n=0;n<o;++n){let t=l[n];r=e[t],r||(r=e[t]=s[n],r.unshift(t)),p.push(r)}if(p.length>0&&Gn.randInt(1,10)<=3){let t=Gn.randInt(0,p.length-1);r=p[t],o=r.length;let e=new Array(o);for(e[0]=r[0],n=1;n<o;n++)e[n]="";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}},Un=new An,Yn={request:function(t,e){if(e)return Promise.resolve(JSON.stringify(e));let n,i,o,r,s=t.instruments,l=t.fields,a=Bn;for(l=[],n=0;n<t.fields.length;n++)i=t.fields[n],a[i.name]||l.push(i);let u={};o=s.length;let h=[],p=Un.generate(l,o);for(n=0;n<o;++n){let t=s[n];r=u[t],r||(r=u[t]=p[n],r.unshift(t)),h.push(r)}if(h.length>0&&Un.randInt(1,10)<=3){let t=Un.randInt(0,h.length-1);r=h[t],o=r.length;let e=new Array(o);for(e[0]=r[0],n=1;n<o;n++)e[n]="";h.splice(t+1,0,e)}let d=[{displayName:"Instrument"}];for(n=0;n<l.length;n++)i=l[n],d.push({displayName:i.name,field:i.name.toUpperCase()});return Promise.resolve(JSON.stringify({data:h,headers:[d]}))}},Xn=function(t){return"datagrid"===t?Promise.resolve(Yn):"adc"===t?Promise.resolve(Wn):Promise.reject(t+" is not supported.")};Xn.setInvalidFields=function(t){if(t&&"string"==typeof t)Bn[t]=!0;else if(Array.isArray(t))for(let e=0;e<t.length;e++)Bn[t[e]]=!0};let qn=function(t){this.Quotes=new Tn,this.Quotes2=new kn,this.Archive=new Hn,this.ContainerDescription=!0,this.Data=Xn,t&&this.Quotes2.config(t)};qn.prototype.init=function(t){return t&&this.Quotes2.config(t),this},qn.prototype.onLoad=function(t){return setTimeout(t,2e3),this},qn.prototype.navigate=function(t){return this},qn.prototype.appHit=function(t,e,n){},qn.prototype.getUserInfo=function(){return Promise.resolve({UUID:"PAXTRA"})},qn.prototype.contextChange=function(t){};let jn={"⇧":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},Kn={CF_TICK:1,PRCTCK_1:1,BID_TICK:1,ASK_TICK:1},Jn={"||":1,"&&":2,"<":3,">":3,"<=":3,">=":3,"!=":3,"=":3,"==":3,"===":3,"+":4,"-":4,"*":5,"%":6,"/":6,"!":7,"!!":7},Qn={"+":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}},Zn={"+":2,"-":2,"*":2,"/":2,"%":2,"<":2,">":2,"<=":2,">=":2,"==":2,"!=":2,"&&":2,"||":2,"!":1,"!!":1},$n=function(t,e,n,i){let o={value:e,type:n};return i&&(o.dataType=i),"operator"===n?o.precedence=Jn[e]:"parenthesis"===n&&(o.precedence=0),t.push(o),t.length-1},ti={_tokens:[],_withString:function(t){return" #"+$n(ti._tokens,t.substring(1,t.length-1),"literal","string")+"#"},_withField:function(t){return" #"+$n(ti._tokens,t,"literal","variable")+"#"},_withFieldInBrackets:function(t){return ti._withField(t.substring(1,t.length-1))},_withNegativeNumber:function(t){let e=+t;return e==e?" #"+$n(ti._tokens,e,"literal","number")+"#":""},_withPositiveNumber:function(t){return 35===t.charCodeAt(0)?t:ti._withNegativeNumber(t)},_withOperator:function(t){return Jn[t]?("="!=t&&"==="!=t||(t="=="),"#"+$n(ti._tokens,t,"operator")+"#"):""},_withParenthesis:function(t){return"#"+$n(ti._tokens,t,"parenthesis")+"#"},_tester:function(t){let e=t._rpn,n=e.length,i=0,o=0;for(let t=0;t<n;++t){let n=e[t];if("literal"!==n.type){let t=Zn[n.value];if(!(i>=t))return console.warn("Cannot parse an expression with insufficient number of operands"),!0;i-=t}i++,i>o&&(o=i)}return 1!==i||(t._stackSize=o,!1)},_filter:function(t,e){let n,i=t._rpn,o=new Array(t._stackSize),r=i.length,s=0;for(let t=0;t<r;++t){let r=i[t],l=r.value;"literal"===r.type?n="variable"!==r.dataType?l:e?e[l]:null:1===Zn[l]?(n=Qn[l](o[s-1]),s-=1):(n=Qn[l](o[s-2],o[s-1]),s-=2),o[s++]=n}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;ti._tokens.length=0,e=e.replace(/".+?"/g,ti._withString),e=e.replace(/'.+?'/g,ti._withString),e=e.replace(/\[.+?\]/g,ti._withFieldInBrackets),e=e.replace(/-[0-9.]+/g,ti._withNegativeNumber),e=e.replace(/[0-9.#]+/g,ti._withPositiveNumber),e=e.replace(/[a-zA-Z_]\w*/g,ti._withField),e=e.replace(/[\-\/+*%!=<>&|]+/g,ti._withOperator),e=e.replace(/[()]/g,ti._withParenthesis);let n=ti._tokens,i=n.length;if(!i)return null;let o,r,s,l=[],a=e.match(/#[0-9]+#/g);for(o=0;o<i;++o){let t=a[o];if(r=n[+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;$n(l,"-","operator"),r.value*=-1}}l.push(r)}ti._tokens.length=0,i=l.length;let u=[],h=[],p=null,d=!1;for(o=0;o<i;++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 ti._tester(c)?null:ti._filter.bind(null,c)}},ei=function(){this._conditions=[],this._scopes=[],ei._painters.push(this)},ni=function(t,e){null!=t._coloringCssClass&&t._coloringCssClass!==e&&(t.classList.remove(t._coloringCssClass),t._coloringCssClass=null)};if(ei.ColoringTypes={TEXT:1,HEATMAP:2,CONDITIONAL:3},ei.prototype._coloringType=0,ei.prototype._conditions=null,ei.prototype._effectiveStyles=null,ei.prototype._blinkCondition=null,ei.prototype._scopes,ei.prototype._columnStats=null,ei.prototype._blinkingDuration=250,ei._runningBlinkId=0,ei._painters=[],ei._emptyAry=[],ei._emptyObj={},ei._bgObj={backgroundColor:"",color:""},ei._colorObj={color:""},ei.bgStyles=["backgroundColor","color"],ei.nonBgStyles=["fontSize","fontWeight","fontStyle","textAlign","textDecoration"],ei.supportedStyles=ei.bgStyles.concat(ei.nonBgStyles),ei.themeReady=null,ei._contrastColors={},ei.parse=ti.parse,ei.prototype.dispose=function(){let t=ei._painters.indexOf(this);t>=0&&ei._painters.splice(t,1),this.reset(),this._conditions=null,this._scopes.length=0,this._blinkCondition=null},ei.prototype.reset=function(){this._setColoringType(0),this.clearBlinking()},ei.prototype.resetColoring=function(){this._setColoringType(0),this._effectiveStyles=null,this._conditions.length=0},ei.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];ei._clearBlinkTimer(t)&&t._restorer();let n=t.cell;n&&delete n.blinking,t.cell=null}this._scopes.length=0}},ei.prototype.resetBlinking=ei.prototype.clearBlinking,ei.prototype.clearHeatMap=function(){return this._blinkCondition?(this._setColoringType(0),this.resetHeatMap(),!1):(this.dispose(),!0)},ei.prototype.resetHeatMap=function(){this._conditions.length=0,this._columnStats=null},ei.prototype.applyThemeColor=function(){let t=N.getColors();if(this._coloringType===ei.ColoringTypes.HEATMAP){let e=this._conditions[0];if(e&&(e.textMode?e.baseColor=t.baseText:e.baseColor=t.baseGrid,e.useThemeColor)){let n=t.up,i=t.down,o=t.level===t.baseText?"":t.level;ei._setUpDownColors(e,n,i,o)}}this._blinkCondition&&this._blinkCondition.useThemeColor&&ei._setUpDownColors(this._blinkCondition,t.up,t.down,t.level,!0)},ei.prototype.getConditions=function(){return this._conditions},ei.prototype.getColoringType=function(){return this._coloringType},ei.prototype._setColoringType=function(t){this._coloringType!==t&&(this._coloringType=t)},ei.prototype.setEffectiveStyles=function(t){this._effectiveStyles=t},ei.prototype.getEffectiveStyles=function(){return this._effectiveStyles},ei.prototype.setConditions=function(t){this._conditions.length=0,this._setColoringType(ei.ColoringTypes.CONDITIONAL);let e=t?t.length:0;for(let n=0;n<e;n++)this._addCondition(t[n])},ei.prototype.setColumnStats=function(t){this._columnStats=t&&t.getMin?t:null},ei.prototype.getColumnStats=function(){return this._columnStats},ei.prototype._addCondition=function(t){let e=t.expression;e&&(t._fn=ti.parse(e.text||e),this._conditions.push(t))},ei.prototype.addHeatmap=function(t,e,n,i,o,r){this._setColoringType(ei.ColoringTypes.HEATMAP);let s={heatmap:!0};return s.field=t,s.expression=ei._heatMapCondition.bind(s),s.midPoint=e,ei._setUpDownColors(s,n,i),s.baseColor=o,!0!==r&&"text"!==r||(s.textMode=!0),this._addCondition(s),s},ei.prototype.addHeatmapWithTheme=function(t,e,n){let i=N.themeColors,o=this.addHeatmap(t,e,i.up,i.down,i.baseGrid,n);return!0!==n&&"text"!==n||(o.baseColor=i.baseText),o.useThemeColor=!0,o},ei.prototype._addColorText=function(t,e,n,i,o){this._setColoringType(ei.ColoringTypes.TEXT);let r={};return r.field=e,r.expression=t.bind(null,e),r.upClass=n,r.downClass=i,r.levelClass=o,this._addCondition(r),r},ei.prototype.addColorText=function(t,e,n,i){return this._addColorText(Kn[t]?ei._tickColorTextCondition:ei._colorTextCondition,t,e,n,i)},ei.prototype.addColorTextWithTheme=function(t){return this.addColorText(t,"positive","negative","neutral")},ei.prototype.addTickColorText=function(t,e,n){return this.addColorText("CF_TICK",t,e,n)},ei.prototype.addTickColorTextWithTheme=function(){let t=N.themeColors,e=this.addTickColorText(t.tickUp,t.tickDown,t.level);return e.useThemeColor=!0,e},ei.prototype.addTickBlink=function(t,e,n,i){return this.addBlink("CF_TICK",t,e,n,i)},ei.prototype.addTickBlinkWithTheme=function(t){let e=N.themeColors,n=this.addTickBlink(e.tickUp,e.tickDown,e.level,t);return n.useThemeColor=!0,n},ei.prototype.addBlink=function(t,e,n,i,o){return this._addBlink(Kn[t]?ei._tickBlinkCondition:ei._fieldBlinkCondition,t,e,n,i,o)},ei.prototype.addBlinkWithTheme=function(t,e){let n=N.themeColors,i=this.addBlink(t,n.up,n.down,n.level,e);return i.useThemeColor=!0,i},ei.prototype._addBlink=function(t,e,n,i,o,r){let s=this._blinkCondition={};return s.blink=!0,s.blinkId=ei._runningBlinkId++,s.field=e,s._fn=s.expression=t,!0!==r&&"border"!==r||(s.border=!0),ei._setUpDownColors(s,n,i,o,!0),s},ei.prototype.renderForPrinting=function(t,e,n,i){if(!t)return;let o=this._getStyles(e,n,i),r=o.cssClass;ni(t,r),null!=r?r&&(t.classList.add(r),t._coloringCssClass=r):(t.style.backgroundColor=o.backgroundColor||"",t.style.color=o.color||"")},ei._colorTextCondition=function(t,e){let n=e[t];if(n||0===n){if(n>0)return 1;if(n<0)return-1}return"u"},ei._tickColorTextCondition=function(t,e){return jn[e[t]]},ei._heatMapCondition=function(t,e,n){let i,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=n-this.midPoint,s<0&&(s=e-this.midPoint)):(s=e-this.midPoint,s>0&&(s=n-this.midPoint)),s<0&&(s=-s),i=r/s,i},ei._tickBlinkCondition=function(t){return jn[t]},ei._fieldBlinkCondition=function(t,e){return t>e?1:t<e?-1:0},ei._borderRestorer=function(t){t.blinkTimer=0;let e=t.cell.getElement();e&&(e.style.border="")},ei._cellRestorer=function(t){t.blinkTimer=0;let e=t.cell.getElement();if(e){let n=t.rowData,i=NaN,o=NaN;if(this._coloringType===ei.ColoringTypes.HEATMAP){let t=this._columnStats;t&&(i=t.getMin(),o=t.getMax())}let r=this._getStyles(n,i,o),s=r.cssClass;ni(e,s),null!=s?(s&&(e.classList.add(s),e._coloringCssClass=s),e.style.backgroundColor="",e.style.color=""):(e.style.backgroundColor=r.backgroundColor||"",e.style.color=r.color||"")}},ei.prototype._getStyles=function(t,e,n){if(!t)return ei._emptyObj;let i=this._conditions.length;for(let o=0;o<i;++o){let i,r=this._conditions[o],s=r._fn;try{i=s&&s(t,e,n)}catch(t){}if(i){if(this._coloringType===ei.ColoringTypes.HEATMAP){let t;return t=i>0?R(r.baseColor,r.upColor,i):R(r.baseColor,r.downColor,-i),r.textMode?(ei._colorObj.color=f(t),ei._colorObj):(ei._bgObj.backgroundColor=f(t),ei._bgObj.color=b(t),ei._bgObj)}return this._coloringType===ei.ColoringTypes.TEXT?(i>0?r.cssClass=r.upClass:i<0?r.cssClass=r.downClass:0===i&&(r.cssClass=r.levelClass),r.cssClass||(r.cssClass=""),r):r}}return ei._emptyObj},ei.blendColor=R,ei.blackAndWhite=b,ei.rgb2Hex=_,ei.num2Hex=f,ei.num2Rgb=g,ei.hex2Num=y,ei.hex2Rgb=m,ei.themeChanged=function(){},ei.setThemeColors=function(){},ei._onThemeChanged=function(){let t=ei._painters;for(let e=t.length;--e>=0;)t[e].applyThemeColor()},ei.loadThemeColors=function(){return ei.themeReady||(ei.themeReady=N.getThemeColors(ei._onThemeChanged).then(ei._onThemeChanged).catch(ei._onThemeChanged)),ei.themeReady},ei.reloadThemeColors=function(){return ei.themeReady=N.reloadThemeColors().then(ei._onThemeChanged).catch(ei._onThemeChanged),ei.themeReady},ei.clearCellStyle=function(t,e){let n=t.getElement();if(!n)return;let i=t.blinking;if(i&&(ei._clearBlinkTimer(i),delete t.blinking,i.cell=null),ni(n),e||(e=ei.supportedStyles),Array.isArray(e))for(let t=e.length;--t>=0;)n.style[e[t]]="";else for(let t in e)n.style[t]=""},ei._setUpDownColors=function(t,e,n,i,o){t.upColor=e,null!=e&&o&&(t.contrastUpColor=ei.getOppositeColor(e)),t.downColor=n,null!=n&&o&&(t.contrastDownColor=ei.getOppositeColor(n)),t.levelColor=i,null!=i&&o&&(t.contrastLevelColor=ei.getOppositeColor(i))},ei._clearBlinkTimer=function(t,e){return!!t.blinkTimer&&(clearTimeout(t.blinkTimer),t.blinkTimer=0,!0)},ei.getOppositeColor=function(t){if("string"==typeof t){if("#"===t.charAt(0)){let e=ei._contrastColors[t];if(!e){let n=y(t);e=ei._contrastColors[t]=b(n)}return e}}else if(Array.isArray(t))return b(t);return""},ei.prototype.render=function(t,e,n,i){null!=n&&n==n?this._paintCell(t,e,n,i):this._conditions.length&&this._coloringType===ei.ColoringTypes.CONDITIONAL&&this._paintCell(t,e)},ei.prototype.renderHeatMap=function(t,e,n,i){this._paintCell(t,e,n,i)},ei.prototype.renderColoring=function(t,e){this._paintCell(t,e)},ei.prototype._paintCell=function(t,e,n,i){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,n,i),a=o.style,u=l.cssClass;ni(o,u),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=""))},ei.prototype._prepareScope=function(t){let e=t.blinking;e||(e={},e.cell=t,t.blinking=e,this._scopes.push(e));let n=this._blinkCondition;if(e.blinkId!==n.blinkId){e.blinkId=n.blinkId,e.field=n.field;let t=n.border?ei._borderRestorer:ei._cellRestorer;e._restorer=t.bind(this,e)}return e},ei.prototype.blink=function(t,e,n){if(!t)return!1;let i=t.getElement();if(!i)return!1;let o=this._blinkCondition;if(!o)return!1;let r,s,l=this._prepareScope(t);return l.rowData=n,e>0?(r=o.upColor,s=o.contrastUpColor):e<0?(r=o.downColor,s=o.contrastDownColor):(r=o.levelColor,s=o.contrastLevelColor),this._blink(l,i,r,s),!0},ei.prototype.flash=function(t,e,n){if(!t)return!1;let i=t.getElement();if(!i)return!1;if(!this._blinkCondition)return!1;let o=this._prepareScope(t);return o.rowData=n,"string"!=typeof e&&(e=N.themeColors.level),this._blink(o,i,e,ei.getOppositeColor(e)),!0},ei.prototype._blink=function(t,e,n,i){return ei._clearBlinkTimer(t),t.blinkTimer=setTimeout(t._restorer,this._blinkingDuration),this._blinkCondition.border?(e.style.border="1px solid "+n,!1):(e.style.backgroundColor=n,e.style.color=i,!0)},ei.prototype.blinkCell=function(t,e,n,i){if(!this._blinkCondition)return!1;let o=this._blinkCondition._fn(e,n);return this.blink(t,o,i)},ei.prototype.calcBlinkSignal=function(t,e){return this._blinkCondition?this._blinkCondition._fn(t,e):0},ei.prototype.verifyBlinking=function(t,e){let n=t.blinking;n&&n.blinkTimer&&n.rowData!==e&&(n.rowData=e,ei._clearBlinkTimer(n)&&n._restorer())},ei.prototype.disableLevelColor=function(t){},ei.prototype.setBlinkingDuration=function(t){"number"==typeof t&&(this._blinkingDuration=t)},window){var ii=window.tr;ii||(ii=window.tr={});var oi=ii.rt;oi||(oi=ii.rt={});var ri=ii.grid;ri||(ri=ii.grid={}),ii.MockJET||(ii.MockJET=qn),ii.closestElement||(ii.closestElement=t.closestElement),ii.CellPainter||(ii.CellPainter=ei),oi.Grid||(oi.Grid=pn),ri.CellPainter||(ri.CellPainter=ei)}})();
|