@syncfusion/ej2-pivotview 28.1.36 → 28.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* filename: ej2-pivotview.min.js
|
|
3
|
+
* version : 28.1.37
|
|
4
|
+
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
|
|
5
|
+
* Use of this code is subject to the terms of our license.
|
|
6
|
+
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
|
+
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
|
+
* applicable laws.
|
|
9
|
+
*/
|
|
1
10
|
this.ej=this.ej||{},this.ej.pivotview=function(e,t,i,a,r,n,o,s,l,d,p,h,u,c,g,m){"use strict";var f=function(){function e(){}return e.getType=function(e){var t=new Date(e);return"boolean"==typeof e?"boolean":isNaN(Number(e))?t instanceof Date&&!isNaN(t.valueOf())?t&&t.getDay()&&(t.getHours()>0||t.getMinutes()>0||t.getSeconds()>0||t.getMilliseconds()>0)?"datetime":"date":typeof e:"number"},e.resetTime=function(e){return e.setHours(0,0,0,0),e},e.getClonedData=function(e){var t=[];if(e)for(var i=0,a=e;i<a.length;i++){for(var r=a[i],n=Object.keys(r),o=0,s={};o<n.length;)s[n[o]]=r[n[o]],o++;t.push(s)}return t},e.getClonedCSVData=function(e){return e.map(function(e){return e.slice()})},e.getDefinedObj=function(e){var t=0,i={};if(null!==e&&void 0!==e)for(var a=Object.keys(e);t<a.length;)null!==e[a[t]]&&void 0!==e[a[t]]&&(i[a[t]]=e[a[t]]),t++;else i=e;return i},e.inArray=function(e,t){if(t)for(var i=0,a=t.length;i<a;i++)if(t[i]===e)return i;return-1},e.setPivotProperties=function(e,t){e.allowServerDataBinding=!1,e.pivotGridModule&&(e.pivotGridModule.allowServerDataBinding=!1),e.setProperties(t,!0),e.allowServerDataBinding=!0,e.pivotGridModule&&(e.pivotGridModule.allowServerDataBinding=!0)},e.getClonedDataSourceSettings=function(e){return this.getDefinedObj({type:e.type,catalog:e.catalog,cube:e.cube,providerType:e.providerType,url:e.url,localeIdentifier:e.localeIdentifier,excludeFields:t.isNullOrUndefined(e.excludeFields)?[]:e.excludeFields.slice(),expandAll:e.expandAll,allowLabelFilter:e.allowLabelFilter,allowValueFilter:e.allowValueFilter,allowMemberFilter:e.allowMemberFilter,enableSorting:!!e.enableSorting,rows:this.cloneFieldSettings(e.rows),columns:this.cloneFieldSettings(e.columns),filters:this.cloneFieldSettings(e.filters),values:this.cloneFieldSettings(e.values),filterSettings:this.cloneFilterSettings(e.filterSettings),sortSettings:this.cloneSortSettings(e.sortSettings),drilledMembers:this.cloneDrillMemberSettings(e.drilledMembers),valueSortSettings:this.CloneValueSortObject(e.valueSortSettings),valueAxis:e.valueAxis,valueIndex:e.valueIndex,grandTotalsPosition:e.grandTotalsPosition,formatSettings:this.cloneFormatSettings(e.formatSettings),calculatedFieldSettings:this.cloneCalculatedFieldSettings(e.calculatedFieldSettings),fieldMapping:this.cloneFieldSettings(e.fieldMapping),showSubTotals:e.showSubTotals,showRowSubTotals:e.showRowSubTotals,showColumnSubTotals:e.showColumnSubTotals,subTotalsPosition:e.subTotalsPosition,showGrandTotals:e.showGrandTotals,showRowGrandTotals:e.showRowGrandTotals,showColumnGrandTotals:e.showColumnGrandTotals,showHeaderWhenEmpty:e.showHeaderWhenEmpty,alwaysShowValueHeader:e.alwaysShowValueHeader,conditionalFormatSettings:this.cloneConditionalFormattingSettings(e.conditionalFormatSettings),emptyCellsTextContent:e.emptyCellsTextContent,groupSettings:this.cloneGroupSettings(e.groupSettings),showAggregationOnValueField:e.showAggregationOnValueField,authentication:this.CloneAuthenticationObject(e.authentication)})},e.getClonedFieldList=function(e){for(var t=Object.keys(e),i={},a=0,r=t.length;a<r;a++){var n=e[t[a]];e[t[a]]&&(i[t[a]]={type:n.type,caption:n.caption,id:n.id,isSelected:n.isSelected,sort:n.sort,filterType:n.filterType,index:n.index,filter:n.filter,isCustomField:n.isCustomField,showRemoveIcon:n.showRemoveIcon,showFilterIcon:n.showFilterIcon,showSortIcon:n.showSortIcon,showNoDataItems:n.showNoDataItems,isCalculatedField:n.isCalculatedField,showEditIcon:n.showEditIcon,showValueTypeIcon:n.showValueTypeIcon,allowDragAndDrop:n.allowDragAndDrop,showSubTotals:n.showSubTotals,expandAll:n.expandAll,pid:n.pid,aggregateType:n.aggregateType,baseField:n.baseField,baseItem:n.baseItem,dateMember:this.cloneDateMembers(n.dateMember),members:this.cloneFormatMembers(n.members),formatString:n.formatString,format:n.format,formula:n.formula,isExcelFilter:n.isExcelFilter,membersOrder:n.membersOrder?n.membersOrder.slice():n.membersOrder,isAlphanumeric:n.isAlphanumeric,tag:n.tag,expanded:n.expanded,spriteCssClass:n.spriteCssClass,name:n.name,defaultHierarchy:n.defaultHierarchy,hasAllMember:n.hasAllMember,allMember:n.allMember,isChecked:n.isChecked,filterMembers:this.cloneFieldMembers(n.filterMembers),childMembers:this.cloneFieldMembers(n.childMembers),searchMembers:this.cloneFieldMembers(n.searchMembers),htmlAttributes:this.getDefinedObj(n.htmlAttributes),currrentMembers:this.cloneFormatMembers(n.currrentMembers),isHierarchy:n.isHierarchy,isNamedSets:n.isNamedSets,actualFilter:n.actualFilter?n.actualFilter.slice():n.actualFilter,levels:this.cloneFieldMembers(n.levels),levelCount:n.levelCount,fieldType:n.fieldType,memberType:n.memberType,parentHierarchy:n.parentHierarchy})}return i},e.cloneDateMembers=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push({formattedText:r.formattedText,actualText:r.actualText})}return t}return e},e.cloneFormatMembers=function(e){if(e){for(var t=Object.keys(e),i={},a=0,r=t.length;a<r;a++){var n=e[t[a]];i[t[a]]={index:n.index?n.index.slice():n.index,isDrilled:n.isDrilled,ordinal:n.ordinal}}return i}return e},e.cloneFieldMembers=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push({caption:r.caption,hasChildren:r.hasChildren,id:r.id,isSelected:r.isSelected,name:r.name,tag:r.tag,htmlAttributes:this.getDefinedObj(r.htmlAttributes),type:r.type,spriteCssClass:r.spriteCssClass,pid:r.pid,isChecked:r.isChecked})}return t}return e},e.updateDataSourceSettings=function(e,i){e&&this.setPivotProperties(e,{dataSourceSettings:this.getDefinedObj({type:i.type,catalog:i.catalog,cube:i.cube,providerType:i.providerType,url:i.url,localeIdentifier:i.localeIdentifier,excludeFields:t.isNullOrUndefined(i.excludeFields)?[]:i.excludeFields,expandAll:i.expandAll,allowLabelFilter:i.allowLabelFilter,allowValueFilter:i.allowValueFilter,allowMemberFilter:i.allowMemberFilter,enableSorting:!!i.enableSorting,rows:i.rows,columns:i.columns,filters:i.filters,values:i.values,filterSettings:i.filterSettings,sortSettings:i.sortSettings,drilledMembers:i.drilledMembers,valueSortSettings:i.valueSortSettings,valueAxis:i.valueAxis,grandTotalsPosition:i.grandTotalsPosition,formatSettings:i.formatSettings,calculatedFieldSettings:i.calculatedFieldSettings,fieldMapping:i.fieldMapping,showSubTotals:i.showSubTotals,showRowSubTotals:i.showRowSubTotals,showColumnSubTotals:i.showColumnSubTotals,subTotalsPosition:i.subTotalsPosition,showGrandTotals:i.showGrandTotals,showRowGrandTotals:i.showRowGrandTotals,showColumnGrandTotals:i.showColumnGrandTotals,showHeaderWhenEmpty:i.showHeaderWhenEmpty,alwaysShowValueHeader:i.alwaysShowValueHeader,conditionalFormatSettings:i.conditionalFormatSettings,emptyCellsTextContent:i.emptyCellsTextContent,groupSettings:i.groupSettings,showAggregationOnValueField:i.showAggregationOnValueField,authentication:this.CloneAuthenticationObject(i.authentication)})})},e.cloneFieldSettings=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({name:r.name,caption:r.caption,axis:r.axis,baseField:r.baseField,baseItem:r.baseItem,isCalculatedField:r.isCalculatedField,isNamedSet:r.isNamedSet,showNoDataItems:r.showNoDataItems,showSubTotals:r.showSubTotals,type:r.type,dataType:r.dataType,showFilterIcon:r.showFilterIcon,showSortIcon:r.showSortIcon,showRemoveIcon:r.showRemoveIcon,showValueTypeIcon:r.showValueTypeIcon,showEditIcon:r.showEditIcon,allowDragAndDrop:r.allowDragAndDrop,expandAll:r.expandAll,groupName:r.groupName}))}return t}return e},e.cloneOlapFieldSettings=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({caption:r.caption,hasChildren:r.hasChildren,id:r.id,isSelected:r.isSelected,name:r.name,spriteCssClass:r.spriteCssClass,tag:r.tag,type:r.type,pid:r.pid,expanded:r.expanded,defaultHierarchy:r.defaultHierarchy,hasAllMember:r.hasAllMember,allMember:r.allMember,isChecked:r.isChecked,filterMembers:r.filterMembers,childMembers:r.childMembers,searchMembers:r.searchMembers,htmlAttributes:this.getDefinedObj(r.htmlAttributes),currrentMembers:r.currrentMembers,isHierarchy:r.isHierarchy,isNamedSets:r.isNamedSets,formatString:r.formatString,actualFilter:r.actualFilter,levels:r.levels,levelCount:r.levelCount,memberType:r.memberType,fieldType:r.fieldType,parentHierarchy:r.parentHierarchy}))}return t}return e},e.cloneFilterSettings=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({name:r.name,type:r.type,condition:r.condition,items:r.items?r.items.slice():r.items,levelCount:r.levelCount,measure:r.measure,selectedField:r.selectedField,showDateFilter:r.showDateFilter,showLabelFilter:r.showLabelFilter,showNumberFilter:r.showNumberFilter,value1:r.value1,value2:r.value2}))}return t}return e},e.cloneSortSettings=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({name:r.name,order:r.order,membersOrder:r.membersOrder?r.membersOrder.slice():r.membersOrder}))}return t}return e},e.getFormattedHeader=function(t,i){var a=e.frameHeaderWithKeys(t);if(a.valueSort&&a.valueSort.axis){var r=a.valueSort.axis,n=this.isDateField(r,i);a.formattedText=n||!i.formatFields[r]||!0===t.isSum?a.formattedText:i.getFormattedValue(a.actualText,r).formattedText}return a},e.getFormattedMembers=function(e,t,i){var a=this.isDateField(t,i);if(a||i.groupingFields[t]){for(var r={},n=Object.keys(e),o=i.fieldList[t].dateMember,s=0,l=n.length;s<l;s++){var d=e[n[s]];a?r[d.caption]=d:r[o[d.ordinal-1].actualText]=d}return r}return e},e.isDateField=function(e,t){return t.formatFields[e]&&["date","dateTime","time"].indexOf(t.formatFields[e].type)>-1},e.formatChartHeaders=function(e,i,a){for(var r=[],n=0,o=e.length;n<o;n++){var s=a?i.parent.dataSourceSettings.columns.length>0&&!t.isNullOrUndefined(i.parent.dataSourceSettings.columns[n])?i.parent.dataSourceSettings.columns[n].name:void 0:i.parent.dataSourceSettings.rows.length>0&&!t.isNullOrUndefined(i.parent.dataSourceSettings.rows[n])?i.parent.dataSourceSettings.rows[n].name:void 0;t.isNullOrUndefined(s)?r.push(e[n]):i.engineModule.formatFields[s]&&["date","dateTime","time"].indexOf(i.engineModule.formatFields[s].type)>-1?r.push(e[n]):r.push(i.engineModule.getFormattedValue(e[n],s).formattedText)}return r.join(" - ")},e.cloneDrillMemberSettings=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({name:r.name,delimiter:r.delimiter,items:r.items?r.items.slice():r.items}))}return t}return e},e.cloneFormatSettings=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({name:r.name,calendar:r.calendar,currency:r.currency,format:r.format,maximumFractionDigits:r.maximumFractionDigits,maximumSignificantDigits:r.maximumSignificantDigits,minimumFractionDigits:r.minimumFractionDigits,minimumIntegerDigits:r.minimumIntegerDigits,minimumSignificantDigits:r.minimumSignificantDigits,skeleton:r.skeleton,type:r.type,useGrouping:r.useGrouping}))}return t}return e},e.CloneValueSortObject=function(e){return e?{columnIndex:e.columnIndex,headerDelimiter:e.headerDelimiter,headerText:e.headerText,measure:e.measure,sortOrder:e.sortOrder}:e},e.CloneAuthenticationObject=function(e){return e?{userName:e.userName,password:e.password}:e},e.cloneCalculatedFieldSettings=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({name:r.name,formatString:r.formatString,formula:r.formula,hierarchyUniqueName:r.hierarchyUniqueName}))}return t}return e},e.cloneConditionalFormattingSettings=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({applyGrandTotals:r.applyGrandTotals,conditions:r.conditions,label:r.label,measure:r.measure,style:r.style?{backgroundColor:r.style.backgroundColor,color:r.style.color,fontFamily:r.style.fontFamily,fontSize:r.style.fontSize}:r.style,value1:r.value1,value2:r.value2}))}return t}return e},e.cloneGroupSettings=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({name:r.name,caption:r.caption,customGroups:this.cloneCustomGroups(r.customGroups),endingAt:r.endingAt,startingAt:r.startingAt,groupInterval:r.groupInterval,rangeInterval:r.rangeInterval,type:r.type}))}return t}return e},e.cloneCustomGroups=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({groupName:r.groupName,items:r.items?r.items.slice():r.items}))}return t}return e},e.getFilterItemByName=function(e,t){var a=new i.DataManager({json:t}).executeLocal((new i.Query).where("name","equal",e));if(a&&a.length>0)return a[a.length-1]},e.getFieldByName=function(e,t){return new i.DataManager({json:t}).executeLocal((new i.Query).where("name","equal",e))[0]},e.getFieldInfo=function(e,t,i){if(!i)for(var a=[this.cloneFieldSettings(t.dataSourceSettings.rows),this.cloneFieldSettings(t.dataSourceSettings.columns),this.cloneFieldSettings(t.dataSourceSettings.values),this.cloneFieldSettings(t.dataSourceSettings.filters)],r=0,n=a.length;r<n;r++)for(var o=0,s=a[r]?a[r].length:0;o<s;o++)if(a[r][o]&&a[r][o].name===e)return{fieldName:e,fieldItem:a[r][o],axis:0===r?"rows":1===r?"columns":2===r?"values":"filters",position:o};var l="olap"===t.dataType?t.olapEngineModule.fieldList[e]:t.engineModule.fieldList[e];return{fieldName:e,fieldItem:l?{name:e,caption:l.caption,baseField:l.baseField,baseItem:l.baseItem,isCalculatedField:l.isCalculatedField,isNamedSet:l.isNamedSets,showNoDataItems:l.showNoDataItems,showSubTotals:l.showSubTotals,type:l.aggregateType,showFilterIcon:l.showFilterIcon,showSortIcon:l.showSortIcon,showRemoveIcon:l.showRemoveIcon,showValueTypeIcon:l.showValueTypeIcon,showEditIcon:l.showEditIcon,allowDragAndDrop:l.allowDragAndDrop,expandAll:l.expandAll}:void 0,axis:"fieldlist",position:-1}},e.isButtonIconRefesh=function(e,i,a){var r=!1;try{if("dataSourceSettings"===e&&i.dataSourceSettings&&a.dataSourceSettings){var n=["notAvail","notAvail","notAvail","notAvail"],o=Object.keys(i.dataSourceSettings),s=Object.keys(a.dataSourceSettings);if(o&&s&&s.length>0&&o.length===s.length)for(var l=["rows","columns","values","filters"],d=0;d<s.length;d++){var p=s[d]in i.dataSourceSettings&&!t.isNullOrUndefined(i.dataSourceSettings[s[d]])?Object.keys(i.dataSourceSettings[s[d]]):[],h=s[d]in a.dataSourceSettings&&!t.isNullOrUndefined(a.dataSourceSettings[s[d]])?Object.keys(a.dataSourceSettings[s[d]]):[];if(-1!==l.indexOf(s[d])&&-1!==l.indexOf(o[d])&&p&&h&&h.length>0&&p.length===h.length)for(var u=["showFilterIcon","showSortIcon","showRemoveIcon","showValueTypeIcon","showEditIcon","allowDragAndDrop","expandAll"],c=0;c<h.length;c++){for(var g=Object.keys(i.dataSourceSettings[s[d]][h[c]]),m=Object.keys(a.dataSourceSettings[s[d]][h[c]]),f=0;f<m.length;f++){if(-1===u.indexOf(m[f])||-1===u.indexOf(g[f])){n[d]="break";break}n[d]="update"}if("break"===n[d])break}else n[d]="break";if("break"===n[d])break}for(var v=0,S=0,y=0,b=0,C=n;b<C.length;b++){var x=C[b];"break"===x&&v++,"notAvail"===x&&S++,"update"===x&&y++}r=!(v>0||4===S)&&(0===v&&S<4&&y>0)}}catch(e){r=!1}return r},e.formatPivotValues=function(e){for(var t=[],i=0;i<e.length;i++)if(e[i]){t[i]=[];for(var a=0;a<e[i].length;a++)e[i][a]&&(t[i][a]={axis:e[i][a].Axis,actualText:e[i][a].ActualText,indexObject:e[i][a].IndexObject,index:e[i][a].Index,rowHeaders:e[i][a].RowHeaders,columnHeaders:e[i][a].ColumnHeaders,formattedText:e[i][a].FormattedText,actualValue:e[i][a].ActualValue,rowIndex:e[i][a].RowIndex,colIndex:e[i][a].ColIndex,colSpan:e[i][a].ColSpan,level:e[i][a].Level,rowSpan:e[i][a].RowSpan,isSum:e[i][a].IsSum,isGrandSum:e[i][a].IsGrandSum,valueSort:e[i][a].ValueSort,ordinal:e[i][a].Ordinal,hasChild:e[i][a].HasChild,isDrilled:e[i][a].IsDrilled,value:e[i][a].Value,type:e[i][a].Type,members:e[i][a].Members})}return t},e.formatFieldList=function(e){for(var t=Object.keys(e),i={},a=0;a<t.length;a++)e[t[a]]&&(i[t[a]]={id:e[t[a]].Id,caption:e[t[a]].Caption,type:e[t[a]].Type,formatString:e[t[a]].FormatString,index:e[t[a]].Index,members:e[t[a]].Members,formattedMembers:e[t[a]].FormattedMembers,dateMember:e[t[a]].DateMember,filter:e[t[a]].Filter,sort:e[t[a]].Sort,aggregateType:e[t[a]].AggregateType,baseField:e[t[a]].BaseField,baseItem:e[t[a]].BaseItem,filterType:e[t[a]].FilterType,format:e[t[a]].Format,formula:e[t[a]].Formula,isSelected:e[t[a]].IsSelected,isExcelFilter:e[t[a]].IsExcelFilter,showNoDataItems:e[t[a]].ShowNoDataItems,isCustomField:e[t[a]].IsCustomField,showFilterIcon:e[t[a]].ShowFilterIcon,showSortIcon:e[t[a]].ShowSortIcon,showRemoveIcon:e[t[a]].ShowRemoveIcon,showEditIcon:e[t[a]].ShowEditIcon,showValueTypeIcon:e[t[a]].ShowValueTypeIcon,allowDragAndDrop:e[t[a]].AllowDragAndDrop,isCalculatedField:e[t[a]].IsCalculatedField,showSubTotals:e[t[a]].ShowSubTotals,expandAll:e[t[a]].expandAll,groupName:e[t[a]].groupName});return i},e.frameContent=function(e,t,i,a){var r=[],n=a;if(n.dataSourceSettings.values.length>0&&!n.engineModule.isEmptyData&&(n.enableValueSorting||!n.engineModule.isEngineUpdated))for(var o=0,s="value"===t?i:0,l="value"===t?e.length:i,d=s;d<l;d++)if(e[d]){r[o="header"===t?d:o]={};for(var p=0;p<e[d].length;p++)e[d][p]&&(r[o][p]=e[d][p]);o++}return r},e.getLocalizedObject=function(e){var t={};return t.Null=e.localeObj.getConstant("null"),t.Years=e.localeObj.getConstant("Years"),t.Quarters=e.localeObj.getConstant("Quarters"),t.Months=e.localeObj.getConstant("Months"),t.Days=e.localeObj.getConstant("Days"),t.Hours=e.localeObj.getConstant("Hours"),t.Minutes=e.localeObj.getConstant("Minutes"),t.Seconds=e.localeObj.getConstant("Seconds"),t.QuarterYear=e.localeObj.getConstant("QuarterYear"),t.Of=e.localeObj.getConstant("of"),t.Qtr=e.localeObj.getConstant("qtr"),t.Undefined=e.localeObj.getConstant("undefined"),t.GroupOutOfRange=e.localeObj.getConstant("groupOutOfRange"),t.Group=e.localeObj.getConstant("group"),t},e.updateReport=function(e,t){e.setProperties({dataSourceSettings:{rows:[]}},!0),e.setProperties({dataSourceSettings:{columns:[]}},!0),e.setProperties({dataSourceSettings:{formatSettings:[]}},!0);for(i=0;i<t.Rows.length;i++)e.dataSourceSettings.rows.push({name:t.Rows[i].Name,caption:t.Rows[i].Caption,showNoDataItems:t.Rows[i].ShowNoDataItems,baseField:t.Rows[i].BaseField,baseItem:t.Rows[i].BaseItem,showFilterIcon:t.Rows[i].ShowFilterIcon,showSortIcon:t.Rows[i].ShowSortIcon,showEditIcon:t.Rows[i].ShowEditIcon,showRemoveIcon:t.Rows[i].ShowRemoveIcon,showSubTotals:t.Rows[i].ShowValueTypeIcon,allowDragAndDrop:t.Rows[i].AllowDragAndDrop,axis:t.Rows[i].Axis,dataType:t.Rows[i].DataType,isCalculatedField:t.Rows[i].IsCalculatedField,showValueTypeIcon:t.Rows[i].ShowValueTypeIcon,type:t.Rows[i].Type,expandAll:t.Rows[i].expandAll});for(i=0;i<t.Columns.length;i++)e.dataSourceSettings.columns.push({name:t.Columns[i].Name,caption:t.Columns[i].Caption,showNoDataItems:t.Columns[i].ShowNoDataItems,baseField:t.Columns[i].BaseField,baseItem:t.Columns[i].BaseItem,showFilterIcon:t.Columns[i].ShowFilterIcon,showSortIcon:t.Columns[i].ShowSortIcon,showEditIcon:t.Columns[i].ShowEditIcon,showRemoveIcon:t.Columns[i].ShowRemoveIcon,showSubTotals:t.Columns[i].ShowValueTypeIcon,allowDragAndDrop:t.Columns[i].AllowDragAndDrop,axis:t.Columns[i].Axis,dataType:t.Columns[i].DataType,isCalculatedField:t.Columns[i].IsCalculatedField,showValueTypeIcon:t.Columns[i].ShowValueTypeIcon,type:t.Columns[i].Type,expandAll:t.Columns[i].expandAll});for(var i=0;i<t.FormatSettings.length;i++)e.dataSourceSettings.formatSettings.push({name:t.FormatSettings[i].Name,format:t.FormatSettings[i].Format,type:t.FormatSettings[i].Type,currency:t.FormatSettings[i].Currency,maximumFractionDigits:t.FormatSettings[i].MaximumFractionDigits,maximumSignificantDigits:t.FormatSettings[i].MaximumSignificantDigits,minimumFractionDigits:t.FormatSettings[i].MinimumFractionDigits,minimumIntegerDigits:t.FormatSettings[i].MinimumIntegerDigits,minimumSignificantDigits:t.FormatSettings[i].MinimumSignificantDigits,skeleton:t.FormatSettings[i].Skeleton,useGrouping:t.FormatSettings[i].UseGrouping})},e.generateUUID=function(){var e=(new Date).getTime(),t=performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var a=16*Math.random();return e>0?(a=(e+a)%16|0,e=Math.floor(e/16)):(a=(t+a)%16|0,t=Math.floor(t/16)),("x"===i?a:3&a|8).toString(16)})},e.applyCustomSort=function(e,t,i,a,r){var n,o=[];o=e.IsOrderChanged?e.members:"Ascending"===e.sortOrder||"None"===e.sortOrder||void 0===e.sortOrder?[].concat(e.members):[].concat(e.members).reverse();var s=[],l=void 0===i||"string"===i||"number"===i;"Grand Total"===t[0].actualText&&(n=t[0],t.shift());for(var d=0,p=0;d<t.length;d++){var h=t[d],u=r?h.formattedText:l?h.actualText:!0===i?h.actualText.toString():h.dateText;if(o[p]===u){if(t.splice(p++,0,h),t.splice(++d,1),!(p<o.length)){a||s.splice(--p,0,u);break}d=-1}d>=0&&!a&&(s[d]=u)}if(!a){for(d=s.length;d<t.length;d++){var h=t[d],u=r?h.formattedText:l?h.actualText:!0===i?h.actualText.toString():h.dateText;s[d]=u}"Grand Total"===s[s.length-1]&&s.pop(),e.members=s}return n&&t.splice(0,0,n),t},e.applyHeadersSort=function(e,t,i,a){return e=a?e.sort(function(e,i){var a=e.actualText,r=i.actualText;return"Grand Total"===a||"Grand Total"===r?0:"Out of Range"===a?1:"Out of Range"===r?-1:isNaN(parseFloat(a))||isNaN(parseFloat(r))?"Ascending"===t?a.localeCompare(r,void 0,{numeric:!0,sensitivity:"base"}):r.localeCompare(a,void 0,{numeric:!0,sensitivity:"base"}):"Ascending"===t?parseFloat(a)-parseFloat(r):parseFloat(r)-parseFloat(a)}):"datetime"===i||"date"===i||"time"===i?"Ascending"===t?e.sort(function(e,t){return"Out of Range"===e.dateText?1:"Out of Range"===t.dateText?-1:e.dateText>t.dateText?1:e.dateText<t.dateText?-1:0}):"Descending"===t?e.sort(function(e,t){return"Out of Range"===e.dateText?1:"Out of Range"===t.dateText?-1:e.dateText<t.dateText?1:e.dateText>t.dateText?-1:0}):e:!0===i?"Ascending"===t?e.sort(function(e,t){return"Grand Total"===e.actualText||"Grand Total"===t.actualText?0:"Out of Range"===e.actualText?1:"Out of Range"===t.actualText?-1:Number(e.actualText.toString().match(/\d+/))>Number(t.actualText.toString().match(/\d+/))?1:Number(t.actualText.toString().match(/\d+/))>Number(e.actualText.toString().match(/\d+/))?-1:0}):"Descending"===t?e.sort(function(e,t){return"Grand Total"===e.actualText||"Grand Total"===t.actualText?0:"Out of Range"===e.actualText?-1:"Out of Range"===t.actualText?1:Number(e.actualText.toString().match(/\d+/))<Number(t.actualText.toString().match(/\d+/))?1:Number(t.actualText.toString().match(/\d+/))<Number(e.actualText.toString().match(/\d+/))?-1:0}):e:"Ascending"===t?e.sort(function(e,t){return"Grand Total"===e.actualText||"Grand Total"===t.actualText?0:e.actualText>t.actualText?1:t.actualText>e.actualText?-1:0}):"Descending"===t?e.sort(function(e,t){return"Grand Total"===e.actualText||"Grand Total"===t.actualText?0:e.actualText<t.actualText?1:t.actualText<e.actualText?-1:0}):e},e.renderOlapEngine=function(e,t){try{e.olapEngineModule.renderEngine(e.dataSourceSettings,t||e.frameCustomProperties(e.olapEngineModule.fieldListData,e.olapEngineModule.fieldList),e.onHeadersSort?e.getHeaderSortInfo.bind(e):void 0),e.setProperties({dataSourceSettings:{valueIndex:e.olapEngineModule.measureIndex}},!0)}catch(t){e.actionObj.actionName="engineFormation",e.olapEngineModule.errorInfo?(e.actionFailureMethod(e.olapEngineModule.errorInfo),e.olapEngineModule.errorInfo=void 0):e.actionFailureMethod(t)}},e.frameHeaderWithKeys=function(e){for(var t=Object.keys(e),i=0,a={};i<t.length;)a[t[i]]=e[t[i]],i++;return a},e.getPageSize=function(e){switch(e){case"Letter":return new a.SizeF(612,792);case"Note":return new a.SizeF(540,720);case"Legal":return new a.SizeF(612,1008);case"A0":return new a.SizeF(2380,3368);case"A1":return new a.SizeF(1684,2380);case"A2":return new a.SizeF(1190,1684);case"A3":return new a.SizeF(842,1190);case"A5":return new a.SizeF(421,595);case"A6":return new a.SizeF(297,421);case"A7":return new a.SizeF(210,297);case"A8":return new a.SizeF(148,210);case"A9":return new a.SizeF(105,148);case"B0":return new a.SizeF(2836,4008);case"B1":return new a.SizeF(2004,2836);case"B2":return new a.SizeF(1418,2004);case"B3":return new a.SizeF(1002,1418);case"B4":return new a.SizeF(709,1002);case"B5":return new a.SizeF(501,709);case"Archa":return new a.SizeF(648,864);case"Archb":return new a.SizeF(864,1296);case"Archc":return new a.SizeF(1296,1728);case"Archd":return new a.SizeF(1728,2592);case"Arche":return new a.SizeF(2592,3456);case"Flsa":return new a.SizeF(612,936);case"HalfLetter":return new a.SizeF(396,612);case"Letter11x17":return new a.SizeF(792,1224);case"Ledger":return new a.SizeF(1224,792);default:return new a.SizeF(595,842)}},e.getSortedValue=function(e,t){return e.sort(function(e,i){return"Descending"===t?(i.value||"grand sum"===i.header.type?i.value:0)-(e.value||"grand sum"===e.header.type?e.value:0):(e.value||"grand sum"===e.header.type?e.value:0)-(i.value||"grand sum"===i.header.type?i.value:0)}),e.map(function(e){return e.header})},e}(),v=function(){return(v=Object.assign||function(e){for(var t,i=1,a=arguments.length;i<a;i++){t=arguments[i];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},S=function(){function e(){this.aggregatedValueMatrix=[],this.valueContent=[],this.formatFields={},this.groupingFieldsInfo={},this.dateFormatFunction={},this.calculatedFields={},this.calculatedFormulas={},this.valueAxis=0,this.saveDataHeaders={},this.columnCount=0,this.rowCount=0,this.columnPageCount=0,this.rowPageCount=0,this.colFirstLvl=0,this.rowFirstLvl=0,this.rowStartPos=0,this.colStartPos=0,this.enableValueSorting=!1,this.headerCollection={rowHeaders:[],columnHeaders:[],rowHeadersCount:0,columnHeadersCount:0},this.rMembers=[],this.cMembers=[],this.groupingFields={},this.isLastHeaderHasMeasures=!0,this.measureIndex=-1,this.isPagingOrVirtualizationEnabled=!1,this.rowMaxLevel=0,this.valueMatrix=[],this.memberCnt=-1,this.pageInLimit=!1,this.endPos=0,this.removeCount=0,this.colHdrBufferCalculated=!1,this.colValuesLength=1,this.rowValuesLength=1,this.slicedHeaders=[],this.fieldFilterMem={},this.filterPosObj={},this.selectedHeaders={selectedHeader:[],values:[]},this.rowGrandTotal=null,this.columnGrandTotal=null,this.removeRowGrandTotal=!1,this.removeColumnGrandTotal=!1,this.isValueHasAdvancedAggregate=!1,this.rawIndexObject={},this.reformAxisCount=0,this.isEditing=!1,this.valueAxisFields={},this.data=[],this.actualData=[],this.groupRawIndex={},this.fieldKeys={},this.allowDataCompression=!1,this.dataSourceSettings={},this.frameHeaderObjectsCollection=!1,this.headerObjectsCollection={},this.columnKeys={},this.fieldDrillCollection={},this.formatRegex=/^(?:[ncpae])(?:([0-9]|1[0-9]|20))?$/i,this.measureNames={},this.enablePaging=!1,this.enableVirtualization=!1,this.enableHtmlSanitizer=!1,this.enableOptimizedRendering=!1,this.groupedDataType={},this.emptyRowsLength=0,this.tabularPivotValues=[]}return e.prototype.clearProperties=function(e){this.isPagingOrVirtualizationEnabled||e||(this.columnKeys={},this.headerCollection={rowHeaders:[],columnHeaders:[],rowHeadersCount:0,columnHeadersCount:0}),this.enableValueSorting&&(this.valueContent=[]),this.saveDataHeaders=this.allowValueFilter?this.saveDataHeaders:{},this.rMembers=[],this.cMembers=[],this.slicedHeaders=[],this.fieldFilterMem={},this.filterPosObj={},this.selectedHeaders={selectedHeader:[],values:[]},this.rowGrandTotal=null,this.columnGrandTotal=null,this.rawIndexObject={},this.dataSourceSettings.valueIndex>-1&&(this.valueAxisFields={}),this.headerObjectsCollection={},this.fieldDrillCollection={}},e.prototype.renderEngine=function(e,a,r,n){if(this.getValueCellInfo=r,this.getHeaderSortInfo=n,this.customProperties=a,this.fieldList)for(var o=0,s=e.formatSettings;o<s.length;o++)!this.formatFields[s[o].name]&&this.fieldList[s[o].name]&&(this.fieldList[s[o].name].members={},this.fieldList[s[o].name].formattedMembers={},this.fieldList[s[o].name].dateMember=[]);this.formatFields={},this.dateFormatFunction={},this.calculatedFields={},this.calculatedFormulas={},this.valueAxis=0,this.saveDataHeaders={},this.columnCount=0,this.rowCount=0,this.columnPageCount=0,this.rowPageCount=0,this.colFirstLvl=0,this.rowFirstLvl=0,this.rowStartPos=0,this.colStartPos=0,this.dataSourceSettings.excludeFields=t.isNullOrUndefined(e.excludeFields)?[]:e.excludeFields,this.enableValueSorting=!1,this.headerCollection={rowHeaders:[],columnHeaders:[],rowHeadersCount:0,columnHeadersCount:0},this.aggregatedValueMatrix=[],this.rMembers=[],this.cMembers=[],this.memberCnt=-1,this.pageInLimit=!1,this.endPos=0,this.removeCount=0,this.colHdrBufferCalculated=!1,this.colValuesLength=1,this.rowValuesLength=1,this.slicedHeaders=[],this.fieldFilterMem={},this.filterPosObj={},this.selectedHeaders={selectedHeader:[],values:[]},this.rowGrandTotal=null,this.columnGrandTotal=null,this.removeRowGrandTotal=!1,this.removeColumnGrandTotal=!1,this.isValueHasAdvancedAggregate=!1,this.rawIndexObject={},this.isLastHeaderHasMeasures=!0,this.isEditing=!1;var l;if(this.globalize=a&&a.globalize?a.globalize:new t.Internationalization,this.currencyCode=a&&a.currenyCode?a.currenyCode:void 0,this.localeObj=a?a.localeObj:void 0,this.fieldsType=a?a.fieldsType:{},this.clonedReport=a?a.clonedReport&&a.clonedReport.properties?a.clonedReport.properties:a.clonedReport:{},this.enablePaging=a.enablePaging,this.enableVirtualization=a.enableVirtualization,this.enableOptimizedRendering=a.enableOptimizedRendering,this.enableHtmlSanitizer=a.enableHtmlSanitizer,this.isPagingOrVirtualizationEnabled=this.enablePaging||this.enableVirtualization,this.enableSort=e.enableSorting,this.dataSourceSettings.alwaysShowValueHeader=e.alwaysShowValueHeader,this.dataSourceSettings.showHeaderWhenEmpty=!!t.isNullOrUndefined(e.showHeaderWhenEmpty)||e.showHeaderWhenEmpty,this.dataSourceSettings.showSubTotals=!!t.isNullOrUndefined(e.showSubTotals)||e.showSubTotals,this.dataSourceSettings.showRowSubTotals=!!t.isNullOrUndefined(e.showRowSubTotals)||e.showRowSubTotals,this.dataSourceSettings.showColumnSubTotals=!!t.isNullOrUndefined(e.showColumnSubTotals)||e.showColumnSubTotals,this.dataSourceSettings.showGrandTotals=!!t.isNullOrUndefined(e.showGrandTotals)||e.showGrandTotals,this.dataSourceSettings.grandTotalsPosition=t.isNullOrUndefined(e.grandTotalsPosition)?"Bottom":e.grandTotalsPosition,this.dataSourceSettings.showRowGrandTotals=!!t.isNullOrUndefined(e.showRowGrandTotals)||e.showRowGrandTotals,this.dataSourceSettings.showColumnGrandTotals=!!t.isNullOrUndefined(e.showColumnGrandTotals)||e.showColumnGrandTotals,this.showSubTotalsAtTop=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&"Top"===e.subTotalsPosition&&!a.isTabularLayout,this.showSubTotalsAtBottom=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals&&"Bottom"===e.subTotalsPosition||a.isTabularLayout,this.allowValueFilter=e.allowValueFilter,this.isValueFilterEnabled=!1,this.enableValueSorting=!!a&&a.enableValueSorting,this.isDrillThrough=!!a&&(!!a.isDrillThrough&&a.isDrillThrough),this.valueContent=[],this.dataSourceSettings=f.getClonedDataSourceSettings(e),e.dataSource instanceof i.DataManager||(this.data=e.dataSource),this.data&&this.data[0]){if(!this.fieldList){"CSV"===e.type?this.fields=this.data.shift():this.fields=Object.keys(this.data[0]);for(o=0;o<this.fields.length;o++)this.fieldKeys[this.fields[o]]="CSV"===e.type?o:this.fields[o]}a&&a.pageSettings&&a.allowDataCompression&&(this.actualData=this.data,this.data=this.getGroupedRawData(e)),this.dataSourceSettings.rows=e.rows?e.rows:[],this.dataSourceSettings.columns=e.columns?e.columns:[],this.dataSourceSettings.filters=e.filters?e.filters:[],this.dataSourceSettings.values=e.values?e.values:[],this.dataSourceSettings.formatSettings=e.formatSettings?e.formatSettings:[],this.dataSourceSettings.groupSettings=e.groupSettings?e.groupSettings:[],this.dataSourceSettings.calculatedFieldSettings=e.calculatedFieldSettings?e.calculatedFieldSettings:[],this.enableSort=void 0===e.enableSorting||e.enableSorting,this.dataSourceSettings.fieldMapping=e.fieldMapping?e.fieldMapping:[],this.valueAxisFields={};for(var d=0,p=this.dataSourceSettings.values;d<p.length;d++){var h=p[d];this.valueAxisFields[h.name]=h}l=this.getGroupData(this.data);for(o=0;o<this.fields.length;o++)this.fieldKeys[this.fields[o]]="CSV"===e.type?o:this.fields[o];this.validateFilters(e),this.isExpandAll=!(!this.isValueFiltersAvail||!e.allowValueFilter)||e.expandAll,this.drilledMembers=e.drilledMembers?this.isValueFiltersAvail&&e.allowValueFilter?[]:e.drilledMembers:[],this.isMultiMeasures=this.dataSourceSettings.values.length>1,this.valueAxis="row"===e.valueAxis?1:0,this.measureIndex=t.isNullOrUndefined(e.valueIndex)?-1:e.valueIndex,this.emptyCellTextContent=e.emptyCellsTextContent?e.emptyCellsTextContent:"",this.rowValuesLength=1===this.valueAxis?this.dataSourceSettings.values.length:1,this.colValuesLength=0===this.valueAxis?this.dataSourceSettings.values.length:1,this.valueSortSettings=e.valueSortSettings||{sortOrder:"None",headerDelimiter:".",headerText:"",columnIndex:void 0},this.valueSortData=[],this.pageSettings=a?a.pageSettings?a.pageSettings:this.pageSettings:void 0,this.allowDataCompression=a&&a.allowDataCompression,this.savedFieldList=a?a.savedFieldList:void 0,this.getFieldList(l,this.enableSort,e.allowValueFilter),this.removeIrrelevantFields(Object.keys(this.fieldList)),this.fillFieldMembers(),this.updateSortSettings(e.sortSettings,this.enableSort),this.filterMembers=[];var u=this.dataSourceSettings.columns.length-1;for(this.columnKeys={};u>-1;)this.columnKeys[this.dataSourceSettings.columns[u].name]=this.dataSourceSettings.columns[u],u--;this.updateFilterMembers(e),this.generateGridData(e)}},e.prototype.removeIrrelevantFields=function(e){var i={};i[0]=this.dataSourceSettings.rows,i[1]=this.dataSourceSettings.columns,i[2]=this.dataSourceSettings.values,i[3]=this.dataSourceSettings.filters;for(var a=0;a<4;){if(i[a])for(var r=0;r<i[a].length;r++){var n=i[a][r].name;this.dataSourceSettings.excludeFields.indexOf(n)>-1||!t.isNullOrUndefined(e)&&-1===e.indexOf(n)?(i[a].splice(r,1),r--):2===a&&(this.measureNames[n]=i[a][r].caption?i[a][r].caption:n,this.measureNames[i[a][r].caption?i[a][r].caption:n]=n)}a++}this.isMultiMeasures=this.dataSourceSettings.values.length>1,this.measureIndex=-1===this.measureIndex?this.valueAxis?i[0].length:i[1].length:this.measureIndex},e.prototype.updateDataSourceSettings=function(e,i){i&&(this.emptyCellTextContent=e.emptyCellsTextContent?e.emptyCellsTextContent:"",this.valueAxis="row"===e.valueAxis?1:0,this.rowValuesLength=1===this.valueAxis?this.dataSourceSettings.values.length:1,this.colValuesLength=0===this.valueAxis?this.dataSourceSettings.values.length:1,this.measureIndex=t.isNullOrUndefined(e.valueIndex)?-1:e.valueIndex,this.enableSort=e.enableSorting,this.dataSourceSettings.alwaysShowValueHeader=e.alwaysShowValueHeader,this.dataSourceSettings.showHeaderWhenEmpty=!!t.isNullOrUndefined(e.showHeaderWhenEmpty)||e.showHeaderWhenEmpty,this.dataSourceSettings.showSubTotals=!!t.isNullOrUndefined(e.showSubTotals)||e.showSubTotals,this.dataSourceSettings.showRowSubTotals=!!t.isNullOrUndefined(e.showRowSubTotals)||e.showRowSubTotals,this.dataSourceSettings.showColumnSubTotals=!!t.isNullOrUndefined(e.showColumnSubTotals)||e.showColumnSubTotals,this.dataSourceSettings.showGrandTotals=!!t.isNullOrUndefined(e.showGrandTotals)||e.showGrandTotals,this.dataSourceSettings.grandTotalsPosition=t.isNullOrUndefined(e.grandTotalsPosition)?"Bottom":e.grandTotalsPosition,this.dataSourceSettings.showRowGrandTotals=!!t.isNullOrUndefined(e.showRowGrandTotals)||e.showRowGrandTotals,this.dataSourceSettings.showColumnGrandTotals=!!t.isNullOrUndefined(e.showColumnGrandTotals)||e.showColumnGrandTotals,this.showSubTotalsAtTop=this.dataSourceSettings.showSubTotals&&"Top"===e.subTotalsPosition&&e.showColumnSubTotals,this.showSubTotalsAtBottom=!!this.customProperties.isTabularLayout||this.dataSourceSettings.showSubTotals&&"Bottom"===e.subTotalsPosition&&e.showRowSubTotals,this.allowValueFilter=e.allowValueFilter,this.dataSourceSettings.formatSettings=e.formatSettings?e.formatSettings:[],this.dataSourceSettings.groupSettings=e.groupSettings?e.groupSettings:[],this.dataSourceSettings.calculatedFieldSettings=e.calculatedFieldSettings?e.calculatedFieldSettings:[],this.enableSort=void 0===e.enableSorting||e.enableSorting,this.dataSourceSettings.fieldMapping=e.fieldMapping?e.fieldMapping:[],this.dataSourceSettings.values=e.values?e.values:[],this.dataSourceSettings.rows=e.rows?e.rows:[],this.dataSourceSettings.columns=e.columns?e.columns:[],this.dataSourceSettings.filters=e.filters?e.filters:[],this.dataSourceSettings.filterSettings=e.filterSettings?e.filterSettings:[],this.dataSourceSettings.sortSettings=e.sortSettings?e.sortSettings:[],this.dataSourceSettings.conditionalFormatSettings=e.conditionalFormatSettings?e.conditionalFormatSettings:[],this.dataSourceSettings.valueSortSettings=e.valueSortSettings?e.valueSortSettings:{},this.removeIrrelevantFields(Object.keys(this.fieldList)))},e.prototype.getGroupedRawData=function(e){this.data=[];for(var i=0,a=this.actualData;i<a.length;i++){var r=a[i];this.data[this.data.length]=f.frameHeaderWithKeys(r)}var n=e.values.filter(function(e){return"Count"===e.type||"DistinctCount"===e.type}).map(function(e){return e.name}),o=n.length>0,s=this.data,l=e.rows.concat(e.columns.concat(e.filters)).map(function(e){return e.name}),d={},p=[];this.groupRawIndex={};for(var h={},u=0,c=0;c<s.length;c++){var g=s[c],m=[];if(o)for(y=0;y<n.length;y++)g[this.fieldKeys[n[y]]]=t.isNullOrUndefined(g[this.fieldKeys[n[y]]])?g[this.fieldKeys[n[y]]]:1;for(var v=0;v<l.length;v++)m.push(g[this.fieldKeys[l[v]]]);var S=m.join("-");if(d[S]){for(var y=0;y<e.values.length;y++){var b=e.values[y].name,C=g[this.fieldKeys[b]],x=d[S],w=e.values[y].type;t.isNullOrUndefined(C)||("number"==typeof C&&"DistinctCount"!==w||(w="Count"),t.isNullOrUndefined(x[b])?x[b]="Product"===w?1:"Min"===w||"Max"===w?void 0:0:"number"!=typeof x[b]&&(x[b]=1),"Count"===w?x[b]+=1:"Min"===w?t.isNullOrUndefined(x[b])||(x[b]=x[b]>C?C:x[b]):"Max"===w?t.isNullOrUndefined(x[b])||(x[b]=x[b]<C?C:x[b]):"Product"===w?x[b]*=C:x[b]+=C)}this.isDrillThrough&&this.groupRawIndex[h[S]].push(c)}else d[S]=g,p.push(g),this.isDrillThrough&&(this.groupRawIndex[u]=[c],h[S]=u,u++)}return p},e.prototype.getGroupData=function(e){for(var i=this,a=e[0],r=this,n=0,o=this.dataSourceSettings.groupSettings;n<o.length;n++){var s=function(n){var o=n.name,s=n.caption;if(!(r.fields.indexOf(o)>-1))return{value:a};var l={},d=void 0;if("Date"===n.type&&r.groupingFields[o]||"Custom"===n.type&&r.groupingFields[o])return{value:a};if("Number"===n.type){if("number"!==f.getType(a[o])&&r.groupingFields[o])return{value:a};n.rangeInterval&&e.sort(function(e,t){return Number(e[i.fieldKeys[o]])>Number(t[i.fieldKeys[o]])?1:Number(t[i.fieldKeys[o]])>Number(e[i.fieldKeys[o]])?-1:0})}for(var p=e.length;p--;){var h=e[p];if(h[r.fieldKeys[o]]&&"Date"===n.type){var u=new Date(h[r.fieldKeys[o]].toString());if(!t.isNullOrUndefined(u)&&n.groupInterval.length>0)for(var c=0,g=n.groupInterval.length;c<g;c++){var m=n.groupInterval[c],v=r.getRange(n,u.getTime()),S=f.resetTime(new Date);switch(m){case"Years":l[b=c===n.groupInterval.length-1?o:o+"_date_group_years"]=m,r.fieldKeys[b]="CSV"===r.dataSourceSettings.type?r.fieldKeys[b]?r.fieldKeys[b]:r.fields.length:b,-1===r.fields.indexOf(b)&&r.fields.push(b),h[r.fieldKeys[b]]=v?void 0:new Date(S.setFullYear(u.getFullYear())).toString();break;case"Quarters":l[b=c===n.groupInterval.length-1?o:o+"_date_group_quarters"]=m;y=Math.ceil((u.getMonth()+1)/3);r.fieldKeys[b]="CSV"===r.dataSourceSettings.type?r.fieldKeys[b]?r.fieldKeys[b]:r.fields.length:b,-1===r.fields.indexOf(b)&&r.fields.push(b),h[r.fieldKeys[b]]=v?void 0:(r.localeObj?r.localeObj.getConstant("qtr"):"Qtr")+y.toString();break;case"QuarterYear":l[b=c===n.groupInterval.length-1?o:o+"_date_group_quarterYear"]=m;var y=Math.ceil((u.getMonth()+1)/3);r.fieldKeys[b]="CSV"===r.dataSourceSettings.type?r.fieldKeys[b]?r.fieldKeys[b]:r.fields.length:b,-1===r.fields.indexOf(b)&&r.fields.push(b),h[r.fieldKeys[b]]=v?void 0:(r.localeObj?r.localeObj.getConstant("qtr"):"Qtr")+y.toString()+" "+(r.localeObj?r.localeObj.getConstant("of"):"of")+" "+u.getFullYear().toString();break;case"Months":l[b=c===n.groupInterval.length-1?o:o+"_date_group_months"]=m,r.fieldKeys[b]="CSV"===r.dataSourceSettings.type?r.fieldKeys[b]?r.fieldKeys[b]:r.fields.length:b,-1===r.fields.indexOf(b)&&r.fields.push(b),h[r.fieldKeys[b]]=v?void 0:new Date(S.setMonth(u.getMonth(),1)).toString();break;case"Days":l[b=c===n.groupInterval.length-1?o:o+"_date_group_days"]=m,r.fieldKeys[b]="CSV"===r.dataSourceSettings.type?r.fieldKeys[b]?r.fieldKeys[b]:r.fields.length:b,-1===r.fields.indexOf(b)&&r.fields.push(b),h[r.fieldKeys[b]]=v?void 0:new Date(S.setMonth(u.getMonth(),u.getDate())).toString();break;case"Hours":l[b=c===n.groupInterval.length-1?o:o+"_date_group_hours"]=m,r.fieldKeys[b]="CSV"===r.dataSourceSettings.type?r.fieldKeys[b]?r.fieldKeys[b]:r.fields.length:b,-1===r.fields.indexOf(b)&&r.fields.push(b),h[r.fieldKeys[b]]=v?void 0:new Date(S.setHours(u.getHours())).toString();break;case"Minutes":l[b=c===n.groupInterval.length-1?o:o+"_date_group_minutes"]=m,r.fieldKeys[b]="CSV"===r.dataSourceSettings.type?r.fieldKeys[b]?r.fieldKeys[b]:r.fields.length:b,-1===r.fields.indexOf(b)&&r.fields.push(b),h[r.fieldKeys[b]]=v?void 0:new Date(S.setMinutes(u.getMinutes())).toString();break;case"Seconds":l[b=c===n.groupInterval.length-1?o:o+"_date_group_seconds"]=m,r.fieldKeys[b]="CSV"===r.dataSourceSettings.type?r.fieldKeys[b]?r.fieldKeys[b]:r.fields.length:b,-1===r.fields.indexOf(b)&&r.fields.push(b),h[r.fieldKeys[b]]=v?void 0:new Date(S.setSeconds(u.getSeconds())).toString()}}}else if(isNaN(Number(h[r.fieldKeys[o]]))||"Number"!==n.type){if(h[r.fieldKeys[o]]&&"Custom"===n.type&&n.customGroups&&n.customGroups.length>0){var b=o+"_custom_group",C=n.customGroups,x=void 0;r.groupingFieldsInfo[o]=o,r.groupingFieldsInfo[b]=o;for(var c=0,w=C.length;c<w;c++){var T=C[c];if(T.items&&T.items.length>1){d=b,r.fieldKeys[b]="CSV"===r.dataSourceSettings.type?r.fieldKeys[b]?r.fieldKeys[b]:r.fields.length:b,-1===r.fields.indexOf(b)&&r.fields.push(b);var M=-1!==f.inArray(h[r.fieldKeys[o]].toString(),T.items);h[r.fieldKeys[b]]=M?T.groupName&&""!==T.groupName?T.groupName:r.localeObj.getConstant("group")+" "+c:x&&x!==h[r.fieldKeys[o]].toString()?x:h[r.fieldKeys[o]].toString(),x=h[r.fieldKeys[b]]}}}}else{v=r.getRange(n,Number(h[r.fieldKeys[o]]));h[r.fieldKeys[o]]=v?void 0:h[r.fieldKeys[o]]}for(var D=[],O=0,P=ne=Object.keys(h);O<P.length;O++){le=P[O];D.push(!!h[le])}a=-1===D.indexOf(!1)&&ne.length===Object.keys(e[0]).length?h:a}if("Date"===n.type){for(var N=!1,E=[r.dataSourceSettings.rows,r.dataSourceSettings.columns,r.dataSourceSettings.values,r.dataSourceSettings.filters],F=Object.keys(l),I=Object.keys(F).length,L=void 0,A=0,R=E;A<R.length;A++){Ce=R[A];if(!N&&Ce){for(var k=Ce.length,c=0;c<k;){if(Ce[c].name===o){N=!0;xe=Ce[c];for(Ce.splice(c,1),me=(me=r.dataSourceSettings.rows).concat(r.dataSourceSettings.columns,r.dataSourceSettings.values,r.dataSourceSettings.filters);I--;){var j=xe.caption?xe.caption:xe.name;if(r.clonedReport){var q=r.clonedReport.rows;q=q.concat(r.clonedReport.columns,r.clonedReport.values,r.clonedReport.filters);var H=f.getFieldByName(F[I],q);H&&(j=H.caption?H.caption:H.name)}if(f.getFieldByName(F[I],me))r.groupingFieldsInfo[F[I]]=o;else{L=l[F[I]],j=-1!==j.indexOf(" (")&&-1!==j.indexOf(")")?j.slice(j.indexOf("(")+1,j.length-1):j;we={name:F[I],caption:(r.localeObj?r.localeObj.getConstant(L):L)+" ("+j+")",type:"Count",showNoDataItems:xe.showNoDataItems,baseField:xe.baseField,baseItem:xe.baseItem,showFilterIcon:xe.showFilterIcon,showSortIcon:xe.showSortIcon,showEditIcon:xe.showEditIcon,showRemoveIcon:xe.showRemoveIcon,showSubTotals:xe.showValueTypeIcon,allowDragAndDrop:xe.allowDragAndDrop,expandAll:xe.expandAll,groupName:xe.groupName};Ce.splice(c,0,we),r.groupingFieldsInfo[we.name]=o}}break}if(Ce[c].name.indexOf(o)>-1){var V=l[Ce[c].name],U=Ce.filter(function(e){return e.name===o})[0];if(!t.isNullOrUndefined(U)){var _=-1!==U.caption.indexOf(" (")&&-1!==U.caption.indexOf(")")?U.caption.slice(U.caption.indexOf("(")+1,U.caption.length-1):U.caption;Ce[c].caption=(r.localeObj?r.localeObj.getConstant(V):U)+" ("+_+")"}}c++}if(N)break}}I=Object.keys(F).length;for(var B=(ue=r.getMappingField(o,r.clonedReport?r.clonedReport.fieldMapping:r.dataSourceSettings.fieldMapping)).caption?ue.caption:o;I--;){L=l[F[I]];for(var c=0,G=r.dataSourceSettings.formatSettings.length;c<G;c++)if(r.dataSourceSettings.formatSettings[c].name===F[I]){r.dataSourceSettings.formatSettings.splice(c,1);break}if("Quarters"!==L&&"QuarterYear"!==L){var z={name:F[I],type:["Years","Months","Days"].indexOf(L)>-1?"date":"time",format:"Years"===L?"yyyy":"Months"===L?"MMM":"Days"===L?"d-MMM":"Hours"===L?"hh a":"Minutes"===L?":mm":"Seconds"===L?":ss":void 0};r.dataSourceSettings.formatSettings.push(z)}if(!N){W=r.getMappingField(F[I],r.dataSourceSettings.fieldMapping);if(F[I]!==o&&t.isNullOrUndefined(W.name)){we={name:F[I],caption:(r.localeObj?r.localeObj.getConstant(L):L)+" ("+B+")"};r.dataSourceSettings.fieldMapping.push(we),r.groupingFieldsInfo[we.name]=o}else F[I]!==o&&(W.caption=(r.localeObj?r.localeObj.getConstant(L):L)+" ("+B+")",r.groupingFieldsInfo[W.name]=o)}}if(!N){var W=r.getMappingField(o,r.dataSourceSettings.fieldMapping);if(L=l[o],F[I]!==o&&t.isNullOrUndefined(W.name)){we={name:o,caption:(r.localeObj?r.localeObj.getConstant(L):L)+" ("+B+")"};r.dataSourceSettings.fieldMapping.push(we),r.groupingFieldsInfo[we.name]=o}else W.caption=(r.localeObj?r.localeObj.getConstant(L):L)+" ("+B+")",r.groupingFieldsInfo[W.name]=o}}else if("Number"===n.type&&n.rangeInterval){var Q=void 0,Y=[],K=[],X=e.length,k=0;r.groupingFields[o]=o;for(var J=[];k<X;){var Z=Number(e[k][o]);K.push(Z),isNaN(Z)||-1!==Y.indexOf(Z)||Y.push(Z),k++}for(X=e.length,k=0;k<X;){var $=e[k];if($&&!isNaN(Number($[o]))){Q=("string"==typeof n.endingAt?parseInt(n.endingAt,10):n.endingAt)||Math.max.apply(Math,Y);var ee=Math.round(Number($[o])),te=Math.round(ee+(n.rangeInterval-1));if(ee>=J[0]&&ee<=J[J.length-1]){var ie=J[0],ae=J[J.length-1];$[o]=r.getNumberGroupHeaders(ie,ae,Q),t.isNullOrUndefined(r.groupedDataType[o])&&(r.groupedDataType[o]="string")}else if(0===J.length){for(c=ee;c<=te;c++)J.push(c);var ie=J[0],ae=J[J.length-1];$[o]=r.getNumberGroupHeaders(ie,ae,Q),t.isNullOrUndefined(r.groupedDataType[o])&&(r.groupedDataType[o]="string")}else{var ae=(ie=J[J.length-1]+1)+(n.rangeInterval-1),re=!0;for(J.splice(0,J.length);re;)ee>=ie&&ee<=ae&&($[o]=r.getNumberGroupHeaders(ie,ae,Q),t.isNullOrUndefined(r.groupedDataType[o])&&(r.groupedDataType[o]="string"),J.push(ie),J.push(ae),re=!1),ae=(ie=ae+1)+(n.rangeInterval-1)}for(var ne=Object.keys($),D=[],oe=0,se=ne;oe<se.length;oe++){var le=se[oe];D.push(!!$[le])}a=-1===D.indexOf(!1)&&ne.length===Object.keys(e[0]).length?$:a}k++}for(var de=0,pe=E=[r.dataSourceSettings.rows,r.dataSourceSettings.columns,r.dataSourceSettings.values,r.dataSourceSettings.filters];de<pe.length;de++){var he=pe[de],ue=f.getFieldByName(o,he);ue&&((ue=ue.properties?ue.properties:ue).type="Count")}for(var c=0,ce=r.dataSourceSettings.formatSettings.length;c<ce;c++)if(r.dataSourceSettings.formatSettings[c].name===o){r.dataSourceSettings.formatSettings.splice(c,1);break}}else if("Custom"===n.type&&d){var ge=d,N=!1,E=[r.dataSourceSettings.rows,r.dataSourceSettings.columns,r.dataSourceSettings.values,r.dataSourceSettings.filters],me=r.dataSourceSettings.rows;me=me.concat(r.dataSourceSettings.columns,r.dataSourceSettings.values,r.dataSourceSettings.filters);var fe=[];s&&""!==s||(fe=ge.match(/_custom_group/g));for(var ve=f.getFieldByName(o.replace(/_custom_group/g,""),me),Se=f.getFieldByName(ge,me),ye=0,be=E;ye<be.length;ye++){var Ce=be[ye];if(!N&&Ce){for(var k=Ce.length,c=0;c<k;){if(Ce[c].name===n.name&&!Se){N=!0;var xe=Ce[c],we={name:ge,caption:s&&""!==s?s:(ve.caption?ve.caption:ve.name)+(fe.length+1),type:"Count",showNoDataItems:xe.showNoDataItems,baseField:xe.baseField,baseItem:xe.baseItem,showSubTotals:xe.showValueTypeIcon,allowDragAndDrop:xe.allowDragAndDrop,showFilterIcon:xe.showFilterIcon,showSortIcon:xe.showSortIcon,showRemoveIcon:xe.showRemoveIcon,showEditIcon:xe.showEditIcon,expandAll:xe.expandAll,groupName:xe.groupName};Ce.splice(c,0,we),r.groupingFieldsInfo[we.name]=o,r.groupingFieldsInfo[o]=o;break}if(Ce[c].name===ge&&Se){we={name:Se.name,caption:s&&""!==s?s:Se.caption,type:Se.type,showNoDataItems:Se.showNoDataItems,baseField:Se.baseField,baseItem:Se.baseItem,showRemoveIcon:Se.showRemoveIcon,showSubTotals:Se.showValueTypeIcon,allowDragAndDrop:Se.allowDragAndDrop,showFilterIcon:Se.showFilterIcon,showSortIcon:Se.showSortIcon,showEditIcon:Se.showEditIcon,expandAll:Se.expandAll,groupName:Se.groupName};Ce.splice(c,1,we),r.groupingFieldsInfo[we.name]=o,r.groupingFieldsInfo[o]=o;break}c++}if(N)break}}var Te=f.getFieldByName(o,f.cloneFormatSettings(r.dataSourceSettings.formatSettings));Te&&(Te.name=ge,r.dataSourceSettings.formatSettings.push(Te)),r.groupingFields[o]=o}r.groupingFields=t.extend(r.groupingFields,l)}(o[n]);if("object"==typeof s)return s.value}return a},e.prototype.getNumberGroupHeaders=function(e,t,i){return e===t?e.toString():i>=e&&i<=t?i===e?e.toString():e.toString()+"-"+i.toString():e.toString()+"-"+t.toString()},e.prototype.getRange=function(e,t){var i;if("Date"===e.type){var a=new Date(t),r="string"==typeof e.startingAt?new Date(e.startingAt):e.startingAt,n="string"==typeof e.endingAt?new Date(e.endingAt):e.endingAt;i=!!(r&&a.getTime()<r.getTime()||n&&a.getTime()>n.getTime())}else{var o="string"==typeof e.startingAt?parseInt(e.startingAt,10):e.startingAt,s="string"==typeof e.endingAt?parseInt(e.endingAt,10):e.endingAt;i=!isNaN(o)&&t<o||!isNaN(s)&&t>s}return i},e.prototype.getPercentFormat=function(e,i){var a=t.isNullOrUndefined(e[i])||t.isNullOrUndefined(this.formatFields[i].format)?void 0:this.formatFields[i].format.toLowerCase().match(/p[0-9]/);return t.isNullOrUndefined(a)?2:Number(this.formatFields[i].format.replace(/[^0-9]/g,""))},e.prototype.getFormattedFields=function(e){this.formatFields=this.setFormattedFields(e.formatSettings)},e.prototype.setFormattedFields=function(e){for(var t=e.length,i={};t--;)i[e[t].name]=e[t],e[t].type&&(this.dateFormatFunction[e[t].name]={exactFormat:this.globalize.getDateFormat(e[t]),fullFormat:this.globalize.getDateFormat({format:"yyyy/MM/dd/HH/mm/ss",type:e[t].type})});return i},e.prototype.getFieldList=function(e,i,a){for(var r,n=this.dataSourceSettings.excludeFields.length-1;n>-1;){var o=this.fields.indexOf(this.dataSourceSettings.excludeFields[n]);-1!==o&&this.fields.splice(o,1),this.fieldList&&delete this.fieldList[this.dataSourceSettings.excludeFields[n]],n--}var s=this.fields,l=t.extend([],this.dataSourceSettings.rows,null,!0);l=l.concat(this.dataSourceSettings.columns,this.dataSourceSettings.values,this.dataSourceSettings.filters),this.getFormattedFields(this.dataSourceSettings),this.getCalculatedField(s);var d=(s=this.fields).length,p=["string","number","datetime","date","boolean"];if(this.savedFieldList)for(this.fieldList=this.savedFieldList;d--;){var h=s[d],u=this.getMappingField(h,this.dataSourceSettings.fieldMapping);this.fieldList[h]?(this.fieldList[h].isSelected=!1,this.fieldList[h].index=d,this.fieldList[h].filter=[],this.fieldList[h].sort=i?"Ascending":"None",this.fieldList[h].isExcelFilter=!1,this.fieldList[h].filterType="",this.fieldList[h].showFilterIcon=!(u&&"showFilterIcon"in u)||u.showFilterIcon,this.fieldList[h].showRemoveIcon=!(u&&"showRemoveIcon"in u)||u.showRemoveIcon,this.fieldList[h].showSortIcon=!(u&&"showSortIcon"in u)||u.showSortIcon,this.fieldList[h].showEditIcon=!(u&&"showEditIcon"in u)||u.showEditIcon,this.fieldList[h].showValueTypeIcon=!(u&&"showValueTypeIcon"in u)||u.showValueTypeIcon,this.fieldList[h].allowDragAndDrop=!(u&&"allowDragAndDrop"in u)||u.allowDragAndDrop,this.fieldList[h].isCalculatedField=!!(u&&"isCalculatedField"in u)&&u.isCalculatedField,this.fieldList[h].showNoDataItems=!!(u&&"showNoDataItems"in u)&&u.showNoDataItems,this.fieldList[h].showSubTotals=!(u&&"showSubTotals"in u)||u.showSubTotals,this.fieldList[h].expandAll=!!(u&&"expandAll"in u)&&u.expandAll,this.fieldList[h].pid=u&&"groupName"in u&&u.groupName?u.groupName:this.groupingFieldsInfo[h]?this.groupingFieldsInfo[h]:void 0,this.isValueFiltersAvail&&a&&(this.fieldList[h].dateMember=[],this.fieldList[h].members={},this.fieldList[h].isMembersFilled=!1),this.updateMembersOrder(h)):(r=t.isNullOrUndefined(this.groupedDataType[h])?u&&"dataType"in u&&u.dataType&&p.indexOf(u.dataType.toLowerCase())>-1?u.dataType.toLowerCase():r:this.groupedDataType[h],this.fieldList[h]={caption:u&&"caption"in u&&u.caption?u.caption:h,id:h,type:-1!==h.indexOf("_custom_group")||-1!==h.indexOf("_date_group")?"string":void 0===r||"undefined"===r?"number":r,isSelected:!1,sort:i?"Ascending":"None",filterType:"",index:d,filter:[],isCustomField:-1!==h.indexOf("_custom_group")||-1!==h.indexOf("_date_group"),showRemoveIcon:!(u&&"showRemoveIcon"in u)||u.showRemoveIcon,showFilterIcon:!(u&&"showFilterIcon"in u)||u.showFilterIcon,showSortIcon:!(u&&"showSortIcon"in u)||u.showSortIcon,showNoDataItems:!!(u&&"showNoDataItems"in u)&&u.showNoDataItems,isCalculatedField:!!(u&&"isCalculatedField"in u)&&u.isCalculatedField,showEditIcon:!(u&&"showEditIcon"in u)||u.showEditIcon,showValueTypeIcon:!(u&&"showValueTypeIcon"in u)||u.showValueTypeIcon,allowDragAndDrop:!(u&&"allowDragAndDrop"in u)||u.allowDragAndDrop,showSubTotals:!(u&&"showSubTotals"in u)||u.showSubTotals,expandAll:!!(u&&"expandAll"in u)&&u.expandAll,pid:u&&"groupName"in u&&u.groupName?u.groupName:this.groupingFieldsInfo[h]?this.groupingFieldsInfo[h]:void 0,aggregateType:u&&"type"in u?u.type:"number"===(-1!==h.indexOf("_custom_group")||-1!==h.indexOf("_date_group")?"string":void 0===r||"undefined"===r?"number":r)?"Sum":"Count",baseField:u&&"baseField"in u?u.baseField:void 0,baseItem:u&&"baseItem"in u?u.baseItem:void 0},this.updateMembersOrder(h))}else for(this.fieldList={};d--;){var h=s[d],u=this.getMappingField(h,this.dataSourceSettings.fieldMapping);r=t.isNullOrUndefined(this.groupedDataType[h])?u&&"dataType"in u&&u.dataType&&p.indexOf(u.dataType.toLowerCase())>-1?u.dataType.toLowerCase():f.getType(e[this.fieldKeys[h]]):this.groupedDataType[h],this.fieldList[h]={id:h,pid:u&&"groupName"in u&&u.groupName?u.groupName:this.groupingFieldsInfo[h]?this.groupingFieldsInfo[h]:void 0,caption:u&&"caption"in u&&u.caption?u.caption:h,type:-1!==h.indexOf("_custom_group")||-1!==h.indexOf("_date_group")?"string":void 0===r||"undefined"===r?"number":r,filterType:"",index:d,filter:[],sort:i?"Ascending":"None",isSelected:!1,isCustomField:-1!==h.indexOf("_custom_group")||-1!==h.indexOf("_date_group"),showFilterIcon:!(u&&"showFilterIcon"in u)||u.showFilterIcon,showRemoveIcon:!(u&&"showRemoveIcon"in u)||u.showRemoveIcon,showSortIcon:!(u&&"showSortIcon"in u)||u.showSortIcon,showEditIcon:!(u&&"showEditIcon"in u)||u.showEditIcon,showValueTypeIcon:!(u&&"showValueTypeIcon"in u)||u.showValueTypeIcon,allowDragAndDrop:!(u&&"allowDragAndDrop"in u)||u.allowDragAndDrop,showSubTotals:!(u&&"showSubTotals"in u)||u.showSubTotals,showNoDataItems:!!(u&&"showNoDataItems"in u)&&u.showNoDataItems,isCalculatedField:!!(u&&"isCalculatedField"in u)&&u.isCalculatedField,expandAll:!!(u&&"expandAll"in u)&&u.expandAll,aggregateType:u&&"type"in u?u.type:"number"===(-1!==h.indexOf("_custom_group")||-1!==h.indexOf("_date_group")?"string":void 0===r||"undefined"===r?"number":r)?"Sum":"Count",baseField:u&&"baseField"in u?u.baseField:void 0,baseItem:u&&"baseItem"in u?u.baseItem:void 0},this.updateMembersOrder(h)}this.groupedDataType={},this.updateTreeViewData(l)},e.prototype.updateMembersOrder=function(e){for(var t=0,i=this.dataSourceSettings.sortSettings;t<i.length;t++){var a=i[t];if(e===a.name&&a.membersOrder){this.fieldList[e].membersOrder=a.membersOrder;break}}},e.prototype.getMappingField=function(e,t){var i={};if(t&&t.length>0)for(var a=0,r=t.length;a<r;a++)if(t[a].name===e){i=t[a];break}return i},e.prototype.updateFieldList=function(e){for(var t=this.fields,i=t.length;i--;)this.fieldList[t[i]].isExcelFilter=e[t[i]].isExcelFilter},e.prototype.updateTreeViewData=function(e){for(var i=this,a=e.length,r=this.dataSourceSettings.calculatedFieldSettings.length;a--;)if(this.fieldList[e[a].name]){var n=this.fieldList[e[a].name];n.type=e[a].dataType?e[a].dataType.toLowerCase():n.type,n.caption=e[a].caption?e[a].caption:e[a].name,n.isSelected=!0,n.showNoDataItems=e[a].showNoDataItems,n.aggregateType=e[a].type,n.baseField=e[a].baseField,n.baseItem=e[a].baseItem,n.allowDragAndDrop=e[a].allowDragAndDrop,n.showFilterIcon=e[a].showFilterIcon,n.showSortIcon=e[a].showSortIcon,n.showRemoveIcon=e[a].showRemoveIcon,n.showValueTypeIcon=e[a].showValueTypeIcon,n.showEditIcon=e[a].showEditIcon,n.showSubTotals=e[a].showSubTotals,n.expandAll=e[a].expandAll}for(;r--;)this.fieldList[this.dataSourceSettings.calculatedFieldSettings[r].name]&&(this.fieldList[this.dataSourceSettings.calculatedFieldSettings[r].name].aggregateType="CalculatedField",this.fieldList[this.dataSourceSettings.calculatedFieldSettings[r].name].isCalculatedField=!0,this.fieldList[this.dataSourceSettings.calculatedFieldSettings[r].name].formula=this.dataSourceSettings.calculatedFieldSettings[r].formula);var o=["_date_group_years","_date_group_quarters","_date_group_quarterYear","_date_group_months","_date_group_days","_date_group_hours","_date_group_minutes","_date_group_seconds"];this.dataSourceSettings.groupSettings.filter(function(t){return!e.some(function(e){return t.name===e.name})}).forEach(function(e){var a=e.name,r=e.type.toLowerCase();Object.keys(i.fieldList).forEach(function(n){"date"!==r||t.isNullOrUndefined(e.caption)||!o.some(function(e){return n===""+a+e})&&n!==a?"custom"!==r||t.isNullOrUndefined(e.caption)||n!==a+"_custom_group"?"number"!==r||t.isNullOrUndefined(e.caption)||n!==a||(i.fieldList[n].caption=e.caption):i.fieldList[n].caption=e.caption:i.fieldList[n].caption=i.fieldList[n].caption.replace(e.name,e.caption)})})},e.prototype.getCalculatedField=function(e){for(var i=0,a=this.dataSourceSettings.calculatedFieldSettings;i<a.length;i++){var r=a[i];this.calculatedFields[r.name]=t.extend({},r,null,!0),this.calculatedFields[r.name].actualFormula=r.formula}for(var n=Object.keys(this.calculatedFields),o=this,s=0,l=n.length;s<l;s++)!function(t,i){var a=o.calculatedFields[n[t]],r=a.properties,s=(r?r.formula:a.formula).trim(),l=s.replace(/"/g,"");a.formula=l.indexOf("^")>-1?o.powerFunction(l):l,-1===a.formula.indexOf("Math.min(")&&a.formula.indexOf("min(")>-1&&(a.formula=a.formula.replace(/min\(/g,"Math.min(")),-1===a.formula.indexOf("Math.max(")&&a.formula.indexOf("max(")>-1&&(a.formula=a.formula.replace(/max\(/g,"Math.max(")),-1===a.formula.indexOf("Math.abs(")&&a.formula.indexOf("abs(")>-1&&(a.formula=a.formula.replace(/abs\(/g,"Math.abs(")),a.name=r?r.name:a.name,"CSV"===o.dataSourceSettings.type?-1===e.indexOf(a.name)&&e.push(a.name):(e=e.filter(function(e){return e!==a.name})).push(a.name);for(var d=s.split('"'),p=0,h=d.length;p<h;p++){var u=d[p].trim(),c=u.split(/[ .:;?!~,`"&|()<>{}[\]\r\n/\\]+/),g=u.match(/^([^()]+)\((.*)\)$/),m="DistinctCount"===c[0]?"DistinctCount":"PopulationStDev"===c[0]?"PopulationStDev":"SampleStDev"===c[0]?"SampleStDev":"PopulationVar"===c[0]?"PopulationVar":"SampleVar"===c[0]?"SampleVar":c[0];if(-1!==["Sum","Count","Min","Max","Avg","Product","DistinctCount","PopulationStDev","SampleStDev","PopulationVar","SampleVar","Median"].indexOf(m)){var f=-1===e.indexOf(c[1])&&g[2]?e.indexOf(g[2]):e.indexOf(c[1]);o.calculatedFormulas[a.name]?o.calculatedFormulas[a.name].push({index:f,type:m,formula:u}):o.calculatedFormulas[a.name]=[{index:f,type:m,formula:u}]}}}(s);this.fields=e},e.prototype.validateFilters=function(e){this.isValueFiltersAvail=!1;var i=e.filterSettings?e.filterSettings:[],a=t.extend([],this.dataSourceSettings.rows,null,!0);a=a.concat(this.dataSourceSettings.columns);for(var r=0,n=i;r<n.length;r++){for(var o=n[r],s=0,l=a;s<l.length;s++){var d=l[s];if(o.name===d.name&&"Value"===o.type){this.isValueFiltersAvail=!0;break}}if(this.isValueFiltersAvail)break}},e.prototype.validateValueFields=function(){this.isValueHasAdvancedAggregate=!1;for(var e=0,t=this.dataSourceSettings.values;e<t.length;e++){var i=t[e];if(-1!==["DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentRowTotal","PercentageOfParentColumnTotal","PercentageOfParentTotal","RunningTotals"].indexOf(i.type)){this.isValueHasAdvancedAggregate=!0;break}}},e.prototype.fetchFieldMembers=function(e){var t=this.fieldList[e].index;this.generateMembers(t,new Set)},e.prototype.generateMembers=function(e,i){var a=this.data.length,r=this.fields,n=this.fieldList,o=r[e];n[o].members&&!this.allowDataCompression||(n[o].members={},this.allowDataCompression&&(n[o].isMembersFilled=!1)),n[o].dateMember&&!this.allowDataCompression||(n[o].dateMember=[]);var s=n[o].members,l=n[o].dateMember;if((n[o].isSelected||i.has(e))&&!n[o].isMembersFilled){for(var d=Object.keys(s).length>0,p=0,h=n[o].expandAll,u=f.isDateField(o,this),c=0;c<a;c++){var g=this.data[c][this.fieldKeys[o]],m=g;if(m=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(m):m,!d){var v=u?this.getFormattedValue(m,o):{formattedText:null===m?this.localeObj?this.localeObj.getConstant("null"):String(m):void 0===m?this.localeObj?o in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(m):m.toString(),actualText:null===m?this.localeObj?this.localeObj.getConstant("null"):String(m):void 0===m?this.localeObj?o in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(m):m};Object.prototype.hasOwnProperty.call(s,m)?s[m].index.push(c):(p++,s[m]={index:[c],ordinal:p,isDrilled:this.isExpandAll||h,caption:v.formattedText},l.push({formattedText:v.formattedText,actualText:u?v.dateText:v.actualText}))}var S=t.isNullOrUndefined(g)?g:"number"===n[o].type?isNaN(Number(g))?void 0:Number(g):1,y={ordinal:s[m].ordinal,member:S};this.valueMatrix[c]||(this.valueMatrix[c]=[]),this.valueMatrix[c][e]=y}n[o].isMembersFilled=!0}},e.prototype.fillFieldMembers=function(){var e=this.fields,t=this.fieldList,i=e.length;this.data.length-this.valueMatrix.length<0&&(this.valueMatrix=this.valueMatrix.slice(0,this.data.length));var a=new Set;if(this.calculatedFormulas&&Object.keys(this.calculatedFormulas).length>0)for(var r in this.calculatedFormulas)if(t[r]&&t[r].isSelected)for(var n=this.calculatedFormulas[r],o=0;o<n.length;o++){var s=n[o];a.add(s.index)}for(var l=0;l<i;l++)this.generateMembers(l,a)},e.prototype.generateValueMatrix=function(){for(var e=this.fields,i=this.data.length,a=e.length,r=this.fieldList;i--;)for(var n=a;n--;){var o=e[n],s=r[o];if(s.isMembersFilled){var l=this.data[i][this.fieldKeys[o]];this.valueMatrix[i][n].member=t.isNullOrUndefined(l)?l:"number"===s.type?isNaN(Number(l))?void 0:Number(l):1}}},e.prototype.updateSortSettings=function(e,t){for(var i=0,a=e?e.length:0;i<a&&t;i++)this.fieldList[e[i].name]&&(this.fieldList[e[i].name].sort=e[i].order)},e.prototype.updateFilterMembers=function(e){var t=this.filterMembers,i={},a=this.getFilters(e,i),r=this.valueMatrix.length;if(a)for(var n=i.include.index,o=0;o<n.length;o++)void 0!==i.exclude&&void 0!==i.exclude.indexObject[n[o]]||t.push(n[o]);else for(o=0;o<r;o++)void 0!==i.exclude&&void 0!==i.exclude.indexObject[o]||t.push(o)},e.prototype.getFilters=function(e,t){for(var i=e.filterSettings?e.filterSettings:[],a=!1,r=[],n=0,o=i.length;n<o;n++){var s=i[n].properties?i[n].properties:i[n];this.fieldList[s.name]&&this.fieldList[s.name].isSelected&&this.isValidFilterField(s,e.allowMemberFilter,e.allowLabelFilter)&&(this.applyLabelFilter(s),s&&(r=s.items),s.type&&"Include"===s.type?(this.frameFilterList(r,s.name,t,"include",s.showLabelFilter,a),a=!0):this.frameFilterList(r,s.name,t,"exclude",s.showLabelFilter),s.showLabelFilter&&(s.items=[],s.type=s.showDateFilter?"Date":s.showNumberFilter?"Number":"Label"))}return a},e.prototype.isValidFilterField=function(e,i,a){var r=e.name,n=!1,o=["Include","Exclude"],s=t.extend([],this.dataSourceSettings.rows,null,!0);if(s=s.concat(this.dataSourceSettings.columns),this.fieldList[r].isSelected&&i&&o.indexOf(e.type)>=0){n=!0;for(var l=0,d=this.dataSourceSettings.values;l<d.length;l++)if(r===(u=d[l]).name){n=!1;break}}else if(a)for(var p=0,h=s;p<h.length;p++){var u=h[p];if(r===u.name&&["Label","Date","Number"].indexOf(e.type)>=0){n=!0;break}}return n},e.prototype.applyLabelFilter=function(e){if(["Label","Date","Number"].indexOf(e.type)>=0){var t=Object.keys(this.fieldList[e.name].members);if(e.showLabelFilter=!0,"Label"===e.type)e.items=this.getLabelFilterMembers(t,e.condition,e.value1,e.value2);else if("Date"===e.type){e.showDateFilter=!0;var i="string"==typeof e.value1?new Date(e.value1):e.value1,a="string"==typeof e.value2?new Date(e.value2):e.value2;e.items=this.getDateFilterMembers(t,e.name,e.condition,i,a)}else{e.showNumberFilter=!0,e.items=[];for(var r=0,n=t;r<n.length;r++){var o=n[r],s=this.getParsedValue(e.name,e.value1),l=this.getParsedValue(e.name,e.value2),d=this.getParsedValue(e.name,o);this.validateFilterValue(d,e.condition,s,l)&&e.items.push(o)}}var p=["DoesNotBeginWith","DoesNotContains","DoesNotEndsWith","DoesNotEquals","NotBetween"];e.type=e.condition?p.indexOf(e.condition)>-1&&!e.showNumberFilter?"Exclude":"Include":"Exclude"}else e.showLabelFilter=!1},e.prototype.getLabelFilterMembers=function(e,t,i,a){for(var r=[],n=0,o=e;n<o.length;n++){var s=o[n],l=s.toLowerCase();if(i.toString())switch(t){case"Equals":case"DoesNotEquals":l===i.toLowerCase()&&r.push(s);break;case"BeginWith":case"DoesNotBeginWith":0===l.indexOf(i.toLowerCase())&&r.push(s);break;case"EndsWith":case"DoesNotEndsWith":null!==l.match(i.toLowerCase()+"$")&&r.push(s);break;case"Contains":case"DoesNotContains":l.indexOf(i.toLowerCase())>-1&&r.push(s);break;case"GreaterThan":l>i.toLowerCase()&&r.push(s);break;case"GreaterThanOrEqualTo":l>=i.toLowerCase()&&r.push(s);break;case"LessThan":l<i.toLowerCase()&&r.push(s);break;case"LessThanOrEqualTo":l<=i.toLowerCase()&&r.push(s);break;case"Between":case"NotBetween":l>=i.toLowerCase()&&l<=a.toLowerCase()&&r.push(s);break;default:l===i.toLowerCase()&&r.push(s)}}return r},e.prototype.getDateFilterMembers=function(e,t,i,a,r){for(var n=[],o=0,s=e;o<s.length;o++){var l=s[o],d=new Date(l);if(a)switch(i){case"Equals":case"DoesNotEquals":this.getFormattedValue(d.toString(),t).formattedText===this.getFormattedValue(a.toString(),t).formattedText&&n.push(this.getFormattedValue(l,t).formattedText);break;case"After":d.getTime()>a.getTime()&&n.push(this.getFormattedValue(l,t).formattedText);break;case"AfterOrEqualTo":d.getTime()>=a.getTime()&&n.push(this.getFormattedValue(l,t).formattedText);break;case"Before":d.getTime()<a.getTime()&&n.push(this.getFormattedValue(l,t).formattedText);break;case"BeforeOrEqualTo":d.getTime()<=a.getTime()&&n.push(this.getFormattedValue(l,t).formattedText);break;case"Between":case"NotBetween":d.getTime()>=a.getTime()&&d.getTime()<=r.getTime()&&n.push(this.getFormattedValue(l,t).formattedText);break;default:this.getFormattedValue(d.toString(),t).formattedText===this.getFormattedValue(a.toString(),t).formattedText&&n.push(this.getFormattedValue(l,t).formattedText)}}return n},e.prototype.validateFilterValue=function(e,t,i,a){var r=!1;if("number"==typeof i)switch(t){case"Equals":e===i&&(r=!0);break;case"DoesNotEquals":e!==i&&(r=!0);break;case"GreaterThan":e>i&&(r=!0);break;case"GreaterThanOrEqualTo":e>=i&&(r=!0);break;case"LessThan":e<i&&(r=!0);break;case"LessThanOrEqualTo":e<=i&&(r=!0);break;case"Between":e>=i&&e<=a&&(r=!0);break;case"NotBetween":e>=i&&e<=a||(r=!0);break;default:e!==i&&(r=!0)}return r},e.prototype.frameFilterList=function(e,t,i,a,r,n){i[a]?this.updateFilter(e,t,i,a,r,n):(i[a]={indexObject:{},index:[]},this.updateFilter(e,t,i,a,r,n))},e.prototype.updateFilter=function(e,i,a,r,n,o){var s=0,l=this.fieldList[i];l.filter=e,l.filterType=r,l.isExcelFilter=n;var d=f.getFormattedMembers(l.members,i,this),p=o,h={},u={};for(h[r]={indexObject:{},index:[]},this.fieldFilterMem[i]={memberObj:{}};!t.isNullOrUndefined(e[s]);){if(d[e[s]]){var c=d[e[s]].index;if("include"===r)for(var g=0,m=c.length;g<m;g++)p&&void 0===a[r].indexObject[c[g]]||(h[r].indexObject[c[g]]=c[g],h[r].index.push(c[g]));else{for(var g=0,m=c.length;g<m;g++)void 0===a[r].indexObject[c[g]]&&(a[r].indexObject[c[g]]=c[g],a[r].index.push(c[g]));this.fieldFilterMem[i].memberObj[e[s]]=e[s]}}s++}if("include"===r){a[r]=h[r];for(g=0;g<e.length;g++)d[e[g]]&&(u[e[g]]=e[g]);for(var v=Object.keys(d),g=0,m=v.length;g<m;g++)void 0===u[v[g]]&&(this.fieldFilterMem[i].memberObj[v[g]]=v[g])}},e.prototype.applyValueFiltering=function(e,i,a,r,n,o,s){this.isValueFiltered=!1;var l=t.extend({},"row"===s&&this.rowGrandTotal?this.rowGrandTotal:"column"===s&&this.columnGrandTotal?this.columnGrandTotal:"Top"!==this.dataSourceSettings.grandTotalsPosition?a[a.length-1]:a[0],null,!0);return this.getFilteredData(a,r,n,o,i,e.name,l,s),this.isValueFiltered&&(("row"===s&&null===this.rowGrandTotal||"column"===s&&null===this.columnGrandTotal)&&o.push(l),a=o),a},e.prototype.getFilteredData=function(e,i,a,r,n,o,s,l){for(var d=e.length,p=0;p<d;p++)if(a[o])if(e[p].level===n){this.isValueFiltered=!0,this.fieldList[o].isExcelFilter=!0;var h=0,u=a[o].measure,c=this.fieldList[u].index,g=this.fieldList[u].aggregateType;this.rawIndexObject={},h="row"===l?this.getAggregateValue(e[p].index,i.indexObject,c,g,!1):this.getAggregateValue(i.index,e[p].indexObject,c,g,!1);var m={fieldName:u,row:e[p],column:i,value:h,cellSets:this.getValueCellInfo?this.getCellSet(this.rawIndexObject):[],rowCellType:e[p].hasChild&&e[p].isDrilled?"subTotal":"grand sum"===e[p].type?"grandTotal":"value",columnCellType:i.hasChild&&i.isDrilled?"subTotal":"grand sum"===i.type?"grandTotal":"value",aggregateType:g,skipFormatting:!1};this.getValueCellInfo&&this.getValueCellInfo(m),h=m.value,this.rawIndexObject={};var f=this.getParsedValue(u,a[o].value1),v=this.getParsedValue(u,a[o].value2);if(this.validateFilterValue(h,a[o].condition,f,v)||"grand sum"===e[p].type)"grand sum"!==e[p].type&&(r.push(t.extend({},e[p],null,!0)),r[r.length-1].isLevelFiltered=!0);else{var S=this.removefilteredData(e[p],this.valueFilteredData),y=S||e[p];this.validateFilteredParentData(y,this.valueFilteredData,s,0,n,l)}}else e[p].hasChild&&e[p].members.length>0&&"grand sum"!==e[p].type&&(r.push(t.extend({},e[p],null,!0)),r[r.length-1].members=[],r[r.length-1].isLevelFiltered=!0,this.getFilteredData(e[p].members,i,a,r[r.length-1].members,n,o,s,l))},e.prototype.getParsedValue=function(e,i){var a=i?i.toString():"";if(this.formatFields[e]&&i){var r=t.extend({},this.formatFields[e],null,!0);return delete r.name,this.globalize.parseNumber(a,r)}return this.globalize.parseNumber(a,{format:"N"})},e.prototype.removefilteredData=function(e,i){for(var a,r=t.extend([],i,null,!0),n=0;n<r.length;n++){if(e.isLevelFiltered&&e.axis===r[n].axis&&e.valueSort.levelName===r[n].valueSort.levelName&&e.actualText===r[n].actualText&&e.axis===r[n].axis&&e.level===r[n].level&&e.ordinal===r[n].ordinal){a=r[n],i.splice(n,1);break}i[n].hasChild&&i[n].members.length>0&&this.removefilteredData(e,i[n].members)}return a},e.prototype.validateFilteredParentData=function(e,t,i,a,r,n){if(t.length>0)for(var o=0,s=t;o<s.length;o++){var l=s[o];if(l.level===a){if("row"===n)for(var d=0,p=h=e.index;d<p.length;d++){S=p[d];i.index.indexOf(S)>=0&&i.index.splice(i.index.indexOf(S),1),e.valueSort.levelName.toString().indexOf(l.valueSort.levelName.toString())>=0&&l.level!==r&&l.index.indexOf(S)>=0&&l.index.splice(l.index.indexOf(S),1)}else for(var h=e.indexObject,u=0,c=Object.keys(h);u<c.length;u++){S=c[u];Object.prototype.hasOwnProperty.call(h,S)&&(delete i.indexObject[S],e.valueSort.levelName.toString().indexOf(l.valueSort.levelName.toString())>=0&&l.level!==r&&delete l.indexObject[S])}l&&l.members.length>0&&l.members[0].level===a+1&&l.members[0].level!==r&&this.validateFilteredParentData(e,l.members,i,a+1,r,n)}}else if("row"===n)for(var g=0,m=h=e.index;g<m.length;g++){S=m[g];i.index.indexOf(S)>=0&&i.index.splice(i.index.indexOf(S),1)}else for(var h=e.indexObject,f=0,v=Object.keys(h);f<v.length;f++){var S=v[f];Object.prototype.hasOwnProperty.call(h,S)&&delete i.indexObject[S]}},e.prototype.updateFramedHeaders=function(e,i,a,r,n){for(var o=0,s=e;o<s.length;o++){var l=s[o];this.isHeaderAvail=!1,(this.validateFilteredHeaders(l,a,n)||"grand sum"===l.type)&&("row"===n?this.rowCount+=this.rowValuesLength:this.columnCount+=this.customProperties.isTabularLayout?this.rowMaxLevel+this.colValuesLength:this.colValuesLength,r.push(t.extend({},l,null,!0)),r[r.length-1].members=[],l.hasChild&&l.isDrilled&&l.members.length>0&&this.updateFramedHeaders(l.members,i,a,r[r.length-1].members,n))}return this.filterFramedHeaders},e.prototype.validateFilteredHeaders=function(e,t,i){for(var a=0,r=t;a<r.length;a++){var n=r[a];if(!this.isHeaderAvail){if(e.actualText===n.actualText&&e.level===n.level&&e.valueSort.levelName===n.valueSort.levelName)return"row"===i?n.index.length>0?(this.isHeaderAvail=!0,e.index=n.index,!0):(this.isHeaderAvail=!1,e.index=n.index,!1):Object.keys(n.indexObject).length>0?(this.isHeaderAvail=!0,e.indexObject=n.indexObject,!0):(this.isHeaderAvail=!1,e.indexObject=n.indexObject,!1);n.hasChild&&n.members.length>0&&"grand sum"!==n.type&&this.validateFilteredHeaders(e,n.members,i)}}return this.isHeaderAvail},e.prototype.isEmptyDataAvail=function(e,t){this.isEmptyData=!1,e.length>0&&"grand sum"===e[e.length-1].type&&0===e[e.length-1].index.length&&(this.isEmptyData=!0),t.length>0&&"grand sum"===t[t.length-1].type&&0===Object.keys(t[t.length-1].indexObject).length&&(this.isEmptyData=!0),0!==e.length&&0!==t.length||(this.isEmptyData=!0)},e.prototype.updateGridData=function(e){this.updateDataSourceSettings(e,!0),this.data=e.dataSource,this.allowDataCompression&&(this.actualData=this.data,this.data=this.getGroupedRawData(e));for(var t=0,i=this.fields;t<i.length;t++){var a=i[t];this.fieldList[a].members={},this.fieldList[a].dateMember=[],this.fieldList[a].isMembersFilled=!1}this.fillFieldMembers(),this.filterMembers=[],this.cMembers=[],this.rMembers=[],this.updateFilterMembers(e),this.isEditing=!0,this.isDrillThrough=!0,this.generateGridData(e),this.isEditing=!1},e.prototype.generateGridData=function(e,i,a,r){void 0===i&&(i=!1),t.isNullOrUndefined(r)&&this.customProperties.isTabularLayout&&(this.rowMaxLevel=0),this.updateDataSourceSettings(e,i);var n=e.columns?e.columns:[],o=this.data,s=e.rows?e.rows:[],l=e.filterSettings,d=e.values?e.values:[];this.removeCount=0,this.isExpandAll=e.expandAll,this.drilledMembers=e.drilledMembers?e.drilledMembers:[],this.isEmptyData=!1;var p=[];if(s[0]&&s[0].showNoDataItems||n[0]&&n[0].showNoDataItems)for(h=0;h<this.valueMatrix.length;h++)p.push(h);for(var h=0;h<this.filterMembers.length;h++)this.filterPosObj[this.filterMembers[h]]=this.filterMembers[h];this.valueSortSettings.columnIndex=void 0,this.validateValueFields(),this.frameDrillObject(),this.isValueFilterEnabled&&!this.isEditing||r||(this.isLastHeaderHasMeasures=!0,this.columnCount=0,this.rowCount=0,this.cMembers=[],this.rMembers=[],0!==s.length&&0!==d.length&&(this.rMembers=this.getIndexedHeaders(s,o,0,s[0].showNoDataItems?p:this.filterMembers,"row","",this.allowValueFilter)),0!==n.length&&0!==d.length&&(this.cMembers=this.getIndexedHeaders(n,o,0,n[0].showNoDataItems?p:this.filterMembers,"column","",this.allowValueFilter)),this.insertAllMembersCommon(),this.saveDataHeaders=this.isValueFiltersAvail&&e.allowValueFilter?{rowHeaders:t.extend([],this.rMembers,null,!0),columnHeaders:t.extend([],this.cMembers,null,!0)}:{}),this.customProperties.isTabularLayout&&(this.showSubTotalsAtBottom=!0),this.pivotValues=[],this.headerContent=[],this.valueContent=[],this.valueFilteredData=[],this.filterFramedHeaders=[];var u=[],c=[],g=[],m=[],v=[],S=this.dataSourceSettings.values.length;if(this.isValueFiltersAvail&&e.allowValueFilter&&!r){this.valueFilteredData=[];var y=this.saveDataHeaders.rowHeaders?this.saveDataHeaders.rowHeaders:[],b=this.saveDataHeaders.columnHeaders?this.saveDataHeaders.columnHeaders:[];if(l.length>0){for(var C={},x={},w=0,T=d;w<T.length;w++){var M=T[w];x[M.name]=M}for(var D=0,O=l;D<O.length;D++){var P=O[D];y=g.length>0?g:y,b=m.length>0?m:b,this.valueFilteredData=[];var N=P.properties?P.properties:P;if("Value"===N.type&&this.fieldList[P.name]&&this.fieldList[P.name].isSelected){C[P.name]=P,N.items=[];for(var E=!1,F=s.length,I=n.length,L=0;L<F;L++)if(N.name===s[L].name&&x[N.measure]&&!E){E=!0,g=this.applyValueFiltering(s[L],L,y,this.columnGrandTotal?this.columnGrandTotal:"Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals?b[0]:b[b.length-1],C,this.valueFilteredData,"row");break}for(var A=0;A<I;A++)if(N.name===n[A].name&&x[N.measure]&&!E){E=!0,m=this.applyValueFiltering(n[A],A,b,this.rowGrandTotal?this.rowGrandTotal:"Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals?y[0]:y[y.length-1],C,this.valueFilteredData,"column");break}}}}g=g.length>0?g:y,m=m.length>0?m:b,this.isEmptyDataAvail(g,m);var R=f.getClonedFieldList(this.fieldList),k=this.data[0];this.getFieldList(k,this.enableSort,e.allowValueFilter),this.fillFieldMembers(),this.updateSortSettings(e.sortSettings,this.enableSort),this.filterMembers=[],this.updateFilterMembers(e),this.isLastHeaderHasMeasures=!0,this.rMembers=0!==s.length?this.getIndexedHeaders(s,o,0,s[0].showNoDataItems?p:this.filterMembers,"row",""):[],this.cMembers=0!==n.length?this.getIndexedHeaders(n,o,0,n[0].showNoDataItems?p:this.filterMembers,"column",""):[],this.insertAllMembersCommon(),this.updateFieldList(R),this.rowCount=0,this.columnCount=0,this.rMembers=this.updateFramedHeaders(this.rMembers,this.rMembers,g,this.filterFramedHeaders,"row"),this.filterFramedHeaders=[],this.cMembers=this.updateFramedHeaders(this.cMembers,this.cMembers,m,this.filterFramedHeaders,"column"),this.isValueFilterEnabled=!0}r||this.applyValueSorting(),this.isPagingOrVirtualizationEnabled&&(r?(this.rMembers=r.rowHeaders,this.cMembers=r.columnHeaders,this.rowCount=this.customProperties.isTabularLayout?this.rowCount+this.emptyRowsLength:r.rowHeadersCount,this.columnCount=r.columnHeadersCount):(this.headerCollection.rowHeaders=this.rMembers,this.headerCollection.columnHeaders=this.cMembers,this.headerCollection.rowHeadersCount=this.rowCount,this.headerCollection.columnHeadersCount=this.columnCount),this.calculatePagingValues()),!this.valueAxis&&this.isLastHeaderHasMeasures&&this.getAggregatedHeaders(s,n,this.rMembers,this.cMembers,d),this.getHeaderData(s,n,d,v,this.cMembers,c,this.pivotValues,0,this.valueAxis?1:S),this.insertSubTotals(),this.getTableData(v.length>0?v:this.rMembers,u,c,0,this.pivotValues,S,0,this.rowGrandTotal?this.rowGrandTotal:this.rMembers[this.rMembers.length-1],this.columnGrandTotal?this.columnGrandTotal:this.cMembers[this.cMembers.length-1]),this.applyAdvancedAggregate(u,c,this.pivotValues),this.customProperties.isTabularLayout&&(this.pivotValues=this.getTabularPivotValues(),this.setRowSpan(),this.rowCount=this.rowCount-this.emptyRowsLength),this.isEngineUpdated=!0,this.isEmptyDataAvail(this.rMembers,this.cMembers),this.clearProperties(a)},e.prototype.updateHeaders=function(e,i){e=t.isNullOrUndefined(e)?!(!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showRowGrandTotals)||!(this.dataSourceSettings.rows.length>0):e,(this.pageSettings&&this.removeRowGrandTotal||!e&&!this.rowGrandTotal)&&"grand sum"===this.rMembers[this.rMembers.length-1].type&&(this.rMembers=this.rMembers.slice(0,this.rMembers.length-1)),i=t.isNullOrUndefined(i)?!(!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showColumnGrandTotals)||!(this.dataSourceSettings.columns.length>0):i,(this.pageSettings&&this.removeColumnGrandTotal||!i&&!this.columnGrandTotal)&&"grand sum"===this.cMembers[this.cMembers.length-1].type&&(this.cMembers=this.cMembers.slice(0,this.cMembers.length-1))},e.prototype.updatePivotValues=function(e){var t=!(!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showRowGrandTotals)||!(this.dataSourceSettings.rows.length>0),i=!(!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showColumnGrandTotals)||!(this.dataSourceSettings.columns.length>0);if(e&&this.updateHeaders(t,i),(this.pageSettings&&this.removeRowGrandTotal||!t&&!this.rowGrandTotal)&&this.valueContent.length>0){a=1;this.valueAxis&&this.dataSourceSettings.values.length>0&&(a=1+this.dataSourceSettings.values.length),this.pivotValues[this.pivotValues.length-a]&&"grand sum"===this.pivotValues[this.pivotValues.length-a][0].type&&(this.pivotValues=this.pivotValues.slice(0,this.pivotValues.length-a),this.valueContent=this.valueContent.slice(0,this.valueContent.length-a))}if((this.pageSettings&&this.removeColumnGrandTotal||!i&&!this.columnGrandTotal)&&this.headerContent.length>0){var a=this.dataSourceSettings.values.length;if(this.valueAxis&&this.dataSourceSettings.values.length>0&&(a=1),this.pivotValues[0][this.pivotValues[0].length-a]&&"grand sum"===this.pivotValues[0][this.pivotValues[0].length-a].type)for(var r=0;r<this.pivotValues.length;r++)if(this.pivotValues[r]&&(this.pivotValues[r]=this.pivotValues[r].slice(0,this.pivotValues[r].length-a)),this.headerContent[r])for(var n=this.pivotValues[r].length;n<this.pivotValues[r].length+a;n++)delete this.headerContent[r][n]}this.removeRowGrandTotal=this.removeColumnGrandTotal=!1},e.prototype.onDrill=function(e){this.enableVirtualization||this.enablePaging||!this.customProperties.isTabularLayout||(this.rowMaxLevel=0),this.frameDrillObject(e);var t=this.getHeadersInfo(e.fieldName,e.axis);this.performDrillOperation(t.headers,e,t.fields,t.position,0),this.headerCollection.rowHeadersCount=this.rowCount,this.headerCollection.columnHeadersCount=this.columnCount,"row"===t.axis?this.headerCollection.rowHeaders=t.headers:this.headerCollection.columnHeaders=t.headers,this.updateEngine()},e.prototype.onSort=function(e,t){t&&this.updateDataSourceSettings(t,!0);var i=this.getHeadersInfo(e.name,"");this.fieldList[e.name].sort=e.order,this.performSortOperation(i.headers,e,i,0),this.updateEngine()},e.prototype.onFilter=function(e,t){this.updateDataSourceSettings(t,!0);var i=this.getHeadersInfo(e.name,"");this.isLastHeaderHasMeasures=!!(this.valueAxis&&"row"===i.axis||!this.valueAxis&&"column"===i.axis)||this.isLastHeaderHasMeasures,"Include"===e.type&&e.items.length===this.fieldList[e.name].dateMember.length?(this.fieldList[e.name].filter=[],this.fieldList[e.name].filterType=""):(this.fieldList[e.name].filter=e.items,this.fieldList[e.name].filterType=e.type);for(var a={},r=0,n=this.filterMembers;r<n.length;r++){var o=n[r];a[o]=o}this.filterMembers=[],this.fieldFilterMem={},this.updateFilterMembers(t);for(var s=this.filterMembers.filter(function(e){return void 0===a[e]}),l=0,d=e.items;l<d.length;l++)d[l];var p=this.dataSourceSettings.rows[0]&&this.dataSourceSettings.rows[0].showNoDataItems||this.dataSourceSettings.columns[0]&&this.dataSourceSettings.columns[0].showNoDataItems;if(p&&this.columnKeys[e.name]?p=!(!this.dataSourceSettings.columns[0]||!this.dataSourceSettings.columns[0].showNoDataItems):p&&"row"===i.axis&&(p=!(!this.dataSourceSettings.rows[0]||!this.dataSourceSettings.rows[0].showNoDataItems)),p){var h=[];this.filterPosObj={};for(u=0;u<s.length;u++)this.filterPosObj[s[u]]=s[u];for(var u=0;u<this.valueMatrix.length;u++)h.push(u);s=h}this.performFilterCommonUpdate(e,i,s),this.frameHeaderObjectsCollection=!1,this.headerObjectsCollection={},this.customProperties.isTabularLayout&&(this.rowCount=this.rowCount-this.emptyRowsLength),this.updateEngine()},e.prototype.onAggregation=function(e,t){t&&this.updateDataSourceSettings(t,!0),this.fieldList[e.name].aggregateType=e.type,this.rMembers=this.headerCollection.rowHeaders,this.cMembers=this.headerCollection.columnHeaders,this.allowDataCompression&&(this.data=this.getGroupedRawData(this.dataSourceSettings),this.generateValueMatrix()),this.updateEngine()},e.prototype.onCalcOperation=function(e,t){this.dataSourceSettings.calculatedFieldSettings=t.calculatedFieldSettings?t.calculatedFieldSettings:[],this.dataSourceSettings.values=t.values?t.values:[],this.rMembers=this.headerCollection.rowHeaders,this.cMembers=this.headerCollection.columnHeaders,this.getCalculatedField(this.fields),this.fieldList[e.name]?this.fieldList[e.name].formula=e.formula:(this.fieldList[e.name]={id:e.name,caption:e.name,type:"number",aggregateType:"CalculatedField",filterType:"",index:this.fields.length-1,filter:[],sort:this.enableSort?"Ascending":"None",isSelected:!0,isExcelFilter:!1,formula:e.formula},1===this.valueAxis?this.headerCollection.rowHeadersCount=this.rowCount=this.rowCount/(this.dataSourceSettings.values.length-1)*this.dataSourceSettings.values.length:this.headerCollection.columnHeadersCount=this.columnCount=this.columnCount/(this.dataSourceSettings.values.length-1)*this.dataSourceSettings.values.length),this.getFormattedFields(t),this.fillFieldMembers(),this.updateEngine()},e.prototype.performDrillOperation=function(e,t,i,a,r){for(var n=0;n<e.length;){if(a===r){var o=e[n].valueSort.levelName.split(this.valueSortSettings.headerDelimiter);if(t.memberName===o.join(t.delimiter?t.delimiter:"**")){if("down"===t.action){e[n].isDrilled=!0,e[n].members=this.getIndexedHeaders(i,this.data,a+1,e[n].index,t.axis,t.memberName.split(t.delimiter?t.delimiter:"**").join(this.valueSortSettings.headerDelimiter));var s=void 0;if("row"===t.axis)s=this.applyValueSorting(e[n].members,this.cMembers),e[n].members=s.rMembers,this.rowCount+=this.showSubTotalsAtBottom?1:0;else{var l=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&i[a].showSubTotals;this.columnCount-=l?0:this.colValuesLength,s=this.applyValueSorting(this.rMembers,e[n].members),e[n].members=s.cMembers}}else e[n].isDrilled=!1,this.updateHeadersCount(e[n].members,t.axis,a,i,"minus",!0),e[n].members=[],"row"===t.axis&&(this.rowCount-=this.showSubTotalsAtBottom?1:0);break}}else e[n].members.length>0&&(e[n].members=this.performDrillOperation(e[n].members,t,i,a,r+1));n++}return e},e.prototype.performSortOperation=function(e,t,i,a){for(var r=0;r<e.length;){if(i.position===a){e=this.getSortedHeaders(e,t.order.toString());break}e[r].members.length>0&&(e[r].members=this.performSortOperation(e[r].members,t,i,a+1)),r++}return e},e.prototype.performFilterDeletion=function(e,t,i,a,r){for(var n=0,o=!0,s=this;n<e.length&&o;)!function(){if(i.position===r){var l=s;e=e.filter(function(e){return""!==l.fieldFilterMem[t.name].memberObj[e.formattedText]&&(!l.fieldFilterMem[t.name].memberObj[e.formattedText]||"grand sum"===e.type)}),o=!1}else e[n].members.length>0&&(e[n].members=s.performFilterDeletion(e[n].members,t,i,a,r+1));n++}();var l=this;return e.filter(function(e){return e.members.length>0||"grand sum"===e.type||l.matchIndexes(e.indexObject,a)})},e.prototype.matchIndexes=function(e,t){var i=Object.keys(e),a=i.length;if(0===a)return!0;for(;a>-1;){if(void 0!==t[e[i[a]]])return!0;a--}return!1},e.prototype.performFilterAddition=function(e,t,i){for(var a=0,r=this;a<e.length;)!function(){var n=e[a].valueSort.levelName;if(r.headerObjectsCollection[n]){for(var o={},s=0,l=e[a].members;s<l.length;s++){var d=l[s];o[d.valueSort.levelName.toString()]=d.valueSort.levelName.toString()}var p=r.headerObjectsCollection[n].filter(function(e){return!o[e.valueSort.levelName.toString()]});e[a].members=e[a].members.concat(p),e[a].members=r.getSortedHeaders(e[a].members,r.fieldList[i.fields[e[a].members[0].level].name].sort),delete r.headerObjectsCollection[n]}e[a].members.length>0&&(e[a].members=r.performFilterAddition(e[a].members,t,i)),a++}();return e},e.prototype.performFilterCommonUpdate=function(e,t,i){if("row"===t.axis||"column"===t.axis){for(var a="row"===t.axis?this.rMembers:this.cMembers,r={},n=0,o=this.filterMembers;n<o.length;n++){var s=o[n];r[s]=s}if(this.fieldFilterMem[e.name]&&(a=this.performFilterDeletion(t.headers,e,t,r,0)),i.length>0&&t.fields.length>0){if(this.frameHeaderObjectsCollection=!0,t.fields.filter(function(e){return e.showNoDataItems}).length>0)for(var l=0;l<this.data.length;l++)i.push(l);this.headerObjectsCollection.parent=this.getIndexedHeaders(t.fields,this.data,0,i,t.axis,"");for(var d={},p=0,h=a=this.performFilterAddition(a,t.fields,t);p<h.length;p++){var u=h[p];d[u.valueSort.levelName.toString()]=u.valueSort.levelName.toString()}var c=this.headerObjectsCollection.parent.filter(function(e){return!d[e.valueSort.levelName.toString()]}),g=a.filter(function(e){return"grand sum"===e.type});g.length>0&&a.pop(),a=this.getSortedHeaders(a.concat(c),this.fieldList[t.fields[0].name].sort).concat(g),"row"===t.axis?(this.cMembers=this.getIndexedHeaders(this.dataSourceSettings.columns,this.data,0,this.filterMembers,"column",""),this.insertAllMember(this.cMembers,this.filterMembers,"","column")):(this.rMembers=this.getIndexedHeaders(this.dataSourceSettings.rows,this.data,0,this.filterMembers,"row",""),this.insertAllMember(this.rMembers,this.filterMembers,"","row"))}"row"===t.axis?this.rowCount=0:this.columnCount=0,this.updateHeadersCount(a,t.axis,0,t.fields,"plus",!1),"row"===t.axis?(t.position>0&&this.insertPosition(this.dataSourceSettings.rows,this.data,0,this.filterMembers,"row","",a),this.insertTotalPosition(a),this.rMembers=this.headerCollection.rowHeaders=a,this.headerCollection.rowHeadersCount=this.rowCount):(t.position>0&&this.insertPosition(this.dataSourceSettings.columns,this.data,0,this.filterMembers,"column","",a),this.insertTotalPosition(a),this.cMembers=this.headerCollection.columnHeaders=a,this.headerCollection.columnHeadersCount=this.columnCount)}else{var m=this.dataSourceSettings.rows[0]&&this.dataSourceSettings.rows[0].showNoDataItems||this.dataSourceSettings.columns[0]&&this.dataSourceSettings.columns[0].showNoDataItems;this.rMembers=this.getIndexedHeaders(this.dataSourceSettings.rows,this.data,0,m?i:this.filterMembers,"row",""),this.cMembers=this.getIndexedHeaders(this.dataSourceSettings.columns,this.data,0,m?i:this.filterMembers,"column",""),this.insertAllMembersCommon(),this.rowCount=0,this.columnCount=0,this.updateHeadersCount(this.cMembers,"column",0,this.dataSourceSettings.columns,"plus",!1),this.updateHeadersCount(this.rMembers,"row",0,this.dataSourceSettings.rows,"plus",!1),m&&(this.insertPosition(this.dataSourceSettings.rows,this.data,0,this.filterMembers,"row","",this.rMembers),this.insertPosition(this.dataSourceSettings.columns,this.data,0,this.filterMembers,"column","",this.cMembers)),this.headerCollection.rowHeaders=this.rMembers,this.headerCollection.rowHeadersCount=this.rowCount,this.headerCollection.columnHeaders=this.cMembers,this.headerCollection.columnHeadersCount=this.columnCount}this.applyValueSorting()},e.prototype.getHeadersInfo=function(e,t){this.rMembers=this.headerCollection.rowHeaders,this.cMembers=this.headerCollection.columnHeaders;for(var i="row"===(t=""===t?this.getAxisByFieldName(e):t)?this.rMembers:this.cMembers,a="row"===t?this.dataSourceSettings.rows:this.dataSourceSettings.columns,r=0,n=0,o=a;n<o.length&&o[n].name!==e;n++)r++;return{axis:t,fields:a,headers:i,position:r}},e.prototype.updateEngine=function(){this.customProperties.isTabularLayout&&(this.rowCount=this.rowCount+this.emptyRowsLength),this.removeCount=0,this.validateValueFields(),this.calculatePagingValues(),this.pivotValues=[],this.headerContent=[],this.valueContent=[];var e=[],t=[],i=[],a=this.dataSourceSettings.values.length;this.frameDrillObject(),this.getAggregatedHeaders(this.dataSourceSettings.rows,this.dataSourceSettings.columns,this.rMembers,this.cMembers,this.dataSourceSettings.values),this.getHeaderData(this.dataSourceSettings.rows,this.dataSourceSettings.columns,this.dataSourceSettings.values,i,this.cMembers,t,this.pivotValues,0,this.valueAxis?1:a),this.insertSubTotals(),this.getTableData(i.length>0?i:this.rMembers,e,t,0,this.pivotValues,a,0,this.rowGrandTotal?this.rowGrandTotal:this.rMembers[this.rMembers.length-1],this.columnGrandTotal?this.columnGrandTotal:this.cMembers[this.cMembers.length-1]),this.applyAdvancedAggregate(e,t,this.pivotValues),this.customProperties.isTabularLayout&&(this.pivotValues=this.getTabularPivotValues(),this.setRowSpan(),this.rowCount=this.rowCount-this.emptyRowsLength),this.isEngineUpdated=!0,this.isEmptyDataAvail(this.rMembers,this.cMembers)},e.prototype.getAxisByFieldName=function(e){for(var t=0,i="";t<4&&""===i;){switch(t){case 0:i=this.getFieldByName(e,this.dataSourceSettings.rows)?"row":"";break;case 1:i=this.getFieldByName(e,this.dataSourceSettings.columns)?"column":""}t++}return i},e.prototype.getFieldByName=function(e,t){return new i.DataManager({json:t}).executeLocal((new i.Query).where("name","equal",e))[0]},e.prototype.updateHeadersCount=function(e,t,i,a,r,n){var o=0,s=a[i],l=!0;for(l="column"===t?this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&(!s||s.showSubTotals):this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals&&(!s||s.showSubTotals);o<e.length;)"row"===t?this.rowCount=this.rowCount-("plus"===r?-(1===this.valueAxis?this.dataSourceSettings.values.length:1):1===this.valueAxis?this.dataSourceSettings.values.length:1):this.columnCount=this.columnCount-("plus"===r?-(1===this.valueAxis?1:this.dataSourceSettings.values.length):1===this.valueAxis?1:this.dataSourceSettings.values.length),e[o].members.length>0&&(this.updateHeadersCount(e[o].members,t,i+1,a,r,!0),"row"===t&&(this.rowCount+=this.showSubTotalsAtBottom&&e[o].hasChild&&e[o].isDrilled?1:0)),o++;"column"===t&&!l&&n&&(this.columnCount+="plus"===r?-this.colValuesLength:this.colValuesLength)},e.prototype.getSortedHeaders=function(e,t){var i="Grand Total"!==e[0].actualText?e[0].valueSort.axis:e[1].valueSort.axis,a=!(this.formatFields&&this.formatFields[i]&&this.formatFields[i].type),r=this.fieldList[i];if(a){if(r&&"number"===r.type&&e.length>0&&"string"==typeof e[0].actualText){for(var n=[],o=[],s=[],l=0;l<e.length;l++)if(isNaN(Number(e[l].actualText.toString().charAt(0))))n.push(e[l]);else{if(""!==e[l].actualText){o.push(e[l]);break}s.push(e[l])}return o.length>0&&(o=this.sortHeaders(i,r,e,r.sort,r.isAlphanumeric)),e}return this.sortHeaders(i,r,e,t,r.type)}return this.sortHeaders(i,r,e,t,"date")},e.prototype.sortHeaders=function(e,i,a,r,n){var o=!1,s=this.fieldList[e]&&this.fieldList[e].membersOrder?this.fieldList[e].membersOrder.slice():[],l={fieldName:e,sortOrder:r,members:s&&s.length>0?s:Object.keys(i.members),IsOrderChanged:!1},d="datetime"===(n="datetime"===n||"date"===n||"time"===n?this.formatFields[e]&&["date","dateTime","time"].indexOf(this.formatFields[e].type)>-1?n:"string":n)||"date"===n||"time"===n,p=!1;if(this.dataSourceSettings.groupSettings.length>0){var h=this.dataSourceSettings.groupSettings.filter(function(e){return e.name===i.id});!t.isNullOrUndefined(h)&&h.length>0&&(p="number"===h[0].type.toLocaleLowerCase()&&"string"===i.type.toLocaleLowerCase())}if(s&&s.length>0?f.applyCustomSort(l,a,n):(f.applyHeadersSort(a,r,n,p),o=!0),o&&this.getHeaderSortInfo){for(var u=[],c=0,g=0;c<a.length;c++){var m=a[c],v=d?m.dateText:m.actualText;"Grand Total"!==m.actualText&&(u[g++]=v)}l.members=u}return this.getHeaderSortInfo&&this.getHeaderSortInfo(l),l.IsOrderChanged&&f.applyCustomSort(l,a,n,!0),a},e.prototype.applyValueSorting=function(e,t){var i=!1;if(void 0===e||void 0===t){if(this.valueSortHeaderText=void 0,this.enableValueSorting&&this.valueSortSettings.headerText&&!this.valueSortHeaderText&&""!==this.valueSortSettings.headerText&&this.dataSourceSettings.values.length>0){this.valueSortHeaderText=this.valueSortSettings.headerText;for(var a=this.valueSortHeaderText.split(this.valueSortSettings.headerDelimiter),r=0,n=this.dataSourceSettings.values;r<n.length;r++){var o=n[r],s=o.caption?o.caption:o.name,l=a.indexOf(s);if(l>-1){a.splice(l,1),a.push(s),this.valueSortHeaderText=a.join(this.valueSortSettings.headerDelimiter);break}}}e=this.rMembers,t=this.cMembers,i=!0}if(this.valueSortHeaderText){for(var a=this.valueSortHeaderText.split(this.valueSortSettings.headerDelimiter),d="",p=void 0,h=void 0,u=void 0,c=0;c<this.dataSourceSettings.values.length;c++){if(this.dataSourceSettings.values[c].caption===a[a.length-1]){u=this.dataSourceSettings.values[c].name;break}u=a[a.length-1]}if((1===this.dataSourceSettings.values.length&&0===this.dataSourceSettings.columns.length||this.dataSourceSettings.values.length>1)&&u&&this.fieldList[u]){for(c=0;c<a.length-1;c++)d=""===d?a[c]:d+this.valueSortSettings.headerDelimiter+a[c];p=this.fieldList[u].index,h=this.fieldList[u].aggregateType}else{if(this.dataSourceSettings.alwaysShowValueHeader&&1!==a.length)for(c=0;c<a.length-1;c++)d=""===d?a[c]:d+this.valueSortSettings.headerDelimiter+a[c];else d=this.valueSortHeaderText;p=this.fieldList[this.dataSourceSettings.values[0].name].index,h=this.fieldList[this.dataSourceSettings.values[0].name].aggregateType}var g=void 0;0===this.valueAxis?(g=this.getMember(t,d))&&(e=this.sortByValueRow(e,g,this.valueSortSettings.sortOrder,p,h)):(g=this.getMember(e,d))&&(t=this.sortByValueRow(t,g,this.valueSortSettings.sortOrder,p,h)),i&&(this.rMembers=e,this.cMembers=t,this.isPagingOrVirtualizationEnabled&&(this.headerCollection.rowHeaders=this.rMembers,this.headerCollection.columnHeaders=this.cMembers))}return{rMembers:e,cMembers:t}},e.prototype.getMember=function(e,t){for(var i,a=e.length,r=0;r<a;r++){if(e[r].valueSort.levelName===t){i=e[r];break}if(e[r].members.length>0&&(i=this.getMember(e[r].members,t)),i)return i}return i},e.prototype.sortByValueRow=function(e,t,i,a,r){for(var n=[],o=0,s=e;o<s.length;o++)if("grand sum"===(u=s[o]).type)n.push({header:u});else{this.rawIndexObject={};var l=this.getAggregateValue(u.index,t.indexObject,a,r,!1),d={fieldName:this.fields[a],row:u,column:t,value:l,cellSets:this.getValueCellInfo?this.getCellSet(this.rawIndexObject):[],rowCellType:u.hasChild&&u.isDrilled?"subTotal":"grand sum"===u.type?"grandTotal":"value",columnCellType:t.hasChild&&t.isDrilled?"subTotal":"grand sum"===t.type?"grandTotal":"value",aggregateType:r,skipFormatting:!1};this.getValueCellInfo&&this.getValueCellInfo(d),l=d.value,this.rawIndexObject={},n.push({header:u,value:l})}for(var p=0,h=e=f.getSortedValue(n,i);p<h.length;p++){var u=h[p];u.members.length>0&&(u.members=this.sortByValueRow(u.members,t,i,a,r))}return e},e.prototype.insertAllMembersCommon=function(){this.rowGrandTotal=this.columnGrandTotal=null;var e=!(!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showRowGrandTotals)||!(this.dataSourceSettings.rows.length>0),t=!(!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showColumnGrandTotals)||!(this.dataSourceSettings.columns.length>0);this.isValueHasAdvancedAggregate?(this.insertAllMember(this.rMembers,this.filterMembers,"","row"),e&&(this.rowCount+=this.rowValuesLength),this.insertAllMember(this.cMembers,this.filterMembers,"","column"),t&&(this.columnCount+=this.colValuesLength)):(e?(this.insertAllMember(this.rMembers,this.filterMembers,"","row"),this.rowCount+=this.rowValuesLength):this.rowGrandTotal=this.insertAllMember([],this.filterMembers,"","row")[0],t?(this.insertAllMember(this.cMembers,this.filterMembers,"","column"),this.columnCount+=this.colValuesLength):this.columnGrandTotal=this.insertAllMember([],this.filterMembers,"","column")[0])},e.prototype.insertSubTotals=function(){for(var e=this.pivotValues.length,i=0;i<e;i++){var a=this.pivotValues[i];if(a)for(var r=void 0,n=1,o=a.length,s=void 0,l=1,d=this.showSubTotalsAtTop?this.reformAxisCount:o,p=this.showSubTotalsAtTop?l:d-1,h=void 0,u=void 0;l<d;){var c=a[p];if(c){r&&(r.colSpan=n,r.colIndex=this.showSubTotalsAtTop?r.colIndex+(n-1):r.colIndex-(n-1)),this.showSubTotalsAtTop&&(h=u=this.getMemberSpanCount(this.pivotValues[i],p)),s={index:c.index,indexObject:c.indexObject},c.index=[],c.indexObject={},r=t.extend({},c,null,!0),c.index=s.index,c.indexObject=s.indexObject;for(var g=i+1;this.pivotValues[g]&&!this.pivotValues[g][p];){var m=this.pivotValues[i][p];m.isDrilled||!this.valueAxis&&!this.isLastHeaderHasMeasures&&m.members&&m.members.length>0&&g>this.measureIndex||(m.rowSpan=g-i+1,r.rowSpan=g-i+1);var f="sum"===c.type||"grand sum"===c.type?c.type:"sum";this.pivotValues[g][p]=this.headerContent[g][p]={type:f,formattedText:"sum"===c.type||"grand sum"===c.type?c.formattedText:c.formattedText+" Total",axis:"column",hierarchyName:c.hierarchyName,level:-1,colIndex:p,rowIndex:g,valueSort:c.valueSort},c.valueSort&&c.valueSort[this.valueSortSettings.headerText]&&(this.valueSortSettings.columnIndex=p);var v=!1;"grand sum"===f?(m.rowSpan=g-i+1,r.rowSpan=g-i+1):"sum"!==m.type&&(m.isDrilled||this.valueAxisFields[m.actualText]&&!this.valueAxis&&!this.isLastHeaderHasMeasures&&m.members&&m.members.length>0)?(this.pivotValues[i+1][p].rowSpan=g-i,v=!0):this.pivotValues[g][p].rowSpan=-1,g>i+1&&("sum"===m.type||v)&&(this.pivotValues[g][p].rowSpan=-1),g++}n=1}else a[p]=this.headerContent[i][p]=t.extend({},r,null,!0),a[p].index=this.headerContent[i][p].index=s.index,a[p].indexObject=this.headerContent[i][p].indexObject=s.indexObject,n++,this.showSubTotalsAtTop?(u--,a[p].colSpan=u,a[p].colIndex=a[p].colIndex+(n-1)):(a[p].colSpan=n,a[p].colIndex=a[p].colIndex-(n-1));if(1===p&&r&&(this.showSubTotalsAtTop?(r.colSpan=h,r.colIndex=r.colIndex+(n-1)):(r.colSpan=n,r.colIndex=r.colIndex-(n-1))),this.showSubTotalsAtTop&&(a[p+1]||p+1===this.reformAxisCount)){var S=this.pivotValues[i][p-n+1];S.colSpan=h,this.pivotValues[i][p-n+1]=S}p=this.showSubTotalsAtTop?p+1:p-1,l++}}},e.prototype.getMemberSpanCount=function(e,t){for(var i=1,a=t+1;a<this.reformAxisCount&&!e[a];a++)i++;return i},e.prototype.frameDrillObject=function(e){void 0===e&&(e=null),this.fieldDrillCollection={};for(var t=0;t<this.drilledMembers.length;t++){for(var i=this.drilledMembers[t],a=!1,r=1,n=!1,o=this.fieldList[i.name],s=o&&o.expandAll,l=0;l<this.dataSourceSettings.rows.length;l++)if(this.dataSourceSettings.rows[l].name===i.name){r=((d=this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&this.measureIndex>-1&&this.measureIndex<=l)?l+1:l)+1,a=!!d,n=!0;break}if(!n)for(l=0;l<this.dataSourceSettings.columns.length;l++)if(this.dataSourceSettings.columns[l].name===i.name){var d=!this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&this.measureIndex>-1&&this.measureIndex<=l;r=(d?l+1:l)+1,a=!!d,n=!0;break}for(var p=0,h=i.items;p<h.length;p++){var u=h[p],c=u.split(i.delimiter);if(r===c.length){var g=i.name+this.valueSortSettings.headerDelimiter+c.join(this.valueSortSettings.headerDelimiter);if(this.fieldDrillCollection[g]=g,a){var m=!1;if(this.isExpandAll||s)for(var f=0,v=this.dataSourceSettings.values;f<v.length;f++){var S=v[f],y=S.caption?S.caption:S.name;if(c[this.measureIndex]=y,!(i.items.indexOf(c.join(i.delimiter))>-1)){m=!1;break}m=!0}((this.isExpandAll||s)&&m||!this.isExpandAll||!s)&&((c=u.split(i.delimiter)).splice(this.measureIndex,1),e&&e.memberName===u&&(e.memberName=c.join(i.delimiter)),g=i.name+this.valueSortSettings.headerDelimiter+c.join(this.valueSortSettings.headerDelimiter),this.fieldDrillCollection[g]=g)}}}}},e.prototype.getIndexedHeaders=function(e,i,a,r,n,o,s){var l=[],d=0;if(e&&e.length>0){d++;var p=e.length,h={},u=e[a].name,c=e[a],g=this.fieldList[u];if(t.isNullOrUndefined(this.reportDataType)){this.reportDataType={};for(U=0;U<this.dataSourceSettings.rows.length;U++)this.reportDataType[this.dataSourceSettings.rows[U].name]=this.dataSourceSettings.rows[U].dataType;for(U=0;U<this.dataSourceSettings.columns.length;U++)this.reportDataType[this.dataSourceSettings.columns[U].name]=this.dataSourceSettings.columns[U].dataType;for(U=0;U<this.dataSourceSettings.values.length;U++)this.reportDataType[this.dataSourceSettings.values[U].name]=this.dataSourceSettings.values[U].dataType}g.type=t.isNullOrUndefined(this.reportDataType[g.id])?g.type:this.reportDataType[g.id];var m=!1,f=this.formatFields[u]&&["date","dateTime","time"].indexOf(this.formatFields[u].type)>-1,v=r.length<1&&a>0||c.showNoDataItems,S={};if(v){for(var y=Object.keys(g.members),b=0,C=y.length;b<C;b++)(this.dataSourceSettings.showHeaderWhenEmpty||this.localeObj&&y[b]!==this.localeObj.getConstant("undefined"))&&(S[y[b]]=y[b]);r.length<1&&(m=!0,r.length=y.length)}n===this.dataSourceSettings.valueAxis&&this.measureIndex===a&&(this.dataSourceSettings.values.length>1||this.dataSourceSettings.alwaysShowValueHeader)&&(this.isLastHeaderHasMeasures=!1);for(var b=0,C=r.length;b<C;b++){var x={};t.isNullOrUndefined(e[a].showSubTotals)||e[a].showSubTotals||(x.showSubTotals=!1),x.hasChild=a<p-1,x.level=a,x.axis=n,x.colSpan=1,this.rowMaxLevel="row"===n&&this.rowMaxLevel<a?a:this.rowMaxLevel;var w=m?g.members[Object.keys(S)[0]].ordinal:this.valueMatrix[r[b]][g.index].ordinal,T=m?Object.keys(S)[0]:i[r[b]][this.fieldKeys[u]];if(T=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(T):T,!(t.isNullOrUndefined(T)||this.localeObj&&T===this.localeObj.getConstant("undefined"))||this.dataSourceSettings.showHeaderWhenEmpty){if(delete S[T],!v||!this.fieldFilterMem[u]||this.fieldFilterMem[u].memberObj[T]!==T){var M=f?{actualText:T,formattedText:g.dateMember[w-1].formattedText,dateText:g.dateMember[w-1].actualText}:{formattedText:null===T?this.localeObj?this.localeObj.getConstant("null"):String(T):void 0===T&&this.localeObj?u in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(T),actualText:null===T?this.localeObj?this.localeObj.getConstant("null"):String(T):void 0===T?this.localeObj?u in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(T):T};x.actualText=M.actualText,x.formattedText=M.formattedText,f&&(x.dateText=M.dateText);var D=!v||void 0!==this.filterPosObj[r[b]]&&!m,O=!1;if(v&&g.filter.length>0&&"include"===g.filterType&&(O=!0),h&&h[w]||O&&!(O&&g.filter.indexOf(T.toString())>-1))D&&(h[w].index.push(r[b]),h[w].indexObject[r[b]]=r[b]);else{h[w]={index:[],indexObject:{}},x.index=h[w].index,x.indexObject=h[w].indexObject,D&&(x.index=h[w].index=[r[b]],h[w].indexObject[r[b]]=r[b],x.indexObject=h[w].indexObject),x.ordinal=w,x.valueSort={},x.valueSort.axis=u,0!==a?(x.valueSort.levelName=o+this.valueSortSettings.headerDelimiter+x.formattedText,x.valueSort[o+this.valueSortSettings.headerDelimiter+x.formattedText]=1,x.valueSort.uniqueName=o+this.valueSortSettings.headerDelimiter+(x.actualText?x.actualText:x.formattedText),x.valueSort[o+this.valueSortSettings.headerDelimiter+(x.actualText?x.actualText:x.formattedText)]=1):(x.valueSort[x.formattedText]=1,x.valueSort.levelName=x.formattedText,x.valueSort[x.actualText?x.actualText:x.formattedText]=1,x.valueSort.uniqueName=x.actualText?x.actualText:x.formattedText);var P=x.valueSort.axis+this.valueSortSettings.headerDelimiter+x.valueSort.levelName,N=this.isExpandAll||c&&c.expandAll;x.isDrilled=!(!s||!this.isValueFiltersAvail)||(x.hasChild&&this.fieldDrillCollection[P]?!N||!this.valueAxis&&!this.isLastHeaderHasMeasures&&d>=this.measureIndex:N),x.members=[],l.push(x)}v&&!m&&a>0&&b+1===r.length&&Object.keys(S).length>0&&(m=!0,C=Object.keys(S).length,b=-1)}}else v&&!m&&a>0&&b+1===r.length&&Object.keys(S).length>0&&(C=Object.keys(S).length,m=!0,b=-1)}for(var E=0,F=l.length;E<F;E++){this.frameHeaderObjectsCollection||("row"===n?this.rowCount+=this.rowValuesLength+(l[E].isDrilled&&l[E].hasChild&&this.showSubTotalsAtBottom?1:0):this.columnCount+=this.colValuesLength);var I=null;if(l[E].valueSort&&l[E].valueSort.levelName&&(I=l[E].valueSort.levelName),o=I||l[E].formattedText,!this.dataSourceSettings.showHeaderWhenEmpty&&p-1>a&&l[E].index&&l[E].index.length>0)if(v&&e[a+1]&&e[a+1].name&&Object.keys(this.fieldList[e[a+1].name].members).length>0)l[E].hasChild=!0;else{for(var L=l[E].index.length,A=0,R=0;R<L;R++){T=i[l[E].index[R]][this.fieldKeys[e[a+1].name]];(t.isNullOrUndefined(T)||this.localeObj&&T===this.localeObj.getConstant("undefined"))&&A++}l[E].hasChild=A!==L}if(p-1>a&&l[E].isDrilled){this.columnCount-=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&c.showSubTotals||"column"!==n?0:this.colValuesLength;var k=l[E].index;l[E].members=this.getIndexedHeaders(e,i,a+1,void 0===k?[]:k,n,o,s),this.frameHeaderObjectsCollection&&(this.headerObjectsCollection[o]=l[E].members)}}if(this.enableSort){if(f)return this.sortHeaders(u,g,l,g.sort,"date");if("number"===g.type.toLowerCase()&&l.length>0&&"string"==typeof l[0].actualText&&l[0].actualText.match(/[a-zA-Z]+/g)){for(var j=[],q=void 0,H=[],V=[],U=0;U<l.length;U++)if(t.isNullOrUndefined(l[U].actualText.toString().match(/\d+/)))j.push(l[U]),q||"None"===g.sort||"Out of Range"===l[U].actualText&&(q=l[U],l.splice(U,1));else{if(""!==l[U].actualText){this.fieldList[u].isAlphanumeric=!0,H.push(l[U]);break}V.push(l[U])}return q&&("Ascending"===g.sort?"Grand Total"===l[0].actualText?l.splice(1,0,q):l.splice(0,0,q):"Grand Total"===l[l.length-1].actualText?l.splice(l.length-1,0,q):l.splice(l.length,0,q)),H.length>0&&this.sortHeaders(u,g,l,g.sort,g.isAlphanumeric),l}return this.sortHeaders(u,g,l,g.sort,g.type)}return l}return l},e.prototype.getOrderedIndex=function(e){for(var t={},i=0;i<e.length;i++)"grand sum"!==e[i].type&&(t[e[i].ordinal]=i);return t},e.prototype.insertPosition=function(e,t,i,a,r,n,o){var s=[],l=this.getOrderedIndex(o);if(e){for(var d={},p=e[i].name,h=this.fieldList[p],u=0,c=a.length;u<c;u++){var g={},m=this.valueMatrix[a[u]][h.index].ordinal,f=o[l[m]],v=t[a[u]][this.fieldKeys[p]];v=null===v?this.localeObj?this.localeObj.getConstant("null"):String(v):v;var S=this.formatFields[p]&&["date","dateTime","time"].indexOf(this.formatFields[p].type)>-1?this.getFormattedValue(v,p):{formattedText:v.toString(),actualText:v.toString()};f&&f.formattedText===S.formattedText&&(d&&d[m]?(d[m].index.push(a[u]),d[m].indexObject[a[u]]=a[u]):(d[m]={index:[],indexObject:{}},f.index=d[m].index=[a[u]],d[m].indexObject[a[u]]=a[u],f.indexObject=d[m].indexObject,f.valueSort={},f.valueSort.axis=p,0!==i?(f.valueSort.levelName=n+this.valueSortSettings.headerDelimiter+f.formattedText,f.valueSort[n+this.valueSortSettings.headerDelimiter+f.formattedText]=1,f.valueSort.uniqueName=n+this.valueSortSettings.headerDelimiter+(f.actualText?f.actualText:f.formattedText),f.valueSort[n+this.valueSortSettings.headerDelimiter+(f.actualText?f.actualText:f.formattedText)]=1):(f.valueSort[f.formattedText]=1,f.valueSort.levelName=f.formattedText,f.valueSort[f.actualText?f.actualText:f.formattedText]=1,f.valueSort.uniqueName=f.actualText?f.actualText:f.formattedText),g.members=[],s.push(g)))}for(var y=o.length-s.length;y>0;)s.push({members:[]}),y--;for(var b=0,C=s.length;b<C;b++)if(o[b].members.length>0){var x=null;o[b].valueSort&&o[b].valueSort.levelName&&(x=o[b].valueSort.levelName),n=x||o[b].formattedText,s[b].members=this.insertPosition(e,t,i+1,o[b].index,r,n,o[b].members)}return s}return s},e.prototype.insertTotalPosition=function(e){var t=e[e.length-1];if(t&&"grand sum"===t.type){t.index=this.filterMembers,t.indexObject={};for(var i=0,a=this.filterMembers.length;i<a;i++)t.indexObject[this.filterMembers[i]]=this.filterMembers[i]}return e},e.prototype.calculatePagingValues=function(){if(this.isPagingOrVirtualizationEnabled){1===this.valueAxis?this.rowValuesLength=this.dataSourceSettings.values.length:this.colValuesLength=this.dataSourceSettings.values.length,this.columnPageCount=Math.ceil(this.columnCount/this.pageSettings.columnPageSize),this.rowPageCount=Math.ceil(this.rowCount/this.pageSettings.rowPageSize),this.pageSettings.currentColumnPage=this.pageSettings.currentColumnPage>=this.columnPageCount||this.enableOptimizedRendering&&this.pageSettings.currentColumnPage>1&&(this.pageSettings.currentColumnPage+1)*this.colValuesLength>=this.columnPageCount?this.columnPageCount:this.pageSettings.currentColumnPage,this.pageSettings.currentRowPage=this.pageSettings.currentRowPage>=this.rowPageCount||this.enableOptimizedRendering&&this.pageSettings.currentRowPage>1&&(this.pageSettings.currentRowPage+1)*this.rowValuesLength>=this.rowPageCount?this.rowPageCount:this.pageSettings.currentRowPage;var e=this.enablePaging?1:this.enableOptimizedRendering?1.5:3;this.memberCnt=this.enablePaging?0:-this.rowValuesLength,this.rowStartPos=(this.pageSettings.currentRowPage*this.pageSettings.rowPageSize-this.pageSettings.rowPageSize)*(this.enablePaging?1:this.rowValuesLength)+(this.enablePaging?1:0);var t=this.enablePaging?this.rowStartPos:this.rowStartPos+this.pageSettings.rowPageSize*e*this.rowValuesLength>this.rowCount?this.rowCount-this.pageSettings.rowPageSize*e*this.rowValuesLength:this.rowStartPos;t<0&&(t=this.rowStartPos=0,this.pageSettings.currentRowPage=1),this.rowFirstLvl=(this.rowStartPos-t)%this.pageSettings.rowPageSize,this.rowStartPos=t,this.endPos=this.rowStartPos+this.pageSettings.rowPageSize*e*(this.enablePaging?1:this.rowValuesLength)-(this.enablePaging?1:0),this.endPos=this.endPos>this.rowCount+1?this.rowCount+1:this.endPos,this.rMembers=this.performSlicing(this.rMembers,[],this.rowStartPos,"row"),this.memberCnt=this.enablePaging?0:-this.colValuesLength,this.pageInLimit=!1,this.colHdrBufferCalculated=!1,this.colStartPos=(this.pageSettings.currentColumnPage*this.pageSettings.columnPageSize-this.pageSettings.columnPageSize)*(this.enablePaging?1:this.colValuesLength)+(this.enablePaging?1:0),(t=this.enablePaging?this.colStartPos:this.colStartPos+this.pageSettings.columnPageSize*e*this.colValuesLength>this.columnCount?this.columnCount-this.pageSettings.columnPageSize*e*this.colValuesLength:this.colStartPos)<0&&(t=this.colStartPos=0,this.pageSettings.currentColumnPage=1),this.colFirstLvl=(this.colStartPos-t)%this.pageSettings.columnPageSize,this.colStartPos=t,this.endPos=this.colStartPos+this.pageSettings.columnPageSize*e*(this.enablePaging?1:this.colValuesLength)-(this.enablePaging?1:0),this.endPos=this.endPos>this.columnCount+1?this.columnCount+1:this.endPos,this.cMembers=this.performSlicing(this.cMembers,[],this.colStartPos,"column"),this.memberCnt=-1,this.pageInLimit=!1,this.isValueHasAdvancedAggregate?("grand sum"!==this.rMembers[this.rMembers.length-1].type&&"grand sum"===this.headerCollection.rowHeaders[this.headerCollection.rowHeaders.length-1].type&&(this.rMembers.push(this.headerCollection.rowHeaders[this.headerCollection.rowHeaders.length-1]),this.removeRowGrandTotal=!0),"grand sum"!==this.cMembers[this.cMembers.length-1].type&&"grand sum"===this.headerCollection.columnHeaders[this.headerCollection.columnHeaders.length-1].type&&(this.cMembers.push(this.headerCollection.columnHeaders[this.headerCollection.columnHeaders.length-1]),this.removeColumnGrandTotal=!0)):(this.rowGrandTotal=this.rowGrandTotal?this.rowGrandTotal:this.headerCollection.rowHeaders[this.headerCollection.rowHeaders.length-1],this.columnGrandTotal=this.columnGrandTotal?this.columnGrandTotal:this.headerCollection.columnHeaders[this.headerCollection.columnHeaders.length-1])}},e.prototype.performSlicing=function(e,t,i,a){for(var r=0;e[r]&&!(this.enablePaging&&this.endPos<=this.memberCnt&&0!==r);){if(this.memberCnt+=e[r].level<=this.measureIndex?"column"===a?this.colValuesLength:this.rowValuesLength:1,i<=this.memberCnt&&this.endPos>=this.memberCnt&&!this.pageInLimit&&("column"===a?this.colFirstLvl=this.colFirstLvl+e[r].level:this.rowFirstLvl=this.rowFirstLvl+e[r].level,this.pageInLimit=!0),this.pageInLimit&&!this.enablePaging&&this.endPos<=this.memberCnt){if("column"!==a)break;if(0===e[r].members.length){if(this.colHdrBufferCalculated)break;this.colHdrBufferCalculated=!0,this.endPos+=e[r].level*this.colValuesLength}else if(this.colHdrBufferCalculated)break}if(t.push(e[r].members.length>0?this.removeChildMembers(e[r]):e[r]),e[r].members.length>0&&("column"===a?this.memberCnt-=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&this.columnKeys[e[r].valueSort.axis].showSubTotals?0:this.colValuesLength:this.showSubTotalsAtBottom&&this.memberCnt++,t[t.length-1].members=this.performSlicing(e[r].members,[],i,a)),this.pageInLimit||t.pop(),0===e[r].level&&this.pageInLimit&&this.endPos<=this.memberCnt)break;r++}return t},e.prototype.removeChildMembers=function(e){for(var t=Object.keys(e),i=0,a={};i<t.length;)a[t[i]]=e[t[i]],"members"===t[i]&&(a.members=[]),i++;return a},e.prototype.insertAllMember=function(e,t,i,a){var r=e.length,n={hasChild:!1,index:t,level:0,axis:a,isDrilled:!1,indexObject:{},members:[],actualText:"Grand"+(i=" Total"),formattedText:this.localeObj?this.localeObj.getConstant("grandTotal"):"Grand"+i,ordinal:r,type:"grand sum",valueSort:{}};n.valueSort[n.formattedText]=1,n.valueSort.levelName=n.formattedText,n.valueSort[n.actualText]=1,n.valueSort.uniqueName=n.actualText;for(var o=0,s=t.length;o<s;o++)n.indexObject[t[o]]=t[o];return"Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals?e.unshift(n):e.push(n),e},e.prototype.getTableData=function(e,i,a,r,n,o,s,l,d,p){for(var h=e.length,u=0;u<h;u++){var c=!this.valueAxis&&!this.isLastHeaderHasMeasures&&n.length<this.dataSourceSettings.columns.length+1?this.dataSourceSettings.columns.length+1:n.length,g=e[u];i[c]=g;var m=c-Number(Object.keys(i)[0]),v=!i[c].members.length;g.colIndex=0,g.rowIndex=c;var S=!1,y=this.dataSourceSettings.valueSortSettings.headerDelimiter;if(this.valueAxis&&0===this.dataSourceSettings.rows.length&&this.dataSourceSettings.values.length>1&&(this.rowIndex=t.isNullOrUndefined(this.rowIndex)&&!v&&0===this.dataSourceSettings.rows.length?g.index:this.rowIndex,S=this.valueAxis&&0===this.dataSourceSettings.rows.length&&g.valueSort.levelName&&0!==g.valueSort.levelName.toString().indexOf("Grand Total"+y),this.valueAxis&&0===this.dataSourceSettings.rows.length&&0===g.valueSort.levelName.toString().indexOf("Grand Total"+y)&&(g.index=this.rowIndex)),S)v||this.recursiveRowData(e,i,a,c,n,o,v,u,0,s,l,d);else{var b=!1;if(this.showSubTotalsAtBottom&&i[r]&&i[r].hasChild)for(var C=0,x=i[r].members;C<x.length;C++)if("value"===x[C].type){b=!0;break}if(b&&!i[c].isSum&&i[c].members&&0===i[c].members.length)continue;if(n[c]||(n[c]=[],this.valueContent[m]={}),n[c][0]=i[c]=this.valueContent[m][0]=f.getFormattedHeader(g,this),this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)){var w=c,T=m,M=c,D=!1;if(((0!==s||0!==this.measureIndex)&&!v||v)&&"value"===g.type&&!g.valueSort.axis||s>this.measureIndex&&"row"===g.axis&&g.valueSort.axis)for(var O=0,P=!1,N=g.valueSort.uniqueName?g.valueSort.uniqueName.toString().split(this.valueSortSettings.headerDelimiter):[],E=0,F=1,I=a.length;E<I;++E){if(!P)for(O=0;O<o;O++)if(N.indexOf(this.dataSourceSettings.values[O].name)>-1){P=!0,D=!0;break}if(s>this.measureIndex&&"row"===g.axis&&g.valueSort.axis)this.updateRowData(e,a,c,n,O,u,E,F,m,l,d);else{if(!i[r]){D=!1;break}var L=this.showSubTotalsAtBottom&&p?p:r;this.updateRowData(i,a,c,n,O,L,E,F,m,l,d)}F=n[c].length}if(!D)for(var E=0,F=1,I=a.length;E<I;++E)F=n[c].length,n[w][F]=this.valueContent[T][F]={axis:"value",actualText:"",colSpan:1,colIndex:F,formattedText:"",hasChild:!1};this.recursiveRowData(e,i,a,M,n,o,v,u,o,s,l,d)}else{for(var E=0,F=1,I=a.length;E<I;++E)for(var A=a[E].valueSort.uniqueName?a[E].valueSort.uniqueName.toString().split(this.valueSortSettings.headerDelimiter):[],O=0;O<o;O++)this.valueAxis||this.isLastHeaderHasMeasures?(this.updateRowData(e,a,c,n,O,u,E,F,m,l,d),F=n[c].length):A.indexOf(this.dataSourceSettings.values[O].name)>-1&&(this.updateRowData(e,a,c,n,O,u,E,F,m,l,d),F=n[c].length);this.recursiveRowData(e,i,a,c,n,o,v,u,0,s,l,d)}}}},e.prototype.insertRowSubTotals=function(e,t,i,a,r,n,o,s){var l=!!e[i].type&&("value"===e[i].type&&e[i].valueSort.levelName!==e[i].actualText);if(e[i].hasChild&&e[i].members.length>0){var d=[],p=f.frameHeaderWithKeys(e[i]);if("value"===e[i].members[0].type){for(var h=0,u=[],c=1,g=0,m=p.members;g<m.length;g++){var v=m[g];"value"===v.type&&(u[u.length]=v)}for(;h<u.length;){var S=f.frameHeaderWithKeys(u[h]),y=void 0;for(c;c<e.length;c++)if(e[c]&&e[c].valueSort.levelName===S.valueSort.levelName){y=e.indexOf(e[c]);break}y>-1&&(d[d.length]=y),S.formattedText=p.formattedText+" "+S.formattedText,S.isSum=!0,S.members=[],this.getTableData([S],e,t,i,a,r,n,o,s),h++}}else{p.formattedText=p.formattedText+" Total",p.members=[],p.isDrilled=!1,p.hasChild=!1,p.isSum=!0,p.type="sum";var b=l?this.getParentIndex(e,p):0;this.getTableData([p],e,t,i,a,r,n,o,s,b),d=[i]}for(y=0;y<d.length;y++){var C=a[d[y]];C=C.map(function(e){return e.formattedText=0===e.colIndex?e.formattedText:"",e}),a[d[y]]=C}}},e.prototype.getParentIndex=function(e,t){for(var i=0,a=e.length-1;a>0;a--)if(t.level===e[a].level&&e[a].index){i=a;break}return i},e.prototype.getAggregatedHeaders=function(e,t,i,a,r){this.selectedHeaders={selectedHeader:[],values:[]};for(var n=r.length,o=0;o<n;o++)switch(r[o].type){case"DifferenceFrom":case"PercentageOfDifferenceFrom":var s=void 0,l=void 0;this.selectedHeaders.values.push(r[o].name),r[o].baseField&&r[o].baseItem?(s=r[o].baseField,l=r[o].baseItem):this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&t.length>0?(s=t[0].name,l=Object.keys(this.fieldList[t[0].name].members)[0]):e.length>0&&(s=e[0].name,l=Object.keys(this.fieldList[e[0].name].members)[0]);for(var d=!1,p=0,h=e;p<h.length;p++)if(h[p].name===s){this.getAggregatedHeaderData(i,r[o].name,l,!1,"row",r[o].type,this.selectedHeaders.selectedHeader,o),d=!0;break}if(!d)for(var u=0,c=t;u<c.length;u++)if(c[u].name===s){this.getAggregatedHeaderData(a,r[o].name,l,!1,"column",r[o].type,this.selectedHeaders.selectedHeader,o);break}break;case"PercentageOfParentRowTotal":case"PercentageOfParentColumnTotal":this.selectedHeaders.values.push(r[o].name),this.getAggregatedHeaderData("PercentageOfParentRowTotal"===r[o].type?i:a,r[o].name,void 0,!1,"PercentageOfParentRowTotal"===r[o].type?"row":"column",r[o].type,this.selectedHeaders.selectedHeader,o);break;case"RunningTotals":this.selectedHeaders.values.push(r[o].name),this.getAggregatedHeaderData(this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)?a:i,r[o].name,void 0,!1,this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)?"column":"row",r[o].type,this.selectedHeaders.selectedHeader,o);break;case"PercentageOfParentTotal":s=void 0;this.selectedHeaders.values.push(r[o].name),r[o].baseField?s=r[o].baseField:this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&t.length>0?s=t[0].name:e.length>0&&(s=e[0].name);for(var d=!1,g=e.length,m=0;m<g;m++)if(e[m].name===s){f=m>=this.measureIndex?m+1:m;this.getAggregatedHeaderData(i,r[o].name,void 0,!1,"row",r[o].type,this.selectedHeaders.selectedHeader,o,f),d=!0;break}if(!d)for(var g=t.length,m=0;m<g;m++)if(t[m].name===s){var f=m;this.valueAxis||this.isLastHeaderHasMeasures||(f=m>=this.measureIndex?m+1:m),this.getAggregatedHeaderData(a,r[o].name,void 0,!1,"column",r[o].type,this.selectedHeaders.selectedHeader,o,f);break}}},e.prototype.getAggregatedHeaderData=function(e,i,a,r,n,o,s,l,d){for(var p=0,h=e;p<h.length;p++){var u=h[p];switch(o){case"DifferenceFrom":case"PercentageOfDifferenceFrom":if(-1!==u.valueSort.levelName.toString().split(this.valueSortSettings.headerDelimiter).indexOf(a)){var c=[];if(!r&&"row"===n)for(var g=0,m=e;g<m.length;g++){var f=m[g];f.level>=u.level&&c.push(f)}if(s.push(this.updateSelectedHeaders(a,u.level,n,r,i,o,u.valueSort.levelName,r?[u]:"column"===n?e:c,l+1)),u.members.length>0){var v=!1,S=[];if("row"===n)for(var y=0,b=u.members;y<b.length;y++){if("value"!==(T=b[y]).type||0!==T.members.length){S.push(T),v=!1;break}v=!0}(!v&&S.length>0||"column"===n)&&this.getAggregatedHeaderData("column"===n?u.members:S,i,a,!0,n,o,s[s.length-1].childMembers,l)}}else u.members.length>0&&this.getAggregatedHeaderData(u.members,i,a,!1,n,o,s,l);break;case"RunningTotals":case"PercentageOfParentRowTotal":case"PercentageOfParentColumnTotal":"grand sum"===u.type?s.push(this.updateSelectedHeaders(void 0,u.level,n,!1,i,o,u.valueSort.levelName,e,l+1)):u.members.length>0&&(s.push(this.updateSelectedHeaders(void 0,u.level,n,!1,i,o,u.valueSort.levelName,u.members,l+1)),this.getAggregatedHeaderData(u.members,i,void 0,!1,n,o,s,l));break;case"PercentageOfParentTotal":if("grand sum"!==u.type)if(u.valueSort.levelName.split(this.valueSortSettings.headerDelimiter).length-1===d)if(u.members.length>0){if(r)for(var C=s[s.length-1].aggregateHeaders,x=0,w=u.members;x<w.length;x++){var T=w[x];C.push(t.extend({},T,null,!0))}else{var M=t.extend([],u.members,null,!0);s.push(this.updateSelectedHeaders(void 0,u.level,n,!1,i,o,u.valueSort.levelName,M,l+1)),(C=s[s.length-1].aggregateHeaders).push(t.extend({},u,null,!0))}this.getAggregatedHeaderData(u.members,i,void 0,!0,n,o,s,l,d+1)}else r||s.push(this.updateSelectedHeaders(void 0,u.level,n,!1,i,o,u.valueSort.levelName,[u],l+1));else u.members.length>0&&this.getAggregatedHeaderData(u.members,i,void 0,!1,n,o,s,l,d)}}},e.prototype.updateSelectedHeaders=function(e,i,a,r,n,o,s,l,d){return{name:e,level:i,axis:a,isChild:r,value:n,type:o,uniqueName:s,aggregateHeaders:t.extend([],l,null,!0),childMembers:[],valueCount:d}},e.prototype.applyAdvancedAggregate=function(e,t,i){if(this.aggregatedValueMatrix=[],this.selectedHeaders.values.length>0){for(var a={},r=[],n=[],o=!1,s=i.length,l=0;l<s;l++)if(void 0!==i[l]&&void 0!==i[l][0]){if(!o)for(var d=i[l].length,p=0;p<d;p++){var h=i[l][p].actualText;"value"===i[l][p].axis&&-1!==this.selectedHeaders.values.indexOf(h)&&(r.push(p),o=!0)}if(!(this.showSubTotalsAtBottom&&i[l][0].isDrilled&&i[l][0].hasChild)&&r.length>0&&"value"===i[l][r[0]].axis&&-1!==this.selectedHeaders.values.indexOf(i[l][r[0]].actualText)){n.push(l);for(var u=0,c=r;u<c.length;u++)a[l+","+(f=c[u])]=[l,f]}}this.updateAggregates(e,t,i,this.selectedHeaders.selectedHeader,r,n,a);for(var g=0,m=Object.keys(a);g<m.length;g++){var f=m[g];i[a[f][0]][a[f][1]].formattedText=this.selectedHeaders.selectedHeader.length>0?this.emptyCellTextContent:"#N/A",this.aggregatedValueMatrix[a[f][0]]||(this.aggregatedValueMatrix[a[f][0]]=[]),this.aggregatedValueMatrix[a[f][0]][a[f][1]]=0}this.updatePivotValues(!0)}},e.prototype.updateAggregates=function(e,i,a,r,n,o,s){for(var l=0,d=r;l<d.length;l++){var p=d[l],h=p.aggregateHeaders,u=p.value,c=p.type,g=p.uniqueName,m="row"===p.axis,f=void 0,v=[],S=[],y=[],b=[],C=[],x=[];if(-1!==["DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentRowTotal","PercentageOfParentColumnTotal","PercentageOfParentTotal","RunningTotals"].indexOf(p.type))if(m){if("RunningTotals"!==p.type)for(var w=0,T=o;w<T.length;w++)if(void 0!==e[Ue=T[w]]&&e[Ue].valueSort[g]){f=e[Ue],C=0===this.valueAxis||this.valueAxis&&a[Ue]&&a[Ue][1]&&a[Ue][1].actualText===u?a[Ue]:[];break}}else{for(var M=a.length,D=0;D<M&&(void 0!==a[D]&&void 0===a[D][0]);D++)y.push(a[D]);for(var O=y.length;O--;){var P=(A=y[O][n[0]]).actualText;-1===this.selectedHeaders.values.indexOf(P)&&(S=y[O],O=0)}if("RunningTotals"!==p.type){for(var N=S.length,E=0;E<N;E++){xe=!1;if(void 0!==S[E]&&S[E].valueSort[g]){f=S[E];for(var F=a.length,D=0;D<F;D++)void 0!==(A=a[D])&&void 0!==A[0]&&"value"===A[E].axis&&-1!==this.selectedHeaders.values.indexOf(A[E].actualText)&&(xe=!0,x[D]=A[E],b.push(D));if(xe)break}}if(0===x.length&&0===b.length)for(var N=S.length,E=0;E<N;E++){xe=!1;if(void 0!==S[E]&&0===S[E].valueSort.levelName.indexOf(g)){f=S[E];for(var I=a.length,L=0;L<I;L++){var A=a[L];void 0!==A&&void 0!==A[0]&&"value"===A[E].axis&&-1!==this.selectedHeaders.values.indexOf(A[E].actualText)&&(xe=!0,b.push(L))}if(xe)break}}}}switch(p.type){case"DifferenceFrom":case"PercentageOfDifferenceFrom":var R=p.isChild;if(m){if(R){for(var k=g.split(this.valueSortSettings.headerDelimiter),j=0,q=o;j<q.length;j++)if(void 0!==e[qe=q[j]]&&-1!==(ee=e[qe].valueSort.levelName.split(this.valueSortSettings.headerDelimiter)).indexOf(k[k.length-1])&&f&&e[qe].level===f.level)for(var H=0,V=n;H<V.length;H++){Le=V[H];"value"===(X=a[qe][Le]).axis&&X.actualText===u&&(v.push([qe,Le]),s[qe+","+Le]&&delete s[qe+","+Le])}}else for(var U=0,_=h;U<_.length;U++)for(var B=_[U],G=0,z=o;G<z.length;G++)if(void 0!==e[Ue=z[G]]&&e[Ue].valueSort[B.valueSort.levelName]&&e[Ue].level===f.level&&"grand sum"!==e[Ue].type)for(var W=0,Q=n;W<Q.length;W++){Le=Q[W];"value"===(X=a[Ue][Le]).axis&&X.actualText===u&&(v.push([Ue,Le]),s[Ue+","+Le]&&delete s[Ue+","+Le])}for(var Y=0,K=v;Y<K.length;Y++){var X=a[(Le=K[Y])[0]][Le[1]],J=t.isNullOrUndefined(C[Le[1]].actualValue)?0:C[Le[1]].actualValue,Z=(t.isNullOrUndefined(X.actualValue)?0:X.actualValue)-J;Z=isNaN(Z)?0:0===X.value&&0===C[Le[1]].value?0:Z,this.aggregatedValueMatrix[Le[0]]||(this.aggregatedValueMatrix[Le[0]]=[]),"DifferenceFrom"===c?(this.aggregatedValueMatrix[Le[0]][Le[1]]=Z,X.formattedText=0===Z?this.emptyCellTextContent:this.getFormattedValue(Z,u).formattedText):(Z=0===J?0:Z/J,this.aggregatedValueMatrix[Le[0]][Le[1]]=Z,X.formattedText=X.showSubTotals?0!==Z?this.globalize.formatNumber(Z,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,X.actualText)}):this.emptyCellTextContent:X.formattedText)}}else{if(R)for(var k=g.split(this.valueSortSettings.headerDelimiter),N=S.length,$=0;$<N;$++){xe=!1;if(void 0!==S[$]){var ee=S[$].valueSort.levelName.split(this.valueSortSettings.headerDelimiter);if(-1!==ee.indexOf(k[k.length-1])&&S[$].level===f.level){for(var te=0,ie=b;te<ie.length;te++)"value"===(X=a[Le=ie[te]][$]).axis&&X.actualText===u&&(xe=!0,v.push([Le,$]),s[Le+","+$]&&delete s[Le+","+$]);if(xe)break}}}else for(var ae=0,re=h;ae<re.length;ae++)for(var B=re[ae],N=S.length,E=0;E<N;E++){xe=!1;if(void 0!==S[E]&&S[E].valueSort[B.valueSort.levelName]&&f&&S[E].level===f.level&&"grand sum"!==S[E].type){for(var ne=0,oe=b;ne<oe.length;ne++)"value"===(X=a[Le=oe[ne]][E]).axis&&X.actualText===u&&(xe=!0,v.push([Le,E]),s[Le+","+E]&&delete s[Le+","+E]);if(xe)break}}var se=void 0;0===x.length&&(se=this.getSelectedColumn(p.uniqueName,i));for(var le=0,de=v;le<de.length;le++){var X=a[(Le=de[le])[0]][Le[1]],pe=0;if(0===x.length){Ne=this.getSelectedRow(X.rowHeaders,e);pe=this.getAggregateValue(Ne.index,se.indexObject,this.fieldList[u].index,p.type,!1)}else pe=x[Le[0]].value;Z=X.value-pe;Z=isNaN(Z)?0:Z,this.aggregatedValueMatrix[Le[0]]||(this.aggregatedValueMatrix[Le[0]]=[]),"DifferenceFrom"===c?(X.formattedText=0===Z?this.emptyCellTextContent:this.getFormattedValue(Z,u).formattedText,this.aggregatedValueMatrix[Le[0]][Le[1]]=Z):(Z=0===x[Le[0]].value?0:Z/x[Le[0]].value,X.formattedText=0!==Z?this.globalize.formatNumber(Z,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,X.actualText)}):this.emptyCellTextContent,this.aggregatedValueMatrix[Le[0]][Le[1]]=Z)}}p.childMembers.length>0&&this.updateAggregates(e,i,a,p.childMembers,n,o,s);break;case"PercentageOfParentRowTotal":case"PercentageOfParentColumnTotal":case"PercentageOfParentTotal":if(m){for(var he=0,ue=h;he<ue.length;he++)for(var B=ue[he],ce=0,ge=o;ce<ge.length;ce++)if(void 0!==e[D=ge[ce]]&&e[D].valueSort[B.valueSort.levelName]&&e[D].level===B.level)for(var me=0,fe=n;me<fe.length;me++){Le=fe[me];"value"===(X=a[D][Le]).axis&&X.actualText===u&&(v.push([D,Le]),s[D+","+Le]&&delete s[D+","+Le])}for(var ve=0,Se=v;ve<Se.length;ve++){var X=a[(D=Se[ve])[0]][D[1]],ye=0;ye=0===C.length&&f?this.getAggregateValue(f.index,i[D[1]-1].indexObject,this.fieldList[u].index,p.type,!1):C[D[1]]?C[D[1]].actualValue:0;Z=X.value/ye;Z=isNaN(Z)?0:Z,X.formattedText=X.showSubTotals?0!==Z?this.globalize.formatNumber(Z,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,X.actualText)}):this.emptyCellTextContent:X.formattedText,this.aggregatedValueMatrix[D[0]]||(this.aggregatedValueMatrix[D[0]]=[]),this.aggregatedValueMatrix[D[0]][D[1]]=Z}}else{for(var be=0,Ce=h;be<Ce.length;be++)for(var B=Ce[be],N=S.length,L=0;L<N;L++){var xe=!1;if(void 0!==S[L]&&S[L].valueSort[B.valueSort.levelName]){for(var we=0,Te=b;we<Te.length;we++){Le=Te[we];this.showSubTotalsAtBottom&&a[Le][0].isDrilled&&a[Le][0].hasChild||"value"===(X=a[Le][L]).axis&&X.actualText===u&&(xe=!0,v.push([Le,L]),s[Le+","+L]&&delete s[Le+","+L])}if(xe)break}}var Me=void 0;0===x.length&&(Me=this.getSelectedColumn(p.uniqueName,i));for(var De=0,Oe=v;De<Oe.length;De++){var X=a[(D=Oe[De])[0]][D[1]],Pe=0;if(0===x.length){var Ne=this.getSelectedRow(X.rowHeaders,e);Pe=this.getAggregateValue(Ne.index,Me.indexObject,this.fieldList[u].index,p.type,!1)}else Pe=x[D[0]].value;var Ee=X.value/Pe;Ee=isNaN(Ee)?0:Ee,X.formattedText=0!==Ee?this.globalize.formatNumber(Ee,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,X.actualText)}):this.emptyCellTextContent,this.aggregatedValueMatrix[D[0]]||(this.aggregatedValueMatrix[D[0]]=[]),this.aggregatedValueMatrix[D[0]][D[1]]=Ee}}break;case"RunningTotals":if(m)for(var Fe=0,Ie=n;Fe<Ie.length;Fe++)for(var Le=Ie[Fe],Z=0,Ae=0,Re=h;Ae<Re.length;Ae++)for(var B=Re[Ae],ke=0,je=o;ke<je.length;ke++){var qe=je[ke];if(void 0!==e[qe]){X=a[qe][Le];if(void 0!==e[qe]&&e[qe].valueSort[B.valueSort.levelName]&&e[qe].level===B.level&&"value"===X.axis&&X.actualText===u){"grand sum"!==e[qe].type&&(Z+=X.showSubTotals||!t.isNullOrUndefined(X.actualValue)&&isNaN(X.actualValue)?t.isNullOrUndefined(X.value)||isNaN(X.value)?null:X.value:X.actualValue,X.formattedText=X.showSubTotals?0===Z&&X.actualValue&&0!==X.actualValue?"":this.getFormattedValue(Z,u).formattedText:X.formattedText,this.aggregatedValueMatrix[qe]||(this.aggregatedValueMatrix[qe]=[]),this.aggregatedValueMatrix[qe][Le]=Z),s[qe+","+Le]&&delete s[qe+","+Le];break}}}else for(var He=0,Ve=o;He<Ve.length;He++){var Ue=Ve[He];if(void 0!==a[Ue])for(var Z=0,_e=0,Be=h;_e<Be.length;_e++)for(var B=Be[_e],Ge=e[Ue].hasChild&&e[Ue].isDrilled&&(!t.isNullOrUndefined(e[Ue].showSubTotals)&&!e[Ue].showSubTotals||!this.dataSourceSettings.showSubTotals||!this.dataSourceSettings.showRowSubTotals),N=S.length,E=0;E<N;E++){X=a[Ue][E];if(void 0!==S[E]&&S[E].valueSort[B.valueSort.levelName]&&"value"===X.axis&&X.actualText===u){"grand sum"!==S[E].type&&(t.isNullOrUndefined(X.value)||(Z+=X.value),X.formattedText=Ge?"":this.getFormattedValue(Z,u).formattedText,this.aggregatedValueMatrix[Ue]||(this.aggregatedValueMatrix[Ue]=[]),this.aggregatedValueMatrix[Ue][E]=Z),s[Ue+","+E]&&delete s[Ue+","+E];break}}}}}},e.prototype.getSelectedColumn=function(e,t){for(var i={axis:"column",index:[],indexObject:{}},a=0,r=t;a<r.length;a++){var n=r[a];n&&n.valueSort&&0===n.valueSort.levelName.indexOf(e)&&(i.index=i.index.concat(n.index).sort(function(e,t){return e-t}),i.indexObject=v({},i.indexObject,n.indexObject))}return i},e.prototype.getSelectedRow=function(e,t){for(var i=0,a=t;i<a.length;i++){var r=a[i];if(r){if(r.valueSort&&r.valueSort.levelName===e)return r;if(""===e&&"grand sum"===r.type)return r}}return null},e.prototype.recursiveRowData=function(e,i,a,r,n,o,s,l,d,p,h,u){s||this.getTableData(i[r].members,i,a,r,n,o,p+1,h,u),this.showSubTotalsAtBottom&&(t.isNullOrUndefined(e[l].showSubTotals)||e[l].showSubTotals)&&this.insertRowSubTotals(i,a,r,n,o,p,h,u),this.isPagingOrVirtualizationEnabled||(i[r].members=[])},e.prototype.updateRowData=function(e,i,a,r,n,o,s,l,d,p,h){var u=this.fieldList[this.dataSourceSettings.values[n].name].index,c=this.fieldList[this.dataSourceSettings.values[n].name].aggregateType,g=this.dataSourceSettings.values[n].name,m=[],f={},v=0,S=0;switch(c){case"Index":for(var y=["cVal","rTotalVal","cTotalVal","gTotalVal"],b=0,C=0,x=m=[[e[o],i[s]],[e[o],h],[p,i[s]],[p,h]];C<x.length;C++){M=x[C];f[y[b]]=this.getAggregateValue(M[0].index,M[1].indexObject,u,c,0!==b),b++}D=f.cVal*f.gTotalVal/(f.rTotalVal*f.cTotalVal);v=!(e[o].members.length>0&&e[o].hasChild&&e[o].isDrilled)||(t.isNullOrUndefined(e[o].showSubTotals)||e[o].showSubTotals)&&this.dataSourceSettings.showRowSubTotals&&this.dataSourceSettings.showSubTotals?t.isNullOrUndefined(f.cVal)?f.cVal:isNaN(D)?0:D:void 0,S=t.isNullOrUndefined(f.cVal)?f.cVal:isNaN(D)?0:D;break;case"PercentageOfGrandTotal":case"PercentageOfColumnTotal":case"PercentageOfRowTotal":(m=[[e[o],i[s]]]).push("PercentageOfGrandTotal"===c?[p,h]:"PercentageOfColumnTotal"===c?[p,i[s]]:[e[o],h]);for(var y=["cVal","gTotalVal"],b=0,w=0,T=m;w<T.length;w++){var M=T[w];f[y[b]]=this.getAggregateValue(M[0].index,M[1].indexObject,u,c,0!==b),b++}D=f.cVal/f.gTotalVal;v=!(e[o].members.length>0&&e[o].hasChild&&e[o].isDrilled)||(t.isNullOrUndefined(e[o].showSubTotals)||e[o].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals?t.isNullOrUndefined(f.cVal)?f.cVal:isNaN(D)?0:D:void 0,S=t.isNullOrUndefined(f.cVal)?f.cVal:isNaN(D)?0:D;break;default:var D=this.getAggregateValue(e[o].index,i[s].indexObject,u,c,!1);v=!(e[o].members.length>0&&e[o].hasChild&&e[o].isDrilled)||(t.isNullOrUndefined(e[o].showSubTotals)||e[o].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals?D:void 0,S=D}var O={fieldName:this.dataSourceSettings.values[n].name,row:e[o],column:i[s],value:v,cellSets:this.getValueCellInfo?this.getCellSet(this.rawIndexObject):[],rowCellType:e[o].hasChild&&e[o].isDrilled?"subTotal":"grand sum"===e[o].type?"grandTotal":"value",columnCellType:i[s].hasChild&&i[s].isDrilled?"subTotal":"grand sum"===i[s].type?"grandTotal":"value",aggregateType:c,skipFormatting:!1};this.getValueCellInfo&&this.getValueCellInfo(O),v=O.value;var P=e[o].hasChild||i[s].hasChild||"grand sum"===e[o].type||"grand sum"===i[s].type||this.showSubTotalsAtBottom&&e[o].isSum,N="grand sum"===e[o].type||"grand sum"===i[s].type,E=e[o].members.length>0&&e[o].hasChild&&e[o].isDrilled&&(!t.isNullOrUndefined(e[o].showSubTotals)&&!e[o].showSubTotals||!this.dataSourceSettings.showSubTotals||!this.dataSourceSettings.showRowSubTotals),F=E?"":void 0===v?this.emptyCellTextContent:"Count"===c||"DistinctCount"===c?v.toLocaleString():this.getFormattedValue(v,g).formattedText;!isNaN(v)&&!t.isNullOrUndefined(v)&&["PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal"].indexOf(c)>=0?F=this.globalize.formatNumber(v,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,O.fieldName)}):E||!isNaN(v)||t.isNullOrUndefined(v)||-1===["PopulationStDev","SampleStDev","PopulationVar","SampleVar"].indexOf(c)||(F="#DIV/0!",v=0),F=O.skipFormatting?t.isNullOrUndefined(v)?this.emptyCellTextContent:v.toString():F,r[a][l]=this.valueContent[d][l]={axis:"value",actualText:g,indexObject:this.isDrillThrough?this.rawIndexObject:{},rowHeaders:"grand sum"===e[o].type?"":e[o].valueSort.levelName,columnHeaders:"grand sum"===i[s].type?"":i[s].valueSort.levelName,formattedText:F,value:v,hierarchyName:i[s].hierarchyName,actualValue:S,rowIndex:a,colIndex:l,isSum:P,isGrandSum:N,showSubTotals:!E},this.rawIndexObject={}},e.prototype.getCellSet=function(e){for(var t=[],i=0,a=Object.keys(e);i<a.length;i++){var r=a[i];this.data[parseInt(r,10)]&&t.push(this.data[parseInt(r,10)])}return t},e.prototype.updateValueMembers=function(e,i,a,r,n,o,s){var l=a&&!t.isNullOrUndefined(a.levelName)?a.levelName.toString():void 0,d=a&&!t.isNullOrUndefined(a.uniqueName)?a.uniqueName.toString():void 0;if(e)for(var p=0;p<o;p++){var h=this.dataSourceSettings.values[p],u=h.caption?h.caption:h.name,c={axis:this.valueAxis?"row":"column",rowIndex:this.valueAxis?0:i&&s<=i.rowIndex?i.rowIndex+1:s,actualText:h.name,formattedText:u,level:0,valueSort:{},members:[],type:this.valueAxis?"value":i?i.type:null,index:!this.valueAxis&&i?i.index:null,indexObject:!this.valueAxis&&i?i.indexObject:null};n.length>0&&(c.showSubTotals=h.showSubTotals);var g=c.valueSort;g.axis=this.valueAxis?void 0:h.name,g[(l?l+this.valueSortSettings.headerDelimiter:"")+u]=1,g[(d?d+this.valueSortSettings.headerDelimiter:"")+h.name]=1,g.levelName=(l?l+this.valueSortSettings.headerDelimiter:"")+u,g.uniqueName=(d?d+this.valueSortSettings.headerDelimiter:"")+h.name,r.push(c),this.updateValueMembers(!1,i,g,c.members,n,o,s+1)}else for(var m=0,v=n.length;m<v;m++){var S=f.frameHeaderWithKeys(n[m]);S.members=[],S.rowIndex=this.valueAxis?S.rowIndex:s<0?0:s;var y={};y.axis=S.valueSort.axis,y[(l?l+this.valueSortSettings.headerDelimiter:"")+S.formattedText]=1,y[(d?d+this.valueSortSettings.headerDelimiter:"")+S.actualText]=1,y.levelName=(l?l+this.valueSortSettings.headerDelimiter:"")+S.formattedText,y.uniqueName=(d?d+this.valueSortSettings.headerDelimiter:"")+S.actualText,S.hierarchyName=S.valueSort.uniqueName,S.valueSort=y;var b=y.axis+this.valueSortSettings.headerDelimiter+y.levelName,C=this.fieldList[y.axis];S.isDrilled&&((this.isExpandAll||C.expandAll)&&this.fieldDrillCollection[b]||!this.isExpandAll&&!C.expandAll&&!this.fieldDrillCollection[b])&&(S.isDrilled=!1),r.push(S),S.isDrilled&&n[m].members.length>0?(this.valueAxis&&s<this.measureIndex&&this.measureIndex!==s+1&&(!n[m].hasChild||(t.isNullOrUndefined(n[m].showSubTotals)||n[m].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals)&&this.updateValueMembers(!0,S,y,r[r.length-1].members,[],o,s),this.updateValueMembers(this.measureIndex===s+1,S,y,r[r.length-1].members,n[m].members,o,s+1),!this.valueAxis&&s<this.measureIndex&&this.measureIndex!==s+1&&(!n[m].hasChild||(t.isNullOrUndefined(n[m].showSubTotals)||n[m].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals)&&this.updateValueMembers(!0,S,y,r[r.length-1].members,[],o,s)):s<this.measureIndex&&this.updateValueMembers(!0,S,y,r[r.length-1].members,[],o,s)}},e.prototype.reArrangeValueMember=function(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];this.valueAxisFields[r.actualText]&&(t[t.length]=r)}return t.concat(e).slice(0,e.length)},e.prototype.frameDefinedHeaderData=function(e,i,a,r,n,o){for(var s=0,l=e.length;s<l;s++){var d=!0;!(e[s].members.length>0)||(t.isNullOrUndefined(e[s].showSubTotals)||e[s].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals||(d=!1);var p=this.measureIndex<r&&d?1:this.measureIndex>r&&e[s].members.length>0||this.measureIndex!==r+1||!e[s].isDrilled?this.measureIndex===r&&0!==this.measureIndex&&d?1:this.measureIndex>r&&d&&e[s].valueSort&&e[s].valueSort.axis&&this.measureNames[e[s].valueSort.axis.toString()]?1:0:0!==this.measureIndex&&d?1:0;if(e[s].members.length){var h=void 0,u=e[s].members;this.showSubTotalsAtTop?r+1<this.measureIndex&&d?(h=n,u=this.reArrangeValueMember(u)):h=n+p:h=n,this.frameDefinedHeaderData(u,i,a,r+1,h,o)}var c=this.measureIndex>r&&e[s].valueSort&&e[s].valueSort.axis&&this.measureNames[e[s].valueSort.axis.toString()]?this.measureIndex:r;i[(n=this.showSubTotalsAtTop?n+1:i.length+p)-1]||(i[n-1]=f.frameHeaderWithKeys(e[s])),e[s].colIndex=n,a[c]?a[c][n]=this.headerContent[c][n]=f.frameHeaderWithKeys(e[s]):(a[c]=[],this.headerContent[c]={},a[c][n]=this.headerContent[c][n]=f.frameHeaderWithKeys(e[s])),this.isPagingOrVirtualizationEnabled||this.showSubTotalsAtTop&&0===p||i[n-1]&&(i[n-1].members=[]),this.showSubTotalsAtTop&&(n=i.length,s+1===l&&0===e[s].level&&(this.reformAxisCount=i.length+1))}},e.prototype.getHeaderData=function(e,i,a,r,n,o,s,l,d){if(!this.valueAxis&&!this.isLastHeaderHasMeasures){var p=[];if(this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals&&"grand sum"===n[n.length-1].type)this.updateValueMembers(0===this.measureIndex&&n.length>1,null,null,p,n.slice(0,n.length-1),d,0),this.updateValueMembers(!1,null,null,p,n.slice(n.length-1,n.length),d,-1);else if("Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&0===this.measureIndex)this.updateValueMembers(!1,null,null,p,n.slice(0,1),d,-1),this.updateValueMembers(0===this.measureIndex&&n.length>1,null,null,p,n.slice(1,n.length),d,0);else{var h=0===i.length&&1===n.length&&"grand sum"===n[0].type;this.updateValueMembers(!h&&0===this.measureIndex,null,null,p,n,d,h?-1:0)}if(this.getAggregatedHeaders(e,i,this.rMembers,p,a),this.selectedHeaders.values.length>0)for(var u=this.selectedHeaders.selectedHeader.length,c=0;c<u;c++)if("column"===(b=this.selectedHeaders.selectedHeader[c]).axis)if(b.uniqueName===b.value)this.selectedHeaders.selectedHeader.splice(c,1),c--,u--;else if("Grand Total"===b.uniqueName)for(var g=b.aggregateHeaders.length,m=0;m<g;m++)if(b.aggregateHeaders[m]&&b.aggregateHeaders[m].members.length>0)for(var v=0,S=b.aggregateHeaders[m].members;v<S.length;v++)(M=S[v]).actualText===b.value&&(b.aggregateHeaders[m]=M,"grand sum"===M.type&&(b.uniqueName=M.valueSort.levelName));return void this.frameDefinedHeaderData(p,o,s,0,this.showSubTotalsAtTop?0:1,d)}if(0===r.length&&this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&this.dataSourceSettings.values.length>0){if(this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&"grand sum"===this.rMembers[this.rMembers.length-1].type)this.updateValueMembers(0===this.measureIndex&&this.rMembers.length>1,null,null,r,this.rMembers.slice(0,this.rMembers.length-1),this.dataSourceSettings.values.length,0),this.updateValueMembers(!1,null,null,r,this.rMembers.slice(this.rMembers.length-1,this.rMembers.length),this.dataSourceSettings.values.length,-1);else if("Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&0===this.measureIndex)this.updateValueMembers(!1,null,null,r,this.rMembers.slice(0,1),this.dataSourceSettings.values.length,-1),this.updateValueMembers(0===this.measureIndex&&this.rMembers.length>1,null,null,r,this.rMembers.slice(1,this.rMembers.length),this.dataSourceSettings.values.length,0);else{var y=0===e.length&&1===this.rMembers.length&&"grand sum"===this.rMembers[0].type;this.updateValueMembers(!y&&0===this.measureIndex,null,null,r,this.rMembers,this.dataSourceSettings.values.length,y?-1:0)}if(this.getAggregatedHeaders(e,i,r,n,a),this.selectedHeaders.values.length>0)for(var u=this.selectedHeaders.selectedHeader.length,c=0;c<u;c++){var b=this.selectedHeaders.selectedHeader[c];if("row"===b.axis)for(var C=b.aggregateHeaders.length,m=0;m<C;m++)if(b.aggregateHeaders[m].actualText===b.value){if(-1!==b.aggregateHeaders[m].valueSort.levelName.indexOf(b.uniqueName))b.uniqueName=b.aggregateHeaders[m].valueSort.levelName,b.aggregateHeaders.splice(m,1),m--,C--;else for(var x=b.aggregateHeaders[m].members.length,w=0;w<x;w++)if("value"!==(M=b.aggregateHeaders[m].members[w]).type&&M.level===b.aggregateHeaders[m].level){var T=t.extend([],b.aggregateHeaders[m].members,null,!0);b.aggregateHeaders=[].concat(b.aggregateHeaders,T,b.aggregateHeaders.splice(m)),b.aggregateHeaders.splice(T.length+m,1),m=T.length+m-1,C=b.aggregateHeaders.length}}else if(b.aggregateHeaders[m].actualText!==b.value&&b.aggregateHeaders[m].members.length>0)for(var x=b.aggregateHeaders[m].members.length,w=0;w<x;w++){var M=b.aggregateHeaders[m].members[w];if(M.actualText===b.value){b.uniqueName===b.aggregateHeaders[m].valueSort.levelName&&(b.uniqueName=M.valueSort.levelName),b.aggregateHeaders[m].members.splice(w,1),b.aggregateHeaders[m]=M;break}}}}for(var D=n.length,O=this.dataSourceSettings.columns.length,P=this.valueSortSettings.headerText,N=0;N<D;N++){var E=!t.isNullOrUndefined(n[N].showSubTotals)&&!n[N].showSubTotals;n[N].members.length&&this.getHeaderData(e,i,a,r,n[N].members,o,s,this.showSubTotalsAtTop&&!E?l+1:l,d);var F=!0;l=this.showSubTotalsAtTop?l:o.length,!E&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals?o[l]=f.frameHeaderWithKeys(n[N]):(n[N].members.length>0?(this.removeCount++,F=!1):o[this.showSubTotalsAtTop?l:o.length]=f.frameHeaderWithKeys(n[N]),l=this.showSubTotalsAtTop?l:o.length-1);var I=n[N].level;n[N].rowIndex=I;var L=l*d+(this.showSubTotalsAtTop?1:d);n[N].colIndex=L,s[I]||(s[I]=[],this.headerContent[I]={}),s[I][L]=this.headerContent[I][L]=f.getFormattedHeader(n[N],this);var A=0===this.dataSourceSettings.columns.length&&1===this.dataSourceSettings.values.length;if((this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader||A)&&!this.valueAxis&&F)for(var R=0;R<d;R++){var k=this.dataSourceSettings.values[R].caption?this.dataSourceSettings.values[R].caption:this.dataSourceSettings.values[R].name,j={axis:"column",actualText:this.dataSourceSettings.values[R].name,formattedText:k,level:0,valueSort:{},colIndex:l*d+1+R,rowIndex:O};s[O]?s[O][l*d+1+R]=this.headerContent[O][l*d+1+R]=j:(s[O]=[],this.headerContent[O]={},s[O][l*d+1+R]=this.headerContent[O][l*d+1+R]=j);var q=s[O][l*d+1+R].valueSort;q[n[N].valueSort.levelName+this.valueSortSettings.headerDelimiter+k]=1,q.levelName=n[N].valueSort.levelName+this.valueSortSettings.headerDelimiter+k,q[n[N].valueSort.uniqueName+this.valueSortSettings.headerDelimiter+this.dataSourceSettings.values[R].name]=1,q.uniqueName=n[N].valueSort.uniqueName+this.valueSortSettings.headerDelimiter+this.dataSourceSettings.values[R].name,q&&q[P]&&(this.valueSortSettings.columnIndex=l*d+1+R)}else n[N].valueSort&&n[N].valueSort[P]&&(this.valueSortSettings.columnIndex=l*d+1);this.isPagingOrVirtualizationEnabled||(o[l].members=[]),this.showSubTotalsAtTop&&(l=o.length,0===n[N].level&&N+1===D&&(this.reformAxisCount=o.length*d+1))}},e.prototype.getAggregateValue=function(e,i,a,r,n){var o=0,s=0,l=0,d=!0,p=!1;switch(r.toLowerCase()){case"median":for(var h=[],u=0;void 0!==e[o];)void 0!==i[x=e[o]]&&(p=!0,this.rawIndexObject[x]=x,t.isNullOrUndefined(this.valueMatrix[x][a].member)||h.push(this.valueMatrix[x][a].member)),o++;(N=h.length)>0&&(h.sort(function(e,t){return e-t}),s=N%2==0?(h[u=N/2<=1?0:N/2-1]+h[u+1])/2:h[u=(N+1)/2<=1?0:(N+1)/2-1]);break;case"count":for(;void 0!==e[o];)void 0!==i[x=e[o]]&&(p=!0,this.rawIndexObject[x]=x,s+=t.isNullOrUndefined(this.valueMatrix[x][a].member)?0:this.allowDataCompression?this.valueMatrix[x][a].member:1),o++;break;case"distinctcount":for(var c=[];void 0!==e[o];){if(void 0!==i[e[o]]){this.rawIndexObject[e[o]]=e[o],p=!0;m=this.data[e[o]][this.fieldKeys[this.fields[a]]];if(!t.isNullOrUndefined(m)){A=m.toString();(0===c.length||c.length>0&&-1===c.indexOf(A))&&(s+=this.allowDataCompression&&"number"==typeof m?m:1,c.push(A))}}o++}break;case"product":for(;void 0!==e[o];){if(void 0!==i[x=e[o]]){this.rawIndexObject[x]=x,p=!0;A=this.valueMatrix[x][a].member;t.isNullOrUndefined(A)?d&&(s=A):(s=d||t.isNullOrUndefined(s)?1:s,s*=A),d=!1}o++}break;case"populationstdev":case"samplestdev":case"populationvar":case"samplevar":for(var g=0,m=0,f=[],v=0,S=0,y=0;void 0!==e[o];){if(void 0!==i[x=e[o]]){p=!0,this.rawIndexObject[x]=x;A=this.valueMatrix[x][a].member;t.isNullOrUndefined(A)||(m+=A,f.push(A),g++)}o++}if(g>0){v=m/g;for(var b=0,C=f;b<C.length;b++){var x=C[b];y+=Math.pow(x-v,2)}s=0===(S=-1!==["populationstdev","samplestdev"].indexOf(r.toLowerCase())?Math.sqrt(y/("populationstdev"===r.toLowerCase()?g:g-1)):y/("populationvar"===r.toLowerCase()?g:g-1))?NaN:S}else s=m;break;case"min":var w=!0;for(s=void 0;void 0!==e[o];)void 0!==i[x=e[o]]&&void 0!==this.valueMatrix[x][a].member&&(p=!0,this.rawIndexObject[x]=x,t.isNullOrUndefined(s)&&t.isNullOrUndefined(this.valueMatrix[x][a].member)?s=this.valueMatrix[x][a].member:w?(s=this.valueMatrix[x][a].member,w=!1):s=this.valueMatrix[x][a].member<s?this.valueMatrix[x][a].member:s),o++;break;case"max":for(var T=!0;void 0!==e[o];)void 0!==i[x=e[o]]&&void 0!==this.valueMatrix[x][a].member&&(p=!0,this.rawIndexObject[x]=x,T?(s=this.valueMatrix[x][a].member,T=!1):s=this.valueMatrix[x][a].member>s?this.valueMatrix[x][a].member:s),o++;break;case"calculatedfield":p=!0;var M=this.calculatedFields[this.fields[a]],D=M.formula,O={};if(this.calculatedFormulas[M.name])for(var P=this.calculatedFormulas[M.name],N=0,E=P.length;N<E;N++){var F=P[N],I=O[F.formula];if(void 0===I){var L=F.type;I=this.getAggregateValue(e,i,F.index,L,!1),O[F.formula]=I}D=D.replace(F.formula,String(I))}s=(s=this.evaluate(D))===1/0||s===-1/0?1/0:void 0===s||isNaN(s)?void 0:JSON.parse(String(s));break;default:for(s=void 0;void 0!==e[o];){if(void 0!==i[x=e[o]]){p=!0,n||(this.rawIndexObject[x]=x);var A=this.valueMatrix[x][a].member;t.isNullOrUndefined(s)&&t.isNullOrUndefined(A)?s=A:(t.isNullOrUndefined(s)&&(s=0),s+=t.isNullOrUndefined(A)?0:A),t.isNullOrUndefined(A)||l++}o++}}return r&&"avg"===r.toLowerCase()&&0!==s&&!t.isNullOrUndefined(s)?s/l:p?s:void 0},e.prototype.evaluate=function(e){return Function('"use strict";return ('+e+")")()},e.prototype.getFormattedValue=function(e,i){var a=null===e?this.localeObj?this.localeObj.getConstant("null"):String(e):void 0===e?this.localeObj?i in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(e):e,r={formattedText:a.toString(),actualText:a,dateText:a};if(this.formatFields[i]&&(this.formatFields[i].format||this.formatFields[i].skeleton)&&!t.isNullOrUndefined(e))try{var n=this.formatFields[i].properties?this.formatFields[i].properties:this.formatFields[i],o=t.extend({},n,null,!0);delete o.name,!o.minimumSignificantDigits&&o.minimumSignificantDigits<1&&delete o.minimumSignificantDigits,!o.maximumSignificantDigits&&o.maximumSignificantDigits<1&&delete o.maximumSignificantDigits,o.type?(r.formattedText=this.dateFormatFunction[i].exactFormat(new Date(e)),r.actualText=e):(delete o.type,o.format&&!this.formatRegex.test(o.format)&&(t.isNullOrUndefined(o.minimumFractionDigits)&&delete o.minimumFractionDigits,t.isNullOrUndefined(o.maximumFractionDigits)&&delete o.maximumFractionDigits,t.isNullOrUndefined(o.minimumIntegerDigits)&&delete o.minimumIntegerDigits),r.formattedText=this.globalize.formatNumber(isNaN(Number(e))?e:Number(e),o),r.actualText=isNaN(Number(e))?e:Number(e),r.dateText=isNaN(Number(e))?e:Number(e)),"None"!==this.fieldList[i].sort&&o.type&&["date","dateTime","time"].indexOf(this.formatFields[i].type)>-1&&(r.dateText=this.dateFormatFunction[i].fullFormat(new Date(e))),this.fieldList[i].isCustomField&&(r.formattedText="NaN"===r.formattedText?a.toString():r.formattedText,r.dateText="NaN"===r.dateText?a.toString():r.dateText)}catch(e){if(!this.fieldList[i].isCustomField)throw e}finally{this.fieldList[i].isCustomField&&(r.formattedText=t.isNullOrUndefined(r.formattedText)||"NaN"===r.formattedText?a.toString():r.formattedText,r.dateText=t.isNullOrUndefined(r.dateText)||"NaN"===r.dateText?a.toString():r.dateText)}return r},e.prototype.powerFunction=function(e){if(e.indexOf("^")>-1){for(var t=[];e.indexOf("(")>-1;)e=e.replace(/(\([^()]*\))/g,function(e,i){return t.push(i),"~"+(t.length-1)});for(t.push(e),e="~"+(t.length-1);e.indexOf("~")>-1;)e=e.replace(new RegExp("~(\\d+)","g"),function(e,i){return t[i].replace(/(\w*)\^(\w*)/g,"Math.pow($1,$2)")})}return e},e.prototype.getTabularPivotValues=function(){this.tabularPivotValues=[];var e;this.emptyRowsLength=0;for(var i=0;i<this.pivotValues.length;i++){for(var a=void 0;t.isNullOrUndefined(this.pivotValues[i])&&i<this.pivotValues.length;)this.tabularPivotValues.length++,i++;i<this.pivotValues.length&&(a=this.pivotValues[i]);var r=a[0]?a[0]:void 0;if(t.isNullOrUndefined(r)||"row"!==r.axis){for(var n=[],o=this.rowMaxLevel+1,s=0;s<this.rowMaxLevel;s++)n.push(void 0);n.push(r);for(var l=a.slice(1,a.length),d=0;d<l.length;d++)l[d].colIndex=o,l[d].rowIndex=this.tabularPivotValues.length,o++;n=n.concat(l),this.tabularPivotValues.push(n)}else if(t.isNullOrUndefined(a[1])||r.hasChild&&r.isDrilled)this.emptyRowsLength++;else{var p=r.valueSort.levelName.split(this.dataSourceSettings.valueSortSettings.headerDelimiter);e=r.colIndex;for(var h=[],u=p[0],c=0,g=0;g<p.length-1||g<this.rowMaxLevel;g++){if(g<p.length-1){g>0&&(u=u+"."+p[g]);var m=r.isDrilled;(p.length>1||0===g)&&(m=!0),h.push({axis:r.axis,formattedText:p[g],rowIndex:this.tabularPivotValues.length,hasChild:r.hasChild,isDrilled:m,level:c,valueSort:{levelName:u},colIndex:e++,colSpan:1,rowSpan:1})}if(g>=r.level){var f=0===g?this.rowMaxLevel:this.rowMaxLevel-1;h.push({axis:r.axis,formattedText:r.formattedText,rowIndex:this.tabularPivotValues.length,hasChild:r.hasChild,isDrilled:r.isDrilled,level:c,valueSort:{levelName:r.valueSort.levelName},colIndex:e++,colSpan:f,rowSpan:1})}c++}r.colIndex=e,r.rowIndex=this.tabularPivotValues.length,r.colSpan=1,r.rowSpan=1,h.push(r),this.setColumnSpan(h);for(var l=a.slice(1,a.length),v=1;v<a.length;v++){var S=a[v];S.colIndex=e+1,S.rowIndex=this.tabularPivotValues.length,e++}h=h.concat(l),this.tabularPivotValues.push(h)}}return this.tabularPivotValues},e.prototype.setColumnSpan=function(e){for(var t=1,i=e.length-1;i>=0;i--){0!==i&&e[i].formattedText===e[i-1].formattedText&&(e[i].colSpan=0,t++,e[i-1].colSpan=t);var a=e[i].formattedText.split(" ");if(i<e.length-1&&"Total"!==a[a.length-1]){e[i].hasChild=!0;for(var r=this.dataSourceSettings.drilledMembers,n=0;n<r.length;n++)for(var o=0;o<r[n].items.length;o++)r[n].items[o]===e[i].formattedText&&(e[i].isDrilled=!!e[i].isDrilled)}}},e.prototype.setRowSpan=function(){for(var e=this.headerContent.length,i=0;i<this.rowMaxLevel;i++){var a=1;if(this.tabularPivotValues.length>this.rowMaxLevel+e)for(var r=this.tabularPivotValues.length-1;r>=e-1;r--)if(r!==e-1){var n=this.tabularPivotValues;if(t.isNullOrUndefined(n[r-1]))break;t.isNullOrUndefined(n[r-1][i])||n[r][i].formattedText!==n[r-1][i].formattedText?a=1:(n[r][i].rowSpan=0,a++,n[r-1][i].rowSpan=a)}}},e}(),y="initial-load",b="ui-update",C="content-ready",x="data-ready",w="tree-view-update",T="Show chart view",M="e-pivotfieldlist",D="e-rtl",O="e-device",P="e-icons",N="e-pivotfieldlist-container",E="e-collapse",F="e-expand",I="e-table",L="e-rowsheader",A="e-headercell",R="e-pivot-calc-input",k="e-format",j="e-pivot-formula",q="e-menu-hide",H="e-visible-hide",V="e-movablescrolldiv",U="e-cellselectionbackground",_="e-selectionbackground",B="e-headercontent",G="e-remove-report",z="e-pivot-toolbar",W="e-pivotchart",Q="e-pivotview-disable-icon",Y="e-pivotview-select-icon",K="e-pivot-toolbar-menu",X="e-pivot-content-loader",J=function(){function e(e){this.menuInfo=[],this.stringAggregateTypes=["Count","DistinctCount"],this.parent=e}return e.prototype.render=function(e,t){this.parentElement=t,this.openContextMenu(e)},e.prototype.openContextMenu=function(e){var t=this,i=e.target.parentElement.getAttribute("data-uid"),a=f.getFieldInfo(i,this.parent);this.buttonElement=e.target.parentElement;var r="number"!==this.parent.engineModule.fieldList[i].type?1:0,n=this.getMenuItem(r).slice();if(this.parent.actionObj.actionName="Aggregate field",this.parent.actionObj.fieldInfo=a.fieldItem,!this.parent.actionBeginMethod()){var o={cancel:!1,fieldName:i,aggregateTypes:n,displayMenuCount:7},s="pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent;try{s.trigger("aggregateMenuOpen",o,function(i){if(!i.cancel){n=i.aggregateTypes,t.createContextMenu(r,n,i.displayMenuCount),t.currentMenu=e.target;var a=t.currentMenu.getBoundingClientRect();t.parent.enableRtl?t.menuInfo[r].open(a.top+(window.scrollY||document.documentElement.scrollTop),a.left-105):t.menuInfo[r].open(a.top+(window.scrollY||document.documentElement.scrollTop),a.left)}})}catch(e){this.parent.actionFailureMethod(e)}}},e.prototype.createContextMenu=function(e,i,a){var r=this,n=[];n[e]=[],this.menuInfo[e]&&!this.menuInfo[e].isDestroyed&&this.menuInfo[e].destroy();for(var s=[],l=0;l<i.length;l++){var d=i[l];e?this.stringAggregateTypes.indexOf(d)>-1&&s.indexOf(d)<0&&(n[e].push({text:this.parent.localeObj.getConstant(d),id:this.parent.element.id+"StringMenu_"+d}),s.push(d)):this.parent.getAllSummaryType().indexOf(d)>-1&&s.indexOf(d)<0&&(n[e].push({text:this.parent.localeObj.getConstant(d),id:this.parent.element.id+"_"+d}),s.push(d))}n[e].length>a&&(n[e].splice(a),n[e].push({text:this.parent.localeObj.getConstant("MoreOption"),id:this.parent.element.id+"_MoreOption"}));var p={items:n[e],enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:this.parent.cssClass,beforeOpen:this.beforeMenuOpen.bind(this,e),onClose:function(){t.select("#"+r.buttonElement.id,r.parentElement).focus()},select:this.selectOptionInContextMenu.bind(this)},h=document.getElementById(this.parent.element.id+(e?"valueFieldStringContextMenu":"valueFieldContextMenu"));null!==h?h.innerHTML="":h=t.createElement("ul",{id:this.parent.element.id+(e?"valueFieldStringContextMenu":"valueFieldContextMenu")}),this.parent.element.appendChild(h),this.menuInfo[e]=new o.ContextMenu(p),this.menuInfo[e].isStringTemplate=!0,this.menuInfo[e].appendTo(h)},e.prototype.getMenuItem=function(e){for(var t=[],i=0;i<this.parent.aggregateTypes.length;i++){var a=this.parent.aggregateTypes[i];e?this.stringAggregateTypes.indexOf(a)>-1&&-1===t.indexOf(a)&&t.push(a):this.parent.getAllSummaryType().indexOf(a)>-1&&-1===t.indexOf(a)&&t.push(a)}return t},e.prototype.beforeMenuOpen=function(e,t){t.element.style.zIndex=(this.menuInfo[e].element.style.zIndex+3).toString(),t.element.style.display="inline"},e.prototype.createValueSettingsDialog=function(e,i,a){this.parentElement=i;var n=t.createElement("div",{id:this.parentElement.id+"_ValueDialog",className:"e-value-field-settings",attrs:{"data-field":e.getAttribute("data-uid")?e.getAttribute("data-uid"):e.getAttribute("data-field")}});this.parentElement.appendChild(n);var o=new r.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,header:this.parent.localeObj.getConstant("valueFieldSettings"),content:this.createFieldOptions(e,a),isModal:!0,visible:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"320px",height:"auto",position:{X:"center",Y:"center"},buttons:[{click:this.updateValueSettings.bind(this),isFlat:!1,buttonModel:{cssClass:"e-ok-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:function(){o.hide()},isFlat:!1,buttonModel:{cssClass:"e-cancel-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}],closeOnEscape:"pivotfieldlist"!==this.parent.getModuleName()||"Popup"!==this.parent.renderMode,target:this.parentElement,close:this.removeDialog.bind(this),cssClass:this.parent.cssClass});o.isStringTemplate=!0,o.appendTo(n)},e.prototype.createFieldOptions=function(e,i){var a=this,r=e.getAttribute("data-caption"),n=i&&"MoreOption"!==i?i:e.getAttribute("data-type"),o=e.getAttribute("data-basefield"),d=e.getAttribute("data-baseitem");n="undefined"!==n.toString()?n:"Sum";for(var p=[],h=this.parent.aggregateTypes,u=[],c=0;c<h.length;c++)this.parent.getAllSummaryType().indexOf(h[c])>-1&&u.indexOf(h[c])<0&&(p.push({value:h[c],text:this.parent.localeObj.getConstant(h[c])}),u.push(h[c]));for(var g=["DifferenceFrom","PercentageOfDifferenceFrom"],m=["DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"],v=t.extend([],this.parent.dataSourceSettings.rows,null,!0),S=[],y=[],b=0,C=v=v.concat(this.parent.dataSourceSettings.columns);b<C.length;b++){var x=C[b],w=x.name,T=x.caption?x.caption:x.name;S.push({value:w,text:T})}if(0===Object.keys(S).length)S.push({value:"",text:""}),o="",y=[];else{var M="undefined"!==(o=o&&"undefined"!==o.toString()&&"null"!==o.toString()?o:S[0].value).toString()?o:S[0].value,D=f.isDateField(M,this.parent.engineModule);y=this.parent.engineModule.fieldList[M].dateMember.map(function(e){return D?e.formattedText:a.parent.engineModule.getFormattedValue(e.actualText,M).formattedText})}d="undefined"!==d.toString()?d:y[0];var O=t.createElement("div",{className:"e-value-field-div-content",id:this.parentElement.id+"_field_div_content",attrs:{"data-type":n,"data-caption":r,"data-basefield":o,"data-baseitem":d}}),P=t.createElement("div",{className:"e-field-name-text-container"}),N=t.createElement("div",{className:"e-field-option-container"}),E=t.createElement("div",{className:"e-type-option-container"}),F=t.createElement("div",{className:"e-base-field-option-container"}),I=t.createElement("div",{className:"e-base-item-option-container"}),L=t.createElement("div",{className:"e-field-name-title"});L.innerText=this.parent.localeObj.getConstant("sourceName")+" ";var A=t.createElement("div",{className:"e-field-name-content"});A.innerText=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e.getAttribute("data-uid")?e.getAttribute("data-uid"):e.getAttribute("data-field")):e.getAttribute("data-uid")?e.getAttribute("data-uid"):e.getAttribute("data-field"),this.buttonElement=this.buttonElement?this.buttonElement:document.getElementsByClassName(A.innerText)[0];var R=t.createElement("div",{className:"e-type-option-text"});R.innerText=this.parent.localeObj.getConstant("sourceCaption");var k=t.createElement("div",{className:"e-base-field-option-text"});k.innerText=this.parent.localeObj.getConstant("summarizeValuesBy");var j=t.createElement("div",{className:"e-base-item-option-text"});j.innerText=this.parent.localeObj.getConstant("baseField");var q=t.createElement("div",{className:"e-type-option-text"});q.innerText=this.parent.localeObj.getConstant("baseItem");var H=t.createElement("div",{className:"e-caption-input-container"}),V=t.createElement("div",{id:this.parentElement.id+"_type_option"}),U=t.createElement("div",{id:this.parentElement.id+"_base_field_option"}),_=t.createElement("div",{id:this.parentElement.id+"_base_item_option"}),B=t.createElement("input",{id:this.parentElement.id+"type_input_option",className:"e-caption-input-text",attrs:{type:"text"}});P.appendChild(L),P.appendChild(A),H.appendChild(R),H.appendChild(B),E.appendChild(k),F.appendChild(j),I.appendChild(q),E.appendChild(V),F.appendChild(U),I.appendChild(_),N.appendChild(P),N.appendChild(H),N.appendChild(E),N.appendChild(F),N.appendChild(I),O.appendChild(N);var G=this,z=new l.DropDownList({dataSource:p,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:n,cssClass:"e-value-options"+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){W.enabled=-1!==m.indexOf(e.value),Q.enabled=-1!==g.indexOf(e.value),Q.enabled&&1===Q.dataSource.length&&(Q.dataSource=y,Q.dataBind())}});z.isStringTemplate=!0,z.appendTo(V);var W=new l.DropDownList({dataSource:S,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:o,enabled:-1!==m.indexOf(n),cssClass:"e-value-options"+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){var t=f.isDateField(e.value,a.parent.engineModule);y=G.parent.engineModule.fieldList[e.value].dateMember.map(function(i){return t?i.formattedText:a.parent.engineModule.getFormattedValue(i.actualText,e.value).formattedText}),Q.dataSource=y,Q.value=y[0],Q.filterBarPlaceholder=G.parent.localeObj.getConstant("example")+" "+y[0],Q.itemData=null,Q.dataBind()}});W.isStringTemplate=!0,W.appendTo(U);var Q=new l.DropDownList({dataSource:y,enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:d,allowFiltering:!0,filterBarPlaceholder:this.parent.localeObj.getConstant("example")+" "+y[0],enabled:-1!==g.indexOf(n),cssClass:"e-filter-operator"+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%"});Q.isStringTemplate=!0,Q.appendTo(_);var Y=new s.MaskedTextBox({placeholder:"Enter field caption",enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:r,width:"100%",cssClass:this.parent.cssClass});return Y.isStringTemplate=!0,Y.appendTo(B),O},e.prototype.selectOptionInContextMenu=function(e){if(null!==e.item.text){var i=this.currentMenu.parentElement,a=f.getFieldInfo(i?i.getAttribute("data-uid"):"",this.parent);if(this.parent.actionObj.actionName="Aggregate field",this.parent.actionObj.fieldInfo=a.fieldItem,this.parent.actionBeginMethod())return;var r=e.item.id.split("_").pop();try{if("MoreOption"===r||"PercentageOfDifferenceFrom"===r||"PercentageOfParentTotal"===r||"DifferenceFrom"===r)this.createValueSettingsDialog(i,this.parentElement,r);else{var n=i.getAttribute("data-uid"),o=this.parent.dataSourceSettings.values,s=i.querySelector(".e-pvt-btn-content"),l=e.item.text+" "+this.parent.localeObj.getConstant("of")+" "+this.parent.engineModule.fieldList[n].caption;l=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(l):l,this.parent.dataSourceSettings.showAggregationOnValueField&&(s.innerText=l),s.setAttribute("title",l),i.setAttribute("data-type",r);for(var d=0;d<this.parent.dataSourceSettings.values.length;d++)if(this.parent.dataSourceSettings.values[d].name===n){var p=t.extend({},o[d].properties?o[d].properties:o[d],null,!0);p.type=r,this.parent.engineModule.fieldList[n].aggregateType=r,o.splice(d,1,p),this.parent.lastAggregationInfo=p}this.updateDataSource()}}catch(e){this.parent.actionFailureMethod(e)}}},e.prototype.updateDataSource=function(e){!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate||"pivotview"===this.parent.getModuleName()?this.parent.updateDataSource(e):"pivotfieldlist"===this.parent.getModuleName()&&"Popup"===this.parent.renderMode?(this.parent.pivotGridModule.setProperties({dataSourceSettings:this.parent.dataSourceSettings.properties},!0),this.parent.pivotGridModule.notify(b,this),this.parent.pivotGridModule.engineModule=this.parent.engineModule):this.parent.triggerPopulateEvent()},e.prototype.updateValueSettings=function(){var e,i=t.getInstance(t.select("#"+this.parentElement.id+"_ValueDialog",document),r.Dialog),a=i.element,n=t.getInstance(t.select("#"+this.parentElement.id+"type_input_option"),s.MaskedTextBox),o=t.getInstance(t.select("#"+this.parentElement.id+"_type_option"),l.DropDownList),d=t.getInstance(t.select("#"+this.parentElement.id+"_base_field_option"),l.DropDownList),p=t.getInstance(t.select("#"+this.parentElement.id+"_base_item_option"),l.DropDownList),h=a.getAttribute("data-field");if(this.parentElement.querySelector(".e-pivot-button")&&(e=this.parentElement.getElementsByClassName("e-pivot-button "+h.replace(/[^A-Z0-9]/gi,""))[0]),e){var u=e.querySelector(".e-pvt-btn-content"),c=this.parent.dataSourceSettings.showAggregationOnValueField?this.parent.localeObj.getConstant(o.value)+" "+this.parent.localeObj.getConstant("of")+" "+n.value:n.value;c=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(c):c,u.innerText=c,u.setAttribute("title",c),e.setAttribute("data-type",o.value),e.setAttribute("data-caption",n.value),e.setAttribute("data-basefield",d.value),e.setAttribute("data-baseitem",p.value)}var g=f.getFieldByName(h,this.parent.dataSourceSettings.values);(g=g.properties?g.properties:g).caption=n.value,g.type=o.value,g.baseField=d.value,g.baseItem=p.value,i.close(),this.parent.lastAggregationInfo=g,this.updateDataSource(!0)},e.prototype.removeDialog=function(){this.buttonElement&&t.select("#"+this.buttonElement.id,this.parentElement)&&t.select("#"+this.buttonElement.id,this.parentElement).focus();var e=t.select("#"+this.parentElement.id+"_ValueDialog",document),i=e?t.getInstance(e,r.Dialog):null;i&&!i.isDestroyed&&i.destroy(),document.getElementById(this.parentElement.id+"_ValueDialog")&&t.remove(document.getElementById(this.parentElement.id+"_ValueDialog"))},e.prototype.destroy=function(){this.parent.isDestroyed||this.menuInfo&&(void 0===this.menuInfo[1]||this.menuInfo[1].isDestroyed||this.menuInfo[1].destroy(),void 0===this.menuInfo[0]||this.menuInfo[0].isDestroyed||this.menuInfo[0].destroy())},e}(),Z=function(){function e(e){this.isAutoFitEnabled=!1,this.pivotColumns=[],this.indentCollection={},this.colPos=0,this.lastSpan=0,this.lvlCollection={},this.hierarchyCollection={},this.lvlPosCollection={},this.hierarchyPosCollection={},this.position=0,this.measurePos=0,this.maxMeasurePos=0,this.hierarchyCount=0,this.actualText="",this.drilledLevelInfo={},this.parent=e,this.resColWidth=this.parent.showGroupingBar&&this.parent.groupingBarModule?this.parent.isAdaptive?180:250:this.parent.isAdaptive?140:200,this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,this.gridSettings=this.parent.gridSettings,this.formatList=this.getFormatList(),this.aggMenu=new J(this.parent)}return e.prototype.render=function(e){if(e&&this.initProperties(),this.resColWidth=this.parent.isTabular?this.gridSettings.columnWidth:this.parent.showGroupingBar&&this.parent.groupingBarModule?this.parent.isAdaptive?180:250:this.parent.isAdaptive?140:200,this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,this.gridSettings=this.parent.gridSettings,this.formatList=this.getFormatList(),this.parent.gridCellCollection={},this.injectGridModules(this.parent),this.rowStartPos=this.getRowStartPos(),this.parent.grid&&this.parent.grid.element&&this.parent.element.querySelector(".e-grid")){this.parent.notEmpty=!0,this.engine.isEngineUpdated?"olap"!==this.parent.dataType&&(this.parent.isTabular&&(this.engine.headerContent=this.frameDataSource("header")),(this.parent.enableValueSorting||this.parent.isTabular)&&(this.engine.valueContent=this.frameDataSource("value"))):(this.engine.headerContent=this.frameDataSource("header"),this.engine.valueContent=this.frameDataSource("value")),this.engine.isEngineUpdated=!1;var i=this.parent.isTabular?this.parent.engineModule.rowMaxLevel+1:1;this.parent.grid.setProperties({frozenColumns:i,columns:this.frameStackedHeaders(),dataSource:("olap"===this.parent.dataType&&""!==this.parent.dataSourceSettings.url||this.parent.dataSourceSettings.dataSource&&this.parent.engineModule.data.length>0&&this.parent.dataSourceSettings.values.length>0)&&!this.engine.isEmptyData?this.frameGridDataSource(this.engine.valueContent):this.frameDataSource("value")},!0),this.parent.grid.notify("datasource-modified",{}),this.parent.isScrolling&&(this.parent.resizeInfo={}),this.parent.grid.refreshColumns(),this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector(".e-grouping-bar")&&this.parent.groupingBarModule.setGridRowWidth(),this.isAutoFitEnabled?this.addPivotAutoFitClass():this.removePivotAutoFitClass(),this.parent.element.querySelector(".e-grid").querySelector("colGroup").innerHTML=this.parent.grid.getHeaderContent().querySelector("colgroup").innerHTML,this.parent.grid.width=this.calculateGridWidth(),!this.gridSettings.allowAutoResizing&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector(".e-grouping-bar")&&this.parent.groupingBarModule.refreshUI(),this.parent.isScrolling||this.calculateGridHeight(!0)}else{this.parent.element.innerHTML="",this.bindGrid(this.parent,!!this.engine.isEmptyData);var a=t.createElement("div",{id:this.parent.element.id+"_grid"});this.parent.element.appendChild(a),this.parent.grid.isStringTemplate=!0,this.parent.grid.appendTo(a)}this.parent.grid.on(n.headerRefreshed,this.refreshHeader,this)},e.prototype.initProperties=function(){this.rowStartPos=void 0,this.maxIndent=void 0,this.resColWidth=void 0,this.isOverflows=void 0,this.indentCollection={},this.formatList=void 0,this.colPos=0,this.colGrandPos=void 0,this.rowGrandPos=void 0,this.lastSpan=0,this.field=void 0,this.fieldCaption=void 0,this.lvlCollection={},this.hierarchyCollection={},this.lvlPosCollection={},this.hierarchyPosCollection={},this.position=0,this.measurePos=0,this.maxMeasurePos=0,this.hierarchyCount=0,this.actualText="",this.timeOutObj=void 0},e.prototype.refreshHeader=function(){var e=this.parent.element.querySelector(".e-content-virtualtable");if(this.parent.enableVirtualization&&!t.isNullOrUndefined(e)){var i=t.closest(e,".e-gridcontent").querySelector("."+V),a=this.parent.element.querySelector(".e-headercontent"),r=e.querySelector(".e-virtualtrack");if(this.parent.virtualHeaderDiv=a.querySelector(".e-virtualtrack"),a.querySelector(".e-virtualtrack")?t.remove(a.querySelector(".e-virtualtrack")):this.parent.virtualHeaderDiv=t.createElement("div",{className:"e-virtualtrack"}),a.appendChild(this.parent.virtualHeaderDiv),r&&t.setStyleAttribute(this.parent.virtualHeaderDiv,{height:0,width:r.style.width}),a.querySelector("."+I)){t.setStyleAttribute(a.querySelector("."+I),{transform:e.querySelector("."+I).style.transform.split(",")[0]+",0px)"});var n=parseInt(a.querySelector("."+I).style.transform.split("(")[1].split(",")[0].split("px")[0],10);this.parent.enableRtl?this.parent.element.querySelector(".e-leftfreeze").style.right=Number(n)+"px":this.parent.element.querySelector(".e-leftfreeze").style.left=Number(-n)+"px"}var o=this.parent.isAdaptive?e:i&&"none"!==i.style.display?i:e.parentElement;a.scrollLeft=o.scrollLeft}},e.prototype.bindGrid=function(e,t){this.injectGridModules(e),this.parent.grid=new n.Grid({cssClass:this.parent.cssClass,frozenColumns:1,frozenRows:0,enableHover:!1,dataSource:t?this.frameEmptyData():this.frameDataSource("value"),columns:t?this.frameEmptyColumns():this.frameStackedHeaders(),height:t?"auto":this.calculateGridHeight(),width:t?this.gridSettings.allowAutoResizing?this.parent.width:400:this.calculateGridWidth(),locale:e.locale,enableRtl:e.enableRtl,allowExcelExport:e.allowExcelExport,allowPdfExport:e.allowPdfExport,allowResizing:this.gridSettings.allowResizing,allowTextWrap:this.gridSettings.allowTextWrap,clipMode:this.gridSettings.clipMode,allowReordering:this.gridSettings.allowReordering,allowSelection:this.gridSettings.allowSelection,contextMenuItems:this.gridSettings.contextMenuItems,selectedRowIndex:this.gridSettings.selectedRowIndex,selectionSettings:this.gridSettings.selectionSettings,textWrapSettings:this.gridSettings.textWrapSettings,printMode:this.gridSettings.printMode,rowHeight:this.gridSettings.rowHeight,gridLines:this.gridSettings.gridLines,contextMenuClick:this.contextMenuClick.bind(this),contextMenuOpen:this.contextMenuOpen.bind(this),beforeCopy:this.gridSettings.beforeCopy?this.gridSettings.beforeCopy.bind(this.parent):void 0,beforePrint:this.gridSettings.beforePrint?this.gridSettings.beforePrint.bind(this.parent):void 0,printComplete:this.gridSettings.printComplete?this.gridSettings.printComplete.bind(this.parent):void 0,rowSelecting:this.gridSettings.rowSelecting?this.gridSettings.rowSelecting.bind(this.parent):void 0,rowSelected:this.rowSelected.bind(this),rowDeselecting:this.gridSettings.rowDeselecting?this.gridSettings.rowDeselecting.bind(this.parent):void 0,rowDeselected:this.rowDeselected.bind(this),cellSelecting:this.gridSettings.cellSelecting?this.gridSettings.cellSelecting.bind(this.parent):void 0,cellSelected:this.cellSelected.bind(this),cellDeselecting:this.gridSettings.cellDeselecting?this.gridSettings.cellDeselecting.bind(this.parent):void 0,cellDeselected:this.cellDeselected.bind(this),resizeStart:this.gridSettings.resizeStart?this.gridSettings.resizeStart.bind(this.parent):void 0,columnDragStart:this.gridSettings.columnDragStart?this.gridSettings.columnDragStart.bind(this):void 0,columnDrag:this.gridSettings.columnDrag?this.gridSettings.columnDrag.bind(this):void 0,columnDrop:this.gridSettings.columnDrop?this.gridSettings.columnDrop.bind(this):void 0,beforeExcelExport:this.beforeExcelExport.bind(this),resizing:this.setGroupWidth.bind(this),resizeStop:this.onResizeStop.bind(this),queryCellInfo:this.queryCellInfo.bind(this),dataBound:this.dataBound.bind(this),headerCellInfo:this.headerCellInfo.bind(this),excelHeaderQueryCellInfo:this.excelHeaderQueryCellInfo.bind(this),pdfHeaderQueryCellInfo:this.pdfHeaderQueryCellInfo.bind(this),excelQueryCellInfo:this.excelQueryCellInfo.bind(this),pdfQueryCellInfo:this.pdfQueryCellInfo.bind(this),beforePdfExport:this.gridSettings.beforePdfExport?this.gridSettings.beforePdfExport.bind(this):void 0,pdfExportComplete:this.pdfExportComplete.bind(this),excelExportComplete:this.excelExportComplete.bind(this),actionComplete:this.actionComplete.bind(this)}),this.parent.grid.on("header-refreshed",this.headerRefreshed.bind(this)),this.parent.grid.on("export-DataBound",this.excelDataBound.bind(this))},e.prototype.actionComplete=function(e){e&&"refresh"===e.requestType&&this.isAutoFitEnabled&&this.removePivotAutoFitClass()},e.prototype.addPivotAutoFitClass=function(){document.body.classList.contains("e-pivotview")||document.body.classList.add("e-pivotview"),document.body.classList.contains("e-pivotview-autofit")||document.body.classList.add("e-pivotview-autofit")},e.prototype.removePivotAutoFitClass=function(){document.body.classList.contains("e-pivotview")&&document.body.classList.remove("e-pivotview"),document.body.classList.contains("e-pivotview-autofit")&&document.body.classList.remove("e-pivotview-autofit")},e.prototype.headerRefreshed=function(){var e=this.parent.element.querySelector(".e-headercontent");this.parent.lastGridSettings&&Object.keys(this.parent.lastGridSettings).indexOf("allowResizing")>-1&&!t.isNullOrUndefined(e)&&e.querySelector("."+I)&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector(".e-grouping-bar")&&(this.parent.lastGridSettings=void 0,this.parent.groupingBarModule.setGridRowWidth())},e.prototype.beforeExcelExport=function(e){t.isNullOrUndefined(e.gridObject.columns)||t.isNullOrUndefined(this.parent.pivotColumns)||(e.gridObject.columns[e.gridObject.columns.length-1].width=this.parent.pivotColumns[this.parent.pivotColumns.length-1].width),this.parent.trigger("beforeExcelExport",e)},e.prototype.rowSelected=function(e){this.parent.renderModule.selected(),this.parent.trigger("rowSelected",e)},e.prototype.rowDeselected=function(e){this.parent.renderModule.selected(),this.parent.trigger("rowDeselected",e)},e.prototype.cellSelected=function(e){this.parent.rowRangeSelection.enable?(this.parent.grid.selectionModule.selectRowsByRange(this.parent.rowRangeSelection.startIndex,this.parent.rowRangeSelection.endIndex),this.parent.rowRangeSelection.enable=!1):(this.parent.renderModule.selected(),this.parent.trigger("selected",e))},e.prototype.cellSelecting=function(e){this.parent.trigger("cellSelecting",e)},e.prototype.cellDeselected=function(e){this.parent.renderModule.selected(),this.parent.trigger("cellDeselected",e)},e.prototype.queryCellInfo=function(e){this.parent.renderModule.rowCellBoundEvent(e)},e.prototype.headerCellInfo=function(e){this.parent.renderModule.columnCellBoundEvent(e)},e.prototype.excelHeaderQueryCellInfo=function(e){this.parent.renderModule.excelColumnEvent(e)},e.prototype.pdfQueryCellInfo=function(e){this.parent.renderModule.pdfRowEvent(e)},e.prototype.excelQueryCellInfo=function(e){this.parent.renderModule.excelRowEvent(e)},e.prototype.pdfHeaderQueryCellInfo=function(e){this.parent.renderModule.pdfColumnEvent(e)},e.prototype.pdfExportComplete=function(e){void 0!==this.parent.lastColumn&&"auto"!==this.parent.lastColumn.width&&(this.parent.lastColumn.width="auto",this.parent.lastColumn=void 0);var t={type:"PDF",promise:e.promise};this.parent.trigger("exportComplete",t)},e.prototype.excelExportComplete=function(e){void 0!==this.parent.lastColumn&&"auto"!==this.parent.lastColumn.width&&(this.parent.lastColumn.width="auto",this.parent.lastColumn=void 0);var t={type:"Excel/CSV",promise:e.promise};this.parent.trigger("exportComplete",t)},e.prototype.dataBound=function(){this.parent.notEmpty&&this.calculateGridHeight(!0),this.parent.isScrolling=!1,this.setFocusOnLastCell(),t.isNullOrUndefined(this.parent.renderReactTemplates)||this.parent.renderReactTemplates(),this.parent.isInitial&&(this.parent.isInitial=!1,this.parent.refreshData(),this.parent.enableVirtualization&&this.parent.onContentReady()),this.parent.notify(C,{})},e.prototype.setFocusOnLastCell=function(){if(this.parent.keyboardModule&&this.parent.keyboardModule.event&&"TD"===this.parent.keyboardModule.event.target.nodeName){var e=this.parent.grid.serviceLocator.getService("focus");e.setFocusedElement(this.parent.keyboardModule.event.target),e.focus(this.parent.keyboardModule.event),t.addClass([this.parent.keyboardModule.event.target],["e-focused","e-focus"]),this.parent.keyboardModule.event.target.setAttribute("tabindex","0"),this.parent.keyboardModule.event=void 0}},e.prototype.getCellElement=function(e){var i=t.closest(e,"td");return t.isNullOrUndefined(i)&&(i=t.closest(e,"th")),i},e.prototype.contextMenuOpen=function(e){var i=this;e.element&&this.parent.cssClass&&t.addClass([e.element.parentElement],this.parent.cssClass);for(var a=this,r=0,n=e.items;r<n.length;r++){var o=function(r){var n=a.parent.lastCellClicked?a.parent.lastCellClicked:a.parent.isAdaptive?e.event.target:a.parent.lastCellClicked,o=a.getCellElement(n),s=void 0,l=void 0;if(!o||o&&0===Number(o.getAttribute("index"))&&0===Number(o.getAttribute("data-colindex")))return e.cancel=!0,{value:void 0};(o.classList.contains("e-valuesheader")||o.classList.contains("e-stot"))&&(s=!0),a.parent.allowGrouping&&a.parent.groupingModule&&!a.validateField(o)&&(l=!0);var d=Number(o.getAttribute("index")),p=Number(o.getAttribute("data-colindex")),h=a.parent.pivotValues[d][p];switch(r.id){case a.parent.element.id+"_expand":o.querySelectorAll("."+F).length>0?(t.selectAll("#"+a.parent.element.id+"_expand",e.element)&&t.select("#"+a.parent.element.id+"_expand",e.element).classList.add("e-disabled"),t.select("#"+a.parent.element.id+"_expand",e.element).classList.contains("e-disabled")&&t.select("#"+a.parent.element.id+"_expand",e.element).classList.remove("e-disabled"),t.select("#"+a.parent.element.id+"_expand",e.element).classList.contains(q)&&(t.select("#"+a.parent.element.id+"_expand",e.element).classList.remove(q),t.select("#"+a.parent.element.id+"_collapse",e.element).classList.remove(q))):s?t.select("#"+a.parent.element.id+"_expand",e.element).classList.add(q):t.select("#"+a.parent.element.id+"_expand",e.element).classList.add("e-disabled");break;case a.parent.element.id+"_collapse":o.querySelectorAll("."+E).length>0?(t.select("#"+a.parent.element.id+"_expand",e.element)&&t.select("#"+a.parent.element.id+"_expand",e.element).classList.add("e-disabled"),t.select("#"+a.parent.element.id+"_collapse",e.element).classList.contains("e-disabled")&&t.select("#"+a.parent.element.id+"_collapse",e.element).classList.remove("e-disabled"),t.select("#"+a.parent.element.id+"_collapse",e.element).classList.contains(q)&&(t.select("#"+a.parent.element.id+"_collapse",e.element).classList.remove(q),t.select("#"+a.parent.element.id+"_expand",e.element).classList.remove(q))):s?t.select("#"+a.parent.element.id+"_collapse",e.element).classList.add(q):t.select("#"+a.parent.element.id+"_collapse",e.element).classList.add("e-disabled");break;case a.parent.element.id+"_custom_group":l||2!==e.items.length||(e.cancel=!0),t.selectAll("#"+a.parent.element.id+"_custom_group",e.element)&&t.addClass([t.select("#"+a.parent.element.id+"_custom_group",e.element)],q),l&&t.selectAll("#"+a.parent.element.id+"_custom_group",e.element)&&t.removeClass([t.select("#"+a.parent.element.id+"_custom_group",e.element)],q);break;case a.parent.element.id+"_custom_ungroup":if(t.selectAll("#"+a.parent.element.id+"_custom_ungroup",e.element)&&t.addClass([t.select("#"+a.parent.element.id+"_custom_ungroup",e.element)],q),l){var u=!1,c=o.getAttribute("fieldname"),g=f.getFieldByName(c,a.parent.dataSourceSettings.groupSettings);if(g&&"Custom"===g.type||a.parent.engineModule.fieldList[c].isCustomField&&c.indexOf("_custom_group")>-1){if(g=f.getFieldByName(c.replace("_custom_group",""),a.parent.dataSourceSettings.groupSettings)){var m=a.parent.engineModule.pivotValues[Number(o.getAttribute("index"))][Number(o.getAttribute("data-colindex"))],v=a.parent.groupingModule.getSelectedCells(m.axis,c,m.actualText.toString());v.push({axis:m.axis,fieldName:c,name:m.actualText.toString(),cellInfo:m});for(var S=a.parent.groupingModule.getSelectedOptions(v),y=0,b=g.customGroups;y<b.length;y++){var C=b[y];if(S.indexOf(C.groupName)>-1){u=!0;break}}}}else(g&&("Date"===g.type||"Number"===g.type)||a.parent.engineModule.fieldList[c].isCustomField&&c.indexOf("_date_group")>-1)&&(u=!0);t.selectAll("#"+a.parent.element.id+"_custom_ungroup",e.element)&&u&&t.removeClass([t.select("#"+a.parent.element.id+"_custom_ungroup",e.element)],q)}break;case a.parent.element.id+"_drillthrough":a.parent.allowDrillThrough?o.classList.contains("e-summary")?t.select("#"+a.parent.element.id+"_drillthrough",e.element).classList.contains("e-disabled")&&t.select("#"+a.parent.element.id+"_drillthrough",e.element).classList.remove("e-disabled"):""===o.innerText&&t.select("#"+a.parent.element.id+"_drillthrough",e.element)&&t.select("#"+a.parent.element.id+"_drillthrough",e.element).classList.add("e-disabled"):t.select("#"+a.parent.element.id+"_drillthrough",e.element)&&t.select("#"+a.parent.element.id+"_drillthrough",e.element).classList.add("e-disabled");break;case a.parent.element.id+"_sortasc":a.parent.enableValueSorting?o.querySelectorAll(".e-icon-descending").length>0?(t.select("#"+a.parent.element.id+"_sortdesc",e.element)?t.select("#"+a.parent.element.id+"_sortdesc",e.element).classList.add("e-disabled"):t.select("#"+a.parent.element.id+"_sortdesc",e.element).classList.remove("e-disabled"),t.select("#"+a.parent.element.id+"_sortasc",e.element).classList.contains("e-disabled")&&t.select("#"+a.parent.element.id+"_sortasc",e.element).classList.remove("e-disabled")):t.select("#"+a.parent.element.id+"_sortdesc",e.element).classList.contains("e-disabled")&&t.select("#"+a.parent.element.id+"_sortdesc",e.element).classList.remove("e-disabled"):t.select("#"+a.parent.element.id+"_sortasc",e.element)&&t.select("#"+a.parent.element.id+"_sortasc",e.element).classList.add("e-disabled");break;case a.parent.element.id+"_sortdesc":a.parent.enableValueSorting?o.querySelectorAll(".e-icon-ascending").length>0?(t.select("#"+a.parent.element.id+"_sortasc",e.element)?t.select("#"+a.parent.element.id+"_sortasc",e.element).classList.add("e-disabled"):t.select("#"+a.parent.element.id+"_sortasc",e.element).classList.remove("e-disabled"),t.select("#"+a.parent.element.id+"_sortdesc",e.element).classList.contains("e-disabled")&&t.select("#"+a.parent.element.id+"_sortdesc",e.element).classList.remove("e-disabled")):t.select("#"+a.parent.element.id+"_sortasc",e.element).classList.contains("e-disabled")&&t.select("#"+a.parent.element.id+"_sortasc",e.element).classList.remove("e-disabled"):t.select("#"+a.parent.element.id+"_sortdesc",e.element)&&t.select("#"+a.parent.element.id+"_sortdesc",e.element).classList.add("e-disabled");break;case a.parent.element.id+"_CalculatedField":a.parent.allowCalculatedField||t.select("#"+a.parent.element.id+"_CalculatedField",e.element).classList.add("e-disabled");break;case a.parent.element.id+"_pdf":a.parent.allowPdfExport||t.select("#"+a.parent.element.id+"_pdf",e.element).classList.add("e-disabled");break;case a.parent.element.id+"_excel":a.parent.allowExcelExport||t.select("#"+a.parent.element.id+"_excel",e.element).classList.add("e-disabled");break;case a.parent.element.id+"_csv":a.parent.allowExcelExport||t.select("#"+a.parent.element.id+"_csv",e.element).classList.add("e-disabled");break;case a.parent.element.id+"_exporting":a.parent.allowExcelExport||a.parent.allowPdfExport||t.select("#"+a.parent.element.id+"_exporting",e.element).classList.add("e-disabled");break;case a.parent.element.id+"_aggregate":if(t.select("#"+a.parent.element.id+"_aggregate",e.element)&&!t.select("#"+a.parent.element.id+"_aggregate",e.element).classList.contains("e-disabled")&&t.select("#"+a.parent.element.id+"_aggregate",e.element).classList.add("e-disabled"),(o.classList.contains("e-valuesheader")||o.classList.contains("e-valuescontent")||o.classList.contains("e-stot")&&o.classList.contains("e-rowsheader"))&&"olap"!==a.parent.dataType){var x;""!==o.innerText&&(x=a.parent.engineModule.fieldList[h.actualText.toString()].type);var w={cancel:!1,fieldName:h.actualText.toString(),aggregateTypes:a.getMenuItem(x).slice(),displayMenuCount:7};a.parent.trigger("aggregateMenuOpen",w,function(a){if(!a.cancel&&""!==o.innerText){for(var n=[],s=[],l=0;l<a.aggregateTypes.length;l++){var d=a.aggregateTypes[l];"number"!==x?["Count","DistinctCount"].indexOf(d)>-1&&s.indexOf(d)<0&&(n.push({text:i.parent.localeObj.getConstant(d),id:i.parent.element.id+"_Agg"+d}),s.push(d)):i.parent.getAllSummaryType().indexOf(d)>-1&&s.indexOf(d)<0&&(n.push({text:i.parent.localeObj.getConstant(d),id:i.parent.element.id+"_Agg"+d}),s.push(d))}n.length>a.displayMenuCount&&(n.splice(a.displayMenuCount),n.push({text:i.parent.localeObj.getConstant("MoreOption"),id:i.parent.element.id+"_AggMoreOption"})),n&&n.length>=1&&(r.items=n,t.select("#"+i.parent.element.id+"_aggregate",e.element).classList.remove("e-disabled"))}})}}}(n[r]);if("object"==typeof o)return o.value}this.parent.trigger("contextMenuOpen",e)},e.prototype.getMenuItem=function(e){for(var t=[],i=0;i<this.parent.aggregateTypes.length;i++){var a=this.parent.aggregateTypes[i];"string"!==e?this.parent.getAllSummaryType().indexOf(a)>-1&&-1===t.indexOf(a)&&t.push(a):["Count","DistinctCount"].indexOf(a)>-1&&-1===t.indexOf(a)&&t.push(a)}return t},e.prototype.contextMenuClick=function(e){var t,i=this,a=this.parent.lastCellClicked,r=e.item.id,n={},o=this.getCellElement(a),s=Number(o.getAttribute("index")),l=Number(o.getAttribute("data-colindex")),d=this.parent.pivotValues[s][l];switch(e.item.id.indexOf(this.parent.element.id+"_Agg")>-1&&(this.field=this.parent.engineModule.fieldList[d.actualText.toString()].id,this.fieldCaption=this.parent.engineModule.fieldList[d.actualText.toString()].caption,t=e.item.id.split("_Agg")[1]),r){case this.parent.element.id+"_pdf":n={pdfDoc:void 0,isBlob:!1,isMultipleExport:!1,pdfExportProperties:{fileName:"Export.pdf"}},this.parent.trigger("beforeExport",n,function(e){i.parent.pdfExport(e.pdfExportProperties,e.isMultipleExport,e.pdfDoc,e.isBlob)});break;case this.parent.element.id+"_excel":n={isBlob:!1,isMultipleExport:!1,workbook:void 0,excelExportProperties:{fileName:"Export.xlsx"}},this.parent.trigger("beforeExport",n,function(e){i.parent.excelExport(e.excelExportProperties,e.isMultipleExport,e.workbook,e.isBlob)});break;case this.parent.element.id+"_csv":n={isBlob:!1,workbook:void 0,isMultipleExport:!1,excelExportProperties:{fileName:"Export.csv"}},this.parent.trigger("beforeExport",n,function(e){i.parent.csvExport(e.excelExportProperties,e.isMultipleExport,e.workbook,e.isBlob)});break;case this.parent.element.id+"_drillthrough_menu":var p=new MouseEvent("dblclick",{view:window,bubbles:!0,cancelable:!0});o.dispatchEvent(p);break;case this.parent.element.id+"_sortasc":this.parent.setProperties({dataSourceSettings:{valueSortSettings:{headerText:d.valueSort.levelName,headerDelimiter:this.parent.dataSourceSettings.valueSortSettings.headerDelimiter}}}),this.parent.dataSourceSettings.valueSortSettings.sortOrder="Ascending";break;case this.parent.element.id+"_sortdesc":this.parent.setProperties({dataSourceSettings:{valueSortSettings:{headerText:d.valueSort.levelName,headerDelimiter:this.parent.dataSourceSettings.valueSortSettings.headerDelimiter}}}),this.parent.dataSourceSettings.valueSortSettings.sortOrder="Descending";break;case this.parent.element.id+"_expand":if(o.querySelectorAll("."+F)){var h=o.querySelectorAll("."+F)[0];this.parent.onDrill(h)}break;case this.parent.element.id+"_collapse":if(o.querySelectorAll("."+E)){var u=o.querySelectorAll("."+E)[0];this.parent.onDrill(u)}break;case this.parent.element.id+"_CalculatedField":this.parent.calculatedFieldModule.createCalculatedFieldDialog();break;case this.parent.element.id+"_AggMoreOption":case this.parent.element.id+"_AggDifferenceFrom":case this.parent.element.id+"_AggPercentageOfDifferenceFrom":case this.parent.element.id+"_AggPercentageOfParentTotal":o.setAttribute("id",this.field),o.setAttribute("data-caption",this.fieldCaption),o.setAttribute("data-field",this.field),o.setAttribute("data-type",this.engine.fieldList[d.actualText.toString()].aggregateType),o.setAttribute("data-basefield",this.engine.fieldList[d.actualText.toString()].baseField),o.setAttribute("data-baseItem",this.engine.fieldList[d.actualText.toString()].baseItem),this.aggMenu.createValueSettingsDialog(o,this.parent.element,t);break;case this.parent.element.id+"_Agg"+t:this.updateAggregate(t);break;case this.parent.element.id+"_custom_group":case this.parent.element.id+"_custom_ungroup":if(this.parent.groupingModule){var c={target:o,option:r,parentElement:this.parent.element};this.parent.notify("init-grouping",c),this.parent.grid.contextMenuModule.contextMenu.close()}}this.parent.trigger("contextMenuClick",e)},e.prototype.validateColumnTotalcell=function(e){for(var t=Object.keys(this.engine.headerContent),i=!1,a="",r=t.length-1;r>=0;r--){var n=this.engine.headerContent[Number(t[r])][e];if(!n)return!1;if(i=!(!i||""===a)&&a===n.valueSort.axis,a=n.valueSort.axis?n.valueSort.axis.toString():"","sum"===n.type&&(i=!0),i&&n.members&&n.members.length>0)return!0}return!1},e.prototype.validateField=function(e){var t=!1;if(e.classList.contains("e-stot")||e.classList.contains("e-gtot")||e.classList.contains("e-valuescontent")||e.classList.contains("e-valuesheader"))t=!0;else{var i=e.getAttribute("fieldName");if(!i||""===i){var a=Number(e.getAttribute("index")),r=Number(e.getAttribute("data-colindex"));i=this.engine.pivotValues[a][r].actualText}for(var n=this.parent.dataSourceSettings.values,o=0;o<n.length;o++)if(this.parent.dataSourceSettings.values[o].name===i){t=!0;break}}return t},e.prototype.updateAggregate=function(e){if(this.parent.getAllSummaryType().indexOf(e)>-1)for(var t=this.parent.dataSourceSettings.values,i=0;i<this.parent.dataSourceSettings.values.length;i++)this.parent.dataSourceSettings.values[i].name===this.field&&(t[i].type=e)},e.prototype.injectGridModules=function(e){n.Grid.Inject(n.Freeze),e.allowExcelExport&&n.Grid.Inject(n.ExcelExport),e.allowPdfExport&&n.Grid.Inject(n.PdfExport),n.Grid.Inject(n.Selection,n.Reorder,n.Resize),this.gridSettings.contextMenuItems&&n.Grid.Inject(n.ContextMenu)},e.prototype.updateGridSettings=function(){if(this.injectGridModules(this.parent),this.parent.grid.allowResizing=this.gridSettings.allowResizing,this.parent.grid.clipMode=this.gridSettings.clipMode,this.parent.grid.allowTextWrap=this.gridSettings.allowTextWrap,this.parent.grid.allowReordering=this.gridSettings.allowReordering,this.parent.grid.allowSelection=this.gridSettings.allowSelection,this.parent.grid.contextMenuItems=this.gridSettings.contextMenuItems,this.parent.grid.selectedRowIndex=this.gridSettings.selectedRowIndex,this.parent.grid.selectionSettings=this.gridSettings.selectionSettings,this.parent.grid.textWrapSettings=this.gridSettings.textWrapSettings,this.parent.grid.printMode=this.gridSettings.printMode,this.parent.grid.rowHeight=this.gridSettings.rowHeight,this.parent.grid.gridLines=this.gridSettings.gridLines,this.parent.lastGridSettings){var e=Object.keys(this.parent.lastGridSettings);e.indexOf("height")>-1&&(this.parent.grid.height=this.gridSettings.height),e.indexOf("width")>-1&&(this.parent.grid.width=this.gridSettings.width),this.updatePivotColumns(),(e.indexOf("allowTextWrap")>-1||e.indexOf("clipMode")>-1)&&this.parent.layoutRefresh()}this.clearColumnSelection()},e.prototype.updatePivotColumns=function(){for(var e=Object.keys(this.parent.lastGridSettings),i=0;i<this.parent.pivotColumns.length;i++)for(var a=this.parent.pivotColumns[i],r=0;r<e.length;r++){var n=e[r];t.isNullOrUndefined(this.parent.pivotColumns[i][n])||(a[n]=this.parent.lastGridSettings[n])}this.parent.fillGridColumns(this.parent.grid.columns)},e.prototype.clearColumnSelection=function(){t.removeClass(this.parent.element.querySelectorAll(".e-active"),["e-active",_])},e.prototype.appendValueSortIcon=function(e,i,a,r,n){var o="pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule,s=this.parent.dataSourceSettings.valueSortSettings;if(this.parent.enableValueSorting&&s&&""!==s.headerText){var l="grand sum"!==e.type||1!==this.parent.dataSourceSettings.values.length||this.parent.dataSourceSettings.alwaysShowValueHeader?this.parent.dataSourceSettings.values.length>1||this.parent.dataSourceSettings.alwaysShowValueHeader?o.headerContent.length-1:0===this.parent.dataSourceSettings.columns.length?0:o.headerContent.length-1:0,d=s&&s.headerText?e.valueSort.levelName===s.headerText:r===s.columnIndex;void 0!==s&&d&&(a===l||a+1===l&&e.level>-1&&o.headerContent[a+1][r]&&-1===o.headerContent[a+1][r].level)&&"column"===this.parent.dataSourceSettings.valueAxis&&i.querySelector("div div").appendChild(t.createElement("span",{className:("Descending"===s.sortOrder?"e-icon-descending e-icons e-descending e-sortfilterdiv e-value-sort-icon":"e-icon-ascending e-icons e-ascending e-sortfilterdiv e-value-sort-icon")+(e.hasChild?" e-value-sort-align":""),styles:"Right"===n.headerTextAlign?"float : left":""}))}return i},e.prototype.onResizeStop=function(e){if(e.column.columns&&e.column.columns.length>0)this.getChildColumnWidth(e.column.columns);else{var i="0.formattedText"===e.column.field?"0.formattedText":e.column.customAttributes.cell.valueSort.levelName;this.parent.resizeInfo[i]=Number(e.column.width.toString().split("px")[0])}if(this.parent.enableVirtualization&&"0.formattedText"===e.column.field){if(this.parent.dataSourceSettings.values.length>1&&!t.isNullOrUndefined(this.parent.grid.columns[this.parent.grid.columns.length-1].columns)){var a=this.parent.grid.columns[this.parent.grid.columns.length-1].columns;a[a.length-1].minWidth=this.parent.gridSettings.columnWidth}else this.parent.grid.columns[this.parent.grid.columns.length-1].minWidth=this.parent.gridSettings.columnWidth;this.parent.layoutRefresh()}this.setGroupWidth(e),this.calculateGridHeight(!0),this.parent.grid.hideScroll()},e.prototype.getChildColumnWidth=function(e){for(var t=0,i=e;t<i.length;t++){var a=i[t];if(a.columns&&a.columns.length>0)this.getChildColumnWidth(a.columns);else{var r=a.customAttributes.cell.valueSort.levelName;this.parent.resizeInfo[r]=Number(a.width.toString().split("px")[0])}}},e.prototype.setGroupWidth=function(e){if(this.parent.enableVirtualization&&"0.formattedText"===e.column.field&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector(".e-grouping-bar")&&Number(e.column.width.toString().split("px")[0])<250&&(e.cancel=!0),this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector(".e-grouping-bar")){if(this.parent.groupingBarModule.refreshUI(),this.parent.element.querySelector(".e-group-row").offsetWidth<245&&!this.parent.firstColWidth){e.cancel=!0;var t=this.parent.grid.columns;t&&t.length>0&&(t[0].width=this.resColWidth),this.parent.element.querySelector("."+B).querySelector("col").style.width=this.resColWidth+"px",this.parent.element.querySelector(".e-content").querySelector("col").style.width=this.resColWidth+"px"}this.parent.element.querySelector(".e-group-rows").style.height="auto",this.parent.element.querySelector(".e-group-values").style.width=this.parent.element.querySelector(".e-group-row").offsetWidth+"px";var i=this.parent.element.querySelector("."+B).offsetHeight;this.parent.element.querySelector(".e-group-rows").style.height=i+"px"}if(e.cancel){var a="0.formattedText"===e.column.field?"0.formattedText":e.column.customAttributes.cell.valueSort.levelName;this.parent.resizeInfo[a]=Number(e.column.width.toString().split("px")[0]),this.parent.enableVirtualization&&this.parent.layoutRefresh()}this.parent.enableVirtualization&&(this.parent.resizedValue=e.cancel||"0.formattedText"!==e.column.field?this.parent.resizedValue:Number(e.column.width.toString().split("px")[0])),this.parent.trigger("touchend"===e.e.type||"mouseup"===e.e.type?"resizeStop":"resizing",e)},e.prototype.selected=function(){clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.onSelect.bind(this),300)},e.prototype.onSelect=function(){for(var e={selectedCellsInfo:[],pivotValues:this.parent.pivotValues,currentCell:null},t=this.parent.element.querySelectorAll(".e-cellselectionbackground,."+_),i=0;i<t.length;i++){var a=t[i],r=Number(a.getAttribute("data-colindex")),n=Number(a.getAttribute("index")),o=this.engine.pivotValues[n][r];o&&("value"===o.axis?e.selectedCellsInfo.push({currentCell:o,value:o.value,columnHeaders:o.columnHeaders,rowHeaders:o.rowHeaders,measure:o.actualText.toString()}):"column"===o.axis?e.selectedCellsInfo.push({currentCell:o,value:o.formattedText,columnHeaders:o.valueSort.levelName,rowHeaders:"",measure:""}):e.selectedCellsInfo.push({currentCell:o,value:o.formattedText,columnHeaders:"",rowHeaders:o.valueSort.levelName,measure:""}))}this.parent.trigger("cellSelected",e)},e.prototype.rowCellBoundEvent=function(e){var i=e.cell;if(i&&this.parent.notEmpty&&this.engine.headerContent){var a=this.parent.hyperlinkSettings.cssClass,r=this.parent.isTabular?i.getAttribute("data-colindex"):"0",n=e.data[Number(r)],o=n.valueSort&&n.valueSort.levelName===(0===this.parent.dataSourceSettings.rows.length&&"row"===this.parent.dataSourceSettings.valueAxis&&this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+n.formattedText);i.setAttribute("index",n.rowIndex?n.rowIndex.toString():"0");var s=this.parent.pivotValues[n.rowIndex]&&this.parent.pivotValues[n.rowIndex][Number(i.getAttribute("data-colindex"))]?this.parent.pivotValues[n.rowIndex][Number(i.getAttribute("data-colindex"))]:null,l=this.parent.isTabular?this.parent.engineModule.rowMaxLevel:0;if(Number(i.getAttribute("data-colindex"))<=l){if("pivot"===this.parent.dataType){var d=n.type&&"value"===n.type;i.innerText="";var p=n.valueSort?n.valueSort.levelName.toString():"",h=n.actualText?n.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,u=p.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(h?h-1:h),c=u?u-1:0;if("Bottom"===this.parent.dataSourceSettings.subTotalsPosition&&!t.isNullOrUndefined(p)){var g=n.isSum?"value"===n.type?p.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+(this.parent.engineModule.valueAxisFields[n.actualText].caption?this.parent.engineModule.valueAxisFields[n.actualText].caption:this.parent.engineModule.valueAxisFields[n.actualText].name))[0]:"":p;n.isSum&&("value"!==n.type||this.drilledLevelInfo[g])?c-=1:n.isSum||(1===g.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length&&(this.drilledLevelInfo={}),n.members&&n.members.length>0&&(this.drilledLevelInfo[g]=n.isDrilled))}if(!this.parent.isTabular){do{c>0&&i.appendChild(t.createElement("span",{className:0===c?"":"e-nextspan"})),c--}while(c>-1);c=u?u-1:0,this.lastSpan=u?this.lastSpan:0,!n.hasChild&&(d?0:c)>0&&i.appendChild(t.createElement("span",{className:"e-lastspan"}))}var m=void 0;if(this.parent.dataSourceSettings.rows.length>0&&(!n.valueSort||Object.keys(n.valueSort).length>0)){if(d)for(var f=0,v=this.parent.dataSourceSettings.values;f<v.length;f++){var S=v[f],y=S.caption?S.caption:S.name;if(p.indexOf(y)>-1){m=S.name;break}}else m=n.level>-1&&this.parent.dataSourceSettings.rows[n.level]?this.parent.dataSourceSettings.rows[n.level].name:"";i.setAttribute("fieldname",m)}}else i=this.onOlapRowCellBoundEvent(i,n);var b=n.formattedText;if(n.type)if("grand sum"===n.type){this.rowGrandPos=n.rowIndex,i.classList.add("e-gtot");var C=this.parent.dataSourceSettings.values;b=t.isNullOrUndefined(n.valueSort.axis)?0===this.parent.dataSourceSettings.rows.length&&1===C.length&&"row"===this.parent.dataSourceSettings.valueAxis?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(C[C.length-1].type)+" "+this.parent.localeObj.getConstant("of")+" "+(t.isNullOrUndefined(C[C.length-1].caption)?C[C.length-1].name:C[C.length-1].caption):this.parent.localeObj.getConstant("grandTotal"):n.formattedText}else n.valueSort.levelName===this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+n.formattedText?(i.classList.add("e-gtot"),b=o?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[n.actualText].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+n.formattedText:b):"sum"===n.type&&3!==n.memberType?b=n.formattedText.split("Total")[0]+this.parent.localeObj.getConstant("total"):i.classList.add("e-stot");this.parent.isTabular?(this.setSpanAttributes("rowspan",n.rowSpan,i),this.setSpanAttributes("colspan",n.colSpan,i)):i.classList.add(L),!0!==n.hasChild||n.isNamedSet||i.appendChild(t.createElement("div",{className:(!0===n.isDrilled?E:F)+" "+P,attrs:{title:!0===n.isDrilled?this.parent.localeObj.getConstant("collapse"):this.parent.localeObj.getConstant("expand")}})),i.appendChild(t.createElement("span",{className:"e-cellvalue",innerHTML:this.parent.isRowCellHyperlink||n.enableHyperlink?'<a data-url="'+b+'" class="e-hyperlinkcell '+a+'">'+b+"</a>":b}));var x=this.parent.pivotView.dataSourceSettings.valueSortSettings;this.parent.enableValueSorting&&x&&x.headerText&&"row"===this.parent.dataSourceSettings.valueAxis&&this.parent.pivotValues[Number(i.getAttribute("index"))][0]&&this.parent.pivotValues[Number(i.getAttribute("index"))][0].valueSort.levelName&&this.parent.pivotValues[Number(i.getAttribute("index"))][0].valueSort.levelName===x.headerText&&i.appendChild(t.createElement("span",{className:("Descending"===x.sortOrder?"e-icon-descending e-icons e-descending e-sortfilterdiv e-value-sort-icon":"e-icon-ascending e-icons e-ascending e-sortfilterdiv e-value-sort-icon")+(n.hasChild?" e-value-sort-align":""),styles:"right"===i.style.textAlign?"float: left":""}))}else{var w=i.innerText;i.innerText="",i.classList.add("e-valuescontent"),n=e.data[Number(i.getAttribute("data-colindex"))],(n=t.isNullOrUndefined(n)?e.column.customAttributes.cell:n).isGrandSum=!!o||n.isGrandSum,n.isSum&&i.classList.add("e-summary");var T=t.isNullOrUndefined(n.isGrandSum)&&!t.isNullOrUndefined(this.parent.olapEngineModule)&&"column"===this.parent.olapEngineModule.olapValueAxis&&"olap"===this.parent.dataType&&this.colGrandPos-this.parent.dataSourceSettings.values.length<Number(i.getAttribute("data-colindex"));n.isGrandSum||T||this.colGrandPos===Number(i.getAttribute("data-colindex"))||this.rowGrandPos===Number(i.getAttribute("index"))?i.classList.add("e-gtot"):("olap"===this.parent.dataType?n.isSum:this.validateColumnTotalcell(n.colIndex))&&i.classList.add("e-colstot"),s&&s.cssClass&&i.classList.add(s.cssClass),i.appendChild(t.createElement("span",{className:"e-cellvalue",innerHTML:-1!==i.className.indexOf("e-summary")&&this.parent.isSummaryCellHyperlink||-1===i.className.indexOf("e-summary")&&this.parent.isValueCellHyperlink||n.enableHyperlink?'<a data-url="'+w+'" class="e-hyperlinkcell '+a+'">'+w+"</a>":w})),this.parent.gridSettings.allowReordering&&i.setAttribute("data-colindex",e.column.customAttributes?e.column.customAttributes.cell.colIndex.toString():e.column.index.toString())}this.parent.cellTemplate&&this.appendTemplate(i,s),this.unWireEvents(i),this.wireEvents(i)}e.pivotview=this.parent,this.parent.trigger("queryCellInfo",e)},e.prototype.appendTemplate=function(e,i){var a=this.parent.getCellTemplate()({targetCell:e,cellInfo:i},this.parent,"cellTemplate",this.parent.element.id+"_cellTemplate",null,null,e);if(a&&""!==a&&a.length>0)if(this.parent.enableHtmlSanitizer)if(this.parent.isVue||this.parent.isVue3){var r=t.createElement("div");r.innerHTML=t.SanitizeHtmlHelper.sanitize(a),t.append([r.firstChild],e)}else this.parent.appendHtml(e,t.SanitizeHtmlHelper.sanitize(a[0].outerHTML));else this.parent.isVue||this.parent.isVue3?t.append(a,e):this.parent.appendHtml(e,a[0].outerHTML)},e.prototype.onOlapRowCellBoundEvent=function(e,i){e.innerText="";var a=this.engine.rowMeasurePos;if(this.parent.enableVirtualization){if(i.ordinal>-1&&this.parent.olapEngineModule.tupRowInfo.length>0){var r=this.parent.olapEngineModule.tupRowInfo[i.ordinal],n=3===i.memberType?this.engine.fieldList[i.actualText.toString()].tag.toString():i.actualText.toString(),o=r.uNameCollection.indexOf(n),s=(r.uNameCollection.substring(0,o)+(3===i.memberType?"":i.actualText.toString())).split("::[").map(function(e){return"["===e[0]?e:"["+e});3===i.memberType&&a&&s.push(i.actualText.toString());for(var l=-1,d=0,p=!1,h=0;h<s.length;h++){l+=s[h].split("~~").length;S="2"!==r.typeCollection[h]&&(!!(this.engine.fieldList[r.members[h].getAttribute("Hierarchy")]&&this.engine.fieldList[r.members[h].getAttribute("Hierarchy")].isHierarchy&&h<this.parent.dataSourceSettings.rows.length-1&&!this.parent.dataSourceSettings.rows[h+1].isNamedSet&&this.parent.dataSourceSettings.rows[h+1].name.indexOf("[Measures]")<0&&this.engine.fieldList[this.parent.dataSourceSettings.rows[h+1].name]&&this.engine.fieldList[this.parent.dataSourceSettings.rows[h+1].name].hasAllMember)||Number(r.members[h].querySelector("CHILDREN_CARDINALITY").textContent)>0);d+=h>0&&p&&!S?1:0,p=S}for(var u=0,c=0;c<l;c++)e.appendChild(t.createElement("span",{className:"e-nextspan"})),u++;for(c=0;c<d&&l>0;c++)e.appendChild(t.createElement("span",{className:"e-lastspan"}));this.indentCollection[i.rowIndex]=u,this.maxIndent=this.maxIndent>u?this.maxIndent:u}}else{var g=i.hierarchy,m=i.valueSort?i.valueSort.levelName.toString():"",f=-1===i.level?this.measurePos:m.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-1,v=3===i.memberType?f+"."+i.levelUniqueName:i.levelUniqueName,S=i.hasChild,y=!1;if(i.isSum&&3===i.memberType){for(var b=this.lvlCollection[i.parentUniqueName].position,C=b+1;C<this.position;C++)delete this.lvlCollection[this.lvlPosCollection[C]],delete this.lvlPosCollection[C];this.position=this.position>b+1?b+1:this.position,y=!0,this.measurePos=this.lvlCollection[i.parentUniqueName].position}if(!this.lvlCollection[v]&&v)this.lvlPosCollection[this.position]=v,this.lvlCollection[v]={position:this.position,hasChild:S},this.position++;else if(v){for(var x=this.lvlCollection[v].position,w=x+1;w<this.position;w++)delete this.lvlCollection[this.lvlPosCollection[w]],delete this.lvlPosCollection[w];this.position=this.position>x+1?x+1:this.position}if(!this.hierarchyCollection[g]&&g)this.hierarchyPosCollection[this.hierarchyCount]=g,this.hierarchyCollection[g]={lvlPosition:this.position-1,hierarchyPOs:this.hierarchyCount},this.hierarchyCount++;else if(g){for(var T=this.hierarchyCollection[g].hierarchyPOs,w=T+1;w<this.hierarchyCount;w++)delete this.hierarchyCollection[this.hierarchyPosCollection[w]],delete this.hierarchyPosCollection[w];this.hierarchyCount=this.hierarchyCount>T+1?T+1:this.hierarchyCount}if(3!==i.memberType&&v&&this.lvlCollection[v]){var M=this.hierarchyCollection[g]?this.hierarchyCollection[g].hierarchyPOs:-1;this.measurePos=a<=M&&this.hierarchyPosCollection[a+1]?this.measurePos:this.lvlCollection[v].position}var D=this.lvlCollection[v]?this.lvlCollection[v].position:-1;D=y?D-1:D;for(var O=0,u=0;O<=D&&D>0&&i.level>-1;){var P=this.lvlCollection[this.lvlPosCollection[O]].hasChild;(p=O>0&&this.lvlCollection[this.lvlPosCollection[O-1]].hasChild)&&!P&&e.appendChild(t.createElement("span",{className:"e-lastspan"})),O!==D&&(e.appendChild(t.createElement("span",{className:"e-nextspan"})),u++),O++}"Top"!==this.parent.dataSourceSettings.grandTotalsPosition||t.isNullOrUndefined(this.parent.olapEngineModule)||"row"!==this.parent.olapEngineModule.olapValueAxis||"olap"!==this.parent.dataType||0!==i.valueSort.levelName.toString().indexOf(this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter)||e.appendChild(t.createElement("span",{className:"e-nextspan"})),3===i.memberType&&-1===i.level&&Object.keys(this.lvlCollection).length>1&&(e.appendChild(t.createElement("span",{className:"e-nextspan"})),u++),this.indentCollection[i.rowIndex]=u,this.maxIndent=this.maxIndent>u?this.maxIndent:u}return e.setAttribute("fieldname",i.hierarchy),!!this.parent.olapEngineModule.tupRowInfo[i.ordinal]&&(0===this.parent.olapEngineModule.tupRowInfo[i.ordinal].measurePosition?1===this.parent.olapEngineModule.tupRowInfo[i.ordinal].allStartPos:0===this.parent.olapEngineModule.tupRowInfo[i.ordinal].allStartPos)&&e.classList.add("e-gtot"),e},e.prototype.columnCellBoundEvent=function(e){if(e.cell.column&&e.cell.column.customAttributes){var i=e.cell.column.customAttributes.cell,a=e.node;if(i){for(var r=this.parent.hyperlinkSettings.cssClass,n=!1,o=0,s=this.parent.dataSourceSettings.values;o<s.length;o++){var l=s[o];l.name===i.actualText&&(n=!0,a.setAttribute("fieldname",l.name))}-1===i.level&&!i.rowSpan||-1===i.rowSpan?e.node.style.display="none":i.rowSpan>1&&(e.node.setAttribute("rowspan",i.rowSpan.toString()),e.node.setAttribute("aria-rowspan",i.rowSpan.toString()),i.rowIndex+i.rowSpan===this.engine.headerContent.length&&(e.node.style.borderBottomWidth="0px")),e.node.setAttribute("data-colindex",i.colIndex.toString()),e.node.setAttribute("index",i.rowIndex.toString());var d=void 0;"pivot"===this.parent.dataType?(!n&&!(this.parent.dataSourceSettings.values&&"column"===this.parent.dataSourceSettings.valueAxis&&this.parent.dataSourceSettings.values.length>1&&n&&i.rowIndex===this.engine.headerContent.length-1)&&this.parent.dataSourceSettings.columns&&this.parent.dataSourceSettings.columns.length>0&&(d=i.level>-1&&this.parent.dataSourceSettings.columns[i.level]?this.parent.dataSourceSettings.columns[i.level].name:"",a.setAttribute("fieldname",d)),this.validateColumnTotalcell(i.colIndex)&&a.classList.add("e-colstot")):a=this.onOlapColumnCellBoundEvent(a,i);var p=0===this.parent.dataSourceSettings.columns.length&&"column"===this.parent.dataSourceSettings.valueAxis&&i.valueSort&&i.valueSort.levelName===this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+i.formattedText;if(i.type||p){a.classList.add("grand sum"===i.type?"e-gtot":"e-stot"),"grand sum"===i.type?this.colGrandPos=i.colIndex:i.type&&a.classList.add("e-colstot");var h="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,u="grand sum"===i.type?t.isNullOrUndefined(i.valueSort.axis)||"olap"===this.parent.dataType?this.parent.localeObj.getConstant("grandTotal"):i.formattedText:i.formattedText.split("Total")[0]+this.parent.localeObj.getConstant("total");u=p&&h.fieldList?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(h.fieldList[i.actualText].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+i.formattedText:u,null!==a.querySelector(".e-headertext")?a.querySelector(".e-headertext").innerText=u:a.querySelector(".e-stackedheadercelldiv").innerText=u}if(a.classList.add("e-columnsheader"),this.parent.isColumnCellHyperlink||i.enableHyperlink)if(a.querySelector(".e-stackedheadercelldiv")){c=a.querySelector(".e-stackedheadercelldiv").innerText;a.querySelector(".e-stackedheadercelldiv").innerHTML='<a data-url="'+c+'" class="e-hyperlinkcell '+r+'">'+c+"</a>"}else if(a.querySelector(".e-headertext")){var c=a.querySelector(".e-headertext").innerText;a.querySelector(".e-headertext").innerHTML='<a data-url="'+c+'" class="e-hyperlinkcell '+r+'">'+c+"</a>"}if(!0!==i.hasChild||i.isNamedSet)this.updateWrapper(a);else{var g=a.querySelector(".e-headercelldiv");g&&(g.style.height="auto",g.style.lineHeight="normal");var m=t.createElement("div",{className:(!0===i.isDrilled?E:F)+" "+P,attrs:{title:!0===i.isDrilled?this.parent.localeObj.getConstant("collapse"):this.parent.localeObj.getConstant("expand")}});window.navigator.userAgent.indexOf("Edge")>-1||window.navigator.userAgent.indexOf("Trident")>-1?a.children[0].style.display="table":a.children[0].style.display="block",this.updateWrapper(a,m)}a=this.appendValueSortIcon(i,a,i.rowIndex,i.colIndex,e.cell.column),this.parent.cellTemplate&&this.appendTemplate(a,i);for(var f=this.parent.dataSourceSettings.values.length,v=0;v<f;v++)this.parent.dataSourceSettings.values[v].name===i.actualText&&("olap"===this.parent.dataType&&!!this.parent.olapEngineModule.tupColumnInfo[i.ordinal]&&(0===this.parent.olapEngineModule.tupColumnInfo[i.ordinal].measurePosition?1===this.parent.olapEngineModule.tupColumnInfo[i.ordinal].allStartPos:0===this.parent.olapEngineModule.tupColumnInfo[i.ordinal].allStartPos)&&a.classList.add("e-gtot"),i.valueSort.levelName===this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+i.formattedText||i.valueSort.levelName==="Grand Total"+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+i.formattedText?a.classList.add("e-gtot"):a.classList.add("e-valuesheader"));this.unWireEvents(a),this.wireEvents(a)}}else if(this.parent.isTabular){var S=this.parent.engineModule.rowMaxLevel+1;e.cell&&e.cell.column&&0===e.cell.column.index?(e.node.setAttribute("colspan",S.toString()),e.node.classList.add("e-freezeleftborder")):e.node.style.display="none"}this.parent.trigger("headerCellInfo",e)},e.prototype.updateWrapper=function(e,i){if(e.querySelectorAll(".e-headercelldiv").length>0||e.querySelectorAll(".e-stackedheadercelldiv").length>0){var a=t.createElement("div",{className:"e-pivotcell-container"}),r=t.createElement("div",{className:(i?"e-stackedheadertext":"e-headertext")+" e-cellvalue",innerHTML:e.querySelectorAll(".e-headercelldiv").length>0?e.querySelector(".e-headercelldiv").innerHTML:e.querySelector(".e-stackedheadercelldiv").innerHTML});i&&a.append(i),a.append(r),e.children[0].innerHTML="",e.children[0].append(a)}return e},e.prototype.onOlapColumnCellBoundEvent=function(e,t){e.setAttribute("fieldname",3===t.memberType?t.actualText.toString():t.hierarchy);var i=this.engine.headerContent[t.rowIndex]?this.engine.headerContent[t.rowIndex][t.colIndex-1]:void 0;return i&&i.actualText===t.actualText&&i.type===t.type&&i.colSpan>1&&(e.style.display="none"),t.rowIndex===this.engine.headerContent.length-1&&2===t.memberType&&(e.style.display=this.isSpannedCell(this.engine.headerContent.length,t)?"none":e.style.display),e},e.prototype.isSpannedCell=function(e,t){for(var i,a,r=this.engine.headerContent[t.rowIndex-1]?this.engine.headerContent[t.rowIndex-1][t.colIndex]:void 0;r&&(r.memberType===t.memberType||r.type&&t.type);)r.rowSpan>0&&(i=r.rowSpan,a=r.rowIndex),r=this.engine.headerContent[r.rowIndex-1]?this.engine.headerContent[r.rowIndex-1][t.colIndex]:void 0;return a+i>=e},e.prototype.onHyperCellClick=function(e){var i=e.target.parentElement.parentElement,a={currentCell:i=i.className.indexOf("e-headercelldiv")>-1?i.parentElement:i,data:this.engine.pivotValues[Number(i.getAttribute("index"))][Number(i.getAttribute("data-colindex"))],cancel:!0,nativeEvent:e};this.parent.trigger("hyperlinkCellClick",a,function(e){if(!e.cancel){a.currentCell=t.getElement(a.currentCell);var i=a.currentCell.getAttribute("data-url")?a.currentCell.getAttribute("data-url"):a.currentCell.querySelector("a").getAttribute("data-url");window.open(i)}})},e.prototype.getRowStartPos=function(){for(var e,t=this.parent.pivotValues,i=0;i<(t?t.length:0);i++)if(t[i]&&t[i][0]&&"row"===t[i][0].axis){e=i;break}return e},e.prototype.frameDataSource=function(e){var t=[];if(("pivot"===this.parent.dataType&&this.parent.dataSourceSettings.dataSource&&this.parent.engineModule.data.length>0||"olap"===this.parent.dataType&&""!==this.parent.dataSourceSettings.url||"Server"===this.parent.dataSourceSettings.mode&&""!==this.parent.dataSourceSettings.url&&this.engine.pivotValues.length>0)&&this.parent.dataSourceSettings.values.length>0&&!this.engine.isEmptyData)if(this.parent.enableValueSorting||!this.engine.isEngineUpdated||"Tabular"===this.gridSettings.layout){for(var i=0,a=this.parent.pivotValues,r="value"===e?this.rowStartPos:0,n="value"===e?a?a.length:0:this.rowStartPos,o=r;o<n;o++)if(a[o]){t[i="header"===e?o:i]={};for(var s=0;s<a[o].length;s++)a[o][s]&&(t[i][s]=a[o][s]);i++}}else t="value"===e?this.engine.valueContent:this.engine.headerContent;else t=this.frameEmptyData();return t},e.prototype.frameEmptyData=function(){return[{0:{formattedText:this.parent.localeObj.getConstant("grandTotal")},1:{formattedText:this.parent.localeObj.getConstant("emptyData")}}]},e.prototype.calculateColWidth=function(e){t.isNullOrUndefined(this.parent.resizedValue)||(this.parent.resizedValue=this.parent.showGroupingBar&&this.parent.resizedValue<250?250:this.parent.resizedValue),this.resColWidth=t.isNullOrUndefined(this.parent.resizedValue)?this.resColWidth:this.parent.resizedValue;var i=this.calculateGridWidth(),a=isNaN(this.parent.width)?this.parent.width.toString().indexOf("%")>-1?parseFloat(this.parent.width.toString())/100*i:i:Number(this.parent.width);if(a-=this.gridSettings.columnWidth>this.resColWidth?this.gridSettings.columnWidth:this.parent.isTabular?(this.parent.engineModule.rowMaxLevel+1)*this.resColWidth:this.resColWidth,e=this.parent.isTabular?e-(this.parent.engineModule.rowMaxLevel+1):e-1,this.isOverflows=!(e*this.gridSettings.columnWidth<a),!this.isOverflows){var r=this.calculateGridHeight(),o="auto"===r?this.parent.getHeightAsNumber():r,s=this.engine&&this.engine.headerContent?Object.keys(this.engine.headerContent).length:1,l=o-this.gridSettings.rowHeight*s;this.engine&&this.engine.valueContent&&this.gridSettings.rowHeight*this.engine.valueContent.length>l&&(a-=n.getScrollBarWidth())}var d=e*this.gridSettings.columnWidth<a?a/e:this.gridSettings.columnWidth;return this.isOverflows||this.gridSettings.allowAutoResizing?Math.floor(d):this.gridSettings.columnWidth},e.prototype.resizeColWidth=function(e){t.isNullOrUndefined(this.parent.resizedValue)||(this.parent.resizedValue=this.parent.showGroupingBar&&this.parent.resizedValue<250?250:this.parent.resizedValue),this.resColWidth=t.isNullOrUndefined(this.parent.resizedValue)?this.resColWidth:this.parent.resizedValue;var i=isNaN(this.parent.width)?this.parent.width.toString().indexOf("%")>-1?parseFloat(this.parent.width.toString())/100*this.parent.element.offsetWidth:this.parent.element.offsetWidth:Number(this.parent.width);e-=1,i-=this.gridSettings.columnWidth>this.resColWidth?this.gridSettings.columnWidth:this.resColWidth,this.isOverflows=!(e*this.gridSettings.columnWidth<i);var a=e*this.gridSettings.columnWidth<i?i/e:this.gridSettings.columnWidth;return this.isOverflows||this.gridSettings.allowAutoResizing?Math.floor(a):this.gridSettings.columnWidth},e.prototype.calculateGridWidth=function(){var e=this.parent.width,t=this.parent.element.getBoundingClientRect().width?this.parent.element.getBoundingClientRect().width:this.parent.element.offsetWidth;return 0===t&&(t=this.parent.element.parentElement.getBoundingClientRect().width?this.parent.element.parentElement.getBoundingClientRect().width:this.parent.element.parentElement.offsetWidth),"auto"===this.gridSettings.width?"auto"===this.parent.width?e=t:this.parent.width.toString().indexOf("%")>-1?e=parseFloat(this.parent.width.toString())/100*t:this.parent.width.toString().indexOf("px")>-1&&(e=this.parent.width.toString().split("px")[0]):e=this.gridSettings.width,!this.gridSettings.allowAutoResizing&&e>this.parent.totColWidth?this.parent.totColWidth:e},e.prototype.calculateGridHeight=function(e){var t=this.parent.element.querySelector(".e-grid .e-content"),i=this.parent.height,a=this.parent.getHeightAsNumber();if(t&&(a=isNaN(a)?a>this.parent.minHeight?a:this.parent.minHeight:t.offsetWidth<t.querySelector("."+I).offsetWidth?a-n.getScrollBarWidth():a,this.parent.showToolbar&&"Chart"!==this.parent.currentView||!this.parent.showToolbar&&"Chart"!==this.parent.displayOption.view))if("auto"===this.gridSettings.height&&a&&this.parent.element.querySelector(".e-gridheader"))if(i=a-(this.parent.element.querySelector(".e-gridheader").offsetHeight+(this.parent.element.querySelector(".e-pivot-grouping-bar")?this.parent.element.querySelector(".e-pivot-grouping-bar").offsetHeight:0)+(this.parent.element.querySelector("."+z)?42:0)+(this.parent.element.querySelector(".e-pivot-pager")?this.parent.element.querySelector(".e-pivot-pager").offsetHeight:0))-1,i=i<40?40:i,e){var r=t.querySelector("."+I).offsetHeight,o=t.querySelector("."+I).offsetHeight,s=t.querySelector("."+I).offsetWidth,l=t.offsetWidth<=s,d=!!(l&&i-r<18);i>=r&&(!l||i>=o)&&!d?this.parent.grid.height="auto":(this.parent.grid.height=i,this.parent.grid.dataBind())}else i>this.engine.valueContent.length*this.gridSettings.rowHeight&&(i="auto");else i=this.gridSettings.height;return i<this.parent.gridSettings.rowHeight?this.parent.gridSettings.rowHeight:i},e.prototype.frameStackedHeaders=function(){var e=this.parent.pivotColumns,i="pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule,a=this.parent.grid.columnModel,r=!1,n=!(!this.parent.toolbarModule||!this.parent.toolbarModule.isReportChange)||!!this.parent.actionObj&&("Sort value"===this.parent.actionObj.actionName&&1===i.valueAxis||"Sort field"===this.parent.actionObj.actionName&&"columns"===this.parent.actionObj.fieldInfo.axis||this.parent.pivotFieldListModule&&"Sort field"===this.parent.pivotFieldListModule.actionObj.actionName&&"columns"===this.parent.pivotFieldListModule.actionObj.fieldInfo.axis);if(this.pivotColumns=[],("olap"===this.parent.dataType&&""!==this.parent.dataSourceSettings.url||this.parent.dataSourceSettings.values.length>0&&this.parent.dataSourceSettings.dataSource&&this.parent.engineModule.data.length>0||"Server"===this.parent.dataSourceSettings.mode&&""!==this.parent.dataSourceSettings.url&&this.engine.pivotValues.length>0)&&!this.engine.isEmptyData){var o=this.engine.headerContent.length,s=[],l=[],d=this.calculateColWidth(this.engine.pivotValues&&this.engine.pivotValues[0]?this.engine.pivotValues[0].length:0),p="olap"===this.parent.dataType&&!t.isNullOrUndefined(this.engine.colMeasurePos)&&this.engine.colDepth-1===this.parent.olapEngineModule.colMeasurePos;do{var h=[],u=0;o--;var c=this.engine.headerContent[o],g=c?Object.keys(c).length:0;if(c)for(var m=this.parent.isTabular?this.parent.engineModule.rowMaxLevel+1:c[0]?0:1,f=0,v=Object.keys(c).length+m;f<v;f++){var S=c[f]&&c[f].colSpan?3!==c[f].memberType||3===c[f].memberType&&!p||0===o?c[f].colSpan:s[f]:1;S="olap"===this.parent.dataType&&t.isNullOrUndefined(S)?1:S;var y=c[f]?"grand sum"===c[f].type?t.isNullOrUndefined(c[f].valueSort.axis)?this.parent.localeObj.getConstant("grandTotal"):c[f].formattedText:"sum"===c[f].type?c[f].formattedText.split("Total")[0]+this.parent.localeObj.getConstant("total"):c[f].formattedText:"";if(y=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(y):y,o===this.engine.headerContent.length-1)S=1,r=e.length-1===g&&(!n&&!this.parent.isEmptyGrid&&e[u]&&e[u].autoFit),h[u]={field:f+".formattedText",headerText:y,customAttributes:{cell:this.cloneDataWithoutIndex(c[f])},width:r?a[u].width:c[f]&&c[f].valueSort?this.setSavedWidth(c[f].valueSort.levelName,d):this.resColWidth,minWidth:r&&u===g?a[a.length-1].minWidth:30,allowReordering:this.parent.gridSettings.allowReordering,allowResizing:this.parent.gridSettings.allowResizing,visible:!0,textAlign:this.parent.enableRtl?"Left":"Right",headerTextAlign:this.parent.enableRtl?"Right":"Left"},f===g&&(h[u].width=h[u].width-3,this.lastColumn=h[u]);else if(s[f]){for(var b=S,C=[],x=f;b>0;){if(h[u]){if(!this.pivotColumns[l[x]])break;C.push(this.pivotColumns[l[x]])}else h[u]={headerText:y,field:c[f]?c[f].valueSort.levelName:"",customAttributes:{cell:this.cloneDataWithoutIndex(c[f])},width:r&&0===u&&!n&&!this.parent.isEmptyGrid&&e[0].autoFit?a[0].width:c[f]?this.setSavedWidth(c[f].valueSort.levelName,d):this.resColWidth,minWidth:30,allowReordering:this.parent.gridSettings.allowReordering,allowResizing:this.parent.gridSettings.allowResizing,visible:!0,headerTextAlign:this.parent.enableRtl?"Right":"Left"},C=[this.pivotColumns[l[x]]];this.isAutoFitEnabled=!!this.isAutoFitEnabled||r,b-=s[x],x+=s[x]}h[u].columns=C}h[u]&&(h[u].clipMode=this.gridSettings.clipMode),s[f]=S,l[f]=u,u++,f=f+S-1}this.pivotColumns=h.length>0?h:this.pivotColumns}while(o>0);if(this.parent.isTabular)for(var w=0;w<this.parent.engineModule.rowMaxLevel+1;w++)if(this.parent.showGroupingBar&&!this.parent.isAdaptive){var T=this.parent.element.querySelector(".e-group-row"),M=T.querySelectorAll(".e-pvt-btn-div"),D=0;D=this.parent.engineModule.rowMaxLevel!==M.length-1&&w===this.parent.engineModule.rowMaxLevel?this.getTotalColumnWidth(M,w):1===T.querySelectorAll(".e-pvt-btn-div").length?250:.8*this.parent.element.getBoundingClientRect().width<=this.getTotalColumnWidth(M,0)?this.gridSettings.columnWidth:(T.querySelectorAll(".e-pvt-btn-div")[w].getBoundingClientRect().width<this.parent.gridSettings.columnWidth?this.parent.gridSettings.columnWidth:T.querySelectorAll(".e-pvt-btn-div")[w].getBoundingClientRect().width)+6,this.pivotColumns[w]={field:w+".formattedText",width:D>this.gridSettings.columnWidth?D:this.resColWidth,minWidth:30,headerText:"",allowReordering:!1,allowResizing:!this.parent.isTabular&&this.parent.gridSettings.allowResizing,visible:!0,clipMode:this.parent.gridSettings.clipMode}}else for(var O=0;O<this.parent.engineModule.rowMaxLevel+1;O++)this.updatePivotColumn(this.pivotColumns,O,r,n,a);else this.updatePivotColumn(this.pivotColumns,0,r,n,a)}else this.pivotColumns=this.frameEmptyColumns();return this.parent.toolbarModule&&this.parent.showToolbar&&(this.parent.toolbarModule.isReportChange=!1),this.parent.triggerColumnRenderEvent(this.pivotColumns),r=this.parent.pivotColumns.length>0&&this.parent.pivotColumns[this.parent.pivotColumns.length-1].autoFit,this.pivotColumns},e.prototype.setSavedWidth=function(e,i){if("0.formattedText"!==e||t.isNullOrUndefined(this.parent.resizedValue)){if(this.parent.isTabular&&this.parent.element.querySelector(".e-row").querySelector(".e-rowcell")&&this.parent.showGroupingBar&&"0.formattedText"===e&&0===this.parent.dataSourceSettings.values.length){for(var a=0,r=this.parent.element.querySelector(".e-group-row").querySelectorAll(".e-pvt-btn-div"),n=0;n<r.length;n++)a+=r[n].getBoundingClientRect().width+6;i=a}i=this.parent.resizeInfo[e]?this.parent.resizeInfo[e]:i}else i=this.parent.resizedValue;return i},e.prototype.frameEmptyColumns=function(){var e=[],t=this.calculateColWidth(2);return e.push({field:"0.formattedText",headerText:"",minWidth:30,width:this.resColWidth}),e.push({field:"1.formattedText",headerText:this.parent.localeObj.getConstant("grandTotal"),minWidth:30,width:t-3}),e},e.prototype.getFormatList=function(){for(var e={},i=0;i<this.parent.dataSourceSettings.values.length;i++){var a=this.parent.dataSourceSettings.values[i],r="N";if("olap"===this.parent.dataType){if(this.parent.olapEngineModule.fieldList[a.name]&&!t.isNullOrUndefined(this.parent.olapEngineModule.fieldList[a.name].formatString)){var n=this.parent.olapEngineModule.formatFields[a.name]?this.parent.olapEngineModule.formatFields[a.name].format:this.parent.olapEngineModule.fieldList[a.name].formatString;r=(n="Standard"===n?"Number":n).indexOf("#")>-1||null!==n.match(/\d/)?n:n[0]+"2"}}else if(["PercentageOfDifferenceFrom","PercentageOfRowTotal","PercentageOfColumnTotal","PercentageOfGrandTotal","PercentageOfParentRowTotal","PercentageOfParentColumnTotal","PercentageOfParentTotal"].indexOf(a.type)>-1?r="P2":["PopulationStDev","SampleStDev","PopulationVar","SampleVar","Index"].indexOf(a.type)>-1&&(r=void 0),this.parent.dataSourceSettings.formatSettings.length>0)for(var o=0;o<this.parent.dataSourceSettings.formatSettings.length;o++){var s=this.parent.dataSourceSettings.formatSettings[o];if(a.name===s.name){r=s.format;break}}e[a.name]=r}return e},e.prototype.getValidHeader=function(e,i){var a,r=this.parent.dataSourceSettings.values;if("row"===i){n=e;if(0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length){if(0===this.parent.dataSourceSettings.rows.length&&"row"===this.parent.dataSourceSettings.valueAxis&&this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+n.value===n.data[0].valueSort.levelName)return this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[n.value.toString()].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+n.value.toString();if(1===r.length&&0===this.parent.dataSourceSettings.rows.length)return this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(r[r.length-1].type)+" "+this.parent.localeObj.getConstant("of")+" "+(t.isNullOrUndefined(r[r.length-1].caption)?r[r.length-1].name:r[r.length-1].caption)}a=n.value}else if("column"===i){var n=e;if((0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length)&&!t.isNullOrUndefined(e.gridCell.column.customAttributes)&&0===this.parent.dataSourceSettings.columns.length&&"column"===this.parent.dataSourceSettings.valueAxis&&this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+n.gridCell.column.customAttributes.cell.formattedText===n.gridCell.column.customAttributes.cell.valueSort.levelName)return this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[n.gridCell.column.customAttributes.cell.actualText].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+n.gridCell.column.customAttributes.cell.formattedText;a=n.cell.value}return a},e.prototype.excelColumnEvent=function(e){0===this.parent.dataSourceSettings.columns.length&&"column"===this.parent.dataSourceSettings.valueAxis&&(e.cell.value=this.getValidHeader(e,"column")),void 0!==e.gridCell&&"auto"===e.gridCell.column.width&&(this.parent.lastColumn=e.gridCell.column,e.gridCell.column.width=e.gridCell.column.minWidth),e=this.exportHeaderEvent(e,"XLSX"),this.parent.trigger("excelHeaderQueryCellInfo",e)},e.prototype.pdfColumnEvent=function(e){0===this.parent.dataSourceSettings.columns.length&&"column"===this.parent.dataSourceSettings.valueAxis&&(e.cell.value=this.getValidHeader(e,"column")),void 0!==e.gridCell&&"auto"===e.gridCell.column.width&&(this.parent.lastColumn=e.gridCell.column,e.gridCell.column.width=e.gridCell.column.minWidth),this.parent.trigger("pdfHeaderQueryCellInfo",e)},e.prototype.excelRowEvent=function(e){var i;if("0.formattedText"===e.column.field){var a=e.data[0],r=a.type&&"value"===a.type,n=0;if("olap"===this.parent.dataType)n=this.indentCollection[a.rowIndex];else{var o=a.valueSort?a.valueSort.levelName.toString():"",s=a.actualText?a.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,l=o.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(s?s-1:s);n=l?l-1:0}this.colPos=0,e.style={hAlign:"Left",indent:2*n},this.lastSpan=r?this.lastSpan:n}else if(this.colPos++,i=e.data[e.column.customAttributes.cell?e.column.customAttributes.cell.colIndex:this.colPos],t.isNullOrUndefined(i.value)||t.isNullOrUndefined(i.formattedText)||""===i.formattedText)e.value="Excel"===this.parent.exportType?null:"";else{var d="pivot"===this.parent.dataType&&this.parent.engineModule?this.parent.engineModule.aggregatedValueMatrix:void 0;d&&d[i.rowIndex]&&d[i.rowIndex][i.colIndex]?e.value=d[i.rowIndex][i.colIndex]:e.value=t.isNullOrUndefined(i.value)?i.formattedText:"#DIV/0!"===i.formattedText?i.formattedText:i.value}e=this.exportContentEvent(e),0===this.parent.dataSourceSettings.rows.length&&"row"===this.parent.dataSourceSettings.valueAxis&&(e.value="0.formattedText"===e.column.field?this.getValidHeader(e,"row"):e.value),this.parent.trigger("excelQueryCellInfo",e),i&&(e.style&&this.formatList[i.actualText]?(e.style.type="number",e.style.numberFormat=e.style.numberFormat?e.style.numberFormat:this.formatList[i.actualText]):this.formatList[i.actualText]&&(e.style={numberFormat:this.formatList[i.actualText]}),e.column.format=this.formatList[i.actualText])},e.prototype.pdfRowEvent=function(e){if("0.formattedText"===(e=this.exportContentEvent(e)).column.field){var t=0,i=e.data[0],a=i.type&&"value"===i.type;if("olap"===this.parent.dataType)t=this.indentCollection[i.rowIndex];else{var r=i.valueSort?i.valueSort.levelName.toString():"",n=i.actualText?i.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,o=r.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(n?n-1:n);t=o?o-1:0}e.style={paragraphIndent:10*t},this.lastSpan=a?this.lastSpan:t,0===this.parent.dataSourceSettings.rows.length&&"row"===this.parent.dataSourceSettings.valueAxis&&(e.value=this.getValidHeader(e,"row"))}this.parent.trigger("pdfQueryCellInfo",e)},e.prototype.excelDataBound=function(e){for(var t=e.excelRows,i=Object.keys(this.engine.headerContent).length,a=0;a<i;a++){for(var r=t[a].cells,n=[],o=0;o<r.length;o++)-1!==r[o].rowSpan&&n.push(r[o]);t[a].cells=n}},e.prototype.exportHeaderEvent=function(e,i){var a=1;if(e.gridCell.column.customAttributes){var r=e.gridCell.column.customAttributes.cell;a=r.rowSpan>0?r.rowSpan:1,"XLSX"===i&&(r.rowSpan>0?a=r.rowSpan:t.isNullOrUndefined(r.type)||0===r.level||(a=1,e.cell.rowSpan=1)),this.actualText=r.actualText}else a=Object.keys(this.engine.headerContent).length;return e.cell.rowSpan!==a&&a>0&&(e.cell.rowSpan=a),e},e.prototype.frameGridDataSource=function(e){for(var t=[],i=0;i<e.length;i++){var a=0;t[i]={};for(var r=Object.keys(e[i]),n=0;null!=e[i]&&n<r.length;n++)for(;a<r.length;)t[i][Number(r[a])]=this.cloneDataWithoutIndex(e[i][Number(r[a])]),a++}return t},e.prototype.cloneDataWithoutIndex=function(e){if(!t.isNullOrUndefined(e)){for(var i=Object.keys(e),a=0,r={};a<i.length;)"indexObject"!==i[a]&&"index"!==i[a]&&(r[i[a]]=e[i[a]]),a++;return r}return e},e.prototype.exportContentEvent=function(e){var i=e.data[Number(e.column.field.split(".formattedText")[0])];return e.value="grand sum"===i.type?t.isNullOrUndefined(i.valueSort.axis)?this.parent.localeObj.getConstant("grandTotal"):i.formattedText:e.value,e},e.prototype.unWireEvents=function(e){e.querySelector(".e-hyperlinkcell")&&t.EventHandler.remove(e.querySelector(".e-hyperlinkcell"),this.parent.isAdaptive?"touchend":"click",this.onHyperCellClick)},e.prototype.wireEvents=function(e){e.querySelector(".e-hyperlinkcell")&&t.EventHandler.add(e.querySelector(".e-hyperlinkcell"),this.parent.isAdaptive?"touchend":"click",this.onHyperCellClick,this)},e.prototype.setSpanAttributes=function(e,t,i){i.setAttribute(e,t?t.toString():"1"),i.classList.add(L,"e-freezeleftborder","e-tabular-layout-header"),0===t&&i.classList.add("e-disable")},e.prototype.updatePivotColumn=function(e,t,i,a,r){e[t]={field:t+".formattedText",width:i&&!a&&!this.parent.isEmptyGrid&&e[t].autoFit?r[t].width:this.resColWidth,minWidth:30,headerText:"",allowReordering:!1,allowResizing:!this.parent.isTabular&&this.parent.gridSettings.allowResizing,visible:!0,clipMode:this.parent.gridSettings.clipMode}},e.prototype.getTotalColumnWidth=function(e,t){for(var i=0,a=t;a<e.length;a++)i+=(e[a].getBoundingClientRect().width<this.parent.gridSettings.columnWidth?this.parent.gridSettings.columnWidth:e[a].getBoundingClientRect().width)+6;return i},e}(),$=function(){function e(e){this.keyConfigs={shiftF:"shift+F",shiftS:"shift+S",shiftE:"shift+E",delete:"delete",enter:"enter",escape:"escape",upArrow:"upArrow",downArrow:"downArrow",altJ:"alt+J"},this.parent=e,this.parent.element.tabIndex=-1===this.parent.element.tabIndex?0:this.parent.element.tabIndex,this.keyboardModule=new t.KeyboardEvents(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})}return e.prototype.keyActionHandler=function(e){switch(e.action){case"shiftF":this.processFilter(e);break;case"shiftS":this.processSort(e);break;case"shiftE":this.processEdit(e);break;case"delete":this.processDelete(e);break;case"enter":this.processEnter(e);break;case"escape":this.processClose(e);break;case"upArrow":case"downArrow":this.processFilterNodeSelection(e);break;case"altJ":this.processComponentFocus(e)}},e.prototype.processComponentFocus=function(e){if(this.parent.element)return this.parent.element.focus(),e.stopPropagation(),void e.preventDefault()},e.prototype.getButtonElement=function(e){for(var t=[].slice.call(this.parent.element.querySelectorAll(".e-pivot-button")),i=0,a=t.length;i<a;i++)if(t[i].getAttribute("data-uid")===e.getAttribute("data-uid"))return t[i];return e},e.prototype.processEnter=function(e){var i=e.target;if(i&&t.closest(i,".e-pivot-button"))return i.querySelector(".e-dropdown-icon")&&t.closest(i,".e-values")?i.querySelector(".e-dropdown-icon").click():i.querySelector(".e-edit")?i.querySelector(".e-edit").click():!i.querySelector(".e-sort")||t.closest(i,".e-values")||t.closest(i,".e-axis-filter")?i.querySelector(".e-btn-filter")&&!t.closest(i,".e-values")&&i.querySelector(".e-btn-filter").click():(i.querySelector(".e-sort").click(),this.getButtonElement(i).focus()),void e.preventDefault()},e.prototype.processSort=function(e){var i=e.target;if(i&&t.closest(i,".e-pivot-button")&&i.querySelector(".e-sort")&&!t.closest(i,".e-values")&&!t.closest(i,".e-axis-filter"))return i.querySelector(".e-sort").click(),this.getButtonElement(i).focus(),void e.preventDefault()},e.prototype.processEdit=function(e){var i=e.target;if(i&&t.closest(i,".e-pivot-button")&&i.querySelector(".e-edit"))return i.querySelector(".e-edit").click(),void e.preventDefault()},e.prototype.processFilter=function(e){var i=e.target;if(i&&t.closest(i,".e-pivot-button")&&i.querySelector(".e-btn-filter")&&!t.closest(i,".e-values")){if(i.querySelector(".e-btn-filter").click(),this.parent&&this.parent.control&&"pivotview"===this.parent.moduleName&&this.parent.control.grid&&this.parent.control.showGroupingBar&&this.parent.control.groupingBarModule&&t.closest(i,".e-group-rows")&&this.parent.filterDialog&&this.parent.filterDialog.dialogPopUp&&!this.parent.filterDialog.dialogPopUp.isDestroyed&&this.parent.filterDialog.dialogPopUp.element){var a=this.parent.filterDialog.dialogPopUp.element,r=this.parent.filterDialog.allowExcelLikeFilter;clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){a&&a.classList.contains("e-popup-open")&&(r&&a.querySelector(".e-dlg-closeicon-btn")?a.querySelector(".e-dlg-closeicon-btn").focus():a.querySelector("input")&&a.querySelector("input").focus())})}return void e.preventDefault()}},e.prototype.processFilterNodeSelection=function(e){var i=e.target;if(i&&t.closest(i,".e-select-all")&&40===e.keyCode){if((r=t.closest(i,".e-member-editor-outer-container").querySelector(".e-member-editor-container"))&&r.querySelector("li")){var a=r.querySelector("li");return r.querySelector("li#_active")&&(t.removeClass([r.querySelector("li#_active")],["e-node-focus"]),r.querySelector("li#_active").removeAttribute("id")),a.setAttribute("id","_active"),t.addClass([a],["e-node-focus"]),a.focus(),void e.preventDefault()}}else if(i&&t.closest(i,".e-member-editor-container")&&38===e.keyCode){var r=t.closest(i,".e-member-editor-container");if(r.querySelector("li#_active.e-node-focus")&&r.querySelector("li")&&r.querySelector("li").classList.contains("e-prev-active-node")&&r.querySelector("li")===r.querySelector("li#_active.e-node-focus")){t.removeClass(r.querySelectorAll("li.e-prev-active-node"),"e-prev-active-node");var n=t.closest(i,".e-member-editor-outer-container").querySelector(".e-select-all");if(n&&n.querySelector("li"))return(a=n.querySelector("li")).setAttribute("id","_active"),t.addClass([a],["e-node-focus"]),a.focus(),void e.preventDefault()}}else i&&i.id===this.parent.parentID+"_inputbox"&&("upArrow"===e.action?i.parentElement.querySelector(".e-spin-up").click():"downArrow"===e.action&&i.parentElement.querySelector(".e-spin-down").click())},e.prototype.processDelete=function(e){var i=e.target;if(i&&t.closest(i,".e-pivot-button")&&i.querySelector(".e-remove"))return i.querySelector(".e-remove").click(),void e.preventDefault()},e.prototype.processClose=function(e){var i=e.target;if(i&&t.closest(i,".e-popup.e-popup-open")){var a=t.getInstance(t.closest(i,".e-popup.e-popup-open"),r.Dialog);if(a&&!a.closeOnEscape){var n=a.element.getAttribute("data-fieldName");if(a.hide(),this.parent.element)for(var o=0,s=[].slice.call(this.parent.element.querySelectorAll(".e-pivot-button"));o<s.length;o++){var l=s[o];if(l.getAttribute("data-uid")===n){l.focus();break}}return void e.preventDefault()}}},e.prototype.destroy=function(){this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null)},e}(),ee=function(){function e(e){this.searchListItem=[],this.parent=e}return e.prototype.updateSorting=function(e){if(!e.target.classList.contains("e-btn-filter")&&!e.target.classList.contains("e-remove")){this.parent.filterDialog.dialogPopUp&&this.parent.filterDialog.dialogPopUp.close();var i=e.target,a=void 0,r=void 0,n=void 0;i.id?(a=i.getAttribute("data-uid"),r=[].slice.call(i.querySelectorAll(".e-descend"))):(a=i.parentElement.getAttribute("data-uid"),r=[].slice.call(i.parentElement.querySelectorAll(".e-descend"))),n=0!==r.length;var o=f.getFieldByName(a,this.parent.dataSourceSettings.sortSettings),s=this.parent.engineModule&&this.parent.engineModule.fieldList[a]&&this.parent.engineModule.fieldList[a].membersOrder?this.parent.engineModule.fieldList[a].membersOrder.slice():[];if(t.isNullOrUndefined(o)){d={name:a,order:n?"Ascending":"Descending",membersOrder:o?o.membersOrder:s};this.parent.dataSourceSettings.sortSettings.push(d)}else{for(var l=0;l<this.parent.dataSourceSettings.sortSettings.length;l++)if(this.parent.dataSourceSettings.sortSettings[l].name===a){this.parent.dataSourceSettings.sortSettings.splice(l,1);break}var d={name:a,order:n?"Ascending":"Descending",membersOrder:o?o.membersOrder:s};this.parent.dataSourceSettings.sortSettings.push(d)}this.parent.control.lastSortInfo=this.parent.dataSourceSettings.sortSettings[this.parent.dataSourceSettings.sortSettings.length-1],n?t.removeClass([i],"e-descend"):t.addClass([i],"e-descend")}},e.prototype.updateFiltering=function(e){var i=e.target,a=i.parentElement.getAttribute("data-uid"),r=i.parentElement.textContent,n=!1,o=[],s=[];if(this.parent.dataSourceSettings.allowMemberFilter)if("olap"===this.parent.dataType)s=this.getOlapData(a,n);else{var l=this.parent.engineModule.fieldList[a],d=f.getClonedData(l.dateMember);this.parent.isDateField=f.isDateField(a,this.parent.engineModule);var p=l&&l.membersOrder?l.membersOrder.slice():[],h=void 0;"Out of Range"===d[0].actualText?(h=d[0],d.splice(0,1)):"Out of Range"===d[d.length-1].actualText&&(h=d[d.length-1],d.splice(d.length-1,1));var u={fieldName:a,sortOrder:l.sort,members:p&&p.length>0?p:Object.keys(d),IsOrderChanged:!1},c=!1,g=!(!l||!l.isAlphanumeric)||void 0;if(p&&p.length>0)d=f.applyCustomSort(u,d,g);else{var m=this.parent.dataSourceSettings.groupSettings.filter(function(e){return e.name===a&&"number"===e.type.toLocaleLowerCase()}),v=!t.isNullOrUndefined(m)&&m.length>0;d=f.applyHeadersSort(d,u.sortOrder,g,v),c=!0}var S=f.getFilterItemByName(a,this.parent.dataSourceSettings.filterSettings);if(t.isNullOrUndefined(S)||(n=!(!this.isValidFilterItemsAvail(a,S)||"Include"!==S.type),o=S.items?S.items:[]),h&&("Ascending"===u.sortOrder?"Grand Total"===d[d.length-1].actualText?d.splice(d.length-1,0,h):d.splice(d.length,0,h):"Grand Total"===d[0].actualText?d.splice(1,0,h):d.splice(0,0,h)),c){for(var y=[],b=0,C=0;b<d.length;b++)"Grand Total"!==d[b].actualText&&(y[C++]=d[b].actualText);u.members=y}this.parent.control.trigger("onHeadersSort",u),u.IsOrderChanged&&(d=f.applyCustomSort(u,d,g,!0)),s=this.getTreeData(n,d,o,a)}this.parent.filterDialog.dialogPopUp&&this.parent.filterDialog.dialogPopUp.close();var x=this.parent.control.filterTargetID;t.isNullOrUndefined(x)&&(x="pivotfieldlist"!==this.parent.moduleName?this.parent.element:document.getElementById(this.parent.parentID+"_Container")),this.parent.filterDialog.createFilterDialog(s,a,r,x)},e.prototype.isValidFilterItemsAvail=function(e,t){var i=!1,a=["Include","Exclude"];if(t&&a.indexOf(t.type)>=0)if("Include"===t.type&&0===t.items.length)i=!0;else for(var r=this.parent.engineModule,n=r.fieldList[e],o="olap"===this.parent.dataType?n.members:f.getFormattedMembers(n.members,e,r),s=0,l=t.items;s<l.length;s++)if(o[l[s]]){i=!0;break}return i},e.prototype.getOlapData=function(e,i){var a=[],r=[];this.parent.filterDialog.isSearchEnabled=!1;var n=[],o=this.parent.engineModule,s=f.getFilterItemByName(e,this.parent.dataSourceSettings.filterSettings);0===o.fieldList[e].filterMembers.length?this.parent.control.loadOnDemandInMemberEditor?s&&s.levelCount>1&&o.fieldList[e].levels.length>1?o.getFilterMembers(this.parent.dataSourceSettings,e,s.levelCount):(o.fieldList[e].levelCount=1,o.getMembers(this.parent.dataSourceSettings,e)):o.getMembers(this.parent.dataSourceSettings,e,!0):(o.fieldList[e].currrentMembers={},o.fieldList[e].searchMembers=[]);var l=o.fieldList[e].isHierarchy;a=o.fieldList[e].filterMembers,t.isNullOrUndefined(s)||(i=!s.type||"Include"===s.type,r=s.items?s.items:[]);for(var d={},p={},h=o.fieldList[e].members,u=0,c=r;u<c.length;u++){var g=c[u];d[g]=g,p[g]=g,h[g]&&(p=this.getParentNode(e,g,p))}return a=this.getFilteredTreeNodes(e,a,p,n),a=this.getOlapTreeData(i,f.getClonedData(a),d,e,l),a=this.sortOlapFilterData(a,o.fieldList[e].sort)},e.prototype.sortOlapFilterData=function(e,t){if(e.length>0){for(var i=!1,a=[],r=0;r<e.length;r++)a.push(e[r].caption);var n="Grand Total"!==e[0].caption||void 0===e[0].caption?e[0].htmlAttributes["data-fieldName"]:e[1].htmlAttributes["data-fieldName"],o=this.parent.engineModule.fieldList[n],s=o&&o.membersOrder?o.membersOrder.slice():[],l={fieldName:n,sortOrder:t,members:s&&s.length>0?s:a,IsOrderChanged:!1};if(s&&s.length>0?this.applyFilterCustomSort(e,l):(e="Ascending"===t?e.sort(function(e,t){return e.caption>t.caption?1:t.caption>e.caption?-1:0}):"Descending"===t?e.sort(function(e,t){return e.caption<t.caption?1:t.caption<e.caption?-1:0}):e,i=!0),i){for(var d=[],p=0,h=0;p<e.length;p++)"Grand Total"!==e[p].caption&&(d[h++]=e[p].caption);l.members=d}this.parent.control.trigger("onHeadersSort",l),l.IsOrderChanged&&this.applyFilterCustomSort(e,l,!0)}return e},e.prototype.applyFilterCustomSort=function(e,t,i){var a,r=[],n=[];r=t.IsOrderChanged?t.members:"Ascending"===t.sortOrder||"None"===t.sortOrder||void 0===t.sortOrder?[].concat(t.members):[].concat(t.members).reverse(),"Grand Total"===e[0].caption&&(a=e[0],e.shift());for(var o=0,s=0;o<e.length;o++){var l=e[o].caption;if(r[s]===l){if(e.splice(s++,0,e[o]),e.splice(++o,1),!(s<r.length)){i||n.splice(--s,0,l);break}o=-1}o>=0&&!i&&(n[o]=e[o].caption)}if(!i){for(o=n.length;o<e.length;o++)n[o]=e[o].caption;"Grand Total"===n[n.length-1]&&n.pop(),t.members=n}return a&&e.splice(0,0,a),e},e.prototype.getParentIDs=function(e,t,i){for(var a,r=0,n=e.fields.dataSource;r<n.length;r++){var o=n[r];if(o.id===t){a=o.pid;break}}return a&&(i.push(a),this.getParentIDs(e,a,i)),i},e.prototype.getChildIDs=function(e,t,i){for(var a,r=0,n=e.fields.dataSource;r<n.length;r++){var o=n[r];if(o.pid===t){a=o.id;break}}return a&&(i.push(a),this.getParentIDs(e,a,i)),i},e.prototype.searchTreeNodes=function(e,i,a,r){if(a){for(var n=[],o=[],s=0,l=[].slice.call(i.element.querySelectorAll("li"));s<l.length;s++){var d=l[s];d.querySelector(".e-list-text").textContent.toLowerCase().indexOf(e.value.toLowerCase())>-1?n.push(d):o.push(d)}if(i.enableNodes(n),t.removeClass(n,"e-disable"),i.disableNodes(o),t.addClass(o,"e-disable"),n.length>0&&o.length>0)for(var p=0,h=n;p<h.length;p++){var u=h[p].getAttribute("data-uid"),c=this.getParentIDs(i,u,[]),g=this.getChildIDs(i,u,[]),m=[];if(c.length>0)for(var v=0,S=o;v<S.length;v++){C=S[v];-1!==f.inArray(C.getAttribute("data-uid"),c)&&m.push(C)}if(g.length>0)for(var y=0,b=o;y<b.length;y++){var C=b[y];-1!==f.inArray(C.getAttribute("data-uid"),g)&&m.push(C)}i.enableNodes(m),t.removeClass(m,"e-disable")}0===[].slice.call(i.element.querySelectorAll("li.e-disable")).length?i.collapseAll():i.expandAll(void 0,void 0,!0),this.searchListItem=n}else if(this.parent.searchTreeItems=[],"olap"!==this.parent.dataType||r){var n=[],x=0;x=1;for(var w=0,T=this.parent.currentTreeItems;w<T.length;w++){var M=T[w];M.name.toLowerCase().indexOf(e.value.toLowerCase())>-1&&(this.parent.searchTreeItems.push(M),x<=this.parent.control.maxNodeLimitInMemberEditor&&n.push(M),x++)}--x>this.parent.control.maxNodeLimitInMemberEditor?(this.parent.editorLabelElement.innerText=x-this.parent.control.maxNodeLimitInMemberEditor+this.parent.control.localeObj.getConstant("editorDataLimitMsg"),this.parent.filterDialog.dialogPopUp.height=this.parent.filterDialog.allowExcelLikeFilter?"440px":"400px",this.parent.isDataOverflow=!0):(this.parent.editorLabelElement.innerText="",this.parent.filterDialog.dialogPopUp.height=this.parent.filterDialog.allowExcelLikeFilter?"400px":"350px",this.parent.isDataOverflow=!1),this.parent.isDataOverflow=x>this.parent.control.maxNodeLimitInMemberEditor,this.parent.editorLabelElement.parentElement.style.display=this.parent.isDataOverflow?"block":"none",i.fields={dataSource:n,id:"id",text:"name",isChecked:"isSelected",parentID:"pid"},i.dataBind()}else this.updateOlapSearchTree(e,i,r)},e.prototype.updateOlapSearchTree=function(e,t,i){var a=[],r=this.parent.filterDialog.dialogPopUp.element.getAttribute("data-fieldname");if(""===e.value.toLowerCase()){this.parent.filterDialog.isSearchEnabled=!1,this.parent.engineModule.fieldList[r].searchMembers=[];for(var n=[],o={},s={},l=this.parent.engineModule.fieldList[r].members,d=[],p=0,h=Object.keys(l);p<h.length;p++)l[g=h[p]].isSelected&&(l[g].parent&&l[l[g].parent].isSelected||d.push(g));for(var u=0,c=d;u<c.length;u++){var g=c[u];o[g]=g,s[g]=g,l[g]&&(s=this.getParentNode(r,g,s))}m=this.parent.engineModule.fieldList[r].filterMembers;a=this.getFilteredTreeNodes(r,m,s,n),a=this.getOlapTreeData(!0,f.getClonedData(a),o,r,i,!0)}else{this.parent.filterDialog.isSearchEnabled=!0;var m=this.parent.engineModule.fieldList[r].searchMembers;a=f.getClonedData(m),a=this.getOlapSearchTreeData(!0,a,r)}t.fields={dataSource:a,id:"id",text:"name",isChecked:"isSelected",parentID:"pid"},t.dataBind()},e.prototype.getTreeData=function(e,i,a,r){this.parent.currentTreeItems=[],this.parent.searchTreeItems=[],this.parent.currentTreeItemsPos={},this.parent.savedTreeFilterPos={};for(var n=this.parent.engineModule,o=[],s=1,l={},d=0,p=a;d<p.length;d++){var h=p[d];l[h]=h}for(var u=r.replace(/[^a-zA-Z0-9 ]/g,"_"),c=0,g=i;c<g.length;c++){var m=g[c],f=m.actualText.toString();f=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(f):f;var v=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(m.actualText):m.actualText,S={id:u+"_"+s,htmlAttributes:{"data-fieldName":r,"data-memberId":v.toString()},actualText:v,name:this.parent.isDateField?m.formattedText:n.getFormattedValue(v,r).formattedText,isSelected:!e};void 0!==l[this.parent.isDateField?m.formattedText:f]&&(S.isSelected=!!e),s<=this.parent.control.maxNodeLimitInMemberEditor&&o.push(S),S.isSelected||(this.parent.savedTreeFilterPos[s-1]=this.parent.isDateField?m.formattedText:f),this.parent.currentTreeItems.push(S),this.parent.searchTreeItems.push(S),this.parent.currentTreeItemsPos[v]={index:s-1,isSelected:S.isSelected},s++}return this.parent.isDataOverflow=s-1>this.parent.control.maxNodeLimitInMemberEditor,o},e.prototype.getOlapTreeData=function(e,t,i,a,r,n){var o=this.parent.engineModule.fieldList[a];this.parent.currentTreeItems=[],this.parent.searchTreeItems=[],this.parent.currentTreeItemsPos={};for(var s=[],l=1,d=0,p=t;d<p.length;d++){var h=p[d],u=h,c=h.id.toString();n||(u.isSelected=!e),void 0!==i[c]&&(u.isSelected=!!e),!n&&h.hasChildren&&this.updateChildNodeStates(o.filterMembers,a,h.id,u.isSelected),o.members[c].isSelected=u.isSelected,o.currrentMembers&&o.currrentMembers[c]&&(o.currrentMembers[c].isSelected=u.isSelected),l<=this.parent.control.maxNodeLimitInMemberEditor&&r&&s.push(u),this.parent.currentTreeItems.push(u),this.parent.searchTreeItems.push(u),this.parent.currentTreeItemsPos[c]={index:l-1,isSelected:u.isSelected},l++}return this.parent.isDataOverflow=!!r&&l-1>this.parent.control.maxNodeLimitInMemberEditor,r?s:t},e.prototype.getOlapSearchTreeData=function(e,t,i){for(var a=this.parent.engineModule.fieldList[i].members,r=0,n=t;r<n.length;r++){var o=n[r],s=o.id.toString();a[s]&&(o.isSelected=a[s].isSelected),this.parent.searchTreeItems.push(o)}return t},e.prototype.updateChildNodeStates=function(e,t,i,a){for(var r=this.parent.engineModule.fieldList[t].members,n=this.parent.engineModule.fieldList[t].currrentMembers,o=0,s=e;o<s.length;o++){var l=s[o];l.pid&&l.pid.toString()===i&&(r[l.id].isSelected=a,n&&n[l.id]&&(n[l.id].isSelected=a),l.hasChildren&&this.updateChildNodeStates(e,t,l.id,a))}},e.prototype.getParentNode=function(e,t,i){var a=this.parent.engineModule.fieldList[e].members;if(a[t].parent&&t!==a[t].parent){var r=a[t].parent;i[r]=r,this.getParentNode(e,r,i)}return i},e.prototype.getFilteredTreeNodes=function(e,i,a,r){for(var n=[],o=this.parent.engineModule.fieldList[e].members,s=0,l=a?Object.keys(a):[];s<l.length;s++){var d=l[s],p=o[d]?o[d].parent:void 0;void 0!==p&&-1===f.inArray(p,n)&&n.push(p)}for(var h=0,u=i;h<u.length;h++){var c=u[h];t.isNullOrUndefined(c.pid)||-1!==f.inArray(c.pid,n)?(r.push(c),t.isNullOrUndefined(c.pid)&&-1!==f.inArray(c.id,n)?o[c.id].isNodeExpand=!0:t.isNullOrUndefined(c.pid)||-1===f.inArray(c.pid,n)?o[c.id].isNodeExpand=!1:(o[c.id].isNodeExpand=!1,o[c.pid].isNodeExpand=!0)):o[c.id].isNodeExpand=!1}return r},e}(),te=function(){function e(e){this.parent=e}return e.prototype.onStateModified=function(e,i){var a="",r=t.closest(e.target,".e-droppable"),n=-1;if(this.parent.dataSourceUpdate.btnElement=e.element?e.element.parentElement:void 0,r&&(a="e-rows"===r.classList[1]?"rows":"e-columns"===r.classList[1]?"columns":"e-values"===r.classList[1]?"values":"e-filters"===r.classList[1]?"filters":""),"olap"===this.parent.dataType||"pivot"===this.parent.dataType){var o="olap"===this.parent.dataType&&this.parent.engineModule.fieldList[i]&&this.parent.engineModule.fieldList[i].isCalculatedField?this.parent.engineModule.fieldList[i].tag:i;if(e.cancel&&""===a)return!1;if(this.parent.dataSourceUpdate.btnElement&&"true"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&("filters"===a||"values"===a)||this.parent.dataSourceUpdate.btnElement&&"false"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&o.toLowerCase().indexOf("[measures].")>-1&&"olap"===this.parent.dataType&&("filters"===a||"rows"===a||"columns"===a)||this.parent.dataSourceUpdate.btnElement&&"false"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&"olap"===this.parent.dataType&&-1===o.toLowerCase().indexOf("[measures].")&&this.parent.engineModule.fieldList[i]&&this.parent.engineModule.fieldList[i].isNamedSets&&("filters"===a||"values"===a)||this.parent.dataSourceUpdate.btnElement&&"false"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&"olap"===this.parent.dataType&&-1===o.toLowerCase().indexOf("[measures].")&&"values"===a){var s=this.parent.localeObj.getConstant("warning"),l=this.parent.localeObj.getConstant("fieldDropErrorAction");return this.parent.errorDialog.createErrorDialog(s,l),!1}}else if(e.cancel&&""===a||this.parent.dataSourceUpdate.btnElement&&"true"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&("filters"===a||"values"===a||a.indexOf(this.parent.dataSourceSettings.valueAxis)>-1))return!1;if(""!==a){if(("olap"===this.parent.dataType||"pivot"===this.parent.dataType)&&((o="olap"===this.parent.dataType&&this.parent.engineModule.fieldList[i]&&this.parent.engineModule.fieldList[i].isCalculatedField?this.parent.engineModule.fieldList[i].tag:i).toLowerCase().indexOf("[measures].")>-1&&"olap"===this.parent.dataType&&("filters"===a||"rows"===a||"columns"===a)||this.parent.engineModule.fieldList[i]&&this.parent.engineModule.fieldList[i].isNamedSets&&"filters"===a||"olap"===this.parent.dataType&&"values"===a&&-1===o.toLowerCase().indexOf("[measures]."))){var s=this.parent.localeObj.getConstant("warning"),l=this.parent.localeObj.getConstant("fieldDropErrorAction");return this.parent.errorDialog.createErrorDialog(s,l),!1}if("pivot"===this.parent.dataType&&this.parent.engineModule.fieldList[i]&&"CalculatedField"===this.parent.engineModule.fieldList[i].aggregateType&&"values"!==a){var s=this.parent.localeObj.getConstant("warning"),l=this.parent.localeObj.getConstant("dropAction");return this.parent.errorDialog.createErrorDialog(s,l),!1}n=this.getButtonPosition(e.target,a)}else this.parent.engineModule.fieldList[i]&&(this.parent.engineModule.fieldList[i].isSelected=!1,"olap"===this.parent.dataType&&this.parent.engineModule.updateFieldlistData(i));return this.parent.dataSourceUpdate.updateDataSource(i,a,n)},e.prototype.getButtonPosition=function(e,i){var a=-1,r=t.closest(e,".e-pvt-btn-div");if(!t.isNullOrUndefined(r)){r=r.querySelector(".e-pivot-button");for(var n=this.parent.element.querySelector(".e-"+i),o=[].slice.call(n.querySelectorAll(".e-pivot-button")),s=0,l=o.length;s<l;s++)if(o[s].id===r.id){a=s;break}}return a},e}(),ie=function(){function e(e){this.parent=e}return e.prototype.updateDataSource=function(e,i,a){for(var r,n,o=this,s=-1,l=!0,d=[this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.values,this.parent.dataSourceSettings.filters],p=0,h=d.length;p<h;p++)if(d[p])for(var u=0,c=d[p].length;u<c;u++)(d[p][u].name===e||"olap"===this.parent.dataType&&"[measures]"===d[p][u].name.toLowerCase()&&d[p][u].name.toLowerCase()===e)&&(n=0===p?"rows":1===p?"columns":2===p?"values":"filters",s=u),n||(n="fieldList");var g={fieldName:e,dropField:f.getFieldInfo(e,this.control).fieldItem,dataSourceSettings:f.getClonedDataSourceSettings(this.parent.dataSourceSettings),dropAxis:i,dropPosition:a,draggedAxis:n,cancel:!1},m="pivotfieldlist"===this.control.getModuleName()&&this.control.isPopupView?this.control.pivotGridModule:this.control;return m.trigger("fieldDrop",g,function(d){if(d.cancel)l=!1;else{if(i=d.dropAxis,a=d.dropPosition,e=d.dropField?d.dropField.name:d.fieldName,r=d.dropField,o.control&&o.btnElement&&"true"===o.btnElement.getAttribute("isvalue"))switch(i){case"":o.control.setProperties({dataSourceSettings:{values:[]}},!0);break;case"rows":a=a===o.parent.dataSourceSettings.rows.length?-1:a,o.control.setProperties({dataSourceSettings:{valueAxis:"row",valueIndex:a}},!0);break;case"columns":a=a===o.parent.dataSourceSettings.columns.length?-1:a,o.control.setProperties({dataSourceSettings:{valueAxis:"column",valueIndex:a}},!0)}else{if(o.removeFieldFromReport(e.toString()),"pivot"===o.parent.dataType&&o.control.showValuesButton&&o.parent.dataSourceSettings.values.length>1){var p="row"===o.parent.dataSourceSettings.valueAxis&&"rows"===i?o.parent.dataSourceSettings.rows:"column"===o.parent.dataSourceSettings.valueAxis&&"columns"===i?o.parent.dataSourceSettings.columns:void 0;s<o.parent.dataSourceSettings.valueIndex&&("row"===o.parent.dataSourceSettings.valueAxis&&"rows"===n||"column"===o.parent.dataSourceSettings.valueAxis&&"columns"===n)&&o.control.setProperties({dataSourceSettings:{valueIndex:o.parent.dataSourceSettings.valueIndex-1}},!0),t.isNullOrUndefined(p)||(-1===a&&-1===o.parent.dataSourceSettings.valueIndex?o.control.setProperties({dataSourceSettings:{valueIndex:p.length}},!0):a>-1&&a<=o.parent.dataSourceSettings.valueIndex?o.control.setProperties({dataSourceSettings:{valueIndex:o.parent.dataSourceSettings.valueIndex+1}},!0):o.parent.dataSourceSettings.valueIndex>-1&&a>o.parent.dataSourceSettings.valueIndex&&(a-=1))}"CalculatedField"===(r=o.getNewField(e.toString(),d.dropField)).type&&""!==i&&(i="values")}if("olap"===o.parent.dataType&&(o.removeFieldFromReport(e.toString()),r=o.getNewField(e.toString(),d.dropField),0===o.parent.dataSourceSettings.values.length&&o.removeFieldFromReport("[measures]"),"CalculatedField"===r.type&&""!==i&&(i="values")),o.control){var h={fieldName:e,droppedField:r,dataSourceSettings:f.getClonedDataSourceSettings(o.parent.dataSourceSettings),droppedAxis:i,droppedPosition:a};m.trigger("onFieldDropped",h,function(e){if(r=e.droppedField){switch(a=e.droppedPosition,i=e.droppedAxis){case"filters":-1!==a?o.parent.dataSourceSettings.filters.splice(a,0,r):o.parent.dataSourceSettings.filters.push(r);break;case"rows":-1!==a?o.parent.dataSourceSettings.rows.splice(a,0,r):o.parent.dataSourceSettings.rows.push(r);break;case"columns":-1!==a?o.parent.dataSourceSettings.columns.splice(a,0,r):o.parent.dataSourceSettings.columns.push(r);break;case"values":if(-1!==a?o.parent.dataSourceSettings.values.splice(a,0,r):o.parent.dataSourceSettings.values.push(r),!("olap"!==o.parent.dataType||o.parent.engineModule.isMeasureAvail||o.parent.dataSourceSettings.values.length>1)){var t={name:"[Measures]",caption:"Measures",showRemoveIcon:!0,allowDragAndDrop:!0};("row"===o.parent.dataSourceSettings.valueAxis?o.parent.dataSourceSettings.rows:o.parent.dataSourceSettings.columns).push(t)}}var n="columns"===i?m.dataSourceSettings.columns.length:"rows"===i?m.dataSourceSettings.rows.length:0;0!==n&&m.dataSourceSettings.valueIndex===n&&o.control.setProperties({dataSourceSettings:{valueIndex:-1}},!0)}})}}}),l},e.prototype.removeFieldFromReport=function(e){for(var t,i=!1,a=[this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.values,this.parent.dataSourceSettings.filters],r=this.parent.engineModule.fieldList[e],n=0,o=a.length;n<o;n++)if(!i&&a[n])for(var s=0,l=a[n].length;s<l;s++)if(a[n][s].name===e||"olap"===this.parent.dataType&&"[measures]"===a[n][s].name.toLowerCase()&&a[n][s].name.toLowerCase()===e){if(t=a[n][s].properties?a[n][s].properties:a[n][s],t.type=r&&"number"===r.type?t.type:"Count",a[n].splice(s,1),"olap"===this.parent.dataType){var d=this.parent.engineModule;d&&d.fieldList[e]&&(d.fieldList[e].currrentMembers={},d.fieldList[e].searchMembers=[])}i=!0;break}return t},e.prototype.getNewField=function(e,t){var i;if("olap"===this.parent.dataType){a=this.parent.engineModule.fieldList[e];i={name:t?t.name:e,caption:t?t.caption:a.caption,isNamedSet:t?t.isNamedSet:a.isNamedSets,isCalculatedField:t?t.isCalculatedField:a.isCalculatedField,type:t?void 0===t.type?"number"===a.type?"Sum":"Count":t.type:void 0===a.aggregateType?"number"===a.type?"Sum":"Count":a.aggregateType,showFilterIcon:t?t.showFilterIcon:a.showFilterIcon,showSortIcon:t?t.showSortIcon:a.showSortIcon,showEditIcon:t?t.showEditIcon:a.showEditIcon,showRemoveIcon:t?t.showRemoveIcon:a.showRemoveIcon,showValueTypeIcon:t?t.showValueTypeIcon:a.showValueTypeIcon,allowDragAndDrop:t?t.allowDragAndDrop:a.allowDragAndDrop,showSubTotals:t?t.showSubTotals:a.showSubTotals,expandAll:t?t.expandAll:a.expandAll}}else{var a=this.parent.engineModule.fieldList[e];i={name:t?t.name:e,caption:t?t.caption:a.caption,type:t?void 0===t.type||null===t.type?"number"===a.type?"Sum":"Count":t.type:void 0===a.aggregateType||null===a.aggregateType?"number"===a.type?"Sum":"Count":a.aggregateType,showNoDataItems:t?t.showNoDataItems:a.showNoDataItems,baseField:t?t.baseField:a.baseField,baseItem:t?t.baseItem:a.baseItem,allowDragAndDrop:t?t.allowDragAndDrop:a.allowDragAndDrop,showSubTotals:t?t.showSubTotals:a.showSubTotals,showFilterIcon:t?t.showFilterIcon:a.showFilterIcon,showSortIcon:t?t.showSortIcon:a.showSortIcon,showEditIcon:t?t.showEditIcon:a.showEditIcon,showRemoveIcon:t?t.showRemoveIcon:a.showRemoveIcon,showValueTypeIcon:t?t.showValueTypeIcon:a.showValueTypeIcon,expandAll:t?t.expandAll:a.expandAll}}return i},e}(),ae=function(){function e(e){this.parent=e}return e.prototype.createErrorDialog=function(e,i){var a=t.createElement("div",{id:this.parent.parentID+"_ErrorDialog",className:"e-pivot-error-dialog"});this.parent.element.appendChild(a),this.errorPopUp=new r.Dialog({animationSettings:{effect:"Fade"},allowDragging:!1,header:e,content:i,isModal:!0,visible:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"auto",height:"auto",position:{X:"center",Y:"center"},buttons:[{click:this.closeErrorDialog.bind(this),isFlat:!1,buttonModel:{cssClass:"e-ok-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}}],cssClass:this.parent.cssClass,closeOnEscape:!0,target:document.body,close:this.removeErrorDialog.bind(this)}),this.errorPopUp.isStringTemplate=!0,this.errorPopUp.appendTo(a)},e.prototype.closeErrorDialog=function(){this.errorPopUp.close()},e.prototype.removeErrorDialog=function(){this.errorPopUp&&!this.errorPopUp.isDestroyed&&(this.errorPopUp.destroy(),this.errorPopUp=null),document.getElementById(this.parent.parentID+"_ErrorDialog")&&t.remove(document.getElementById(this.parent.parentID+"_ErrorDialog"))},e}(),re=function(){function e(e){this.parent=e}return e.prototype.createFilterDialog=function(e,i,a,n){var o=this,s=t.createElement("div",{id:this.parent.parentID+"_EditorTreeView",className:"e-member-editor-dialog "+("olap"===this.parent.dataType?"e-olap-editor-dialog":"")+(this.parent.isDataOverflow?" e-node-limit":""),attrs:{"data-fieldName":i,"aria-label":a}}),l=this.parent.engineModule.fieldList[i].caption,d=this.parent.localeObj.getConstant("filter")+' "'+a+'" '+this.parent.localeObj.getConstant("by");this.filterObject=this.getFilterObject(i),this.isSearchEnabled=!1,this.allowExcelLikeFilter=this.isExcelFilter(i),this.parent.element.appendChild(s),this.dialogPopUp=new r.Dialog({animationSettings:{effect:this.allowExcelLikeFilter?"None":"Fade"},allowDragging:!1,header:this.allowExcelLikeFilter?d:l,content:"",isModal:!0,visible:!0,showCloseIcon:!!this.allowExcelLikeFilter,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"320px",height:this.parent.isDataOverflow?this.allowExcelLikeFilter?"440px":"400px":this.allowExcelLikeFilter?"400px":"350px",position:{X:"center",Y:"center"},buttons:[{isFlat:!1,buttonModel:{cssClass:"e-clear-filter-button"+(this.allowExcelLikeFilter?"":" e-disable")+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:"e-icons e-clear-filter-icon",enableRtl:this.parent.enableRtl,content:this.parent.localeObj.getConstant("clearFilter"),disabled:!this.filterObject}},{isFlat:!1,buttonModel:{cssClass:"e-ok-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:this.closeFilterDialog.bind(this),isFlat:!1,buttonModel:{cssClass:"e-cancel-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}],closeOnEscape:"Popup"!==this.parent.renderMode,target:n,cssClass:this.parent.cssClass,close:this.removeFilterDialog.bind(this)}),this.dialogPopUp.isStringTemplate=!0,this.dialogPopUp.appendTo(s);var p={cancel:!1,fieldName:i,fieldMembers:this.parent.dataSourceSettings.allowMemberFilter?e:[],filterSetting:this.filterObject};("pivotfieldlist"===this.parent.moduleName&&this.parent.control.isPopupView?this.parent.control.pivotGridModule:this.parent.control).trigger("memberEditorOpen",p,function(r){r.cancel?(o.dialogPopUp.close(),o.dialogPopUp=void 0):(e=r.fieldMembers,o.allowExcelLikeFilter?(o.createTabMenu(e,a,i),t.addClass([o.dialogPopUp.element],"e-excel-filter"),o.updateCheckedState()):(o.dialogPopUp.content=o.createTreeView(e,a,i),o.updateCheckedState()),t.setStyleAttribute(o.dialogPopUp.element,{visibility:"visible"}),o.allowExcelLikeFilter&&o.dialogPopUp.element.querySelector(".e-dlg-closeicon-btn").focus(),o.memberTreeView.nodeChecked=o.parent.control.pivotButtonModule.nodeStateModified.bind(o.parent.control.pivotButtonModule),o.allMemberSelect.nodeChecked=o.parent.control.pivotButtonModule.nodeStateModified.bind(o.parent.control.pivotButtonModule))})},e.prototype.createTreeView=function(e,i,a){var r=this,n=t.createElement("div",{id:this.parent.parentID+"EditorDiv",className:"e-member-editor-outer-container"+(this.allowExcelLikeFilter?" e-excelfilter":"")}),l=t.createElement("button",{id:this.parent.parentID+"_LevelDiv",className:"e-level-container-class",attrs:{type:"button"}}),d=t.createElement("div",{id:this.parent.parentID+"_SearchDiv",attrs:{tabindex:"-1"},className:"e-editor-search-container"}),p=this.parent.engineModule.fieldList[a].caption,h=t.createElement("input",{attrs:{type:"text",className:"e-editor-search-input"}}),u=this.parent.isDataOverflow?this.parent.currentTreeItems.length-this.parent.control.maxNodeLimitInMemberEditor+this.parent.control.localeObj.getConstant("editorDataLimitMsg"):"",c=t.createElement("div",{id:this.parent.parentID+"_LabelDiv",attrs:{tabindex:"-1",title:u},className:"e-editor-label-container"});this.parent.editorLabelElement=t.createElement("label",{className:"e-editor-label"}),this.parent.editorLabelElement.innerText=u,c.style.display=this.parent.isDataOverflow?"block":"none",c.appendChild(this.parent.editorLabelElement),d.appendChild(h),this.createSortOptions(a,d,e);var g=t.createElement("div",{id:this.parent.parentID+"_AllDiv",attrs:{tabindex:"-1"},className:"e-select-all-container"}),m=t.createElement("div",{id:this.parent.parentID+"_SelectAllContainer",className:"e-select-all"}),f=t.createElement("div",{className:"e-member-editor-container-outer-div"}),v=t.createElement("div",{className:"e-member-editor-container"}),S=t.createElement("div",{className:"e-member-prompt e-disable"});S.innerText=this.parent.localeObj.getConstant("noMatches"),"olap"!==this.parent.dataType||!this.parent.control.loadOnDemandInMemberEditor||this.parent.engineModule.fieldList[a].isHierarchy||this.parent.engineModule.fieldList[a].isNamedSets||(d.appendChild(l),this.createLevelWrapper(l,a)),g.appendChild(m),n.appendChild(d),n.appendChild(g),n.appendChild(S),this.editorSearch=new s.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("search")+" “"+p+"“",enableRtl:this.parent.enableRtl,cssClass:"e-editor-search"+(this.parent.cssClass?" "+this.parent.cssClass:""),showClearButton:!0,change:function(e){if("olap"===r.parent.dataType)r.searchOlapTreeView(e,S);else{r.parent.eventBase.searchTreeNodes(e,r.memberTreeView,!1);var i=r.dialogPopUp.element;0===[].slice.call(r.memberTreeView.element.querySelectorAll("li")).length?(r.allMemberSelect.disableNodes([r.allMemberSelect.element.querySelector("li")]),i.querySelector(".e-ok-btn").setAttribute("disabled","disabled"),t.removeClass([S],"e-disable")):(r.allMemberSelect.enableNodes([r.allMemberSelect.element.querySelector("li")]),i.querySelector(".e-ok-btn").removeAttribute("disabled"),t.addClass([S],"e-disable")),r.updateCheckedState()}}}),this.editorSearch.isStringTemplate=!0,this.editorSearch.appendTo(h);var y={"data-fieldName":a,"data-memberId":"all"},b=[{id:"all",name:this.parent.localeObj.getConstant("all"),isSelected:!0,htmlAttributes:y}];if(this.allMemberSelect=new o.TreeView({fields:{dataSource:b,id:"id",text:"name",isChecked:"isSelected"},showCheckBox:!0,expandOn:"None",enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,nodeClicked:this.nodeCheck.bind(this,!0),keyPress:this.nodeCheck.bind(this,!0),nodeSelected:function(e){t.removeClass([e.node],"e-active"),e.cancel=!0},cssClass:this.parent.cssClass}),this.allMemberSelect.isStringTemplate=!0,!t.isNullOrUndefined(this.parent.currentTreeItems))for(var C=0;C<this.parent.currentTreeItems.length;C++)(this.parent.currentTreeItems[C].id.indexOf("\n")||0===this.parent.currentTreeItems[C].id.indexOf("\n"))&&(this.parent.currentTreeItems[C].id=this.parent.currentTreeItems[C].id.replace("\n"," "));return this.allMemberSelect.appendTo(m),f.appendChild(v),n.appendChild(f),this.memberTreeView=new o.TreeView({fields:{dataSource:e,id:"id",text:"name",isChecked:"isSelected",parentID:"pid"},showCheckBox:!0,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,nodeChecking:this.validateTreeNode.bind(this),nodeClicked:this.nodeCheck.bind(this,!1),keyPress:this.nodeCheck.bind(this,!1),nodeExpanding:this.updateChildNodes.bind(this),nodeSelected:function(e){t.removeClass([e.node],"e-active"),e.cancel=!0},expandOn:"None",cssClass:this.parent.cssClass}),this.memberTreeView.isStringTemplate=!0,this.memberTreeView.appendTo(v),this.parent.isDataOverflow&&this.parent.control.maxNodeLimitInMemberEditor<this.parent.currentTreeItems.length&&n.appendChild(c),n},e.prototype.createSortOptions=function(e,i,a){if("pivot"===this.parent.dataType&&a&&a.length>0){var r=this.parent.engineModule.fieldList[e].sort,n=t.createElement("div",{className:"e-filter-sort e-btn-group"+(this.parent.enableRtl?" "+D:"")+(this.parent.cssClass?" "+this.parent.cssClass:""),id:this.parent.element.id+"_Member_Sort"});this.parent.element.appendChild(n);var o=t.createElement("button",{className:("Ascending"===r?"e-active ":"")+"e-member-sort",id:this.parent.element.id+"_Sort_Ascend",attrs:{type:"button","aria-label":"button"}}),s=t.createElement("button",{className:("Descending"===r?"e-active ":"")+"e-member-sort",id:this.parent.element.id+"_Sort_Descend",attrs:{type:"button","aria-label":"button"}}),l=new h.Button({iconCss:P+" e-sort-ascend-icon",enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});l.appendTo(o),(l=new h.Button({iconCss:P+" e-sort-descend-icon",enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass,enableHtmlSanitizer:this.parent.enableHtmlSanitizer})).appendTo(s),n.appendChild(o),n.appendChild(s),i.appendChild(n),this.unWireEvent(o),this.unWireEvent(s),this.wireEvent(o,e),this.wireEvent(s,e)}},e.prototype.createLevelWrapper=function(e,i){for(var a=this,r=this.parent.engineModule,n=r.fieldList[i].levels,o=r.fieldList[i].levelCount,s=[],l=0,d=n.length;l<d;l++)s.push({id:n[l].id,text:n[l].name});this.dropMenu=new p.DropDownButton({cssClass:"e-level-drop e-caret-hide"+(this.parent.cssClass?" "+this.parent.cssClass:""),items:s,iconCss:"e-icons e-dropdown-icon",disabled:o===n.length,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,beforeOpen:function(e){var r=[].slice.call(e.element.querySelectorAll("li")),n=a.parent.engineModule.fieldList[i].levelCount;t.removeClass(r,"e-disabled");for(var o=0,s=r.length;o<s;o++)o<n&&t.addClass([r[o]],"e-disabled")},select:function(e){for(var t,i=a.dialogPopUp.element.getAttribute("data-fieldname"),r=a.parent.engineModule,n=0,o=s.length;n<o;n++)s[n].id===e.item.id&&(t=n);r.getFilterMembers(a.parent.dataSourceSettings,i,t+1,!1,!0)},close:function(){var e=a.parent.engineModule,t=e.fieldList[i].levels;e.fieldList[i].levelCount===t.length?(a.dropMenu.disabled=!0,a.dropMenu.dataBind()):a.dropMenu.disabled=!1}}),this.dropMenu.appendTo(e)},e.prototype.searchOlapTreeView=function(e,i){var a=this;clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){var r=a.parent.engineModule,n=a.dialogPopUp.element,o=n.getAttribute("data-fieldname"),s=a.parent.control.maxNodeLimitInMemberEditor?a.parent.control.maxNodeLimitInMemberEditor:5e3;if(r.fieldList[o].isHierarchy)a.parent.eventBase.searchTreeNodes(e,a.memberTreeView,!1,!0);else{if(a.dropMenu&&""!==e.value?a.dropMenu.disabled=!0:a.dropMenu.disabled=!1,a.parent.control.loadOnDemandInMemberEditor){var l=r.fieldList[o].levelCount?r.fieldList[o].levelCount:1;r.getSearchMembers(a.parent.dataSourceSettings,o,e.value.toLowerCase(),s,!1,l)}else r.getSearchMembers(a.parent.dataSourceSettings,o,e.value.toLowerCase(),s,!0);a.parent.eventBase.searchTreeNodes(e,a.memberTreeView,!1,!1)}0===[].slice.call(a.memberTreeView.element.querySelectorAll("li")).length?(a.allMemberSelect.disableNodes([a.allMemberSelect.element.querySelector("li")]),n.querySelector(".e-ok-btn").setAttribute("disabled","disabled"),t.removeClass([i],"e-disable")):(a.allMemberSelect.enableNodes([a.allMemberSelect.element.querySelector("li")]),n.querySelector(".e-ok-btn").removeAttribute("disabled"),t.addClass([i],"e-disable")),a.updateCheckedState()},500)},e.prototype.nodeCheck=function(e,i){var a=[i.node];if(i.event.target.classList.contains("e-fullrow")||"Enter"===i.event.key){var r=e?this.allMemberSelect:this.memberTreeView;"true"===r.getNode(i.node).isChecked?r.uncheckAll(a):r.checkAll(a)}else 38!==i.event.keyCode||e||(t.removeClass(this.memberTreeView.element.querySelectorAll("li.e-prev-active-node"),"e-prev-active-node"),t.addClass(a,"e-prev-active-node"))},e.prototype.applySorting=function(e,i){var a=t.closest(i.target,".e-member-sort");if(a){var r=[].slice.call(t.closest(a,".e-filter-sort").querySelectorAll(".e-member-sort"));a.querySelector(".e-sort-ascend-icon")&&!a.classList.contains("e-active")?(this.updateFilterMembers("Ascending",e),t.addClass([a],"e-active"),t.removeClass([r[1]],"e-active")):a.querySelector(".e-sort-descend-icon")&&!a.classList.contains("e-active")?(this.updateFilterMembers("Descending",e),t.addClass([a],"e-active"),t.removeClass([r[0]],"e-active")):(this.updateFilterMembers("None",e),t.removeClass(r,"e-active"))}},e.prototype.updateFilterMembers=function(e,i){var a=this.parent.engineModule.fieldList[i],r="None"===e?f.getClonedData(a.dateMember):this.parent.currentTreeItems.slice(),n=!!a.isAlphanumeric||void 0,o=!1,s=a&&a.membersOrder?a.membersOrder.slice():[],l={fieldName:i,sortOrder:e,members:s&&s.length>0?s:Object.keys(r),IsOrderChanged:!1};if(s&&s.length>0)r=f.applyCustomSort(l,r,n);else{var d=this.parent.dataSourceSettings.groupSettings.filter(function(e){return e.name===i&&"number"===e.type.toLocaleLowerCase()}),p=!t.isNullOrUndefined(d)&&d.length>0;r=f.applyHeadersSort(r,l.sortOrder,n,p),o=!0}var h="pivotfieldlist"===this.parent.moduleName&&this.parent.control.isPopupView?this.parent.control.pivotGridModule:this.parent.control;if(o){for(var u=[],c=0,g=0;c<r.length;c++)"Grand Total"!==r[c].actualText&&(u[g++]=r[c].actualText);l.members=u}h.trigger("onHeadersSort",l),l.IsOrderChanged&&(r=f.applyCustomSort(l,r,n,!0)),this.parent.currentTreeItems=[],this.parent.searchTreeItems=[];for(var m=[],v=i.replace(/[^a-zA-Z0-9 ]/g,"_"),S=this.parent.engineModule,y=0,b=r.length;y<b;y++){if("None"===e){var C=r[y].actualText.toString(),x={id:v+"_"+(y+1),htmlAttributes:{"data-fieldName":i,"data-memberId":C},actualText:r[y].actualText,name:this.parent.isDateField?r[y].formattedText:S.getFormattedValue(C,i).formattedText,isSelected:this.parent.currentTreeItemsPos[r[y].actualText].isSelected};this.parent.currentTreeItems.push(x),""!==this.editorSearch.value?x.name.toLowerCase().indexOf(this.editorSearch.value.toLowerCase())>-1&&(this.parent.searchTreeItems.push(x),m.push(x)):(this.parent.searchTreeItems.push(x),m.push(x))}else this.parent.currentTreeItems.push(r[y]),""!==this.editorSearch.value?r[y].name.toLowerCase().indexOf(this.editorSearch.value.toLowerCase())>-1&&(this.parent.searchTreeItems.push(r[y]),m.push(r[y])):(this.parent.searchTreeItems.push(r[y]),m.push(r[y]));this.parent.currentTreeItemsPos[r[y].actualText].index=y}var w=this.memberTreeView.fields.dataSource.length;this.memberTreeView.fields={dataSource:m.slice(0,w),id:"id",text:"name",isChecked:"isSelected",parentID:"pid"},this.memberTreeView.dataBind()},e.prototype.updateChildNodes=function(e){if("olap"===this.parent.dataType){var i=this.parent.engineModule,a=e.node.getAttribute("data-fieldname"),r=i.fieldList[a],n=[];if(r&&r.filterMembers.length>0&&!this.isSearchEnabled&&!r.members[e.nodeData.id].isNodeExpand){for(var o=[],s=0,l=r.filterMembers;s<l.length;s++){var d=l[s];d.pid===e.nodeData.id.toString()&&o.push(d)}0===o.length&&(r.childMembers=[],i.getChildMembers(this.parent.dataSourceSettings,e.nodeData.id.toString(),a),o=r.childMembers,r.childMembers=[]);var p=f.getClonedData(o),h=this.memberTreeView.fields.dataSource,u=!1;t.isNullOrUndefined(this.filterObject)||(u="Include"===this.filterObject.type,n=this.filterObject.items?this.filterObject.items:[]),p=this.updateChildData(u,p,n,a,e.nodeData);for(var c=0,g=p=this.parent.eventBase.sortOlapFilterData(p,i.fieldList[a].sort);c<g.length;c++){var m=g[c];h.push(m)}r.members[e.nodeData.id].isNodeExpand=!0,this.memberTreeView.addNodes(p,e.node)}}},e.prototype.updateChildData=function(e,t,i,a,r){for(var n=Object.keys(this.parent.currentTreeItemsPos).length,o=this.parent.engineModule.fieldList[a],s=[],l=1,d=0,p=t;d<p.length;d++){var h=p[d],u=h,c=h.id.toString();o.members[c].isNodeExpand=!1,h.isSelected="true"===r.isChecked,l<=this.parent.control.maxNodeLimitInMemberEditor&&s.push(u),this.parent.currentTreeItems.push(u),this.parent.searchTreeItems.push(u),this.parent.currentTreeItemsPos[c]={index:n,isSelected:u.isSelected},n++,l++}return this.parent.isDataOverflow=!1,s},e.prototype.createTabMenu=function(e,i,a){var r=t.createElement("div",{id:this.parent.parentID+"_FilterTabContainer",className:"e-filter-tab-container",attrs:{tabindex:"-1"}});this.dialogPopUp.content=r,this.dialogPopUp.dataBind();for(var n=["Label","Value","Include","Exclude"],s="((-|\\+)?[0-9]+(\\.[0-9]+)?)+",l=Object.keys(this.parent.engineModule.fieldList[a].members)[0],d=this.parent.engineModule.fieldList[a].type,p=f.getFieldByName(a,this.parent.dataSourceSettings.formatSettings),h=[{header:{text:this.parent.localeObj.getConstant("member"),iconCss:this.filterObject&&n.indexOf(this.filterObject.type)>1?"e-selected-option-icon":""},content:this.createTreeView(e,i,a)}],u=0,c=n;u<c.length;u++){var g=c[u];if("Label"===g&&this.parent.dataSourceSettings.allowLabelFilter||"Value"===g&&this.parent.dataSourceSettings.allowValueFilter){var m="Label"===g&&l&&l.match(s)&&l.match(s)[0].length===l.length&&"number"===d?"Number":"Label"===g&&l&&"Invalid Date"!==new Date(l).toString()&&(p&&p.type||this.filterObject&&"Date"===this.filterObject.type)?"Date":g,v={header:{text:"Number"===m?this.parent.localeObj.getConstant("label"):this.parent.localeObj.getConstant(m.toLowerCase()),iconCss:this.filterObject&&this.filterObject.type===m?"e-selected-option-icon":""},content:this.createCustomFilter(a,this.filterObject&&this.filterObject.type===m?this.filterObject:void 0,m.toLowerCase())};h.push(v)}}var S=this.filterObject?["Label","Date","Number"].indexOf(this.filterObject.type)>=0?1:"Value"===this.filterObject.type?this.parent.dataSourceSettings.allowLabelFilter&&this.parent.dataSourceSettings.allowValueFilter?2:1:0:0;S=this.parent.dataSourceSettings.allowMemberFilter||0!==S?S:1,this.tabObj=new o.Tab({heightAdjustMode:"Auto",items:h,height:"100%",selectedItem:S,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass}),this.tabObj.isStringTemplate=!0,this.tabObj.appendTo(r),this.parent.dataSourceSettings.allowMemberFilter||this.tabObj.hideTab(0),S>0&&t.addClass([this.dialogPopUp.element.querySelector(".e-filter-div-content."+(1===S&&this.parent.dataSourceSettings.allowLabelFilter?"e-label-filter":"e-value-filter"))],"e-selected-tab")},e.prototype.createCustomFilter=function(e,i,a){for(var r=[],n=[],o=[],s=this.parent.dataSourceSettings.values,l="DoesNotEquals",d=0,p=0,h={label:["Equals","DoesNotEquals","BeginWith","DoesNotBeginWith","EndsWith","DoesNotEndsWith","Contains","DoesNotContains","GreaterThan","GreaterThanOrEqualTo","LessThan","LessThanOrEqualTo","Between","NotBetween"],date:["Equals","DoesNotEquals","Before","BeforeOrEqualTo","After","AfterOrEqualTo","Between","NotBetween"],value:["Equals","DoesNotEquals","GreaterThan","GreaterThanOrEqualTo","LessThan","LessThanOrEqualTo","Between","NotBetween"]},u=["Between","NotBetween"],c="label"===a?h.label:"date"===a?h.date:h.value,g=0,m=c;g<m.length;g++){var f=m[g];l=i&&f===i.condition?c.indexOf(i.condition)>=0?i.condition:c[0]:l,r.push({value:f,text:this.parent.localeObj.getConstant(f)})}for(var v=s.length;v--;)n.unshift({value:s[v].name,text:s[v].caption?s[v].caption:s[v].name}),d=i&&"Value"===i.type&&i.measure===s[v].name&&i.condition===l?v:d;if("olap"===this.parent.dataType){var S=this.parent.engineModule,y=S.fieldList[e].levels;if(this.parent.engineModule.fieldList[e].isHierarchy){for(var b=void 0,C=0,x=this.parent.engineModule.fieldListData;C<x.length;C++){var w=x[C];if(w&&w.pid===e){b=w;break}}o.push({value:b?b.id:e,text:b?b.caption:S.fieldList[e].name}),p=0,i&&i.name===e&&i.type.toLowerCase()===a&&(o[o.length-1].iconClass=P+" e-selected-level-icon")}else for(var T=0,M=y.length;T<M;T++){p=i&&i.selectedField===y[T].id?T:p,o.push({value:y[T].id,text:y[T].name});for(var D=0,O=this.parent.dataSourceSettings.filterSettings;D<O.length;D++){var N=O[D];if(N.name===e&&N.selectedField===y[T].id&&N.type.toLowerCase()===a){o[o.length-1].iconClass=P+" e-selected-level-icon";break}}}}var E=t.createElement("div",{className:"e-filter-div-content e-"+(["date","number"].indexOf(a)>=0?"label":a)+"-filter"+(this.parent.isDataOverflow?" e-node-limit":""),id:this.parent.parentID+"_"+a+"_filter_div_content",attrs:{"data-type":a,"data-fieldName":e,"data-operator":l,"data-selectedField":"olap"===this.parent.dataType&&o.length>0?o[p].value.toString():"","data-measure":this.parent.dataSourceSettings.values.length>0?this.parent.dataSourceSettings.values[d].name:"","data-value1":i&&l===i.condition&&i.value1?i.value1.toString():"","data-value2":i&&l===i.condition&&i.value2?i.value2.toString():""}}),F=t.createElement("div",{className:"e-filter-text-div"});F.innerText=this.parent.localeObj.getConstant(a+"TextContent");var I=t.createElement("div",{className:"e-between-text-div "+(-1===u.indexOf(l)?"e-disable":"")});I.innerText=this.parent.localeObj.getConstant("And");var L=t.createElement("div",{className:"e-separator-div"}),A=t.createElement("div",{className:"e-filter-option-container-1"}),R=t.createElement("div",{className:"e-level-option-container "+("olap"===this.parent.dataType?"":"e-disable")}),k=t.createElement("div",{className:"e-measure-option-container "+(["label","date","number"].indexOf(a)>=0?"e-disable":"")}),j=t.createElement("div",{className:"e-condition-option-container"}),q=t.createElement("div",{className:"e-filter-option-container-2"}),H=t.createElement("div",{id:this.parent.parentID+"_"+a+"_level_option_container"}),V=t.createElement("div",{id:this.parent.parentID+"_"+a+"_measure_option_container"}),U=t.createElement("div",{id:this.parent.parentID+"_"+a+"_contition_option_container"}),_=t.createElement("div",{className:"e-filter-input-div-1"}),B=t.createElement("div",{className:"e-filter-input-div-2 "+(-1===u.indexOf(l)?"e-disable":"")}),G=t.createElement("input",{id:this.parent.parentID+"_"+a+"_input_option_1",attrs:{type:"text"}}),z=t.createElement("input",{id:this.parent.parentID+"_"+a+"_input_option_2",attrs:{type:"text"}});return _.appendChild(G),B.appendChild(z),R.appendChild(H),R.appendChild(L.cloneNode(!0)),k.appendChild(V),k.appendChild(L),j.appendChild(U),A.appendChild(R),A.appendChild(k),A.appendChild(j),q.appendChild(_),q.appendChild(I),q.appendChild(B),this.createElements(i,u,V,U,G,z,n,r,d,l,a,H,o,p),E.appendChild(F),E.appendChild(A),E.appendChild(q),E},e.prototype.createElements=function(e,i,a,r,o,p,h,u,c,g,m,f,v,S){var y=this;if("olap"===this.parent.dataType){var b=new l.DropDownList({dataSource:v,enableRtl:this.parent.enableRtl,fields:{value:"value",text:"text",iconCss:"iconClass"},index:S,cssClass:"e-level-options"+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){var i=y.dialogPopUp.element.querySelector(".e-selected-tab"),a=i.getAttribute("data-fieldName"),r=i.getAttribute("data-type");if(!t.isNullOrUndefined(i)){y.updateInputValues(i,r,o,p),n.setStyleAndAttributes(i,{"data-selectedField":e.value});for(var l,d=0,u=y.parent.dataSourceSettings.filterSettings;d<u.length;d++){var c=u[d];if(c.name===a&&c.selectedField===e.value){l=c;break}}if(l){"value"===r&&l.measure&&""!==l.measure&&(C.value=l.measure?l.measure:h[0].value),l.condition?x.value=l.condition?l.condition:"DoesNotEquals":x.value="DoesNotEquals";var g=void 0,m=void 0;"value"===r?(g=t.getInstance(o,s.NumericTextBox),m=t.getInstance(p,s.NumericTextBox),g&&(g.value=l.value1?parseInt(l.value1,10):void 0),m&&(m.value=l.value2?parseInt(l.value2,10):void 0)):(g=t.getInstance(o,s.MaskedTextBox),m=t.getInstance(p,s.MaskedTextBox),g&&(g.value=l.value1?l.value1:""),m&&(m.value=l.value2?l.value2:""))}y.updateInputValues(i,r,o,p)}}});b.isStringTemplate=!0,b.appendTo(f)}var C=new l.DropDownList({dataSource:h,enableRtl:this.parent.enableRtl,fields:{value:"value",text:"text"},index:c,cssClass:"e-value-options"+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){var i=y.dialogPopUp.element.querySelector(".e-selected-tab");t.isNullOrUndefined(i)||(y.updateInputValues(i,m,o,p),n.setStyleAndAttributes(i,{"data-measure":e.value}))}});C.isStringTemplate=!0,C.appendTo(a);var x=new l.DropDownList({dataSource:u,enableRtl:this.parent.enableRtl,fields:{value:"value",text:"text"},value:g,cssClass:"e-filter-operator"+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){var a=y.dialogPopUp.element.querySelector(".e-selected-tab");if(!t.isNullOrUndefined(a)){y.updateInputValues(a,m,o,p);for(var r=0,s=["e-between-text-div","e-filter-input-div-2"];r<s.length;r++){var l=s[r];i.indexOf(e.value)>=0?t.removeClass([a.querySelector("."+l)],"e-disable"):t.addClass([a.querySelector("."+l)],"e-disable")}n.setStyleAndAttributes(a,{"data-operator":e.value})}}});if(x.isStringTemplate=!0,x.appendTo(r),"date"===m){var w=new d.DateTimePicker({placeholder:this.parent.localeObj.getConstant("chooseDate"),enableRtl:this.parent.enableRtl,format:"dd/MM/yyyy hh:mm:ss a",showClearButton:!0,value:e&&g===e.condition?"string"==typeof e.value1?new Date(e.value1):e.value1:null,change:function(e){var i=y.dialogPopUp.element.querySelector(".e-selected-tab");t.isNullOrUndefined(i)||n.setStyleAndAttributes(i,{"data-value1":e.value,"data-value2":T.value})},width:"100%",cssClass:this.parent.cssClass}),T=new d.DateTimePicker({placeholder:this.parent.localeObj.getConstant("chooseDate"),enableRtl:this.parent.enableRtl,format:"dd/MM/yyyy hh:mm:ss a",showClearButton:!0,value:e&&g===e.condition?"string"==typeof e.value2?new Date(e.value2):e.value2:null,change:function(e){var i=y.dialogPopUp.element.querySelector(".e-selected-tab");t.isNullOrUndefined(i)||n.setStyleAndAttributes(i,{"data-value1":w.value,"data-value2":e.value})},width:"100%",cssClass:this.parent.cssClass});w.isStringTemplate=!0,w.appendTo(o),T.isStringTemplate=!0,T.appendTo(p)}else if("value"===m){var M=new s.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,format:"###.##",value:e&&g===e.condition?parseInt(e.value1,10):void 0,change:function(e){var i=y.dialogPopUp.element.querySelector(".e-selected-tab");t.isNullOrUndefined(i)||n.setStyleAndAttributes(i,{"data-value1":e.value?e.value.toString():"0","data-value2":D.value?D.value.toString():"0"})},width:"100%",cssClass:this.parent.cssClass}),D=new s.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,format:"###.##",value:e&&g===e.condition?parseInt(e.value2,10):void 0,change:function(e){var i=y.dialogPopUp.element.querySelector(".e-selected-tab");t.isNullOrUndefined(i)||n.setStyleAndAttributes(i,{"data-value1":M.value?M.value.toString():"0","data-value2":e.value?e.value.toString():"0"})},width:"100%",cssClass:this.parent.cssClass});M.isStringTemplate=!0,M.appendTo(o),D.isStringTemplate=!0,D.appendTo(p)}else{var O=new s.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,value:e&&g===e.condition?e.value1:"",change:function(e){var i=y.dialogPopUp.element.querySelector(".e-selected-tab");t.isNullOrUndefined(i)||n.setStyleAndAttributes(i,{"data-value1":e.value,"data-value2":P.value})},width:"100%",cssClass:this.parent.cssClass}),P=new s.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,value:e&&g===e.condition?e.value2:"",change:function(e){var i=y.dialogPopUp.element.querySelector(".e-selected-tab");t.isNullOrUndefined(i)||n.setStyleAndAttributes(i,{"data-value1":O.value,"data-value2":e.value})},width:"100%",cssClass:this.parent.cssClass});O.isStringTemplate=!0,O.appendTo(o),P.isStringTemplate=!0,P.appendTo(p)}},e.prototype.updateInputValues=function(e,i,a,r){var o=t.getInstance(a,"date"===i?d.DateTimePicker:"value"===i?s.NumericTextBox:s.MaskedTextBox),l=t.getInstance(r,"date"===i?d.DateTimePicker:"value"===i?s.NumericTextBox:s.MaskedTextBox),p=t.isNullOrUndefined(o.value)?"":o.value.toString(),h=t.isNullOrUndefined(l.value)?"":l.value.toString();n.setStyleAndAttributes(e,{"data-value1":p,"data-value2":h})},e.prototype.validateTreeNode=function(e){e.node.classList.contains("e-disable")&&(e.cancel=!0)},e.prototype.updateCheckedState=function(){var e=this.dialogPopUp.element,i=[].slice.call(this.memberTreeView.element.querySelectorAll("li")),a=e.getAttribute("data-fieldname"),r=this.getUnCheckedNodes(a),n=this.getCheckedNodes(a),o=this.allMemberSelect.element.querySelector("li").querySelector("span.e-frame");i.length>0?n>0?(r>0?(t.removeClass([o],"e-check"),t.addClass([o],"e-stop"),this.allMemberSelect.element.querySelector("li").setAttribute("aria-checked","false")):0===r&&(t.removeClass([o],"e-stop"),t.addClass([o],"e-check")),this.dialogPopUp.buttons[0].buttonModel.disabled=!1,e.querySelector(".e-ok-btn").removeAttribute("disabled")):r>0&&0===n&&(t.removeClass([o],["e-check","e-stop"]),this.getCheckedNodes(a)===n&&(this.dialogPopUp.buttons[0].buttonModel.disabled=!0,e.querySelector(".e-ok-btn").setAttribute("disabled","disabled"))):(this.dialogPopUp.buttons[0].buttonModel.disabled=!0,e.querySelector(".e-ok-btn").setAttribute("disabled","disabled"))},e.prototype.getCheckedNodes=function(e){var t=this.parent.engineModule,i=[];if("olap"===this.parent.dataType&&t&&!t.fieldList[e].isHierarchy)return this.memberTreeView.getAllCheckedNodes().length;for(var a=0,r=this.parent.searchTreeItems;a<r.length;a++){var n=r[a];n.isSelected&&i.push(n)}return i.length},e.prototype.getUnCheckedNodes=function(e){var t=[],i=[],a=this.parent.engineModule;if("olap"===this.parent.dataType&&a&&!a.fieldList[e].isHierarchy)return i=this.memberTreeView.getAllCheckedNodes(),this.memberTreeView.fields.dataSource.length-i.length;for(var r=0,n=this.parent.searchTreeItems;r<n.length;r++){var o=n[r];o.isSelected||t.push(o)}return t.length},e.prototype.isExcelFilter=function(e){for(var t=!1,i=0,a=this.parent.dataSourceSettings.filters;i<a.length;i++)if(a[i].name===e){t=!0;break}return!(t||!this.parent.dataSourceSettings.allowLabelFilter&&!this.parent.dataSourceSettings.allowValueFilter)},e.prototype.getFilterObject=function(e){var t=f.getFilterItemByName(e,f.cloneFilterSettings(this.parent.dataSourceSettings.filterSettings));if(t&&(["Label","Date","Number"].indexOf(t.type)>=0&&this.parent.dataSourceSettings.allowLabelFilter||"Value"===t.type&&this.parent.dataSourceSettings.allowValueFilter||["Include","Exclude"].indexOf(t.type)>=0&&this.parent.eventBase.isValidFilterItemsAvail(e,t)))return t},e.prototype.wireEvent=function(e,i){t.EventHandler.add(e,"click",this.applySorting.bind(this,i),this)},e.prototype.unWireEvent=function(e){t.EventHandler.remove(e,"click",this.applySorting)},e.prototype.closeFilterDialog=function(){this.dialogPopUp.close()},e.prototype.removeFilterDialog=function(){this.editorSearch&&!this.editorSearch.isDestroyed&&(this.editorSearch.destroy(),this.editorSearch=null),this.allowExcelLikeFilter&&this.tabObj&&!this.tabObj.isDestroyed&&(this.tabObj.destroy(),this.tabObj=null),this.dropMenu&&!this.dropMenu.isDestroyed&&(this.dropMenu.destroy(),this.dropMenu=null),this.memberTreeView&&!this.memberTreeView.isDestroyed&&(this.memberTreeView.destroy(),this.memberTreeView=null),this.allMemberSelect&&!this.allMemberSelect.isDestroyed&&(this.allMemberSelect.destroy(),this.allMemberSelect=null),document.getElementById(this.parent.parentID+"_LevelDiv-popup")&&t.remove(document.getElementById(this.parent.parentID+"_LevelDiv-popup")),this.dialogPopUp&&!this.dialogPopUp.isDestroyed&&(this.dialogPopUp.destroy(),this.dialogPopUp=null,setTimeout(this.setFocus.bind(this))),document.getElementById(this.parent.parentID+"_EditorTreeView")&&t.remove(document.getElementById(this.parent.parentID+"_EditorTreeView"))},e.prototype.setFocus=function(){if(this.parent.control.pivotButtonModule.parentElement)for(var e=0,t=[].slice.call(this.parent.control.pivotButtonModule.parentElement.querySelectorAll(".e-pivot-button"));e<t.length;e++){var i=t[e];if(i.getAttribute("data-uid")===this.parent.control.pivotButtonModule.fieldName){i.focus();break}}},e}(),ne=function(){function e(e){return this.currentTreeItems=[],this.savedTreeFilterPos={},this.currentTreeItemsPos={},this.searchTreeItems=[],this.isDataOverflow=!1,this.isDateField=!1,this.element=e.element,this.moduleName=e.moduleName,this.dataSourceSettings=e.dataSourceSettings,this.engineModule=e.pivotEngine,this.enableRtl=e.enableRtl,this.enableHtmlSanitizer=e.enableHtmlSanitizer,this.isAdaptive=e.isAdaptive,this.renderMode=e.renderMode,this.parentID=e.id,this.localeObj=e.localeObj,this.dataType=e.dataType,this.cssClass=e.cssClass,this.nodeStateModified=new te(this),this.dataSourceUpdate=new ie(this),this.eventBase=new ee(this),this.filterDialog=new re(this),this.errorDialog=new ae(this),this.keyboardModule=new $(this),this}return e.prototype.destroy=function(){this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null)},e}(),oe=function(){function e(e){this.parent=e,this.parent.commonModule=this,this.addEventListener()}return e.prototype.getModuleName=function(){return"common"},e.prototype.initiateCommonModule=function(){if(this.parent.pivotCommon)this.parent.pivotCommon.element=this.parent.element,this.parent.pivotCommon.engineModule="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,this.parent.pivotCommon.parentID=this.parent.element.id,this.parent.pivotCommon.dataSourceSettings=this.parent.dataSourceSettings.properties?this.parent.dataSourceSettings.properties:this.parent.dataSourceSettings,this.parent.pivotCommon.moduleName=this.parent.getModuleName(),this.parent.pivotCommon.enableRtl=this.parent.enableRtl,this.parent.pivotCommon.isAdaptive=t.Browser.isDevice,this.parent.pivotCommon.renderMode="Popup",this.parent.pivotCommon.localeObj=this.parent.localeObj,this.parent.pivotCommon.dataType=this.parent.dataType,this.parent.pivotCommon.cssClass=this.parent.cssClass;else{var e={pivotEngine:"olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,dataSourceSettings:this.parent.dataSourceSettings.properties?this.parent.dataSourceSettings.properties:this.parent.dataSourceSettings,id:this.parent.element.id,element:this.parent.element,moduleName:this.parent.getModuleName(),enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,isAdaptive:t.Browser.isDevice,renderMode:"Popup",localeObj:this.parent.localeObj,dataType:this.parent.dataType,cssClass:this.parent.cssClass};this.parent.pivotCommon=new ne(e)}this.parent.pivotCommon.control=this.parent},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(y,this.initiateCommonModule,this),this.parent.on(b,this.initiateCommonModule,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(y,this.initiateCommonModule),this.parent.off(b,this.initiateCommonModule))},e.prototype.destroy=function(){this.removeEventListener(),this.parent.pivotCommon&&(this.parent.pivotCommon.destroy(),this.parent.pivotCommon=null)},e}(),se=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function a(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),le=function(e,t,i,a){var r,n=arguments.length,o=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},de=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return se(i,e),le([t.Property()],i.prototype,"name",void 0),le([t.Property()],i.prototype,"caption",void 0),le([t.Property("Sum")],i.prototype,"type",void 0),le([t.Property()],i.prototype,"axis",void 0),le([t.Property(!1)],i.prototype,"showNoDataItems",void 0),le([t.Property()],i.prototype,"baseField",void 0),le([t.Property()],i.prototype,"baseItem",void 0),le([t.Property(!0)],i.prototype,"showSubTotals",void 0),le([t.Property(!1)],i.prototype,"isNamedSet",void 0),le([t.Property(!1)],i.prototype,"isCalculatedField",void 0),le([t.Property(!0)],i.prototype,"showFilterIcon",void 0),le([t.Property(!0)],i.prototype,"showSortIcon",void 0),le([t.Property(!0)],i.prototype,"showRemoveIcon",void 0),le([t.Property(!0)],i.prototype,"showValueTypeIcon",void 0),le([t.Property(!0)],i.prototype,"showEditIcon",void 0),le([t.Property(!0)],i.prototype,"allowDragAndDrop",void 0),le([t.Property()],i.prototype,"dataType",void 0),le([t.Property(!1)],i.prototype,"expandAll",void 0),le([t.Property()],i.prototype,"groupName",void 0),i}(t.ChildProperty),pe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return se(t,e),t}(de),he=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return se(i,e),le([t.Property()],i.prototype,"backgroundColor",void 0),le([t.Property()],i.prototype,"color",void 0),le([t.Property()],i.prototype,"fontFamily",void 0),le([t.Property()],i.prototype,"fontSize",void 0),i}(t.ChildProperty),ue=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return se(i,e),le([t.Property()],i.prototype,"name",void 0),le([t.Property("Include")],i.prototype,"type",void 0),le([t.Property()],i.prototype,"items",void 0),le([t.Property("DoesNotEquals")],i.prototype,"condition",void 0),le([t.Property()],i.prototype,"value1",void 0),le([t.Property()],i.prototype,"value2",void 0),le([t.Property()],i.prototype,"measure",void 0),le([t.Property(1)],i.prototype,"levelCount",void 0),le([t.Property()],i.prototype,"selectedField",void 0),i}(t.ChildProperty),ce=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return se(i,e),le([t.Property()],i.prototype,"measure",void 0),le([t.Property()],i.prototype,"label",void 0),le([t.Property()],i.prototype,"conditions",void 0),le([t.Property()],i.prototype,"value1",void 0),le([t.Property()],i.prototype,"value2",void 0),le([t.Property()],i.prototype,"style",void 0),le([t.Property(!0)],i.prototype,"applyGrandTotals",void 0),i}(t.ChildProperty),ge=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return se(i,e),le([t.Property()],i.prototype,"name",void 0),le([t.Property("Ascending")],i.prototype,"order",void 0),le([t.Property([])],i.prototype,"membersOrder",void 0),i}(t.ChildProperty),me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return se(i,e),le([t.Property()],i.prototype,"name",void 0),le([t.Property()],i.prototype,"minimumFractionDigits",void 0),le([t.Property()],i.prototype,"maximumFractionDigits",void 0),le([t.Property()],i.prototype,"minimumSignificantDigits",void 0),le([t.Property()],i.prototype,"maximumSignificantDigits",void 0),le([t.Property(!0)],i.prototype,"useGrouping",void 0),le([t.Property()],i.prototype,"skeleton",void 0),le([t.Property()],i.prototype,"type",void 0),le([t.Property()],i.prototype,"currency",void 0),le([t.Property()],i.prototype,"minimumIntegerDigits",void 0),le([t.Property()],i.prototype,"format",void 0),i}(t.ChildProperty),fe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return se(i,e),le([t.Property()],i.prototype,"name",void 0),le([t.Property()],i.prototype,"groupInterval",void 0),le([t.Property()],i.prototype,"startingAt",void 0),le([t.Property()],i.prototype,"endingAt",void 0),le([t.Property("Date")],i.prototype,"type",void 0),le([t.Property()],i.prototype,"rangeInterval",void 0),le([t.Property()],i.prototype,"caption",void 0),le([t.Property()],i.prototype,"customGroups",void 0),i}(t.ChildProperty),ve=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return se(i,e),le([t.Property()],i.prototype,"groupName",void 0),le([t.Property([])],i.prototype,"items",void 0),i}(t.ChildProperty),Se=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return se(i,e),le([t.Property()],i.prototype,"name",void 0),le([t.Property()],i.prototype,"formula",void 0),le([t.Property()],i.prototype,"hierarchyUniqueName",void 0),le([t.Property()],i.prototype,"formatString",void 0),i}(t.ChildProperty),ye=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return se(i,e),le([t.Property()],i.prototype,"name",void 0),le([t.Property()],i.prototype,"items",void 0),le([t.Property()],i.prototype,"delimiter",void 0),i}(t.ChildProperty),be=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return se(i,e),le([t.Property()],i.prototype,"headerText",void 0),le([t.Property(".")],i.prototype,"headerDelimiter",void 0),le([t.Property("None")],i.prototype,"sortOrder",void 0),le([t.Property()],i.prototype,"measure",void 0),i}(t.ChildProperty),Ce=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return se(i,e),le([t.Property()],i.prototype,"userName",void 0),le([t.Property()],i.prototype,"password",void 0),i}(t.ChildProperty),xe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return se(i,e),le([t.Property("Local")],i.prototype,"mode",void 0),le([t.Property()],i.prototype,"catalog",void 0),le([t.Property()],i.prototype,"cube",void 0),le([t.Property()],i.prototype,"roles",void 0),le([t.Property("Relational")],i.prototype,"providerType",void 0),le([t.Property()],i.prototype,"url",void 0),le([t.Property(1033)],i.prototype,"localeIdentifier",void 0),le([t.Property()],i.prototype,"dataSource",void 0),le([t.Collection([],de)],i.prototype,"rows",void 0),le([t.Collection([],de)],i.prototype,"columns",void 0),le([t.Collection([],de)],i.prototype,"values",void 0),le([t.Collection([],de)],i.prototype,"filters",void 0),le([t.Collection([],de)],i.prototype,"fieldMapping",void 0),le([t.Property([])],i.prototype,"excludeFields",void 0),le([t.Property(!1)],i.prototype,"expandAll",void 0),le([t.Property("column")],i.prototype,"valueAxis",void 0),le([t.Property(-1)],i.prototype,"valueIndex",void 0),le([t.Collection([],ue)],i.prototype,"filterSettings",void 0),le([t.Collection([],ge)],i.prototype,"sortSettings",void 0),le([t.Property(!0)],i.prototype,"enableSorting",void 0),le([t.Property("JSON")],i.prototype,"type",void 0),le([t.Property(!0)],i.prototype,"allowMemberFilter",void 0),le([t.Property(!1)],i.prototype,"allowLabelFilter",void 0),le([t.Property(!1)],i.prototype,"allowValueFilter",void 0),le([t.Property(!0)],i.prototype,"showSubTotals",void 0),le([t.Property(!0)],i.prototype,"showRowSubTotals",void 0),le([t.Property(!0)],i.prototype,"showColumnSubTotals",void 0),le([t.Property("Auto")],i.prototype,"subTotalsPosition",void 0),le([t.Property(!0)],i.prototype,"showGrandTotals",void 0),le([t.Property("Bottom")],i.prototype,"grandTotalsPosition",void 0),le([t.Property(!0)],i.prototype,"showRowGrandTotals",void 0),le([t.Property(!0)],i.prototype,"showColumnGrandTotals",void 0),le([t.Property(!1)],i.prototype,"alwaysShowValueHeader",void 0),le([t.Property(!0)],i.prototype,"showHeaderWhenEmpty",void 0),le([t.Property(!0)],i.prototype,"showAggregationOnValueField",void 0),le([t.Collection([],me)],i.prototype,"formatSettings",void 0),le([t.Collection([],ye)],i.prototype,"drilledMembers",void 0),le([t.Complex({},be)],i.prototype,"valueSortSettings",void 0),le([t.Collection([],Se)],i.prototype,"calculatedFieldSettings",void 0),le([t.Collection([],ce)],i.prototype,"conditionalFormatSettings",void 0),le([t.Property()],i.prototype,"emptyCellsTextContent",void 0),le([t.Collection([],fe)],i.prototype,"groupSettings",void 0),le([t.Complex({},Ce)],i.prototype,"authentication",void 0),i}(t.ChildProperty),we=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function a(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),Te=function(e,t,i,a){var r,n=arguments.length,o=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},Me=(function(e){function i(){return null!==e&&e.apply(this,arguments)||this}we(i,e),Te([t.Property("Row")],i.prototype,"mode",void 0),Te([t.Property("Flow")],i.prototype,"cellSelectionMode",void 0),Te([t.Property("Single")],i.prototype,"type",void 0),Te([t.Property(!1)],i.prototype,"checkboxOnly",void 0),Te([t.Property(!1)],i.prototype,"persistSelection",void 0),Te([t.Property("Default")],i.prototype,"checkboxMode",void 0),Te([t.Property(!1)],i.prototype,"enableSimpleMultiRowSelection",void 0)}(t.ChildProperty),function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Te([t.Property("auto")],i.prototype,"height",void 0),Te([t.Property("auto")],i.prototype,"width",void 0),Te([t.Property("Both")],i.prototype,"gridLines",void 0),Te([t.Property(!1)],i.prototype,"allowTextWrap",void 0),Te([t.Property(!1)],i.prototype,"allowReordering",void 0),Te([t.Property(!0)],i.prototype,"allowResizing",void 0),Te([t.Property(!0)],i.prototype,"allowAutoResizing",void 0),Te([t.Property(null)],i.prototype,"rowHeight",void 0),Te([t.Property(110)],i.prototype,"columnWidth",void 0),Te([t.Property("Compact")],i.prototype,"layout",void 0),Te([t.Property("Ellipsis")],i.prototype,"clipMode",void 0),Te([t.Property(!1)],i.prototype,"allowSelection",void 0),Te([t.Property(-1)],i.prototype,"selectedRowIndex",void 0),Te([t.Property({mode:"Row",cellSelectionMode:"Flow",type:"Single"})],i.prototype,"selectionSettings",void 0),Te([t.Property({wrapMode:"Both"})],i.prototype,"textWrapSettings",void 0),Te([t.Property("AllPages")],i.prototype,"printMode",void 0),Te([t.Property()],i.prototype,"contextMenuItems",void 0),Te([t.Event()],i.prototype,"beforeCopy",void 0),Te([t.Event()],i.prototype,"printComplete",void 0),Te([t.Event()],i.prototype,"beforePrint",void 0),Te([t.Event()],i.prototype,"beforePdfExport",void 0),Te([t.Event()],i.prototype,"beforeExcelExport",void 0),Te([t.Event()],i.prototype,"contextMenuOpen",void 0),Te([t.Event()],i.prototype,"contextMenuClick",void 0),Te([t.Event()],i.prototype,"queryCellInfo",void 0),Te([t.Event()],i.prototype,"headerCellInfo",void 0),Te([t.Event()],i.prototype,"rowSelecting",void 0),Te([t.Event()],i.prototype,"rowSelected",void 0),Te([t.Event()],i.prototype,"rowDeselecting",void 0),Te([t.Event()],i.prototype,"rowDeselected",void 0),Te([t.Event()],i.prototype,"cellSelecting",void 0),Te([t.Event()],i.prototype,"cellSelected",void 0),Te([t.Event()],i.prototype,"cellDeselecting",void 0),Te([t.Event()],i.prototype,"cellDeselected",void 0),Te([t.Event()],i.prototype,"resizeStart",void 0),Te([t.Event()],i.prototype,"resizing",void 0),Te([t.Event()],i.prototype,"resizeStop",void 0),Te([t.Event()],i.prototype,"pdfHeaderQueryCellInfo",void 0),Te([t.Event()],i.prototype,"pdfQueryCellInfo",void 0),Te([t.Event()],i.prototype,"excelHeaderQueryCellInfo",void 0),Te([t.Event()],i.prototype,"excelQueryCellInfo",void 0),Te([t.Event()],i.prototype,"columnDragStart",void 0),Te([t.Event()],i.prototype,"columnDrag",void 0),Te([t.Event()],i.prototype,"columnDrop",void 0),Te([t.Event()],i.prototype,"columnRender",void 0),i}(t.ChildProperty)),De=function(){function e(e){this.keyConfigs={tab:"tab",shiftTab:"shift+tab",enter:"enter",shiftUp:"shift+upArrow",shiftDown:"shift+downArrow",shiftLeft:"shift+leftArrow",shiftRight:"shift+rightArrow",shiftEnter:"shift+enter",ctrlEnter:"ctrl+enter",upArrow:"upArrow",downArrow:"downArrow",leftArrow:"leftArrow",rightArrow:"rightArrow",escape:"escape",ctrlShiftF:"ctrl+shift+f"},this.parent=e,this.event=void 0,this.parent.element.tabIndex=-1===this.parent.element.tabIndex?0:this.parent.element.tabIndex,this.pivotViewKeyboardModule=new t.KeyboardEvents(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})}return e.prototype.keyActionHandler=function(e){switch(e.action){case"tab":this.processTab(e);break;case"shiftTab":this.processShiftTab(e);break;case"enter":case"shiftEnter":case"ctrlEnter":this.processEnter(e);break;case"shiftUp":case"shiftDown":case"shiftLeft":case"shiftRight":case"upArrow":case"downArrow":case"leftArrow":case"rightArrow":this.processSelection(e);break;case"escape":this.clearSelection();break;case"ctrlShiftF":this.toggleFieldList(e)}},e.prototype.getNextButton=function(e){var i=this.allpivotButtons(e);if(t.removeClass(i,"e-btn-focused"),this.parent.grid.element.querySelector(".e-pivot-button"))for(var a=i.length,r=0;r<a;r++)if(i[r].getAttribute("data-uid")===e.getAttribute("data-uid"))return i[r+1]?i[r+1]:e;return e},e.prototype.getPrevButton=function(e){var i=this.allpivotButtons(e);if(t.removeClass(i,"e-btn-focused"),this.parent.grid.element.querySelector(".e-pivot-button"))for(var a=i.length,r=0;r<a;r++)if(i[r].getAttribute("data-uid")===e.getAttribute("data-uid"))return i[r-1]?i[r-1]:e;return e},e.prototype.allpivotButtons=function(e){var i=[];if(e&&this.parent.showGroupingBar){var a=t.closest(e,".e-pivot-grouping-bar"),r=t.closest(e,".e-group-pivot-rows"),n=t.closest(e,".e-chart-grouping-bar"),o=e.classList.contains(L),s=void 0,l=void 0,d=void 0;if(null!==a?l=a.classList.contains("e-pivot-grouping-bar"):null!==r?d=r.classList.contains("e-group-pivot-rows"):null!==n&&(s=n.classList.contains("e-chart-grouping-bar")),l||d||o){var p=[].slice.call(this.parent.element.querySelector(".e-pivot-grouping-bar").querySelectorAll(".e-pivot-button")),h=[].slice.call(this.parent.element.querySelector(".e-group-pivot-rows").querySelectorAll(".e-pivot-button"));i=p.concat(h)}else s&&(i=[].slice.call(this.parent.element.querySelector(".e-chart-grouping-bar").querySelectorAll(".e-pivot-button")))}return i},e.prototype.processTab=function(e){var i=e.target;if(i&&(t.closest(i,".e-pivot-button")||i.classList.contains("e-group-row"))){if(this.parent.grid){n=this.parent.grid.serviceLocator.getService("focus");if(i.classList.contains("e-group-row")&&i.querySelector(".e-btn-focused"))i=i.querySelector(".e-btn-focused");else if(i.classList.contains("e-group-row")){n.focus();s=n.getFocusedElement();return t.addClass([s],["e-focused","e-focus"]),s.setAttribute("tabindex","0"),void e.preventDefault()}var a=this.getNextButton(i);if(a.getAttribute("data-uid")!==i.getAttribute("data-uid"))this.parent.element.querySelector(".e-focused")?(this.parent.element.querySelector(".e-focused").setAttribute("tabindex","-1"),t.removeClass(this.parent.element.querySelectorAll(".e-focus"),"e-focus"),t.removeClass(this.parent.element.querySelectorAll(".e-focused"),"e-focused"),n.setFocusedElement(this.parent.element.querySelector(".e-headercell")),this.parent.element.querySelector(".e-headercell").setAttribute("tabindex","0")):n.currentInfo.skipAction=!0,t.addClass([a],"e-btn-focused"),a.focus();else{n.focus();s=n.getFocusedElement();t.addClass([s],["e-focused","e-focus"]),s.setAttribute("tabindex","0")}return void e.preventDefault()}}else if(!this.parent.showGroupingBar&&this.parent.showFieldList&&i&&t.closest(i,".e-toggle-field-list")){if(this.parent.grid){(n=this.parent.grid.serviceLocator.getService("focus")).focus();s=n.getFocusedElement();return t.addClass([s],["e-focused","e-focus"]),s.setAttribute("tabindex","0"),void e.preventDefault()}}else if(this.parent.showGroupingBar||this.parent.showFieldList||!i||!t.closest(i,".e-pivotview")||t.closest(i,".e-popup.e-popup-open")){if(i&&t.closest(i,"."+z)&&this.parent.toolbar&&this.parent.toolbarModule)clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){t.removeClass(t.closest(i,"."+z).querySelectorAll(".e-menu-item.e-focused"),"e-focused"),document.activeElement&&document.activeElement.classList.contains("e-menu-item")&&t.addClass([document.activeElement],"e-focused")});else if(i.classList.contains("e-numerictextbox")){(n=this.parent.grid.serviceLocator.getService("focus")).focus();s=n.getFocusedElement();t.removeClass([s],["e-focused","e-focus"]),s.setAttribute("tabindex","0"),e.preventDefault()}}else if(this.parent.grid){var r=t.closest(i,".e-pivotview"),n=this.parent.grid.serviceLocator.getService("focus"),o=[].slice.call(r.getElementsByTagName("tr"));if(i.innerHTML!==o[o.length-1].lastChild.innerHTML){n.focus();var s=n.getFocusedElement();return t.addClass([s],["e-focused","e-focus"]),s.setAttribute("tabindex","0"),void e.preventDefault()}n.currentInfo.skipAction=!0}},e.prototype.processShiftTab=function(e){var i=e.target;if(i&&(t.closest(i,".e-pivot-button")||i.classList.contains("e-group-row"))){if(this.parent.grid){n=this.parent.grid.serviceLocator.getService("focus");if(i.classList.contains("e-group-row")&&i.querySelector(".e-btn-focused"))i=i.querySelector(".e-btn-focused");else if(i.classList.contains("e-group-row")){i=this.parent.element.querySelector(".e-btn-focused")?this.parent.element.querySelector(".e-btn-focused"):this.parent.element.querySelector(".e-pivot-grouping-bar");var a=this.allpivotButtons(i);if(a.length>0&&a[a.length-1])return n.currentInfo.skipAction=!0,a[a.length-1].focus(),t.removeClass(a,"e-btn-focused"),t.addClass([a[a.length-1]],"e-btn-focused"),void e.preventDefault()}var r=this.getPrevButton(i);if(r.getAttribute("data-uid")!==i.getAttribute("data-uid"))return n.currentInfo.skipAction=!0,r.focus(),void e.preventDefault()}}else if(i&&this.parent.grid&&(i.classList.contains("e-movablefirst")||i.classList.contains("e-rowsheader")&&t.closest(i,"tr").getAttribute("data-uid")===this.parent.grid.element.querySelector(".e-frozencontent tr").getAttribute("data-uid"))){var n=this.parent.grid.serviceLocator.getService("focus");if(i.classList.contains("e-movablefirst")){i=this.parent.element.querySelector(".e-group-rows .e-btn-focused")?this.parent.element.querySelector(".e-group-rows .e-btn-focused"):this.parent.element.querySelector(".e-group-rows");s=n.getFocusedElement();t.removeClass([s],["e-focused","e-focus"])}var o=this.allpivotButtons(i);if(o.length>0)return n.currentInfo.skipAction=!0,setTimeout(function(){o[o.length-1].focus()}),t.removeClass(o,"e-btn-focused"),t.addClass([o[o.length-1]],"e-btn-focused"),void e.preventDefault()}else if(i&&t.closest(i,"."+z)&&this.parent.toolbar&&this.parent.toolbarModule)clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){t.removeClass(t.closest(i,"."+z).querySelectorAll(".e-menu-item.e-focused"),"e-focused"),document.activeElement&&document.activeElement.classList.contains("e-menu-item")&&t.addClass([document.activeElement],"e-focused")});else if(i.classList.contains("e-numerictextbox")){(n=this.parent.grid.serviceLocator.getService("focus")).focus();var s=n.getFocusedElement();t.removeClass([s],["e-focused","e-focus"]),s.setAttribute("tabindex","0"),e.preventDefault()}},e.prototype.processEnter=function(e){var i=e.target;if(i&&t.closest(i,".e-grid")){var a=this.parent.grid.serviceLocator.getService("focus");if(13!==e.keyCode||e.shiftKey||e.ctrlKey)if(13===e.keyCode&&e.shiftKey&&!e.ctrlKey){if(this.parent.enableValueSorting){this.event=e,i.click(),a.focus();r=a.getFocusedElement();t.addClass([r],["e-focused","e-focus"]),r.setAttribute("tabindex","0")}}else 13===e.keyCode&&!e.shiftKey&&e.ctrlKey&&this.parent.hyperlinkSettings&&i.querySelector("a")&&i.querySelector("a").click();else if(i.querySelector("."+P)){this.event=e,i.querySelector("."+P).click(),a.focus();r=a.getFocusedElement();t.addClass([r],["e-focused","e-focus"]),r.setAttribute("tabindex","0")}else if(i.classList.contains("e-valuescontent"))i.dispatchEvent(new MouseEvent("dblclick",{view:window,bubbles:!0,cancelable:!0})),i.querySelector(".e-numerictextbox")&&i.click();else if(i.classList.contains("e-numerictextbox")){a.focus();var r=a.getFocusedElement();t.removeClass([r],["e-focused","e-focus"])}return void e.preventDefault()}},e.prototype.clearSelection=function(){var e=this.parent;t.removeClass(e.element.querySelectorAll(".e-cellselectionbackground,."+_),[_,U,"e-active"]),this.parent.renderModule.selected()},e.prototype.processSelection=function(e){var i=e.target;if(this.parent.grid&&this.parent.gridSettings.allowSelection&&"Row"!==this.parent.gridSettings.selectionSettings.mode&&!i.classList.contains("e-numerictextbox")){var a,r=this.parent,n=Number(e.target.getAttribute("data-colindex")),o=Number(e.target.getAttribute("index"));if("TH"!==i.nodeName&&"TD"!==i.nodeName||(a="shiftUp"===e.action||"upArrow"===e.action?0===o||0===n||"TH"!==i.nodeName&&r.renderModule.rowStartPos!==o?null:this.getParentElement(r,a,n,o-1):"shiftDown"===e.action||"downArrow"===e.action?r.element.querySelector('th[data-colindex="'+n+'"][index="'+(o+1)+'"]'):"shiftLeft"===e.action||"leftArrow"===e.action?e.target.previousSibling:e.target.nextSibling),t.isNullOrUndefined(a))"upArrow"===e.action?(a=r.element.querySelector('[data-colindex="'+n+'"][index="'+(o-1)+'"]'),o--):"downArrow"===e.action&&(a=r.element.querySelector('[data-colindex="'+n+'"][index="'+(o+1)+'"]'),o++),t.isNullOrUndefined(a)||r.clearSelection(a,e);else if("Both"===r.gridSettings.selectionSettings.mode&&a.classList.contains("e-rowcell"))r.clearSelection(a,e);else{n=Number(a.getAttribute("data-colindex")),o=Number(a.getAttribute("index"));var s=Number(a.getAttribute("aria-colspan"));r.clearSelection(a,e);var l={cancel:!1,isCellClick:!0,currentCell:a,data:r.pivotValues[o][n]};r.trigger("cellSelecting",l,function(t){t.cancel||r.applyColumnSelection(e,a,n,n+(s>0?s-1:0),o)})}}else if(i&&(37===e.keyCode||38===e.keyCode)&&this.parent&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&!i.classList.contains("e-numerictextbox")){if(this.parent.grid&&this.parent.element.querySelector(".e-frozenheader")&&this.parent.element.querySelector(".e-frozenheader").querySelectorAll(".e-focus").length>0)return t.removeClass(this.parent.element.querySelector(".e-frozenheader").querySelectorAll(".e-focus"),"e-focus"),t.removeClass(this.parent.element.querySelector(".e-frozenheader").querySelectorAll(".e-focused"),"e-focused"),this.parent.element.querySelector(".e-headercell").setAttribute("tabindex","-1"),this.parent.grid.serviceLocator.getService("focus").setFocusedElement(i),t.addClass([i],["e-focused","e-focus"]),i.setAttribute("tabindex","0"),i.focus(),void e.preventDefault()}else!i.classList.contains("e-numerictextbox")||"rightArrow"!==e.action&&"leftArrow"!==e.action||i.click()},e.prototype.getParentElement=function(e,t,i,a){for(;!t;)t=e.element.querySelector('[data-colindex="'+i+'"][index="'+a+'"]'),i--;return t},e.prototype.toggleFieldList=function(e){if(this.parent&&!this.parent.isDestroyed&&this.parent.showFieldList&&this.parent.pivotFieldListModule&&!this.parent.pivotFieldListModule.isDestroyed&&this.parent.element.querySelector(".e-toggle-field-list")){if(!this.parent.element.querySelector(".e-toggle-field-list").classList.contains("e-hide"))return this.parent.element.querySelector(".e-toggle-field-list").click(),void e.preventDefault();this.parent.element.querySelector(".e-toggle-field-list").classList.contains("e-hide")&&this.parent.pivotFieldListModule.dialogRenderer&&this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog&&!this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog.isDestroyed&&this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog.hide()}},e.prototype.destroy=function(){this.pivotViewKeyboardModule&&this.pivotViewKeyboardModule.destroy()},e}(),Oe=function(){function e(e){this.parent=e,this.parent.contextMenuModule=this}return e.prototype.render=function(){this.renderContextMenu()},e.prototype.renderContextMenu=function(){var e=[{text:this.parent.localeObj.getConstant("addToFilter"),id:this.parent.element.id+"_Filters"},{text:this.parent.localeObj.getConstant("addToRow"),id:this.parent.element.id+"_Rows"},{text:this.parent.localeObj.getConstant("addToColumn"),id:this.parent.element.id+"_Columns"},{text:this.parent.localeObj.getConstant("addToValue"),id:this.parent.element.id+"_Values"}],i={cssClass:"e-pivot-context-menu"+(this.parent.cssClass?" "+this.parent.cssClass:""),items:e,enableRtl:this.parent.enableRtl,locale:this.parent.locale,beforeOpen:this.onBeforeMenuOpen.bind(this),select:this.onSelectContextMenu.bind(this)},a=t.createElement("ul",{id:this.parent.element.id+"_PivotContextMenu"});this.parent.element.appendChild(a),this.menuObj=new o.ContextMenu(i),this.menuObj.isStringTemplate=!0,this.menuObj.appendTo(a)},e.prototype.onBeforeMenuOpen=function(e){var i=[].slice.call(e.element.querySelectorAll("li")),a="olap"===this.parent.dataType?this.fieldElement.getAttribute("data-type"):this.fieldElement.querySelector(".e-pvt-btn-content").getAttribute("data-type");if(t.removeClass(i,"e-disabled"),"CalculatedField"===a||"isMeasureFieldsAvail"===a)for(var r=0,n=i;r<n.length;r++)(u=n[r]).textContent!==this.parent.localeObj.getConstant("addToValue")&&t.addClass([u],"e-disabled");else if("isMeasureAvail"===a)for(var o=0,s=i;o<s.length;o++)(u=s[o]).textContent!==this.parent.localeObj.getConstant("addToRow")&&u.textContent!==this.parent.localeObj.getConstant("addToColumn")&&t.addClass([u],"e-disabled");else if("olap"===this.parent.dataType){for(var l=0,d=i;l<d.length;l++)if((u=d[l]).textContent===this.parent.localeObj.getConstant("addToValue")){t.addClass([u],"e-disabled");break}}else if("true"===this.fieldElement.getAttribute("isvalue"))for(var p=0,h=i;p<h.length;p++){var u=h[p];u.textContent!==this.parent.localeObj.getConstant("addToValue")&&u.textContent!==this.parent.localeObj.getConstant("addToFilter")||t.addClass([u],"e-disabled")}},e.prototype.onSelectContextMenu=function(e){if(null!==e.element.textContent){var t=this.fieldElement.getAttribute("data-uid"),i=e.item.id.replace(this.parent.element.id+"_","").toLowerCase();this.parent.pivotCommon.dataSourceUpdate.control="pivotview"===this.parent.getModuleName()?this.parent:this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent,this.parent.pivotCommon.dataSourceUpdate.btnElement=this.fieldElement,this.parent.pivotCommon.dataSourceUpdate.updateDataSource(t,i,-1),this.parent.updateDataSource(!0),this.fieldElement=void 0}},e.prototype.destroy=function(){this.parent.isDestroyed&&this.menuObj&&!this.menuObj.isDestroyed&&(this.menuObj.destroy(),t.select("#"+this.parent.element.id+"_PivotContextMenu",document)&&t.remove(t.select("#"+this.parent.element.id+"_PivotContextMenu",document)))},e}(),Pe=function(){function e(e){this.previousValues={top:0,left:0},this.frozenPreviousValues={top:0,left:0},this.eventType="",this.isFireFox=t.Browser.userAgent.toLowerCase().indexOf("firefox")>-1,this.parent=e,this.addInternalEvents()}return e.prototype.getModuleName=function(){return"virtualscroll"},e.prototype.addInternalEvents=function(){this.parent.isDestroyed||this.parent.on(C,this.wireEvents,this)},e.prototype.wireEvents=function(){if(this.engineModule="pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule,"Chart"!==this.parent.displayOption.view){var e=this.parent.element.querySelector(".e-content-virtualtable"),i=this.parent.element.querySelector(".e-gridcontent"),a=this.parent.element.querySelector(".e-headercontent"),r=i.querySelector("."+V);if(t.EventHandler.clearEvents(e),this.isFireFox&&t.EventHandler.clearEvents(a),this.engineModule){var n=this.parent.isAdaptive?e:i.querySelector("."+V);t.EventHandler.add(n,"scroll touchmove pointermove",this.onHorizondalScroll(a,e),this),t.EventHandler.add(e.parentElement,"scroll wheel touchmove pointermove keyup keydown",this.onVerticalScroll(e.parentElement,e),this),this.isFireFox?(t.EventHandler.add(n,"mouseup touchend scroll",this.common(a,e,e),this),this.parent.isAdaptive||t.EventHandler.add(e.parentElement,"mouseup touchend scroll",this.common(a,e.parentElement,e),this)):(t.EventHandler.add(n,"mouseup touchend",this.common(a,e,e),this),this.parent.isAdaptive||t.EventHandler.add(e.parentElement,"mouseup touchend",this.common(a,e.parentElement,e),this)),t.EventHandler.add(r,"scroll",this.onCustomScrollbarScroll(e,a),this),t.EventHandler.add(e,"scroll",this.onCustomScrollbarScroll(r,a),this),t.EventHandler.add(a,"scroll",this.onCustomScrollbarScroll(r,e),this),t.EventHandler.add(a,"touchstart pointerdown",this.setPageXY(),this),t.EventHandler.add(a,"touchmove pointermove",this.onTouchScroll(a,e),this),t.EventHandler.add(e,"touchstart pointerdown",this.setPageXY(),this),t.EventHandler.add(e,"touchmove pointermove",this.onTouchScroll(a,e),this)}this.parent.grid.on("check-scroll-reset",function(e){e.cancel=!0}),this.parent.grid.on("prevent-frozen-scroll-refresh",function(e){e.cancel=!0}),this.parent.grid.isPreventScrollEvent=!0}},e.prototype.onWheelScroll=function(e){var t=this,i=e;return function(e){var a=i.scrollTop+(1===e.deltaMode?30*e.deltaY:e.deltaY);t.frozenPreviousValues.top!==a&&(e.preventDefault(),t.frozenPreviousValues.top=a,t.eventType=e.type)}},e.prototype.getPointXY=function(e){var t={x:0,y:0};return e.touches&&e.touches.length?(t.x=e.touches[0].pageX,t.y=e.touches[0].pageY):(t.x=e.pageX,t.y=e.pageY),t},e.prototype.onCustomScrollbarScroll=function(e,t){var i=this,a=e,r=t;return function(e){if(null!==i.parent.element.querySelector(".e-content").querySelector("tbody")){var t=e.target,n=t.scrollLeft;i.previousValues.left===n||i.isFireFox&&t.classList.contains("e-headercontent")||(a.scrollLeft=n,r.scrollLeft=n,i.parent.isDestroyed)}}},e.prototype.onTouchScroll=function(e,t){var i=this,a=t;return function(r){if("mouse"!==r.pointerType){var n=i.getPointXY(r),o=i.parent.element.querySelector(".e-grid .e-content").scrollTop+(i.pageXY.y-n.y),s=i.parent.isAdaptive?t:a.parentElement.parentElement.querySelector("."+V),l=s.scrollLeft+(i.pageXY.x-n.x);i.frozenPreviousValues.left===l||l<0||(e.scrollLeft=l,s.scrollLeft=l,i.pageXY.x=n.x,i.frozenPreviousValues.left=l,i.frozenPreviousValues.top===o||o<0||(i.pageXY.y=n.y,i.frozenPreviousValues.top=o,i.eventType=r.type))}}},e.prototype.update=function(e,i,a,r,n,o){var s=this,l=this.parent.element.querySelector(".e-content-virtualtable");this.parent.isScrolling=!0;var d="pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule,p={dataSourceSettings:f.getClonedDataSourceSettings(this.parent.dataSourceSettings)},h=this.parent.virtualScrollSettings&&this.parent.virtualScrollSettings.allowSinglePage&&"pivot"===this.parent.dataType;if(this.parent.pageSettings&&d.pageSettings){if("vertical"===this.direction){var u=o.parentElement.scrollHeight-(e+o.parentElement.offsetHeight),c="pivot"===this.parent.dataType&&"row"===this.parent.dataSourceSettings.valueAxis?this.parent.dataSourceSettings.values.length:1,g=this.parent.pageSettings.rowPageSize*c*this.parent.gridSettings.rowHeight,m=Math.ceil(e/g);if(m+=h&&u<=0?1:0,(this.parent.scrollPosObject.vertical===m||d.pageSettings.rowPageSize>=d.rowCount||l&&l.scrollHeight<3*l.parentElement.clientHeight)&&!h)return;this.parent.actionObj.actionName="vertical-scroll",h&&this.parent.grid&&this.parent.grid.element.querySelector(".e-spinner-inner")&&t.addClass([this.parent.grid.element.querySelector(".e-spinner-inner")],["e-hide-loader"]),this.parent.actionBeginMethod(),h||this.parent.showWaitingPopup(),this.parent.scrollPosObject.vertical=m,this.parent.pageSettings.currentRowPage=d.pageSettings.currentRowPage=m>1?m:1;var v=0;this.parent.trigger("enginePopulating",p,function(){"pivot"===s.parent.dataType?"Server"===s.parent.dataSourceSettings.mode?s.parent.getEngine("onScroll",null,null,null,null,null,null):(s.parent.engineModule.generateGridData(s.parent.dataSourceSettings,!0,!1,s.parent.engineModule.headerCollection),v=s.parent.engineModule.rowStartPos):(s.parent.olapEngineModule.scrollPage(),v=s.parent.olapEngineModule.pageRowStartPos),s.enginePopulatedEventMethod(d)});T=g*(w=Math.ceil(v/(this.parent.pageSettings.rowPageSize*c)))-d.rowFirstLvl*c*this.parent.gridSettings.rowHeight;this.parent.scrollPosObject.verticalSection=T}else{var S=r.scrollWidth-(r.scrollLeft+r.offsetWidth),y="pivot"===this.parent.dataType&&"column"===this.parent.dataSourceSettings.valueAxis?this.parent.dataSourceSettings.values.length:1,g=this.parent.pageSettings.columnPageSize*y*this.parent.gridSettings.columnWidth,m=Math.ceil(Math.abs(i)/g),b=this.parent.virtualScrollSettings&&this.parent.virtualScrollSettings.allowSinglePage&&"pivot"===this.parent.dataType;if(m+=b&&S<=0?1:0,(this.parent.scrollPosObject.horizontal===m||l&&l.scrollWidth<3*l.parentElement.clientWidth)&&!b)return;this.parent.actionObj.actionName="horizontal-scroll",b&&this.parent.grid&&this.parent.grid.element.querySelector(".e-spinner-inner")&&(t.addClass([this.parent.grid.element.querySelector(".e-spinner-inner")],["e-hide-loader"]),n&&t.removeClass([n,o],["e-virtual-pivot-content"])),this.parent.actionBeginMethod(),b||this.parent.showWaitingPopup();var C=this.parent;C.scrollPosObject.horizontal=m,this.parent.pageSettings.currentColumnPage=d.pageSettings.currentColumnPage=m>1?m:1;var x=0;this.parent.trigger("enginePopulating",p,function(){"pivot"===C.dataType?"Server"===s.parent.dataSourceSettings.mode?s.parent.getEngine("onScroll",null,null,null,null,null,null):(C.engineModule.generateGridData(C.dataSourceSettings,!0,!1,C.engineModule.headerCollection),x=C.engineModule.colStartPos):(C.olapEngineModule.scrollPage(),x=C.olapEngineModule.pageColStartPos),s.enginePopulatedEventMethod(d)});var w=Math.ceil(x/(C.pageSettings.columnPageSize*y)),T=g*w-d.colFirstLvl*y*C.gridSettings.columnWidth;C.scrollPosObject.horizontalSection=T}this.parent.actionObj.actionName=this.parent.getActionCompleteName(),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()}},e.prototype.enginePopulatedEventMethod=function(e,t){var i=this,a=t||this.parent,r={dataSourceSettings:a.dataSourceSettings,pivotValues:e.pivotValues};a.trigger("enginePopulated",r,function(e){i.parent.pivotValues=e.pivotValues})},e.prototype.setPageXY=function(){var e=this;return function(t){"mouse"!==t.pointerType&&(e.pageXY=e.getPointXY(t))}},e.prototype.common=function(e,i,a){var r=this;return function(n){var o=r.parent.isAdaptive?i:t.closest(i,".e-gridcontent").querySelector("."+V);r.parent.virtualScrollSettings&&r.parent.virtualScrollSettings.allowSinglePage&&"pivot"===r.parent.dataType&&("vertical"===r.direction?r.parent.element.querySelector("."+X)&&(t.addClass([a],["e-virtual-pivot-content"]),t.removeClass([r.parent.element.querySelector("."+X)],["e-hide-loader"])):r.parent.element.querySelector("."+X)&&(t.addClass([e,i],["e-virtual-pivot-content"]),t.removeClass([r.parent.element.querySelector("."+X)],["e-hide-loader"]))),r.update(r.parent.element.querySelector(".e-grid .e-content").scrollTop*r.parent.verticalScrollScale,o.scrollLeft*r.parent.horizontalScrollScale,n,o,e,i)}},e.prototype.onHorizondalScroll=function(e,i){var a,r=this,n=this.parent.isAdaptive?i:t.closest(i,".e-gridcontent").querySelector("."+V),o=Math.abs(n.scrollLeft),s=o*this.parent.horizontalScrollScale,l=s-this.parent.scrollPosObject.horizontalSection-o;return l=this.parent.enableRtl?l:-l,"none"!==n.style.display&&this.alignFreezedCells(l,!1),function(d){if(o=Math.abs(n.scrollLeft),s=o*r.parent.horizontalScrollScale,"wheel"!==d.type&&"touchmove"!==d.type&&"wheel"!==r.eventType&&"touchmove"!==r.eventType||(clearTimeout(a),a=setTimeout(function(){s="touchmove"===d.type?o:s,r.update(i.parentElement.scrollTop*r.parent.verticalScrollScale,s,d,n,e,i)},300)),r.previousValues.left!==s){r.parent.scrollDirection=r.direction="horizondal",l=s-r.parent.scrollPosObject.horizontalSection-o,l=r.parent.enableRtl?l:-l;var p=i.querySelector("."+I).style.transform.split(",").length>1?i.querySelector("."+I).style.transform.split(",")[1].trim():"0px)";o<r.parent.scrollerBrowserLimit&&(t.setStyleAttribute(i.querySelector("."+I),{transform:"translate("+l+"px,"+p}),t.setStyleAttribute(e.querySelector("."+I),{transform:"translate("+l+"px,0px)"}),r.alignFreezedCells(l,!1));var h=r.parent.scrollPosObject.horizontalSection>s?-(r.parent.scrollPosObject.horizontalSection-s):s+(e.offsetWidth-e.querySelector(".e-headercell.e-leftfreeze").offsetWidth)-(r.parent.scrollPosObject.horizontalSection+(i.querySelector("."+I).offsetWidth-i.querySelector("."+I).querySelector(".e-leftfreeze.e-rowsheader").offsetWidth)),u=Math.ceil(r.parent.scrollPosObject.horizontalSection/r.parent.horizontalScrollScale)<r.parent.scrollerBrowserLimit;if(r.parent.scrollPosObject.horizontalSection>s||h>1&&u){r.parent.virtualScrollSettings&&r.parent.virtualScrollSettings.allowSinglePage&&"pivot"===r.parent.dataType&&r.parent.element.querySelector("."+X)&&(t.addClass([e,i],["e-virtual-pivot-content"]),t.removeClass([r.parent.element.querySelector("."+X)],["e-hide-loader"])),s>e.clientWidth?(r.parent.scrollPosObject.left<1&&(r.parent.scrollPosObject.left=e.clientWidth),r.parent.scrollPosObject.left=r.parent.scrollPosObject.left-50,h=r.parent.scrollPosObject.horizontalSection>s?h-r.parent.scrollPosObject.left:h+r.parent.scrollPosObject.left):h=-r.parent.scrollPosObject.horizontalSection,l=-(s-(r.parent.scrollPosObject.horizontalSection+h)-t.closest(i,".e-gridcontent").querySelector("."+V).scrollLeft);var c=r.parent.gridSettings.columnWidth*r.engineModule.columnCount;c>r.parent.scrollerBrowserLimit&&(r.parent.horizontalScrollScale=c/r.parent.scrollerBrowserLimit,c=r.parent.scrollerBrowserLimit),l>c&&l>s&&(l=s,h=0),t.setStyleAttribute(i.querySelector("."+I),{transform:"translate("+l+"px,"+p}),t.setStyleAttribute(e.querySelector("."+I),{transform:"translate("+l+"px,0px)"}),r.alignFreezedCells(l,!1),r.parent.scrollPosObject.horizontalSection=r.parent.scrollPosObject.horizontalSection+h}var g=n.scrollWidth-(o+(n.offsetWidth-r.parent.element.querySelector(".e-grid").querySelector(".e-headercell.e-leftfreeze").offsetWidth));if(g<=0){var m=i.querySelector(".e-virtualtrack");m.style.display="none";var f=i.scrollWidth-(i.scrollLeft+i.offsetWidth);m.style.display="";var v=i.scrollWidth-(i.scrollLeft+i.offsetWidth);r.parent.scrollPosObject.horizontalSection-=f>g?f:-v,l=o>r.parent.scrollerBrowserLimit?Number(i.querySelector("."+I).style.transform.split(",")[0].split("px")[0].trim()):-(o*r.parent.horizontalScrollScale-r.parent.scrollPosObject.horizontalSection-o),t.setStyleAttribute(i.querySelector("."+I),{transform:"translate("+l+"px,"+p}),t.setStyleAttribute(e.querySelector("."+I),{transform:"translate("+l+"px,0px)"}),r.alignFreezedCells(l,!1)}r.previousValues.left=s,r.frozenPreviousValues.left=s,r.eventType="",e.scrollLeft=n.scrollLeft,i.scrollLeft=n.scrollLeft}}},e.prototype.alignFreezedCells=function(e,t){for(var i=0,a=this.parent.element.querySelectorAll(".e-leftfreeze");i<a.length;i++)if(this.parent.isTabular&&this.parent.dataSourceSettings.rows.length>1){var r=this.parent.element.querySelector(".e-leftfreeze");t?this.parent.enableRtl?a[i].style.right=-e+"px":this.setFrozenColumnPosition(e,r,i,a):this.parent.enableRtl?a[i].style.right=Number(e)+"px":this.setFrozenColumnPosition(e,r,i,a)}else t?this.parent.enableRtl?a[i].style.right=-e+"px":a[i].style.left=e+"px":this.parent.enableRtl?a[i].style.right=Number(e)+"px":a[i].style.left=Number(-e)+"px"},e.prototype.onVerticalScroll=function(e,i){var a,r=this,n=e.querySelector(".e-content-virtualtable")?e.querySelector(".e-content-virtualtable"):e;return function(o){if(r.parent.isAdaptive||n.scrollHeight>3*n.parentElement.clientHeight){var s=e.scrollTop*r.parent.verticalScrollScale;if("wheel"===o.type||"touchmove"===o.type||"scroll"===o.type||"wheel"===r.eventType||"touchmove"===r.eventType||"keyup"===o.type||"keydown"===o.type){var l=r.parent.isAdaptive?e:t.closest(e,".e-gridcontent").querySelector("."+V);clearTimeout(a),a=setTimeout(function(){var t=0;if(r.parent.isAdaptive){var i=l.querySelector(".e-content-virtualtable");t=l.scrollLeft===i.scrollLeft?l.scrollLeft:i.scrollLeft}else t=l.scrollLeft;r.update(e.scrollTop*r.parent.verticalScrollScale,t*r.parent.horizontalScrollScale,o,l,null,e)},300)}if(r.previousValues.top===s)return;r.parent.scrollPosObject.horizontalSection<0&&(r.parent.scrollPosObject.horizontalSection=0),r.parent.scrollDirection=r.direction="vertical";var d=-(s-r.parent.scrollPosObject.verticalSection-e.scrollTop),p=e.querySelector("."+I).style.transform.split(",")[0].trim();d>r.parent.virtualDiv.clientHeight&&(d=r.parent.virtualDiv.clientHeight),e.scrollTop<r.parent.scrollerBrowserLimit&&(t.setStyleAttribute(e.querySelector("."+I),{transform:"translate(0px,"+d+"px)"}),t.setStyleAttribute(e.querySelector("."+I),{transform:p+","+d+"px)"}));var h=r.parent.scrollPosObject.verticalSection>s?-(r.parent.scrollPosObject.verticalSection-s):s+e.clientHeight-(r.parent.scrollPosObject.verticalSection+e.querySelector("."+I).offsetHeight),u=Math.ceil(r.parent.scrollPosObject.verticalSection/r.parent.verticalScrollScale)<r.parent.scrollerBrowserLimit;if(r.parent.scrollPosObject.verticalSection>s||h>1&&u){r.parent.virtualScrollSettings&&r.parent.virtualScrollSettings.allowSinglePage&&"pivot"===r.parent.dataType&&r.parent.element.querySelector("."+X)&&(t.addClass([i],["e-virtual-pivot-content"]),t.removeClass([r.parent.element.querySelector("."+X)],["e-hide-loader"])),s>e.clientHeight?(r.parent.scrollPosObject.top<1&&(r.parent.scrollPosObject.top=e.clientHeight),r.parent.scrollPosObject.top=r.parent.scrollPosObject.top-50,h=r.parent.scrollPosObject.verticalSection>s?h-r.parent.scrollPosObject.top:h+r.parent.scrollPosObject.top):h=-r.parent.scrollPosObject.verticalSection;var c=r.parent.element.querySelector(".e-content").querySelector("."+I);d=-(s-(r.parent.scrollPosObject.verticalSection+h)-e.scrollTop);var g=r.parent.gridSettings.rowHeight*r.engineModule.rowCount+.1-c.clientHeight;g>r.parent.scrollerBrowserLimit&&(r.parent.verticalScrollScale=g/r.parent.scrollerBrowserLimit,g=r.parent.scrollerBrowserLimit),d>g&&d>s&&(d=s,h=0),d>r.parent.virtualDiv.clientHeight&&(d=r.parent.virtualDiv.clientHeight),t.setStyleAttribute(e.querySelector("."+I),{transform:"translate(0px,"+d+"px)"}),t.setStyleAttribute(e.querySelector("."+I),{transform:p+","+d+"px)"}),r.parent.scrollPosObject.verticalSection=r.parent.scrollPosObject.verticalSection+h}r.previousValues.top=s,r.frozenPreviousValues.top=s,r.eventType=""}}},e.prototype.removeInternalEvents=function(){this.parent.isDestroyed||this.parent.off(C,this.wireEvents)},e.prototype.destroy=function(){this.removeInternalEvents()},e.prototype.setFrozenColumnPosition=function(e,t,i,a){if(t){var r=Number(t.getAttribute("data-colIndex"));r>0&&r<=this.parent.engineModule.rowMaxLevel+1&&(a[i].style.left=r*this.parent.gridSettings.columnWidth+"px")}else a[i].style.left=e+"px"},e}(),Ne=function(){function e(e){this.indexString=[],this.isUpdated=!1,this.parent=e,this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule}return e.prototype.showDrillThroughDialog=function(e){for(var i=this,a=e.rawData,n=[],o={},s=0;s<e.rawData.length;s++)n.push(f.frameHeaderWithKeys(e.rawData[s]));try{if("Table"===this.parent.currentView&&this.parent.editSettings.allowInlineEditing&&this.parent.editSettings.allowEditing&&1===e.rawData.length){if(this.parent.actionObj.actionName="Edit record",this.parent.actionBeginMethod())return;this.editCell(e,a)}else{this.removeDrillThroughDialog();var l=t.createElement("div",{id:this.parent.element.id+"_drillthrough",className:"e-drillthrough-dialog"});this.parent.element.appendChild(l),this.dialogPopUp=new r.Dialog({animationSettings:{effect:"Fade"},allowDragging:!1,header:this.parent.localeObj.getConstant("details"),content:this.createDrillThroughGrid(e,a),cssClass:this.parent.cssClass,beforeOpen:function(){i.drillThroughGrid.setProperties({dataSource:i.parent.editSettings.allowEditing?i.dataWithPrimarykey(e,a,o):a,height:i.parent.editSettings.allowEditing?220:300},!1)},beforeClose:function(){if(i.parent.editSettings.allowEditing&&i.isUpdated){"CSV"===i.parent.dataSourceSettings.type&&i.updateData(i.drillThroughGrid.dataSource);for(var e=[],r=0,s=Object.keys(o);r<s.length;r++){var l=s[r];e.push(o[l])}for(var d=Object.keys(o).length,p=[],h=[],u=0,c=0,g=i.drillThroughGrid.dataSource;c<g.length;c++){if("0"===(T=g[c]).__index||""===T.__index){for(var m=0,f=i.engine.fields;m<f.length;m++){var v=f[m];t.isNullOrUndefined(T[v])&&delete T[v]}delete T.__index,p.push(T)}else d>0&&(delete o[T.__index.toString()],h.push(T),d--);"Server"===i.parent.dataSourceSettings.mode&&(T.__index&&delete T.__index,a[u].__index&&delete a[u].__index),u++}if(d=0,"Server"===i.parent.dataSourceSettings.mode){for(var S=[],y=Object.keys(o),b=0;b<y.length;b++)delete i.parent.drillThroughValue.indexObject[o[y[b]]],S.push({Key:y[b],Value:o[y[b]]});i.parent.getEngine("updateRawData",null,null,null,null,null,null,null,{addedData:p,removedData:S,updatedData:h,indexObject:i.parent.drillThroughValue.indexObject})}else{for(var C=[],x=0,w=i.parent.allowDataCompression?i.parent.engineModule.actualData:i.parent.engineModule.data;x<w.length;x++){var T=w[x];delete T.__index,void 0===o[d.toString()]&&C.push(T),d++}C=C.concat(p);var M={currentData:i.drillThroughGrid.dataSource,previousData:n,previousPosition:e,cancel:!1};i.parent.trigger("editCompleted",M),M.cancel||(i.parent.setProperties({dataSourceSettings:{dataSource:C}},!0),i.engine.updateGridData(i.parent.dataSourceSettings),i.parent.pivotValues=i.engine.pivotValues)}i.parent.actionObj.actionName="Records updated";var D={editInfo:{type:i.drillThroughGrid.editSettings.mode,action:"Update",currentData:i.drillThroughGrid.dataSource,previousData:n,previousPosition:e}};i.parent.actionObj.actionInfo=D}i.isUpdated=!1,o={}},isModal:!0,visible:!0,showCloseIcon:!0,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:this.parent.isAdaptive?"100%":"60%",position:{X:"center",Y:"center"},closeOnEscape:!this.parent.editSettings.allowEditing,target:document.body,close:this.removeDrillThroughDialog.bind(this)}),this.dialogPopUp.isStringTemplate=!0,this.dialogPopUp.appendTo(l),t.setStyleAttribute(this.dialogPopUp.element,{visibility:"visible"});var d={escape:"escape"};this.parent.editSettings.allowEditing&&(this.drillthroughKeyboardModule=new t.KeyboardEvents(this.dialogPopUp.element,{keyAction:this.drillthroughKeyActionHandler.bind(this),keyConfigs:d,eventName:"keydown"}))}}catch(e){this.parent.actionFailureMethod(e)}},e.prototype.editCell=function(e,i){var a=this,r=this.parent.gridSettings.allowResizing,n=e.currentCell.actualText.toString(),o=Number(Object.keys(e.currentCell.indexObject));e.currentTarget.firstElementChild.style.display="none";var l=Number(e.rawData[0][n]),d=f.frameHeaderWithKeys(e.rawData[e.rawData.length-1]),p=e.rawData[e.rawData.length-1],h={editInfo:{type:"Inline editing",action:"update",data:i}};this.parent.actionObj.actionInfo=h;var u=new s.NumericTextBox({value:l,enableRtl:this.parent.enableRtl,enabled:!0,format:"####.##",locale:this.parent.locale,cssClass:this.parent.cssClass,change:function(){var i=t.isNullOrUndefined(u.value)?0:u.value,r=e.currentCell.indexObject[o];e.rawData[0][n]=i,a.parent.engineModule.data[r]=e.rawData[0]},blur:function(){var e={currentData:[p],previousData:[d],previousPosition:[p.index],cancel:!1};if(a.parent.trigger("editCompleted",e),!e.cancel){if("Server"===a.parent.dataSourceSettings.mode){var t={};t[o]=o;var i=[p];a.parent.getEngine("updateRawData",null,null,null,null,null,null,null,{addedData:[],removedData:[],updatedData:i,indexObject:t})}a.parent.setProperties({dataSourceSettings:{dataSource:a.parent.engineModule.data}},!0),a.engine.updateGridData(a.parent.dataSourceSettings),a.parent.pivotValues=a.engine.pivotValues,a.parent.gridSettings.allowResizing=r}}}),c=t.createElement("input",{id:this.parent.element.id+"_inputbox"});e.currentTarget.appendChild(c),u.appendTo(c),e.currentCell.value=u.value,u.focusIn(),this.parent.gridSettings.allowResizing=!1},e.prototype.updateData=function(e){for(var i=0,a=this.parent.allowDataCompression?this.parent.engineModule.actualData:this.parent.engineModule.data;i<e.length;){for(var r=Object.keys(e[i]),n=0,o=[];n<r.length;)t.isNullOrUndefined(this.parent.engineModule.fieldKeys[r[n]])||(o[this.parent.engineModule.fieldKeys[r[n]]]=e[i][r[n]]),n++;a[Number(e[i].__index)]=o,i++}this.parent.allowDataCompression?this.parent.engineModule.actualData=a:this.parent.engineModule.data=a},e.prototype.removeDrillThroughDialog=function(){this.dialogPopUp&&!this.dialogPopUp.isDestroyed&&(this.parent.actionObj.actionName="Drill-through closed",this.parent.actionObj.actionName&&this.parent.actionCompleteMethod(),this.dialogPopUp.destroy());var e=document.getElementById(this.parent.element.id+"_drillthrough");e&&t.remove(e),document.getElementById(this.parent.element.id+"_drillthroughgrid_ccdlg")&&t.remove(document.getElementById(this.parent.element.id+"_drillthroughgrid_ccdlg"))},e.prototype.createDrillThroughGrid=function(e,i){var a=this,r=t.createElement("div",{id:this.parent.element.id+"_drillthroughbody",className:"e-drillthrough-body"}),o=t.createElement("div",{id:this.parent.element.id+"_drillthroughbodyheader",className:"e-drillthrough-body-header-container"});if(""!==e.rowHeaders&&(o.innerHTML="<span class=e-drillthrough-body-header-common><span class=e-drillthrough-body-header>"+this.parent.localeObj.getConstant("row")+"</span> : <span class=e-drillthrough-body-header-value>"+e.rowHeaders+"</span></span>"),""!==e.columnHeaders&&(o.innerHTML=o.innerHTML+"<span class=e-drillthrough-body-header-common><span class=e-drillthrough-body-header>"+this.parent.localeObj.getConstant("column")+"</span> : <span class=e-drillthrough-body-header-value>"+e.columnHeaders+"</span></span>"),""!==e.value){var s=e.value.split("(")[0],l=e.value.split("(")[1].split(")")[0];"0"!==l&&(o.innerHTML=o.innerHTML+"<span class=e-drillthrough-body-header-common><span class=e-drillthrough-body-header>"+s+"</span> : <span class=e-drillthrough-body-header-value>"+l+"</span></span>")}var d=["ColumnChooser"];this.parent.editSettings.allowEditing&&(d=this.parent.editSettings.allowCommandColumns?["ColumnChooser","Add"]:"Batch"===this.parent.editSettings.mode?["ColumnChooser","Add","Delete","Update","Cancel"]:"Dialog"===this.parent.editSettings.mode?["ColumnChooser","Add","Edit","Delete"]:["ColumnChooser","Add","Edit","Delete","Update","Cancel"]);var p=t.createElement("div",{id:this.parent.element.id+"_drillthroughgrid",className:"e-drillthrough-grid"});n.Grid.Inject(n.Selection,n.Reorder,n.Resize,n.Toolbar,n.ColumnChooser),this.drillThroughGrid=new n.Grid({cssClass:this.parent.cssClass,gridLines:"Default",allowResizing:!0,allowReordering:!0,showColumnChooser:!0,enableHover:!1,toolbar:d,columns:e.gridColumns,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableVirtualization:!this.parent.editSettings.allowEditing,allowPaging:this.parent.editSettings.allowEditing,pageSettings:{pageSize:20},rowHeight:this.parent.gridSettings.rowHeight,height:"100%"}),"olap"===this.parent.dataType&&this.formatData(i);var h=this;if(this.parent.trigger("beginDrillThrough",{cellInfo:e,gridObj:this.drillThroughGrid,type:"editing"}),this.drillThroughGrid.allowExcelExport&&n.Grid.Inject(n.ExcelExport),this.drillThroughGrid.allowPdfExport&&n.Grid.Inject(n.PdfExport),this.parent.editSettings.allowEditing){n.Grid.Inject(n.Edit,n.Page);try{this.drillThroughGrid.editSettings=this.parent.editSettings,this.drillThroughGrid.actionBegin=function(e){var t="save"===e.requestType?"Save edited records":"add"===e.requestType?"Add new record":"delete"===e.requestType?"Remove record":"";a.parent.actionObj.actionName=t,a.parent.actionObj.actionName&&a.parent.actionBeginMethod()},this.parent.editSettings.allowCommandColumns?(this.drillThroughGrid.editSettings.mode="Normal",this.drillThroughGrid.editSettings.allowEditOnDblClick=!1,n.Grid.Inject(n.CommandColumn),this.drillThroughGrid.columns.push({headerText:this.parent.localeObj.getConstant("manageRecords"),width:160,showInColumnChooser:!1,commands:[{type:"Edit",buttonOption:{iconCss:" e-icons e-edit",cssClass:"e-flat"+(this.parent.cssClass?" "+this.parent.cssClass:"")}},{type:"Delete",buttonOption:{iconCss:"e-icons e-delete",cssClass:"e-flat"+(this.parent.cssClass?" "+this.parent.cssClass:"")}},{type:"Save",buttonOption:{iconCss:"e-icons e-update",cssClass:"e-flat"+(this.parent.cssClass?" "+this.parent.cssClass:"")}},{type:"Cancel",buttonOption:{iconCss:"e-icons e-cancel-icon",cssClass:"e-flat"+(this.parent.cssClass?" "+this.parent.cssClass:"")}}]})):this.drillThroughGrid.editSettings.allowEditOnDblClick=this.parent.editSettings.allowEditOnDblClick,this.drillThroughGrid.columns.push({field:"__index",visible:!1,isPrimaryKey:!0,type:"string",showInColumnChooser:!1,defaultValue:"0",validationRules:{required:!0}})}catch(e){this.parent.actionFailureMethod(e)}this.drillThroughGrid.actionComplete=function(e){"batchsave"!==e.requestType&&"save"!==e.requestType&&"delete"!==e.requestType||(h.isUpdated=!0),a.parent.actionObj.actionName=a.parent.getActionCompleteName();var t={editInfo:{type:a.drillThroughGrid.editSettings.mode,action:e.requestType,data:i}};a.parent.actionObj.actionInfo=t,a.parent.actionObj.actionName&&a.parent.actionCompleteMethod(),("Normal"===h.drillThroughGrid.editSettings.mode&&"save"===e.requestType&&h.drillThroughGrid.element.querySelectorAll(".e-tbar-btn:hover").length>0&&!h.parent.editSettings.allowCommandColumns||"batchsave"===e.requestType)&&h.dialogPopUp.hide()},this.drillThroughGrid.beforeBatchSave=function(){h.isUpdated=!0}}else n.Grid.Inject(n.VirtualScroll);return document.body.appendChild(p),this.drillThroughGrid.isStringTemplate=!0,this.drillThroughGrid.appendTo(p),r.appendChild(o),r.appendChild(p),r},e.prototype.frameGridColumns=function(e){this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule;var i="olap"===this.parent.dataType?e[0]?Object.keys(e[0]):[]:Object.keys(this.engine.fieldList),a=[],r={};if(this.parent.dataSourceSettings.formatSettings.length>0)for(var n=0;n<this.parent.dataSourceSettings.formatSettings.length;n++)r[this.parent.dataSourceSettings.formatSettings[n].name]=this.parent.dataSourceSettings.formatSettings[n].format;if("olap"===this.parent.dataType)for(var o=0,s=i;o<s.length;o++){p=s[o];a.push({field:p.replace(/_x005B_|_x0020_|_x005D_|_x0024_/g,"").replace("].[","").split(".").reverse().join(""),headerText:p.replace(/_x005B_|_x005D_|_x0024_/g,"").replace(/_x0020_/g," ").replace("].[","").split(".").reverse().join("."),width:120,visible:!0,validationRules:{required:!0},format:t.isNullOrUndefined(r[p])?null:r[p],type:t.isNullOrUndefined(r[p])?"string":null})}else for(var l=0,d=i;l<d.length;l++){var p=d[l];if("CalculatedField"!==this.engine.fieldList[p].aggregateType){var h="",u=!("date"!==this.engine.fieldList[p].type&&"datetime"!==this.engine.fieldList[p].type||!(this.isDateFieldExist(p)||e[0]&&e[0][p]&&-1===e[0][p].toString().indexOf(" ")));h="number"===this.engine.fieldList[p].type?"numericedit":"date"===this.engine.fieldList[p].type&&u?"datepickeredit":"datetime"===this.engine.fieldList[p].type&&u?"datetimepickeredit":"defaultedit";var c=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(this.engine.fieldList[p].caption):this.engine.fieldList[p].caption;a.push({field:p,headerText:c,width:120,visible:this.engine.fieldList[p].isSelected,validationRules:{required:!0},editType:h,format:t.isNullOrUndefined(r[p])?void 0:r[p],type:t.isNullOrUndefined(r[p])?"string":null})}}return a},e.prototype.isDateFieldExist=function(e){for(t=0;t<this.parent.dataSourceSettings.formatSettings.length;t++)if(this.parent.dataSourceSettings.formatSettings[t].name===e&&this.parent.dataSourceSettings.formatSettings[t].type.indexOf("date")>-1)return!0;for(var t=0;t<this.parent.dataSourceSettings.fieldMapping.length;t++)if(this.parent.dataSourceSettings.fieldMapping[t].name===e&&this.parent.dataSourceSettings.fieldMapping[t].dataType&&this.parent.dataSourceSettings.fieldMapping[t].dataType.indexOf("date")>-1)return!0;return!1},e.prototype.formatData=function(e){for(var t=0;t<e.length;){for(var i=e[t],a=Object.keys(e[t]),r={},n=0;n<a.length;)r[a[n].replace(/_x005B_|_x0020_|_x005D_|_x0024_/g,"").replace("].[","").split(".").reverse().join("")]=i[a[n]],n++;e[t]=r,t++}},e.prototype.dataWithPrimarykey=function(e,t,i){for(var a=this.indexString.length>0?this.indexString:Object.keys(e.currentCell.indexObject),r=t,n=0,o=0,s=r;o<s.length;o++)s[o].__index=a[n],i[a[n].toString()]=Number(a[n]),n++;return r},e.prototype.drillthroughKeyActionHandler=function(e){switch(e.action){case"escape":this.processClose(e)}},e.prototype.processClose=function(e){var i=e.target;if(i&&t.closest(i,".e-popup.e-popup-open")){var a=t.getInstance(t.closest(i,".e-popup.e-popup-open"),r.Dialog);if(a&&!a.closeOnEscape){var n=a.element.getAttribute("data-fieldName");if(a.hide(),this.parent.element)for(var o=0,s=[].slice.call(this.parent.element.querySelectorAll(".e-pivot-button"));o<s.length;o++){var l=s[o];if(l.getAttribute("data-uid")===n){l.focus();break}}return void e.preventDefault()}}},e.prototype.destroy=function(){this.parent.isDestroyed||this.drillthroughKeyboardModule&&!this.drillthroughKeyboardModule.isDestroyed&&(this.drillthroughKeyboardModule.destroy(),this.drillthroughKeyboardModule=null)},e}(),Ee=function(){function e(e){this.parent=e,this.drillThroughDialog=new Ne(this.parent),this.addInternalEvents()}return e.prototype.getModuleName=function(){return"drillThrough"},e.prototype.addInternalEvents=function(){this.parent.on(C,this.wireEvents,this)},e.prototype.wireEvents=function(){this.unWireEvents(),t.EventHandler.add(this.parent.element,"dblclick",this.mouseClickHandler,this)},e.prototype.unWireEvents=function(){this.parent.isDestroyed||t.EventHandler.remove(this.parent.element,"dblclick",this.mouseClickHandler)},e.prototype.mouseClickHandler=function(e){var i=e.target,a=null;if(i.classList.contains("e-stackedheadercelldiv")||i.classList.contains("e-headercelldiv")||i.classList.contains("e-stackedheadertext")||i.classList.contains("e-headertext")?a=t.closest(i.parentElement,"th"):i.classList.contains("e-cellvalue")?a=i.parentElement:(i.classList.contains("e-headercell")||i.classList.contains("e-rowcell"))&&(a=i),a&&this.parent.pivotValues.length>0&&(this.parent.allowDrillThrough&&a.classList.contains("e-valuescontent")||this.parent.editSettings.allowEditing)){var r=Number(a.getAttribute("data-colindex")),n=Number(a.getAttribute("index"));this.executeDrillThrough(this.parent.pivotValues[n][r],n,r,a)}},e.prototype.executeDrillThrough=function(e,i,a,r){this.parent.drillThroughElement=r,this.parent.drillThroughValue=e;var n="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,o="",s="",l=[];if(!t.isNullOrUndefined(e.rowHeaders)&&!t.isNullOrUndefined(e.columnHeaders)){if("olap"===this.parent.dataType){var d=void 0,p=(d="row"===this.parent.dataSourceSettings.valueAxis?n.tupRowInfo[e.rowOrdinal]:n.tupColumnInfo[e.colOrdinal])?n.getUniqueName(d.measureName):e.actualText;if(n.fieldList[p]&&n.fieldList[p].isCalculatedField)return void this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("drillError"));o=n.fieldList[p||e.actualText].caption,s=n.fieldList[p||e.actualText].aggregateType;try{this.parent.olapEngineModule.getDrillThroughData(e,this.parent.maxRowsInDrillThrough),l=JSON.parse(n.gridJSON)}catch(e){return this.parent.olapEngineModule.errorInfo&&this.parent.actionFailureMethod(this.parent.olapEngineModule.errorInfo),this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.olapEngineModule.errorInfo?this.parent.olapEngineModule.errorInfo:n.gridJSON),void(this.parent.olapEngineModule.errorInfo=void 0)}}else if(o=n.fieldList[e.actualText.toString()]?n.fieldList[e.actualText.toString()].caption:e.actualText.toString(),s=n.fieldList[e.actualText]?n.fieldList[e.actualText].aggregateType:"","Server"===this.parent.dataSourceSettings.mode)this.parent.getEngine("fetchRawData",null,null,null,null,null,null,{rowIndex:i,columnIndex:a});else if(this.parent.allowDataCompression){var h=Object.keys(e.indexObject);this.drillThroughDialog.indexString=[];for(var u=0,c=h;u<c.length;u++)for(var g=c[u],m=0,f=this.parent.engineModule.groupRawIndex[Number(g)];m<f.length;m++){var v=f[m];l.push(this.parent.engineModule.actualData[v]),this.drillThroughDialog.indexString.push(v.toString())}}else for(var S=0,y=h=Object.keys(e.indexObject);S<y.length;S++){var b=y[S];l.push(this.parent.engineModule.data[Number(b)])}"Server"!==this.parent.dataSourceSettings.mode&&this.triggerDialog(o,s,l,e,r)}},e.prototype.frameData=function(e){for(var t=0,i=0,a=[];i<e.rawData.length;){for(var r={};t<e.gridColumns.length;)r[e.gridColumns[t].field]="Server"===this.parent.dataSourceSettings.mode?e.rawData[i][-1!==this.parent.engineModule.fields.indexOf(e.gridColumns[t].field)?this.parent.engineModule.fields.indexOf(e.gridColumns[t].field):0]:e.rawData[i][this.parent.engineModule.fieldKeys[e.gridColumns[t].field]],t++;a.push(r),i++,t=0}return e.rawData=a,e},e.prototype.triggerDialog=function(e,i,a,r,n){var o="CalculatedField"===i?e.toString():""!==i?this.parent.localeObj.getConstant(i)+" "+this.parent.localeObj.getConstant("of")+" "+e:e;o=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(o):o;var s={currentTarget:n,currentCell:r,rawData:a,rowHeaders:"row"===this.parent.dataSourceSettings.valueAxis?this.parent.getRowText(Number(n.getAttribute("index")),0):""===r.rowHeaders?"":r.rowHeaders.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).join(" - "),columnHeaders:""===r.columnHeaders?"":r.columnHeaders.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).join(" - "),value:o+"("+r.formattedText+")",gridColumns:this.drillThroughDialog.frameGridColumns(a),cancel:!1};"CSV"===this.parent.dataSourceSettings.type&&(s=this.frameData(s));var l=this;this.parent.trigger("drillThrough",s,function(e){s.cancel||l.drillThroughDialog.showDrillThroughDialog(e)})},e.prototype.destroy=function(){this.unWireEvents(),this.drillThroughDialog&&(this.drillThroughDialog.destroy(),this.drillThroughDialog=null)},e}(),Fe=function(){function e(e){this.headerColl={},this.maxLevel=0,this.columnGroupObject={},this.selectedLegend=0,this.chartSeriesInfo={},this.measurePos=-1,this.measuresNames={},this.accumulationType=["Pie","Pyramid","Doughnut","Funnel"],this.isChartInitial=!0,this.parent=e}return e.prototype.getModuleName=function(){return"pivotChart"},e.prototype.loadChart=function(e,a){if(this.parent=e,this.measuresNames={},this.engineModule="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,this.dataSourceSettings=this.parent.dataSourceSettings,this.chartSettings=a,!("olap"===e.dataType?""!==e.dataSourceSettings.url&&!e.olapEngineModule.isEmptyData&&e.olapEngineModule.tupColumnInfo.length>0&&e.olapEngineModule.tupRowInfo.length>0&&(!t.isNullOrUndefined(e.olapEngineModule.colMeasurePos)||!t.isNullOrUndefined(e.olapEngineModule.rowMeasurePos)):"Server"===this.parent.dataSourceSettings.mode?!t.isNullOrUndefined(e.dataSourceSettings.url)&&""!==e.dataSourceSettings.url&&e.dataSourceSettings.values.length>0&&!e.engineModule.isEmptyData:e.dataSourceSettings.values.length>0&&e.dataSourceSettings.dataSource&&(e.dataSourceSettings.dataSource.length>0||e.dataSourceSettings.dataSource instanceof i.DataManager)&&!e.engineModule.isEmptyData))return this.parent.chart?(this.parent.element.querySelector(".e-chart")?(this.parent.chart.series=[],this.parent.chart.rows=[],this.parent.chart.primaryXAxis.title="",this.parent.chart.primaryYAxis.title="",this.parent.chart.primaryXAxis.multiLevelLabels=[],this.parent.chart.primaryYAxis.multiLevelLabels=[],this.parent.chart.axes.length>0&&(this.parent.chart.axes[0].title=""),this.parent.chart.primaryXAxis.zoomFactor=t.isNullOrUndefined(this.parent.chartSettings.primaryXAxis.zoomFactor)?1:this.parent.chartSettings.primaryXAxis.zoomFactor):this.parent.element.querySelector(".e-accumulationchart")&&(this.parent.chart.series[0].dataSource=[{}],this.parent.chart.series[0].dataLabel={}),void this.parent.chart.refresh()):(this.parent.appendChartElement(),this.parent.enableVirtualization&&this.isChartInitial&&(this.isChartInitial=!1,this.parent.onContentReady()),void this.parent.notify(C,{}));this.parent.chart||!this.parent.element.querySelector(".e-chart")&&!this.parent.element.querySelector(".e-accumulationchart")||t.remove(t.select("#"+this.parent.element.id+"_chart",this.parent.element)),this.chartSettings.enableMultipleAxis&&this.accumulationType.indexOf(a.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type?this.measureList=this.dataSourceSettings.values.map(function(e){return e.name}):this.measureList=[""===a.value?this.dataSourceSettings.values[0].name:a.value];for(var r=0,n=this.dataSourceSettings.values;r<n.length;r++){var o=(N=n[r]).name.replace(/[^A-Z0-9]+/gi,"_");this.measuresNames[N.name]=o,this.measuresNames[o]=N.name,"Polar"!==this.chartSettings.chartSeries.type&&"Radar"!==this.chartSettings.chartSeries.type||(this.measuresNames[N.caption?N.caption:N.name]=N.name)}this.columnGroupObject={},this.accEmptyPoint=!1;var s=this.engineModule.pivotValues;this.currentMeasure=a.enableMultipleAxis&&this.accumulationType.indexOf(a.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type?this.measureList[0]:(""===a.value||0===this.dataSourceSettings.values.filter(function(e){return e.name===a.value}).length)&&this.dataSourceSettings.values.length>0?this.dataSourceSettings.values[0].name:a.value;var l,d,p,h=this.getColumnTotalIndex(s),u=Object.keys(s),c={},g=0,m=-.5;this.headerColl={},this.maxLevel=0;var v,S={},y="",b="",x="";this.chartSeriesInfo={},this.selectedLegend=0;for(var w=!1,T={},M=!1,D=this.parent.dataSourceSettings.valueSortSettings.headerDelimiter,O=0,P=this.dataSourceSettings.values;O<P.length;O++){var N=P[O];T[o=N.name]=N.caption?N.caption:o,T[N.caption?N.caption:o]=o}if("olap"===this.parent.dataType){var E=[];S=this.groupHierarchyWithLevels(s,E),y=E[E.length-1],x=b=this.measurePos===E.length-1&&E.length>1?E[E.length-2]:y}for(var F=0,I=u;F<I.length;F++){var L=I[F],A=Number(L);if(!t.isNullOrUndefined(s[A])){var R=s[A][0],k=R&&R.valueSort&&!t.isNullOrUndefined(R.valueSort.levelName)?R.valueSort.levelName.toString().split(D):void 0;if(M=!1,k&&"Grand Total"!==k[0]&&((a.enableMultipleAxis&&this.accumulationType.indexOf(a.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type||k.indexOf(T[this.currentMeasure])>-1)&&(M=!0),!M)){for(var j=0,q=k;j<q.length;j++)if(T[Q=q[j]]){M=!0;break}M=!M}if(R&&"row"===R.axis&&(0===this.dataSourceSettings.rows.length||"grand sum"!==R.type&&M)){var H=s[A][0];if(H.isSum)continue;var V="olap"===this.parent.dataType?this.engineModule.tupRowInfo[H.ordinal]:void 0,U=-1,_=H.level;"olap"===this.parent.dataType?(w="[Measures]"===H.hierarchy?w:this.isAttributeDrill(H.hierarchy,V.drillInfo),x=x===b?b:"[Measures]"===H.hierarchy||H.isNamedSet||this.engineModule.fieldList[H.hierarchy]&&!this.engineModule.fieldList[H.hierarchy].hasAllMember?b:x,U=V.drillInfo.length-1,3===H.memberType||V.measureName&&V.measureName!==this.dataSourceSettings.values[0].name||(c=0===(g=(d=void 0===d?H.levelUniqueName:d)===H.levelUniqueName?0:g)?{}:c,g=p&&d!==H.levelUniqueName?p.hierarchy===H.hierarchy?g+(H.level-p.level):t.isNullOrUndefined(c[H.levelUniqueName])?S[H.hierarchy].start:c[H.levelUniqueName]:g,c[H.levelUniqueName]=g,_=g,m+=!p||x!==p.hierarchy||p.isDrilled&&p.hasChild?0:1,x=w?H.hierarchy:b,l=g,p=H)):"value"!==H.type&&(void 0===l||l<_||m++,l=_),this.maxLevel=_>this.maxLevel?_:this.maxLevel;var B="olap"===this.parent.dataType?H.formattedText:H.actualText?H.actualText.toString():H.formattedText.toString(),G=this.engineModule.fieldList[this.currentMeasure],z=0===this.parent.dataSourceSettings.rows.length?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(G.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+(t.isNullOrUndefined(G.caption)?G.name:G.caption):H.formattedText?H.formattedText.toString():B,W=H.hasChild&&!H.isNamedSet?(H.isDrilled?" - ":" + ")+z:z,Q=V?V.uNameCollection:H.valueSort.levelName.toString(),Y={name:B,text:W,hasChild:H.hasChild,isDrilled:H.isDrilled,levelName:Q,level:_,fieldName:H.valueSort.axis?H.valueSort.axis.toString():"",rowIndex:A,colIndex:0,cell:H};("olap"===this.parent.dataType?3!==H.memberType:"value"!==H.type)&&(this.headerColl[m]?this.headerColl[m][_]=Y:(this.headerColl[m]={},this.headerColl[m][_]=Y));var K=s[A],X=Object.keys(K),J=void 0;if("olap"===this.parent.dataType)v=3!==H.memberType?H:v;else if(v="value"!==H.type?H:v,"value"!==H.type)v=H;else{var Z=H&&H.valueSort&&H.valueSort.levelName&&H.valueSort.levelName.toString().split(D),$=void 0;if(Z&&Z.length>0&&(Z.splice(Z.length-1,1),$=Z.join(D)),this.parent.dataSourceSettings.valueIndex<=0||this.engineModule.valueAxis&&this.dataSourceSettings.rows.length===this.engineModule.measureIndex||t.isNullOrUndefined(v.valueSort)||$===v.valueSort.levelName)v=v;else for(var ee=A;ee>-1;)s[ee]&&s[ee][0]&&s[ee][0].valueSort&&s[ee][0].valueSort.levelName===$&&(v=s[ee][0],ee=0),ee--}for(var te=0,ie=X;te<ie.length;te++){var ae=ie[te],re=Number(ae),ne=s[A][re],oe=!t.isNullOrUndefined(ne.rowHeaders)||0===this.dataSourceSettings.rows.length,se="olap"===this.parent.dataType&&V&&V.measureName?V.measureName:ne.actualText;if(("olap"!==this.parent.dataType||!ne.isGrandSum)&&!h[ne.colIndex]&&"value"===ne.axis&&"header"!==H.type&&""!==se&&(a.enableMultipleAxis&&this.accumulationType.indexOf(a.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type||se===this.currentMeasure)){if(t.isNullOrUndefined(H.members)&&(H.members=[]),"olap"===this.parent.dataType?y!==H.hierarchy&&!w||(3===H.memberType&&J?U!==this.measurePos||J.isDrilled&&J.hasChild:H.isDrilled&&H.hasChild):("value"===H.type&&J?!t.isNullOrUndefined(J.members)&&J.hasChild&&J.isDrilled:H.hasChild&&H.isDrilled)||!oe)break;if("olap"===this.parent.dataType&&!0===ne.isSum&&"row"===this.parent.dataSourceSettings.valueAxis)continue;var le="";if("olap"===this.parent.dataType)le=ne.columnHeaders.toString().split(/~~|::/).join(" - ");else{var de=ne.columnHeaders.toString().split(D);le=f.formatChartHeaders(de,this,!0)}var pe="";if("olap"===this.parent.dataType)pe=ne.rowHeaders.toString().split(/~~|::/).join(" - ");else{var he=ne.rowHeaders.toString().split(D);pe=f.formatChartHeaders(he,this,!1)}var ue=le+" | "+se;this.chartSeriesInfo[le]={uniqueName:le,caption:ne.hierarchyName&&ne.hierarchyName.toString().split(D).join(" - "),colorIndex:[]},this.chartSeriesInfo[this.chartSeriesInfo[le].caption]=this.chartSeriesInfo[le];var ce="pivot"===this.parent.dataType&&this.engineModule.aggregatedValueMatrix[A]&&!t.isNullOrUndefined(this.engineModule.aggregatedValueMatrix[A][re])?Number(this.engineModule.aggregatedValueMatrix[A][re]):t.isNullOrUndefined(ne.value)?ne.value:Number(ne.value);0===(ce=ce===1/0?null:ce)&&(this.accEmptyPoint=!0),this.columnGroupObject[ue]?this.columnGroupObject[ue].push({x:0===this.dataSourceSettings.rows.length?H.formattedText:pe,y:ce,rIndex:A,cIndex:re}):this.columnGroupObject[ue]=[{x:0===this.dataSourceSettings.rows.length?H.formattedText:pe,y:ce,rIndex:A,cIndex:re}]}J=v}}}}this.refreshChart()},e.prototype.refreshChart=function(){this.chartSeries=[];var e=0,i={},a=Object.keys(this.columnGroupObject);this.persistSettings=JSON.parse(this.parent.getChartSettings()).chartSettings;for(var r=this.persistSettings.palettes&&this.persistSettings.palettes.length>0?this.persistSettings.palettes:u.getSeriesColor(this.chartSettings.theme),n=this.parent.chartSettings.columnDelimiter?this.parent.chartSettings.columnDelimiter:"-",o=this.parent.chartSettings.columnHeader&&""!==this.parent.chartSettings.columnHeader?this.parent.chartSettings.columnHeader.split(n).join(" - "):"",s=this.chartSettings.chartSeries?this.chartSettings.chartSeries.type:void 0,l={},d=0;d<this.parent.dataSourceSettings.values.length;d++)l[this.parent.dataSourceSettings.values[d].name]=t.isNullOrUndefined(this.parent.dataSourceSettings.values[d].caption)?void 0:this.parent.dataSourceSettings.values[d].caption;if(this.accumulationType.indexOf(s)>-1&&a.length>0){this.currentColumn=a.indexOf(o+" | "+this.currentMeasure)>-1&&void 0!==o?o+" | "+this.currentMeasure:a[0];g={};g=this.persistSettings.chartSeries?this.frameChartSeries(this.persistSettings.chartSeries):g,(t.isNullOrUndefined(g.palettes)||0===g.palettes.length)&&!t.isNullOrUndefined(this.persistSettings.palettes)&&this.persistSettings.palettes.length>0&&(g.palettes=this.persistSettings.palettes),g.dataSource=this.columnGroupObject[this.currentColumn],g.xName="x",g.yName="y",this.persistSettings.chartSeries&&this.persistSettings.chartSeries.dataLabel?(g.dataLabel=this.persistSettings.chartSeries.dataLabel,g.dataLabel.name="x"):(g.dataLabel={visible:!0,position:"Outside",name:"x"},this.parent.setProperties({chartSettings:{chartSeries:{dataLabel:{visible:!0,position:"Outside"}}}},!0)),this.accEmptyPoint&&g.emptyPointSettings?g.emptyPointSettings.mode="Zero":this.accEmptyPoint&&(g.emptyPointSettings={mode:"Zero"}),g.name=this.currentColumn,"Doughnut"===s?(g.type="Pie",g.innerRadius=this.chartSettings.chartSeries.innerRadius?this.chartSettings.chartSeries.innerRadius:"40%"):"Pie"===s&&(g.innerRadius=this.chartSettings.chartSeries.innerRadius?this.chartSettings.chartSeries.innerRadius:"0"),this.chartSeries=this.chartSeries.concat(g)}else for(var p=0,h=a;p<h.length;p++){var c=h[p],g={};g=this.persistSettings.chartSeries?this.frameChartSeries(this.persistSettings.chartSeries):g,!t.isNullOrUndefined(g.palettes)&&g.palettes.length>0&&(t.isNullOrUndefined(this.persistSettings.palettes)||0===this.persistSettings.palettes.length)&&(this.chartSettings.palettes=g.palettes);for(d=0;d<this.columnGroupObject[c].length;d++){var m=this.engineModule.fieldList[this.currentMeasure];this.columnGroupObject[c][d].x=0!==this.parent.dataSourceSettings.rows.length||this.chartSettings.showMultiLevelLabels?""===this.columnGroupObject[c][d].x?this.parent.localeObj.getConstant("blank"):this.columnGroupObject[c][d].x:this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(m.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+(t.isNullOrUndefined(m.caption)?m.name:m.caption)}g.dataSource=this.columnGroupObject[c],g.xName="x",g.yName="y",g.visible=!0;for(var f=void 0,v=void 0,S=void 0,d=0,y=c.split(" | ");d<y.length;d++)this.measuresNames&&this.measuresNames[y[d]]&&(v=y[d],S=c.split(" | "+v)[0]);if(this.chartSettings.enableMultipleAxis){var b=v;f=S+" | "+(b=t.isNullOrUndefined(l[b])?b:l[b])}if(g.name=this.chartSettings.enableMultipleAxis?f:S,this.chartSettings.showPointColorByMembers&&this.chartSettings.enableMultipleAxis){g.name=S;var x=this.chartSeriesInfo[g.name].caption;g.name=void 0!==x&&null!==x?x:g.name,i[g.name]?(g.fill=i[g.name].color,this.chartSeriesInfo[g.name].colorIndex.push(this.selectedLegend++),g.name=void 0):(e=r[e]?e:0,i[g.name]={name:g.name,color:r[e]},g.fill=r[e++],this.chartSeriesInfo[g.name].colorIndex.push(this.selectedLegend++))}if(["Radar","Polar"].indexOf(s)<0){var w=v;g.tooltipMappingName=this.measuresNames[w],g.yAxisName=this.chartSettings.enableMultipleAxis&&"Combined"===this.chartSettings.multipleAxisMode?this.measureList.join("_"):this.measuresNames[w]?this.measuresNames[w]:w}this.persistSettings.chartSeries&&this.persistSettings.chartSeries.emptyPointSettings&&(g.emptyPointSettings=this.persistSettings.chartSeries.emptyPointSettings),g.emptyPointSettings||(g.emptyPointSettings={mode:"Zero"}),this.chartSeries=this.chartSeries.concat(g)}var T={series:this.chartSeries,cancel:!1},M=this;this.parent.trigger("chartSeriesCreated",T,function(e){e.cancel?(M.element&&t.remove(M.element),M.parent.notify(C,{})):M.bindChart()})},e.prototype.frameObjectWithKeys=function(e){for(var t=Object.keys(e),i=0,a={};i<t.length;)a[t[i]]=e[t[i]],i++;return a},e.prototype.frameChartSeries=function(e){for(var t=Object.keys(e),i=0,a={};i<t.length;)this.accumulationType.indexOf(this.parent.chartSettings.chartSeries.type)>-1&&["fill","dashArray","width","segmentAxis","drawType","isClosed","segments","stackingGroup","marker","errorBar","trendlines","minRadius","splineType","maxRadius","cardinalSplineTension","columnWidth","columnSpacing","cornerRadius"].indexOf(t[i])>-1||this.accumulationType.indexOf(this.parent.chartSettings.chartSeries.type)<0&&["endAngle","explode","explodeAll","explodeIndex","explodeOffset","gapRatio","groupMode","groupTo","neckHeight","neckWidth","pyramidMode","startAngle","dataLabel","innerRadius"].indexOf(t[i])>-1?i++:(a[t[i]]=e[t[i]],i++);return a},e.prototype.bindChart=function(){this.parent.showWaitingPopup();var e=this.configXAxis(),i=this.configTooltipSettings(),a=this.configLegendSettings(),n=this.configZoomSettings(),o=this.frameAxesWithRows(),s=this.chartSettings.chartSeries.type;"Both"===this.parent.displayOption.view?this.element="Chart"===this.parent.displayOption.primary?this.parent.element.insertBefore(this.element?this.element:t.createElement("div",{className:W,id:this.parent.element.id+"_chart"}),this.parent.element.querySelector(".e-grid")):this.parent.element.appendChild(this.element?this.element:t.createElement("div",{className:W,id:this.parent.element.id+"_chart"})):this.element||(this.element=this.parent.element.appendChild(t.createElement("div",{className:W,id:this.parent.element.id+"_chart"}))),!this.chartElement&&this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&"Pareto"!==this.chartSettings.chartSeries.type&&(this.parent.element.querySelector("."+W).innerHTML="",this.chartElement=this.parent.element.querySelector("."+W).appendChild(t.createElement("div",{className:"e-pivotchart-inner",id:this.parent.element.id+"_chartInner"}))),this.parent.element.querySelector(".e-pivotchart-inner")&&(this.parent.element.querySelector(".e-pivotchart-inner").innerHTML=""),this.parent.showGroupingBar?this.element.style.minWidth="400px !important":this.element.style.minWidth="310px !important";var l=this.parent.width.toString();this.parent.showToolbar&&this.parent.grid&&(l=this.parent.getGridWidthAsNumber().toString());var d=this.getChartHeight();this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&this.accumulationType.indexOf(s)<0&&"Pareto"!==this.chartSettings.chartSeries.type&&(this.parent.element.querySelector("."+W).style.height=("auto"===d?this.getChartAutoHeight():d)+"px",this.parent.element.querySelector("."+W).style.width=l+"px","Polar"!==this.parent.chartSettings.chartSeries.type&&"Radar"!==this.parent.chartSettings.chartSeries.type&&(this.parent.element.querySelector("."+W).style.overflow="auto",this.parent.element.querySelector("."+W).style.overflowX="hidden")),this.parent.chart&&("accumulationchart"===this.parent.chart.getModuleName()&&this.accumulationType.indexOf(s)<0||"chart"===this.parent.chart.getModuleName()&&this.accumulationType.indexOf(s)>-1&&"Pareto"!==this.chartSettings.chartSeries.type)&&(this.parent.chart.destroy(),t.select("#"+this.parent.element.id+"_chart",this.parent.element)&&(t.select("#"+this.parent.element.id+"_chart",this.parent.element).innerHTML="",t.select("#"+this.parent.element.id+"_chart",this.parent.element).appendChild(t.createElement("div",{className:"e-pivotchart-inner",id:this.parent.element.id+"_chartInner"})))),!(this.parent.chart&&this.parent.chart.element&&this.parent.element.querySelector(".e-chart")||this.parent.element.querySelector(".e-accumulationchart"))||this.parent.toolbarModule&&this.parent.toolbarModule.isMultiAxisChange?(this.parent.toolbarModule&&this.parent.toolbarModule.isMultiAxisChange&&this.parent.chart&&(this.parent.chart.isDestroyed||this.parent.chart.destroy(),this.parent.chart=void 0,t.select("#"+this.parent.element.id+"_chart",this.parent.element).innerHTML="",t.select("#"+this.parent.element.id+"_chart",this.parent.element).appendChild(t.createElement("div",{className:"e-pivotchart-inner",id:this.parent.element.id+"_chartInner"})),this.parent.toolbarModule.isMultiAxisChange=!1),u.Chart.Inject(u.ColumnSeries,u.StackingColumnSeries,u.RangeColumnSeries,u.BarSeries,u.StackingBarSeries,u.ScatterSeries,u.BubbleSeries,u.LineSeries,u.StepLineSeries,u.SplineSeries,u.SplineAreaSeries,u.MultiColoredLineSeries,u.PolarSeries,u.RadarSeries,u.AreaSeries,u.RangeAreaSeries,u.StackingAreaSeries,u.StepAreaSeries,u.StackingLineSeries,u.MultiColoredAreaSeries,u.ParetoSeries,u.Legend,u.Tooltip,u.Category,u.MultiLevelLabel,u.ScrollBar,u.Zoom,u.Export,u.Crosshair,u.Selection,u.StripLine,u.DataLabel),u.AccumulationChart.Inject(u.PieSeries,u.FunnelSeries,u.PyramidSeries,u.AccumulationDataLabel,u.AccumulationLegend,u.AccumulationTooltip,u.Export),this.accumulationType.indexOf(s)>-1?this.parent.chart=new u.AccumulationChart({series:this.chartSeries.length>0?this.chartSeries:[{}],legendSettings:a,tooltip:i,width:l,height:d.toString(),title:this.chartSettings.title,enableSmartLabels:this.chartSettings.enableSmartLabels,center:this.chartSettings.pieCenter,enableBorderOnMouseMove:this.chartSettings.enableBorderOnMouseMove,highlightMode:this.chartSettings.highlightMode,highlightPattern:this.chartSettings.highlightPattern,titleStyle:this.chartSettings.titleStyle,subTitle:this.chartSettings.subTitle,subTitleStyle:this.chartSettings.subTitleStyle,margin:this.chartSettings.margin,border:this.chartSettings.border,background:this.chartSettings.background,theme:this.chartSettings.theme,selectionMode:this.chartSettings.accumulationSelectionMode,isMultiSelect:this.chartSettings.isMultiSelect,enableExport:this.parent.allowPdfExport,selectedDataIndexes:this.chartSettings.selectedDataIndexes,enableAnimation:this.chartSettings.enableAnimation,useGroupingSeparator:this.chartSettings.useGroupingSeparator,locale:this.parent.locale,enableRtl:this.parent.enableRtl,beforePrint:this.beforePrint.bind(this),animationComplete:this.animationComplete.bind(this),legendRender:this.legendRender.bind(this),textRender:this.textRender.bind(this),pointRender:this.pointRender.bind(this),seriesRender:this.seriesRender.bind(this),chartMouseMove:this.chartMouseMove.bind(this),chartMouseClick:this.chartMouseClick.bind(this),pointMove:this.pointMove.bind(this),pointClick:this.pointClick.bind(this),chartMouseLeave:this.chartMouseLeave.bind(this),chartMouseDown:this.chartMouseDown.bind(this),chartMouseUp:this.chartMouseUp.bind(this),tooltipRender:this.tooltipRender.bind(this),loaded:this.loaded.bind(this),load:this.load.bind(this),resized:this.resized.bind(this)}):this.parent.chart=new u.Chart({series:this.chartSeries.length>0?this.chartSeries:[{}],legendSettings:a,tooltip:i,zoomSettings:n,axes:"Polar"===s||"Radar"===s?[]:o.axes,rows:"Polar"===s||"Radar"===s?[{}]:"Bar"===s||"StackingBar"===s||"StackingBar100"===s||"Pareto"===s&&this.chartSettings.enableMultipleAxis?[{height:"100%"}]:o.rows,columns:"Polar"===s||"Radar"===s?[{}]:"Bar"===s||"StackingBar"===s||"StackingBar100"===s&&this.chartSettings.enableMultipleAxis?o.columns:[{width:"100%"}],primaryYAxis:"Polar"===s||"Radar"===s?o.axes[0]:{visible:!1},primaryXAxis:e,width:l,height:"Polar"!==this.parent.chartSettings.chartSeries.type&&"Radar"!==this.parent.chartSettings.chartSeries.type&&this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&"Pareto"!==this.parent.chartSettings.chartSeries.type&&this.parent.dataSourceSettings.values.length>0?Number(d)>235*this.parent.dataSourceSettings.values.length+100?isNaN(Number(d))?d.toString():(Number(d)-5).toString():!isNaN(Number(d))||this.parent.dataSourceSettings.values.length>1?(235*this.parent.dataSourceSettings.values.length+100).toString():d.toString():d.toString(),title:this.chartSettings.title,titleStyle:this.chartSettings.titleStyle,subTitle:this.chartSettings.subTitle,subTitleStyle:this.chartSettings.subTitleStyle,margin:this.chartSettings.margin,border:this.chartSettings.border,background:this.chartSettings.background,chartArea:t.isNullOrUndefined(this.persistSettings.chartArea)?this.chartSettings.chartArea:this.persistSettings.chartArea,palettes:this.chartSettings.palettes,theme:this.chartSettings.theme,crosshair:this.chartSettings.crosshair,selectionMode:this.chartSettings.selectionMode,isMultiSelect:this.chartSettings.isMultiSelect,enableExport:this.parent.allowPdfExport,selectedDataIndexes:this.chartSettings.selectedDataIndexes,isTransposed:this.chartSettings.isTransposed,enableAnimation:this.chartSettings.enableAnimation,enableCanvas:this.chartSettings.enableCanvas,useGroupingSeparator:this.chartSettings.useGroupingSeparator,description:this.chartSettings.description,tabIndex:this.chartSettings.tabIndex,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableSideBySidePlacement:this.chartSettings.enableSideBySidePlacement,beforePrint:this.beforePrint.bind(this),animationComplete:this.animationComplete.bind(this),legendRender:this.legendRender.bind(this),textRender:this.textRender.bind(this),pointRender:this.pointRender.bind(this),seriesRender:this.seriesRender.bind(this),chartMouseMove:this.chartMouseMove.bind(this),chartMouseClick:this.chartMouseClick.bind(this),pointMove:this.pointMove.bind(this),pointClick:this.pointClick.bind(this),chartMouseLeave:this.chartMouseLeave.bind(this),chartMouseDown:this.chartMouseDown.bind(this),chartMouseUp:this.chartMouseUp.bind(this),dragComplete:this.dragComplete.bind(this),zoomComplete:this.zoomComplete.bind(this),scrollStart:this.scrollStart.bind(this),scrollEnd:this.scrollEnd.bind(this),scrollChanged:this.scrollChanged.bind(this),tooltipRender:this.tooltipRender.bind(this),legendClick:this.legendClick.bind(this),loaded:this.loaded.bind(this),load:this.load.bind(this),resized:this.resized.bind(this),axisLabelRender:this.axisLabelRender.bind(this),multiLevelLabelClick:this.multiLevelLabelClick.bind(this),axisMultiLabelRender:this.multiLevelLabelRender.bind(this)}),this.parent.chart.isStringTemplate=!0):(this.parent.chart.series=this.chartSeries,this.parent.chart.title=this.parent.chartSettings.title,this.parent.chart.subTitle=this.parent.chartSettings.subTitle,this.parent.chart.background=this.parent.chartSettings.background,this.parent.chart.theme=this.parent.chartSettings.theme,this.parent.chart.legendSettings=a,this.parent.chart.selectionMode=this.parent.chartSettings.selectionMode,this.parent.chart.enableExport=this.parent.allowPdfExport,this.parent.chart.isMultiSelect=this.parent.chartSettings.isMultiSelect,this.parent.chart.enableAnimation=this.parent.chartSettings.enableAnimation,this.parent.chart.useGroupingSeparator=this.parent.chartSettings.useGroupingSeparator,this.parent.chart.highlightPattern=this.parent.chartSettings.highlightPattern,this.accumulationType.indexOf(s)>-1?(this.parent.chart.enableBorderOnMouseMove=this.parent.chartSettings.enableBorderOnMouseMove,this.parent.chart.highlightMode=this.parent.chartSettings.highlightMode,this.parent.chart.enableSmartLabels=this.parent.chartSettings.enableSmartLabels):(this.parent.chart.palettes=this.parent.chartSettings.palettes,this.parent.chart.isTransposed=this.parent.chartSettings.isTransposed,this.parent.chart.enableSideBySidePlacement=this.parent.chartSettings.enableSideBySidePlacement,this.parent.chart.tabIndex=this.parent.chartSettings.tabIndex,this.parent.chart.description=this.parent.chartSettings.description,this.parent.chart.enableCanvas=this.parent.chartSettings.enableCanvas),"Polar"===s||"Radar"===s?(this.parent.chart.primaryXAxis=e,this.parent.chart.primaryYAxis.visible=!0,this.parent.chart.primaryYAxis=o.axes[0],this.parent.chart.axes=[],this.parent.chart.rows=[{}]):this.accumulationType.indexOf(s)<0&&"chart"===this.parent.chart.getModuleName()&&(this.parent.chart.primaryYAxis.visible=!1,this.parent.chart.primaryXAxis=e,this.parent.chart.axes=o.axes,"Bar"===s||"StackingBar"===s||"StackingBar100"===s&&this.chartSettings.enableMultipleAxis?(this.parent.chart.rows=[{height:"100%"}],this.parent.chart.columns=o.columns):"Pareto"===s&&this.chartSettings.enableMultipleAxis?(this.parent.chart.rows=[{height:"100%"}],this.parent.chart.columns=[{width:"100%"}]):(this.parent.chart.rows=o.rows,this.parent.chart.columns=[{width:"100%"}])),this.parent.chart.refresh(),this.accumulationType.indexOf(s)>-1&&"accumulationchart"===this.parent.chart.getModuleName()&&(0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length)&&(this.parent.hideWaitingPopup(),this.parent.pivotFieldListModule&&r.hideSpinner(this.parent.pivotFieldListModule.fieldListSpinnerElement))),this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis?this.parent.chart.appendTo(t.select("#"+this.parent.element.id+"_chartInner",this.parent.element)):this.parent.chart.appendTo(t.select("#"+this.parent.element.id+"_chart",this.parent.element))},e.prototype.legendClick=function(e){if(this.chartSettings.showPointColorByMembers&&this.chartSettings.enableMultipleAxis)for(var t=this.chartSeriesInfo[e.legendText].colorIndex,i=1;i<t.length;i++)e.chart.series[t[i]].visible=!e.chart.series[t[i]].visible;this.parent.trigger("chartLegendClick",e)},e.prototype.pointClick=function(e){var t=e.series.dataSource?e.series.dataSource:this.parent.chart.series[e.seriesIndex].dataSource;if((["Pie","Funnel","Doughnut","Pyramid","Radar","Polar"].indexOf(this.parent.chartSettings.chartSeries.type)>-1||!this.parent.chartSettings.showMultiLevelLabels)&&("olap"===this.parent.dataType||this.parent.dataSourceSettings.rows.length>1)){this.pivotIndex={rIndex:t?t[e.pointIndex].rIndex:void 0,cIndex:t?t[e.pointIndex].cIndex:void 0},this.creatMenu();var i=this.parent.element.getBoundingClientRect(),a=(this.parent.element.querySelector(".e-pivot-toolbar")?this.parent.element.querySelector(".e-pivot-toolbar").clientHeight:0)+(this.parent.element.querySelector(".e-chart-grouping-bar")?this.parent.element.querySelector(".e-chart-grouping-bar").clientHeight:0)+(window.scrollY||document.documentElement.scrollTop)+i.top;this.accumulationMenu.open(a+e.y,e.x+i.left+(window.scrollX||document.documentElement.scrollLeft))}else if((this.parent.allowDrillThrough||this.parent.editSettings.allowEditing)&&this.parent.drillThroughModule){var r=t[e.pointIndex].rIndex,n=t[e.pointIndex].cIndex;this.parent.drillThroughModule.executeDrillThrough(this.parent.pivotValues[r][n],r,n)}this.parent.trigger("chartPointClick",e)},e.prototype.frameAxesWithRows=function(){var e=[],i=[],a=[],r=[],n=this.persistSettings.chartSeries&&("StackingColumn100"===this.persistSettings.chartSeries.type||"StackingBar100"===this.persistSettings.chartSeries.type||"StackingArea100"===this.persistSettings.chartSeries.type||"StackingLine100"===this.persistSettings.chartSeries.type),o=["PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfDifferenceFrom","PercentageOfParentRowTotal","PercentageOfParentColumnTotal","PercentageOfParentTotal"];if(this.chartSettings.enableMultipleAxis)for(var s=0,l=100/this.dataSourceSettings.values.length+"%",d=0,p=this.dataSourceSettings.values;d<p.length;d++){var h=p[d],u=this.engineModule.fieldList[h.name],c=("olap"===this.parent.dataType?"":this.parent.localeObj.getConstant(u.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" ")+u.caption;r.push(c);for(var g=void 0,m=0,v=this.dataSourceSettings.formatSettings;m<v.length;m++){var S=v[m];if(S.name===h.name){g=S;break}}var y=-1!==f.inArray(u.aggregateType,o)?"P2":g?null===g.format.toLowerCase().match(/n|p|c/)?"N":g.format:"olap"===this.parent.dataType?this.getFormat(u.formatString):"N",b="Polar"===this.chartSettings.chartSeries.type||"Radar"===this.chartSettings.chartSeries.type,C={};(C=this.persistSettings.primaryYAxis?this.frameObjectWithKeys(this.persistSettings.primaryYAxis):C).labelFormat=C.labelFormat?C.labelFormat:n?"":b?"N":y,C.title="Combined"===this.chartSettings.multipleAxisMode?r.join(" - "):C.title?C.title:c,C.zoomFactor=t.isNullOrUndefined(this.chartSettings.primaryYAxis.zoomFactor)?1:this.chartSettings.primaryYAxis.zoomFactor,C.edgeLabelPlacement=this.chartSettings.primaryYAxis.edgeLabelPlacement?this.chartSettings.primaryYAxis.edgeLabelPlacement:this.persistSettings.primaryYAxis.edgeLabelPlacement,"Bar"===this.chartSettings.chartSeries.type||"StackingBar"===this.chartSettings.chartSeries.type||"StackingBar100"===this.chartSettings.chartSeries.type?C.plotOffsetRight=C.plotOffsetRight?C.plotOffsetRight:30:C.plotOffsetTop=C.plotOffsetTop?C.plotOffsetTop:30,b||(C.name="Combined"===this.chartSettings.multipleAxisMode?this.measureList.join("_"):this.measuresNames[h.name]?this.measuresNames[h.name]:h.name),e=e.concat(C),"Combined"===this.chartSettings.multipleAxisMode&&(e=[e[e.length-1]]),"Stacked"===this.chartSettings.multipleAxisMode?(C.rowIndex=s,C.columnIndex=s,i.push({height:l}),a.push({width:l})):(C.rowIndex=0,C.columnIndex=0,i=[{height:"100%"}],a=[{width:"100%"}]),s++}else{for(var u=this.engineModule.fieldList[this.currentMeasure],c=("olap"===this.parent.dataType?"":this.parent.localeObj.getConstant(u.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" ")+u.caption,g=void 0,x=0,w=this.dataSourceSettings.formatSettings;x<w.length;x++)if((h=w[x]).name===this.currentMeasure){g=h;break}var T=void 0;g&&(T=g.format.length);var C={},y=-1!==f.inArray(u.aggregateType,o)?"P2":g?null===g.format.toLowerCase().match(/n[0-10]|p[0-10]|c[0-10]/)||T>3?"N":g.format:"olap"===this.parent.dataType?this.getFormat(u.formatString):"N";(C=this.persistSettings.primaryYAxis?this.frameObjectWithKeys(this.persistSettings.primaryYAxis):C).zoomFactor=t.isNullOrUndefined(this.chartSettings.primaryYAxis.zoomFactor)?1:this.chartSettings.primaryYAxis.zoomFactor,C.rowIndex=0,C.columnIndex=0,C.edgeLabelPlacement=this.chartSettings.primaryYAxis.edgeLabelPlacement?this.chartSettings.primaryYAxis.edgeLabelPlacement:this.persistSettings.primaryYAxis.edgeLabelPlacement,"Polar"!==this.chartSettings.chartSeries.type&&"Radar"!==this.chartSettings.chartSeries.type&&(C.name=this.measuresNames[this.currentMeasure]?this.measuresNames[this.currentMeasure]:this.currentMeasure),C.labelFormat=C.labelFormat?C.labelFormat:n?"":y,C.title=C.title?C.title:c,e=e.concat(C),i.push({height:"100%"}),a.push({width:"100%"})}return{axes:e,rows:i,columns:a}},e.prototype.getFormat=function(e){return e="Currency"===e?"C":"Percent"===e?"P":"N"},e.prototype.getColumnTotalIndex=function(e){for(var i={},a=0,r=Object.keys(e);a<r.length;a++){var n=r[a],o=e[Number(n)],s=void 0;if(!t.isNullOrUndefined(o))for(var l=0,d=s=Object.keys(o);l<d.length;l++){var p=d[l],h=o[Number(p)];if(!t.isNullOrUndefined(h)){if("column"!==h.axis)return i;"sum"!==h.type&&(this.dataSourceSettings&&this.dataSourceSettings.columns&&0===this.dataSourceSettings.columns.length||"grand sum"!==h.type)||-1===h.rowSpan||(i[h.colIndex]=h.colIndex)}}}return i},e.prototype.groupHierarchyWithLevels=function(e,i){var a,r,n={},o=0,s={};this.measurePos=this.engineModule.tupRowInfo[0].measurePosition;for(var l=0;l<e.length;l++){var d=e[l][0];d&&"row"===d.axis&&"grand sum"!==d.type&&(t.isNullOrUndefined(n[d.hierarchy])?(3===d.memberType?o===this.measurePos?(i[this.measurePos]=d.hierarchy,n[d.hierarchy]=(a={},a[d.levelUniqueName]=d.levelUniqueName,a)):o--:(i[o]=d.hierarchy,n[d.hierarchy]=(r={},r[d.levelUniqueName]=d.levelUniqueName,r)),o++):n[d.hierarchy][d.levelUniqueName]=d.levelUniqueName)}for(var p=-1,h=0;h<i.length;h++)this.measurePos!==h&&(s[i[h]]={start:p+1,end:p+Object.keys(n[i[h]]).length},p=s[i[h]].end);return s},e.prototype.frameMultiLevelLabels=function(){for(var e=Object.keys(this.headerColl),t=this.headerColl[-.5],i=0,a=e;i<a.length;i++){for(var r=a[i],n=Number(r),o=this.headerColl[n],s=0,l=!1;s<=this.maxLevel;)l?o[s]||(o[s]={name:o[s-1].name,text:"",hasChild:o[s-1].hasChild,isDrilled:o[s-1].isDrilled,levelName:o[s-1].levelName,level:o[s-1].level,fieldName:o[s-1].fieldName,rowIndex:o[s-1].rowIndex,colIndex:o[s-1].colIndex,span:-1}):o[s]?l=!0:o[s]=t[s],s++;t=this.headerColl[n]}for(var d={},p=0,h=e;p<h.length;p++){for(var r=h[p],n=Number(r),o=this.headerColl[n],u=0,c=Object.keys(o);u<c.length;u++){var g=c[u],m=Number(g);if(d[m]){var f=d[m].length;o[m].levelName===t[m].levelName?d[m][f-1].end=d[m][f-1].end+1:d[m].push({start:n,end:n+1,text:o[m].text,type:-1===o[m].span?"WithoutTopandBottomBorder":"WithoutTopBorder",customAttributes:o[m]})}else d[m]=[{start:n,end:n+1,text:o[m].text,type:-1===o[m].span?"WithoutTopandBottomBorder":"WithoutTopBorder",customAttributes:o[m]}]}t=o}for(var v=[],S=Object.keys(d).length-1;S>-1;S--)v.push({categories:d[S],border:{width:1},overflow:"Trim"});return v},e.prototype.getZoomFactor=function(){this.calculatedWidth=this.getCalulatedWidth();var e=10*this.chartSeries.length>120?10*this.chartSeries.length:120,t=this.chartSeries.length>0?this.calculatedWidth/(Object.keys(this.chartSeries[0].dataSource).length*e):1;return t=t<1&&t>0?t:1},e.prototype.getCalulatedWidth=function(){return isNaN(Number(this.parent.width))?this.parent.width.indexOf("%")>-1?this.calculatedWidth=this.parent.element.clientWidth*(parseFloat(this.parent.width)/100):this.parent.width.indexOf("px")>-1?this.calculatedWidth=Number(this.parent.width.toString().split("px")[0]):this.calculatedWidth=this.parent.element.clientWidth:this.calculatedWidth=Number(this.parent.width),this.calculatedWidth},e.prototype.configTooltipSettings=function(){var e=this.persistSettings.tooltip?this.persistSettings.tooltip:this.chartSettings.tooltip;return e.enable=void 0===e.enable||e.enable,e.enable&&e.template&&(this.templateFn=this.parent.templateParser(e.template)),this.parent.tooltipTemplate&&(e.template=e.template?e.template:this.parent.tooltipTemplate),e.header=e.header?e.header:"",e.enableMarker=void 0===e.enableMarker||e.enableMarker,e},e.prototype.configLegendSettings=function(){var e={};if(this.chartSettings.legendSettings)for(var t=0,i=Object.keys(this.chartSettings.legendSettings);t<i.length;)e[i[t]]=this.chartSettings.legendSettings[i[t]],t++;return e.visible=!1!==e.visible,e.padding=e.padding?e.padding:25,e.shapePadding=e.shapePadding?e.shapePadding:10,e},e.prototype.configXAxis=function(){var e={};return e=this.persistSettings.primaryXAxis?this.frameObjectWithKeys(this.persistSettings.primaryXAxis):e,e.valueType="Category",e.labelIntersectAction=e.labelIntersectAction?e.labelIntersectAction:"Rotate45",e.title=e.title?e.title:this.dataSourceSettings.rows.map(function(e){return e.caption||e.name}).join(" / "),e.zoomFactor=t.isNullOrUndefined(this.parent.chartSettings.primaryXAxis.zoomFactor)?this.getZoomFactor():this.parent.chartSettings.primaryXAxis.zoomFactor,this.parent.chartSettings.zoomSettings.enableScrollbar||(e.zoomFactor=1),this.chartSettings.showMultiLevelLabels&&"Pareto"!==this.chartSettings.chartSeries.type?(e.multiLevelLabels=this.frameMultiLevelLabels(),e.border={width:1,type:"WithoutTopandBottomBorder"},e.majorTickLines={width:0,height:-10}):(e.multiLevelLabels=[],e.border={width:1,type:"Rectangle"},e.majorTickLines={width:0,height:5}),e},e.prototype.configZoomSettings=function(){var e=this.chartSettings.zoomSettings;return e.enableSelectionZooming=void 0===e.enableSelectionZooming||e.enableSelectionZooming,e.enableScrollbar=void 0===e.enableScrollbar||e.enableScrollbar,e},e.prototype.tooltipRender=function(e){var i=this.chartSettings.enableMultipleAxis&&"Combined"===this.chartSettings.multipleAxisMode&&this.accumulationType.indexOf(this.chartSettings.chartSeries.type)<0&&"Radar"!==this.chartSettings.chartSeries.type&&"Polar"!==this.chartSettings.chartSeries.type?e.series.tooltipMappingName:e.series.yAxisName?e.series.yAxisName.split("_CumulativeAxis")[0]:this.chartSettings.enableMultipleAxis&&this.accumulationType.indexOf(this.chartSettings.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type?e.series.name?e.series.name.split(" | ")[1]:e.data.seriesName?e.data.seriesName.split(" | ")[1]:this.currentMeasure:this.measuresNames[this.currentMeasure]?this.measuresNames[this.currentMeasure]:this.currentMeasure,a=e.series.dataSource?e.series.dataSource:this.parent.chart.series[e.data.seriesIndex].dataSource,r=a?a[e.data.pointIndex].rIndex:void 0,n=a?a[e.data.pointIndex].cIndex:void 0,o=this.engineModule.fieldList[this.measuresNames[i]?this.measuresNames[i]:i],s="olap"===this.parent.dataType?"":this.parent.localeObj.getConstant(o.aggregateType),l=("olap"===this.parent.dataType?"":s+" "+this.parent.localeObj.getConstant("of")+" ")+o.caption,d=this.engineModule.pivotValues[r][n].formattedText,p=this.engineModule.formatFields[o.id],h=this.engineModule.getFormattedValue(e.point.y,o.id,d),u=p&&p.format&&null!==p.format.toLowerCase().match(/n|p|c/)&&this.chartSettings.useGroupingSeparator?"olap"===this.parent.dataType?h.toString():h.formattedText:d,c=this.parent.pivotValues[r][n].columnHeaders,g="";if(t.isNullOrUndefined(c))g=void 0;else if("olap"===this.parent.dataType)g=this.chartSeriesInfo[c.toString().split(/~~|::/).join(" - ")].uniqueName;else{var m=c.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter);c=f.formatChartHeaders(m,this,!0),g=this.chartSeriesInfo[c.toString()].uniqueName}var v=e.point.x;if(this.parent.tooltipTemplate&&void 0!==this.parent.getTooltipTemplate()||this.chartSettings.tooltip.template){var S=a?this.parent.getHeaderField(r,n,"row"):"",y=a?this.parent.getHeaderField(r,n,"Column"):"",b={rowHeaders:v,columnHeaders:g,aggregateType:s,value:u,valueField:o.caption,rowFields:S,columnFields:y},C=void 0;C=this.parent.chartSettings&&this.parent.chartSettings.tooltip&&this.parent.chartSettings.tooltip.enable&&this.parent.chartSettings.tooltip.template?this.tooltipTemplateFn()(b,this,"tooltipTemplate",this.element.id+"1tooltipTemplate")[0].outerHTML:this.parent.getTooltipTemplate()(b,this,"tooltipTemplate",this.element.id+"tooltipTemplate")[0].outerHTML,e.template=C}else e.text=l+": "+u+(0===this.dataSourceSettings.columns.length?"":" <br/>"+this.parent.localeObj.getConstant("column")+": "+g)+(0===this.dataSourceSettings.rows.length?"":" <br/>"+this.parent.localeObj.getConstant("row")+": "+v)+(e.data&&"Pareto"===e.data.seriesName?" <br/>"+this.parent.localeObj.getConstant("pareto")+": "+e.data.pointY+"%":""),this.parent.trigger("chartTooltipRender",e)},e.prototype.tooltipTemplateFn=function(){return this.templateFn},e.prototype.loaded=function(e){this.parent.isChartLoaded=!0;var i=this.parent.grid?this.parent.getGridWidthAsNumber().toString():this.parent.getWidthAsNumber().toString();if(this.parent.chart&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.showFieldList&&"Chart"===this.parent.currentView&&this.parent.groupingBarModule.alignIcon(),this.chartSettings.showMultiLevelLabels){var a=f.inArray(this.chartSettings.chartSeries.type,["Bar","StackingBar","StackingBar100"])>-1?"_chartYAxisMultiLevelLabel0":"_chartXAxisMultiLevelLabel0";t.isNullOrUndefined(t.select("#"+this.parent.element.id+a,this.parent.element))||this.parent.element.querySelector("#"+this.parent.element.id+a).setAttribute("cursor","pointer")}var r=this.getChartHeight();this.parent.chart.height=r,this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&(["Pie","Funnel","Pyramid","Doughnut","Radar","Polar","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)>=0?this.parent.element.querySelector("."+W).style.overflow="visible":(this.parent.element.querySelector("."+W).style.overflow="auto",this.parent.element.querySelector("."+W).style.overflowX="hidden"),this.parent.element.querySelector("."+W).style.width=i+"px",this.parent.element.querySelector("."+W).style.height=r+"px"),this.updateView(),"Chart"!==this.parent.displayOption.primary&&"Chart"!==this.parent.displayOption.view||this.parent.notify(C,{}),this.parent.trigger("chartLoaded",e),("Server"===this.parent.dataSourceSettings.mode&&this.parent.isServerWaitingPopup||"Local"===this.parent.dataSourceSettings.mode)&&this.parent.hideWaitingPopup()},e.prototype.updateView=function(){if(this.parent.grid&&this.parent.chart&&this.parent.showToolbar){var e=this.parent.element.querySelector(".e-pivot-grouping-bar"),t=this.parent.element.querySelector(".e-chart-grouping-bar");"Table"===this.parent.currentView?(this.parent.grid.element.style.display="",this.parent.chart.element.style.display="none",this.parent.showGroupingBar&&this.parent.groupingBarModule&&(e&&(e.style.display="",e.querySelector(".e-all-fields-axis")&&null!=this.parent.groupingBarModule.gridPanel&&!this.parent.groupingBarModule.gridPanel.isDestroyed&&this.parent.groupingBarModule.gridPanel.refreshOverflow()),t&&(t.style.display="none")),this.parent.chartSettings.enableMultipleAxis&&this.parent.chartSettings.enableScrollOnMultiAxis&&(this.parent.element.querySelector(".e-pivotchart").style.display="none")):(this.parent.grid.element.style.display="none",this.parent.chart.element.style.display="",this.parent.showGroupingBar&&this.parent.groupingBarModule&&(e&&(e.style.display="none"),t&&(t.style.display="",t.querySelector(".e-all-fields-axis")&&null!=this.parent.groupingBarModule.chartPanel&&!this.parent.groupingBarModule.chartPanel.isDestroyed&&this.parent.groupingBarModule.chartPanel.refreshOverflow())),this.parent.chartSettings.enableMultipleAxis&&this.parent.chartSettings.enableScrollOnMultiAxis&&(this.parent.element.querySelector(".e-pivotchart").style.display=""))}},e.prototype.creatMenu=function(){this.accumulationMenu&&!this.accumulationMenu.isDestroyed&&this.accumulationMenu.destroy();for(var e=(this.parent.allowDrillThrough||this.parent.editSettings.allowEditing)&&this.parent.drillThroughModule?["expand","collapse","drillThrough","exit"]:["expand","collapse","exit"],i=[],a=0;a<e.length;a++)i.push({id:this.parent.element.id+"_DrillMenuChart_"+e[a],text:this.parent.localeObj.getConstant(e[a]),items:[]});for(var r=this.getMenuItems(),n=[],s=[],a=0;a<r.length;a++)"expand"===r[a].type?n.push({id:this.element.id+"drillExpand_"+r[a].key,text:r[a].value}):s.push({id:this.element.id+"drillCollapse_"+r[a].key,text:r[a].value});n.length>0&&(i[0].items=n),s.length>0&&(i[1].items=s);var l={cssClass:this.parent.element.id+"_accumulationChart"+(this.parent.cssClass?" "+this.parent.cssClass:""),items:i,enableRtl:this.parent.enableRtl,beforeOpen:this.drillMenuOpen.bind(this),select:this.drillMenuSelect.bind(this),locale:this.parent.locale};this.accumulationMenu=new o.ContextMenu(l);var d;t.select("#"+this.parent.element.id+"_accumulationChart",this.parent.element)?(d=t.select("#"+this.parent.element.id+"_accumulationChart",this.parent.element)).innerHTML="":(d=t.createElement("ul",{id:this.parent.element.id+"_accumulationChart"}),this.parent.element.appendChild(d)),this.accumulationMenu.isStringTemplate=!0,this.accumulationMenu.appendTo(d)},e.prototype.drillMenuOpen=function(e){e.items[0]&&e.items[0].text===this.parent.localeObj.getConstant("expand")&&e.items[0].items&&0===e.items[0].items.length&&this.accumulationMenu.enableItems([this.parent.localeObj.getConstant("expand")],!1),e.items[1]&&e.items[1].text===this.parent.localeObj.getConstant("collapse")&&e.items[1].items&&0===e.items[1].items.length&&this.accumulationMenu.enableItems([this.parent.localeObj.getConstant("collapse")],!1)},e.prototype.getMenuItems=function(){for(var e=this.pivotIndex.rIndex,t=[],i=this.engineModule.pivotValues,a=[],r=i[e][this.pivotIndex.cIndex],n=!i[e][0].isNamedSet&&i[e][0].hasChild?i[e][0].level:void 0,o="olap"===this.parent.dataType?r.rowHeaders.toString().split(/~~|::/):r.rowHeaders.toString().split(this.engineModule.valueSortSettings.headerDelimiter);i[e][0];){if(r=i[e][0],0!==o.length&&o.indexOf(r.formattedText.toString())===o.length-1){r.hasChild&&!r.isNamedSet&&a.indexOf(r.level)<0&&(n?n>=r.level:0!==n||0===r.level)&&(r.isDrilled&&r.hasChild?t.push({key:e,type:"collapse",value:r.formattedText}):t.push({key:e,type:"expand",value:r.formattedText}),a.push(r.level),n=n?n-1:r.level-1);var s=o.indexOf(r.formattedText.toString());o.splice(s,1)}0===r.level&&r.hasChild&&!r.isNamedSet&&(n=void 0,a=[]),e--}return t},e.prototype.drillMenuSelect=function(e){var t="olap"===this.parent.dataType?this.parent.olapEngineModule.pivotValues:this.parent.engineModule.pivotValues,i=e.element.id.split("_DrillMenuChart_")[1];if(0===e.element.id.indexOf(this.element.id+"drill")){var a=e.element.id.split(this.element.id+"drill")[1].indexOf("Expand")>=0?"drillExpand":"drillCollapse",r=Number(e.element.id.split(this.element.id+a+"_")[1]),n=t[r][0],o="olap"===this.parent.dataType?n.formattedText:n.actualText?n.actualText.toString():n.formattedText.toString(),s=n.formattedText?n.formattedText.toString():o,l=n.hasChild&&!n.isNamedSet?(n.isDrilled?" - ":" + ")+s:s,d="olap"===this.parent.dataType?this.engineModule.tupRowInfo[n.ordinal]:void 0,p=d?d.uNameCollection:n.valueSort.levelName.toString(),h={fieldName:n.valueSort.axis,level:n.level,hasChild:n.hasChild,levelName:p,name:o,text:l,rowIndex:r,colIndex:0,isDrilled:n.isDrilled,cell:n};"olap"===this.parent.dataType?this.parent.onDrill(void 0,h):this.onDrill({customAttributes:h})}else"drillThrough"===i?this.parent.drillThroughModule.executeDrillThrough(t[this.pivotIndex.rIndex][this.pivotIndex.cIndex],this.pivotIndex.rIndex,this.pivotIndex.rIndex):"exit"===i&&this.accumulationMenu.close()},e.prototype.getChartHeight=function(){var e,i;if(t.isNullOrUndefined(this.parent.getHeightAsNumber()))e="auto";else{var a=this.parent.showToolbar?6:5;e=(this.parent.getHeightAsNumber()-a).toString(),i=this.parent.getHeightAsNumber()-a}if(t.isNullOrUndefined(this.parent.getHeightAsNumber()))e="auto";else{var r=!1;null!==this.parent.element.querySelector(".e-chart-grouping-bar")&&"none"===this.parent.element.querySelector(".e-chart-grouping-bar").style.display.toLowerCase()&&(r=!0,this.parent.element.querySelector(".e-chart-grouping-bar").style.display="block"),this.parent.showToolbar&&this.parent.showGroupingBar?e=(i-(this.parent.element.querySelector(".e-pivot-toolbar")?this.parent.element.querySelector(".e-pivot-toolbar").clientHeight:42)-(this.parent.element.querySelector(".e-chart-grouping-bar")?this.parent.element.querySelector(".e-chart-grouping-bar").clientHeight:62)).toString():this.parent.showToolbar?e=(i-(this.parent.element.querySelector(".e-pivot-toolbar")?this.parent.element.querySelector(".e-pivot-toolbar").clientHeight:42)).toString():this.parent.showGroupingBar?e=(i-(this.parent.element.querySelector(".e-chart-grouping-bar")?this.parent.element.querySelector(".e-chart-grouping-bar").clientHeight:62)).toString():(this.parent.chart&&parseInt(this.parent.chart.height,10)<200||i<200)&&(e="200"),r&&(this.parent.element.querySelector(".e-chart-grouping-bar").style.display="none")}return e},e.prototype.getChartAutoHeight=function(){var e=this.parent.element.offsetHeight<this.parent.minHeight?this.parent.minHeight:this.parent.element.offsetHeight;return this.parent.showToolbar&&this.parent.showGroupingBar?e=e-(this.parent.element.querySelector(".e-pivot-toolbar")?this.parent.element.querySelector(".e-pivot-toolbar").clientHeight:42)-(this.parent.element.querySelector(".e-chart-grouping-bar")?this.parent.element.querySelector(".e-chart-grouping-bar").clientHeight:62):this.parent.showToolbar?e-=this.parent.element.querySelector(".e-pivot-toolbar")?this.parent.element.querySelector(".e-pivot-toolbar").clientHeight:42:this.parent.showGroupingBar&&(e-=this.parent.element.querySelector(".e-chart-grouping-bar")?this.parent.element.querySelector(".e-chart-grouping-bar").clientHeight:62),e},e.prototype.axisLabelRender=function(e){if(this.chartSettings.showMultiLevelLabels&&"Pareto"!==this.chartSettings.chartSeries.type&&"primaryXAxis"===e.axis.name&&(e.text=""),"primaryXAxis"!==e.axis.name){var t=this.engineModule.formatFields[this.chartSettings.enableMultipleAxis&&"Combined"===this.chartSettings.multipleAxisMode?this.currentMeasure:e.axis.name],i=this.engineModule.getFormattedValue(e.value,this.chartSettings.enableMultipleAxis&&"Combined"===this.chartSettings.multipleAxisMode?this.currentMeasure:e.axis.name,e.text),a=t&&t.format&&this.chartSettings.useGroupingSeparator?"olap"===this.parent.dataType?i.toString():i.formattedText:e.value.toString();e.text=a}this.parent.trigger("chartAxisLabelRender",e)},e.prototype.multiLevelLabelClick=function(e){var i={axis:e.axis,text:e.text,cell:t.isNullOrUndefined(e.customAttributes)?void 0:e.customAttributes.cell,cancel:!1};this.parent.trigger("multiLevelLabelClick",i),!i.cancel&&e.customAttributes&&e.customAttributes.hasChild&&!e.customAttributes.cell.isNamedSet&&("olap"===this.parent.dataType?this.parent.onDrill(void 0,e.customAttributes):this.onDrill(e))},e.prototype.onDrill=function(e){var t=e.customAttributes,i=this.dataSourceSettings.drilledMembers[0]&&this.dataSourceSettings.drilledMembers[0].delimiter?this.dataSourceSettings.drilledMembers[0].delimiter:"**",a=t.fieldName,r=this.engineModule.pivotValues[t.rowIndex][t.colIndex],n=r.valueSort.levelName.split(this.engineModule.valueSortSettings.headerDelimiter).join(i),o=!1;if(0===this.dataSourceSettings.drilledMembers.length)this.parent.setProperties({dataSourceSettings:{drilledMembers:[{name:a,items:[n],delimiter:i}]}},!0);else{for(var s=0;s<this.dataSourceSettings.drilledMembers.length;s++){var l=this.dataSourceSettings.drilledMembers[s];if(n=n.split(i).join(l.delimiter?l.delimiter:i),i=l.delimiter=l.delimiter?l.delimiter:i,l.name===a){o=!0;var d=l.items.indexOf(n);d>-1?l.items.splice(d,1):l.items.push(n)}}o||this.dataSourceSettings.drilledMembers.push({name:a,items:[n],delimiter:i})}this.parent.showWaitingPopup();var p=this,h={fieldName:a,memberName:n,delimiter:i,axis:"row",action:t.isDrilled?"up":"down",currentCell:r},u={drillInfo:h,pivotview:p.parent};p.parent.trigger("drill",u);var c={dataSourceSettings:f.getClonedDataSourceSettings(this.parent.dataSourceSettings)};this.parent.trigger("enginePopulating",c),this.parent.setProperties({dataSourceSettings:c.dataSourceSettings},!0),p.parent.enableVirtualization||p.parent.enablePaging?"Server"===p.parent.dataSourceSettings.mode?p.parent.getEngine("onDrill",h,null,null,null,null,null):(p.engineModule.drilledMembers=p.dataSourceSettings.drilledMembers,p.engineModule.onDrill(h)):"Server"===p.parent.dataSourceSettings.mode?p.parent.getEngine("onDrill",h,null,null,null,null,null):p.engineModule.generateGridData(p.dataSourceSettings,!0),p.parent.allowServerDataBinding=!1,p.parent.setProperties({pivotValues:p.engineModule.pivotValues},!0),p.parent.allowServerDataBinding=!0;var g={dataSourceSettings:f.getClonedDataSourceSettings(this.parent.dataSourceSettings),pivotValues:this.parent.pivotValues};this.parent.trigger("enginePopulated",g),p.engineModule.pivotValues=g.pivotValues,p.parent.renderPivotGrid()},e.prototype.isAttributeDrill=function(e,t){for(var i=!1,a=0;a<this.dataSourceSettings.drilledMembers.length;a++)if(this.dataSourceSettings.drilledMembers[a].name===e)for(var r=0;r<this.dataSourceSettings.drilledMembers[a].items.length;r++){for(var n=this.dataSourceSettings.drilledMembers[a].items[r].split(this.dataSourceSettings.drilledMembers[a].delimiter),o="",s=0;s<n.length;s++)t[s]&&t[s].uName&&(o=o+(""===o?"":this.dataSourceSettings.drilledMembers[a].delimiter)+(t[s].uName.indexOf("[Measures]")>-1?"[Measures]":t[s].uName));if(o===this.dataSourceSettings.drilledMembers[a].items[r]){i=!0;break}}return i},e.prototype.load=function(e){e.chart.zoomModule&&(e.chart.zoomModule.isZoomed=!0),this.parent.trigger("chartLoad",e)},e.prototype.beforePrint=function(e){this.parent.trigger("beforePrint",e)},e.prototype.animationComplete=function(e){this.parent.trigger("animationComplete",e)},e.prototype.legendRender=function(e){this.parent.trigger("legendRender",e)},e.prototype.textRender=function(e){this.parent.trigger("textRender",e)},e.prototype.pointRender=function(e){this.parent.trigger("pointRender",e)},e.prototype.seriesRender=function(e){this.parent.trigger("seriesRender",e)},e.prototype.chartMouseMove=function(e){this.parent.trigger("chartMouseMove",e)},e.prototype.chartMouseClick=function(e){this.parent.trigger("chartMouseClick",e)},e.prototype.pointMove=function(e){this.parent.trigger("pointMove",e)},e.prototype.chartMouseLeave=function(e){this.parent.trigger("chartMouseLeave",e)},e.prototype.chartMouseDown=function(e){this.parent.trigger("chartMouseDown",e)},e.prototype.chartMouseUp=function(e){this.parent.trigger("chartMouseUp",e)},e.prototype.dragComplete=function(e){this.parent.trigger("dragComplete",e)},e.prototype.zoomComplete=function(e){this.parent.trigger("zoomComplete",e)},e.prototype.scrollStart=function(e){this.parent.trigger("scrollStart",e)},e.prototype.scrollEnd=function(e){this.parent.trigger("scrollEnd",e)},e.prototype.scrollChanged=function(e){this.parent.trigger("scrollChanged",e)},e.prototype.multiLevelLabelRender=function(e){this.parent.trigger("multiLevelLabelRender",e)},e.prototype.resized=function(e){this.accumulationType.indexOf(this.chartSettings.chartSeries.type)<0&&(e.chart.primaryXAxis.zoomFactor=t.isNullOrUndefined(this.parent.chartSettings.primaryXAxis.zoomFactor)?this.getZoomFactor():this.parent.chartSettings.primaryXAxis.zoomFactor,this.parent.chartSettings.zoomSettings.enableScrollbar||(e.chart.primaryXAxis.zoomFactor=t.isNullOrUndefined(this.parent.chartSettings.primaryXAxis.zoomFactor)?1:this.parent.chartSettings.primaryXAxis.zoomFactor)),this.parent.trigger("chartResized",e)},e.prototype.getResizedChartHeight=function(){return["Pie","Funnel","Pyramid","Doughnut","Radar","Polar","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)<0&&this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&this.parent.dataSourceSettings.values.length>0?Number(this.parent.chart.height)>235*this.parent.dataSourceSettings.values.length+100?isNaN(Number(this.getChartHeight()))?this.getChartHeight().toString():(Number(this.getChartHeight())-5).toString():!isNaN(Number(this.getChartHeight()))||this.parent.dataSourceSettings.values.length>1?(235*this.parent.dataSourceSettings.values.length+100).toString():this.getChartHeight().toString():this.getChartHeight().toString()},e.prototype.destroy=function(){this.parent&&this.parent.isDestroyed||(this.engineModule&&!this.parent.destroyEngine&&(this.engineModule.fieldList={},this.engineModule={}),this.chartSeries&&(this.chartSeries=null),this.columnGroupObject&&(this.columnGroupObject=null),this.chartSeriesInfo&&(this.chartSeriesInfo={},this.selectedLegend=null),this.chartSettings&&(this.chartSettings=null),this.dataSourceSettings&&(this.dataSourceSettings=null),this.accumulationMenu&&!this.accumulationMenu.isDestroyed&&(this.accumulationMenu.destroy(),this.accumulationMenu=null),this.parent&&this.parent.chart&&!this.parent.chart.isDestroyed&&(this.parent.chart.destroy(),this.parent.chart=null))},e}(),Ie={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},Le={size:"14px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},Ae={size:"15px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},Re={size:"11px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},ke={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},je={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},qe={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},He={size:"12px",fontWeight:"Regular",color:"#353535",fontStyle:"Normal",fontFamily:"Segoe UI"},Ve={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},Ue=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function a(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),_e=function(e,t,i,a){var r,n=arguments.length,o=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},Be=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(!0)],i.prototype,"enable",void 0),_e([t.Property(1e3)],i.prototype,"duration",void 0),_e([t.Property(0)],i.prototype,"delay",void 0),i}(t.ChildProperty),Ge=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(null)],i.prototype,"value",void 0),_e([t.Property(null)],i.prototype,"color",void 0),_e([t.Property("0")],i.prototype,"dashArray",void 0),i}(t.ChildProperty),ze=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property("Normal")],i.prototype,"fontStyle",void 0),_e([t.Property("16px")],i.prototype,"size",void 0),_e([t.Property("Normal")],i.prototype,"fontWeight",void 0),_e([t.Property("")],i.prototype,"color",void 0),_e([t.Property("Center")],i.prototype,"textAlignment",void 0),_e([t.Property("Segoe UI")],i.prototype,"fontFamily",void 0),_e([t.Property(1)],i.prototype,"opacity",void 0),_e([t.Property("Trim")],i.prototype,"textOverflow",void 0),i}(t.ChildProperty),We=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(10)],i.prototype,"left",void 0),_e([t.Property(10)],i.prototype,"right",void 0),_e([t.Property(10)],i.prototype,"top",void 0),_e([t.Property(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),Qe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property("")],i.prototype,"color",void 0),_e([t.Property(1)],i.prototype,"width",void 0),i}(t.ChildProperty),Ye=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(0)],i.prototype,"x",void 0),_e([t.Property(0)],i.prototype,"y",void 0),i}(t.ChildProperty),Ke=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(0)],i.prototype,"series",void 0),_e([t.Property(0)],i.prototype,"point",void 0),i}(t.ChildProperty),Xe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Complex({},Qe)],i.prototype,"border",void 0),_e([t.Property("transparent")],i.prototype,"background",void 0),_e([t.Property(1)],i.prototype,"opacity",void 0),_e([t.Property(null)],i.prototype,"backgroundImage",void 0),i}(t.ChildProperty),Je=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(!1)],i.prototype,"enable",void 0),_e([t.Property("")],i.prototype,"dashArray",void 0),_e([t.Complex({color:null,width:1},Qe)],i.prototype,"line",void 0),_e([t.Property("Both")],i.prototype,"lineType",void 0),i}(t.ChildProperty),Ze=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(!1)],i.prototype,"visible",void 0),_e([t.Property(null)],i.prototype,"name",void 0),_e([t.Property("transparent")],i.prototype,"fill",void 0),_e([t.Property(1)],i.prototype,"opacity",void 0),_e([t.Property(0)],i.prototype,"angle",void 0),_e([t.Property(!1)],i.prototype,"enableRotation",void 0),_e([t.Property("Auto")],i.prototype,"position",void 0),_e([t.Property(5)],i.prototype,"rx",void 0),_e([t.Property(5)],i.prototype,"ry",void 0),_e([t.Property("Center")],i.prototype,"alignment",void 0),_e([t.Complex({width:null,color:null},Qe)],i.prototype,"border",void 0),_e([t.Complex({left:5,right:5,top:5,bottom:5},We)],i.prototype,"margin",void 0),_e([t.Complex({size:"11px",color:"",fontStyle:"Normal",fontWeight:"Normal",fontFamily:"Segoe UI"},ze)],i.prototype,"font",void 0),_e([t.Property(null)],i.prototype,"template",void 0),i}(t.ChildProperty),$e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property("Line")],i.prototype,"type",void 0),_e([t.Property(null)],i.prototype,"color",void 0),_e([t.Property(1)],i.prototype,"width",void 0),_e([t.Property(null)],i.prototype,"length",void 0),_e([t.Property("")],i.prototype,"dashArray",void 0),i}(t.ChildProperty),et=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(!0)],i.prototype,"visible",void 0),_e([t.Complex({width:null,color:null},Qe)],i.prototype,"border",void 0),_e([t.Complex({size:"11px",color:"",fontStyle:"Normal",fontWeight:"Normal",fontFamily:"Segoe UI"},ze)],i.prototype,"font",void 0),_e([t.Property("transparent")],i.prototype,"fill",void 0),_e([t.Property(0)],i.prototype,"angle",void 0),_e([t.Property(!1)],i.prototype,"enableRotation",void 0),_e([t.Property("Outside")],i.prototype,"position",void 0),_e([t.Property(5)],i.prototype,"rx",void 0),_e([t.Property(5)],i.prototype,"ry",void 0),_e([t.Property(null)],i.prototype,"template",void 0),_e([t.Complex({},$e)],i.prototype,"connectorStyle",void 0),i}(t.ChildProperty),tt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(!1)],i.prototype,"visible",void 0),_e([t.Property("Circle")],i.prototype,"shape",void 0),_e([t.Property("")],i.prototype,"imageUrl",void 0),_e([t.Property(5)],i.prototype,"width",void 0),_e([t.Property(5)],i.prototype,"height",void 0),_e([t.Complex({width:2,color:null},Qe)],i.prototype,"border",void 0),_e([t.Complex({x:0,y:0},Ye)],i.prototype,"offset",void 0),_e([t.Property(null)],i.prototype,"fill",void 0),_e([t.Property(1)],i.prototype,"opacity",void 0),_e([t.Complex({},Ze)],i.prototype,"dataLabel",void 0),i}(t.ChildProperty),it=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(1)],i.prototype,"width",void 0),_e([t.Property(10)],i.prototype,"length",void 0),_e([t.Property(null)],i.prototype,"color",void 0),_e([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),at=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(!1)],i.prototype,"visible",void 0),_e([t.Property("Fixed")],i.prototype,"type",void 0),_e([t.Property("Both")],i.prototype,"direction",void 0),_e([t.Property("Vertical")],i.prototype,"mode",void 0),_e([t.Property(1)],i.prototype,"verticalError",void 0),_e([t.Property(null)],i.prototype,"color",void 0),_e([t.Property(1)],i.prototype,"width",void 0),_e([t.Property(1)],i.prototype,"horizontalError",void 0),_e([t.Property(3)],i.prototype,"verticalNegativeError",void 0),_e([t.Property(3)],i.prototype,"verticalPositiveError",void 0),_e([t.Property(1)],i.prototype,"horizontalNegativeError",void 0),_e([t.Property(1)],i.prototype,"horizontalPositiveError",void 0),_e([t.Complex(null,it)],i.prototype,"errorBarCap",void 0),i}(t.ChildProperty),rt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property("")],i.prototype,"name",void 0),_e([t.Property("0")],i.prototype,"dashArray",void 0),_e([t.Property(!0)],i.prototype,"visible",void 0),_e([t.Property(2)],i.prototype,"period",void 0),_e([t.Property("Linear")],i.prototype,"type",void 0),_e([t.Property(0)],i.prototype,"backwardForecast",void 0),_e([t.Property(0)],i.prototype,"forwardForecast",void 0),_e([t.Property(2)],i.prototype,"polynomialOrder",void 0),_e([t.Complex({},tt)],i.prototype,"marker",void 0),_e([t.Property(!0)],i.prototype,"enableTooltip",void 0),_e([t.Complex({},Be)],i.prototype,"animation",void 0),_e([t.Property("")],i.prototype,"fill",void 0),_e([t.Property(1)],i.prototype,"width",void 0),_e([t.Property(null)],i.prototype,"intercept",void 0),_e([t.Property("SeriesType")],i.prototype,"legendShape",void 0),i}(t.ChildProperty),nt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(null)],i.prototype,"fill",void 0),_e([t.Complex({color:"transparent",width:0},Qe)],i.prototype,"border",void 0),_e([t.Property("Zero")],i.prototype,"mode",void 0),i}(t.ChildProperty),ot=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(0)],i.prototype,"topLeft",void 0),_e([t.Property(0)],i.prototype,"topRight",void 0),_e([t.Property(0)],i.prototype,"bottomLeft",void 0),_e([t.Property(0)],i.prototype,"bottomRight",void 0),i}(t.ChildProperty),st=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(!1)],i.prototype,"enable",void 0),_e([t.Property(null)],i.prototype,"fill",void 0),_e([t.Complex(ke,ze)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),lt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(!0)],i.prototype,"visible",void 0),_e([t.Property(!1)],i.prototype,"startFromAxis",void 0),_e([t.Property(null)],i.prototype,"start",void 0),_e([t.Property(null)],i.prototype,"end",void 0),_e([t.Property(null)],i.prototype,"size",void 0),_e([t.Property("#808080")],i.prototype,"color",void 0),_e([t.Property(null)],i.prototype,"dashArray",void 0),_e([t.Property("Auto")],i.prototype,"sizeType",void 0),_e([t.Property(!1)],i.prototype,"isRepeat",void 0),_e([t.Property(null)],i.prototype,"repeatEvery",void 0),_e([t.Property(null)],i.prototype,"repeatUntil",void 0),_e([t.Property(!1)],i.prototype,"isSegmented",void 0),_e([t.Property(null)],i.prototype,"segmentStart",void 0),_e([t.Property(null)],i.prototype,"segmentEnd",void 0),_e([t.Property(null)],i.prototype,"segmentAxisName",void 0),_e([t.Complex({color:"transparent",width:1},Qe)],i.prototype,"border",void 0),_e([t.Property("")],i.prototype,"text",void 0),_e([t.Property(null)],i.prototype,"rotation",void 0),_e([t.Property("Middle")],i.prototype,"horizontalAlignment",void 0),_e([t.Property("Middle")],i.prototype,"verticalAlignment",void 0),_e([t.Complex(He,ze)],i.prototype,"textStyle",void 0),_e([t.Property("Behind")],i.prototype,"zIndex",void 0),_e([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),dt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property("")],i.prototype,"color",void 0),_e([t.Property(1)],i.prototype,"width",void 0),_e([t.Property("Rectangle")],i.prototype,"type",void 0),i}(t.ChildProperty),pt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(1)],i.prototype,"width",void 0),_e([t.Property("")],i.prototype,"dashArray",void 0),_e([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),ht=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(.7)],i.prototype,"width",void 0),_e([t.Property("")],i.prototype,"dashArray",void 0),_e([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),ut=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(1)],i.prototype,"width",void 0),_e([t.Property("")],i.prototype,"dashArray",void 0),_e([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),ct=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(1)],i.prototype,"width",void 0),_e([t.Property(5)],i.prototype,"height",void 0),_e([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),gt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(.7)],i.prototype,"width",void 0),_e([t.Property(5)],i.prototype,"height",void 0),_e([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),mt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(0)],i.prototype,"x",void 0),_e([t.Property(0)],i.prototype,"y",void 0),i}(t.ChildProperty),ft=(function(){function e(){}_e([t.Property("")],e.prototype,"color",void 0),_e([t.Property(1)],e.prototype,"width",void 0)}(),function(){function e(){}_e([t.Property(!0)],e.prototype,"enable",void 0),_e([t.Property(1e3)],e.prototype,"duration",void 0),_e([t.Property(0)],e.prototype,"delay",void 0)}(),function(){function e(){}_e([t.Property(null)],e.prototype,"value",void 0),_e([t.Property(null)],e.prototype,"color",void 0),_e([t.Property("0")],e.prototype,"dashArray",void 0)}(),function(){function e(){}_e([t.Property(!1)],e.prototype,"visible",void 0),_e([t.Property("Circle")],e.prototype,"shape",void 0),_e([t.Property("")],e.prototype,"imageUrl",void 0),_e([t.Property(5)],e.prototype,"height",void 0),_e([t.Property(5)],e.prototype,"width",void 0),_e([t.Complex({width:2,color:null},Qe)],e.prototype,"border",void 0),_e([t.Property(null)],e.prototype,"fill",void 0),_e([t.Property(1)],e.prototype,"opacity",void 0),_e([t.Complex({},Ze)],e.prototype,"dataLabel",void 0)}(),function(){function e(){}_e([t.Property(!1)],e.prototype,"visible",void 0),_e([t.Property("Fixed")],e.prototype,"type",void 0),_e([t.Property("Both")],e.prototype,"direction",void 0),_e([t.Property("Vertical")],e.prototype,"mode",void 0),_e([t.Property(null)],e.prototype,"color",void 0),_e([t.Property(1)],e.prototype,"verticalError",void 0),_e([t.Property(1)],e.prototype,"width",void 0),_e([t.Property(1)],e.prototype,"horizontalError",void 0),_e([t.Property(3)],e.prototype,"verticalPositiveError",void 0),_e([t.Property(3)],e.prototype,"verticalNegativeError",void 0),_e([t.Property(1)],e.prototype,"horizontalPositiveError",void 0),_e([t.Property(1)],e.prototype,"horizontalNegativeError",void 0),_e([t.Complex(null,it)],e.prototype,"errorBarCap",void 0)}(),function(){function e(){}_e([t.Property("")],e.prototype,"name",void 0),_e([t.Property("Linear")],e.prototype,"type",void 0),_e([t.Property(2)],e.prototype,"period",void 0),_e([t.Property(2)],e.prototype,"polynomialOrder",void 0),_e([t.Property(0)],e.prototype,"backwardForecast",void 0),_e([t.Property(0)],e.prototype,"forwardForecast",void 0),_e([t.Complex({},Be)],e.prototype,"animation",void 0),_e([t.Complex({},tt)],e.prototype,"marker",void 0),_e([t.Property(!0)],e.prototype,"enableTooltip",void 0),_e([t.Property(null)],e.prototype,"intercept",void 0),_e([t.Property("")],e.prototype,"fill",void 0),_e([t.Property(1)],e.prototype,"width",void 0),_e([t.Property("SeriesType")],e.prototype,"legendShape",void 0)}(),function(){function e(){}_e([t.Property(null)],e.prototype,"fill",void 0),_e([t.Complex({color:"transparent",width:0},Qe)],e.prototype,"border",void 0),_e([t.Property("Zero")],e.prototype,"mode",void 0)}(),function(){function e(){}_e([t.Property(0)],e.prototype,"topLeft",void 0),_e([t.Property(0)],e.prototype,"topRight",void 0),_e([t.Property(0)],e.prototype,"bottomLeft",void 0),_e([t.Property(0)],e.prototype,"bottomRight",void 0)}(),function(){function e(){}_e([t.Property("Normal")],e.prototype,"fontStyle",void 0),_e([t.Property("16px")],e.prototype,"size",void 0),_e([t.Property("Normal")],e.prototype,"fontWeight",void 0),_e([t.Property("")],e.prototype,"color",void 0),_e([t.Property("Center")],e.prototype,"textAlignment",void 0),_e([t.Property("Segoe UI")],e.prototype,"fontFamily",void 0),_e([t.Property(1)],e.prototype,"opacity",void 0),_e([t.Property("Trim")],e.prototype,"textOverflow",void 0)}(),function(){function e(){}_e([t.Property(!1)],e.prototype,"enable",void 0),_e([t.Property(null)],e.prototype,"fill",void 0),_e([t.Complex(ke,ze)],e.prototype,"textStyle",void 0)}(),function(){function e(){}_e([t.Property(1)],e.prototype,"width",void 0),_e([t.Property(5)],e.prototype,"height",void 0),_e([t.Property(null)],e.prototype,"color",void 0)}(),function(){function e(){}_e([t.Property(1)],e.prototype,"width",void 0),_e([t.Property("")],e.prototype,"dashArray",void 0),_e([t.Property(null)],e.prototype,"color",void 0)}(),function(){function e(){}_e([t.Property(.7)],e.prototype,"width",void 0),_e([t.Property(5)],e.prototype,"height",void 0),_e([t.Property(null)],e.prototype,"color",void 0)}(),function(){function e(){}_e([t.Property(.7)],e.prototype,"width",void 0),_e([t.Property("")],e.prototype,"dashArray",void 0),_e([t.Property(null)],e.prototype,"color",void 0)}(),function(){function e(){}_e([t.Property(1)],e.prototype,"width",void 0),_e([t.Property("")],e.prototype,"dashArray",void 0),_e([t.Property(null)],e.prototype,"color",void 0)}(),function(){function e(){}_e([t.Property(!0)],e.prototype,"visible",void 0),_e([t.Property(!1)],e.prototype,"startFromAxis",void 0),_e([t.Property(null)],e.prototype,"start",void 0),_e([t.Property(null)],e.prototype,"end",void 0),_e([t.Property(null)],e.prototype,"size",void 0),_e([t.Property("#808080")],e.prototype,"color",void 0),_e([t.Property(null)],e.prototype,"dashArray",void 0),_e([t.Property("Auto")],e.prototype,"sizeType",void 0),_e([t.Property(!1)],e.prototype,"isRepeat",void 0),_e([t.Property(null)],e.prototype,"repeatEvery",void 0),_e([t.Property(null)],e.prototype,"repeatUntil",void 0),_e([t.Property(!1)],e.prototype,"isSegmented",void 0),_e([t.Property(null)],e.prototype,"segmentStart",void 0),_e([t.Property(null)],e.prototype,"segmentEnd",void 0),_e([t.Property(null)],e.prototype,"segmentAxisName",void 0),_e([t.Complex({color:"transparent",width:1},Qe)],e.prototype,"border",void 0),_e([t.Property("")],e.prototype,"text",void 0),_e([t.Property(null)],e.prototype,"rotation",void 0),_e([t.Property("Middle")],e.prototype,"horizontalAlignment",void 0),_e([t.Property("Middle")],e.prototype,"verticalAlignment",void 0),_e([t.Complex(He,ze)],e.prototype,"textStyle",void 0),_e([t.Property("Behind")],e.prototype,"zIndex",void 0),_e([t.Property(1)],e.prototype,"opacity",void 0)}(),function(){function e(){}_e([t.Property("")],e.prototype,"color",void 0),_e([t.Property(1)],e.prototype,"width",void 0),_e([t.Property("Rectangle")],e.prototype,"type",void 0)}(),function(){function e(){}_e([t.Complex({},Qe)],e.prototype,"border",void 0),_e([t.Property("transparent")],e.prototype,"background",void 0),_e([t.Property(1)],e.prototype,"opacity",void 0)}(),function(){function e(){}_e([t.Property(!1)],e.prototype,"enable",void 0),_e([t.Property("")],e.prototype,"dashArray",void 0),_e([t.Complex({color:null,width:1},Qe)],e.prototype,"line",void 0),_e([t.Property("Both")],e.prototype,"lineType",void 0)}(),function(){function e(){}_e([t.Property(!0)],e.prototype,"visible",void 0),_e([t.Property(null)],e.prototype,"height",void 0),_e([t.Property(null)],e.prototype,"width",void 0),_e([t.Complex({x:0,y:0},mt)],e.prototype,"location",void 0),_e([t.Property("Auto")],e.prototype,"position",void 0),_e([t.Property(8)],e.prototype,"padding",void 0),_e([t.Property("Center")],e.prototype,"alignment",void 0),_e([t.Complex(qe,ze)],e.prototype,"textStyle",void 0),_e([t.Property(10)],e.prototype,"shapeHeight",void 0),_e([t.Property(10)],e.prototype,"shapeWidth",void 0),_e([t.Complex({},Qe)],e.prototype,"border",void 0),_e([t.Complex({left:0,right:0,top:0,bottom:0},We)],e.prototype,"margin",void 0),_e([t.Property(5)],e.prototype,"shapePadding",void 0),_e([t.Property("transparent")],e.prototype,"background",void 0),_e([t.Property(1)],e.prototype,"opacity",void 0),_e([t.Property(!0)],e.prototype,"toggleVisibility",void 0),_e([t.Property(null)],e.prototype,"description",void 0),_e([t.Property(3)],e.prototype,"tabIndex",void 0)}(),function(){function e(){}_e([t.Property(0)],e.prototype,"series",void 0),_e([t.Property(0)],e.prototype,"point",void 0)}(),function(){function e(){}_e([t.Property(10)],e.prototype,"left",void 0),_e([t.Property(10)],e.prototype,"right",void 0),_e([t.Property(10)],e.prototype,"top",void 0),_e([t.Property(10)],e.prototype,"bottom",void 0)}(),function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(null)],i.prototype,"fill",void 0),_e([t.Property(null)],i.prototype,"endAngle",void 0),_e([t.Property(!1)],i.prototype,"explode",void 0),_e([t.Property(!1)],i.prototype,"explodeAll",void 0),_e([t.Property(null)],i.prototype,"explodeIndex",void 0),_e([t.Property(null)],i.prototype,"innerRadius",void 0),_e([t.Property("30%")],i.prototype,"explodeOffset",void 0),_e([t.Property(0)],i.prototype,"gapRatio",void 0),_e([t.Property("Value")],i.prototype,"groupMode",void 0),_e([t.Property(null)],i.prototype,"groupTo",void 0),_e([t.Property("20%")],i.prototype,"neckHeight",void 0),_e([t.Property("20%")],i.prototype,"neckWidth",void 0),_e([t.Property("Linear")],i.prototype,"pyramidMode",void 0),_e([t.Property([])],i.prototype,"palettes",void 0),_e([t.Property(0)],i.prototype,"startAngle",void 0),_e([t.Complex(null,Be)],i.prototype,"animation",void 0),_e([t.Complex(null,et)],i.prototype,"dataLabel",void 0),_e([t.Property("0")],i.prototype,"dashArray",void 0),_e([t.Property(1)],i.prototype,"width",void 0),_e([t.Property("X")],i.prototype,"segmentAxis",void 0),_e([t.Property("Line")],i.prototype,"drawType",void 0),_e([t.Property(!0)],i.prototype,"isClosed",void 0),_e([t.Collection([],Ge)],i.prototype,"segments",void 0),_e([t.Property("")],i.prototype,"stackingGroup",void 0),_e([t.Complex({color:"transparent",width:0},Qe)],i.prototype,"border",void 0),_e([t.Property(!0)],i.prototype,"visible",void 0),_e([t.Property(1)],i.prototype,"opacity",void 0),_e([t.Property("Line")],i.prototype,"type",void 0),_e([t.Complex(null,tt)],i.prototype,"marker",void 0),_e([t.Complex(null,at)],i.prototype,"errorBar",void 0),_e([t.Property(!0)],i.prototype,"enableTooltip",void 0),_e([t.Collection([],rt)],i.prototype,"trendlines",void 0),_e([t.Property("")],i.prototype,"tooltipMappingName",void 0),_e([t.Property("SeriesType")],i.prototype,"legendShape",void 0),_e([t.Property(1)],i.prototype,"minRadius",void 0),_e([t.Property(null)],i.prototype,"selectionStyle",void 0),_e([t.Property("Natural")],i.prototype,"splineType",void 0),_e([t.Property(3)],i.prototype,"maxRadius",void 0),_e([t.Property(.5)],i.prototype,"cardinalSplineTension",void 0),_e([t.Property(null)],i.prototype,"columnWidth",void 0),_e([t.Complex(null,nt)],i.prototype,"emptyPointSettings",void 0),_e([t.Complex(null,ot)],i.prototype,"cornerRadius",void 0),_e([t.Property(0)],i.prototype,"columnSpacing",void 0),i}(t.ChildProperty)),vt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property("Rotate45")],i.prototype,"labelIntersectAction",void 0),_e([t.Complex(Ie,ze)],i.prototype,"labelStyle",void 0),_e([t.Property("")],i.prototype,"title",void 0),_e([t.Property(null)],i.prototype,"zoomFactor",void 0),_e([t.Complex({},st)],i.prototype,"crosshairTooltip",void 0),_e([t.Property("")],i.prototype,"labelFormat",void 0),_e([t.Complex(Le,ze)],i.prototype,"titleStyle",void 0),_e([t.Property(!1)],i.prototype,"isIndexed",void 0),_e([t.Property(0)],i.prototype,"plotOffset",void 0),_e([t.Property("Shift")],i.prototype,"edgeLabelPlacement",void 0),_e([t.Property("BetweenTicks")],i.prototype,"labelPlacement",void 0),_e([t.Property("Outside")],i.prototype,"tickPosition",void 0),_e([t.Property(!1)],i.prototype,"opposedPosition",void 0),_e([t.Property(!0)],i.prototype,"visible",void 0),_e([t.Property("Outside")],i.prototype,"labelPosition",void 0),_e([t.Property(0)],i.prototype,"labelRotation",void 0),_e([t.Property(0)],i.prototype,"minorTicksPerInterval",void 0),_e([t.Property(null)],i.prototype,"maximum",void 0),_e([t.Property(null)],i.prototype,"minimum",void 0),_e([t.Property(34)],i.prototype,"maximumLabelWidth",void 0),_e([t.Property(null)],i.prototype,"interval",void 0),_e([t.Complex({},ct)],i.prototype,"majorTickLines",void 0),_e([t.Property(!1)],i.prototype,"enableTrim",void 0),_e([t.Complex({},pt)],i.prototype,"majorGridLines",void 0),_e([t.Complex({},gt)],i.prototype,"minorTickLines",void 0),_e([t.Complex({},ut)],i.prototype,"lineStyle",void 0),_e([t.Complex({},ht)],i.prototype,"minorGridLines",void 0),_e([t.Property(!1)],i.prototype,"isInversed",void 0),_e([t.Property(null)],i.prototype,"description",void 0),_e([t.Property(0)],i.prototype,"startAngle",void 0),_e([t.Property(100)],i.prototype,"coefficient",void 0),_e([t.Collection([],lt)],i.prototype,"stripLines",void 0),_e([t.Property(2)],i.prototype,"tabIndex",void 0),_e([t.Complex({color:null,width:0,type:"Rectangle"},dt)],i.prototype,"border",void 0),i}(t.ChildProperty),St=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(!1)],i.prototype,"enableMarker",void 0),_e([t.Property(!0)],i.prototype,"enable",void 0),_e([t.Property(null)],i.prototype,"fill",void 0),_e([t.Property(!1)],i.prototype,"shared",void 0),_e([t.Property(.75)],i.prototype,"opacity",void 0),_e([t.Property(null)],i.prototype,"header",void 0),_e([t.Property(null)],i.prototype,"format",void 0),_e([t.Complex(je,ze)],i.prototype,"textStyle",void 0),_e([t.Property(null)],i.prototype,"template",void 0),_e([t.Complex({color:"#cccccc",width:.5},Qe)],i.prototype,"border",void 0),_e([t.Property(!0)],i.prototype,"enableAnimation",void 0),i}(t.ChildProperty),yt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property("50%")],i.prototype,"x",void 0),_e([t.Property("50%")],i.prototype,"y",void 0),i}(t.ChildProperty),bt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Property(!1)],i.prototype,"enablePinchZooming",void 0),_e([t.Property(!0)],i.prototype,"enableSelectionZooming",void 0),_e([t.Property(!1)],i.prototype,"enableDeferredZooming",void 0),_e([t.Property(!1)],i.prototype,"enableMouseWheelZooming",void 0),_e([t.Property("XY")],i.prototype,"mode",void 0),_e([t.Property(["Zoom","ZoomIn","ZoomOut","Pan","Reset"])],i.prototype,"toolbarItems",void 0),_e([t.Property(!0)],i.prototype,"enableScrollbar",void 0),_e([t.Property(!1)],i.prototype,"enablePan",void 0),i}(t.ChildProperty),Ct=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ue(i,e),_e([t.Complex({},ft)],i.prototype,"chartSeries",void 0),_e([t.Complex({},vt)],i.prototype,"primaryXAxis",void 0),_e([t.Complex({},vt)],i.prototype,"primaryYAxis",void 0),_e([t.Property("")],i.prototype,"value",void 0),_e([t.Property("")],i.prototype,"columnHeader",void 0),_e([t.Property("-")],i.prototype,"columnDelimiter",void 0),_e([t.Property(!1)],i.prototype,"enableMultipleAxis",void 0),_e([t.Property("Stacked")],i.prototype,"multipleAxisMode",void 0),_e([t.Property(!1)],i.prototype,"enableScrollOnMultiAxis",void 0),_e([t.Property(!1)],i.prototype,"showMemberSeries",void 0),_e([t.Property(!1)],i.prototype,"showPointColorByMembers",void 0),_e([t.Complex({border:{color:null,width:.5},background:"transparent"},u.titleSettings)],i.prototype,"titleStyle",void 0),_e([t.Property("")],i.prototype,"title",void 0),_e([t.Complex({border:{color:null,width:.5},background:"transparent"},u.titleSettings)],i.prototype,"subTitleStyle",void 0),_e([t.Property("")],i.prototype,"subTitle",void 0),_e([t.Complex({color:"#DDDDDD",width:0},Qe)],i.prototype,"border",void 0),_e([t.Complex({},We)],i.prototype,"margin",void 0),_e([t.Complex({border:{color:null,width:.5},background:"transparent"},Xe)],i.prototype,"chartArea",void 0),_e([t.Property(null)],i.prototype,"background",void 0),_e([t.Property("Material")],i.prototype,"theme",void 0),_e([t.Property([])],i.prototype,"palettes",void 0),_e([t.Complex({},Je)],i.prototype,"crosshair",void 0),_e([t.Complex({},St)],i.prototype,"tooltip",void 0),_e([t.Complex(null,yt)],i.prototype,"pieCenter",void 0),_e([t.Complex({},bt)],i.prototype,"zoomSettings",void 0),_e([t.Property()],i.prototype,"legendSettings",void 0),_e([t.Property("None")],i.prototype,"selectionMode",void 0),_e([t.Property("None")],i.prototype,"accumulationSelectionMode",void 0),_e([t.Property(!0)],i.prototype,"enableSmartLabels",void 0),_e([t.Property(!0)],i.prototype,"enableBorderOnMouseMove",void 0),_e([t.Property("None")],i.prototype,"highlightMode",void 0),_e([t.Property("None")],i.prototype,"highlightPattern",void 0),_e([t.Property(!0)],i.prototype,"enableExport",void 0),_e([t.Property(!1)],i.prototype,"isMultiSelect",void 0),_e([t.Collection([],Ke)],i.prototype,"selectedDataIndexes",void 0),_e([t.Property(!0)],i.prototype,"enableAnimation",void 0),_e([t.Property(!1)],i.prototype,"enableCanvas",void 0),_e([t.Property(!0)],i.prototype,"useGroupingSeparator",void 0),_e([t.Property(!1)],i.prototype,"isTransposed",void 0),_e([t.Property(1)],i.prototype,"tabIndex",void 0),_e([t.Property(null)],i.prototype,"description",void 0),_e([t.Event()],i.prototype,"resized",void 0),_e([t.Property(!0)],i.prototype,"enableSideBySidePlacement",void 0),_e([t.Event()],i.prototype,"loaded",void 0),_e([t.Event()],i.prototype,"beforePrint",void 0),_e([t.Event()],i.prototype,"animationComplete",void 0),_e([t.Event()],i.prototype,"load",void 0),_e([t.Event()],i.prototype,"textRender",void 0),_e([t.Event()],i.prototype,"legendRender",void 0),_e([t.Event()],i.prototype,"seriesRender",void 0),_e([t.Event()],i.prototype,"multiLevelLabelRender",void 0),_e([t.Event()],i.prototype,"pointRender",void 0),_e([t.Event()],i.prototype,"tooltipRender",void 0),_e([t.Event()],i.prototype,"legendClick",void 0),_e([t.Event()],i.prototype,"axisLabelRender",void 0),_e([t.Event()],i.prototype,"multiLevelLabelClick",void 0),_e([t.Event()],i.prototype,"chartMouseClick",void 0),_e([t.Event()],i.prototype,"chartMouseMove",void 0),_e([t.Event()],i.prototype,"pointMove",void 0),_e([t.Event()],i.prototype,"pointClick",void 0),_e([t.Event()],i.prototype,"chartMouseDown",void 0),_e([t.Event()],i.prototype,"chartMouseLeave",void 0),_e([t.Event()],i.prototype,"dragComplete",void 0),_e([t.Event()],i.prototype,"chartMouseUp",void 0),_e([t.Event()],i.prototype,"scrollStart",void 0),_e([t.Event()],i.prototype,"zoomComplete",void 0),_e([t.Event()],i.prototype,"scrollChanged",void 0),_e([t.Event()],i.prototype,"scrollEnd",void 0),_e([t.Property(!0)],i.prototype,"showMultiLevelLabels",void 0),i}(t.ChildProperty),xt=function(){function e(){}return e.getCellSets=function(e,i,a,r,n){this.engine=i,this.isMondrian=i.isMondrian,this.isMeasureAvail=i.isMeasureAvail,this.isPaging=i.isPaging,this.pageSettings=i.pageSettings,this.rows=i.rows,this.columns=i.columns,this.values=i.values,this.filters=i.filters,this.allowLabelFilter=i.allowLabelFilter,this.allowValueFilter=i.allowValueFilter,this.drilledMembers=i.updateDrilledItems(e.drilledMembers),this.calculatedFieldSettings=i.calculatedFieldSettings,this.valueAxis="row"===e.valueAxis?"rows":"columns",r&&(r.axis="row"===r.axis?"rows":"columns"),this.filterMembers=t.extend({},i.filterMembers,null,!0),this.fieldDataObj=i.fieldListObj,this.fieldList=i.fieldList,this.cellSetInfo="\nDIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CHILDREN_CARDINALITY, MEMBER_TYPE, MEMBER_VALUE";var o=this.getMeasuresQuery(this.values),s=this.getDimensionsQuery(this.rows,o,"rows",r).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""),l=this.getDimensionsQuery(this.columns,o,"columns",r).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""");if(this.isPaging&&a&&void 0!==this.pageSettings)s=(d=this.getPagingQuery(s,l)).rowQuery,l=d.columnQuery;else if(this.isPaging&&!a&&void 0!==this.pageSettings){var d=this.getPagingCountQuery(s,l);s=d.rowQuery,l=d.columnQuery}s=s.length>0?s+(this.isPaging&&!a?"":this.cellSetInfo+" ON ROWS"):"",l=l.length>0?l+(this.isPaging&&!a?"":this.cellSetInfo+" ON COLUMNS"):"";var p=this.getSlicersQuery(this.filters,"filters").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""),h=this.getfilterQuery(this.filterMembers,e.cube).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,"""),u=this.getCalculatedFieldQuery(this.calculatedFieldSettings).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,"""),c=this.frameMDXQuery(s,l,p,h,u,a),g={catalog:e.catalog,cube:e.cube,url:e.url,request:c,LCID:e.localeIdentifier.toString(),roles:e.roles};i.mdxQuery=c.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/%280/g,'"').replace(/'/g,"'"),r&&(r.axis="rows"===r.axis?"row":"column"),n||this.getTableCellData(g,this.isPaging&&!a?this.engine.generatePagingData.bind(this.engine):this.engine.generateEngine.bind(this.engine),r?{action:r.action,drillInfo:r}:{dataSourceSettings:e,action:"loadTableElements"})},e.getTableCellData=function(e,t,i){var a=this.engine.getConnectionInfo(e.url,e.LCID),r='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> <Header></Header> <Body> <Execute xmlns="urn:schemas-microsoft-com:xml-analysis"> <Command> <Statement>'+e.request+"</Statement> </Command> <Properties> <PropertyList> <Catalog>"+e.catalog+"</Catalog> <LocaleIdentifier>"+a.LCID+"</LocaleIdentifier>"+(e.roles?"<Roles>"+e.roles+"</Roles>":"")+"</PropertyList> </Properties></Execute> </Body> </Envelope>";if(this.engine.doAjaxPost("POST",a.url,r,t,i),this.engine.errorInfo)throw this.engine.errorInfo},e.frameMDXQuery=function(e,t,i,a,r,n){var o=this.isPaging&&!n?""!==r?"":"\nWITH":"\nSelect ";return t.length>0&&(o+=t),e.length>0&&(o=o+(t.length>0?this.isPaging&&!n?"":", ":"")+e),o=r+o+(this.isPaging&&!n?"\nMEMBER [Measures].[3d268ce0-664d-4092-b9cb-fece97175006] AS Count([e16a30d0-2174-4874-8dae-a5085a75a3e2]) MEMBER [Measures].[8d7fe8c1-f09f-410e-b9ba-eaab75a1fc3e] AS Count ([d1876d2b-e50e-4547-85fe-5b8ed9d629de])\nSELECT { [Measures].[3d268ce0-664d-4092-b9cb-fece97175006] , [Measures].[8d7fe8c1-f09f-410e-b9ba-eaab75a1fc3e] } ON AXIS(0)":"")+" "+a+i+"\nCELL PROPERTIES VALUE, FORMAT_STRING, FORMATTED_VALUE\n"},e.getPagingQuery=function(e,t){e=e.replace("NON EMPTY ( ","").slice(0,-1),t=t.replace("NON EMPTY ( ","").slice(0,-1);var i=e,a=(this.pageSettings.currentRowPage-1)*this.pageSettings.rowPageSize,r=(this.pageSettings.currentColumnPage-1)*this.pageSettings.columnPageSize,n=this.engine.isExporting&&this.engine.exportSpeciedPages&&this.engine.exportSpeciedPages.rowSize?this.engine.exportSpeciedPages.rowSize:3*this.pageSettings.rowPageSize,o=this.engine.isExporting&&this.engine.exportSpeciedPages&&this.engine.exportSpeciedPages.columnSize?this.engine.exportSpeciedPages.columnSize:3*this.pageSettings.columnPageSize;return a=this.engine.rowCount<a+n?this.engine.rowCount>n?this.engine.rowCount-n:0:a,this.engine.pageRowStartPos=a,r=this.engine.columnCount<r+o?this.engine.columnCount>o?this.engine.columnCount-o:0:r,this.engine.pageColStartPos=r,{rowQuery:""!==e?"\nSUBSET ({ "+(this.isMondrian?"":"NONEMPTY")+" ("+e+(this.isMondrian||""===t?"":","+t)+")},"+a+","+n+")":"",columnQuery:""!==t?"\nSUBSET ({ "+(this.isMondrian?"":"NONEMPTY")+" ("+t+(this.isMondrian||""===i?"":","+i)+")},"+r+","+o+")":""}},e.getPagingCountQuery=function(e,t){e=e.replace("NON EMPTY ( ","").slice(0,-1),t=t.replace("NON EMPTY ( ","").slice(0,-1);var i=e;return{rowQuery:""!==e?"SET [d1876d2b-e50e-4547-85fe-5b8ed9d629de] as "+(this.isMondrian?"":"NONEMPTY")+" ("+e+(this.isMondrian||""===t?"":","+t)+")\n":"",columnQuery:""!==t?"\nSET [e16a30d0-2174-4874-8dae-a5085a75a3e2] as "+(this.isMondrian?"":"NONEMPTY")+" ("+t+(this.isMondrian||""===i?"":","+i)+")\n":""}},e.getDimensionsQuery=function(e,t,i,a){var r="";if(e.length>0){r="\nNON EMPTY ( "+(this.drilledMembers.length>0?"HIERARCHIZE ({":"");for(var n=0;n<e.length;){0===n?"[measures]"===e[n].name.toLowerCase()?""!==t&&(r+=t):r+="({"+this.getDimensionQuery(e[n],i)+"})":"[measures]"===e[n].name.toLowerCase()?""!==t&&(r=r+" * "+t):r=r+" * "+("({"+this.getDimensionQuery(e[n],i)+"})"),n++}var o=this.getDrillQuery(e,t,i,a);r=a&&a.axis===i?"\nNON EMPTY ( "+(this.drilledMembers.length>0?"HIERARCHIZE ({":"")+o.query:r+(""!==o.query?",":"")+o.query;var s=this.getAttributeDrillQuery(e,t,i,a);r=r+(this.isPaging?(""!==s?"-":"")+s:"")+(this.drilledMembers.length>0?"})":"")+(this.isPaging?"":(""!==s?"-":"")+s)+")"}return r},e.getAttributeDrillQuery=function(e,t,i,a){var r="",n=[];n=a&&a.axis===i&&"down"===a.action.toLowerCase()?[{name:a.fieldName,items:[a.memberName],delimiter:"~~"}]:this.drilledMembers;for(var o=i===this.valueAxis?this.getMeasurePos(i):0,s=0,l=n;s<l.length;s++){var d=l[s];if(!!this.engine.fieldList[d.name]&&this.engine.fieldList[d.name].isHierarchy)for(var p=0,h=d.items;p<h.length;p++){for(var u=h[p],c=[],g=u.split(d.delimiter?d.delimiter:"~~"),m=this.getDrillLevel(e,g),f=this.getDimensionPos(i,d.name),v=e.length-(o>f?1:0),S=!!this.isPaging&&this.isAttributeMemberExist(d.name,u.split(d.delimiter?d.delimiter:"~~"),d.delimiter,g,i);m.level>0&&m.isDrill&&f+1!==o&&!S;){for(var y=[],b=0;b<e.length;){if("[measures]"===e[b].name.toLowerCase())""!==t&&y.push(g[b]?"({{"+g[b]+"}})":"("+t+")");else if(g[b]&&(-1!==g[b].indexOf(e[b].name)||e[b].isNamedSet&&this.fieldList[e[b].name]&&-1!==g[b].indexOf(this.fieldList[e[b].name].pid.split("Sets_")[1])))y.push(this.getHierarchyQuery(g[b],!1,!1,!1,m.level,!0));else{if(g[b]||!e[b]){y=[];break}y.push(this.getHierarchyQuery(e[b].name,!!(this.isPaging&&2===m.level||!this.isPaging&&v>b),e[b].isNamedSet,e[b].isCalculatedField,m.level,!1))}b++}y.length>0&&c.push("("+y.join("*")+")"),m.level--,v--}c.length>0&&(r=r+(""!==r?"-":"")+c.join(this.isPaging?"+":"-"))}}return r},e.getDimensionPos=function(e,t){for(var i=0,a="rows"===e?this.rows:this.columns,r=0;r<a.length;r++)if(a[r].name===t){i=r;break}return i},e.getMeasurePos=function(e){for(var t=0,i="rows"===e?this.rows:this.columns,a=0;a<i.length;a++)if(0===i[a].name.indexOf("[Measures]")){t=a;break}return t},e.getDrillLevel=function(e,t){for(var i=e.length,a=!1,r=0;r<e.length;)t[r]&&-1!==t[r].indexOf(e[r].name)?(i-=1,e[r+1]&&!(e[r+1].isNamedSet||0===e[r+1].name.indexOf("[Measures]")||this.fieldList[e[r+1].name]&&!this.fieldList[e[r+1].name].hasAllMember)&&(a=!0)):(e[r].isNamedSet||0===e[r].name.indexOf("[Measures]")||this.fieldList[e[r].name]&&!this.fieldList[e[r].name].hasAllMember)&&(i-=1),r++;return{level:this.isPaging?2:i,isDrill:a}},e.getHierarchyQuery=function(e,t,i,a,r,n){return e=a?this.fieldList[e].tag:e,!this.fieldList[e]||this.fieldList[e].hasAllMember||i||a?i||a?"({"+e+"})":this.isPaging?"({"+e+(t?".CHILDREN})":n||1!==r?"})":".[All]})"):"({DrilldownLevel({"+e+(t?".CHILDREN":"")+"},,,INCLUDE_CALC_MEMBERS)})":"(("+e+").levels(0).AllMembers)"},e.isAttributeMemberExist=function(e,t,i,a,r){t.splice(a.length-1,1);var n=!1;if(""!==t.join(i)&&(!this.isPaging||1!==t.length||"[Measures]"!==t.join(i))&&this.engine.fieldList[e]&&this.engine.fieldList[e].hasAllMember)for(var o=this.getDimensionPos(r,e),s=0;s<this.drilledMembers.length;s++)if(e!==this.drilledMembers[s].name&&!!this.engine.fieldList[this.drilledMembers[s].name]&&this.engine.fieldList[this.drilledMembers[s].name].isHierarchy)for(var l=this.getDimensionPos(r,this.drilledMembers[s].name),d=0;d<this.drilledMembers[s].items.length;d++){var p=this.getDrillLevel("rows"===r?this.rows:this.columns,this.drilledMembers[s].items[d].split(this.drilledMembers[s].delimiter?this.drilledMembers[s].delimiter:"~~"));if((!this.isPaging||l<o&&p.isDrill)&&(0===this.drilledMembers[s].items[d].indexOf(t.join(i))||0===t.join(i).indexOf(this.drilledMembers[s].items[d]))){n=!0;break}}return n},e.getDrillQuery=function(e,t,i,a){var r="",n=[],o=[],s=!1,l="";a&&a.axis===i&&"down"===a.action.toLowerCase()?(s=!0,o=[{name:a.fieldName,items:[a.memberName],delimiter:"~~"}]):o=this.drilledMembers;for(var d=0,p=o;d<p.length;d++){var h=p[d];if(!(!!this.engine.fieldList[h.name]&&this.engine.fieldList[h.name].isHierarchy))for(var u=0,c=h.items;u<c.length;u++){for(var g=c[u],m=[],f=[],v=0,S=g.split(h.delimiter?h.delimiter:"~~"),y=this.isAttributeMemberExist(h.name,g.split(h.delimiter?h.delimiter:"~~"),h.delimiter?h.delimiter:"~~",S,i);v<e.length&&!y;){if(S[v]&&-1!==S[v].indexOf(e[v].name))-1!==S[S.length-1].indexOf(e[v].name)?s?l=l+(""!==l?" * ":"")+"({"+S[v]+".CHILDREN})":(m.push("("+S[v]+".CHILDREN)"),f.push("("+S[v]+")")):"[measures]"===S[v].toLowerCase()&&""!==t?s?l=l+(""!==l?" * ":"")+"("+t+")":(m.push("("+t+")"),f.push("("+t+")")):-1!==S[v].toLowerCase().indexOf("[measures]")?s?l=l+(""!==l?" * ":"")+"({"+S[v]+"})":(m.push("({"+S[v]+"})"),f.push("({"+S[v]+"})")):s?l=l+(""!==l?" * ":"")+"({"+S[v]+"})":(m.push("("+S[v]+")"),f.push("("+S[v]+")"));else{if(S[v]||!e[v]){m=[];break}if("[measures]"===e[v].name.toLowerCase()&&""!==t)s?l=l+(""!==l?" * ":"")+"("+t+")":(m.push("("+t+")"),f.push("("+t+")"));else{var b=this.getDimensionQuery(e[v],i);s?l=l+(""!==l?" * ":"")+"({"+b+"})":(m.push("("+b+")"),f.push("("+b+")"))}}v++}m.length>0&&m.length<S.length&&(m=[],f=[]),r=r+(""!==r&&m.length>0?",":"")+(m.length>0?"("+m.toString()+")":""),f.length>0&&n.push("("+f.toString()+")")}}return{query:s?l:r,collection:s?[l]:n}},e.getSlicersQuery=function(e,i){var a=this,r="",n=t.extend([],this.rows,null,!0);if(n=n.concat(this.columns),e.length>0){for(var o=0;o<e.length;)n.filter(function(t){var i=a.getDimensionUniqueName(t.name),r=a.getDimensionUniqueName(e[o].name);return i===r&&!(a.isMondrian&&""===r&&""===i)}).length>0||(void 0===e[o].name||this.filterMembers[e[o].name]?this.filterMembers[e[o].name]&&(r=r+(""!==r?" * ":"")+"{"+this.filterMembers[e[o].name].toString()+"}"):r=r+(""!==r?" * ":"")+"{"+this.getDimensionQuery(e[o],i)+"}"),o++;r=""===r?"":"\nWHERE ("+r.replace(/DrilldownLevel/g,"")+")"}return r},e.getDimensionQuery=function(e,t){var i=e.isCalculatedField?this.fieldList[e.name].tag:e.name;return this.fieldList[e.name]&&this.fieldList[e.name].hasAllMember||e.isNamedSet||e.isCalculatedField?e.isNamedSet||e.isCalculatedField?"{"+i+"}":this.isPaging?i+".CHILDREN":"DrilldownLevel({"+i+"}"+("rows"===t||"columns"===t?",,,INCLUDE_CALC_MEMBERS":"")+")":"(("+i+").levels(0).AllMembers)"},e.getDimensionUniqueName=function(e){var t=this.fieldDataObj.hierarchy,i=[];if(t){for(var a=0,r=t;a<r.length;a++){var n=r[a];n.id.toLowerCase()===e.toLowerCase()&&i.push(n)}return i.length>0?i[0].pid:""}return e.split(".")[0]},e.getMeasuresQuery=function(e){var t="";if(e.length>0){t="{{";for(var i="",a=0,r=e;a<r.length;a++){var n=r[a],o=n.isCalculatedField?this.fieldList[n.name].tag:n.name;i=i.length>0?i+", "+o:o}t=t+i+"}}"}return t},e.getfilterQuery=function(e,t){for(var i="\nFROM ["+t+"]",a="\nFROM( SELECT (",r=[],n=[],o=[],s=[],l=0,d=this.rows;l<d.length;l++)e[(m=d[l]).name]&&e[m.name].length>0&&("string"==typeof e[m.name][0]?o.push(e[m.name]):(e[m.name][1]=e[m.name][0].type,r.push(e[m.name]),delete e[m.name]));for(var p=0,h=this.columns;p<h.length;p++)if(e[(m=h[p]).name]&&e[m.name].length>0)if("string"==typeof e[m.name][0])s.push(e[m.name]);else{var u=e[m.name];u[1]=u[0].type,r.push(e[m.name]),delete e[m.name]}for(var c=0,g=this.filters;c<g.length;c++){for(var m=g[c],f=!1,v=0,S=this.columns;v<S.length;v++){var y=S[v];f||this.getDimensionUniqueName(y.name)!==this.getDimensionUniqueName(m.name)||e[m.name]&&(s.push(e[m.name]),f=!0)}if(!f)for(var b=0,C=this.rows;b<C.length;b++){var x=C[b];f||this.getDimensionUniqueName(x.name)!==this.getDimensionUniqueName(m.name)||e[m.name]&&(o.push(e[m.name]),f=!0)}}if((this.allowLabelFilter||this.allowValueFilter)&&r.length>0)for(var w=0,T=["Value","Label"];w<T.length;w++)for(var M=T[w],D=0,O=r;D<O.length;D++){var P=O[D];P&&2===P.length&&"string"==typeof P[1]&&P[1]===M&&n.push(this.getAdvancedFilterQuery(P[0],a,"COLUMNS"))}for(var N=0,E=s.length;N<E;N++)a=0===N?a+"{"+s[N].toString()+"}":a+",{"+s[N].toString()+"}";s.length>0&&(a=o.length>0?a+" ) ON COLUMNS ,(":a+" ) ON COLUMNS");for(var N=0,E=o.length;N<E;N++)a=N>0?a+",{"+o[N].toString()+"}":a+"{"+o[N].toString()+"}";a=s.length>0&&o.length>0?a+=") ON ROWS ":0===s.length&&o.length>0?a+") ON COLUMNS ":a;var F="";return n.length>0&&(F=n.join(" ")+" "+(s.length>0||o.length>0?a:"")+" "+i+Array(n.length+1+(s.length>0||o.length>0?1:0)).join(")")),i=0===s.length&&0===o.length?i:a+i+")",F.length>0?F:i},e.getAdvancedFilterQuery=function(e,t,i){return"\nFROM (SELECT Filter("+e.selectedField+".AllMembers, "+this.getAdvancedFilterCondtions(e.name,e.condition,e.value1,e.value2,e.type,e.measure)+")) on "+i},e.getAdvancedFilterCondtions=function(e,t,i,a,r,n){var o="";switch(t){case"Equals":o="("+("Value"!==r?e+'.CurrentMember.member_caption ="'+i+'"':n+" = "+i);break;case"DoesNotEquals":o="("+("Value"!==r?e+'.CurrentMember.member_caption <>"'+i+'"':n+" <>"+i);break;case"Contains":o="( InStr (1,"+e+'.CurrentMember.member_caption,"'+i+'") >0';break;case"DoesNotContains":o="( InStr (1,"+e+'.CurrentMember.member_caption,"'+i+'")=0';break;case"BeginWith":o="( Left ("+e+".CurrentMember.member_caption,"+i.length+')="'+i+'"';break;case"DoesNotBeginWith":o="( Left ("+e+".CurrentMember.member_caption,"+i.length+') <>"'+i+'"';break;case"EndsWith":o="( Right ("+e+".CurrentMember.member_caption,"+i.length+')="'+i+'"';break;case"DoesNotEndsWith":o="( Right ("+e+".CurrentMember.member_caption,"+i.length+') <>"'+i+'"';break;case"GreaterThan":o="("+("Value"!==r?e+'.CurrentMember.member_caption >"'+i+'"':n+" >"+i);break;case"GreaterThanOrEqualTo":o="("+("Value"!==r?e+'.CurrentMember.member_caption >="'+i+'"':n+" >="+i);break;case"LessThan":o="("+("Value"!==r?e+'.CurrentMember.member_caption <"'+i+'"':n+" <"+i);break;case"LessThanOrEqualTo":o="("+("Value"!==r?e+'.CurrentMember.member_caption <="'+i+'"':n+" <="+i);break;case"Between":o="("+("Value"!==r?e+'.CurrentMember.member_caption >="'+i+'"AND '+e+'.CurrentMember.member_caption <="'+a+'"':n+" >="+i+" AND "+n+" <="+a);break;case"NotBetween":o="("+("Value"!==r?e+'.CurrentMember.member_caption >="'+i+'"OR '+e+'.CurrentMember.member_caption <="'+a+'"':n+" >="+i+" OR "+n+" <="+a);break;default:o="( InStr (1,"+e+'.CurrentMember.member_caption,"'+i+'") >0'}return o},e.getCalculatedFieldQuery=function(e){var i="";if(e.length>0){i="\nWITH";for(var a=0,r=e;a<r.length;a++){var n=r[a],o=(n.formula.indexOf("Measure")>-1?"[Measures].":n.hierarchyUniqueName+".")+"["+n.name+"]",s=t.isNullOrUndefined(n.formatString)?null:n.formatString;i+="\nMEMBER "+o+"as ("+n.formula+") "+(t.isNullOrUndefined(s)?"":', FORMAT_STRING ="'+s.trim()+'"')}}return i},e}(),wt=function(){function e(){this.fieldList={},this.columnCount=0,this.rowCount=0,this.colFirstLvl=0,this.rowFirstLvl=0,this.pageColStartPos=0,this.enableSort=!1,this.enableValueSorting=!1,this.dataFields={},this.formatFields={},this.filterMembers={},this.drilledSets={},this.isExporting=!1,this.aggregatedValueMatrix=[],this.mappingFields={},this.formatRegex=/^(?:[ncpae])(?:([0-9]|1[0-9]|20))?$/i,this.clonedValTuple=[],this.clonedColumnTuple=[],this.clonedRowTuple=[],this.pivotValues=[],this.valueContent=[],this.headerContent=[],this.rowStartPos=0,this.pageRowStartPos=0,this.tupColumnInfo=[],this.tupRowInfo=[],this.gridJSON="",this.namedSetsPosition={},this.colDepth=0,this.totalCollection=[],this.parentObjCollection={},this.curDrillEndPos=-1,this.headerGrouping={},this.lastLevel=[],this.showRowSubTotals=!0,this.showColumnSubTotals=!0,this.hideRowTotalsObject={},this.hideColumnTotalsObject={},this.sortObject={},this.isColDrill=!1}return e.prototype.renderEngine=function(e,i,a){if(this.isEmptyData=!1,this.getHeaderSortInfo=a,this.mdxQuery="",this.isMeasureAvail=!1,this.allowMemberFilter=!1,this.allowLabelFilter=!1,this.allowValueFilter=!1,this.isMondrian=!1,this.aggregatedValueMatrix=[],this.measureReportItems=[],this.calcChildMembers=[],this.selectedItems=[],this.savedFieldList=void 0,this.savedFieldListData=void 0,this.formatFields={},this.filterMembers={},this.dataFields={},this.valueAxis="",this.columnCount=0,this.rowCount=0,this.colFirstLvl=0,this.rowFirstLvl=0,this.pageColStartPos=0,this.sortObject={},this.globalize=new t.Internationalization,this.locale=this.globalize.culture?this.globalize.culture:"en-US",this.localeObj=i?i.localeObj:void 0,this.enableValueSorting=!!i&&i.enableValueSorting,e.url){this.dataSourceSettings=e,this.measureIndex=t.isNullOrUndefined(e.valueIndex)?-1:e.valueIndex,this.valueAxis="row"===e.valueAxis?"row":"column",this.getAxisFields(),this.formats=e.formatSettings?e.formatSettings:[],this.enableSort=void 0===e.enableSorting||e.enableSorting,this.valueSortSettings=e.valueSortSettings?e.valueSortSettings:void 0,this.filterSettings=e.filterSettings?e.filterSettings:[],this.sortSettings=e.sortSettings?e.sortSettings:[],this.allowMemberFilter=!!e.allowMemberFilter,this.allowLabelFilter=!!e.allowLabelFilter,this.allowValueFilter=!!e.allowValueFilter,this.drilledMembers=e.drilledMembers?this.updateDrilledItems(e.drilledMembers):[],this.calculatedFieldSettings=e.calculatedFieldSettings?e.calculatedFieldSettings:[],this.emptyCellTextContent=e.emptyCellsTextContent?e.emptyCellsTextContent:"",this.pageSettings=i?i.pageSettings?i.pageSettings:this.pageSettings:void 0,this.isPaging=!(!this.pageSettings||!i.enablePaging&&!i.enableVirtualization),this.frameSortObject(),this.getFormattedFields(this.formats),this.savedFieldList=i?i.savedFieldList:void 0,this.savedFieldListData=i?i.savedFieldListData:void 0,this.fieldListData=[],this.fieldListObj={},this.setNamedSetsPosition(),this.savedFieldList&&Object.keys(this.savedFieldList).length>0&&this.savedFieldListData?this.updateFieldlist(!0):(this.getCubes(e),this.getFieldList(e)),this.loadCalculatedMemberElements(this.calculatedFieldSettings);var r=this.getMeasureInfo();this.olapVirtualization=this.isPaging&&e.showSubTotals&&r.measureIndex===("column"===r.measureAxis?e.columns.length-1:e.rows.length-1)&&!t.isNullOrUndefined(this.pageSettings)&&e.showGrandTotals,this.isPaging=this.isPaging?!this.olapVirtualization:this.isPaging,this.measureReportItems=[],this.updateFilterItems(this.filterSettings),this.generateGridData(e)}},e.prototype.generateGridData=function(e,t){var i=!(!t||"navPaging"!==t||!this.isPaging||void 0===this.pageSettings);this.rows.length>0||this.columns.length>0||this.values.length>0||this.filters.length>0?xt.getCellSets(e,this,i):(xt.getCellSets(e,this,!0,void 0,!0),this.generateEngine(void 0,void 0,{dataSourceSettings:e,action:"loadTableElements"}))},e.prototype.generatePagingData=function(e,t,i){var a=[].slice.call(e.querySelectorAll("Axes, CellData")),r=a[1]?a[1].querySelectorAll("FmtValue"):null;r&&r.length>0&&(this.columnCount=Number(r[0].textContent),this.rowCount=Number(r[1].textContent));var n=i.dataSourceSettings;xt.getCellSets(n,this,!0)},e.prototype.scrollPage=function(){if(this.olapVirtualization){var e=this.getVirtualScrollingData(this.clonedColumnTuple,this.clonedRowTuple);e.isCalculated&&(this.pivotValues=[],this.clearEngineProperties(),this.performEngine(e.columnTuple,e.rowTuple,e.valueTuple)),this.pivotValues=this.pivotValues.slice()}else xt.getCellSets(this.dataSourceSettings,this,!0)},e.prototype.getVirtualScrollingData=function(e,i){var a=this.clonedValTuple.slice(),r=!1,n=(this.pageSettings.currentColumnPage-1)*this.pageSettings.columnPageSize,o=(this.pageSettings.currentRowPage-1)*this.pageSettings.rowPageSize,s=3*this.pageSettings.columnPageSize,l=3*this.pageSettings.rowPageSize;if(n=this.columnCount<n+s?this.columnCount>s?this.columnCount-s:0:n,o=this.rowCount<o+l?this.rowCount>l?this.rowCount-l:0:o,n!==this.pageColStartPos||o!==this.pageRowStartPos||!(e.length<=s&&i.length<=l)){r=!0;var d=this.getMeasureInfo(),p=!t.isNullOrUndefined(e[0])&&0===Number(e[0].querySelectorAll("Member")[0].querySelector("LNum").textContent),h=!t.isNullOrUndefined(i[0])&&0===Number(i[0].querySelectorAll("Member")[0].querySelector("LNum").textContent),u=!!p&&n+s>=e.length-1,c=!!h&&o+l>=i.length-1,g=p?this.getAxisdepth(e):"column"===d.measureAxis?d.valueInfo.length:1,m=h?this.getAxisdepth(i):"row"===d.measureAxis?d.valueInfo.length:1,f=(p?g:0)+n,v=(h?m:0)+o,S=e.slice(f,f+s),y=i.slice(v,v+l),b=S[0]?Number(S[0].querySelectorAll("Member")[0].querySelector("LNum").textContent):0,C=y[0]?Number(y[0].querySelectorAll("Member")[0].querySelector("LNum").textContent):0,x=this.getVirtualTotals(e.slice(0,f),b,u,"column",g),w=this.getVirtualTotals(i.slice(0,v),C,c,"row",m);f=S.length+x.totalsCollection.length>s?Math.max(S.length+x.totalsCollection.length-s):0,v=y.length+w.totalsCollection.length>l?Math.max(y.length+w.totalsCollection.length-l):0,S=x.totalsCollection.concat(S.slice(f,S.length)),y=w.totalsCollection.concat(y.slice(v,y.length));var T=this.getVirtualValues(a,n+f,o+v,s,l,x.indexCollection,w.indexCollection,e.length,i.length,g,m,h);e=S.slice(),i=y.slice(),a=T.slice()}return this.pageColStartPos=n,this.pageRowStartPos=o,{columnTuple:e,rowTuple:i,valueTuple:a,isCalculated:r}},e.prototype.getAxisdepth=function(e){for(var t=0,i=0;i<e.length&&0===Number(e[i].querySelectorAll("Member")[0].querySelector("LNum").textContent);i++)t++;return t},e.prototype.getVirtualTotals=function(e,t,i,a,r){var n=[],o=[];if(1!==t)for(d=e.length-1;d>0;d--){var s=Number(e[d].querySelectorAll("Member")[0].querySelector("LNum").textContent);if(0===s)break;if(t>s)if(t=s,Number(e[d-1].querySelectorAll("Member")[0].querySelector("LNum").textContent)===s){for(var l=0;l<r;l++)n[n.length]=e[d-l],o[o.length]=d-l;d=r>1?d-(r-1):d}else n[n.length]=e[d],o[o.length]=d;else if(1===s)break}if(i)for(var d=r;d>0;d--)n=n.concat([e[d-1]]),o=o.concat([d-1]);return{totalsCollection:n.reverse(),indexCollection:o.reverse()}},e.prototype.getVirtualValues=function(e,t,i,a,r,n,o,s,l,d,p,h){var u=[],c=e;if(l>r){var g=((h?p:0)+i)*s;c=e.slice(g,g+r*s);for(var m=[],f=0;f<o.length;f++)m=m.concat(e.slice(o[f]*s,o[f]*s+s));c=m.concat(c)}for(var f=0,v=c.length/s;f<v;f++){for(var S=c.slice(f*s,f*s+s),y=S.slice(t+d,t+d+a),b=[],C=0;C<n.length;C++)b[b.length]=S[n[C]];u=u.concat(b.concat(y))}return u},e.prototype.generateEngine=function(e,i,a){"down"!==a.action&&this.clearEngineProperties(),this.xmlDoc=e?e.cloneNode(!0):void 0,this.request=i,this.customArgs=a,this.parentObjCollection={},this.curDrillEndPos=-1,this.onDemandDrillEngine=[],this.getSubTotalsVisibility(),this.xmlaCellSet=e?e.querySelectorAll("Axes, CellData"):void 0;var r=this.xmlaCellSet&&this.xmlaCellSet.length>0?[].slice.call(this.xmlaCellSet[0].querySelectorAll('Axis[name|="Axis0"] Tuple')):[],n=this.xmlaCellSet&&this.xmlaCellSet.length>0?[].slice.call(this.xmlaCellSet[0].querySelectorAll('Axis[name|="Axis1"] Tuple')):[],o=this.xmlaCellSet&&this.xmlaCellSet.length>1?[].slice.call(this.xmlaCellSet[1].querySelectorAll("Cell")):[];if(this.olapVirtualization&&!t.isNullOrUndefined(this.pageSettings)){if(r.length*n.length!==o.length){for(var s=[],l=0;l<o.length;l++)t.isNullOrUndefined(o[l])||(s[Number(o[l].getAttribute("CellOrdinal"))]=o[l]);o=s}this.clonedValTuple=o;var d=this.getDrillInfo("columns"),p=this.getActualTuples(r,d);d=this.getDrillInfo("rows");var h=this.getActualTuples(n,d,p.indexColls,r.length);this.clonedColumnTuple=p.tupColls,this.clonedRowTuple=h.tupColls,this.columnCount=this.clonedColumnTuple.length,this.rowCount=this.clonedRowTuple.length,p=h=void 0;var u=this.getVirtualScrollingData(this.clonedColumnTuple,this.clonedRowTuple);this.performEngine(u.columnTuple,u.rowTuple,u.valueTuple)}else this.performEngine(r,n,o)},e.prototype.getDrillInfo=function(e){var t={},i=[];if("columns"===e?i=this.dataSourceSettings.columns.map(function(e){return e.name}):"rows"===e&&(i=this.dataSourceSettings.rows.map(function(e){return e.name})),i.length>0)for(var a=0,r=this.drilledMembers.length;a<r;a++){var n=this.drilledMembers[a],o=i.indexOf(n.name);o>-1&&(t[o]||(t[o]=[]),t[o]=t[o].concat(n.items))}return t},e.prototype.getActualTuples=function(e,t,i,a){var r=[],n=[],o=[];if(e.length>0)for(var s=this,l=0,d=e.length;l<d;l++)!function(l,d){for(var p=e[l],h=!0,u=!1,c=!1,g=p.getElementsByTagName("MEMBER_TYPE"),m=p.getElementsByTagName("UName"),f=0,v=g.length;f<v;f++){var S=Number(g[f].textContent),y=m[f].textContent;if(c&&S<2?h=!1:2===S?u=!0:u&&S<2&&(h=!1),t[f]&&t[f].indexOf(y)>-1&&(c=!0),!h)break}if(h)if(r[r.length]=p,i){var b=s.clonedValTuple.slice(l*a,l*a+a);o=o.concat(i.map(function(e){return b[e]}))}else n[n.length]=l}(l);else if(i){var p=this.clonedValTuple.slice(0,a);o=o.concat(i.map(function(e){return p[e]}))}return o.length>0&&(this.clonedValTuple=o),{tupColls:r,indexColls:n}},e.prototype.clearEngineProperties=function(){this.pivotValues=[],this.valueContent=[],this.headerContent=[],this.colDepth=0,this.tupColumnInfo=[],this.tupRowInfo=[],this.colMeasures={},this.colMeasurePos=void 0,this.rowMeasurePos=void 0,this.rowStartPos=-1},e.prototype.performEngine=function(e,i,a){this.totalCollection=[];var r=this.getMeasureInfo();if(this.drilledMembers.length>0){var n=void 0;e=(n=this.frameMeasureOrder(r,"column",e,a,e.length,e.length*i.length)).orderedHeaderTuples,a=n.orderedValueTuples,i=(n=this.frameMeasureOrder(r,"row",i,a,e.length,e.length*i.length)).orderedHeaderTuples,a=n.orderedValueTuples}"down"===this.customArgs.action&&this.updateTupCollection("row"===this.customArgs.drillInfo.axis?i.length:e.length);for(var o={},s=0;s<a.length;s++)t.isNullOrUndefined(a[s])||(o[this.olapVirtualization?s:Number(a[s].getAttribute("CellOrdinal"))]=a[s]);var l;if(this.valueSortSettings.columnIndex=void 0,this.enableValueSorting&&this.valueSortSettings&&!this.isPaging&&!this.olapVirtualization&&(l=this.getValueSortInfo(e,i,r)),"down"===this.customArgs.action&&"column"!==this.customArgs.drillInfo.axis||(this.frameColumnHeader(e),this.isPaging||this.olapVirtualization||this.performColumnSorting(o,l)),"down"===this.customArgs.action&&"row"!==this.customArgs.drillInfo.axis||(this.frameRowHeader(i),this.isPaging||this.olapVirtualization||this.performRowSorting(o,l)),this.frameValues(o,e.length),this.performColumnSpanning(),!this.isPaging&&!this.olapVirtualization&&this.enableSort)for(var d=0;d<this.headerContent.length;d++)this.headerContent[d]=this.pivotValues[d];this.isEngineUpdated=!0,this.isEmptyData=0===e.length},e.prototype.getValueSortInfo=function(e,t,i){var a;if(this.valueSortSettings.headerText){var r=this.valueSortSettings.headerText.split(this.valueSortSettings.headerDelimiter),n=r.indexOf("Grand Total");if(n>-1){var o=r.join("").split(r[n]).join("");(r=[])[i.measureIndex]=o}for(var s="",l=i.measureIndex,d=0;d<this.dataSourceSettings.values.length;d++)if(l=r.indexOf(this.dataSourceSettings.values[d].caption),this.dataSourceSettings.values[d].caption===r[l]){r[l]=this.fieldList[this.dataSourceSettings.values[d].name].name,s=r[l];break}if(-1!==l){l<i.measureIndex&&(r=this.reArrangeHeaders(r,i.measureIndex,s));var p="column"===this.olapValueAxis?e:t;if(p.length>0){var h=p[0].getElementsByTagName("Member").length-(n>-1?l:0),u=this.getParentElement(p,r,h,i.measureIndex,s,n>-1)[0];a=p.indexOf(u)}}}return{memberIndex:a,columnLength:e.length,rowLength:t.length,isValueSorting:a>-1}},e.prototype.getParentElement=function(e,i,a,r,n,o){for(var s=[],l=0,d=!1,p=!1,h=e[0].getElementsByTagName("Member").length-a,u=0;u<e.length;u++){if(t.isNullOrUndefined(e[u].getElementsByTagName("Member")[h])){s=[];break}var c=e[u].getElementsByTagName("UName")[h].textContent,g=e[u].getElementsByTagName("Caption")[h].textContent,m=Number(e[u].getElementsByTagName("LNum")[h].textContent),f=c===i[h]||g===i[h]||t.isNullOrUndefined(i[h])&&0===m;if(f){if(s[s.length]=e[u],d=!0,l=m,o)break}else{if(d&&l<m){for(var v=[],S=u;S<e.length;S++){var y=e[S].getElementsByTagName("UName")[h].textContent,b=e[S].getElementsByTagName("Caption")[h].textContent,C=Number(e[S].getElementsByTagName("LNum")[h].textContent),x=y===i[h+1]||b===i[h+1]||t.isNullOrUndefined(i[h+1])&&0===C;if(l+1===C&&x)v[v.length]=e[S],p=!0;else if(l+1<C){if(!p)break;v[v.length]=e[S]}else if(l+1>C)break}if(p){var w=i.slice(0,h).concat(i.slice(h+1,i.length));w.indexOf(n)<r&&(w=this.reArrangeHeaders(w,r,n)),s=this.getParentElement(v,w,v[0].getElementsByTagName("Member").length,r,n)}break}if(d&&!f)break}}return o?s:(h<i.length-1&&s.length>0&&!p&&(s=this.getParentElement(s,i,a-1,r,n)),s)},e.prototype.reArrangeHeaders=function(e,t,i){var a=e.indexOf(i),r=e.slice(0,a),n=e.slice(a+1,e.length);return r[t]=e[a],r.concat(n)},e.prototype.getSubTotalsVisibility=function(){this.showRowSubTotals=this.dataSourceSettings.showRowSubTotals&&this.dataSourceSettings.showSubTotals,this.showColumnSubTotals=this.dataSourceSettings.showColumnSubTotals&&this.dataSourceSettings.showSubTotals,this.showSubTotalsAtTop=this.showColumnSubTotals&&"Top"===this.dataSourceSettings.subTotalsPosition,this.showSubTotalsAtBottom=this.showRowSubTotals&&"Bottom"===this.dataSourceSettings.subTotalsPosition,this.hideRowTotalsObject={},this.hideColumnTotalsObject={};var e=1;do{if(1===e){if(this.showColumnSubTotals)for(var t=0;t<this.dataSourceSettings.columns.length;t++)!1===this.dataSourceSettings.columns[t].showSubTotals&&(this.hideColumnTotalsObject[this.dataSourceSettings.columns[t].name]=t)}else if(this.showRowSubTotals)for(var i=0;i<this.dataSourceSettings.rows.length;i++)!1===this.dataSourceSettings.rows[i].showSubTotals&&(this.hideRowTotalsObject[this.dataSourceSettings.rows[i].name]=i);e++}while(e<3)},e.prototype.frameRowHeader=function(e){var t=this;this.headerGrouping={},this.lastLevel=[];var i=!0,a=this.pivotValues.length,r=[],n=[];"down"!==this.customArgs.action?(r=this.pivotValues,n=this.valueContent):a=this.customArgs.drillInfo.currentCell.rowIndex+1,this.rowStartPos=this.rowStartPos>0?this.rowStartPos:a;for(var o,s,l,d=0,p=[],h={},u=[],c=!1,g=-1,m=-1,f=[],v=[{actualText:"Grand Total",axis:"row",colIndex:0,formattedText:"Grand Total",hasChild:!1,level:-1,rowIndex:0,index:[],type:"grand sum",ordinal:0,colSpan:1,rowSpan:1,memberType:2,isDrilled:!1,valueSort:{"Grand Total":1,levelName:"Grand Total"}}],S=[],y=this.customArgs.drillInfo&&"row"===this.customArgs.drillInfo.axis?this.customArgs.drillInfo.currentCell.ordinal+1:0;d<e.length;){O=e[d].querySelectorAll("Member");S=this.frameTupCollection(O,S,d+y,this.tupRowInfo,this.showRowSubTotals,this.hideRowTotalsObject,"row"),d++}d=0;var b,C=e.length;if("down"===this.customArgs.action){var x=this.customArgs.drillInfo.currentCell.ordinal+1;d=x,C+=x,s=this.tupRowInfo[x-1].allCount,o=this.tupRowInfo[x-1].allStartPos,b=this.tupRowInfo[x-1]}for(var w=d,T=0,M=!1,D=[];d<C;){var O=e["down"===this.customArgs.action?d-(this.customArgs.drillInfo.currentCell.ordinal+1):d].querySelectorAll("Member"),P=0,N=void 0,E=this.tupRowInfo[d].allCount,F=this.tupRowInfo[d].allStartPos,I=this.tupRowInfo[d].measure,L=this.tupRowInfo[d].typeCollection,A=this.tupRowInfo[d].drillStartPos,R=this.tupRowInfo[d].startDrillUniquename;if(0===d||d===w){for(var k="down"===this.customArgs.action?this.tupRowInfo[0].members:O;P<k.length;)"1"===k[P].querySelector("MEMBER_TYPE").textContent&&0===Number(k[P].querySelector("LNum").textContent)?f[P]=0:f[P]=Number(k[P].querySelector("LNum").textContent),"1"===k[P].querySelector("MEMBER_TYPE").textContent?(h[P]=0,g=-1===g?P:g,m=P):(h[P]=1,c="3"!==k[P].querySelector("MEMBER_TYPE").textContent||c),P++;l=L.indexOf("3")}if(P=0,0===d&&(O.length>E+(I?1:0)||1===O.length&&I)&&v.pop(),0===d&&this.isPaging?0===v.length:!c||E===s||F!==o||1===O.length&&I){var j=this.checkAttributeDrill(this.tupRowInfo[d].drillInfo,"rows"),q=!(A>-1)||(!(E>0)||(j||F>A));q=b&&q&&A>-1?b.startDrillUniquename!==R||!(m>b.measurePosition||b.measureName===this.tupRowInfo[d].measureName||F!==A+1&&this.tupRowInfo[d].measurePosition!==A+1):q;var H=!(g>-1&&E>0)||(j||F>m);if((M="Top"===this.dataSourceSettings.grandTotalsPosition&&0===this.olapRowValueIndex&&"row"===this.olapValueAxis&&this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&("row"!==this.olapValueAxis||this.dataSourceSettings.rows.length>1))&&1===v.length&&(v=this.frameGrandTotalValues(e,v,L,l)),O.length===E+(I?1:0)&&I&&!M){var V="Grand Total"+this.valueSortSettings.headerDelimiter+this.dataFields[this.getUniqueName(O[l].querySelector("UName").textContent)].caption?this.dataFields[this.getUniqueName(O[l].querySelector("UName").textContent)].caption:O[l].querySelector("Caption").textContent,U="3"===L[l]&&this.dataFields[this.getUniqueName(O[l].querySelector("UName").textContent)]&&this.dataFields[this.getUniqueName(O[l].querySelector("UName").textContent)].caption?this.dataFields[this.getUniqueName(O[l].querySelector("UName").textContent)].caption:O[l].querySelector("Caption").textContent;(v=this.frameGrandTotalAxisSet(v,this.getUniqueName(O[l].querySelector("UName").textContent),U,a,d,Number(L[l]),O[l].querySelector("PARENT_UNIQUE_NAME")?O[l].querySelector("PARENT_UNIQUE_NAME").textContent:void 0,O[l].querySelector("LName").textContent,O[l].getAttribute("Hierarchy"),{levelName:V,axis:O[l].getAttribute("Hierarchy")}))[v.length-1].valueSort[V]=1}else if(0!==F&&(0!==l||1!==F)&&q&&H){"Top"===this.dataSourceSettings.grandTotalsPosition&&i&&this.dataSourceSettings.showGrandTotals&&("row"!==this.olapValueAxis||this.dataSourceSettings.rows.length>1)&&(this.insertRowGrandTotal(v,n,r,e,a),a=this.pivotValues.length,i=!1),b=this.tupRowInfo[d];var _=a,B=P;N={};for(var G=!1;P<O.length;){var z=O[P];if(z.querySelector("UName").textContent!==p[P]&&"2"!==L[P]&&(!(Object.keys(N).length>0?N.isDrilled&&!this.fieldList[N.hierarchy].isHierarchy:G)||"3"===L[P]&&h[P-1]&&0!==h[P+1])){var W=Number(z.querySelector("LNum").textContent)-(h[P]&&"3"!==L[P]?1:f[P]),Q=!!this.namedSetsPosition.row[P],Y=this.getUniqueName(z.querySelector("UName").textContent),K=this.getDepth(this.tupRowInfo[d],Y,Number(L[P])),V=this.getCaptionCollectionWithMeasure(this.tupRowInfo[d],P,!0);if(this.showSubTotalsAtBottom&&a>this.rowStartPos&&(_=a=this.insertRowSubTotal(r,n,D,a,W,V)),!(this.isPaging&&r[T][0]&&this.fieldList[r[T][0].hierarchy]&&this.fieldList[r[T][0].hierarchy].isHierarchy&&r[T][0].hasChild&&!r[T][0].isDrilled&&!this.rows[P].isNamedSet&&(0===this.rows[P].name.indexOf("[Measures]")||this.fieldList[z.getAttribute("Hierarchy")]&&(this.fieldList[z.getAttribute("Hierarchy")].isHierarchy||this.fieldList[z.getAttribute("Hierarchy")].hasAllMember))&&r[T][0].depth<K)){r[a]=[{axis:"row",actualText:Y,colIndex:0,formattedText:"3"===L[P]&&this.dataFields[Y]&&this.dataFields[Y].caption?this.dataFields[Y].caption:z.querySelector("Caption").textContent,hasChild:!!(this.fieldList[z.getAttribute("Hierarchy")]&&this.fieldList[z.getAttribute("Hierarchy")].isHierarchy&&P<this.rows.length-1&&!this.rows[P+1].isNamedSet&&this.rows[P+1].name.indexOf("[Measures]")<0&&this.fieldList[this.rows[P+1].name]&&this.fieldList[this.rows[P+1].name].hasAllMember)||Number(z.querySelector("CHILDREN_CARDINALITY").textContent)>0,level:W,depth:K,rowIndex:a,index:[],ordinal:d,type:"header",colSpan:1,rowSpan:1,memberType:Number(L[P]),isDrilled:!(!this.fieldList[z.getAttribute("Hierarchy")]||!this.fieldList[z.getAttribute("Hierarchy")].isHierarchy||this.isAttributeDrill(z.getAttribute("Hierarchy"),this.tupRowInfo[d].drillInfo,"rows"))||this.tupRowInfo[d].drillInfo[P].isDrilled,parentUniqueName:z.querySelector("PARENT_UNIQUE_NAME")?z.querySelector("PARENT_UNIQUE_NAME").textContent:void 0,levelUniqueName:z.querySelector("LName").textContent,hierarchy:z.getAttribute("Hierarchy"),isNamedSet:Q,valueSort:{levelName:"",axis:z.getAttribute("Hierarchy")}}],this.olapVirtualization&&"header"===r[a][0].type&&delete r[a][0].type,(N="3"!==L[P]?r[a][0]:N)||u.push(z.querySelector("Caption").textContent),V=this.getCaptionCollectionWithMeasure(this.tupRowInfo[d],P,!1),r[a][0].valueSort.levelName=V,r[a][0].valueSort[V]=1,n[a-this.rowStartPos]={},n[a-this.rowStartPos][0]=r[a][0],I&&l>P&&(p[l]="");for(var X=P+1;X<O.length;X++)p[X]="";p[P]=z.querySelector("UName").textContent,T=3!==Number(L[P])?a:T,a++,B=P}}else"2"===L[P]?B=P:this.tupRowInfo[d].drillInfo[P].isDrilled&&0===h[P]&&(G=!0);this.tupRowInfo[d].drillInfo[P].isDrilled&&this.tupRowInfo[d].showTotals&&(this.tupRowInfo[d].showTotals=!!this.showRowSubTotals&&void 0===this.hideRowTotalsObject[this.tupRowInfo[d].drillInfo[P].hierarchy]),P++}_<a&&B>=O.length-1&&(r[a-1][0].ordinal=d,"header"===r[a-1][0].type&&delete r[a-1][0].type)}s=E,o=F}d++}this.showSubTotalsAtBottom&&D.length>0&&(D.reverse(),D.forEach(function(e){r[a]=[e],n[a-t.rowStartPos]={},n[a-t.rowStartPos][0]=r[a][0],a++})),("Top"!==this.dataSourceSettings.grandTotalsPosition||"row"===this.olapValueAxis&&1===this.dataSourceSettings.rows.length&&"Top"===this.dataSourceSettings.grandTotalsPosition||0===this.dataSourceSettings.rows.length)&&this.insertRowGrandTotal(v,n,r,e,a)},e.prototype.insertRowSubTotal=function(e,t,i,a,r,n){var o=f.frameHeaderWithKeys(e[a-1][0]);if(o.level<r&&"grand sum"!==o.type&&(o.isDrilled||3===o.memberType))if(3===o.memberType){for(var s=[],l=1;3===e[a-l][0].memberType;)s[s.length]=e[a-l][0],l++;if(e[a-l][0].isDrilled&&0!==s.length){for(var d=0,p=s.length;d<p;d++)s[d].formattedText=e[a-l][0].formattedText+" "+s[d].formattedText,s[d].isSum=!0,s[d].type="sum",s[d].parentUniqueName=e[a-l][0].levelUniqueName,i[i.length]=s[d];a-=--l}}else o.hasChild=!1,o.isDrilled=!1,o.isSum=!0,o.type="sum",o.formattedText=o.formattedText+" Total",i[Object.keys(i).length]=o;if(i.length>0)for(var h=i.length-1,u=i[h].valueSort.levelName.split(".").length,c=n.split(".").length;u>=c&&(e[a]=[i[h]],t[a-this.rowStartPos]={},t[a-this.rowStartPos][0]=e[a][0],a++,i.splice(i.length-1,1),Object.keys(i).length>0);)u=i[--h].valueSort.levelName.split(".").length;return a},e.prototype.insertRowGrandTotal=function(e,t,i,a,r){if(e.length>1&&3!==e[0].memberType&&(e[0].ordinal=-1),"down"!==this.customArgs.action){var n=0===this.dataSourceSettings.rows.length||1===this.dataSourceSettings.rows.length&&"[Measures]"===this.dataSourceSettings.rows[0].name;if(this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals||n)for(var o=0;o<e.length;o++)e[o].rowIndex=r,i[r]=[e[o]],t[r-this.rowStartPos]={},t[r-this.rowStartPos][0]=i[r][0],r++}else this.updateRowEngine(i,t,a.length),this.onDemandDrillEngine=i;return e},e.prototype.frameGrandTotalAxisSet=function(e,t,i,a,r,n,o,s,l,d){return e.push({axis:"row",actualText:t,colIndex:0,formattedText:i,hasChild:!1,level:-1,rowIndex:a,index:[],ordinal:r,colSpan:1,rowSpan:1,memberType:n,isDrilled:!1,parentUniqueName:o,levelUniqueName:s,hierarchy:l,valueSort:d}),e},e.prototype.getDepth=function(e,t,i){var a=e.uNameCollection.indexOf(t),r=(e.uNameCollection.substring(0,a)+(3===i?"":t)).split("::[").map(function(e){return"["===e[0]?e:"["+e});3===i&&this.rowMeasurePos===r.length&&r.push(t);for(var n=-1,o=0;o<r.length;o++)n+=r[o].split("~~").length;return n},e.prototype.checkAttributeDrill=function(e,t){for(var i=!1,a=0;a<e.length&&!(i=this.isAttributeDrill(e[a].hierarchy,e,t));a++);return i},e.prototype.frameTupCollection=function(e,i,a,r,n,o,s){for(var l,d,p,h,u,c,g=0,m=0,f=[],v=[],S=[],y="",b="",C=!0,x=-1;g<e.length;){var w=e[g],T=Number(w.querySelector("LNum").textContent),M=w.querySelector("UName").textContent;Number(w.querySelector("MEMBER_TYPE").textContent)>3&&(w.querySelector("MEMBER_TYPE").textContent=0===M.indexOf("[Measures]")?"3":"1");var D=0===M.indexOf("[Measures]")?"3":Number(w.querySelector("MEMBER_TYPE").textContent)>3?"1":w.querySelector("MEMBER_TYPE").textContent,O=w.querySelector("Caption").textContent;this.fieldList[O]&&"CalculatedField"===this.fieldList[O].type&&(O=this.fieldList[O].caption,w.querySelector("Caption").textContent=O);var P=w.getAttribute("Hierarchy"),N=w.querySelector("PARENT_UNIQUE_NAME")?w.querySelector("PARENT_UNIQUE_NAME").textContent:"";if("2"===D?(this.isPaging||m++,p=t.isNullOrUndefined(p)?g:p):"3"===D?(h=w,u=M,c=g,"column"===s?(this.colMeasures[M]=w,this.colMeasurePos=g):this.rowMeasurePos=g):x=o[P],"2"!==D){if(this.headerGrouping[g]){if(T>this.lastLevel[g])this.lastLevel[g]=T;else if(T<this.lastLevel[g]){for(var E=this.lastLevel[g];E>=T;)delete this.headerGrouping[g].UName[E],delete this.headerGrouping[g].Caption[E],E--;this.lastLevel[g]=T}this.headerGrouping[g].UName[T]=M,this.headerGrouping[g].Caption[T]=O}else this.lastLevel[g]=T,this.headerGrouping[g]={UName:(l={},l[T]=M,l),Caption:(d={},d[T]=O,d)};if(this.isPaging)for(var F=N;this.drilledSets[F];){var I=this.drilledSets[F].querySelector("Caption").textContent,L=Number(this.drilledSets[F].querySelector("LNum").textContent);this.headerGrouping[g].UName[L]=F,this.headerGrouping[g].Caption[L]=I,F=null===this.drilledSets[F].querySelector("PARENT_UNIQUE_NAME")?"":this.drilledSets[F].querySelector("PARENT_UNIQUE_NAME").textContent}for(var A="",R=Object.keys(this.headerGrouping[g].UName),k=0;k<R.length;k++){H=R[k];A=0===k?this.headerGrouping[g].UName[Number(H)]:A+"~~"+this.headerGrouping[g].UName[Number(H)]}y=""===y?A:y+"::"+A;for(var j="",q=Object.keys(this.headerGrouping[g].Caption),k=0;k<q.length;k++){var H=q[k];j=0===k?this.headerGrouping[g].Caption[Number(H)]:j+"~~"+this.headerGrouping[g].Caption[Number(H)]}g!==c&&(b=""===b?j:b+"::"+j)}if(f.push(D),v.push(T),(t.isNullOrUndefined(i[g])||i[g]<T)&&(i[g]=T),S.push({level:T,uName:M,hierarchy:P,isDrilled:!1}),r[a-1]&&"1"===r[a-1].typeCollection[g]&&S[g].level>r[a-1].drillInfo[g].level){var V=y.split(/~~|::\[/).map(function(e){return"["===e[0]?e:"["+e});V.pop();var U=V.join("~~");this.setDrillInfo(N,U,g,a,r)}g++}return x>-1&&(C="2"!==f[x+1]),r[a]={allCount:m,allStartPos:p,measure:h,measureName:u,measurePosition:c,members:e,typeCollection:f,uNameCollection:y,captionCollection:b,levelCollection:v,drillInfo:S,drillStartPos:-1,drillEndPos:-1,showTotals:!(!n&&m>0&&p>(0===c?1:0))&&C},i},e.prototype.getCaptionCollectionWithMeasure=function(e,t,i){var a=e.captionCollection,r=!0;if(!i&&"3"!==e.typeCollection[t])for(var n=0;n<this.measurePosition;n++)if(e.drillInfo[t].hierarchy===this.dataSourceSettings.rows[n].name){r=!1;break}if(e.measure&&r){var o=this.getUniqueName(e.measure.querySelector("UName").textContent),s=this.dataFields[o]&&this.dataFields[o].caption?this.dataFields[o].caption:e.measure.querySelector("Caption").textContent,l=e.uNameCollection.split(/[~~::]+/g).indexOf(e.measureName);(d=e.captionCollection.split(/[~~::]+/g)).splice(l,0,s),a=d.join(this.valueSortSettings.headerDelimiter)}else{var d=e.captionCollection.split(/[~~::]+/g);a=d.join(this.valueSortSettings.headerDelimiter)}return a},e.prototype.setNamedSetsPosition=function(){this.namedSetsPosition={};var e=0;do{for(var t={},i=e?this.dataSourceSettings.rows:this.dataSourceSettings.columns,a=0;a<i.length;a++)i[a].isNamedSet&&(t[a]=i[a].name);this.namedSetsPosition[e?"row":"column"]=t,e++}while(e<2)},e.prototype.updateRowEngine=function(e,t,i){for(var a=this.pivotValues.length-1,r=Object.keys(e).length;a>this.customArgs.drillInfo.currentCell.rowIndex;)this.pivotValues[a+r]=this.pivotValues[a],this.pivotValues[a+r][0].ordinal+=i,this.pivotValues[a+r][0].rowIndex+=r,this.valueContent[a+r-this.rowStartPos]=this.valueContent[a-this.rowStartPos],a--;for(var n=0;n<e.length;n++)this.pivotValues[n]=e[n],this.valueContent[Number(n)-this.rowStartPos]=t[Number(n)-this.rowStartPos];this.pivotValues[this.customArgs.drillInfo.currentCell.rowIndex][0].isDrilled=!0},e.prototype.updateTupCollection=function(e){for(var t="row"===this.customArgs.drillInfo.axis?this.tupRowInfo:this.tupColumnInfo,i=t.length-1;i>this.customArgs.drillInfo.currentCell.ordinal;)t[i+e]=t[i],i--},e.prototype.frameGrandTotalValues=function(e,t,i,a){for(var r=0,n=!1;r<e.length&&!n;){var o=e["down"===this.customArgs.action?r-(this.customArgs.drillInfo.currentCell.ordinal+1):r].querySelectorAll("Member"),s=this.tupRowInfo[r].allCount,l=(this.tupRowInfo[r].allStartPos,this.tupRowInfo[r].measure),d=this.tupRowInfo[r].typeCollection;this.tupRowInfo[r].drillStartPos,this.tupRowInfo[r].startDrillUniquename;if(0===r&&(o.length>s+(l?1:0)||1===o.length&&l)&&t.pop(),0!==r||!this.isPaging||0===t.length){this.checkAttributeDrill(this.tupRowInfo[r].drillInfo,"rows");if(o.length===s+(l?1:0)&&l){var p="Grand Total"+this.valueSortSettings.headerDelimiter+o[a].querySelector("Caption").textContent,h="3"===d[a]&&this.dataFields[this.getUniqueName(o[a].querySelector("UName").textContent)]&&this.dataFields[this.getUniqueName(o[a].querySelector("UName").textContent)].caption?this.dataFields[this.getUniqueName(o[a].querySelector("UName").textContent)].caption:o[a].querySelector("Caption").textContent;(t=this.frameGrandTotalAxisSet(t,this.getUniqueName(o[a].querySelector("UName").textContent),h,this.pivotValues.length,r,Number(d[a]),o[a].querySelector("PARENT_UNIQUE_NAME")?o[a].querySelector("PARENT_UNIQUE_NAME").textContent:void 0,o[a].querySelector("LName").textContent,o[a].getAttribute("Hierarchy"),{levelName:p,axis:o[a].getAttribute("Hierarchy")}))[t.length-1].valueSort["Grand Total"+this.valueSortSettings.headerDelimiter+o[a].querySelector("Caption").textContent]=1}}n=this.dataSourceSettings.values.length+1===t.length,r++}return t},e.prototype.frameColumnHeader=function(e){var t=this;this.headerGrouping={},this.lastLevel=[];for(var i=0,a=[],r=[],n=[],o=-1,s=-1,l=this.customArgs.drillInfo&&"column"===this.customArgs.drillInfo.axis?this.customArgs.drillInfo.currentCell.ordinal+1:0;i<e.length;){d=e[i].querySelectorAll("Member");a=this.frameTupCollection(d,a,i+l,this.tupColumnInfo,this.showColumnSubTotals,this.hideColumnTotalsObject,"column"),i++}if(this.olapVirtualization&&(a=a.slice(0,a.length-1).map(function(e){return 0===e?1:e}).concat(a.slice(a.length-1))),e.length>0)for(var d=e[0].querySelectorAll("Member"),p=0;p<d.length;)n[p]="1"===d[p].querySelector("MEMBER_TYPE").textContent&&0===Number(d[p].querySelector("LNum").textContent)?0:Number(d[p].querySelector("LNum").textContent),"1"!==d[p].querySelector("MEMBER_TYPE").textContent||!this.isPaging&&0!==Number(d[p].querySelector("LNum").textContent)?r[p]=1:(r[p]=0,o=-1===o?p:o,s=p),p++;i=0;for(var h,u=1,c={},g=!0,m=!1,f=this;i<e.length;)!function(){var l=e[i].querySelectorAll("Member"),d=f.tupColumnInfo[i].allCount,p=f.tupColumnInfo[i].allStartPos,v=f.tupColumnInfo[i].measure,S=f.tupColumnInfo[i].typeCollection,y=f.tupColumnInfo[i].drillInfo,b=f.tupColumnInfo[i].drillStartPos,C=f.tupColumnInfo[i].startDrillUniquename,x=f.tupColumnInfo[i].endDrillUniquename,w=f.tupColumnInfo[i].drillEndPos,T=f.tupColumnInfo[i].levelCollection,M="2"!==S[0]&&("3"!==S[0]||"2"!==S[1]),D=0;a.map(function(e,i){D+=0===r[i]?e+(1-(n[i]>1?1:n[i])):0===e?t.isPaging&&"2"===S[i]?0:1:e}),f.colDepth=f.colDepth>D?f.colDepth:D,0===i&&l.length>d+(v?1:0)&&(m=!0,M=d>0&&M?p>o:M);var O=!1;if("Top"===f.dataSourceSettings.grandTotalsPosition&&f.dataSourceSettings.showGrandTotals&&f.dataSourceSettings.showColumnGrandTotals){for(var P=0,N=0;N<l.length;N++)0===l[N].querySelector("Caption").textContent.indexOf("All")&&P++;O=P===("column"===f.olapValueAxis?f.dataSourceSettings.columns.length-1:f.dataSourceSettings.columns.length)}if((M||O)&&(0===d||O)){var E=[-1,-1,-1];f.tupColumnInfo[i-1]&&0===f.tupColumnInfo[i-1].allCount?E=f.levelCompare(T,f.tupColumnInfo[i-1].levelCollection):m&&h&&(E=f.levelCompare(T,h.levelCollection)),f.tupColumnInfo[i].drillStartPos<0||f.showSubTotalsAtTop?(!g&&E[0]>-1&&E[2]>-1&&(u=f.mergeTotCollection(u,d,a,n,r,p,y,E)),f.setParentCollection(l),f.frameCommonColumnLoop(l,i,u,a,r,n),f.tupColumnInfo[i].showTotals||u--,!g&&E[0]>-1&&E[2]>-1&&(u=f.mergeTotCollection(u,d,a,n,r,p,y,E)),g=!1,f.isColDrill?f.isColDrill=!1:u++):c.drillStartPos===b&&c.startDrillUniquename===C&&c.allCount!==d||(!g&&E[0]>-1&&E[2]>-1&&(u=f.mergeTotCollection(u,d,a,n,r,p,y,E),g=!0),f.setParentCollection(l),(!m||s<=b)&&(O||(f.totalCollection[f.totalCollection.length]={allCount:d,ordinal:i,members:l,drillInfo:y}),c.allCount=d,c.allStartPos=p,c.drillStartPos=b,c.startDrillUniquename=C,c.endDrillUniquename=x)),h=f.tupColumnInfo[i]}var F=f.checkAttributeDrill(f.tupColumnInfo[i].drillInfo,"columns");if(d>0&&(!m||M&&(F||s<p))&&(d===c.allCount||p!==c.allStartPos)){var I=w===b||c.endDrillUniquename===x,L=p!==c.allStartPos?c.startDrillUniquename!==C:I;b>-1&&!L||(g||(u=f.mergeTotCollection(u,d,a,n,r,p,y),g=!0),f.setParentCollection(l),m&&b>-1&&!(s<=b)||(O||(f.totalCollection[f.totalCollection.length]={allCount:d,ordinal:i,members:l,allStartPos:p,drillInfo:y}),c.allCount=d,c.allStartPos=p,c.drillStartPos=b,c.startDrillUniquename=C,c.endDrillUniquename=x))}i++}();if(this.totalCollection.length>0)if(Object.keys(this.colMeasures).length>1)this.orderTotals(u,a,r,n);else{this.totalCollection=this.totalCollection.reverse();for(var v=0,S=this.totalCollection;v<S.length;v++){var y=S[v];if(!(0===this.tupColumnInfo[y.ordinal].measurePosition?1===this.tupColumnInfo[y.ordinal].allStartPos:0===this.tupColumnInfo[y.ordinal].allStartPos)||this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals){this.frameCommonColumnLoop(y.members,y.ordinal,u,a,n,r);var b=this.checkAttributeDrill(this.tupColumnInfo[y.ordinal].drillInfo,"columns");(this.tupColumnInfo[y.ordinal].showTotals||b)&&u++}}}},e.prototype.orderTotals=function(e,t,i,a){for(var r={},n=1,o=0,s=this.totalCollection;o<s.length;o++){var l=s[o];if(!(0===this.tupColumnInfo[l.ordinal].measurePosition?1===this.tupColumnInfo[l.ordinal].allStartPos:0===this.tupColumnInfo[l.ordinal].allStartPos)||this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals){var d=this.tupColumnInfo[l.ordinal].measure.querySelector("UName").textContent;r[d]?(r[d].coll.push(l),n=n<++r[d].count?r[d].count:n):r[d]={coll:[l],count:1}}}for(var p=Object.keys(r),h=n-1;h>-1;){for(var u=0,c=p;u<c.length;u++)(l=r[c[u]].coll[h])&&(this.frameCommonColumnLoop(l.members,l.ordinal,e,t,i,a),this.tupColumnInfo[l.ordinal].showTotals&&e++);h--}},e.prototype.setParentCollection=function(e){for(var t=0;e.length>t;){var i=e[t],a=Number(i.querySelector("MEMBER_TYPE").textContent)>2?"3":i.querySelector("MEMBER_TYPE").textContent,r=Number(i.querySelector("LNum").textContent),n=i.querySelector("UName").textContent,o=i.querySelector("PARENT_UNIQUE_NAME")?i.querySelector("PARENT_UNIQUE_NAME").textContent:"",s=!0,l=!1;if(this.parentObjCollection[t]){var d=Object.keys(this.parentObjCollection[t]),p=this.parentObjCollection[t][r-1];s=p?o===p.querySelector("UName").textContent:0===d.length,l="1"===this.tupColumnInfo[0].typeCollection[t]}"2"===a?delete this.parentObjCollection[t]:(!this.isPaging&&!l||s||delete this.parentObjCollection[t],this.parentObjCollection[t]?this.parentObjCollection[t][r]&&this.parentObjCollection[t][r].querySelector("UName").textContent===n||(this.parentObjCollection[t][r]=i):(this.parentObjCollection[t]={},this.parentObjCollection[t][r]=i)),t++}},e.prototype.setDrillInfo=function(e,t,i,a,r){for(a--;r[a]&&r[a].drillInfo[i].uName===e&&!(r[a].uNameCollection.split(/~~|::\[/).map(function(e){return"["===e[0]?e:"["+e}).join("~~").indexOf(t)<0);)r[a].drillInfo[i].isDrilled=!0,this.curDrillEndPos<=i&&(r[a].drillEndPos=this.curDrillEndPos=i,r[a].endDrillUniquename=e),(r[a].drillStartPos>i||-1===r[a].drillStartPos)&&(r[a].drillStartPos=i),r[a].startDrillUniquename=e,a--},e.prototype.levelCompare=function(e,t){for(var i=[-1,0],a=0;a<t.length;a++)if(e[a]!==t[a]){i=[a,e[a],t[a]-e[a]];break}return i},e.prototype.mergeTotCollection=function(e,i,a,r,n,o,s,l){for(var d=t.isNullOrUndefined(o)?l[0]:o-(this.colMeasurePos===o-1?2:1),p=s[d]&&s[d].level,h=this.getLevelsAsString(d-1,s),u={},c=1,g=!1,m=0,f=this.totalCollection;m<f.length;m++){var v=f[m];if(g||v.allCount<=i&&(!(p>-1&&v.drillInfo[d])||v.drillInfo[d].level>=p&&this.getLevelsAsString(d-1,v.drillInfo)===h)){var S=this.tupColumnInfo[v.ordinal].measure?this.tupColumnInfo[v.ordinal].measure.querySelector("UName").textContent:"measure";u[S]?(u[S].coll.push(v),c=c<++u[S].count?u[S].count:c):u[S]={coll:[v],count:1},g=!1}}for(var y=Object.keys(u),b=c-1;b>-1;){for(var C=0,x=y;C<x.length;C++){var w=u[x[C]].coll[b];w&&((!(0===this.tupColumnInfo[w.ordinal].measurePosition?1===this.tupColumnInfo[w.ordinal].allStartPos:0===this.tupColumnInfo[w.ordinal].allStartPos)||this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals)&&(this.frameCommonColumnLoop(w.members,w.ordinal,e,a,n,r),this.tupColumnInfo[w.ordinal].showTotals&&e++),this.totalCollection.pop())}b--}return e},e.prototype.getLevelsAsString=function(e,t){for(var i=[],a=0;a<e;a++)i[a]=t[a].level;return i.length>0?i.toString():""},e.prototype.frameCommonColumnLoop=function(e,t,i,a,r,n){var o,s=-1;if(this.tupColumnInfo[t].showTotals)for(var l=0,d=0;l<e.length;)d+=n[l]>0&&this.getMeasurePosition(this.tupColumnInfo[t].uNameCollection,this.tupColumnInfo[t].measurePosition)!==l?a[l]:a[l]+(1-r[l]),this.tupColumnInfo[t].drillInfo[l].isDrilled&&this.tupColumnInfo[t].showTotals&&(this.tupColumnInfo[t].showTotals=!!this.showColumnSubTotals&&void 0===this.hideColumnTotalsObject[this.tupColumnInfo[t].drillInfo[l].hierarchy],d-=a[l]-this.tupColumnInfo[t].levelCollection[l],s=this.tupColumnInfo[t].showTotals?-1:d-1),l++;var p=this.checkAttributeDrill(this.tupColumnInfo[t].drillInfo,"columns");if(this.tupColumnInfo[t].showTotals||p)for(var h=0,u=0,c={},g="0"===e[0].querySelector("LNum").textContent;h<e.length;){for(var m=e[h],f=Number(m.querySelector("MEMBER_TYPE").textContent)>2?"3":m.querySelector("MEMBER_TYPE").textContent,v=0,S=m.querySelector("LNum").textContent,y="2"!==f?n[h]?1:r[h]:1;y<=("3"===f?1:a[h]);y++){var b=!1;this.pivotValues[u]||(this.pivotValues[u]=[]),Number(e[h].querySelector("LNum").textContent)>y&&"2"!==f?(this.parentObjCollection[h][y]||this.getDrilledParent(e[h],y,this.parentObjCollection[h]),this.parentObjCollection[h][y]&&(m=this.parentObjCollection[h][y]),b=!0):(m=e[h],v++);var C=this.getUniqueName(m.querySelector("UName").textContent);"2"!==f?c[C]="3"===f&&this.dataFields[C]&&this.dataFields[C].caption?this.dataFields[C].caption:m.querySelector("Caption").textContent:"2"===f&&"0"===S&&g&&(c[C]="Grand Total",g=!1);for(var x=Object.keys(c),w=h>=this.measurePosition&&0===Number(m.getElementsByTagName("LNum")[0].textContent)&&1===x.length?"Grand Total"+this.valueSortSettings.headerDelimiter:"",T=0;T<x.length;T++){var M=x[T];0===T?w+=c[M]:w=w+this.valueSortSettings.headerDelimiter+c[M]}var D=!!this.namedSetsPosition.column[h],O=this.getDepth(this.tupColumnInfo[t],C,Number(f));if(this.isPaging&&this.pivotValues[u-1]&&this.pivotValues[u-1][i]&&this.fieldList[this.pivotValues[u-1][i].hierarchy]&&this.fieldList[this.pivotValues[u-1][i].hierarchy].isHierarchy&&this.pivotValues[u-1][i].hasChild&&!this.pivotValues[u-1][i].isDrilled&&!this.columns[h].isNamedSet&&this.fieldList[m.getAttribute("Hierarchy")]&&(this.fieldList[m.getAttribute("Hierarchy")].isHierarchy||this.fieldList[m.getAttribute("Hierarchy")].hasAllMember)&&this.pivotValues[u-1][i].depth<O){this.isColDrill=!0;break}this.pivotValues[u][i]={axis:"column",actualText:C,colIndex:i,formattedText:"3"===f&&this.dataFields[C]&&this.dataFields[C].caption?this.dataFields[C].caption:m.querySelector("Caption").textContent,hasChild:!!(this.fieldList[m.getAttribute("Hierarchy")]&&this.fieldList[m.getAttribute("Hierarchy")].isHierarchy&&h<this.columns.length-1&&!this.columns[h+1].isNamedSet&&this.columns[h+1].name.indexOf("[Measures]")<0&&this.fieldList[this.columns[h+1].name]&&this.fieldList[this.columns[h+1].name].hasAllMember)||Number(m.querySelector("CHILDREN_CARDINALITY").textContent)>0,level:v>1?-1:Number(m.querySelector("LNum").textContent)-(n[h]&&"3"!==f?1:0),rowIndex:u,ordinal:t,memberType:Number(f),depth:O,isDrilled:!(!this.fieldList[m.getAttribute("Hierarchy")]||!this.fieldList[m.getAttribute("Hierarchy")].isHierarchy||this.isAttributeDrill(m.getAttribute("Hierarchy"),this.tupColumnInfo[t].drillInfo,"columns"))||(b||this.tupColumnInfo[t].drillInfo[h].isDrilled),parentUniqueName:m.querySelector("PARENT_UNIQUE_NAME")?m.querySelector("PARENT_UNIQUE_NAME").textContent:void 0,levelUniqueName:m.querySelector("LName").textContent,hierarchy:m.getAttribute("Hierarchy"),isNamedSet:D,valueSort:(o={levelName:w},o[w]=1,o.axis=m.getAttribute("Hierarchy"),o)},this.headerContent[u]||(this.headerContent[u]={}),this.headerContent[u][i]=this.pivotValues[u][i],u++}h++}else if(s>-1)this.pivotValues[s][i-1].ordinal=t;else if(this.tupColumnInfo[t].allCount>0){for(var l=0,d=0;l<this.tupColumnInfo[t].allStartPos;)d+=n[l]>0&&this.getMeasurePosition(this.tupColumnInfo[t].uNameCollection,this.tupColumnInfo[t].measurePosition)!==l?a[l]:a[l]+(1-r[l]),l++;this.tupColumnInfo[t].allStartPos===this.tupColumnInfo[t].measurePosition+1?d-=a[this.tupColumnInfo[t].allStartPos-2]-this.tupColumnInfo[t].levelCollection[this.tupColumnInfo[t].allStartPos-2]+1:d-=a[this.tupColumnInfo[t].allStartPos-1]-this.tupColumnInfo[t].levelCollection[this.tupColumnInfo[t].allStartPos-1],this.pivotValues[d-1]&&(this.pivotValues[d-1][i-1].ordinal=t)}},e.prototype.isAttributeDrill=function(e,t,i){var a=!1;if(!this.isAdjacentToMeasure(e,i))for(var r=0;r<this.drilledMembers.length;r++)if(this.drilledMembers[r].name===e)for(var n=0;n<this.drilledMembers[r].items.length;n++){for(var o=this.drilledMembers[r].delimiter,s=this.drilledMembers[r].items[n].split(o),l="",d=0;d<s.length;d++)t[d]&&t[d].uName&&(l=l+(""===l?"":this.drilledMembers[r].delimiter)+t[d].uName);if(l===this.drilledMembers[r].items[n]){a=!0;break}}return a},e.prototype.isAdjacentToMeasure=function(e,t){for(var i=!1,a="rows"===t?this.rows:this.columns,r=0;r<a.length;r++)if(a[r].name===e&&a[r+1]&&("[Measures]"===a[r+1].name||a[r+1].isNamedSet||this.fieldList[a[r+1].name]&&!this.fieldList[a[r+1].name].hasAllMember)){i=!0;break}return i},e.prototype.getDrilledParent=function(e,t,i){for(var a=e,r=Number(e.querySelector("LNum").textContent)-1;r>=t;r--){var n=this.drilledSets[a.querySelector("PARENT_UNIQUE_NAME").textContent];if(!n)break;i[r]=n,a=n}},e.prototype.performRowSorting=function(e,t){var i;if((this.enableSort||this.enableValueSorting)&&this.tupRowInfo.length>0){for(var a=this.pivotValues.length,r={},n={},o=[],s=!1,l=this.tupRowInfo[0].typeCollection.lastIndexOf("1"),d=void 0,p=this.colDepth;p<a;p++){V=this.pivotValues[p][0];if(!this.showSubTotalsAtBottom||!V.isSum||3===V.memberType){var h=this.tupRowInfo[V.ordinal],u=h?0===h.measurePosition&&3===V.memberType?h.measureName:h.uNameCollection:"";if(""!==u){l>-1&&(u=this.frameUniqueName(u,V,h));var c=u.split(/~~|::\[/).length;3===V.memberType&&this.tupRowInfo[0].measurePosition>0?n[_=this.getParentUname(u,V,!0,!0)]?n[_].push(V):n[_]=[V]:r[c]?r[c][u]=[V]:r[c]=(i={},i[u]=[V],i)}s&&o.push(V),"grand sum"===V.type&&(s=!0)}}for(var g=Object.keys(n).length>0&&this.tupRowInfo[0].measurePosition>0,m=Object.keys(r).map(function(e){return Number(e)}).sort(function(e,t){return e>t?1:t>e?-1:0}),v={},S=m.length-1;S>=0;S--){for(var y={},b=r[m[S]],C=Object.keys(b),x=0;x<C.length;x++)y[_=0===S?"parent":this.getParentUname(C[x],b[C[x]][0],g,!1)]?y[_].push(b[C[x]][0]):y[_]=[b[C[x]]][0];for(var w=Object.keys(y),T=0;T<w.length;T++)y[w[T]]=this.sortRowHeaders(y[w[T]],e,t);if(v[m[S+1]])for(T=0;T<w.length;T++){for(var M=[],D=y[w[T]],O=0;O<D.length;O++){var P=this.tupRowInfo[D[O].ordinal],N=0===P.measurePosition&&3===D[O].memberType?P.measureName:P.uNameCollection;M.push(D[O]),l>-1&&(N=this.frameUniqueName(N,D[O],P));var E=!1;if(g&&n[_=this.getParentUname(N,D[O],g,!0)]){n[_]=this.sortRowHeaders(n[_],e,t);var F=N.lastIndexOf("::[")===N.indexOf("::[Measures]"),I=N.split("::[").length-1===P.measurePosition,L=!P.drillInfo[P.measurePosition-1].isDrilled,A=P.members.length>P.measurePosition+1;if(F&&I&&L&&A){E=!0;for(var R=0;R<n[_].length;R++){M.push(n[_][R]);var k=N.substring(0,N.indexOf("::[Measures]"))+"::"+n[_][R].actualText;v[m[S+1]][k]&&(M=M.concat(v[m[S+1]][k]))}}else d=this.showSubTotalsAtBottom&&M[M.length-1].isDrilled,M=M.concat(n[_])}if(!E&&v[m[S+1]][N])if(this.showSubTotalsAtBottom&&3===M[M.length-1].memberType&&M[M.length-1].level>-1&&d){for(var j=[],q=0,H=M.length-1;H>=0;H--){if(3!==M[H].memberType){j=j.reverse(),q=H+1;break}j[j.length]=M[H]}M=M.slice(0,q).concat(v[m[S+1]][N]).concat(j)}else{var V=M[M.length-1],U=void 0;this.showSubTotalsAtBottom&&V.isDrilled&&((U=f.frameHeaderWithKeys(V)).hasChild=!1,U.isDrilled=!1,U.isSum=!0,U.formattedText=U.formattedText+" Total"),M=M.concat(v[m[S+1]][N]),U&&(M[M.length]=U)}}y[w[T]]=M}else if(g)for(T=0;T<w.length;T++){for(var D=y[w[T]],M=[],O=0;O<D.length;O++){M.push(D[O]);N=this.tupRowInfo[D[O].ordinal].uNameCollection;l>-1&&(N=this.frameUniqueName(N,D[O],this.tupRowInfo[D[O].ordinal]));var _=this.getParentUname(N,D[O],!0,!0);n[_]&&(n[_]=this.sortRowHeaders(n[_],e,t),M=M.concat(n[_]))}y[w[T]]=M}v[m[S]]=y}var B=0,G=0,z=0;s=!1,o=this.sortRowHeaders(o,e,t);for(p=this.colDepth;p<a;p++){"Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&("column"===this.olapValueAxis&&this.colDepth+1===p||"row"===this.olapValueAxis&&this.colDepth+this.dataSourceSettings.values.length+1===p)&&(B=0,s=!1);var W=s?o:v[m[0]].parent,Q="Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&this.colDepth===p?W.length:s?B-G:B;W[Q]&&(this.pivotValues[p]=[W[Q]],this.pivotValues[p][0].rowIndex=p,this.valueContent[z][0]=this.pivotValues[p][0]),B++,z++,"grand sum"===this.pivotValues[p][0].type&&(s=!0,G=B)}}},e.prototype.performColumnSorting=function(e,i){if(this.enableSort||this.enableValueSorting)for(var a=0;a<this.dataSourceSettings.columns.length;a++){for(var r=[],n=0,o=[],s=0;s<this.pivotValues.length;s++){var l=this.pivotValues[s],d=void 0,p={},h=[],u=1;o[n]=[],r[n]=[];var c=1,g=l[c].hierarchy,m=l[c].levelUniqueName;for(c;c<l.length;c++)if(!l[c].isNamedSet){if(2!==l[c].memberType&&"[Measures]"!==l[c].hierarchy&&-1!==l[c].level){if(t.isNullOrUndefined(p[l[c].formattedText])||t.isNullOrUndefined(this.pivotValues[s-1]))p[l[c].formattedText]||(p[l[c].formattedText]=[]),l[c+1]&&l[c].formattedText===l[c+1].formattedText||(h[h.length]=l[c]),p[l[c].formattedText][l[c].colIndex]=l[c];else if(p[l[c].formattedText]&&this.pivotValues[s-1]){var f=this.pivotValues[s-1][l[c].colIndex],v=Number(Object.keys(p[l[c].formattedText])[0]),S=p[l[c].formattedText][v].colIndex,y=this.pivotValues[s-1][S];if(f.formattedText!==y.formattedText){d=this.sortColumnHeaders(p,h,this.sortObject[l[c-1].levelUniqueName]||this.sortObject[l[c].hierarchy],e,i,g,m),r[n]=t.isNullOrUndefined(r[n])?[]:r[n];for(var b=0;b<d.length;b++)for(var C=Object.keys(p[d[b]]).length,x=0;x<C;x++)u=0===r[n].length?1:0,r[n][r[n].length+u]=p[d[b]][Number(Object.keys(p[d[b]])[x])];h=[],(p={})[l[c].formattedText]=[],h[h.length]=l[c],p[l[c].formattedText][l[c].colIndex]=l[c]}else p[l[c].formattedText][l[c].colIndex]=l[c]}}else if(Object.keys(p).length>0){o[n][o[n].length+u]=l[c],d=this.sortColumnHeaders(p,h,this.sortObject[l[c-1].levelUniqueName]||this.sortObject[l[c].hierarchy],e,i,g,m),r[n]=t.isNullOrUndefined(r[n])?[]:r[n];for(var w=0;w<d.length;w++)for(var T=Object.keys(p[d[w]]).length,M=0;M<T;M++)u=0===r[n].length?1:0,r[n][r[n].length+u]=p[d[w]][Number(Object.keys(p[d[w]])[M])]}else(-1===l[c].level||0===l[c].level)&&Object.keys(p).length>=0&&"[Measures]"!==l[c].hierarchy&&(o[n][o[n].length+u]=l[c]);if(-1!==l[c].level&&1===Object.keys(p).length&&"[Measures]"!==l[c].hierarchy&&!t.isNullOrUndefined(l[c+1])&&-1===l[c+1].level){var D=Object.keys(p[l[c].formattedText]).length,O=Object.keys(p[l[c].formattedText]);if(D>1)for(var P=0;P<D;P++)u=0===o[n].length?1:0,o[n][o[n].length+u]=p[l[c].formattedText][Number(O[P])];else o[n][o[n].length+u]=l[c]}if(Object.keys(o[n]).length>0){u=0===r[n].length?1:0;var N=o[n].length;if(N>2)for(var E=1;E<N;E++)u=0===r[n].length?1:0,r[n][r[n].length+u]=o[n][E];else r[n][r[n].length+u]=o[n][1]||o[n][0];p={},h=[],o[n]=[]}}if(Object.keys(p).length>0){o[n][o[n].length+u]=l[c];var F=this.sortObject[l[c-1].levelUniqueName]||this.sortObject[l[c-1].hierarchy];d=this.sortColumnHeaders(p,h,F,e,i,g,m),r[n]=t.isNullOrUndefined(r[n])?[]:r[n];for(var I=0;I<d.length;I++)for(var L=Object.keys(p[d[I]]).length,M=0;M<L;M++)u=0===r[n].length?1:0,r[n][r[n].length+u]=p[d[I]][Number(Object.keys(p[d[I]])[M])]}for(var A=1;A<r[n].length;A++)this.pivotValues[n][A]=r[n][A];for(var R=s;R<this.pivotValues.length;R++){var k=t.extend({},this.pivotValues[R+1],null,!0),j=t.extend({},this.pivotValues[R],null,!0);if(Object.keys(k).length===Object.keys(j).length&&Object.keys(k).length>2){for(var q=1;q<this.pivotValues[s].length;q++)Object.keys(k).length>0&&j[q].colIndex!==k[q].colIndex&&(this.pivotValues[R+1][q]=k[j[q].colIndex]);break}}n++,p={}}for(var H=0;H<this.pivotValues.length;H++)for(var l=this.pivotValues[H],s=1;s<l.length;s++)l[s].colIndex=s}},e.prototype.frameUniqueName=function(e,t,i){var a=e.indexOf(t.actualText.toString()+"::[Measures]")>-1,r=(e=e.substring(0,e.indexOf(t.actualText.toString()))+t.actualText.toString()).split("::[").length<=this.getMeasurePosition(e,i.measurePosition);return e+=a||r?"::"+i.measureName:""},e.prototype.getMeasurePosition=function(e,t){for(var i=t,a=e.split("::["),r=0;r<a.length;r++)if(a[r]&&a[r].indexOf("Measures")>-1){i=r;break}return i},e.prototype.sortRowHeaders=function(e,i,a){if(this.enableValueSorting&&"column"===this.olapValueAxis&&a.isValueSorting&&!t.isNullOrUndefined(this.valueSortSettings)){for(var r=[],n=0;n<e.length;n++){var o=e[n],s=i[o.ordinal*a.columnLength+a.memberIndex],l=s?s.getElementsByTagName("Value"):void 0,d=s&&l.length>0?Number(l[0].textContent):0;r.push({header:o,value:d})}e=f.getSortedValue(r,this.valueSortSettings.sortOrder)}else if(this.enableSort&&e.length>0&&3!==e[0].memberType&&!e[0].isNamedSet){for(var p=[],n=0;n<e.length;n++)p[n]=e[n].actualText;var h=!1,u="Grand Total"!==e[0].actualText?e[0].hierarchy:e[1].hierarchy,c=this.fieldList[u]&&this.fieldList[u].membersOrder?this.fieldList[u].membersOrder.slice():[],g={fieldName:u,levelName:e[0].levelUniqueName,sortOrder:this.sortObject[e[0].hierarchy]||this.sortObject[e[0].levelUniqueName],members:c&&c.length>0?c:p,IsOrderChanged:!1};if(c&&c.length>0?f.applyCustomSort(g,e,"string",!1,!0):("Ascending"===g.sortOrder||void 0===g.sortOrder?e.sort(function(e,t){return e.formattedText>t.formattedText?1:t.formattedText>e.formattedText?-1:0}):"Descending"===g.sortOrder&&e.sort(function(e,t){return e.formattedText<t.formattedText?1:t.formattedText<e.formattedText?-1:0}),h=!0),h&&this.getHeaderSortInfo){for(var m=[],v=0,S=0;v<e.length;v++)"Grand Total"!==e[v].actualText&&(m[S++]=e[v].formattedText);g.members=m}this.getHeaderSortInfo&&this.getHeaderSortInfo(g),g.IsOrderChanged&&f.applyCustomSort(g,e,"string",!0,!0)}return e},e.prototype.sortColumnHeaders=function(e,i,a,r,n,o,s){var l=Object.keys(e);if(this.enableValueSorting&&"row"===this.olapValueAxis&&n.isValueSorting&&!t.isNullOrUndefined(this.valueSortSettings)){for(var d=[],p=0;p<l.length;p++){var h=e[l[p]],u=this.showSubTotalsAtTop?h[0]:h[h.length-1],c=r[n.memberIndex*n.columnLength+u.ordinal],g=c?c.getElementsByTagName("Value"):void 0,m=c&&g.length>0?Number(g[0].textContent):0;d.push({header:u,value:m})}l=f.getSortedValue(d,this.valueSortSettings.sortOrder).map(function(e){return e.formattedText})}else if(this.enableSort){var v=!1,S=this.fieldList[o]&&this.fieldList[o].membersOrder?this.fieldList[o].membersOrder.slice():[],y={fieldName:o,levelName:s,sortOrder:a,members:S&&S.length>0?S:l,IsOrderChanged:!1};if(S&&S.length>0?this.applyCustomSort(l,y):("Ascending"===y.sortOrder||void 0===y.sortOrder?l.sort(function(e,t){return e>t?1:t>e?-1:0}):"Descending"===y.sortOrder&&l.sort(function(e,t){return e<t?1:t<e?-1:0}),v=!0),v&&this.getHeaderSortInfo){for(var b=[],C=0,x=0;C<l.length;C++)"Grand Total"!==l[C]&&(b[x++]=l[C]);y.members=b}this.getHeaderSortInfo&&this.getHeaderSortInfo(y),y.IsOrderChanged&&this.applyCustomSort(l,y,!0)}return l},e.prototype.applyCustomSort=function(e,t,i){var a,r=[],n=[];r=t.IsOrderChanged?t.members:"Ascending"===t.sortOrder||"None"===t.sortOrder||void 0===t.sortOrder?[].concat(t.members):[].concat(t.members).reverse(),"Grand Total"===e[0]&&(a=e[0],e.shift());for(var o=0,s=0;o<e.length;o++){var l=e[o];if(r[s]===l){if(e.splice(s++,0,l),e.splice(++o,1),!(s<r.length)){i||n.splice(--s,0,l);break}o=-1}o>=0&&!i&&(n[o]=e[o])}if(!i){for(o=n.length;o<e.length;o++)n[o]=e[o];"Grand Total"===n[n.length-1]&&n.pop(),t.members=n}return a&&e.splice(0,0,a),e},e.prototype.frameSortObject=function(){if(this.enableSort)for(var e=0;e<this.sortSettings.length;e++)this.sortObject[this.sortSettings[e].name]=this.sortSettings[e].order},e.prototype.getParentUname=function(e,t,i,a){var r="";if(i&&!a){for(var n=this.tupRowInfo[t.ordinal],o=[],s={},l=0;l<e.length;l++)"~"!==e[l]&&":"!==e[l]||(o.push(l),s[l]=e[l]+e[l],l++);r=this.getMeasurePosition(e,n.measurePosition)>=e.split("::[").length-1?o[o.length-2]>-1?e.substring(0,o[o.length-2])+s[o[o.length-1]]+n.measureName:"parent":(d=e.lastIndexOf("~~")>e.lastIndexOf("::[")?e.lastIndexOf("~~"):e.lastIndexOf("::["))>-1?e.substring(0,d):"parent"}else{var d=e.lastIndexOf("~~")>e.lastIndexOf("::[")?e.lastIndexOf("~~"):e.lastIndexOf("::[");r=d>-1?e.substring(0,d):"parent"}return r},e.prototype.performColumnSpanning=function(){for(var e={},t=this.rowStartPos-1,i=Object.keys(this.colMeasures).length,a=this.tupColumnInfo[0]?this.tupColumnInfo[0].measurePosition:this.measureIndex,r=t;r>-1;r--)if(3===this.pivotValues[r][1].memberType){a=r;break}for(;t>-1;){e[t]={};for(var n=this.pivotValues[t].length-1;n>0;){e[t][n]=1;var o=this.pivotValues[t][n+1],s=this.pivotValues[t+1]&&this.rowStartPos-t>1?this.pivotValues[t+1][n]:void 0,l=this.pivotValues[t][n],d=!1,p=!1,h=this.tupColumnInfo[l.ordinal],u=h.allStartPos>("3"===h.typeCollection[0]?1:0),c=this.checkAttributeDrill(h.drillInfo,"columns");if(this.showSubTotalsAtTop&&l.isDrilled&&o&&o.actualText!==l.actualText&&l.level>-1&&(l.ordinal=this.getOrdinal(l,this.pivotValues[t+1])),s&&o&&(2===l.memberType||-1===l.level?o.actualText===l.actualText:3===l.memberType&&l.actualText===o.actualText||o.valueSort.levelName===l.valueSort.levelName)&&(2===l.memberType?u&&"sum"!==o.type?l.colSpan=1:l.colSpan=o.colSpan+1>(a>t?i:0)?1:o.colSpan+1:(l.colSpan=o.colSpan+1,l.ordinal=o.ordinal),d=!0),2===l.memberType){if(u)c||(l.type="sum"),l.formattedText="Total",l.valueSort[l.valueSort.levelName.toString()]=1;else if(l.type="grand sum",l.formattedText="Grand Total",t<this.measureIndex){l.valueSort.levelName="Grand Total",l.valueSort["Grand Total".toString()]=1}l.hasChild=!1}else-1===l.level&&(l.type="sum",l.formattedText="Total",l.hasChild=!1,l.valueSort[l.valueSort.levelName.toString()]=1);s?2===l.memberType&&2===s.memberType||s.actualText===l.actualText?(e[t][n]=e[t+1]?e[t+1][n]+1:1,0===t||1===l.memberType&&l.level>-1&&1===s.memberType&&-1===s.level?(l.rowSpan=!l.isDrilled||this.fieldList[l.hierarchy]&&this.fieldList[l.hierarchy].isHierarchy&&!l.hasChild?e[t+1][n]+1:1,s.rowSpan=!s.isDrilled||this.fieldList[s.hierarchy]&&this.fieldList[s.hierarchy].isHierarchy&&!s.hasChild||-1!==s.level?s.rowSpan:e[t+1][n]):3===l.memberType?l.rowSpan=1:l.rowSpan=-1,p=!0):!l.isDrilled||this.fieldList[l.hierarchy]&&this.fieldList[l.hierarchy].isHierarchy&&!l.hasChild||-1!==l.level||2!==s.memberType?(l.rowSpan=0===t?e[t][n]:-1,s.rowSpan=s.level>-1&&(!s.isDrilled||this.fieldList[s.hierarchy]&&this.fieldList[s.hierarchy].isHierarchy&&!s.hasChild)||2!==l.memberType&&2===s.memberType?e[t+1][n]:1):(e[t][n]=e[t+1]?e[t+1][n]+1:1,l.rowSpan=-1,p=!0):l.rowSpan=l.level>-1||1===this.rowStartPos?e[t][n]:-1,d||(l.colSpan=1),p||(e[t][n]=1),n--}t--}},e.prototype.getOrdinal=function(e,t){for(var i=0,a=e.colIndex;a>0;a--)if(-1===t[a].level){i=t[a].ordinal;break}return i},e.prototype.frameValues=function(e,i){var a=this.colDepth,r=this.pivotValues.length,n=0;if("down"===this.customArgs.action){var o=Object.keys(this.onDemandDrillEngine);a=Number(o[0]),r=Number(o[o.length-1])+1,n=this.onDemandDrillEngine[a][0].ordinal}for(var s=a;s<r;s++)for(var l=this.pivotValues[s],d=l[0].ordinal,p=1;p<this.pivotValues[0].length;p++)if(this.pivotValues[this.colDepth-1][p]){var h=this.pivotValues[this.colDepth-1][p].ordinal,u=this.pivotValues[this.colDepth-1][p],c=3===l[0].memberType?l[0].actualText.toString():this.tupColumnInfo[u.ordinal]&&this.tupColumnInfo[u.ordinal].measure?this.tupColumnInfo[u.ordinal].measure.querySelector("UName").textContent:l[0].actualText;if("header"===l[0].type)l[p]={axis:"value",actualText:this.getUniqueName(c),formattedText:"",value:0,colIndex:p,rowIndex:s};else{var g=void 0,m="0",f=this.getUniqueName(c),v=!0,S=!this.fieldList[l[0].hierarchy]||!this.fieldList[l[0].hierarchy].isHierarchy||l[0].isDrilled;if(this.tupRowInfo[d])v=this.tupRowInfo[d].showTotals;else{var y=0===this.dataSourceSettings.rows.length||1===this.dataSourceSettings.rows.length&&"[Measures]"===this.dataSourceSettings.rows[0].name;v=this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals||y}var b=e[(d-n)*i+h];g=this.showSubTotalsAtBottom&&l[0].isDrilled?"":!v&&S?"":t.isNullOrUndefined(b)||t.isNullOrUndefined(b.querySelector("FmtValue"))?this.emptyCellTextContent:b.querySelector("FmtValue").textContent,m=!v&&S?"0":t.isNullOrUndefined(b)||t.isNullOrUndefined(b.querySelector("Value"))?null:b.querySelector("Value").textContent,g=this.showSubTotalsAtBottom&&l[0].isDrilled?"":v&&!t.isNullOrUndefined(m)?this.getFormattedValue(Number(m),f,""!==g?g:m):g;var C=!this.tupColumnInfo[h]||(this.tupColumnInfo[h].allCount>0||this.tupColumnInfo[h].drillStartPos>-1)||!this.tupRowInfo[d]||this.tupRowInfo[d].allCount>0||this.tupRowInfo[d].drillStartPos>-1,x=!!this.tupRowInfo[d]&&(0===this.tupRowInfo[d].measurePosition?1===this.tupRowInfo[d].allStartPos:0===this.tupRowInfo[d].allStartPos)||!!this.tupColumnInfo[h]&&(0===this.tupColumnInfo[h].measurePosition?1===this.tupColumnInfo[h].allStartPos:0===this.tupColumnInfo[h].allStartPos);l[p]={axis:"value",actualText:f,formattedText:g,colOrdinal:h,rowOrdinal:d,columnHeaders:this.tupColumnInfo[h]?this.tupColumnInfo[h].captionCollection:"",rowHeaders:this.tupRowInfo[d]?this.tupRowInfo[d].captionCollection:"",value:t.isNullOrUndefined(m)?null:Number(m),colIndex:p,rowIndex:s,isSum:C,isGrandSum:x}}this.valueContent[s-this.rowStartPos][p]=l[p]}},e.prototype.getFormattedValue=function(e,i,a){var r=a;if(this.formatFields[i]&&!t.isNullOrUndefined(e)){var n=this.formatFields[i].properties?this.formatFields[i].properties:this.formatFields[i],o=t.extend({},n,null,!0);delete o.name,!o.minimumSignificantDigits&&o.minimumSignificantDigits<1&&delete o.minimumSignificantDigits,!o.maximumSignificantDigits&&o.maximumSignificantDigits<1&&delete o.maximumSignificantDigits,o.type?r=this.globalize.formatDate(new Date(e.toString()),o):(delete o.type,r=this.globalize.formatNumber(e,o))}return r},e.prototype.getMeasureInfo=function(){this.olapValueAxis=void 0,this.olapRowValueIndex=void 0;for(var e,t="column",i=[],a=0,r=this.values;a<r.length;a++){var n=r[a];i[i.length]=n.isCalculatedField?this.fieldList[n.name].tag:n.name}if(i.length>0){if(this.isMeasureAvail){for(var o=!1,s=0,l=0,d=this.rows.length;l<d;l++)if("[measures]"===this.rows[l].name.toLowerCase()){t="row",e=l,o=!0,s=this.dataSourceSettings.rows.length,this.olapRowValueIndex=e;break}if(!o)for(var l=0,d=this.columns.length;l<d;l++)if("[measures]"===this.columns[l].name.toLowerCase()){t="column",e=l,o=!0,s=this.dataSourceSettings.columns.length;break}this.olapValueAxis=t,this.measurePosition=e,this.measureIndex=e===s-1?-1:e}else e="row"===(t=this.valueAxis)?this.rows.length-1:this.columns.length-1;return{measureAxis:t,measureIndex:e,valueInfo:i}}return{measureAxis:t,measureIndex:-1,valueInfo:[]}},e.prototype.frameMeasureOrder=function(e,i,a,r,n,o){var s=[],l=[],d=[],p={},h=[],u=e.measureAxis,c=e.measureIndex,g=e.valueInfo;if(u===i&&g.length>0){for(var m={},f=[],v=0,S=a.length;v<S;v++){for(var y=a[v],b=[].slice.call(y.querySelectorAll("Member")),C="",x="",w=0;w<b.length;)C=C+(""!==C?"~~":"")+b[w].querySelector("UName").textContent,w===c&&0===c?x=C:w===c-1&&(x=C),w++;m[x]?m[x][m[x].length]=C:(m[x]=[C],f[f.length]=x),p[C]={index:v,node:y},h[h.length]=C}if(h.length>0&&f.length>0)if(0===c){for(var T=0,M=g;T<M.length;T++)for(var D=M[T],O=0,P=f;O<P.length;O++)if((L=P[O])===D)for(var N=0,E=m[L];N<E.length;N++){C=E[N];d[d.length]=p[C].index,s[s.length]=p[C].node}}else for(var F=0,I=f;F<I.length;F++)for(var L=I[F],A=0,R=g;A<R.length;A++)for(var k=R[A],j=0,q=m[L];j<q.length;j++)(C=q[j]).split("~~")[c]===k&&(d[d.length]=p[C].index,s[s.length]=p[C].node);var H=[];if(r.length>0){for(var V=[],U=[],_=0,B=0,G=0,v=0,z=o;v<z;v++){B>n-1?(B=0,V[++G]||(V[G]=[]),V[G][B]=v,B++):(V[G]||(V[G]=[]),V[G][B]=v,B++);var W=void 0;r[_]?W=this.olapVirtualization?v:Number(r[_].getAttribute("CellOrdinal")):_++,W===v&&(U[v]=W,H[W]=r[_],_++)}if(r=H,"column"===u){if(V.length>0&&V[0].length===d.length)for(var w=0,z=d.length;w<z;w++)for(v=0;v<V.length;){var Q=v*n+w;if(!t.isNullOrUndefined(V[v])&&!t.isNullOrUndefined(d[w])){Y=U[Q]?U[Q].toString():Q.toString();(K=r[Number(V[v][d[w]])])&&(K.setAttribute("CellOrdinal",Y.toString()),l[Q]=K)}v++}}else if(V.length===d.length)for(var w=0,z=d.length;w<z;w++)for(v=0;v<V[d[w]].length;){var Y=U[Q=w*n+v]?U[Q].toString():Q.toString(),K=r[Number(V[d[w]][v])];K&&(K.setAttribute("CellOrdinal",Y.toString()),l[l.length]=K),v++}}return{orderedHeaderTuples:s,orderedValueTuples:l}}return{orderedHeaderTuples:a,orderedValueTuples:r}},e.prototype.getDrilledSets=function(e,i,a,r){for(var n=[],o=i.actualText.toString(),s="row"===r?this.tupRowInfo:this.tupColumnInfo,l=s[i.ordinal],d=0===s[0].typeCollection.indexOf("3")?1:0,p=0,h="1"===s[0].typeCollection[a];p<s.length;)(t.isNullOrUndefined(s[p].allStartPos)||s[p].allStartPos>d)&&(n[n.length]=s[p].uNameCollection),p++;for(var u=e.split("::[").map(function(e){return"["===e[0]?e:"["+e}),c=[],g=0;g<=a;g++)if(u[g])if((h||this.isPaging)&&g===a){for(var m=u[g].split("~~"),f=m.indexOf(o),v=[],S=0;S<=f;S++)v.push(m[S]);c[c.length]=v.length>0?v.join("~~"):u[g]}else c[c.length]=u[g];e=c.join("::");for(var y=[],b={},C=0,x=n;C<x.length;C++){var w=x[C];if(0===w.indexOf(e)&&(y.push(w),this.isPaging))for(var T=w.split("::[")[a],M=(P=(T="["===T[0]?T:"["+T).split("~~")).indexOf(o);M<P.length;M++)b[P[M]]=P[M]}if(this.isPaging){for(var D=l.uNameCollection.split("::[").map(function(e){return"["===e[0]?e:"["+e}),O=[],M=0;M<D.length;M++)M!==a&&(O[M]=D[M]);for(var P=Object.keys(b),M=0;M<P.length;M++)O[a]=P[M],y.push(O.join("::"))}for(var N={},E=0,F=y;E<F.length;E++){for(var I=F[E].split("::[").map(function(e){return"["===e[0]?e:"["+e}),L="",A=0;A<=a;A++){var R=I[A];if(R){var k=R.split("~~");L=L+(""!==L?"~~":"")+k[k.length-1]}}N[L]=L}return N},e.prototype.updateDrilledInfo=function(e){this.dataSourceSettings=e,this.drilledMembers=e.drilledMembers?this.updateDrilledItems(e.drilledMembers):[],this.generateGridData(e)},e.prototype.updateCalcFields=function(e,t){this.dataSourceSettings=e,this.calculatedFieldSettings=e.calculatedFieldSettings?e.calculatedFieldSettings:[],this.getAxisFields(),this.updateFieldlist(),this.loadCalculatedMemberElements(this.calculatedFieldSettings),this.dataFields[t.name]?this.generateGridData(e):xt.getCellSets(e,this,!0,void 0,!0)},e.prototype.onSort=function(e,t){this.dataSourceSettings=e,t||(this.sortSettings=e.sortSettings?e.sortSettings:[],this.getAxisFields(),this.frameSortObject(),this.updateFieldlist()),this.xmlaCellSet.length>0&&this.xmlDoc?this.generateEngine(this.xmlDoc,this.request,this.customArgs):this.generateGridData(e)},e.prototype.updateFieldlist=function(e){for(var t=0;t<this.savedFieldListData.length;){var i=this.savedFieldListData[t].id,a=this.savedFieldListData[t].pid;if(this.savedFieldList[i]){var r=this.enableSort?this.sortObject[i]?this.sortObject[i]:"Ascending":"None";this.savedFieldList[i].isSelected=!1,this.savedFieldList[i].isExcelFilter=!1,this.savedFieldList[i].sort=r,this.savedFieldList[i].allowDragAndDrop=!0,this.savedFieldList[i].showFilterIcon=!0,this.savedFieldList[i].showSortIcon=!0,this.savedFieldList[i].showEditIcon=!0,this.savedFieldList[i].showRemoveIcon=!0,this.savedFieldList[i].showValueTypeIcon=!0,this.savedFieldList[i].showSubTotals=!0,this.savedFieldListData[t].sort=r,this.savedFieldListData[t].allowDragAndDrop=!0,this.savedFieldListData[t].showFilterIcon=!0,this.savedFieldListData[t].showSortIcon=!0,this.savedFieldListData[t].showEditIcon=!0,this.savedFieldListData[t].showRemoveIcon=!0,this.savedFieldListData[t].showValueTypeIcon=!0,this.savedFieldListData[t].showSubTotals=!0,e&&(this.savedFieldList[i].filter=[],this.savedFieldList[i].actualFilter=[])}if(this.dataFields[i]&&this.savedFieldList[i]&&this.selectedItems.indexOf(i)>-1?(this.savedFieldList[i].isSelected=!0,this.savedFieldList[i].allowDragAndDrop=!this.dataFields[i]||this.dataFields[i].allowDragAndDrop,this.savedFieldList[i].showFilterIcon=!this.dataFields[i]||this.dataFields[i].showFilterIcon,this.savedFieldList[i].showSortIcon=!this.dataFields[i]||this.dataFields[i].showSortIcon,this.savedFieldList[i].showEditIcon=!this.dataFields[i]||this.dataFields[i].showEditIcon,this.savedFieldList[i].showRemoveIcon=!this.dataFields[i]||this.dataFields[i].showRemoveIcon,this.savedFieldList[i].showValueTypeIcon=!this.dataFields[i]||this.dataFields[i].showValueTypeIcon,this.savedFieldList[i].showSubTotals=!this.dataFields[i]||this.dataFields[i].showSubTotals,this.savedFieldListData[t].isSelected=!0,this.savedFieldListData[t].allowDragAndDrop=!this.dataFields[i]||this.dataFields[i].allowDragAndDrop,this.savedFieldListData[t].showFilterIcon=!this.dataFields[i]||this.dataFields[i].showFilterIcon,this.savedFieldListData[t].showSortIcon=!this.dataFields[i]||this.dataFields[i].showSortIcon,this.savedFieldListData[t].showEditIcon=!this.dataFields[i]||this.dataFields[i].showEditIcon,this.savedFieldListData[t].showRemoveIcon=!this.dataFields[i]||this.dataFields[i].showRemoveIcon,this.savedFieldListData[t].showValueTypeIcon=!this.dataFields[i]||this.dataFields[i].showValueTypeIcon,this.savedFieldListData[t].showSubTotals=!this.dataFields[i]||this.dataFields[i].showSubTotals):this.dataFields[a]&&this.savedFieldList[a]&&this.selectedItems.indexOf(a)>-1?this.savedFieldListData[t].isSelected=!0:this.savedFieldListData[t].isSelected=!1,this.savedFieldList[i]&&this.savedFieldList[i].isCalculatedField||"[calculated members].[_0]"===i.toLowerCase()){for(var n=!1,o=0,s=this.calculatedFieldSettings;o<s.length;o++){var l=s[o];if(i===l.name){var d=l.formula,p=l.formatString;this.savedFieldListData[t].formula=d,this.savedFieldListData[t].formatString=p,this.savedFieldListData[t].parentHierarchy=d.toLowerCase().indexOf("measure")>-1?void 0:l.hierarchyUniqueName,this.savedFieldList[i].formula=d,this.savedFieldList[i].formatString=p,this.savedFieldList[i].parentHierarchy=this.savedFieldListData[t].parentHierarchy,n=!0}}(!n&&"[calculated members].[_0]"!==i.toLowerCase()||"[calculated members].[_0]"===i.toLowerCase()&&0===this.calculatedFieldSettings.length)&&(this.savedFieldListData.splice(t,1),t--,this.savedFieldList[i]&&delete this.savedFieldList[i])}t++}this.fieldList=this.savedFieldList,this.fieldListData=this.savedFieldListData},e.prototype.updateFieldlistData=function(e,t){for(var i=0,a=this.fieldListData;i<a.length;i++){var r=a[i];if(r.id===e){r.isSelected=!!t;break}}},e.prototype.getFormattedFields=function(e){this.formatFields={};for(var t=e.length;t--;)this.formatFields[e[t].name]=e[t]},e.prototype.getCubes=function(e){var t=this.getConnectionInfo(e.url,e.localeIdentifier.toString()),i='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Header/><Body><Discover xmlns="urn:schemas-microsoft-com:xml-analysis"><RequestType>MDSCHEMA_CUBES</RequestType><Restrictions><RestrictionList><CATALOG_NAME>'+e.catalog+"</CATALOG_NAME></RestrictionList></Restrictions><Properties><PropertyList><Catalog>"+e.catalog+"</Catalog> <LocaleIdentifier>"+t.LCID+"</LocaleIdentifier>"+(e.roles?"<Roles>"+e.roles+"</Roles>":"")+"</PropertyList></Properties></Discover></Body></Envelope>";if(this.doAjaxPost("POST",t.url,i,this.validateCube.bind(this),{dataSourceSettings:e,action:"getCubes"}),this.errorInfo)throw this.errorInfo},e.prototype.validateCube=function(e,t,i){for(var a=[].slice.call(e.querySelectorAll("row")),r=!1,n=0,o=a;n<o.length;n++)if(o[n].querySelector("CUBE_NAME").textContent===i.dataSourceSettings.cube){r=!0;break}!r&&a.length>0&&(this.errorInfo="Invalid cube name "+this.dataSourceSettings.cube)},e.prototype.getFieldList=function(e){var t={catalog:e.catalog,cube:e.cube,url:e.url,LCID:e.localeIdentifier.toString(),request:"MDSCHEMA_HIERARCHIES",roles:e.roles};this.getTreeData(t,this.getFieldListItems.bind(this),{dataSourceSettings:e,action:"loadFieldElements"})},e.prototype.getTreeData=function(e,t,i){var a=this.getConnectionInfo(e.url,e.LCID),r='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Header/><Body><Discover xmlns="urn:schemas-microsoft-com:xml-analysis"><RequestType>'+e.request+"</RequestType><Restrictions><RestrictionList><CATALOG_NAME>"+e.catalog+"</CATALOG_NAME><CUBE_NAME>"+e.cube+"</CUBE_NAME></RestrictionList></Restrictions><Properties><PropertyList><Catalog>"+e.catalog+"</Catalog> <LocaleIdentifier>"+a.LCID+"</LocaleIdentifier>"+(e.roles?"<Roles>"+e.roles+"</Roles>":"")+"</PropertyList></Properties></Discover></Body></Envelope>";if(this.doAjaxPost("POST",a.url,r,t,i),this.errorInfo)throw this.errorInfo},e.prototype.getAxisFields=function(){this.rows=this.dataSourceSettings.rows?this.dataSourceSettings.rows:[],this.columns=this.dataSourceSettings.columns?this.dataSourceSettings.columns:[],this.filters=this.dataSourceSettings.filters?this.dataSourceSettings.filters:[],this.values=this.dataSourceSettings.values?this.dataSourceSettings.values:[];for(var e=t.extend([],this.rows,null,!0),i=(e=e.concat(this.columns,this.values,this.filters)).length;i--;)this.dataFields[e[i].name]=e[i],"[measures]"===e[i].name.toLowerCase()?this.isMeasureAvail=!0:this.selectedItems.push(e[i].name);if(this.mappingFields={},this.dataSourceSettings.fieldMapping)for(var a=0,r=this.dataSourceSettings.fieldMapping;a<r.length;a++){var n=r[a];this.mappingFields[n.name]=n}if(!this.isMeasureAvail&&this.values.length>0){var o={name:"[Measures]",caption:"Measures",showRemoveIcon:!0,allowDragAndDrop:!0};"row"===this.valueAxis?this.rows.push(o):this.columns.push(o),this.isMeasureAvail=!0}},e.prototype.getAggregateType=function(e,t){var i;switch(t){case"1":i="Sum";break;case"2":i="Count";break;case"3":i="Min";break;case"4":i="Max";break;case"5":i="Avg";break;case"8":i="DistinctCount";break;case"127":i="CalculatedField";break;default:i=void 0}return i||void 0},e.prototype.getUniqueName=function(e){for(var t=e,i=0,a=this.calculatedFieldSettings;i<a.length;i++){var r=a[i];if(e===(r.formula.toLowerCase().indexOf("measure")>-1?"[Measures].":r.hierarchyUniqueName+".")+"["+r.name+"]"){t=r.name;break}}return t},e.prototype.updateFilterItems=function(e){var i=t.extend([],this.rows,null,!0);i=i.concat(this.columns);for(var a=0,r=e;a<r.length;a++){var n=r[a];if("Include"===n.type&&this.allowMemberFilter&&this.fieldList[n.name]){var o=this.fieldList[n.name].members,s=o&&Object.keys(o).length>0;this.fieldList[n.name].actualFilter=n.items.slice();var l=t.extend([],n.items,null,!0);if(s)for(var d=0;d<l.length;){for(var p=[],h=0,u=p=this.getParentNode(l[d],o,p);h<u.length;h++){var c=u[h],g=f.inArray(c,n.items);-1!==g&&n.items.splice(g,1)}d++}for(var m=[],v=0,S=n.items;v<S.length;v++){var y=S[v],b=void 0;s||1!==n.items.length||(this.getMembers(this.dataSourceSettings,n.name,void 0,void 0,void 0,n.items[0]),b=this.fieldList[n.name].actualFilter[0]),m.push(y),s?this.fieldList[n.name].filter.push(o[y].caption):this.fieldList[n.name].filter.push(b||y)}this.filterMembers[n.name]=m,this.fieldList[n.name].isExcelFilter=!1}else if((this.allowValueFilter||this.allowLabelFilter)&&-1!==["Date","Label","Number","Value"].indexOf(n.type))for(var C=0,x=i;C<x.length;C++)if(x[C].name===n.name){var w=this.filterMembers[n.name];w&&"object"==typeof w[0]&&w[0].type===n.type?w[w.length]=n:this.filterMembers[n.name]=[n],this.fieldList[n.name].isExcelFilter=!0;break}}},e.prototype.getParentNode=function(e,t,i){if(t[e].parent&&e!==t[e].parent){var a=t[e].parent;i.push(a),this.getParentNode(a,t,i)}return i},e.prototype.updateDrilledItems=function(e){var i=[],a=t.extend([],this.rows,null,!0);a=a.concat(this.columns);for(var r=0,n=e;r<n.length;r++)for(var o=n[r],s=0,l=a;s<l.length;s++){var d=l[s];if(o.name===d.name){i.push(o);break}}return i},e.prototype.getDrillThroughData=function(e,t){for(var i,a=this.tupColumnInfo[e.colOrdinal]&&this.tupColumnInfo[e.colOrdinal].uNameCollection&&""!==this.tupColumnInfo[e.colOrdinal].uNameCollection?this.tupColumnInfo[e.colOrdinal].uNameCollection.split("::[").map(function(e){return"["===e[0]?e:"["+e}):[],r=this.tupRowInfo[e.rowOrdinal]&&this.tupRowInfo[e.rowOrdinal].uNameCollection&&""!==this.tupRowInfo[e.rowOrdinal].uNameCollection?this.tupRowInfo[e.rowOrdinal].uNameCollection.split("::[").map(function(e){return"["===e[0]?e:"["+e}):[],n=[],o="",s=0;s<this.filters.length;s++)if(i=this.filterMembers[this.filters[s].name]){for(var l=0;l<i.length;l++)o+=i[l],o=l<i.length-1?o+",":o+"";n[s]=o,o=""}for(s=0;s<n.length;s++)o=""===o?"{"+n[s]+"}":o+",{"+n[s]+"}";for(var d="",p="",s=0;s<a.length;s++)d=(d.length>0?d+",":"")+(a[s].split("~~").length>1?a[s].split("~~")[a[s].split("~~").length-1]:a[s]);for(s=0;s<r.length;s++)p=(p.length>0?p+",":"")+(r[s].split("~~").length>1?r[s].split("~~")[r[s].split("~~").length-1]:r[s]);var h="DRILLTHROUGH MAXROWS "+t+" Select("+(d.length>0?d:"")+(d.length>0&&p.length>0?",":"")+(p.length>0?p:"")+") on 0 from "+(""===o?"["+this.dataSourceSettings.cube+"]":"(SELECT ("+o+") ON COLUMNS FROM ["+this.dataSourceSettings.cube+"])");h=h.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,""");var u=this.getSoapMsg(this.dataSourceSettings,h),c=this.getConnectionInfo(this.dataSourceSettings.url,this.dataSourceSettings.localeIdentifier);if(this.doAjaxPost("POST",c.url,u,this.drillThroughSuccess.bind(this),{dataSourceSettings:this.dataSourceSettings,action:"drillThrough"}),this.errorInfo)throw this.errorInfo},e.prototype.drillThroughSuccess=function(e){var t=[].slice.call(e.querySelectorAll("row")),i="";if(t.length>0){for(var a=[],r=0;r<t.length;){for(var n=[].slice.call(t[r].children),o=0;o<n.length;)a.push('"'+n[o].tagName+'":"'+n[o].textContent+'"'),o++;r++}for(var s=a[0],l=0;l<a.length;)Object.keys(JSON.parse("[{"+a[l]+"}]")[0])[0]!==Object.keys(JSON.parse("[{"+s+"}]")[0])[0]?(i+=","+a[l],l++):(i+=""===i?"[{"+a[l]:"}, {"+a[l],l++);i+="}]"}else for(var d=[].slice.call(e.querySelectorAll("faultstring")),r=0;r<d.length;)i+=d[r].textContent,r++;this.gridJSON=i},e.prototype.getFilterMembers=function(e,t,i,a,r){var n,o=this.fieldList[t].levels,s=this.fieldList[t].levelCount;return n=r?"Descendants({"+o[s].id+"}, "+o[i-1].id+", "+(i-s==1?"SELF)":"SELF_AND_BEFORE)"):t+", Descendants({"+o[0].id+"}, "+o[i-1].id+", SELF_AND_BEFORE)",this.fieldList[t].levelCount=i,a||this.getMembers(e,t,!1,n,r),n},e.prototype.getMembers=function(e,t,i,a,r,n){var o,s="DIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CHILDREN_CARDINALITY, MEMBER_TYPE, MEMBER_VALUE",l=this.fieldList[t].hasAllMember,d=(l?t:t+".LEVELS(0)").replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,""");o=i||n?n?"SELECT {"+(n=n.replace(/&/g,"&"))+"} ON 0 FROM ["+e.cube+"] WHERE {}":"SELECT ({"+d+".ALLMEMBERS})"+s+" ON 0 FROM ["+e.cube+"]":"SELECT ({"+(a||(l?d+", "+d+".CHILDREN":d+".ALLMEMBERS"))+"})"+s+" ON 0 FROM ["+e.cube+"]";var p=this.getSoapMsg(e,o),h=this.getConnectionInfo(e.url,e.localeIdentifier);if(r||(this.fieldList[t].filterMembers=[],this.fieldList[t].childMembers=[],this.fieldList[t].searchMembers=[],this.fieldList[t].members={},this.fieldList[t].currrentMembers={}),this.doAjaxPost("POST",h.url,p,n?this.getOlapFilterText.bind(this):this.generateMembers.bind(this),{dataSourceSettings:e,fieldName:t,loadLevelMembers:r,action:"fetchMembers"}),this.errorInfo)throw this.errorInfo},e.prototype.getOlapFilterText=function(e,t,i){var a=[].slice.call(e.querySelectorAll('Axis[name="Axis0"] Tuple'));a.length>0&&this.fieldList[i.fieldName]&&a[a.length-1].getElementsByTagName("Caption")&&a[a.length-1].getElementsByTagName("Caption")[0]&&(this.fieldList[i.fieldName].actualFilter[0]=a[a.length-1].getElementsByTagName("Caption")[0].textContent)},e.prototype.getChildMembers=function(e,t,i){var a="SELECT ({"+t.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,""")+".CHILDREN})DIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CHILDREN_CARDINALITY, MEMBER_TYPE, MEMBER_VALUE ON 0 FROM ["+e.cube+"]",r=this.getSoapMsg(e,a),n=this.getConnectionInfo(e.url,e.localeIdentifier);if(this.doAjaxPost("POST",n.url,r,this.generateMembers.bind(this),{dataSourceSettings:e,fieldName:i,action:"fetchChildMembers"}),this.errorInfo)throw this.errorInfo},e.prototype.getCalcChildMembers=function(e,t){this.calcChildMembers=[];var i="SELECT ({"+t.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,""")+".MEMBERS})DIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CHILDREN_CARDINALITY, MEMBER_TYPE, MEMBER_VALUE ON 0 FROM ["+e.cube+"]",a=this.getConnectionInfo(e.url,e.localeIdentifier),r=this.getSoapMsg(e,i);if(this.doAjaxPost("POST",a.url,r,this.generateMembers.bind(this),{dataSourceSettings:e,action:"fetchCalcChildMembers"}),this.errorInfo)throw this.errorInfo},e.prototype.getSearchMembers=function(e,t,i,a,r,n){if(this.fieldList[t].searchMembers=[],this.fieldList[t].currrentMembers={},""!==i){var o=t.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,"""),s="WITH SET [SearchMembersSet] AS 'FILTER("+(r?o+".ALLMEMBERS, ":"{"+(n>1?this.getFilterMembers(e,t,n,!0):o+", "+o+".CHILDREN")+"},")+"(INSTR(1, "+o+'.CurrentMember.member_caption, "'+i+'") > 0))'SET [SearchParentsSet] AS 'GENERATE([SearchMembersSet], ASCENDANTS([SearchMembersSet].Current))'SET [SearchSet] AS 'HIERARCHIZE(DISTINCT({[SearchMembersSet], [SearchParentsSet]}))'SELECT SUBSET([SearchSet], 0, '+a+")DIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CHILDREN_CARDINALITY, MEMBER_TYPE, MEMBER_VALUE ON 0 FROM ["+e.cube+"]",l=this.getSoapMsg(e,s),d=this.getConnectionInfo(e.url,e.localeIdentifier);if(this.doAjaxPost("POST",d.url,l,this.generateMembers.bind(this),{dataSourceSettings:e,fieldName:t,action:"fetchSearchMembers"}),this.errorInfo)throw this.errorInfo}},e.prototype.generateMembers=function(e,t,i){for(var a,r=[].slice.call(e.querySelectorAll('Axis[name="Axis0"] Tuple')),n=i.fieldName,o={},s=0,l=r;s<l.length;s++){var d=l[s],p=d.querySelector("Member"),h=p.querySelector("MEMBER_TYPE").textContent,u=p.querySelector("UName").textContent,c=p.querySelector("Caption").textContent,g=p.querySelector("PARENT_UNIQUE_NAME")?p.querySelector("PARENT_UNIQUE_NAME").textContent:"",m={"data-fieldName":n,"data-memberId":u};if(""===g&&"1"===h)o={hasChildren:!!d.querySelector("CHILDREN_CARDINALITY")&&"0"!==d.querySelector("CHILDREN_CARDINALITY").textContent,isSelected:!1,id:u,tag:u,name:c,caption:c,htmlAttributes:m},"fetchMembers"===i.action||"fetchChildMembers"===i.action?(this.fieldList[n].members[u]={name:u,caption:c,parent:void 0,isNodeExpand:!1,isSelected:!1},this.fieldList[n].filterMembers.push(o),this.fieldList[n].childMembers.push(o)):"fetchSearchMembers"===i.action?(this.fieldList[n].currrentMembers[u]={name:u,caption:c,parent:void 0,isNodeExpand:!1,isSelected:!1},this.fieldList[n].searchMembers.push(o),o.expanded=!0):this.calcChildMembers.push(o);else if(""!==g&&"1"===h)if(g===a&&"1"===h)o={hasChildren:!!d.querySelector("CHILDREN_CARDINALITY")&&"0"!==d.querySelector("CHILDREN_CARDINALITY").textContent,id:u,name:c,isSelected:!1,caption:c,htmlAttributes:m,tag:u},"fetchMembers"===i.action||"fetchChildMembers"===i.action?(this.fieldList[n].filterMembers.push(o),this.fieldList[n].childMembers.push(o),this.fieldList[n].members[u]={name:u,caption:c,parent:void 0,isNodeExpand:!1,isSelected:!1}):"fetchSearchMembers"===i.action?(o.expanded=!0,this.fieldList[n].searchMembers.push(o),this.fieldList[n].currrentMembers[u]={name:u,caption:c,parent:void 0,isNodeExpand:!1,isSelected:!1}):this.calcChildMembers.push(o);else{if("fetchMembers"===i.action&&this.fieldList[n].members[u])continue;var f=!!i.loadLevelMembers&&this.fieldList[n].members[g].isSelected;o={hasChildren:!!d.querySelector("CHILDREN_CARDINALITY")&&"0"!==d.querySelector("CHILDREN_CARDINALITY").textContent,htmlAttributes:m,isSelected:!1,id:u,pid:g,name:c,caption:c,tag:u},"fetchMembers"===i.action||"fetchChildMembers"===i.action?(this.fieldList[n].isHierarchy=!1,this.fieldList[n].filterMembers.push(o),this.fieldList[n].childMembers.push(o),this.fieldList[n].members[u]={name:u,caption:c,parent:g,isNodeExpand:!1,isSelected:f}):"fetchSearchMembers"===i.action?(this.fieldList[n].searchMembers.push(o),o.expanded=!0,this.fieldList[n].currrentMembers[u]={name:u,caption:c,parent:g,isNodeExpand:!1,isSelected:!1}):this.calcChildMembers.push(o)}else"2"===h&&(a=u)}},e.prototype.getFieldListItems=function(e,t,i){for(var a={},r=[],n=0,o=[].slice.call(e.querySelectorAll("row"));n<o.length;n++){var s=o[n],l=[].slice.call(s.querySelectorAll("ALL_MEMBER")).length>0,d=s.querySelector("DIMENSION_UNIQUE_NAME").textContent,p=s.querySelector("HIERARCHY_UNIQUE_NAME").textContent,h=d===p&&"[measures]"!==d.toLowerCase()&&"[measures]"!==p.toLowerCase();r.push({pid:this.isMondrian||h?d+"~#^Dim":d,id:p,name:s.querySelector("HIERARCHY_CAPTION").textContent,caption:s.querySelector("HIERARCHY_CAPTION").textContent,tag:p,hasAllMember:l,allMember:l?s.querySelectorAll("ALL_MEMBER")[0].textContent:void 0,type:"string"})}a={hierarchy:r,hierarchySuccess:e,measures:[]},this.fieldListObj=a;var u={catalog:i.dataSourceSettings.catalog,cube:i.dataSourceSettings.cube,url:i.dataSourceSettings.url,LCID:i.dataSourceSettings.localeIdentifier.toString(),request:"MDSCHEMA_DIMENSIONS",roles:i.dataSourceSettings.roles};this.getTreeData(u,this.loadDimensionElements.bind(this),i)},e.prototype.loadCalculatedMemberElements=function(e){if(e.length>0){var t=this.fieldListData,i={hasChildren:!0,isSelected:!1,id:"[Calculated Members].[_0]",name:"[Calculated Members].[_0]",caption:"Calculated Members",spriteCssClass:"e-calcMemberGroupCDB "+P,tag:"[Calculated Members].[_0]",type:"string"};t.length>0&&"[measures]"===t[0].id.toLowerCase()&&t.splice(0,0,i);for(var a=0,r=e;a<r.length;a++){var n=r[a];if(!this.fieldList[n.name]){var o=n.formula,s=(o.toLowerCase().indexOf("measure")>-1?"[Measures].":n.hierarchyUniqueName+".")+"["+n.name+"]",l=this.dataFields[n.name]&&this.dataFields[n.name].caption?this.dataFields[n.name].caption:this.mappingFields[n.name]&&this.mappingFields[n.name].caption?this.mappingFields[n.name].caption:n.name,d=n.formatString,p={hasChildren:!1,isSelected:!1,id:n.name,pid:"[Calculated Members].[_0]",name:n.name,caption:l,spriteCssClass:"e-calc-member "+(o.toLowerCase().indexOf("measure")>-1?"e-calc-measure-icon":"e-calc-dimension-icon")+" "+P,tag:s,formula:o,formatString:d,aggregateType:void 0,type:"CalculatedField",filter:[],dateMember:[],sort:"Ascending",actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},isHierarchy:!0,isExcelFilter:!1,isCalculatedField:!0,allowDragAndDrop:this.dataFields[n.name]?this.dataFields[n.name].allowDragAndDrop:!this.mappingFields[n.name]||this.mappingFields[n.name].allowDragAndDrop,showFilterIcon:this.dataFields[n.name]?this.dataFields[n.name].showFilterIcon:!this.mappingFields[n.name]||this.mappingFields[n.name].showFilterIcon,showSortIcon:this.dataFields[n.name]?this.dataFields[n.name].showSortIcon:!this.mappingFields[n.name]||this.mappingFields[n.name].showSortIcon,showEditIcon:this.dataFields[n.name]?this.dataFields[n.name].showEditIcon:!this.mappingFields[n.name]||this.mappingFields[n.name].showEditIcon,showRemoveIcon:this.dataFields[n.name]?this.dataFields[n.name].showRemoveIcon:!this.mappingFields[n.name]||this.mappingFields[n.name].showRemoveIcon,showValueTypeIcon:this.dataFields[n.name]?this.dataFields[n.name].showValueTypeIcon:!this.mappingFields[n.name]||this.mappingFields[n.name].showValueTypeIcon,showSubTotals:this.dataFields[n.name]?this.dataFields[n.name].showSubTotals:!this.mappingFields[n.name]||this.mappingFields[n.name].showSubTotals,fieldType:o.toLowerCase().indexOf("measure")>-1?"Measure":"Dimension",parentHierarchy:o.toLowerCase().indexOf("measure")>-1?void 0:n.hierarchyUniqueName};t.push(p),this.fieldList[p.id]=p,this.updateMembersOrder(n.name)}}}},e.prototype.loadDimensionElements=function(e,i,a){for(var r=[],n=[].slice.call(e.querySelectorAll("row")),o={},s=0,l=n;s<l.length;s++){var d=l[s],p=d.querySelector("DIMENSION_UNIQUE_NAME").textContent,h=d.querySelector("DEFAULT_HIERARCHY").textContent,u=d.querySelector("DIMENSION_CAPTION").textContent,c=p===h;p.toLowerCase().indexOf("[measure")>=0?o={hasChildren:!0,isSelected:!1,id:p,name:p,caption:u,spriteCssClass:"[measures]"===p.toLowerCase()?"e-measureGroupCDB-icon "+P:"e-dimensionCDB-icon "+P,tag:p,type:"string"}:t.isNullOrUndefined(n[0].querySelector("HIERARCHY_CAPTION"))&&r.push({hasChildren:!0,isSelected:!1,id:this.isMondrian||c?p+"~#^Dim":p,name:p,caption:u,spriteCssClass:"e-dimensionCDB-icon "+P,tag:p,defaultHierarchy:d.querySelector("DEFAULT_HIERARCHY").textContent,type:"string"})}r.splice(0,0,o),this.fieldListData=r;var g={catalog:a.dataSourceSettings.catalog,cube:a.dataSourceSettings.cube,url:a.dataSourceSettings.url,LCID:a.dataSourceSettings.localeIdentifier.toString(),request:"MDSCHEMA_SETS",roles:a.dataSourceSettings.roles};this.getTreeData(g,this.loadNamedSetElements.bind(this),a)},e.prototype.loadNamedSetElements=function(e,i,a){var r=t.extend([],this.rows,null,!0);r=r.concat(this.columns,this.filters);for(var n=this.fieldListData,o=[],s=0,l=r;s<l.length;s++){u=l[s];o.push(u.name)}for(var d=[],p=0,h=[].slice.call(e.querySelectorAll("row"));p<h.length;p++){var u=h[p];d.indexOf(u.querySelector("DIMENSIONS").textContent.split(".")[0])>=0||(n.push({hasChildren:!0,isSelected:!1,pid:u.querySelector("DIMENSIONS").textContent.split(".")[0],id:u.querySelector("SET_DISPLAY_FOLDER").textContent+"_"+u.querySelector("DIMENSIONS").textContent.split(".")[0],name:u.querySelector("SET_DISPLAY_FOLDER").textContent,spriteCssClass:"e-folderCDB-icon e-icons namedSets",caption:u.querySelector("SET_DISPLAY_FOLDER").textContent,type:"string"}),d.push(u.querySelector("DIMENSIONS").textContent.split(".")[0]));var c="["+u.querySelector("SET_NAME").textContent.trim()+"]",g={hasChildren:!0,isNamedSets:!0,isSelected:o.indexOf("["+u.querySelector("SET_NAME").textContent+"]")>=0,pid:u.querySelector("SET_DISPLAY_FOLDER").textContent+"_"+u.querySelector("DIMENSIONS").textContent.split(".")[0],id:c,name:u.querySelector("SET_CAPTION").textContent,caption:this.dataFields[c]&&this.dataFields[c].caption?this.dataFields[c].caption:this.mappingFields[c]&&this.mappingFields[c].caption?this.mappingFields[c].caption:u.querySelector("SET_CAPTION").textContent,spriteCssClass:"e-namedSetCDB-icon "+P,tag:u.querySelector("EXPRESSION").textContent,type:"string",filter:[],dateMember:[],actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},isHierarchy:!0,isExcelFilter:!1,allowDragAndDrop:this.dataFields[c]?this.dataFields[c].allowDragAndDrop:!this.mappingFields[c]||this.mappingFields[c].allowDragAndDrop,showFilterIcon:this.dataFields[c]?this.dataFields[c].showFilterIcon:!this.mappingFields[c]||this.mappingFields[c].showFilterIcon,showSortIcon:this.dataFields[c]?this.dataFields[c].showSortIcon:!this.mappingFields[c]||this.mappingFields[c].showSortIcon,showEditIcon:this.dataFields[c]?this.dataFields[c].showEditIcon:!this.mappingFields[c]||this.mappingFields[c].showEditIcon,showRemoveIcon:this.dataFields[c]?this.dataFields[c].showRemoveIcon:!this.mappingFields[c]||this.mappingFields[c].showRemoveIcon,showValueTypeIcon:this.dataFields[c]?this.dataFields[c].showValueTypeIcon:!this.mappingFields[c]||this.mappingFields[c].showValueTypeIcon,showSubTotals:this.dataFields[c]?this.dataFields[c].showSubTotals:!this.mappingFields[c]||this.mappingFields[c].showSubTotals};n.push(g),this.fieldList[c]=g,this.updateMembersOrder(c)}a.hierarchy=this.fieldListData,a.hierarchySuccess=this.fieldListObj.hierarchySuccess,this.loadHierarchyElements(a)},e.prototype.loadHierarchyElements=function(e){for(var i=e.hierarchySuccess,a=e.hierarchy,r=t.extend([],this.rows,null,!0),n=[],o=0,s=r=r.concat(this.columns,this.filters);o<s.length;o++){var l=s[o];n.push(l.name)}for(var d=0,p=[].slice.call(i.querySelectorAll("row"));d<p.length;d++){var h=(l=p[d]).querySelector("DIMENSION_UNIQUE_NAME").textContent,u=l.querySelector("HIERARCHY_UNIQUE_NAME").textContent,c=[].slice.call(l.querySelectorAll("ALL_MEMBER")).length>0,g=void 0;if(c){var m=l.querySelectorAll("ALL_MEMBER")[0].textContent.replace(/[&[\]']+/g,"").split(".");g=m[m.length-1].trim()}else g=void 0;for(var f=l.querySelector("HIERARCHY_DISPLAY_FOLDER")?l.querySelector("HIERARCHY_DISPLAY_FOLDER").textContent:"",v=[],S=0,y=a;S<y.length;S++)(D=y[S]).tag===h&&v.push(D);if(v.length>0){var b=h===u&&"[measures]"!==h.toLowerCase()&&"[measures]"!==u.toLowerCase();if("[measures]"!==h.toLowerCase()&&"[measures]"!==u.toLowerCase()){var C=h+(this.isMondrian||b?"~#^Dim":"");if(""!==f){for(var x=h+(this.isMondrian||b?"~#^Dim":"")+"_"+f,w=[],T=0,M=a;T<M.length;T++){var D=M[T];D.tag===x&&D.pid===C&&w.push(D)}if(0===w.length){var O={hasChildren:!0,isSelected:!1,pid:h+(this.isMondrian||b?"~#^Dim":""),id:x,name:f,spriteCssClass:"e-folderCDB-icon "+P,tag:x,caption:f,type:"string"};a.push(O)}C=x}var N={hasChildren:!l.querySelector("HIERARCHY_ORIGIN")||"2"!==l.querySelector("HIERARCHY_ORIGIN").textContent&&"6"!==l.querySelector("HIERARCHY_ORIGIN").textContent,isSelected:n.indexOf(u)>=0,pid:C,id:u,name:l.querySelector("HIERARCHY_CAPTION").textContent,spriteCssClass:(l.querySelector("HIERARCHY_ORIGIN")?"2"!==l.querySelector("HIERARCHY_ORIGIN").textContent&&"6"!==l.querySelector("HIERARCHY_ORIGIN").textContent?"e-hierarchyCDB-icon":"e-attributeCDB-icon":"e-hierarchyCDB-icon")+" "+P,hasAllMember:c,allMember:g,tag:u,caption:this.dataFields[u]&&this.dataFields[u].caption?this.dataFields[u].caption:this.mappingFields[u]&&this.mappingFields[u].caption?this.mappingFields[u].caption:l.querySelector("HIERARCHY_CAPTION").textContent,type:"string",filter:[],dateMember:[],sort:this.enableSort?this.sortObject[u]?this.sortObject[u]:"Ascending":"None",actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},levels:[],levelCount:1,isHierarchy:!!l.querySelector("HIERARCHY_ORIGIN")&&("2"===l.querySelector("HIERARCHY_ORIGIN").textContent||"6"===l.querySelector("HIERARCHY_ORIGIN").textContent),isExcelFilter:!1,allowDragAndDrop:this.dataFields[u]?this.dataFields[u].allowDragAndDrop:!this.mappingFields[u]||this.mappingFields[u].allowDragAndDrop,showFilterIcon:this.dataFields[u]?this.dataFields[u].showFilterIcon:!this.mappingFields[u]||this.mappingFields[u].showFilterIcon,showSortIcon:this.dataFields[u]?this.dataFields[u].showSortIcon:!this.mappingFields[u]||this.mappingFields[u].showSortIcon,showEditIcon:this.dataFields[u]?this.dataFields[u].showEditIcon:!this.mappingFields[u]||this.mappingFields[u].showEditIcon,showRemoveIcon:this.dataFields[u]?this.dataFields[u].showRemoveIcon:!this.mappingFields[u]||this.mappingFields[u].showRemoveIcon,showValueTypeIcon:this.dataFields[u]?this.dataFields[u].showValueTypeIcon:!this.mappingFields[u]||this.mappingFields[u].showValueTypeIcon,showSubTotals:this.dataFields[u]?this.dataFields[u].showSubTotals:!this.mappingFields[u]||this.mappingFields[u].showSubTotals};a.push(N),this.fieldList[u]=N,this.updateMembersOrder(u)}}}var E={catalog:e.dataSourceSettings.catalog,cube:e.dataSourceSettings.cube,url:e.dataSourceSettings.url,LCID:e.dataSourceSettings.localeIdentifier.toString(),request:"MDSCHEMA_LEVELS",roles:e.dataSourceSettings.roles};this.getTreeData(E,this.loadLevelElements.bind(this),e)},e.prototype.updateMembersOrder=function(e){for(var t=0,i=this.sortSettings;t<i.length;t++){var a=i[t];if(e===a.name&&a.membersOrder){this.fieldList[e].membersOrder=a.membersOrder;break}}},e.prototype.loadLevelElements=function(e,t,i){var a=[],r=this.fieldListData;a=[];for(var n=0,o=[].slice.call(e.querySelectorAll("row"));n<o.length;n++){var s=o[n];if(1!==parseInt(s.querySelector("LEVEL_TYPE").textContent,10)&&"[measures]"!==s.querySelector("HIERARCHY_UNIQUE_NAME").textContent.toLowerCase()){var l=s.querySelector("HIERARCHY_UNIQUE_NAME").textContent,d=s.querySelector("LEVEL_UNIQUE_NAME").textContent,p=s.querySelector("LEVEL_CAPTION").textContent,h={hasChildren:!1,isChecked:!1,isSelected:this.fieldList[l].isSelected,pid:l,id:d,name:p,tag:d,spriteCssClass:"e-level-members e-hierarchy-level-"+parseInt(s.querySelector("LEVEL_NUMBER").textContent,10)+"-icon "+P,caption:p,type:"string"};a.push(h),this.fieldList[l]&&this.fieldList[l].spriteCssClass&&-1===this.fieldList[l].spriteCssClass.indexOf("e-attributeCDB-icon")?(this.fieldList[l].levels.push(h),this.fieldList[l].isHierarchy=!1):this.fieldList[l].isHierarchy=!0}}this.fieldListData=r=r.concat(a);var u={catalog:i.dataSourceSettings.catalog,cube:i.dataSourceSettings.cube,url:i.dataSourceSettings.url,LCID:i.dataSourceSettings.localeIdentifier.toString(),request:"MDSCHEMA_MEASURES",roles:i.dataSourceSettings.roles};this.getTreeData(u,this.loadMeasureElements.bind(this),i)},e.prototype.loadMeasureElements=function(e,i,a){for(var r,n=this.fieldListData,o=[],s=[],l=0,d=t.extend([],this.values,null,!0);l<d.length;l++){c=d[l];s.push(c.name)}if("en-US"!==this.locale){var p={catalog:a.dataSourceSettings.catalog,cube:a.dataSourceSettings.cube,url:a.dataSourceSettings.url,LCID:a.dataSourceSettings.localeIdentifier.toString(),request:"MDSCHEMA_MEASUREGROUPS",roles:a.dataSourceSettings.roles};this.getTreeData(p,this.loadMeasureGroups.bind(this),a)}for(var h=0,u=[].slice.call(e.querySelectorAll("row"));h<u.length;h++){var c=u[h],g=t.isNullOrUndefined(c.querySelector("MEASUREGROUP_NAME"))?"":c.querySelector("MEASUREGROUP_NAME").textContent,m=c.querySelector("MEASURE_UNIQUE_NAME").textContent,f=c.querySelector("DEFAULT_FORMAT_STRING")?c.querySelector("DEFAULT_FORMAT_STRING").textContent:"#,#",v=c.querySelector("MEASURE_AGGREGATOR")?c.querySelector("MEASURE_AGGREGATOR").textContent:"1";if(!(o.indexOf(g)>=0)){if("en-US"!==this.locale){for(var S=[],y=0,b=this.fieldListObj.measuresGroups;y<b.length;y++){var C=b[y];C.querySelector("MEASUREGROUP_NAME").textContent===g&&S.push(C)}r=S.length>0?S[0].querySelector("MEASUREGROUP_CAPTION").textContent:g}else r=g;""!==g&&(n.push({hasChildren:!0,isChecked:!1,isSelected:!1,pid:"[Measures]",id:g,name:r,spriteCssClass:"e-measureCDB e-folderCDB-icon "+P,tag:g,caption:r,aggregateType:this.getAggregateType(g,v),type:"string"}),o.push(g))}var x={hasChildren:!1,isSelected:s.indexOf(m)>=0,pid:""===g?"[Measures]":g,id:m,name:c.querySelector("MEASURE_CAPTION").textContent,spriteCssClass:"e-measure-icon "+P,tag:m,caption:this.dataFields[m]&&this.dataFields[m].caption?this.dataFields[m].caption:this.mappingFields[m]&&this.mappingFields[m].caption?this.mappingFields[m].caption:c.querySelector("MEASURE_CAPTION").textContent,aggregateType:this.getAggregateType(m,v),type:"number",filter:[],actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},formatString:f,allowDragAndDrop:this.dataFields[m]?this.dataFields[m].allowDragAndDrop:!this.mappingFields[m]||this.mappingFields[m].allowDragAndDrop,showFilterIcon:this.dataFields[m]?this.dataFields[m].showFilterIcon:!this.mappingFields[m]||this.mappingFields[m].showFilterIcon,showSortIcon:this.dataFields[m]?this.dataFields[m].showSortIcon:!this.mappingFields[m]||this.mappingFields[m].showSortIcon,showEditIcon:this.dataFields[m]?this.dataFields[m].showEditIcon:!this.mappingFields[m]||this.mappingFields[m].showEditIcon,showRemoveIcon:this.dataFields[m]?this.dataFields[m].showRemoveIcon:!this.mappingFields[m]||this.mappingFields[m].showRemoveIcon,showValueTypeIcon:this.dataFields[m]?this.dataFields[m].showValueTypeIcon:!this.mappingFields[m]||this.mappingFields[m].showValueTypeIcon,showSubTotals:this.dataFields[m]?this.dataFields[m].showSubTotals:!this.mappingFields[m]||this.mappingFields[m].showSubTotals};n.push(x),this.fieldList[m]=x,s.indexOf(m)>=0&&s.splice(s.indexOf(m),1)}this.measureReportItems=s},e.prototype.loadMeasureGroups=function(e){t.isNullOrUndefined(this.fieldListObj)&&(this.fieldListObj={}),this.fieldListObj.measuresGroups=[].slice.call(e.querySelectorAll("row"))},e.prototype.doAjaxPost=function(e,i,a,r,n){var o=this;new t.Ajax({mode:!1,contentType:"text/xml",url:i,data:a,dataType:"xml",type:e,beforeSend:this.beforeSend.bind(this),onSuccess:function(e,t){var i=(new DOMParser).parseFromString(e,"text/xml"),a=i.querySelector("Body");a.querySelector("OlapInfo")||a.querySelector("DiscoverResponse")||(a.querySelector("Fault")&&a.querySelector("Fault").querySelector("faultstring")?o.errorInfo=a.querySelector("Fault").querySelector("faultstring").innerHTML:a.querySelector("return")&&a.querySelector("return").querySelector("Error")&&(o.errorInfo=a.querySelector("return").querySelector("Error").getAttribute("Description"))),r(i,t,n)},onFailure:function(e){o.errorInfo=e}}).send()},e.prototype.beforeSend=function(e){this.dataSourceSettings.authentication.userName&&this.dataSourceSettings.authentication.password&&e.httpRequest.setRequestHeader("Authorization","Basic "+btoa(this.dataSourceSettings.authentication.userName+":"+this.dataSourceSettings.authentication.password))},e.prototype.getSoapMsg=function(e,t){var i=this.getConnectionInfo(e.url,e.localeIdentifier);return this.isMondrian?'<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><Execute xmlns="urn:schemas-microsoft-com:xml-analysis"><Command><Statement><![CDATA['+t+"]]></Statement></Command><Properties><PropertyList><DataSourceInfo>"+""+"</DataSourceInfo><Catalog>"+e.catalog+"</Catalog><AxisFormat>TupleFormat</AxisFormat><Content>Data</Content><Format>Multidimensional</Format></PropertyList></Properties></Execute></SOAP-ENV:Body></SOAP-ENV:Envelope>":'<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> <Header></Header> <Body> <Execute xmlns="urn:schemas-microsoft-com:xml-analysis"> <Command> <Statement> '+t+" </Statement> </Command> <Properties> <PropertyList> <Catalog>"+e.catalog+"</Catalog> <LocaleIdentifier>"+i.LCID+"</LocaleIdentifier>"+(e.roles?"<Roles>"+e.roles+"</Roles>":"")+"</PropertyList> </Properties> </Execute> </Body> </Envelope>"},e.prototype.getConnectionInfo=function(e,i){var a={url:"",LCID:t.isNullOrUndefined(i)?"1033":i.toString()};if(""!==e)for(var r=0,n=e.split(";");r<n.length;r++){var o=n[r];o.toLowerCase().indexOf("locale")<0&&0===a.url.length?a.url=o:o.toLowerCase().indexOf("locale")>=0&&(a.LCID=o.replace(/ /g,"").split("=")[1])}return a},e.prototype.getMDXQuery=function(e){return xt.getCellSets(e,this,!0,void 0,!0),this.mdxQuery},e}(),Tt=function(){function e(){}return e.prototype.drawHeader=function(e,t){var i=t.pageSettings.size,r=e.header,n=new a.PointF(0,r&&r.fromTop?r.fromTop:0),o=new a.SizeF(i.width-80,r&&r.height?.75*r.height:50),s=new a.RectangleF(n,o);t.template.top=this.drawPageTemplate(new a.PdfPageTemplateElement(s),r)},e.prototype.drawFooter=function(e,t){var i=t.pageSettings.size,r=e.footer,n=new a.PointF(0,i.width-80-(r&&r.fromBottom?.75*r.fromBottom:0)),o=new a.SizeF(i.width-80,r&&r.height?.75*r.height:50),s=new a.RectangleF(n,o);t.template.bottom=this.drawPageTemplate(new a.PdfPageTemplateElement(s),r)},e.prototype.drawPageTemplate=function(e,i){for(var a=0,r=i.contents;a<r.length;a++){var n=r[a];switch(this.processContentValidation(n),n.type){case"Text":if(""===n.value||t.isNullOrUndefined(n.value)||"string"!=typeof n.value)throw new Error("please enter the valid input value in text content...");this.drawText(e,n);break;case"PageNumber":this.drawPageNumber(e,n);break;case"Image":if(t.isNullOrUndefined(n.src)||""===n.src)throw new Error("please enter the valid base64 string in image content...");this.drawImage(e,n);break;case"Line":this.drawLine(e,n)}}return e},e.prototype.processContentValidation=function(e){if(t.isNullOrUndefined(e.type))throw new Error("please set valid content type...");if("Line"===e.type){if(t.isNullOrUndefined(e.points))throw new Error("please enter valid points in "+e.type+" content...");if(t.isNullOrUndefined(e.points.x1)||"number"!=typeof e.points.x1)throw new Error("please enter valid x1 co-ordinate in "+e.type+" points...");if(t.isNullOrUndefined(e.points.y1)||"number"!=typeof e.points.y1)throw new Error("please enter valid y1 co-ordinate in "+e.type+" points...");if(t.isNullOrUndefined(e.points.x2)||"number"!=typeof e.points.x2)throw new Error("please enter valid x2 co-ordinate in "+e.type+" points...");if(t.isNullOrUndefined(e.points.y2)||"number"!=typeof e.points.y2)throw new Error("please enter valid y2 co-ordinate in "+e.type+" points...")}else{if(t.isNullOrUndefined(e.position))throw new Error("please enter valid position in "+e.type+" content...");if(t.isNullOrUndefined(e.position.x)||"number"!=typeof e.position.x)throw new Error("please enter valid x co-ordinate in "+e.type+" position...");if(t.isNullOrUndefined(e.position.y)||"number"!=typeof e.position.y)throw new Error("please enter valid y co-ordinate in "+e.type+" position...")}},e.prototype.drawText=function(e,i){var r=this.getFontFromContent(i),n=this.getBrushFromContent(i),o=null;if(!t.isNullOrUndefined(i.style)&&!t.isNullOrUndefined(i.style.textPenColor)){var s=this.hexDecToRgb(i.style.textPenColor);o=new a.PdfPen(new a.PdfColor(s.r,s.g,s.b))}null==n&&null==o&&(n=new a.PdfSolidBrush(new a.PdfColor(0,0,0)));var l=i.value.toString(),d=.75*i.position.x,p=.75*i.position.y,h=new a.PdfStringFormat;t.isNullOrUndefined(i.stringFormat)||(h=i.stringFormat);var u=this.setContentFormat(i,h);null===u||t.isNullOrUndefined(u.format)||t.isNullOrUndefined(u.size)?e.graphics.drawString(l,r,o,n,d,p,h):e.graphics.drawString(l,r,o,n,d,p,u.size.width,u.size.height,u.format)},e.prototype.drawPageNumber=function(e,i){var r=this.getFontFromContent(i),n=null;if(t.isNullOrUndefined(i.style)||t.isNullOrUndefined(i.style.textBrushColor))n=new a.PdfSolidBrush(new a.PdfColor(0,0,0));else{var o=this.hexDecToRgb(i.style.textBrushColor);n=new a.PdfSolidBrush(new a.PdfColor(o.r,o.g,o.b))}var s=new a.PdfPageNumberField(r,n);s.numberStyle=this.getPageNumberStyle(i.pageNumberType);var l,d;if(t.isNullOrUndefined(i.format))d="{0}",l=new a.PdfCompositeField(r,n,d,s);else{var p="$total";if(-1!==i.format.indexOf(p)&&-1!==i.format.indexOf("$current"))(h=new a.PdfPageCountField(r)).numberStyle=this.getPageNumberStyle(i.pageNumberType),d=i.format.indexOf(p)>i.format.indexOf("$current")?(d=i.format.replace("$current","0")).replace(p,"1"):(d=i.format.replace("$current","1")).replace(p,"0"),l=new a.PdfCompositeField(r,n,d,s,h);else if(-1!==i.format.indexOf("$current")&&-1===i.format.indexOf(p))d=i.format.replace("$current","0"),l=new a.PdfCompositeField(r,n,d,s);else{var h=new a.PdfPageCountField(r);d=i.format.replace(p,"0"),l=new a.PdfCompositeField(r,n,d,h)}}var u=.75*i.position.x,c=.75*i.position.y,g=this.setContentFormat(i,l.stringFormat);null===g||t.isNullOrUndefined(g.format)||t.isNullOrUndefined(g.size)||(l.stringFormat=g.format,l.bounds=new a.RectangleF(u,c,g.size.width,g.size.height)),l.draw(e.graphics,u,c)},e.prototype.drawImage=function(e,i){var r=.75*i.position.x,n=.75*i.position.y,o=t.isNullOrUndefined(i.size)||t.isNullOrUndefined(i.size.width)?void 0:.75*i.size.width,s=t.isNullOrUndefined(i.size)||t.isNullOrUndefined(i.size.height)?void 0:.75*i.size.height,l=new a.PdfBitmap(i.src);t.isNullOrUndefined(o)?e.graphics.drawImage(l,r,n):e.graphics.drawImage(l,r,n,o,s)},e.prototype.drawLine=function(e,i){var a=.75*i.points.x1,r=.75*i.points.y1,n=.75*i.points.x2,o=.75*i.points.y2,s=this.getPenFromContent(i);t.isNullOrUndefined(i.style)||(t.isNullOrUndefined(i.style.penSize)||"number"!=typeof i.style.penSize||(s.width=.75*i.style.penSize),s.dashStyle=this.getDashStyle(i.style.dashStyle)),e.graphics.drawLine(s,a,r,n,o)},e.prototype.getFontFromContent=function(e){var i=t.isNullOrUndefined(e.font)||t.isNullOrUndefined(e.font.fontSize)?t.isNullOrUndefined(e.style)||t.isNullOrUndefined(e.style.fontSize)?9.75:.75*e.style.fontSize:.75*e.font.fontSize,r=t.isNullOrUndefined(e.font)||t.isNullOrUndefined(e.font.pdfFontFamily)?a.PdfFontFamily.TimesRoman:e.font.pdfFontFamily,n=a.PdfFontStyle.Regular;return t.isNullOrUndefined(e.font)||t.isNullOrUndefined(e.font.bold)||(n|=a.PdfFontStyle.Bold),t.isNullOrUndefined(e.font)||t.isNullOrUndefined(e.font.italic)||(n|=a.PdfFontStyle.Italic),t.isNullOrUndefined(e.font)||t.isNullOrUndefined(e.font.underline)||(n|=a.PdfFontStyle.Underline),t.isNullOrUndefined(e.font)||t.isNullOrUndefined(e.font.strikeout)||(n|=a.PdfFontStyle.Strikeout),new a.PdfStandardFont(r,i,n)},e.prototype.getPenFromContent=function(e){var i=new a.PdfPen(new a.PdfColor(0,0,0));if(!t.isNullOrUndefined(e.style)&&null!==e.style&&!t.isNullOrUndefined(e.style.penColor)){var r=this.hexDecToRgb(e.style.penColor);i=new a.PdfPen(new a.PdfColor(r.r,r.g,r.b))}return i},e.prototype.getBrushFromContent=function(e){var i=null;if(!t.isNullOrUndefined(e.style)&&!t.isNullOrUndefined(e.style.textBrushColor)){var r=this.hexDecToRgb(e.style.textBrushColor);i=new a.PdfSolidBrush(new a.PdfColor(r.r,r.g,r.b))}return i},e.prototype.setContentFormat=function(e,i){if(!t.isNullOrUndefined(e.size)){var r=.75*e.size.width,n=.75*e.size.height;if(i=new a.PdfStringFormat(a.PdfTextAlignment.Left,a.PdfVerticalAlignment.Middle),!t.isNullOrUndefined(e.style)&&!t.isNullOrUndefined(e.style.hAlign))switch(e.style.hAlign){case"Right":i.alignment=a.PdfTextAlignment.Right;break;case"Center":i.alignment=a.PdfTextAlignment.Center;break;case"Justify":i.alignment=a.PdfTextAlignment.Justify}if(!t.isNullOrUndefined(e.style)&&!t.isNullOrUndefined(e.style.vAlign))switch(e.style.vAlign){case"Bottom":i.lineAlignment=a.PdfVerticalAlignment.Bottom;break;case"Top":i.lineAlignment=a.PdfVerticalAlignment.Top}return{format:i,size:new a.SizeF(r,n)}}return null},e.prototype.getPageNumberStyle=function(e){switch(e){case"LowerLatin":return 2;case"LowerRoman":return 3;case"UpperLatin":return 4;case"UpperRoman":return 5;default:return 1}},e.prototype.getDashStyle=function(e){switch(e){case"Dash":return 1;case"Dot":return 2;case"DashDot":return 3;case"DashDotDot":return 4;default:return 0}},e.prototype.hexDecToRgb=function(e){if(null===e||""===e||7!==e.length)throw new Error("please set valid hex value for color..");e=e.substring(1);var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:255&t}},e}(),Mt=function(){function e(e){this.parent=e,this.pdfExportHelper=new Tt}return e.prototype.getModuleName=function(){return"chartExport"},e.prototype.pdfChartExport=function(e,i,r,n){var o=this,s=[this.parent.chart],l=this.getChartInfo(s),d=l.width,p=l.height,h=this.parent.chart.svgObject;this.parent.chart.enableCanvas||(h=t.createElement("canvas",{id:"ej2-canvas",attrs:{width:d.toString(),height:p.toString()}}));var u=window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(l.svg)],{type:"image/svg+xml"})),c=new Image,g=h.getContext("2d");return c.src=u,new Promise(function(s){c.onload=function(){var l;l=t.isNullOrUndefined(i)?new a.PdfDocument:i,g.drawImage(c,0,0),window.URL.revokeObjectURL(u),o.exportPdf(h,l,r,n,d,p,e),s(l)}})},e.prototype.getChartInfo=function(e,i){var a,r=0,n=0,o=this.parent.chart.enableCanvas,s=new c.SvgRenderer("").createSvg({id:"Svg_Export_Element",width:200,height:200});return e.map(function(e){var l=e.svgObject.cloneNode(!0),d=e.renderer.createGroup({style:t.isNullOrUndefined(i)||i?"transform: translateY("+n+"px)":"transform: translateX("+r+"px)"});"transparent"===(a=l.childNodes[0]?l.childNodes[0].getAttribute("fill"):"transparent")&&(a=e.theme.indexOf("Dark")>-1||"HighContrast"===e.theme?"rgba(0, 0, 0, 1)":"rgba(255, 255, 255, 1)"),o||d.appendChild(l),r=e.availableSize.width,n=e.availableSize.height,o||s.appendChild(d)}),o||(s.setAttribute("width",r+""),s.setAttribute("height",n+""),s.setAttribute("style","background-color: "+a+";")),{width:r,height:n,svg:s}},e.prototype.exportPdf=function(e,i,r,n,o,s,l){var d=i.sections.add(),p=i.pageSettings.width,h=i.pageSettings.height,u=i.pageSettings.margins,c=o+u.left+u.right;i.pageSettings.size=new a.SizeF(c,h);var g=this.exportProperties.fileName?this.exportProperties.fileName:t.isNullOrUndefined(l)||t.isNullOrUndefined(l.fileName)?"default":l.fileName;if(this.exportProperties.width||this.exportProperties.height?(i.pageSettings.orientation=this.exportProperties.width>this.exportProperties.height||!this.exportProperties.height&&this.exportProperties.width>h||!this.exportProperties.width&&p>this.exportProperties.height?a.PdfPageOrientation.Landscape:a.PdfPageOrientation.Portrait,i.pageSettings.size=new a.SizeF(this.exportProperties.width?this.exportProperties.width:p,this.exportProperties.height?this.exportProperties.height:h)):(i.pageSettings.orientation=0===this.exportProperties.orientation||this.exportProperties.orientation?this.exportProperties.orientation:t.isNullOrUndefined(l)||t.isNullOrUndefined(l.pageOrientation)?a.PdfPageOrientation.Landscape:"Landscape"===l.pageOrientation?a.PdfPageOrientation.Landscape:a.PdfPageOrientation.Portrait,t.isNullOrUndefined(l)||t.isNullOrUndefined(l.pageSize)||(i.pageSettings.size=f.getPageSize(l.pageSize))),!t.isNullOrUndefined(this.exportProperties.pdfMargins)){var m=i.pageSettings.margins;m.top=t.isNullOrUndefined(this.exportProperties.pdfMargins.top)?m.top:this.exportProperties.pdfMargins.top,m.bottom=t.isNullOrUndefined(this.exportProperties.pdfMargins.bottom)?m.bottom:this.exportProperties.pdfMargins.bottom,m.left=t.isNullOrUndefined(this.exportProperties.pdfMargins.left)?m.left:this.exportProperties.pdfMargins.left,m.right=t.isNullOrUndefined(this.exportProperties.pdfMargins.right)?m.right:this.exportProperties.pdfMargins.right}d.setPageSettings(i.pageSettings),h=i.pageSettings.height;var v=e.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");v=v.slice(v.indexOf(",")+1);var S=new a.PdfBitmap(v),y=d.pages.add();t.isNullOrUndefined(l)||t.isNullOrUndefined(l.header)||this.pdfExportHelper.drawHeader(l,i),t.isNullOrUndefined(l)||t.isNullOrUndefined(l.footer)||this.pdfExportHelper.drawFooter(l,i),y.graphics.drawImage(S,0,0,h<s||this.exportProperties.width||i.pageSettings.size?y.getClientSize().width:c,h<s?y.getClientSize().height:s);var b;n||r?n&&(b=i.save()):(i.save(g+".pdf"),i.destroy());var C={type:"PDF",promise:n?b:null};return this.parent.trigger("exportComplete",C),new Promise(function(){})},e.prototype.destroy=function(){this.exportProperties&&(this.exportProperties=null),this.pdfExportHelper&&(this.pdfExportHelper=null)},e}(),Dt=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function a(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),Ot=function(e,t,i,a){var r,n=arguments.length,o=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},Pt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Dt(i,e),Ot([t.Property(!0)],i.prototype,"showFilterIcon",void 0),Ot([t.Property(!0)],i.prototype,"showSortIcon",void 0),Ot([t.Property(!0)],i.prototype,"showRemoveIcon",void 0),Ot([t.Property(!0)],i.prototype,"showValueTypeIcon",void 0),Ot([t.Property("Both")],i.prototype,"displayMode",void 0),Ot([t.Property(!0)],i.prototype,"allowDragAndDrop",void 0),Ot([t.Property(!1)],i.prototype,"showFieldsPanel",void 0),i}(t.ChildProperty),Nt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Dt(i,e),Ot([t.Property(!1)],i.prototype,"allowAdding",void 0),Ot([t.Property(!1)],i.prototype,"allowEditing",void 0),Ot([t.Property(!1)],i.prototype,"allowDeleting",void 0),Ot([t.Property(!1)],i.prototype,"allowCommandColumns",void 0),Ot([t.Property(!1)],i.prototype,"allowInlineEditing",void 0),Ot([t.Property("Normal")],i.prototype,"mode",void 0),Ot([t.Property(!0)],i.prototype,"allowEditOnDblClick",void 0),Ot([t.Property(!0)],i.prototype,"showConfirmDialog",void 0),Ot([t.Property(!1)],i.prototype,"showDeleteConfirmDialog",void 0),i}(t.ChildProperty),Et=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Dt(i,e),Ot([t.Property()],i.prototype,"measure",void 0),Ot([t.Property()],i.prototype,"label",void 0),Ot([t.Property("NotEquals")],i.prototype,"conditions",void 0),Ot([t.Property()],i.prototype,"value1",void 0),Ot([t.Property()],i.prototype,"value2",void 0),i}(t.ChildProperty),Ft=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Dt(i,e),Ot([t.Property(!1)],i.prototype,"showHyperlink",void 0),Ot([t.Property(!1)],i.prototype,"showRowHeaderHyperlink",void 0),Ot([t.Property(!1)],i.prototype,"showColumnHeaderHyperlink",void 0),Ot([t.Property(!1)],i.prototype,"showValueCellHyperlink",void 0),Ot([t.Property(!1)],i.prototype,"showSummaryCellHyperlink",void 0),Ot([t.Collection([],Et)],i.prototype,"conditionalSettings",void 0),Ot([t.Property()],i.prototype,"headerText",void 0),Ot([t.Property("")],i.prototype,"cssClass",void 0),i}(t.ChildProperty),It=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Dt(i,e),Ot([t.Property(5)],i.prototype,"columnPageSize",void 0),Ot([t.Property(5)],i.prototype,"rowPageSize",void 0),Ot([t.Property(1)],i.prototype,"currentColumnPage",void 0),Ot([t.Property(1)],i.prototype,"currentRowPage",void 0),i}(t.ChildProperty),Lt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Dt(i,e),Ot([t.Property("Bottom")],i.prototype,"position",void 0),Ot([t.Property(!1)],i.prototype,"isInversed",void 0),Ot([t.Property(!0)],i.prototype,"showRowPager",void 0),Ot([t.Property(!0)],i.prototype,"showColumnPager",void 0),Ot([t.Property(!0)],i.prototype,"showRowPageSize",void 0),Ot([t.Property(!0)],i.prototype,"showColumnPageSize",void 0),Ot([t.Property([10,50,100,200])],i.prototype,"rowPageSizes",void 0),Ot([t.Property([5,10,20,50,100])],i.prototype,"columnPageSizes",void 0),Ot([t.Property(!1)],i.prototype,"enableCompactView",void 0),Ot([t.Property()],i.prototype,"template",void 0),i}(t.ChildProperty),At=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Dt(i,e),Ot([t.Property("Table")],i.prototype,"view",void 0),Ot([t.Property("Table")],i.prototype,"primary",void 0),i}(t.ChildProperty),Rt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Dt(i,e),Ot([t.Property(!1)],i.prototype,"allowSinglePage",void 0),i}(t.ChildProperty),kt=function(e){function o(i,a){var r=e.call(this,i,a)||this;return r.verticalScrollScale=1,r.horizontalScrollScale=1,r.scrollerBrowserLimit=8e6,r.lastSortInfo={},r.lastFilterInfo={},r.lastAggregationInfo={},r.lastCalcFieldInfo={},r.isScrolling=!1,r.allowEngineExport=!1,r.isInitial=!0,r.shiftLockedPos=[],r.savedSelectedCellsPos=[],r.cellSelectionPos=[],r.isPopupClicked=!1,r.isMouseDown=!1,r.isMouseUp=!1,r.fieldsType={},r.remoteData=[],r.defaultItems={},r.isCellBoxMultiSelection=!1,r.gridCellCollection={},r.rowRangeSelection={enable:!1,startIndex:0,endIndex:0},r.isStaticRefresh=!1,r.resizeInfo={},r.scrollPosObject={vertical:0,horizontal:0,verticalSection:0,horizontalSection:0,top:0,left:0,scrollDirection:{direction:"",position:0}},r.pivotColumns=[],r.totColWidth=0,r.posCount=0,r.isModified=!1,r.isInitialRendering=!1,r.needsID=!0,r.pivotRefresh=t.Component.prototype.refresh,r.request="undefined"!=typeof window?new XMLHttpRequest:null,r.isServerWaitingPopup=!1,r.actionObj={},r.defaultFieldListOrder="None",r.destroyEngine=!1,r.pivotView=r,t.setValue("mergePersistData",r.mergePersistPivotData,r),r}return Dt(o,e),o.prototype.requiredModules=function(){var e=[];return this.showGroupingBar&&e.push({args:[this],member:"groupingBar"}),this.allowConditionalFormatting&&e.push({args:[this],member:"conditionalFormatting"}),this.allowNumberFormatting&&e.push({args:[this],member:"numberFormatting"}),this.allowCalculatedField&&e.push({args:[this],member:"calculatedField"}),this.showToolbar&&(this.toolbar.length>0||this.toolbarTemplate)&&e.push({args:[this],member:"toolbar"}),this.showFieldList&&e.push({args:[this],member:"fieldList"}),this.allowExcelExport&&e.push({args:[this],member:"excelExport"}),this.allowPdfExport&&e.push({args:[this],member:"pdfExport"}),this.enableVirtualization&&e.push({args:[this],member:"virtualscroll"}),this.allowGrouping&&e.push({args:[this],member:"grouping"}),(this.allowDrillThrough||this.editSettings&&this.editSettings.allowEditing)&&e.push({args:[this],member:"drillThrough"}),this.enablePaging&&e.push({args:[this],member:"pager"}),e},o.prototype.preRender=function(){this.dataSourceSettings&&"SSAS"===this.dataSourceSettings.providerType?(this.dataType="olap",this.olapEngineModule=new wt):(this.dataType="pivot",this.engineModule=new S),this.isAdaptive=t.Browser.isDevice,t.Browser.isIE||"edge"===t.Browser.info.name?this.scrollerBrowserLimit=15e5:"chrome"===t.Browser.info.name&&(this.scrollerBrowserLimit=15e6),this.isTouchMode=!!t.closest(this.element,"e-bigger"),this.initProperties(),this.renderToolTip(),this.keyboardModule=new De(this),this.contextMenuModule=new Oe(this),this.globalize=new t.Internationalization(this.locale),(this.showFieldList||this.showGroupingBar||this.allowNumberFormatting||this.allowCalculatedField||this.toolbar&&this.showToolbar||this.allowGrouping||this.gridSettings.contextMenuItems||this.allowDrillThrough)&&(this.commonModule=new oe(this)),!this.allowPdfExport||"Both"!==this.displayOption.view&&"Chart"!==this.displayOption.view||(this.chartExportModule=new Mt(this)),this.defaultLocale={applyToGrandTotal:"Apply to Grand Total",grandTotal:"Grand Total",total:"Total",value:"Value",noValue:"No value",row:"Row",column:"Column",collapse:"Collapse",expand:"Expand",rowAxisPrompt:"Drop row here",columnAxisPrompt:"Drop column here",valueAxisPrompt:"Drop value here",filterAxisPrompt:"Drop filter here",filter:"Filter",filtered:"Filtered",sort:"Sort",filters:"Filters",rows:"Rows",columns:"Columns",values:"Values",close:"Close",cancel:"Cancel",delete:"Delete",CalculatedField:"Calculated Field",createCalculatedField:"Create Calculated Field",fieldName:"Enter the field name",error:"Error",invalidFormula:"Invalid formula.",dropText:'Example: ("Sum(Order_Count)" + "Sum(In_Stock)") * 250',dropTextMobile:"Add fields and edit formula here.",dropAction:"Calculated field cannot be place in any other region except value axis.",alert:"Alert",warning:"Warning",ok:"OK",search:"Search",drag:"Drag",remove:"Remove",allFields:"All Fields",formula:"Formula",addToRow:"Add to Row",addToColumn:"Add to Column",addToValue:"Add to Value",addToFilter:"Add to Filter",emptyData:"No records to display",fieldExist:"A field already exists in this name. Please enter a different name.",confirmText:"A calculation field already exists in this name. Do you want to replace it?",noMatches:"No matches",format:"Summaries values by",edit:"Edit",clear:"Clear",sortAscending:"Sort ascending order",sortDescending:"Sort descending order",sortNone:"Sort data order",clearCalculatedField:"Clear edited field info",editCalculatedField:"Edit calculated field",formulaField:"Drag and drop fields to formula",dragField:"Drag field to formula",clearFilter:"Clear",by:"by",all:"All",multipleItems:"Multiple items",member:"Member",label:"Label",date:"Date",enterValue:"Enter value",chooseDate:"Enter date",Before:"Before",BeforeOrEqualTo:"Before Or Equal To",After:"After",AfterOrEqualTo:"After Or Equal To",labelTextContent:"Show the items for which the label",dateTextContent:"Show the items for which the date",valueTextContent:"Show the items for which",Equals:"Equals",DoesNotEquals:"Does Not Equal",BeginWith:"Begins With",DoesNotBeginWith:"Does Not Begin With",EndsWith:"Ends With",DoesNotEndsWith:"Does Not End With",Contains:"Contains",DoesNotContains:"Does Not Contain",GreaterThan:"Greater Than",GreaterThanOrEqualTo:"Greater Than Or Equal To",LessThan:"Less Than",LessThanOrEqualTo:"Less Than Or Equal To",Between:"Between",NotBetween:"Not Between",And:"and",Sum:"Sum",Count:"Count",DistinctCount:"Distinct Count",Product:"Product",Avg:"Avg",Median:"Median",Min:"Min",SampleVar:"Sample Var",PopulationVar:"Population Var",RunningTotals:"Running Totals",Max:"Max",Index:"Index",SampleStDev:"Sample StDev",PopulationStDev:"Population StDev",PercentageOfRowTotal:"% of Row Total",PercentageOfParentTotal:"% of Parent Total",PercentageOfParentColumnTotal:"% of Parent Column Total",PercentageOfParentRowTotal:"% of Parent Row Total",DifferenceFrom:"Difference From",PercentageOfDifferenceFrom:"% of Difference From",PercentageOfGrandTotal:"% of Grand Total",PercentageOfColumnTotal:"% of Column Total",MoreOption:"More...",NotEquals:"Not Equals",AllValues:"All Values",conditionalFormatting:"Conditional Formatting",apply:"Apply",condition:"Add Condition",formatLabel:"Format",valueFieldSettings:"Value field settings",baseField:"Base field",baseItem:"Base item",summarizeValuesBy:"Summarize values by",sourceName:"Field name :",sourceCaption:"Field caption",example:"e.g:",editorDataLimitMsg:" more items. Search to refine further.",details:"Details",manageRecords:"Manage Records",Years:"Years",Quarters:"Quarters",Months:"Months",Days:"Days",Hours:"Hours",Minutes:"Minutes",Seconds:"Seconds",save:"Save a report",new:"Create a new report",load:"Load",saveAs:"Save as current report",rename:"Rename a current report",deleteReport:"Delete a current report",export:"Export",subTotals:"Sub totals",grandTotals:"Grand totals",reportName:"Report Name :",pdf:"PDF",excel:"Excel",csv:"CSV",png:"PNG",jpeg:"JPEG",svg:"SVG",mdxQuery:"MDX Query",showSubTotals:"Show subtotals",doNotShowSubTotals:"Do not show subtotals",showSubTotalsRowsOnly:"Show subtotals rows only",showSubTotalsColumnsOnly:"Show subtotals columns only",showGrandTotals:"Show grand totals",doNotShowGrandTotals:"Do not show grand totals",showGrandTotalsRowsOnly:"Show grand totals rows only",showGrandTotalsColumnsOnly:"Show grand totals columns only",fieldList:"Show fieldlist",grid:"Show table",toolbarFormatting:"Conditional formatting",chart:"Chart",reportMsg:"Please enter valid report name!!!",reportList:"Report list",removeConfirm:"Are you sure you want to delete this report?",emptyReport:"No reports found!!",bar:"Bar",pie:"Pie",funnel:"Funnel",doughnut:"Doughnut",pyramid:"Pyramid",stackingcolumn:"Stacked Column",stackingarea:"Stacked Area",stackingbar:"Stacked Bar",stackingline:"Stacked Line",stepline:"Step Line",steparea:"Step Area",splinearea:"Spline Area",spline:"Spline",stackingcolumn100:"100% Stacked Column",stackingbar100:"100% Stacked Bar",stackingarea100:"100% Stacked Area",stackingline100:"100% Stacked Line",bubble:"Bubble",pareto:"Pareto",radar:"Radar",line:"Line",area:"Area",scatter:"Scatter",polar:"Polar",of:"of",emptyFormat:"No format found!!!",emptyInput:"Enter a value",newReportConfirm:"Do you want to save the changes to this report?",emptyReportName:"Enter a report name",qtr:"Qtr",null:"null",undefined:"undefined",groupOutOfRange:"Out of Range",fieldDropErrorAction:"The field you are moving cannot be placed in that area of the report",aggregate:"Aggregate",drillThrough:"Drill Through",ascending:"Ascending",descending:"Descending",number:"Number",currency:"Currency",percentage:"Percentage",formatType:"Format Type",customText:"Currency Symbol",symbolPosition:"Symbol Position",left:"Left",right:"Right",grouping:"Grouping",true:"True",false:"False",decimalPlaces:"Decimal Places",numberFormat:"Number Formatting",memberType:"Field Type",formatString:"Format",expressionField:"Expression",customFormat:"Enter custom format string",numberFormatString:"Example: C, P, 0000 %, ###0.##0#, etc.",selectedHierarchy:"Parent Hierarchy",olapDropText:"Example: [Measures].[Order Quantity] + ([Measures].[Order Quantity] * 0.10)",Percent:"Percent",Currency:"Currency",Custom:"Custom",Measure:"Measure",Dimension:"Dimension",Standard:"Standard",blank:"(Blank)",fieldTooltip:'Drag and drop fields to create an expression. And, if you want to edit the existing calculated fields! You can achieve it by simply selecting the field under "Calculated Members".',fieldTitle:"Field Name",QuarterYear:"Quarter Year",drillError:"Cannot show the raw items of calculated fields.",caption:"Field Caption",copy:"Copy",defaultReport:"Sample Report",customFormatString:"Custom Format",invalidFormat:"Invalid Format.",group:"Group",unGroup:"Ungroup",invalidSelection:"Cannot group that selection.",groupName:"Enter the caption to display in header",captionName:"Enter the caption for group field",selectedItems:"Selected items",groupFieldCaption:"Field caption",groupTitle:"Group name",startAt:"Starting at",endAt:"Ending at",groupBy:"Interval by",selectGroup:"Select groups",multipleAxes:"Multiple Axis",showLegend:"Show Legend",exit:"Exit",chartTypeSettings:"Chart Type Settings",ChartType:"Chart Type",yes:"Yes",no:"No",numberFormatMenu:"Number Formatting...",conditionalFormattingMenu:"Conditional Formatting...",removeCalculatedField:"Are you sure you want to delete this calculated field?",replaceConfirmBefore:"A report named ",replaceConfirmAfter:" already exists. Do you want to replace it?",invalidJSON:"Invalid JSON data",invalidCSV:"Invalid CSV data",stacked:"Stacked",single:"Single",combined:"Combined",multipleAxisMode:"Multiple Axis Mode",grandTotalPosition:"Grand totals position",top:"Top",bottom:"Bottom",None:"None",rowPage:"Row pager",rowPerPage:"Rows per page",columnPage:"Column pager",columnPerPage:"Columns per page",goToFirstPage:"Go to first page",goToPreviousPage:"Go to previous page",goToNextPage:"Go to next page",goToLastPage:"Go to last page",subTotalPosition:"Subtotals position",auto:"Auto",loading:"Loading...",add:"Add"},this.localeObj=new t.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.renderContextMenu(),this.isDragging=!1,this.pivotDeferLayoutUpdate=t.isNullOrUndefined(this.pivotDeferLayoutUpdate)?this.allowDeferLayoutUpdate:this.pivotDeferLayoutUpdate,this.addInternalEvents()},o.prototype.onBeforeTooltipOpen=function(e){e.element.classList.add("e-pivottooltipwrap")},o.prototype.renderToolTip=function(){this.showTooltip?(this.tooltipTemplate?this.tooltip=new r.Tooltip({target:"td.e-valuescontent",cssClass:"e-pivottooltiptemplate"+(this.cssClass?" "+this.cssClass:""),showTipPointer:!1,position:"BottomRight",mouseTrail:!0,enableRtl:this.enableRtl,locale:this.locale,enableHtmlSanitizer:this.enableHtmlSanitizer,beforeRender:this.setToolTip.bind(this),beforeOpen:this.onBeforeTooltipOpen}):this.tooltip=new r.Tooltip({target:"td.e-valuescontent",cssClass:this.cssClass,showTipPointer:!1,position:"BottomRight",mouseTrail:!0,enableRtl:this.enableRtl,locale:this.locale,enableHtmlSanitizer:this.enableHtmlSanitizer,beforeRender:this.setToolTip.bind(this),beforeOpen:this.onBeforeTooltipOpen}),this.tooltip.isStringTemplate=!0,this.tooltip.appendTo(this.element)):this.tooltip&&this.tooltip.destroy()},o.prototype.renderContextMenu=function(){if(this.gridSettings.contextMenuItems||this.allowGrouping&&"pivot"===this.dataType){var e=[],t=[],i=[],a=[],r=[],n=[],o=[];if(this.gridSettings.contextMenuItems)for(var s=0,l=this.gridSettings.contextMenuItems;s<l.length;s++){var d=l[s];if("string"==typeof d&&-1!==this.getDefaultItems().indexOf(d))if(-1!==d.toString().toLowerCase().indexOf("aggregate")&&"pivot"===this.dataType){o=[{text:this.localeObj.getConstant("Sum")}];var p=this.buildDefaultItems("Aggregate");p.items=o,r.push(p)}else-1!==d.toString().toLowerCase().indexOf("export")?a.push(this.buildDefaultItems(d)):e.push(this.buildDefaultItems(d));else"string"!=typeof d&&i.push(d)}if(this.allowGrouping&&"pivot"===this.dataType&&(this.getFieldByID(this.element.id+"_custom_group",this.gridSettings.contextMenuItems)||t.push(this.buildDefaultItems("Group")),this.getFieldByID(this.element.id+"_custom_ungroup",this.gridSettings.contextMenuItems)||t.push(this.buildDefaultItems("Ungroup"))),a.length>0){var h=this.buildDefaultItems("export");h.items=a,n.push(h)}var u=[];Array.prototype.push.apply(u,r),Array.prototype.push.apply(u,e),Array.prototype.push.apply(u,t),Array.prototype.push.apply(u,n),Array.prototype.push.apply(u,i),this.setProperties({gridSettings:{contextMenuItems:u}},!0)}},o.prototype.getFieldByID=function(e,t){return new i.DataManager({json:t}).executeLocal((new i.Query).where("id","equal",e))[0]},o.prototype.getAllSummaryType=function(){return["Sum","Count","DistinctCount","Product","Min","Max","Avg","Median","Index","PopulationVar","SampleVar","PopulationStDev","SampleStDev","RunningTotals","PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfParentColumnTotal","PercentageOfParentRowTotal","DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"]},o.prototype.getDefaultItems=function(){return["Drillthrough","Expand","Collapse","Pdf Export","Excel Export","Csv Export","Sort Ascending","Sort Descending","Aggregate","CalculatedField"]},o.prototype.buildDefaultItems=function(e){var t;switch(e){case"Aggregate":t={text:this.localeObj.getConstant("aggregate"),target:"th.e-valuesheader,td.e-valuescontent,.e-stot.e-rowsheader",id:this.element.id+"_aggregate"};break;case"CalculatedField":t={text:this.localeObj.getConstant("CalculatedField"),target:"td.e-valuescontent",id:this.element.id+"_CalculatedField"};break;case"Drillthrough":t={text:this.localeObj.getConstant("drillThrough"),target:"td.e-valuescontent",id:this.element.id+"_drillthrough_menu",iconCss:"e-pivotview-grid "+P};break;case"export":t={text:this.localeObj.getConstant("export"),target:"td.e-valuescontent",id:this.element.id+"_exporting",iconCss:"e-pivotview-export "+P};break;case"Pdf Export":t={text:this.localeObj.getConstant("pdf"),id:this.element.id+"_pdf",iconCss:"e-pivotview-pdf-export "+P};break;case"Excel Export":t={text:this.localeObj.getConstant("excel"),id:this.element.id+"_excel",iconCss:"e-pivotview-excel-export "+P};break;case"Csv Export":t={text:this.localeObj.getConstant("csv"),id:this.element.id+"_csv",iconCss:"e-pivotview-csv-export "+P};break;case"Expand":t={text:this.localeObj.getConstant("expand"),target:"td.e-rowsheader,.e-columnsheader",id:this.element.id+"_expand",iconCss:"e-pivotview-expand "+P};break;case"Collapse":t={text:this.localeObj.getConstant("collapse"),target:"td.e-rowsheader,.e-columnsheader",id:this.element.id+"_collapse",iconCss:"e-pivotview-collapse "+P};break;case"Sort Ascending":t={text:this.localeObj.getConstant("ascending"),target:"th.e-valuesheader,.e-stot",id:this.element.id+"_sortasc",iconCss:"e-icon-ascending "+P};break;case"Sort Descending":t={text:this.localeObj.getConstant("descending"),target:"th.e-valuesheader,.e-stot",id:this.element.id+"_sortdesc",iconCss:"e-icon-descending "+P};break;case"Group":t={text:this.localeObj.getConstant("group"),target:"td.e-rowsheader,.e-columnsheader",id:this.element.id+"_custom_group",iconCss:"e-pivotview-group "+P};break;case"Ungroup":t={text:this.localeObj.getConstant("unGroup"),target:"td.e-rowsheader,.e-columnsheader",id:this.element.id+"_custom_ungroup",iconCss:"e-pivotview-ungroup "+P}}return this.defaultItems[e]={text:t.text,id:t.id,target:t.target,iconCss:t.iconCss},this.defaultItems[e]},o.prototype.initProperties=function(){this.isTabular="Tabular"===this.gridSettings.layout,this.pivotRefresh=t.Component.prototype.refresh,this.minHeight=t.isNullOrUndefined(this.minHeight)?300:this.minHeight<10?10:this.minHeight,this.isScrolling=!1,this.allowServerDataBinding=!1,this.isStaticRefresh=!1,this.setProperties({pivotValues:[]},!0),this.allowServerDataBinding=!0,this.scrollPosObject={vertical:0,horizontal:0,verticalSection:0,horizontalSection:0,top:0,left:0,scrollDirection:{direction:"",position:0}},this.queryCellInfo=this.gridSettings.queryCellInfo?this.gridSettings.queryCellInfo.bind(this):void 0,this.headerCellInfo=this.gridSettings.headerCellInfo?this.gridSettings.headerCellInfo.bind(this):void 0,this.resizing=this.gridSettings.resizing?this.gridSettings.resizing.bind(this):void 0,this.resizeStop=this.gridSettings.resizeStop?this.gridSettings.resizeStop.bind(this):void 0,this.pdfHeaderQueryCellInfo=this.gridSettings.pdfHeaderQueryCellInfo?this.gridSettings.pdfHeaderQueryCellInfo:void 0,this.pdfQueryCellInfo=this.gridSettings.pdfQueryCellInfo?this.gridSettings.pdfQueryCellInfo:void 0,this.excelHeaderQueryCellInfo=this.gridSettings.excelHeaderQueryCellInfo?this.gridSettings.excelHeaderQueryCellInfo:void 0,this.excelQueryCellInfo=this.gridSettings.excelQueryCellInfo?this.gridSettings.excelQueryCellInfo:void 0,this.columnDragStart=this.gridSettings.columnDragStart?this.gridSettings.columnDragStart.bind(this):void 0,this.columnDrag=this.gridSettings.columnDrag?this.gridSettings.columnDrag.bind(this):void 0,this.columnDrop=this.gridSettings.columnDrop?this.gridSettings.columnDrop.bind(this):void 0,this.beforeColumnsRender=this.gridSettings.columnRender?this.gridSettings.columnRender:void 0,this.selected=this.gridSettings.cellSelected?this.gridSettings.cellSelected:void 0,this.cellDeselected=this.gridSettings.cellDeselected?this.gridSettings.cellDeselected:void 0,this.rowSelected=this.gridSettings.rowSelected?this.gridSettings.rowSelected:void 0,this.rowDeselected=this.gridSettings.rowDeselected?this.gridSettings.rowDeselected:void 0,this.chartTooltipRender=this.chartSettings.tooltipRender?this.chartSettings.tooltipRender:void 0,this.chartLegendClick=this.chartSettings.legendClick?this.chartSettings.legendClick:void 0,this.chartLoaded=this.chartSettings.loaded?this.chartSettings.loaded:void 0,this.chartLoad=this.chartSettings.load?this.chartSettings.load:void 0,this.chartResized=this.chartSettings.resized?this.chartSettings.resized:void 0,this.chartAxisLabelRender=this.chartSettings.axisLabelRender?this.chartSettings.axisLabelRender:void 0,this.multiLevelLabelClick=this.chartSettings.multiLevelLabelClick?this.chartSettings.multiLevelLabelClick:void 0,this.chartPointClick=this.chartSettings.pointClick?this.chartSettings.pointClick:void 0,this.contextMenuClick=this.gridSettings.contextMenuClick?this.gridSettings.contextMenuClick:void 0,this.contextMenuOpen=this.gridSettings.contextMenuOpen?this.gridSettings.contextMenuOpen:void 0,this.beforePdfExport=this.gridSettings.beforePdfExport?this.gridSettings.beforePdfExport.bind(this):void 0,this.beforeExcelExport=this.gridSettings.beforeExcelExport?this.gridSettings.beforeExcelExport.bind(this):void 0,this.beforePrint=this.chartSettings.beforePrint?this.chartSettings.beforePrint:void 0,this.animationComplete=this.chartSettings.animationComplete?this.chartSettings.animationComplete:void 0,this.legendRender=this.chartSettings.legendRender?this.chartSettings.legendRender:void 0,this.textRender=this.chartSettings.textRender?this.chartSettings.textRender:void 0,this.pointRender=this.chartSettings.pointRender?this.chartSettings.pointRender:void 0,this.seriesRender=this.chartSettings.seriesRender?this.chartSettings.seriesRender:void 0,this.chartMouseMove=this.chartSettings.chartMouseMove?this.chartSettings.chartMouseMove:void 0,this.chartMouseClick=this.chartSettings.chartMouseClick?this.chartSettings.chartMouseClick:void 0,this.pointMove=this.chartSettings.pointMove?this.chartSettings.pointMove:void 0,this.chartMouseLeave=this.chartSettings.chartMouseLeave?this.chartSettings.chartMouseLeave:void 0,this.chartMouseDown=this.chartSettings.chartMouseDown?this.chartSettings.chartMouseDown:void 0,this.chartMouseUp=this.chartSettings.chartMouseUp?this.chartSettings.chartMouseUp:void 0,this.dragComplete=this.chartSettings.dragComplete?this.chartSettings.dragComplete:void 0,this.zoomComplete=this.chartSettings.zoomComplete?this.chartSettings.zoomComplete:void 0,this.scrollStart=this.chartSettings.scrollStart?this.chartSettings.scrollStart:void 0,this.scrollEnd=this.chartSettings.scrollEnd?this.chartSettings.scrollEnd:void 0,this.scrollChanged=this.chartSettings.scrollChanged?this.chartSettings.scrollChanged:void 0,this.multiLevelLabelRender=this.chartSettings.multiLevelLabelRender?this.chartSettings.multiLevelLabelRender:void 0,null===this.gridSettings.rowHeight&&(this.isTouchMode?this.setProperties({gridSettings:{rowHeight:36}},!0):this.setProperties({gridSettings:{rowHeight:this.isAdaptive?36:30}},!0)),this.chartSettings&&this.chartSettings.showMemberSeries&&!this.chartSettings.showPointColorByMembers&&this.setProperties({chartSettings:{showPointColorByMembers:!0}},!0),this.element.style.height="100%",this.enableVirtualization&&this.updatePageSettings(!0),this.isCellBoxMultiSelection=this.gridSettings.allowSelection&&"Box"===this.gridSettings.selectionSettings.cellSelectionMode&&"Cell"===this.gridSettings.selectionSettings.mode&&"Multiple"===this.gridSettings.selectionSettings.type,this.allowGrouping&&!this.isCellBoxMultiSelection&&(this.isCellBoxMultiSelection=!0,this.setProperties({gridSettings:{allowSelection:!0,selectionSettings:{cellSelectionMode:"Box",mode:"Cell",type:"Multiple"}}},!0)),"Table"!==this.displayOption.view&&(this.pivotChartModule=new Fe(this)),this.currentView=this.currentView?this.currentView:"Both"===this.displayOption.view?this.displayOption.primary:this.displayOption.view},o.prototype.updatePageSettings=function(e){if(this.enableVirtualization){var t=1,i=1;this.dataSourceSettings.values.length>1&&"pivot"===this.dataType&&("row"===this.dataSourceSettings.valueAxis?i=this.dataSourceSettings.values.length:t=this.dataSourceSettings.values.length);var a=this.getHeightAsNumber();isNaN(a)&&(a=this.element.offsetHeight),this.pageSettings={currentColumnPage:e?1:this.pageSettings.currentColumnPage,currentRowPage:e?1:this.pageSettings.currentRowPage,columnPageSize:Math.ceil((Math.floor(this.getWidthAsNumber()/this.gridSettings.columnWidth)-1)/t),rowPageSize:Math.ceil(Math.floor(a/this.gridSettings.rowHeight)/i)}}},o.prototype.render=function(){this.loadData()},o.prototype.loadData=function(){if(this.dataSourceSettings.formatSettings.length>0)for(var e=this.dataSourceSettings.formatSettings,i=0;i<e.length;i++)t.isNullOrUndefined(e[i].maximumFractionDigits)&&t.isNullOrUndefined(e[i].minimumFractionDigits)||null!==e[i].format.match(/^(P|N|C|P[0-9]|C[0-9]|N[0-9])$/g)||(e[i].maximumFractionDigits=void 0,e[i].minimumIntegerDigits=void 0);"pivot"===this.dataType&&this.dataSourceSettings.url&&""!==this.dataSourceSettings.url?"Server"===this.dataSourceSettings.mode?(this.guid=f.generateUUID(),this.initialLoad(),"Chart"!==this.displayOption.view?this.renderEmptyGrid():this.refreshData(),this.showWaitingPopup()):new t.Fetch(this.dataSourceSettings.url,"GET").send().then(function(e){return"string"==typeof e?e:e.text()}).then(this.onReadyStateChange.bind(this)):this.initialLoad()},o.prototype.onSuccess=function(e){if(this.request.readyState===XMLHttpRequest.DONE)if("onExcelExport"===this.currentAction||"onCsvExport"===this.currentAction){if(200===this.request.status){var i=this.request.response,a=t.isNullOrUndefined(e.fileName)?"onExcelExport"===this.currentAction?"default.xlsx":"default.csv":e.fileName;g.Save.save(a,i)}}else{this.isServerWaitingPopup=!0;try{var r={action:this.currentAction,response:this.request.responseText};this.trigger("afterServiceInvoke",r);var n=JSON.parse(this.request.responseText);if("fetchFieldMembers"===this.currentAction){var o=JSON.parse(n.members),s=[],l={};this.engineModule.globalize=t.isNullOrUndefined(this.globalize)?new t.Internationalization:this.globalize,this.engineModule.formatFields=this.engineModule.setFormattedFields(this.dataSourceSettings.formatSettings);for(var d=f.isDateField(n.memberName,this.engineModule),p="number"===this.engineModule.fieldList[n.memberName].type,h=0,u=(T=Object.keys(o)).length;h<u;h++){var c=o[T[h]],m=d?this.engineModule.getFormattedValue(c.Name,n.memberName):{formattedText:c.Caption};l[T[h]]={index:c.Index,ordinal:c.Ordinal,isDrilled:c.IsDrilled,caption:m.formattedText},s.push({formattedText:m.formattedText,actualText:d?m.dateText:p?isNaN(Number(c.Name))?c.Name:Number(c.Name):c.Name})}this.engineModule.fieldList[n.memberName].members=l,this.engineModule.fieldList[n.memberName].dateMember=s,this.showGroupingBar?this.pivotButtonModule.updateFilterEvents():this.pivotFieldListModule.pivotButtonModule.updateFilterEvents()}else if("fetchRawData"===this.currentAction){for(var v=this.engineModule.fieldList[this.drillThroughValue.actualText.toString()]?this.engineModule.fieldList[this.drillThroughValue.actualText.toString()].caption:this.drillThroughValue.actualText.toString(),S=this.engineModule.fieldList[this.drillThroughValue.actualText]?this.engineModule.fieldList[this.drillThroughValue.actualText].aggregateType:"",y=JSON.parse(n.rawData),b=JSON.parse(n.indexObject),C={},x=0;x<b.length;x++)C[b[x].Key]=b[x].Value;this.drillThroughValue.indexObject=C,this.drillThroughModule.triggerDialog(v,S,y,this.drillThroughValue,this.drillThroughElement),this.hideWaitingPopup()}else{var w=f.formatFieldList(JSON.parse(n.fieldList));if(this.engineModule.fieldList)for(var T=Object.keys(this.engineModule.fieldList),h=0;h<T.length;h++)this.engineModule.fieldList[T[h]]&&w[T[h]]&&(w[T[h]].dateMember=this.engineModule.fieldList[T[h]].dateMember,w[T[h]].formattedMembers=this.engineModule.fieldList[T[h]].formattedMembers,w[T[h]].members=this.engineModule.fieldList[T[h]].members);this.engineModule.fieldList=w,this.engineModule.fields=JSON.parse(n.fields),this.engineModule.rowCount=JSON.parse(n.pivotCount).RowCount,this.engineModule.columnCount=JSON.parse(n.pivotCount).ColumnCount,this.engineModule.rowStartPos=JSON.parse(n.pivotCount).RowStartPosition,this.engineModule.colStartPos=JSON.parse(n.pivotCount).ColumnStartPosition,this.engineModule.rowFirstLvl=JSON.parse(n.pivotCount).RowFirstLevel,this.engineModule.colFirstLvl=JSON.parse(n.pivotCount).ColumnFirstLevel,this.engineModule.columnPageCount=JSON.parse(n.pivotCount).ColumnPageCount,this.engineModule.rowPageCount=JSON.parse(n.pivotCount).RowPageCount;for(var M=void 0,D=f.formatPivotValues(JSON.parse(n.pivotValue)),O=0;O<D.length;O++)if(D[O]&&D[O][0]&&"row"===D[O][0].axis){M=O;break}this.engineModule.headerContent=f.frameContent(D,"header",M,this),this.engineModule.pageSettings=this.pageSettings,this.dataSourceSettings.groupSettings.length>0&&f.updateReport(this,JSON.parse(n.dataSourceSettings));var P=JSON.parse(n.dataSourceSettings).ValueSortSettings;this.engineModule.valueSortSettings={headerText:P.HeaderText,headerDelimiter:P.HeaderDelimiter,sortOrder:P.SortOrder,columnIndex:P.ColumnIndex},this.engineModule.pivotValues=D,this.engineModule.isEmptyData=0===this.dataSourceSettings.values.length;for(var N=0,E=this.dataSourceSettings.values;N<E.length;N++){var F=E[N];this.engineModule.valueAxisFields[F.name]=F}}}catch(e){this.engineModule.pivotValues=[]}if("onScroll"===this.currentAction)if("vertical"===this.scrollDirection){var I="row"===this.dataSourceSettings.valueAxis?this.dataSourceSettings.values.length:1,L=(R=this.pageSettings.rowPageSize*I*this.gridSettings.rowHeight)*(k=Math.ceil(this.engineModule.rowStartPos/(this.pageSettings.rowPageSize*I)))-this.engineModule.rowFirstLvl*I*this.gridSettings.rowHeight;this.scrollPosObject.verticalSection=L}else if("horizondal"===this.scrollDirection){var A="column"===this.dataSourceSettings.valueAxis?this.dataSourceSettings.values.length:1,R=this.pageSettings.columnPageSize*A*this.gridSettings.columnWidth,k=Math.ceil(this.engineModule.colStartPos/(this.pageSettings.columnPageSize*A)),L=R*k-this.engineModule.colFirstLvl*A*this.gridSettings.columnWidth;this.scrollPosObject.horizontalSection=L}"fetchFieldMembers"!==this.currentAction&&"fetchRawData"!==this.currentAction&&(this.initEngine(),this.calculatedFieldModule&&this.calculatedFieldModule.isRequireUpdate&&(this.calculatedFieldModule.endDialog(),this.calculatedFieldModule.isRequireUpdate=!1),this.pivotFieldListModule&&this.pivotFieldListModule.calculatedFieldModule&&this.pivotFieldListModule.calculatedFieldModule.isRequireUpdate&&(this.pivotFieldListModule.calculatedFieldModule.endDialog(),this.pivotFieldListModule.calculatedFieldModule.isRequireUpdate=!1))}},o.prototype.getEngine=function(e,t,i,a,r,n,o,s,l,d){var p=this;this.engineModule.isEmptyData=!1,this.element.querySelector(".e-spin-hide")&&"onExcelExport"!==e&&"onCsvExport"!==e&&this.showWaitingPopup(),this.currentAction=e,this.isServerWaitingPopup=!1;var h={pageSettings:JSON.parse(this.getPageSettings()).pageSettings,enableValueSorting:this.enableValueSorting,enablePaging:this.enablePaging,enableVirtualization:this.enableVirtualization,allowDataCompression:this.allowDataCompression,enableDrillThrough:this.allowDrillThrough||this.editSettings.allowEditing,locale:JSON.stringify(f.getLocalizedObject(this)),enableOptimizedRendering:this.enableVirtualization&&this.virtualScrollSettings&&this.virtualScrollSettings.allowSinglePage,requestType:"string",headers:{"Content-type":"application/json"}};this.request.readyState!==XMLHttpRequest.UNSENT&&this.request.readyState!==XMLHttpRequest.OPENED||(this.request.withCredentials=!1);var u={request:this.request,dataSourceSettings:JSON.parse(this.getPersistData()).dataSourceSettings,action:e,customProperties:{},internalProperties:h,drillItem:t,sortItem:i,aggregatedItem:a,calculatedItem:r,filterItem:n,memberName:o,fetchRawDataArgs:s,editArgs:l,hash:this.guid,excelExportProperties:d,exportAllPages:this.exportAllPages,isGroupingUpdated:"onRefresh"===this.currentAction&&this.dataSourceSettings.groupSettings.length>0||!!this.groupingModule&&this.groupingModule.isUpdate};this.trigger("beforeServiceInvoke",u,function(e){p.request=e.request,u.internalProperties=e.internalProperties,u.customProperties=e.customProperties,u.dataSourceSettings=e.dataSourceSettings,u.calculatedItem=e.calculatedItem,u.drillItem=e.drillItem,u.editArgs=e.editArgs,u.fetchRawDataArgs=e.fetchRawDataArgs,u.filterItem=e.filterItem,u.hash=e.hash,u.memberName=e.memberName,u.sortItem=e.sortItem,u.excelExportProperties=e.excelExportProperties,u.exportAllPages=e.exportAllPages}),this.request.open("POST",this.dataSourceSettings.url,!0),this.request.onreadystatechange=this.onSuccess.bind(this,u.excelExportProperties),"onExcelExport"===u.action||"onCsvExport"===u.action?this.request.responseType="blob":this.request.responseType="";for(var c=Object.keys(u.internalProperties.headers),g=0;g<c.length;g++){var m=c[g],v=String(u.internalProperties.headers[m]);this.request.setRequestHeader(m,v)}"string"===u.internalProperties.requestType?this.request.send(JSON.stringify(u)):"base64"===u.internalProperties.requestType&&this.request.send(btoa(JSON.stringify(u)))},o.prototype.getChartSettings=function(){var e=["chartSettings"],t=this.chartSettings.load,i=this.chartSettings.loaded,a=this.chartSettings.textRender,r=this.chartSettings.pointRender,n=this.chartSettings.seriesRender,o=this.chartSettings.legendRender,s=this.chartSettings.pointClick,l=this.chartSettings.tooltipRender,d=this.chartSettings.legendClick,p=this.chartSettings.multiLevelLabelRender,h=this.chartSettings.beforePrint,u=this.chartSettings.animationComplete,c=this.chartSettings.chartMouseMove,g=this.chartSettings.chartMouseClick,m=this.chartSettings.pointMove,f=this.chartSettings.chartMouseLeave,v=this.chartSettings.chartMouseDown,S=this.chartSettings.chartMouseUp,y=this.chartSettings.dragComplete,b=this.chartSettings.zoomComplete,C=this.chartSettings.scrollStart,x=this.chartSettings.scrollEnd,w=this.chartSettings.scrollChanged;this.chartSettings.load=void 0,this.chartSettings.loaded=void 0,this.chartSettings.textRender=void 0,this.chartSettings.pointRender=void 0,this.chartSettings.seriesRender=void 0,this.chartSettings.legendRender=void 0,this.chartSettings.pointClick=void 0,this.chartSettings.tooltipRender=void 0,this.chartSettings.legendClick=void 0,this.chartSettings.multiLevelLabelRender=void 0,this.chartSettings.beforePrint=void 0,this.chartSettings.animationComplete=void 0,this.chartSettings.chartMouseMove=void 0,this.chartSettings.chartMouseClick=void 0,this.chartSettings.pointMove=void 0,this.chartSettings.chartMouseLeave=void 0,this.chartSettings.chartMouseDown=void 0,this.chartSettings.chartMouseUp=void 0,this.chartSettings.dragComplete=void 0,this.chartSettings.zoomComplete=void 0,this.chartSettings.scrollStart=void 0,this.chartSettings.scrollEnd=void 0,this.chartSettings.scrollChanged=void 0;var T=this.addOnPersist(e);return this.chartSettings.load=t,this.chartSettings.loaded=i,this.chartSettings.textRender=a,this.chartSettings.pointRender=r,this.chartSettings.seriesRender=n,this.chartSettings.legendRender=o,this.chartSettings.pointClick=s,this.chartSettings.tooltipRender=l,this.chartSettings.legendClick=d,this.chartSettings.multiLevelLabelRender=p,this.chartSettings.beforePrint=h,this.chartSettings.animationComplete=u,this.chartSettings.chartMouseMove=c,this.chartSettings.chartMouseClick=g,this.chartSettings.pointMove=m,this.chartSettings.chartMouseLeave=f,this.chartSettings.chartMouseDown=v,this.chartSettings.chartMouseUp=S,this.chartSettings.dragComplete=y,this.chartSettings.zoomComplete=b,this.chartSettings.scrollStart=C,this.chartSettings.scrollEnd=x,this.chartSettings.scrollChanged=w,T},o.prototype.getPageSettings=function(){var e=["pageSettings"];return this.addOnPersist(e)},o.prototype.onReadyStateChange=function(e){var i=[];if("CSV"===this.dataSourceSettings.type)for(var a=e.split(/\r?\n|\r/),r=0;r<a.length;r++)t.isNullOrUndefined(a[r])||""===a[r]||i.push(a[r].split(","));else try{i=JSON.parse(e)}catch(e){i=[]}i&&i.length>0&&this.setProperties({dataSourceSettings:{dataSource:i}},!0),this.initialLoad()},o.prototype.initialLoad=function(){var e=this;try{this.cellTemplateFn=this.templateParser(this.cellTemplate),this.tooltipTemplateFn=this.templateParser(this.tooltipTemplate),this.spinnerTemplate?r.createSpinner({target:this.element,template:this.spinnerTemplate,cssClass:this.cssClass?this.cssClass:void 0},this.createElement):r.createSpinner({target:this.element,cssClass:this.cssClass?this.cssClass:void 0},this.createElement);var t={dataSourceSettings:this.dataSourceSettings,pivotview:this,fieldsType:{},defaultFieldListOrder:this.defaultFieldListOrder};this.trigger("load",t,function(i){e.dataSourceSettings=i.dataSourceSettings,e.fieldsType=i.fieldsType,e.defaultFieldListOrder=t.defaultFieldListOrder,e.updateClass(),e.notify("init-groupingbar",{}),"Server"!==e.dataSourceSettings.mode&&e.notify(y,{}),e.isAdaptive&&e.contextMenuModule.render(),e.notify("init-toolbar",{}),e.notify("init-pivotPager",{})})}catch(e){this.actionFailureMethod(e)}},o.prototype.addInternalEvents=function(){this.on(y,this.generateData,this),this.on(x,this.renderPivotGrid,this),this.on(C,this.onContentReady,this)},o.prototype.removeInternalEvents=function(){this.off(y,this.generateData),this.off(x,this.renderPivotGrid),this.off(C,this.onContentReady)},o.prototype.getPersistData=function(e){var t=["dataSourceSettings","pivotValues","gridSettings","chartSettings","displayOption","pageSettings"],a=this.gridSettings.columnRender,r=this.gridSettings.excelQueryCellInfo,n=this.gridSettings.excelHeaderQueryCellInfo,o=this.gridSettings.pdfQueryCellInfo,s=this.gridSettings.pdfHeaderQueryCellInfo,l=this.chartSettings.load,d=this.chartSettings.loaded,p=this.chartSettings.textRender,h=this.chartSettings.pointRender,u=this.chartSettings.seriesRender,c=this.chartSettings.legendRender,g=this.chartSettings.pointClick,m=this.chartSettings.tooltipRender,f=this.chartSettings.legendClick,v=this.chartSettings.multiLevelLabelRender,S=this.chartSettings.beforePrint,y=this.chartSettings.animationComplete,b=this.chartSettings.chartMouseMove,C=this.chartSettings.chartMouseClick,x=this.chartSettings.pointMove,w=this.chartSettings.chartMouseLeave,T=this.chartSettings.chartMouseDown,M=this.chartSettings.chartMouseUp,D=this.chartSettings.dragComplete,O=this.chartSettings.zoomComplete,P=this.chartSettings.scrollStart,N=this.chartSettings.scrollEnd,E=this.chartSettings.scrollChanged;this.gridSettings.columnRender=void 0,this.gridSettings.excelQueryCellInfo=void 0,this.gridSettings.excelHeaderQueryCellInfo=void 0,this.gridSettings.pdfQueryCellInfo=void 0,this.gridSettings.pdfHeaderQueryCellInfo=void 0,this.chartSettings.tooltipRender=void 0,this.chartSettings.legendClick=void 0,this.chartSettings.multiLevelLabelRender=void 0,this.chartSettings.load=void 0,this.chartSettings.loaded=void 0,this.chartSettings.textRender=void 0,this.chartSettings.pointRender=void 0,this.chartSettings.seriesRender=void 0,this.chartSettings.legendRender=void 0,this.chartSettings.pointClick=void 0,this.chartSettings.beforePrint=void 0,this.chartSettings.animationComplete=void 0,this.chartSettings.chartMouseMove=void 0,this.chartSettings.chartMouseClick=void 0,this.chartSettings.pointMove=void 0,this.chartSettings.chartMouseLeave=void 0,this.chartSettings.chartMouseDown=void 0,this.chartSettings.chartMouseUp=void 0,this.chartSettings.dragComplete=void 0,this.chartSettings.zoomComplete=void 0,this.chartSettings.scrollStart=void 0,this.chartSettings.scrollEnd=void 0,this.chartSettings.scrollChanged=void 0;var F=[];e&&(F=!this.dataSourceSettings.dataSource||this.dataSourceSettings.dataSource instanceof i.DataManager?this.dataSourceSettings.dataSource:this.dataSourceSettings.dataSource.slice(),this.setProperties({dataSourceSettings:{dataSource:[]}},!0));var I=this.addOnPersist(t);return this.gridSettings.columnRender=a,this.gridSettings.excelQueryCellInfo=r,this.gridSettings.excelHeaderQueryCellInfo=n,this.gridSettings.pdfQueryCellInfo=o,this.gridSettings.pdfHeaderQueryCellInfo=s,this.chartSettings.load=l,this.chartSettings.loaded=d,this.chartSettings.textRender=p,this.chartSettings.pointRender=h,this.chartSettings.seriesRender=u,this.chartSettings.legendRender=c,this.chartSettings.pointClick=g,this.chartSettings.tooltipRender=m,this.chartSettings.legendClick=f,this.chartSettings.multiLevelLabelRender=v,this.chartSettings.beforePrint=S,this.chartSettings.animationComplete=y,this.chartSettings.chartMouseMove=b,this.chartSettings.chartMouseClick=C,this.chartSettings.pointMove=x,this.chartSettings.chartMouseLeave=w,this.chartSettings.chartMouseDown=T,this.chartSettings.chartMouseUp=M,this.chartSettings.dragComplete=D,this.chartSettings.zoomComplete=O,this.chartSettings.scrollStart=P,this.chartSettings.scrollEnd=N,this.chartSettings.scrollChanged=E,e&&this.setProperties({dataSourceSettings:{dataSource:F}},!0),I},o.prototype.loadPersistData=function(e){var t=JSON.parse(e);this.allowServerDataBinding=!1,this.setProperties({gridSettings:t.gridSettings,pivotValues:t.pivotValues,chartSettings:t.chartSettings,displayOption:t.displayOption},!0),"Chart"===t.displayOption.primary?this.currentView="Chart":this.currentView="Table",this.allowServerDataBinding=!0,this.dataSourceSettings&&this.dataSourceSettings.dataSource&&this.dataSourceSettings.dataSource instanceof i.DataManager&&t.dataSourceSettings&&t.dataSourceSettings.dataSource&&t.dataSourceSettings.dataSource.dataSource&&this.dataSourceSettings.dataSource.dataSource&&t.dataSourceSettings.dataSource.dataSource.url===this.dataSourceSettings.dataSource.dataSource.url&&(t.dataSourceSettings.dataSource=this.dataSourceSettings.dataSource),this.dataSourceSettings=t.dataSourceSettings},o.prototype.mergePersistPivotData=function(){var e=window.localStorage.getItem(this.getModuleName()+this.element.id);if(!t.isNullOrUndefined(e)&&""!==e){var a=JSON.parse(e);this.dataSourceSettings&&this.dataSourceSettings.dataSource&&this.dataSourceSettings.dataSource instanceof i.DataManager&&a.dataSourceSettings&&a.dataSourceSettings.dataSource&&a.dataSourceSettings.dataSource.dataSource&&this.dataSourceSettings.dataSource.dataSource&&a.dataSourceSettings.dataSource.dataSource.url===this.dataSourceSettings.dataSource.dataSource.url&&(a.dataSourceSettings.dataSource=this.dataSourceSettings.dataSource),this.setProperties(a,!0)}},o.prototype.showConditionalFormattingDialog=function(){this.conditionalFormattingModule&&this.conditionalFormattingModule.showConditionalFormattingDialog()},o.prototype.createCalculatedFieldDialog=function(){this.calculatedFieldModule&&this.calculatedFieldModule.createCalculatedFieldDialog()},o.prototype.getModuleName=function(){return"pivotview"},o.prototype.copy=function(e){this.grid.copy(e)},o.prototype.onPropertyChanged=function(i,a){for(var r=!1,n=0,o=Object.keys(i);n<o.length;n++){var s=o[n];switch(s){case"dataSourceSettings":case"hyperlinkSettings":case"allowDrillThrough":case"editSettings":case"allowDataCompression":if(i.dataSourceSettings&&(!t.isNullOrUndefined(i.dataSourceSettings.dataSource)&&!t.isNullOrUndefined(this.clonedDataSet)&&this.clonedDataSet!==i.dataSourceSettings.dataSource&&!t.isNullOrUndefined(i.dataSourceSettings.groupSettings)&&i.dataSourceSettings.groupSettings.length>0||1===Object.keys(i.dataSourceSettings).length&&"dataSource"===Object.keys(i.dataSourceSettings)[0]&&this.dataSourceSettings.groupSettings.length>0)&&(this.clonedDataSet=i.dataSourceSettings.dataSource,this.engineModule.groupingFields={}),i.dataSourceSettings&&1===Object.keys(i.dataSourceSettings).length&&i.dataSourceSettings.groupSettings&&"pivot"===this.dataType&&this.updateGroupingReport(i.dataSourceSettings.groupSettings,"Date"),(t.isNullOrUndefined(i.dataSourceSettings)?[]:Object.keys(i.dataSourceSettings)).indexOf("dataSource")>-1&&"CSV"!==i.dataSourceSettings.type)!t.isNullOrUndefined(this.savedDataSourceSettings)&&this.dataSourceSettings.dataSource.length>0&&(f.updateDataSourceSettings(this,this.savedDataSourceSettings),this.savedDataSourceSettings=void 0),i.dataSourceSettings.dataSource&&0===i.dataSourceSettings.dataSource.length&&(this.savedDataSourceSettings=f.getClonedDataSourceSettings(this.dataSourceSettings),this.setProperties({dataSourceSettings:{rows:[]}},!0),this.setProperties({dataSourceSettings:{columns:[]}},!0),this.setProperties({dataSourceSettings:{values:[]}},!0),this.setProperties({dataSourceSettings:{filters:[]}},!0)),this.isStaticRefresh||(this.pivotValues=[],"pivot"===this.dataType?(this.engineModule.fieldList=null,this.engineModule.isEmptyData=!0,this.engineModule.data=[],this.engineModule.groupingFieldsInfo={}):"olap"===this.dataType&&(this.olapEngineModule.fieldList={},this.olapEngineModule.fieldListData=void 0,this.olapEngineModule.isEmptyData=!0)),this.showWaitingPopup(),this.notify(y,{});else if(f.isButtonIconRefesh(s,a,i)){if(this.showGroupingBar&&this.groupingBarModule&&this.axisFieldModule.render(),this.showFieldList&&this.pivotFieldListModule){var l=f.cloneFieldSettings(this.dataSourceSettings.rows),d=f.cloneFieldSettings(this.dataSourceSettings.columns),p=f.cloneFieldSettings(this.dataSourceSettings.values),h=f.cloneFieldSettings(this.dataSourceSettings.filters);this.pivotFieldListModule.setProperties({dataSourceSettings:{rows:l,columns:d,values:p,filters:h}},!0),this.pivotFieldListModule.axisFieldModule.render(),this.pivotFieldListModule.treeViewModule.fieldTable&&!this.isAdaptive&&this.pivotFieldListModule.notify(w,{})}}else this.remoteData=[],"pivot"===this.dataType&&this.dataSourceSettings.url&&""!==this.dataSourceSettings.url&&("type"in i.dataSourceSettings||"url"in i.dataSourceSettings)?(this.engineModule.fieldList=null,this.loadData()):(i.dataSourceSettings&&("pivot"===this.dataType&&"dataSource"in i.dataSourceSettings||"olap"===this.dataType&&"url"in i.dataSourceSettings)&&(this.isStaticRefresh||("pivot"===this.dataType?(this.engineModule.fieldList=null,this.engineModule.isEmptyData=!0,this.engineModule.data=[],this.engineModule.groupingFieldsInfo={}):"olap"===this.dataType&&(this.olapEngineModule.fieldList={},this.olapEngineModule.fieldListData=void 0,this.olapEngineModule.isEmptyData=!0),this.pivotValues=[])),this.notify(y,{}));break;case"height":case"width":this.layoutRefresh();break;case"pivotValues":case"displayOption":if(i.displayOption&&1===Object.keys(i.displayOption).length&&i.displayOption.view)switch(this.currentView="Both"===i.displayOption.view?this.displayOption.primary:i.displayOption.view,(this.showGroupingBar||this.showFieldList)&&(this.showFieldList&&this.pivotFieldListModule&&(this.pivotFieldListModule.destroyEngine=!0,this.pivotFieldListModule.destroy(),null!==t.select("#"+this.element.id+"_PivotFieldList",this.element)&&t.remove(t.select("#"+this.element.id+"_PivotFieldList",this.element)),this.pivotFieldListModule.destroyEngine=!1),this.notify("init-groupingbar",this)),i.displayOption.view){case"Both":this.pivotChartModule||(this.pivotChartModule=new Fe(this)),this.grid||this.renderEmptyGrid();break;case"Chart":this.grid&&(this.grid.destroy(),this.grid=void 0),this.pivotChartModule||(this.pivotChartModule=new Fe(this));break;case"Table":this.grid||this.renderEmptyGrid(),this.pivotChartModule&&(this.destroyEngine=!0,this.pivotChartModule.destroy(),this.destroyEngine=!1,this.chart=void 0,this.pivotChartModule=void 0)}else this.showToolbar&&!t.isNullOrUndefined(i.displayOption)&&i.displayOption.view&&(this.currentView="Both"===i.displayOption.view?this.displayOption.primary:i.displayOption.view);this.showToolbar&&!t.isNullOrUndefined(i.displayOption)&&i.displayOption.view&&("Chart"===i.displayOption.view?(this.toolbarModule.createChartMenu(),this.toggleButtonState("e-toolbar-grid","add"),this.toggleButtonState("e-toolbar-chart","remove")):"Table"===i.displayOption.view?(t.select("#"+this.element.id+"_grid",this.element).style.display="block",this.toggleButtonState("e-toolbar-chart","add"),this.toggleButtonState("e-toolbar-grid","remove")):(this.toolbarModule.createChartMenu(),this.toggleButtonState("e-toolbar-grid","remove"),this.toggleButtonState("e-toolbar-chart","remove")));var u="pivot"===this.dataType?this.engineModule:this.olapEngineModule;t.isNullOrUndefined(u.fieldList)&&t.isNullOrUndefined(u.pivotValues)||this.notify(x,{});break;case"gridSettings":this.isTabular="Tabular"===this.gridSettings.layout,this.lastGridSettings=i.gridSettings,this.isCellBoxMultiSelection=this.gridSettings.allowSelection&&"Box"===this.gridSettings.selectionSettings.cellSelectionMode&&"Cell"===this.gridSettings.selectionSettings.mode&&"Multiple"===this.gridSettings.selectionSettings.type,this.allowGrouping&&this.groupingModule&&!this.isCellBoxMultiSelection&&(this.setProperties({gridSettings:{allowSelection:!0,selectionSettings:{cellSelectionMode:"Box",mode:"Cell",type:"Multiple"}}},!0),this.isCellBoxMultiSelection=!0),this.renderModule.updateGridSettings(),i.gridSettings.layout&&this.initialLoad();break;case"chartSettings":this.showGroupingBar&&this.groupingBarModule&&(-1!==Object.keys(i.chartSettings).indexOf("enableMultipleAxis")||i.chartSettings.chartSeries&&-1!==Object.keys(i.chartSettings.chartSeries).indexOf("type"))&&(this.groupingBarModule.renderLayout(),this.pivotChartModule&&this.groupingBarModule.appendToElement()),t.isNullOrUndefined(this.pivotChartModule)&&"Table"!==this.displayOption.view&&(this.pivotChartModule=new Fe(this));var c="pivot"===this.dataType?this.engineModule:this.olapEngineModule;t.isNullOrUndefined(this.pivotChartModule)||t.isNullOrUndefined(c.pivotValues)||this.pivotChartModule.loadChart(this,this.chartSettings),t.isNullOrUndefined(c.pivotValues)||t.isNullOrUndefined(c.fieldList)||this.notify(b,this);break;case"locale":case"currencyCode":case"enableRtl":if(this.tooltip&&this.tooltip.destroy(),this.dataSourceSettings.groupSettings&&this.dataSourceSettings.groupSettings.length>0&&this.clonedDataSet){var g="CSV"===this.dataSourceSettings.type?f.getClonedCSVData(this.clonedDataSet):f.getClonedData(this.clonedDataSet);this.setProperties({dataSourceSettings:{dataSource:g}},!0)}e.prototype.refresh.call(this),this.updateClass();break;case"enableValueSorting":this.enableValueSorting=i.enableValueSorting,this.updateDataSource();break;case"showGroupingBar":this.element.querySelector(".e-grouping-bar")?this.element.querySelector(".e-grouping-bar").remove():this.groupingBarModule&&this.groupingBarModule.renderLayout(),t.isNullOrUndefined(i.showFieldList)&&this.renderPivotGrid();break;case"showFieldList":this.initialLoad();break;case"groupingBarSettings":this.showGroupingBar&&this.groupingBarModule&&(i.groupingBarSettings&&Object.keys(i.groupingBarSettings).indexOf("showFieldsPanel")>-1?(this.groupingBarModule.RefreshFieldsPanel(),this.layoutRefresh()):this.axisFieldModule.render());break;case"showValuesButton":this.showGroupingBar&&this.groupingBarModule&&this.axisFieldModule&&this.axisFieldModule.render(),this.showFieldList&&this.pivotFieldListModule&&this.pivotFieldListModule.axisFieldModule&&(this.pivotFieldListModule.setProperties({showValuesButton:i.showValuesButton},!0),this.pivotFieldListModule.axisFieldModule.render());break;case"showTooltip":this.renderToolTip();break;case"showToolbar":case"toolbar":this.toolbarModule&&this.showToolbar&&this.toolbarModule.refreshToolbar();break;case"chartTypes":this.toolbarModule&&this.toolbarModule.createChartMenu();break;case"aggregateTypes":this.showGroupingBar&&this.groupingBarModule&&this.axisFieldModule&&this.axisFieldModule.render(),this.showFieldList&&this.pivotFieldListModule&&this.pivotFieldListModule.axisFieldModule&&(this.pivotFieldListModule.setProperties({aggregateTypes:i.aggregateTypes},!0),this.pivotFieldListModule.axisFieldModule.render());break;case"enableFieldSearching":this.pivotFieldListModule&&(this.pivotFieldListModule.enableFieldSearching=this.enableFieldSearching);break;case"pageSettings":this.enableVirtualization||(this.engineModule.pageSettings=this.pageSettings,this.engineModule.fieldList?this.refreshPageData():this.initialLoad());break;case"pagerSettings":case"enablePaging":this.notify("init-pivotPager",this),this.initialLoad();break;case"cellTemplate":this.cellTemplateFn=this.templateParser(this.cellTemplate),r=!0;break;case"tooltipTemplate":this.tooltipTemplateFn=this.templateParser(this.tooltipTemplate),r=!0;break;case"allowCalculatedField":this.pivotFieldListModule&&(this.pivotFieldListModule.allowCalculatedField=this.allowCalculatedField);break;case"allowDeferLayoutUpdate":this.pivotFieldListModule&&(this.pivotFieldListModule.allowDeferLayoutUpdate=this.allowDeferLayoutUpdate);break;case"allowGrouping":this.refresh()}}r&&this.grid&&this.grid.refreshColumns()},o.prototype.toggleButtonState=function(e,t){var i=this.element.querySelector("."+e);if(i){var a=i.closest(".e-toolbar-item");a&&("add"===t?a.classList.add("e-disabled"):"remove"===t&&a.classList.remove("e-disabled"))}},o.prototype.templateParser=function(e){if(e)try{return"function"!=typeof e&&document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}},o.prototype.getCellTemplate=function(){return this.cellTemplateFn},o.prototype.appendHtml=function(e,i){var a=document.createElement("div");return a.innerHTML=i,t.isNullOrUndefined(a.firstChild)||e.appendChild(a.firstChild),e},o.prototype.renderPivotGrid=function(){this.isEmptyGrid=!1,this.notEmpty=!0,this.clearTemplate(),this.showGroupingBar&&(this.pivotChartModule&&this.appendChartElement(),this.groupingBarModule.appendToElement()),this.pivotChartModule&&(this.pivotChartModule.engineModule=this.engineModule,this.pivotChartModule.loadChart(this,this.chartSettings),this.enableRtl&&this.chart&&"rtl"!==document.body.getAttribute("dir")&&t.addClass([this.chart.element],"e-ltr")),this.enableVirtualization&&(this.virtualscrollModule=new Pe(this)),(this.allowDrillThrough||this.editSettings.allowEditing)&&(this.drillThroughModule=new Ee(this)),this.enablePaging&&this.notify("init-pivotPager",this),"Chart"!==this.displayOption.view?(this.hyperlinkSettings&&(this.isRowCellHyperlink=!!this.hyperlinkSettings.showRowHeaderHyperlink||!!this.hyperlinkSettings.showHyperlink,this.isColumnCellHyperlink=!!this.hyperlinkSettings.showColumnHeaderHyperlink||!!this.hyperlinkSettings.showHyperlink,this.isValueCellHyperlink=!!this.hyperlinkSettings.showValueCellHyperlink||!!this.hyperlinkSettings.showHyperlink,this.isSummaryCellHyperlink=!!this.hyperlinkSettings.showSummaryCellHyperlink||!!this.hyperlinkSettings.showHyperlink,this.applyHyperlinkSettings()),this.renderModule=this.renderModule?this.renderModule:new Z(this),this.renderModule.render(!0)):this.grid&&t.remove(this.grid.element),(this.showFieldList||this.allowNumberFormatting||this.allowCalculatedField||this.toolbar||this.allowGrouping||this.gridSettings.contextMenuItems)&&(this.notify(b,this),this.pivotFieldListModule&&this.allowDeferLayoutUpdate&&(this.pivotFieldListModule.clonedDataSource=f.getClonedDataSourceSettings(this.dataSourceSettings))),this.allowConditionalFormatting&&this.applyFormatting(this.pivotValues),this.showToolbar&&"Both"===this.displayOption.view&&this.chart&&this.grid&&(this.showGroupingBar&&this.groupingBarModule&&this.element.querySelector(".e-grouping-bar")&&this.groupingBarModule.refreshUI(),this.toolbarModule&&this.toolbarModule.toolbar&&(this.toolbarModule.toolbar.width=this.getGridWidthAsNumber()),this.chartSettings.enableScrollOnMultiAxis&&this.chartSettings.enableMultipleAxis&&(this.element.querySelector("."+W).style.width=t.formatUnit(this.getGridWidthAsNumber())),this.chart.width=t.formatUnit(this.getGridWidthAsNumber()),"Table"===this.currentView?(this.grid.element.style.display="",this.chart.element.style.display="none",this.chartSettings.enableMultipleAxis&&this.chartSettings.enableScrollOnMultiAxis&&(this.element.querySelector(".e-pivotchart").style.display="none")):(this.grid.element.style.display="none",this.chart.element.style.display="",this.chartSettings.enableMultipleAxis&&this.chartSettings.enableScrollOnMultiAxis&&(this.element.querySelector(".e-pivotchart").style.display=""))),this.toolbarModule&&(this.showFieldList&&t.select("#"+this.element.id+"_PivotFieldList",this.element)&&(this.toolbar&&-1!==this.toolbar.indexOf("FieldList")?t.select("#"+this.element.id+"_PivotFieldList",this.element).style.display="none":(t.select("#"+this.element.id+"_PivotFieldList",this.element).style.top=this.element.querySelector("."+z).offsetHeight.toString()+"px",t.select("#"+this.element.id+"_PivotFieldList",this.element).style.position="relative")),this.toolbar&&-1!==this.toolbar.indexOf("FieldList")&&this.showToolbar&&this.element.querySelector(".e-toggle-field-list")&&(this.element.querySelector(".e-toggle-field-list").style.display="none"),this.toolbarModule&&"New"!==this.toolbarModule.action&&"Load"!==this.toolbarModule.action&&"Remove"!==this.toolbarModule.action&&(this.isModified=!0),this.isInitialRendering||(this.isModified=!1,this.isInitialRendering=!this.isInitialRendering),this.toolbarModule.action="")},o.prototype.appendChartElement=function(){if(!t.select("#"+this.element.id+"_chart",this.element)){"Both"===this.displayOption.view&&"Chart"===this.displayOption.primary?this.element.insertBefore(t.createElement("div",{className:W,id:this.element.id+"_chart"}),this.element.querySelector(".e-grid")):this.element.appendChild(t.createElement("div",{className:W,id:this.element.id+"_chart"}));var e=this.width.toString();this.showToolbar&&this.grid&&(e=this.getGridWidthAsNumber().toString());var i=this.pivotChartModule.getChartHeight();(this.chartSettings&&this.chartSettings.chartSeries&&this.pivotChartModule.accumulationType.indexOf(this.chartSettings.chartSeries.type)>-1?new u.AccumulationChart({width:e,height:i}):new u.Chart({width:e,height:i})).appendTo(t.select("#"+this.element.id+"_chart",this.element)),this.showToolbar&&("Both"===this.displayOption.view&&"Chart"===this.currentView&&(this.grid.element.style.display="none"),"Chart"!==this.currentView&&(t.select("#"+this.element.id+"_chart",this.element).style.display="none"))}},o.prototype.showWaitingPopup=function(){this.grid&&this.grid.element&&!this.spinnerTemplate&&"Table"===this.currentView?r.showSpinner(this.grid.element):r.showSpinner(this.element)},o.prototype.hideWaitingPopup=function(){this.grid&&this.grid.element&&!this.spinnerTemplate&&"Table"===this.currentView?r.hideSpinner(this.grid.element):r.hideSpinner(this.element)},o.prototype.updateDataSource=function(){var e=this;this.showWaitingPopup();var i=this,a=!t.isNullOrUndefined(i.lastSortInfo)&&Object.keys(i.lastSortInfo).length>0,r=!t.isNullOrUndefined(i.lastFilterInfo)&&Object.keys(i.lastFilterInfo).length>0,n=!t.isNullOrUndefined(i.lastAggregationInfo)&&Object.keys(i.lastAggregationInfo).length>0,o=!t.isNullOrUndefined(i.lastCalcFieldInfo)&&Object.keys(i.lastCalcFieldInfo).length>0,s={dataSourceSettings:f.getClonedDataSourceSettings(i.dataSourceSettings)};i.trigger("enginePopulating",s,function(t){if((i.enableVirtualization||i.enablePaging)&&(a||r||n||o)||f.updateDataSourceSettings(i,t.dataSourceSettings),i.updatePageSettings(!1),a&&""!==i.dataSourceSettings.valueSortSettings.headerText&&i.setProperties({dataSourceSettings:{valueSortSettings:{headerText:""}}},!0),"pivot"===i.dataType&&(i.enableVirtualization||i.enablePaging)&&(a||r||n||o))a&&("Server"===e.dataSourceSettings.mode?i.getEngine("onSort",null,i.lastSortInfo,null,null,null,null):i.engineModule.onSort(i.lastSortInfo,i.dataSourceSettings),i.lastSortInfo={}),n&&("Server"===e.dataSourceSettings.mode?i.getEngine("onAggregation",null,null,i.lastAggregationInfo,null,null,null):i.engineModule.onAggregation(i.lastAggregationInfo,i.dataSourceSettings),i.lastAggregationInfo={}),o&&("Server"===e.dataSourceSettings.mode?i.getEngine("onCalcOperation",null,null,null,i.lastCalcFieldInfo,null,null):i.engineModule.onCalcOperation(i.lastCalcFieldInfo,i.dataSourceSettings),i.lastCalcFieldInfo={}),r&&("Server"===e.dataSourceSettings.mode?i.getEngine("onFilter",null,null,null,null,i.lastFilterInfo,null):i.engineModule.onFilter(i.lastFilterInfo,i.dataSourceSettings),i.lastFilterInfo={}),i.allowServerDataBinding=!1,i.setProperties({pivotValues:i.engineModule.pivotValues},!0),i.allowServerDataBinding=!0,"Server"!==i.dataSourceSettings.mode&&i.enginePopulatedEventMethod("updateDataSource");else if("olap"===i.dataType){s={mode:"",savedFieldList:i.olapEngineModule.fieldList,savedFieldListData:i.olapEngineModule.fieldListData,pageSettings:i.pageSettings,enableValueSorting:i.enableValueSorting,isDrillThrough:i.allowDrillThrough||i.editSettings.allowEditing,localeObj:i.localeObj,enableVirtualization:e.enableVirtualization};o||a?(i.olapEngineModule.savedFieldList=i.olapEngineModule.fieldList,i.olapEngineModule.savedFieldListData=i.olapEngineModule.fieldListData,o?(i.olapEngineModule.updateCalcFields(i.dataSourceSettings,i.lastCalcFieldInfo),i.lastCalcFieldInfo={}):(i.olapEngineModule.onSort(i.dataSourceSettings),i.lastSortInfo={})):f.renderOlapEngine(i,s),i.allowServerDataBinding=!1,i.setProperties({pivotValues:i.olapEngineModule.pivotValues},!0),i.allowServerDataBinding=!0,i.enginePopulatedEventMethod("updateDataSource")}else{var s={mode:"",savedFieldList:i.engineModule.fieldList,pageSettings:i.pageSettings,enableValueSorting:i.enableValueSorting,isDrillThrough:i.allowDrillThrough||i.editSettings.allowEditing,localeObj:i.localeObj,fieldsType:i.fieldsType,clonedReport:i.clonedReport,globalize:i.globalize,currenyCode:i.currencyCode,enablePaging:e.enablePaging,enableVirtualization:e.enableVirtualization,allowDataCompression:e.allowDataCompression,enableHtmlSanitizer:e.enableHtmlSanitizer,enableOptimizedRendering:e.enableVirtualization&&e.virtualscrollModule&&e.virtualScrollSettings.allowSinglePage,isTabularLayout:e.isTabular};"Server"===i.dataSourceSettings.mode?a?i.getEngine("onSort",null,i.lastSortInfo,null,null,null,null):n?i.getEngine("onAggregation",null,null,i.lastAggregationInfo,null,null,null):o?i.getEngine("onCalcOperation",null,null,null,i.lastCalcFieldInfo,null,null):r?i.getEngine("onFilter",null,null,null,null,i.lastFilterInfo,null):i.getEngine("onDrop",null,null,null,null,null,null):(i.engineModule.renderEngine(i.dataSourceSettings,s,i.aggregateCellInfo?i.getValueCellInfo.bind(i):void 0,i.onHeadersSort?i.getHeaderSortInfo.bind(i):void 0),i.allowServerDataBinding=!1,i.setProperties({pivotValues:i.engineModule.pivotValues},!0),i.allowServerDataBinding=!0,i.enginePopulatedEventMethod("updateDataSource")),i.lastSortInfo={},i.lastAggregationInfo={},i.lastCalcFieldInfo={},i.lastFilterInfo={}}})},o.prototype.refreshPageData=function(){var e={dataSourceSettings:f.getClonedDataSourceSettings(this.dataSourceSettings)};this.actionBeginMethod(),this.showWaitingPopup(),this.trigger("enginePopulating",e),"pivot"===this.dataType&&("Server"===this.dataSourceSettings.mode?this.getEngine("onPageChange",null,null,null,null,null,null):this.engineModule.generateGridData(this.dataSourceSettings,!0,!1,this.engineModule.headerCollection),this.setProperties({pivotValues:this.engineModule.pivotValues},!0),this.enginePopulatedEventMethod("updateDataSource")),this.actionObj.actionName=this.getActionCompleteName(),this.actionObj.actionName&&this.actionCompleteMethod()},o.prototype.excelExport=function(e,t,i,a){if("Server"===this.dataSourceSettings.mode)this.getEngine("onExcelExport",null,null,null,null,null,null,null,null,e);else{this.enableVirtualization||this.enablePaging||this.allowEngineExport||this.allowConditionalFormatting&&this.dataSourceSettings.conditionalFormatSettings.length>0?this.excelExportModule.exportToExcel("Excel",e,a):(this.exportType="Excel",this.grid.excelExport(e,t,i,a)),this.actionObj.actionName=this.getActionCompleteName();var r={exportInfo:{type:this.exportType,info:e}};this.actionObj.actionInfo=r,this.actionObj.actionName&&this.actionCompleteMethod()}},o.prototype.csvExport=function(e,t,i,a){if("Server"===this.dataSourceSettings.mode)this.getEngine("onCsvExport",null,null,null,null,null,null,null,null,e);else{this.enableVirtualization||this.enablePaging||this.allowEngineExport||this.allowConditionalFormatting&&this.dataSourceSettings.conditionalFormatSettings.length>0?this.excelExportModule.exportToExcel("CSV",e,a):(this.exportType="CSV",this.grid.csvExport(e,t,i,a)),this.actionObj.actionName=this.getActionCompleteName();var r={exportInfo:{type:this.exportType,info:e}};this.actionObj.actionInfo=r,this.actionObj.actionName&&this.actionCompleteMethod()}},o.prototype.gridPdfExport=function(e,t,i,a){var r={pdfExportProperties:e,isMultipleExport:t,isBlob:a,pdfDoc:i,currentExportView:"Table",pdfMargins:{}},n=null;this.trigger("beforeExport",r),this.pdfExportModule&&(this.pdfExportModule.exportProperties=r),n=this.enableVirtualization||this.enablePaging||this.allowEngineExport||Object.keys(r.pdfMargins).length>0||r.height||r.width||this.allowConditionalFormatting&&this.dataSourceSettings.conditionalFormatSettings.length>0&&("Server"!==this.dataSourceSettings.mode||(this.enableVirtualization||this.enablePaging)&&"Server"===this.dataSourceSettings.mode&&this.allowConditionalFormatting&&this.dataSourceSettings.conditionalFormatSettings.length>0)?this.pdfExportModule.exportToPDF(r.pdfExportProperties,r.isMultipleExport,r.pdfDoc,r.isBlob):this.grid.pdfExport(r.pdfExportProperties,r.isMultipleExport,r.pdfDoc,r.isBlob),this.actionObj.actionName=this.getActionCompleteName();var o={exportInfo:{type:"PDF",info:e}};return this.actionObj.actionInfo=o,this.actionObj.actionName&&this.actionCompleteMethod(),n},o.prototype.chartExport=function(e,i,r,n,o){var s={pdfExportProperties:i,isMultipleExport:r,isBlob:o,pdfDoc:n,type:e,currentExportView:"Chart",pdfMargins:{}};this.trigger("beforeExport",s),this.chartExportModule.exportProperties=s;var l,d=s.fileName?s.fileName:t.isNullOrUndefined(i)||t.isNullOrUndefined(i.fileName)?"default":i.fileName;if("PDF"===e)l=this.chartExportModule.pdfChartExport(s.pdfExportProperties,s.pdfDoc,s.isMultipleExport,s.isBlob);else{var p=0===s.orientation||s.orientation?s.orientation:t.isNullOrUndefined(i)||t.isNullOrUndefined(i.pageOrientation)?a.PdfPageOrientation.Landscape:"Landscape"===i.pageOrientation?a.PdfPageOrientation.Landscape:a.PdfPageOrientation.Portrait;l=this.chart.exportModule.export(s.type,d,p,null)}this.actionObj.actionName=this.getActionCompleteName();var h={exportInfo:{type:e,info:d}};return this.actionObj.actionInfo=h,this.actionObj.actionName&&this.actionCompleteMethod(),l},o.prototype.pdfExport=function(e,t,i,a,r){var n=this,o=null;return new Promise(function(s){if(r&&"Both"===n.displayOption.view)"Chart"===n.displayOption.primary?n.chartExport("PDF",e,!0,i,!1).then(function(i){o=n.gridPdfExport(e,t,i,a),s(o)}):n.gridPdfExport(e,!0,i,!1).then(function(i){o=n.chartExport("PDF",e,t,i,a),s(o)});else{var l=n.gridPdfExport(e,t,i,a);s(l)}})},o.prototype.printChart=function(){this.chart&&this.chart.print()},o.prototype.onDrill=function(e,i){var a=this,r=this.dataSourceSettings.drilledMembers[0]&&this.dataSourceSettings.drilledMembers[0].delimiter?this.dataSourceSettings.drilledMembers[0].delimiter:"**",n="",o="",s="";if(i?(n=i.fieldName,o=i.cell.axis,s=i.isDrilled?"up":"down"):(n="row"===(o=e.parentElement.classList.contains(L)?"row":"column")?t.closest(e,"td").getAttribute("fieldname"):t.closest(e,"th").getAttribute("fieldname"),s=e.classList.contains(E)?"up":"down"),"pivot"===this.dataType){var l=f.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers),d="row"===o?Number(t.closest(e,"td").getAttribute("data-colindex")):Number(t.closest(e,"th").getAttribute("data-colindex")),p="row"===o?Number(t.closest(e,"td").getAttribute("index")):Number(t.closest(e,"th").getAttribute("index")),h=i?i.cell:this.engineModule.pivotValues[p][d],u=h.valueSort.levelName.split(this.engineModule.valueSortSettings.headerDelimiter).join(r),c=!1;if(0===this.dataSourceSettings.drilledMembers.length)this.setProperties({dataSourceSettings:{drilledMembers:[{name:n,items:[u],delimiter:r}]}},!0);else{for(var g=f.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers),m=0;m<g.length;m++){var v=g[m];if(u=u.split(r).join(v.delimiter?v.delimiter:r),r=v.delimiter=v.delimiter?v.delimiter:r,v.name===n){c=!0;var S=v.items.indexOf(u);S>-1?v.items.splice(S,1):v.items.push(u)}}this.setProperties({dataSourceSettings:{drilledMembers:g}},!0),c||this.dataSourceSettings.drilledMembers.push({name:n,items:[u],delimiter:r})}this.showWaitingPopup();var y=this,b={fieldName:n,memberName:u,delimiter:r,axis:o,action:s,currentCell:h},C={drillInfo:b,pivotview:y,cancel:!1};y.trigger("drill",C,function(e){if(e.cancel)a.hideWaitingPopup(),a.setProperties({dataSourceSettings:{drilledMembers:l}},!0);else{var t={dataSourceSettings:f.getClonedDataSourceSettings(a.dataSourceSettings)};y.trigger("enginePopulating",t),y.setProperties({dataSourceSettings:t.dataSourceSettings},!0),y.enableVirtualization||y.enablePaging?"Server"===a.dataSourceSettings.mode?a.getEngine("onDrill",b,null,null,null,null,null):(y.engineModule.drilledMembers=y.dataSourceSettings.drilledMembers,y.engineModule.onDrill(b)):"Server"===a.dataSourceSettings.mode?a.getEngine("onDrill",b,null,null,null,null,null):y.engineModule.generateGridData(y.dataSourceSettings,!0),y.allowServerDataBinding=!1,y.setProperties({pivotValues:y.engineModule.pivotValues},!0),y.allowServerDataBinding=!0;var i={dataSourceSettings:f.getClonedDataSourceSettings(t.dataSourceSettings),pivotValues:a.pivotValues};a.trigger("enginePopulated",i),y.engineModule.pivotValues=i.pivotValues;var r={drillInfo:b};a.actionObj.actionInfo=r,y.renderPivotGrid()}})}else this.onOlapDrill(n,o,s,r,e,i)},o.prototype.onOlapDrill=function(e,i,a,r,n,o){var s,l=this,d=this,p=f.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers);if(o)s=o.cell;else{var h="row"===i?Number(t.closest(n,"td").getAttribute("data-colindex")):Number(t.closest(n,"th").getAttribute("data-colindex")),u="row"===i?Number(t.closest(n,"td").getAttribute("index")):Number(t.closest(n,"th").getAttribute("index"));s=this.olapEngineModule.pivotValues[u][h]}var c="row"===i?this.olapEngineModule.tupRowInfo[s.ordinal]:this.olapEngineModule.tupColumnInfo[s.ordinal],g={axis:i,action:a,fieldName:e,delimiter:"~~",memberName:c.uNameCollection,currentCell:s};this.showWaitingPopup();var m={drillInfo:g,pivotview:d,cancel:!1},v=this.olapEngineModule.fieldList[g.fieldName]&&this.olapEngineModule.fieldList[g.fieldName].isHierarchy,S=c.drillInfo.map(function(e){return e.hierarchy}).indexOf(s.hierarchy.toString()),y=f.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers);if(g&&"down"===g.action){for(var b=c.drillInfo.map(function(e){return e.uName}),C="",x=0;x<=S;x++){q=(j=b[x]).split("~~");C=C+(""!==C?"~~":"")+q[q.length-1]}for(var w=this.olapEngineModule.getDrilledSets(g.memberName,s,this.olapEngineModule.fieldList[s.hierarchy]&&!this.olapEngineModule.fieldList[s.hierarchy].hasAllMember?s.valueSort.levelName.split(this.dataSourceSettings.valueSortSettings.headerDelimiter).length-1:S,i),T=0,M=k=Object.keys(w);T<M.length;T++)for(var D=w[U=M[T]],O=0,P=y.length;O<P;O++){var N=y[O],E=D;N.delimiter&&(E=E.replace(/~~/g,N.delimiter));for(var F=[],I=0;I<N.items.length;I++)0!==N.items[I].indexOf(E)&&(F[F.length]=N.items[I]);N.items=F}this.olapEngineModule.drilledSets[s.actualText]=c.members[S],g.memberName=C;for(var L=[],A=0,R=y;A<R.length;A++)(j=R[A]).name===g.fieldName&&L.push(j);if(L.length>0){if(L[0].delimiter&&(C=C.replace(/~~/g,L[0].delimiter)),-1===(G=f.inArray(C,L[0].items))&&L[0].items.push(C),v)for(O=0;O<L[0].items.length;)L[0].items[O]===C?L[0].items.splice(O,1):++O}else if(!v){z={name:g.fieldName,items:[C],delimiter:"~~"};y?y.push(z):y=[z]}m.drillInfo.memberName=C,this.setProperties({dataSourceSettings:{drilledMembers:y}},!0),d.trigger("drill",m,function(e){if(e.cancel)l.hideWaitingPopup(),l.setProperties({dataSourceSettings:{drilledMembers:p}},!0);else{var t={dataSourceSettings:f.getClonedDataSourceSettings(l.dataSourceSettings)};l.trigger("enginePopulating",t),l.setProperties({dataSourceSettings:t.dataSourceSettings},!0),l.olapEngineModule.updateDrilledInfo(l.dataSourceSettings),l.allowServerDataBinding=!1,l.setProperties({pivotValues:l.olapEngineModule.pivotValues},!0),l.allowServerDataBinding=!0;var i={dataSourceSettings:f.getClonedDataSourceSettings(t.dataSourceSettings),pivotValues:d.olapEngineModule.pivotValues};l.trigger("enginePopulated",i),l.olapEngineModule.pivotValues=i.pivotValues,l.renderPivotGrid()}})}else{delete this.olapEngineModule.drilledSets[s.actualText];for(var w=this.olapEngineModule.getDrilledSets(g.memberName,s,S,i),k=Object.keys(w),b=c.drillInfo.map(function(e){return e.uName}),C="",x=0;x<=S;x++){var j=b[x],q=j.split("~~");C=C+(""!==C?"~~":"")+q[q.length-1]}for(var H=0,V=k;H<V.length;H++){for(var U=V[H],D=w[U],_=[],O=0,P=y.length;O<P;O++){var B=D;if((L=y[O]).name===g.fieldName&&_.push(L),L.delimiter&&(B=D.replace(/~~/g,L.delimiter)),!v){for(var F=[],I=0;I<L.items.length;I++)0!==L.items[I].indexOf(B)&&(F[F.length]=L.items[I]);L.items=F}}if(v)if(_.length>0){_[0].delimiter&&(C=C.replace(/~~/g,_[0].delimiter));var G=f.inArray(C,_[0].items);-1===G&&_[0].items.push(C)}else{var z={name:g.fieldName,items:[C],delimiter:"~~"};y?y.push(z):y=[z]}}for(var W=[],Q=0,Y=y;Q<Y.length;Q++){var K=Y[Q];K.items.length>0&&W.push(K)}this.setProperties({dataSourceSettings:{drilledMembers:y}},!0),d.trigger("drill",m,function(e){if(e.cancel)l.hideWaitingPopup(),l.setProperties({dataSourceSettings:{drilledMembers:p}},!0);else{var t={dataSourceSettings:f.getClonedDataSourceSettings(l.dataSourceSettings)};l.trigger("enginePopulating",t),l.setProperties({dataSourceSettings:t.dataSourceSettings},!0),l.setProperties({dataSourceSettings:{drilledMembers:W}},!0),l.olapEngineModule.updateDrilledInfo(l.dataSourceSettings),l.allowServerDataBinding=!1,l.setProperties({pivotValues:l.olapEngineModule.pivotValues},!0),l.allowServerDataBinding=!0;var i={dataSourceSettings:f.getClonedDataSourceSettings(t.dataSourceSettings),pivotValues:d.olapEngineModule.pivotValues};l.trigger("enginePopulated",i),l.olapEngineModule.pivotValues=i.pivotValues,l.renderPivotGrid()}})}},o.prototype.onContentReady=function(){var e=n.getScrollBarWidth();this.isPopupClicked=!1;var i,a;this.showFieldList&&this.pivotFieldListModule&&"Server"!==this.dataSourceSettings.mode?(this.pivotFieldListModule.element.style.display="block",r.hideSpinner(this.pivotFieldListModule.fieldListSpinnerElement)):this.fieldListSpinnerElement&&r.hideSpinner(this.fieldListSpinnerElement),this.isEmptyGrid?this.pivotValues.length>0&&(this.isEmptyGrid=!1,this.notEmpty=!0):("Server"===this.dataSourceSettings.mode&&this.isServerWaitingPopup||"Local"===this.dataSourceSettings.mode)&&this.hideWaitingPopup();var o=this.element.querySelector(".e-content-virtualtable")?this.element.querySelector(".e-content-virtualtable"):this.element.querySelector(".e-content"),s=this.element.querySelector(".e-headercontent"),l=this.virtualScrollSettings&&this.virtualScrollSettings.allowSinglePage&&"pivot"===this.dataType;if(this.grid){var d=this.element.querySelector(".e-gridcontent"),p=o.parentElement.offsetWidth<o.querySelector("."+I).offsetWidth,h="pivot"===this.dataType?this.engineModule:this.olapEngineModule;if(this.enableVirtualization&&h&&this.virtualscrollModule){if(l&&this.element.querySelector("."+X)&&(t.removeClass([s,o],["e-virtual-pivot-content"]),t.addClass([this.element.querySelector("."+X)],["e-hide-loader"]),this.grid&&this.grid.element.querySelector(".e-spinner-inner")&&t.removeClass([this.grid.element.querySelector(".e-spinner-inner")],["e-hide-loader"])),l){var u=this.element.querySelector("."+X);if(u||(u=t.createElement("div",{className:X+" e-hide-loader",innerHTML:this.localeObj.getConstant("loading")}),this.grid.element&&!this.element.querySelector("."+X)&&this.grid.element.insertBefore(u,this.grid.element.firstElementChild)),this.element.querySelector("."+B)&&this.element.querySelector(".e-gridcontent")){var c=this.element.querySelector(".e-gridcontent").offsetHeight+this.element.querySelector("."+B).offsetHeight;t.setStyleAttribute(u,{height:c+"px",width:this.element.querySelector("."+B).offsetWidth+"px",padding:Math.floor(c/2)+"px"})}}this.element.querySelector(".e-content")&&!this.element.querySelector(".e-content").querySelector(".e-virtualtrack")&&(this.virtualDiv=t.createElement("div",{className:"e-virtualtrack"}),this.element.querySelector(".e-content").appendChild(this.virtualDiv)),this.element.querySelector(".e-headercontent")&&!this.element.querySelector(".e-headercontent").querySelector(".e-virtualtrack")?(this.virtualHeaderDiv=t.createElement("div",{className:"e-virtualtrack"}),this.element.querySelector(".e-headercontent").appendChild(this.virtualHeaderDiv)):this.virtualHeaderDiv=this.element.querySelector(".e-headercontent").querySelector(".e-virtualtrack");var g=d.querySelector("."+V);if(d&&!g){this.virtualTableDiv=t.createElement("div",{className:V}),d.appendChild(this.virtualTableDiv),g=d.querySelector("."+V),this.virtualScrollDiv=t.createElement("div",{className:"e-movablescroll"}),g.appendChild(this.virtualScrollDiv),t.setStyleAttribute(g,{minHeight:e+"px",maxHeight:e+"px",overflowX:"scroll"}),t.setStyleAttribute(this.virtualScrollDiv,{height:"0.1px"});var m=t.createElement("div",{className:"e-content-virtualtable"});m.append.apply(m,Array.prototype.slice.call(o.childNodes)),o.appendChild(m),m.scrollLeft=0}var f=this.element.querySelector(".e-content").querySelector("."+I),v=this.gridSettings.rowHeight*h.rowCount+.1-f.clientHeight;v>this.scrollerBrowserLimit&&(this.verticalScrollScale=v/this.scrollerBrowserLimit,v=this.scrollerBrowserLimit),(a=this.gridSettings.columnWidth*h.columnCount)>this.scrollerBrowserLimit&&(this.horizontalScrollScale=a/this.scrollerBrowserLimit,a=this.scrollerBrowserLimit),t.setStyleAttribute(this.virtualDiv,{height:(v>.1?v:.1)+"px",width:(a>.1?a:.1)+"px"}),t.setStyleAttribute(this.virtualHeaderDiv,{height:0,width:(a>.1?a:.1)+"px"}),this.isAdaptive&&(o.style.minHeight="1px",o.style.minHeight="1px");var S=this.isAdaptive?o:d.querySelector("."+V)?d.querySelector("."+V):o;i=o.parentElement.scrollTop>this.scrollerBrowserLimit?o.querySelector("."+I).style.transform.split(",")[1].trim():(l?o.parentElement.scrollTop:-(o.parentElement.scrollTop*this.verticalScrollScale-this.scrollPosObject.verticalSection-o.parentElement.scrollTop))+"px)",Number(i.split("px")[0])>this.virtualDiv.clientHeight&&(i=this.virtualDiv.clientHeight+"px)");var y=Math.abs(S.scrollLeft),b=y>this.scrollerBrowserLimit?o.querySelector("."+I).style.transform.split(",")[0].trim()+",":"translate("+(this.enableRtl?1:-1)*(y*this.horizontalScrollScale-this.scrollPosObject.horizontalSection-y)+"px,";t.setStyleAttribute(o.querySelector("."+I),{transform:b+i}),t.setStyleAttribute(s.querySelector("."+I),{transform:b+0+"px)"}),!p&&d&&g||this.isAdaptive?g.style.display="none":g.style.display="block";var C=Number(-o.querySelector("."+I).style.transform.split("(")[1].split(",")[0].split("px")[0]);if(this.virtualscrollModule.alignFreezedCells(C,!0),p){var x=0;x=this.pivotColumns.length<25?a+o.querySelector("."+I).querySelector(".e-leftfreeze").offsetWidth+(d.offsetWidth-d.clientWidth):a+(d.offsetWidth-d.clientWidth),"auto"!==this.grid.height?this.grid.element.querySelector(".e-movablescroll").style.width=x+e+"px":this.grid.element.querySelector(".e-movablescroll").style.width=x+"px"}this.grid.element.querySelector(".e-content-virtualtable")&&o.parentElement.scrollHeight===o.scrollHeight&&(o.style.overflowY="");var w="pivot"===this.dataType&&"column"===this.dataSourceSettings.valueAxis?this.dataSourceSettings.values.length:1,T=this.pageSettings.columnPageSize*w*this.gridSettings.columnWidth,M=S.scrollWidth-(Math.abs(y)+S.offsetWidth);if(this.virtualscrollModule&&T>0&&M<=T&&y>0){var D=o.scrollWidth-(Math.abs(o.scrollLeft)+o.parentElement.offsetWidth),O=void 0;D<1&&"horizondal"===this.scrollDirection&&(o.parentElement.scrollTop>0&&(O=o.parentElement.scrollTop),this.virtualDiv.style.display="none",D=o.scrollWidth-(Math.abs(o.scrollLeft)+o.parentElement.offsetWidth)),this.virtualDiv.style.display="",O&&(o.parentElement.scrollTop=O);var P=o.scrollWidth-(Math.abs(o.scrollLeft)+o.parentElement.offsetWidth);D>1&&(this.scrollPosObject.horizontalSection-=M<=0?D>M?D:-P:P===D?D-M:D<P&&(M===P||M>D)?-(P-D):0,"auto"!==this.grid.height&&(this.scrollPosObject.horizontalSection-=e),this.scrollPosObject.horizontalSection=this.scrollPosObject.horizontalSection>=-this.element.querySelector(".e-grid").querySelector(".e-headercell.e-leftfreeze").offsetWidth?this.scrollPosObject.horizontalSection:-this.element.querySelector(".e-grid").querySelector(".e-headercell.e-leftfreeze").offsetWidth),b=y>this.scrollerBrowserLimit?o.querySelector("."+I).style.transform.split(",")[0].trim()+",":"translate("+(this.enableRtl?1:-1)*(y*this.horizontalScrollScale-this.scrollPosObject.horizontalSection-y)+"px,",t.setStyleAttribute(o.querySelector("."+I),{transform:b+i}),t.setStyleAttribute(s.querySelector("."+I),{transform:b+0+"px)"}),C=Number(-o.querySelector("."+I).style.transform.split("(")[1].split(",")[0].split("px")[0]),this.virtualscrollModule.alignFreezedCells(C,!0)}}if("Chart"!==this.currentView&&this.grid.hideScroll(),this.showGroupingBar){if(this.groupingBarModule&&this.element.querySelector(".e-grouping-bar")&&this.groupingBarModule.setGridRowWidth(),this.actionObj.fieldInfo&&this.actionObj.fieldInfo.fieldName){var N=this.pivotButtonModule.parentElement.querySelector('[data-uid="'+this.actionObj.fieldInfo.fieldName+'"]');t.isNullOrUndefined(N)||N.focus()}this.element.style.minWidth="400px",this.grid.element.style.minWidth="400px"}else this.element.style.minWidth="310px",this.grid.element.style.minWidth="310px"}if(this.unwireEvents(),this.wireEvents(),this.isChartLoaded=!1,this.isEmptyGrid||this.trigger("dataBound"),this.actionObj.actionName=this.getActionCompleteName(),this.actionObj.actionName&&("Field filtered"===this.actionObj.actionName&&this.pivotCommon&&this.pivotCommon.filterDialog&&(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.pivotCommon.filterDialog.setFocus.bind(this.pivotCommon.filterDialog))),"Window resize"!==this.actionObj.actionName&&this.actionCompleteMethod()),this.groupingModule&&(this.groupingModule.isUpdate=!1),this.engineModule&&this.engineModule.clearProperties(),this.virtualscrollModule&&this.grid&&this.virtualscrollModule.onHorizondalScroll(s,o),!this.isAdaptive&&this.enableVirtualization&&o&&this.virtualscrollModule&&!l){var E=o.parentElement.parentElement.querySelector(".e-movablescrolldiv");if(a<3*o.parentElement.clientWidth)o.style.overflowX="visible",E.style.display="none",s.scrollLeft=o.parentElement.scrollLeft,t.setStyleAttribute(o.querySelector("."+I),{transform:"translate(0px,"+i}),t.setStyleAttribute(s.querySelector("."+I),{transform:"translate(0px, 0px)"}),this.virtualscrollModule.alignFreezedCells(0,!0);else{t.EventHandler.remove(this.element.querySelector(".e-gridcontent").querySelector(".e-content"),"scroll",this.headerScrollUpdate);var F=this.element.querySelector(".e-gridcontent").querySelector(".e-content").scrollLeft;o.style.overflowX="auto",E.style.display="block",0!==F&&(E.scrollLeft=F),E.scrollLeft!==o.scrollLeft&&0!==o.scrollLeft&&(E.scrollLeft=o.scrollLeft)}}},o.prototype.setToolTip=function(e){var i=this,a=Number(e.target.getAttribute("data-colindex")),r=Number(e.target.getAttribute("index")),n=this.dataSourceSettings.values.length>0&&this.pivotValues&&this.pivotValues[r]&&this.pivotValues[r][a]?this.pivotValues[r][a]:void 0;this.tooltip.content="";var o,s,l=!1;if(n&&"olap"===this.dataType){var d=n.actualText;if(!t.isNullOrUndefined(d)&&this.olapEngineModule.fieldList&&!this.olapEngineModule.fieldList[d]){var p=this.olapEngineModule.tupRowInfo;d=n.rowOrdinal>-1&&p.length>0&&p[n.rowOrdinal]&&!t.isNullOrUndefined(p[n.rowOrdinal].measureName)?p[n.rowOrdinal].measureName:d}this.olapEngineModule.fieldList&&this.olapEngineModule.fieldList[d]&&(o=(h=this.olapEngineModule.fieldList[d]).isCalculatedField?h.type:h.aggregateType,s=this.olapEngineModule.dataFields[d]&&this.olapEngineModule.dataFields[d].caption?this.olapEngineModule.dataFields[d].caption:h.caption,l=!0)}else if(n&&this.engineModule.fieldList&&this.engineModule.fieldList[n.actualText]){var h=this.engineModule.fieldList[n.actualText];o="DistinctCount"===(o=h.aggregateType)||"number"===h.type&&"include"!==h.type&&"exclude"!==h.type?void 0===o?"Sum":h.aggregateType:"Count",s=h.caption,l=!0}if(n&&l){var u=this.isTabular&&this.engineModule.rowMaxLevel>0?this.engineModule.rowMaxLevel:0,c=this.getRowText(r,u),g=this.getColText(0,a,r),m=""===n.formattedText?this.localeObj.getConstant("noValue"):n.formattedText;if(this.tooltipTemplate&&void 0!==this.getTooltipTemplate()){var f={rowHeaders:c,columnHeaders:g,aggregateType:o,valueField:s,value:m,rowFields:this.getHeaderField(r,a,"row"),columnFields:this.getHeaderField(r,a,"column")};if("function"==typeof this.tooltipTemplate&&this.isReact){var v=document.createElement("div");this.getTooltipTemplate()(f,this,"tooltipTemplate",this.element.id+"tooltipTemplate",null,null,v),this.renderReactTemplates(function(){i.enableHtmlSanitizer?i.tooltip.content=t.SanitizeHtmlHelper.sanitize(v.outerHTML):i.tooltip.content=v.outerHTML})}else{var S=this.getTooltipTemplate()(f,this,"tooltipTemplate",this.element.id+"tooltipTemplate")[0].outerHTML;this.enableHtmlSanitizer?this.tooltip.content=t.SanitizeHtmlHelper.sanitize(S):this.tooltip.content=S}}else{var y="<div class=e-pivottooltip><p class=e-tooltipheader>"+this.localeObj.getConstant("row")+":</p><p class=e-tooltipcontent>"+c+"</p></br><p class=e-tooltipheader>"+this.localeObj.getConstant("column")+":</p><p class=e-tooltipcontent>"+g+"</p></br>"+(""!==n.actualText?"<p class=e-tooltipheader>"+("olap"===this.dataType?"":this.localeObj.getConstant(o)+" "+this.localeObj.getConstant("of")+" ")+s+":</p><p class=e-tooltipcontent>"+m+"</p></div>":""),b=function(){return y};this.tooltip.content=t.initializeCSPTemplate(b)}}else e.cancel=!0},o.prototype.getTooltipTemplate=function(){return this.tooltipTemplateFn},o.prototype.getHeaderField=function(e,t,i){var a,r="",n="olap"===this.dataType?this.olapEngineModule:this.engineModule,o=n.valueSortSettings.headerDelimiter;if("row"===i){a=this.pivotValues[e][0].valueSort.levelName.toString().split(o).length;for(var s=0;s<a&&this.dataSourceSettings.rows.length>0&&this.dataSourceSettings.rows[s];s++)r+=(s?" - ":"")+(this.dataSourceSettings.rows[s].caption?this.dataSourceSettings.rows[s].caption:this.dataSourceSettings.rows[s].name)}else{if(this.dataSourceSettings.columns.length>0){var l=0===this.dataSourceSettings.values.length?0:Number(Object.keys(n.headerContent)[Object.keys(n.headerContent).length-1]);a=this.pivotValues[l][t].valueSort.levelName.toString().split(o).length,a=this.dataSourceSettings.values.length>1?a-1:a}for(var d=0;d<a&&this.dataSourceSettings.columns.length>0&&this.dataSourceSettings.columns[d];d++)r+=(d?" - ":"")+(this.dataSourceSettings.columns[d].caption?this.dataSourceSettings.columns[d].caption:this.dataSourceSettings.columns[d].name)}return r},o.prototype.getLevel=function(e){var t=e.valueSort?e.valueSort.levelName.toString():"",i=e.actualText?e.actualText.toString().split(this.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,a=t.split(this.dataSourceSettings.valueSortSettings.headerDelimiter).length-(i?i-1:i);return a?a-1:0},o.prototype.getRowText=function(e,i){var a=this.pivotValues[e][i],r="";if(a){var n=this.getLevel(a);if(r="grand sum"===a.type?this.localeObj.getConstant("grandTotal"):a.formattedText,"row"===this.dataSourceSettings.valueAxis)r=(r=0===this.dataSourceSettings.rows.length&&this.dataSourceSettings.values.length>1?this.pivotValues[e][0].valueSort.levelName.toString().slice((this.localeObj.getConstant("grandTotal")+this.dataSourceSettings.valueSortSettings.headerDelimiter).length).toString():1===this.dataSourceSettings.values.length?t.isNullOrUndefined(this.dataSourceSettings.values[0].caption)?this.dataSourceSettings.values[0].name:this.dataSourceSettings.values[0].caption:this.pivotValues[e][0].valueSort.levelName.toString()).split(this.dataSourceSettings.valueSortSettings.headerDelimiter).join(" - ");else if(this.isTabular)r=(a=this.pivotValues[e][i]).valueSort.levelName.toString();else for(;n>0||void 0===a.index;)e--,void 0!==(a=this.pivotValues[e][i]).index&&n>a.level&&(r=r+this.dataSourceSettings.valueSortSettings.headerDelimiter+a.formattedText,n-=1);r=this.isTabular?r.split(this.dataSourceSettings.valueSortSettings.headerDelimiter).join(" - "):r.split(this.dataSourceSettings.valueSortSettings.headerDelimiter).reverse().join(" - ")}return r},o.prototype.getColText=function(e,t,i){for(var a=this.pivotValues[0][t],r=a.axis,n="grand sum"===a.type?this.localeObj.getConstant("grandTotal"):a.formattedText;"value"!==r&&i>e;)e++,this.pivotValues[e]&&(r=(a=this.pivotValues[e][t]).axis,"sum"!==a.type&&"grand sum"!==a.type&&"value"!==r&&(n=n+" - "+a.formattedText));return n},o.prototype.updateClass=function(){this.enableRtl?t.addClass([this.element],D):t.removeClass([this.element],D),this.isAdaptive?t.addClass([this.element],O):t.removeClass([this.element],O),this.cssClass&&t.addClass([this.element],this.cssClass.split(" "))},o.prototype.mouseRclickHandler=function(e){3===e.which?this.lastCellClicked=e.target:0===e.which&&(this.lastCellClicked=e.target),this.lastCellClicked=e.target},o.prototype.mouseDownHandler=function(e){3===e.which&&(this.lastCellClicked=e.target),this.isCellBoxMultiSelection&&(this.isMouseDown=!0,this.isMouseUp=!1,this.lastSelectedElement=void 0)},o.prototype.mouseMoveHandler=function(e){var i=this;if(this.isCellBoxMultiSelection&&(e.preventDefault(),this.isMouseDown&&e.target)){var a=e.target,r=a.parentElement.classList.contains(L)||a.classList.contains(L)?"row":"column";if(a="column"===r?t.closest(a,"th"):t.closest(a,"td")){var n=Number(a.getAttribute("data-colindex")),o=Number(a.getAttribute("index")),s={cancel:!1,isCellClick:!0,currentCell:a,data:this.pivotValues[o][n]};this.trigger("cellSelecting",s,function(e){if(!e.cancel){i.grid.clearSelection();var t=i.parentAt(a,"TH");i.lastSelectedElement&&i.lastSelectedElement!==t&&t.classList.contains(_)?(i.lastSelectedElement.classList.remove("e-active"),i.lastSelectedElement.classList.remove(_),i.lastSelectedElement=t):(i.lastSelectedElement=t,t.classList.contains(A)&&t.classList.contains("e-leftfreeze")||(t.classList.add("e-active"),t.classList.add(_))),i.renderModule.selected()}})}}},o.prototype.mouseUpHandler=function(){this.isCellBoxMultiSelection&&(this.isMouseDown=!1,this.isMouseUp=!0)},o.prototype.parentAt=function(e,t){for(;e.tagName!==t&&e.parentElement;)e=e.parentElement;return e},o.prototype.mouseClickHandler=function(e){3===e.which?this.lastCellClicked=e.target:0===e.which&&(this.lastCellClicked=e.target);var i=e.target;if(!t.closest(i,".e-pivot-button")){var a=null,r=i.parentElement&&i.parentElement.classList.contains(L)||i.classList.contains(L)?"row":"column";if(a="column"===r?t.closest(i,"th"):t.closest(i,"td"),"column"!==r||a||"Row"===this.gridSettings.selectionSettings.mode||(a=t.closest(i,"td")),i.classList.contains(E)||i.classList.contains(F)||!this.enableValueSorting||i.classList.contains("e-resized")||i.classList.contains("e-rhandler")&&i.classList.contains("e-rcursor")||"olap"===this.dataType&&this.enableVirtualization){if(!i.classList.contains(E)&&!i.classList.contains(F))return void this.cellClicked(i,a,e);var n=i.parentElement.getAttribute("fieldname"),o=f.getFieldInfo(n,this),s=i.classList.contains(E)?this.actionObj.actionName="Drill up":i.classList.contains(F)?this.actionObj.actionName="Drill down":"";if(this.actionObj.actionName=s,this.actionObj.fieldInfo=o.fieldItem,this.actionBeginMethod())return;try{this.onDrill(i)}catch(e){this.actionFailureMethod(e)}}else{var l="pivot"===this.dataType?this.engineModule:this.olapEngineModule;this.cellClicked(i,a,e);try{if(a&&(a.parentElement.parentElement.parentElement.parentElement.classList.contains(B)&&"column"===this.dataSourceSettings.valueAxis&&!a.classList.contains("e-leftfreeze")||a.parentElement.classList.contains("e-row")&&"row"===this.dataSourceSettings.valueAxis&&(a.classList.contains("e-rowsheader")||a.classList.contains("e-stot")))){var d=a.getAttribute("fieldname"),o=f.getFieldInfo(d,this);if(this.actionObj.actionName="Sort value",this.actionObj.fieldInfo=o.fieldItem,this.actionBeginMethod())return;var p=Number(a.getAttribute("data-colindex")),h=Number(a.getAttribute("index"));if("row"===this.dataSourceSettings.valueAxis&&(this.dataSourceSettings.values.length>1||this.dataSourceSettings.alwaysShowValueHeader)){var u=this.pivotValues[h][p];h=-1===this.dataSourceSettings.valueIndex?"value"===u.type||3===u.memberType?h:h+1:this.getLevel(u)<=l.measureIndex&&u.members&&u.members.length>0?u.members[0].rowIndex:h}else"column"===this.dataSourceSettings.valueAxis&&(this.dataSourceSettings.values.length>1||this.dataSourceSettings.alwaysShowValueHeader)&&(p=Number(a.getAttribute("data-colindex"))+Number(a.getAttribute("aria-colspan"))-1,h=l.headerContent.length-1);this.setProperties({dataSourceSettings:{valueSortSettings:{columnIndex:Number(a.getAttribute("data-colindex"))+Number(a.getAttribute("aria-colspan"))-1,sortOrder:"Descending"===this.dataSourceSettings.valueSortSettings.sortOrder?"Ascending":"Descending",headerText:this.pivotValues[h][p].valueSort.levelName,headerDelimiter:this.dataSourceSettings.valueSortSettings.headerDelimiter?this.dataSourceSettings.valueSortSettings.headerDelimiter:"."}}},!0),this.showWaitingPopup();var c=this;if(l.enableValueSorting=!0,c.enableVirtualization||c.enablePaging){if(c.dataSourceSettings.enableSorting){for(var g=0,m=Object.keys(c.engineModule.fieldList);g<m.length;g++){var v=m[g];c.engineModule.fieldList[v].sort="Ascending"}c.setProperties({dataSourceSettings:{sortSettings:[]}},!0)}"Server"===c.dataSourceSettings.mode?c.getEngine("onValueSort",null,null,null,null,null,null):(c.engineModule.rMembers=c.engineModule.headerCollection.rowHeaders,c.engineModule.cMembers=c.engineModule.headerCollection.columnHeaders,c.engineModule.applyValueSorting(),c.engineModule.updateEngine())}else"Server"===c.dataSourceSettings.mode?c.getEngine("onValueSort",null,null,null,null,null,null):"olap"===this.dataType?c.olapEngineModule.onSort(c.dataSourceSettings,!0):c.engineModule.generateGridData(c.dataSourceSettings,!0);c.allowServerDataBinding=!1,c.setProperties({pivotValues:l.pivotValues},!0),c.allowServerDataBinding=!0;var S={valueSortInfo:l.valueSortSettings};this.actionObj.actionInfo=S,c.renderPivotGrid()}}catch(e){this.actionFailureMethod(e)}}}},o.prototype.updateTotColWidth=function(){this.totColWidth=0;for(var e=0,t=this.pivotColumns;e<t.length;e++){var i=t[e];this.totColWidth=this.totColWidth+i.width}},o.prototype.framePivotColumns=function(e){for(var t=0,i=e;t<i.length;t++){var a=i[t];if(a.columns&&a.columns.length>0)this.framePivotColumns(a.columns);else{var r="0.formattedText"===a.field?"":a.customAttributes&&a.customAttributes.cell&&a.customAttributes.cell.valueSort?a.customAttributes.cell.valueSort.levelName:"",n=this.renderModule.setSavedWidth("0.formattedText"===a.field?a.field:r,Number("auto"===a.width?a.minWidth:a.width));this.pivotColumns.push({allowReordering:a.allowReordering,allowResizing:a.allowResizing,headerText:r,width:n,autoFit:a.autoFit}),this.totColWidth=this.totColWidth+Number(n)}}},o.prototype.setGridColumns=function(e){if(!t.isNullOrUndefined(this.totColWidth)&&this.totColWidth>0||this.renderModule.isAutoFitEnabled){for(var i=0,a=e;i<a.length;i++){var r=a[i];if(r.columns&&r.columns.length>0)this.setGridColumns(r.columns);else if(this.renderModule.isAutoFitEnabled)r.autoFit=this.pivotColumns[this.posCount].autoFit,this.posCount++;else{var o="0.formattedText"===r.field?"":r.customAttributes?r.customAttributes.cell.valueSort.levelName:"";r.allowReordering=this.pivotColumns[this.posCount].allowReordering,r.allowResizing=this.pivotColumns[this.posCount].allowResizing,r.autoFit=this.pivotColumns[this.posCount].autoFit;var s=this.renderModule.setSavedWidth("0.formattedText"===r.field?r.field:o,Number(this.pivotColumns[this.posCount].width));r.autoFit?this.renderModule.isAutoFitEnabled=!0:"auto"!==r.width?r.width=s:r.minWidth=s,this.posCount++,r.allowReordering&&(this.gridSettings.allowReordering=!0),r.allowResizing&&(this.gridSettings.allowResizing=!0)}}this.gridSettings.allowReordering&&n.Grid.Inject(n.Reorder),this.gridSettings.allowResizing&&n.Grid.Inject(n.Resize)}},o.prototype.fillGridColumns=function(e){for(var t=0,i=e;t<i.length;t++){var a=i[t];a.allowReordering=this.gridSettings.allowReordering,a.allowResizing=this.gridSettings.allowResizing,a.clipMode=this.gridSettings.clipMode,this.posCount++,a.columns&&a.columns.length>0&&this.fillGridColumns(a.columns)}},o.prototype.triggerColumnRenderEvent=function(e){this.pivotColumns=[],this.totColWidth=0,this.framePivotColumns(e);var t=this.pivotColumns[0].width,i={columns:this.pivotColumns,dataSourceSettings:this.dataSourceSettings,stackedColumns:this.getStackedColumns(e,[])};this.trigger("beforeColumnsRender",i),this.updateTotColWidth(),t!==this.pivotColumns[0].width&&(this.firstColWidth=this.pivotColumns[0].width,this.renderModule.resColWidth=parseInt(this.firstColWidth.toString(),10)),this.posCount=0,this.setGridColumns(e)},o.prototype.setCommonColumnsWidth=function(e,t){for(var i=0,a=e;i<a.length;i++){var r=a[i];this.isTabular?r.index>this.engineModule.rowMaxLevel?r.columns?this.setCommonColumnsWidth(r.columns,t):this.setColumnWidth(r,t):r.width=this.firstColWidth?this.firstColWidth:r.width:"0.formattedText"!==r.field?r.columns?this.setCommonColumnsWidth(r.columns,t):this.setColumnWidth(r,t):r.width=this.firstColWidth?this.firstColWidth:r.width}},o.prototype.getHeightAsNumber=function(){var e,t;return isNaN(this.height)?this.height.toString().indexOf("%")>-1?(this.isAngular&&this.element&&this.element.style&&(t=window.getComputedStyle(this.element).display,this.element.style.display="block"),e=parseFloat(this.height.toString())/100*this.element.offsetHeight,this.isAngular&&this.element&&this.element.style&&(this.element.style.display=t)):this.height.toString().indexOf("px")>-1&&(e=Number(this.height.toString().split("px")[0])):e=Number(this.height),(e<this.minHeight||"auto"===this.height)&&(e=this.minHeight),e},o.prototype.getWidthAsNumber=function(){var e;return isNaN(this.width)?(this.width.toString().indexOf("%")>-1?e=parseFloat(this.width.toString())/100*this.element.offsetWidth:this.width.toString().indexOf("px")>-1&&(e=Number(this.width.toString().split("px")[0])),isNaN(e)&&(e=this.element.offsetWidth)):e=Number(this.width),e<400&&(e=400),e},o.prototype.getGridWidthAsNumber=function(){var e,t=this.element.offsetWidth?this.element.offsetWidth:this.element.getBoundingClientRect().width;return isNaN(this.grid.width)?(this.grid.width.toString().indexOf("%")>-1?e=parseFloat(this.grid.width.toString())/100*t:this.grid.width.toString().indexOf("px")>-1&&(e=Number(this.grid.width.toString().split("px")[0])),isNaN(e)&&(e=t)):e=Number(this.grid.width),e},o.prototype.onWindowResize=function(){this.actionObj.actionName="Window resize",this.actionBeginMethod()||(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.layoutRefresh.bind(this),500),this.actionObj.actionName=this.getActionCompleteName(),this.actionObj.actionName&&this.actionCompleteMethod())},o.prototype.refresh=function(){this.pivotRefresh()},o.prototype.layoutRefresh=function(){if(this.element&&this.element.classList.contains("e-pivotview")&&("olap"===this.dataType?this.olapEngineModule&&this.olapEngineModule.pivotValues:this.engineModule&&this.engineModule.pivotValues)){if(this.grid){var e="olap"===this.dataType&&this.olapEngineModule.pivotValues.length>0?this.olapEngineModule.pivotValues[0].length:this.dataSourceSettings.values.length>0&&this.engineModule&&this.engineModule.pivotValues.length>0?this.engineModule.pivotValues[0].length:2,t=this.renderModule.calculateColWidth(e);this.grid.width=this.renderModule.calculateGridWidth(),this.renderModule.calculateGridHeight(!0),this.gridSettings.allowAutoResizing&&this.setCommonColumnsWidth(this.grid.columns,t),this.triggerColumnRenderEvent(this.grid.columns),this.grid.refreshColumns(),this.renderModule.isAutoFitEnabled?this.renderModule.addPivotAutoFitClass():this.renderModule.removePivotAutoFitClass(),this.element.querySelector(".e-grid").querySelector("colGroup").innerHTML=this.grid.getHeaderContent().querySelector("colgroup").innerHTML,this.showGroupingBar&&this.groupingBarModule&&this.element.querySelector(".e-grouping-bar")&&this.groupingBarModule.setGridRowWidth(),this.chart&&this.pivotChartModule&&(this.chart.height=this.pivotChartModule.getResizedChartHeight())}this.showToolbar&&this.toolbarModule&&this.toolbarModule.toolbar&&(this.toolbarModule.toolbar.width=this.grid?this.getGridWidthAsNumber():this.getWidthAsNumber()),this.enablePaging&&this.notify("init-pivotPager",this),this.chart&&(this.showToolbar&&"Chart"===this.currentView||!this.showToolbar)&&(this.chart.width=this.showToolbar&&this.grid?this.getGridWidthAsNumber().toString():"Both"===this.displayOption.view&&this.grid?this.getGridWidthAsNumber().toString():this.getWidthAsNumber().toString(),this.chart.height=this.pivotChartModule.getResizedChartHeight(),"Chart"===this.displayOption.view&&this.showGroupingBar&&this.groupingBarModule&&this.element.querySelector(".e-chart-grouping-bar")&&this.groupingBarModule.refreshUI())}},o.prototype.cellClicked=function(e,i,a){var r=this;if(e.classList.contains("e-rowselect")&&(e.classList.contains("e-spanclicked")?this.isPopupClicked=!1:this.isPopupClicked=!0),i&&!t.isNullOrUndefined(this.pivotValues)&&this.pivotValues.length>0){var n=Number(i.getAttribute("data-colindex")),o=Number(i.getAttribute("index")),s=Number(i.getAttribute("aria-colspan")),l={cancel:!1,isCellClick:!0,currentCell:i,data:this.pivotValues[o][n]};this.trigger("cellSelecting",l,function(e){r.gridSettings.allowSelection&&(("Both"===r.gridSettings.selectionSettings.mode?i.classList.contains("e-rowcell"):"Row"===r.gridSettings.selectionSettings.mode)?r.clearSelection(i,a):e.cancel||(r.clearSelection(i,a),r.applyColumnSelection(a,i,n,n+(s>0?s-1:0),o)),"Column"===r.gridSettings.selectionSettings.mode||i.classList.contains("e-columnsheader")||r.rowDeselect(i,a,o,r.gridSettings.selectionSettings.mode,e),"Column"===r.gridSettings.selectionSettings.mode||e.cancel||(("Multiple"===r.gridSettings.selectionSettings.type?a.ctrlKey||a.shiftKey:r.selectedRowIndex===o)?r.selectedRowIndex=void 0:(r.selectedRowIndex=o,r.grid.selectionModule.selectRow(o-r.renderModule.rowStartPos)))),r.cellClick&&e.isCellClick&&r.trigger("cellClick",{currentCell:i,data:r.pivotValues[o][n],nativeEvent:a}),r.getSelectedCellsPos()})}else this.clearSelection(null,a)},o.prototype.rowDeselect=function(e,i,a,r,n){if(!i.shiftKey&&!i.ctrlKey&&"Both"!==this.gridSettings.selectionSettings.mode||"Single"===this.gridSettings.selectionSettings.type)if(e.classList.contains(U)||e.classList.contains(_)||e.classList.contains("e-active")){if(t.removeClass(this.element.querySelectorAll("."+U),U),t.removeClass(this.element.querySelectorAll("."+_),_),t.removeClass(this.element.querySelectorAll(".e-active"),"e-active"),n.cancel)this.setSavedSelectedCells();else if("Cell"===r)t.addClass([e],[U]);else if("Row"===r||"Single"===this.gridSettings.selectionSettings.type){var o='[index="'+a+'"]';t.addClass(this.element.querySelectorAll(o),[_,"e-active"]),"Row"!==r&&e.classList.add(U)}}else n.cancel?this.setSavedSelectedCells():(t.removeClass(this.element.querySelectorAll("."+U),U),t.removeClass(this.element.querySelectorAll("."+_),_),t.removeClass(this.element.querySelectorAll(".e-active"),"e-active"));else(i.shiftKey||i.ctrlKey||"Both"===this.gridSettings.selectionSettings.mode)&&n.cancel&&(t.removeClass(this.element.querySelectorAll("."+U),U),t.removeClass(this.element.querySelectorAll("."+_),_),t.removeClass(this.element.querySelectorAll(".e-active"),"e-active"),this.setSavedSelectedCells())},o.prototype.clearSelection=function(e,i){if(!i.shiftKey&&!i.ctrlKey||"Single"===this.gridSettings.selectionSettings.type)if("Cell"===this.gridSettings.selectionSettings.mode)e&&e.classList.contains("e-columnsheader")?t.removeClass(this.element.querySelectorAll(".e-rowcell."+U),U):t.removeClass(this.element.querySelectorAll(".e-columnsheader.e-active"),["e-active",_]);else if("Both"===this.gridSettings.selectionSettings.mode)if(e&&e.classList.contains("e-rowcell"))for(var a=0,r=[].slice.call(this.element.querySelectorAll("."+_+", ."+U));a<r.length;a++){var n=r[a];t.removeClass([n],["e-active",_,U])}else t.removeClass(this.element.querySelectorAll("."+U),U)},o.prototype.applyRowSelection=function(e,t,i){var a=this.engineModule.pivotValues[t][e];if(i.ctrlKey||i.shiftKey||!a||this.selectedRowIndex===t)this.selectedRowIndex=void 0;else{this.selectedRowIndex=t;var r=a.level,n=t;do{n++,a=this.engineModule.pivotValues[n][e]}while(a&&r<a.level);var o=this;this.isAdaptive?this.rowRangeSelection={enable:!0,startIndex:t-o.renderModule.rowStartPos,endIndex:n-(1+o.renderModule.rowStartPos)}:o.grid.selectionModule.selectRowsByRange(t-o.renderModule.rowStartPos,n-(1+o.renderModule.rowStartPos))}},o.prototype.applyColumnSelection=function(e,i,a,r,n){if(!i.classList.contains(L)&&("Cell"!==this.gridSettings.selectionSettings.mode||i.classList.contains("e-columnsheader"))){var o=e.ctrlKey;this.isAdaptive&&"Multiple"===this.gridSettings.selectionSettings.type&&(this.grid.selectionModule.showPopup(e),this.isPopupClicked?(this.element.querySelector(".e-rowselect").classList.add("e-spanclicked"),o=!0):(this.element.querySelector(".e-rowselect").classList.remove("e-spanclicked"),o=!1));for(var s=[],l=this.gridSettings.selectionSettings.type,d=i.classList.contains("e-active"),p=[],h={},u=a;u<=r;u++)p.push(u.toString());if(o&&"Single"!==l)d=!1;else{for(var c=0,g=[].slice.call(this.element.querySelectorAll(".e-active"));c<g.length;c++){w=g[c];t.removeClass([w],["e-active",_]),-1===p.indexOf(w.getAttribute("data-colindex"))&&(d=!1);var m=Number(w.getAttribute("data-colindex"));h[m]=m}p=Object.keys(h).length>0?Object.keys(h).sort(function(e,t){return parseInt(e,10)-parseInt(t,10)}):p}"Multiple"===l&&e.shiftKey?(this.shiftLockedPos=0===this.shiftLockedPos.length?p:this.shiftLockedPos,Number(this.shiftLockedPos[0])<=a?a=Number(this.shiftLockedPos[0]):r=r<Number(this.shiftLockedPos[this.shiftLockedPos.length-1])?Number(this.shiftLockedPos[this.shiftLockedPos.length-1]):r):this.shiftLockedPos=[];var f=[];if(e.ctrlKey&&"Both"===this.gridSettings.selectionSettings.mode&&"Multiple"===l&&!i.classList.contains(L))for(var v=0,S=[].slice.call(this.element.querySelectorAll(".e-rowsheader."+U));v<S.length;v++){w=S[v];f.push(w.getAttribute("index"))}for(var y=a;y<=r;)s.push('[data-colindex="'+y+'"]'+("Cell"===this.gridSettings.selectionSettings.mode?'[index="'+n+'"]':"")),y++;if(!d){n=i.classList.contains(A)?n:this.renderModule.rowStartPos-1;for(var b=i.classList.contains("e-active"),C=0,x=[].slice.call(this.element.querySelectorAll(s.toString()));C<x.length;C++){var w=x[C];Number(w.getAttribute("index"))>=n&&(b&&o&&-1===f.indexOf(w.getAttribute("index"))?t.removeClass([w],["e-active",_]):t.addClass([w],["e-active",_]))}}this.renderModule.selected()}},o.prototype.getSelectedCellsPos=function(){var e=this;e.savedSelectedCellsPos=[],e.cellSelectionPos=[];for(var t=0,i=[].slice.call(this.element.querySelectorAll("."+_));t<i.length;t++){n=i[t];e.savedSelectedCellsPos.push({rowIndex:n.getAttribute("index"),colIndex:n.getAttribute("data-colindex")})}for(var a=0,r=[].slice.call(this.element.querySelectorAll("."+U));a<r.length;a++){var n=r[a];e.cellSelectionPos.push({rowIndex:n.getAttribute("index"),colIndex:n.getAttribute("data-colindex")})}},o.prototype.setSavedSelectedCells=function(){for(var e=this,i=0,a=[].slice.call(this.savedSelectedCellsPos);i<a.length;i++){s='[data-colindex="'+(o=a[i]).colIndex+'"][index="'+o.rowIndex+'"]';t.addClass([e.element.querySelector(s)],["e-active",_])}for(var r=0,n=[].slice.call(this.cellSelectionPos);r<n.length;r++){var o=n[r],s='[data-colindex="'+o.colIndex+'"][index="'+o.rowIndex+'"]';t.addClass([e.element.querySelector(s)],[U])}},o.prototype.renderEmptyGrid=function(){var e=this;if(this.isEmptyGrid=!0,this.notEmpty=!1,this.isInitial=!0,this.renderModule=this.renderModule?this.renderModule:new Z(this),this.grid&&this.grid.element&&this.element.querySelector(".e-grid"))this.notEmpty=!0,this.grid.setProperties({columns:this.renderModule.frameEmptyColumns(),dataSource:this.renderModule.frameEmptyData()},!0),this.grid.notify("datasource-modified",{}),this.grid.refreshColumns();else{this.element.querySelector(".e-grid")&&t.remove(this.element.querySelector(".e-grid")),this.renderModule.bindGrid(this,!0),this.grid.showSpinner=function(){},this.grid.hideSpinner=function(){};var i=t.createElement("div",{id:this.element.id+"_grid"});this.element.appendChild(i),this.grid.isStringTemplate=!0,this.grid.appendTo(i),this.grid.off("data-ready",this.grid.dataReady),this.grid.on("data-ready",function(){e.grid.scrollModule.setWidth(),e.grid.scrollModule.setHeight()})}},o.prototype.initEngine=function(){var e=this;if(this.element.querySelector(".e-spin-hide")&&this.showWaitingPopup(),"pivot"===this.dataType){var i=t.isNullOrUndefined(this.dataSourceSettings.dataSource)?t.isNullOrUndefined(this.engineModule.data)?void 0:this.engineModule.data[0]:this.dataSourceSettings.dataSource[0];if(i&&this.pivotCommon){var a="[object Array]"===Object.prototype.toString.call(i);if(a&&"JSON"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidJSON"));if(!a&&"CSV"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidCSV"))}}var r={dataSourceSettings:f.getClonedDataSourceSettings(this.dataSourceSettings)};this.trigger("enginePopulating",r,function(t){f.updateDataSourceSettings(e,t.dataSourceSettings),e.updatePageSettings(!1);var i={mode:"",savedFieldList:void 0,pageSettings:e.pageSettings,enableValueSorting:e.enableValueSorting,isDrillThrough:e.allowDrillThrough||e.editSettings.allowEditing,localeObj:e.localeObj,fieldsType:e.fieldsType,clonedReport:e.clonedReport,globalize:e.globalize,currenyCode:e.currencyCode,enablePaging:e.enablePaging,enableVirtualization:e.enableVirtualization,allowDataCompression:e.allowDataCompression,enableHtmlSanitizer:e.enableHtmlSanitizer,enableOptimizedRendering:e.enableVirtualization&&e.virtualScrollSettings&&e.virtualScrollSettings.allowSinglePage,isTabularLayout:e.isTabular};if("pivot"===e.dataType){if(e.dataSourceSettings.groupSettings&&e.dataSourceSettings.groupSettings.length>0){var a=e.engineModule.data;e.clonedDataSet=e.clonedDataSet?e.clonedDataSet:"CSV"===e.dataSourceSettings.type?f.getClonedCSVData(a):f.getClonedData(a);var r=JSON.parse(e.getPersistData()).dataSourceSettings;r.dataSource=[],e.clonedReport=e.clonedReport?e.clonedReport:r}"Server"!==e.dataSourceSettings.mode&&e.engineModule.renderEngine(e.dataSourceSettings,i,e.aggregateCellInfo?e.getValueCellInfo.bind(e):void 0,e.onHeadersSort?e.getHeaderSortInfo.bind(e):void 0),e.allowServerDataBinding=!1,e.setProperties({pivotValues:e.engineModule.pivotValues},!0),e.allowServerDataBinding=!0,e.enginePopulatedEventMethod("initEngine")}else"SSAS"===e.dataSourceSettings.providerType&&"olap"===e.dataType&&(i.savedFieldList=e.olapEngineModule.fieldList,i.savedFieldListData=e.olapEngineModule.fieldListData,f.renderOlapEngine(e,i),e.allowServerDataBinding=!1,e.setProperties({pivotValues:e.olapEngineModule.pivotValues},!0),e.allowServerDataBinding=!0,e.enginePopulatedEventMethod("initEngine"))})},o.prototype.enginePopulatedEventMethod=function(e,t){if("initEngine"===e){var i=t||this;this.trigger("enginePopulated",{pivotValues:this.pivotValues},function(e){"olap"===i.dataType?(i.olapEngineModule.pivotValues=e.pivotValues,i.pivotValues=i.olapEngineModule.pivotValues):(i.setProperties(i.engineModule.pivotValues=e.pivotValues,!0),i.setProperties(i.pivotValues=i.engineModule.pivotValues,!0)),i.notify(x,{}),i.notEmpty=!0})}else{var a=t||this,r={dataSourceSettings:a.dataSourceSettings,pivotValues:a.pivotValues};a.trigger("enginePopulated",r,function(e){a.dataSourceSettings=e.dataSourceSettings,"olap"===a.dataType?(a.olapEngineModule.pivotValues=e.pivotValues,a.allowServerDataBinding=!1,a.setProperties({pivotValues:a.olapEngineModule.pivotValues},!0),a.allowServerDataBinding=!0):(a.engineModule.pivotValues=e.pivotValues,a.allowServerDataBinding=!1,a.setProperties({pivotValues:a.engineModule.pivotValues},!0),a.allowServerDataBinding=!0),a.pivotCommon&&(a.pivotCommon.engineModule="olap"===a.dataType?a.olapEngineModule:a.engineModule,a.pivotCommon.dataSourceSettings=a.dataSourceSettings),a.renderPivotGrid()})}},o.prototype.generateData=function(){this.isStaticRefresh||("Chart"!==this.displayOption.view&&t.isNullOrUndefined(this.grid)?(this.renderEmptyGrid(),this.showWaitingPopup()):(this.showWaitingPopup(),clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.refreshData.bind(this),100)))},o.prototype.refreshData=function(){var e=this;e.isStaticRefresh?(e.isStaticRefresh=!1,e.hideWaitingPopup()):e.dataSourceSettings&&(e.dataSourceSettings.dataSource||e.dataSourceSettings.url)?e.dataSourceSettings.dataSource instanceof i.DataManager?"pivot"===e.dataType&&e.remoteData.length>0?(this.element.querySelector(".e-spinner-pane")||this.showWaitingPopup(),this.engineModule.data=e.remoteData,this.initEngine()):t.isNullOrUndefined(e.engineModule.data)||0!==e.engineModule.data.length?e.initEngine():(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(e.getData.bind(e),100)):""!==this.dataSourceSettings.url&&"olap"===this.dataType||e.dataSourceSettings.dataSource&&e.dataSourceSettings.dataSource.length>0||this.engineModule.data&&this.engineModule.data.length>0?("pivot"===e.dataType&&(this.hideWaitingPopup(),e.engineModule.data=e.dataSourceSettings.dataSource),e.initEngine()):"Server"===this.dataSourceSettings.mode?this.getEngine("onRefresh"):(this.notify(x,{}),this.hideWaitingPopup()):(this.notify(x,{}),this.hideWaitingPopup())},o.prototype.getValueCellInfo=function(e){var t=e;return this.trigger("aggregateCellInfo",t),t},o.prototype.getHeaderSortInfo=function(e){var t=e;return this.trigger("onHeadersSort",t),t},o.prototype.bindTriggerEvents=function(e){this.trigger(n.getObject("name",e),e)},o.prototype.getData=function(){this.dataSourceSettings.dataSource.defaultQuery?this.dataSourceSettings.dataSource.executeQuery(this.dataSourceSettings.dataSource.defaultQuery).then(this.executeQuery.bind(this)):this.dataSourceSettings.dataSource.executeQuery(new i.Query).then(this.executeQuery.bind(this))},o.prototype.executeQuery=function(e){this.element.querySelector(".e-spinner-pane")||this.showWaitingPopup();var i=this;i.engineModule.data=e.result,this.isEmptyGrid&&!t.isNullOrUndefined(i.engineModule.data)&&0===i.engineModule.data.length?this.hideWaitingPopup():!t.isNullOrUndefined(i.engineModule.data)&&i.engineModule.data.length>0?(this.isEmptyGrid=!1,i.initEngine()):(this.isEmptyGrid=!0,this.hideWaitingPopup(),this.renderEmptyGrid(),this.engineModule.fieldList=null,this.engineModule.isEmptyData=!0,this.pivotValues=[],this.engineModule.data=[],this.notify(x,{}))},o.prototype.applyFormatting=function(e){if(e){for(var i=[],a=e.length,r=0;r<a;r++)void 0!==e[r]&&void 0===e[r][0]&&i.push(r);for(r=0;r<e.length;r++)for(var n=1;e[r]&&n<e[r].length;n++)if("value"===e[r][n].axis&&""!==e[r][n].formattedText){e[r][n].style=void 0,e[r][n].cssClass=void 0;for(var o=this.dataSourceSettings.conditionalFormatSettings,s=0;s<o.length;s++)!0!==o[s].applyGrandTotals&&!t.isNullOrUndefined(o[s].applyGrandTotals)&&e[r][n].isGrandSum||this.checkCondition(e[r][n].value,o[s].conditions,o[s].value1,o[s].value2)&&(o[s].measure&&e[r][n].actualText!==o[s].measure||void 0!==o[s].measure&&""===o[s].measure||void 0!==o[s].label&&""===o[s].label||!(!o[s].label||e[r][0].valueSort.levelName.indexOf(o[s].label)>-1||e[r][n].rowHeaders.indexOf(o[s].label)>-1||e[r][n].columnHeaders.indexOf(o[s].label)>-1)||(o[s].style&&o[s].style.backgroundColor&&(o[s].style.backgroundColor="#"===o[s].style.backgroundColor.charAt(0)&&this.conditionalFormattingModule.isHex(o[s].style.backgroundColor.substr(1))?o[s].style.backgroundColor:this.conditionalFormattingModule.colourNameToHex(o[s].style.backgroundColor)),o[s].style&&o[s].style.color&&(o[s].style.color="#"===o[s].style.color.charAt(0)&&this.conditionalFormattingModule.isHex(o[s].style.color.substr(1))?o[s].style.color:this.conditionalFormattingModule.colourNameToHex(o[s].style.color)),e[r][n].style=o[s].style,e[r][n].cssClass="format"+this.element.id+s))}for(var l=this.dataSourceSettings.conditionalFormatSettings,s=0;s<l.length;s++){var d=this.createStyleSheet.bind(this)(),p="color: "+l[s].style.color+"!important;background-color: "+l[s].style.backgroundColor+"!important;font-size: "+l[s].style.fontSize+"!important;font-family: "+l[s].style.fontFamily+" !important;",h=".format"+this.element.id+s;d.insertRule(h+", "+h+" .e-cellvalue{"+p+"}",0)}}},o.prototype.createStyleSheet=function(){var e=document.createElement("style");return e.appendChild(document.createTextNode("")),document.head.appendChild(e),e.sheet},o.prototype.applyHyperlinkSettings=function(){if(this.pivotValues){for(var e=this.pivotValues,i=[],a=e.length,r=0;r<a;r++)t.isNullOrUndefined(e[r])||void 0!==e[r][0]||i.push(r);if(this.hyperlinkSettings.conditionalSettings.length>0)for(r=0;r<e.length;r++)for(p=1;e[r]&&p<e[r].length;p++)if("value"===e[r][p].axis){e[r][p].enableHyperlink=!1;for(var n=this.hyperlinkSettings.conditionalSettings,o=0;o<n.length;o++)if(this.checkCondition(e[r][p].value,n[o].conditions,n[o].value1,n[o].value2)){var s="row"===this.dataSourceSettings.valueAxis?r:"pivot"===this.dataType?this.engineModule.headerContent.length-1:this.olapEngineModule.headerContent.length-1,l="row"===this.dataSourceSettings.valueAxis?0:p;(!n[o].measure||1===this.dataSourceSettings.values.length||e[s][l].valueSort&&e[s][l].actualText===n[o].measure)&&(!n[o].label||e[i[n[o].label.split(".").length-1]]&&e[i[n[o].label.split(".").length-1]][p]&&e[i[n[o].label.split(".").length-1]][p].valueSort&&e[i[n[o].label.split(".").length-1]][p].valueSort[n[o].label]||e[r][0].valueSort.levelName.indexOf(n[o].label)>-1)&&(e[r][p].enableHyperlink=!0)}}if(t.isNullOrUndefined(this.hyperlinkSettings.headerText))return;for(var d=this.dataSourceSettings.valueSortSettings.headerDelimiter?this.dataSourceSettings.valueSortSettings.headerDelimiter:".",r=0;r<e.length;r++)for(var p=1;e[r]&&p<e[r].length;p++)if("value"===e[r][p].axis){var h=this.hyperlinkSettings.headerText;if(e[r][0].valueSort.levelName.indexOf(h)>-1)e[r][0].enableHyperlink=!0,e[r][p].enableHyperlink=!0;else{for(var u=!1,o=0;o<i.length;o++)h=d+this.hyperlinkSettings.headerText,(d+e[i[o]][p].valueSort.levelName).indexOf(h)>-1&&(e[i[o]][p].enableHyperlink=!0,u=!0);e[r][p].enableHyperlink=u}}}},o.prototype.checkCondition=function(e,t,i,a){switch(t){case"LessThan":return e<i;case"LessThanOrEqualTo":return e<=i;case"GreaterThan":return e>i;case"GreaterThanOrEqualTo":return e>=i;case"Equals":return e===i;case"NotEquals":return e!==i;case"Between":return i<a&&e>=i&&e<=a||i>a&&e<=i&&e>=a;case"NotBetween":return!(i<a&&e>=i&&e<=a||i>a&&e<=i&&e>=a);default:return!1}},o.prototype.updateGroupingReport=function(e,i){if(!this.clonedDataSet&&!this.clonedReport){var a=this.engineModule.data;this.clonedDataSet="CSV"===this.dataSourceSettings.type?f.getClonedCSVData(a):f.getClonedData(a);var r=JSON.parse(this.getPersistData()).dataSourceSettings;r.dataSource=[],this.clonedReport=this.clonedReport?this.clonedReport:r}var n=/_date_group_years|_date_group_quarters|_date_group_quarterYear|_date_group_months|_date_group_days|_date_group_hours|_date_group_minutes|_date_group_seconds/g,o="CSV"===this.dataSourceSettings.type?f.getClonedCSVData(this.clonedDataSet):f.getClonedData(this.clonedDataSet),s=this.dataSourceSettings,l=this.clonedReport.properties?this.clonedReport.properties:this.clonedReport,d=[s.rows,s.columns,s.values,s.filters],p=[s.filterSettings,s.sortSettings,s.formatSettings,s.drilledMembers],h=l.rows;if(h=h.concat(l.columns,l.values,l.filters),0===e.length||e.length>0){this.engineModule.groupingFields={},this.setProperties({dataSourceSettings:{dataSource:o,groupSettings:e.length>0?s.groupSettings:[]}},!0);for(var u,c="Date"===i,g=[],m=0,v=d.length;m<v;m++)for(var S,y,b=0,C=d[m].length;b<C;b++)!function(e,i){var a=d[m][e].name;-1===g.indexOf(a)&&g.push(a);var r=g.indexOf(a);if(!t.isNullOrUndefined(a.match(n))&&c||-1!==a.indexOf("_custom_group")&&!f.getFieldByName(a.replace("_custom_group",""),s.groupSettings)){d[m].splice(e,1),g.splice(r,1),e--,i--,a=a.split("_")[0];for(var o=!1,l=0;l<d.length&&!(o=d[l].filter(function(e){return e.name===a}).length>0);l++);if(!o){u=a.split("_")[0];var p=f.getFieldByName(u,h);h=h.filter(function(e){return e.name!==u}),g.push(u),p&&(o?d[m].splice(e,1,p):d[m].splice(++e,0,p))}}else(p=f.getFieldByName(a,h))?d[m].splice(e,1,p):u===a&&d[m].splice(e,1);S=e,y=i}(b,C),b=S,C=y;for(var x=0,w=g;x<w.length;x++)for(var T=w[x],M=f.getFilterItemByName(T,l.filterSettings),D=f.getFieldByName(T,l.sortSettings),O=f.getFieldByName(T,l.formatSettings),P=f.getFieldByName(T,l.drilledMembers),N=[M,D,O,P],m=0,v=p.length;m<v;m++){for(var E=!1,b=0,C=p[m].length;b<C;b++){var F=p[m][b].name;if(!t.isNullOrUndefined(F.match(n))&&c||-1!==F.indexOf("_custom_group")&&!f.getFieldByName(F.replace("_custom_group",""),s.groupSettings))p[m].splice(b,1),b--,C--;else if(T===p[m][b].name){E=!0,N[m]?p[m].splice(b,1,N[m]):(p[m].splice(b,1),b--,C--);break}}!E&&0===m&&M&&p[m].push(M),!E&&1===m&&D&&p[m].push(D),!E&&2===m&&O&&p[m].push(O),!E&&3===m&&P&&p[m].push(P)}}},o.prototype.removeButtonFocus=function(){document.querySelectorAll(".e-btn-focused")&&t.removeClass(document.querySelectorAll(".e-btn-focused"),"e-btn-focused")},o.prototype.wireEvents=function(){var e=this.virtualScrollSettings&&this.virtualScrollSettings.allowSinglePage&&"pivot"===this.dataType;"Chart"!==this.displayOption.view&&(t.EventHandler.add(this.element,this.isAdaptive?"touchend":"click",this.mouseClickHandler,this),t.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this),t.EventHandler.add(this.element.querySelector(".e-gridheader"),"mousemove",this.mouseMoveHandler,this),t.EventHandler.add(this.element,"mouseup",this.mouseUpHandler,this),t.EventHandler.add(this.element,this.isAdaptive?"touchend":"contextmenu",this.mouseRclickHandler,this),this.virtualscrollModule&&this.enableVirtualization&&!e&&t.EventHandler.add(this.element.querySelector(".e-gridcontent").querySelector(".e-content"),"scroll",this.headerScrollUpdate,this)),t.EventHandler.add(document,this.isAdaptive?"touchend":"click",this.removeButtonFocus,this),window.addEventListener("resize",this.onWindowResize.bind(this),!0)},o.prototype.headerScrollUpdate=function(){this.element.querySelector(".e-headercontent").scrollLeft!==this.element.querySelector(".e-gridcontent").querySelector(".e-content").scrollLeft&&(this.virtualscrollModule.direction="horizondal"),this.element.querySelector(".e-headercontent").scrollLeft=this.element.querySelector(".e-gridcontent").querySelector(".e-content").scrollLeft},o.prototype.unwireEvents=function(){"Chart"!==this.displayOption.view&&(t.EventHandler.remove(this.element,this.isAdaptive?"touchend":"click",this.mouseClickHandler),t.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler),this.element.querySelector(".e-gridheader")&&t.EventHandler.remove(this.element.querySelector(".e-gridheader"),"mousemove",this.mouseMoveHandler),t.EventHandler.remove(this.element,"mouseup",this.mouseUpHandler),t.EventHandler.remove(this.element,this.isAdaptive?"touchend":"contextmenu",this.mouseRclickHandler),this.virtualscrollModule&&this.enableVirtualization&&this.element.querySelector(".e-gridcontent")&&t.EventHandler.remove(this.element.querySelector(".e-gridcontent").querySelector(".e-content"),"scroll",this.headerScrollUpdate)),t.EventHandler.remove(document,this.isAdaptive?"touchend":"click",this.removeButtonFocus),window.removeEventListener("resize",this.onWindowResize.bind(this),!0)},o.prototype.actionBeginMethod=function(){var e={dataSourceSettings:f.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,cancel:!1};return this.trigger("actionBegin",e),e.cancel},o.prototype.actionCompleteMethod=function(){var e={dataSourceSettings:f.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,actionInfo:this.actionObj.actionInfo};this.trigger("actionComplete",e),this.actionObj.actionName="",this.actionObj.actionInfo=void 0,this.actionObj.fieldInfo=void 0},o.prototype.actionFailureMethod=function(e){var t={actionName:this.actionObj.actionName,errorInfo:e};this.trigger("actionFailure",t)},o.prototype.getActionCompleteName=function(){var e;switch(this.actionObj.actionName){case"Open conditional formatting dialog":e="Conditional formatting applied";break;case"Open number formatting dialog":e="Number formatting applied";break;case"Show table view":e="Table view shown";break;case T:e="Chart view shown";break;case"Hide sub-totals":e="Sub-totals hidden";break;case"Show row sub-totals":e="Row sub-totals shown";break;case"Show column sub-totals":e="Column sub-totals shown";break;case"Show sub-totals":e="Sub-totals shown";break;case"Hide grand totals":e="Grand totals hidden";break;case"Show row grand totals":e="Row grand totals shown";break;case"Show column grand totals":e="Column grand totals shown";break;case"Show grand totals":e="Grand totals shown";break;case"Sort value":e="Value sorted";break;case"Open calculated field dialog":e="Calculated field applied";break;case"Edit calculated field":e="Calculated field edited";break;case"Sort field":e="Field sorted";break;case"Filter field":e="Field filtered";break;case"Remove field":e="Field removed";break;case"Aggregate field":e="Field aggregated";break;case"Edit record":e="Record edited";break;case"Report change":e="Report changed";break;case"Save edited records":e="Edited records saved";break;case"Add new record":e="New record added";break;case"Remove record":e="Record removed";break;case"PNG export":e="PNG exported";break;case"JPEG export":e="JPEG exported";break;case"SVG export":e="SVG exported";break;case"PDF export":e="PDF exported";break;case"CSV export":e="CSV exported";break;case"Excel export":e="Excel exported";break;case"Window resize":e="Window resized";break;case"Save current report":e="Report saved";break;case"Add new report":e="New report added";break;case"Save as current report":e="Report re-saved";break;case"Rename current report":e="Report renamed";break;case"horizontal-scroll":e="Horizontally scrolled";break;case"vertical-scroll":e="Vertically scrolled";break;case"Navigate row page":e="Row page navigated";break;case"Navigate column page":e="Column page navigated";break;default:e=this.actionObj.actionName}return e},o.prototype.getStackedColumns=function(e,t){for(var i=0,a=e;i<a.length;i++){var r=a[i];t.push(r),r.columns&&r.columns.length>0&&this.getStackedColumns(r.columns,t)}return t},o.prototype.destroy=function(){this.removeInternalEvents(),this.engineModule&&(this.engineModule.fieldList={},this.engineModule.rMembers=null,this.engineModule.cMembers=null,this.engineModule.valueMatrix=[],this.engineModule={}),this.olapEngineModule&&(this.olapEngineModule.fieldList={},this.olapEngineModule={}),this.showGroupingBar&&this.groupingBarModule&&this.groupingBarModule.destroy(),this.allowGrouping&&this.groupingModule&&this.groupingModule.destroy(),this.showToolbar&&this.toolbarModule&&this.toolbarModule.destroy(),this.enablePaging&&this.pagerModule&&this.pagerModule.destroy(),this.enableVirtualization&&this.virtualscrollModule&&this.virtualscrollModule.destroy(),this.allowConditionalFormatting&&this.conditionalFormattingModule&&this.conditionalFormattingModule.destroy(),this.allowNumberFormatting&&this.numberFormattingModule&&this.numberFormattingModule.destroy(),this.contextMenuModule&&this.contextMenuModule.destroy(),this.keyboardModule&&this.keyboardModule.destroy(),this.tooltip&&!this.tooltip.isDestroyed&&this.tooltip.destroy(),this.calculatedFieldModule&&this.calculatedFieldModule.destroy(),this.chart&&!this.chart.isDestroyed&&(this.chart.destroy(),this.chart.isDestroyed&&t.select("#"+this.element.id+"_chart",this.element)&&t.remove(t.select("#"+this.element.id+"_chart",this.element))),this.grid&&!this.grid.isDestroyed&&(this.grid.destroy(),this.grid.isDestroyed&&t.select("#"+this.element.id+"_grid",this.element)&&t.remove(t.select("#"+this.element.id+"_grid",this.element))),this.commonModule&&this.commonModule.destroy(),this.pivotChartModule&&this.pivotChartModule.destroy(),this.pivotButtonModule&&!this.pivotButtonModule.isDestroyed&&this.pivotButtonModule.destroy(),this.pivotFieldListModule&&!this.pivotFieldListModule.isDestroyed&&(this.pivotFieldListModule.destroy(),this.pivotFieldListModule.isDestroyed&&null!==t.select("#"+this.element.id+"_PivotFieldList",this.element)&&t.remove(t.select("#"+this.element.id+"_PivotFieldList",this.element))),(this.allowDrillThrough||this.editSettings&&this.editSettings.allowEditing)&&this.drillThroughModule&&this.drillThroughModule.destroy(),this.chartExportModule&&this.chartExportModule.destroy(),this.unwireEvents(),e.prototype.destroy.call(this),this.groupingBarModule&&(this.groupingBarModule=null),this.groupingModule&&(this.groupingModule=null),this.pivotFieldListModule&&(this.pivotFieldListModule=null),this.calculatedFieldModule&&(this.calculatedFieldModule=null),this.conditionalFormattingModule&&(this.conditionalFormattingModule=null),this.numberFormattingModule&&(this.numberFormattingModule=null),this.toolbarModule&&(this.toolbarModule=null),this.pagerModule&&(this.pagerModule=null),this.virtualscrollModule&&(this.virtualscrollModule=null),this.contextMenuModule&&(this.contextMenuModule=null),this.keyboardModule&&(this.keyboardModule=null),this.tooltip&&(this.tooltip=null),this.chart&&(this.chart=null),this.grid&&(this.grid=null),this.commonModule&&(this.commonModule=null),this.pivotChartModule&&(this.pivotChartModule=null),this.pivotButtonModule&&(this.pivotButtonModule=null),this.renderModule&&(this.renderModule=null),this.axisFieldModule&&(this.axisFieldModule=null),this.pdfExportModule&&(this.pdfExportModule=null),this.excelExportModule&&(this.excelExportModule=null),this.drillThroughModule&&(this.drillThroughModule=null),this.clonedDataSet&&(this.clonedDataSet=null),this.clonedReport&&(this.clonedReport=null),this.pagerModule&&(this.pagerModule=null),this.chartExportModule&&(this.chartExportModule=null),this.exportSpecifiedPages&&(this.exportSpecifiedPages=void 0),this.element.innerHTML="",t.removeClass([this.element],M),t.removeClass([this.element],D),t.removeClass([this.element],O),this.globalize=null,this.localeObj=null,this.currentView=null,this.fieldListSpinnerElement=null,this.lastSortInfo=null,this.lastFilterInfo=null,this.lastAggregationInfo=null,this.lastCalcFieldInfo=null,this.lastCellClicked=null,this.lastColumn=null,this.pivotCommon=null},o.prototype.showNumberFormattingDialog=function(){this.allowNumberFormatting&&this.numberFormattingModule.showNumberFormattingDialog()},o.prototype.getValuesHeader=function(e,i){var a=this.dataSourceSettings.values;return"value"===i&&!t.isNullOrUndefined(e.valueSort)&&this.localeObj.getConstant("grandTotal")+this.dataSourceSettings.valueSortSettings.headerDelimiter+e.formattedText===e.valueSort.levelName&&("column"===e.axis&&0===this.dataSourceSettings.columns.length&&"column"===this.dataSourceSettings.valueAxis||"row"===e.axis&&0===this.dataSourceSettings.rows.length&&"row"===this.dataSourceSettings.valueAxis)?this.localeObj.getConstant("total")+" "+this.localeObj.getConstant(this.engineModule.fieldList[e.actualText].aggregateType)+" "+this.localeObj.getConstant("of")+" "+e.formattedText:"grandTotal"===i&&1===a.length&&"row"===this.dataSourceSettings.valueAxis&&e.formattedText===this.localeObj.getConstant("grandTotal")?this.localeObj.getConstant("total")+" "+this.localeObj.getConstant(a[a.length-1].type)+" "+this.localeObj.getConstant("of")+" "+(t.isNullOrUndefined(a[a.length-1].caption)?a[a.length-1].name:a[a.length-1].caption):e.formattedText},o.prototype.setColumnWidth=function(e,t){e.autoFit||("auto"!==e.width?e.width=this.renderModule.lastColumn&&e.field===this.renderModule.lastColumn.field?t-3:t:e.minWidth=t)},Ot([t.Property("USD")],o.prototype,"currencyCode",void 0),Ot([t.Property(!1)],o.prototype,"showFieldList",void 0),Ot([t.Complex({},Me)],o.prototype,"gridSettings",void 0),Ot([t.Complex({},Ct)],o.prototype,"chartSettings",void 0),Ot([t.Complex({},Pt)],o.prototype,"groupingBarSettings",void 0),Ot([t.Complex({},Ft)],o.prototype,"hyperlinkSettings",void 0),Ot([t.Complex({},It)],o.prototype,"pageSettings",void 0),Ot([t.Complex({},Lt)],o.prototype,"pagerSettings",void 0),Ot([t.Complex({},xe)],o.prototype,"dataSourceSettings",void 0),Ot([t.Complex({},Nt)],o.prototype,"editSettings",void 0),Ot([t.Complex({},At)],o.prototype,"displayOption",void 0),Ot([t.Complex({},Rt)],o.prototype,"virtualScrollSettings",void 0),Ot([t.Property()],o.prototype,"pivotValues",void 0),Ot([t.Property(!1)],o.prototype,"showGroupingBar",void 0),Ot([t.Property(!0)],o.prototype,"showTooltip",void 0),Ot([t.Property(!1)],o.prototype,"showToolbar",void 0),Ot([t.Property([])],o.prototype,"toolbar",void 0),Ot([t.Property(!1)],o.prototype,"showValuesButton",void 0),Ot([t.Property(!1)],o.prototype,"allowCalculatedField",void 0),Ot([t.Property(!1)],o.prototype,"enableFieldSearching",void 0),Ot([t.Property(!1)],o.prototype,"enableValueSorting",void 0),Ot([t.Property(!1)],o.prototype,"allowConditionalFormatting",void 0),Ot([t.Property(!1)],o.prototype,"allowNumberFormatting",void 0),Ot([t.Property("auto")],o.prototype,"height",void 0),Ot([t.Property("auto")],o.prototype,"width",void 0),Ot([t.Property(!1)],o.prototype,"allowExcelExport",void 0),Ot([t.Property(!1)],o.prototype,"enableVirtualization",void 0),Ot([t.Property(!1)],o.prototype,"enablePaging",void 0),Ot([t.Property(!1)],o.prototype,"allowDrillThrough",void 0),Ot([t.Property(!1)],o.prototype,"allowPdfExport",void 0),Ot([t.Property(!1)],o.prototype,"allowDeferLayoutUpdate",void 0),Ot([t.Property(!1)],o.prototype,"allowDataCompression",void 0),Ot([t.Property(1e3)],o.prototype,"maxNodeLimitInMemberEditor",void 0),Ot([t.Property(1e4)],o.prototype,"maxRowsInDrillThrough",void 0),Ot([t.Property(!0)],o.prototype,"loadOnDemandInMemberEditor",void 0),Ot([t.Property(!1)],o.prototype,"enableHtmlSanitizer",void 0),Ot([t.Property()],o.prototype,"cellTemplate",void 0),Ot([t.Property()],o.prototype,"toolbarTemplate",void 0),Ot([t.Property()],o.prototype,"tooltipTemplate",void 0),Ot([t.Property()],o.prototype,"spinnerTemplate",void 0),Ot([t.Property(!1)],o.prototype,"allowGrouping",void 0),Ot([t.Property(!0)],o.prototype,"exportAllPages",void 0),Ot([t.Property(["Sum","Count","DistinctCount","Product","Min","Max","Avg","Median","Index","PopulationVar","SampleVar","PopulationStDev","SampleStDev","RunningTotals","PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfParentColumnTotal","PercentageOfParentRowTotal","DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"])],o.prototype,"aggregateTypes",void 0),Ot([t.Property(["Column","Bar","Line","Area","Scatter","Polar","StackingColumn","StackingArea","StackingBar","StackingLine","StepLine","StepArea","SplineArea","Spline","StackingColumn100","StackingBar100","StackingArea100","StackingLine100","Bubble","Pareto","Radar","Pie","Doughnut","Funnel","Pyramid"])],o.prototype,"chartTypes",void 0),Ot([t.Property("")],o.prototype,"cssClass",void 0),Ot([t.Event()],o.prototype,"queryCellInfo",void 0),Ot([t.Event()],o.prototype,"headerCellInfo",void 0),Ot([t.Event()],o.prototype,"resizing",void 0),Ot([t.Event()],o.prototype,"resizeStop",void 0),Ot([t.Event()],o.prototype,"pdfHeaderQueryCellInfo",void 0),Ot([t.Event()],o.prototype,"pdfQueryCellInfo",void 0),Ot([t.Event()],o.prototype,"excelHeaderQueryCellInfo",void 0),Ot([t.Event()],o.prototype,"excelQueryCellInfo",void 0),Ot([t.Event()],o.prototype,"columnDragStart",void 0),Ot([t.Event()],o.prototype,"columnDrag",void 0),Ot([t.Event()],o.prototype,"columnDrop",void 0),Ot([t.Event()],o.prototype,"beforePdfExport",void 0),Ot([t.Event()],o.prototype,"beforeExcelExport",void 0),Ot([t.Event()],o.prototype,"beforeColumnsRender",void 0),Ot([t.Event()],o.prototype,"selected",void 0),Ot([t.Event()],o.prototype,"cellDeselected",void 0),Ot([t.Event()],o.prototype,"rowSelected",void 0),Ot([t.Event()],o.prototype,"rowDeselected",void 0),Ot([t.Event()],o.prototype,"chartTooltipRender",void 0),Ot([t.Event()],o.prototype,"chartLegendClick",void 0),Ot([t.Event()],o.prototype,"beforePrint",void 0),Ot([t.Event()],o.prototype,"animationComplete",void 0),Ot([t.Event()],o.prototype,"legendRender",void 0),Ot([t.Event()],o.prototype,"textRender",void 0),Ot([t.Event()],o.prototype,"pointRender",void 0),Ot([t.Event()],o.prototype,"seriesRender",void 0),Ot([t.Event()],o.prototype,"chartMouseMove",void 0),Ot([t.Event()],o.prototype,"chartMouseClick",void 0),Ot([t.Event()],o.prototype,"pointMove",void 0),Ot([t.Event()],o.prototype,"chartMouseLeave",void 0),Ot([t.Event()],o.prototype,"chartMouseDown",void 0),Ot([t.Event()],o.prototype,"chartMouseUp",void 0),Ot([t.Event()],o.prototype,"dragComplete",void 0),Ot([t.Event()],o.prototype,"zoomComplete",void 0),Ot([t.Event()],o.prototype,"scrollStart",void 0),Ot([t.Event()],o.prototype,"scrollEnd",void 0),Ot([t.Event()],o.prototype,"scrollChanged",void 0),Ot([t.Event()],o.prototype,"multiLevelLabelRender",void 0),Ot([t.Event()],o.prototype,"chartLoaded",void 0),Ot([t.Event()],o.prototype,"chartLoad",void 0),Ot([t.Event()],o.prototype,"chartResized",void 0),Ot([t.Event()],o.prototype,"chartAxisLabelRender",void 0),Ot([t.Event()],o.prototype,"multiLevelLabelClick",void 0),Ot([t.Event()],o.prototype,"chartPointClick",void 0),Ot([t.Event()],o.prototype,"contextMenuClick",void 0),Ot([t.Event()],o.prototype,"contextMenuOpen",void 0),Ot([t.Event()],o.prototype,"onPdfCellRender",void 0),Ot([t.Event()],o.prototype,"saveReport",void 0),Ot([t.Event()],o.prototype,"fetchReport",void 0),Ot([t.Event()],o.prototype,"loadReport",void 0),Ot([t.Event()],o.prototype,"renameReport",void 0),Ot([t.Event()],o.prototype,"removeReport",void 0),Ot([t.Event()],o.prototype,"newReport",void 0),Ot([t.Event()],o.prototype,"toolbarRender",void 0),Ot([t.Event()],o.prototype,"toolbarClick",void 0),Ot([t.Event()],o.prototype,"load",void 0),Ot([t.Event()],o.prototype,"enginePopulating",void 0),Ot([t.Event()],o.prototype,"enginePopulated",void 0),Ot([t.Event()],o.prototype,"onFieldDropped",void 0),Ot([t.Event()],o.prototype,"fieldDrop",void 0),Ot([t.Event()],o.prototype,"fieldDragStart",void 0),Ot([t.Event()],o.prototype,"dataBound",void 0),Ot([t.Event()],o.prototype,"created",void 0),Ot([t.Event()],o.prototype,"destroyed",void 0),Ot([t.Event()],o.prototype,"beforeExport",void 0),Ot([t.Event()],o.prototype,"exportComplete",void 0),Ot([t.Event()],o.prototype,"conditionalFormatting",void 0),Ot([t.Event()],o.prototype,"memberFiltering",void 0),Ot([t.Event()],o.prototype,"cellClick",void 0),Ot([t.Event()],o.prototype,"drillThrough",void 0),Ot([t.Event()],o.prototype,"editCompleted",void 0),Ot([t.Event()],o.prototype,"beginDrillThrough",void 0),Ot([t.Event()],o.prototype,"hyperlinkCellClick",void 0),Ot([t.Event()],o.prototype,"cellSelecting",void 0),Ot([t.Event()],o.prototype,"drill",void 0),Ot([t.Event()],o.prototype,"cellSelected",void 0),Ot([t.Event()],o.prototype,"chartSeriesCreated",void 0),Ot([t.Event()],o.prototype,"aggregateCellInfo",void 0),Ot([t.Event()],o.prototype,"fieldListRefreshed",void 0),Ot([t.Event()],o.prototype,"memberEditorOpen",void 0),Ot([t.Event()],o.prototype,"calculatedFieldCreate",void 0),Ot([t.Event()],o.prototype,"numberFormatting",void 0),Ot([t.Event()],o.prototype,"aggregateMenuOpen",void 0),Ot([t.Event()],o.prototype,"fieldRemove",void 0),Ot([t.Event()],o.prototype,"beforeServiceInvoke",void 0),Ot([t.Event()],o.prototype,"afterServiceInvoke",void 0),Ot([t.Event()],o.prototype,"actionBegin",void 0),Ot([t.Event()],o.prototype,"actionComplete",void 0),Ot([t.Event()],o.prototype,"actionFailure",void 0),Ot([t.Event()],o.prototype,"onHeadersSort",void 0),o=Ot([t.NotifyPropertyChanges],o)}(t.Component),jt=function(){function e(){}return e.getClonedPivotValues=function(e){for(var t=[],i=0;i<e.length;i++)if(e[i]){t[i]=[];for(var a=0;a<e[i].length;a++)e[i][a]&&(t[i][a]=this.getClonedPivotValueObj(e[i][a]))}return t},e.getClonedPivotValueObj=function(e){var t=0,i={};if(null!==e&&void 0!==e)for(var a=Object.keys(e);t<a.length;)i[a[t]]=e[a[t]],t++;else i=e;return i},e.isContainCommonElements=function(e,t){for(var i=0,a=e.length;i<a;i++)for(var r=0,n=t.length;r<n;r++)if(t[r]===e[i])return!0;return!1},e}(),qt=function(){function e(e){this.actualrCnt=0,this.parent=e}return e.prototype.getModuleName=function(){return"excelExport"},e.prototype.addHeaderAndFooter=function(e,i,a,r){var n=[];if(t.isNullOrUndefined(e.rows))""!==i&&("footer"===a&&this.actualrCnt++,n.push({index:1,value:i}),this.rows.push({index:this.actualrCnt+1,cells:n}),this.actualrCnt="header"===a?this.actualrCnt+2:this.actualrCnt);else{this.actualrCnt="footer"===a?this.actualrCnt+r-e.rows[0].cells.length:this.actualrCnt;for(var o=e.rows,s=0;s<o.length;s++){var l=0;n=[];for(var d=o[s],p=0;p<d.cells.length;p++)n.push({index:l+1,value:d.cells[p].value,colSpan:d.cells[p].colSpan,rowSpan:d.cells[p].rowSpan,style:d.cells[p].style}),l+=n[p].colSpan;this.actualrCnt++,this.rows.push({index:this.actualrCnt,cells:n})}this.actualrCnt="header"===a?r:this.actualrCnt}},e.prototype.exportToExcel=function(e,i,a){this.rows=[],this.actualrCnt=0;var r=!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(i.header),n=!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(i.footer),o=!t.isNullOrUndefined(i)&&!t.isNullOrUndefined(i.fileName);this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule;var s,l=jt.getClonedPivotValues(this.engine.pivotValues),d=o?i.fileName:"CSV"===e?"default.csv":"default.xlsx";if(this.parent.exportAllPages&&(this.parent.enableVirtualization||this.parent.enablePaging)){var p=this.engine.pageSettings,h=void 0;this.engine.isPagingOrVirtualizationEnabled=!1,"olap"===this.parent.dataType?(this.updateOlapPageSettings(!0),h=this.parent.olapEngineModule.mdxQuery.slice(0)):this.engine.pageSettings=null,this.engine.generateGridData(this.parent.dataSourceSettings,!0,!0),this.parent.applyFormatting(this.engine.pivotValues),s=jt.getClonedPivotValues(this.engine.pivotValues),this.engine.pivotValues=l,this.engine.pageSettings=p,this.engine.isPagingOrVirtualizationEnabled=!0,"olap"===this.parent.dataType&&(this.updateOlapPageSettings(!1),this.parent.olapEngineModule.mdxQuery=h)}else s=l;var u,c,g,f,v={fileName:d,header:"",footer:"",dataCollections:[s],excelExportProperties:i};this.parent.trigger("beforeExport",v,function(e){u=e.fileName,c=e.header,g=e.footer,f=e.dataCollections}),!r&&t.isNullOrUndefined(v.excelExportProperties)&&""!==c?this.addHeaderAndFooter({},c,"header",void 0):t.isNullOrUndefined(v.excelExportProperties)||t.isNullOrUndefined(v.excelExportProperties.header)||this.addHeaderAndFooter(v.excelExportProperties.header,"","header",v.excelExportProperties.header.headerRows);for(var S=[],y=0;y<f.length;y++){for(var b=f[y],C=0,x=b.length,w=this.parent.renderModule.getFormatList(),T=0,M=0;M<x;M++)if(b[M]){this.actualrCnt++,C=b[M].length;for(var D=[],O=0;O<C;O++)if(b[M][O]){(_=b[M][O])&&"value"===_.axis&&""===_.formattedText&&(_.value=Number(_.formattedText));var P="row"===this.parent.dataSourceSettings.valueAxis&&"olap"===this.parent.dataType&&_.rowOrdinal&&this.engine.tupRowInfo[_.rowOrdinal]?this.engine.tupRowInfo[_.rowOrdinal].measureName:_.actualText,N="row"===_.axis?{hAlign:"Left",bold:!0,wrapText:!0}:{numberFormat:w[P],bold:!1,wrapText:!0},E={bold:!0,vAlign:"Center",wrapText:!0,indent:0===O?10*_.level:0};if(-1!==_.level||_.rowSpan){var F=this.engine.aggregatedValueMatrix,I="value"===_.axis?F[M]&&F[M][O]?F[M][O]:"#DIV/0!"===_.formattedText?_.formattedText:_.value:_.formattedText,L=0===this.parent.dataSourceSettings.rows.length&&"row"===this.parent.dataSourceSettings.valueAxis||0===this.parent.dataSourceSettings.columns.length&&"column"===this.parent.dataSourceSettings.valueAxis;if(I="grand sum"!==_.type||1===this.parent.dataSourceSettings.values.length&&"row"===this.parent.dataSourceSettings.valueAxis&&"column"===_.axis?"sum"===_.type?I.toString().replace("Total",this.parent.localeObj.getConstant("total")):!t.isNullOrUndefined(_.valueSort)&&this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+_.formattedText===_.valueSort.levelName&&L?this.parent.getValuesHeader(_,"value"):I:L?this.parent.getValuesHeader(_,"grandTotal"):this.parent.localeObj.getConstant("grandTotal"),-1!==_.level||_.rowSpan){D.push({index:O+1,value:I,colSpan:_.colSpan,rowSpan:-1===_.rowSpan?1:_.rowSpan});var A=D[D.length-1];if("value"===_.axis)(isNaN(_.value)||""===_.formattedText||void 0===_.formattedText||t.isNullOrUndefined(_.value))&&(A.value="Excel"===e?null:""),N.numberFormat="string"==typeof I?void 0:N.numberFormat,A.style=t.isNullOrUndefined(A.value)?{bold:!1,wrapText:!0}:N;else if(A.style=E,"row"===_.axis&&0===O)if(A.style=N,"olap"===this.parent.dataType){var R=this.parent.renderModule.indentCollection[M];A.style.indent=2*R,T=T>R?T:R}else{var k=_.valueSort?_.valueSort.levelName.toString():"",j=_.actualText?_.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,q=k.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(j?j-1:j),H=q?q-1:0;A.style.indent=2*H,T=H>T?H:T}(_.style||A.style.backColor||A.style.fontColor||A.style.fontName||A.style.fontSize)&&(A.style.backColor=A.style.backColor?A.style.backColor:_.style.backgroundColor,A.style.fontColor=A.style.fontColor?A.style.fontColor:_.style.color,A.style.fontName=A.style.fontName?A.style.fontName:_.style.fontFamily,t.isNullOrUndefined(A.style.fontSize)&&t.isNullOrUndefined(_.style.fontSize)||(A.style.fontSize=t.isNullOrUndefined(A.style.fontSize)?Number(_.style.fontSize.split("px")[0]):Number(A.style.fontSize))),A.style.borders={color:"#000000",lineStyle:"thin"};var V=void 0,U=void 0;"column"===_.axis?(V={style:E,cell:_},this.parent.trigger("excelHeaderQueryCellInfo",V)):(U={style:N,cell:_,column:void 0,data:b,value:I},this.parent.trigger("excelQueryCellInfo",U)),A.value="column"===_.axis?V.cell.formattedText:U.value,A.style="column"===_.axis?V.style:U.style}}O+=_.colSpan?_.colSpan-1:0}else{var _={formattedText:""},V=void 0;_&&(V={style:void 0,cell:_},this.parent.trigger("excelHeaderQueryCellInfo",V)),D.push({index:O+1,colSpan:1,rowSpan:1,value:_.formattedText,style:V.style})}this.rows.push({index:this.actualrCnt,cells:D})}n?this.addHeaderAndFooter(i.footer,"","footer",i.footer.footerRows):!n&&""!==g&&t.isNullOrUndefined(v.excelExportProperties)?this.addHeaderAndFooter({},g,"footer",void 0):t.isNullOrUndefined(v.excelExportProperties)||t.isNullOrUndefined(v.excelExportProperties.footer)||this.addHeaderAndFooter(v.excelExportProperties.footer,"","footer",v.excelExportProperties.footer.footerRows);for(var B=[],O=0;O<C;O++)B.push({index:O+1,width:100});T>0&&(B[0].width=100+20*T),S.push({columns:B,rows:this.rows})}var G,z=new m.Workbook({worksheets:S},"Excel"===e?"xlsx":"csv",void 0,this.parent.currencyCode),W=u.split(".").pop();a?G=z.saveAsBlob("xlsx"===W||"Excel"===e?"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"text/csv"):z.save("xlsx"===W||"csv"===W?u:u+("Excel"===e?".xlsx":".csv"));var Q={type:e,promise:a?G:null};this.parent.trigger("exportComplete",Q)},e.prototype.updateOlapPageSettings=function(e){this.parent.olapEngineModule.isExporting=!!e,this.parent.exportSpecifiedPages?this.parent.olapEngineModule.exportSpeciedPages=this.parent.exportSpecifiedPages=e?this.parent.exportSpecifiedPages:void 0:(this.parent.olapEngineModule.pageSettings=e?null:this.parent.olapEngineModule.pageSettings,this.parent.olapEngineModule.isPaging=!e)},e.prototype.destroy=function(){this.engine&&(this.engine=null)},e}(),Ht=function(){function e(e){this.parent=e,this.pdfExportHelper=new Tt}return e.prototype.getModuleName=function(){return"pdfExport"},e.prototype.addPage=function(e,i){i=i||this.exportProperties.pdfExportProperties;var r=e.document.sections.add(),n=e.document.pageSettings.height,o=e.document.pageSettings.width;if(this.exportProperties.width||this.exportProperties.height?(e.document.pageSettings.orientation=this.exportProperties.width>this.exportProperties.height||!this.exportProperties.height&&this.exportProperties.width>n||!this.exportProperties.width&&o>this.exportProperties.height?a.PdfPageOrientation.Landscape:a.PdfPageOrientation.Portrait,e.document.pageSettings.size=new a.SizeF(this.exportProperties.width?this.exportProperties.width:o,this.exportProperties.height?this.exportProperties.height:n)):(e.document.pageSettings.orientation=0===this.exportProperties.orientation||this.exportProperties.orientation?this.exportProperties.orientation:t.isNullOrUndefined(i)||t.isNullOrUndefined(i.pageOrientation)?a.PdfPageOrientation.Landscape:"Landscape"===i.pageOrientation?a.PdfPageOrientation.Landscape:a.PdfPageOrientation.Portrait,t.isNullOrUndefined(i)||t.isNullOrUndefined(i.pageSize)||(e.document.pageSettings.size=f.getPageSize(i.pageSize))),!t.isNullOrUndefined(this.exportProperties.pdfMargins)){var s=e.document.pageSettings.margins;s.top=t.isNullOrUndefined(this.exportProperties.pdfMargins.top)?s.top:this.exportProperties.pdfMargins.top,s.bottom=t.isNullOrUndefined(this.exportProperties.pdfMargins.bottom)?s.bottom:this.exportProperties.pdfMargins.bottom,s.left=t.isNullOrUndefined(this.exportProperties.pdfMargins.left)?s.left:this.exportProperties.pdfMargins.left,s.right=t.isNullOrUndefined(this.exportProperties.pdfMargins.right)?s.right:this.exportProperties.pdfMargins.right}r.setPageSettings(e.document.pageSettings);var l=r.pages.add();return t.isNullOrUndefined(i)||t.isNullOrUndefined(i.header)||this.pdfExportHelper.drawHeader(i,e.document),t.isNullOrUndefined(i)||t.isNullOrUndefined(i.footer)||this.pdfExportHelper.drawFooter(i,e.document),l},e.prototype.getFontStyle=function(e){var i=a.PdfFontStyle.Regular;return!t.isNullOrUndefined(e)&&e.bold&&(i|=a.PdfFontStyle.Bold),!t.isNullOrUndefined(e)&&e.italic&&(i|=a.PdfFontStyle.Italic),!t.isNullOrUndefined(e)&&e.underline&&(i|=a.PdfFontStyle.Underline),!t.isNullOrUndefined(e)&&e.strikeout&&(i|=a.PdfFontStyle.Strikeout),i},e.prototype.getBorderStyle=function(e){var i=new a.PdfBorders;if(t.isNullOrUndefined(e)){var r=new a.PdfColor(234,234,234);i.all=new a.PdfPen(r)}else{var n=e.width,o=t.isNullOrUndefined(n)||"number"!=typeof n?void 0:.75*n,s=new a.PdfColor(196,196,196);if(!t.isNullOrUndefined(e.color)){var l=this.pdfExportHelper.hexDecToRgb(e.color);s=new a.PdfColor(l.r,l.g,l.b)}var d=new a.PdfPen(s,o);t.isNullOrUndefined(e.dashStyle)||(d.dashStyle=this.pdfExportHelper.getDashStyle(e.dashStyle)),i.all=d}return i},e.prototype.getStyle=function(){var e=new a.PdfBorders;if(t.isNullOrUndefined(this.gridStyle))return{brush:new a.PdfSolidBrush(new a.PdfColor),border:e,font:void 0};var i=t.isNullOrUndefined(this.gridStyle.header.fontName)?a.PdfFontFamily.Helvetica:this.getFontFamily(this.gridStyle.header.fontName),r=this.getFontStyle(this.gridStyle.header),n=t.isNullOrUndefined(this.gridStyle.header.fontSize)?10.5:this.gridStyle.header.fontSize,o=new a.PdfColor;if(!t.isNullOrUndefined(this.gridStyle.header.fontColor)){var s=this.pdfExportHelper.hexDecToRgb(this.gridStyle.header.fontColor);o=new a.PdfColor(s.r,s.g,s.b)}var l=new a.PdfStandardFont(i,n,r);return t.isNullOrUndefined(this.gridStyle.header.font)||(l=this.gridStyle.header.font),{border:this.getBorderStyle(this.gridStyle.header.border),font:l,brush:new a.PdfSolidBrush(o)}},e.prototype.setRecordThemeStyle=function(e,i){if(!t.isNullOrUndefined(this.gridStyle)&&!t.isNullOrUndefined(this.gridStyle.record)){var r=t.isNullOrUndefined(this.gridStyle.record.fontName)?a.PdfFontFamily.Helvetica:this.getFontFamily(this.gridStyle.record.fontName),n=t.isNullOrUndefined(this.gridStyle.record.fontSize)?9.75:this.gridStyle.record.fontSize,o=this.getFontStyle(this.gridStyle.record),s=new a.PdfStandardFont(r,n,o);t.isNullOrUndefined(this.gridStyle.record.font)||(s=this.gridStyle.record.font),e.style.setFont(s);var l=new a.PdfColor;if(!t.isNullOrUndefined(this.gridStyle.record.fontColor)){var d=this.pdfExportHelper.hexDecToRgb(this.gridStyle.record.fontColor);l=new a.PdfColor(d.r,d.g,d.b)}e.style.setTextBrush(new a.PdfSolidBrush(l))}var p=this.gridStyle&&this.gridStyle.record&&this.gridStyle.record.border?this.getBorderStyle(this.gridStyle.record.border):i;return e.style.setBorder(p),e},e.prototype.exportToPDF=function(e,i,r,n){var o=this;this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,this.gridStyle=t.isNullOrUndefined(this.exportProperties.pdfExportProperties)?void 0:this.exportProperties.pdfExportProperties.theme;var s=this.applyEvent();t.isNullOrUndefined(r)||(s.document=r);var l=this.getStyle(),d=t.isNullOrUndefined(this.exportProperties)||t.isNullOrUndefined(this.exportProperties.fileName)?t.isNullOrUndefined(e)||t.isNullOrUndefined(e.fileName)?"default":e.fileName:this.exportProperties.fileName,p=100+20*(this.parent.renderModule.maxIndent?this.parent.renderModule.maxIndent:5),h=Math.floor((540-p)/90)+1,u=0,c=s.args.pivotValues[u];(this.exportProperties.columnSize||this.exportProperties.width||this.exportProperties.height)&&(h=this.exportProperties.columnSize>0?this.exportProperties.columnSize:c[0].length),this.exportProperties.allowRepeatHeader=!0===this.exportProperties.allowRepeatHeader||t.isNullOrUndefined(this.exportProperties.allowRepeatHeader);for(var g=!!this.exportProperties.allowRepeatHeader&&this.exportProperties.allowRepeatHeader,m=0;g&&h>1&&m<c.length;m++)for(var f=h;c[m]&&f<c[m].length;f+=h)c[m].splice(f,0,c[m][0]);var v=c&&c.length>0?c[0].length:0,S=0;do{t.isNullOrUndefined(e)||(this.exportProperties.header=t.isNullOrUndefined(e.header)||t.isNullOrUndefined(e.header.contents)||t.isNullOrUndefined(e.header.contents[0].value)?this.exportProperties.header:e.header.contents[0].value,this.exportProperties.footer=t.isNullOrUndefined(e.footer)||t.isNullOrUndefined(e.footer.contents)||t.isNullOrUndefined(e.footer.contents[0].value)?this.exportProperties.footer:e.footer.contents[0].value);var y=this.addPage(s,e),b=new a.PdfGrid,C=h>0?h:5;if(c&&c.length>0){b.columns.add(c[0].length-S>=C?C:c[0].length-S);for(var x=c.length,w=0,T=0,M=0,D=0;D<x;D++)if(c[D]){var O=!(c[D][0]&&"row"===c[D][0].axis),P=c[D].length>S+C?S+C:c[D].length;O&&b.headers.add(1);var N=O?b.headers.getHeader(w):b.rows.addRow();O?(N.style.setBorder(l.border),l.font&&N.style.setFont(l.font),N.style.setTextBrush(l.brush)):this.setRecordThemeStyle(N,l.border);for(var E=0,F=!0,I=S;I<P;I++){var L=!1;if(c[D][I]){var A=(k=c[D][I]).formattedText;A=0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length?this.parent.getValuesHeader(k,"value"):A,A="grand sum"===k.type?0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length?this.parent.getValuesHeader(k,"grandTotal"):this.parent.localeObj.getConstant("grandTotal"):"sum"===k.type?A.toString().replace("Total",this.parent.localeObj.getConstant("total")):A,(-1!==k.level||k.rowSpan)&&((-1!==k.level||k.rowSpan)&&(N.cells.getCell(E).columnSpan=k.colSpan?C-E<k.colSpan?C-E:k.colSpan:1,O&&k.rowSpan&&k.rowSpan>1&&(N.cells.getCell(E).rowSpan=k.rowSpan?k.rowSpan:1),N.cells.getCell(E).value=A?A.toString():""),""!==A&&(F=!1)),T=k.level>T?k.level:T,L="value"===k.axis,I+=N.cells.getCell(E).columnSpan?N.cells.getCell(E).columnSpan-1:0,E+=N.cells.getCell(E).columnSpan?N.cells.getCell(E).columnSpan-1:0,k.style&&(N=this.applyStyle(N,k,E));R={style:void 0,pivotCell:k,cell:N.cells.getCell(E),column:b.columns.getColumn(E)};this.parent.trigger("onPdfCellRender",R),"column"===k.axis?(R={style:R.style,cell:R.cell,gridCell:R.pivotCell},this.parent.trigger("pdfHeaderQueryCellInfo",R),N.cells.getCell(E).value=R.gridCell.formattedText?R.gridCell.formattedText:A):(R={style:R.style,cell:R.cell,column:void 0,data:R.pivotCell,value:A},this.parent.trigger("pdfQueryCellInfo",R),N.cells.getCell(E).value=R.value?R.value:A),R.style&&this.processCellStyle(N.cells.getCell(E),R)}else{var R={style:void 0,pivotCell:void 0,cell:N.cells.getCell(E),column:b.columns.getColumn(E)};this.parent.trigger("onPdfCellRender",R),M=R.column.width;var k={formattedText:""};"column"===k.axis&&(R={style:R.style,cell:R.cell,gridCell:R.pivotCell},this.parent.trigger("pdfHeaderQueryCellInfo",R)),R.style&&this.processCellStyle(N.cells.getCell(E),R),N.cells.getCell(E).value="",0===I&&O&&this.parent.dataSourceSettings.columns&&this.parent.dataSourceSettings.columns.length>0?b.headers.getHeader(0).cells.getCell(0).rowSpan++:0!==I&&O&&this.parent.dataSourceSettings.columns&&this.parent.dataSourceSettings.columns.length>0&&b.headers.getHeader(0).cells.getCell(0).rowSpan<Object.keys(this.engine.headerContent).length&&b.headers.getHeader(0).cells.getCell(0).rowSpan++}var j=new a.PdfStringFormat;if("olap"===this.parent.dataType){var q=!O&&0===E&&c[D][I]?this.parent.renderModule.indentCollection[c[D][I].rowIndex]:0;j.paragraphIndent=15*q,T=T>q?T:q}else if(j.paragraphIndent=0,!O&&0===E&&c[D][I]&&-1!==c[D][I].level){var H=c[D][I],V=H.valueSort?H.valueSort.levelName.toString():"",U=H.actualText?H.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,_=V.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(U?U-1:U),B=_?_-1:0;j.paragraphIndent=10*B}j.alignment=L?a.PdfTextAlignment.Right:a.PdfTextAlignment.Left,j.lineAlignment=a.PdfVerticalAlignment.Middle,N.cells.getCell(E).style.stringFormat=j,E++}F&&(N.height=16),w++}b.columns.getColumn(0).width=M>0?M:100+20*T}0===S&&this.parent.dataSourceSettings.columns&&this.parent.dataSourceSettings.columns.length>0&&b.headers.getHeader(0).cells.getCell(0).rowSpan--,b.draw(y,new a.PointF(10,20)),(S+=C)>=v&&s.args.pivotValues.length>u+1&&(u++,v=(c=s.args.pivotValues[u])&&c.length>0?c[0].length:0,S=0)}while(S<v);return new Promise(function(e){var t;n||i?n&&(t=s.document.save()):(s.document.save(d+".pdf"),s.document.destroy());var a={type:"PDF",promise:n?t:null};o.parent.trigger("exportComplete",a),e(s.document)})},e.prototype.applyStyle=function(e,t,i){var r=this.parent.conditionalFormattingModule.hexToRgb(t.style.backgroundColor),n=new a.PdfSolidBrush(new a.PdfColor(r.r,r.g,r.b));e.cells.getCell(i).style.backgroundBrush=n;var o=Number(t.style.fontSize.split("px")[0]),s=new a.PdfStandardFont(a.PdfFontFamily.TimesRoman,o,a.PdfFontStyle.Regular);return e.cells.getCell(i).style.font=s,r=this.parent.conditionalFormattingModule.hexToRgb(t.style.color),n=new a.PdfSolidBrush(new a.PdfColor(r.r,r.g,r.b)),e.cells.getCell(i).style.textBrush=n,e},e.prototype.getFontFamily=function(e){switch(e){case"TimesRoman":return 2;case"Courier":return 1;case"Symbol":return 3;case"ZapfDingbats":return 4;default:return 0}},e.prototype.getFont=function(e){if(e.style.font)return e.style.font;var i=e.cell.cellStyle.font&&e.cell.cellStyle.font.fontSize?e.cell.cellStyle.font.fontSize:t.isNullOrUndefined(e.style.fontSize)?9.75:.75*e.style.fontSize,r=t.isNullOrUndefined(e.style.fontFamily)?a.PdfFontFamily.TimesRoman:this.getFontFamily(e.style.fontFamily),n=a.PdfFontStyle.Regular;return!t.isNullOrUndefined(e.style.bold)&&e.style.bold&&(n|=a.PdfFontStyle.Bold),!t.isNullOrUndefined(e.style.italic)&&e.style.italic&&(n|=a.PdfFontStyle.Italic),!t.isNullOrUndefined(e.style.underline)&&e.style.underline&&(n|=a.PdfFontStyle.Underline),!t.isNullOrUndefined(e.style.strikeout)&&e.style.strikeout&&(n|=a.PdfFontStyle.Strikeout),new a.PdfStandardFont(r,i,n)},e.prototype.processCellStyle=function(e,i){if(!t.isNullOrUndefined(i.style.backgroundColor)){var r=this.pdfExportHelper.hexDecToRgb(i.style.backgroundColor);e.style.backgroundBrush=new a.PdfSolidBrush(new a.PdfColor(r.r,r.g,r.b))}if(!t.isNullOrUndefined(i.style.textBrushColor)){var n=this.pdfExportHelper.hexDecToRgb(i.style.textBrushColor);e.style.textBrush=new a.PdfSolidBrush(new a.PdfColor(n.r,n.g,n.b))}if(!t.isNullOrUndefined(i.style.textPenColor)){var o=this.pdfExportHelper.hexDecToRgb(i.style.textPenColor);e.style.textPen=new a.PdfPen(new a.PdfColor(o.r,o.g,o.b))}if(t.isNullOrUndefined(i.style.fontFamily)&&t.isNullOrUndefined(i.style.fontSize)&&t.isNullOrUndefined(i.style.bold)&&t.isNullOrUndefined(i.style.italic)&&t.isNullOrUndefined(i.style.underline)&&t.isNullOrUndefined(i.style.strikeout)||(e.style.font=this.getFont(i)),!t.isNullOrUndefined(i.style.border)){var s=new a.PdfBorders,l=i.style.border.width,d=t.isNullOrUndefined(l)||"number"!=typeof l?void 0:.75*l,p=new a.PdfColor(196,196,196);if(!t.isNullOrUndefined(i.style.border.color)){var h=this.pdfExportHelper.hexDecToRgb(i.style.border.color);p=new a.PdfColor(h.r,h.g,h.b)}var u=new a.PdfPen(p,d);t.isNullOrUndefined(i.style.border.dashStyle)||(u.dashStyle=this.pdfExportHelper.getDashStyle(i.style.border.dashStyle)),s.all=u,e.style.borders=s}},e.prototype.applyEvent=function(){var e,t,i=jt.getClonedPivotValues(this.engine.pivotValues);if(this.parent.exportAllPages&&(this.parent.enableVirtualization||this.parent.enablePaging)&&"Server"!==this.parent.dataSourceSettings.mode){var r=this.engine.pageSettings;this.engine.isPagingOrVirtualizationEnabled=!1,"olap"===this.parent.dataType?(this.updateOlapPageSettings(!0),t=this.parent.olapEngineModule.mdxQuery.slice(0)):this.engine.pageSettings=null,this.engine.generateGridData(this.parent.dataSourceSettings,!0,!0),this.parent.applyFormatting(this.engine.pivotValues),e=jt.getClonedPivotValues(this.engine.pivotValues),this.engine.pivotValues=i,this.engine.pageSettings=r,this.engine.isPagingOrVirtualizationEnabled=!0,"olap"===this.parent.dataType&&(this.updateOlapPageSettings(!1),this.parent.olapEngineModule.mdxQuery=t)}else e=i;var n={pivotValues:[e]};return this.parent.trigger("enginePopulated",n),this.document=new a.PdfDocument,{document:this.document,args:n}},e.prototype.updateOlapPageSettings=function(e){this.parent.olapEngineModule.isExporting=!!e,this.parent.exportSpecifiedPages?this.parent.olapEngineModule.exportSpeciedPages=this.parent.exportSpecifiedPages=e?this.parent.exportSpecifiedPages:void 0:(this.parent.olapEngineModule.pageSettings=e?null:this.parent.olapEngineModule.pageSettings,this.parent.olapEngineModule.isPaging=!e)},e.prototype.destroy=function(){this.engine&&(this.engine=null),this.exportProperties&&(this.exportProperties=null),this.document&&(this.document=null),this.pdfExportHelper&&(this.pdfExportHelper=null)},e}(),Vt=function(){function e(e){this.parent=e,this.parent.pagerModule=this,this.addEventListener()}return e.prototype.getModuleName=function(){return"pager"},e.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on("init-pivotPager",this.createPager,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(t.isNullOrUndefined(this.parent.pagerSettings.template)&&this.unWireEvent(),this.parent.off("init-pivotPager",this.createPager))},e.prototype.createPager=function(){null!==t.select("#"+this.parent.element.id+"pivot-pager",this.parent.element)&&(t.remove(t.select("#"+this.parent.element.id+"pivot-pager",this.parent.element)),this.destroy(),this.addEventListener());var e=this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber(),i=this.parent.pagerSettings;if(this.parent.enablePaging){var a=t.createElement("div",{id:this.parent.element.id+"pivot-pager",className:"e-pivot-pager "+(this.parent.isAdaptive||e<650?O:"")+" "+(this.parent.enableRtl?D:"")+" "+("Top"===this.parent.pagerSettings.position?" e-pivot-pager-top":" e-pivot-pager-bottom")+" "+(i.enableCompactView||e<400?"e-compact-view":""),styles:"width:"+(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())+"px"});this.parent.showFieldList&&t.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)&&"Top"===i.position?this.parent.element.insertBefore(a,t.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)):this.parent.showGroupingBar&&t.select("#"+this.parent.element.id+" .e-pivot-grouping-bar",this.parent.element)&&"Top"===i.position?this.parent.element.insertBefore(a,t.select("#"+this.parent.element.id+" .e-pivot-grouping-bar",this.parent.element)):"Top"===this.parent.pagerSettings.position?this.parent.element.insertBefore(a,t.select("#"+this.parent.element.id+"_grid",this.parent.element)):this.parent.element.append(a);var r=this,o=function(){return r.createPagerContainer()};if(this.pager=new n.Pager({enableRtl:this.parent.enableRtl,locale:this.parent.locale,template:""===i.template||i.template?i.template:t.initializeCSPTemplate(o),cssClass:this.parent.cssClass}),this.pager.isVue=this.parent.isVue,this.pager.appendTo(a),t.isNullOrUndefined(i.template)){if(i.showRowPager&&(!i.enableCompactView&&e>400&&new s.NumericTextBox({min:1,max:this.parent.engineModule.rowPageCount,showSpinButton:!1,format:"#",validateDecimalOnType:!0,decimals:0,strictMode:!0,value:this.parent.pageSettings.currentRowPage,enableRtl:this.parent.enableRtl,locale:this.parent.locale,width:e<669?"50px":"64px",change:this.rowPageChange.bind(this),cssClass:this.parent.cssClass}).appendTo(t.select("#"+this.parent.element.id+"_row_textbox",this.parent.element)),i.showRowPageSize)){var d=this.parent.pagerSettings.rowPageSizes.slice(0);-1===this.parent.pagerSettings.rowPageSizes.indexOf(this.parent.pageSettings.rowPageSize)&&(d.push(this.parent.pageSettings.rowPageSize),d.sort(function(e,t){return e-t})),new l.DropDownList({dataSource:d,value:this.parent.pageSettings.rowPageSize,enableRtl:this.parent.enableRtl,locale:this.parent.locale,change:this.rowPageSizeChange.bind(this),popupHeight:"300px",popupWidth:"100%",width:"64px",cssClass:this.parent.cssClass}).appendTo(t.select("#"+this.parent.element.id+"_row_size_list",this.parent.element))}if(i.showColumnPager&&(!i.enableCompactView&&e>400&&new s.NumericTextBox({min:1,max:this.parent.engineModule.columnPageCount,showSpinButton:!1,format:"#",validateDecimalOnType:!0,decimals:0,strictMode:!0,value:this.parent.pageSettings.currentColumnPage,enableRtl:this.parent.enableRtl,locale:this.parent.locale,width:e<669?"50px":"64px",change:this.columnPageChange.bind(this),cssClass:this.parent.cssClass}).appendTo(t.select("#"+this.parent.element.id+"_column_textbox",this.parent.element)),i.showColumnPageSize)){var p=this.parent.pagerSettings.columnPageSizes.slice(0);-1===this.parent.pagerSettings.columnPageSizes.indexOf(this.parent.pageSettings.columnPageSize)&&(p.push(this.parent.pageSettings.columnPageSize),p.sort(function(e,t){return e-t})),new l.DropDownList({dataSource:p,value:this.parent.pageSettings.columnPageSize,enableRtl:this.parent.enableRtl,locale:this.parent.locale,change:this.columnPageSizeChange.bind(this),popupHeight:"300px",popupWidth:"100%",width:"64px",cssClass:this.parent.cssClass}).appendTo(t.select("#"+this.parent.element.id+"_column_size_list",this.parent.element))}this.unWireEvent(),this.wireEvent()}}},e.prototype.wireEvent=function(){for(var e=[].slice.call(this.parent.element.querySelectorAll(".e-icon-first, .e-icon-prev, .e-icon-next, .e-icon-last")),i=0;i<e.length;i++)t.EventHandler.add(e[i],"click",this.updatePageSettings,this)},e.prototype.unWireEvent=function(){for(var e=[].slice.call(this.parent.element.querySelectorAll(".e-icon-first, .e-icon-prev, .e-icon-next, .e-icon-last")),i=0;i<e.length;i++)t.EventHandler.remove(e[i],"click",this.updatePageSettings)},e.prototype.columnPageChange=function(e){this.parent.pageSettings.currentColumnPage=e.value},e.prototype.rowPageChange=function(e){this.parent.pageSettings.currentRowPage=e.value},e.prototype.columnPageSizeChange=function(e){this.parent.pageSettings.columnPageSize=Number(e.value)},e.prototype.rowPageSizeChange=function(e){this.parent.pageSettings.rowPageSize=Number(e.value)},e.prototype.updatePageSettings=function(e){var t=e.target.id;switch(t){case this.parent.element.id+"_row_firstIcon":this.parent.pageSettings.currentRowPage=1;break;case this.parent.element.id+"_row_prevIcon":this.parent.pageSettings.currentRowPage=this.parent.pageSettings.currentRowPage>1?this.parent.pageSettings.currentRowPage-1:this.parent.pageSettings.currentRowPage;break;case this.parent.element.id+"_row_nextIcon":this.parent.pageSettings.currentRowPage=this.parent.pageSettings.currentRowPage<this.parent.engineModule.rowPageCount?this.parent.pageSettings.currentRowPage+1:this.parent.pageSettings.currentRowPage;break;case this.parent.element.id+"_row_lastIcon":this.parent.pageSettings.currentRowPage=this.parent.engineModule.rowPageCount;break;case this.parent.element.id+"_column_firstIcon":this.parent.pageSettings.currentColumnPage=1;break;case this.parent.element.id+"_column_prevIcon":this.parent.pageSettings.currentColumnPage=this.parent.pageSettings.currentColumnPage>1?this.parent.pageSettings.currentColumnPage-1:this.parent.pageSettings.currentColumnPage;break;case this.parent.element.id+"_column_nextIcon":this.parent.pageSettings.currentColumnPage=this.parent.pageSettings.currentColumnPage<this.parent.engineModule.columnPageCount?this.parent.pageSettings.currentColumnPage+1:this.parent.pageSettings.currentColumnPage;break;case this.parent.element.id+"_column_lastIcon":this.parent.pageSettings.currentColumnPage=this.parent.engineModule.columnPageCount}-1!==t.indexOf("_row")?this.parent.actionObj.actionName="Navigate row page":-1!==t.indexOf("_column")&&(this.parent.actionObj.actionName="Navigate column page")},e.prototype.createPagerContainer=function(){var e,i,a=this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber(),r=this.parent.pagerSettings;r.showRowPager&&(e=this.createPagerItems("row",r,a)),r.showColumnPager&&(i=this.createPagerItems("column",r,a));var n=t.createElement("div",{id:this.parent.element.id+"_mainDiv",className:"e-pivot-pager-maindiv "+(r.showRowPager&&r.showColumnPager?"":"e-pivot-pager-single-maindiv")+" "+(r.isInversed?"e-inverse-view":"")}),o=t.createElement("div",{id:this.parent.element.id+"_vertical_separator",className:this.parent.isAdaptive||a<650?"e-pivotview-hseparator":"e-pivotview-vseparator"});return r.isInversed&&r.showColumnPager&&r.showRowPager?n.append(i,o,e):r.showColumnPager&&r.showRowPager?n.append(e,o,i):r.showRowPager&&!r.showColumnPager?n.append(e):!r.showRowPager&&r.showColumnPager&&n.append(i),n.outerHTML},e.prototype.createPagerItems=function(e,i,a){var r=!i.showRowPager||!i.showColumnPager,n=t.createElement("div",{id:this.parent.element.id+"_"+e+"_mainDiv",className:"row"===e?"e-pivot-pager-row-maindiv "+(i.showRowPageSize?"":"e-page-size-disable"):"e-pivot-pager-column-maindiv "+(i.showColumnPageSize?"":"e-page-size-disable")}),o=t.createElement("div",{id:this.parent.element.id+"_"+e+"_pagerSettings",className:"row"===e?"e-pivot-row-pager-settings":"e-pivot-column-pager-settings"});this.parent.pagerSettings.showColumnPager&&this.parent.pagerSettings.showRowPager&&o.classList.add("e-pivot-both-pager-settings");var s="column"===e&&1===this.parent.pageSettings.currentColumnPage||"row"===e&&1===this.parent.pageSettings.currentRowPage,l="column"===e&&this.parent.pageSettings.currentColumnPage===this.parent.engineModule.columnPageCount||"row"===e&&this.parent.pageSettings.currentRowPage===this.parent.engineModule.rowPageCount,d=t.createElement("div",{id:this.parent.element.id+"_"+e+"_NavContainer",attrs:{class:"e-pivot-pager-nav-container e-pagercontainer"}}),p=t.createElement("div",{id:this.parent.element.id+"_"+e+"_PageInfoContainer",attrs:{class:"e-pivot-pager-info-container e-pagercontainer"}}),h=t.createElement("div",{id:this.parent.element.id+"_"+e+"_firstIcon",attrs:{class:"e-first e-icons e-icon-first"+(s?" e-firstpagedisabled e-disable":" e-firstpage e-pager-default"),title:this.parent.localeObj.getConstant("goToFirstPage"),"aria-label":this.parent.localeObj.getConstant("goToFirstPage"),tabindex:"0",role:"button"}}),u=t.createElement("div",{id:this.parent.element.id+"_"+e+"_prevIcon",attrs:{class:"e-prev e-icons e-icon-prev"+(s?" e-prevpagedisabled e-disable":" e-prevpage e-pager-default"),title:this.parent.localeObj.getConstant("goToPreviousPage"),"aria-label":this.parent.localeObj.getConstant("goToPreviousPage"),tabindex:"0",role:"button"}}),c=t.createElement("span",{id:this.parent.element.id+"_"+e+"_pagerString",className:"row"===e?"e-pivotview-row-pagerString":"e-pivotview-column-pagerString"});c.innerText="row"===e?this.parent.localeObj.getConstant("rowPage"):this.parent.localeObj.getConstant("columnPage");var g=t.createElement("input",{id:this.parent.element.id+"_"+e+"_textbox",className:"row"===e?"e-pivot-pager-row-dropdown":"e-pivot-pager-column-dropdown",attrs:{placeholder:"1"}}),m=t.createElement("div",{id:this.parent.element.id+"_"+e+"_of_string_mainDiv",className:"row"===e?"e-pivot-row-of-string-maindiv":"e-pivot-column-of-string-maindiv"}),f=t.createElement("span",{id:this.parent.element.id+"_"+e+"_ofString",className:"row"===e?"e-pivot-row-of-string":"e-pivot-column-of-string"});f.innerText=this.parent.localeObj.getConstant("of")+" ";var v=t.createElement("span",{id:this.parent.element.id+"_"+e+"_pagerNumber",className:"row"===e?"e-pivotview-row-pagerNumber":"e-pivotview-column-pagerNumber"});v.innerText=("row"===e?this.parent.engineModule.rowPageCount:this.parent.engineModule.columnPageCount).toString();var S=t.createElement("div",{id:this.parent.element.id+"_"+e+"_nextIcon",attrs:{class:"e-next e-icons e-icon-next"+(l?" e-nextpagedisabled e-disable":" e-nextpage e-pager-default"),title:this.parent.localeObj.getConstant("goToNextPage"),"aria-label":this.parent.localeObj.getConstant("goToNextPage"),tabindex:"0",role:"button"}}),y=t.createElement("div",{id:this.parent.element.id+"_"+e+"_lastIcon",attrs:{class:"e-last e-icons e-icon-last"+(l?" e-lastpagedisabled e-disable":" e-lastpage e-pager-default"),title:this.parent.localeObj.getConstant("goToLastPage"),"aria-label":this.parent.localeObj.getConstant("goToLastPage"),tabindex:"0",role:"button"}}),b=t.createElement("span",{id:this.parent.element.id+"_"+e+"_size",className:"row"===e?"e-pivotview-row-size":"e-pivotview-column-size"});b.innerText="row"===e?this.parent.localeObj.getConstant("rowPerPage"):this.parent.localeObj.getConstant("columnPerPage");var C=t.createElement("div",{id:this.parent.element.id+"_"+e+"_size_list_maindiv",className:"e-pager-dropdown e-pagercontainer"}),x=t.createElement("div",{id:this.parent.element.id+"_"+e+"_size_list",className:"row"===e?"e-pivot-row-size-list":"e-pivot-column-size-list"}),w=t.createElement("div",{id:this.parent.element.id+"_"+e+"_text_div",className:"e-pivotview-text-div"}),T=t.createElement("div",{id:this.parent.element.id+"_"+e+"_text_div_1",className:"e-pivotview-text-div-1"});return C.append(x),i.enableCompactView||a<400?(d.append(u,S),o.append(d)):(m.append(f,v),d.append(h,u,S,y),p.append(g,m),o.append(d,p)),("row"===e&&i.showRowPager||"column"===e&&i.showColumnPager)&&(("column"===e&&!i.showRowPager||"row"===e&&!i.showColumnPager)&&r&&T.append(b,C),i.showColumnPager&&i.showRowPager||!r?("row"===e&&i.showRowPageSize||"column"===e&&i.showColumnPageSize?!i.enableCompactView&&a>400?(w.append(c,b),T.append(o,C)):(w.append(c,o),T.append(b,C)):("row"===e&&!i.showRowPageSize||"column"===e&&!i.showColumnPageSize)&&(w.append(c),T.append(o)),n.append(w,T)):("row"===e&&(i.showRowPageSize?n.append(o,c,T):n.append(o,c)),"column"===e&&(i.showColumnPageSize?n.append(o,c,T):n.append(o,c)))),n},e.prototype.destroy=function(){if(this.removeEventListener(),this.parent.pagerModule){var e=t.select("#"+this.parent.element.id+"_column_textbox",this.parent.element),i=e?t.getInstance(e,s.NumericTextBox):null;i&&(i.destroy(),i=null);var a=(e=t.select("#"+this.parent.element.id+"_row_textbox",this.parent.element))?t.getInstance(e,s.NumericTextBox):null;a&&(a.destroy(),a=null);var r=(e=t.select("#"+this.parent.element.id+"_column_size_list",this.parent.element))?t.getInstance(e,l.DropDownList):null;r&&(r.destroy(),r=null);var n=(e=t.select("#"+this.parent.element.id+"_row_size_list",this.parent.element))?t.getInstance(e,l.DropDownList):null;n&&(n.destroy(),n=null),this.pager&&this.pager.destroy(),this.pager=null}},e}(),Ut=function(){function e(e){this.parent=e}return e.prototype.render=function(){var e=t.createElement("div",{id:this.parent.element.id+"_Container",className:N+" "+("olap"===this.parent.dataType?"e-olapfieldlist-container":""),styles:"width:"+this.parent.element.style.width});this.parent.isAdaptive?t.addClass([e],O):t.removeClass([e],O),this.parent.enableRtl?t.addClass([e],D):t.removeClass([e],D),this.parent.cssClass&&t.addClass([e],this.parent.cssClass.split(" ")),this.parent.enableFieldSearching?t.addClass([e],"e-search-mode"):t.removeClass([e],"e-search-mode"),this.parentElement=t.createElement("div",{className:"e-field-list-container"}),this.parent.element.appendChild(e),this.parent.isAdaptive&&(e.removeAttribute("style"),this.parentElement=t.createElement("div",{className:"e-adaptive-container"}),this.renderAdaptiveLayout(e)),"Popup"===this.parent.renderMode?(this.renderFieldListDialog(e),this.unWireDialogEvent(this.parent.element.querySelector(".e-toggle-field-list")),this.wireDialogEvent(this.parent.element.querySelector(".e-toggle-field-list"))):this.renderStaticLayout(e)},e.prototype.renderStaticLayout=function(e){if(!this.parent.isAdaptive){var i=t.createElement("div",{className:"e-field-list-title"}),a=t.createElement("div",{className:"e-title-content"});a.innerText=this.parent.localeObj.getConstant("staticFieldList"),i.appendChild(a),i.appendChild(this.createCalculatedButton()),t.addClass([e],"e-static"),e.appendChild(i),e.appendChild(this.parentElement),t.addClass([e],"e-static"),this.parent.allowDeferLayoutUpdate&&(e.appendChild(this.createDeferUpdateButtons()),this.renderDeferUpdateButtons(e))}},e.prototype.renderDeferUpdateButtons=function(e){this.parent.allowDeferLayoutUpdate&&(this.deferUpdateCheckBox=new h.CheckBox({label:this.parent.localeObj.getConstant("deferLayoutUpdate"),checked:this.parent.isPopupView&&this.parent.pivotGridModule?!!t.isNullOrUndefined(this.parent.pivotGridModule.pivotDeferLayoutUpdate)||this.parent.pivotGridModule.pivotDeferLayoutUpdate:!!t.isNullOrUndefined(this.parent.isDeferLayoutUpdate)||this.parent.isDeferLayoutUpdate,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,locale:this.parent.locale,change:this.onCheckChange.bind(this),cssClass:this.parent.cssClass}),this.deferUpdateCheckBox.isStringTemplate=!0,this.deferUpdateCheckBox.appendTo(t.select("#"+this.parent.element.id+"DeferUpdateCheckBox",e)),this.deferUpdateApplyButton=new h.Button({cssClass:"e-defer-apply-button e-defer-update-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("apply"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,isPrimary:!0,disabled:this.parent.isPopupView&&this.parent.pivotGridModule?!t.isNullOrUndefined(this.parent.pivotGridModule.pivotDeferLayoutUpdate)&&!this.parent.pivotGridModule.pivotDeferLayoutUpdate:!t.isNullOrUndefined(this.parent.isDeferLayoutUpdate)&&!this.parent.isDeferLayoutUpdate}),this.deferUpdateApplyButton.isStringTemplate=!0,this.deferUpdateApplyButton.appendTo(t.select("#"+this.parent.element.id+"_DeferUpdateButton1",e)),this.deferUpdateApplyButton.element.onclick="Fixed"===this.parent.renderMode?this.applyButtonClick.bind(this):this.onDeferUpdateClick.bind(this)),this.deferUpdateCancelButton=new h.Button({cssClass:"e-defer-cancel-button e-cancel-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.allowDeferLayoutUpdate?this.parent.localeObj.getConstant("cancel"):this.parent.localeObj.getConstant("close"),enableRtl:this.parent.enableRtl,isPrimary:!this.parent.allowDeferLayoutUpdate,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,disabled:this.parent.isPopupView&&this.parent.pivotGridModule&&this.parent.pivotGridModule.refreshing?!(!this.parent.allowDeferLayoutUpdate||t.isNullOrUndefined(this.parent.pivotGridModule.pivotDeferLayoutUpdate))&&!this.parent.pivotGridModule.pivotDeferLayoutUpdate:!(!this.parent.refreshing||t.isNullOrUndefined(this.parent.isDeferLayoutUpdate)||!this.parent.allowDeferLayoutUpdate)&&!this.parent.isDeferLayoutUpdate}),this.deferUpdateCancelButton.isStringTemplate=!0,this.deferUpdateCancelButton.appendTo(t.select("#"+this.parent.element.id+"_DeferUpdateButton2",e)),this.parent.allowDeferLayoutUpdate&&(!this.parent.isDeferLayoutUpdate&&"Popup"===this.parent.renderMode&&this.parent.refreshing||this.parent.isPopupView&&this.parent.pivotGridModule&&!this.parent.pivotGridModule.pivotDeferLayoutUpdate&&this.parent.pivotGridModule.refreshing)&&(this.deferUpdateApplyButton.element.style.display="none",this.deferUpdateCancelButton.setProperties({content:this.parent.localeObj.getConstant("close")}),this.deferUpdateCancelButton.isPrimary=!0,this.deferUpdateApplyButton.disabled=this.parent.isPopupView?this.parent.pivotGridModule.pivotDeferLayoutUpdate:this.parent.isDeferLayoutUpdate,this.deferUpdateCancelButton.disabled=this.parent.isPopupView?this.parent.pivotGridModule.pivotDeferLayoutUpdate:this.parent.isDeferLayoutUpdate),this.deferUpdateCancelButton.element.onclick=this.onCloseFieldList.bind(this)},e.prototype.createDeferUpdateButtons=function(){var e=t.createElement("div",{className:"e-layout-footer"});if(this.parent.allowDeferLayoutUpdate){var i=t.createElement("div",{className:"e-checkbox-layout",attrs:{title:this.parent.localeObj.getConstant("deferLayoutUpdate")}}),a=t.createElement("input",{id:this.parent.element.id+"DeferUpdateCheckBox"});i.appendChild(a),e.appendChild(i)}var r=t.createElement("div",{className:"e-button-layout"});if(this.parent.allowDeferLayoutUpdate){var n=t.createElement("button",{id:this.parent.element.id+"_DeferUpdateButton1",attrs:{type:"button",title:this.parent.localeObj.getConstant("apply")}});r.appendChild(n)}var o=t.createElement("button",{id:this.parent.element.id+"_DeferUpdateButton2",attrs:{type:"button",title:this.parent.localeObj.getConstant("cancel")}});return r.appendChild(o),e.appendChild(r),e},e.prototype.onCheckChange=function(e){e.checked&&(this.parent.clonedDataSource=f.getClonedDataSourceSettings(this.parent.dataSourceSettings),"olap"===this.parent.dataType&&(this.parent.clonedFieldListData=f.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData)),this.parent.clonedFieldList=f.getClonedFieldList(this.parent.pivotFieldList)),this.parent.isDeferLayoutUpdate=e.checked,this.parent.isPopupView&&this.parent.pivotGridModule&&(this.parent.pivotGridModule.pivotDeferLayoutUpdate=e.checked),"Fixed"===this.parent.renderMode?(this.deferUpdateApplyButton.setProperties({disabled:!e.checked}),this.deferUpdateCancelButton.setProperties({disabled:!e.checked})):this.parent.allowDeferLayoutUpdate&&e.checked?(this.deferUpdateApplyButton.element.style.display="",this.deferUpdateCancelButton.setProperties({content:this.parent.localeObj.getConstant("cancel")}),this.deferUpdateCancelButton.isPrimary=!1):(this.deferUpdateApplyButton.element.style.display="none",this.deferUpdateCancelButton.setProperties({content:this.parent.localeObj.getConstant("close")}),this.deferUpdateCancelButton.isPrimary=!0),Object.keys(this.parent.clonedFieldList).length!==Object.keys(this.parent.pivotFieldList).length&&this.parent.calculatedFieldModule&&this.parent.calculatedFieldModule.field&&"pivot"===this.parent.dataType&&(this.parent.engineModule.fields=Object.keys(this.parent.clonedFieldList)),this.onCloseFieldList(null,!0)},e.prototype.applyButtonClick=function(){"pivotfieldlist"===this.parent.getModuleName()&&this.parent.allowDeferLayoutUpdate&&(this.parent.pivotChange=!1),this.parent.isDeferUpdateApplied=!0,this.parent.updateDataSource(!1);var e=this.parent;e.axisFieldModule.render(),e.clonedDataSource=f.getClonedDataSourceSettings(e.dataSourceSettings),"olap"===this.parent.dataType&&(this.parent.clonedFieldListData=f.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData)),e.clonedFieldList=f.getClonedFieldList(e.pivotFieldList)},e.prototype.onCloseFieldList=function(e,t){if((this.parent.allowDeferLayoutUpdate||t)&&(!this.parent.isPopupView||this.parent.pivotGridModule&&""!==this.parent.pivotGridModule.actionObj.actionName||""!==this.parent.actionObj.actionName)){if(this.parent.setProperties({dataSourceSettings:this.parent.clonedDataSource},!0),"olap"===this.parent.dataType)if(this.parent.olapEngineModule.fieldList=f.getClonedFieldList(this.parent.clonedFieldList),this.parent.olapEngineModule.fieldListData=f.cloneOlapFieldSettings(this.parent.clonedFieldListData),this.parent.isPopupView)this.parent.isPopupView&&this.parent.clonedFieldListData&&Object.keys(this.parent.clonedFieldListData).length>0&&(this.parent.olapEngineModule.fieldListData=this.parent.clonedFieldListData);else for(var i=0,a=Object.keys(this.parent.clonedFieldList);i<a.length;i++){var r=a[i],n=this.parent.clonedFieldList[r];this.parent.olapEngineModule.updateFieldlistData(n.id,n.isSelected)}else this.parent.engineModule.fieldList=f.getClonedFieldList(this.parent.clonedFieldList);this.parent.updateDataSource(!1,!0)}if((!this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!this.parent.pivotGridModule.pivotDeferLayoutUpdate)&&t&&(this.parent.pivotChange=!1),this.parent.allowDeferLayoutUpdate&&this.parent.isPopupView&&this.parent.pivotGridModule&&!this.parent.isAdaptive&&(this.parent.pivotGridModule.actionObj.actionName="",this.parent.pivotGridModule.engineModule=this.parent.engineModule,this.parent.pivotGridModule.olapEngineModule=this.parent.olapEngineModule,this.parent.pivotGridModule.setProperties({dataSourceSettings:this.parent.clonedDataSource},!0)),this.parent.allowDeferLayoutUpdate&&this.parent.allowCalculatedField&&"pivot"===this.parent.dataType&&!this.parent.isAdaptive){this.parent.engineModule.fieldList=this.parent.pivotFieldList=f.getClonedFieldList(this.parent.clonedFieldList);var o=Object.keys(this.parent.engineModule.fieldList);if(this.parent.allowCalculatedField&&o.length!==this.parent.engineModule.fields.length){var s=[];this.parent.engineModule.fields.forEach(function(e){-1!==o.indexOf(e)&&(s[s.length]=e)}),this.parent.engineModule.fields=s}}"Popup"!==this.parent.renderMode||t?this.parent.actionObj.actionName="Action dropped":(this.parent.dialogRenderer.fieldListDialog.hide(),this.parent.actionObj.actionName="Field list closed"),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()},e.prototype.renderFieldListDialog=function(e){var i=t.createElement("div",{className:"e-toggle-field-list e-icons e-select-table",attrs:{tabindex:"0",title:this.parent.localeObj.getConstant("fieldList"),"aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("fieldList"),role:"button"}});if(this.parent.element.appendChild(i),this.parent.isAdaptive){var a='<div class=e-title-mobile-header><span class="e-icons e-field-list-back-icon"></span><div class=e-title-mobile-content>'+this.parent.localeObj.getConstant("fieldList")+"</div></div>",n=[{click:this.showFieldListDialog.bind(this),isFlat:!1,buttonModel:{cssClass:"e-field-list-btn e-small e-round"+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:P+" e-add-icon",isPrimary:!0}},{click:this.showCalculatedField.bind(this),isFlat:!1,buttonModel:{cssClass:"e-calculated-field-btn e-small e-round e-disable"+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:P+" e-add-icon",enableRtl:this.parent.enableRtl,isPrimary:!0}}];this.fieldListDialog=new r.Dialog({animationSettings:{effect:this.parent.enableRtl?"SlideRight":"SlideLeft"},header:a,content:this.parentElement,isModal:!0,showCloseIcon:!1,visible:!1,allowDragging:!1,closeOnEscape:!1,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"100%",height:"100%",position:{X:"center",Y:"center"},buttons:n,target:document.body,cssClass:this.parent.cssClass,close:this.removeFieldListIcon.bind(this),open:this.dialogOpen.bind(this)}),this.fieldListDialog.isStringTemplate=!0,this.fieldListDialog.appendTo(e),t.setStyleAttribute(t.select("#"+e.id+"_dialog-content",e),{padding:"0"});var o=e.querySelector(".e-footer-content");t.addClass([o],"e-field-list-footer"),t.removeClass([o.querySelector(".e-calculated-field-btn")],"e-flat"),t.removeClass([o.querySelector(".e-field-list-btn")],"e-flat"),this.fieldListDialog.element.querySelector(".e-field-list-back-icon").onclick=this.parent.allowDeferLayoutUpdate?this.onDeferUpdateClick.bind(this):this.onCloseFieldList.bind(this)}else{var s=this.createDeferUpdateButtons().outerHTML,a="<div class=e-title-header><div class=e-title-content>"+this.parent.localeObj.getConstant("fieldList")+"</div></div>";this.fieldListDialog=new r.Dialog({animationSettings:{effect:"Zoom"},header:a,content:this.parentElement,isModal:!1,showCloseIcon:!1,visible:!1,allowDragging:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:this.parent.element.style.width,position:{X:"center",Y:this.parent.element.offsetTop},footerTemplate:s,closeOnEscape:!1,cssClass:this.parent.cssClass,target:t.isNullOrUndefined(this.parent.target)?document.body:"string"==typeof this.parent.target?document.querySelector(this.parent.target):this.parent.target,close:this.removeFieldListIcon.bind(this)}),this.fieldListDialog.isStringTemplate=!0,this.fieldListDialog.appendTo(e),this.renderDeferUpdateButtons(e),t.setStyleAttribute(t.select("#"+e.id+"_title",e),{width:"100%"}),e.querySelector(".e-title-header").appendChild(this.createCalculatedButton())}},e.prototype.dialogOpen=function(){4===this.lastTabIndex?(this.adaptiveElement.items[this.lastTabIndex].content="",this.adaptiveElement.dataBind(),this.parent.notify("init-calculatedfield",{})):this.adaptiveElement.refresh()},e.prototype.updateDataSource=function(e){for(var t=["filters","columns","rows","values"],i=0,a=e;i<a.length;i++){var r=a[i],n=t[this.adaptiveElement.selectedItem];this.parent.pivotCommon.dataSourceUpdate.control="pivotview"===this.parent.getModuleName()?this.parent:this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent,this.parent.pivotCommon.dataSourceUpdate.updateDataSource(r,n,-1)}this.parent.axisFieldModule.render(),this.parent.allowDeferLayoutUpdate?this.parent.triggerPopulateEvent():this.parent.updateDataSource(!0)},e.prototype.onDeferUpdateClick=function(){this.parent.updateDataSource(),this.parent.dialogRenderer.fieldListDialog.hide()},e.prototype.renderAdaptiveLayout=function(e){var i=t.createElement("div",{className:"e-field-list-footer"});e.appendChild(this.parentElement);var a=[{header:{text:this.parent.localeObj.getConstant("filters")},content:this.createAxisTable("filters")},{header:{text:this.parent.localeObj.getConstant("columns")},content:this.createAxisTable("columns")},{header:{text:this.parent.localeObj.getConstant("rows")},content:this.createAxisTable("rows")},{header:{text:this.parent.localeObj.getConstant("values")},content:this.createAxisTable("values")},{header:{text:this.parent.localeObj.getConstant("createCalculatedField")},content:"Calculated Field Related UI"}];this.parent.allowCalculatedField||a.pop(),this.adaptiveElement=new o.Tab({heightAdjustMode:"Auto",items:a,height:"100%",enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,locale:this.parent.locale,selected:this.tabSelect.bind(this),cssClass:this.parent.cssClass}),"Fixed"===this.parent.renderMode?(i.appendChild(this.createAddButton()),t.addClass([e],"e-static"),this.adaptiveElement.isStringTemplate=!0,this.adaptiveElement.appendTo(this.parentElement),this.parentElement.appendChild(i)):(this.adaptiveElement.isStringTemplate=!0,this.adaptiveElement.appendTo(this.parentElement))},e.prototype.tabSelect=function(e){var i=t.closest(this.parentElement,"."+N);this.lastTabIndex=e.selectedIndex,i&&i.querySelector(".e-field-list-btn")&&(4!==e.selectedIndex?(t.addClass([i.querySelector(".e-calculated-field-btn")],"e-disable"),t.removeClass([i.querySelector(".e-field-list-btn")],"e-disable")):(t.removeClass([i.querySelector(".e-calculated-field-btn")],"e-disable"),t.addClass([i.querySelector(".e-field-list-btn")],"e-disable"))),4===e.selectedIndex?(this.adaptiveElement.items[4].content="",this.adaptiveElement.dataBind(),this.parent.notify("init-calculatedfield",{})):this.parent.axisFieldModule.render()},e.prototype.createCalculatedButton=function(){var e=t.createElement("button",{id:this.parent.element.id+"_CalculatedField",attrs:{type:"button",tabindex:"0","aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("CalculatedField")}}),i=new h.Button({cssClass:"e-calculated-field e-disable"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("CalculatedField"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});return i.isStringTemplate=!0,i.appendTo(e),this.parent.calculatedFieldModule&&t.removeClass([e],"e-disable"),i.element.onclick=this.showCalculatedField.bind(this),e},e.prototype.createAddButton=function(){var e=t.createElement("div",{className:"e-field-list-footer-content"}),i=t.createElement("div",{}),a=t.createElement("div",{}),r=new h.Button({cssClass:"e-calculated-field-btn e-small e-round e-disable"+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:P+" e-add-icon",enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),n=new h.Button({cssClass:"e-field-list-btn e-small e-round"+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:P+" e-add-icon",enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});return n.isStringTemplate=!0,n.appendTo(i),r.isStringTemplate=!0,r.appendTo(a),e.appendChild(i),e.appendChild(a),r.element.onclick=this.showCalculatedField.bind(this),n.element.onclick=this.showFieldListDialog.bind(this),e},e.prototype.createAxisTable=function(e){var i=t.createElement("div",{className:"e-field-list-"+e}),a=t.createElement("div",{className:"e-axis-content e-"+e}),r=t.createElement("span",{className:"e-draggable-prompt"});return r.innerText=this.parent.localeObj.getConstant("addPrompt"),i.appendChild(a),i.appendChild(r),i},e.prototype.showCalculatedField=function(){try{if(!this.parent.isAdaptive){if(this.parent.actionObj.actionName="Open calculated field dialog",this.parent.actionBeginMethod())return;this.parent.dialogRenderer.fieldListDialog&&(this.parent.dialogRenderer.fieldListDialog.hide(),t.addClass([this.parent.element.querySelector(".e-toggle-field-list")],"e-hide"))}this.parent.notify("init-calculatedfield",{})}catch(e){this.parent.actionFailureMethod(e)}},e.prototype.showFieldListDialog=function(){var e=this.adaptiveElement.selectedItem;this.parent.treeViewModule.render(e)},e.prototype.onShowFieldList=function(){if(this.parent.actionObj.actionName="Open field list",!this.parent.actionBeginMethod()){this.parent.actionObj.actionName="";try{this.parent.allowDeferLayoutUpdate&&(this.parent.isAdaptive&&this.parent.axisFieldModule.render(),this.parent.clonedDataSource=f.getClonedDataSourceSettings(this.parent.dataSourceSettings),"olap"===this.parent.dataType&&(this.parent.clonedFieldListData=f.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData)),this.parent.clonedFieldList=f.getClonedFieldList(this.parent.pivotFieldList)),t.addClass([this.parent.element.querySelector(".e-toggle-field-list")],"e-hide"),this.parent.dialogRenderer.fieldListDialog.show(),this.parent.dialogRenderer.fieldListDialog.element.style.top=parseInt(this.parent.dialogRenderer.fieldListDialog.element.style.top,10)<0?"0px":this.parent.dialogRenderer.fieldListDialog.element.style.top}catch(e){this.parent.actionFailureMethod(e)}}},e.prototype.removeFieldListIcon=function(){this.parent.isAdaptive&&this.parent.allowCalculatedField&&this.parent.calculatedFieldModule&&this.adaptiveElement&&4===this.adaptiveElement.selectedItem&&(t.select("#"+this.parent.element.id+"droppable",this.adaptiveElement.element)?this.parent.calculatedFieldModule.updateAdaptiveCalculatedField(!1):this.parent.notify("init-calculatedfield",{edit:!1})),document.getElementById(this.parent.element.id+"calculateddialog")||t.removeClass([this.parent.element.querySelector(".e-toggle-field-list")],"e-hide")},e.prototype.keyPress=function(e){if(13===e.keyCode&&e.target)return e.target.click(),void e.preventDefault()},e.prototype.wireDialogEvent=function(e){t.EventHandler.add(e,"keydown",this.keyPress,this),t.EventHandler.add(e,"click",this.onShowFieldList,this)},e.prototype.unWireDialogEvent=function(e){t.EventHandler.remove(e,"keydown",this.keyPress),t.EventHandler.remove(e,"click",this.onShowFieldList)},e.prototype.destroy=function(){"Popup"===this.parent.renderMode&&this.unWireDialogEvent(this.parent.element.querySelector(".e-toggle-field-list")),this.deferUpdateCheckBox&&!this.deferUpdateCheckBox.isDestroyed&&(this.deferUpdateCheckBox.destroy(),this.deferUpdateCheckBox=null),this.deferUpdateApplyButton&&!this.deferUpdateApplyButton.isDestroyed&&(this.deferUpdateApplyButton.destroy(),this.deferUpdateApplyButton=null),this.deferUpdateCancelButton&&!this.deferUpdateCancelButton.isDestroyed&&(this.deferUpdateCancelButton.destroy(),this.deferUpdateCancelButton=null),this.adaptiveElement&&!this.adaptiveElement.isDestroyed&&(this.adaptiveElement.destroy(),this.adaptiveElement=null),"Popup"===this.parent.renderMode&&(this.fieldListDialog&&!this.fieldListDialog.isDestroyed&&(this.fieldListDialog.destroy(),this.fieldListDialog=null),document.getElementById(this.parent.element.id+"_Container")&&t.remove(document.getElementById(this.parent.element.id+"_Container")))},e}(),_t=function(){function e(e){this.selectedNodes=[],this.isSearching=!1,this.parentIDs=[],this.isSpaceKey=!1,this.parent=e,this.addEventListener()}return e.prototype.render=function(e){if(this.parentElement=this.parent.dialogRenderer.parentElement,this.fieldListSort=this.parent.pivotGridModule?this.parent.pivotGridModule.defaultFieldListOrder:this.parent.defaultFieldListOrder,this.fieldListSort="Ascending"===this.fieldListSort?"Ascend":"Descending"===this.fieldListSort?"Descend":"None",this.parent.isAdaptive)this.renderTreeDialog(e);else{var i=t.createElement("div",{className:"e-field-table "+("olap"===this.parent.dataType?"e-olap-field-table":"")}),a=t.createElement("div",{className:"e-field-header",attrs:{title:this.parent.localeObj.getConstant("allFields")}});a.innerText=this.parent.localeObj.getConstant("allFields");var r=t.createElement("div",{className:"e-field-list-tree-outer-div e-treeContainer"});this.treeViewElement=t.createElement("div",{id:this.parent.element.id+"_TreeView",className:"e-field-list "+("olap"===this.parent.dataType?"e-olap-field-list-tree":"")});var n=t.createElement("div",{className:"e-field-header-container"});if(n.appendChild(a),i.appendChild(n),this.updateSortElements(n),this.parent.enableFieldSearching){var o=t.createElement("div",{id:this.parent.element.id+"_SearchDiv",attrs:{tabindex:"-1"},className:"e-field-list-search"}),l=t.createElement("input",{attrs:{type:"text"}});o.appendChild(l),this.fieldSearch=new s.TextBox({placeholder:this.parent.localeObj.getConstant("search"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-field-list-search-input"+(this.parent.cssClass?" "+this.parent.cssClass:""),input:this.textChange.bind(this),showClearButton:!0}),this.fieldSearch.isStringTemplate=!0,this.fieldSearch.appendTo(l),this.fieldSearch.addIcon("append","e-field-list-search-icon "+P);var d=t.createElement("div",{className:"e-member-prompt e-disable"});d.innerText=this.parent.localeObj.getConstant("noMatches"),i.appendChild(o),i.appendChild(d)}if(r.appendChild(this.treeViewElement),i.appendChild(r),this.parentElement.appendChild(i),"Fixed"===this.parent.renderMode){var p=t.createElement("div",{className:"e-center-div"}),h=t.createElement("div",{className:"e-center-title"});h.innerText=this.parent.localeObj.getConstant("centerHeader"),this.parentElement.appendChild(p),this.parentElement.appendChild(h)}this.renderTreeView()}},e.prototype.updateSortElements=function(e){for(var i={None:"sortNone",Ascend:"sortAscending",Descend:"sortDescending"},a=0,r=Object.keys(i);a<r.length;a++){var n=r[a],o=t.createElement("span",{attrs:{tabindex:"0","aria-disabled":"false","aria-label":"Sort "+n,"data-sort":n,title:this.parent.localeObj.getConstant(i[n]),role:"button"},className:P+" e-sort-"+n.toLowerCase()+" "+(this.fieldListSort===n?"e-selected":"")});e.appendChild(o),this.unWireFieldListEvent(o),this.wireFieldListEvent(o)}},e.prototype.renderTreeView=function(){this.fieldTable=new o.TreeView({fields:{dataSource:this.getTreeData(),id:"id",text:"caption",isChecked:"isSelected",parentID:"pid",iconCss:"spriteCssClass"},nodeChecked:this.nodeChecked.bind(this),nodeClicked:this.nodeStateChange.bind(this),keyPress:this.nodeStateChange.bind(this),cssClass:"e-field-list-tree"+(this.parent.cssClass?" "+this.parent.cssClass:""),showCheckBox:!0,allowDragAndDrop:!0,sortOrder:"None",loadOnDemand:"olap"!==this.parent.dataType&&!this.parent.enableFieldSearching,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,nodeDragStart:this.dragStart.bind(this),nodeDragStop:this.dragStop.bind(this),drawNode:this.updateTreeNode.bind(this),nodeExpanding:this.updateNodeIcon.bind(this),nodeCollapsed:this.updateNodeIcon.bind(this),nodeSelected:function(e){t.removeClass([e.node],"e-active"),e.cancel=!0}}),this.treeViewElement.innerHTML="",this.fieldTable.isStringTemplate=!0,this.fieldTable.appendTo(this.treeViewElement);var e="Fixed"===this.parent.renderMode?this.parent.element:this.parentElement;t.isNullOrUndefined(e.querySelector(".e-field-list"))||(t.getInstance(e.querySelector(".e-field-list"),o.TreeView).dragObj.enableAutoScroll=!1)},e.prototype.updateNodeIcon=function(e){if("olap"===this.parent.dataType)if(e.node&&e.node.querySelector(".e-list-icon")&&e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-icon")>-1){i=e.node.querySelector(".e-list-icon");t.removeClass([i],"e-folderCDB-icon"),t.addClass([i],"e-folderCDB-open-icon")}else if(e.node&&e.node.querySelector(".e-list-icon")&&e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-open-icon")>-1){var i=e.node.querySelector(".e-list-icon");t.removeClass([i],"e-folderCDB-open-icon"),t.addClass([i],"e-folderCDB-icon")}},e.prototype.updateTreeNode=function(e){var i=!1;"olap"===this.parent.dataType?i=this.updateOlapTreeNode(e):e.nodeData.hasChildren?(i=!1,e.node.querySelector(".e-checkbox-wrapper").style.display="none",t.addClass([e.node],"e-pivot-parent")):i=!0,t.isNullOrUndefined(e.nodeData.pid)||t.addClass([e.node],"e-pivot-child");var a=e.node.querySelector(".e-text-content");if(e.node.querySelector(".e-list-icon")&&a){var r=e.node.querySelector(".e-list-icon");a.insertBefore(r,e.node.querySelector(".e-list-text"))}if(i&&!this.parent.isAdaptive){var n=f.getFieldInfo(e.nodeData.id,this.parent);i=!1;var o=t.createElement("span",{attrs:{tabindex:"-1",title:n.fieldItem?n.fieldItem.allowDragAndDrop?this.parent.localeObj.getConstant("drag"):"":this.parent.localeObj.getConstant("drag"),"aria-disabled":"false"},className:P+" e-drag "+(n.fieldItem?n.fieldItem.allowDragAndDrop?"":"e-disable-drag":"")});e.node.querySelector(".e-checkbox-wrapper")&&!e.node.querySelector(".cls.DRAG_CLASS")&&a&&a.insertBefore(o,e.node.querySelector(".e-checkbox-wrapper"))}if(e.node.querySelector(".e-check")&&t.addClass([e.node.querySelector(".e-list-text")],"e-selected-node"),this.parent.enableFieldSearching&&this.isSearching){var s=e.node;if("olap"===this.parent.dataType)for(var l=s.getAttribute("data-uid"),d=this.parent.pivotCommon.eventBase.searchListItem,p=0;p<this.parentIDs.length;p++){l===this.parentIDs[p]&&t.addClass([s],"e-disable");for(var h=0,u=d;h<u.length;h++){var c=u[h],g=this.parent.pivotCommon.eventBase.getParentIDs(this.fieldTable,c.getAttribute("data-uid"),[]);if(f.inArray(l,g)>-1){t.removeClass([s],"e-disable");break}}}else for(p=0;p<this.nonSearchList.length;p++){if(s.textContent===this.nonSearchList[p].textContent){t.addClass([s],"e-disable");break}if(s.innerText===this.nonSearchList[p].textContent){t.addClass([s],"e-disable");break}}}},e.prototype.updateOlapTreeNode=function(e){var t=!1;return"olap"===this.parent.dataType?(e.node&&e.node.querySelector(".e-calcMemberGroupCDB,.e-measureGroupCDB-icon,.e-folderCDB-icon,.e-folderCDB-open-icon,.e-dimensionCDB-icon,.e-kpiCDB-icon")&&(e.node.querySelector(".e-checkbox-wrapper").style.display="none"),e.node&&e.node.querySelector(".e-list-icon")&&e.node.querySelector(".e-list-icon").className.indexOf("e-level-members")>-1&&(this.parent.isAdaptive?e.node.querySelector(".e-checkbox-wrapper").style.display="none":e.node.querySelector(".e-checkbox-wrapper").style.visibility="hidden"),e.node&&(e.node.querySelector(".e-hierarchyCDB-icon,.e-attributeCDB-icon,.e-namedSetCDB-icon")||e.node.querySelector(".e-measure-icon,.e-kpiGoal-icon,.e-kpiStatus-icon,.e-kpiTrend-icon,.e-kpiValue-icon")||e.node.querySelector(".e-calc-measure-icon,.e-calc-dimension-icon"))&&(e.node.querySelector(".e-measure-icon")?(e.node.querySelector(".e-list-icon").style.display="none",t=!0):t=!0)):t=!0,t},e.prototype.renderTreeDialog=function(e){var i=t.createElement("div",{id:this.parent.element.id+"_FieldListTreeView",className:"e-adaptive-field-list-dialog "+("olap"===this.parent.dataType?"e-olap-editor-dialog":"")});this.parentElement.appendChild(i),this.fieldDialog=new r.Dialog({animationSettings:{effect:"Fade"},allowDragging:!1,header:this.parent.localeObj.getConstant("adaptiveFieldHeader"),content:this.createTreeView(this.getTreeData(e)),isModal:!0,visible:!0,showCloseIcon:!1,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,locale:this.parent.locale,width:"320px",height:"350px",position:{X:"center",Y:"center"},buttons:[{click:this.closeTreeDialog.bind(this),isFlat:!1,buttonModel:{cssClass:"e-cancel-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}},{click:this.onFieldAdd.bind(this),isFlat:!1,buttonModel:{cssClass:"e-ok-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("add"),isPrimary:!0}}],closeOnEscape:!1,cssClass:this.parent.cssClass,close:this.closeTreeDialog.bind(this),target:t.closest(this.parentElement,"."+N)}),this.fieldDialog.isStringTemplate=!0,this.fieldDialog.appendTo(i)},e.prototype.createTreeView=function(e){var i=t.createElement("div",{id:this.parent.element.id+"EditorDiv",className:"e-member-editor-outer-container"}),a=t.createElement("div",{id:this.parent.element.id+"_SearchDiv",attrs:{tabindex:"-1"},className:"e-editor-search-container"}),r=t.createElement("input",{attrs:{type:"text"}});a.appendChild(r);var n=t.createElement("div",{className:"e-field-list-tree-outer-div"}),l=t.createElement("div",{className:"e-member-editor-container "+("olap"===this.parent.dataType?"e-olap-field-list-tree":"")});i.appendChild(a),this.editorSearch=new s.MaskedTextBox({showClearButton:!0,placeholder:this.parent.localeObj.getConstant("search"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-editor-search"+(this.parent.cssClass?" "+this.parent.cssClass:""),change:this.textChange.bind(this)}),this.editorSearch.isStringTemplate=!0,this.editorSearch.appendTo(r);var d=t.createElement("div",{className:"e-member-prompt e-disable"});return d.innerText=this.parent.localeObj.getConstant("noMatches"),i.appendChild(d),n.appendChild(l),i.appendChild(n),this.fieldTable=new o.TreeView({fields:{dataSource:e,id:"id",text:"caption",isChecked:"isSelected",parentID:"pid",iconCss:"spriteCssClass"},showCheckBox:!0,loadOnDemand:"olap"!==this.parent.dataType,sortOrder:"olap"===this.parent.dataType?"None":"Ascending",enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass,nodeChecked:this.nodeChecked.bind(this),nodeClicked:this.addNode.bind(this),keyPress:this.addNode.bind(this),drawNode:this.updateTreeNode.bind(this),nodeExpanding:this.updateNodeIcon.bind(this),nodeCollapsed:this.updateNodeIcon.bind(this),nodeSelected:function(e){t.removeClass([e.node],"e-active"),e.cancel=!0}}),this.fieldTable.isStringTemplate=!0,this.fieldTable.appendTo(l),i},e.prototype.textChange=function(e){this.parent.pivotCommon.eventBase.searchTreeNodes(e,this.fieldTable,!0);var i,a;this.parent.isAdaptive?i=this.fieldDialog.element.querySelector(".e-member-prompt"):(i=this.parentElement.querySelector(".e-member-prompt"),a=this.parentElement.querySelector(".e-treeContainer"));var r=[].slice.call(this.fieldTable.element.querySelectorAll("li")),n=[].slice.call(this.fieldTable.element.querySelectorAll("li.e-disable"));if(r.length===n.length?(t.removeClass([i],"e-disable"),this.parent.isAdaptive||(t.addClass([a],"e-disable"),t.removeClass([a],"e-field-list-tree-outer-div-searchMode"))):(t.addClass([i],"e-disable"),this.parent.isAdaptive||(t.removeClass([a],"e-disable"),t.addClass([a],"e-field-list-tree-outer-div-searchMode"))),this.isSearching=n.length>0,this.nonSearchList=n,"olap"===this.parent.dataType){this.parentIDs=[];for(var o=0;o<r.length;o++)if(r[o].classList.contains("e-level-1")){var s=r[o].getAttribute("data-uid");this.parentIDs.push(s)}}},e.prototype.dragStart=function(e){var i=this;if(e.event.target.classList.contains("e-drag")&&!e.event.target.classList.contains("e-disable-drag")){var a=f.getFieldInfo(e.draggedNode.getAttribute("data-uid"),this.parent),r={fieldName:a.fieldName,fieldItem:a.fieldItem,axis:a.axis,dataSourceSettings:this.parent.dataSourceSettings,cancel:!1};(this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger("fieldDragStart",r,function(a){if(a.cancel)i.parent.isDragging=!1,e.cancel=!0;else{i.parent.isDragging=!0,t.addClass([e.draggedNode.querySelector(".e-list-text")],"e-list-selected");var r=void 0,n=["e-rows","e-columns","e-filters"];if((r="olap"===i.parent.dataType?i.parent.olapEngineModule.fieldList[e.draggedNode.getAttribute("data-uid")]:i.parent.engineModule.fieldList[e.draggedNode.getAttribute("data-uid")])&&"CalculatedField"===r.aggregateType)for(var o=0,s=n;o<s.length;o++){var l=s[o];t.addClass([i.parentElement.querySelector("."+l)],"e-drag-restrict")}var d=e.clonedNode;d&&"Popup"===("pivotfieldlist"===i.parent.getModuleName()&&i.parent.renderMode)&&(d.style.zIndex=(i.parent.dialogRenderer.fieldListDialog.zIndex+1).toString())}})}else this.parent.isDragging=!1,e.cancel=!0},e.prototype.dragStop=function(e){e.cancel=!0,this.parent.isDragging=!1;for(var i=0,a=["e-rows","e-columns","e-filters"];i<a.length;i++){var r=a[i];t.removeClass([this.parentElement.querySelector("."+r)],"e-drag-restrict")}t.removeClass([e.draggedNode.querySelector(".e-list-text")],"e-list-selected"),this.parent.pivotCommon.filterDialog.dialogPopUp&&this.parent.pivotCommon.filterDialog.dialogPopUp.close();var n=e.draggedNodeData.id.toString();if(this.isNodeDropped(e,n)){var o=this.parent.pivotFieldList[n];this.parent.pivotCommon.dataSourceUpdate.control="pivotview"===this.parent.getModuleName()?this.parent:this.parent.isPopupView&&this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent,this.parent.pivotCommon.nodeStateModified.onStateModified(e,n)&&(this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&this.parent.pivotGridModule.pivotDeferLayoutUpdate?(o.isSelected=!0,this.updateDataSource()):this.parent.updateDataSource(),this.parent.axisFieldModule.render())}},e.prototype.isNodeDropped=function(e,i){var a=!0;if("true"===e.draggedNodeData.isChecked){var r=this.getButton(i),n=t.closest(r,".e-droppable"),o=t.closest(e.target,".e-droppable");if(r&&n===o){for(var s=[].slice.call(n.querySelectorAll(".e-pivot-button")),l=t.closest(e.target,".e-pvt-btn-div"),d=void 0,p=-1,h=0,u=s.length;h<u;h++)if(s[h].id===r.id&&(d=h),l){var c=l.querySelector(".e-pivot-button");s[h].id===c.id&&(p=h)}if(d===p||d===s.length-1&&-1===p){var g=document.getElementById(this.parent.element.id+"_Container");t.removeClass([].slice.call(g.querySelectorAll(".e-drop-indicator")),"e-drop-hover"),a=!1}}}return a},e.prototype.getButton=function(e){for(var t,i=document.getElementById(this.parent.element.id+"_Container"),a=[].slice.call(i.querySelectorAll(".e-pivot-button")),r=0,n=a.length;r<n;r++)if(a[r].getAttribute("data-uid")===e){t=a[r];break}return t},e.prototype.nodeChecked=function(e){if(this.isSpaceKey){var i=t.closest(e.node,".e-text-content");if(!t.isNullOrUndefined(i)){var a=t.closest(i,"li").getAttribute("data-uid");this.parent.isAdaptive?this.addNode(void 0,a,"check"===e.action,i):this.nodeStateChange(void 0,a,"check"===e.action,i)}}this.isSpaceKey=!1},e.prototype.nodeStateChange=function(e,i,a,r){var n=this;r=t.isNullOrUndefined(r)?e.node:r,i=t.isNullOrUndefined(i)?r.getAttribute("data-uid"):i,this.parent.pivotCommon.filterDialog.dialogPopUp&&this.parent.pivotCommon.filterDialog.dialogPopUp.close();var o=this.parent.pivotFieldList[i];if(!t.isNullOrUndefined(e)){if(this.isSpaceKey=e.event.action&&"space"===e.event.action,t.isNullOrUndefined(o)||r.classList.contains("e-disable")||e.event.target&&(e.event.target.classList.contains("e-icon-collapsible")||e.event.target.classList.contains("e-icon-expandable"))||e.event.action&&"enter"!==e.event.action)return;a=!1;var s=this.fieldTable.getNode(r);e.event&&e.event.target&&!e.event.target.closest(".e-checkbox-wrapper")?"true"===s.isChecked?(this.fieldTable.uncheckAll([r]),a=!1):(this.fieldTable.checkAll([r]),a=!0):a="true"===s.isChecked}var l=this.parent.isPopupView?this.parent.pivotGridModule:this.parent,d=f.getFieldInfo(i,this.parent),p=r.closest(".e-pivot-parent");if(a){var h={fieldName:i,dropField:d.fieldItem,dataSourceSettings:f.getClonedDataSourceSettings(this.parent.dataSourceSettings),dropAxis:"number"===o.type||"CalculatedField"===o.type&&o.formula&&o.formula.indexOf("Measure")>-1&&"olap"===this.parent.dataType?"values":"rows",dropPosition:d.position,draggedAxis:"fieldlist",cancel:!1};l.trigger("fieldDrop",h,function(e){if(e.cancel)n.updateCheckState(o,"check");else{t.addClass([r.querySelector(".e-list-text")],"e-selected-node"),p&&t.addClass([p.querySelector(".e-list-text")],"e-selected-node"),n.updateSelectedNodes(r,"check");var s=n.parent.pivotCommon.dataSourceUpdate.getNewField(i,d.fieldItem);n.updateReportSettings(s,e),n.updateNodeStateChange(i,o,a)}})}else{var u={cancel:!1,fieldName:i,dataSourceSettings:f.getClonedDataSourceSettings(this.parent.dataSourceSettings),fieldItem:d.fieldItem,axis:d.axis};l.trigger("fieldRemove",u,function(e){e.cancel?n.updateCheckState(o,"uncheck"):(t.removeClass([r.querySelector(".e-list-text")],"e-selected-node"),p&&t.isNullOrUndefined(p.querySelector(".e-pivot-child .e-check"))&&t.removeClass([p.querySelector(".e-list-text")],"e-selected-node"),n.updateSelectedNodes(r,"uncheck"),n.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport(i),"pivot"===n.parent.dataType&&n.parent.showValuesButton&&n.parent.dataSourceSettings.values.length>1&&d&&d.position<n.parent.dataSourceSettings.valueIndex&&("row"===n.parent.dataSourceSettings.valueAxis&&"rows"===d.axis||"column"===n.parent.dataSourceSettings.valueAxis&&"columns"===d.axis)&&l.setProperties({dataSourceSettings:{valueIndex:n.parent.dataSourceSettings.valueIndex-1}},!0),"olap"===n.parent.dataType&&0===n.parent.dataSourceSettings.values.length&&n.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport("[Measures]"),n.updateNodeStateChange(i,o,a))})}},e.prototype.updateReportSettings=function(e,i){var a=i.dropPosition,r=i.dropAxis;if("pivot"===this.parent.dataType&&this.parent.showValuesButton&&this.parent.dataSourceSettings.values.length>1){var n="row"===this.parent.dataSourceSettings.valueAxis&&"rows"===r?this.parent.dataSourceSettings.rows:"column"===this.parent.dataSourceSettings.valueAxis&&"columns"===r?this.parent.dataSourceSettings.columns:void 0;t.isNullOrUndefined(n)||(-1===a&&-1===this.parent.dataSourceSettings.valueIndex?this.parent.setProperties({dataSourceSettings:{valueIndex:n.length}},!0):a>-1&&a<=this.parent.dataSourceSettings.valueIndex?this.parent.setProperties({dataSourceSettings:{valueIndex:this.parent.dataSourceSettings.valueIndex+1}},!0):this.parent.dataSourceSettings.valueIndex>-1&&a>this.parent.dataSourceSettings.valueIndex&&(a-=1))}switch(r){case"filters":-1!==a?this.parent.dataSourceSettings.filters.splice(a,0,e):this.parent.dataSourceSettings.filters.push(e);break;case"rows":-1!==a?this.parent.dataSourceSettings.rows.splice(a,0,e):this.parent.dataSourceSettings.rows.push(e);break;case"columns":-1!==a?this.parent.dataSourceSettings.columns.splice(a,0,e):this.parent.dataSourceSettings.columns.push(e);break;case"values":if(-1!==a?this.parent.dataSourceSettings.values.splice(a,0,e):this.parent.dataSourceSettings.values.push(e),"olap"===this.parent.dataType&&this.parent.olapEngineModule&&!this.parent.olapEngineModule.isMeasureAvail&&!(this.parent.dataSourceSettings.values.length>1)){var o={name:"[Measures]",caption:"Measures",baseField:void 0,baseItem:void 0};("row"===this.parent.dataSourceSettings.valueAxis?this.parent.dataSourceSettings.rows:this.parent.dataSourceSettings.columns).push(o)}}},e.prototype.updateCheckState=function(e,t){for(var i=this.fieldTable.element.querySelectorAll(".e-checkbox-wrapper"),a=this.fieldTable.element.querySelectorAll(".e-list-text"),r=0;r<i.length;r++)e.caption===a[r].textContent&&("check"===t?this.fieldTable.uncheckAll([e.id]):this.fieldTable.checkAll([e.id]))},e.prototype.updateNodeStateChange=function(e,i,a){!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate?this.parent.updateDataSource(!0):(i.isSelected=a,"olap"===this.parent.dataType&&this.parent.olapEngineModule.updateFieldlistData(e,a),this.updateDataSource());var r=this.treeViewElement.querySelector('[data-uid="'+e+'"]');r.focus(),t.removeClass([r],"e-hover");var n=this.parent;setTimeout(function(){n.axisFieldModule.render()})},e.prototype.updateSelectedNodes=function(e,i){if(e&&e.querySelector("ul"))for(var a=0,r=[].slice.call(e.querySelectorAll("li"));a<r.length;a++){var n=r[a];"check"===i?t.addClass([n.querySelector(".e-list-text")],"e-selected-node"):t.removeClass([n.querySelector(".e-list-text")],"e-selected-node")}},e.prototype.updateDataSource=function(){this.parent.isPopupView?("olap"===this.parent.dataType?this.parent.pivotGridModule.olapEngineModule=this.parent.olapEngineModule:this.parent.pivotGridModule.engineModule=this.parent.engineModule,this.parent.pivotGridModule.setProperties({dataSourceSettings:this.parent.dataSourceSettings.properties},!0),this.parent.pivotGridModule.notify(b,this)):this.parent.triggerPopulateEvent()},e.prototype.addNode=function(e,i,a,r){var n=this;r=t.isNullOrUndefined(r)?e.node:r,i=t.isNullOrUndefined(i)?r.getAttribute("data-uid"):i;var o=this.parent.pivotFieldList[i];if(!t.isNullOrUndefined(e)){if(this.isSpaceKey=e.event.key&&" "===e.event.key,t.isNullOrUndefined(o)||e.node.classList.contains("e-disable")||e.event.target&&(e.event.target.classList.contains("e-icon-collapsible")||e.event.target.classList.contains("e-icon-expandable"))||e.event.key&&"Enter"!==e.event.key)return;a=!1;var s=this.fieldTable.getNode(e.node);e.event&&e.event.target&&!e.event.target.classList.contains("e-frame")?"true"===s.isChecked?(this.fieldTable.uncheckAll([e.node]),a=!1):(this.fieldTable.checkAll([e.node]),a=!0):a="true"===s.isChecked}var l=f.getFieldInfo(o.id.toString(),this.parent),d=this.parent.isPopupView?this.parent.pivotGridModule:this.parent;if(a){var p=["filters","columns","rows","values"],h={fieldName:l.fieldName,dropField:l.fieldItem,dataSourceSettings:f.getClonedDataSourceSettings(this.parent.dataSourceSettings),dropAxis:p[this.parent.dialogRenderer.adaptiveElement.selectedItem],draggedAxis:"fieldlist",cancel:!1};d.trigger("fieldDrop",h,function(e){e.cancel?n.updateCheckState(o,"check"):n.selectedNodes.push(o.id.toString())})}else{var u={cancel:!1,fieldName:l.fieldName,dataSourceSettings:f.getClonedDataSourceSettings(this.parent.dataSourceSettings),fieldItem:l.fieldItem,axis:l.axis};d.trigger("fieldRemove",u,function(e){if(e.cancel)n.updateCheckState(o,"uncheck");else for(var t=n.selectedNodes.length;t--;)if(n.selectedNodes[t]===o.id.toString()){n.selectedNodes.splice(t,1);break}})}},e.prototype.refreshTreeView=function(){if(this.fieldTable){var e=this.getUpdatedData();this.fieldTable.fields={dataSource:e,id:"id",text:"caption",isChecked:"isSelected",parentID:"pid",iconCss:"spriteCssClass"},this.fieldTable.dataBind()}},e.prototype.getUpdatedData=function(){var e=this.getTreeData(),t=this.fieldTable.expandedNodes;return this.updateExpandedNodes(e,t),this.applySorting(e,this.fieldListSort)},e.prototype.getTreeData=function(e){var i=[];if("olap"===this.parent.dataType)i=this.getOlapTreeData(e);else{for(var a=this.parent.pivotFieldList?Object.keys(this.parent.pivotFieldList):[],r={},n=0,o=a;n<o.length;n++){var s=o[n],l=this.parent.pivotFieldList[s];if(r[s]={id:l.id,pid:l.pid,caption:l.caption,isSelected:l.isSelected},!t.isNullOrUndefined(l.pid)&&!r[s].hasChildren){var d=l.pid+"_group_name";r[s].pid=d,r[d]={id:d,caption:l.pid,isSelected:r[d]&&r[d].isSelected?r[d].isSelected:l.isSelected,hasChildren:!0}}}if(this.parent.isAdaptive){for(var p=[this.parent.dataSourceSettings.filters,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.values][e],h=a.length;h--;)r[a[h]].isSelected=!1;for(var u=0,c=p;u<c.length;u++)r[c[u].name].isSelected=!0}for(var g=0,m=Object.keys(r);g<m.length;g++){var f=r[l=m[g]];i.push(f)}}return i},e.prototype.getOlapTreeData=function(e){var i=[],a=this.parent.olapEngineModule.fieldListData?this.parent.olapEngineModule.fieldListData:[];if(this.parent.isAdaptive)for(var r=[this.parent.dataSourceSettings.filters,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.values][e],n=0;n<a.length;){var o=a[n],s=void 0;if(3===e){if("[measures]"!==o.id.toLowerCase()&&(0===o.id.toLowerCase().indexOf("[measures]")||o.spriteCssClass&&-1!==o.spriteCssClass.indexOf("e-measureCDB"))||"[calculated members].[_0]"===o.id.toLowerCase()||o.spriteCssClass&&-1!==o.spriteCssClass.indexOf("e-calc-measure-icon")){(s={id:o.id,caption:o.caption,hasChildren:o.hasChildren,type:o.type,aggregateType:o.aggregateType,isSelected:o.isSelected,pid:o.pid,spriteCssClass:o.spriteCssClass}).isSelected=!1,s.spriteCssClass&&-1!==s.spriteCssClass.indexOf("e-measureCDB")&&(s.spriteCssClass=s.spriteCssClass.replace("e-folderCDB-icon","e-measureGroupCDB-icon"),s.pid=void 0);for(var l=0,d=r;l<d.length;l++){var p=d[l];if(s.id===p.name){s.isSelected=!0;break}}i.push(s)}}else if(!(0===o.id.toLowerCase().indexOf("[measures]")||o.spriteCssClass&&-1!==o.spriteCssClass.indexOf("e-measureCDB")||o.spriteCssClass&&-1!==o.spriteCssClass.indexOf("e-calc-measure-icon"))){(s={id:o.id,caption:o.caption,hasChildren:o.hasChildren,type:o.type,aggregateType:o.aggregateType,isSelected:o.isSelected,pid:o.pid,spriteCssClass:o.spriteCssClass}).isSelected=!1;for(var h=0,u=r;h<u.length;h++){var c=u[h];if(s.id===c.name){s.isSelected=!0;break}}i.push(s)}n++}else i=t.isNullOrUndefined(this.parent.olapEngineModule.fieldListData)?[]:f.getClonedData(this.parent.olapEngineModule.fieldListData);return i},e.prototype.updateExpandedNodes=function(e,t){if(t.length>0)for(var i=0,a=0,r=e;a<r.length;a++){var n=r[a];if(t.indexOf(n.id)>-1&&(i++,n.expanded=!0,n.spriteCssClass=n.spriteCssClass&&n.spriteCssClass.toString().indexOf("e-folderCDB-icon")>-1?n.spriteCssClass.toString().replace("e-folderCDB-icon","e-folderCDB-open-icon"):n.spriteCssClass,i===t.length))break}},e.prototype.updateSorting=function(e){var i=e.target,a=i.getAttribute("data-sort");if(this.parent.actionObj.actionName="Sort field tree",!this.parent.actionBeginMethod()){try{if(-1===i.className.indexOf("e-selected")){switch(a){case"None":this.fieldListSort="None",t.addClass([i],"e-selected"),t.removeClass([this.parentElement.querySelector(".e-sort-ascend")],"e-selected"),t.removeClass([this.parentElement.querySelector(".e-sort-descend")],"e-selected");break;case"Ascend":this.fieldListSort="Ascend",t.addClass([i],"e-selected"),t.removeClass([this.parentElement.querySelector(".e-sort-none")],"e-selected"),t.removeClass([this.parentElement.querySelector(".e-sort-descend")],"e-selected");break;case"Descend":this.fieldListSort="Descend",t.addClass([i],"e-selected"),t.removeClass([this.parentElement.querySelector(".e-sort-ascend")],"e-selected"),t.removeClass([this.parentElement.querySelector(".e-sort-none")],"e-selected")}this.refreshTreeView()}}catch(e){this.parent.actionFailureMethod(e)}this.parent.actionObj.actionName=this.parent.getActionCompleteName(),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()}},e.prototype.applySorting=function(e,t){if(e.length>0)if("olap"===this.parent.dataType){var i=void 0,a=void 0;this.parent.dataSourceSettings.calculatedFieldSettings.length>0&&"[calculated members].[_0]"===e[0].id.toLowerCase()?(a=e[0],i=e[1],e.splice(0,2)):(i=e[0],e.splice(0,1)),e="Ascend"===t?e.sort(function(e,t){return e.caption>t.caption?1:t.caption>e.caption?-1:0}):"Descend"===t?e.sort(function(e,t){return e.caption<t.caption?1:t.caption<e.caption?-1:0}):e,a?e.splice(0,0,a,i):e.splice(0,0,i)}else this.fieldTable.sortOrder="Ascend"===t?"Ascending":"Descend"===t?"Descending":"None";return e},e.prototype.onFieldAdd=function(){this.parent.dialogRenderer.updateDataSource(this.selectedNodes),this.closeTreeDialog()},e.prototype.closeTreeDialog=function(){this.selectedNodes=[],this.fieldDialog.hide(),this.fieldDialog.destroy(),document.getElementById(this.parent.element.id+"_FieldListTreeView")&&t.remove(document.getElementById(this.parent.element.id+"_FieldListTreeView")),this.fieldDialog=null},e.prototype.keyPress=function(e){if(13===e.keyCode&&e.target)return e.target.click(),void e.preventDefault()},e.prototype.wireFieldListEvent=function(e){t.EventHandler.add(e,"keydown",this.keyPress,this),t.EventHandler.add(e,"click",this.updateSorting,this)},e.prototype.unWireFieldListEvent=function(e){t.EventHandler.remove(e,"keydown",this.keyPress),t.EventHandler.remove(e,"click",this.updateSorting)},e.prototype.addEventListener=function(){this.parent.on(w,this.refreshTreeView,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(w,this.refreshTreeView)},e.prototype.destroy=function(){this.removeEventListener(),this.editorSearch&&!this.editorSearch.isDestroyed&&(this.editorSearch.destroy(),this.editorSearch=null),this.fieldSearch&&!this.fieldSearch.isDestroyed&&(this.fieldSearch.destroy(),this.fieldSearch=null),this.fieldTable&&!this.fieldTable.isDestroyed&&(this.fieldTable.destroy(),this.fieldTable=null),this.fieldDialog&&!this.fieldDialog.isDestroyed&&(this.fieldDialog.destroy(),this.fieldDialog=null)},e}(),Bt=function(){function e(e){this.parent=e}return e.prototype.render=function(){if(!this.parent.isAdaptive){var e=t.createElement("div",{className:"e-axis-table "+("olap"===this.parent.dataType?"e-olap-axis-table":"")});this.leftAxisPanel=t.createElement("div",{className:"e-left-axis-fields"}),this.rightAxisPanel=t.createElement("div",{className:"e-right-axis-fields"}),this.parent.dialogRenderer.parentElement.appendChild(e),e.appendChild(this.leftAxisPanel),e.appendChild(this.rightAxisPanel),this.axisTable=e,this.renderAxisTable()}this.parent.axisFieldModule.render()},e.prototype.renderAxisTable=function(){for(var e=["filters","rows","columns","values"],i=0,a=e.length;i<a;i++){var r=t.createElement("div",{className:"e-field-list-"+e[i]}),n=t.createElement("div",{className:"e-axis-container"}),o=t.createElement("div",{className:"e-axis-header",attrs:{title:this.parent.localeObj.getConstant(e[i])}});o.innerText=this.parent.localeObj.getConstant(e[i]),n.appendChild(this.getIconupdate(e[i])),n.appendChild(o);var s=t.createElement("div",{className:"e-axis-content e-"+e[i]}),l=void 0;l="rows"===e[i]?this.parent.localeObj.getConstant("dropRowPrompt"):"columns"===e[i]?this.parent.localeObj.getConstant("dropColPrompt"):"values"===e[i]?this.parent.localeObj.getConstant("dropValPrompt"):this.parent.localeObj.getConstant("dropFilterPrompt");var d=t.createElement("span",{className:"e-draggable-prompt"});d.innerText=l,new t.Droppable(s,{}),r.appendChild(n),r.appendChild(s),r.appendChild(d),i<=1?this.leftAxisPanel.appendChild(r):this.rightAxisPanel.appendChild(r),this.unWireEvent(s),this.wireEvent(s)}},e.prototype.getIconupdate=function(e){var i=t.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:"e-axis-icon-container"}),a=t.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:P+" e-axis-"+e});return i.appendChild(a),i},e.prototype.wireEvent=function(e){t.EventHandler.add(e,"mouseover",this.updateDropIndicator,this),t.EventHandler.add(e,"mouseleave",this.updateDropIndicator,this)},e.prototype.unWireEvent=function(e){t.EventHandler.remove(e,"mouseover",this.updateDropIndicator),t.EventHandler.remove(e,"mouseleave",this.updateDropIndicator)},e.prototype.updateDropIndicator=function(e){var i=this.parent.dialogRenderer.parentElement;if(this.parent.isDragging&&e.target.classList.contains("e-axis-content")&&"mouseover"===e.type){t.removeClass([].slice.call(i.querySelectorAll(".e-drop-indicator")),"e-drop-hover"),t.removeClass([].slice.call(i.querySelectorAll(".e-drop-indicator-last")),"e-drop-hover");var a=[].slice.call(e.target.querySelectorAll(".e-pvt-btn-div"));a.length>0&&t.addClass([a[a.length-1].querySelector(".e-drop-indicator-last")],"e-drop-hover")}else this.parent.isDragging&&(e.target.classList.contains("e-droppable")||"mouseleave"!==e.type)||(t.removeClass([].slice.call(i.querySelectorAll(".e-drop-indicator")),"e-drop-hover"),t.removeClass([].slice.call(i.querySelectorAll(".e-drop-indicator-last")),"e-drop-hover"))},e}(),Gt=function(){function e(e){this.parent=e,this.menuOption=new J(this.parent),this.parent.pivotButtonModule=this,this.addEventListener(),this.parent instanceof Kt&&(this.axisField=new zt(this.parent)),this.isDestroyed=!1}return e.prototype.renderPivotButton=function(e){var i,a=this;this.parentElement="pivotview"===this.parent.getModuleName()?this.parent.element:document.getElementById(this.parent.element.id+"_Container");var r,n=Array.prototype.slice.call(this.parentElement.querySelectorAll(".e-group-"+e.axis));"rows"===e.axis&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&t.isNullOrUndefined(this.parentElement.querySelector(".e-group-pivot-rows"))&&(n.push(this.parent.groupingBarModule.rowPanel),r=this.parent.groupingBarModule.rowPanel);var o=t.extend([],e.field,null,!0),s=e.axis,d=-1,p="pivot"===this.parent.dataType&&("pivotfieldlist"===this.parent.getModuleName()&&this.parent.pivotGridModule?this.parent.pivotGridModule.showValuesButton:this.parent.showValuesButton);if(("row"===this.parent.dataSourceSettings.valueAxis&&"rows"===e.axis||"column"===this.parent.dataSourceSettings.valueAxis&&"columns"===e.axis)&&p&&this.parent.dataSourceSettings.values.length>1&&t.isNullOrUndefined(f.getFieldByName("[Measures]",o))){var u=f.getFieldByName("[Measures]",this.parent.dataSourceSettings.fieldMapping),c={name:"[Measures]",caption:this.parent.localeObj.getConstant("values"),axis:e.axis,showRemoveIcon:!(u&&"showRemoveIcon"in u)||u.showRemoveIcon,allowDragAndDrop:!(u&&"allowDragAndDrop"in u)||u.allowDragAndDrop};-1===this.parent.dataSourceSettings.valueIndex||this.parent.dataSourceSettings.valueIndex>o.length?(d=o.length,o.push(c),this.parent.setProperties({dataSourceSettings:{valueIndex:-1}},!0)):(d=this.parent.dataSourceSettings.valueIndex,o.splice(d,0,c))}if("pivotfieldlist"===this.parent.getModuleName()){if(this.parentElement=document.getElementById(this.parent.element.id+"_Container"),!this.parentElement.querySelector(".e-field-list-"+s))return;var g=this.parentElement.querySelector(".e-field-list-"+s).querySelector(".e-draggable-prompt");0===o.length?t.removeClass([g],"e-disable"):t.addClass([g],"e-disable"),r=this.parentElement.querySelector(".e-field-list-"+s).querySelector(".e-axis-content")}else this.parentElement=this.parent.element,t.isNullOrUndefined(this.parentElement.querySelector(".e-group-"+s))||(r=this.parentElement.querySelector(".e-group-"+s));if(r)if("pivotview"===this.parent.getModuleName()&&0===o.length)for(m=0;m<n.length;m++)(b=n[m]).classList.contains("e-group-chart-values")||b.classList.contains("e-group-chart-columns")||((g=t.createElement("span",{className:"e-draggable-prompt"})).innerText=this.parent.groupingBarSettings.allowDragAndDrop?"rows"===s?this.parent.localeObj.getConstant("rowAxisPrompt"):"columns"===s?this.parent.localeObj.getConstant("columnAxisPrompt"):"values"===s?this.parent.localeObj.getConstant("valueAxisPrompt"):"filters"===s?this.parent.localeObj.getConstant("filterAxisPrompt"):this.parent.localeObj.getConstant("allFields"):"",b.appendChild(g));else{for(var m=0,v=o.length;m<v;m++)for(var S="pivotfieldlist"===this.parent.getModuleName()?[r]:n,y=0;y<S.length;y++){var b=S[y];if(this.parent.olapEngineModule&&(this.parent.olapEngineModule.fieldList[o[m].name]||"[Measures]"===o[m].name)||this.parent.engineModule){var C="olap"===this.parent.dataType&&("[measures]"===o[m].name.toLowerCase()||"values"===s),x="olap"===this.parent.dataType&&"values"===s;if(!b.classList.contains("e-group-chart-values")&&!b.classList.contains("e-group-chart-columns")){var w=t.createElement("div",{className:"e-pvt-btn-div"+(0===m&&"all-fields"!==s?" e-first-btn":"")+(this.parent.isTabular?" e-tabular-pvt-btn":""),attrs:{"data-tag":s+":"+o[m].name}});this.parent.isTabular&&(w.style.width="auto");var T=o[m].caption?o[m].caption:o[m].name;T=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(T):T;var M=t.createElement("div",{id:this.parent.element.id+"_"+o[m].name,className:"e-pivot-button "+o[m].name.replace(/[^A-Z0-9]/gi,"")+(this.parent.isTabular?" e-tabular-row-btn":""),attrs:{"data-uid":o[m].name,tabindex:"pivotview"===this.parent.getModuleName()&&this.parent.grid&&"rows"===s&&!b.classList.contains("e-group-chart-rows")?"-1":"0",isvalue:m===d||C&&!x?"true":"false","aria-disabled":"false","aria-label":T,"data-type":"olap"===this.parent.dataType?x?"isMeasureFieldsAvail":C?"isMeasureAvail":o[m].type:o[m].type,"data-caption":T,"data-basefield":this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(o[m].baseField):o[m].baseField,"data-baseitem":this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(o[m].baseItem):o[m].baseItem,role:"button"}}),D=t.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:"e-drop-indicator"}),O=t.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:"e-drop-indicator-last"}),N=this.createButtonDragIcon(o[m],M),E=this.createButtonText(o,m,s,d);if(M.appendChild(E),"all-fields"!==s){if(C||o[m].isNamedSet||o[m].isCalculatedField||(-1!==["filters","values"].indexOf(s)||d===m||"olap"===this.parent.dataType&&("pivotview"===this.parent.getModuleName()&&this.parent.enableVirtualization||"pivotfieldlist"===this.parent.getModuleName()&&void 0!==this.parent.pivotGridModule&&this.parent.pivotGridModule.enableVirtualization)||this.createSortOption(M,o[m].name,o[m]),"values"!==s&&d!==m&&this.createFilterOption(M,o[m].name,s,o[m]),"values"===s&&this.getTypeStatus(o,m,M)),o[m].isCalculatedField||"CalculatedField"===o[m].type){var F=t.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("editCalculatedField")},className:P+" e-edit"});this.parent.allowCalculatedField&&this.parent.calculatedFieldModule&&(o[m].showEditIcon||void 0===o[m].showEditIcon)?t.removeClass([F],"e-disable"):t.addClass([F],"e-disable"),M.appendChild(F)}var I=t.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("remove")},className:P+" e-remove"});"pivotview"===this.parent.getModuleName()?this.parent.groupingBarSettings.showRemoveIcon&&(o[m].showRemoveIcon||void 0===o[m].showRemoveIcon)?t.removeClass([I],"e-disable"):t.addClass([I],"e-disable"):o[m].showRemoveIcon||void 0===o[m].showRemoveIcon?t.removeClass([I],"e-disable"):t.addClass([I],"e-disable"),M.appendChild(I),w.appendChild(D),w.appendChild(M),w.appendChild(O)}else w.appendChild(D),w.appendChild(M);b.appendChild(w);var L=new h.Button({enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass});L.isStringTemplate=!0,L.appendTo(M),this.unWireEvent(w,m===d&&"all-fields"!==s?"values":s,C),this.wireEvent(w,m===d&&"all-fields"!==s?"values":s,C),("pivotview"===this.parent.getModuleName()&&!this.parent.isAdaptive||"pivotfieldlist"===this.parent.getModuleName())&&(this.createDraggable(o[m],"pivotview"===this.parent.getModuleName()?E:N),t.getInstance(M.querySelector(".e-draggable"),t.Draggable).enableAutoScroll=!1)}}}if("values"===s)for(var A=t.select(".e-group-chart-values-drodown-div",this.parentElement)?t.getInstance(t.select(".e-group-chart-values-drodown-div",this.parentElement),l.DropDownList):null,R=this,m=0;m<n.length;m++)!function(e){var i=n[e];if(i.classList.contains("e-group-chart-values")&&R.parent.pivotChartModule){var a=o.map(function(e){return{text:e.caption?e.caption:e.name,value:e.name}}),r=R.parent;if(A&&i.querySelector(".e-group-chart-values-drodown-div"))A.dataSource=a,A.value=r.chartSettings.enableMultipleAxis?a[0].value:r.pivotChartModule.currentMeasure;else{var s=t.createElement("div",{className:"e-group-chart-values-drodown-div"});i.appendChild(s),(A=new l.DropDownList({dataSource:a,enableRtl:R.parent.enableRtl,locale:R.parent.locale,value:r.chartSettings.enableMultipleAxis?a[0].value:r.pivotChartModule.currentMeasure,width:200,fields:{value:"value",text:"text"},cssClass:"e-group-chart-values-drodown"+(R.parent.cssClass?" "+R.parent.cssClass:""),change:function(e){e.e&&null!==e.e&&(r.chartSettings.value=e.value)}})).isStringTemplate=!0,A.appendTo(s)}}}(m);else if("columns"===s)for(var k=void 0,j=t.select(".e-group-chart-columns-dropdown-div",this.parentElement)?t.getInstance(t.select(".e-group-chart-columns-dropdown-div",this.parentElement),l.DropDownList):null,m=0;m<n.length;m++)if((b=n[m]).classList.contains("e-group-chart-columns")&&this.parent.pivotChartModule){for(var q=this.parent.pivotChartModule.currentMeasure,H=this.parent.chartSettings.columnDelimiter?this.parent.chartSettings.columnDelimiter:"-",V=this.parent.chartSettings.columnHeader&&""!==this.parent.chartSettings.columnHeader?this.parent.chartSettings.columnHeader.split(H).join(" - "):"",U="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,_=U.pivotValues,B=this.parent.pivotChartModule.getColumnTotalIndex(_),G=[],z=!1,W=0,Q=Object.keys(_);W<Q.length;W++){var Y=Q[W];if(z)break;var K=Number(Y);if(_[K][0]&&"row"===_[K][0].axis&&(0===this.parent.dataSourceSettings.rows.length||"grand sum"!==_[K][0].type))for(var X=_[K][0],J="olap"===this.parent.dataType?U.tupRowInfo[X.ordinal]:void 0,Z=_[K],$=0,ee=Object.keys(Z);$<ee.length;$++){var te=ee[$],ie=Number(te),ae=_[K][ie],re="olap"===this.parent.dataType&&J&&J.measureName?J.measureName:ae.actualText;if(!B[ae.colIndex]&&"value"===ae.axis&&"header"!==X.type&&""!==re&&re===q){z=!0;var ne="olap"===this.parent.dataType?ae.columnHeaders.toString().split(/~~|::/).join(" - "):ae.columnHeaders.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).join(" - ");G.push({value:ne,text:ne,title:(i={},i.title=ne,i)}),ne===V&&(k=G.length)}}}if(j&&b.querySelector(".e-group-chart-columns-dropdown-div"))j.dataSource=G,j.value=void 0!==k?G[k-1].value:G[0].value;else{var oe=t.createElement("div",{className:"e-group-chart-columns-dropdown-div"});b.appendChild(oe),(j=new l.DropDownList({dataSource:G,enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:k?G[k-1].value:G[0]?G[0].value:"",width:"200",fields:{value:"value",text:"text",htmlAttributes:"title"},cssClass:"e-group-chart-columns-dropdown"+(this.parent.cssClass?" "+this.parent.cssClass:""),change:function(e){if(e.e&&null!==e.e){var t=a.parent.chartSettings.columnDelimiter?a.parent.chartSettings.columnDelimiter:"-";a.parent.chartSettings.columnHeader=e.value.split(" - ").join(t)}}})).isStringTemplate=!0,j.appendTo(oe)}}}},e.prototype.createButtonText=function(e,i,a,r){var n,o;"filters"===a&&(o=this.updateButtontext(e[i].name));var s;(s="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule).fieldList&&void 0!==s.fieldList[e[i].name]&&(n="DistinctCount"===(n=s.fieldList[e[i].name].aggregateType)||"number"===s.fieldList[e[i].name].type&&"include"!==s.fieldList[e[i].name].type&&"exclude"!==s.fieldList[e[i].name].type?void 0===n?"Sum":s.fieldList[e[i].name].aggregateType:"Count");var l=e[i].caption?e[i].caption:e[i].name;l=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(l):l;var d=t.createElement("span",{attrs:{title:"filters"===a?"olap"===this.parent.dataType&&"CalculatedField"===s.fieldList[e[i].name].type?l:l+" ("+o+")":"olap"===this.parent.dataType?l:this.parent.dataSourceSettings.showAggregationOnValueField&&"values"===a&&"CalculatedField"!==n?this.parent.localeObj.getConstant(n)+" "+this.parent.localeObj.getConstant("of")+" "+l:l,tabindex:"-1","aria-disabled":"false",oncontextmenu:"return false;","data-type":r===i?"":n},className:"e-pvt-btn-content "+("pivotview"===this.parent.getModuleName()?this.parent.groupingBarSettings.allowDragAndDrop&&(e[i].allowDragAndDrop||void 0===e[i].allowDragAndDrop)?"":"e-disable-drag":"")});return d.innerText="filters"===a?"olap"===this.parent.dataType&&"CalculatedField"===s.fieldList[e[i].name].type?l:l+" ("+o+")":"olap"===this.parent.dataType?l:this.parent.dataSourceSettings.showAggregationOnValueField&&"values"===a&&"CalculatedField"!==n?this.parent.localeObj.getConstant(n)+" "+this.parent.localeObj.getConstant("of")+" "+l:l,d},e.prototype.getTypeStatus=function(e,t,i){var a;if((a="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule).fieldList){var r=a.fieldList[e[t].name];r&&"CalculatedField"!==r.aggregateType&&this.validateDropdown(r.type)&&this.createSummaryType(i,e[t].name,e[t])}},e.prototype.validateDropdown=function(e){var t=this.parent.aggregateTypes;if("number"!==e)return t.indexOf("Count")>-1||t.indexOf("DistinctCount")>-1;for(var i=0;i<t.length;i++)if(this.parent.getAllSummaryType().indexOf(t[i])>-1)return!0;return!1},e.prototype.createSummaryType=function(e,i,a){var r=t.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("format")},className:P+" e-dropdown-icon"});return"pivotview"===this.parent.getModuleName()?this.parent.groupingBarSettings.showValueTypeIcon&&a.showValueTypeIcon?t.removeClass([r],"e-disable"):t.addClass([r],"e-disable"):a.showValueTypeIcon?t.removeClass([r],"e-disable"):t.addClass([r],"e-disable"),e.appendChild(r),r},e.prototype.createMenuOption=function(e){this.menuOption.render(e,this.parentElement),this.parent.pivotButtonModule=this},e.prototype.openCalculatedFieldDialog=function(e){var i=e.target.parentElement.getAttribute("data-uid"),a=f.getFieldInfo(i,this.parent);if(this.parent.actionObj.actionName="Edit calculated field",this.parent.actionObj.fieldInfo=a,!this.parent.actionBeginMethod())try{"pivotview"===this.parent.getModuleName()?this.parent.isAdaptive&&this.parent.showFieldList&&this.parent.pivotFieldListModule&&!this.parent.pivotFieldListModule.isDestroyed?(this.parent.pivotFieldListModule.element.querySelector(".e-toggle-field-list").click(),this.parent.pivotFieldListModule.dialogRenderer.adaptiveElement.select(4),this.parent.pivotFieldListModule.calculatedFieldModule.updateAdaptiveCalculatedField(!0,i)):(this.parent.isAdaptive||(this.parent.calculatedFieldModule.buttonCall=!0),this.parent.notify("init-calculatedfield",{edit:!0,fieldName:i})):"pivotfieldlist"===this.parent.getModuleName()&&(this.parent.isAdaptive?(this.parent.dialogRenderer.adaptiveElement.select(4),this.parent.calculatedFieldModule.updateAdaptiveCalculatedField(!0,i),this.parent.calculatedFieldModule.buttonCall=!0):(this.parent.dialogRenderer.fieldListDialog&&(this.parent.dialogRenderer.fieldListDialog.hide(),t.addClass([this.parent.element.querySelector(".e-toggle-field-list")],"e-hide")),this.parent.notify("init-calculatedfield",{edit:!0,fieldName:i}),this.parent.calculatedFieldModule&&(this.parent.calculatedFieldModule.buttonCall=!0)))}catch(e){this.parent.actionFailureMethod(e)}},e.prototype.createDraggable=function(e,i){this.draggable=new t.Draggable(i,{clone:!0,enableTailMode:!0,enableAutoScroll:!0,helper:this.createDragClone.bind(this),dragStart:this.onDragStart.bind(this),drag:this.onDragging.bind(this),dragStop:this.onDragStop.bind(this),abort:"pivotview"===this.parent.getModuleName()?this.parent.groupingBarSettings.allowDragAndDrop&&e.allowDragAndDrop?"":".e-pivot-button":e.allowDragAndDrop?"":".e-pivot-button"})},e.prototype.createButtonDragIcon=function(e,i){var a=t.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false"}}),r=t.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("drag")},className:P+" e-drag "+(e.allowDragAndDrop||void 0===e.allowDragAndDrop?"":"e-disable-drag")});return a.appendChild(r),"pivotfieldlist"===this.parent.getModuleName()&&i.appendChild(a),a},e.prototype.createSortOption=function(e,i,a){var r,n,o;if(o="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate)r="Descending"===o.fieldList[i].sort?"e-descend":"";else{r="";for(var s=0;s<this.parent.dataSourceSettings.sortSettings.length;s++)this.parent.dataSourceSettings.sortSettings[s].name===i&&(r="Descending"===this.parent.dataSourceSettings.sortSettings[s].order?"e-descend":"")}return n=o.fieldList&&"None"===o.fieldList[i].sort?t.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("sort")},className:P}):t.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("sort")},className:P+" e-sort "+r}),this.parent.dataSourceSettings.enableSorting?"pivotview"===this.parent.getModuleName()?a.showSortIcon&&this.parent.groupingBarSettings.showSortIcon?t.removeClass([n],"e-disable"):t.addClass([n],"e-disable"):a.showSortIcon?t.removeClass([n],"e-disable"):t.addClass([n],"e-disable"):t.addClass([n],"e-disable"),e.appendChild(n),n},e.prototype.createFilterOption=function(e,i,a,r){var n,o;o="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule;var s=f.getFieldByName(i,this.parent.dataSourceSettings.filterSettings);if(!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate)o.fieldList[i].filter=null===o.fieldList[i].filter?[]:o.fieldList[i].filter,n="Server"===this.parent.dataSourceSettings.mode&&!s||"Local"===this.parent.dataSourceSettings.mode&&0===o.fieldList[i].filter.length?o.fieldList[i].isExcelFilter?"e-pv-filtered":"e-pv-filter":"e-pv-filtered";else{n="e-pv-filter";for(var l=0;l<this.parent.dataSourceSettings.filterSettings.length;l++)this.parent.dataSourceSettings.filterSettings[l].name===i&&(n="e-pv-filtered")}var d=t.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("filter")},className:"e-btn-filter e-icons "+n});return(this.parent.dataSourceSettings.allowLabelFilter||this.parent.dataSourceSettings.allowValueFilter)&&"filters"!==a||this.parent.dataSourceSettings.allowMemberFilter?t.removeClass([d],"e-disable"):t.addClass([d],"e-disable"),"pivotview"===this.parent.getModuleName()?((this.parent.dataSourceSettings.allowLabelFilter||this.parent.dataSourceSettings.allowValueFilter)&&"filters"!==a||this.parent.dataSourceSettings.allowMemberFilter)&&this.parent.groupingBarSettings.showFilterIcon&&r.showFilterIcon?t.removeClass([d],"e-disable"):t.addClass([d],"e-disable"):r.showFilterIcon&&((this.parent.dataSourceSettings.allowLabelFilter||this.parent.dataSourceSettings.allowValueFilter)&&"filters"!==a||this.parent.dataSourceSettings.allowMemberFilter)?t.removeClass([d],"e-disable"):t.addClass([d],"e-disable"),e.appendChild(d),d},e.prototype.updateButtontext=function(e){var t,i,a=(t="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule).fieldList[e].filter.length,r=t.fieldList[e].filterType,n=t.fieldList[e].dateMember.length,o=t.fieldList[e].filter[0];if("olap"===this.parent.dataType)i=this.updateOlapButtonText(t,e,o,a);else if("include"===r)1===a?i=o:a>1&&(i=a===n?this.parent.localeObj.getConstant("all"):this.parent.localeObj.getConstant("multipleItems"));else if("exclude"===r){if(1===a)i=2===n?o!==t.fieldList[e].dateMember[0].actualText?o:t.fieldList[e].dateMember[0].actualText:this.parent.localeObj.getConstant("multipleItems");else if(a>1){var s=void 0,l=Object.keys(t.fieldList[e].members),d=t.fieldList[e].filter;if(a===l.length-1)for(s=0;s<l.length;s++){var p=l[s];if(-1===d.indexOf(p)){i=l[s];break}}else i=this.parent.localeObj.getConstant("multipleItems")}}else i=this.parent.localeObj.getConstant("all");return i},e.prototype.updateOlapButtonText=function(e,t,i,a){var r,n=e.fieldList[t].actualFilter;if(n.length>0){var o=e.fieldList[t].members,s=[];if(e.fieldList[t].filterMembers.length>0){for(var l={},d=0,p=n;d<p.length;d++)l[c=p[d]]=c,o[c]&&(l=this.parent.pivotCommon.eventBase.getParentNode(t,c,l));for(var h=0,u=l?Object.keys(l):[];h<u.length;h++){var c=u[h];o[c].isSelected&&(o[c].parent&&o[o[c].parent].isSelected||s.push(c))}i=1===s.length?o[s[0]].caption:i}a=0===s.length?a:s.length}return 0===a?r=e.fieldList[t].allMember?e.fieldList[t].allMember:this.parent.localeObj.getConstant("all"):1===a?r=i:a>1&&(r=this.parent.localeObj.getConstant("multipleItems")),r},e.prototype.createDragClone=function(e){var i=t.closest(e.element,".e-pivot-button"),a=t.createElement("div",{id:this.parent.element.id+"_DragClone",className:"e-button-drag-clone"+(this.parent.cssClass?" "+this.parent.cssClass:"")}),r=t.createElement("span",{className:"e-text-content"});return r.innerText=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i.textContent):i.textContent,a.appendChild(r),document.body.appendChild(a),a},e.prototype.onDragStart=function(e){var i=this,a=t.closest(e.element,".e-pivot-button"),r=document.getElementById(this.parent.element.id+"_DragClone"),n=f.getFieldInfo(a.getAttribute("data-uid"),this.parent),o={fieldName:n.fieldName,fieldItem:n.fieldItem,axis:n.axis,dataSourceSettings:f.getClonedDataSourceSettings(this.parent.dataSourceSettings),cancel:!1};("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger("fieldDragStart",o,function(n){if(n.cancel)i.parent.isDragging=!1,i.draggable.intDestroy(e.event),t.detach(r);else{i.parent.isDragging=!0;var o=void 0,s=(o="olap"===i.parent.dataType?i.parent.olapEngineModule:i.parent.engineModule).fieldList[a.getAttribute("data-uid")],l=["e-rows","e-columns","e-filters"];if(t.addClass([a],"e-list-selected"),r&&"Popup"===("pivotfieldlist"===i.parent.getModuleName()&&i.parent.renderMode)){var d=i.parent;r.style.zIndex=(d.dialogRenderer.fieldListDialog.zIndex+1).toString()}if(s&&"CalculatedField"===s.aggregateType)for(var p=0,h=l;p<h.length;p++){var u=h[p];t.addClass([i.parentElement.querySelector("."+u)],"e-drag-restrict"),i.parentElement.querySelector("."+u).querySelectorAll(".e-pivot-button").forEach(function(e){e.style.cursor="no-drop"})}}})},e.prototype.onDragging=function(e){this.draggable.setProperties({cursorAt:{top:!t.isNullOrUndefined(e.event.targetTouches)||t.Browser.isDevice?60:-20}})},e.prototype.onDragStop=function(e){this.parent.isDragging=!1,e.target&&e.element&&t.closest(e.element,".e-group-all-fields")&&!t.closest(e.target,".e-droppable")&&(e.cancel=!0);var i=t.closest(e.element,".e-pivot-button");t.removeClass([].slice.call(this.parentElement.querySelectorAll(".e-pivot-button")),"e-list-selected"),t.removeClass([].slice.call(this.parentElement.querySelectorAll(".e-drop-indicator")),"e-drop-hover");for(var a=0,r=["e-rows","e-columns","e-filters"];a<r.length;a++){var n=r[a];t.removeClass([this.parentElement.querySelector("."+n)],"e-drag-restrict"),this.parentElement.querySelector("."+n).querySelectorAll(".e-pivot-button").forEach(function(e){e.style.cursor="default"})}this.parent.pivotCommon.filterDialog.dialogPopUp&&this.parent.pivotCommon.filterDialog.dialogPopUp.close(),document.getElementById(this.parent.element.id+"_DragClone")&&t.remove(document.getElementById(this.parent.element.id+"_DragClone")),document.body.style.cursor="auto",this.isButtonDropped(e.target,i)&&!e.cancel&&(this.parent.pivotCommon.dataSourceUpdate.control="pivotview"===this.parent.getModuleName()?this.parent:this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent,this.parent.pivotCommon.nodeStateModified.onStateModified(e,i.getAttribute("data-uid"))&&(this.updateDataSource(),this.parent.axisFieldModule.render()))},e.prototype.isButtonDropped=function(e,i){var a=t.closest(i,".e-droppable"),r=t.closest(e,".e-droppable"),n=!0;if(a&&a===r){for(var o=[].slice.call(a.querySelectorAll(".e-pivot-button")),s=t.closest(e,".e-pvt-btn-div"),l=void 0,d=-1,p=0,h=o.length;p<h;p++)if(o[p].id===i.id&&(l=p),s){var u=s.querySelector(".e-pivot-button");o[p].id===u.id&&(d=p)}(l===d||l===o.length-1&&-1===d)&&(t.removeClass([].slice.call(this.parentElement.querySelectorAll(".e-drop-indicator")),"e-drop-hover"),n=!1)}return n},e.prototype.updateSorting=function(e){var i=t.closest(e.target,".e-pivot-button"),a=f.getFieldInfo(i?i.getAttribute("data-uid"):"",this.parent);if(!e.target.classList.contains("e-btn-filter")&&!e.target.classList.contains("e-remove")&&!e.target.classList.contains("e-drag")&&i&&a.fieldItem&&(a.fieldItem.showSortIcon||t.isNullOrUndefined(a.fieldItem.showSortIcon))&&!a.fieldItem.isCalculatedField){if(this.parent.actionObj.actionName="Sort field",this.parent.actionObj.fieldInfo=a,this.parent.actionBeginMethod())return;try{if((this.parent instanceof Kt||this.parent.groupingBarSettings.showSortIcon)&&this.parent.dataSourceSettings.enableSorting&&("olap"!==this.parent.dataType||!("pivotfieldlist"===this.parent.getModuleName()&&void 0!==this.parent.pivotGridModule&&this.parent.pivotGridModule.enableVirtualization||"pivotview"===this.parent.getModuleName()&&this.parent.enableVirtualization))){if(this.parent.pivotCommon.eventBase.updateSorting(e),this.parent.staticPivotGridModule&&(this.parent.staticPivotGridModule.actionObj=this.parent.actionObj),!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate||"pivotfieldlist"!==this.parent.getModuleName()){var r={sortInfo:this.parent.lastSortInfo};this.parent.actionObj.actionInfo=r,this.updateDataSource(!0)}var n=this;n.parent instanceof Kt&&(n.axisField.render(),this.parent.isPopupView&&this.parent.pivotGridModule?this.parent.pivotGridModule.notify(b,this):this.parent.staticPivotGridModule&&this.parent.staticPivotGridModule.notify(b,this))}}catch(e){this.parent.actionFailureMethod(e)}}},e.prototype.updateDataSource=function(e){!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate||"pivotview"===this.parent.getModuleName()?this.parent.updateDataSource(e):"pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView&&this.parent.pivotGridModule?("olap"===this.parent.dataType?this.parent.pivotGridModule.olapEngineModule=this.parent.olapEngineModule:this.parent.pivotGridModule.engineModule=this.parent.engineModule,this.parent.pivotGridModule.notify(b,this),this.parent.pivotGridModule.setProperties({dataSourceSettings:this.parent.dataSourceSettings.properties},!0)):this.parent.triggerPopulateEvent()},e.prototype.updateFiltering=function(e){var t=this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent,i=e.target.parentElement.getAttribute("data-uid"),a=f.getFieldInfo(i,this.parent);if(this.parent.actionObj.actionName="Filter field",this.parent.actionObj.fieldInfo=a,!this.parent.actionBeginMethod())try{"pivotfieldlist"===t.getModuleName()?r.showSpinner(t.fieldListSpinnerElement):t.showWaitingPopup(),t.mouseEventArgs=e,t.filterTargetID="pivotfieldlist"!==this.parent.pivotCommon.moduleName?this.parent.element:document.getElementById(this.parent.pivotCommon.parentID+"_Container"),"Server"===t.dataSourceSettings.mode?this.parent.engineModule.fieldList[i].members&&Object.keys(this.parent.engineModule.fieldList[i].members).length>0?this.updateFilterEvents():t.getEngine("fetchFieldMembers",null,null,null,null,null,i):("pivot"!==t.dataType||this.parent.engineModule.fieldList[i].isMembersFilled||this.parent.engineModule.fetchFieldMembers(i),this.updateFilterEvents())}catch(e){this.parent.actionFailureMethod(e)}},e.prototype.updateFilterEvents=function(){var e=this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent;this.parent.pivotCommon.eventBase.updateFiltering(e.mouseEventArgs);var t=e.mouseEventArgs.target;this.fieldName=t.parentElement.getAttribute("data-uid"),this.parent.pivotCommon.filterDialog.dialogPopUp&&this.bindDialogEvents(),"pivotfieldlist"===e.getModuleName()?r.hideSpinner(e.fieldListSpinnerElement):e.hideWaitingPopup()},e.prototype.bindDialogEvents=function(){this.parent.pivotCommon.filterDialog.allowExcelLikeFilter&&this.parent.pivotCommon.filterDialog.tabObj?(this.index=this.parent.pivotCommon.filterDialog.tabObj.selectedItem,this.updateDialogButtonEvents(),this.parent.pivotCommon.filterDialog.dialogPopUp.buttons=this.buttonModel(),this.parent.pivotCommon.filterDialog.dialogPopUp.dataBind(),this.parent.pivotCommon.filterDialog.tabObj.selected=this.tabSelect.bind(this)):this.parent.dataSourceSettings.allowMemberFilter&&(this.index=0,this.updateDialogButtonEvents())},e.prototype.buttonModel=function(){return[{isFlat:!1,buttonModel:{cssClass:"e-clear-filter-button"+(this.parent.pivotCommon.filterDialog.allowExcelLikeFilter?"":" e-disable")+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:"e-icons e-clear-filter-icon",enableRtl:this.parent.enableRtl,content:this.parent.localeObj.getConstant("clearFilter"),disabled:!this.parent.pivotCommon.filterDialog.filterObject},click:this.ClearFilter.bind(this)},{isFlat:!1,buttonModel:{cssClass:"e-ok-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0},click:0===this.index?this.updateFilterState.bind(this,this.fieldName):this.updateCustomFilter.bind(this)},{isFlat:!1,click:this.parent.pivotCommon.filterDialog.closeFilterDialog.bind(this.parent.pivotCommon.filterDialog),buttonModel:{cssClass:"e-cancel-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}]},e.prototype.tabSelect=function(e){this.index=e.selectedIndex,this.updateDialogButtonEvents(),t.removeClass([].slice.call(this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelectorAll(".e-selected-tab")),"e-selected-tab"),e.selectedIndex>0&&t.addClass([this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector(".e-filter-div-content."+(1===e.selectedIndex&&this.parent.dataSourceSettings.allowLabelFilter?"e-label-filter":"e-value-filter"))],"e-selected-tab"),0===e.selectedIndex?this.parent.pivotCommon.filterDialog.updateCheckedState():(this.parent.pivotCommon.filterDialog.dialogPopUp.buttons[0].buttonModel.disabled=!1,this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector(".e-ok-btn").removeAttribute("disabled"))},e.prototype.updateDialogButtonEvents=function(){this.parent.pivotCommon.filterDialog.dialogPopUp.buttons=this.buttonModel(),this.parent.pivotCommon.filterDialog.dialogPopUp.dataBind()},e.prototype.updateCustomFilter=function(){var e,i=this,a=this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector(".e-selected-tab"),r=a.getAttribute("data-fieldname"),n=a.getAttribute("data-selectedField"),o=a.getAttribute("data-type"),s=a.getAttribute("data-measure"),l=a.getAttribute("data-operator"),d=a.getAttribute("data-value1"),p=a.getAttribute("data-value2"),h="value"===o?"Value":"date"===o?"Date":"number"===o?"Number":"Label",u={name:r,type:h,measure:s,condition:l,value1:"date"===o?new Date(d):d,value2:"date"===o?new Date(p):p};if("olap"===this.parent.dataType){u.selectedField=n,this.removeDataSourceSettings(r,n,h);for(var c=0,g=this.parent.dataSourceSettings.filterSettings;c<g.length;c++){var m=g[c];m.name===r&&m.selectedField===n&&(e=m)}}else e=f.getFilterItemByName(r,this.parent.dataSourceSettings.filterSettings);if(t.isNullOrUndefined(d)||""===d||["Between","NotBetween"].indexOf(l)>-1&&(t.isNullOrUndefined(p)||""===p)){var v=h.toLowerCase()+(t.isNullOrUndefined(d)||""===d?"_input_option_1":"_input_option_2"),S=t.select("#"+this.parent.element.id+"_"+v,a);return t.addClass([S],"e-empty-field"),void S.focus()}var y={cancel:!1,filterSettings:u,dataSourceSettings:f.getClonedDataSourceSettings(this.parent.dataSourceSettings)};("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger("memberFiltering",y,function(t){t.cancel||(u=t.filterSettings,e?((e=e.properties?e.properties:e).type=u.type,e.measure=u.measure,e.condition=u.condition,e.value1=u.value1,e.value2=u.value2,"olap"===i.parent.dataType&&(e.selectedField=u.selectedField)):i.parent.dataSourceSettings.filterSettings.push(u)),"Value"!==h&&(i.parent.lastFilterInfo=f.getFilterItemByName(r,i.parent.dataSourceSettings.filterSettings),i.parent.lastFilterInfo=i.parent.lastFilterInfo.properties?i.parent.lastFilterInfo.properties:i.parent.lastFilterInfo),i.parent.pivotCommon.filterDialog.dialogPopUp.close(),t.cancel||(i.refreshPivotButtonState(r,!0),i.updateDataSource(!0))})},e.prototype.ClearFilter=function(){var e=this.parent.pivotCommon.filterDialog.dialogPopUp.element,t=e.getAttribute("data-fieldname"),i=e.querySelector(".e-selected-tab");if(this.parent.pivotCommon.filterDialog.dialogPopUp.close(),"olap"===this.parent.dataType&&i){var a=i.getAttribute("data-selectedField");this.removeDataSourceSettings(t,a)}else this.removeDataSourceSettings(t);var r=f.getFilterItemByName(t,this.parent.dataSourceSettings.filterSettings);this.refreshPivotButtonState(t,!!r),this.updateDataSource(!0)},e.prototype.removeButton=function(e){var t=this,i=e.target,a=i.parentElement.getAttribute("data-uid"),r=f.getFieldInfo(a,this.parent);if(this.parent.actionObj.actionName="Remove field",this.parent.actionObj.fieldInfo=r,!this.parent.actionBeginMethod()){var n={cancel:!1,fieldName:a,dataSourceSettings:f.getClonedDataSourceSettings(this.parent.dataSourceSettings),fieldItem:r.fieldItem,axis:r.axis};try{("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger("fieldRemove",n,function(e){e.cancel||("true"===i.parentElement.getAttribute("isvalue")?(t.parent.setProperties({dataSourceSettings:{values:[]}},!0),"olap"===t.parent.dataType&&t.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport("[Measures]")):(t.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport(a),"pivot"===t.parent.dataType&&t.parent.showValuesButton&&t.parent.dataSourceSettings.values.length>1&&r.position<t.parent.dataSourceSettings.valueIndex&&("row"===t.parent.dataSourceSettings.valueAxis&&"rows"===e.axis||"column"===t.parent.dataSourceSettings.valueAxis&&"columns"===e.axis)&&t.parent.setProperties({dataSourceSettings:{valueIndex:t.parent.dataSourceSettings.valueIndex-1}},!0),"olap"===t.parent.dataType&&0===t.parent.dataSourceSettings.values.length&&t.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport("[Measures]")),"pivotfieldlist"===t.parent.getModuleName()&&t.parent.axisFieldModule.render(),t.updateDataSource())})}catch(e){this.parent.actionFailureMethod(e)}}},e.prototype.nodeStateModified=function(e){var i=t.closest(e.node,"li"),a=i.getAttribute("data-fieldname");if("all"===i.getAttribute("data-memberId"))this.parent.pivotCommon.filterDialog.memberTreeView.nodeChecked=null,"check"===e.action?this.parent.pivotCommon.filterDialog.memberTreeView.checkAll():this.parent.pivotCommon.filterDialog.memberTreeView.uncheckAll(),"olap"===this.parent.dataType&&this.parent.olapEngineModule&&!this.parent.olapEngineModule.fieldList[a].isHierarchy&&this.updateNodeStates(this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes(),a),this.checkedStateAll(e.action),this.parent.pivotCommon.filterDialog.memberTreeView.nodeChecked=this.nodeStateModified.bind(this);else{if("olap"===this.parent.dataType&&this.parent.olapEngineModule&&!this.parent.olapEngineModule.fieldList[a].isHierarchy){var r=this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes();this.updateNodeStates(r,a)}var n=this.parent.pivotCommon.currentTreeItemsPos[i.getAttribute("data-memberId")].index;this.parent.pivotCommon.currentTreeItems[n]&&(this.parent.pivotCommon.currentTreeItems[n].isSelected="check"===e.action,this.parent.pivotCommon.currentTreeItemsPos[i.getAttribute("data-memberId")].isSelected="check"===e.action)}this.parent.pivotCommon.filterDialog.updateCheckedState()},e.prototype.checkedStateAll=function(e){for(var t={},i=0,a=this.parent.pivotCommon.searchTreeItems;i<a.length;i++)(o=a[i]).isSelected="check"===e,t[o.htmlAttributes["data-memberId"]]=o.htmlAttributes["data-memberId"];for(var r=0,n=this.parent.pivotCommon.currentTreeItems;r<n.length;r++){var o=n[r];void 0!==t[o.htmlAttributes["data-memberId"]]&&(o.isSelected="check"===e,this.parent.pivotCommon.currentTreeItemsPos[o.htmlAttributes["data-memberId"]].isSelected="check"===e)}},e.prototype.updateNodeStates=function(e,t){var i=this.parent.pivotCommon.engineModule.fieldList[t],a=i.members,r=i.currrentMembers;if(i.searchMembers.length>0){for(var n=0,o=p=Object.keys(r);n<o.length;n++)r[c=o[n]]&&(r[c].isSelected=!1),a[c]&&(a[c].isSelected=!1,this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+c+'"]')&&(d=this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+c+'"]'))&&!d.querySelector("ul")&&this.parent.pivotCommon.eventBase.updateChildNodeStates(i.filterMembers,t,c,!1));for(var s=0,l=e;s<l.length;s++){if(a[f=l[s]]&&this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+f+'"]')){var d=this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+f+'"]');d&&!d.querySelector("ul")&&(a[f].isSelected=!0,this.parent.pivotCommon.eventBase.updateChildNodeStates(i.filterMembers,t,f,!0))}r[f]&&(r[f].isSelected=!0)}}else{for(var p=Object.keys(a),h=0,u=p;h<u.length;h++){var c=u[h];a[c].isSelected&&(a[c].isSelected=!1)}for(var g=0,m=e;g<m.length;g++){var f=m[g];a[f]&&(a[f].isSelected=!0,this.parent.pivotCommon.eventBase.updateChildNodeStates(i.filterMembers,t,f,!0))}}},e.prototype.updateFilterState=function(e){var t=this,i=!1,a={items:[],name:e,type:"Include"},r="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule;if("olap"===this.parent.dataType&&r&&!r.fieldList[e].isHierarchy){var n=r.fieldList[e].members,o=r.fieldList[e].currrentMembers;if(a.items=this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes(),a.levelCount=r.fieldList[e].levelCount,i=a.items.length!==this.parent.pivotCommon.filterDialog.memberTreeView.fields.dataSource.length,r.fieldList[e].searchMembers.length>0&&!i){var s=Object.keys(n).length,l=Object.keys(o).length;i=s!==l||s!==a.items.length}for(var d=0,p=a.items;d<p.length;d++){var h=p[d];r.fieldList[e].searchMembers.length>0&&o[h]?o[h].isSelected=!0:n[h]&&(n[h].isSelected=!0)}}else{for(var u=0,c=this.parent.pivotCommon.searchTreeItems;u<c.length;u++){var g=c[u];g.isSelected&&(this.parent.pivotCommon.isDateField?a.items.push(g.name):a.items.push(g.htmlAttributes["data-memberId"]))}i=a.items.length!==this.parent.pivotCommon.currentTreeItems.length}if("olap"===this.parent.dataType&&this.removeDataSourceSettings(e),this.parent.allowDeferLayoutUpdate){r.fieldList[a.name].filterType=a.type.toLowerCase(),r.fieldList[a.name].filter=[];for(var m=0;m<a.items.length;m++)r.fieldList[a.name].filter.push(a.items[m])}var v={filterSettings:a,dataSourceSettings:f.getClonedDataSourceSettings(this.parent.dataSourceSettings),cancel:!1};("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger("memberFiltering",v,function(r){if(a=r.filterSettings,!r.cancel){if(f.getFilterItemByName(e,t.parent.dataSourceSettings.filterSettings))for(var n=0;n<t.parent.dataSourceSettings.filterSettings.length;n++)if(t.parent.dataSourceSettings.filterSettings[n].name===e){t.parent.dataSourceSettings.filterSettings.splice(n,1);break}t.parent.dataSourceSettings.filterSettings.push(a)}if(t.parent.pivotCommon.filterDialog.dialogPopUp.close(),!r.cancel){t.refreshPivotButtonState(e,i),i||(t.removeDataSourceSettings(e),a={}),t.parent.lastFilterInfo=a;var o={filterInfo:t.parent.lastFilterInfo};t.parent.actionObj.actionInfo=o,t.updateDataSource(!0);var s=t;s.parent instanceof Kt&&s.axisField.render()}for(var l=0,d=[].slice.call(t.parentElement.querySelectorAll(".e-pivot-button"));l<d.length;l++){var p=d[l];if(p.getAttribute("data-uid")===e){p.focus();break}}})},e.prototype.refreshPivotButtonState=function(e,i){for(var a,r=0,n=[].slice.call(this.parentElement.querySelectorAll(".e-pivot-button"));r<n.length;r++){var o=n[r];if(o.getAttribute("data-uid")===e){a=o.querySelector(".e-btn-filter");break}}a&&(i?(t.removeClass([a],"e-pv-filter"),t.addClass([a],"e-pv-filtered")):(t.removeClass([a],"e-pv-filtered"),t.addClass([a],"e-pv-filter")))},e.prototype.removeDataSourceSettings=function(e,t,i){for(var a=this.parent.dataSourceSettings.filterSettings,r=0,n=a.length;r<n;r++)if("olap"===this.parent.dataType&&t){if(!i&&a[r].name===e&&a[r].selectedField===t){a.splice(r,1);break}i&&a[r].type!==i&&a[r].name===e&&(a.splice(r,1),n--,r--)}else if(a[r].name===e){if(a.splice(r,1),"olap"!==this.parent.dataType)break;n--,r--}},e.prototype.updateDropIndicator=function(e){if(this.parent.isDragging&&(t.removeClass([].slice.call(this.parentElement.querySelectorAll(".e-drop-indicator-last")),"e-drop-hover"),t.removeClass([].slice.call(this.parentElement.querySelectorAll(".e-drop-indicator")),"e-drop-hover"),t.closest(e.target,".e-droppable"))){var i=t.closest(e.target,".e-pvt-btn-div");t.addClass([i.querySelector(".e-drop-indicator")],"e-drop-hover")}},e.prototype.wireEvent=function(e,i,a){t.EventHandler.add(e,"mouseover",this.updateDropIndicator,this),a||(-1===["filters","values"].indexOf(i)&&null!==e.querySelector(".e-pivot-button")&&t.EventHandler.add(e.querySelector(".e-pivot-button"),"click",this.updateSorting,this),"values"!==i&&null!==e.querySelector(".e-btn-filter")&&t.EventHandler.add(e.querySelector(".e-btn-filter"),"click",this.updateFiltering,this),"values"===i&&null!==e.querySelector(".e-dropdown-icon")&&t.EventHandler.add(e.querySelector(".e-dropdown-icon"),"click",this.createMenuOption,this)),null!==e.querySelector(".e-edit")&&t.EventHandler.add(e.querySelector(".e-edit"),"click",this.openCalculatedFieldDialog,this),null!==e.querySelector(".e-remove")&&t.EventHandler.add(e.querySelector(".e-remove"),"click",this.removeButton,this)},e.prototype.unWireEvent=function(e,i,a){t.EventHandler.remove(e,"mouseover",this.updateDropIndicator),a||(-1===["filters","values"].indexOf(i)&&null!==e.querySelector(".e-pivot-button")&&t.EventHandler.remove(e.querySelector(".e-pivot-button"),"click",this.updateSorting),"values"!==i&&null!==e.querySelector(".e-btn-filter")&&t.EventHandler.remove(e.querySelector(".e-btn-filter"),"click",this.updateFiltering),"values"===i&&null!==e.querySelector(".e-dropdown-icon")&&t.EventHandler.remove(e.querySelector(".e-dropdown-icon"),"click",this.createMenuOption)),null!==e.querySelector(".e-edit")&&t.EventHandler.remove(e.querySelector(".e-edit"),"click",this.openCalculatedFieldDialog),null!==e.querySelector(".e-remove")&&t.EventHandler.remove(e.querySelector(".e-remove"),"click",this.removeButton)},e.prototype.addEventListener=function(){this.handlers={load:this.renderPivotButton},this.parent.isDestroyed||this.parent.on("pivot-button-update",this.handlers.load,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("pivot-button-update",this.handlers.load)},e.prototype.destroy=function(){this.menuOption&&(this.menuOption.destroy(),this.menuOption=null);var e=t.select(".e-group-chart-values-drodown-div",this.parentElement),i=e?t.getInstance(e,l.DropDownList):null;i&&!i.isDestroyed&&i.destroy();var a=(e=t.select(".e-group-chart-columns-dropdown-div",this.parentElement))?t.getInstance(e,l.DropDownList):null;a&&!a.isDestroyed&&(a.destroy(),a=null),this.draggable&&!this.draggable.isDestroyed&&(this.draggable.destroy(),this.draggable=null),this.axisField&&(this.axisField=null),this.removeEventListener(),this.isDestroyed=!0},e}(),zt=function(){function e(e){this.parent=e}return e.prototype.render=function(){(!this.parent.pivotButtonModule||this.parent.pivotButtonModule&&this.parent.pivotButtonModule.isDestroyed)&&new Gt(this.parent),this.createPivotButtons()},e.prototype.createPivotButtons=function(){var e=[this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.values,this.parent.dataSourceSettings.filters],t=this.parent.dialogRenderer.parentElement;if(t.querySelector(".e-field-list-filters")&&(t.querySelector(".e-field-list-filters").querySelector(".e-axis-content").innerHTML=""),t.querySelector(".e-field-list-rows")&&(t.querySelector(".e-field-list-rows").querySelector(".e-axis-content").innerHTML=""),t.querySelector(".e-field-list-columns")&&(t.querySelector(".e-field-list-columns").querySelector(".e-axis-content").innerHTML=""),t.querySelector(".e-field-list-values")&&(t.querySelector(".e-field-list-values").querySelector(".e-axis-content").innerHTML=""),"pivot"===this.parent.dataType&&this.parent.dataSourceSettings.dataSource&&(!(this.parent.dataSourceSettings.dataSource instanceof i.DataManager)&&this.parent.dataSourceSettings.dataSource.length>0||this.parent.dataSourceSettings.dataSource instanceof i.DataManager&&this.parent.engineModule.data&&this.parent.engineModule.data.length>0)||"olap"===this.parent.dataType&&this.parent.dataSourceSettings.url&&""!==this.parent.dataSourceSettings.url||"Server"===this.parent.dataSourceSettings.mode&&""!==this.parent.dataSourceSettings.url)for(var a=["rows","columns","values","filters"],r=0,n=e.length;r<n;r++)if(e[r]){var o={field:e[r],axis:a[r].toString()};this.parent.notify("pivot-button-update",o)}},e}(),Wt=function(){function e(e){this.parent=e,this.parent.dialogRenderer=new Ut(this.parent),this.parent.treeViewModule=new _t(this.parent),this.parent.axisTableModule=new Bt(this.parent),this.parent.axisFieldModule=new zt(this.parent)}return e.prototype.render=function(){this.parent.dialogRenderer.render(),this.parent.isAdaptive||this.parent.treeViewModule.render(),this.parent.axisTableModule.render()},e}(),Qt=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function a(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),Yt=function(e,t,i,a){var r,n=arguments.length,o=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},Kt=function(e){function a(t,i){var a=e.call(this,t,i)||this;return a.pivotChange=!1,a.isRequiredUpdate=!0,a.lastSortInfo={},a.lastFilterInfo={},a.lastAggregationInfo={},a.lastCalcFieldInfo={},a.isPopupView=!1,a.enableValueSorting=!1,a.request="undefined"!=typeof window?new XMLHttpRequest:null,a.remoteData=[],a.actionObj={},a.destroyEngine=!1,a.defaultFieldListOrder="None",a.isDeferUpdateApplied=!1,a.isInitial=!0,a}return Qt(a,e),a.prototype.requiredModules=function(){var e=[];return this.allowCalculatedField&&e.push({args:[this],member:"calculatedField"}),e},a.prototype.getAllSummaryType=function(){return["Sum","Count","DistinctCount","Product","Min","Max","Avg","Median","Index","PopulationVar","SampleVar","PopulationStDev","SampleStDev","RunningTotals","PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfParentColumnTotal","PercentageOfParentRowTotal","DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"]},a.prototype.preRender=function(){this.dataSourceSettings&&"SSAS"===this.dataSourceSettings.providerType?(this.olapEngineModule=new wt,this.dataType="olap"):(this.engineModule=new S,this.dataType="pivot"),this.isAdaptive=t.Browser.isDevice,this.globalize=new t.Internationalization(this.locale),this.renderModule=new Wt(this),this.defaultLocale={staticFieldList:"Pivot Field List",fieldList:"Field List",dropFilterPrompt:"Drop filter here",dropColPrompt:"Drop column here",dropRowPrompt:"Drop row here",dropValPrompt:"Drop value here",addPrompt:"Add field here",adaptiveFieldHeader:"Choose field",centerHeader:"Drag fields between axes below:",add:"Add",drag:"Drag",filter:"Filter",filtered:"Filtered",sort:"Sort",remove:"Remove",filters:"Filters",rows:"Rows",columns:"Columns",values:"Values",CalculatedField:"Calculated Field",createCalculatedField:"Create Calculated Field",fieldName:"Enter the field name",error:"Error",invalidFormula:"Invalid formula.",dropText:'Example: ("Sum(Order_Count)" + "Sum(In_Stock)") * 250',dropTextMobile:"Add fields and edit formula here.",dropAction:"Calculated field cannot be place in any other region except value axis.",search:"Search",close:"Close",cancel:"Cancel",delete:"Delete",alert:"Alert",warning:"Warning",ok:"OK",allFields:"All Fields",formula:"Formula",fieldExist:"A field already exists in this name. Please enter a different name.",confirmText:"A calculation field already exists in this name. Do you want to replace it?",noMatches:"No matches",format:"Summaries values by",edit:"Edit",clear:"Clear",clearCalculatedField:"Clear edited field info",editCalculatedField:"Edit calculated field",sortAscending:"Sort ascending order",sortDescending:"Sort descending order",sortNone:"Sort data order",formulaField:"Drag and drop fields to formula",dragField:"Drag field to formula",clearFilter:"Clear",by:"by",enterValue:"Enter value",chooseDate:"Enter date",all:"All",multipleItems:"Multiple items",Equals:"Equals",DoesNotEquals:"Does Not Equal",BeginWith:"Begins With",DoesNotBeginWith:"Does Not Begin With",EndsWith:"Ends With",DoesNotEndsWith:"Does Not End With",Contains:"Contains",DoesNotContains:"Does Not Contain",GreaterThan:"Greater Than",GreaterThanOrEqualTo:"Greater Than Or Equal To",LessThan:"Less Than",LessThanOrEqualTo:"Less Than Or Equal To",Between:"Between",NotBetween:"Not Between",Before:"Before",BeforeOrEqualTo:"Before Or Equal To",After:"After",AfterOrEqualTo:"After Or Equal To",member:"Member",label:"Label",date:"Date",value:"Value",labelTextContent:"Show the items for which the label",dateTextContent:"Show the items for which the date",valueTextContent:"Show the items for which",And:"and",Sum:"Sum",Count:"Count",DistinctCount:"Distinct Count",Product:"Product",Avg:"Avg",Median:"Median",Min:"Min",Max:"Max",Index:"Index",SampleStDev:"Sample StDev",PopulationStDev:"Population StDev",SampleVar:"Sample Var",PopulationVar:"Population Var",RunningTotals:"Running Totals",DifferenceFrom:"Difference From",PercentageOfDifferenceFrom:"% of Difference From",PercentageOfGrandTotal:"% of Grand Total",PercentageOfColumnTotal:"% of Column Total",PercentageOfRowTotal:"% of Row Total",PercentageOfParentTotal:"% of Parent Total",PercentageOfParentColumnTotal:"% of Parent Column Total",PercentageOfParentRowTotal:"% of Parent Row Total",MoreOption:"More...",Years:"Years",Quarters:"Quarters",Months:"Months",Days:"Days",Hours:"Hours",Minutes:"Minutes",Seconds:"Seconds",apply:"Apply",valueFieldSettings:"Value field settings",sourceName:"Field name :",sourceCaption:"Field caption",summarizeValuesBy:"Summarize values by",baseField:"Base field",baseItem:"Base item",example:"e.g:",editorDataLimitMsg:" more items. Search to refine further.",deferLayoutUpdate:"Defer Layout Update",null:"null",undefined:"undefined",groupOutOfRange:"Out of Range",fieldDropErrorAction:"The field you are moving cannot be placed in that area of the report",memberType:"Field Type",selectedHierarchy:"Parent Hierarchy",formatString:"Format",expressionField:"Expression",olapDropText:"Example: [Measures].[Order Quantity] + ([Measures].[Order Quantity] * 0.10)",customFormat:"Enter custom format string",numberFormatString:"Example: C, P, 0000 %, ###0.##0#, etc.",Measure:"Measure",Dimension:"Dimension",Standard:"Standard",Currency:"Currency",Percent:"Percent",Custom:"Custom",blank:"(Blank)",fieldTooltip:'Drag and drop fields to create an expression. And, if you want to edit the existing calculated fields! You can achieve it by simply selecting the field under "Calculated Members".',fieldTitle:"Field Name",QuarterYear:"Quarter Year",caption:"Field Caption",copy:"Copy",of:"of",group:"Group",removeCalculatedField:"Are you sure you want to delete this calculated field?",yes:"Yes",no:"No",None:"None",qtr:"Qtr",grandTotal:"Grand Total"},this.localeObj=new t.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.isDragging=!1,this.isDeferLayoutUpdate=t.isNullOrUndefined(this.isDeferLayoutUpdate)&&!this.isPopupView?this.allowDeferLayoutUpdate:this.isDeferLayoutUpdate,this.wireEvent()},a.prototype.frameCustomProperties=function(e,t){this.pivotGridModule&&this.pivotGridModule.updatePageSettings(!1);var i=!!this.pivotGridModule&&this.pivotGridModule.isTabular,a=this.pivotGridModule?this.pivotGridModule.pageSettings:this.pageSettings,r=!!this.pivotGridModule&&this.pivotGridModule.enablePaging,n=!!this.pivotGridModule&&this.pivotGridModule.enableVirtualization,o=this.pivotGridModule?this.pivotGridModule.enableHtmlSanitizer:this.enableHtmlSanitizer,s=this.pivotGridModule?this.pivotGridModule.localeObj:this.staticPivotGridModule?this.staticPivotGridModule.localeObj:this.localeObj,l=!this.pivotGridModule||(this.pivotGridModule.allowDrillThrough||this.pivotGridModule.editSettings.allowEditing),d=this.pivotGridModule?this.pivotGridModule.enableValueSorting:void 0,p=!(!this.pivotGridModule||!this.pivotGridModule.allowDataCompression)&&this.pivotGridModule.allowDataCompression,h=this.pivotGridModule&&this.pivotGridModule.enableVirtualization&&this.pivotGridModule.virtualScrollSettings&&this.pivotGridModule.virtualScrollSettings.allowSinglePage;return"olap"===this.dataType?{mode:"",savedFieldList:t||void 0,savedFieldListData:e||void 0,pageSettings:a,enableValueSorting:d,isDrillThrough:l,localeObj:s,enableVirtualization:n,allowDataCompression:p}:{mode:"",savedFieldList:void 0,pageSettings:a,enableValueSorting:d,isDrillThrough:l,localeObj:s,clonedReport:this.clonedReport,globalize:this.globalize,currenyCode:this.currencyCode,enablePaging:r,enableVirtualization:n,enableHtmlSanitizer:o,allowDataCompression:p,enableOptimizedRendering:h,isTabularLayout:i}},a.prototype.render=function(){"pivot"===this.dataType&&this.dataSourceSettings.url&&""!==this.dataSourceSettings.url?"Server"===this.dataSourceSettings.mode?(this.guid=f.generateUUID(),this.initialLoad()):new t.Fetch(this.dataSourceSettings.url,"GET").send().then(function(e){return"string"==typeof e?e:e.text()}).then(this.onReadyStateChange.bind(this)):this.initialLoad()},a.prototype.getEngine=function(e,t,i,a,r,n,o,s,l){var d=this;this.currentAction=e,this.pivotGridModule&&this.pivotGridModule.updatePageSettings(!1);var p={pageSettings:this.pivotGridModule?JSON.parse(this.pivotGridModule.getPageSettings()).pageSettings:void 0,enableValueSorting:this.pivotGridModule?this.pivotGridModule.enableValueSorting:void 0,enableDrillThrough:!this.pivotGridModule||(this.pivotGridModule.allowDrillThrough||this.pivotGridModule.editSettings.allowEditing),locale:JSON.stringify(f.getLocalizedObject(this)),enableOptimizedRendering:this.pivotGridModule&&this.pivotGridModule.enableVirtualization&&this.pivotGridModule.virtualScrollSettings&&this.pivotGridModule.virtualScrollSettings.allowSinglePage,requestType:"string",headers:{"Content-type":"application/json"}};this.request.readyState!==XMLHttpRequest.UNSENT&&this.request.readyState!==XMLHttpRequest.OPENED||(this.request.withCredentials=!1);var h={request:this.request,dataSourceSettings:JSON.parse(this.getPersistData()).dataSourceSettings,action:e,customProperties:{},internalProperties:p,drillItem:t,sortItem:i,aggregatedItem:a,calculatedItem:r,filterItem:n,memberName:o,fetchRawDataArgs:s,editArgs:l,hash:this.pivotGridModule?this.pivotGridModule.guid:this.guid,isGroupingUpdated:"onRefresh"===this.currentAction&&this.dataSourceSettings.groupSettings.length>0||!(!this.pivotGridModule||!this.pivotGridModule.groupingModule)&&this.pivotGridModule.groupingModule.isUpdate};this.trigger("beforeServiceInvoke",h,function(e){d.request=e.request,h.internalProperties=e.internalProperties,h.customProperties=e.customProperties,h.dataSourceSettings=e.dataSourceSettings,h.calculatedItem=e.calculatedItem,h.drillItem=e.drillItem,h.editArgs=e.editArgs,h.fetchRawDataArgs=e.fetchRawDataArgs,h.filterItem=e.filterItem,h.hash=e.hash,h.memberName=e.memberName,h.sortItem=e.sortItem}),this.request.open("POST",this.dataSourceSettings.url,!0),this.request.onreadystatechange=this.onSuccess.bind(this);for(var u=Object.keys(h.internalProperties.headers),c=0;c<u.length;c++){var g=u[c],m=String(h.internalProperties.headers[g]);this.request.setRequestHeader(g,m)}"string"===h.internalProperties.requestType?this.request.send(JSON.stringify(h)):"base64"===h.internalProperties.requestType&&this.request.send(btoa(JSON.stringify(h)))},a.prototype.onSuccess=function(){if(this.request.readyState===XMLHttpRequest.DONE){try{var e={action:this.currentAction,response:this.request.responseText};this.trigger("afterServiceInvoke",e);var i=JSON.parse(this.request.responseText);if("fetchFieldMembers"===this.currentAction){var a=JSON.parse(i.members),r=[],n={};this.engineModule.globalize=t.isNullOrUndefined(this.globalize)?new t.Internationalization:this.globalize,this.engineModule.formatFields=this.engineModule.setFormattedFields(this.dataSourceSettings.formatSettings);for(var o=f.isDateField(i.memberName,this.engineModule),s="number"===this.engineModule.fieldList[i.memberName].type,l=0,d=(c=Object.keys(a)).length;l<d;l++){var p=a[c[l]],h=o?this.engineModule.getFormattedValue(p.Name,i.memberName):{formattedText:p.Caption};n[c[l]]={index:p.Index,ordinal:p.Ordinal,isDrilled:p.IsDrilled,caption:h.formattedText},r.push({formattedText:h.formattedText,actualText:o?h.dateText:s?isNaN(Number(p.Name))?p.Name:Number(p.Name):p.Name})}this.engineModule.fieldList[i.memberName].members=n,this.engineModule.fieldList[i.memberName].dateMember=r,this.pivotButtonModule.updateFilterEvents()}else{var u=f.formatFieldList(JSON.parse(i.fieldList));if(this.engineModule.fieldList)for(var c=Object.keys(this.engineModule.fieldList),l=0;l<c.length;l++)this.engineModule.fieldList[c[l]]&&u[c[l]]&&(u[c[l]].dateMember=this.engineModule.fieldList[c[l]].dateMember,u[c[l]].formattedMembers=this.engineModule.fieldList[c[l]].formattedMembers,u[c[l]].members=this.engineModule.fieldList[c[l]].members);this.engineModule.fieldList=u,this.engineModule.fields=JSON.parse(i.fields),this.engineModule.rowCount=JSON.parse(i.pivotCount).RowCount,this.engineModule.columnCount=JSON.parse(i.pivotCount).ColumnCount,this.engineModule.rowStartPos=JSON.parse(i.pivotCount).RowStartPosition,this.engineModule.colStartPos=JSON.parse(i.pivotCount).ColumnStartPosition,this.engineModule.rowFirstLvl=JSON.parse(i.pivotCount).RowFirstLevel,this.engineModule.colFirstLvl=JSON.parse(i.pivotCount).ColumnFirstLevel;for(var g=void 0,m=f.formatPivotValues(JSON.parse(i.pivotValue)),v=0;v<m.length;v++)if(m[v]&&m[v][0]&&"row"===m[v][0].axis){g=v;break}this.engineModule.headerContent=f.frameContent(m,"header",g,this),this.engineModule.pageSettings=this.pivotGridModule?this.pivotGridModule.pageSettings:void 0;var S=JSON.parse(i.dataSourceSettings).ValueSortSettings;this.engineModule.valueSortSettings={headerText:S.HeaderText,headerDelimiter:S.HeaderDelimiter,sortOrder:S.SortOrder,columnIndex:S.ColumnIndex},this.engineModule.pivotValues=m,this.engineModule.isEmptyData=0===this.dataSourceSettings.values.length}}catch(e){this.engineModule.pivotValues=[]}"fetchFieldMembers"!==this.currentAction&&(this.isInitial&&!this.isPopupView?(this.initEngine(),this.isInitial=!1):this.enginePopulatedEventMethod(this,!0,!1),this.calculatedFieldModule&&"onCalcOperation"===this.currentAction&&(this.calculatedFieldModule.endDialog(),this.calculatedFieldModule.isRequireUpdate&&(this.calculatedFieldModule.isRequireUpdate=!1)),this.pivotGridModule&&this.pivotGridModule.calculatedFieldModule&&this.pivotGridModule.calculatedFieldModule.isRequireUpdate&&(this.pivotGridModule.calculatedFieldModule.endDialog(),this.pivotGridModule.calculatedFieldModule.isRequireUpdate=!1))}},a.prototype.onReadyStateChange=function(e){var i=[];if("CSV"===this.dataSourceSettings.type)for(var a=e.split(/\r?\n|\r/),r=0;r<a.length;r++)t.isNullOrUndefined(a[r])||""===a[r]||i.push(a[r].split(","));else try{i=JSON.parse(e)}catch(e){i=[]}i&&i.length>0&&this.setProperties({dataSourceSettings:{dataSource:i}},!0),this.initialLoad()},a.prototype.initialLoad=function(){var e=this,i={dataSourceSettings:this.dataSourceSettings,defaultFieldListOrder:this.defaultFieldListOrder};this.trigger("load",i,function(a){e.dataSourceSettings=a.dataSourceSettings,e.defaultFieldListOrder=i.defaultFieldListOrder,t.addClass([e.element],M),e.enableRtl?t.addClass([e.element],D):t.removeClass([e.element],D),e.isAdaptive?t.addClass([e.element],O):t.removeClass([e.element],O),e.cssClass&&t.addClass([e.element],e.cssClass.split(" ")),e.notify(y,{})})},a.prototype.wireEvent=function(){this.on(y,this.generateData,this),this.on(x,this.fieldListRender,this)},a.prototype.unWireEvent=function(){this.pivotGridModule&&this.pivotGridModule.isDestroyed||(this.off(y,this.generateData),this.off(x,this.fieldListRender))},a.prototype.getPersistData=function(){var e=["dataSourceSettings"];return this.addOnPersist(e)},a.prototype.getModuleName=function(){return"pivotfieldlist"},a.prototype.onPropertyChanged=function(i,a){for(var r=!1,n=0,o=Object.keys(i);n<o.length;n++){var s=o[n];switch(s){case"locale":e.prototype.refresh.call(this);break;case"dataSourceSettings":if(i.dataSourceSettings&&(!t.isNullOrUndefined(i.dataSourceSettings.dataSource)&&this.clonedDataSet!==i.dataSourceSettings.dataSource&&i.dataSourceSettings.groupSettings||1===Object.keys(i.dataSourceSettings).length&&"dataSource"===Object.keys(i.dataSourceSettings)[0]&&this.dataSourceSettings.groupSettings.length>0)&&(this.clonedDataSet=i.dataSourceSettings.dataSource,this.engineModule.groupingFields={}),(t.isNullOrUndefined(i.dataSourceSettings.dataSource)||i.dataSourceSettings.groupSettings&&i.dataSourceSettings.groupSettings.length>0)&&("olap"!==this.dataType||t.isNullOrUndefined(i.dataSourceSettings.url))||("olap"!==this.dataType&&(t.isNullOrUndefined(this.savedDataSourceSettings)||(f.updateDataSourceSettings(this.staticPivotGridModule,this.savedDataSourceSettings),this.savedDataSourceSettings=void 0),i.dataSourceSettings.dataSource&&0===i.dataSourceSettings.dataSource.length&&!t.isNullOrUndefined(this.staticPivotGridModule)&&(this.savedDataSourceSettings=f.getClonedDataSourceSettings(this.staticPivotGridModule.dataSourceSettings),this.staticPivotGridModule.setProperties({dataSourceSettings:{rows:[],columns:[],values:[],filters:[]}},!0))),"pivot"===this.dataType?(this.engineModule.fieldList=null,this.engineModule.isEmptyData=!0,this.engineModule.data=[],this.engineModule.pivotValues=[],this.engineModule.groupingFieldsInfo={}):"olap"===this.dataType&&(this.olapEngineModule.fieldList={},this.olapEngineModule.fieldListData=void 0,this.olapEngineModule.isEmptyData=!0),t.isNullOrUndefined(this.staticPivotGridModule)||(this.staticPivotGridModule.pivotValues=[]),this.initialLoad()),f.isButtonIconRefesh(s,a,i)){if(this.isPopupView&&this.pivotGridModule&&this.pivotGridModule.showGroupingBar&&this.pivotGridModule.groupingBarModule){var l=f.cloneFieldSettings(this.dataSourceSettings.filters),d=f.cloneFieldSettings(this.dataSourceSettings.values),p=f.cloneFieldSettings(this.dataSourceSettings.rows),h=f.cloneFieldSettings(this.dataSourceSettings.columns);this.pivotGridModule.setProperties({dataSourceSettings:{rows:p,columns:h,values:d,filters:l}},!0),this.pivotGridModule.axisFieldModule.render()}else if(!this.isPopupView&&this.staticPivotGridModule&&!this.staticPivotGridModule.isDestroyed){var u=this.staticPivotGridModule;if(u.showGroupingBar&&u.groupingBarModule&&u.axisFieldModule.render(),u.showFieldList&&u.pivotFieldListModule){var p=f.cloneFieldSettings(u.dataSourceSettings.rows),h=f.cloneFieldSettings(u.dataSourceSettings.columns),d=f.cloneFieldSettings(u.dataSourceSettings.values),l=f.cloneFieldSettings(u.dataSourceSettings.filters);u.pivotFieldListModule.setProperties({dataSourceSettings:{rows:p,columns:h,values:d,filters:l}},!0),u.pivotFieldListModule.axisFieldModule.render(),u.pivotFieldListModule.treeViewModule.fieldTable&&!u.isAdaptive&&u.pivotFieldListModule.notify(w,{})}}this.axisFieldModule.render(),this.treeViewModule.fieldTable&&!this.isAdaptive&&this.notify(w,{})}break;case"aggregateTypes":this.axisFieldModule&&this.axisFieldModule.render(),this.pivotGridModule&&this.pivotGridModule.axisFieldModule&&(this.pivotGridModule.setProperties({aggregateTypes:i.aggregateTypes},!0),this.pivotGridModule.axisFieldModule.render());break;case"showValuesButton":this.axisFieldModule&&this.axisFieldModule.render(),this.pivotGridModule&&this.pivotGridModule.showGroupingBar&&this.pivotGridModule.groupingBarModule&&this.pivotGridModule.axisFieldModule&&(this.pivotGridModule.setProperties({showValuesButton:i.showValuesButton},!0),this.pivotGridModule.axisFieldModule.render());break;case"enableRtl":this.enableRtl?t.addClass([this.element],D):t.removeClass([this.element],D),r=!0;break;case"enableFieldSearching":case"allowDeferLayoutUpdate":case"allowCalculatedField":this.refresh()}r&&this.fieldListRender()}},a.prototype.initEngine=function(){var e=this;if("pivot"===this.dataType){var i=t.isNullOrUndefined(this.dataSourceSettings.dataSource)?t.isNullOrUndefined(this.engineModule.data)?void 0:this.engineModule.data[0]:this.dataSourceSettings.dataSource[0];if(i&&this.pivotCommon){var a="[object Array]"===Object.prototype.toString.call(i);if(a&&"JSON"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidJSON"));if(!a&&"CSV"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidCSV"))}}var r={dataSourceSettings:f.getClonedDataSourceSettings(this.dataSourceSettings)},n=this.isPopupView?this.pivotGridModule:this;n.trigger("enginePopulating",r,function(t){if(f.updateDataSourceSettings(e,t.dataSourceSettings),"pivot"===e.dataType){if(e.dataSourceSettings.groupSettings&&e.dataSourceSettings.groupSettings.length>0){var i=e.dataSourceSettings.dataSource;e.clonedDataSet=e.clonedDataSet?e.clonedDataSet:"CSV"===e.dataSourceSettings.type?f.getClonedCSVData(i):f.getClonedData(i);var a=JSON.parse(e.getPersistData()).dataSourceSettings;a.dataSource=[],e.clonedReport=e.clonedReport?e.clonedReport:a}var r=e.frameCustomProperties();r.enableValueSorting=e.staticPivotGridModule?e.staticPivotGridModule.enableValueSorting:e.enableValueSorting,"Server"!==e.dataSourceSettings.mode&&e.engineModule.renderEngine(e.dataSourceSettings,r,e.aggregateCellInfo?e.getValueCellInfo.bind(e):void 0,e.onHeadersSort?e.getHeaderSortInfo.bind(e):void 0),e.pivotFieldList=e.engineModule.fieldList;var o={pivotFieldList:e.pivotFieldList,pivotValues:e.engineModule.pivotValues},s=e;n.trigger("enginePopulated",o,function(e){s.pivotFieldList=e.pivotFieldList,s.engineModule.pivotValues=e.pivotValues,s.notify(x,{}),s.trigger("dataBound")})}else if("olap"===e.dataType){f.renderOlapEngine(e),e.pivotFieldList=e.olapEngineModule.fieldList;var o={pivotFieldList:e.pivotFieldList,pivotValues:e.olapEngineModule.pivotValues},l=e;n.trigger("enginePopulated",o,function(e){l.pivotFieldList=e.pivotFieldList,l.olapEngineModule.pivotValues=e.pivotValues,l.notify(x,{}),l.trigger("dataBound")})}}),"None"!==this.defaultFieldListOrder&&this.treeViewModule.fieldTable&&!this.isAdaptive&&this.notify(w,{})},a.prototype.generateData=function(){this.pivotFieldList={},this.dataSourceSettings&&(this.dataSourceSettings.dataSource||this.dataSourceSettings.url)?""!==this.dataSourceSettings.url&&"olap"===this.dataType||!t.isNullOrUndefined(this.dataSourceSettings.dataSource)&&this.dataSourceSettings.dataSource.length>0?("pivot"===this.dataType&&(this.engineModule.data=this.dataSourceSettings.dataSource),this.initEngine()):this.dataSourceSettings.dataSource instanceof i.DataManager?"pivot"===this.dataType&&this.remoteData.length>0?(this.engineModule.data=this.remoteData,this.initEngine()):setTimeout(this.getData.bind(this),100):"Server"===this.dataSourceSettings.mode?this.getEngine("onRefresh"):this.notify(x,{}):(this.notify(x,{}),this.trigger("dataBound"))},a.prototype.getValueCellInfo=function(e){var t=e;return this.trigger("aggregateCellInfo",t),t},a.prototype.getHeaderSortInfo=function(e){var t=e;return this.trigger("onHeadersSort",t),t},a.prototype.getData=function(){this.dataSourceSettings.dataSource.defaultQuery?this.dataSourceSettings.dataSource.executeQuery(this.dataSourceSettings.dataSource.defaultQuery).then(this.executeQuery.bind(this)):this.dataSourceSettings.dataSource.executeQuery(new i.Query).then(this.executeQuery.bind(this))},a.prototype.executeQuery=function(e){this.engineModule.data=e.result,this.initEngine()},a.prototype.fieldListRender=function(){this.element.innerHTML="";var e;"Popup"===this.renderMode&&this.dialogRenderer.fieldListDialog&&!this.dialogRenderer.fieldListDialog.isDestroyed&&(e=this.dialogRenderer.fieldListDialog.visible,this.dialogRenderer.fieldListDialog.destroy(),t.remove(document.getElementById(this.element.id+"_Container"))),this.renderModule.render(),"Popup"===this.renderMode?(this.fieldListSpinnerElement=this.dialogRenderer.fieldListDialog.element,e&&this.dialogRenderer.fieldListDialog.show()):this.fieldListSpinnerElement=this.element.querySelector(".e-pivotfieldlist-container"),this.spinnerTemplate?r.createSpinner({target:this.fieldListSpinnerElement,template:this.spinnerTemplate,cssClass:this.cssClass?this.cssClass:void 0},this.createElement):r.createSpinner({target:this.fieldListSpinnerElement,cssClass:this.cssClass?this.cssClass:void 0},this.createElement);var i={pivotEngine:"olap"===this.dataType?this.olapEngineModule:this.engineModule,dataSourceSettings:this.dataSourceSettings,id:this.element.id,element:"Popup"===this.renderMode?this.dialogRenderer.fieldListDialog.element:t.select("#"+this.element.id+"_Container",this.element),moduleName:this.getModuleName(),enableRtl:this.enableRtl,enableHtmlSanitizer:this.enableHtmlSanitizer,isAdaptive:this.isAdaptive,renderMode:this.renderMode,localeObj:this.localeObj,dataType:this.dataType,cssClass:this.cssClass};this.pivotCommon=new ne(i),this.pivotCommon.control=this,this.allowDeferLayoutUpdate&&(this.clonedDataSource=f.getClonedDataSourceSettings(this.dataSourceSettings),"olap"===this.dataType&&(this.clonedFieldListData=f.cloneOlapFieldSettings(this.olapEngineModule.fieldListData)),this.clonedFieldList=f.getClonedFieldList(this.pivotFieldList))},a.prototype.getFieldCaption=function(e){var t=this.getFields(e),i="olap"===this.dataType?this.olapEngineModule:this.engineModule;if(t.length>0&&i&&i.fieldList)for(var a=t.length;a--;)if(t[a])for(var r=0,n=t[a];r<n.length;r++){var o=n[r];o&&i.fieldList[o.name]&&(o.caption?i.fieldList[o.name].caption=o.caption:i.fieldList[o.name].caption=o.name)}},a.prototype.getFields=function(e){return[e.rows,e.columns,e.values,e.filters]},a.prototype.updateDataSource=function(e,i){var a=this;this.pivotGridModule&&this.pivotGridModule.showWaitingPopup(),r.showSpinner(this.fieldListSpinnerElement);var n=this,o=n.isPopupView?n.pivotGridModule:n,s=!1,l=n.pivotGridModule&&(n.pivotGridModule.enableVirtualization||n.pivotGridModule.enablePaging)?n.pivotGridModule.pageSettings:void 0,d=Object.keys(n.lastCalcFieldInfo).length>0,p=Object.keys(n.lastSortInfo).length>0,h=Object.keys(n.lastAggregationInfo).length>0,u=Object.keys(n.lastFilterInfo).length>0,c={dataSourceSettings:f.getClonedDataSourceSettings(n.dataSourceSettings)};o.trigger("enginePopulating",c,function(c){if(l&&(p||u||h||d)||(f.updateDataSourceSettings(n,c.dataSourceSettings),f.updateDataSourceSettings(n.pivotGridModule,c.dataSourceSettings)),t.isNullOrUndefined(i)){var g=!p&&(n.staticPivotGridModule?n.staticPivotGridModule.enableValueSorting:n.enableValueSorting);if(p&&""!==n.dataSourceSettings.valueSortSettings.headerText&&(n.pivotGridModule&&n.pivotGridModule.setProperties({dataSourceSettings:{valueSortSettings:{headerText:""}}},!0),n.setProperties({dataSourceSettings:{valueSortSettings:{headerText:""}}},!0)),"pivot"===n.dataType){var m=n.frameCustomProperties();m.enableValueSorting=g,m.savedFieldList=n.pivotFieldList,l&&(p||u||h||d)&&!n.allowDeferLayoutUpdate?(p&&("Server"===o.dataSourceSettings.mode?o.getEngine("onSort",null,n.lastSortInfo,null,null,null,null):n.engineModule.onSort(n.lastSortInfo),n.lastSortInfo={}),u&&("Server"===o.dataSourceSettings.mode?o.getEngine("onFilter",null,null,null,null,n.lastFilterInfo,null):n.engineModule.onFilter(n.lastFilterInfo,n.dataSourceSettings),n.lastFilterInfo={}),h&&("Server"===o.dataSourceSettings.mode?o.getEngine("onAggregation",null,null,n.lastAggregationInfo,null,null,null):n.engineModule.onAggregation(n.lastAggregationInfo),n.lastAggregationInfo={}),d&&("Server"===o.dataSourceSettings.mode?o.getEngine("onCalcOperation",null,null,null,n.lastCalcFieldInfo,null,null):n.engineModule.onCalcOperation(n.lastCalcFieldInfo,n.dataSourceSettings),n.lastCalcFieldInfo={})):("Server"===n.dataSourceSettings.mode?p?n.getEngine("onSort",null,n.lastSortInfo,null,null,null,null):h?n.getEngine("onAggregation",null,null,n.lastAggregationInfo,null,null,null):d?n.getEngine("onCalcOperation",null,null,null,n.lastCalcFieldInfo,null,null):u?n.getEngine("onFilter",null,null,null,null,n.lastFilterInfo,null):n.getEngine("onDrop",null,null,null,null,null,null):n.engineModule.renderEngine(n.dataSourceSettings,m,n.aggregateCellInfo?n.getValueCellInfo.bind(n):void 0,n.onHeadersSort?n.getHeaderSortInfo.bind(n):void 0),n.lastSortInfo={},n.lastAggregationInfo={},n.lastCalcFieldInfo={},n.lastFilterInfo={})}else s=n.updateOlapDataSource(n,p,d,s,g,u);n.getFieldCaption(n.dataSourceSettings)}else n.axisFieldModule.render(),n.pivotGridModule&&n.pivotGridModule.notify(b,n),n.isRequiredUpdate=!1;"Server"!==n.dataSourceSettings.mode?n.enginePopulatedEventMethod(n,e,s):(n.allowDeferLayoutUpdate&&!n.isRequiredUpdate||n.isRequiredUpdate)&&(r.hideSpinner(a.fieldListSpinnerElement),a.pivotGridModule&&a.pivotGridModule.hideWaitingPopup())})},a.prototype.enginePopulatedEventMethod=function(e,i,a){var n=this,o=e.isPopupView?e.pivotGridModule:e,s={dataSourceSettings:e.dataSourceSettings,pivotFieldList:"pivot"===e.dataType?e.engineModule.fieldList:e.olapEngineModule.fieldList,pivotValues:"pivot"===e.dataType?e.engineModule.pivotValues:e.olapEngineModule.pivotValues};o.trigger("enginePopulated",s,function(o){e.dataSourceSettings=o.dataSourceSettings,e.pivotCommon.dataSourceSettings=e.dataSourceSettings,e.pivotFieldList=o.pivotFieldList,"olap"===e.dataType?(e.olapEngineModule.pivotValues=o.pivotValues,e.pivotCommon.engineModule=e.olapEngineModule):(e.engineModule.pivotValues=o.pivotValues,e.pivotCommon.engineModule=e.engineModule),i||!e.treeViewModule.fieldTable||e.isAdaptive||e.notify(w,{}),e.isRequiredUpdate?(e.allowDeferLayoutUpdate&&(e.clonedDataSource=f.getClonedDataSourceSettings(e.dataSourceSettings),"olap"===n.dataType&&(n.clonedFieldListData=f.cloneOlapFieldSettings(n.olapEngineModule.fieldListData)),e.clonedFieldList=f.getClonedFieldList(e.pivotFieldList)),e.updateView(e.pivotGridModule)):n.isPopupView&&(n.isDeferLayoutUpdate||e.pivotGridModule&&e.pivotGridModule.pivotDeferLayoutUpdate)&&(e.pivotGridModule.engineModule=e.engineModule,e.pivotGridModule.setProperties({dataSourceSettings:e.dataSourceSettings.properties},!0),e.pivotGridModule.notify(b,e),r.hideSpinner(e.fieldListSpinnerElement)),(n.isPopupView&&e.pivotGridModule&&e.pivotGridModule.allowDeferLayoutUpdate&&!e.isRequiredUpdate||!t.isNullOrUndefined(e.pivotGridModule))&&(r.hideSpinner(e.fieldListSpinnerElement),e.pivotGridModule.hideWaitingPopup()),e.isRequiredUpdate=!0,!e.pivotGridModule||a?r.hideSpinner(e.fieldListSpinnerElement):e.pivotGridModule.fieldListSpinnerElement=e.fieldListSpinnerElement});var l=this.getActionCompleteName();this.actionObj.actionName=l,this.actionObj.actionName&&this.actionCompleteMethod()},a.prototype.updateOlapDataSource=function(e,t,i,a,r,n){var o=e.frameCustomProperties(e.olapEngineModule.fieldListData,e.olapEngineModule.fieldList);return o.enableValueSorting=r,o.savedFieldList=e.pivotFieldList,!i&&!t||n?f.renderOlapEngine(e,o):(e.olapEngineModule.savedFieldList=e.pivotFieldList,e.olapEngineModule.savedFieldListData=e.olapEngineModule.fieldListData,i?(e.olapEngineModule.updateCalcFields(e.dataSourceSettings,e.lastCalcFieldInfo),e.lastCalcFieldInfo={},a=!e.olapEngineModule.dataFields[e.lastCalcFieldInfo.name],e.pivotGridModule&&e.pivotGridModule.hideWaitingPopup()):e.olapEngineModule.onSort(e.dataSourceSettings)),e.lastSortInfo={},e.lastAggregationInfo={},e.lastCalcFieldInfo={},e.lastFilterInfo={},a},a.prototype.update=function(e){e&&(this.clonedDataSet=e.clonedDataSet,this.clonedReport=e.clonedReport,this.setProperties({dataSourceSettings:e.dataSourceSettings,showValuesButton:e.showValuesButton},!0),this.engineModule=e.engineModule,this.olapEngineModule=e.olapEngineModule,this.dataType=e.dataType,this.pivotFieldList="olap"===this.dataType?e.olapEngineModule.fieldList:e.engineModule.fieldList,this.isPopupView?this.pivotGridModule=e:this.staticPivotGridModule=e,this.getFieldCaption(e.dataSourceSettings),this.pivotCommon.engineModule="olap"===this.dataType?this.olapEngineModule:this.engineModule,this.pivotCommon.dataSourceSettings=this.dataSourceSettings,this.pivotCommon.control=this,this.treeViewModule.fieldTable&&!this.isAdaptive&&this.notify(w,{}),this.axisFieldModule.render(),!this.isPopupView&&this.allowDeferLayoutUpdate&&(this.clonedDataSource=f.getClonedDataSourceSettings(this.dataSourceSettings),"olap"===this.dataType&&(this.clonedFieldListData=f.cloneOlapFieldSettings(this.olapEngineModule.fieldListData)),this.clonedFieldList=f.getClonedFieldList(this.pivotFieldList)))},a.prototype.updateView=function(e){if(e){var t="Calculated field applied"===this.actionObj.actionName&&"olap"===e.dataType;!e.element.querySelector(".e-spin-hide")||t||this.allowDeferLayoutUpdate&&!this.isDeferUpdateApplied&&!e.isInitial||e.showWaitingPopup(),e.clonedDataSet=this.clonedDataSet,e.clonedReport=this.clonedReport,e.setProperties({dataSourceSettings:this.dataSourceSettings,showValuesButton:this.showValuesButton},!0),e.engineModule=this.engineModule,e.olapEngineModule=this.olapEngineModule,e.dataType=this.dataType,this.pivotChange||(e.pivotValues="olap"===this.dataType?this.olapEngineModule.pivotValues:this.engineModule.pivotValues);var i={dataSourceSettings:f.getClonedDataSourceSettings(e.dataSourceSettings),pivotValues:e.pivotValues};e.trigger("fieldListRefreshed",i),this.isPopupView||(e.guid=this.guid,this.staticPivotGridModule=e,e.isStaticRefresh=!0),this.isDeferUpdateApplied=!1,this.staticPivotGridModule&&(this.staticPivotGridModule.isServerWaitingPopup=!0),e.dataBind()}},a.prototype.triggerPopulateEvent=function(){var e=this,t=this.isPopupView?this.pivotGridModule:this,i={dataSourceSettings:this.dataSourceSettings,pivotFieldList:"olap"===this.dataType?this.olapEngineModule.fieldList:this.engineModule.fieldList,pivotValues:"olap"===this.dataType?this.olapEngineModule.pivotValues:this.engineModule.pivotValues};t.trigger("enginePopulated",i,function(t){e.dataSourceSettings=t.dataSourceSettings,e.pivotFieldList=t.pivotFieldList,"olap"===e.dataType?e.olapEngineModule.pivotValues=t.pivotValues:e.engineModule.pivotValues=t.pivotValues})},a.prototype.actionBeginMethod=function(){var e={dataSourceSettings:f.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,cancel:!1};return(this.isPopupView?this.pivotGridModule:this).trigger("actionBegin",e),e.cancel},a.prototype.actionCompleteMethod=function(){var e={dataSourceSettings:f.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,actionInfo:this.actionObj.actionInfo};(this.isPopupView?this.pivotGridModule:this).trigger("actionComplete",e),this.actionObj.actionName="",this.actionObj.actionInfo=void 0,this.actionObj.fieldInfo=void 0},a.prototype.actionFailureMethod=function(e){var t={actionName:this.actionObj.actionName,errorInfo:e};(this.isPopupView?this.pivotGridModule:this).trigger("actionFailure",t)},a.prototype.getActionCompleteName=function(){return"Open calculated field dialog"===this.actionObj.actionName?"Calculated field applied":"Edit calculated field"===this.actionObj.actionName?"Calculated field edited":"Sort field"===this.actionObj.actionName?"Field sorted":"Filter field"===this.actionObj.actionName?"Field filtered":"Remove field"===this.actionObj.actionName?"Field removed":"Aggregate field"===this.actionObj.actionName?"Field aggregated":"Sort field tree"===this.actionObj.actionName?"Field tree sorted":this.actionObj.actionName},a.prototype.destroy=function(){this.unWireEvent(),this.engineModule&&!this.destroyEngine&&(this.engineModule.fieldList={},this.engineModule.rMembers=null,this.engineModule.cMembers=null,this.engineModule.valueMatrix=[],this.engineModule={}),this.olapEngineModule&&!this.destroyEngine&&(this.olapEngineModule.fieldList={},this.olapEngineModule={}),this.pivotFieldList&&(this.pivotFieldList={}),this.contextMenuModule&&this.contextMenuModule.destroy(),this.treeViewModule&&this.treeViewModule.destroy(),this.pivotButtonModule&&this.pivotButtonModule.destroy(),this.pivotCommon&&this.pivotCommon.destroy(),this.dialogRenderer&&this.dialogRenderer.destroy(),this.calculatedFieldModule&&this.calculatedFieldModule.destroy(),e.prototype.destroy.call(this),this.contextMenuModule&&(this.contextMenuModule=null),this.treeViewModule&&(this.treeViewModule=null),this.pivotButtonModule&&(this.pivotButtonModule=null),this.pivotCommon&&(this.pivotCommon=null),this.dialogRenderer&&(this.dialogRenderer=null),this.calculatedFieldModule&&(this.calculatedFieldModule=null),this.axisFieldModule&&(this.axisFieldModule=null),this.axisTableModule&&(this.axisTableModule=null),this.renderModule&&(this.renderModule=null),this.clonedDataSet&&(this.clonedDataSet=null),this.clonedReport&&(this.clonedReport=null),this.clonedFieldList&&(this.clonedFieldList=null),this.clonedFieldListData&&(this.clonedFieldListData=null),this.localeObj&&(this.localeObj=null),this.defaultLocale&&(this.defaultLocale=null),this.element.innerHTML="",t.removeClass([this.element],M),t.removeClass([this.element],D),t.removeClass([this.element],O)},Yt([t.Complex({},xe)],a.prototype,"dataSourceSettings",void 0),Yt([t.Property("Popup")],a.prototype,"renderMode",void 0),Yt([t.Property()],a.prototype,"target",void 0),Yt([t.Property("")],a.prototype,"cssClass",void 0),Yt([t.Property(!1)],a.prototype,"enableHtmlSanitizer",void 0),Yt([t.Property(!1)],a.prototype,"allowCalculatedField",void 0),Yt([t.Property(!1)],a.prototype,"enableFieldSearching",void 0),Yt([t.Property(!1)],a.prototype,"showValuesButton",void 0),Yt([t.Property(!1)],a.prototype,"allowDeferLayoutUpdate",void 0),Yt([t.Property(1e3)],a.prototype,"maxNodeLimitInMemberEditor",void 0),Yt([t.Property(!0)],a.prototype,"loadOnDemandInMemberEditor",void 0),Yt([t.Property()],a.prototype,"spinnerTemplate",void 0),Yt([t.Property(["Sum","Count","DistinctCount","Product","Min","Max","Avg","Median","Index","PopulationVar","SampleVar","PopulationStDev","SampleStDev","RunningTotals","PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfParentColumnTotal","PercentageOfParentRowTotal","DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"])],a.prototype,"aggregateTypes",void 0),Yt([t.Property("USD")],a.prototype,"currencyCode",void 0),Yt([t.Event()],a.prototype,"load",void 0),Yt([t.Event()],a.prototype,"enginePopulating",void 0),Yt([t.Event()],a.prototype,"memberFiltering",void 0),Yt([t.Event()],a.prototype,"enginePopulated",void 0),Yt([t.Event()],a.prototype,"onFieldDropped",void 0),Yt([t.Event()],a.prototype,"fieldDrop",void 0),Yt([t.Event()],a.prototype,"fieldDragStart",void 0),Yt([t.Event()],a.prototype,"aggregateCellInfo",void 0),Yt([t.Event()],a.prototype,"memberEditorOpen",void 0),Yt([t.Event()],a.prototype,"calculatedFieldCreate",void 0),Yt([t.Event()],a.prototype,"aggregateMenuOpen",void 0),Yt([t.Event()],a.prototype,"fieldRemove",void 0),Yt([t.Event()],a.prototype,"dataBound",void 0),Yt([t.Event()],a.prototype,"created",void 0),Yt([t.Event()],a.prototype,"destroyed",void 0),Yt([t.Event()],a.prototype,"beforeServiceInvoke",void 0),Yt([t.Event()],a.prototype,"afterServiceInvoke",void 0),Yt([t.Event()],a.prototype,"actionBegin",void 0),Yt([t.Event()],a.prototype,"actionComplete",void 0),Yt([t.Event()],a.prototype,"actionFailure",void 0),Yt([t.Event()],a.prototype,"onHeadersSort",void 0),a=Yt([t.NotifyPropertyChanges],a)}(t.Component),Xt="PopulationVar",Jt="CalculatedField",Zt=function(){function e(e){this.isFormula=!1,this.isRequireUpdate=!1,this.formatTypes=["Standard","Currency","Percent","Custom","None"],this.parent=e,this.existingReport=null,this.parent.calculatedFieldModule=this,this.removeEventListener(),this.addEventListener(),this.parentID=this.parent.element.id,this.treeObj=null,this.droppable=null,this.newFields=null,this.isFieldExist=!0,this.formulaText=null,this.fieldText=null,this.formatText=null,this.formatType=null,this.fieldType=null,this.parentHierarchy=null,this.isEdit=!1,this.currentFieldName=null}return e.prototype.getModuleName=function(){return"calculatedField"},e.prototype.keyActionHandler=function(e){var i=e.currentTarget.querySelector(".e-node-focus");if(i)switch(e.action){case"moveRight":case"shiftE":"pivot"===this.parent.dataType&&this.displayMenu(i);break;case"delete":"LI"===i.tagName&&!i.querySelector(".e-list-icon.e-format")&&!i.querySelector(".e-list-icon").classList.contains(".e-icons")&&i.querySelector("."+G)&&i.querySelector("."+G).classList.contains("e-list-icon")&&this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),{},!0,i);break;case"enter":var a=i.getAttribute("data-field"),n=t.getInstance(t.select("#"+this.parentID+"calculateddialog",document),r.Dialog),o=i.getAttribute("data-type"),s=t.select("#"+this.parentID+"droppable",n.element);"pivot"===this.parent.dataType?""===s.value?s.value=o===Jt?i.getAttribute("data-uid"):'"'+o+"("+a+')"':""!==s.value&&(s.value=o===Jt?s.value+i.getAttribute("data-uid"):s.value+'"'+o+"("+a+')"'):(this.parent.olapEngineModule&&this.parent.olapEngineModule.fieldList[a]&&this.parent.olapEngineModule.fieldList[a].isCalculatedField&&(a=this.parent.olapEngineModule.fieldList[a].tag),""===s.value?s.value=a:""!==s.value&&(s.value=s.value+a))}},e.prototype.fieldClickHandler=function(e){var i=t.closest(e.event.target,"li");(e.event.target.classList.contains(k)||e.event.target.classList.contains("e-edit")||e.event.target.classList.contains("e-edited")||e.event.target.classList.contains(G))&&(this.parent.isAdaptive?"olap"===this.parent.dataType&&this.parent.isAdaptive&&("LI"===i.tagName&&i.querySelector(".e-list-edit-icon").classList.contains("e-edit")&&e.event.target.classList.contains("e-edit")?(this.isEdit=!0,this.currentFieldName=i.getAttribute("data-field"),this.fieldText=i.getAttribute("data-caption"),this.formulaText=i.getAttribute("data-formula"),this.formatType=i.getAttribute("data-formatString"),this.formatText="Custom"===this.formatType?i.getAttribute("data-customformatstring"):null,this.fieldType=i.getAttribute("data-membertype"),this.parentHierarchy="Dimension"===this.fieldType?i.getAttribute("data-hierarchy"):null,t.addClass([i.querySelector(".e-list-edit-icon")],"e-edited"),t.removeClass([i.querySelector(".e-list-edit-icon")],"e-edit"),this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)):"LI"===i.tagName&&i.querySelector(".e-list-edit-icon").classList.contains("e-edited")&&e.event.target.classList.contains("e-edited")?(this.isEdit=!1,this.fieldText=this.formatText=this.formulaText=this.currentFieldName=null,this.parentHierarchy=this.fieldType=this.formatType=null,t.addClass([i.querySelector(".e-list-edit-icon")],"e-edit"),t.removeClass([i.querySelector(".e-list-edit-icon")],"e-edited")):"LI"===i.tagName&&i.querySelector("."+G).classList.contains("e-icons")&&e.event.target.classList.contains(G)&&this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),{},!0,e.node)):this.displayMenu(i,e.node,e.event.target))},e.prototype.accordionClickHandler=function(e){if(e.item&&-1!==e.item.iconCss.indexOf("e-list-icon")&&t.closest(e.originalEvent.target,".e-acrdn-header-icon")){var i=t.closest(e.originalEvent.target,".e-acrdn-header").querySelector(".e-pivot-calc-check"),a=i.getAttribute("data-field"),r=i.getAttribute("data-caption"),n=f.getFieldByName(a,this.parent.dataSourceSettings.formatSettings),o=t.closest(e.originalEvent.target,".e-acrdn-header-icon");if(n){var s=this.getFormat(n.format),l=s?this.formatTypes.indexOf(s)>-1?n.format:"Custom":"None";this.formatType=l}o.querySelector(".e-edit")&&e.originalEvent.target.classList.contains("e-edit")?(this.isEdit=!0,this.currentFieldName=a,this.fieldText=r||a,this.formulaText=this.parent.engineModule.fieldList[a].formula,this.formatText=n?n.format:"",t.addClass([o.querySelector(".e-list-icon")],"e-edited"),t.removeClass([o.querySelector(".e-list-icon")],"e-edit"),this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)):o.querySelector(".e-edited")&&e.originalEvent.target.classList.contains("e-edited")?(this.isEdit=!1,this.fieldText=this.formatText=this.formulaText=this.currentFieldName=null,t.addClass([o.querySelector(".e-list-icon")],"e-edit"),t.removeClass([o.querySelector(".e-list-icon")],"e-edited")):o.querySelector("."+G)&&e.originalEvent.target.classList.contains(G)&&this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),{},!0,i)}},e.prototype.accordionCreated=function(){for(var e=t.getInstance(t.select("#"+this.parentID+"accordDiv",document),o.Accordion).element.querySelectorAll(".e-acrdn-item"),i=0;i<e.length;i++)if(e[i].querySelector(".e-edit")||e[i].querySelector(".e-edited")){var a=t.createElement("span",{className:"e-list-icon e-remove-report e-icons"});t.append([a],e[i].querySelector(".e-acrdn-header-icon")),t.addClass([e[i]],"e-select")}},e.prototype.clearFormula=function(){this.treeObj&&this.treeObj.element.querySelector("li")&&(t.removeClass(this.treeObj.element.querySelectorAll("li"),"e-active"),this.displayMenu(this.treeObj.element.querySelector("li")))},e.prototype.displayMenu=function(e,i,a){var n=!a||a.classList.contains("e-edit"),d=!a||a.classList.contains("e-edited"),p=t.getInstance(t.select("#"+this.parentID+"calculateddialog",document),r.Dialog),h=t.getInstance(t.select("#"+this.parentID+"ddlelement",document),s.MaskedTextBox);try{if("pivot"!==this.parent.dataType||!e.querySelector(".e-list-icon.e-format")||!e.querySelector(".e-list-icon.e-format").classList.contains(P)||e.querySelector(".e-list-icon").classList.contains("e-edited")||e.querySelector(".e-list-icon").classList.contains(G)||e.querySelector(".e-list-icon").classList.contains("e-edit")||"LI"!==e.tagName){if("LI"===e.tagName&&(e.querySelector(".e-edit")&&e.querySelector(".e-edit").classList.contains("e-list-icon")&&n||"olap"===this.parent.dataType&&e.getAttribute("data-type")===Jt&&e.classList.contains("e-active")&&(a&&!a.classList.contains(G)||!a))){this.isEdit=!0;var u=e.getAttribute("data-field"),c=e.getAttribute("data-caption");this.currentFieldName=u,h.value=c,h.dataBind();var g=e.getAttribute("data-formatString"),m=p.element,f=t.getInstance(t.select("#"+this.parentID+"Format_Div",m),l.DropDownList),v=t.getInstance(t.select("#"+this.parentID+"Custom_Format_Element",m),s.MaskedTextBox),S=e.getAttribute("data-customformatstring");if("olap"===this.parent.dataType){var y=e.getAttribute("data-membertype"),b=e.getAttribute("data-hierarchy"),C=e.getAttribute("data-formula"),x=t.select("#"+this.parentID+"_FieldNameTitle",m),w=t.getInstance(t.select("#"+this.parentID+"Member_Type_Div",m),l.DropDownList),T=t.getInstance(t.select("#"+this.parentID+"Hierarchy_List_Div",m),l.DropDownList);x.innerText=this.parent.localeObj.getConstant("caption"),t.select("#"+this.parentID+"droppable",document).value=C,w.readonly=!0,w.value=y,w.dataBind(),"Dimension"===y&&(T.value=b)}else t.addClass(this.treeObj.element.querySelectorAll(".e-edited"),"e-edit"),t.removeClass(this.treeObj.element.querySelectorAll(".e-edited"),"e-edited"),t.addClass([e.querySelector(".e-list-icon")],"e-edited"),t.removeClass([e.querySelector(".e-list-icon")],"e-edit"),e.querySelector(".e-edited").setAttribute("title",this.parent.localeObj.getConstant("clearCalculatedField")),t.select("#"+this.parentID+"droppable",document).value=e.getAttribute("data-uid");""!==g&&(f.value=g,f.dataBind()),v.value=S,v.dataBind()}else if("LI"===e.tagName&&(e.querySelector(".e-edited")&&e.querySelector(".e-edited").classList.contains("e-list-icon")&&d||"olap"===this.parent.dataType&&!e.classList.contains("e-active"))){this.isEdit=!1,h.value="",h.dataBind();m=p.element;if((v=t.getInstance(t.select("#"+this.parentID+"Custom_Format_Element",m),s.MaskedTextBox)).value="",v.dataBind(),"olap"===this.parent.dataType){var T=t.getInstance(t.select("#"+this.parentID+"Hierarchy_List_Div",m),l.DropDownList),f=t.getInstance(t.select("#"+this.parentID+"Format_Div",m),l.DropDownList),w=t.getInstance(t.select("#"+this.parentID+"Member_Type_Div",m),l.DropDownList);(x=t.select("#"+this.parentID+"_FieldNameTitle",m)).innerText=this.parent.localeObj.getConstant("fieldTitle"),T.index=0,T.dataBind(),f.index=0,f.dataBind(),w.index=0,w.readonly=!1,w.dataBind()}else t.addClass(this.treeObj.element.querySelectorAll(".e-edited"),"e-edit"),t.removeClass(this.treeObj.element.querySelectorAll(".e-edited"),"e-edited"),e.querySelector(".e-edit").setAttribute("title",this.parent.localeObj.getConstant("edit"));t.select("#"+this.parentID+"droppable",document).value=""}else if("LI"===e.tagName&&e.querySelector("."+G)&&e.querySelector("."+G).classList.contains("e-list-icon")&&!n&&!d){if(this.parent.actionObj.actionName="Remove field",this.parent.actionBeginMethod())return;var M=t.select("#"+this.parentID+"droppable",document),D={name:this.isEdit?this.currentFieldName:h.value,caption:h.value,formula:M.value};this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),D,!0,i)}}else{var O=t.select("#"+this.parentID+"CalcContextmenu",document)?t.getInstance(t.select("#"+this.parentID+"CalcContextmenu",document),o.ContextMenu):null;O&&!O.isDestroyed&&O.destroy(),this.curMenu=e.querySelector(".e-list-text"),this.openContextMenu(e)}}catch(e){this.parent.actionFailureMethod(e)}},e.prototype.removeCalcField=function(e){var i,a=this.parent.dataSourceSettings,r=e.getAttribute("data-field"),n=a.calculatedFieldSettings;"pivot"===this.parent.dataType&&(this.parent.isAdaptive?"number"==typeof(u=parseInt(e.getAttribute("id").split(this.parentID+"_")[1],10))&&t.getInstance(t.select("#"+this.parentID+"accordDiv",document),o.Accordion).hideItem(u):this.treeObj.removeNodes([e]));for(m=0;m<n.length;m++)if(n[m]&&n[m].name===r){n.splice(m,1);break}if("olap"===this.parent.dataType){for(var l=(i=this.parent.olapEngineModule).fieldListData?i.fieldListData:[],d=0,p=Object.keys(l);d<p.length;d++){var h=p[d];if(l[parseInt(h,10)].name===r){var u=parseInt(h,10);if("number"==typeof u){l.splice(u,1);break}}}var c=this.treeObj.getNode(e).parentID;this.treeObj.removeNodes([e]),n.length<=0&&this.treeObj.removeNodes([c])}else i=this.parent.engineModule;if(i.fields)for(m=0;m<i.fields.length;m++)if(i.fields[m]===r){i.fields.splice(m,1);break}i.savedFieldList&&i.savedFieldList[r]&&delete i.savedFieldList[r],i.fieldList&&i.fieldList[r]&&delete i.fieldList[r];for(var g=a.formatSettings,m=0;m<g.length;m++)if(g[m]&&g[m].name===r){g.splice(m,1);break}for(var f=[a.values,a.rows,a.columns,a.filters],m=0,v=f.length;m<v;m++)for(var S=0,y=f[m].length;S<y;S++)if(f[m][S].name===r){f[m].splice(S,1);break}if(this.isEdit&&this.currentFieldName===r){var b=t.getInstance(t.select("#"+this.parentID+"ddlelement",document),s.MaskedTextBox);this.isEdit=!1,b.value="",this.currentFieldName=this.formatText=this.fieldText=this.formatType=null,this.formulaText=this.fieldType=this.parentHierarchy=null}(!t.isNullOrUndefined(this.parent.isDeferLayoutUpdate)&&!this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!this.parent.pivotGridModule.pivotDeferLayoutUpdate||"pivotfieldlist"!==this.parent.getModuleName())&&this.parent.updateDataSource(),this.closeErrorDialog()},e.prototype.openContextMenu=function(e){var i=this,a=e.getAttribute("data-field"),r="number"!==this.parent.engineModule.fieldList[a].type?"string":"number",n="string"===r?this.getValidSummaryType().slice(0,2):this.getValidSummaryType(),s={cancel:!1,fieldName:a,aggregateTypes:this.getMenuItems(r).slice()};("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger("aggregateMenuOpen",s,function(a){if(!a.cancel){for(var r=[],s=[],l=0,d=a.aggregateTypes;l<d.length;l++){var p=d[l];n.indexOf(p)>-1&&-1===r.indexOf(p)&&(r.push(p),s.push({id:i.parent.element.id+"Calc_"+p,text:i.parent.localeObj.getConstant(p)}))}i.createMenu(s,e);var h=e.getBoundingClientRect(),u=window.scrollY||document.documentElement.scrollTop,c=t.getInstance(t.select("#"+i.parentID+"CalcContextmenu",document),o.ContextMenu);i.parent.enableRtl?c.open(h.top+u,h.left-100):c.open(h.top+u,h.left+150)}})},e.prototype.selectContextMenu=function(e){if(null!==e.element.textContent){var i=t.closest(this.curMenu,".e-list-item").getAttribute("data-caption");t.closest(this.curMenu,".e-list-item").setAttribute("data-type",e.element.id.split("_").pop()),this.curMenu.textContent=i+" ("+e.element.textContent+")",t.addClass([this.curMenu.parentElement.parentElement],["e-node-focus","e-hover"]),this.curMenu.parentElement.parentElement.setAttribute("tabindex","0"),this.curMenu.parentElement.parentElement.focus()}},e.prototype.createMenu=function(e,i){var a,n=this,s={cssClass:this.parentID+"calculatedmenu"+(this.parent.cssClass?" "+this.parent.cssClass:""),items:e,enableRtl:this.parent.enableRtl,locale:this.parent.locale,select:this.selectContextMenu.bind(this),onClose:function(){n.treeObj.element.focus(),t.addClass([i],["e-hover","e-node-focus"])}};a=t.select("#"+this.parentID+"CalcContextmenu",document)?t.select("#"+this.parentID+"CalcContextmenu",document):t.createElement("ul",{id:this.parentID+"CalcContextmenu"}),t.getInstance(t.select("#"+this.parentID+"calculateddialog",document),r.Dialog).element.appendChild(a);var l=new o.ContextMenu(s);l.isStringTemplate=!0,l.appendTo(a)},e.prototype.applyFormula=function(){var e=this,i=this,a=!1;t.removeClass([document.getElementById(this.parentID+"ddlelement")],"e-empty-field");var r=t.getInstance(t.select("#"+this.parentID+"ddlelement",document),s.MaskedTextBox);this.newFields=t.extend([],this.parent.dataSourceSettings.calculatedFieldSettings,null,!0);var n={fieldName:this.isEdit?this.currentFieldName:r.value,calculatedField:this.getCalculatedFieldInfo(),calculatedFieldSettings:f.cloneCalculatedFieldSettings(this.parent.dataSourceSettings.calculatedFieldSettings),cancel:!1};("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger("calculatedFieldCreate",n,function(r){if(r.cancel)e.endDialog(),e.parent.lastCalcFieldInfo={},e.isFormula=!1;else{var n=r.calculatedField;if(!e.isEdit)if("olap"===i.parent.dataType){h=n.name;i.parent.olapEngineModule.fieldList[h]&&"CalculatedField"!==i.parent.olapEngineModule.fieldList[h].type&&(a=!0)}else for(var o=0,l=Object.keys(i.parent.engineModule.fieldList);o<l.length;o++){var d=l[o];n.name&&n.name===d&&"CalculatedField"!==i.parent.engineModule.fieldList[d].aggregateType&&(a=!0)}if(a)return void i.parent.pivotCommon.errorDialog.createErrorDialog(i.parent.localeObj.getConstant("error"),i.parent.localeObj.getConstant("fieldExist"));e.existingReport=t.extend({},e.parent.dataSourceSettings,null,!0);var p=e.parent.dataSourceSettings;if(t.isNullOrUndefined(n.name)||""===n.name||t.isNullOrUndefined(n.caption)||""===n.caption||!n.formula||""===n.formula)t.isNullOrUndefined(n.name)||""===n.name||t.isNullOrUndefined(n.caption)||""===n.caption?(t.getInstance(t.select("#"+e.parentID+"ddlelement",document),s.MaskedTextBox).value="",t.addClass([document.getElementById(e.parentID+"ddlelement")],"e-empty-field"),document.getElementById(e.parentID+"ddlelement").focus()):e.parent.pivotCommon.errorDialog.createErrorDialog(e.parent.localeObj.getConstant("error"),e.parent.localeObj.getConstant("invalidFormula"));else{var h=void 0;if("olap"===e.parent.dataType){if(h={name:n.name,formula:n.formula,formatString:n.formatString},t.isNullOrUndefined(n.hierarchyUniqueName)||(h.hierarchyUniqueName=n.hierarchyUniqueName),e.isFieldExist=!1,e.isEdit){for(y=0;y<p.calculatedFieldSettings.length;y++)if(p.calculatedFieldSettings[y].name===h.name&&e.isEdit){p.calculatedFieldSettings[y].hierarchyUniqueName=n.hierarchyUniqueName,e.parent.olapEngineModule.fieldList[h.name].caption=n.caption,p.calculatedFieldSettings[y].formatString=h.formatString,p.calculatedFieldSettings[y].formula=h.formula,h=p.calculatedFieldSettings[y],e.updateFormatSettings(p,h.name,n.formatString),e.parent.olapEngineModule.getFormattedFields(p.formatSettings),e.parent.olapEngineModule.formatFields[h.name]&&(e.parent.olapEngineModule.formatFields[h.name].format?e.parent.olapEngineModule.formatFields[h.name].format=e.getFormat(h.formatString):delete e.parent.olapEngineModule.formatFields[h.name]),e.isFieldExist=!0;break}for(var u=!1,c=0,g=[p.rows,p.columns,p.values,p.filters];c<g.length;c++){for(var m=0,f=g[c];m<f.length;m++){var v=f[m];if(v.isCalculatedField&&null!==h.name&&v.name===h.name&&e.isEdit){v.caption=n.caption,e.isFieldExist=!0,u=!0;break}}if(u)break}}else for(y=0;y<p.calculatedFieldSettings.length;y++)if(p.calculatedFieldSettings[y].name===h.name)return void e.createConfirmDialog(i.parent.localeObj.getConstant("alert"),i.parent.localeObj.getConstant("confirmText"),n);e.isFieldExist||(p.calculatedFieldSettings.push(h),e.updateFormatSettings(p,h.name,n.formatString),e.parent.olapEngineModule.getFormattedFields(p.formatSettings),e.parent.olapEngineModule.formatFields[h.name]&&(e.parent.olapEngineModule.formatFields[h.name].format?e.parent.olapEngineModule.formatFields[h.name].format=e.getFormat(h.formatString):delete e.parent.olapEngineModule.formatFields[h.name])),e.parent.lastCalcFieldInfo=h}else{h={name:n.name,caption:n.caption,type:"CalculatedField"};var S={name:n.name,formula:n.formula};if(t.isNullOrUndefined(n.formatString)||(S.formatString=n.formatString),e.isFieldExist=!0,e.isEdit){for(y=0;y<p.values.length;y++)if(p.values[y].type===Jt&&null!==h.name&&p.values[y].name===h.name&&e.isEdit)for(b=0;b<p.calculatedFieldSettings.length;b++)p.calculatedFieldSettings[b].name===h.name&&(p.values.splice(y,1),p.values.splice(y,0,h),e.currentFormula=p.calculatedFieldSettings[b].formula,p.calculatedFieldSettings.splice(b,1),p.calculatedFieldSettings.splice(b,0,S),e.updateFormatSettings(p,h.name,n.formatString),e.isFieldExist=!1)}else for(var y=0;y<p.values.length;y++)if(p.values[y].type===Jt&&p.values[y].name===h.name){for(var b=0;b<p.calculatedFieldSettings.length;b++)if(p.calculatedFieldSettings[b].name===h.name)return void e.createConfirmDialog(i.parent.localeObj.getConstant("alert"),i.parent.localeObj.getConstant("confirmText"),n);e.isFieldExist=!1}e.isFieldExist&&(p.values.push(h),p.calculatedFieldSettings.push(S),e.updateFormatSettings(p,h.name,n.formatString)),e.parent.lastCalcFieldInfo=S}e.addFormula(p,h.name)}}})},e.prototype.getCalculatedFieldInfo=function(){var e=t.select("#"+this.parentID+"calculateddialog",document),i=e?t.getInstance(e,r.Dialog):void 0,a=t.getInstance(t.select("#"+this.parentID+"ddlelement",document),s.MaskedTextBox),n=t.select("#"+this.parentID+"droppable",document),o=this.parent.isAdaptive?this.parent.dialogRenderer.adaptiveElement.element:i.element,d=t.getInstance(t.select("#"+this.parentID+"Custom_Format_Element",o),s.MaskedTextBox),p={name:this.isEdit?this.currentFieldName:a.value,caption:a.value,formula:n.value},h=t.getInstance(t.select("#"+this.parentID+"Format_Div",o),l.DropDownList);if(p.formatString="Custom"===h.value?d.value:"None"===h.value?null:h.value,"olap"===this.parent.dataType){var u=t.getInstance(t.select("#"+this.parentID+"Member_Type_Div",o),l.DropDownList),c=t.getInstance(t.select("#"+this.parentID+"Hierarchy_List_Div",o),l.DropDownList);"Dimension"===u.value&&(p.hierarchyUniqueName=c.value)}return p},e.prototype.updateFormatSettings=function(e,i,a){for(var r={name:i,format:a,useGrouping:!0},n=!1,o=0;o<e.formatSettings.length;o++)if(e.formatSettings[o].name===i){if("undefined"===a||void 0===a||""===a){e.formatSettings.splice(o,1),n=!0;break}var s=e.formatSettings[o].properties?e.formatSettings[o].properties:e.formatSettings[o];s.format=a,e.formatSettings.splice(o,1,s),n=!0;break}n||""===a||t.isNullOrUndefined(a)||e.formatSettings.push(r)},e.prototype.addFormula=function(e,t){this.isFormula=!0,this.field=t,this.parent.setProperties({dataSourceSettings:e},!0),"pivotfieldlist"===this.parent.getModuleName()&&(this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&this.parent.pivotGridModule.pivotDeferLayoutUpdate)&&(this.parent.isRequiredUpdate=!1);try{var i={calculatedFieldInfo:this.parent.lastCalcFieldInfo};this.parent.actionObj.actionInfo=i;var a="Edit calculated field"===this.parent.actionObj.actionName?"Calculated field edited":"Calculated field applied";this.parent.actionObj.actionName=a,this.parent.updateDataSource(!1);var r="pivotfieldlist"===this.parent.getModuleName()&&this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent;r&&"Server"!==r.dataSourceSettings.mode?this.endDialog():this.isRequireUpdate=!0,"pivotfieldlist"===this.parent.getModuleName()&&"Fixed"===this.parent.renderMode&&this.parent.isDeferLayoutUpdate&&(this.parent.pivotChange=!0)}catch(e){this.showError()}},e.prototype.endDialog=function(){this.isEdit=!1;var e=t.select("#"+this.parentID+"calculateddialog",document),i=e?t.getInstance(e,r.Dialog):void 0;if(i)i.close();else{t.getInstance(t.select("#"+this.parentID+"ddlelement",document),s.MaskedTextBox).value="",this.currentFieldName=this.formatText=this.fieldText=this.formatType=null,this.formulaText=this.fieldType=this.parentHierarchy=null;var a=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:i.element;if(this.parent.dialogRenderer.parentElement.querySelector("."+R).value="",t.select("#"+this.parentID+"droppable",this.parent.dialogRenderer.parentElement).value="",t.select("#"+this.parentID+"Custom_Format_Element",this.parent.dialogRenderer.parentElement).value="","olap"===this.parent.dataType){var n=t.getInstance(t.select("#"+this.parentID+"Member_Type_Div",a),l.DropDownList),o=t.getInstance(t.select("#"+this.parentID+"Hierarchy_List_Div",a),l.DropDownList);n.index=0,n.readonly=!1,n.dataBind(),o.index=0,o.enabled=!1,o.dataBind()}var d=t.getInstance(t.select("#"+this.parentID+"Custom_Format_Element",a),s.MaskedTextBox),p=t.getInstance(t.select("#"+this.parentID+"Format_Div",a),l.DropDownList);p.index="olap"===this.parent.dataType?0:4,p.dataBind(),d.enabled=!1,d.dataBind()}},e.prototype.showError=function(){if(this.parent.engineModule.fieldList[this.field]&&delete this.parent.engineModule.fieldList[this.field],this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("invalidFormula")),this.parent.setProperties({dataSourceSettings:this.existingReport},!0),this.isEdit){for(var e=this.parent.dataSourceSettings.calculatedFieldSettings,t=0;e&&t<e.length;t++)if(e[t].name===this.field){e[t].formula=this.currentFormula;break}}else if(this.parent.engineModule.fields)for(t=0;t<this.parent.engineModule.fields.length;t++)if(this.parent.engineModule.fields[t]===this.field){this.parent.engineModule.fields.splice(t,1);break}this.parent.lastCalcFieldInfo={},this.parent.updateDataSource(!1),this.isFormula=!1},e.prototype.getFieldListData=function(e){var i=[];if("olap"===this.parent.dataType)for(var a=0,r=i=f.getClonedData(e.olapEngineModule.fieldListData?e.olapEngineModule.fieldListData:[]);a<r.length;a++){var n=r[a];n.spriteCssClass&&(n.spriteCssClass.indexOf("e-attributeCDB-icon")>-1||n.spriteCssClass.indexOf("e-level-members")>-1)?n.hasChildren=!0:n.spriteCssClass&&n.spriteCssClass.indexOf("e-namedSetCDB-icon")>-1?n.hasChildren=!1:n.spriteCssClass&&n.spriteCssClass.indexOf("e-calcMemberGroupCDB")>-1&&(n.expanded=this.isEdit)}else for(var o=0,s=e.engineModule.fieldList?Object.keys(e.engineModule.fieldList):[];o<s.length;o++){var l=s[o],d=null,p=null,h=e.engineModule.fieldList[l];p="number"===h.type&&"include"!==e.engineModule.fieldList[l].type&&"exclude"!==e.engineModule.fieldList[l].type||"DistinctCount"===h.aggregateType?void 0!==h.aggregateType?h.aggregateType:"Sum":"Count",d=this.parent.localeObj.getConstant(p),i.push({index:h.index,name:(this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(h.caption):h.caption)+" ("+d+")",type:p,icon:k+" "+P,formula:this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(h.formula):h.formula,field:this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(l):l,caption:this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(h.caption?h.caption:l):h.caption?h.caption:l})}return i},e.prototype.fieldDropped=function(e){e.cancel=!0;var i=t.getInstance(t.select("#"+this.parentID+"calculateddialog",document),r.Dialog),a=t.select("#"+this.parentID+"droppable",i.element);t.removeClass([a],"e-copy-drop"),t.removeClass([e.draggedNode.querySelector(".e-list-text")],"e-list-selected");var n=e.draggedNode.getAttribute("data-field");if("olap"===this.parent.dataType)if(this.parent.olapEngineModule.fieldList[n]&&this.parent.olapEngineModule.fieldList[n].isCalculatedField&&(n=this.parent.olapEngineModule.fieldList[n].tag),e.target.id===this.parentID+"droppable"&&""===a.value)a.value=n,a.focus();else if(e.target.id===this.parentID+"droppable"&&""!==a.value){var o=a.value,s=a.selectionStart,l=o.substring(s,o.length),d=(h=o.substring(0,s))+n;a.value=h+n+l,a.focus(),a.setSelectionRange(d.length,d.length)}else e.cancel=!0;else{var p=e.draggedNode.getAttribute("data-type");if(e.target.id===this.parentID+"droppable"&&""===a.value)a.value=p===Jt?e.draggedNodeData.id.toString():'"'+p+"("+n+')"',a.focus();else if(e.target.id===this.parentID+"droppable"&&""!==a.value){var d=void 0,s=a.selectionStart,h=(o=a.value).substring(0,s),l=o.substring(s,o.length);p===Jt?(d=h+e.draggedNodeData.id.toString(),a.value=h+e.draggedNodeData.id.toString()+l):(d=h+'"'+p+"("+n+')"',a.value=h+'"'+p+"("+n+')"'+l),a.focus(),a.setSelectionRange(d.length,d.length)}else e.cancel=!0}},e.prototype.createDialog=function(){var e=this;if(null!==t.select("#"+this.parentID+"calculateddialog",document))for(t.remove(t.select("#"+this.parentID+"calculateddialog",document));!t.isNullOrUndefined(document.querySelector("."+this.parentID+"calculatedmenu"));)t.remove(document.querySelector("."+this.parentID+"calculatedmenu"));var i=t.createElement("div",{id:this.parentID+"calculateddialog",className:"e-pivot-calc-dialog-div "+("olap"===this.parent.dataType?"e-olap-calc-dialog-div":"")});this.parent.element.appendChild(i);var a=[{click:this.applyFormula.bind(this),isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("ok"),isPrimary:!0,cssClass:this.parent.cssClass}},{click:this.cancelClick.bind(this),isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("cancel"),cssClass:this.parent.cssClass}}];if("olap"===this.parent.dataType){var n={click:this.clearFormula.bind(this),isFlat:!1,buttonModel:{cssClass:"e-calc-clear-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("clear")}};a.splice(0,0,n)}var o=new r.Dialog({allowDragging:!0,position:{X:"center",Y:"center"},buttons:a,close:this.closeDialog.bind(this),beforeOpen:this.beforeOpen.bind(this),open:function(){t.select("#"+e.parentID+"ddlelement",o.element)&&t.select("#"+e.parentID+"ddlelement",o.element).focus()},animationSettings:{effect:"Zoom"},width:"25%",isModal:!0,closeOnEscape:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,showCloseIcon:!0,header:this.parent.localeObj.getConstant("createCalculatedField"),target:document.body,cssClass:this.parent.cssClass});o.isStringTemplate=!0,o.appendTo(i)},e.prototype.cancelClick=function(){t.getInstance(t.select("#"+this.parentID+"calculateddialog",document),r.Dialog).close(),this.isEdit=!1},e.prototype.beforeOpen=function(){t.getInstance(t.select("#"+this.parentID+"calculateddialog",document),r.Dialog).element.querySelector(".e-dlg-header").setAttribute("title",this.parent.localeObj.getConstant("createCalculatedField"))},e.prototype.closeDialog=function(){"pivotfieldlist"===this.parent.getModuleName()&&(this.parent.axisFieldModule.render(),"Fixed"!==this.parent.renderMode&&(t.addClass([this.parent.element.querySelector(".e-toggle-field-list")],"e-hide"),this.parent.dialogRenderer.fieldListDialog.show())),this.destroy(),t.isNullOrUndefined(document.getElementById(this.parentID+"calculateddialog"))||t.remove(document.getElementById(this.parentID+"calculateddialog")),t.isNullOrUndefined(document.querySelector("."+this.parentID+"calculatedmenu"))||t.remove(document.querySelector("."+this.parentID+"calculatedmenu"));var e="pivotview"===this.parent.getModuleName()||"pivotfieldlist"===this.parent.getModuleName()&&"Fixed"===this.parent.renderMode?0:500;this.buttonCall&&(this.buttonCall=!1,setTimeout(this.setFocus.bind(this),e))},e.prototype.setFocus=function(){var e;if("pivotview"===this.parent.getModuleName()&&this.parent.element?e=this.parent.element:document.getElementById(this.parent.element.id+"_Container")&&(e=document.getElementById(this.parent.element.id+"_Container")),e)for(var t=0,i=[].slice.call(e.querySelectorAll(".e-pivot-button"));t<i.length;t++){var a=i[t];if(a.getAttribute("data-uid")===this.currentFieldName){a.focus();break}}},e.prototype.renderDialogElements=function(){var e=t.createElement("div",{id:this.parentID+"outerDiv",className:("olap"===this.parent.dataType?"e-olap-calc-outer-div ":"")+"e-pivot-calc-outer-div"}),i=t.createElement("div",{id:this.parentID+"Olap_Tree_Div",className:"e-olap-field-tree-div"}),a=t.createElement("div",{id:this.parentID+"Pivot_Calc_Div",className:"e-pivot-calculated-div"});if("pivotfieldlist"===this.parent.getModuleName()&&null!==this.parent.dialogRenderer.parentElement.querySelector("."+j)&&this.parent.isAdaptive){var n=t.createElement("div",{id:this.parentID+"accordDiv",className:"e-pivot-accord"});e.appendChild(n);var o=t.createElement("div",{id:this.parentID+"buttonDiv",className:"e-pivot-button-div"}),s=t.createElement("button",{id:this.parentID+"addBtn",className:"e-pivot-add-button",attrs:{type:"button"}});s.innerText=this.parent.localeObj.getConstant("add");var l=t.createElement("button",{id:this.parentID+"cancelBtn",className:"e-pivot-cancel-button",attrs:{type:"button"}});l.innerText=this.parent.localeObj.getConstant("cancel"),o.appendChild(l),o.appendChild(s),e.appendChild(o)}else{this.parent.isAdaptive||"olap"!==this.parent.dataType||((v=t.createElement("div",{className:"e-pivot-field-name-title",id:this.parentID+"_FieldNameTitle"})).innerText=this.parent.localeObj.getConstant("fieldTitle"),a.appendChild(v));var d=t.createElement("div",{id:this.parentID+"innerDiv",className:"e-pivot-calc-input-div"}),p=t.createElement("input",{id:this.parentID+"ddlelement",attrs:{type:"text"},className:R});d.appendChild(p),"olap"!==this.parent.dataType||this.parent.isAdaptive?e.appendChild(d):a.appendChild(d);var h=t.createElement("div",{id:this.parentID+"control_container",className:"e-pivot-treeview-outer"});if(!this.parent.isAdaptive){var u=t.createElement("div",{className:"e-pivot-all-field-title"});if(u.innerText="olap"===this.parent.dataType?this.parent.localeObj.getConstant("allFields"):this.parent.localeObj.getConstant("formulaField"),"olap"===this.parent.dataType){var c=t.createElement("div",{className:"e-pivot-all-field-title-container"});c.appendChild(u);var g=t.createElement("span",{attrs:{tabindex:"0","aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("fieldTooltip"),role:"button"},className:P+" e-info"});c.appendChild(g),new r.Tooltip({content:this.parent.localeObj.getConstant("fieldTooltip"),position:this.parent.enableRtl?"RightCenter":"LeftCenter",target:".e-info",offsetY:(this.parent.enableRtl,-10),locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:220,cssClass:this.parent.cssClass}).appendTo(c),h.appendChild(c)}else e.appendChild(u)}var m=t.createElement("div",{className:"e-pivot-treeview-outer-div"});h.appendChild(m);var f=t.createElement("div",{id:this.parentID+"tree",className:"e-pivot-treeview"});if(m.appendChild(f),"olap"!==this.parent.dataType||this.parent.isAdaptive?e.appendChild(h):i.appendChild(h),!this.parent.isAdaptive){var v=t.createElement("div",{className:"e-pivot-formula-title"});v.innerText="olap"===this.parent.dataType?this.parent.localeObj.getConstant("expressionField"):this.parent.localeObj.getConstant("formula"),"olap"===this.parent.dataType?a.appendChild(v):e.appendChild(v)}var S=t.createElement("textarea",{id:this.parentID+"droppable",className:j+" e-control e-textbox e-input",attrs:{placeholder:this.parent.isAdaptive?this.parent.localeObj.getConstant("dropTextMobile"):"olap"===this.parent.dataType?this.parent.localeObj.getConstant("olapDropText"):this.parent.localeObj.getConstant("dropText")}});if("olap"!==this.parent.dataType||this.parent.isAdaptive?e.appendChild(S):a.appendChild(S),this.parent.isAdaptive){o=t.createElement("div",{id:this.parentID+"buttonDiv",className:"e-pivot-button-div"});(O=t.createElement("button",{id:this.parentID+"okBtn",className:"e-pivot-ok-button",attrs:{type:"button"}})).innerText=this.parent.localeObj.getConstant("apply"),o.appendChild(O),e.appendChild(o)}if("olap"===this.parent.dataType){if(!this.parent.isAdaptive){var y=t.createElement("div",{className:"e-olap-member-title"});y.innerText=this.parent.localeObj.getConstant("memberType"),a.appendChild(y)}var b=t.createElement("div",{id:this.parentID+"Member_Type_Div",className:"e-olap-calc-member-type-div"});if(this.parent.isAdaptive)e.appendChild(b);else{a.appendChild(b);var C=t.createElement("div",{className:"e-olap-hierarchy-title"});C.innerText=this.parent.localeObj.getConstant("selectedHierarchy"),a.appendChild(C)}var x=t.createElement("div",{id:this.parentID+"Hierarchy_List_Div",className:"e-olap-calc-hierarchy-list-div"});this.parent.isAdaptive?e.appendChild(x):a.appendChild(x)}if(!this.parent.isAdaptive){var w=t.createElement("div",{className:"e-pivot-format-title"});w.innerText=this.parent.localeObj.getConstant("formatString"),a.appendChild(w)}var T=t.createElement("div",{id:this.parentID+"Format_Div",className:"e-pivot-calc-format-type-div"});this.parent.isAdaptive?e.appendChild(T):a.appendChild(T);var M=t.createElement("div",{id:this.parentID+"custom_Format_Div",className:"e-pivot-calc-custom-format-div"}),D=t.createElement("input",{id:this.parentID+"Custom_Format_Element",attrs:{type:"text"},className:"e-custom-format-input"});if(M.appendChild(D),a.appendChild(M),this.parent.isAdaptive?e.appendChild(M):a.appendChild(M),"pivotfieldlist"===this.parent.getModuleName()&&null===this.parent.dialogRenderer.parentElement.querySelector("."+j)&&this.parent.isAdaptive){var O=e.querySelector(".e-pivot-ok-button");e.appendChild(O)}else"olap"===this.parent.dataType&&e.appendChild(i),e.appendChild(a)}return e},e.prototype.renderAdaptiveLayout=function(e){var i=this.parent.dialogRenderer.adaptiveElement;if(e){if(t.select("#"+this.parentID+"droppable",i.element)){var a=t.getInstance(t.select("#"+this.parentID+"ddlelement",document),s.MaskedTextBox);this.formulaText=t.select("#"+this.parentID+"droppable",document).value,this.fieldText=a.value}if(i.element.querySelector(".e-olap-calc-member-type-div")){var r=t.getInstance(t.select("#"+this.parentID+"Member_Type_Div",i.element),l.DropDownList);this.fieldType=r.value}if(i.element.querySelector(".e-olap-calc-hierarchy-list-div")){var n=t.getInstance(t.select("#"+this.parentID+"Hierarchy_List_Div",i.element),l.DropDownList);this.parentHierarchy="Dimension"===this.fieldType?n.value:null}if(i.element.querySelector(".e-pivot-calc-format-type-div")){var o=t.getInstance(t.select("#"+this.parentID+"Format_Div",i.element),l.DropDownList);this.formatType=o.value}if(i.element.querySelector(".e-custom-format-input")){var d=t.getInstance(t.select("#"+this.parentID+"Custom_Format_Element",i.element),s.MaskedTextBox);this.formatText="Custom"===("olap"===this.parent.dataType?this.formatType:this.getFormat(this.formatType))?d.value:null}}else this.currentFieldName=this.formulaText=this.fieldText=this.formatText=null,this.fieldType=this.formatType=this.parentHierarchy=null;this.renderMobileLayout(i)},e.prototype.updateAdaptiveCalculatedField=function(e,i){var a=this.parent.dialogRenderer.adaptiveElement.element;this.isEdit=e;var r=e?"pivot"===this.parent.dataType?this.parent.engineModule.fieldList[i]:this.parent.olapEngineModule.fieldList[i]:{id:null,caption:null,formula:null,fieldType:"Measure",formatString:"pivot"===this.parent.dataType?null:"Standard",parentHierarchy:null};this.currentFieldName=r.id;var n=t.getInstance(t.select("#"+this.parentID+"ddlelement",document),s.MaskedTextBox);if(t.select("#"+this.parentID+"droppable",document)&&(this.formulaText=t.select("#"+this.parentID+"droppable",document).value=r.formula,this.fieldText=n.value=r.caption,n.dataBind()),a.querySelector(".e-olap-calc-member-type-div")){var o=t.getInstance(t.select("#"+this.parentID+"Member_Type_Div",a),l.DropDownList);this.fieldType=o.value=r.fieldType,o.readonly=!!e,o.dataBind()}if(a.querySelector(".e-olap-calc-hierarchy-list-div")){var d=t.getInstance(t.select("#"+this.parentID+"Hierarchy_List_Div",a),l.DropDownList);"Dimension"===this.fieldType?this.parentHierarchy=d.value=r.parentHierarchy:(this.parentHierarchy=null,d.index=0),d.dataBind()}if(a.querySelector(".e-pivot-calc-format-type-div")){var p=t.getInstance(t.select("#"+this.parentID+"Format_Div",a),l.DropDownList);this.formatType=p.value=this.formatTypes.indexOf(r.formatString)>-1?r.formatString:"Custom"}if(a.querySelector(".e-custom-format-input")){var h=t.getInstance(t.select("#"+this.parentID+"Custom_Format_Element",a),s.MaskedTextBox),u=f.getFieldByName(i,this.parent.dataSourceSettings.formatSettings);"pivot"===this.parent.dataType?this.formatText=h.value=u?u.format:null:this.formatText=h.value="Custom"===this.formatType?r.formatString:null,h.dataBind()}},e.prototype.createDropElements=function(){for(var e=this,i=t.select("#"+this.parentID+"calculateddialog",document)?t.getInstance(t.select("#"+this.parentID+"calculateddialog",document),r.Dialog):null,a=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:i.element,n=[],o=[],d=0,p=this.formatTypes;d<p.length;d++){var h=p[d];n.push({value:"pivot"===this.parent.dataType?this.getFormat(h):h,text:this.parent.localeObj.getConstant(h)})}if("olap"===this.parent.dataType){for(var u=[],c=0,g=["Measure","Dimension"];c<g.length;c++){var m=g[c];u.push({value:m,text:this.parent.localeObj.getConstant(m)})}for(var v=0,S=f.getClonedData(this.parent.olapEngineModule.fieldListData);v<S.length;v++){var y=S[v];y.spriteCssClass&&(y.spriteCssClass.indexOf("e-attributeCDB-icon")>-1||y.spriteCssClass.indexOf("e-hierarchyCDB-icon")>-1)&&o.push({value:y.id,text:y.caption})}var b=new l.DropDownList({dataSource:u,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:null!==this.fieldType?this.fieldType:u[0].value,readonly:this.isEdit,cssClass:"e-member-options"+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(i){C.enabled="Dimension"===i.value,e.fieldType=i.value,e.formulaText=t.select("#"+e.parentID+"droppable",document).value,C.dataBind()}});b.isStringTemplate=!0,b.appendTo(t.select("#"+this.parentID+"Member_Type_Div",a));var C=new l.DropDownList({dataSource:o,enableRtl:this.parent.enableRtl,locale:this.parent.locale,allowFiltering:!0,enabled:"Dimension"===b.value,filterBarPlaceholder:this.parent.localeObj.getConstant("example")+" "+o[0].text.toString(),fields:{value:"value",text:"text"},value:null!==this.parentHierarchy&&"Dimension"===b.value?this.parentHierarchy:o[0].value,cssClass:"e-member-options"+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(i){e.parentHierarchy=i.value,e.formulaText=t.select("#"+e.parentID+"droppable",document).value}});C.isStringTemplate=!0,C.appendTo(t.select("#"+this.parentID+"Hierarchy_List_Div",a))}var x=new l.DropDownList({dataSource:n,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:this.parent.isAdaptive&&null!==this.formatType?this.formatType:"olap"===this.parent.dataType?n[0].value:n[4].value,cssClass:"e-member-options"+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(i){w.enabled="Custom"===i.value,e.formatType=i.value,e.formulaText=t.select("#"+e.parentID+"droppable",document).value,w.dataBind()}});x.isStringTemplate=!0,x.appendTo(t.select("#"+this.parentID+"Format_Div",a));var w=new s.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("customFormat"),locale:this.parent.locale,enableRtl:this.parent.enableRtl,value:null!==this.formatText&&"Custom"===x.value?this.formatText:null,enabled:"Custom"===x.value,change:function(i){e.formatText=i.value,e.formulaText=t.select("#"+e.parentID+"droppable",document).value},cssClass:this.parent.cssClass});w.isStringTemplate=!0,w.appendTo(t.select("#"+this.parentID+"Custom_Format_Element",a))},e.prototype.getFormat=function(e){var t=e;if("olap"!==this.parent.dataType)switch(t){case"Standard":t="N";break;case"Currency":t="C";break;case"Percent":t="P";break;case"N":t="Standard";break;case"C":t="Currency";break;case"P":t="Percent"}else switch(t){case"Standard":t="N";break;case"Currency":t="C";break;case"Percent":t="P"}return t},e.prototype.createTreeView=function(){var e=this,i=t.select("#"+this.parentID+"calculateddialog",document)?t.getInstance(t.select("#"+this.parentID+"calculateddialog",document),r.Dialog):null,a=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:i.element;"olap"===this.parent.dataType?this.treeObj=new o.TreeView({fields:{dataSource:this.getFieldListData(this.parent),id:"id",text:"caption",parentID:"pid",iconCss:"spriteCssClass"},allowDragAndDrop:!0,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,locale:this.parent.locale,nodeDragStart:this.dragStart.bind(this),nodeDragging:function(e){e.event.target&&e.event.target.classList.contains(j)?(t.removeClass([e.clonedNode],"e-drag-restrict"),t.addClass([e.event.target],"e-copy-drop")):(t.addClass([e.clonedNode],"e-drag-restrict"),t.removeClass([e.event.target],"e-copy-drop"),e.dropIndicator="e-no-drop",t.addClass([e.clonedNode.querySelector("."+P)],"e-icon-expandable"),t.removeClass([e.clonedNode.querySelector("."+P)],"e-list-icon"))},nodeClicked:this.fieldClickHandler.bind(this),nodeSelected:function(i){i.node.getAttribute("data-type")===Jt?e.displayMenu(i.node):(t.removeClass([i.node],"e-active"),i.cancel=!0)},nodeDragStop:this.fieldDropped.bind(this),drawNode:this.drawTreeNode.bind(this),nodeExpanding:this.updateNodeIcon.bind(this),nodeCollapsed:this.updateNodeIcon.bind(this),sortOrder:"None",cssClass:this.parent.cssClass}):this.treeObj=new o.TreeView({fields:{dataSource:this.getFieldListData(this.parent),id:"formula",text:"name",iconCss:"icon"},allowDragAndDrop:!0,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,locale:this.parent.locale,cssClass:this.parent.cssClass,nodeCollapsing:this.nodeCollapsing.bind(this),nodeDragStart:this.dragStart.bind(this),nodeClicked:this.fieldClickHandler.bind(this),nodeDragStop:this.fieldDropped.bind(this),drawNode:this.drawTreeNode.bind(this),keyPress:function(e){39===e.event.keyCode&&(e.cancel=!0)},sortOrder:"Ascending"}),this.treeObj.isStringTemplate=!0,this.treeObj.appendTo(t.select("#"+this.parentID+"tree",a))},e.prototype.updateNodeIcon=function(e){if(e.node&&e.node.querySelector(".e-list-icon")&&e.node.querySelector(".e-icon-expandable.e-process")&&e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-icon")>-1){i=e.node.querySelector(".e-list-icon");t.removeClass([i],"e-folderCDB-icon"),t.addClass([i],"e-folderCDB-open-icon")}else if(e.node&&e.node.querySelector(".e-list-icon")&&e.node.querySelector(".e-icon-expandable")&&e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-open-icon")>-1){var i=e.node.querySelector(".e-list-icon");t.removeClass([i],"e-folderCDB-open-icon"),t.addClass([i],"e-folderCDB-icon")}else{for(var a=this.treeObj.fields.dataSource,r=[],n=0,o=a;n<o.length;n++){var s=o[n];s.pid===e.nodeData.id.toString()&&r.push(s)}if(0!==r.length)return;this.parent.olapEngineModule.calcChildMembers=[],this.parent.olapEngineModule.getCalcChildMembers(this.parent.dataSourceSettings,e.nodeData.id.toString()),r=this.parent.olapEngineModule.calcChildMembers,this.parent.olapEngineModule.calcChildMembers=[];for(var l=0,d=r;l<d.length;l++)(i=d[l]).pid=e.nodeData.id.toString(),i.hasChildren=!1,i.spriteCssClass="e-level-members",i.caption=""===i.caption?this.parent.localeObj.getConstant("blank"):i.caption,a.push(i);this.treeObj.addNodes(r,e.node)}},e.prototype.nodeCollapsing=function(e){e.cancel=!0},e.prototype.dragStart=function(e){var i=!1,a=e.clonedNode;if(a&&("olap"===this.parent.dataType&&(a.querySelector(".e-calc-dimension-icon,.e-calc-measure-icon,.e-measure-icon")||a.querySelector(".e-attributeCDB-icon,.e-hierarchyCDB-icon")||a.querySelector(".e-level-members,.e-namedSetCDB-icon"))||"pivot"===this.parent.dataType&&e.event.target.classList.contains("e-drag"))&&(i=!0),i){t.addClass([e.draggedNode.querySelector(".e-list-text")],"e-list-selected"),t.addClass([a],"e-pivot-calc");var n=t.getInstance(t.select("#"+this.parentID+"calculateddialog",document),r.Dialog);a.style.zIndex=(n.zIndex+1).toString(),a.style.display="inline"}else e.cancel=!0},e.prototype.drawTreeNode=function(e){if("olap"===this.parent.dataType){e.node.querySelector(".e-measure-icon")&&(e.node.querySelector(".e-list-icon").style.display="none");l=e.nodeData;e.node.setAttribute("data-field",l.id),e.node.setAttribute("data-caption",l.caption);var i=e.node.querySelector(".e-text-content");if(e.nodeData&&e.nodeData.type===Jt&&i&&e.node.querySelector(".e-list-icon.e-calc-member")){e.node.setAttribute("data-type",l.type),e.node.setAttribute("data-membertype",l.fieldType),e.node.setAttribute("data-hierarchy",l.parentHierarchy?l.parentHierarchy:""),e.node.setAttribute("data-formula",l.formula);h=l.formatString?this.formatTypes.indexOf(l.formatString)>-1?l.formatString:"Custom":"None";e.node.setAttribute("data-formatString",h),e.node.setAttribute("data-customformatstring","Custom"===h?l.formatString:"");var a=t.createElement("span",{className:G+" e-icons e-list-icon"});if(i.classList.add("e-calcfieldmember"),this.parent.isAdaptive){var r=t.createElement("span",{className:"e-list-edit-icon"+(this.isEdit&&this.currentFieldName===l.id?" e-edited ":" e-edit ")+P}),n=t.createElement("div",{className:"e-list-header-icon"});n.appendChild(r),n.appendChild(a),i.appendChild(n)}else i.appendChild(a)}if(this.parent.isAdaptive){var o=e.node.querySelector(".e-text-content");if(e.node&&e.node.querySelector(".e-list-icon")&&o){var s=e.node.querySelector(".e-list-icon");o.insertBefore(s,e.node.querySelector(".e-list-text"))}e.node&&e.node.querySelector(".e-calcMemberGroupCDB,.e-measureGroupCDB-icon,.e-folderCDB-icon")&&(e.node.querySelector(".e-checkbox-wrapper").style.display="none"),e.node&&e.node.querySelector(".e-level-members")&&(e.node.querySelector(".e-list-icon").style.display="none")}(e.node.querySelector(".e-calc-dimension-icon,.e-calc-measure-icon,.e-measure-icon")||e.node.querySelector(".e-attributeCDB-icon,.e-hierarchyCDB-icon")||e.node.querySelector(".e-level-members,.e-namedSetCDB-icon"))&&t.addClass([e.node],"e-draggable")}else{var l=e.nodeData.field;e.node.setAttribute("data-field",l),e.node.setAttribute("data-caption",e.nodeData.caption),e.node.setAttribute("data-type",e.nodeData.type);var d=f.getFieldByName(l,this.parent.dataSourceSettings.formatSettings);if(e.node.setAttribute("data-formatString",d?d.format:""),d){var p=this.getFormat(d.format),h=p?this.formatTypes.indexOf(p)>-1?d.format:"Custom":"None";e.node.setAttribute("data-customformatstring","Custom"===h?p:""),e.node.setAttribute("data-formatString",d?h:"")}var u=t.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("dragField")},className:P+" e-drag"}),c=t.createElement("div",{className:" e-iconspace"});t.prepend([u],e.node.querySelector(".e-text-content")),t.append([c,e.node.querySelector("."+k)],e.node.querySelector(".e-text-content")),this.getMenuItems(this.parent.engineModule.fieldList[l].type).length<=0?t.removeClass([e.node.querySelector("."+k)],P):e.node.querySelector("."+k).setAttribute("title",this.parent.localeObj.getConstant("format")),this.parent.engineModule.fieldList[l].aggregateType===Jt&&(e.node.querySelector("."+k).setAttribute("title",this.parent.localeObj.getConstant("remove")),t.addClass([e.node.querySelector("."+k)],G),t.addClass([e.node.querySelector(".e-iconspace")],["e-edit",P,"e-list-icon"]),e.node.querySelector(".e-edit").setAttribute("title",this.parent.localeObj.getConstant("edit")),e.node.querySelector(".e-edit").setAttribute("aria-disabled","false"),e.node.querySelector(".e-edit").setAttribute("tabindex","-1"),t.removeClass([e.node.querySelector("."+k)],k),t.removeClass([e.node.querySelector(".e-iconspace")],"e-iconspace"))}},e.prototype.createTypeContainer=function(e){for(var i=t.createElement("div",{id:this.parentID+"control_container",className:"e-pivot-treeview-outer"}),a=this.getMenuItems(this.parent.engineModule.fieldList[e].type),r=0;r<a.length;r++){var n=t.createElement("input",{id:this.parentID+"radio"+e+a[r],attrs:{type:"radio","data-ftxt":e,"data-value":a[r]},className:"e-pivot-calc-radio"});i.appendChild(n)}return i},e.prototype.getMenuItems=function(e,i){for(var a=t.isNullOrUndefined(i)?this.parent.aggregateTypes:i,r=[],n=this.getValidSummaryType(),o=0;o<a.length;o++)n.indexOf(a[o])>-1&&r.indexOf(a[o])<0&&(("Count"!==a[o]&&"DistinctCount"!==a[o]||"number"===e)&&"number"!==e||r.push(a[o]));return r},e.prototype.getValidSummaryType=function(){return["Count","DistinctCount","Sum","Avg","Median","Min","Max","Product","SampleStDev","PopulationStDev","SampleVar",Xt]},e.prototype.getAccordionData=function(e){for(var t=[],i=Object.keys(e.engineModule.fieldList),a=0,r=i.length;a<r;a++){var n=i[a];t.push({header:"<input id="+this.parentID+"_"+a+' class=e-pivot-calc-check type="checkbox" data-field='+n+' data-caption="'+this.parent.engineModule.fieldList[n].caption+'" data-type='+this.parent.engineModule.fieldList[n].type+"/>",content:this.parent.engineModule.fieldList[n].aggregateType===Jt||this.getMenuItems(this.parent.engineModule.fieldList[n].type).length<1?"":this.createTypeContainer(n).outerHTML,iconCss:this.parent.engineModule.fieldList[n].aggregateType===Jt?"e-list-icon "+(this.isEdit&&this.currentFieldName===n?"e-edited":"e-edit"):""})}return t},e.prototype.renderMobileLayout=function(e){var i=this;e.items[4].content=this.renderDialogElements().outerHTML,e.dataBind();var a=t.select("#"+this.parentID+"calculateddialog",document)?t.getInstance(t.select("#"+this.parentID+"calculateddialog",document),r.Dialog):null,n=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:a.element;this.parent.isAdaptive&&null!==this.parent.dialogRenderer.parentElement.querySelector("."+j)&&this.createDropElements();var l=new h.Button({cssClass:this.parent.cssClass,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});if(l.isStringTemplate=!0,l.appendTo(t.select("#"+this.parentID+"cancelBtn",n)),l.element&&(l.element.onclick=this.cancelBtnClick.bind(this)),null!==this.parent.dialogRenderer.parentElement.querySelector("."+j)&&this.parent.isAdaptive){var d=new h.Button({cssClass:this.parent.cssClass,isPrimary:!0,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});d.isStringTemplate=!0,d.appendTo(t.select("#"+this.parentID+"okBtn",n));var p=new s.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("fieldName"),locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:function(e){i.fieldText=e.value,i.formulaText=t.select("#"+i.parentID+"droppable",document).value},cssClass:this.parent.cssClass});p.isStringTemplate=!0,p.appendTo(t.select("#"+this.parentID+"ddlelement",n)),null!==this.formulaText&&null!==t.select("#"+this.parentID+"droppable",this.parent.dialogRenderer.parentElement)&&(t.select("#"+this.parentID+"droppable",this.parent.dialogRenderer.parentElement).value=this.formulaText),null!==this.fieldText&&null!==this.parent.dialogRenderer.parentElement.querySelector("."+R)&&(this.parent.dialogRenderer.parentElement.querySelector("."+R).value=this.fieldText,p.value=this.fieldText),d.element&&(d.element.onclick=this.applyFormula.bind(this))}else if(this.parent.isAdaptive){var u=new h.Button({cssClass:this.parent.cssClass,isPrimary:!0,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});if(u.isStringTemplate=!0,u.appendTo(t.select("#"+this.parentID+"addBtn",n)),"olap"===this.parent.dataType)this.treeObj=new o.TreeView({fields:{dataSource:this.getFieldListData(this.parent),id:"id",text:"caption",parentID:"pid",iconCss:"spriteCssClass"},showCheckBox:!0,autoCheck:!1,sortOrder:"None",enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,nodeClicked:this.fieldClickHandler.bind(this),drawNode:this.drawTreeNode.bind(this),nodeExpanding:this.updateNodeIcon.bind(this),nodeCollapsed:this.updateNodeIcon.bind(this),nodeSelected:function(e){t.removeClass([e.node],"e-active"),e.cancel=!0},cssClass:this.parent.cssClass}),this.treeObj.isStringTemplate=!0,this.treeObj.appendTo(t.select("#"+this.parentID+"accordDiv",n));else{var c=new o.Accordion({items:this.getAccordionData(this.parent),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,expanding:this.accordionExpand.bind(this),clicked:this.accordionClickHandler.bind(this),created:this.accordionCreated.bind(this)});c.isStringTemplate=!0,c.appendTo(t.select("#"+this.parentID+"accordDiv",n)),this.updateType()}u.element&&(u.element.onclick=this.addBtnClick.bind(this))}},e.prototype.accordionExpand=function(e){if(0===e.element.querySelectorAll(".e-radio-wrapper").length)for(var i=Object.keys(this.parent.engineModule.fieldList),a=0,r=i.length;a<r;a++){var n=i[a],o="number"!==this.parent.engineModule.fieldList[n].type?["Count","DistinctCount"]:["Sum","Count","Avg","Median","Min","Max","DistinctCount","Product","SampleStDev","PopulationStDev","SampleVar",Xt],s=void 0;if(n===e.element.querySelector("[data-field").getAttribute("data-field"))for(var l=0;l<o.length;l++)(s=new h.RadioButton({label:this.parent.localeObj.getConstant(o[l]),name:"AggregateType"+n,checked:e.element.querySelector("[data-type").getAttribute("data-type")===o[l],change:this.onChange.bind(this),locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass})).isStringTemplate=!0,s.appendTo(t.select("#"+this.parentID+"radio"+n+o[l],e.element))}},e.prototype.onChange=function(e){var t=e.event.target.parentElement.querySelector(".e-label").innerText,i=e.event.target.closest(".e-acrdn-item").querySelector("[data-field").getAttribute("data-caption");e.event.target.closest(".e-acrdn-item").querySelector(".e-label").innerText=i+" ("+t+")",e.event.target.closest(".e-acrdn-item").querySelector("[data-type").setAttribute("data-type",e.event.target.getAttribute("data-value"))},e.prototype.updateType=function(){for(var e=Object.keys(this.parent.engineModule.fieldList),i=t.select("#"+this.parentID+"calculateddialog",document)?t.getInstance(t.select("#"+this.parentID+"calculateddialog",document),r.Dialog):null,a=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:i.element,n=0,o=e.length;n<o;n++){var s=e[n],l=null;l="number"===this.parent.engineModule.fieldList[s].type&&"include"!==this.parent.engineModule.fieldList[s].type&&"exclude"!==this.parent.engineModule.fieldList[s].type||"DistinctCount"===this.parent.engineModule.fieldList[s].aggregateType?void 0!==this.parent.engineModule.fieldList[s].aggregateType?this.parent.engineModule.fieldList[s].aggregateType:"Sum":"Count";var d=new h.CheckBox({label:this.parent.engineModule.fieldList[s].caption+" ("+this.parent.localeObj.getConstant(l)+")",locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass});d.isStringTemplate=!0,d.appendTo(t.select("#"+this.parentID+"_"+n,a)),t.select("#"+this.parentID+"_"+n,a).setAttribute("data-field",s),t.select("#"+this.parentID+"_"+n,a).setAttribute("data-type",l)}},e.prototype.cancelBtnClick=function(){this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)},e.prototype.addBtnClick=function(){var e="",t=null,i=null;if("pivot"===this.parent.dataType){for(var a=document.querySelectorAll(".e-accordion .e-check"),r=0;r<a.length;r++)if(t=a[r].parentElement.querySelector("[data-field]").getAttribute("data-field"),-1===(i=a[r].parentElement.querySelector("[data-field]").getAttribute("data-type")).indexOf(Jt))e=e+'"'+i+"("+t+')"';else for(var n=0;n<this.parent.dataSourceSettings.calculatedFieldSettings.length;n++)if(this.parent.dataSourceSettings.calculatedFieldSettings[n].name===t){e+=this.parent.dataSourceSettings.calculatedFieldSettings[n].formula;break}}else for(var o=this.treeObj.getAllCheckedNodes(),s=this.parent.olapEngineModule,l=0,d=o;l<d.length;l++){var p=d[l];e+=s.fieldList[p]&&s.fieldList[p].type===Jt?s.fieldList[p].tag:p}this.formulaText=null!==this.formulaText?this.formulaText+e:e,this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)},e.prototype.createCalculatedFieldDialog=function(e){if(this.parent.isAdaptive&&"pivotfieldlist"===this.parent.getModuleName())this.renderAdaptiveLayout(!e||void 0===e.edit||e.edit),this.isEdit=e&&void 0!==e.edit?e.edit:this.isEdit;else if(!this.parent.isAdaptive){if(this.isEdit=!(!e||void 0===e.edit)&&e.edit,this.renderDialogLayout(),e&&e.edit){var i=this.treeObj.element.querySelector('li[data-field="'+e.fieldName+'"]');if(i)if(t.addClass([i],["e-active","e-node-focus"]),i.setAttribute("aria-selected","true"),i.id=this.treeObj.element.id+"_active","pivot"===this.parent.dataType){var a={event:{target:i.querySelector(".e-list-icon.e-edit.e-icons")}};this.fieldClickHandler(a)}else this.displayMenu(i)}var n=t.getInstance(t.select("#"+this.parentID+"calculateddialog",document),r.Dialog);n.element.style.top=parseInt(n.element.style.top,10)<0?"0px":n.element.style.top}},e.prototype.renderDialogLayout=function(){this.newFields=t.extend([],this.parent.dataSourceSettings.calculatedFieldSettings,null,!0),this.createDialog();var e=t.getInstance(t.select("#"+this.parentID+"calculateddialog",document),r.Dialog);e.content=this.renderDialogElements(),e.refresh();var i=new s.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("fieldName"),locale:this.parent.locale,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass});i.isStringTemplate=!0,i.appendTo(t.select("#"+this.parentID+"ddlelement",e.element)),this.createDropElements(),this.createTreeView(),this.droppable=new t.Droppable(t.select("#"+this.parentID+"droppable",e.element)),this.keyboardEvents=new t.KeyboardEvents(e.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:{moveRight:"rightarrow",enter:"enter",shiftE:"shift+E",delete:"delete"},eventName:"keydown"})},e.prototype.createConfirmDialog=function(e,i,a,n,o){var s=t.createElement("div",{id:this.parentID+"_CalculatedFieldErrorDialog",className:"e-pivot-error-dialog"});this.parent.element.appendChild(s);var l=new r.Dialog({animationSettings:{effect:"Fade"},allowDragging:!1,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"auto",height:"auto",position:{X:"center",Y:"center"},buttons:[{click:n?this.removeCalcField.bind(this,o):this.replaceFormula.bind(this,a),isFlat:!1,buttonModel:{cssClass:"e-ok-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:n?this.parent.localeObj.getConstant("yes"):this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:this.closeErrorDialog.bind(this),isFlat:!1,buttonModel:{cssClass:"e-cancel-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:n?this.parent.localeObj.getConstant("no"):this.parent.localeObj.getConstant("cancel")}}],header:e,content:i,isModal:!0,visible:!0,closeOnEscape:!0,target:document.body,cssClass:this.parent.cssClass,close:this.removeErrorDialog.bind(this)});l.isStringTemplate=!0,l.appendTo(s)},e.prototype.replaceFormula=function(e){var i=this.parent.dataSourceSettings;if("olap"===this.parent.dataType){for(r=0;r<i.calculatedFieldSettings.length;r++)if(i.calculatedFieldSettings[r].name===e.name){t.isNullOrUndefined(e.hierarchyUniqueName)||(i.calculatedFieldSettings[r].hierarchyUniqueName=e.hierarchyUniqueName),i.calculatedFieldSettings[r].formatString=e.formatString,i.calculatedFieldSettings[r].formula=e.formula,this.parent.lastCalcFieldInfo=i.calculatedFieldSettings[r];break}}else for(var a=0;a<i.values.length;a++)if(i.values[a].type===Jt&&i.values[a].name===e.name)for(var r=0;r<i.calculatedFieldSettings.length;r++)i.calculatedFieldSettings[r].name===e.name&&(i.calculatedFieldSettings[r].formula=e.formula,this.parent.lastCalcFieldInfo=i.calculatedFieldSettings[r],this.updateFormatSettings(i,e.name,e.formatString));this.addFormula(i,e.name),this.removeErrorDialog()},e.prototype.removeErrorDialog=function(){var e=t.select("#"+this.parentID+"_CalculatedFieldErrorDialog",document),i=e?t.getInstance(e,r.Dialog):null;i&&!i.isDestroyed&&i.destroy(),null!==t.select("#"+this.parentID+"_CalculatedFieldErrorDialog",document)&&t.remove(t.select("#"+this.parentID+"_CalculatedFieldErrorDialog",document))},e.prototype.closeErrorDialog=function(){t.getInstance(t.select("#"+this.parentID+"_CalculatedFieldErrorDialog",document),r.Dialog).close()},e.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on("init-calculatedfield",this.createCalculatedFieldDialog,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("init-calculatedfield",this.createCalculatedFieldDialog)},e.prototype.destroy=function(){this.treeObj&&!this.treeObj.isDestroyed&&this.treeObj.destroy(),this.treeObj&&(this.treeObj=null),this.newFields&&(this.newFields=null),this.curMenu&&(this.curMenu=null),this.droppable&&(this.droppable=null),this.keyboardEvents&&(this.keyboardEvents=null);var e=t.select("#"+this.parentID+"ddlelement",document);e&&t.getInstance(e,s.MaskedTextBox).destroy(),(e=t.select("#"+this.parentID+"calculateddialog",document))&&t.getInstance(e,r.Dialog).destroy(),(e=t.select("#"+this.parentID+"CalcContextmenu",document))&&t.getInstance(e,o.ContextMenu).destroy(),(e=t.select("#"+this.parentID+"accordDiv",document))&&t.getInstance(e,o.Accordion).destroy(),(e=t.select("#"+this.parentID+"_CalculatedFieldErrorDialog",document))&&t.getInstance(e,r.Dialog).destroy()},e}();Kt.Inject(Zt);var $t=function(){function e(e){this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"fieldList"},e.prototype.initiateModule=function(){if(!t.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)){if(this.element=t.createElement("div",{id:this.parent.element.id+"_PivotFieldList",styles:"position:"+(this.parent.enableRtl?"static":"absolute")+";height:0;width:"+this.parent.element.style.width+";display:none"}),null===t.select("#"+this.parent.element.id+"containerwrapper",document)){var e=t.createElement("div",{id:this.parent.element.id+"containerwrapper",styles:"height:"+(isNaN(this.parent.height)?this.parent.height:this.parent.height+"px")});this.parent.element.parentElement.appendChild(e),e.appendChild(this.element),e.appendChild(this.parent.element)}else t.select("#"+this.parent.element.id+"containerwrapper",document).appendChild(this.element);this.parent.pivotFieldListModule=new Kt({dataSourceSettings:{providerType:this.parent.dataSourceSettings.providerType,rows:[],columns:[],values:[],filters:[]},spinnerTemplate:this.parent.spinnerTemplate,allowDeferLayoutUpdate:this.parent.allowDeferLayoutUpdate,renderMode:"Popup",allowCalculatedField:this.parent.allowCalculatedField,showValuesButton:this.parent.showValuesButton,enableRtl:this.parent.enableRtl,locale:this.parent.locale,target:this.parent.element.parentElement,aggregateTypes:this.parent.aggregateTypes,maxNodeLimitInMemberEditor:this.parent.maxNodeLimitInMemberEditor,aggregateCellInfo:this.parent.bindTriggerEvents.bind(this.parent),onHeadersSort:this.parent.bindTriggerEvents.bind(this.parent),cssClass:this.parent.cssClass,enableFieldSearching:this.parent.enableFieldSearching,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),this.parent.pivotFieldListModule.isPopupView=!0,this.parent.pivotFieldListModule.pivotGridModule=this.parent,this.parent.pivotFieldListModule.appendTo(this.element)}},e.prototype.updateControl=function(){if(this.parent.allowDeferLayoutUpdate&&(this.parent.actionObj.actionName="Field list refreshed"),this.element){for(var e=void 0,i=0;i<this.parent.toolbar.length;i++)"FieldList"===this.parent.toolbar[i]&&(e=!0);e&&"Server"===this.parent.dataSourceSettings.mode?this.element.style.display="none":this.element.style.display="block",t.prepend([this.element],this.parent.element),this.parent.showGroupingBar&&this.parent.groupingBarModule?(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.update.bind(this))):t.isNullOrUndefined(this.element.querySelector(".e-toggle-field-list"))||(t.setStyleAttribute(this.element.querySelector(".e-toggle-field-list"),{left:"auto"}),this.parent.enableRtl?t.removeClass([this.element.querySelector(".e-toggle-field-list")],"e-fieldlist-left"):t.addClass([this.element.querySelector(".e-toggle-field-list")],"e-fieldlist-left")),t.setStyleAttribute(this.element,{width:t.formatUnit(this.parent.element.offsetWidth)})}this.parent.pivotFieldListModule.update(this.parent)},e.prototype.update=function(){var e;if((e="Table"!==this.parent.currentView?this.parent.chart?this.parent.pivotChartModule.getCalulatedWidth():e:this.parent.grid?this.parent.grid.element.offsetWidth:e)&&!t.isNullOrUndefined(this.element.querySelector(".e-toggle-field-list"))){var i=e<400?400:e;t.setStyleAttribute(this.element.querySelector(".e-toggle-field-list"),{left:t.formatUnit(this.parent.enableRtl?-Math.abs(i-this.element.querySelector(".e-toggle-field-list").offsetWidth):i-this.element.querySelector(".e-toggle-field-list").offsetWidth),top:this.parent.element.querySelector(".e-hscroll")?this.parent.element.querySelector(".e-toggle-field-list").offsetHeight.toString()+"px":""}),this.parent.enableRtl?t.addClass([this.element.querySelector(".e-toggle-field-list")],"e-fieldlist-left"):t.removeClass([this.element.querySelector(".e-toggle-field-list")],"e-fieldlist-left")}},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("init-groupingbar",this.initiateModule,this),this.parent.on(b,this.updateControl,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("init-groupingbar",this.initiateModule),this.parent.off(b,this.updateControl))},e.prototype.destroy=function(){this.removeEventListener(),this.parent.pivotFieldListModule&&!this.parent.pivotFieldListModule.isDestroyed&&(this.parent.pivotFieldListModule.destroy(),this.parent.pivotFieldListModule=null,t.isNullOrUndefined(t.select("#"+this.parent.element.id+"_PivotFieldList",document))||t.remove(t.select("#"+this.parent.element.id+"_PivotFieldList",document)))},e}(),ei=function(){function e(e){this.parent=e}return e.prototype.render=function(){(!this.parent.pivotButtonModule||this.parent.pivotButtonModule&&this.parent.pivotButtonModule.isDestroyed)&&new Gt(this.parent),this.createPivotButtons();for(var e=[],i=(e=e.concat([].slice.call(this.parent.groupingBarModule.rowPanel.querySelectorAll(".e-pvt-btn-div")))).length,a=0;a<i;a++){if(!this.parent.isTabular){var r=t.createElement("span",{className:"e-indent-div",styles:this.parent.isTabular?"auto":"width:"+24*a+"px"});t.prepend([r],e[a])}}},e.prototype.createPivotButtons=function(){var e=[this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.values,this.parent.dataSourceSettings.filters],a=Array.prototype.slice.call(this.parent.element.querySelectorAll(".e-group-all-fields,.e-group-rows,.e-group-columns,.e-group-values,.e-group-filters"));t.isNullOrUndefined(this.parent.element.querySelector(".e-group-pivot-rows"))&&a.push(this.parent.groupingBarModule.rowPanel);for(d=0;d<a.length;d++){var r=a[d];this.parent.dataSourceSettings.values.length>0&&r.classList.contains("e-group-chart-values")&&this.parent.dataSourceSettings.columns.length>0&&r.classList.contains("e-group-chart-columns")||(r.innerHTML="")}if("pivot"===this.parent.dataType&&this.parent.dataSourceSettings.dataSource&&(!(this.parent.dataSourceSettings.dataSource instanceof i.DataManager)&&this.parent.dataSourceSettings.dataSource.length>0||this.parent.dataSourceSettings.dataSource instanceof i.DataManager&&this.parent.engineModule.data&&this.parent.engineModule.data.length>0)||"olap"===this.parent.dataType&&this.parent.dataSourceSettings.url&&""!==this.parent.dataSourceSettings.url||"Server"===this.parent.dataSourceSettings.mode&&this.parent.dataSourceSettings.url&&""!==this.parent.dataSourceSettings.url){var n=["rows","columns","values","filters"];if("pivot"===this.parent.dataType&&this.parent.groupingBarSettings.showFieldsPanel){n.push("all-fields"),e.push([]);for(var o=0,s=this.parent.engineModule&&this.parent.engineModule.fieldList?Object.keys(this.parent.engineModule.fieldList):[];o<s.length;o++){var l=s[o];this.parent.engineModule.fieldList[l]&&!this.parent.engineModule.fieldList[l].isSelected&&e[e.length-1].push(f.getFieldInfo(l,this.parent,!0).fieldItem)}}for(var d=0,p=e.length;d<p;d++)if(e[d]){var h={field:e[d],axis:n[d].toString()};this.parent.notify("pivot-button-update",h)}}},e}(),ti=function(){function e(e){this.rowAxisWidth=0,this.parent=e,this.parent.groupingBarModule=this,this.resColWidth=this.parent.isAdaptive?180:249,this.addEventListener(),this.parent.axisFieldModule=new ei(this.parent),this.touchObj=new t.Touch(this.parent.element,{tapHold:this.tapHoldHandler.bind(this)})}return e.prototype.getModuleName=function(){return"groupingBar"},e.prototype.renderLayout=function(){this.groupingTable=t.createElement("div",{className:"e-grouping-bar"});var e=t.createElement("div",{className:"e-left-axis-fields"});this.rightAxisPanel=t.createElement("div",{className:"e-right-axis-fields"});var i=t.createElement("div",{className:"e-axis-row e-axiscontainer"}),a=t.createElement("div",{className:"e-axis-column e-axiscontainer"}),r=t.createElement("div",{className:"e-axis-value e-axiscontainer"}),n=t.createElement("div",{className:"e-axis-filter e-axiscontainer"});this.rowPanel=t.createElement("div",{className:"e-group-rows e-rows"+(this.parent.isTabular?" e-tabular-group-rows":"")});var o=t.createElement("div",{className:"e-group-columns e-columns"}),s=t.createElement("div",{className:"e-group-values e-values"}),l=t.createElement("div",{className:"e-group-filters e-filters"});i.appendChild(this.rowPanel),a.appendChild(o),r.appendChild(s),n.appendChild(l),this.rowAxisPanel=i,e.appendChild(r),e.appendChild(i),this.rightAxisPanel.appendChild(n),this.rightAxisPanel.appendChild(a),this.groupingTable.appendChild(t.createElement("div",{styles:"display:flex;"})),this.groupingTable.firstElementChild.appendChild(e),this.groupingTable.firstElementChild.appendChild(this.rightAxisPanel),"pivot"===this.parent.dataType&&null!=this.parent.groupingBarSettings&&this.parent.groupingBarSettings.showFieldsPanel&&(this.gridPanel=this.createToolbarUI(this.groupingTable)),this.groupingTable.classList.add("e-pivot-grouping-bar"),this.groupingTable.querySelector(".e-group-rows").classList.add("e-group-pivot-rows");for(var d=0,p=[this.rowPanel,o,s,l];d<p.length;d++){var h=p[d];this.parent.groupingBarSettings.allowDragAndDrop&&new t.Droppable(h,{}),this.unWireEvent(h),this.wireEvent(h)}"Table"!==this.parent.displayOption.view&&"Table"!==this.parent.groupingBarSettings.displayMode?(this.groupingChartTable=this.groupingTable.cloneNode(!0),t.select("#"+this.parent.element.id+"_AllFields",this.groupingChartTable)&&(t.select("#"+this.parent.element.id+"_AllFields",this.groupingChartTable).remove(),this.chartPanel=this.createToolbarUI(this.groupingChartTable)),this.groupingChartTable.classList.add("e-chart-grouping-bar"),this.groupingChartTable.classList.remove("e-pivot-grouping-bar"),this.groupingChartTable.querySelector(".e-group-rows").classList.add("e-group-chart-rows"),this.groupingChartTable.querySelector(".e-group-rows").classList.remove("e-group-pivot-rows"),this.parent.chartSettings.enableMultipleAxis&&this.parent.chartSettings.chartSeries&&["Pie","Pyramid","Doughnut","Funnel"].indexOf(this.parent.chartSettings.chartSeries.type)<0?this.groupingChartTable.querySelector(".e-group-values").classList.add("e-group-chart-multi-values"):this.groupingChartTable.querySelector(".e-group-values").classList.add("e-group-chart-values"),this.parent.chartSettings.chartSeries&&["Pie","Pyramid","Doughnut","Funnel"].indexOf(this.parent.chartSettings.chartSeries.type)>-1?this.groupingChartTable.querySelector(".e-group-columns").classList.add("e-group-chart-columns"):this.groupingChartTable.querySelector(".e-group-columns").classList.add("e-group-chart-accumulation-column"),this.groupingChartTable.querySelector(".e-group-filters").classList.add("e-group-chart-filters")):this.groupingChartTable=void 0,"Chart"!==this.parent.displayOption.view&&"Chart"!==this.parent.groupingBarSettings.displayMode||(this.groupingTable=void 0)},e.prototype.appendToElement=function(){var e=this.groupingTable?this.groupingTable:this.groupingChartTable;if(!t.isNullOrUndefined(e)){var i=e.getElementsByClassName("e-left-axis-fields")[0],a=e.getElementsByClassName("e-group-filters e-filters")[0],r=e.getElementsByClassName("e-group-columns e-columns")[0],n=e.getElementsByClassName("e-group-values e-values")[0];if((this.parent.element.querySelector(".e-grid")||this.parent.element.querySelector("."+W))&&this.parent.showGroupingBar){if(this.parent.element.querySelector(".e-grouping-bar"))for(var o=this.parent.element.querySelectorAll(".e-grouping-bar"),s=0;s<o.length;s++){var l=o[s];t.remove(l)}if(this.groupingChartTable)if(t.select("#"+this.parent.element.id+"_chart",this.parent.element)){if(t.setStyleAttribute(this.groupingChartTable,{width:t.formatUnit(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())}),this.parent.element.insertBefore(this.groupingChartTable,t.select("#"+this.parent.element.id+"_chart",this.parent.element)),this.groupingChartTable.querySelector(".e-all-fields-axis")&&null!=this.chartPanel&&!this.chartPanel.isDestroyed){var d=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2;this.chartPanel.width=d<400?"398px":d,this.chartPanel.refreshOverflow(),this.parent.showFieldList&&this.parent.pivotFieldListModule&&this.parent.pivotFieldListModule.element&&(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.alignIcon.bind(this)))}}else this.groupingChartTable=void 0;if("Chart"!==this.parent.displayOption.view&&this.groupingTable){this.parent.isAdaptive&&(this.parent.isTabular?(i.style.minWidth=this.parent.dataSourceSettings.rows.length*this.parent.gridSettings.columnWidth+"px",n.style.minWidth=this.parent.dataSourceSettings.rows.length*this.parent.gridSettings.columnWidth+"px"):(i.style.minWidth="180px",n.style.minWidth="180px")),this.parent.firstColWidth&&(i.style.minWidth="auto",n.style.minWidth="auto"),a.removeAttribute("style"),r.removeAttribute("style"),this.rowPanel.removeAttribute("style");var p=void 0;if(p="olap"===this.parent.dataType?this.parent.olapEngineModule.headerContent?Object.keys(this.parent.olapEngineModule.headerContent).length:0:this.parent.engineModule.headerContent?Object.keys(this.parent.engineModule.headerContent).length:0,!t.isNullOrUndefined(p)){var h=this.parent.element.querySelector("."+B).querySelector(".e-columnheader");h.removeAttribute("style"),t.addClass([h.querySelector("."+A)],"e-group-row"),h.querySelector(".e-group-row").querySelector(".e-headercelldiv").style.display="none",h.querySelector(".e-group-row").querySelector(".e-sortfilterdiv").style.display="none"}if(this.parent.element.insertBefore(this.groupingTable,this.parent.element.querySelector(".e-grid")),t.setStyleAttribute(this.groupingTable,{width:t.formatUnit(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())}),this.groupingTable&&this.groupingTable.querySelector(".e-all-fields-axis")&&null!=this.gridPanel&&!this.gridPanel.isDestroyed){var u=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2;this.gridPanel.width=u,this.gridPanel.refreshOverflow()}this.groupingTable.style.minWidth="400px",this.parent.axisFieldModule.render(),this.setGridRowWidth();var c=this.parent.element.querySelector("."+B).querySelector("colgroup").children[0],g=this.parent.isTabular?this.rowAxisWidth:parseInt(c.style.width,10),m=t.formatUnit(this.groupingTable.offsetWidth-g);t.setStyleAttribute(n,{width:g+"px"}),t.setStyleAttribute(this.rightAxisPanel,{width:m}),this.groupingTable.style.display="";var f=n.offsetHeight/2;"Chart"===this.parent.displayOption.primary&&(this.groupingTable.style.display="none"),f>r.offsetHeight&&(t.setStyleAttribute(a,{height:t.formatUnit(f)}),t.setStyleAttribute(r,{height:t.formatUnit(f+2)}));var v=this.parent.element.querySelector("."+B).offsetHeight;t.setStyleAttribute(this.rowPanel,{height:v+"px"}),this.parent.element.querySelector("."+B).querySelector(".e-rhandler")&&(this.parent.element.querySelector("."+B).querySelector(".e-rhandler").style.height=v+"px");for(var S=[].slice.call(this.parent.element.querySelector("."+B).querySelector("thead").querySelectorAll("tr")).filter(function(e){return e.childNodes.length>0}),y=v/S.length,b=0,C=S;b<C.length;b++){var x=C[b];t.setStyleAttribute(x,{height:y+"px"});for(var w=0,T=[].slice.call(x.querySelectorAll(".e-rhandler"));w<T.length;w++){var M=T[w];t.setStyleAttribute(M,{height:y+"px"})}}}else this.parent.axisFieldModule.render(),this.updateChartAxisHeight();if(this.parent.showToolbar&&"Both"===this.parent.displayOption.view){var D="Table"===this.parent.currentView?".e-chart-grouping-bar":".e-pivot-grouping-bar",O=this.parent.element.querySelector(D);O&&(O.style.display="none")}}}},e.prototype.updateChartAxisHeight=function(){if(this.groupingChartTable&&t.select("#"+this.parent.element.id+"_chart",this.parent.element)){var e=this.groupingChartTable.querySelector(".e-group-rows"),i=this.groupingChartTable.querySelector(".e-group-values"),a=this.groupingChartTable.querySelector(".e-group-filters"),r=this.groupingChartTable.querySelector(".e-group-columns");if(e&&r&&(e.style.height="auto",r.style.height="auto",e.offsetHeight>0&&r.offsetHeight>0)){n=e.offsetHeight>r.offsetHeight?e.offsetHeight:r.offsetHeight;t.setStyleAttribute(e,{height:t.formatUnit(n)}),t.setStyleAttribute(r,{height:t.formatUnit(n)})}if(i&&a&&(i.style.height="auto",a.style.height="auto",i.offsetHeight>0&&a.offsetHeight>0)){var n=i.offsetHeight>a.offsetHeight?i.offsetHeight:a.offsetHeight;t.setStyleAttribute(i,{height:t.formatUnit(n)}),t.setStyleAttribute(a,{height:t.formatUnit(n)})}}},e.prototype.refreshUI=function(){if(this.groupingChartTable){if(t.setStyleAttribute(this.groupingChartTable,{width:t.formatUnit(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())}),this.groupingChartTable.querySelector(".e-all-fields-axis")&&null!=this.chartPanel&&!this.chartPanel.isDestroyed){var e=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2;this.chartPanel.width=e<400?"398px":e,this.chartPanel.refreshOverflow()}this.updateChartAxisHeight(),this.parent.showFieldList&&this.parent.pivotFieldListModule&&this.parent.pivotFieldListModule.element&&(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.alignIcon.bind(this)))}if(this.groupingTable){var i=this.groupingTable.getElementsByClassName("e-group-values e-values")[0];if(t.setStyleAttribute(this.groupingTable,{width:t.formatUnit(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())}),this.groupingTable&&this.groupingTable.querySelector(".e-all-fields-axis")&&null!=this.gridPanel&&!this.gridPanel.isDestroyed){var a=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2;this.gridPanel.width=a<400?"398px":a,this.gridPanel.refreshOverflow()}this.groupingTable.style.minWidth="400px";var r=this.parent.element.querySelector("."+B).querySelector("colgroup").children[0],n=this.parent.isTabular?this.rowAxisWidth:parseInt(r.style.width,10),o=t.formatUnit(this.groupingTable.offsetWidth-n);if(t.setStyleAttribute(i,{width:n+"px"}),t.setStyleAttribute(this.rightAxisPanel,{width:o}),this.parent.showFieldList&&this.parent.pivotFieldListModule&&this.parent.pivotFieldListModule.element&&(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.alignIcon.bind(this))),!this.parent.grid.element.querySelector(".e-group-row")){var s=this.parent.element.querySelector("."+B).querySelector(".e-columnheader");t.addClass([s.querySelector("."+A)],"e-group-row"),t.setStyleAttribute(this.rowPanel,{height:this.parent.element.querySelector("."+B).offsetHeight+"px"}),s.querySelector(".e-group-row").appendChild(this.rowAxisPanel),t.setStyleAttribute(s.querySelector(".e-group-row").querySelector(".e-headercelldiv"),{display:"none"}),t.setStyleAttribute(s.querySelector(".e-group-row").querySelector(".e-sortfilterdiv"),{display:"none"});var l=this.parent.element.querySelector("."+B).offsetHeight;t.setStyleAttribute(this.rowPanel,{height:l+"px"}),this.parent.element.querySelector("."+B).querySelector(".e-rhandler")&&(this.parent.element.querySelector("."+B).querySelector(".e-rhandler").style.height=l+"px");for(var d=[].slice.call(this.parent.element.querySelector("."+B).querySelector("thead").querySelectorAll("tr")).filter(function(e){return e.childNodes.length>0}),p=l/d.length,h=0,u=d;h<u.length;h++){var c=u[h];t.setStyleAttribute(c,{height:p+"px"});for(var g=0,m=[].slice.call(c.querySelectorAll(".e-rhandler"));g<m.length;g++){var f=m[g];f.parentElement.parentElement.querySelector(".e-leftfreeze")||t.setStyleAttribute(f,{height:p+"px"})}}}}},e.prototype.alignIcon=function(){if(this.parent.pivotFieldListModule){var e=this.parent.pivotFieldListModule.element,i=void 0;if(i="Table"===this.parent.currentView?this.parent.grid?this.parent.grid.element.offsetWidth:i:this.parent.chart?this.parent.pivotChartModule.getCalulatedWidth():i){var a=this.parent.isAdaptive?300:400,r=i<a?a:i;t.setStyleAttribute(e.querySelector(".e-toggle-field-list"),{left:t.formatUnit(this.parent.enableRtl?-Math.abs(r-e.querySelector(".e-toggle-field-list").offsetWidth):r-e.querySelector(".e-toggle-field-list").offsetWidth),top:this.parent.element.querySelector(".e-hscroll")?this.parent.element.querySelector(".e-toggle-field-list").offsetHeight.toString()+"px":""})}}},e.prototype.setGridRowWidth=function(){var e=this.parent.element.querySelector("."+B).querySelector(".e-columnheader");t.addClass([e.querySelector("."+A)],"e-group-row"),e.querySelector(".e-group-row").appendChild(this.rowAxisPanel);var i=this.parent.element.querySelector("."+B).querySelector("colgroup").children[0];if(this.rowPanel.querySelector(".e-pivot-button"))if(this.parent.isAdaptive){if(!this.parent.firstColWidth){var a=this.parent.grid.columns;if(a&&a.length>0)if(this.parent.isTabular){this.rowAxisWidth=this.parent.dataSourceSettings.rows.length*this.parent.gridSettings.columnWidth;for(var r=0;r<this.parent.engineModule.rowMaxLevel;r++)a[r].width=this.parent.gridSettings.columnWidth}else a[0].width=this.resColWidth;this.parent.posCount=0,this.parent.grid.headerModule.refreshUI()}}else{var n=[].slice.call(this.rowPanel.querySelectorAll(".e-pvt-btn-div")),o=n[n.length-1],s=this.parent.isTabular?0:o.querySelector(".e-indent-div").offsetWidth+20,l=o.querySelector(".e-pivot-button").offsetWidth+s,d=t.formatUnit(l<this.resColWidth?this.resColWidth:l),p=this.parent.element.querySelector("."+B).querySelector("."+A),h=this.parent.element.querySelector(".e-content").querySelector("colgroup").children[0],u=parseInt(d,10),c=this.parent.pivotColumns.length>0;(a=this.parent.grid.columns)&&a.length>0&&(a[0].width=a[0].autoFit?a[0].width:u>this.resColWidth?u:this.resColWidth);var g=void 0;g="olap"===this.parent.dataType?this.parent.renderModule.calculateColWidth(this.parent.olapEngineModule.pivotValues.length>0?this.parent.olapEngineModule.pivotValues[0].length:2):this.parent.renderModule.calculateColWidth(this.parent.dataSourceSettings.values.length>0&&this.parent.engineModule.pivotValues.length>0?this.parent.engineModule.pivotValues[0].length:2);for(var m=0;m<a.length;m++)if(0!==m)if(a[m].columns)this.parent.setCommonColumnsWidth(this.parent.renderModule.pivotColumns[m].columns,g);else if("auto"!==a[m].width){var f=a[m].customAttributes?a[m].customAttributes.cell.valueSort.levelName:"",v=this.parent.renderModule.setSavedWidth(f,g);a[m].width=a[m].autoFit||c&&this.parent.pivotColumns[m].autoFit?a[m].width:this.parent.renderModule.lastColumn&&this.parent.renderModule.lastColumn.field===a[m].field?v-3:v}else a[m].minWidth=g;if(this.parent.isTabular){var S=this.rowAxisPanel.querySelectorAll(".e-pvt-btn-div");this.rowAxisWidth=this.getPivotButtonsTotalWidth(S),0===this.parent.engineModule.rowMaxLevel&&1===S.length&&(this.rowAxisWidth=250),.8*this.parent.element.getBoundingClientRect().width<=this.rowAxisWidth&&(this.rowAxisWidth=S.length*this.parent.gridSettings.columnWidth)}this.parent.posCount=0,this.parent.setGridColumns(this.parent.grid.columns),this.parent.grid.headerModule.refreshUI(),this.parent.firstColWidth||(d=a[0].autoFit?a[0].width.toString():d,i.style.width=d,h.style.width=d,p.style.width=d,t.setStyleAttribute(p,{width:d}))}else this.parent.grid.columns&&this.parent.grid.columns.length>0&&(this.parent.grid.columns[0].width=this.parent.grid.columns[0].width>this.resColWidth?this.parent.grid.columns[0].width:this.resColWidth),this.parent.grid.headerModule.refreshUI();(this.groupingTable||this.groupingChartTable)&&this.refreshUI()},e.prototype.wireEvent=function(e){t.EventHandler.add(e,"mouseover",this.dropIndicatorUpdate,this),t.EventHandler.add(e,"mouseleave",this.dropIndicatorUpdate,this)},e.prototype.unWireEvent=function(e){t.EventHandler.remove(e,"mouseover",this.dropIndicatorUpdate),t.EventHandler.remove(e,"mouseleave",this.dropIndicatorUpdate)},e.prototype.dropIndicatorUpdate=function(e){(this.parent.isDragging&&e.target.classList.contains("e-droppable")&&"mouseover"===e.type||!this.parent.isDragging||!e.target.classList.contains("e-droppable")&&"mouseleave"===e.type)&&(t.removeClass([].slice.call(this.parent.element.querySelectorAll(".e-drop-indicator")),"e-drop-hover"),t.removeClass([].slice.call(this.parent.element.querySelectorAll(".e-drop-indicator-last")),"e-drop-hover"))},e.prototype.tapHoldHandler=function(e){var i=t.closest(e.originalEvent.target,".e-pivot-button");if(!t.isNullOrUndefined(i)&&this.parent.isAdaptive){var a=i.getBoundingClientRect();return this.parent.contextMenuModule.fieldElement=i,void this.parent.contextMenuModule.menuObj.open(a.top,a.left)}},e.prototype.RefreshFieldsPanel=function(){if("pivot"===this.parent.dataType&&null!=this.parent.groupingBarSettings){if(t.selectAll("#"+this.parent.element.id+"_AllFields",this.parent.element).length>0)for(var e=0,i=t.selectAll("#"+this.parent.element.id+"_AllFields",this.parent.element);e<i.length;e++)i[e].remove();this.parent.groupingBarSettings.showFieldsPanel&&(this.groupingChartTable&&"Table"!==this.parent.displayOption.view&&"Table"!==this.parent.groupingBarSettings.displayMode&&(this.chartPanel=this.createToolbarUI(this.groupingChartTable)),this.groupingTable&&(this.gridPanel=this.createToolbarUI(this.groupingTable)),this.parent.axisFieldModule.render(),this.refreshUI())}},e.prototype.createToolbarUI=function(e){t.select("#"+this.parent.element.id+"_AllFields",e)&&t.select("#"+this.parent.element.id+"_AllFields",e).remove(),e.prepend(t.createElement("div",{id:this.parent.element.id+"_AllFields"}));var i=new o.Toolbar({cssClass:"e-all-fields-axis"+(this.parent.cssClass?" "+this.parent.cssClass:""),enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,items:[{template:"<div class=e-group-all-fields></div>"}],allowKeyboard:!1,width:this.parent.gridSettings.allowAutoResizing?"auto":this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2});return i.appendTo(t.select("#"+this.parent.element.id+"_AllFields",e)),i},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("init-groupingbar",this.renderLayout,this),this.parent.on(b,this.appendToElement,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(b,this.appendToElement),this.parent.off("init-groupingbar",this.renderLayout))},e.prototype.destroy=function(){this.removeEventListener(),this.parent.pivotButtonModule&&(this.parent.pivotButtonModule.destroy(),this.parent.pivotButtonModule=null),this.groupingTable&&this.groupingTable.querySelector(".e-all-fields-axis")&&null!=this.gridPanel&&!this.gridPanel.isDestroyed&&(this.gridPanel.destroy(),this.gridPanel=null),this.groupingChartTable&&this.groupingChartTable.querySelector(".e-all-fields-axis")&&null!=this.chartPanel&&!this.chartPanel.isDestroyed&&(this.chartPanel.destroy(),this.chartPanel=null),this.touchObj&&!this.touchObj.isDestroyed&&this.touchObj.destroy(),this.parent.element.querySelector(".e-grouping-bar")&&t.remove(this.parent.element.querySelector(".e-grouping-bar"))},e.prototype.getPivotButtonsTotalWidth=function(e){for(var t=0,i=0;i<e.length;i++)t+=(e[i].getBoundingClientRect().width<this.parent.gridSettings.columnWidth?this.parent.gridSettings.columnWidth:e[i].getBoundingClientRect().width)+6;return t},e}(),ii=function(){function e(e){this.parent=e,this.parent.conditionalFormattingModule=this,this.parentID=this.parent.element.id,this.fontColor=[],this.backgroundColor=[],this.newFormat=[]}return e.prototype.getModuleName=function(){return"conditionalFormatting"},e.prototype.createDialog=function(){null!==t.select("#"+this.parentID+"conditionalformatting",document)&&t.remove(t.select("#"+this.parentID+"conditionalformatting",document));var e=t.createElement("div",{id:this.parentID+"conditionalformatting",className:"e-pivot-formatting-dialog"});this.parent.element.appendChild(e);var i,a=[{click:this.addButtonClick.bind(this),isFlat:!1,buttonModel:{cssClass:(this.parent.isAdaptive?"e-small e-round e-format-condition-button":"e-format-condition-button")+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:P+" e-add-icon",content:this.parent.isAdaptive?"":this.parent.localeObj.getConstant("condition")}},{click:this.applyButtonClick.bind(this),isFlat:!1,buttonModel:{isPrimary:!0,cssClass:"e-format-apply-button"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("apply")}},{click:this.cancelButtonClick.bind(this),isFlat:!1,buttonModel:{cssClass:"e-format-cancel-button"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}];(i=this.parent.isAdaptive?new r.Dialog({animationSettings:{effect:"Zoom"},isModal:!0,width:"100%",height:"100%",showCloseIcon:!1,closeOnEscape:!1,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,position:{X:"center",Y:"center"},allowDragging:!0,buttons:a,beforeOpen:this.beforeOpen.bind(this),close:this.removeDialog.bind(this),cssClass:this.parent.cssClass,header:this.parent.localeObj.getConstant("conditionalFormatting"),target:document.body}):new r.Dialog({allowDragging:!0,position:{X:"center",Y:this.parent.element.offsetTop},buttons:a,beforeOpen:this.beforeOpen.bind(this),close:this.removeDialog.bind(this),cssClass:this.parent.cssClass,isModal:!0,closeOnEscape:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,showCloseIcon:!0,header:this.parent.localeObj.getConstant("conditionalFormatting"),target:this.parent.element})).isStringTemplate=!0,i.appendTo(e)},e.prototype.beforeOpen=function(){t.select("#"+this.parentID+"conditionalformatting",document).querySelector(".e-dlg-header").setAttribute("title",this.parent.localeObj.getConstant("conditionalFormatting"))},e.prototype.addButtonClick=function(){var e=this,t={conditions:"LessThan",value1:0,applyGrandTotals:!0,style:{backgroundColor:"white",color:"black",fontFamily:"Arial",fontSize:"12px"}},i=this;this.parent.trigger("conditionalFormatting",t,function(t){i.refreshConditionValues(),e.destroyColorPickers(),i.newFormat.push(t),i.addFormat()})},e.prototype.applyButtonClick=function(){if(this.refreshConditionValues()){this.parent.setProperties({dataSourceSettings:{conditionalFormatSettings:this.newFormat}},!0);var e={conditionalFormattingInfo:this.parent.dataSourceSettings.conditionalFormatSettings};this.parent.actionObj.actionInfo=e,this.parent.dataSourceSettings.values.length>0&&this.parent.renderPivotGrid(),t.getInstance(t.select("#"+this.parentID+"conditionalformatting",document),r.Dialog).close()}},e.prototype.cancelButtonClick=function(){t.getInstance(t.select("#"+this.parentID+"conditionalformatting",document),r.Dialog).close(),this.newFormat=[]},e.prototype.refreshConditionValues=function(){for(var e=0;e<this.newFormat.length;e++){if(""===t.select("#"+this.parentID+"conditionvalue1"+e,document).value||""===t.select("#"+this.parentID+"conditionvalue2"+e,document).value)return""===t.select("#"+this.parentID+"conditionvalue1"+e,document).value?t.select("#"+this.parentID+"conditionvalue1"+e,document).focus():t.select("#"+this.parentID+"conditionvalue2"+e,document).focus(),!1;this.newFormat[e].value1=Number(t.select("#"+this.parentID+"conditionvalue1"+e,document).value),this.newFormat[e].value2=Number(t.select("#"+this.parentID+"conditionvalue2"+e,document).value)}return!0},e.prototype.addFormat=function(){for(var e=t.createElement("div",{id:this.parentID+"formatDiv",className:"e-new-format"}),i=0;i<this.newFormat.length;i++)e.appendChild(this.createDialogElements(i));if(0===this.newFormat.length){var a=this.createDialogElements(),n=t.createElement("p",{id:this.parentID+"emptyFormat",className:"e-pivot-conditional-empty-format"});n.innerText=this.parent.localeObj.getConstant("emptyFormat"),a.appendChild(n),e.appendChild(a)}t.getInstance(t.select("#"+this.parentID+"conditionalformatting",document),r.Dialog).setProperties({content:e},!1);for(i=0;i<this.newFormat.length;i++)this.renderDropDowns(i),this.renderColorPicker(i)},e.prototype.createDialogElements=function(e){var i=t.createElement("div",{id:this.parentID+"outerDiv"+e,className:"e-format-outer-div"});if(void 0!==e){var a=this.newFormat[e],r=t.createElement("button",{id:this.parentID+"removeButton"+e,className:"e-format-delete-button",attrs:{type:"button",title:this.parent.localeObj.getConstant("delete")}});i.appendChild(r);var n=t.createElement("div",{id:this.parentID+"innerDiv"+e,className:"e-format-inner-div"}),o=t.createElement("table",{id:this.parentID+"_valueTable"+e,className:"e-format-table",attrs:{role:"table"}}),s=t.createElement("tr"),l=t.createElement("td"),d=t.createElement("span",{id:this.parentID+"valuelabel"+e,className:"e-format-value-label"});d.innerText=this.parent.localeObj.getConstant("value"),l.appendChild(d),s.appendChild(l),o.appendChild(s),s=t.createElement("tr"),l=t.createElement("td");var p=t.createElement("div",{id:this.parentID+"measure"+e}),h=t.createElement("input",{id:this.parentID+"measureinput"+e,attrs:{type:"text",tabindex:"0"}});p.appendChild(h),l.appendChild(p),s.appendChild(l),l=t.createElement("td");var u=t.createElement("div",{id:this.parentID+"condition"+e}),c=t.createElement("input",{id:this.parentID+"conditioninput"+e,attrs:{type:"text",tabindex:"0"}});u.appendChild(c),l.appendChild(u),s.appendChild(l),l=t.createElement("td",{attrs:{style:"display:table"},className:"e-format-input-value"});var g="Between"!==a.conditions&&"NotBetween"!==a.conditions?H:"",m=t.createElement("div",{attrs:{style:"display: table-row;"}}),f=t.createElement("div",{id:this.parentID+"ConditionValue1"+e,attrs:{style:"display: table-cell;"}}),v=t.createElement("input",{id:this.parentID+"conditionvalue1"+e,attrs:{type:"text",tabindex:"0",value:t.isNullOrUndefined(a.value1)?"0":a.value1.toString(),placeholder:this.parent.localeObj.getConstant("emptyInput")}});f.appendChild(v),m.appendChild(f);var S=t.createElement("span",{id:this.parentID+"valuespan"+e,className:"e-format-value-span "+g,innerHTML:"&"});m.appendChild(S);var y=t.createElement("div",{id:this.parentID+"ConditionValue2"+e,attrs:{style:"display: table-cell;"}}),b=t.createElement("input",{id:this.parentID+"conditionvalue2"+e,attrs:{type:"text",tabindex:"0",value:t.isNullOrUndefined(a.value2)?"0":a.value2.toString(),placeholder:this.parent.localeObj.getConstant("emptyInput")}});y.appendChild(b),m.appendChild(y),l.appendChild(m),s.appendChild(l),o.appendChild(s),n.appendChild(o);var C=t.createElement("table",{id:this.parentID+"_grandTotalTable"+e,className:"e-format-table e-grandtotal-checkbox-table",attrs:{role:"table"}}),x=t.createElement("tr"),w=t.createElement("td");C.appendChild(x);var T=t.createElement("input",{id:this.parentID+"grandtotalcheckbox"+e,attrs:{type:"checkbox",tabindex:"0"}});w.appendChild(T),x.appendChild(w),C.appendChild(x),n.appendChild(C);var M=t.createElement("table",{id:this.parentID+"_formatTable"+e,className:"e-format-table",attrs:{role:"table"}}),D=t.createElement("tr"),O=t.createElement("td"),P=t.createElement("span",{id:this.parentID+"formatlabel"+e,className:"e-format-label"});P.innerText=this.parent.localeObj.getConstant("formatLabel"),O.appendChild(P),D.appendChild(O),M.appendChild(D),D=t.createElement("tr"),O=t.createElement("td");var N=t.createElement("div",{id:this.parentID+"fontname"+e}),E=t.createElement("input",{id:this.parentID+"fontnameinput"+e,attrs:{type:"text",tabindex:"0"}});N.appendChild(E),O.appendChild(N),D.appendChild(O),O=t.createElement("td");var F=t.createElement("div",{id:this.parentID+"fontsize"+e}),I=t.createElement("input",{id:this.parentID+"fontsizeinput"+e,attrs:{type:"text",tabindex:"0"}});F.appendChild(I),O.appendChild(F),D.appendChild(O),this.parent.isAdaptive&&(M.appendChild(D),D=t.createElement("tr"),M.appendChild(D),D=t.createElement("tr")),O=t.createElement("td");var L=t.createElement("input",{id:this.parentID+"fontcolor"+e,attrs:{type:"color",tabindex:"0"},className:"e-format-font-color"});O.appendChild(L);var A=t.createElement("input",{id:this.parentID+"backgroundcolor"+e,attrs:{type:"color",tabindex:"0"},className:"e-format-back-color"});O.appendChild(A),D.appendChild(O),O=t.createElement("td");var R=t.createElement("input",{id:this.parentID+"valuepreview"+e,className:"e-input e-format-value-preview",attrs:{tabindex:"-1",readonly:"true",value:"123.45"}});O.appendChild(R),D.appendChild(O),M.appendChild(D),n.appendChild(M),i.appendChild(n)}return i},e.prototype.renderDropDowns=function(e){var i=t.getInstance(t.select("#"+this.parentID+"conditionalformatting",document),r.Dialog).element,a=this.newFormat[e],n=[];n.push({index:0,name:this.parent.localeObj.getConstant("AllValues"),field:this.parent.localeObj.getConstant("AllValues")});for(var o=0;o<this.parent.dataSourceSettings.values.length;o++){var d=this.parent.dataSourceSettings.values[o].caption||this.parent.dataSourceSettings.values[o].name;d=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(d):d,n.push({index:o+1,name:d,field:this.parent.dataSourceSettings.values[o].name})}var p=t.isNullOrUndefined(a.measure)?this.parent.localeObj.getConstant("AllValues"):a.measure,u=[];u[e]=new l.DropDownList({dataSource:n,fields:{text:"name",value:"field"},value:p,width:"100%",cssClass:this.parent.cssClass,popupHeight:"200px",popupWidth:"auto",locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:this.measureChange.bind(this,e)}),u[e].isStringTemplate=!0,u[e].appendTo(t.select("#"+this.parentID+"measureinput"+e,i));var c=[{value:"LessThan",name:this.parent.localeObj.getConstant("LessThan")},{value:"LessThanOrEqualTo",name:this.parent.localeObj.getConstant("LessThanOrEqualTo")},{value:"GreaterThan",name:this.parent.localeObj.getConstant("GreaterThan")},{value:"GreaterThanOrEqualTo",name:this.parent.localeObj.getConstant("GreaterThanOrEqualTo")},{value:"Equals",name:this.parent.localeObj.getConstant("Equals")},{value:"NotEquals",name:this.parent.localeObj.getConstant("NotEquals")},{value:"Between",name:this.parent.localeObj.getConstant("Between")},{value:"NotBetween",name:this.parent.localeObj.getConstant("NotBetween")}];p=t.isNullOrUndefined(a.conditions)?"LessThan":a.conditions;var g=[];g[e]=new l.DropDownList({dataSource:c,fields:{value:"value",text:"name"},value:p,width:"100%",cssClass:this.parent.cssClass,popupHeight:"200px",popupWidth:"auto",locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:this.conditionChange.bind(this,e)}),g[e].isStringTemplate=!0,g[e].appendTo(t.select("#"+this.parentID+"conditioninput"+e,i));var m="Between"!==this.newFormat[e].conditions&&"NotBetween"!==this.newFormat[e].conditions?H:"",f=new s.TextBox({enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-format-value1 "+this.parent.cssClass,width:"auto"});f.isStringTemplate=!0,f.appendTo(t.select("#"+this.parentID+"conditionvalue1"+e,i));var v=new s.TextBox({enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-format-value2 "+m+" "+this.parent.cssClass,width:"auto"});v.isStringTemplate=!0,v.appendTo(t.select("#"+this.parentID+"conditionvalue2"+e,i));var S=new h.CheckBox({label:this.parent.localeObj.getConstant("applyToGrandTotal"),checked:this.newFormat[e].applyGrandTotals,enableRtl:this.parent.enableRtl,locale:this.parent.locale,change:this.onCheckChange.bind(this,e),cssClass:this.parent.cssClass});S.isStringTemplate=!0,S.appendTo(t.select("#"+this.parentID+"grandtotalcheckbox"+e,i));var y=[{index:0,name:"Arial"},{index:1,name:"San Serif"},{index:2,name:"Impact"},{index:3,name:"Trebuchet MS"},{index:4,name:"Serif"},{index:5,name:"Verdana"},{index:6,name:"Courier New"},{index:7,name:"Times New Roman"},{index:8,name:"Tahoma"},{index:9,name:"Gerogia"}];p=t.isNullOrUndefined(a.style.fontFamily)?"Arial":a.style.fontFamily;var b=[];b[e]=new l.DropDownList({dataSource:y,fields:{text:"name"},value:p,width:"100%",cssClass:this.parent.cssClass,popupHeight:"200px",popupWidth:"auto",locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:this.fontNameChange.bind(this,e)}),b[e].isStringTemplate=!0,b[e].appendTo(t.select("#"+this.parentID+"fontnameinput"+e,i));var C=[{index:0,name:"9px"},{index:1,name:"10px"},{index:2,name:"11px"},{index:3,name:"12px"},{index:4,name:"13px"},{index:5,name:"14px"},{index:6,name:"15px"},{index:6,name:"16px"}];p=t.isNullOrUndefined(a.style.fontSize)?"12px":a.style.fontSize;var x=[];x[e]=new l.DropDownList({dataSource:C,fields:{text:"name"},popupHeight:"200px",popupWidth:"auto",value:p,width:"100%",change:this.fontSizeChange.bind(this,e),locale:this.parent.locale,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass}),x[e].isStringTemplate=!0,x[e].appendTo(t.select("#"+this.parentID+"fontsizeinput"+e,i))},e.prototype.conditionChange=function(e,i){this.newFormat[e].conditions=i.value;var a=t.select("#"+this.parentID+"valuespan"+e,document),r=t.select("#"+this.parentID+"conditionvalue2"+e,document);"Between"===i.value||"NotBetween"===i.value?(a.classList.remove(H),r.parentElement.classList.remove(H)):(a.classList.add(H),r.parentElement.classList.add(H))},e.prototype.onCheckChange=function(e,t){this.newFormat[e].applyGrandTotals=t.checked},e.prototype.fontNameChange=function(e,i){this.newFormat[e].style.fontFamily=i.value.toString(),t.select("#"+this.parentID+"valuepreview"+e,document).style.fontFamily=i.value},e.prototype.fontSizeChange=function(e,i){this.newFormat[e].style.fontSize=i.value.toString(),t.select("#"+this.parentID+"valuepreview"+e,document).style.fontSize=i.value},e.prototype.measureChange=function(e,t){this.newFormat[e].measure=t.value.toString()===this.parent.localeObj.getConstant("AllValues")?void 0:t.value.toString()},e.prototype.renderColorPicker=function(e){var i=t.getInstance(t.select("#"+this.parentID+"conditionalformatting",document),r.Dialog).element,a=this.newFormat[e],n=t.isNullOrUndefined(a.style.color)?"black":a.style.color,o="#"===n.charAt(0)&&this.isHex(n.substr(1))?n:this.colourNameToHex(n);t.select("#"+this.parentID+"valuepreview"+e,document).style.color=o,this.fontColor[e]=new s.ColorPicker({cssClass:"e-format-color-picker e-format-font-color-picker"+(this.parent.cssClass?" "+this.parent.cssClass:""),value:o,mode:"Palette",change:this.fontColorChange.bind(this,e),locale:this.parent.locale,enableRtl:this.parent.enableRtl}),this.fontColor[e].isStringTemplate=!0,this.fontColor[e].appendTo(t.select("#"+this.parentID+"fontcolor"+e,i)),t.addClass([this.fontColor[e].element.nextElementSibling.querySelector(".e-selected-color")],P),o="#"===(n=t.isNullOrUndefined(a.style.backgroundColor)?"white":a.style.backgroundColor).charAt(0)&&this.isHex(n.substr(1))?n:this.colourNameToHex(n),t.select("#"+this.parentID+"valuepreview"+e,document).style.backgroundColor=o,t.select("#"+this.parentID+"valuepreview"+e,document).style.fontFamily=a.style.fontFamily,t.select("#"+this.parentID+"valuepreview"+e,document).style.fontSize=a.style.fontSize,this.backgroundColor[e]=new s.ColorPicker({cssClass:"e-format-color-picker"+(this.parent.cssClass?" "+this.parent.cssClass:""),value:o,mode:"Palette",change:this.backColorChange.bind(this,e),locale:this.parent.locale,enableRtl:this.parent.enableRtl}),this.backgroundColor[e].isStringTemplate=!0,this.backgroundColor[e].appendTo(t.select("#"+this.parentID+"backgroundcolor"+e,i)),t.addClass([this.backgroundColor[e].element.nextElementSibling.querySelector(".e-selected-color")],P);var l=new h.Button({iconCss:P+" e-format-delete-icon",cssClass:"e-flat"+(this.parent.cssClass?" "+this.parent.cssClass:""),locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});l.isStringTemplate=!0,l.appendTo(t.select("#"+this.parentID+"removeButton"+e,i)),l.element.onclick=this.toggleButtonClick.bind(this,e)},e.prototype.backColorChange=function(e,i){this.newFormat[e].style.backgroundColor=i.currentValue.hex,t.select("#"+this.parentID+"valuepreview"+e,document).style.backgroundColor=i.currentValue.hex},e.prototype.fontColorChange=function(e,i){this.newFormat[e].style.color=i.currentValue.hex,t.select("#"+this.parentID+"valuepreview"+e,document).style.color=i.currentValue.hex},e.prototype.toggleButtonClick=function(e){this.destroyColorPickers(),this.newFormat.splice(e,1),this.addFormat()},e.prototype.isHex=function(e){for(var t=parseInt(e,16);"0"===e.charAt(0);)e=e.substr(1);return t.toString(16)===e.toLowerCase()||0===t&&""===e},e.prototype.hexToRgb=function(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},e.prototype.colourNameToHex=function(e){var t={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};if(void 0!==t[e.toLowerCase()])return t[e.toLowerCase()];if(0===e.search("rgba")){for(var i=e.substr(5).split(")")[0].split(","),a="",r="",n=0;n<i.length-1;n++)i[n]=(+i[n]).toString(16),1===i[n].length&&(i[n]="0"+i[n]),a+=i[n];return r=Math.round(255*+i[3]).toString(16),"#"+a+r}if(0===e.search("rgb")){for(var i=e.substr(4).split(")")[0].split(","),a="",n=0;n<i.length;n++)i[n]=(+i[n]).toString(16),1===i[n].length&&(i[n]="0"+i[n]),a+=i[n];return"#"+a}return"#d5d5d5"},e.prototype.removeDialog=function(){var e=t.select("#"+this.parentID+"conditionalformatting",document),i=e?t.getInstance(e,r.Dialog):null;i&&!i.isDestroyed&&(this.destroyColorPickers(),i.destroy()),e&&t.remove(e),this.fontColor=[],this.backgroundColor=[],this.newFormat=[]},e.prototype.destroyColorPickers=function(){for(var e=0;e<(this.newFormat?this.newFormat.length:0);e++)this.fontColor&&this.fontColor[e]&&!this.fontColor[e].isDestroyed&&this.fontColor[e].destroy(),this.backgroundColor&&this.backgroundColor[e]&&!this.backgroundColor[e].isDestroyed&&this.backgroundColor[e].destroy()},e.prototype.showConditionalFormattingDialog=function(){this.newFormat=[];for(var e=0;e<this.parent.dataSourceSettings.conditionalFormatSettings.length;e++)this.newFormat.push(t.extend({},this.parent.dataSourceSettings.conditionalFormatSettings[e].properties,null,!0));this.createDialog(),t.getInstance(t.select("#"+this.parentID+"conditionalformatting",document),r.Dialog).refresh(),this.addFormat()},e.prototype.destroy=function(){var e=t.select("#"+this.parentID+"conditionalformatting",document),i=e?t.getInstance(e,r.Dialog):null;i&&!i.isDestroyed&&i.close()},e}(),ai=function(){function e(e){this.isMultiAxisChange=!1,this.isReportChange=!1,this.currentReport="",this.parent=e,this.parent.toolbarModule=this,this.addEventListener()}return e.prototype.getModuleName=function(){return"toolbar"},e.prototype.createToolbar=function(){this.parent.isModified=!1,this.renderDialog(),null!==t.select("#"+this.parent.element.id+"pivot-toolbar",this.parent.element)&&t.remove(t.select("#"+this.parent.element.id+"pivot-toolbar",this.parent.element));var e=t.createElement("div",{id:this.parent.element.id+"pivot-toolbar",className:z});this.parent.showFieldList&&t.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)?this.parent.element.insertBefore(e,t.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)):this.parent.showGroupingBar&&t.select("#"+this.parent.element.id+" .e-pivot-grouping-bar",this.parent.element)?this.parent.element.insertBefore(e,t.select("#"+this.parent.element.id+" .e-pivot-grouping-bar",this.parent.element)):this.parent.element.insertBefore(e,t.select("#"+this.parent.element.id+"_grid",this.parent.element)),this.toolbar=new o.Toolbar({created:this.create.bind(this),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,items:this.getItems(),allowKeyboard:!1,cssClass:this.parent.cssClass,width:this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber()}),this.toolbar.isStringTemplate=!0;var i="viewContainerRef",a={};this.parent[i]&&(t.setValue("registeredTemplate",a,this.toolbar),this.toolbar[i]=this.parent[i]),this.parent.toolbarTemplate&&"string"==typeof this.parent.toolbarTemplate?(this.toolbar.appendTo(this.parent.toolbarTemplate),this.parent.element.replaceChild(this.toolbar.element,this.parent.element.querySelector("."+z)),this.toolbar.element.classList.add(z)):this.toolbar.appendTo(e),this.toolbar.width=this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber(),this.parent.chart&&this.parent.chart.setProperties({width:this.parent.grid?this.parent.getGridWidthAsNumber().toString():this.parent.getWidthAsNumber().toString()},!0),this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector(".e-grouping-bar")&&this.parent.groupingBarModule.refreshUI()},e.prototype.fetchReports=function(){var e={reportName:[]};return this.parent.trigger("fetchReport",e),e},e.prototype.fetchReportsArgs=function(){var e=new i.Deferred,t={reportName:[]};return this.parent.trigger("fetchReport",t,function(t){e.resolve(t)}),e},e.prototype.getItems=function(){for(var e=this.parent.toolbar.filter(function(e,t,i){return i.indexOf(e)===t}),i=[],a=0,r=e;a<r.length;a++){var n=r[a];switch(n){case"New":i.push({prefixIcon:"e-new-report "+P,tooltipText:this.parent.localeObj.getConstant("new"),click:this.actionClick.bind(this),id:this.parent.element.id+"new"});break;case"Save":i.push({prefixIcon:"e-save-report "+P,tooltipText:this.parent.localeObj.getConstant("save"),click:this.actionClick.bind(this),id:this.parent.element.id+"save"});break;case"SaveAs":i.push({prefixIcon:"e-saveas-report "+P,tooltipText:this.parent.localeObj.getConstant("saveAs"),click:this.actionClick.bind(this),id:this.parent.element.id+"saveas"});break;case"Rename":i.push({prefixIcon:"e-rename-report "+P,tooltipText:this.parent.localeObj.getConstant("rename"),click:this.actionClick.bind(this),id:this.parent.element.id+"rename"});break;case"Remove":i.push({prefixIcon:G+" "+P,tooltipText:this.parent.localeObj.getConstant("deleteReport"),click:this.actionClick.bind(this),id:this.parent.element.id+"remove"});break;case"Load":i.push({template:"<div><input class=e-load-report id="+this.parent.element.id+"_reportlist></input></div>",click:this.actionClick.bind(this),id:this.parent.element.id+"load"});break;case"Grid":var o="Chart"===this.parent.displayOption.view;i.push({prefixIcon:"e-toolbar-grid "+P,tooltipText:this.parent.localeObj.getConstant("grid"),id:this.parent.element.id+"grid",cssClass:(o?"e-disabled":"")+(this.parent.cssClass?" "+this.parent.cssClass:""),click:this.menuItemClick.bind(this)});break;case"Chart":var s="Table"===this.parent.displayOption.view;i.push({template:'<ul id="'+this.parent.element.id+'chart_menu"></ul>',id:this.parent.element.id+"chartmenu",cssClass:(s?"e-disabled":"")+(this.parent.cssClass?" "+this.parent.cssClass:"")});break;case"MDX":"olap"===this.parent.dataType&&i.push({prefixIcon:"e-mdx "+P,id:this.parent.element.id+"mdxQuery",click:this.actionClick.bind(this),tooltipText:this.parent.localeObj.getConstant("mdxQuery")});break;case"Export":i.push({template:'<ul id="'+this.parent.element.id+'export_menu"></ul>',id:this.parent.element.id+"exportmenu"});break;case"SubTotal":i.push({template:'<ul id="'+this.parent.element.id+'subtotal_menu"></ul>',id:this.parent.element.id+"subtotalmenu"});break;case"GrandTotal":i.push({template:'<ul id="'+this.parent.element.id+'grandtotal_menu"></ul>',id:this.parent.element.id+"grandtotalmenu"});break;case"ConditionalFormatting":i.push({prefixIcon:"e-toolbar-formatting "+P,id:this.parent.element.id+"formatting",click:this.actionClick.bind(this),tooltipText:this.parent.localeObj.getConstant("toolbarFormatting")});break;case"NumberFormatting":i.push({prefixIcon:"e-pivot-format-toolbar "+P,id:this.parent.element.id+"numberFormatting",click:this.actionClick.bind(this),tooltipText:this.parent.localeObj.getConstant("numberFormat")});break;case"Formatting":i.push({template:'<ul id="'+this.parent.element.id+'formatting_menu"></ul>',id:this.parent.element.id+"formattingmenu"});break;case"FieldList":i.push({prefixIcon:"e-toolbar-fieldlist "+P,tooltipText:this.parent.localeObj.getConstant("fieldList"),click:this.actionClick.bind(this),align:"Right",id:this.parent.element.id+"fieldlist"}),this.parent.element.querySelector(".e-toggle-field-list")&&(this.parent.element.querySelector(".e-toggle-field-list").style.display="none");break;default:"object"==typeof n&&i.push(n)}}this.parent.showFieldList&&-1===e.indexOf("FieldList")&&t.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)&&"none"===t.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element).style.display&&(t.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element).style.display="block");var l={customToolbar:i};return this.parent.trigger("toolbarRender",l),i},e.prototype.reportChange=function(e){if(this.parent.actionObj.actionName="Report change",this.isReportChange=!0,this.parent.actionBeginMethod())return void(e.cancel=!0);try{this.dropArgs=e,this.parent.isModified&&""!==this.currentReport?this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("newReportConfirm")):this.reportLoad(e)}catch(e){this.parent.actionFailureMethod(e)}},e.prototype.reportLoad=function(e){var t=this;if("Save"!==this.action&&"Rename"!==this.action&&"New"!==this.action){var i={reportName:e.itemData.value},a={reportName:e.itemData.value};this.parent.actionObj.actionInfo=a,this.parent.trigger("loadReport",i,function(e){t.currentReport=e.reportName,t.parent.isModified=!1})}},e.prototype.saveReport=function(e){if(this.currentReport&&""!==this.currentReport&&e.item.id===this.parent.element.id+"save"){var t={report:this.getCurrentReport(),reportName:this.currentReport};this.parent.actionObj.actionName=this.parent.getActionCompleteName();var i={reportName:this.currentReport};this.parent.actionObj.actionInfo=i,this.parent.trigger("saveReport",t),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod(),this.parent.isModified=!1}else{if(""===this.currentReport&&(e.item.id===this.parent.element.id+"save"||e.item.id===this.parent.element.id+"saveas"))return void this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("emptyReport"));this.dialogShow(e,"saveAs")}},e.prototype.mdxQueryDialog=function(){t.select("#"+this.parent.element.id+"mdx-dialog",document)||this.renderMDXDialog();var e=t.getInstance(t.select("#"+this.parent.element.id+"mdx-dialog",document),r.Dialog),i=t.createElement("div",{className:"e-mdx-query"}),a=t.createElement("textarea",{className:"e-mdx-query-content",attrs:{readonly:"readonly","aria-label":this.parent.localeObj.getConstant("mdxQuery")}});a.innerText=this.parent.olapEngineModule.getMDXQuery(this.parent.dataSourceSettings).trim(),i.appendChild(a),e.content=i,e.show()},e.prototype.dialogShow=function(e,i){if(e){var a=t.getInstance(t.select("#"+this.parent.element.id+"report-dialog",document),r.Dialog);a.header=e.item.tooltipText;var n=t.createElement("div",{className:"e-report-outer"}),o=t.createElement("div",{className:"e-pivotview-report-label"});o.innerText=this.parent.localeObj.getConstant("reportName");var s=t.createElement("input",{className:"e-pivotview-report-input e-input",attrs:{placeholder:this.parent.localeObj.getConstant("emptyReportName"),value:i&&"rename"===i?this.currentReport:""}});s.innerText=i&&"rename"===i?this.currentReport:"",s.setSelectionRange(s.textContent.length,s.textContent.length),n.appendChild(o),n.appendChild(s),a.content=n,a.refresh(),a.show()}},e.prototype.renameReport=function(e){if(this.parent.trigger("toolbarClick",e),!this.currentReport||""===this.currentReport)return void this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("emptyReport"));this.dialogShow(e,"rename")},e.prototype.actionClick=function(e){var t=e.item.id===this.parent.element.id+"new"?"Add new report":e.item.id===this.parent.element.id+"save"?"Save current report":e.item.id===this.parent.element.id+"saveas"?"Save as current report":e.item.id===this.parent.element.id+"rename"?"Rename current report":e.item.id===this.parent.element.id+"remove"?"Remove current report":e.item.id===this.parent.element.id+"load"?"Load report":e.item.id===this.parent.element.id+"formatting"?"Open conditional formatting dialog":e.item.id===this.parent.element.id+"numberFormatting"?"Open number formatting dialog":e.item.id===this.parent.element.id+"mdxQuery"?"MdxQuery":e.item.id===this.parent.element.id+"fieldlist"?"Open field list":"";if(this.parent.actionObj.actionName=t,!this.parent.actionBeginMethod())try{switch(e.item.id){case this.parent.element.id+"save":case this.parent.element.id+"saveas":this.saveReport(e);break;case this.parent.element.id+"remove":return this.action="Remove",void(this.currentReport&&""!==this.currentReport?this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeConfirm")):this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("emptyReport")));case this.parent.element.id+"rename":this.renameReport(e);break;case this.parent.element.id+"new":this.action="New",this.newArgs=e,this.parent.isModified&&this.currentReport&&""!==this.currentReport?this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("newReportConfirm")):this.createNewReport(e);break;case this.parent.element.id+"load":this.action="Load";break;case this.parent.element.id+"fieldlist":this.parent.pivotFieldListModule&&this.parent.pivotFieldListModule.dialogRenderer&&this.parent.pivotFieldListModule.dialogRenderer.onShowFieldList();break;case this.parent.element.id+"formatting":this.parent.conditionalFormattingModule&&this.parent.conditionalFormattingModule.showConditionalFormattingDialog();break;case this.parent.element.id+"mdxQuery":this.mdxQueryDialog();break;case this.parent.element.id+"numberFormatting":this.parent.numberFormattingModule&&this.parent.numberFormattingModule.showNumberFormattingDialog()}}catch(e){this.parent.actionFailureMethod(e)}},e.prototype.renderDialog=function(){null!==t.select("#"+this.parent.element.id+"report-dialog",this.parent.element)&&t.remove(t.select("#"+this.parent.element.id+"report-dialog",this.parent.element));var e=t.createElement("div",{id:this.parent.element.id+"report-dialog",className:"e-pivotview-report-dialog"});this.parent.element.appendChild(e);var i=new r.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,position:{X:"center",Y:"center"},buttons:[{click:this.okBtnClick.bind(this),isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:this.cancelBtnClick.bind(this),isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],isModal:!0,visible:!1,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"auto",height:"auto",zIndex:1000001,closeOnEscape:!0,target:document.body,cssClass:this.parent.cssClass});i.isStringTemplate=!0,i.appendTo(e)},e.prototype.renderMDXDialog=function(){null!==t.select("#"+this.parent.element.id+"mdx-dialog",this.parent.element)&&t.remove(t.select("#"+this.parent.element.id+"mdx-dialog",this.parent.element));var e=t.createElement("div",{id:this.parent.element.id+"mdx-dialog",className:"e-pivotview-mdx-dialog"});this.parent.element.appendChild(e);var i=new r.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,position:{X:"center",Y:"center"},buttons:[{click:this.copyMDXQuery.bind(this),isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("copy"),isPrimary:!0}}],header:this.parent.localeObj.getConstant("mdxQuery"),isModal:!0,visible:!1,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"auto",height:"auto",zIndex:1000001,closeOnEscape:!0,target:document.body,cssClass:this.parent.cssClass});i.isStringTemplate=!0,i.appendTo(e)},e.prototype.copyMDXQuery=function(){var e=t.getInstance(t.select("#"+this.parent.element.id+"mdx-dialog",document),r.Dialog).element.querySelector(".e-mdx-query-content");try{e.select(),document.execCommand("copy")}catch(e){window.alert("Oops, unable to copy")}},e.prototype.okBtnClick=function(){var e=this,i=t.getInstance(t.select("#"+this.parent.element.id+"report-dialog",document),r.Dialog),a=i.element.querySelector(".e-pivotview-report-input");if(a&&""===a.value)return void a.focus();if(this.parent.localeObj||(this.parent=t.getInstance(t.select("#"+this.parent.element.id,document),kt)),i.header!==this.parent.localeObj.getConstant("save")&&i.header!==this.parent.localeObj.getConstant("saveAs")||!a.value||""===a.value){if(i.header===this.parent.localeObj.getConstant("new")&&a.value&&""!==a.value){this.action="New",this.currentReport=a.value;var n=!1,o=this,s={reportName:[]};this.parent.trigger("fetchReport",s,function(i){for(var l=0;l<i.reportName.length;l++)if(a.value===s.reportName[l]){n=!0;break}if(n)return void o.createConfirmDialog(o.parent.localeObj.getConstant("alert"),o.parent.localeObj.getConstant("replaceConfirmBefore")+'"'+a.value+'"'+o.parent.localeObj.getConstant("replaceConfirmAfter"));o.parent.trigger("newReport");var d={report:o.getCurrentReport(),reportName:a.value},p={reportName:a.value};e.parent.actionObj.actionInfo=p,o.parent.trigger("saveReport",d),o.parent.isModified=!1,o.updateReportList(),t.getInstance(t.select("#"+e.parent.element.id+"report-dialog",document),r.Dialog).hide()})}else if(i.header===this.parent.localeObj.getConstant("rename")&&a.value&&""!==a.value){if(this.currentReport===a.value)return void i.hide();this.action="Rename";var l=!1;this.renameText=a.value;for(var d=this.fetchReports(),p=0;p<d.reportName.length;p++)if(a.value===d.reportName[p]){l=!0;break}if(l)return void this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("replaceConfirmBefore")+'"'+a.value+'"'+this.parent.localeObj.getConstant("replaceConfirmAfter"));var h={reportName:this.currentReport,rename:a.value},u={reportName:{oldName:this.currentReport,newName:a.value}};this.parent.actionObj.actionInfo=u,this.parent.trigger("renameReport",h),this.currentReport=a.value,this.updateReportList(),i.hide()}}else{this.action="Save",this.currentReport=a.value;var c=!1,g=this,d={reportName:[]};this.parent.trigger("fetchReport",d,function(i){for(var n=0;n<i.reportName.length;n++)if(a.value===i.reportName[n]){c=!0;break}if(c)return void g.createConfirmDialog(g.parent.localeObj.getConstant("alert"),g.parent.localeObj.getConstant("replaceConfirmBefore")+'"'+a.value+'"'+g.parent.localeObj.getConstant("replaceConfirmAfter"));var o={report:g.getCurrentReport(),reportName:a.value},s={reportName:a.value};e.parent.actionObj.actionInfo=s,g.parent.trigger("saveReport",o),g.parent.isModified=!1,g.updateReportList(),t.getInstance(t.select("#"+e.parent.element.id+"report-dialog",document),r.Dialog).hide()})}this.parent.actionObj.actionName=this.parent.getActionCompleteName(),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()},e.prototype.createNewReport=function(e){this.dialogShow(e)},e.prototype.cancelBtnClick=function(){t.getInstance(t.select("#"+this.parent.element.id+"report-dialog",document),r.Dialog).hide()},e.prototype.createConfirmDialog=function(e,i){document.getElementById(this.parent.element.id+"_ConfirmDialog")&&t.remove(document.getElementById(this.parent.element.id+"_ConfirmDialog").parentElement);var a=t.createElement("div",{id:this.parent.element.id+"_ConfirmDialog",className:"e-pivot-error-dialog"});this.parent.element.appendChild(a);var n=new r.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,header:e,content:i,isModal:!0,visible:!0,closeOnEscape:!0,target:document.body,cssClass:this.parent.cssClass,width:"auto",height:"auto",position:{X:"center",Y:"center"},buttons:[{isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("yes"),isPrimary:!0,cssClass:"e-ok-btn"+(this.parent.cssClass?" "+this.parent.cssClass:"")},click:this.okButtonClick.bind(this)},{isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("no"),cssClass:"e-cancel-btn"+(this.parent.cssClass?" "+this.parent.cssClass:"")},click:this.cancelButtonClick.bind(this)}]});n.isStringTemplate=!0,n.appendTo(a),n.element.querySelector(".e-dlg-header").innerText=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e):e},e.prototype.okButtonClick=function(){var e=this,i=t.getInstance(t.select("#"+this.parent.element.id+"report-dialog",document),r.Dialog);if("Remove"===this.action){var a={reportName:this.currentReport},n={reportName:this.currentReport};this.parent.actionObj.actionInfo=n,this.parent.trigger("removeReport",a);var o=this.fetchReports();if(o.reportName&&o.reportName.length>0){var s={reportName:o.reportName[o.reportName.length-1]};this.parent.trigger("loadReport",s,function(t){e.currentReport=t.reportName,e.parent.isModified=!1}),this.currentReport=o.reportName[o.reportName.length-1]}else this.currentReport="",this.parent.isModified=!1,this.action="";this.updateReportList(),this.parent.actionObj.actionName="Report removed",this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()}else if("New"===this.action||"Save"!==this.action&&"Rename"!==this.action&&"New"!==this.action){if(this.currentReport&&""!==this.currentReport&&this.parent.isModified){var l={report:this.getCurrentReport(),reportName:this.currentReport},n={reportName:this.currentReport};this.parent.actionObj.actionInfo=n,this.parent.actionObj.actionName="Report saved",this.parent.actionObj.actionName&&this.parent.actionCompleteMethod(),this.parent.trigger("saveReport",l),this.parent.isModified=!1,"New"===this.action?(this.parent.actionObj.actionName="Add new report",this.createNewReport(this.newArgs)):(this.parent.actionObj.actionName="Report change",this.reportLoad(this.dropArgs))}else if("New"===this.action){this.parent.trigger("newReport");l={report:this.getCurrentReport(),reportName:this.currentReport};this.parent.trigger("saveReport",l),this.parent.isModified=!1,this.updateReportList(),i.hide()}}else if("Save"===this.action){l={report:this.getCurrentReport(),reportName:this.currentReport};this.parent.trigger("saveReport",l),this.parent.isModified=!1,this.updateReportList(),i.hide()}else if("Rename"===this.action){var d={reportName:this.currentReport,rename:this.renameText,isReportExists:!0};this.parent.trigger("renameReport",d),this.currentReport=this.renameText,this.parent.isModified=!1,this.updateReportList(),i.hide()}t.getInstance(t.select("#"+this.parent.element.id+"_ConfirmDialog",document),r.Dialog).hide()},e.prototype.cancelButtonClick=function(){var e=t.getInstance(t.select("#"+this.parent.element.id+"report-dialog",document),r.Dialog);if("New"===this.action)this.parent.isModified?this.createNewReport(this.newArgs):e.hide();else if("Save"===this.action){if(t.select("#"+this.parent.element.id+"_reportlist",this.parent.element)){var i=t.getInstance(t.select("#"+this.parent.element.id+"_reportlist",this.parent.element),l.DropDownList);this.currentReport=i.value}e.hide()}else"Rename"===this.action?e.hide():this.dropArgs&&"Remove"!==this.action&&this.reportLoad(this.dropArgs);t.getInstance(t.select("#"+this.parent.element.id+"_ConfirmDialog",document),r.Dialog).hide()},e.prototype.createChartMenu=function(){var e=this;if(t.select("#"+this.parent.element.id+"chart_menu",this.parent.element)){for(var i=t.select("#"+this.parent.element.id+"chart_menu",this.parent.element),a=[],r=this.getValidChartType(),n=0;n<r.length&&n<7;n++){var s=r[n];a.push({text:this.parent.localeObj.getConstant(s.toLowerCase()),id:this.parent.element.id+"_"+s})}7===a.length&&(a.splice(6),a.push({text:this.parent.localeObj.getConstant("MoreOption"),id:this.parent.element.id+"_ChartMoreOption"}));var l=a.length<=0||"Table"===this.parent.displayOption.view;a.push({separator:!0}),a.push({text:this.parent.localeObj.getConstant("multipleAxes"),id:this.parent.element.id+"_multipleAxes"}),a.push({text:this.parent.localeObj.getConstant("showLegend"),id:this.parent.element.id+"_showLegend"});var d=[{iconCss:"e-toolbar-chart "+P,items:l?[]:a}],p=i?t.getInstance(i,o.Menu):null;p&&!p.isDestroyed&&(p.destroy(),p=null),(p=new o.Menu({items:d,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:K+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this),beforeOpen:this.whitespaceRemove.bind(this),onClose:function(){e.focusToolBar()},beforeItemRender:this.multipleAxesCheckbox.bind(this)})).isStringTemplate=!0,p.appendTo(i)}},e.prototype.create=function(){var e=this;if(t.select("#"+this.parent.element.id+"chart_menu",this.parent.element)&&this.createChartMenu(),t.select("#"+this.parent.element.id+"export_menu",this.parent.element)){var i=t.select("#"+this.parent.element.id+"export_menu",this.parent.element),a=[{iconCss:"e-export "+P,items:[{text:this.parent.localeObj.getConstant("pdf"),iconCss:"e-pivotview-pdf-export "+P,id:this.parent.element.id+"pdf"},{text:this.parent.localeObj.getConstant("excel"),iconCss:"e-pivotview-excel-export "+P,id:this.parent.element.id+"excel"},{text:this.parent.localeObj.getConstant("csv"),iconCss:"e-pivotview-csv-export "+P,id:this.parent.element.id+"csv"},{text:this.parent.localeObj.getConstant("png"),iconCss:"e-pivotview-png-export "+P,id:this.parent.element.id+"png"},{text:this.parent.localeObj.getConstant("jpeg"),iconCss:"e-pivotview-jpeg-export "+P,id:this.parent.element.id+"jpeg"},{text:this.parent.localeObj.getConstant("svg"),iconCss:"e-pivotview-svg-export "+P,id:this.parent.element.id+"svg"}]}],r=new o.Menu({items:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:K+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this),beforeOpen:this.updateExportMenu.bind(this),onClose:function(){e.focusToolBar()}});r.isStringTemplate=!0,r.appendTo(i)}if(t.select("#"+this.parent.element.id+"subtotal_menu",this.parent.element)){var n=t.select("#"+this.parent.element.id+"subtotal_menu",this.parent.element),a=[{iconCss:"e-sub-total "+P,items:[{text:this.parent.localeObj.getConstant("showSubTotals"),id:this.parent.element.id+"subtotal",iconCss:Y+" "+P},{text:this.parent.localeObj.getConstant("doNotShowSubTotals"),id:this.parent.element.id+"notsubtotal",iconCss:Y+" "+P},{text:this.parent.localeObj.getConstant("showSubTotalsRowsOnly"),id:this.parent.element.id+"subtotalrow",iconCss:Y+" "+P},{text:this.parent.localeObj.getConstant("showSubTotalsColumnsOnly"),id:this.parent.element.id+"subtotalcolumn",iconCss:Y+" "+P},{separator:!0},{text:this.parent.localeObj.getConstant("subTotalPosition"),id:this.parent.element.id+"subtotalpositions",iconCss:Q+" "+P,items:[{text:this.parent.localeObj.getConstant("auto"),id:this.parent.element.id+"sub-none-position",iconCss:Y+" "+P},{text:this.parent.localeObj.getConstant("top"),id:this.parent.element.id+"sub-top-position",iconCss:Y+" "+P},{text:this.parent.localeObj.getConstant("bottom"),id:this.parent.element.id+"sub-bottom-position",iconCss:Y+" "+P}]}]}],s=new o.Menu({items:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:K+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this),beforeOpen:this.updateSubtotalSelection.bind(this),onClose:function(){e.focusToolBar()}});s.isStringTemplate=!0,s.appendTo(n)}if(t.select("#"+this.parent.element.id+"grandtotal_menu",this.parent.element)){var d=t.select("#"+this.parent.element.id+"grandtotal_menu",this.parent.element),a=[{iconCss:"e-grand-total "+P,items:[{text:this.parent.localeObj.getConstant("showGrandTotals"),id:this.parent.element.id+"grandtotal",iconCss:Y+" "+P},{text:this.parent.localeObj.getConstant("doNotShowGrandTotals"),id:this.parent.element.id+"notgrandtotal",iconCss:Y+" "+P},{text:this.parent.localeObj.getConstant("showGrandTotalsRowsOnly"),id:this.parent.element.id+"grandtotalrow",iconCss:Y+" "+P},{text:this.parent.localeObj.getConstant("showGrandTotalsColumnsOnly"),id:this.parent.element.id+"grandtotalcolumn",iconCss:Y+" "+P},{separator:!0},{text:this.parent.localeObj.getConstant("grandTotalPosition"),id:this.parent.element.id+"grandtotalpositions",iconCss:Q+" "+P,items:[{text:this.parent.localeObj.getConstant("top"),id:this.parent.element.id+"top-position",iconCss:Y+" "+P},{text:this.parent.localeObj.getConstant("bottom"),id:this.parent.element.id+"bottom-position",iconCss:Y+" "+P}]}]}],p=new o.Menu({items:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:K+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this),beforeOpen:this.updateGrandtotalSelection.bind(this),onClose:function(){e.focusToolBar()}});p.isStringTemplate=!0,p.appendTo(d)}if(t.select("#"+this.parent.element.id+"formatting_menu",this.parent.element)){var h=t.select("#"+this.parent.element.id+"formatting_menu",this.parent.element),a=[{iconCss:"e-pivot-format-menu "+P,items:[{text:this.parent.localeObj.getConstant("numberFormatMenu"),iconCss:"e-pivot-number-format-menu "+P,id:this.parent.element.id+"numberFormattingMenu"},{text:this.parent.localeObj.getConstant("conditionalFormattingMenu"),iconCss:"e-pivot-conditional-format-menu "+P,id:this.parent.element.id+"conditionalFormattingMenu"}]}],u=new o.Menu({items:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:K+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this)});u.isStringTemplate=!0,u.appendTo(h)}var c={report:this.parent.getPersistData(),reportName:this.parent.localeObj.getConstant("defaultReport")};if(this.currentReport=this.parent.localeObj.getConstant("defaultReport"),this.parent.trigger("saveReport",c),t.select("#"+this.parent.element.id+"_reportlist",this.parent.element)){var g=t.select("#"+this.parent.element.id+"_reportlist",this.parent.element),m=this.fetchReports(),f=new l.DropDownList({dataSource:m.reportName,width:"150px",popupHeight:"200px",placeholder:""===this.currentReport?this.parent.localeObj.getConstant("reportList"):"",enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-reportlist-drop"+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.reportChange.bind(this),value:this.currentReport});f.isStringTemplate=!0,f.appendTo(g)}this.updateItemElements()},e.prototype.getCurrentReport=function(){var e=this.parent.getPersistData();if("CSV"===this.parent.dataSourceSettings.type&&"Server"!==this.parent.dataSourceSettings.mode){var t=JSON.parse(e);t.dataSourceSettings.dataSource.splice(0,0,this.parent.engineModule.fields),e=JSON.stringify(t)}return e},e.prototype.updateItemElements=function(){for(var e=0,t=[].slice.call(this.toolbar.element.querySelectorAll(".e-toolbar-item"));e<t.length;e++){var i=t[e];i.querySelector("button")?i.querySelector("button").setAttribute("tabindex","0"):i.querySelector(".e-menu.e-menu-parent")&&(i.querySelector(".e-menu.e-menu-parent").setAttribute("tabindex","-1"),i.querySelector(".e-menu-item.e-menu-caret-icon")&&i.querySelector(".e-menu-item.e-menu-caret-icon").setAttribute("tabindex","0"))}},e.prototype.whitespaceRemove=function(e){var t=e.element.querySelector(".e-separator");t&&(t.style.margin="0px")},e.prototype.multipleAxesCheckbox=function(e){var i=this;if(this.parent.element.id+"_multipleAxes"===e.element.id){(a=t.createElement("input",{id:this.parent.element.id+"_checkBox"})).style.display="none",this.parent.element.appendChild(a);r=new h.CheckBox({label:this.parent.localeObj.getConstant("multipleAxes"),cssClass:"e-multipleAxes"+(this.parent.cssClass?" "+this.parent.cssClass:""),checked:this.parent.chartSettings.enableMultipleAxis,change:function(){document.getElementById(i.parent.element.id+"_multipleAxes").click()},enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});e.element.innerText="",r.appendTo(a),["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)>-1&&!e.element.classList.contains("e-disabled")?(e.element.classList.add("e-disabled"),r.disabled=!0):["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)<0&&e.element.classList.contains("e-disabled")&&(e.element.classList.remove("e-disabled"),r.disabled=!1);n=this.parent.element.querySelector(".e-checkbox-wrapper.e-multipleAxes");e.element.appendChild(n)}else if(this.parent.element.id+"_showLegend"===e.element.id){var a=t.createElement("input",{id:this.parent.element.id+"_showLegendCheckBox"});a.style.display="none",this.parent.element.appendChild(a);var r=new h.CheckBox({label:this.parent.localeObj.getConstant("showLegend"),checked:this.getLableState(),cssClass:"e-showLegend"+(this.parent.cssClass?" "+this.parent.cssClass:""),change:function(){document.getElementById(i.parent.element.id+"_showLegend").click()},enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});e.element.innerText="",r.appendTo(a);var n=this.parent.element.querySelector(".e-checkbox-wrapper.e-showLegend");e.element.appendChild(n)}},e.prototype.getLableState=function(){var e=JSON.parse(this.parent.getChartSettings()).chartSettings;return e&&e.legendSettings&&void 0!==e.legendSettings.visible?this.showLableState=e.legendSettings.visible:this.showLableState=!0,this.showLableState},e.prototype.getAllChartItems=function(){return["Line","Column","Area","Bar","StackingColumn","StackingArea","StackingBar","StackingLine","StepLine","StepArea","SplineArea","Scatter","Spline","StackingColumn100","StackingBar100","StackingArea100","StackingLine100","Bubble","Pareto","Polar","Radar","Pie","Pyramid","Funnel","Doughnut"]},e.prototype.updateExportMenu=function(e){var i=[].slice.call(e.element.querySelectorAll("li"));"Table"===this.parent.currentView?(t.addClass(i.slice(3),q),t.removeClass(i.slice(1,3),q)):(t.addClass(i.slice(1,3),q),t.removeClass(i.slice(3),q))},e.prototype.updateSubtotalSelection=function(e){e.parentItem.id!==this.parent.element.id+"subtotalpositions"?(t.select("#"+this.parent.element.id+"subtotal ."+Y,e.element).classList.contains(Q)||t.select("#"+this.parent.element.id+"subtotal ."+Y,e.element).classList.add(Q),t.select("#"+this.parent.element.id+"notsubtotal ."+Y,e.element).classList.contains(Q)||t.select("#"+this.parent.element.id+"notsubtotal ."+Y,e.element).classList.add(Q),t.select("#"+this.parent.element.id+"subtotalrow ."+Y,e.element).classList.contains(Q)||t.select("#"+this.parent.element.id+"subtotalrow ."+Y,e.element).classList.add(Q),t.select("#"+this.parent.element.id+"subtotalcolumn ."+Y,e.element).classList.contains(Q)||t.select("#"+this.parent.element.id+"subtotalcolumn ."+Y,e.element).classList.add(Q),this.parent.dataSourceSettings.showSubTotals&&this.parent.dataSourceSettings.showRowSubTotals&&!this.parent.dataSourceSettings.showColumnSubTotals?t.select("#"+this.parent.element.id+"subtotalrow ."+Y,e.element).classList.remove(Q):this.parent.dataSourceSettings.showSubTotals&&!this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals?t.select("#"+this.parent.element.id+"subtotalcolumn ."+Y,e.element).classList.remove(Q):this.parent.dataSourceSettings.showSubTotals&&this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals?t.select("#"+this.parent.element.id+"subtotal ."+Y,e.element).classList.remove(Q):this.parent.dataSourceSettings.showSubTotals&&(this.parent.dataSourceSettings.showRowSubTotals||this.parent.dataSourceSettings.showColumnSubTotals)||t.select("#"+this.parent.element.id+"notsubtotal ."+Y,e.element).classList.remove(Q)):(t.select("#"+this.parent.element.id+"sub-none-position ."+Y,e.element).classList.add(Q),"Auto"===this.parent.dataSourceSettings.subTotalsPosition&&t.select("#"+this.parent.element.id+"sub-none-position ."+Y,e.element).classList.remove(Q),t.select("#"+this.parent.element.id+"sub-top-position ."+Y,e.element).classList.add(Q),"Top"===this.parent.dataSourceSettings.subTotalsPosition&&t.select("#"+this.parent.element.id+"sub-top-position ."+Y,e.element).classList.remove(Q),t.select("#"+this.parent.element.id+"sub-bottom-position ."+Y,e.element).classList.add(Q),"Bottom"===this.parent.dataSourceSettings.subTotalsPosition&&t.select("#"+this.parent.element.id+"sub-bottom-position ."+Y,e.element).classList.remove(Q))},e.prototype.updateGrandtotalSelection=function(e){e.parentItem.id!==this.parent.element.id+"grandtotalpositions"?(t.select("#"+this.parent.element.id+"grandtotal ."+Y,e.element).classList.contains(Q)||t.select("#"+this.parent.element.id+"grandtotal ."+Y,e.element).classList.add(Q),t.select("#"+this.parent.element.id+"notgrandtotal ."+Y,e.element).classList.contains(Q)||t.select("#"+this.parent.element.id+"notgrandtotal ."+Y,e.element).classList.add(Q),t.select("#"+this.parent.element.id+"grandtotalrow ."+Y,e.element).classList.contains(Q)||t.select("#"+this.parent.element.id+"grandtotalrow ."+Y,e.element).classList.add(Q),t.select("#"+this.parent.element.id+"grandtotalcolumn ."+Y,e.element).classList.contains(Q)||t.select("#"+this.parent.element.id+"grandtotalcolumn ."+Y,e.element).classList.add(Q),this.parent.dataSourceSettings.showGrandTotals&&this.parent.dataSourceSettings.showRowGrandTotals&&!this.parent.dataSourceSettings.showColumnGrandTotals?t.select("#"+this.parent.element.id+"grandtotalrow ."+Y,e.element).classList.remove(Q):this.parent.dataSourceSettings.showGrandTotals&&!this.parent.dataSourceSettings.showRowGrandTotals&&this.parent.dataSourceSettings.showColumnGrandTotals?t.select("#"+this.parent.element.id+"grandtotalcolumn ."+Y,e.element).classList.remove(Q):this.parent.dataSourceSettings.showGrandTotals&&this.parent.dataSourceSettings.showRowGrandTotals&&this.parent.dataSourceSettings.showColumnGrandTotals?t.select("#"+this.parent.element.id+"grandtotal ."+Y,e.element).classList.remove(Q):this.parent.dataSourceSettings.showGrandTotals&&(this.parent.dataSourceSettings.showRowGrandTotals||this.parent.dataSourceSettings.showColumnGrandTotals)||t.select("#"+this.parent.element.id+"notgrandtotal ."+Y,e.element).classList.remove(Q)):(t.select("#"+this.parent.element.id+"top-position ."+Y,e.element).classList.add(Q),"Top"===this.parent.dataSourceSettings.grandTotalsPosition&&t.select("#"+this.parent.element.id+"top-position ."+Y,e.element).classList.remove(Q),t.select("#"+this.parent.element.id+"bottom-position ."+Y,e.element).classList.add(Q),"Bottom"===this.parent.dataSourceSettings.grandTotalsPosition&&t.select("#"+this.parent.element.id+"bottom-position ."+Y,e.element).classList.remove(Q))},e.prototype.updateReportList=function(){if(t.select("#"+this.parent.element.id+"_reportlist",this.parent.element)){var e=this.fetchReports(),i=t.getInstance(t.select("#"+this.parent.element.id+"_reportlist",this.parent.element),l.DropDownList);i.dataSource=e.reportName,""===this.currentReport&&i.dataSource.length>0?(i.value=i.dataSource[i.dataSource.length-1],i.text=i.dataSource[i.dataSource.length-1],this.currentReport=i.dataSource[i.dataSource.length-1]):(i.value=this.currentReport,i.text=this.currentReport),i.refresh()}},e.prototype.menuItemClick=function(e){var t,i=this,a={},r=e.item.id===this.parent.element.id+"grid"?"Show table view":e.item.id===this.parent.element.id+"_Column"?T:e.item.id===this.parent.element.id+"_Bar"?T:e.item.id===this.parent.element.id+"_Line"?T:e.item.id===this.parent.element.id+"_Area"?T:e.item.id===this.parent.element.id+"_Scatter"?T:e.item.id===this.parent.element.id+"_Polar"?T:e.item.id===this.parent.element.id+"_ChartMoreOption"?T:e.item.id===this.parent.element.id+"_multipleAxes"?"Multiple Axis":e.item.id===this.parent.element.id+"_showLegend"?"Show legend":e.item.id===this.parent.element.id+"pdf"?"PDF export":e.item.id===this.parent.element.id+"png"?"PNG export":e.item.id===this.parent.element.id+"excel"?"Excel export":e.item.id===this.parent.element.id+"csv"?"CSV export":e.item.id===this.parent.element.id+"jpeg"?"JPEG export":e.item.id===this.parent.element.id+"svg"?"SVG export":e.item.id===this.parent.element.id+"notsubtotal"?"Hide sub-totals":e.item.id===this.parent.element.id+"subtotalrow"?"Show row sub-totals":e.item.id===this.parent.element.id+"subtotalcolumn"?"Show column sub-totals":e.item.id===this.parent.element.id+"subtotal"?"Show sub-totals":e.item.id===this.parent.element.id+"notgrandtotal"?"Hide grand totals":e.item.id===this.parent.element.id+"grandtotalrow"?"Show row grand totals":e.item.id===this.parent.element.id+"grandtotalcolumn"?"Show column grand totals":e.item.id===this.parent.element.id+"grandtotal"?"Show grand totals":e.item.id===this.parent.element.id+"numberFormattingMenu"?"Number Formatting menu":e.item.id===this.parent.element.id+"conditionalFormattingMenu"?"Conditional Formatting menu":"";if(this.parent.actionObj.actionName=r,!this.parent.actionBeginMethod()){(this.getAllChartItems().indexOf(e.item.id.split(this.parent.element.id+"_")[1])>-1||"ChartMoreOption"===e.item.id.split(this.parent.element.id+"_")[1]||"multipleAxes"===e.item.id.split(this.parent.element.id+"_")[1]||"showLegend"===e.item.id.split(this.parent.element.id+"_")[1])&&(t=e.item.id.split(this.parent.element.id+"_")[1]);try{switch(e.item.id){case this.parent.element.id+"grid":if(this.parent.grid&&this.parent.chart){this.parent.grid.element.style.display="",this.parent.chart.element.style.display="none",this.parent.chartSettings.enableMultipleAxis&&this.parent.chartSettings.enableScrollOnMultiAxis&&(this.parent.element.querySelector(".e-pivotchart").style.display="none"),this.parent.currentView="Table",this.parent.setProperties({displayOption:{primary:"Table"}},!0),this.parent.showGroupingBar&&this.parent.groupingBarModule&&(this.parent.element.querySelector(".e-pivot-grouping-bar")&&(this.parent.element.querySelector(".e-pivot-grouping-bar").style.display=""),this.parent.element.querySelector(".e-chart-grouping-bar")&&(this.parent.element.querySelector(".e-chart-grouping-bar").style.display="none"));var n={toolbarInfo:{displayOption:this.parent.displayOption,gridSettings:this.parent.gridSettings}};this.parent.actionObj.actionInfo=n,this.parent.layoutRefresh()}break;case this.parent.element.id+"pdf":"Table"===this.parent.currentView?this.parent.pdfExport({fileName:"Export.pdf"},!1,void 0,!1):this.parent.chartExport("PDF",{fileName:"result"},void 0,null,void 0);break;case this.parent.element.id+"excel":a={excelExportProperties:{fileName:"Export.xlsx"},isBlob:void 0,isMultipleExport:void 0,workbook:void 0},this.parent.trigger("beforeExport",a,function(e){i.parent.excelExport(e.excelExportProperties,e.isMultipleExport,e.workbook,e.isBlob)});break;case this.parent.element.id+"csv":a={excelExportProperties:{fileName:"Export.csv"},isBlob:!1,isMultipleExport:!1,workbook:void 0},this.parent.trigger("beforeExport",a,function(e){"Server"===i.parent.dataSourceSettings.mode?i.parent.getEngine("onCsvExport",null,null,null,null,null,null,null,null,e.excelExportProperties):i.parent.csvExport(e.excelExportProperties,e.isMultipleExport,e.workbook,e.isBlob)});break;case this.parent.element.id+"png":this.parent.chartExport("PNG",{fileName:"result"},void 0,null,void 0);break;case this.parent.element.id+"jpeg":this.parent.chartExport("JPEG",{fileName:"result"},void 0,null,void 0);break;case this.parent.element.id+"svg":this.parent.chartExport("SVG",{fileName:"result"},void 0,null,void 0);break;case this.parent.element.id+"notsubtotal":this.parent.setProperties({dataSourceSettings:{showSubTotals:!1,showColumnSubTotals:!1,showRowSubTotals:!1}},!0),this.parent.refreshData();break;case this.parent.element.id+"subtotalrow":this.parent.setProperties({dataSourceSettings:{showSubTotals:!0,showColumnSubTotals:!1,showRowSubTotals:!0}},!0),this.parent.refreshData();break;case this.parent.element.id+"subtotalcolumn":this.parent.setProperties({dataSourceSettings:{showSubTotals:!0,showColumnSubTotals:!0,showRowSubTotals:!1}},!0),this.parent.refreshData();break;case this.parent.element.id+"subtotal":this.parent.setProperties({dataSourceSettings:{showSubTotals:!0,showColumnSubTotals:!0,showRowSubTotals:!0}},!0),this.parent.refreshData();break;case this.parent.element.id+"notgrandtotal":this.parent.setProperties({dataSourceSettings:{showGrandTotals:!1,showColumnGrandTotals:!1,showRowGrandTotals:!1}},!0),this.parent.refreshData();break;case this.parent.element.id+"grandtotalrow":this.parent.setProperties({dataSourceSettings:{showGrandTotals:!0,showColumnGrandTotals:!1,showRowGrandTotals:!0}},!0),this.parent.refreshData();break;case this.parent.element.id+"grandtotalcolumn":this.parent.setProperties({dataSourceSettings:{showGrandTotals:!0,showColumnGrandTotals:!0,showRowGrandTotals:!1}},!0),this.parent.refreshData();break;case this.parent.element.id+"grandtotal":this.parent.setProperties({dataSourceSettings:{showGrandTotals:!0,showColumnGrandTotals:!0,showRowGrandTotals:!0}},!0),this.parent.refreshData();break;case this.parent.element.id+"top-position":this.parent.setProperties({dataSourceSettings:{grandTotalsPosition:"Top"}},!0),this.parent.refreshData();break;case this.parent.element.id+"bottom-position":this.parent.setProperties({dataSourceSettings:{grandTotalsPosition:"Bottom"}},!0),this.parent.refreshData();break;case this.parent.element.id+"sub-top-position":this.parent.setProperties({dataSourceSettings:{subTotalsPosition:"Top"}},!0),this.parent.refreshData();break;case this.parent.element.id+"sub-bottom-position":this.parent.setProperties({dataSourceSettings:{subTotalsPosition:"Bottom"}},!0),this.parent.refreshData();break;case this.parent.element.id+"sub-none-position":this.parent.setProperties({dataSourceSettings:{subTotalsPosition:"Auto"}},!0),this.parent.refreshData();break;case this.parent.element.id+"numberFormattingMenu":this.parent.numberFormattingModule&&this.parent.numberFormattingModule.showNumberFormattingDialog();break;case this.parent.element.id+"conditionalFormattingMenu":this.parent.conditionalFormattingModule&&this.parent.conditionalFormattingModule.showConditionalFormattingDialog();break;case this.parent.element.id+"_"+t:e.item&&e.item.text&&("ChartMoreOption"===t?this.createChartTypeDialog():"multipleAxes"===t?(this.parent.chartSettings.enableScrollOnMultiAxis&&(this.isMultiAxisChange=!0),this.parent.chartSettings.enableMultipleAxis=!this.parent.chartSettings.enableMultipleAxis,this.updateChartType(this.parent.chartSettings.chartSeries.type,!0)):this.getAllChartItems().indexOf(t)>-1?this.updateChartType(t,!1):"showLegend"===t&&(this.parent.chart.legendSettings.visible=!this.showLableState,this.parent.chartSettings.legendSettings?this.parent.chartSettings.legendSettings.visible=!this.showLableState:this.parent.setProperties({chartSettings:{legendSettings:{visible:!this.showLableState}}},!0),this.updateChartType(this.parent.chartSettings.chartSeries.type,!0)))}}catch(e){this.parent.actionFailureMethod(e)}}},e.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on("init-toolbar",this.createToolbar,this)},e.prototype.getValidChartType=function(){for(var e=[],t=0;t<=this.parent.chartTypes.length;t++){var i=this.parent.chartTypes[t];this.getAllChartItems().indexOf(i)>-1&&e.indexOf(i)<0&&e.push(i)}return e},e.prototype.createChartTypeDialog=function(){var e=this,i=this.parent.element.appendChild(t.createElement("div",{id:this.parent.element.id+"_ChartTypeDialog",className:"e-pivotchart-type-dialog"})),a=new r.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,header:this.parent.localeObj.getConstant("chartTypeSettings"),content:this.getDialogContent(),isModal:!0,beforeOpen:this.beforeOpen.bind(this),visible:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"auto",height:"auto",position:{X:"center",Y:"center"},buttons:[{click:function(){e.chartTypeDialogUpdate()},isFlat:!1,buttonModel:{cssClass:"e-ok-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:function(){e.removeDialog()},isFlat:!1,buttonModel:{cssClass:"e-cancel-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}],closeOnEscape:!0,target:this.parent.element,cssClass:this.parent.cssClass,close:this.removeDialog.bind(this)});a.isStringTemplate=!0,a.appendTo(i)},e.prototype.removeDialog=function(){var e=t.select("#"+this.parent.element.id+"_ChartTypeDialog",this.parent.element)?t.getInstance(t.select("#"+this.parent.element.id+"_ChartTypeDialog",this.parent.element),r.Dialog):null;e&&!e.isDestroyed&&e.destroy(),document.getElementById(this.parent.element.id+"_ChartTypeDialog")&&t.remove(document.getElementById(this.parent.element.id+"_ChartTypeDialog"))},e.prototype.chartTypeDialogUpdate=function(){var e=t.getInstance(t.select("#"+this.parent.element.id+"_ChartTypeOption"),l.DropDownList).value,i=t.getInstance(t.select("#"+this.parent.element.id+"_DialogMultipleAxis"),h.CheckBox).checked,a=t.getInstance(t.select("#"+this.parent.element.id+"_DialogShowLabel"),h.CheckBox).checked;this.parent.chart.legendSettings.visible=a,this.chartLableState&&(this.parent.chart.legendSettings.visible=a,this.parent.chartSettings.legendSettings?this.parent.chartSettings.legendSettings.visible=a:this.parent.setProperties({chartSettings:{legendSettings:{visible:a}}},!0)),this.updateChartType(e,!1),this.parent.chartSettings.enableMultipleAxis=i,this.parent.chartSettings.multipleAxisMode=t.getInstance(t.select("#"+this.parent.element.id+"_AxisModeOption"),l.DropDownList).value,(t.select("#"+this.parent.element.id+"_ChartTypeDialog",document)?t.getInstance(t.select("#"+this.parent.element.id+"_ChartTypeDialog",document),r.Dialog):null).close()},e.prototype.updateChartType=function(e,i){if(this.getAllChartItems().indexOf(e)>-1&&this.parent.chart){this.parent.currentView="Chart",this.parent.setProperties({displayOption:{primary:"Chart"}},!0),this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&(this.parent.element.querySelector("."+W).style.width=t.formatUnit(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber()),this.parent.element.querySelector("."+W).style.height=t.formatUnit(this.parent.pivotChartModule.getChartHeight())),this.parent.chart.setProperties({width:t.formatUnit(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber()),height:t.formatUnit(this.parent.pivotChartModule.getChartHeight())},!0),this.parent.chartSettings.chartSeries.type!==e||i?this.parent.chartSettings.chartSeries.type=e:this.parent.chart.refresh();var a={toolbarInfo:{displayOption:this.parent.displayOption,chartSettings:this.parent.chartSettings}};this.parent.actionObj.actionInfo=a}},e.prototype.getDialogContent=function(){var e=t.createElement("div",{className:"e-chart-type-div-content"}),i=t.createElement("div",{className:"e-chart-type-option-container"}),a=t.createElement("div",{className:"e-multiple-axes-mode-container"}),r=t.createElement("div",{className:"e-chart-type-option-text"});r.innerText=this.parent.localeObj.getConstant("ChartType");var n=t.createElement("div",{className:"e-multiple-axes-mode-text"});n.innerText=this.parent.localeObj.getConstant("multipleAxisMode");var o=t.createElement("div",{id:this.parent.element.id+"_ChartTypeOption"}),s=t.createElement("div",{id:this.parent.element.id+"_AxisModeOption"});i.appendChild(r),i.appendChild(o);for(var d=[],p=[{value:"Stacked",text:this.parent.localeObj.getConstant("stacked")},{value:"Single",text:this.parent.localeObj.getConstant("single")},{value:"Combined",text:this.parent.localeObj.getConstant("combined")}],h=this.getValidChartType(),u=0;u<h.length;u++)d.push({value:h[u],text:this.parent.localeObj.getConstant(h[u].toLowerCase())});var c=new l.DropDownList({dataSource:d,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:this.parent.chartSettings.chartSeries.type?this.parent.chartSettings.chartSeries.type:this.getValidChartType()[0],width:"100%",change:this.changeDropDown.bind(this),cssClass:this.parent.cssClass});c.isStringTemplate=!0,c.appendTo(o),e.appendChild(i);var g=t.createElement("input",{id:this.parent.element.id+"_DialogMultipleAxis",attrs:{type:"checkbox"}});e.appendChild(g);var m=t.createElement("input",{id:this.parent.element.id+"_DialogShowLabel",attrs:{type:"checkbox"}});e.appendChild(m),a.appendChild(n),a.appendChild(s),e.appendChild(a);var f=new l.DropDownList({dataSource:p,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:this.parent.chartSettings.multipleAxisMode?this.parent.chartSettings.multipleAxisMode:"Stacked",width:"100%",enabled:this.parent.chartSettings.enableMultipleAxis,cssClass:this.parent.cssClass});return f.isStringTemplate=!0,f.appendTo(s),e},e.prototype.changeDropDown=function(e){var i=JSON.parse(this.parent.getChartSettings()).chartSettings;if(i&&i.legendSettings&&void 0!==i.legendSettings.visible||(t.getInstance(t.select("#"+this.parent.element.id+"_DialogShowLabel"),h.CheckBox).checked=!0),["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(e.value.toString())>-1)t.getInstance(t.select("#"+this.parent.element.id+"_DialogMultipleAxis"),h.CheckBox).disabled=!0,t.getInstance(t.select("#"+this.parent.element.id+"_AxisModeOption"),l.DropDownList).enabled=!1;else{var a=t.getInstance(t.select("#"+this.parent.element.id+"_DialogMultipleAxis"),h.CheckBox);a.disabled=!1,t.getInstance(t.select("#"+this.parent.element.id+"_AxisModeOption"),l.DropDownList).enabled=a.checked}},e.prototype.beforeOpen=function(){var e=this,i=new h.CheckBox({label:this.parent.localeObj.getConstant("multipleAxes"),cssClass:"e-dialog-multiple-axis"+(this.parent.cssClass?" "+this.parent.cssClass:""),checked:!!this.parent.chartSettings.enableMultipleAxis&&this.parent.chartSettings.enableMultipleAxis,change:function(i){t.getInstance(t.select("#"+e.parent.element.id+"_AxisModeOption"),l.DropDownList).enabled=i.checked},enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),a=new h.CheckBox({label:this.parent.localeObj.getConstant("showLegend"),checked:this.getLableState(),change:function(){e.chartLableState=!0},cssClass:"e-dialog-show-legend"+(this.parent.cssClass?" "+this.parent.cssClass:""),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),n=t.select("#"+this.parent.element.id+"_ChartTypeDialog",document)?t.getInstance(t.select("#"+this.parent.element.id+"_ChartTypeDialog",document),r.Dialog):null;a.appendTo(t.select("#"+this.parent.element.id+"_DialogShowLabel",n.element)),i.appendTo(t.select("#"+this.parent.element.id+"_DialogMultipleAxis",n.element)),["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)>-1&&(i.disabled=!0,t.getInstance(t.select("#"+this.parent.element.id+"_AxisModeOption"),l.DropDownList).enabled=!1);var o=JSON.parse(this.parent.getChartSettings()).chartSettings;o&&o.legendSettings&&void 0!==o.legendSettings.visible?this.chartLableState=!0:this.chartLableState=!1},e.prototype.refreshToolbar=function(){this.destroy(),this.createToolbar()},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("init-toolbar",this.createToolbar)},e.prototype.destroy=function(){this.removeEventListener();var e=t.select("#"+this.parent.element.id+"_ConfirmDialog",document),i=e?t.getInstance(e,r.Dialog):null;i&&!i.isDestroyed&&(i.destroy(),i=null);var a=(e=t.select("#"+this.parent.element.id+"report-dialog",document))?t.getInstance(e,r.Dialog):null;a&&!a.isDestroyed&&(a.destroy(),a=null);var n=(e=t.select("#"+this.parent.element.id+"mdx-dialog",document))?t.getInstance(e,r.Dialog):null;n&&!n.isDestroyed&&(n.destroy(),n=null);var s=(e=t.select("#"+this.parent.element.id+"chart_menu",document))?t.getInstance(e,o.Menu):null;s&&!s.isDestroyed&&(s.destroy(),s=null);var d=(e=t.select("#"+this.parent.element.id+"_ChartTypeDialog",document))?t.getInstance(e,r.Dialog):null;d&&!d.isDestroyed&&(d.destroy(),d=null);var p=(e=t.select("#"+this.parent.element.id+"export_menu",document))?t.getInstance(e,o.Menu):null;p&&!p.isDestroyed&&(p.destroy(),p=null);var h=(e=t.select("#"+this.parent.element.id+"subtotal_menu",document))?t.getInstance(e,o.Menu):null;h&&!h.isDestroyed&&(h.destroy(),h=null);var u=(e=t.select("#"+this.parent.element.id+"grandtotal_menu",document))?t.getInstance(e,o.Menu):null;u&&!u.isDestroyed&&(u.destroy(),u=null);var c=(e=t.select("#"+this.parent.element.id+"formatting_menu",document))?t.getInstance(e,o.Menu):null;c&&!c.isDestroyed&&(c.destroy(),c=null);var g=(e=t.select("#"+this.parent.element.id+"_reportlist",document))?t.getInstance(e,l.DropDownList):null;g&&!g.isDestroyed&&(g.destroy(),g=null),this.toolbar&&!this.toolbar.isDestroyed&&(this.toolbar.destroy(),this.toolbar=null),(e=t.select("#"+this.parent.element.id+"pivot-toolbar",document))&&t.remove(e)},e.prototype.focusToolBar=function(){t.removeClass(document.querySelector("."+z).querySelectorAll(".e-menu-item.e-focused"),"e-focused"),t.removeClass(document.querySelector("."+z).querySelectorAll(".e-menu-item.e-selected"),"e-selected"),document.querySelector(".e-toolbar-items")&&t.addClass([document.querySelector(".e-toolbar-items")],"e-focused")},e}(),ri=function(){function e(e){this.parent=e,this.parent.numberFormattingModule=this,this.removeEventListener(),this.addEventListener(),this.newFormat=[],this.lastFormattedValue=[]}return e.prototype.getModuleName=function(){return"numberFormatting"},e.prototype.showNumberFormattingDialog=function(){var e=this,i=t.createElement("div",{id:this.parent.element.id+"_FormatDialog",className:"e-pivot-format-dialog"});this.parent.element.appendChild(i),this.dialog=new r.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,header:this.parent.localeObj.getConstant("numberFormat"),content:this.getDialogContent(),isModal:!0,visible:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"320px",height:"auto",position:{X:"center",Y:"center"},buttons:[{click:this.updateFormatting.bind(this),isFlat:!1,buttonModel:{cssClass:"e-ok-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("apply"),isPrimary:!0}},{click:function(){e.dialog.hide()},isFlat:!1,buttonModel:{cssClass:"e-cancel-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}],closeOnEscape:!0,cssClass:this.parent.cssClass,target:this.parent.element,close:this.removeDialog.bind(this)}),this.dialog.isStringTemplate=!0,this.dialog.appendTo(i),this.dialog.element.querySelector(".e-dlg-header").innerText=this.parent.localeObj.getConstant("numberFormat");var a;this.newFormat=[{name:this.parent.localeObj.getConstant("AllValues"),format:"N0",useGrouping:!0,type:void 0}];for(var n=[],o=0;o<this.parent.dataSourceSettings.formatSettings.length;o++)a={name:this.parent.dataSourceSettings.formatSettings[o].name,format:this.parent.dataSourceSettings.formatSettings[o].format,useGrouping:this.parent.dataSourceSettings.formatSettings[o].useGrouping,type:this.parent.dataSourceSettings.formatSettings[o].type},this.newFormat.push(a);for(o=0;o<this.newFormat.length;o++)n.push(this.newFormat[o].name);for(var s=0;s<this.parent.dataSourceSettings.values.length;s++)-1===n.indexOf(this.parent.dataSourceSettings.values[s].name)&&(a={name:this.parent.dataSourceSettings.values[s].name,format:"N0",useGrouping:!0},this.newFormat.push(a));this.renderControls()},e.prototype.getDialogContent=function(){var e=t.createElement("div",{id:this.parent.element.id+"_FormatDialogOuter",className:"e-pivot-format-dialog-outer"}),i=t.createElement("table",{id:this.parent.element.id+"_FormatTable",className:"e-pivot-format-table",attrs:{role:"tableItems"}}),a=t.createElement("tr"),r=t.createElement("td"),n=t.createElement("div",{id:this.parent.element.id+"_FormatValueLable",className:"e-pivot-format-value-lable"});n.innerText=this.parent.localeObj.getConstant("values");var o=t.createElement("div",{id:this.parent.element.id+"_FormatValueDrop"});r.appendChild(n),r.appendChild(o),a.appendChild(r),i.appendChild(a),a=t.createElement("tr"),r=t.createElement("td");var s=t.createElement("div",{id:this.parent.element.id+"_FormatLable",className:"e-pivot-format-lable"});s.innerText=this.parent.localeObj.getConstant("formatType");var l=t.createElement("div",{id:this.parent.element.id+"_FormatDrop"});r.appendChild(s),r.appendChild(l),a.appendChild(r),i.appendChild(a),a=t.createElement("tr"),r=t.createElement("td");var d=t.createElement("div",{id:this.parent.element.id+"_GroupingLable",className:"e-pivot-format-grouping-lable"});d.innerText=this.parent.localeObj.getConstant("grouping");var p=t.createElement("div",{id:this.parent.element.id+"_GroupingDrop"});r.appendChild(d),r.appendChild(p),a.appendChild(r),i.appendChild(a),a=t.createElement("tr"),r=t.createElement("td");var h=t.createElement("div",{id:this.parent.element.id+"_DecimalLable",className:"e-pivot-format-decimal-lable"});h.innerText=this.parent.localeObj.getConstant("decimalPlaces");var u=t.createElement("div",{id:this.parent.element.id+"_DecimalDrop"});return r.appendChild(h),r.appendChild(u),a.appendChild(r),i.appendChild(a),a=t.createElement("tr"),r=t.createElement("td"),this.customLable=t.createElement("div",{id:this.parent.element.id+"_CustomLable",className:"e-pivot-format-custom-lable"}),this.customLable.innerText=this.parent.localeObj.getConstant("customFormatString"),this.customText=t.createElement("input",{id:this.parent.element.id+"_CustomText",attrs:{type:"text",tabindex:"0"},className:"e-input e-pivot-format-custom-text"}),r.appendChild(this.customLable),r.appendChild(this.customText),a.appendChild(r),i.appendChild(a),a=t.createElement("tr"),i.appendChild(a),e.appendChild(i),e},e.prototype.renderControls=function(){var e,i,a;if(t.select("#"+this.parent.element.id+"_FormatValueDrop",this.dialog.element)){var r=[];r.push({index:0,name:this.parent.localeObj.getConstant("AllValues"),field:this.parent.localeObj.getConstant("AllValues")});for(var n=0;n<this.parent.dataSourceSettings.values.length;n++){var o=this.parent.dataSourceSettings.values[n].caption||this.parent.dataSourceSettings.values[n].name;o=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(o):o,r.push({index:n+1,name:o,field:this.parent.dataSourceSettings.values[n].name})}(e=new l.DropDownList({dataSource:r,fields:{text:"name",value:"field"},enableRtl:this.parent.enableRtl,locale:this.parent.locale,index:0,cssClass:"e-pivot-format-value-drop"+(this.parent.cssClass?" "+this.parent.cssClass:""),change:this.valueChange.bind(this),width:"100%",open:this.customUpdate.bind(this)})).isStringTemplate=!0,e.appendTo(t.select("#"+this.parent.element.id+"_FormatValueDrop",this.dialog.element))}if(t.select("#"+this.parent.element.id+"_FormatDrop",this.dialog.element)){s=[{index:0,name:this.parent.localeObj.getConstant("number")},{index:1,name:this.parent.localeObj.getConstant("currency")},{index:2,name:this.parent.localeObj.getConstant("percentage")},{index:3,name:this.parent.localeObj.getConstant("Custom")}];(i=new l.DropDownList({dataSource:s,fields:{text:"name",value:"name"},index:0,change:this.dropDownChange.bind(this),enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-pivot-format-drop"+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%"})).isStringTemplate=!0,i.appendTo(t.select("#"+this.parent.element.id+"_FormatDrop",this.dialog.element))}if(t.select("#"+this.parent.element.id+"_GroupingDrop",this.dialog.element)){s=[{index:0,name:this.parent.localeObj.getConstant("true")},{index:1,name:this.parent.localeObj.getConstant("false")}];(a=new l.DropDownList({dataSource:s,fields:{text:"name",value:"name"},enableRtl:this.parent.enableRtl,locale:this.parent.locale,index:0,cssClass:"e-pivot-format-grouping-drop"+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:this.groupingChange.bind(this)})).isStringTemplate=!0,a.appendTo(t.select("#"+this.parent.element.id+"_GroupingDrop",this.dialog.element))}if(t.select("#"+this.parent.element.id+"_DecimalDrop",this.dialog.element)){var s=[{index:0,name:0},{index:1,name:1},{index:2,name:2},{index:3,name:3},{index:4,name:4},{index:5,name:5},{index:6,name:6},{index:7,name:7},{index:8,name:8},{index:9,name:9},{index:10,name:10}],d=new l.DropDownList({dataSource:s,fields:{text:"name",value:"name"},enableRtl:this.parent.enableRtl,locale:this.parent.locale,index:0,cssClass:"e-pivot-format-decimal-drop"+(this.parent.cssClass?" "+this.parent.cssClass:""),popupHeight:150,width:"100%",change:this.decimalChange.bind(this)});d.isStringTemplate=!0,d.appendTo(t.select("#"+this.parent.element.id+"_DecimalDrop",this.dialog.element))}if(i.value!==this.parent.localeObj.getConstant("Custom")&&(this.customText.disabled=!0),0!==this.lastFormattedValue.length){e.value=this.lastFormattedValue[0].name;var p=this.lastFormattedValue[0].format,h=""===p?"":p.split("")[0].toLowerCase(),u=this.lastFormattedValue[0].useGrouping?this.parent.localeObj.getConstant("true"):this.parent.localeObj.getConstant("false");this.updateFormattingDialog(p,h,u)}},e.prototype.valueChange=function(e){for(var i=this.newFormat,a=!1,r=0;r<i.length;r++)if(i[r].name===e.value){var n=i[r].format,o=""===n?"":n.split("")[0].toLowerCase(),s=i[r].useGrouping?this.parent.localeObj.getConstant("true"):this.parent.localeObj.getConstant("false");this.updateFormattingDialog(n,o,s),a=!0;break}a||(t.getInstance(t.select("#"+this.parent.element.id+"_FormatDrop",this.parent.element),l.DropDownList).value=this.parent.localeObj.getConstant("number"),t.getInstance(t.select("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),l.DropDownList).value=0,t.getInstance(t.select("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),l.DropDownList).value=this.parent.localeObj.getConstant("true"))},e.prototype.updateFormattingDialog=function(e,i,a){var r=t.getInstance(t.select("#"+this.parent.element.id+"_FormatDrop",this.parent.element),l.DropDownList);2===e.length&&["n","p","c"].indexOf(i)>-1?(r.value="n"===i?this.parent.localeObj.getConstant("number"):"p"===i?this.parent.localeObj.getConstant("percentage"):"c"===i?this.parent.localeObj.getConstant("currency"):this.parent.localeObj.getConstant("number"),t.getInstance(t.select("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),l.DropDownList).value=Number(e.split("")[1]),t.getInstance(t.select("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),l.DropDownList).value=a):(r.value=this.parent.localeObj.getConstant("Custom"),this.customText.value=e)},e.prototype.customUpdate=function(){if(t.getInstance(t.select("#"+this.parent.element.id+"_FormatDrop",this.parent.element),l.DropDownList).value===this.parent.localeObj.getConstant("Custom")){var e=this.getIndexValue();this.newFormat[e].format=this.customText.value}},e.prototype.dropDownChange=function(e){var i=this.getIndexValue(),a=t.getInstance(t.select("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),l.DropDownList),r=t.getInstance(t.select("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),l.DropDownList);if(e.value===this.parent.localeObj.getConstant("Custom"))this.customText.disabled=!1,a.enabled=!1,r.enabled=!1,this.newFormat[i].format=this.customText.value;else{var n=this.formattedText();this.newFormat[i].format=n,this.customText.disabled=!0,a.enabled=!0,r.enabled=!0,this.customText.value=""}},e.prototype.groupingChange=function(){var e=this.getIndexValue(),i=t.getInstance(t.select("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),l.DropDownList);this.newFormat[e].useGrouping=i.value===this.parent.localeObj.getConstant("true")},e.prototype.getIndexValue=function(){for(var e=[],i=0;i<this.newFormat.length;i++)e.push(this.newFormat[i].name);var a=t.getInstance(t.select("#"+this.parent.element.id+"_FormatValueDrop",this.parent.element),l.DropDownList);return e.indexOf(a.value.toString())},e.prototype.decimalChange=function(){var e=this.getIndexValue(),t=this.formattedText();this.newFormat[e].format=t},e.prototype.formattedText=function(){var e,i=t.getInstance(t.select("#"+this.parent.element.id+"_FormatDrop",this.parent.element),l.DropDownList),a=t.getInstance(t.select("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),l.DropDownList);return i.value===this.parent.localeObj.getConstant("number")||i.value===this.parent.localeObj.getConstant("percentage")||i.value===this.parent.localeObj.getConstant("currency")?(e=i.value===this.parent.localeObj.getConstant("number")?"N":i.value===this.parent.localeObj.getConstant("currency")?"C":"P",e+=a.value):e=this.customText.value},e.prototype.removeDialog=function(){this.dialog&&!this.dialog.isDestroyed&&this.dialog.destroy(),document.getElementById(this.parent.element.id+"_FormatDialog")&&t.remove(document.getElementById(this.parent.element.id+"_FormatDialog"))},e.prototype.updateFormatting=function(){var e=this,i=this.formattedText(),a=this.getIndexValue();this.newFormat=this.newFormat.splice(a,1);for(var r=t.extend([],this.newFormat,!0),n=this.parent.dataSourceSettings.formatSettings,o=0;o<n.length;o++)this.insertFormat(n[o].name,n[o].format,n[o].type,n[o].currency,n[o].useGrouping);var s=t.getInstance(t.select("#"+this.parent.element.id+"_FormatValueDrop",this.parent.element),l.DropDownList);if(s.value===this.parent.localeObj.getConstant("AllValues"))for(o=0;o<this.parent.dataSourceSettings.values.length;o++)this.insertFormat(this.parent.dataSourceSettings.values[o].name,i);else this.insertFormat(s.value.toString(),i);var d={formatSettings:f.cloneFormatSettings(this.newFormat),formatName:s.value.toString(),cancel:!1};this.parent.trigger("numberFormatting",d,function(t){if(t.cancel)e.dialog.close(),e.parent.setProperties({dataSourceSettings:{formatSettings:r}},!0);else{e.parent.setProperties({dataSourceSettings:{formatSettings:t.formatSettings}},!0);var i={numberFormattingInfo:e.parent.dataSourceSettings.formatSettings};e.parent.actionObj.actionInfo=i;try{e.parent.updateDataSource(),e.dialog.close()}catch(t){e.parent.setProperties({dataSourceSettings:{formatSettings:r}},!0),e.parent.pivotCommon.errorDialog.createErrorDialog(e.parent.localeObj.getConstant("error"),e.parent.localeObj.getConstant("invalidFormat")),e.parent.hideWaitingPopup()}}})},e.prototype.insertFormat=function(e,i,a,r,n){for(var o=!1,s=t.getInstance(t.select("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),l.DropDownList),d={name:e,format:i,useGrouping:t.isNullOrUndefined(n)?s.value===this.parent.localeObj.getConstant("true"):n,type:a,currency:r},p=this.newFormat,h=0;h<p.length;h++)p[h].name===e&&(p[h]=d,o=!0);o||p.push(d),this.lastFormattedValue=[],this.lastFormattedValue.push(d)},e.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on("init-formatting",this.showNumberFormattingDialog,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("init-formatting",this.showNumberFormattingDialog)},e.prototype.destroy=function(){this.dialog&&!this.dialog.isDestroyed&&(this.dialog.destroy(),this.dialog=null),this.removeEventListener()},e}(),ni=function(){function e(e){this.dateGroup=/_date_group_years|_date_group_quarters|_date_group_quarterYear|_date_group_months|_date_group_days|_date_group_hours|_date_group_minutes|_date_group_seconds/g,this.parent=e,this.parent.groupingModule=this,this.addEventListener()}return e.prototype.getModuleName=function(){return"grouping"},e.prototype.render=function(e){var t=e.target,i=e.option,a=e.parentElement,r=[];this.parentElement=a,this.isUpdate=!1;var n=Number(t.getAttribute("data-colindex")),o=Number(t.getAttribute("index")),s=this.parent.engineModule.pivotValues[o][n],l=s.valueSort.axis.toString();(r=this.getSelectedCells(s.axis,l,s.actualText.toString())).push({axis:s.axis,fieldName:l,name:s.actualText.toString(),cellInfo:s}),-1!==i.replace(a.id,"").indexOf("_custom_group")?this.createGroupSettings(l,r):this.updateUnGroupSettings(l,r)},e.prototype.getSelectedOptions=function(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];-1===f.inArray(r.name,t)&&t.push(r.name)}return t},e.prototype.createGroupSettings=function(e,t){var i=this.parent.engineModule.fieldList[e],a=this.getGroupSettings(e);if(t.length>0){var r=void 0,n=!1;if(i.isCustomField)if(a)a&&"Custom"===a.type?1===t.length?n=!0:(n=!1,r="custom"):a&&"Number"===a.type&&(n=!1,r="number");else{var o=this.getGroupSettings(e.replace(this.dateGroup,"")),s=this.getGroupSettings(e.replace(/_custom_group/g,""));o?(n=!1,r="date",e=e.replace(this.dateGroup,"")):s&&(n=1===t.length,r="custom")}else a?"Number"===a.type||"Date"===a.type?(n=!1,r="Date"===a.type?"date":"number"):"Custom"===a.type&&(n=1===t.length,r="custom"):"number"===i.type||-1!==["datetime","date"].indexOf(i.type)||this.isDateType(e)?(n=!1,r=1===t.length?-1!==["datetime","date"].indexOf(i.type)||this.isDateType(e)?"date":"number":"custom"):"string"===i.type&&(n=1===t.length,r="custom");n?(this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("warning"),this.parent.localeObj.getConstant("invalidSelection")),this.parent.grid.clearSelection()):r&&""!==r&&this.createGroupDialog(e,r,t)}},e.prototype.updateUnGroupSettings=function(e,t){var i=this.parent.engineModule.fieldList[e],a=f.cloneGroupSettings(this.parent.dataSourceSettings.groupSettings),r=this.getGroupSettings(e);if(t.length>0){var n=void 0;if(i.isCustomField)if(r)"Custom"===r.type&&(n="custom");else{var o=this.getGroupSettings(e.replace(this.dateGroup,"")),s=this.getGroupSettings(e.replace(/_custom_group/g,""));o?(n="date",e=e.replace(this.dateGroup,"")):s&&(n="custom")}else r&&("Number"!==r.type&&"Date"!==r.type||(n="Date"===r.type?"date":"number"));if("date"===n||"number"===n)a=this.validateSettings(e,a,n,[]);else if("custom"===n){var l=this.getSelectedOptions(t);a=this.validateSettings(e,a,n,l)}this.updateDateSource(a,n)}},e.prototype.updateDateSource=function(e,t){this.isUpdate&&(this.parent.setProperties({dataSourceSettings:{groupSettings:e}},!0),this.parent.updateGroupingReport(e,"date"===t?"Date":"custom"===t?"Custom":"Number"),"Server"===this.parent.dataSourceSettings.mode?this.parent.getEngine("onRefresh"):this.parent.initEngine())},e.prototype.removeGroupSettings=function(e,t,i,a){var r=a.indexOf(e);if(-1!==r)for(var n=i[r],o=0,s=n.customGroups.length;o<s;o++)if(n.customGroups[o]){var l=n.customGroups[o];-1!==f.inArray(l.groupName,t)&&(i=this.modifyParentGroupItems(e,i,[l.groupName],l.items,a),n.customGroups.splice(o,1),this.isUpdate=!0,o--,s--)}return delete this.parent.engineModule.groupingFieldsInfo[e],i},e.prototype.getGroupSettings=function(e){for(var t=0,i=this.parent.dataSourceSettings.groupSettings;t<i.length;t++){var a=i[t];if(a.name===e)return a}},e.prototype.isDateType=function(e){for(var t=0,i=this.parent.dataSourceSettings.formatSettings;t<i.length;t++){var a=i[t];if(a.name===e&&a.type)return!0}return!1},e.prototype.getSelectedCells=function(e,t,i){for(var a=[],r=this.parent.element.querySelectorAll(".e-cellselectionbackground,."+_),n=0;n<r.length;n++){var o=r[n],s=Number(o.getAttribute("data-colindex")),l=Number(o.getAttribute("index")),d=this.parent.engineModule.pivotValues[l][s];d&&d.axis===e&&"grand sum"!==d.type&&"sum"!==d.type&&d.valueSort.axis===t&&i!==d.actualText.toString()&&a.push({axis:d.axis,fieldName:d.valueSort.axis.toString(),name:d.actualText.toString(),cellInfo:d})}return a},e.prototype.createGroupDialog=function(e,i,a){var n=t.createElement("div",{id:this.parentElement.id+"_GroupDialog",className:"e-group-field-settings",attrs:{"data-field":e,"data-type":i}});this.parentElement.appendChild(n);var o=new r.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,header:this.parent.localeObj.getConstant("grouping"),content:this.createGroupOptions(e,i),isModal:!0,visible:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:300,height:"auto",position:{X:"center",Y:"center"},buttons:[{click:this.updateGroupSettings.bind(this,a),isFlat:!1,buttonModel:{cssClass:"e-ok-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:function(){o.hide()},isFlat:!1,buttonModel:{cssClass:"e-cancel-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}],closeOnEscape:!0,close:this.removeDialog.bind(this),target:this.parentElement,cssClass:this.parent.cssClass});o.isStringTemplate=!0,o.appendTo(n)},e.prototype.createGroupOptions=function(e,i){var a=this,n=this,o=t.createElement("div",{className:"e-group-field-div-content",id:this.parentElement.id+"_group_field_div_content",attrs:{"data-fieldName":e,"data-type":i}}),p=t.createElement("div",{className:"e-group-option-container"});o.appendChild(p);var u=this.parent.dataSourceSettings,c=f.getFieldByName(e,u.groupSettings);switch(i){case"custom":var g=void 0,m=u.rows;m=m.concat(u.columns,u.values,u.filters);var v=f.getFieldByName(e.replace(/_custom_group/g,""),m),S=f.getFieldByName(e,m),y=f.getFieldByName(e+"_custom_group",m);if(S){var b=e+"_custom_group";g=y?y.caption:this.parent.engineModule.fieldList[v.name].caption+(b.match(/_custom_group/g).length+1)}var C=t.createElement("div",{className:"e-caption-option-text"});C.innerText=this.parent.localeObj.getConstant("groupFieldCaption");var x=t.createElement("div",{className:"e-group-caption-container"}),w=t.createElement("input",{id:this.parentElement.id+"group_caption_option",className:"e-group-caption-text",attrs:{type:"text"}});x.appendChild(C),x.appendChild(w),p.appendChild(x);var T=t.createElement("div",{className:"e-input-option-text"});T.innerText=this.parent.localeObj.getConstant("groupTitle");var M=t.createElement("div",{className:"e-group-input-container"}),D=t.createElement("input",{id:this.parentElement.id+"group_input_option",className:"e-group-input-text",attrs:{type:"text"}});M.appendChild(T),M.appendChild(D),p.appendChild(M);var O=new s.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("captionName"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:g,width:"100%",cssClass:this.parent.cssClass});O.isStringTemplate=!0,O.appendTo(w);var P=new s.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("groupName"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,width:"100%",cssClass:this.parent.cssClass});P.isStringTemplate=!0,P.appendTo(D);break;case"date":case"number":var N=t.createElement("div",{className:"e-group-start-option-container"}),E=t.createElement("input",{id:this.parentElement.id+"group_start_option",className:"e-group_start_option",attrs:{type:"checkbox"}}),F=t.createElement("input",{id:this.parentElement.id+"group_start_input",className:"e-group_start_input",attrs:{type:"text"}});N.appendChild(E),N.appendChild(F),p.appendChild(N);var I=t.createElement("div",{className:"e-group-end-option-container"}),L=t.createElement("input",{id:this.parentElement.id+"group_end_option",className:"e-group_end_option",attrs:{type:"checkbox"}}),A=t.createElement("input",{id:this.parentElement.id+"group_end_input",className:"e-group_end_input",attrs:{type:"text"}});I.appendChild(L),I.appendChild(A),p.appendChild(I);var R=t.createElement("div",{className:"e-group-interval-option-container"}),k=t.createElement("div",{className:"e-group-inerval-option-text"});k.innerText=this.parent.localeObj.getConstant("groupBy");var j=t.createElement("input",{id:this.parentElement.id+"group_interval_input",className:"e-group_interval_input",attrs:{type:"text"}});R.appendChild(k),R.appendChild(j),p.appendChild(R);var q=void 0,H=void 0;if("date"===i){var V=[],U=[{value:"Seconds",text:this.parent.localeObj.getConstant("Seconds")},{value:"Minutes",text:this.parent.localeObj.getConstant("Minutes")},{value:"Hours",text:this.parent.localeObj.getConstant("Hours")},{value:"Days",text:this.parent.localeObj.getConstant("Days")},{value:"Months",text:this.parent.localeObj.getConstant("Months")},{value:"QuarterYear",text:this.parent.localeObj.getConstant("QuarterYear")},{value:"Quarters",text:this.parent.localeObj.getConstant("Quarters")},{value:"Years",text:this.parent.localeObj.getConstant("Years")}];c&&"Date"===c.type?(V=c.groupInterval,q=c.startingAt?c.startingAt.toString():void 0,H=c.endingAt?c.endingAt.toString():void 0):V=["Months"],(G=new d.DateTimePicker({placeholder:this.parent.localeObj.getConstant("chooseDate"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,format:"dd/MM/yyyy hh:mm:ss a",enabled:!(void 0===q),width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,G.appendTo(F),(z=new d.DateTimePicker({placeholder:this.parent.localeObj.getConstant("chooseDate"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,format:"dd/MM/yyyy hh:mm:ss a",enabled:!(void 0===H),width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,z.appendTo(A),l.MultiSelect.Inject(l.CheckBoxSelection);var _=new l.MultiSelect({dataSource:U,value:V,fields:{text:"text",value:"value"},mode:"CheckBox",showDropDownIcon:!0,enableSelectionOrder:!1,placeholder:this.parent.localeObj.getConstant("selectGroup"),filterBarPlaceholder:this.parent.localeObj.getConstant("example")+" "+this.parent.localeObj.getConstant("Months"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass,select:function(){t.getInstance(t.select("#"+n.parentElement.id+"_GroupDialog",document),r.Dialog).element.querySelector(".e-ok-btn").removeAttribute("disabled")},removed:function(){var e=0;_.liCollections.forEach(function(t){t.classList.contains("e-active")&&e++}),0===e&&t.getInstance(t.select("#"+n.parentElement.id+"_GroupDialog",document),r.Dialog).element.querySelector(".e-ok-btn").setAttribute("disabled","disabled")}});_.isStringTemplate=!0,_.appendTo(j),G.value=void 0===q?null:new Date(q),G.dataBind(),z.value=void 0===H?null:new Date(H),z.dataBind()}else{var B=void 0;c&&"Number"===c.type?(B=c.rangeInterval,q=c.startingAt?c.startingAt.toString():void 0,H=c.endingAt?c.endingAt.toString():void 0):B=2;var G=new s.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,showClearButton:!0,format:"###",value:void 0===q?void 0:parseInt(q,10),enabled:!(void 0===q),width:"100%",cssClass:this.parent.cssClass});G.isStringTemplate=!0,G.appendTo(F);var z=new s.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,showClearButton:!0,format:"###",value:void 0===H?void 0:parseInt(H,10),enabled:!(void 0===H),width:"100%",cssClass:this.parent.cssClass});z.isStringTemplate=!0,z.appendTo(A);var W=new s.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,showClearButton:!0,format:"###",min:1,value:B,width:"100%",cssClass:this.parent.cssClass});W.isStringTemplate=!0,W.appendTo(j)}var Q=new h.CheckBox({label:this.parent.localeObj.getConstant("startAt"),checked:!(void 0===q),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass,change:function(e){var r="date"===i?t.getInstance(t.select("#"+a.parentElement.id+"group_start_input"),d.DateTimePicker):t.getInstance(t.select("#"+a.parentElement.id+"group_start_input"),s.NumericTextBox);r.enabled=e.checked,r.dataBind()}});Q.isStringTemplate=!0,Q.appendTo(E);var Y=new h.CheckBox({label:this.parent.localeObj.getConstant("endAt"),checked:!(void 0===H),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass,change:function(e){var r="date"===i?t.getInstance(t.select("#"+a.parentElement.id+"group_end_input"),d.DateTimePicker):t.getInstance(t.select("#"+a.parentElement.id+"group_end_input"),s.NumericTextBox);r.enabled=e.checked,r.dataBind()}});Y.isStringTemplate=!0,Y.appendTo(L)}return o},e.prototype.updateGroupSettings=function(e){var i=t.getInstance(t.select("#"+this.parentElement.id+"_GroupDialog",document),r.Dialog),a=i.element,n=a.getAttribute("data-type"),o=a.getAttribute("data-field"),p=f.cloneGroupSettings(this.parent.dataSourceSettings.groupSettings);if(0===p.length&&!this.parent.clonedDataSet&&!this.parent.clonedReport){var u=this.parent.engineModule.data;this.parent.clonedDataSet="CSV"===this.parent.dataSourceSettings.type?f.getClonedCSVData(u):f.getClonedData(u),this.parent.setProperties({dataSourceSettings:{dataSource:[]}},!0),this.parent.clonedReport=t.extend({},this.parent.dataSourceSettings,null,!0),this.parent.setProperties({dataSourceSettings:{dataSource:u}},!0)}if("custom"===n){var c=t.getInstance(t.select("#"+this.parentElement.id+"group_input_option"),s.MaskedTextBox),g=t.getInstance(t.select("#"+this.parentElement.id+"group_caption_option"),s.MaskedTextBox);if(t.removeClass([c.element],"e-empty-field"),null===c.value||""===c.value)return t.addClass([c.element],"e-empty-field"),void c.element.focus();for(var m=this.getSelectedOptions(e),v={groupName:c.value,items:m},S=[],y=[],b={name:o,caption:g.value,type:"Custom",customGroups:[]},C=!1,x=0,w=p.length;x<w;x++)if(p[x].name===o){(b=p[x]).caption=g.value;for(var T=0,M=b.customGroups.length;T<M;T++)if(b.customGroups[T]){var D=b.customGroups[T];D.items&&jt.isContainCommonElements(D.items,m)&&(S=this.mergeArray(S,[D.groupName]),y=this.mergeArray(y,D.items),b.customGroups.splice(T,1),T--,M--)}for(var O=0,P=m;O<P.length;O++){var N=P[O],E=y.indexOf(N);-1!==E&&y.splice(E,1)}y=this.mergeArray(y,[v.groupName]),b.customGroups.push(v),this.isUpdate=!0,C=!0;break}C||(b.customGroups.push(v),this.isUpdate=!0,p.push(b)),p=this.validateSettings(o,p,n,0===S.length?v.items:S,y)}else if("date"===n||"number"===n){var F=t.getInstance(t.select("#"+this.parentElement.id+"group_start_option"),h.CheckBox),I=t.getInstance(t.select("#"+this.parentElement.id+"group_end_option"),h.CheckBox),L="date"===n?t.getInstance(t.select("#"+this.parentElement.id+"group_start_input"),d.DateTimePicker):t.getInstance(t.select("#"+this.parentElement.id+"group_start_input"),s.NumericTextBox),A="date"===n?t.getInstance(t.select("#"+this.parentElement.id+"group_end_input"),d.DateTimePicker):t.getInstance(t.select("#"+this.parentElement.id+"group_end_input"),s.NumericTextBox),R="date"===n?t.getInstance(t.select("#"+this.parentElement.id+"group_interval_input"),l.MultiSelect):t.getInstance(t.select("#"+this.parentElement.id+"group_interval_input"),s.NumericTextBox),b={name:o,startingAt:F.checked?L.value.toString():void 0,endingAt:I.checked?A.value.toString():void 0};if("date"===n){for(var k=[],j=0,q=R.value;j<q.length;j++){var H=q[j];k.push(H)}b.type="Date",b.groupInterval=k}else b.type="Number",b.rangeInterval=R.value;for(var C=!1,x=0,w=p.length;x<w;x++)if(p[x].name===o){p.splice(x,1,b),this.isUpdate=!0,C=!0;break}C||(this.isUpdate=!0,p.push(b)),p=this.validateSettings(o,p,n,[],[])}i.close(),this.updateDateSource(p,n)},e.prototype.getGroupBasedSettings=function(e){for(var t={},i=0,a=e;i<a.length;i++){var r=a[i];t[r.type]?t[r.type].push(r):t[r.type]=[r]}return t},e.prototype.getGroupByName=function(e){for(var t={},i=0,a=e;i<a.length;i++){var r=a[i],n=r.name.replace(/_custom_group/g,"");t[n]?t[n].push(r):t[n]=[r]}return t},e.prototype.validateSettings=function(e,t,i,a,r){var n=[],o=this.getGroupBasedSettings(t),s=["Date","Number","Custom"];if(o[s[2]]&&"custom"===i){var l=this.getGroupByName(o[s[2]]);if(l[e.replace(/_custom_group/g,"")]){var d=l[e.replace(/_custom_group/g,"")],p=d.map(function(e){return e.name});d=r?this.modifyParentGroupItems(e,d,a,r,p):this.removeGroupSettings(e.replace("_custom_group",""),a,d,p)}for(var h=[],u=0,c=Object.keys(l);u<c.length;u++){var g=c[u],p=l[g].map(function(e){return e.name});h=this.reOrderSettings(l[g],p,h,g,e)}o[s[2]]=h}else if(("date"===i||"number"===i)&&!r){var m="date"===i?o[s[0]]:o[s[1]];if("date"===i){o[s[0]]=m.filter(function(t){return t.name!==e});var f=["_date_group_years","_date_group_quarters","_date_group_quarterYear","_date_group_months","_date_group_days","_date_group_hours","_date_group_minutes","_date_group_seconds"];if(0===o[s[0]].length){delete this.parent.engineModule.groupingFieldsInfo[e];var v=this;for(var S in this.parent.engineModule.groupingFieldsInfo)!function(t){f.some(function(i){return t===""+e+i})&&delete v.parent.engineModule.groupingFieldsInfo[t]}(S);var y=this;for(var S in this.parent.engineModule.fieldList)!function(t){f.some(function(i){return t===""+e+i})&&delete y.parent.engineModule.fieldList[t]}(S);var b=this.parent.engineModule.fields.filter(function(t){return!f.some(function(i){return t===""+e+i})});this.parent.engineModule.fields=b}}else o[s[1]]=m.filter(function(t){return t.name!==e});this.isUpdate=!0}for(var C=0,x=s;C<x.length;C++){var w=x[C];o[w]&&(n=n.concat(o[w]))}return n},e.prototype.reOrderSettings=function(e,i,a,r,n){var o=i.indexOf(r);if(o>-1&&e[o].customGroups&&e[o].customGroups.length>0)a.push(e[o]),this.reOrderSettings(e,i,a,r+"_custom_group");else if(o>-1&&e[o].customGroups&&0===e[o].customGroups.length&&!t.isNullOrUndefined(n)){delete this.parent.engineModule.fieldList[n],delete this.parent.engineModule.groupingFieldsInfo[n];var s=this.parent.engineModule.fields.filter(function(e){return e!==n});this.parent.engineModule.fields=s}return a},e.prototype.modifyParentGroupItems=function(e,t,i,a,r){var n=r.indexOf(e+"_custom_group");if(-1!==n){var o=t[n];if(o.customGroups&&o.customGroups.length>0)for(var s=0,l=o.customGroups.length;s<l;s++)if(o.customGroups[s]){var d=!1,p=o.customGroups[s];if(p.items){for(var h=0,u=i;h<u.length;h++){var c=u[h],g=p.items.indexOf(c);-1!==g&&(p.items.splice(g,1),this.isUpdate=!0,d=!0)}d&&(p.items=this.mergeArray(p.items,a))}}}return t},e.prototype.mergeArray=function(e,t){for(var i=[],a=e.concat(t),r=a.length,n={};r--;){var o=String(a[r]);n[o]||(i.unshift(o),n[o]=!0)}return i},e.prototype.removeDialog=function(){if(!(this.parent.grid&&this.parent.grid.isDestroyed||t.isNullOrUndefined(this.parent.grid))){this.parent.grid.clearSelection();var e=t.select("#"+this.parent.element.id+"_GroupDialog",document),i=e?t.getInstance(e,r.Dialog):null;i&&!i.isDestroyed&&i.destroy(),this.parent.element&&document.getElementById(this.parent.element.id+"_GroupDialog")&&t.remove(document.getElementById(this.parent.element.id+"_GroupDialog"))}},e.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on("init-grouping",this.render,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.removeDialog(),this.parent.off("init-grouping",this.render))},e.prototype.destroy=function(){this.removeEventListener()},e}();return kt.Inject(ti,$t,Zt,ii,Pe,Ee,ai,Fe,Ht,qt,ri,ni,Vt),Kt.Inject(Zt),e.AggregateMenu=J,e.Authentication=Ce,e.AxisFieldRenderer=zt,e.AxisTableRenderer=Bt,e.CalculatedField=Zt,e.CalculatedFieldSettings=Se,e.CellEditSettings=Nt,e.Common=oe,e.CommonKeyboardInteraction=$,e.ConditionalFormatSettings=ce,e.ConditionalFormatting=ii,e.ConditionalSettings=Et,e.CustomGroups=ve,e.DataSourceSettings=xe,e.DataSourceUpdate=ie,e.DialogRenderer=Ut,e.DisplayOption=At,e.DrillOptions=ye,e.DrillThrough=Ee,e.ErrorDialog=ae,e.EventBase=ee,e.ExcelExport=qt,e.FieldList=$t,e.FieldListFieldOptions=pe,e.FieldOptions=de,e.Filter=ue,e.FilterDialog=re,e.FormatSettings=me,e.GroupSettings=fe,e.Grouping=ni,e.GroupingBar=ti,e.GroupingBarSettings=Pt,e.HyperlinkSettings=Ft,e.KeyboardInteraction=De,e.MDXQuery=xt,e.MdxQuery="MdxQuery",e.NodeStateModified=te,e.NumberFormatting=ri,e.OlapEngine=wt,e.PDFExport=Ht,e.PageSettings=It,e.Pager=Vt,e.PagerSettings=Lt,e.PivotChart=Fe,e.PivotCommon=ne,e.PivotContextMenu=Oe,e.PivotEngine=S,e.PivotFieldList=Kt,e.PivotUtil=f,e.PivotView=kt,e.Render=Z,e.Sort=ge,e.Style=he,e.Toolbar=ai,e.TreeViewRenderer=_t,e.ValueSortSettings=be,e.VirtualScroll=Pe,e.VirtualScrollSettings=Rt,e.actionBegin="actionBegin",e.actionComplete="actionComplete",e.actionDropped="Action dropped",e.actionFailure="actionFailure",e.addNewRecord="Add new record",e.addNewReport="Add new report",e.afterPivotTableRender="afterPivotTableRender",e.afterServiceInvoke="afterServiceInvoke",e.aggregateCellInfo="aggregateCellInfo",e.aggregateField="Aggregate field",e.aggregateMenuOpen="aggregateMenuOpen",e.animationComplete="animationComplete",e.axisLabelFont=Ie,e.axisTitleFont=Le,e.beforeColumnsRender="beforeColumnsRender",e.beforeExcelExport="beforeExcelExport",e.beforeExport="beforeExport",e.beforePdfExport="beforePdfExport",e.beforePivotTableRender="beforePivotTableRender",e.beforePrint="beforePrint",e.beforeServiceInvoke="beforeServiceInvoke",e.beginDrillThrough="beginDrillThrough",e.calculatedFieldApplied="Calculated field applied",e.calculatedFieldCreate="calculatedFieldCreate",e.calculatedFieldEdited="Calculated field edited",e.cellClick="cellClick",e.cellDeselected="cellDeselected",e.cellSelected="cellSelected",e.cellSelecting="cellSelecting",e.chartAxisLabelRender="chartAxisLabelRender",e.chartLegendClick="chartLegendClick",e.chartLoad="chartLoad",e.chartLoaded="chartLoaded",e.chartMouseClick="chartMouseClick",e.chartMouseDown="chartMouseDown",e.chartMouseLeave="chartMouseLeave",e.chartMouseMove="chartMouseMove",e.chartMouseUp="chartMouseUp",e.chartPointClick="chartPointClick",e.chartResized="chartResized",e.chartSeriesCreated="chartSeriesCreated",e.chartSubTitleFont=Re,e.chartTitleFont=Ae,e.chartTooltipRender="chartTooltipRender",e.chartView=T,e.chartViewed="Chart view shown",e.click="click",e.closeFieldlist="Field list closed",e.columnPageNavigated="Column page navigated",e.columnPageNavigation="Navigate column page",e.conditionalFormatting="conditionalFormatting",e.conditionalFormattingMenu="Conditional Formatting menu",e.conditionallyFormatted="Conditional formatting applied",e.contentReady=C,e.contextMenuCalculatedField="CalculatedField Context menu",e.contextMenuClick="contextMenuClick",e.contextMenuOpen="contextMenuOpen",e.crosshairLabelFont=ke,e.csvExport="CSV export",e.csvExported="CSV exported",e.dataBound="dataBound",e.dataReady=x,e.dragComplete="dragComplete",e.drill="drill",e.drillDown="Drill down",e.drillThrough="drillThrough",e.drillThroughClosed="Drill-through closed",e.drillUp="Drill up",e.editCalculatedField="Edit calculated field",e.editCompleted="editCompleted",e.editRecord="Edit record",e.editedRecordsSaved="Edited records saved",e.enginePopulated="enginePopulated",e.enginePopulating="enginePopulating",e.excelExport="Excel export",e.excelExported="Excel exported",e.excelHeaderQueryCellInfo="excelHeaderQueryCellInfo",e.excelQueryCellInfo="excelQueryCellInfo",e.exportComplete="exportComplete",e.fetchReport="fetchReport",e.fieldAggregated="Field aggregated",e.fieldDragStart="fieldDragStart",e.fieldDrop="fieldDrop",e.fieldFiltered="Field filtered",e.fieldListRefreshed="fieldListRefreshed",e.fieldRemove="fieldRemove",e.fieldRemoved="Field removed",e.fieldSorted="Field sorted",e.fieldTreeSorted="Field tree sorted",e.filterField="Filter field",e.grandTotalsColumn="Show column grand totals",e.grandTotalsColumnShown="Column grand totals shown",e.grandTotalsHidden="Grand totals hidden",e.grandTotalsRow="Show row grand totals",e.grandTotalsRowShown="Row grand totals shown",e.grandTotalsShown="Grand totals shown",e.headerCellInfo="headerCellInfo",e.hideGrandTotals="Hide grand totals",e.hideSubTotals="Hide sub-totals",e.horizontalScroll="horizontal-scroll",e.horizontalScrolled="Horizontally scrolled",e.hyperlinkCellClick="hyperlinkCellClick",e.initCalculatedField="init-calculatedfield",e.initFormatting="init-formatting",e.initGrouping="init-grouping",e.initPivotPager="init-pivotPager",e.initSubComponent="init-groupingbar",e.initToolbar="init-toolbar",e.initialLoad=y,e.jpegExport="JPEG export",e.jpegExported="JPEG exported",e.legendLabelFont=qe,e.legendRender="legendRender",e.load="load",e.loadReport="loadReport",e.loadReports="Load report",e.memberEditorOpen="memberEditorOpen",e.memberFiltering="memberFiltering",e.multiLevelLabelClick="multiLevelLabelClick",e.multiLevelLabelRender="multiLevelLabelRender",e.multipleAxis="Multiple Axis",e.newRecordAdded="New record added",e.newReport="newReport",e.newReportAdded="New report added",e.numberFormatted="Number formatting applied",e.numberFormatting="numberFormatting",e.numberFormattingMenu="Number Formatting menu",e.onFieldDropped="onFieldDropped",e.onHeadersSort="onHeadersSort",e.onPdfCellRender="onPdfCellRender",e.openCalculatedField="Open calculated field dialog",e.openConditionalFormatting="Open conditional formatting dialog",e.openNumberFormatting="Open number formatting dialog",e.pdfExport="PDF export",e.pdfExported="PDF exported",e.pdfHeaderQueryCellInfo="pdfHeaderQueryCellInfo",e.pdfQueryCellInfo="pdfQueryCellInfo",e.pivotButtonUpdate="pivot-button-update",e.pngExport="PNG export",e.pngExported="PNG exported",e.pointMove="pointMove",e.pointRender="pointRender",e.queryCellInfo="queryCellInfo",e.recordEdited="Record edited",e.recordRemoved="Record removed",e.recordUpdated="Records updated",e.removeCurrentReport="Remove current report",e.removeField="Remove field",e.removeRecord="Remove record",e.removeReport="removeReport",e.renameCurrentReport="Rename current report",e.renameReport="renameReport",e.reportChange="Report change",e.reportChanged="Report changed",e.reportReSaved="Report re-saved",e.reportRemoved="Report removed",e.reportRenamed="Report renamed",e.reportSaved="Report saved",e.resizeStop="resizeStop",e.resizing="resizing",e.rowDeselected="rowDeselected",e.rowPageNavigated="Row page navigated",e.rowPageNavigation="Navigate row page",e.rowSelected="rowSelected",e.saveAsCurrentReport="Save as current report",e.saveCurrentReport="Save current report",e.saveEditedRecords="Save edited records",e.saveReport="saveReport",e.scroll="scroll",e.scrollChanged="scrollChanged",e.scrollEnd="scrollEnd",e.scrollStart="scrollStart",e.selected="selected",e.seriesRender="seriesRender",e.showFieldList="Open field list",e.showGrandTotals="Show grand totals",e.showLegend="Show legend",e.showSubTotals="Show sub-totals",e.sortField="Sort field",e.sortFieldTree="Sort field tree",e.sortValue="Sort value",e.stockEventFont=Ve,e.stripLineLabelFont=He,e.subTotalsColumn="Show column sub-totals",e.subTotalsColumnShown="Column sub-totals shown",e.subTotalsHidden="Sub-totals hidden",e.subTotalsRow="Show row sub-totals",e.subTotalsRowShown="Row sub-totals shown",e.subTotalsShown="Sub-totals shown",e.svgExport="SVG export",e.svgExported="SVG exported",e.tableView="Show table view",e.tableViewed="Table view shown",e.textRender="textRender",e.toolbarClick="toolbarClick",e.toolbarRender="toolbarRender",e.tooltipLabelFont=je,e.treeViewUpdate=w,e.uiUpdate=b,e.valueSorted="Value sorted",e.verticalScroll="vertical-scroll",e.verticalScrolled="Vertically scrolled",e.windowResize="Window resize",e.windowResized="Window resized",e.zoomComplete="zoomComplete",e}({},ej.base,ej.data,ej.pdfexport,ej.popups,ej.grids,ej.navigations,ej.inputs,ej.dropdowns,ej.calendars,ej.splitbuttons,ej.buttons,ej.charts,ej.svgbase,ej.fileutils,ej.excelexport),this.ejs=ej;
|
|
2
11
|
//# sourceMappingURL=ej2-pivotview.min.js.map
|