@syncfusion/ej2-pivotview
Version:
The pivot grid, or pivot table, is used to visualize large sets of relational data in a cross-tabular format, similar to an Excel pivot table.
12 lines • 1.14 MB
JavaScript
/*!
* filename: ej2-pivotview.umd.min.js
* version : 30.2.6
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-pdf-export"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-grids"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-splitbuttons"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-charts"),require("@syncfusion/ej2-svg-base"),require("@syncfusion/ej2-file-utils"),require("@syncfusion/ej2-excel-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-data","@syncfusion/ej2-pdf-export","@syncfusion/ej2-popups","@syncfusion/ej2-grids","@syncfusion/ej2-navigations","@syncfusion/ej2-inputs","@syncfusion/ej2-dropdowns","@syncfusion/ej2-calendars","@syncfusion/ej2-splitbuttons","@syncfusion/ej2-buttons","@syncfusion/ej2-charts","@syncfusion/ej2-svg-base","@syncfusion/ej2-file-utils","@syncfusion/ej2-excel-export"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Data,e.ej2PdfExport,e.ej2Popups,e.ej2Grids,e.ej2Navigations,e.ej2Inputs,e.ej2Dropdowns,e.ej2Calendars,e.ej2Splitbuttons,e.ej2Buttons,e.ej2Charts,e.ej2SvgBase,e.ej2FileUtils,e.ej2ExcelExport)}(this,function(e,_e,ce,U,P,w,D,H,G,N,O,z,y,E,I,R){"use strict";var F="e-pivotfieldlist",L="e-rtl",A="e-device",W="e-icons",Q="e-disable",k="e-hide",j="e-icon-first",q="e-icon-last",V="e-icon-prev",_="e-icon-next",B="e-dropdown-icon",K="e-pivotfieldlist-container",X="e-toggle-field-list",J="e-static",Z="e-draggable",$="e-field-list",ee="e-field-list-tree-outer-div",te="e-field-list-tree-outer-div-searchMode",ie="e-search-mode",ae="e-pivot-parent",re="e-pivot-child",ne="e-field-list-footer",se="e-left-axis-fields",oe="e-right-axis-fields",le="e-all-fields-axis",de="e-axis-content",he="e-draggable-prompt",pe="e-pvt-btn-div",Y="e-pivot-button",ue="e-content",ge="e-pvt-btn-content",me="e-sort",Se="e-member-sort",fe="e-descend",ve="e-btn-filter",ye="e-pv-filter",be="e-pv-filtered",Ce="e-remove",xe="e-drag",we="e-disable-drag",Te="e-drop-indicator",Me="e-drop-hover",De="e-member-editor-outer-container",Oe="e-member-editor-container",Pe="e-drillthrough-body-header",Ne="e-drillthrough-body-header-common",Ee="e-drillthrough-body-header-value",Fe="e-frame",Le="e-check",Ae="e-stop",Re="e-ok-btn",ke="e-cancel-btn",je="e-pivot-error-dialog",qe="e-droppable",He="e-rows",Ve="e-columns",Ue="e-values",Be="e-filters",Ge="e-grouping-bar",ze="e-group-all-fields",We="e-group-rows",Qe="e-group-columns",Ye="e-group-values",Ke="e-group-filters",Xe="e-drag-restrict",Je="e-list-selected",Ze="e-title-header",$e="e-text-content",et="e-field-list-btn",tt="e-calculated-field-btn",it="e-small",at="e-round",rt="e-add-icon",nt="e-list-text",st="e-selected-node",ot="e-selected-option-icon",lt="e-selected-level-icon",dt="e-between-text-div",ht="e-filter-input-div-2",pt="e-value-options",ut="e-filter-operator",ct="e-filter-sort",gt="e-sort-ascend-icon",mt="e-sort-descend-icon",St="e-active",ft="e-collapse",vt="e-expand",u="e-table",yt="e-columnsheader",bt="e-rowsheader",Ct="e-headercell",xt="e-cellvalue",wt="e-tooltipheader",Tt="e-tooltipcontent",Mt="e-nextspan",Dt="e-lastspan",Ot="e-editor-search-container",Pt="e-editor-search",Nt="e-select-all",Et="e-pivot-calc-check",It="e-pivot-calc-input",Ft="e-custom-format-input",Lt="e-olap-calc-hierarchy-list-div",At="e-pivot-calc-format-type-div",Rt="e-olap-calc-member-type-div",kt="e-member-options",jt="e-format",qt="e-pivot-formula",Ht="e-pivot-treeview",Vt="e-pivot-treeview-outer",Ut="e-treeContainer",_t="e-pivot-ok-button",Bt="e-pivot-button-div",Gt="e-axis",zt="e-axis-filter",Wt="e-grid",Qt="e-pivotview",Yt="e-pivot-all-field-title",b="e-disabled",Kt="e-menu-hide",Xt="e-member-prompt",Jt="e-edit",Zt="e-edited",$t="e-empty-field",ei="e-format-condition-button",ti="e-format-table",ii="e-input",ai="e-visible-hide",ri="e-format-color-picker",ni="e-dlg-header",si="e-virtualtrack",oi="e-movablescrolldiv",li="e-content-virtualtable",di="e-movablescroll",hi="e-headercontent",pi="e-cellselectionbackground",ui="e-selectionbackground",ci="e-checkbox-wrapper",gi="e-headercontent",mi="e-field-list-back-icon",Si="e-rowcell",fi="e-active",vi="e-spanclicked",yi="e-rowselect",bi="e-gridheader",Ci="e-gridcontent",xi="e-pivotview-pdf-export",wi="e-pivotview-excel-export",Ti="e-pivotview-csv-export",Mi="e-remove-report",Di="e-pivot-toolbar",Oi="e-pivotview-report-input",Pi="e-toolbar-grid",Ni="e-toolbar-chart",Ei="e-pivotchart",Ii="e-group-chart-rows",Fi="e-group-chart-columns",Li="e-group-chart-values",Ai="e-group-chart-values-drodown-div",Ri="e-group-chart-columns-dropdown-div",ki="e-chart-grouping-bar",ji="e-pivotview-disable-icon",r="e-pivotview-select-icon",qi="e-pivot-grouping-bar",Hi="e-mdx-query-content",Vi="e-pivotchart-inner",Ui="e-group-pivot-rows",_i="e-pivot-toolbar-menu",Bi="e-pivot-pager",Gi="e-pagercontainer",zi="e-page-size-disable",Wi="e-node-limit",Qi="e-leftfreeze",Yi="e-pivot-content-loader",Ki="e-hide-loader",Xi="e-icon-collapsible",Ji="e-icon-expandable",Zi="e-pivotview-autofit",$i="e-group-row",ea="e-freezeleftborder",Ie=(n.getType=function(e){var t=new Date(e),t="boolean"==typeof e?"boolean":isNaN(Number(e))?t instanceof Date&&!isNaN(t.valueOf())?t&&t.getDay()&&(0<t.getHours()||0<t.getMinutes()||0<t.getSeconds()||0<t.getMilliseconds())?"datetime":"date":typeof e:"number";return t},n.resetTime=function(e){return e.setHours(0,0,0,0),e},n.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),s=0,o={};s<n.length;)o[n[s]]=r[n[s]],s++;t.push(o)}return t},n.getClonedCSVData=function(e){return e.map(function(e){return e.slice()})},n.getDefinedObj=function(e){var t=0,i={};if(null!=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},n.inArray=function(e,t){if(t)for(var i=0,a=t.length;i<a;i++)if(t[i]===e)return i;return-1},n.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)},n.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:_e.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)})},n.getClonedFieldList=function(e,t){for(var i=Object.keys(e),a={},r=0,n=i.length;r<n;r++){var s=e[i[r]];e[i[r]]&&(a[i[r]]={type:s.type,caption:s.caption,id:s.id,isSelected:s.isSelected,sort:s.sort,filterType:s.filterType,index:s.index,filter:t?[]:s.filter,isCustomField:s.isCustomField,showRemoveIcon:s.showRemoveIcon,showFilterIcon:s.showFilterIcon,showSortIcon:s.showSortIcon,showNoDataItems:s.showNoDataItems,isCalculatedField:s.isCalculatedField,showEditIcon:s.showEditIcon,showValueTypeIcon:s.showValueTypeIcon,allowDragAndDrop:s.allowDragAndDrop,showSubTotals:s.showSubTotals,expandAll:s.expandAll,pid:s.pid,aggregateType:s.aggregateType,baseField:s.baseField,baseItem:s.baseItem,dateMember:t?[]:this.cloneDateMembers(s.dateMember),members:t?{}:this.cloneFormatMembers(s.members),formatString:s.formatString,format:s.format,formula:s.formula,isExcelFilter:s.isExcelFilter,membersOrder:s.membersOrder&&s.membersOrder.slice(),isAlphanumeric:s.isAlphanumeric,tag:s.tag,expanded:s.expanded,spriteCssClass:s.spriteCssClass,name:s.name,defaultHierarchy:s.defaultHierarchy,hasAllMember:s.hasAllMember,allMember:s.allMember,isChecked:s.isChecked,filterMembers:this.cloneFieldMembers(s.filterMembers),childMembers:t?[]:this.cloneFieldMembers(s.childMembers),searchMembers:t?[]:this.cloneFieldMembers(s.searchMembers),htmlAttributes:this.getDefinedObj(s.htmlAttributes),currrentMembers:t?{}:this.cloneFormatMembers(s.currrentMembers),isHierarchy:s.isHierarchy,isNamedSets:s.isNamedSets,actualFilter:s.actualFilter&&s.actualFilter.slice(),levels:t?[]:this.cloneFieldMembers(s.levels),levelCount:s.levelCount,fieldType:s.fieldType,memberType:s.memberType,parentHierarchy:s.parentHierarchy})}return a},n.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},n.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(),isDrilled:n.isDrilled,ordinal:n.ordinal}}return i}return e},n.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},n.updateDataSourceSettings=function(e,t){e&&this.setPivotProperties(e,{dataSourceSettings:this.getDefinedObj({type:t.type,catalog:t.catalog,cube:t.cube,providerType:t.providerType,url:t.url,localeIdentifier:t.localeIdentifier,excludeFields:_e.isNullOrUndefined(t.excludeFields)?[]:t.excludeFields,expandAll:t.expandAll,allowLabelFilter:t.allowLabelFilter,allowValueFilter:t.allowValueFilter,allowMemberFilter:t.allowMemberFilter,enableSorting:!!t.enableSorting,rows:t.rows,columns:t.columns,filters:t.filters,values:t.values,filterSettings:t.filterSettings,sortSettings:t.sortSettings,drilledMembers:t.drilledMembers,valueSortSettings:t.valueSortSettings,valueAxis:t.valueAxis,grandTotalsPosition:t.grandTotalsPosition,formatSettings:t.formatSettings,calculatedFieldSettings:t.calculatedFieldSettings,fieldMapping:t.fieldMapping,showSubTotals:t.showSubTotals,showRowSubTotals:t.showRowSubTotals,showColumnSubTotals:t.showColumnSubTotals,subTotalsPosition:t.subTotalsPosition,showGrandTotals:t.showGrandTotals,showRowGrandTotals:t.showRowGrandTotals,showColumnGrandTotals:t.showColumnGrandTotals,showHeaderWhenEmpty:t.showHeaderWhenEmpty,alwaysShowValueHeader:t.alwaysShowValueHeader,conditionalFormatSettings:t.conditionalFormatSettings,emptyCellsTextContent:t.emptyCellsTextContent,groupSettings:t.groupSettings,showAggregationOnValueField:t.showAggregationOnValueField,authentication:this.CloneAuthenticationObject(t.authentication)})})},n.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},n.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,formula:r.formula,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},n.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(),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},n.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()}))}return t}return e},n.getFormattedHeader=function(e,t){var i,a,r=n.frameHeaderWithKeys(e);return r.valueSort&&r.valueSort.axis&&(i=r.valueSort.axis,a=this.isDateField(i,t),r.formattedText=(a||!t.formatFields[i]||!0===e.isSum?r:t.getFormattedValue(r.actualText,i)).formattedText),r},n.getFormattedMembers=function(e,t,i){var a=this.isDateField(t,i);if(a||i.groupingFields[t]){for(var r={},n=Object.keys(e),s=i.fieldList[t].dateMember,o=0,l=n.length;o<l;o++){var d=e[n[o]];a?r[d.caption]=d:r[s[d.ordinal-1].actualText]=d}return r}return e},n.isDateField=function(e,t){return t.formatFields[e]&&-1<["date","dateTime","time"].indexOf(t.formatFields[e].type)},n.formatChartHeaders=function(e,t,i,a){for(var r=[],n=0,s=e.length;n<s;n++){var o=i?0<t.parent.dataSourceSettings.columns.length&&!_e.isNullOrUndefined(t.parent.dataSourceSettings.columns[n])?t.parent.dataSourceSettings.columns[n].name:void 0:0<t.parent.dataSourceSettings.rows.length&&!_e.isNullOrUndefined(t.parent.dataSourceSettings.rows[n])?t.parent.dataSourceSettings.rows[n].name:void 0;_e.isNullOrUndefined(o)?a&&a.isGrandSum?r.push(t.parent.localeObj.getConstant("grandTotal")):r.push(e[n]):t.engineModule.formatFields[o]&&-1<["date","dateTime","time"].indexOf(t.engineModule.formatFields[o].type)?r.push(e[n]):r.push(t.engineModule.getFormattedValue(e[n],o).formattedText)}return r.join(" - ")},n.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()}))}return t}return e},n.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},n.CloneValueSortObject=function(e){return e&&{columnIndex:e.columnIndex,headerDelimiter:e.headerDelimiter,headerText:e.headerText,measure:e.measure,sortOrder:e.sortOrder,columnHeaderText:e.columnHeaderText,rowHeaderText:e.rowHeaderText,rowSortOrder:e.rowSortOrder,columnSortOrder:e.columnSortOrder}},n.CloneAuthenticationObject=function(e){return e&&{userName:e.userName,password:e.password}},n.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},n.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},value1:r.value1,value2:r.value2}))}return t}return e},n.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},n.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()}))}return t}return e},n.getFilterItemByName=function(e,t){t=new ce.DataManager({json:t}).executeLocal((new ce.Query).where("name","equal",e));if(t&&0<t.length)return t[t.length-1]},n.getFieldByName=function(e,t){return new ce.DataManager({json:t}).executeLocal((new ce.Query).where("name","equal",e))[0]},n.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 s=0,o=a[r]?a[r].length:0;s<o;s++)if(a[r][s]&&a[r][s].name===e)return{fieldName:e,fieldItem:a[r][s],axis:0===r?"rows":1===r?"columns":2===r?"values":"filters",position:s};i=("olap"===t.dataType?t.olapEngineModule:t.engineModule).fieldList[e];return{fieldName:e,fieldItem:i?{name:e,caption:i.caption,baseField:i.baseField,baseItem:i.baseItem,isCalculatedField:i.isCalculatedField,isNamedSet:i.isNamedSets,showNoDataItems:i.showNoDataItems,showSubTotals:i.showSubTotals,type:i.aggregateType,showFilterIcon:i.showFilterIcon,showSortIcon:i.showSortIcon,showRemoveIcon:i.showRemoveIcon,showValueTypeIcon:i.showValueTypeIcon,showEditIcon:i.showEditIcon,allowDragAndDrop:i.allowDragAndDrop,expandAll:i.expandAll}:void 0,axis:"fieldlist",position:-1}},n.isButtonIconRefesh=function(e,t,i){var a=!1;try{if("dataSourceSettings"===e&&t.dataSourceSettings&&i.dataSourceSettings){var r=["notAvail","notAvail","notAvail","notAvail"],n=Object.keys(t.dataSourceSettings),s=Object.keys(i.dataSourceSettings);if(n&&s&&0<s.length&&n.length===s.length)for(var o=["rows","columns","values","filters"],l=0;l<s.length;l++){var d=s[l]in t.dataSourceSettings&&!_e.isNullOrUndefined(t.dataSourceSettings[s[l]])?Object.keys(t.dataSourceSettings[s[l]]):[],h=s[l]in i.dataSourceSettings&&!_e.isNullOrUndefined(i.dataSourceSettings[s[l]])?Object.keys(i.dataSourceSettings[s[l]]):[];if(-1!==o.indexOf(s[l])&&-1!==o.indexOf(n[l])&&d&&h&&0<h.length&&d.length===h.length)for(var p=["showFilterIcon","showSortIcon","showRemoveIcon","showValueTypeIcon","showEditIcon","allowDragAndDrop","expandAll"],u=0;u<h.length;u++){for(var c=Object.keys(t.dataSourceSettings[s[l]][h[u]]),g=Object.keys(i.dataSourceSettings[s[l]][h[u]]),m=0;m<g.length;m++){if(-1===p.indexOf(g[m])||-1===p.indexOf(c[m])){r[l]="break";break}r[l]="update"}if("break"===r[l])break}else r[l]="break";if("break"===r[l])break}for(var S=0,f=0,v=0,y=0,b=r;y<b.length;y++){var C=b[y];"break"===C&&S++,"notAvail"===C&&f++,"update"===C&&v++}a=!(0<S||4===f)&&0===S&&f<4&&0<v}}catch(e){a=!1}return a},n.frameContent=function(e,t,i,a){var r=[];if(0<a.dataSourceSettings.values.length&&!a.engineModule.isEmptyData&&(a.enableValueSorting||!a.engineModule.isEngineUpdated))for(var n=0,s="value"===t?e.length:i,o="value"===t?i:0;o<s;o++)if(e[o]){r[n="header"===t?o:n]={};for(var l=0;l<e[o].length;l++)e[o][l]&&(r[n][l]=e[o][l]);n++}return r},n.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},n.generateUUID=function(){var i=(new Date).getTime(),a=performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random();return 0<i?(t=(i+t)%16|0,i=Math.floor(i/16)):(t=(a+t)%16|0,a=Math.floor(a/16)),("x"===e?t:3&t|8).toString(16)})},n.applyCustomSort=function(e,i,a,t,r){var n,s=[],o=((s=e.IsOrderChanged?e.members:"Ascending"===e.sortOrder||"None"===e.sortOrder||void 0===e.sortOrder?[].concat(e.members):[].concat(e.members).reverse()).length>i.length&&(s=s.filter(function(t){return i.some(function(e){e=r?e.formattedText:"string"===a||"number"===a?e.actualText:e.dateText;return typeof t==typeof e&&e===t})})),[]),l=void 0===a||"string"===a||"number"===a;0<i.length&&"Grand Total"===i[0].actualText&&(n=i[0],i.shift());for(var d=0,h=0;d<i.length;d++){var p=i[d],u=r?p.formattedText:l?p.actualText:!0===a?p.actualText.toString():p.dateText;if(s[h]===u){if(i.splice(h++,0,p),i.splice(++d,1),!(h<s.length)){t||o.splice(--h,0,u);break}d=-1}0<=d&&!t&&(o[d]=u)}if(!t){for(d=o.length;d<i.length;d++){p=i[d],u=r?p.formattedText:l?p.actualText:!0===a?p.actualText.toString():p.dateText;o[d]=u}"Grand Total"===o[o.length-1]&&o.pop(),e.members=o}return n&&i.splice(0,0,n),i},n.applyHeadersSort=function(e,i,t,a){return a?e=e.sort(function(e,t){e=e.actualText,t=t.actualText;return"Grand Total"===e||"Grand Total"===t?0:"Out of Range"===e?1:"Out of Range"===t?-1:isNaN(parseFloat(e))||isNaN(parseFloat(t))?"Ascending"===i?e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"}):t.localeCompare(e,void 0,{numeric:!0,sensitivity:"base"}):"Ascending"===i?parseFloat(e)-parseFloat(t):parseFloat(t)-parseFloat(e)}):"datetime"===t||"date"===t||"time"===t?e="Ascending"===i?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"===i?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===t?e="Ascending"===i?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"===i?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||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:"string"===t?e.sort(function(e,t){return"Ascending"===i?"Grand Total"===e.actualText||"Grand Total"===t.actualText?0:e.actualText.localeCompare(t.actualText,void 0,{sensitivity:"base"}):"Grand Total"===e.actualText||"Grand Total"===t.actualText?0:t.actualText.localeCompare(e.actualText,void 0,{sensitivity:"base"})}):e="Ascending"===i?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"===i?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},n.renderOlapEngine=function(t,e){try{t.olapEngineModule.renderEngine(t.dataSourceSettings,e||t.frameCustomProperties(t.olapEngineModule.fieldListData,t.olapEngineModule.fieldList),t.onHeadersSort?t.getHeaderSortInfo.bind(t):void 0),t.setProperties({dataSourceSettings:{valueIndex:t.olapEngineModule.measureIndex}},!0)}catch(e){t.actionObj.actionName="engineFormation",t.olapEngineModule.errorInfo?(t.actionFailureMethod(t.olapEngineModule.errorInfo),t.olapEngineModule.errorInfo=void 0):t.actionFailureMethod(e)}},n.frameHeaderWithKeys=function(e){for(var t=Object.keys(e),i=0,a={};i<t.length;)a[t[i]]=e[t[i]],i++;return a},n.getPageSize=function(e){switch(e){case"Letter":return new U.SizeF(612,792);case"Note":return new U.SizeF(540,720);case"Legal":return new U.SizeF(612,1008);case"A0":return new U.SizeF(2380,3368);case"A1":return new U.SizeF(1684,2380);case"A2":return new U.SizeF(1190,1684);case"A3":return new U.SizeF(842,1190);case"A5":return new U.SizeF(421,595);case"A6":return new U.SizeF(297,421);case"A7":return new U.SizeF(210,297);case"A8":return new U.SizeF(148,210);case"A9":return new U.SizeF(105,148);case"B0":return new U.SizeF(2836,4008);case"B1":return new U.SizeF(2004,2836);case"B2":return new U.SizeF(1418,2004);case"B3":return new U.SizeF(1002,1418);case"B4":return new U.SizeF(709,1002);case"B5":return new U.SizeF(501,709);case"Archa":return new U.SizeF(648,864);case"Archb":return new U.SizeF(864,1296);case"Archc":return new U.SizeF(1296,1728);case"Archd":return new U.SizeF(1728,2592);case"Arche":return new U.SizeF(2592,3456);case"Flsa":return new U.SizeF(612,936);case"HalfLetter":return new U.SizeF(396,612);case"Letter11x17":return new U.SizeF(792,1224);case"Ledger":return new U.SizeF(1224,792);default:return new U.SizeF(595,842)}},n.getSortedValue=function(e,i){return e.sort(function(e,t){return"Descending"===i?(t.value||"grand sum"===t.header.type?t.value:0)-(e.value||"grand sum"===e.header.type?e.value:0):(e.value||"grand sum"===e.header.type?e.value:0)-(t.value||"grand sum"===t.header.type?t.value:0)}),e.map(function(e){return e.header})},n.toggleFieldListIconVisibility=function(e){e.showFieldList&&_e.select("#"+e.element.id+"_PivotFieldList",e.element)&&(e.toolbar&&-1!==e.toolbar.indexOf("FieldList")?_e.select("#"+e.element.id+"_PivotFieldList",e.element).style.display="none":(_e.select("#"+e.element.id+"_PivotFieldList",e.element).style.top=e.element.querySelector("."+Di).offsetHeight.toString()+"px",_e.select("#"+e.element.id+"_PivotFieldList",e.element).style.position="relative")),e.toolbar&&-1!==e.toolbar.indexOf("FieldList")&&e.showToolbar&&e.element.querySelector("."+X)&&(e.element.querySelector("."+X).style.display="none")},n.isMemberDrilled=function(e,t,i){for(var a=!1,r=0;r<i.length;r++)for(var n=i[r].items,s=0;s<n.length&&!a;s++)for(var o=n[s].split(i[r].delimiter),l=e.formattedText.split(" "),d=[],h=0;h<l.length;h++)if(d.push(l[h]),d.join(" ")===o[o.length-1])for(var p=0;p<t.length&&o[p];p++){if(o[p]!==t[p]||o[0]!==t[0]){a=!1;break}a=!0}return a},n);function n(){}var ta=function(){return(ta=Object.assign||function(e){for(var t,i=1,a=arguments.length;i<a;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},ia=(t.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.lastMember={},this.slicedHeaders=[],this.fieldFilterMem={},this.filterPosObj={},this.selectedHeaders={selectedHeader:[],values:[]},this.rowGrandTotal=null,this.columnGrandTotal=null,this.rawIndexObject={},-1<this.dataSourceSettings.valueIndex&&(this.valueAxisFields={}),this.headerObjectsCollection={},this.fieldDrillCollection={},this.sortMembers={}},t.prototype.renderEngine=function(e,t,i,a){if(this.getValueCellInfo=i,this.getHeaderSortInfo=a,this.customProperties=t,this.fieldList)for(var r=0,n=e.formatSettings;r<n.length;r++)!this.formatFields[n[r].name]&&this.fieldList[n[r].name]&&(this.fieldList[n[r].name].members={},this.fieldList[n[r].name].formattedMembers={},this.fieldList[n[r].name].dateMember=[]);if(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=_e.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,this.globalize=t&&t.globalize?t.globalize:new _e.Internationalization,this.currencyCode=t&&t.currenyCode?t.currenyCode:void 0,this.localeObj=t?t.localeObj:void 0,this.fieldsType=t?t.fieldsType:{},this.clonedReport=t?t.clonedReport&&t.clonedReport.properties?t.clonedReport.properties:t.clonedReport:{},this.enablePaging=t.enablePaging,this.enableVirtualization=t.enableVirtualization,this.enableOptimizedRendering=t.enableOptimizedRendering,this.enableHtmlSanitizer=t.enableHtmlSanitizer,this.isPagingOrVirtualizationEnabled=this.enablePaging||this.enableVirtualization,this.enableSort=e.enableSorting,this.dataSourceSettings.alwaysShowValueHeader=e.alwaysShowValueHeader,this.dataSourceSettings.showHeaderWhenEmpty=!!_e.isNullOrUndefined(e.showHeaderWhenEmpty)||e.showHeaderWhenEmpty,this.dataSourceSettings.showSubTotals=!!_e.isNullOrUndefined(e.showSubTotals)||e.showSubTotals,this.dataSourceSettings.showRowSubTotals=!!_e.isNullOrUndefined(e.showRowSubTotals)||e.showRowSubTotals,this.dataSourceSettings.showColumnSubTotals=!!_e.isNullOrUndefined(e.showColumnSubTotals)||e.showColumnSubTotals,this.dataSourceSettings.showGrandTotals=!!_e.isNullOrUndefined(e.showGrandTotals)||e.showGrandTotals,this.dataSourceSettings.grandTotalsPosition=_e.isNullOrUndefined(e.grandTotalsPosition)?"Bottom":e.grandTotalsPosition,this.dataSourceSettings.showRowGrandTotals=!!_e.isNullOrUndefined(e.showRowGrandTotals)||e.showRowGrandTotals,this.dataSourceSettings.showColumnGrandTotals=!!_e.isNullOrUndefined(e.showColumnGrandTotals)||e.showColumnGrandTotals,this.showSubTotalsAtTop=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&"Top"===e.subTotalsPosition,this.showSubTotalsAtBottom=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals&&"Bottom"===e.subTotalsPosition||t.isTabularLayout,this.allowValueFilter=e.allowValueFilter,this.isValueFilterEnabled=!1,this.enableValueSorting=!!t&&t.enableValueSorting,this.isDrillThrough=t&&t.isDrillThrough||!1,this.valueContent=[],this.dataSourceSettings=Ie.getClonedDataSourceSettings(e),e.dataSource instanceof ce.DataManager||("CSV"===e.type?(this.data=e.dataSource.map(function(e){return e.slice()}),this.fieldList&&this.data.shift()):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]),this.fieldKeys={};for(r=0;r<this.fields.length;r++)this.fieldKeys[this.fields[r]]="CSV"===e.type?r:this.fields[r]}t&&t.pageSettings&&t.allowDataCompression&&(this.actualData=this.data,this.data=this.getGroupedRawData(e)),this.dataSourceSettings.rows=e.rows||[],this.dataSourceSettings.columns=e.columns||[],this.dataSourceSettings.filters=e.filters||[],this.dataSourceSettings.values=e.values||[],this.dataSourceSettings.formatSettings=e.formatSettings||[],this.dataSourceSettings.groupSettings=e.groupSettings||[],this.dataSourceSettings.calculatedFieldSettings=e.calculatedFieldSettings||[],this.enableSort=void 0===e.enableSorting||e.enableSorting,this.dataSourceSettings.fieldMapping=e.fieldMapping||[],this.valueAxisFields={};for(var s=0,o=this.dataSourceSettings.values;s<o.length;s++){var l=o[s];this.valueAxisFields[l.name]=l}i=this.getGroupData(this.data),this.validateFilters(e),this.isExpandAll=!(!this.isValueFiltersAvail||!e.allowValueFilter)||e.expandAll,this.drilledMembers=!e.drilledMembers||this.isValueFiltersAvail&&e.allowValueFilter?[]:e.drilledMembers,this.isMultiMeasures=1<this.dataSourceSettings.values.length,this.valueAxis="row"===e.valueAxis?1:0,this.measureIndex=_e.isNullOrUndefined(e.valueIndex)?-1:e.valueIndex,this.emptyCellTextContent=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||{rowSortOrder:"None",rowHeaderText:"",columnSortOrder:"None",columnHeaderText:"",headerDelimiter:".",columnIndex:void 0,rowIndex:void 0},this.valueSortData=[],this.pageSettings=t?t.pageSettings||this.pageSettings:void 0,this.allowDataCompression=t&&t.allowDataCompression,this.savedFieldList=t?t.savedFieldList:void 0,this.getFieldList(i,this.enableSort,e.allowValueFilter),this.removeIrrelevantFields(Object.keys(this.fieldList)),this.fillFieldMembers(),this.updateSortSettings(e.sortSettings,this.enableSort),this.filterMembers=[];var d=this.dataSourceSettings.columns.length-1;for(this.columnKeys={};-1<d;)this.columnKeys[this.dataSourceSettings.columns[d].name]=this.dataSourceSettings.columns[d],d--;this.updateFilterMembers(e),this.generateGridData(e)}},t.prototype.removeIrrelevantFields=function(e){for(var t={},i=(t[0]=this.dataSourceSettings.rows,t[1]=this.dataSourceSettings.columns,t[2]=this.dataSourceSettings.values,t[3]=this.dataSourceSettings.filters,0);i<4;){if(t[i])for(var a=0;a<t[i].length;a++){var r=t[i][a].name;-1<this.dataSourceSettings.excludeFields.indexOf(r)||!_e.isNullOrUndefined(e)&&-1===e.indexOf(r)?(t[i].splice(a,1),a--):2===i&&(this.measureNames[r]=t[i][a].caption||r,this.measureNames[t[i][a].caption||r]=r)}i++}this.isMultiMeasures=1<this.dataSourceSettings.values.length,this.measureIndex=-1===this.measureIndex?(this.valueAxis?t[0]:t[1]).length:this.measureIndex},t.prototype.updateDataSourceSettings=function(e,t){t&&(this.emptyCellTextContent=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=_e.isNullOrUndefined(e.valueIndex)?-1:e.valueIndex,this.enableSort=e.enableSorting,this.dataSourceSettings.alwaysShowValueHeader=e.alwaysShowValueHeader,this.dataSourceSettings.showHeaderWhenEmpty=!!_e.isNullOrUndefined(e.showHeaderWhenEmpty)||e.showHeaderWhenEmpty,this.dataSourceSettings.showSubTotals=!!_e.isNullOrUndefined(e.showSubTotals)||e.showSubTotals,this.dataSourceSettings.showRowSubTotals=!!_e.isNullOrUndefined(e.showRowSubTotals)||e.showRowSubTotals,this.dataSourceSettings.showColumnSubTotals=!!_e.isNullOrUndefined(e.showColumnSubTotals)||e.showColumnSubTotals,this.dataSourceSettings.showGrandTotals=!!_e.isNullOrUndefined(e.showGrandTotals)||e.showGrandTotals,this.dataSourceSettings.grandTotalsPosition=_e.isNullOrUndefined(e.grandTotalsPosition)?"Bottom":e.grandTotalsPosition,this.dataSourceSettings.showRowGrandTotals=!!_e.isNullOrUndefined(e.showRowGrandTotals)||e.showRowGrandTotals,this.dataSourceSettings.showColumnGrandTotals=!!_e.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||[],this.dataSourceSettings.groupSettings=e.groupSettings||[],this.dataSourceSettings.calculatedFieldSettings=e.calculatedFieldSettings||[],this.enableSort=void 0===e.enableSorting||e.enableSorting,this.dataSourceSettings.fieldMapping=e.fieldMapping||[],this.dataSourceSettings.values=e.values||[],this.dataSourceSettings.rows=e.rows||[],this.dataSourceSettings.columns=e.columns||[],this.dataSourceSettings.filters=e.filters||[],this.dataSourceSettings.filterSettings=e.filterSettings||[],this.dataSourceSettings.sortSettings=e.sortSettings||[],this.dataSourceSettings.conditionalFormatSettings=e.conditionalFormatSettings||[],this.dataSourceSettings.valueSortSettings=e.valueSortSettings||{},this.removeIrrelevantFields(Object.keys(this.fieldList)))},t.prototype.getGroupedRawData=function(e){this.data=[];for(var t=0,i=this.actualData;t<i.length;t++){var a=i[t];this.data[this.data.length]=Ie.frameHeaderWithKeys(a)}for(var r=e.values.filter(function(e){return"Count"===e.type||"DistinctCount"===e.type}).map(function(e){return e.name}),n=0<r.length,s=this.data,o=e.rows.concat(e.columns.concat(e.filters)).map(function(e){return e.name}),l={},d=[],h=(this.groupRawIndex={},{}),p=0,u=0;u<s.length;u++){var c=s[u],g=[];if(n)for(var m=0;m<r.length;m++)c[this.fieldKeys[r[m]]]=_e.isNullOrUndefined(c[this.fieldKeys[r[m]]])?c[this.fieldKeys[r[m]]]:1;for(var S=0;S<o.length;S++)g.push(c[this.fieldKeys[o[S]]]);var f=g.join("-");if(l[f]){for(m=0;m<e.values.length;m++){var v=e.values[m].name,y=c[this.fieldKeys[v]],b=l[f],C=e.values[m].type;_e.isNullOrUndefined(y)||("number"==typeof y&&"DistinctCount"!==C||(C="Count"),_e.isNullOrUndefined(b[v])?b[v]="Product"===C?1:"Min"===C||"Max"===C?void 0:0:"number"!=typeof b[v]&&(b[v]=1),"Count"===C?b[v]+=1:"Min"===C?_e.isNullOrUndefined(b[v])||(b[v]=b[v]>y?y:b[v]):"Max"===C?_e.isNullOrUndefined(b[v])||(b[v]=b[v]<y?y:b[v]):"Product"===C?b[v]*=y:b[v]+=y)}this.isDrillThrough&&this.groupRawIndex[h[f]].push(u)}else l[f]=c,d.push(c),this.isDrillThrough&&(this.groupRawIndex[p]=[u],h[f]=p,p++)}return d},t.prototype.getGroupData=function(Oe){for(var Pe=this,Ne=Oe[0],Ee=this,e=0,t=this.dataSourceSettings.groupSettings;e<t.length;e++){var i=function(e,k){var t=k[e],i=t.name,a=t.caption;if(!(-1<Ee.fields.indexOf(i)))return e<k.length-1?"continue":{value:Ne};var r={},j=void 0;if("Date"===t.type&&Ee.groupingFields[i]||"Custom"===t.type&&Ee.groupingFields[i])return{value:Ne};if("Number"===t.type){if("number"!==Ie.getType(Ne[i])&&Ee.groupingFields[i])return{value:Ne};t.rangeInterval&&Oe.sort(function(e,t){return Number(e[Pe.fieldKeys[i]])>Number(t[Pe.fieldKeys[i]])?1:Number(t[Pe.fieldKeys[i]])>Number(e[Pe.fieldKeys[i]])?-1:0})}for(var q=Oe.length;q--;){var n=Oe[q];if(n[Ee.fieldKeys[i]]&&"Date"===t.type){var s=new Date(n[Ee.fieldKeys[i]].toString());if(!_e.isNullOrUndefined(s)&&0<t.groupInterval.length)for(var o=0,H=t.groupInterval.length;o<H;o++){var l=t.groupInterval[o],d=Ee.getRange(t,s.getTime()),h=Ie.resetTime(new Date);switch(l){case"Years":r[p=o===t.groupInterval.length-1?i:i+"_date_group_years"]=l,Ee.fieldKeys[p]="CSV"===Ee.dataSourceSettings.type?Ee.fieldKeys[p]||Ee.fields.length:p,-1===Ee.fields.indexOf(p)&&Ee.fields.push(p),n[Ee.fieldKeys[p]]=d?void 0:new Date(h.setFullYear(s.getFullYear())).toString();break;case"Quarters":r[p=o===t.groupInterval.length-1?i:i+"_date_group_quarters"]=l;var V=Math.ceil((s.getMonth()+1)/3);Ee.fieldKeys[p]="CSV"===Ee.dataSourceSettings.type?Ee.fieldKeys[p]||Ee.fields.length:p,-1===Ee.fields.indexOf(p)&&Ee.fields.push(p),n[Ee.fieldKeys[p]]=d?void 0:(Ee.localeObj?Ee.localeObj.getConstant("qtr"):"Qtr")+V.toString();break;case"QuarterYear":V=(r[p=o===t.groupInterval.length-1?i:i+"_date_group_quarterYear"]=l,Math.ceil((s.getMonth()+1)/3));Ee.fieldKeys[p]="CSV"===Ee.dataSourceSettings.type?Ee.fieldKeys[p]||Ee.fields.length:p,-1===Ee.fields.indexOf(p)&&Ee.fields.push(p),n[Ee.fieldKeys[p]]=d?void 0:(Ee.localeObj?Ee.localeObj.getConstant("qtr"):"Qtr")+V.toString()+" "+(Ee.localeObj?Ee.localeObj.getConstant("of"):"of")+" "+s.getFullYear().toString();break;case"Months":r[p=o===t.groupInterval.length-1?i:i+"_date_group_months"]=l,Ee.fieldKeys[p]="CSV"===Ee.dataSourceSettings.type?Ee.fieldKeys[p]||Ee.fields.length:p,-1===Ee.fields.indexOf(p)&&Ee.fields.push(p),n[Ee.fieldKeys[p]]=d?void 0:new Date(h.setMonth(s.getMonth(),1)).toString();break;case"Days":r[p=o===t.groupInterval.length-1?i:i+"_date_group_days"]=l,Ee.fieldKeys[p]="CSV"===Ee.dataSourceSettings.type?Ee.fieldKeys[p]||Ee.fields.length:p,-1===Ee.fields.indexOf(p)&&Ee.fields.push(p),n[Ee.fieldKeys[p]]=d?void 0:new Date(h.setMonth(s.getMonth(),s.getDate())).toString();break;case"Hours":r[p=o===t.groupInterval.length-1?i:i+"_date_group_hours"]=l,Ee.fieldKeys[p]="CSV"===Ee.dataSourceSettings.type?Ee.fieldKeys[p]||Ee.fields.length:p,-1===Ee.fields.indexOf(p)&&Ee.fields.push(p),n[Ee.fieldKeys[p]]=d?void 0:new Date(h.setHours(s.getHours())).toString();break;case"Minutes":r[p=o===t.groupInterval.length-1?i:i+"_date_group_minutes"]=l,Ee.fieldKeys[p]="CSV"===Ee.dataSourceSettings.type?Ee.fieldKeys[p]||Ee.fields.length:p,-1===Ee.fields.indexOf(p)&&Ee.fields.push(p),n[Ee.fieldKeys[p]]=d?void 0:new Date(h.setMinutes(s.getMinutes())).toString();break;case"Seconds":r[p=o===t.groupInterval.length-1?i:i+"_date_group_seconds"]=l,Ee.fieldKeys[p]="CSV"===Ee.dataSourceSettings.type?Ee.fieldKeys[p]||Ee.fields.length:p,-1===Ee.fields.indexOf(p)&&Ee.fields.push(p),n[Ee.fieldKeys[p]]=d?void 0:new Date(h.setSeconds(s.getSeconds())).toString()}}}else if(isNaN(Number(n[Ee.fieldKeys[i]]))||"Number"!==t.type){if(n[Ee.fieldKeys[i]]&&"Custom"===t.type&&t.customGroups&&0<t.customGroups.length){var p=i+"_custom_group",U=t.customGroups,_=void 0;Ee.groupingFieldsInfo[i]=i,Ee.groupingFieldsInfo[p]=i;for(var B=0,G=U.length;B<G;B++){var z,u=U[B];u.items&&1<u.items.length&&(Ee.fieldKeys[j=p]="CSV"===Ee.dataSourceSettings.type?Ee.fieldKeys[p]||Ee.fields.length:p,-1===Ee.fields.indexOf(p)&&Ee.fields.push(p),z=-1!==Ie.inArray(n[Ee.fieldKeys[i]].toString(),u.items),n[Ee.fieldKeys[p]]=z?u.groupName&&""!==u.groupName?u.groupName:Ee.localeObj.getConstant("group")+" "+B:_&&_!==n[Ee.fieldKeys[i]].toString()?_:n[Ee.fieldKeys[i]].toString(),_=n[Ee.fieldKeys[p]])}}}else{d=Ee.getRange(t,Number(n[Ee.fieldKeys[i]]));n[Ee.fieldKeys[i]]=d?void 0:n[Ee.fieldKeys[i]]}for(var W=[],Q=0,Y=ce=Object.keys(n);Q<Y.length;Q++){var K=Y[Q];W.push(!!n[K])}Ne=-1===W.indexOf(!1)&&ce.length===Object.keys(Oe[0]).length?n:Ne}if("Date"===t.type){for(var c=!1,X=[Ee.dataSourceSettings.rows,Ee.dataSourceSettings.columns,Ee.dataSourceSettings.values,Ee.dataSourceSettings.filters],g=Object.keys(r),m=Object.keys(g).length,S=void 0,J=0,Z=X;J<Z.length;J++){var f=Z[J];if(!c&&f){for(var $,v,ee,y=f.length,b=0;b<y;){if(f[b].name===i){c=!0;var C=f[b];for(f.splice(b,1),F=(F=Ee.dataSourceSettings.rows).concat(Ee.dataSourceSettings.columns,Ee.dataSourceSettings.values,Ee.dataSourceSettings.filters);m--;){var x,w=C.caption||C.name;Ee.clonedReport&&(x=(x=Ee.clonedReport.rows).concat(Ee.clonedReport.columns,Ee.clonedReport.values,Ee.clonedReport.filters),x=Ie.getFieldByName(g[m],x))&&(w=x.caption||x.name),Ie.getFieldByName(g[m],F)?Ee.groupingFieldsInfo[g[m]]=i:(S=r[g[m]],w=-1!==w.indexOf(" (")&&-1!==w.indexOf(")")?w.slice(w.indexOf("(")+1,w.length-1):w,R={name:g[m],caption:(Ee.localeObj?Ee.localeObj.getConstant(S):S)+" ("+w+")",type:"Count",showNoDataItems:C.showNoDataItems,baseField:C.baseField,baseItem:C.baseItem,showFilterIcon:C.showFilterIcon,showSortIcon:C.showSortIcon,showEditIcon:C.showEditIcon,showRemoveIcon:C.showRemoveIcon,showSubTotals:C.showValueTypeIcon,allowDragAndDrop:C.allowDragAndDrop,expandAll:C.expandAll,groupName:C.groupName},f.splice(b,0,R),Ee.groupingFieldsInfo[R.name]=i)}break}-1<f[b].name.indexOf(i)&&($=r[f[b].name],v=f.filter(function(e){return e.name===i})[0],_e.isNullOrUndefined(v)||(ee=v.caption?-1!==v.caption.indexOf(" (")&&-1!==v.caption.indexOf(")")?v.caption.slice(v.caption.indexOf("(")+1,v.caption.length-1):v.caption:i,f[b].caption=(Ee.localeObj?Ee.localeObj.getConstant($):v)+" ("+ee+")")),b++}if(c)break}}for(var m=Object.keys(g).length,te=(ve=Ee.getMappingField(i,(Ee.clonedReport||Ee.dataSourceSettings).fieldMapping)).caption||i;m--;){S=r[g[m]];for(var ie,T,ae=0,re=Ee.dataSourceSettings.formatSettings.length;ae<re;ae++)if(Ee.dataSourceSettings.formatSettings[ae].name===g[m]){Ee.dataSourceSettings.formatSettings.splice(ae,1);break}"Quarters"!==S&&"QuarterYear"!==S&&(ie={name:g[m],type:-1<["Years","Months","Days"].indexOf(S)?"date":"time",format:"Years"===S?"yyyy":"Months"===S?"MMM":"Days"===S?"d-MMM":"Hours"===S?"hh a":"Minutes"===S?":mm":"Seconds"===S?":ss":void 0},Ee.dataSourceSettings.formatSettings.push(ie)),c||(T=Ee.getMappingField(g[m],Ee.dataSourceSettings.fieldMapping),g[m]!==i&&_e.isNullOrUndefined(T.name)?(R={name:g[m],caption:(Ee.localeObj?Ee.localeObj.getConstant(S):S)+" ("+te+")"},Ee.dataSourceSettings.fieldMapping.push(R),Ee.groupingFieldsInfo[R.name]=i):g[m]!==i&&(T.caption=(Ee.localeObj?Ee.localeObj.getConstant(S):S)+" ("+te+")",Ee.groupingFieldsInfo[T.name]=i))}c||(T=Ee.getMappingField(i,Ee.dataSourceSettings.fieldMapping),S=r[i],g[m]!==i&&_e.isNullOrUndefined(T.name)?(R={name:i,caption:(Ee.localeObj?Ee.localeObj.getConstant(S):S)+" ("+te+")"},Ee.dataSourceSettings.fieldMapping.push(R),Ee.groupingFieldsInfo[R.name]=i):(T.caption=(Ee.localeObj?Ee.localeObj.getConstant(S):S)+" ("+te+")",Ee.groupingFieldsInfo[T.name]=i))}else if("Number"===t.type&&t.rangeInterval){for(var ne=[],se=[],oe=Oe.length,y=0,M=(Ee.groupingFields[i]=i,[]);y<oe;){var le=Number(Oe[y][i]);se.push(le),isNaN(le)||-1!==ne.indexOf(le)||ne.push(le),y++}for(oe=Oe.length,y=0;y<oe;){var D=Oe[y];if(D&&!isNaN(Number(D[i]))){var de=("string"==typeof t.endingAt?parseInt(t.endingAt,10):t.endingAt)||Math.max.apply(Math,ne),O=Number.isInteger(t.rangeInterval)?0:Ee.countDecimalPlaces(t.rangeInterval),P=void 0;switch(O){case 10:P=1e-10;break;case 9:P=1e-9;break;case 8:P=1e-8;break;case 7:P=1e-7;break;case 6:P=1e-6;break;case 5:P=1e-5;break;case 4:P=1e-4;break;case 3:P=.001;break;case 2:P=.01;break;case 1:P=.1;break;default:P=1}var N=Number.isInteger(t.rangeInterval)?Math.floor(Number(D[i])):Number(D[i].toFixed(O)),he=Number.isInteger(t.rangeInterval)?Math.floor(Number(N+(t.rangeInterval-1))):Number((N+t.rangeInterval).toFixed(O));if(N>=M[0]&&N<=M[M.length-1]){var E=M[0],I=Number.isInteger(t.rangeInterval)?Math.floor(M[M.length-1]):Number(M[M.length-1].toFixed(O));Ee.processGrouping(D,i,E,I,de,t.rangeInterval,O),_e.isNullOrUndefined(Ee.groupedDataType[i])&&(Ee.groupedDataType[i]="string")}else if(0===M.length){for(var pe=N;pe<=he;pe=Number((pe+P).toFixed(O)))M.push(pe);E=M[0],I=Number.isInteger(t.rangeInterval)?Math.floor(M[M.length-1]):Number(M[M.length-1].toFixed(O));Ee.processGrouping(D,i,E,I,de,t.rangeInterval,O),_e.isNullOrUndefined(Ee.groupedDataType[i])&&(Ee.groupedDataType[i]="string")}else{var E=Number.isInteger(t.rangeInterval)?Math.floor(M[M.length-1])+1:Number(M[M.length-1].toFixed(O)),I=Number.isInteger(t.rangeInterval)?Math.floor(E+(t.rangeInterval-1)):Number((E+t.rangeInterval).toFixed(O)),ue=!0;for(M.splice(0,M.length);ue;)E<=N&&N<=I&&(Ee.processGrouping(D,i,E,I,de,t.rangeInterval,O),_e.isNullOrUndefined(Ee.groupedDataType[i])&&(Ee.groupedDataType[i]="string"),M.push(E),M.push(I),ue=!1),E=Number.isInteger(t.rangeInterval)?I+1:I,I=Number.isInteger(t.rangeInterval)?Math.floor(E+(t.rangeInterval-1)):Number((E+t.rangeInterval).toFixed(O))}for(var ce,W=[],ge=0,me=ce=Object.keys(D);ge<me.length;ge++){K=me[ge];W.push(!!D[K])}Ne=-1===W.indexOf(!1)&&ce.length===Object.keys(Oe[0]).length?D:Ne}y++}for(var Se=0,fe=X=[Ee.dataSourceSettings.rows,Ee.dataSourceSettings.columns,Ee.dataSourceSettings.values,Ee.dataSourceSettings.filters];Se<fe.length;Se++){var ve,ye=fe[Se];(ve=Ie.getFieldByName(i,ye))&&((ve=ve.properties||ve).type="Count")}for(var be=0,Ce=Ee.dataSourceSettings.formatSettings.length;be<Ce;be++)if(Ee.dataSourceSettings.formatSettings[be].name===i){Ee.dataSourceSettings.formatSettings.splice(be,1);break}}else if("Custom"===t.type&&j){for(var F,xe=j,c=!1,X=[Ee.dataSourceSettings.rows,Ee.dataSourceSettings.columns,Ee.dataSourceSettings.values,Ee.dataSourceSettings.filters],we=(F=(F=Ee.dataSourceSettings.rows).concat(Ee.dataSourceSettings.columns,Ee.dataSourceSettings.values,Ee.dataSourceSettings.filters),[]),Te=(a&&""!==a||(we=xe.match(/_custom_group/g)),Ie.getFieldByName(i.replace(/_custom_group/g,""),F)),L=Ie.getFieldByName(xe,F),Me=0,De=X;Me<De.length;Me++){f=De[Me];if(!c&&f){for(var y=f.length,A=0;A<y;){if(f[A].name===t.name&&!L){c=!0;var C=f[A],R={name:xe,caption:a&&""!==a?a:(Te.caption||Te.name)+(we.length+1),type:"Count",showNoDataItems:C.showNoDataItems,baseField:C.baseField,baseItem:C.baseItem,showSubTotals:C.showValueTypeIcon,allowDragAndDrop:C.allowDragAndDrop,showFilterIcon:C.showFilterIcon,showSortIcon:C.showSortIcon,showRemoveIcon:C.showRemoveIcon,showEditIcon:C.showEditIcon,expandAll:C.expandAll,groupName:C.groupName};f.splice(A,0,R),Ee.groupingFieldsInfo[R.name]=i,Ee.groupingFieldsInfo[i]=i;break}if(f[A].name===xe&&L){R={name:L.name,caption:a&&""!==a?a:L.caption,type:L.type,showNoDataItems:L.showNoDataItems,baseField:L.baseField,baseItem:L.baseItem,showRemoveIcon:L.showRemoveIcon,showSubTotals:L.showValueTypeIcon,allowDragAndDrop:L.allowDragAndDrop,showFilterIcon:L.showFilterIcon,showSortIcon:L.showSortIcon,showEditIcon:L.showEditIcon,expandAll:L.expandAll,groupName:L.groupName};f.splice(A,1,R),Ee.groupingFieldsInfo[R.name]=i,Ee.groupingFieldsInfo[i]=i;break}A++}if(c)break}}e=Ie.getFieldByName(i,Ie.cloneFormatSettings(Ee.dataSourceSettings.formatSettings));e&&(e.name=xe,Ee.dataSourceSettings.formatSettings.push(e)),Ee.groupingFields[i]=i}Ee.groupingFields=_e.extend(Ee.groupingFields,r)}(e,t);if("object"==typeof i)return i.value}return Ne},t.prototype.countDecimalPlaces=function(e){e=e.toString();return e.includes(".")?e.split(".")[1].length:0},t.prototype.processGrouping=function(e,t,i,a,r,n,s){Number.isInteger(e[t])||!Number.isInteger(e[t])&&(Number(e[t])<a||r<=Number(e[t]))?e[t]=this.getNumberGroupHeaders(i,a,r):!Number.isInteger(e[t])&&Number(e[t])>=a&&(e[t]=this.getNumberGroupHeaders(Number((i+n).toFixed(s)),Number((a+n).toFixed(s)),r))},t.prototype.getNumberGroupHeaders=function(e,t,i){return e===t?e.toString():e<=i&&i<=t?i===e?e.toString():e.toString()+"-"+i.toString():e.toString()+"-"+t.toString()},t.prototype.getRange=function(e,t){var i,a,r;return"Date"===e.type?(r=new Date(t),a="string"==typeof e.startingAt?new Date(e.startingAt):e.startingAt,i="string"==typeof e.endingAt?new Date(e.endingAt):e.endingAt,!!(a&&r.getTime()<a.getTime()||i&&r.getTime()>i.getTime())):(a="string"==typeof e.startingAt?parseFloat(e.startingAt):e.startingAt,r="string"==typeof e.endingAt?parseFloat(e.endingAt):e.endingAt,!isNaN(a)&&t<a||!isNaN(r)&&r<t)},t.prototype.getPercentFormat=function(e,t){e=_e.isNullOrUndefined(e[t])||_e.isNullOrUndefined(this.formatFields[t].format)?void 0:this.formatFields[t].format.toLowerCase().match(/p[0-9]/);return _e.isNullOrUndefined(e)?2:Number(this.formatFields[t].format.replace(/[^0-9]/g,""))},t.prototype.getFormattedFields=function(e){this.formatFields=this.setFormattedFields(e.formatSettings)},t.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},t.prototype.getFieldList=function(i,a,e){for(var r,n=this,t=this.dataSourceSettings.excludeFields.length-1;-1<t;){var s=this.fields.indexOf(this.dataSourceSettings.excludeFields[t]);-1!==s&&this.fields.splice(s,1),this.fieldList&&delete this.fieldList[this.dataSourceSettings.excludeFields[t]],t--}var o=this.fields,l=(l=_e.extend([],this.dataSourceSettings.rows,null,!0)).concat(this.dataSourceSettings.columns,this.dataSourceSettings.values,this.dataSourceSettings.filters);this.getFormattedFields(this.dataSourceSettings),this.getCalculatedField(o);var d=(o=this.fields).length,h=["string","number","datetime","date","boolean"];if(this.savedFieldList)for(this.fieldList=this.savedFieldList;d--;){var p=o[d],u=this.getMappingField(p,this.dataSourceSettings.fieldMapping);this.fieldList[p]?(this.fieldList[p].isSelected=!1,this.fieldList[p].index=d,this.fieldList[p].filter=[],this.fieldList[p].sort=a?"Ascending":"None",this.fieldList[p].isExcelFilter=!1,this.fieldList[p].filterType="",this.fieldList[p].showFilterIcon=!(u&&"showFilterIcon"in u)||u.showFilterIcon,this.fieldList[p].showRemoveIcon=!(u&&"showRemoveIcon"in u)||u.showRemoveIcon,this.fieldList[p].showSortIcon=!(u&&"showSortIcon"in u)||u.showSortIcon,this.fieldList[p].showEditIcon=!(u&&"showEditIcon"in u)||u.showEditIcon,this.fieldList[p].showValueTypeIcon=!(u&&"showValueTypeIcon"in u)||u.showValueTypeIcon,this.fieldList[p].allowDragAndDrop=!(u&&"allowDragAndDrop"in u)||u.allowDragAndDrop,this.fieldList[p].isCalculatedField=!!(u&&"isCalculatedField"in u)&&u.isCalculatedField,this.fieldList[p].showNoDataItems=!!(u&&"showNoDataItems"in u)&&u.showNoDataItems,this.fieldList[p].showSubTotals=!(u&&"showSubTotals"in u)||u.showSubTotals,this.fieldList[p].expandAll=!!(u&&"expandAll"in u)&&u.expandAll,this.fieldList[p].pid=u&&"groupName"in u&&u.groupName?u.groupName:this.groupingFieldsInfo[p]||void 0,this.isValueFiltersAvail&&e&&(this.fieldList[p].dateMember=[],this.fieldList[p].members={},this.fieldList[p].isMembersFilled=!1)):(r=_e.isNullOrUndefined(this.groupedDataType[p])?u&&"dataType"in u&&u.dataType&&-1<h.indexOf(u.dataType.toLowerCase())?u.dataType.toLowerCase():r:this.groupedDataType[p],this.fieldList[p]={caption:u&&"caption"in u&&u.caption?u.caption:p,id:p,type:-1!==p.indexOf("_custom_group")||-1!==p.indexOf("_date_group")?"string":void 0===r||"undefined"===r?"number":r,isSelected:!1,sort:a?"Ascending":"None",filterType:"",index:d,filter:[],isCustomField:-1!==p.indexOf("_custom_group")||-1!==p.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[p]||void 0,aggregateType:u&&"type"in u?u.type:"number"===(-1!==p.indexOf("_custom_group")||-1!==p.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(p)}else{this.fieldList={};for(var c=this;d--;)!function(){var t=o[d],e=c.getMappingField(t,c.dataSourceSettings.fieldMapping);void 0!==(r=_e.isNullOrUndefined(c.groupedDataType[t])?e&&"dataType"in e&&e.dataType&&-1<h.indexOf(e.dataType.toLowerCase())?e.dataType.toLowerCase():Ie.getType(i[c.fieldKeys[t]]):c.groupedDataType[t])&&"undefined"!==r||(0<c.dataSourceSettings.groupSettings.length?c.dataSourceSettings.groupSettings.forEach(function(e){r=n.fieldKeys[t]===e.name&&"number"===e.type.toLocaleLowerCase()?"string":"number"}):r="number"),c.fieldList[t]={id:t,pid:e&&"groupName"in e&&e.groupName?e.groupName:c.groupingFieldsInfo[t]||void 0,caption:e&&"caption"in e&&e.caption?e.caption:t,type:-1!==t.indexOf("_custom_group")||-1!==t.indexOf("_date_group")?"string":r,filterType:"",index:d,filter:[],sort:a?"Ascending":"None",isSelected:!1,isCustomField:-1!==t.indexOf("_custom_group")||-1!==t.indexOf("_date_group"),showFilterIcon:!(e&&"showFilterIcon"in e)||e.showFilterIcon,showRemoveIcon:!(e&&"showRemoveIcon"in e)||e.showRemoveIcon,showSortIcon:!(e&&"showSortIcon"in e)||e.showSortIcon,showEditIcon:!(e&&"showEditIcon"in e)||e.showEditIcon,showValueTypeIcon:!(e&&"showValueTypeIcon"in e)||e.showValueTypeIcon,allowDragAndDrop:!(e&&"allowDragAndDrop"in e)||e.allowDragAndDrop,showSubTotals:!(e&&"showSubTotals"in e)||e.showSubTotals,showNoDataItems:!!(e&&"showNoDataItems"in e)&&e.showNoDataItems,isCalculatedField:!!(e&&"isCalculatedField"in e)&&e.isCalculatedField,expandAll:!!(e&&"expandAll"in e)&&e.expandAll,aggregateType:e&&"type"in e?e.type:"number"===(-1!==t.indexOf("_custom_group")||-1!==t.indexOf("_date_group")?"string":void 0===r||"undefined"===r?"number":r)?"Sum":"Count",baseField:e&&"baseField"in e?e.baseField:void 0,baseItem:e&&"baseItem"in e?e.baseItem:void 0},c.updateMembersOrder(t)}()}this.groupedDataType={},this.updateTreeViewData(l)},t.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}}},t.prototype.getMappingField=function(e,t){var i={};if(t&&0<t.length)for(var a=0,r=t.length;a<r;a++)if(t[a].name===e){i=t[a];break}return i},t.prototype.updateFieldList=function(e){for(var t=this.fields,i=t.length;i--;)this.fieldList[t[i]].isExcelFilter=e[t[i]].isExcelFilter},t.prototype.updateTreeViewData=function(e){for(var t,r=this,i=e.length,a=this.dataSourceSettings.calculatedFieldSettings.length;i--;)this.fieldList[e[i].name]&&((t=this.fieldList[e[i].name]).type=e[i].dataType?e[i].dataType.toLowerCase():t.type,t.caption=e[i].caption||e[i].name,t.isSelected=!0,t.showNoDataItems=e[i].showNoDataItems,t.aggregateType=e[i].type,t.baseField=e[i].baseField,t.baseItem=e[i].baseItem,t.allowDragAndDrop=e[i].allowDragAndDrop,t.showFilterIcon=e[i].showFilterIcon,t.showSortIcon=e[i].showSortIcon,t.showRemoveIcon=e[i].showRemoveIcon,t.showValueTypeIcon=e[i].showValueTypeIcon,t.showEditIcon=e[i].showEditIcon,t.showSubTotals=e[i].showSubTotals,t.expandAll=e[i].expandAll);for(;a--;)this.fieldList[this.dataSourceSettings.calculatedFieldSettings[a].name]&&(this.fieldList[this.dataSourceSettings.calculatedFieldSettings[a].name].aggregateType="CalculatedField",this.fieldList[this.dataSourceSettings.calculatedFieldSettings[a].name].isCalculatedField=!0,this.fieldList[this.dataSourceSettings.calculatedFieldSettings[a].name].formula=this.dataSourceSettings.calculatedFieldSettings[a].formula);var n=this.dataSourceSettings.groupSettings.filter(function(t){return!e.some(function(e){return t.name===e.name})}),s=["_date_group_years","_date_group_quarters","_date_group_quarterYear","_date_group_months","_date_group_days","_date_group_hours","_date_group_minutes","_date_group_seconds"];n.forEach(function(e){var i=e.name,a=e.type.toLowerCase();Object.keys(r.fieldList).forEach(function(t){"date"!==a||_e.isNullOrUndefined(e.caption)||!s.some(function(e){return t===""+i+e})&&t!==i?("custom"===a&&!_e.isNullOrUndefined(e.caption)&&t===i+"_custom_group"||"number"===a&&!_e.isNullOrUndefined(e.caption)&&t===i)&&(r.fieldList[t].caption=e.caption):r.fieldList[t].caption=r.fieldList[t].caption.replace(e.name,e.caption)})})},t.prototype.getCalculatedField=function(p){for(var e=0,t=this.dataSourceSettings.calculatedFieldSettings;e<t.length;e++){var i=t[e];this.calculatedFields[i.name]=_e.extend({},i,null,!0),this.calculatedFields[i.name].actualFormula=i.formula}for(var u=Object.keys(this.calculatedFields),c=this,a=0,r=u.length;a<r;a++)!function(e){for(var t=c.calculatedFields[u[e]],e=t.properties,i=(e||t).formula.trim(),a=i.replace(/"/g,""),r=(t.formula=-1<a.indexOf("^")?c.powerFunction(a):a,-1===t.formula.indexOf("Math.min(")&&-1<t.formula.indexOf("min(")&&(t.formula=t.formula.replace(/min\(/g,"Math.min(")),-1===t.formula.indexOf("Math.max(")&&-1<t.formula.indexOf("max(")&&(t.formula=t.formula.replace(/max\(/g,"Math.max(")),-1===t.formula.indexOf("Math.abs(")&&-1<t.formula.indexOf("abs(")&&(t.formula=t.formula.replace(/abs\(/g,"Math.abs(")),t.name=(e||t).name,"CSV"===c.dataSourceSettings.type?-1===p.indexOf(t.name)&&p.push(t.name):(p=p.filter(function(e){return e!==t.name})).push(t.name),i.split('"')),n=0,s=r.length;n<s;n++){var o=r[n].trim(),l=o.split(/[ .:;?!~,`"&|()<>{}[\]\r\n/\\]+/),d=o.match(/^([^()]+)\((.*)\)$/),h="DistinctCount"===l[0]?"DistinctCount":"PopulationStDev"===l[0]?"PopulationStDev":"SampleStDev"===l[0]?"SampleStDev":"PopulationVar"===l[0]?"PopulationVar":"SampleVar"===l[0]?"SampleVar":l[0];-1!==["Sum","Count","Min","Max","Avg","Product","DistinctCount","PopulationStDev","SampleStDev","PopulationVar","SampleVar","Median"].indexOf(h)&&(d=-1===p.indexOf(l[1])&&d[2]?p.indexOf(d[2]):p.indexOf(l[1]),c.calculatedFormulas[t.name]?c.calculatedFormulas[t.name].push({index:d,type:h,formula:o}):c.calculatedFormulas[t.name]=[{index:d,type:h,formula:o}])}}(a);this.fields=p},t.prototype.validateFilters=function(e){this.isValueFiltersAvail=!1;for(var e=e.filterSettings||[],t=(t=_e.extend([],this.dataSourceSettings.rows,null,!0)).concat(this.dataSourceSettings.columns),i=0,a=e;i<a.length;i++){for(var r=a[i],n=0,s=t;n<s.length;n++){var o=s[n];if(r.name===o.name&&"Value"===r.type){this.isValueFiltersAvail=!0;break}}if(this.isValueFiltersAvail)break}},t.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}}},t.prototype.fetchFieldMembers=function(e){e=this.fieldList[e].index;this.generateMembers(e,new Set)},t.prototype.generateMembers=function(e,t){var i=this.data.length,a=this.fields,r=this.fieldList,n=a[e],s=(r[n].members&&!this.allowDataCompression||(r[n].members={},this.allowDataCompression&&(r[n].isMembersFilled=!1)),r[n].dateMember&&!this.allowDataCompression||(r[n].dateMember=[]),r[n].members),o=r[n].dateMember;if((r[n].isSelected||t.has(e))&&!r[n].isMembersFilled){for(var l=0<Object.keys(s).length,d=0,h=r[n].expandAll,p=Ie.isDateField(n,this),u=0;u<i;u++){var c=this.data[u][this.fieldKeys[n]],g=c,g=this.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(g):g,m=(l||(m=p?this.getFormattedValue(g,n):{formattedText:null===g?this.localeObj?this.localeObj.getConstant("null"):String(g):void 0===g?this.localeObj?n in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(g):g.toString(),actualText:null===g?this.localeObj?this.localeObj.getConstant("null"):String(g):void 0===g?this.localeObj?n in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(g):g},Object.prototype.hasOwnProperty.call(s,g)?s[g].index.push(u):(d++,s[g]={index:[u],ordinal:d,isDrilled:this.isExpandAll||h,caption:m.formattedText},o.push({formattedText:m.formattedText,actualText:p?m.dateText:m.actualText}))),_e.isNullOrUndefined(c)?c:"number"===r[n].type?isNaN(Number(c))?void 0:Number(c):1),c={ordinal:s[g].ordinal,member:m};this.valueMatrix[u]||(this.valueMatrix[u]=[]),this.valueMatrix[u][e]=c}r[n].isMembersFilled=!0}},t.prototype.fillFieldMembers=function(){var e=this.fields,t=this.fieldList,i=e.length,a=(this.data.length-this.valueMatrix.length<0&&(this.valueMatrix=this.valueMatrix.slice(0,this.data.length)),new Set);if(this.calculatedFormulas&&0<Object.keys(this.calculatedFormulas).length)for(var r in this.calculatedFormulas)if(t[r]&&t[r].isSelected)for(var n=this.calculatedFormulas[r],s=0;s<n.length;s++){var o=n[s];a.add(o.index)}for(var l=0;l<i;l++)this.generateMembers(l,a)},t.prototype.generateValueMatrix=function(){for(var e=this.fields,t=this.data.length,i=e.length,a=this.fieldList;t--;)for(var r=i;r--;){var n=e[r],s=a[n];s.isMembersFilled&&(n=this.data[t][this.fieldKeys[n]],this.valueMatrix[t][r].member=_e.isNullOrUndefined(n)?n:"number"===s.type?isNaN(Number(n))?void 0:Number(n):1)}},t.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)},t.prototype.updateFilterMembers=function(e){var t=this.filterMembers,i={},e=this.getFilters(e,i),a=this.valueMatrix.length;if(e)for(var r=i.include.index,n=0;n<r.length;n++)void 0!==i.exclude&&void 0!==i.exclude.indexObject[r[n]]||t.push(r[n]);else for(n=0;n<a;n++)void 0!==i.exclude&&void 0!==i.exclude.indexObject[n]||t.push(n)},t.prototype.getFilters=function(e,t){for(var i=e.filterSettings||[],a=!1,r=[],n=0,s=i.length;n<s;n++){var o=i[n].properties||i[n];this.fieldList[o.name]&&this.fieldList[o.name].isSelected&&this.isValidFilterField(o,e.allowMemberFilter,e.allowLabelFilter)&&(this.applyLabelFilter(o),o&&(r=o.items),o.type&&"Include"===o.type?(this.frameFilterList(r,o.name,t,"include",o.showLabelFilter,a),a=!0):this.frameFilterList(r,o.name,t,"exclude",o.showLabelFilter),o.showLabelFilter)&&(o.items=[],o.type=o.showDateFilter?"Date":o.showNumberFilter?"Number":"Label")}return a},t.prototype.isValidFilterField=function(e,t,i){var a=e.name,r=!1,n=(n=_e.extend([],this.dataSourceSettings.rows,null,!0)).concat(this.dataSourceSettings.columns);if(this.fieldList[a].isSelected&&t&&0<=["Include","Exclude"].indexOf(e.type)){for(var r=!0,s=0,o=this.dataSourceSettings.values;s<o.length;s++)if(a===o[s].name){r=!1;break}}else if(i)for(var l=0,d=n;l<d.length;l++)if(a===d[l].name&&0<=["Label","Date","Number"].indexOf(e.type)){r=!0;break}return r},t.prototype.applyLabelFilter=function(e){if(0<=["Label","Date","Number"].indexOf(e.type)){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 s=n[r],o=this.getParsedValue(e.name,e.value1),l=this.getParsedValue(e.name,e.value2),d=this.getParsedValue(e.name,s);this.validateFilterValue(d,e.condition,o,l)&&e.items.push(s)}}e.type=!e.condition||-1<["DoesNotBeginWith","DoesNotContains","DoesNotEndsWith","DoesNotEquals","NotBetween"].indexOf(e.condition)&&!e.showNumberFilter?"Exclude":"Include"}else e.showLabelFilter=!1},t.prototype.getLabelFilterMembers=function(e,t,i,a){for(var r=[],n=0,s=e;n<s.length;n++){var o=s[n],l=o.toLowerCase();if(i.toString())switch(t){case"Equals":case"DoesNotEquals":l===i.toLowerCase()&&r.push(o);break;case"BeginWith":case"DoesNotBeginWith":0===l.indexOf(i.toLowerCase())&&r.push(o);break;case"EndsWith":case"DoesNotEndsWith":null!==l.match(i.toLowerCase()+"$")&&r.push(o);break;case"Contains":case"DoesNotContains":-1<l.indexOf(i.toLowerCase())&&r.push(o);break;case"GreaterThan":l>i.toLowerCase()&&r.push(o);break;case"GreaterThanOrEqualTo":l>=i.toLowerCase()&&r.push(o);break;case"LessThan":l<i.toLowerCase()&&r.push(o);break;case"LessThanOrEqualTo":l<=i.toLowerCase()&&r.push(o);break;case"Between":case"NotBetween":l>=i.toLowerCase()&&l<=a.toLowerCase()&&r.push(o);break;default:l===i.toLowerCase()&&r.push(o)}}return r},t.prototype.getDateFilterMembers=function(e,t,i,a,r){for(var n=[],s=0,o=e;s<o.length;s++){var l=o[s],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},t.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":i<e&&(r=!0);break;case"GreaterThanOrEqualTo":i<=e&&(r=!0);break;case"LessThan":e<i&&(r=!0);break;case"LessThanOrEqualTo":e<=i&&(r=!0);break;case"Between":i<=e&&e<=a&&(r=!0);break;case"NotBetween":i<=e&&e<=a||(r=!0);break;default:e!==i&&(r=!0)}return r},t.prototype.frameFilterList=function(e,t,i,a,r,n){i[a]||(i[a]={indexObject:{},index:[]}),this.updateFilter(e,t,i,a,r,n)},t.prototype.updateFilter=function(e,t,i,a,r,n){var s=0,o=this.fieldList[t],l=(o.filter=e,o.filterType=a,o.isExcelFilter=r,Ie.getFormattedMembers(o.members,t,this)),d=n,h={},p={};for(h[a]={indexObject:{},index:[]},this.fieldFilterMem[t]={memberObj:{}};!_e.isNullOrUndefined(e[s]);){if(l[e[s]]){var u=l[e[s]].index;if("include"===a)for(var c=0,g=u.length;c<g;c++)d&&void 0===i[a].indexObject[u[c]]||(h[a].indexObject[u[c]]=u[c],h[a].index.push(u[c]));else{for(c=0,g=u.length;c<g;c++)void 0===i[a].indexObject[u[c]]&&(i[a].indexObject[u[c]]=u[c],i[a].index.push(u[c]));this.fieldFilterMem[t].memberObj[e[s]]=e[s]}}s++}if("include"===a){i[a]=h[a];for(c=0;c<e.length;c++)l[e[c]]&&(p[e[c]]=e[c]);for(var m=Object.keys(l),c=0,g=m.length;c<g;c++)void 0===p[m[c]]&&(this.fieldFilterMem[t].memberObj[m[c]]=m[c])}},t.prototype.applyValueFiltering=function(e,t,i,a,r,n,s){this.isValueFiltered=!1;var o=_e.extend({},"row"===s&&this.rowGrandTotal?this.rowGrandTotal:"column"===s&&this.columnGrandTotal?this.columnGrandTotal:"Top"!==this.dataSourceSettings.grandTotalsPosition?i[i.length-1]:i[0],null,!0);return this.getFilteredData(i,a,r,n,t,e.name,o,s),this.isValueFiltered&&(("row"===s&&null===this.rowGrandTotal||"column"===s&&null===this.columnGrandTotal)&&n.push(o),i=n),i},t.prototype.getFilteredData=function(e,t,i,a,r,n,s,o){for(var l,d,h,p,u=e.length,c=0;c<u;c++)i[n]&&(e[c].level===r?(this.isValueFiltered=!0,this.fieldList[n].isExcelFilter=!0,l=0,p=i[n].measure,h=this.fieldList[p].index,d=this.fieldList[p].aggregateType,this.rawIndexObject={},l="row"===o?this.getAggregateValue(e[c].index,t.indexObject,h,d,!1):this.getAggregateValue(t.index,e[c].indexObject,h,d,!1),h={fieldName:p,row:e[c],column:t,value:l,cellSets:this.getValueCellInfo?this.getCellSet(this.rawIndexObject):[],rowCellType:e[c].hasChild&&e[c].isDrilled?"subTotal":"grand sum"===e[c].type?"grandTotal":"value",columnCellType:t.hasChild&&t.isDrilled?"subTotal":"grand sum"===t.type?"grandTotal":"value",aggregateType:d,skipFormatting:!1},this.getValueCellInfo&&this.getValueCellInfo(h),l=h.value,this.rawIndexObject={},d=this.getParsedValue(p,i[n].value1),h=this.getParsedValue(p,i[n].value2),this.validateFilterValue(l,i[n].condition,d,h)||"grand sum"===e[c].type?"grand sum"!==e[c].type&&(a.push(_e.extend({},e[c],null,!0)),a[a.length-1].isLevelFiltered=!0):(p=this.removefilteredData(e[c],this.valueFilteredData)||e[c],this.validateFilteredParentData(p,this.valueFilteredData,s,0,r,o))):e[c].hasChild&&0<e[c].members.length&&"grand sum"!==e[c].type&&(a.push(_e.extend({},e[c],null,!0)),a[a.length-1].members=[],a[a.length-1].isLevelFiltered=!0,this.getFilteredData(e[c].members,t,i,a[a.length-1].members,r,n,s,o)))},t.prototype.getParsedValue=function(e,t){var i=t?t.toString():"";return this.formatFields[e]&&t?(delete(t=_e.extend({},this.formatFields[e],null,!0)).name,this.globalize.parseNumber(i,t)):this.globalize.parseNumber(i,{format:"N"})},t.prototype.removefilteredData=function(e,t){for(var i,a=_e.extend([],t,null,!0),r=0;r<a.length;r++){if(e.isLevelFiltered&&e.axis===a[r].axis&&e.valueSort.levelName===a[r].valueSort.levelName&&e.actualText===a[r].actualText&&e.axis===a[r].axis&&e.level===a[r].level&&e.ordinal===a[r].ordinal){i=a[r],t.splice(r,1);break}t[r].hasChild&&0<t[r].members.length&&this.removefilteredData(e,t[r].members)}return i},t.prototype.validateFilteredParentData=function(e,t,i,a,r,n){if(0<t.length)for(var s=0,o=t;s<o.length;s++){var l=o[s];if(l.level===a){if("row"===n)for(var d=0,h=u=e.index;d<h.length;d++){var p=h[d];0<=i.index.indexOf(p)&&i.index.splice(i.index.indexOf(p),1),0<=e.valueSort.levelName.toString().indexOf(l.valueSort.levelName.toString())&&l.level!==r&&0<=l.index.indexOf(p)&&l.index.splice(l.index.indexOf(p),1)}else for(var u=e.indexObject,c=0,g=Object.keys(u);c<g.length;c++){p=g[c];Object.prototype.hasOwnProperty.call(u,p)&&(delete i.indexObject[p],0<=e.valueSort.levelName.toString().indexOf(l.valueSort.levelName.toString()))&&l.level!==r&&delete l.indexObject[p]}l&&0<l.members.length&&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 m=0,S=u=e.index;m<S.length;m++){p=S[m];0<=i.index.indexOf(p)&&i.index.splice(i.index.indexOf(p),1)}else for(var u=e.indexObject,f=0,v=Object.keys(u);f<v.length;f++){p=v[f];Object.prototype.hasOwnProperty.call(u,p)&&delete i.indexObject[p]}},t.prototype.updateFramedHeaders=function(e,t,i,a,r){for(var n=0,s=e;n<s.length;n++){var o=s[n];this.isHeaderAvail=!1,(this.validateFilteredHeaders(o,i,r)||"grand sum"===o.type)&&("row"===r?this.rowCount+=this.rowValuesLength:this.columnCount+=this.customProperties.isTabularLayout?this.rowMaxLevel+this.colValuesLength:this.colValuesLength,a.push(_e.extend({},o,null,!0)),a[a.length-1].members=[],o.hasChild)&&o.isDrilled&&0<o.members.length&&this.updateFramedHeaders(o.members,t,i,a[a.length-1].members,r)}return this.filterFramedHeaders},t.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?0<n.index.length?(this.isHeaderAvail=!0,e.index=n.index,!0):(this.isHeaderAvail=!1,e.index=n.index,!1):0<Object.keys(n.indexObject).length?(this.isHeaderAvail=!0,e.indexObject=n.indexObject,!0):(this.isHeaderAvail=!1,e.indexObject=n.indexObject,!1);n.hasChild&&0<n.members.length&&"grand sum"!==n.type&&this.validateFilteredHeaders(e,n.members,i)}}return this.isHeaderAvail},t.prototype.isEmptyDataAvail=function(e,t){this.isEmptyData=!1,0<e.length&&"grand sum"===e[e.length-1].type&&0===e[e.length-1].index.length&&(this.isEmptyData=!0),0<t.length&&"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)},t.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},t.prototype.generateGridData=function(e,t,i,a,r){void 0===t&&(t=!1),void 0===r&&(r=!1),_e.isNullOrUndefined(a)&&this.customProperties.isTabularLayout&&(this.rowMaxLevel=0),this.updateDataSourceSettings(e,t);var n=e.columns||[],s=this.data,o=e.rows||[],l=e.filterSettings,d=e.values||[],h=(this.removeCount=0,this.isExpandAll=e.expandAll,this.drilledMembers=e.drilledMembers||[],this.isEmptyData=!1,[]);if(o[0]&&o[0].showNoDataItems||n[0]&&n[0].showNoDataItems)for(var p=0;p<this.valueMatrix.length;p++)h.push(p);for(p=0;p<this.filterMembers.length;p++)this.filterPosObj[this.filterMembers[p]]=this.filterMembers[p];this.valueSortSettings.columnIndex=void 0,this.validateValueFields(),this.frameDrillObject(),this.isValueFilterEnabled&&!this.isEditing||a||(this.isLastHeaderHasMeasures=!0,this.columnCount=0,this.rowCount=0,this.cMembers=[],this.rMembers=[],0!==o.length&&0!==d.length&&(this.rMembers=this.getIndexedHeaders(o,s,this.customProperties.isTabularLayout?this.rowMaxLevel:0,o[0].showNoDataItems?h:this.filterMembers,"row","",this.allowValueFilter)),0!==n.length&&0!==d.length&&(this.cMembers=this.getIndexedHeaders(n,s,0,n[0].showNoDataItems?h:this.filterMembers,"column","",this.allowValueFilter)),this.insertAllMembersCommon(),this.saveDataHeaders=this.isValueFiltersAvail&&e.allowValueFilter?{rowHeaders:_e.extend([],this.rMembers,null,!0),columnHeaders:_e.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=[],S=[],f=this.dataSourceSettings.values.length;if(this.isValueFiltersAvail&&e.allowValueFilter&&!a){this.valueFilteredData=[];var v=this.saveDataHeaders.rowHeaders||[],y=this.saveDataHeaders.columnHeaders||[];if(0<l.length){for(var b={},C={},x=0,w=d;x<w.length;x++){var T=w[x];C[T.name]=T}for(var M=0,D=l;M<D.length;M++){var O=D[M],v=0<g.length?g:v,y=0<m.length?m:y,P=(this.valueFilteredData=[],O.properties||O);if("Value"===P.type&&this.fieldList[O.name]&&this.fieldList[O.name].isSelected){b[O.name]=O;for(var N=!(P.items=[]),E=o.length,I=n.length,F=0;F<E;F++)if(P.name===o[F].name&&C[P.measure]&&!N){N=!0,g=this.applyValueFiltering(o[F],F,v,this.columnGrandTotal||("Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals?y[0]:y[y.length-1]),b,this.valueFilteredData,"row");break}for(var L=0;L<I;L++)if(P.name===n[L].name&&C[P.measure]&&!N){N=!0,m=this.applyValueFiltering(n[L],L,y,this.rowGrandTotal||("Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals?v[0]:v[v.length-1]),b,this.valueFilteredData,"column");break}}}}g=0<g.length?g:v,m=0<m.length?m:y,this.isEmptyDataAvail(g,m);var l=Ie.getClonedFieldList(this.fieldList),A=this.data[0];this.getFieldList(A,this.enableSort,e.allowValueFilter),this.fillFieldMembers(),this.updateSortSettings(e.sortSettings,this.enableSort),this.filterMembers=[],this.updateFilterMembers(e),this.isLastHeaderHasMeasures=!0,this.rMembers=0!==o.length?this.getIndexedHeaders(o,s,0,o[0].showNoDataItems?h:this.filterMembers,"row",""):[],this.cMembers=0!==n.length?this.getIndexedHeaders(n,s,0,n[0].showNoDataItems?h:this.filterMembers,"column",""):[],this.insertAllMembersCommon(),this.updateFieldList(l),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}a||this.applyValueSorting(),this.isPagingOrVirtualizationEnabled&&(a?(this.rMembers=a.rowHeaders,this.cMembers=a.columnHeaders,this.rowCount=a.rowHeadersCount,this.columnCount=a.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(o,n,this.rMembers,this.cMembers,d),this.getHeaderData(o,n,d,S,this.cMembers,c,this.pivotValues,0,this.valueAxis?1:f),this.insertSubTotals(),this.getTableData(0<S.length?S:this.rMembers,u,c,0,this.pivotValues,f,0,this.rowGrandTotal||this.rMembers[this.rMembers.length-1],this.columnGrandTotal||this.cMembers[this.cMembers.length-1]),this.applyAdvancedAggregate(u,c,this.pivotValues),this.customProperties.isTabularLayout&&(this.pivotValues=this.getTabularPivotValues(t,!1,r),this.setRowSpan()),this.isEngineUpdated=!0,this.isEmptyDataAvail(this.rMembers,this.cMembers),this.clearProperties(i)},t.prototype.updateHeaders=function(e,t){e=_e.isNullOrUndefined(e)?!((!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showRowGrandTotals)&&0<this.dataSourceSettings.rows.length):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)),t=_e.isNullOrUndefined(t)?!((!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showColumnGrandTotals)&&0<this.dataSourceSettings.columns.length):t,(this.pageSettings&&this.removeColumnGrandTotal||!t&&!this.columnGrandTotal)&&"grand sum"===this.cMembers[this.cMembers.length-1].type&&(this.cMembers=this.cMembers.slice(0,this.cMembers.length-1))},t.prototype.updatePivotValues=function(e){var t=!((!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showRowGrandTotals)&&0<this.dataSourceSettings.rows.length),i=!((!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showColumnGrandTotals)&&0<this.dataSourceSettings.columns.length);if(e&&this.updateHeaders(t,i),(this.pageSettings&&this.removeRowGrandTotal||!t&&!this.rowGrandTotal)&&0<this.valueContent.length&&(a=1,this.valueAxis&&0<this.dataSourceSettings.values.length&&(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)),(this.pageSettings&&this.removeColumnGrandTotal||!i&&!this.columnGrandTotal)&&0<this.headerContent.length){var a=this.dataSourceSettings.values.length;if(this.valueAxis&&0<this.dataSourceSettings.values.length&&(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},t.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()},t.prototype.onSort=function(e,t){t&&this.updateDataSourceSettings(t,!0);t=this.getHeadersInfo(e.name,"");this.fieldList[e.name].sort=e.order,this.performSortOperation(t.headers,e,t,0),this.updateEngine()},t.prototype.onFilter=function(e,t){this.updateDataSourceSettings(t,!0);for(var i=this.getHeadersInfo(e.name,""),a=(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),{}),r=0,n=this.filterMembers;r<n.length;r++){var s=n[r];a[s]=s}this.filterMembers=[],this.fieldFilterMem={},this.updateFilterMembers(t);for(var o=this.filterMembers.filter(function(e){return void 0===a[e]}),l=0,d=e.items;l<d.length;l++)d[l];t=this.dataSourceSettings.rows[0]&&this.dataSourceSettings.rows[0].showNoDataItems||this.dataSourceSettings.columns[0]&&this.dataSourceSettings.columns[0].showNoDataItems;if(t&&this.columnKeys[e.name]?t=!(!this.dataSourceSettings.columns[0]||!this.dataSourceSettings.columns[0].showNoDataItems):t&&"row"===i.axis&&(t=!(!this.dataSourceSettings.rows[0]||!this.dataSourceSettings.rows[0].showNoDataItems)),t){var h=[];this.filterPosObj={};for(var p=0;p<o.length;p++)this.filterPosObj[o[p]]=o[p];for(p=0;p<this.valueMatrix.length;p++)h.push(p);o=h}this.performFilterCommonUpdate(e,i,o),i="column"===i.axis?this.getHeadersInfo("","row"):this.getHeadersInfo("","column"),this.performFilterCommonUpdate(e,i,o),this.frameHeaderObjectsCollection=!1,this.headerObjectsCollection={},this.updateEngine()},t.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()},t.prototype.onCalcOperation=function(e,t){this.dataSourceSettings.calculatedFieldSettings=t.calculatedFieldSettings||[],this.dataSourceSettings.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()},t.prototype.performDrillOperation=function(e,t,i,a,r){for(var n=0;n<e.length;){if(a===r){var s,o=e[n].valueSort.levelName.split(this.valueSortSettings.headerDelimiter);if(t.memberName===o.join(t.delimiter||"**")){"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||"**").join(this.valueSortSettings.headerDelimiter)),o=void 0,"row"===t.axis?(o=this.applyValueSorting(e[n].members,this.cMembers),e[n].members=o.rMembers,this.customProperties.isTabularLayout||(this.rowCount+=this.showSubTotalsAtBottom?1:0)):(s=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&i[a].showSubTotals,this.columnCount-=s?0:this.colValuesLength,o=this.applyValueSorting(this.rMembers,e[n].members),e[n].members=o.cMembers)):(e[n].isDrilled=!1,this.updateHeadersCount(e[n].members,t.axis,a,i,"minus",!0),e[n].members=[],"row"!==t.axis||this.customProperties.isTabularLayout||(this.rowCount-=this.showSubTotalsAtBottom?1:0));break}}else 0<e[n].members.length&&(e[n].members=this.performDrillOperation(e[n].members,t,i,a,r+1));n++}return e},t.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}0<e[r].members.length&&(e[r].members=this.performSortOperation(e[r].members,t,i,a+1)),r++}return e},t.prototype.performFilterDeletion=function(e,i,a,r,n){for(var s=0,o=!0,l=this;s<e.length&&o;)!function(){var t;a.position===n?(t=l,e=e.filter(function(e){return""!==t.fieldFilterMem[i.name].memberObj[e.formattedText]&&(!t.fieldFilterMem[i.name].memberObj[e.formattedText]||"grand sum"===e.type)}),o=!1):0<e[s].members.length&&(e[s].members=l.performFilterDeletion(e[s].members,i,a,r,n+1)),s++}();var t=this;return e.filter(function(e){return 0<e.members.length||"grand sum"===e.type||t.matchIndexes(e.indexObject,r)})},t.prototype.matchIndexes=function(e,t){var i=Object.keys(e),a=i.length;if(0===a)return!0;for(;-1<a;){if(void 0!==t[e[i[a]]])return!0;a--}return!1},t.prototype.performFilterAddition=function(s,o,l){for(var d=0,h=this;d<s.length;)!function(){var e=s[d].valueSort.levelName;if(h.headerObjectsCollection[e]){for(var t={},i=0,a=s[d].members;i<a.length;i++){var r=a[i];t[r.valueSort.levelName.toString()]=r.valueSort.levelName.toString()}var n=h.headerObjectsCollection[e].filter(function(e){return!t[e.valueSort.levelName.toString()]});s[d].members=s[d].members.concat(n),s[d].members=h.getSortedHeaders(s[d].members,h.fieldList[l.fields[s[d].members[0].level].name].sort),delete h.headerObjectsCollection[e]}0<s[d].members.length&&(s[d].members=h.performFilterAddition(s[d].members,o,l)),d++}();return s},t.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,s=this.filterMembers;n<s.length;n++){var o=s[n];r[o]=o}if(this.fieldFilterMem[e.name]&&(a=this.performFilterDeletion(t.headers,e,t,r,0)),0<i.length&&0<t.fields.length){if(this.frameHeaderObjectsCollection=!0,0<t.fields.filter(function(e){return e.showNoDataItems}).length)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 a=this.performFilterAddition(a,t.fields,t),d={},h=0,p=a;h<p.length;h++){var u=p[h];d[u.valueSort.levelName.toString()]=u.valueSort.levelName.toString()}var e=this.headerObjectsCollection.parent.filter(function(e){return!d[e.valueSort.levelName.toString()]}),c=a.filter(function(e){return"grand sum"===e.type});0<c.length&&a.pop(),a=this.getSortedHeaders(a.concat(e),this.fieldList[t.fields[0].name].sort).concat(c),"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?(0<t.position&&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):(0<t.position&&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{e=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,e?i:this.filterMembers,"row",""),this.cMembers=this.getIndexedHeaders(this.dataSourceSettings.columns,this.data,0,e?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),e&&(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()},t.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,s=a;n<s.length&&s[n].name!==e;n++)r++;return{axis:t,fields:a,headers:i,position:r}},t.prototype.updateEngine=function(){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(0<i.length?i:this.rMembers,e,t,0,this.pivotValues,a,0,this.rowGrandTotal||this.rMembers[this.rMembers.length-1],this.columnGrandTotal||this.cMembers[this.cMembers.length-1]),this.applyAdvancedAggregate(e,t,this.pivotValues),this.customProperties.isTabularLayout&&(this.pivotValues=this.getTabularPivotValues(!0,!0),this.setRowSpan()),this.isEngineUpdated=!0,this.isEmptyDataAvail(this.rMembers,this.cMembers)},t.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},t.prototype.getFieldByName=function(e,t){return new ce.DataManager({json:t}).executeLocal((new ce.Query).where("name","equal",e))[0]},t.prototype.updateHeadersCount=function(e,t,i,a,r,n){for(var s=0,o=a[i],l=!0,l="column"===t?this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&(!o||o.showSubTotals):this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals&&(!o||o.showSubTotals);s<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),0<e[s].members.length&&(this.updateHeadersCount(e[s].members,t,i+1,a,r,!0),"row"===t)&&(this.rowCount-=this.showSubTotalsAtBottom&&!this.customProperties.isTabularLayout&&e[s].hasChild&&e[s].isDrilled?1:0),s++;"column"===t&&!l&&n&&(this.columnCount+="plus"===r?-this.colValuesLength:this.colValuesLength)},t.prototype.getSortedHeaders=function(e,t){var i=("Grand Total"!==e[0].actualText?e[0]: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&&0<e.length&&"string"==typeof e[0].actualText){for(var n=[],s=[],o=[],l=0;l<e.length;l++)if(isNaN(Number(e[l].actualText.toString().charAt(0))))n.push(e[l]);else{if(""!==e[l].actualText){s.push(e[l]);break}o.push(e[l])}return 0<s.length&&(s=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")},t.prototype.sortHeaders=function(e,t,i,a,r){var n,s=!1,o=this.fieldList[e]&&this.fieldList[e].membersOrder?this.fieldList[e].membersOrder.slice():[],l=(this.sortMembers[e]||(this.sortMembers[e]=Object.keys(t.members)),{fieldName:e,sortOrder:a,members:o&&0<o.length?o:this.sortMembers[e],IsOrderChanged:!1}),d="datetime"===(r="datetime"!==r&&"date"!==r&&"time"!==r||this.formatFields[e]&&-1<["date","dateTime","time"].indexOf(this.formatFields[e].type)?r:"string")||"date"===r||"time"===r,e=!1;if(0<this.dataSourceSettings.groupSettings.length&&(n=this.dataSourceSettings.groupSettings.filter(function(e){return e.name===t.id}),!_e.isNullOrUndefined(n))&&0<n.length&&(e="number"===n[0].type.toLocaleLowerCase()&&"string"===t.type.toLocaleLowerCase()),o&&0<o.length?Ie.applyCustomSort(l,i,r):(Ie.applyHeadersSort(i,a,r,e),s=!0),s&&this.getHeaderSortInfo){for(var h=[],p=0,u=0;p<i.length;p++){var c=i[p],g=d?c.dateText:c.actualText;"Grand Total"!==c.actualText&&(h[u++]=g)}l.members=h}return this.getHeaderSortInfo&&this.getHeaderSortInfo(l),l.IsOrderChanged&&Ie.applyCustomSort(l,i,r,!0),i},t.prototype.applyValueSorting=function(e,t){var i=!1;return this.enableValueSorting&&(this.valueSortSettings.rowHeaderText||this.valueSortSettings.columnHeaderText)&&0<this.dataSourceSettings.values.length&&(void 0!==e&&void 0!==t||(this.rowValueSortHeaderText=void 0,this.columnValueSortHeaderText=void 0,_e.isNullOrUndefined(this.valueSortSettings.rowHeaderText)||""===this.valueSortSettings.rowHeaderText||(this.rowValueSortHeaderText=this.prepareValueSortHeaderText(this.valueSortSettings.rowHeaderText)),_e.isNullOrUndefined(this.valueSortSettings.columnHeaderText)||""===this.valueSortSettings.columnHeaderText||(this.columnValueSortHeaderText=this.prepareValueSortHeaderText(this.valueSortSettings.columnHeaderText)),e=this.rMembers,t=this.cMembers,i=!0),t=this.applySortingForAxis(this.rowValueSortHeaderText,!0,e,t,this.rowGrandTotal),e=this.applySortingForAxis(this.columnValueSortHeaderText,!1,t,e,this.columnGrandTotal),i)&&(this.rMembers=e,this.cMembers=t,this.isPagingOrVirtualizationEnabled)&&(this.headerCollection.rowHeaders=this.rMembers,this.headerCollection.columnHeaders=this.cMembers),{rMembers:e,cMembers:t}},t.prototype.applySortingForAxis=function(e,t,i,a,r){var n,s;return e&&(s=t?this.dataSourceSettings.showRowGrandTotals:this.dataSourceSettings.showColumnGrandTotals,n=t?0<this.dataSourceSettings.rows.length:0<this.dataSourceSettings.columns.length,s=!(!this.dataSourceSettings.showGrandTotals||!s)||!n,n=!0,e.includes(this.localeObj.getConstant("grandTotal"))&&!s&&(i.push(r),n=!1),r=(s=this.getHeaderDetails(e,t)).hText,e=s.mIndex,s=s.mType,(r=this.getMember(i,r))&&(a=this.sortByValueRow(a,r,t?this.valueSortSettings.rowSortOrder:this.valueSortSettings.columnSortOrder,e,s)),n||i.pop()),a},t.prototype.prepareValueSortHeaderText=function(e){for(var t=e.split(this.valueSortSettings.headerDelimiter),i=0,a=this.dataSourceSettings.values;i<a.length;i++){var r=a[i],r=r.caption||r.name,n=t.indexOf(r);if(-1<n){t.splice(n,1),t.push(r),e=t.join(this.valueSortSettings.headerDelimiter);break}}return e},t.prototype.getHeaderDetails=function(e,t){for(var i,a,r,n=e.split(this.valueSortSettings.headerDelimiter),s="",o=0;o<this.dataSourceSettings.values.length;o++){if(this.dataSourceSettings.values[o].caption===n[n.length-1]){r=this.dataSourceSettings.values[o].name;break}r=n[n.length-1]}if((1===this.dataSourceSettings.values.length&&(!t&&"column"===this.dataSourceSettings.valueAxis&&0===this.dataSourceSettings.columns.length||t&&"row"===this.dataSourceSettings.valueAxis&&0===this.dataSourceSettings.rows.length)||1<this.dataSourceSettings.values.length&&(!t&&"column"===this.dataSourceSettings.valueAxis||t&&"row"===this.dataSourceSettings.valueAxis))&&r&&this.fieldList[r]){for(o=0;o<n.length-1;o++)s=""===s?n[o]:s+this.valueSortSettings.headerDelimiter+n[o];i=this.fieldList[r].index,a=this.fieldList[r].aggregateType}else{if(!this.dataSourceSettings.alwaysShowValueHeader||1===n.length||t&&"row"!==this.dataSourceSettings.valueAxis||!t&&"column"!==this.dataSourceSettings.valueAxis)s=e;else for(o=0;o<n.length-1;o++)s=""===s?n[o]:s+this.valueSortSettings.headerDelimiter+n[o];if(_e.isNullOrUndefined(this.dataSourceSettings.valueSortSettings.measure)||""===this.dataSourceSettings.valueSortSettings.measure)i=this.fieldList[this.dataSourceSettings.values[0].name].index,a=this.fieldList[this.dataSourceSettings.values[0].name].aggregateType;else for(o=0;o<this.dataSourceSettings.values.length;o++){if(this.dataSourceSettings.valueSortSettings.measure===this.dataSourceSettings.values[o].name){i=this.fieldList[this.dataSourceSettings.valueSortSettings.measure].index,a=this.fieldList[this.dataSourceSettings.valueSortSettings.measure].aggregateType;break}i=this.fieldList[this.dataSourceSettings.values[0].name].index,a=this.fieldList[this.dataSourceSettings.values[0].name].aggregateType}}return{hText:s,mIndex:i,mType:a}},t.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(i=0<e[r].members.length?this.getMember(e[r].members,t):i)return i}return i},t.prototype.sortByValueRow=function(e,t,i,a,r){for(var n,s,o=[],l=0,d=e;l<d.length;l++)"grand sum"===(h=d[l]).type?o.push({header:h}):(this.rawIndexObject={},n=this.getAggregateValue(h.index,t.indexObject,a,r,!1),s={fieldName:this.fields[a],row:h,column:t,value:n,cellSets:this.getValueCellInfo?this.getCellSet(this.rawIndexObject):[],rowCellType:h.hasChild&&h.isDrilled?"subTotal":"grand sum"===h.type?"grandTotal":"value",columnCellType:t.hasChild&&t.isDrilled?"subTotal":"grand sum"===t.type?"grandTotal":"value",aggregateType:r,skipFormatting:!1},this.getValueCellInfo&&this.getValueCellInfo(s),n=s.value,this.rawIndexObject={},o.push({header:h,value:n}));for(var h,p=0,u=e=Ie.getSortedValue(o,i);p<u.length;p++)0<(h=u[p]).members.length&&(h.members=this.sortByValueRow(h.members,t,i,a,r));return e},t.prototype.insertAllMembersCommon=function(){this.rowGrandTotal=this.columnGrandTotal=null;var e=!((!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showRowGrandTotals)&&0<this.dataSourceSettings.rows.length),t=!((!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showColumnGrandTotals)&&0<this.dataSourceSettings.columns.length);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])},t.prototype.insertSubTotals=function(){for(var e=this.pivotValues.length,t=0;t<e;t++){var i=this.pivotValues[t];if(i)for(var a=void 0,r=1,n=i.length,s=void 0,o=1,l=this.showSubTotalsAtTop?this.reformAxisCount:n,d=this.showSubTotalsAtTop?o:l-1,h=void 0,p=void 0;o<l;){var u,c=i[d];if(c){a&&(a.colSpan=r,a.colIndex=this.showSubTotalsAtTop?a.colIndex+(r-1):a.colIndex-(r-1)),this.showSubTotalsAtTop&&(h=p=this.getMemberSpanCount(this.pivotValues[t],d)),s={index:c.index,indexObject:c.indexObject},c.index=[],c.indexObject={},a=_e.extend({},c,null,!0),c.index=s.index,c.indexObject=s.indexObject;for(var g=t+1;this.pivotValues[g]&&!this.pivotValues[g][d];){var m=this.pivotValues[t][d],S=(m.isDrilled||!this.valueAxis&&!this.isLastHeaderHasMeasures&&m.members&&0<m.members.length&&g>this.measureIndex||(m.rowSpan=g-t+1,a.rowSpan=g-t+1),"sum"===c.type||"grand sum"===c.type?c.type:"sum"),f=(this.pivotValues[g][d]=this.headerContent[g][d]={type:S,formattedText:"sum"===c.type||"grand sum"===c.type?c.formattedText:c.formattedText+" Total",axis:"column",hierarchyName:c.hierarchyName,level:-1,colIndex:d,rowIndex:g,valueSort:c.valueSort},c.valueSort&&(c.valueSort[this.valueSortSettings.rowHeaderText]||c.valueSort[this.valueSortSettings.columnHeaderText])&&(this.valueSortSettings.columnIndex=d),!1);"grand sum"===S?(m.rowSpan=g-t+1,a.rowSpan=g-t+1):"sum"!==m.type&&(m.isDrilled||this.valueAxisFields[m.actualText]&&!this.valueAxis&&!this.isLastHeaderHasMeasures&&m.members&&0<m.members.length)?(this.pivotValues[t+1][d].rowSpan=g-t,f=!0):this.pivotValues[g][d].rowSpan=-1,t+1<g&&("sum"===m.type||f)&&(this.pivotValues[g][d].rowSpan=-1),g++}r=1}else i[d]=this.headerContent[t][d]=_e.extend({},a,null,!0),i[d].index=this.headerContent[t][d].index=s.index,i[d].indexObject=this.headerContent[t][d].indexObject=s.indexObject,r++,this.showSubTotalsAtTop?(p--,i[d].colSpan=p,i[d].colIndex=i[d].colIndex+(r-1)):(i[d].colSpan=r,i[d].colIndex=i[d].colIndex-(r-1));1===d&&a&&(this.showSubTotalsAtTop?(a.colSpan=h,a.colIndex=a.colIndex+(r-1)):(a.colSpan=r,a.colIndex=a.colIndex-(r-1))),this.showSubTotalsAtTop&&(i[d+1]||d+1===this.reformAxisCount)&&((u=this.pivotValues[t][d-r+1]).colSpan=h,this.pivotValues[t][d-r+1]=u),d=this.showSubTotalsAtTop?d+1:d-1,o++}}},t.prototype.getMemberSpanCount=function(e,t){for(var i=1,a=t+1;a<this.reformAxisCount&&!e[a];a++)i++;return i},t.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,s=this.fieldList[i.name],o=s&&s.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)&&-1<this.measureIndex&&this.measureIndex<=l)?l+1:l)+1,a=!!d,n=!0;break}if(!n)for(var d,l=0;l<this.dataSourceSettings.columns.length;l++)if(this.dataSourceSettings.columns[l].name===i.name){r=((d=!this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&-1<this.measureIndex&&this.measureIndex<=l)?l+1:l)+1,a=!!d,n=!0;break}for(var h=0,p=i.items;h<p.length;h++){var u=p[h],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||o)for(var S=0,f=this.dataSourceSettings.values;S<f.length;S++){var v=f[S],v=v.caption||v.name;if(c[this.measureIndex]=v,!(-1<i.items.indexOf(c.join(i.delimiter)))){m=!1;break}m=!0}(!this.isExpandAll&&!o||!m)&&this.isExpandAll&&o||((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)}}}}},t.prototype.getIndexedHeaders=function(e,t,i,a,r,n,s){var o=[];if(e&&0<e.length){0;var l=e.length,d={},h=e[i].name,p=e[i],u=this.fieldList[h];if(_e.isNullOrUndefined(this.reportDataType)){this.reportDataType={};for(var c=0;c<this.dataSourceSettings.rows.length;c++)this.reportDataType[this.dataSourceSettings.rows[c].name]=this.dataSourceSettings.rows[c].dataType;for(c=0;c<this.dataSourceSettings.columns.length;c++)this.reportDataType[this.dataSourceSettings.columns[c].name]=this.dataSourceSettings.columns[c].dataType;for(c=0;c<this.dataSourceSettings.values.length;c++)this.reportDataType[this.dataSourceSettings.values[c].name]=this.dataSourceSettings.values[c].dataType}u.type=_e.isNullOrUndefined(this.reportDataType[u.id])?u.type:this.reportDataType[u.id];var g=!1,m=this.formatFields[h]&&-1<["date","dateTime","time"].indexOf(this.formatFields[h].type),S=a.length<1&&0<i||p.showNoDataItems,f={};if(S){for(var v=Object.keys(u.members),y=0,b=v.length;y<b;y++)(this.dataSourceSettings.showHeaderWhenEmpty||this.localeObj&&v[y]!==this.localeObj.getConstant("undefined"))&&(f[v[y]]=v[y]);a.length<1&&(g=!0,a.length=v.length)}r===this.dataSourceSettings.valueAxis&&this.measureIndex===i&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&(this.isLastHeaderHasMeasures=!1);for(y=0,b=a.length;y<b;y++){var C,x,w={},T=(_e.isNullOrUndefined(e[i].showSubTotals)||e[i].showSubTotals||(w.showSubTotals=!1),w.hasChild=i<l-1,w.level=i,w.axis=r,w.colSpan=1,this.rowMaxLevel="row"===r&&this.rowMaxLevel<i?i:this.rowMaxLevel,(g?u.members[Object.keys(f)[0]]:this.valueMatrix[a[y]][u.index]).ordinal),M=g?Object.keys(f)[0]:t[a[y]][this.fieldKeys[h]];M=this.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(M):M,(_e.isNullOrUndefined(M)||this.localeObj&&M===this.localeObj.getConstant("undefined"))&&!this.dataSourceSettings.showHeaderWhenEmpty?S&&!g&&0<i&&y+1===a.length&&0<Object.keys(f).length&&(b=Object.keys(f).length,g=!0,y=-1):(delete f[M],S&&this.fieldFilterMem[h]&&this.fieldFilterMem[h].memberObj[M]===M||(x=m?{actualText:M,formattedText:u.dateMember[T-1].formattedText,dateText:u.dateMember[T-1].actualText}:{formattedText:null===M?this.localeObj?this.localeObj.getConstant("null"):String(M):void 0===M&&this.localeObj?h in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(M),actualText:null===M?this.localeObj?this.localeObj.getConstant("null"):String(M):void 0===M?this.localeObj?h in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(M):M},w.actualText=x.actualText,w.formattedText=x.formattedText,m&&(w.dateText=x.dateText),x=!S||void 0!==this.filterPosObj[a[y]]&&!g,C=!1,S&&0<u.filter.length&&"include"===u.filterType&&(C=!0),d&&d[T]||C&&!(-1<u.filter.indexOf(M.toString()))?x&&(d[T].index.push(a[y]),d[T].indexObject[a[y]]=a[y]):(d[T]={index:[],indexObject:{}},w.index=d[T].index,w.indexObject=d[T].indexObject,x&&(w.index=d[T].index=[a[y]],d[T].indexObject[a[y]]=a[y],w.indexObject=d[T].indexObject),w.ordinal=T,w.valueSort={},w.valueSort.axis=h,0!==i?(w.valueSort.levelName=n+this.valueSortSettings.headerDelimiter+(this.customProperties.isTabularLayout?this.getFormattedValue(w.formattedText,u.caption):w).formattedText,w.valueSort[n+this.valueSortSettings.headerDelimiter+w.formattedText]=1,w.valueSort.uniqueName=n+this.valueSortSettings.headerDelimiter+(w.actualText||w.formattedText),w.valueSort[n+this.valueSortSettings.headerDelimiter+(w.actualText||w.formattedText)]=1):(w.valueSort[w.formattedText]=1,w.valueSort.levelName=(this.customProperties.isTabularLayout?this.getFormattedValue(w.formattedText,u.caption):w).formattedText,w.valueSort[w.actualText||w.formattedText]=1,w.valueSort.uniqueName=w.actualText||w.formattedText),C=w.valueSort.axis+this.valueSortSettings.headerDelimiter+w.valueSort.levelName,x=this.isExpandAll||p&&p.expandAll,w.isDrilled=!(!s||!this.isValueFiltersAvail)||(w.hasChild&&this.fieldDrillCollection[C]?!x||!this.valueAxis&&!this.isLastHeaderHasMeasures&&this.measureIndex<=1:x),w.members=[],o.push(w)),S&&!g&&0<i&&y+1===a.length&&0<Object.keys(f).length&&(g=!0,b=Object.keys(f).length,y=-1)))}for(var D=0,O=o.length;D<O;D++){this.frameHeaderObjectsCollection||("row"===r?(N=o[D].isDrilled&&o[D].hasChild,this.rowCount+=this.rowValuesLength+(N&&this.showSubTotalsAtBottom&&!this.customProperties.isTabularLayout?1:0)):this.columnCount+=this.colValuesLength);var P,N=null;if(n=(N=o[D].valueSort&&o[D].valueSort.levelName?o[D].valueSort.levelName:N)||o[D].formattedText,!this.dataSourceSettings.showHeaderWhenEmpty&&i<l-1&&o[D].index&&0<o[D].index.length)if(S&&e[i+1]&&e[i+1].name&&0<Object.keys(this.fieldList[e[i+1].name].members).length)o[D].hasChild=!0;else{for(var E=o[D].index.length,I=0,F=0;F<E;F++){M=t[o[D].index[F]][this.fieldKeys[e[i+1].name]];(_e.isNullOrUndefined(M)||this.localeObj&&M===this.localeObj.getConstant("undefined"))&&I++}o[D].hasChild=I!==E}i<l-1&&o[D].isDrilled&&(this.columnCount-=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&p.showSubTotals||"column"!==r?0:this.colValuesLength,P=o[D].index,o[D].members=this.getIndexedHeaders(e,t,i+1,void 0===P?[]:P,r,n,s),this.frameHeaderObjectsCollection)&&(this.headerObjectsCollection[n]=o[D].members)}if(this.enableSort){if(m)return this.sortHeaders(h,u,o,u.sort,"date");if("number"===u.type.toLowerCase()&&0<o.length&&"string"==typeof o[0].actualText&&o[0].actualText.match(/[a-zA-Z]+/g)){for(var L=[],A=void 0,R=[],k=[],c=0;c<o.length;c++)if(_e.isNullOrUndefined(o[c].actualText.toString().match(/\d+/)))L.push(o[c]),A||"None"===u.sort||"Out of Range"===o[c].actualText&&(A=o[c],o.splice(c,1));else{if(""!==o[c].actualText){this.fieldList[h].isAlphanumeric=!0,R.push(o[c]);break}k.push(o[c])}return A&&("Ascending"===u.sort?"Grand Total"===o[0].actualText?o.splice(1,0,A):o.splice(0,0,A):"Grand Total"===o[o.length-1].actualText?o.splice(o.length-1,0,A):o.splice(o.length,0,A)),0<R.length&&this.sortHeaders(h,u,o,u.sort,u.isAlphanumeric),o}return this.sortHeaders(h,u,o,u.sort,u.type)}}return o},t.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},t.prototype.insertPosition=function(e,t,i,a,r,n,s){var o=[],l=this.getOrderedIndex(s);if(e){for(var d={},h=e[i].name,p=this.fieldList[h],u=0,c=a.length;u<c;u++){var g={},m=this.valueMatrix[a[u]][p.index].ordinal,S=s[l[m]],f=null===(f=t[a[u]][this.fieldKeys[h]])?this.localeObj?this.localeObj.getConstant("null"):String(f):f,f=this.formatFields[h]&&-1<["date","dateTime","time"].indexOf(this.formatFields[h].type)?this.getFormattedValue(f,h):{formattedText:f.toString(),actualText:f.toString()};S&&S.formattedText===f.formattedText&&(d&&d[m]?(d[m].index.push(a[u]),d[m].indexObject[a[u]]=a[u]):(d[m]={index:[],indexObject:{}},S.index=d[m].index=[a[u]],d[m].indexObject[a[u]]=a[u],S.indexObject=d[m].indexObject,S.valueSort={},S.valueSort.axis=h,0!==i?(S.valueSort.levelName=n+this.valueSortSettings.headerDelimiter+S.formattedText,S.valueSort[n+this.valueSortSettings.headerDelimiter+S.formattedText]=1,S.valueSort.uniqueName=n+this.valueSortSettings.headerDelimiter+(S.actualText||S.formattedText),S.valueSort[n+this.valueSortSettings.headerDelimiter+(S.actualText||S.formattedText)]=1):(S.valueSort[S.formattedText]=1,S.valueSort.levelName=S.formattedText,S.valueSort[S.actualText||S.formattedText]=1,S.valueSort.uniqueName=S.actualText||S.formattedText),g.members=[],o.push(g)))}for(var v=s.length-o.length;0<v;)o.push({members:[]}),v--;for(var y,b=0,C=o.length;b<C;b++)0<s[b].members.length&&(y=null,n=(y=s[b].valueSort&&s[b].valueSort.levelName?s[b].valueSort.levelName:y)||s[b].formattedText,o[b].members=this.insertPosition(e,t,i+1,s[b].index,r,n,s[b].members))}return o},t.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},t.prototype.calculatePagingValues=function(){var e,t;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&&1<this.pageSettings.currentColumnPage&&(this.pageSettings.currentColumnPage+1)*this.colValuesLength>=this.columnPageCount?this.columnPageCount:this.pageSettings.currentColumnPage,this.pageSettings.currentRowPage=this.pageSettings.currentRowPage>=this.rowPageCount||this.enableOptimizedRendering&&1<this.pageSettings.currentRowPage&&(this.pageSettings.currentRowPage+1)*this.rowValuesLength>=this.rowPageCount?this.rowPageCount:this.pageSettings.currentRowPage,e=this.enablePaging?1:this.enableOptimizedRendering?1.5:this.viewportPageCount,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),(t=!this.enablePaging&&this.rowStartPos+this.pageSettings.rowPageSize*e*this.rowValuesLength>this.rowCount?this.rowCount-this.pageSettings.rowPageSize*e*this.rowValuesLength:this.rowStartPos)<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.lastMember={},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.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.headerCollection.rowHeaders[this.headerCollection.rowHeaders.length-1],this.columnGrandTotal=this.columnGrandTotal||this.headerCollection.columnHeaders[this.headerCollection.columnHeaders.length-1]))},t.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,!this.pageInLimit&&i<=this.memberCnt&&("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(0<e[r].members.length&&"row"===a&&(this.lastMember[e[r].actualText]=e[r].members[e[r].members.length-1].valueSort.levelName),t.push(0<e[r].members.length?this.removeChildMembers(e[r]):e[r]),0<e[r].members.length&&("column"===a?this.memberCnt-=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&this.columnKeys[e[r].valueSort.axis].showSubTotals?0:this.colValuesLength:this.showSubTotalsAtBottom&&!this.customProperties.isTabularLayout&&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},t.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},t.prototype.insertAllMember=function(e,t,i,a){var r=e.length,n={hasChild:!" Total",index:t,level:0,axis:a,isDrilled:!1,indexObject:{},members:[],actualText:"Grand Total",formattedText:this.localeObj?this.localeObj.getConstant("grandTotal"):"Grand Total",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 s=0,o=t.length;s<o;s++)n.indexObject[t[s]]=t[s];return"Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals?e.unshift(n):e.push(n),e},t.prototype.getTableData=function(e,t,i,a,r,n,s,o,l,d){for(var h=e.length,p=0;p<h;p++){var u=!this.valueAxis&&!this.isLastHeaderHasMeasures&&r.length<this.dataSourceSettings.columns.length+1?this.dataSourceSettings.columns.length+1:r.length,c=e[p],g=(t[u]=c,u-Number(Object.keys(t)[0])),m=!t[u].members.length,S=(c.colIndex=0,c.rowIndex=u,!1),f=this.dataSourceSettings.valueSortSettings.headerDelimiter;if(this.valueAxis&&0===this.dataSourceSettings.rows.length&&1<this.dataSourceSettings.values.length&&(this.rowIndex=_e.isNullOrUndefined(this.rowIndex)&&!m&&0===this.dataSourceSettings.rows.length?c.index:this.rowIndex,S=this.valueAxis&&0===this.dataSourceSettings.rows.length&&c.valueSort.levelName&&0!==c.valueSort.levelName.toString().indexOf("Grand Total"+f),this.valueAxis)&&0===this.dataSourceSettings.rows.length&&0===c.valueSort.levelName.toString().indexOf("Grand Total"+f)&&(c.index=this.rowIndex),S)m||this.recursiveRowData(e,t,i,u,r,n,m,p,0,s,o,l);else{var v=!1;if(this.showSubTotalsAtBottom&&t[a]&&t[a].hasChild)for(var y=0,b=t[a].members;y<b.length;y++)if("value"===b[y].type){v=!0;break}if(!v||t[u].isSum||!t[u].members||0!==t[u].members.length)if(r[u]||(r[u]=[],this.valueContent[g]={}),r[u][0]=t[u]=this.valueContent[g][0]=Ie.getFormattedHeader(c,this),this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)){var C=u,x=g,f=u,w=!1;if(((0!==s||0!==this.measureIndex)&&!m||m)&&"value"===c.type&&!c.valueSort.axis||s>this.measureIndex&&"row"===c.axis&&c.valueSort.axis)for(var T=0,M=!1,D=c.valueSort.uniqueName?c.valueSort.uniqueName.toString().split(this.valueSortSettings.headerDelimiter):[],O=0,P=1,N=i.length;O<N;++O){if(!M)for(T=0;T<n;T++)if(-1<D.indexOf(this.dataSourceSettings.values[T].name)){w=M=!0;break}if(s>this.measureIndex&&"row"===c.axis&&c.valueSort.axis)this.updateRowData(e,i,u,r,T,p,O,P,g,o,l);else{if(!t[a]){w=!1;break}var E=this.showSubTotalsAtBottom&&d?d:a;this.updateRowData(t,i,u,r,T,E,O,P,g,o,l)}P=r[u].length}if(!w)for(O=0,P=1,N=i.length;O<N;++O)P=r[u].length,r[C][P]=this.valueContent[x][P]={axis:"value",actualText:"",colSpan:1,colIndex:P,formattedText:"",hasChild:!1};this.recursiveRowData(e,t,i,f,r,n,m,p,n,s,o,l)}else{for(O=0,P=1,N=i.length;O<N;++O)for(var I=i[O].valueSort.uniqueName?i[O].valueSort.uniqueName.toString().split(this.valueSortSettings.headerDelimiter):[],T=0;T<n;T++)(this.valueAxis||this.isLastHeaderHasMeasures||-1<I.indexOf(this.dataSourceSettings.values[T].name))&&(this.updateRowData(e,i,u,r,T,p,O,P,g,o,l),P=r[u].length);this.recursiveRowData(e,t,i,u,r,n,m,p,0,s,o,l)}}}},t.prototype.insertRowSubTotals=function(e,t,i,a,r,n,s,o){var l=!!e[i].type&&"value"===e[i].type&&e[i].valueSort.levelName!==e[i].actualText;if(e[i].hasChild&&0<e[i].members.length){var d=[],h=Ie.frameHeaderWithKeys(e[i]);if("value"===e[i].members[0].type){for(var p=0,u=[],c=1,g=0,m=h.members;g<m.length;g++){var S=m[g];"value"===S.type&&(u[u.length]=S)}for(;p<u.length;){for(var f=Ie.frameHeaderWithKeys(u[p]),v=void 0;c<e.length;c++)if(e[c]&&e[c].valueSort.levelName===f.valueSort.levelName){v=e.indexOf(e[c]);break}-1<v&&(d[d.length]=v),f.formattedText=h.formattedText+" "+f.formattedText,f.isSum=!0,f.members=[],this.getTableData([f],e,t,i,a,r,n,s,o),p++}}else{h.formattedText=h.formattedText+" Total",h.members=[],h.isDrilled=!1,h.hasChild=!1,h.isSum=!0,h.type="sum";l=l?this.getParentIndex(e,h):0;(this.enableVirtualization&&e[i].members&&e[i].members[e[i].members.length-1]&&e[i].members[e[i].members.length-1].valueSort&&e[i].members[e[i].members.length-1].valueSort.levelName===this.lastMember[e[i].actualText]||!this.enableVirtualization)&&this.getTableData([h],e,t,i,a,r,n,s,o,l),d=[i]}for(v=0;v<d.length;v++){var y=(y=a[d[v]]).map(function(e){return e.formattedText=0===e.colIndex?e.formattedText:"",e});a[d[v]]=y}}},t.prototype.getParentIndex=function(e,t){for(var i=0,a=e.length-1;0<a;a--)if(t.level===e[a].level&&e[a].index){i=a;break}return i},t.prototype.getAggregatedHeaders=function(e,t,i,a,r){this.selectedHeaders={selectedHeader:[],values:[]};for(var n=r.length,s=0;s<n;s++)switch(r[s].type){case"DifferenceFrom":case"PercentageOfDifferenceFrom":for(var o=void 0,l=void 0,d=(this.selectedHeaders.values.push(r[s].name),r[s].baseField&&r[s].baseItem?(o=r[s].baseField,l=r[s].baseItem):this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&0<t.length?(o=t[0].name,l=Object.keys(this.fieldList[t[0].name].members)[0]):0<e.length&&(o=e[0].name,l=Object.keys(this.fieldList[e[0].name].members)[0]),!1),h=0,p=e;h<p.length;h++)if(p[h].name===o){this.getAggregatedHeaderData(i,r[s].name,l,!1,"row",r[s].type,this.selectedHeaders.selectedHeader,s),d=!0;break}if(!d)for(var u=0,c=t;u<c.length;u++)if(c[u].name===o){this.getAggregatedHeaderData(a,r[s].name,l,!1,"column",r[s].type,this.selectedHeaders.selectedHeader,s);break}break;case"PercentageOfParentRowTotal":case"PercentageOfParentColumnTotal":this.selectedHeaders.values.push(r[s].name),this.getAggregatedHeaderData("PercentageOfParentRowTotal"===r[s].type?i:a,r[s].name,void 0,!1,"PercentageOfParentRowTotal"===r[s].type?"row":"column",r[s].type,this.selectedHeaders.selectedHeader,s);break;case"RunningTotals":this.selectedHeaders.values.push(r[s].name),this.getAggregatedHeaderData(this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)?a:i,r[s].name,void 0,!1,this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)?"column":"row",r[s].type,this.selectedHeaders.selectedHeader,s);break;case"PercentageOfParentTotal":for(var o=void 0,d=(this.selectedHeaders.values.push(r[s].name),r[s].baseField?o=r[s].baseField:this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&0<t.length?o=t[0].name:0<e.length&&(o=e[0].name),!1),g=e.length,m=0;m<g;m++)if(e[m].name===o){var S=m>=this.measureIndex?m+1:m;this.getAggregatedHeaderData(i,r[s].name,void 0,!1,"row",r[s].type,this.selectedHeaders.selectedHeader,s,S),d=!0;break}if(!d)for(g=t.length,m=0;m<g;m++)if(t[m].name===o){S=m;this.valueAxis||this.isLastHeaderHasMeasures||(S=m>=this.measureIndex?m+1:m),this.getAggregatedHeaderData(a,r[s].name,void 0,!1,"column",r[s].type,this.selectedHeaders.selectedHeader,s,S);break}}},t.prototype.getAggregatedHeaderData=function(e,t,i,a,r,n,s,o,l){for(var d=0,h=e;d<h.length;d++){var p=h[d];switch(n){case"DifferenceFrom":case"PercentageOfDifferenceFrom":if(-1!==p.valueSort.levelName.toString().split(this.valueSortSettings.headerDelimiter).indexOf(i)){var u=[];if(!a&&"row"===r)for(var c=0,g=e;c<g.length;c++){var m=g[c];m.level>=p.level&&u.push(m)}if(s.push(this.updateSelectedHeaders(i,p.level,r,a,t,n,p.valueSort.levelName,a?[p]:"column"===r?e:u,o+1)),0<p.members.length){var S=!1,f=[];if("row"===r)for(var v=0,y=p.members;v<y.length;v++){if("value"!==(w=y[v]).type||0!==w.members.length){f.push(w),S=!1;break}S=!0}(!S&&0<f.length||"column"===r)&&this.getAggregatedHeaderData("column"===r?p.members:f,t,i,!0,r,n,s[s.length-1].childMembers,o)}}else 0<p.members.length&&this.getAggregatedHeaderData(p.members,t,i,!1,r,n,s,o);break;case"RunningTotals":case"PercentageOfParentRowTotal":case"PercentageOfParentColumnTotal":"grand sum"===p.type?s.push(this.updateSelectedHeaders(void 0,p.level,r,!1,t,n,p.valueSort.levelName,e,o+1)):0<p.members.length&&(s.push(this.updateSelectedHeaders(void 0,p.level,r,!1,t,n,p.valueSort.levelName,p.members,o+1)),this.getAggregatedHeaderData(p.members,t,void 0,!1,r,n,s,o));break;case"PercentageOfParentTotal":if("grand sum"!==p.type)if(p.valueSort.levelName.split(this.valueSortSettings.headerDelimiter).length-1===l)if(0<p.members.length){if(a)for(var b=s[s.length-1].aggregateHeaders,C=0,x=p.members;C<x.length;C++){var w=x[C];b.push(_e.extend({},w,null,!0))}else{var T=_e.extend([],p.members,null,!0);s.push(this.updateSelectedHeaders(void 0,p.level,r,!1,t,n,p.valueSort.levelName,T,o+1)),(b=s[s.length-1].aggregateHeaders).push(_e.extend({},p,null,!0))}this.getAggregatedHeaderData(p.members,t,void 0,!0,r,n,s,o,l+1)}else a||s.push(this.updateSelectedHeaders(void 0,p.level,r,!1,t,n,p.valueSort.levelName,[p],o+1));else 0<p.members.length&&this.getAggregatedHeaderData(p.members,t,void 0,!1,r,n,s,o,l)}}},t.prototype.updateSelectedHeaders=function(e,t,i,a,r,n,s,o,l){return{name:e,level:t,axis:i,isChild:a,value:r,type:n,uniqueName:s,aggregateHeaders:_e.extend([],o,null,!0),childMembers:[],valueCount:l}},t.prototype.applyAdvancedAggregate=function(e,t,i){if(this.aggregatedValueMatrix=[],0<this.selectedHeaders.values.length){for(var a={},r=[],n=[],s=!1,o=i.length,l=0;l<o;l++)if(void 0!==i[l]&&void 0!==i[l][0]){if(!s)for(var d=i[l].length,h=0;h<d;h++){var p=i[l][h].actualText;"value"===i[l][h].axis&&-1!==this.selectedHeaders.values.indexOf(p)&&(r.push(h),s=!0)}var u=this.showSubTotalsAtBottom&&i[l][0].isDrilled&&i[l][0].hasChild;if(!u&&0<r.length&&"value"===i[l][r[0]].axis&&-1!==this.selectedHeaders.values.indexOf(i[l][r[0]].actualText)){n.push(l);for(var c=0,g=r;c<g.length;c++)a[l+","+(m=g[c])]=[l,m]}}this.updateAggregates(e,t,i,this.selectedHeaders.selectedHeader,r,n,a);for(var m,S=0,f=Object.keys(a);S<f.length;S++)i[a[m=f[S]][0]][a[m][1]].formattedText=0<this.selectedHeaders.selectedHeader.length?this.emptyCellTextContent:"#N/A",this.aggregatedValueMatrix[a[m][0]]||(this.aggregatedValueMatrix[a[m][0]]=[]),this.aggregatedValueMatrix[a[m][0]][a[m][1]]=0;this.updatePivotValues(!0)}},t.prototype.updateAggregates=function(e,t,i,k,a,r,n){for(var s=0,j=k;s<j.length;s++){var o=j[s],l=o.aggregateHeaders,d=o.value,q=o.type,h=o.uniqueName,p="row"===o.axis,u=void 0,c=[],g=[],m=[],S=[],f=[],v=[];if(-1!==["DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentRowTotal","PercentageOfParentColumnTotal","PercentageOfParentTotal","RunningTotals"].indexOf(o.type))if(p){if("RunningTotals"!==o.type)for(var H=0,V=r;H<V.length;H++){var y=V[H];if(void 0!==e[y]&&e[y].valueSort[h]){u=e[y],f=0===this.valueAxis||this.valueAxis&&i[y]&&i[y][1]&&i[y][1].actualText===d?i[y]:[];break}}}else{for(var U=i.length,b=0;b<U&&(void 0!==i[b]&&void 0===i[b][0]);b++)m.push(i[b]);for(var C=m.length;C--;){var _=(M=m[C][a[0]]).actualText;-1===this.selectedHeaders.values.indexOf(_)&&(g=m[C],C=0)}if("RunningTotals"!==o.type){for(var x=g.length,w=0;w<x;w++){var T=!1;if(void 0!==g[w]&&g[w].valueSort[h]){for(var u=g[w],B=i.length,b=0;b<B;b++)void 0!==(M=i[b])&&void 0!==M[0]&&"value"===M[w].axis&&-1!==this.selectedHeaders.values.indexOf(M[w].actualText)&&(T=!0,v[b]=M[w],S.push(b));if(T)break}}if(0===v.length&&0===S.length)for(x=g.length,w=0;w<x;w++){T=!1;if(void 0!==g[w]&&0===g[w].valueSort.levelName.indexOf(h)){u=g[w];for(var M,G=i.length,D=0;D<G;D++)void 0!==(M=i[D])&&void 0!==M[0]&&"value"===M[w].axis&&-1!==this.selectedHeaders.values.indexOf(M[w].actualText)&&(T=!0,S.push(D));if(T)break}}}}switch(o.type){case"DifferenceFrom":case"PercentageOfDifferenceFrom":var z=o.isChild;if(p){if(z)for(var O=h.split(this.valueSortSettings.headerDelimiter),W=0,Q=r;W<Q.length;W++){var P=Q[W];if(void 0!==e[P])if(-1!==e[P].valueSort.levelName.split(this.valueSortSettings.headerDelimiter).indexOf(O[O.length-1])&&u&&e[P].level===u.level)for(var Y=0,K=a;Y<K.length;Y++){E=K[Y];"value"===(I=i[P][E]).axis&&I.actualText===d&&(c.push([P,E]),n[P+","+E])&&delete n[P+","+E]}}else for(var X=0,J=l;X<J.length;X++)for(var N=J[X],Z=0,$=r;Z<$.length;Z++){y=$[Z];if(void 0!==e[y]&&e[y].valueSort[N.valueSort.levelName]&&e[y].level===u.level&&"grand sum"!==e[y].type)for(var ee=0,te=a;ee<te.length;ee++){var E=te[ee];"value"===(I=i[y][E]).axis&&I.actualText===d&&(c.push([y,E]),n[y+","+E])&&delete n[y+","+E]}}for(var ie=0,ae=c;ie<ae.length;ie++){var I=i[(E=ae[ie])[0]][E[1]],re=_e.isNullOrUndefined(f[E[1]].actualValue)?0:f[E[1]].actualValue,F=(_e.isNullOrUndefined(I.actualValue)?0:I.actualValue)-re;F=isNaN(F)||0===I.value&&0===f[E[1]].value?0:F,this.aggregatedValueMatrix[E[0]]||(this.aggregatedValueMatrix[E[0]]=[]),"DifferenceFrom"===q?(this.aggregatedValueMatrix[E[0]][E[1]]=F,I.formattedText=0===F?this.emptyCellTextContent:this.getFormattedValue(F,d).formattedText):(this.aggregatedValueMatrix[E[0]][E[1]]=F=0===re?0:F/re,I.formattedText=I.showSubTotals?0!==F?this.globalize.formatNumber(F,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,I.actualText)}):this.emptyCellTextContent:I.formattedText)}}else{if(z)for(var O=h.split(this.valueSortSettings.headerDelimiter),x=g.length,L=0;L<x;L++){T=!1;if(void 0!==g[L])if(-1!==g[L].valueSort.levelName.split(this.valueSortSettings.headerDelimiter).indexOf(O[O.length-1])&&g[L].level===u.level){for(var ne=0,se=S;ne<se.length;ne++)"value"===(I=i[E=se[ne]][L]).axis&&I.actualText===d&&(T=!0,c.push([E,L]),n[E+","+L])&&delete n[E+","+L];if(T)break}}else for(var oe=0,le=l;oe<le.length;oe++)for(N=le[oe],x=g.length,w=0;w<x;w++){var T=!1;if(void 0!==g[w]&&g[w].valueSort[N.valueSort.levelName]&&u&&g[w].level===u.level&&"grand sum"!==g[w].type){for(var de=0,he=S;de<he.length;de++)"value"===(I=i[E=he[de]][w]).axis&&I.actualText===d&&(T=!0,c.push([E,w]),n[E+","+w])&&delete n[E+","+w];if(T)break}}var pe=void 0;0===v.length&&(pe=this.getSelectedColumn(o.uniqueName,t));for(var ue=0,ce=c;ue<ce.length;ue++){var I=i[(E=ce[ue])[0]][E[1]],ge=0,F=(ge=0===v.length?(A=this.getSelectedRow(I.rowHeaders,e),this.getAggregateValue(A.index,pe.indexObject,this.fieldList[d].index,o.type,!1)):v[E[0]].value,I.value-ge);F=isNaN(F)?0:F,this.aggregatedValueMatrix[E[0]]||(this.aggregatedValueMatrix[E[0]]=[]),"DifferenceFrom"===q?I.formattedText=0===F?this.emptyCellTextContent:this.getFormattedValue(F,d).formattedText:(F=0===v[E[0]].value?0:F/v[E[0]].value,I.formattedText=0!==F?this.globalize.formatNumber(F,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,I.actualText)}):this.emptyCellTextContent),this.aggregatedValueMatrix[E[0]][E[1]]=F}}0<o.childMembers.length&&this.updateAggregates(e,t,i,o.childMembers,a,r,n);break;case"PercentageOfParentRowTotal":case"PercentageOfParentColumnTotal":case"PercentageOfParentTotal":if(p){for(var me=0,Se=l;me<Se.length;me++)for(var N=Se[me],fe=0,ve=r;fe<ve.length;fe++){b=ve[fe];if(void 0!==e[b]&&e[b].valueSort[N.valueSort.levelName]&&e[b].level===N.level)for(var ye=0,be=a;ye<be.length;ye++){E=be[ye];"value"===(I=i[b][E]).axis&&I.actualText===d&&(c.push([b,E]),n[b+","+E])&&delete n[b+","+E]}}for(var Ce=0,xe=c;Ce<xe.length;Ce++){var I=i[(b=xe[Ce])[0]][b[1]],we=0,we=0===f.length&&u?this.getAggregateValue(u.index,t[b[1]-1].indexObject,this.fieldList[d].index,o.type,!1):f[b[1]]?f[b[1]].actualValue:0,F=I.value/we;F=isNaN(F)?0:F,I.formattedText=I.showSubTotals?0!==F?this.globalize.formatNumber(F,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,I.actualText)}):this.emptyCellTextContent:I.formattedText,this.aggregatedValueMatrix[b[0]]||(this.aggregatedValueMatrix[b[0]]=[]),this.aggregatedValueMatrix[b[0]][b[1]]=F}}else{for(var Te=0,Me=l;Te<Me.length;Te++)for(N=Me[Te],x=g.length,D=0;D<x;D++){T=!1;if(void 0!==g[D]&&g[D].valueSort[N.valueSort.levelName]){for(var De=0,Oe=S;De<Oe.length;De++){E=Oe[De];this.showSubTotalsAtBottom&&i[E][0].isDrilled&&i[E][0].hasChild||"value"===(I=i[E][D]).axis&&I.actualText===d&&(T=!0,c.push([E,D]),n[E+","+D])&&delete n[E+","+D]}if(T)break}}var Pe=void 0;0===v.length&&(Pe=this.getSelectedColumn(o.uniqueName,t));for(var Ne=0,Ee=c;Ne<Ee.length;Ne++){var A,I=i[(b=Ee[Ne])[0]][b[1]],R=0,R=(R=0===v.length?(A=this.getSelectedRow(I.rowHeaders,e),this.getAggregateValue(A.index,Pe.indexObject,this.fieldList[d].index,o.type,!1)):v[b[0]].value,I.value/R),R=isNaN(R)?0:R;I.formattedText=0!=R?this.globalize.formatNumber(R,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,I.actualText)}):this.emptyCellTextContent,this.aggregatedValueMatrix[b[0]]||(this.aggregatedValueMatrix[b[0]]=[]),this.aggregatedValueMatrix[b[0]][b[1]]=R}}break;case"RunningTotals":if(p){for(var Ie=0,Fe=a;Ie<Fe.length;Ie++)for(var E=Fe[Ie],F=0,Le=0,Ae=l;Le<Ae.length;Le++)for(var N=Ae[Le],Re=0,ke=r;Re<ke.length;Re++)if(void 0!==e[P=ke[Re]]){I=i[P][E];if(void 0!==e[P]&&e[P].valueSort[N.valueSort.levelName]&&e[P].level===N.level&&"value"===I.axis&&I.actualText===d){"grand sum"!==e[P].type&&(F+=I.showSubTotals||!_e.isNullOrUndefined(I.actualValue)&&isNaN(I.actualValue)?_e.isNullOrUndefined(I.value)||isNaN(I.value)?null:I.value:I.actualValue,I.formattedText=I.showSubTotals?0===F&&I.actualValue&&0!==I.actualValue?"":this.getFormattedValue(F,d).formattedText:I.formattedText,this.aggregatedValueMatrix[P]||(this.aggregatedValueMatrix[P]=[]),this.aggregatedValueMatrix[P][E]=F),n[P+","+E]&&delete n[P+","+E];break}}}else for(var je=0,qe=r;je<qe.length;je++)if(void 0!==i[y=qe[je]])for(var F=0,He=0,Ve=l;He<Ve.length;He++)for(var N=Ve[He],Ue=e[y].hasChild&&e[y].isDrilled&&(!_e.isNullOrUndefined(e[y].showSubTotals)&&!e[y].showSubTotals||!this.dataSourceSettings.showSubTotals||!this.dataSourceSettings.showRowSubTotals),x=g.length,w=0;w<x;w++){I=i[y][w];if(void 0!==g[w]&&g[w].valueSort[N.valueSort.levelName]&&"value"===I.axis&&I.actualText===d){"grand sum"!==g[w].type&&(_e.isNullOrUndefined(I.value)||(F+=I.value),I.formattedText=Ue?"":this.getFormattedValue(F,d).formattedText,this.aggregatedValueMatrix[y]||(this.aggregatedValueMatrix[y]=[]),this.aggregatedValueMatrix[y][w]=F),n[y+","+w]&&delete n[y+","+w];break}}}}},t.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=ta({},i.indexObject,n.indexObject))}return i},t.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},t.prototype.recursiveRowData=function(e,t,i,a,r,n,s,o,l,d,h,p){s||this.getTableData(t[a].members,t,i,a,r,n,d+1,h,p),this.showSubTotalsAtBottom&&(_e.isNullOrUndefined(e[o].showSubTotals)||e[o].showSubTotals)&&this.insertRowSubTotals(t,i,a,r,n,d,h,p),this.isPagingOrVirtualizationEnabled||(t[a].members=[])},t.prototype.updateRowData=function(e,t,i,a,r,n,s,o,l,d,h){var p=this.fieldList[this.dataSourceSettings.values[r].name].index,u=this.fieldList[this.dataSourceSettings.values[r].name].aggregateType,c=this.dataSourceSettings.values[r].name,g=[],m={},S=0,f=0;switch(u){case"Index":for(var v=["cVal","rTotalVal","cTotalVal","gTotalVal"],y=0,b=0,C=g=[[e[n],t[s]],[e[n],h],[d,t[s]],[d,h]];b<C.length;b++){var x=C[b];m[v[y]]=this.getAggregateValue(x[0].index,x[1].indexObject,p,u,0!==y),y++}var w=m.cVal*m.gTotalVal/(m.rTotalVal*m.cTotalVal),S=!(0<e[n].members.length&&e[n].hasChild&&e[n].isDrilled)||(_e.isNullOrUndefined(e[n].showSubTotals)||e[n].showSubTotals)&&this.dataSourceSettings.showRowSubTotals&&this.dataSourceSettings.showSubTotals?_e.isNullOrUndefined(m.cVal)?m.cVal:isNaN(w)?0:w:void 0,f=_e.isNullOrUndefined(m.cVal)?m.cVal:isNaN(w)?0:w;break;case"PercentageOfGrandTotal":case"PercentageOfColumnTotal":case"PercentageOfRowTotal":(g=[[e[n],t[s]]]).push("PercentageOfGrandTotal"===u?[d,h]:"PercentageOfColumnTotal"===u?[d,t[s]]:[e[n],h]);for(var v=["cVal","gTotalVal"],y=0,T=0,M=g;T<M.length;T++){x=M[T];m[v[y]]=this.getAggregateValue(x[0].index,x[1].indexObject,p,u,0!==y),y++}w=m.cVal/m.gTotalVal;S=!(0<e[n].members.length&&e[n].hasChild&&e[n].isDrilled)||(_e.isNullOrUndefined(e[n].showSubTotals)||e[n].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals?_e.isNullOrUndefined(m.cVal)?m.cVal:isNaN(w)?0:w:void 0,f=_e.isNullOrUndefined(m.cVal)?m.cVal:isNaN(w)?0:w;break;default:w=this.getAggregateValue(e[n].index,t[s].indexObject,p,u,!1);S=!(0<e[n].members.length&&e[n].hasChild&&e[n].isDrilled)||(_e.isNullOrUndefined(e[n].showSubTotals)||e[n].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals?w:void 0,f=w}var r={fieldName:this.dataSourceSettings.values[r].name,row:e[n],column:t[s],value:S,cellSets:this.getValueCellInfo?this.getCellSet(this.rawIndexObject):[],rowCellType:e[n].hasChild&&e[n].isDrilled?"subTotal":"grand sum"===e[n].type?"grandTotal":"value",columnCellType:t[s].hasChild&&t[s].isDrilled?"subTotal":"grand sum"===t[s].type?"grandTotal":"value",aggregateType:u,skipFormatting:!1},D=(this.getValueCellInfo&&this.getValueCellInfo(r),S=r.value,e[n].hasChild||t[s].hasChild||"grand sum"===e[n].type||"grand sum"===t[s].type||this.showSubTotalsAtBottom&&e[n].isSum),O="grand sum"===e[n].type||"grand sum"===t[s].type,P=0<e[n].members.length&&e[n].hasChild&&e[n].isDrilled&&(!_e.isNullOrUndefined(e[n].showSubTotals)&&!e[n].showSubTotals||!this.dataSourceSettings.showSubTotals||!this.dataSourceSettings.showRowSubTotals),N=P?"":void 0===S?this.emptyCellTextContent:"Count"===u||"DistinctCount"===u?S.toLocaleString():this.getFormattedValue(S,c).formattedText;!isNaN(S)&&!_e.isNullOrUndefined(S)&&0<=["PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal"].indexOf(u)?N=this.globalize.formatNumber(S,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,r.fieldName)}):P||!isNaN(S)||_e.isNullOrUndefined(S)||-1===["PopulationStDev","SampleStDev","PopulationVar","SampleVar"].indexOf(u)||(N="#DIV/0!",S=0),N=r.skipFormatting?_e.isNullOrUndefined(S)?this.emptyCellTextContent:S.toString():N,a[i][o]=this.valueContent[l][o]={axis:"value",actualText:c,indexObject:this.isDrillThrough?this.rawIndexObject:{},rowHeaders:"grand sum"===e[n].type?"":e[n].valueSort.levelName,columnHeaders:"grand sum"===t[s].type?"":t[s].valueSort.levelName,formattedText:N,value:S,hierarchyName:t[s].hierarchyName,actualValue:f,rowIndex:i,colIndex:o,isSum:D,isGrandSum:O,showSubTotals:!P},this.rawIndexObject={}},t.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},t.prototype.updateValueMembers=function(e,t,i,a,r,n,s){var o=i&&!_e.isNullOrUndefined(i.levelName)?i.levelName.toString():void 0,l=i&&!_e.isNullOrUndefined(i.uniqueName)?i.uniqueName.toString():void 0;if(e)for(var d=0;d<n;d++){var h=this.dataSourceSettings.values[d],p=h.caption||h.name,u={axis:this.valueAxis?"row":"column",rowIndex:this.valueAxis?0:t&&s<=t.rowIndex?t.rowIndex+1:s,actualText:h.name,formattedText:p,level:0,valueSort:{},members:[],type:this.valueAxis?"value":t?t.type:null,index:!this.valueAxis&&t?t.index:null,indexObject:!this.valueAxis&&t?t.indexObject:null},c=(0<r.length&&(u.showSubTotals=h.showSubTotals),u.valueSort);c.axis=this.valueAxis?void 0:h.name,c[(o?o+this.valueSortSettings.headerDelimiter:"")+p]=1,c[(l?l+this.valueSortSettings.headerDelimiter:"")+h.name]=1,c.levelName=(o?o+this.valueSortSettings.headerDelimiter:"")+p,c.uniqueName=(l?l+this.valueSortSettings.headerDelimiter:"")+h.name,a.push(u),this.updateValueMembers(!1,t,c,u.members,r,n,s+1)}else for(var g=0,m=r.length;g<m;g++){var S=Ie.frameHeaderWithKeys(r[g]),f=(S.members=[],S.rowIndex=this.valueAxis?S.rowIndex:s<0?0:s,{}),v=(f.axis=S.valueSort.axis,f[(o?o+this.valueSortSettings.headerDelimiter:"")+S.formattedText]=1,f[(l?l+this.valueSortSettings.headerDelimiter:"")+S.actualText]=1,f.levelName=(o?o+this.valueSortSettings.headerDelimiter:"")+S.formattedText,f.uniqueName=(l?l+this.valueSortSettings.headerDelimiter:"")+S.actualText,S.hierarchyName=S.valueSort.uniqueName,(S.valueSort=f).axis+this.valueSortSettings.headerDelimiter+f.levelName),y=this.fieldList[f.axis];S.isDrilled&&((this.isExpandAll||y.expandAll)&&this.fieldDrillCollection[v]||!this.isExpandAll&&!y.expandAll&&!this.fieldDrillCollection[v])&&(S.isDrilled=!1),a.push(S),S.isDrilled&&0<r[g].members.length?(this.valueAxis&&s<this.measureIndex&&this.measureIndex!==s+1&&(!r[g].hasChild||(_e.isNullOrUndefined(r[g].showSubTotals)||r[g].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals)&&this.updateValueMembers(!0,S,f,a[a.length-1].members,[],n,s),this.updateValueMembers(this.measureIndex===s+1,S,f,a[a.length-1].members,r[g].members,n,s+1),!this.valueAxis&&s<this.measureIndex&&this.measureIndex!==s+1&&(!r[g].hasChild||(_e.isNullOrUndefined(r[g].showSubTotals)||r[g].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals)&&this.updateValueMembers(!0,S,f,a[a.length-1].members,[],n,s)):s<this.measureIndex&&this.updateValueMembers(!0,S,f,a[a.length-1].members,[],n,s)}},t.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)},t.prototype.frameDefinedHeaderData=function(e,t,i,a,r,n){for(var s=0,o=e.length;s<o;s++){var l,d,h=!0,p=(!(0<e[s].members.length)||(_e.isNullOrUndefined(e[s].showSubTotals)||e[s].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals||(h=!1),this.measureIndex<a&&h?1:this.measureIndex>a&&0<e[s].members.length||this.measureIndex!==a+1||!e[s].isDrilled?this.measureIndex===a&&0!==this.measureIndex&&h||this.measureIndex>a&&h&&e[s].valueSort&&e[s].valueSort.axis&&this.measureNames[e[s].valueSort.axis.toString()]?1:0:0!==this.measureIndex&&h?1:0),h=(e[s].members.length&&(l=void 0,d=e[s].members,this.showSubTotalsAtTop?a+1<this.measureIndex&&h?(l=r,d=this.reArrangeValueMember(d)):l=r+p:l=r,this.frameDefinedHeaderData(d,t,i,a+1,l,n)),this.measureIndex>a&&e[s].valueSort&&e[s].valueSort.axis&&this.measureNames[e[s].valueSort.axis.toString()]?this.measureIndex:a);t[(r=this.showSubTotalsAtTop?r+1:t.length+p)-1]||(t[r-1]=Ie.frameHeaderWithKeys(e[s])),e[s].colIndex=r,i[h]||(i[h]=[],this.headerContent[h]={}),i[h][r]=this.headerContent[h][r]=Ie.frameHeaderWithKeys(e[s]),this.isPagingOrVirtualizationEnabled||this.showSubTotalsAtTop&&0==p||t[r-1]&&(t[r-1].members=[]),this.showSubTotalsAtTop&&(r=t.length,s+1===o)&&0===e[s].level&&(this.reformAxisCount=t.length+1)}},t.prototype.getHeaderData=function(e,t,i,a,r,n,s,o,l){if(this.valueAxis||this.isLastHeaderHasMeasures){if(0===a.length&&this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&0<this.dataSourceSettings.values.length&&(this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&!_e.isNullOrUndefined(this.rMembers)&&0<this.rMembers.length&&"grand sum"===this.rMembers[this.rMembers.length-1].type?(this.updateValueMembers(0===this.measureIndex&&1<this.rMembers.length,null,null,a,this.rMembers.slice(0,this.rMembers.length-1),this.dataSourceSettings.values.length,0),this.updateValueMembers(!1,null,null,a,this.rMembers.slice(this.rMembers.length-1,this.rMembers.length),this.dataSourceSettings.values.length,-1)):"Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&0===this.measureIndex?(this.updateValueMembers(!1,null,null,a,this.rMembers.slice(0,1),this.dataSourceSettings.values.length,-1),this.updateValueMembers(0===this.measureIndex&&1<this.rMembers.length,null,null,a,this.rMembers.slice(1,this.rMembers.length),this.dataSourceSettings.values.length,0)):(M=0===e.length&&1===this.rMembers.length&&"grand sum"===this.rMembers[0].type,this.updateValueMembers(!M&&0===this.measureIndex,null,null,a,this.rMembers,this.dataSourceSettings.values.length,M?-1:0)),this.getAggregatedHeaders(e,t,a,r,i),0<this.selectedHeaders.values.length))for(O=this.selectedHeaders.selectedHeader.length,P=0;P<O;P++)if("row"===(D=this.selectedHeaders.selectedHeader[P]).axis)for(var d=D.aggregateHeaders.length,h=0;h<d;h++)if(D.aggregateHeaders[h].actualText===D.value)if(-1!==D.aggregateHeaders[h].valueSort.levelName.indexOf(D.uniqueName))D.uniqueName=D.aggregateHeaders[h].valueSort.levelName,D.aggregateHeaders.splice(h,1),h--,d--;else for(var p,u=D.aggregateHeaders[h].members.length,c=0;c<u;c++)"value"!==(E=D.aggregateHeaders[h].members[c]).type&&E.level===D.aggregateHeaders[h].level&&(p=_e.extend([],D.aggregateHeaders[h].members,null,!0),D.aggregateHeaders=[].concat(D.aggregateHeaders,p,D.aggregateHeaders.splice(h)),D.aggregateHeaders.splice(p.length+h,1),h=p.length+h-1,d=D.aggregateHeaders.length);else if(D.aggregateHeaders[h].actualText!==D.value&&0<D.aggregateHeaders[h].members.length)for(u=D.aggregateHeaders[h].members.length,c=0;c<u;c++)if((E=D.aggregateHeaders[h].members[c]).actualText===D.value){D.uniqueName===D.aggregateHeaders[h].valueSort.levelName&&(D.uniqueName=E.valueSort.levelName),D.aggregateHeaders[h].members.splice(c,1),D.aggregateHeaders[h]=E;break}for(var g=r.length,m=this.dataSourceSettings.columns.length,S=this.valueSortSettings.headerText,f=0;f<g;f++){var v=!_e.isNullOrUndefined(r[f].showSubTotals)&&!r[f].showSubTotals,y=(r[f].members.length&&this.getHeaderData(e,t,i,a,r[f].members,n,s,this.showSubTotalsAtTop&&!v?o+1:o,l),!0),v=(o=this.showSubTotalsAtTop?o:n.length,!v&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals?n[o]=Ie.frameHeaderWithKeys(r[f]):(0<r[f].members.length?(this.removeCount++,y=!1):n[this.showSubTotalsAtTop?o:n.length]=Ie.frameHeaderWithKeys(r[f]),o=this.showSubTotalsAtTop?o:n.length-1),r[f].level),b=(r[f].rowIndex=v,o*l+(this.showSubTotalsAtTop?1:l)),v=(r[f].colIndex=b,s[v]||(s[v]=[],this.headerContent[v]={}),s[v][b]=this.headerContent[v][b]=Ie.getFormattedHeader(r[f],this),0===this.dataSourceSettings.columns.length&&1===this.dataSourceSettings.values.length);if((this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader||v)&&!this.valueAxis&&y)for(var C=0;C<l;C++){var x=this.dataSourceSettings.values[C].caption||this.dataSourceSettings.values[C].name,w={axis:"column",actualText:this.dataSourceSettings.values[C].name,formattedText:x,level:0,valueSort:{},colIndex:o*l+1+C,rowIndex:m},w=(s[m]||(s[m]=[],this.headerContent[m]={}),s[m][o*l+1+C]=this.headerContent[m][o*l+1+C]=w,s[m][o*l+1+C].valueSort);w[r[f].valueSort.levelName+this.valueSortSettings.headerDelimiter+x]=1,w.levelName=r[f].valueSort.levelName+this.valueSortSettings.headerDelimiter+x,w[r[f].valueSort.uniqueName+this.valueSortSettings.headerDelimiter+this.dataSourceSettings.values[C].name]=1,w.uniqueName=r[f].valueSort.uniqueName+this.valueSortSettings.headerDelimiter+this.dataSourceSettings.values[C].name,w&&w[S]&&(this.valueSortSettings.columnIndex=o*l+1+C)}else r[f].valueSort&&r[f].valueSort[S]&&(this.valueSortSettings.columnIndex=o*l+1);this.isPagingOrVirtualizationEnabled||(n[o].members=[]),this.showSubTotalsAtTop&&(o=n.length,0===r[f].level)&&f+1===g&&(this.reformAxisCount=n.length*l+1)}}else{var T,M=[];if(this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals&&"grand sum"===r[r.length-1].type?(this.updateValueMembers(0===this.measureIndex&&1<r.length,null,null,M,r.slice(0,r.length-1),l,0),this.updateValueMembers(!1,null,null,M,r.slice(r.length-1,r.length),l,-1)):"Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&0===this.measureIndex?(this.updateValueMembers(!1,null,null,M,r.slice(0,1),l,-1),this.updateValueMembers(0===this.measureIndex&&1<r.length,null,null,M,r.slice(1,r.length),l,0)):(T=0===t.length&&1===r.length&&"grand sum"===r[0].type,this.updateValueMembers(!T&&0===this.measureIndex,null,null,M,r,l,T?-1:0)),this.getAggregatedHeaders(e,t,this.rMembers,M,i),0<this.selectedHeaders.values.length)for(var D,O=this.selectedHeaders.selectedHeader.length,P=0;P<O;P++)if("column"===(D=this.selectedHeaders.selectedHeader[P]).axis)if(D.uniqueName===D.value)this.selectedHeaders.selectedHeader.splice(P,1),P--,O--;else if("Grand Total"===D.uniqueName)for(var N=D.aggregateHeaders.length,h=0;h<N;h++)if(D.aggregateHeaders[h]&&0<D.aggregateHeaders[h].members.length)for(var E,I=0,F=D.aggregateHeaders[h].members;I<F.length;I++)(E=F[I]).actualText===D.value&&"grand sum"===(D.aggregateHeaders[h]=E).type&&(D.uniqueName=E.valueSort.levelName);this.frameDefinedHeaderData(M,n,s,0,this.showSubTotalsAtTop?0:1,l)}},t.prototype.getAggregateValue=function(e,t,i,a,r){var n=0,s=0,o=0,l=!0,d=!1;switch(a.toLowerCase()){case"median":for(var h=[],p=0;void 0!==e[n];)void 0!==t[C=e[n]]&&(d=!0,this.rawIndexObject[C]=C,_e.isNullOrUndefined(this.valueMatrix[C][i].member)||h.push(this.valueMatrix[C][i].member)),n++;0<(O=h.length)&&(h.sort(function(e,t){return e-t}),s=O%2==0?(h[p=O/2<=1?0:O/2-1]+h[p+1])/2:h[p=(O+1)/2<=1?0:(O+1)/2-1]);break;case"count":for(;void 0!==e[n];)void 0!==t[C=e[n]]&&(d=!0,this.rawIndexObject[C]=C,s+=_e.isNullOrUndefined(this.valueMatrix[C][i].member)?0:this.allowDataCompression?this.valueMatrix[C][i].member:1),n++;break;case"distinctcount":for(var u=[];void 0!==e[n];)void 0!==t[e[n]]&&(this.rawIndexObject[e[n]]=e[n],d=!0,m=this.data[e[n]][this.fieldKeys[this.fields[i]]],!_e.isNullOrUndefined(m))&&(c=m.toString(),0===u.length||0<u.length&&-1===u.indexOf(c))&&(s+=this.allowDataCompression&&"number"==typeof m?m:1,u.push(c)),n++;break;case"product":for(;void 0!==e[n];)void 0!==t[C=e[n]]&&(this.rawIndexObject[C]=C,d=!0,c=this.valueMatrix[C][i].member,_e.isNullOrUndefined(c)?l&&(s=c):(s=l||_e.isNullOrUndefined(s)?1:s,s*=c),l=!1),n++;break;case"populationstdev":case"samplestdev":case"populationvar":case"samplevar":for(var c,g=0,m=0,S=[],p=0,f=0;void 0!==e[n];)void 0!==t[C=e[n]]&&(d=!0,this.rawIndexObject[C]=C,c=this.valueMatrix[C][i].member,_e.isNullOrUndefined(c)||(m+=c,S.push(c),g++)),n++;if(0<g){for(var v=m/g,y=0,b=S;y<b.length;y++){var C=b[y];f+=Math.pow(C-v,2)}s=0===(p=-1!==["populationstdev","samplestdev"].indexOf(a.toLowerCase())?Math.sqrt(f/("populationstdev"===a.toLowerCase()?g:g-1)):f/("populationvar"===a.toLowerCase()?g:g-1))?NaN:p}else s=m;break;case"min":for(var x=!0,s=void 0;void 0!==e[n];)void 0!==t[C=e[n]]&&void 0!==this.valueMatrix[C][i].member&&(d=!0,this.rawIndexObject[C]=C,_e.isNullOrUndefined(s)&&_e.isNullOrUndefined(this.valueMatrix[C][i].member)?s=this.valueMatrix[C][i].member:x?(s=this.valueMatrix[C][i].member,x=!1):s=this.valueMatrix[C][i].member<s?this.valueMatrix[C][i].member:s),n++;break;case"max":for(var w=!0;void 0!==e[n];)void 0!==t[C=e[n]]&&void 0!==this.valueMatrix[C][i].member&&(d=!0,this.rawIndexObject[C]=C,w?(s=this.valueMatrix[C][i].member,w=!1):s=this.valueMatrix[C][i].member>s?this.valueMatrix[C][i].member:s),n++;break;case"calculatedfield":d=!0;var p=this.calculatedFields[this.fields[i]],T=p.formula,M={};if(this.calculatedFormulas[p.name])for(var D=this.calculatedFormulas[p.name],O=0,P=D.length;O<P;O++){var N,E=D[O],I=M[E.formula];void 0===I&&(N=E.type,I=this.getAggregateValue(e,t,E.index,N,!1),M[E.formula]=I),T=T.replace(E.formula,String(I))}s=(s=this.evaluate(T))===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[n];)void 0!==t[C=e[n]]&&(d=!0,r||(this.rawIndexObject[C]=C),c=this.valueMatrix[C][i].member,_e.isNullOrUndefined(s)&&_e.isNullOrUndefined(c)?s=c:(_e.isNullOrUndefined(s)&&(s=0),s+=_e.isNullOrUndefined(c)?0:c),_e.isNullOrUndefined(c)||o++),n++}return a&&"avg"===a.toLowerCase()&&0!==s&&!_e.isNullOrUndefined(s)?s/o:d?s:void 0},t.prototype.evaluate=function(e){return Function('"use strict";return ('+e+")")()},t.prototype.getFormattedValue=function(e,t){var i=null===e?this.localeObj?this.localeObj.getConstant("null"):String(e):void 0===e?this.localeObj?t in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(e):e,a={formattedText:i.toString(),actualText:i,dateText:i};if(this.formatFields[t]&&(this.formatFields[t].format||this.formatFields[t].skeleton)&&!_e.isNullOrUndefined(e))try{var r=this.formatFields[t].properties||this.formatFields[t],n=_e.extend({},r,null,!0);delete n.name,!n.minimumSignificantDigits&&n.minimumSignificantDigits<1&&delete n.minimumSignificantDigits,!n.maximumSignificantDigits&&n.maximumSignificantDigits<1&&delete n.maximumSignificantDigits,n.type?(a.formattedText=null===this.dateFormatFunction[t].exactFormat(new Date(e))?a.formattedText:this.dateFormatFunction[t].exactFormat(new Date(e)),a.actualText=e):(delete n.type,n.format&&!this.formatRegex.test(n.format)&&(_e.isNullOrUndefined(n.minimumFractionDigits)&&delete n.minimumFractionDigits,_e.isNullOrUndefined(n.maximumFractionDigits)&&delete n.maximumFractionDigits,_e.isNullOrUndefined(n.minimumIntegerDigits))&&delete n.minimumIntegerDigits,a.formattedText=this.globalize.formatNumber(isNaN(Number(e))?e:Number(e),n),a.actualText=isNaN(Number(e))?e:Number(e),a.dateText=isNaN(Number(e))?e:Number(e)),"None"!==this.fieldList[t].sort&&n.type&&-1<["date","dateTime","time"].indexOf(this.formatFields[t].type)&&(a.dateText=this.dateFormatFunction[t].fullFormat(new Date(e))),this.fieldList[t].isCustomField&&(a.formattedText="NaN"===a.formattedText?i.toString():a.formattedText,a.dateText="NaN"===a.dateText?i.toString():a.dateText)}catch(e){if(!this.fieldList[t].isCustomField)throw e}finally{this.fieldList[t].isCustomField&&(a.formattedText=_e.isNullOrUndefined(a.formattedText)||"NaN"===a.formattedText?i.toString():a.formattedText,a.dateText=_e.isNullOrUndefined(a.dateText)||"NaN"===a.dateText?i.toString():a.dateText)}return a},t.prototype.powerFunction=function(e){if(-1<e.indexOf("^")){for(var i=[];-1<e.indexOf("(");)e=e.replace(/(\([^()]*\))/g,function(e,t){return i.push(t),"~"+(i.length-1)});for(i.push(e),e="~"+(i.length-1);-1<e.indexOf("~");)e=e.replace(new RegExp("~(\\d+)","g"),function(e,t){return i[t].replace(/(\w*)\^(\w*)/g,"Math.pow($1,$2)")})}return e},t.prototype.getTabularPivotValues=function(e,t,i){this.tabularPivotValues=[];var a=0<Object.keys(this.groupingFields).length;"row"!==this.dataSourceSettings.valueAxis||!(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)||t||i||(this.rowMaxLevel=this.rowMaxLevel+1);for(var r=0;r<this.pivotValues.length;r++){for(var n=void 0,s=!1,o=!0,l=void 0,d=void 0,h=!1;_e.isNullOrUndefined(this.pivotValues[r])&&r<this.pivotValues.length;)this.tabularPivotValues.length++,r++;var p,u,c,g,m=(n=r<this.pivotValues.length?this.pivotValues[r]:n)[0]||void 0;if(m&&(l=m.valueSort.levelName.split(this.dataSourceSettings.valueSortSettings.headerDelimiter),(!this.dataSourceSettings.showSubTotals&&"value"!==m.type||this.dataSourceSettings.showColumnSubTotals&&!this.dataSourceSettings.showRowSubTotals)&&m.formattedText!==this.localeObj.getConstant("grandTotal")&&m.isSum&&(o=!1),a)&&(p=this.pivotValues[r-1][0],u=this.tabularPivotValues[this.tabularPivotValues.length-1][this.rowMaxLevel-1],_e.isNullOrUndefined(p)&&_e.isNullOrUndefined(u)||(c=p.valueSort.axis,g=void 0,!_e.isNullOrUndefined(u)&&u.valueSort.axis&&(g=u.valueSort.axis),d=(c.includes("custom_group")||!_e.isNullOrUndefined(g)&&g.includes("custom_group"))&&(p.formattedText===l[this.rowMaxLevel-1]&&p.formattedText!==l[l.length-1]||u&&u.formattedText===l[this.rowMaxLevel-1])?p.valueSort.axis||u.valueSort.axis:m.valueSort.axis)),m&&"row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)){if("value"===m.type&&l.length-1!==this.rowMaxLevel&&l[0]!==this.localeObj.getConstant("grandTotal"))for(var S=0;S<this.dataSourceSettings.values.length;S++)if(m.formattedText===this.dataSourceSettings.values[S].name){m.hasChild=o=!1;break}l.length-1!==this.rowMaxLevel&&(m.isDrilled=!0,!m.hasChild&&!m.type||l[0]===this.localeObj.getConstant("grandTotal")&&"grand sum"===m.type)?m.hasChild=!0:m.level=l.length-1,s=Ie.isMemberDrilled(m,l,this.drilledMembers)}if(o&&l&&1<l.length&&"sum"===m.type&&l[l.length-1]===l[l.length-2]&&(o=!1),_e.isNullOrUndefined(m)||"row"!==m.axis){for(var f=[],v=this.rowMaxLevel+1,y=0;y<this.rowMaxLevel;y++)f.push(void 0);f.push(m);for(var b=n.slice(1,n.length),C=0;C<b.length;C++)b[C].colIndex=v,b[C].rowIndex=this.tabularPivotValues.length,v++;f=f.concat(b),this.tabularPivotValues.push(f)}else if(!_e.isNullOrUndefined(n[1])&&(!m.hasChild||!m.isDrilled)&&o){var x=[];if("row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&(e&&s?l.length-1<this.rowMaxLevel:l.length<=this.rowMaxLevel)&&"value"===m.type&&(this.dataSourceSettings.expandAll?!s:s)||l[0]===this.localeObj.getConstant("grandTotal")){for(var w=l.length-1;0<=w;w--){if(h=!0,l[w]===l[l.length-2]){if(x[w]=l[l.length-2]+" "+l[l.length-1],0===w)break;for(;0<=w;)x[w-1]=l[w-1],w--;break}x[w]=l[l.length-2]+" "+l[l.length-1]}l=x}for(var T=m.colIndex,M=[],D=l[0],O=0,P=0;P<l.length-1||P<this.rowMaxLevel;P++){var N=void 0,E=void 0,I=m.isDrilled,F=m.hasChild;"row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)?(E=N=!1,l[l.length-1]!==l[l.length-2]&&(P<(l.length-1===this.rowMaxLevel&&this.dataSourceSettings.rows.length===this.rowMaxLevel?l.length-2:l.length-1)&&(E=!0),P<l.length-2)&&(N=!0)):(P<this.rowMaxLevel&&(F=!0),(1<l.length||0===P)&&(I=!0)),P<l.length-1&&(0<P&&(D=D+this.dataSourceSettings.valueSortSettings.headerDelimiter+l[P]),M.push({actualText:l[P],axis:m.axis,formattedText:l[P],rowIndex:this.tabularPivotValues.length,hasChild:"row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&"grand sum"!==m.type?E:F,isDrilled:"row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&"grand sum"!==m.type?N:I,level:O,valueSort:{levelName:h&&"value"===m.type&&P===this.rowMaxLevel?m.valueSort.levelName:D,axis:a?d?d.includes("custom_group")?d:this.dataSourceSettings.rows[P].name:m.valueSort.axis:this.dataSourceSettings.rows[P]?this.dataSourceSettings.rows[P].name:m.valueSort.axis},type:h?m.type:void 0,colIndex:T++,colSpan:1,rowSpan:1})),P>=m.level&&(F=0===P?this.rowMaxLevel:this.rowMaxLevel-1,M.push({actualText:"row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)?void 0===l[P]?l[l.length-1]:l[P]:m.formattedText,axis:m.axis,formattedText:"row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)?void 0===l[P]?l[l.length-1]:l[P]:m.formattedText,rowIndex:this.tabularPivotValues.length,hasChild:"row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&"grand sum"!==m.type?E:m.hasChild,isDrilled:"row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&"grand sum"!==m.type?N:m.isDrilled,level:O,valueSort:{levelName:m.valueSort.levelName,axis:a?d?d.includes("custom_group")?d:this.dataSourceSettings.rows[P].name:m.valueSort.axis:this.dataSourceSettings.rows[P].name},type:h?m.type:m.type||void 0,colIndex:T++,colSpan:F,rowSpan:1})),O++}m.colIndex=T,m.rowIndex=this.tabularPivotValues.length,m.colSpan=1,m.rowSpan=1,"row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&(m.formattedText=l[l.length-1]),M.push(m),this.setColumnSpan(M,m);for(var b=n.slice(1,n.length),L=1;L<n.length;L++){var A=n[L];A.colIndex=T+1,A.rowIndex=this.tabularPivotValues.length,T++}M=M.concat(b),this.tabularPivotValues.push(M)}}return this.tabularPivotValues},t.prototype.setColumnSpan=function(e,t){for(var i=1,a=e.length-1;0<=a;a--)if(0!==a&&e[a].formattedText===e[a-1].formattedText&&e[a].valueSort.levelName===e[a-1].valueSort.levelName&&(e[a].colSpan=0,i++,e[a-1].colSpan=i),a<("row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)?e.length-2:e.length-1)&&!t.isSum&&e[e.length-1].formattedText!==e[e.length-2].formattedText&&"grand sum"!==t.type){e[a].hasChild=!0;for(var r=this.dataSourceSettings.drilledMembers,n=0;n<r.length;n++)for(var s=0;s<r[n].items.length;s++)r[n].items[s]===e[a].formattedText&&(e[a].isDrilled=!!e[a].isDrilled)}},t.prototype.setRowSpan=function(){for(var e=this.headerContent.length,t=0;t<this.rowMaxLevel;t++){var i=1;if(this.tabularPivotValues.length>this.rowMaxLevel+e)for(var a=this.tabularPivotValues.length-1;e-1<=a;a--)if(a!==e-1){var r,n,s,o=this.tabularPivotValues;if(_e.isNullOrUndefined(o[a-1]))break;!_e.isNullOrUndefined(o[a-1][t])&&(r=-1!==(r=(n=o[a-1][t].valueSort.levelName).lastIndexOf(this.dataSourceSettings.valueSortSettings.headerDelimiter))?n.substring(0,r):n,s=-1!==(s=(n=o[a][t].valueSort.levelName).lastIndexOf(this.dataSourceSettings.valueSortSettings.headerDelimiter))?n.substring(0,s):n,o[a][t].formattedText===o[a-1][t].formattedText)&&s===r?(o[a][t].rowSpan=0,i++,o[a-1][t].rowSpan=i):i=1}}},t);function t(){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.lastMember={},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.tabularPivotValues=[],this.sortMembers={},this.viewportPageCount=3}var aa="load",ra="enginePopulating",na="enginePopulated",sa="onFieldDropped",oa="fieldDrop",la="beforeExport",da="exportComplete",ha="excelHeaderQueryCellInfo",pa="pdfHeaderQueryCellInfo",ua="excelQueryCellInfo",ca="pdfQueryCellInfo",ga="onPdfCellRender",ma="dataBound",Sa="queryCellInfo",fa="headerCellInfo",va="hyperlinkCellClick",ya="resizing",ba="resizeStop",Ca="cellClick",xa="drillThrough",wa="beforeColumnsRender",Ta="selected",Ma="selecting",Da="cellSelecting",Oa="drill",Pa="cellSelected",Na="cellDeselected",Ea="rowSelected",Ia="rowDeselected",Fa="beginDrillThrough",La="editCompleted",Aa="multiLevelLabelClick",Ra="saveReport",ka="fetchReport",ja="loadReport",qa="renameReport",Ha="removeReport",Va="newReport",Ua="toolbarRender",_a="toolbarClick",Ba="chartTooltipRender",Ga="chartLegendClick",za="chartLoaded",Wa="multiLevelLabelRender",Qa="beforePrint",Ya="animationComplete",Ka="legendRender",Xa="textRender",Ja="pointRender",Za="seriesRender",$a="chartMouseMove",er="chartMouseClick",tr="pointMove",ir="chartMouseLeave",ar="chartMouseDown",rr="chartMouseUp",nr="dragComplete",sr="zoomComplete",or="scrollStart",lr="scrollEnd",dr="scrollChanged",hr="chartLoad",pr="chartResized",ur="chartAxisLabelRender",cr="chartSeriesCreated",gr="aggregateCellInfo",mr="onHeadersSort",Sr="contextMenuClick",fr="contextMenuOpen",vr="fieldListRefreshed",yr="conditionalFormatting",br="beforeExcelExport",Cr="memberFiltering",xr="calculatedFieldCreate",wr="memberEditorOpen",Tr="fieldRemove",Mr="numberFormatting",Dr="aggregateMenuOpen",Or="fieldDragStart",Pr="chartPointClick",Nr="beforeServiceInvoke",Er="afterServiceInvoke",Ir="actionBegin",Fr="actionComplete",Lr="actionFailure",Ar="initial-load",Rr="ui-update",kr="vertical-scroll",jr="horizontal-scroll",qr="content-ready",Hr="data-ready",Vr="init-groupingbar",Ur="tree-view-update",_r="pivot-button-update",Br="init-calculatedfield",Gr="init-toolbar",zr="init-pivotPager",Wr="init-formatting",Qr="init-grouping",Yr="Sort value",Kr="Drill up",Xr="Drill down",Jr="Add new report",Zr="Save current report",$r="Save as current report",en="Rename current report",tn="Remove current report",an="Load report",rn="Open conditional formatting dialog",nn="Open number formatting dialog",sn="MdxQuery",on="Open field list",ln="Show table view",dn="Show chart view",hn="Multiple Axis",pn="Show legend",un="PDF export",cn="PNG export",gn="Excel export",mn="CSV export",Sn="JPEG export",fn="SVG export",vn="Hide sub-totals",yn="Show row sub-totals",bn="Show column sub-totals",Cn="Show sub-totals",xn="Hide grand totals",wn="Show row grand totals",Tn="Show column grand totals",Mn="Show grand totals",Dn="Number Formatting menu",On="Conditional Formatting menu",Pn="Report change",Nn="Sort field tree",En="Edit calculated field",In="Sort field",Fn="Filter field",Ln="Remove field",An="Open calculated field dialog",Rn="Edit record",kn="Save edited records",jn="Add new record",qn="Remove record",Hn="Aggregate field",Vn="Window resize",Un="Navigate row page",_n="Navigate column page",Bn="Calculated field applied",Gn="Edited records saved",zn="New record added",Wn="Record removed",Qn="Field list closed",Yn="Field tree sorted",Kn="Report saved",Xn="New report added",Jn="Report re-saved",Zn="Report renamed",$n="Report removed",es="Excel exported",ts="CSV exported",is="PDF exported",as="PNG exported",rs="JPEG exported",ns="SVG exported",ss="Conditional formatting applied",os="Number formatting applied",ls="Table view shown",ds="Chart view shown",hs="Sub-totals hidden",ps="Row sub-totals shown",us="Column sub-totals shown",cs="Sub-totals shown",gs="Grand totals hidden",ms="Row grand totals shown",Ss="Column grand totals shown",fs="Grand totals shown",vs="Value sorted",ys="Calculated field edited",bs="Field sorted",Cs="Field filtered",xs="Field removed",ws="Field aggregated",Ts="Record edited",Ms="Report changed",Ds="Window resized",Os="Records updated",Ps="Drill-through closed",Ns="Vertically scrolled",Es="Horizontally scrolled",Is="Row page navigated",Fs="Column page navigated",Ls="Action dropped",As="Invalid formula",Rs=(ks.prototype.render=function(e,t){this.parentElement=t,this.openContextMenu(e)},ks.prototype.openContextMenu=function(t){var i=this,e=t.target.parentElement.getAttribute("data-uid"),a=Ie.getFieldInfo(e,this.parent),r=(this.buttonElement=t.target.parentElement,"number"!==this.parent.engineModule.fieldList[e].type?1:0),n=this.getMenuItem(r).slice();if(this.parent.actionObj.actionName=Hn,this.parent.actionObj.fieldInfo=a.fieldItem,!this.parent.actionBeginMethod()){a={cancel:!1,fieldName:e,aggregateTypes:n,displayMenuCount:7},e="pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent;try{e.trigger(Dr,a,function(e){e.cancel||(n=e.aggregateTypes,i.createContextMenu(r,n,e.displayMenuCount),i.currentMenu=t.target,e=i.currentMenu.getBoundingClientRect(),i.parent.enableRtl?i.menuInfo[r].open(e.top+(window.scrollY||document.documentElement.scrollTop),e.left-105):i.menuInfo[r].open(e.top+(window.scrollY||document.documentElement.scrollTop),e.left))})}catch(e){this.parent.actionFailureMethod(e)}}},ks.prototype.createContextMenu=function(e,t,i){for(var a=this,r=[],n=(r[e]=[],this.menuInfo[e]&&!this.menuInfo[e].isDestroyed&&this.menuInfo[e].destroy(),[]),s=0;s<t.length;s++){var o=t[s];e?-1<this.stringAggregateTypes.indexOf(o)&&n.indexOf(o)<0&&(r[e].push({text:this.parent.localeObj.getConstant(o),id:this.parent.element.id+"StringMenu_"+o}),n.push(o)):-1<this.parent.getAllSummaryType().indexOf(o)&&n.indexOf(o)<0&&(r[e].push({text:this.parent.localeObj.getConstant(o),id:this.parent.element.id+"_"+o}),n.push(o))}r[e].length>i&&(r[e].splice(i),r[e].push({text:this.parent.localeObj.getConstant("MoreOption"),id:this.parent.element.id+"_MoreOption"}));var i={items:r[e],enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:this.parent.cssClass,beforeOpen:this.beforeMenuOpen.bind(this,e),onClose:function(){_e.select("#"+a.buttonElement.id,a.parentElement).focus()},select:this.selectOptionInContextMenu.bind(this)},l=document.getElementById(this.parent.element.id+(e?"valueFieldStringContextMenu":"valueFieldContextMenu"));null!==l?l.innerHTML="":l=_e.createElement("ul",{id:this.parent.element.id+(e?"valueFieldStringContextMenu":"valueFieldContextMenu")}),this.parent.element.appendChild(l),this.menuInfo[e]=new D.ContextMenu(i),this.menuInfo[e].isStringTemplate=!0,this.menuInfo[e].appendTo(l)},ks.prototype.getMenuItem=function(e){for(var t=[],i=0;i<this.parent.aggregateTypes.length;i++){var a=this.parent.aggregateTypes[i];e?-1<this.stringAggregateTypes.indexOf(a)&&-1===t.indexOf(a)&&t.push(a):-1<this.parent.getAllSummaryType().indexOf(a)&&-1===t.indexOf(a)&&t.push(a)}return t},ks.prototype.beforeMenuOpen=function(e,t){t.element.style.zIndex=(this.menuInfo[e].element.style.zIndex+3).toString(),t.element.style.display="inline"},ks.prototype.createValueSettingsDialog=function(e,t,i){this.parentElement=t;var t=_e.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")}}),a=(this.parentElement.appendChild(t),new P.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,header:this.parent.localeObj.getConstant("valueFieldSettings"),content:this.createFieldOptions(e,i),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:Re+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:function(){a.hide()},isFlat:!1,buttonModel:{cssClass:ke+(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}));a.isStringTemplate=!0,a.appendTo(t)},ks.prototype.createFieldOptions=function(e,t){for(var a=this,i=e.getAttribute("data-caption"),t=t&&"MoreOption"!==t?t:e.getAttribute("data-type"),r=e.getAttribute("data-basefield"),n=e.getAttribute("data-baseitem"),t="undefined"!==t.toString()?t:"Sum",s=[],o=this.parent.aggregateTypes,l=[],d=0;d<o.length;d++)-1<this.parent.getAllSummaryType().indexOf(o[d])&&l.indexOf(o[d])<0&&(s.push({value:o[d],text:this.parent.localeObj.getConstant(o[d])}),l.push(o[d]));for(var h,p,u=["DifferenceFrom","PercentageOfDifferenceFrom"],c=["DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"],g=(g=_e.extend([],this.parent.dataSourceSettings.rows,null,!0)).concat(this.parent.dataSourceSettings.columns),m=[],S=[],f=0,v=g;f<v.length;f++){var y=v[f],k=y.name,y=y.caption||y.name;m.push({value:k,text:y})}S=0===Object.keys(m).length?(m.push({value:"",text:""}),r="",[]):(h="undefined"!==(r=r&&"undefined"!==r.toString()&&"null"!==r.toString()?r:m[0].value).toString()?r:m[0].value,p=Ie.isDateField(h,this.parent.engineModule),this.parent.engineModule.fieldList[h].dateMember.map(function(e){return(p?e:a.parent.engineModule.getFormattedValue(e.actualText,h)).formattedText}));var n="undefined"!==n.toString()?n:S[0],g=_e.createElement("div",{className:"e-value-field-div-content",id:this.parentElement.id+"_field_div_content",attrs:{"data-type":t,"data-caption":i,"data-basefield":r,"data-baseitem":n}}),b=_e.createElement("div",{className:"e-field-name-text-container"}),C=_e.createElement("div",{className:"e-field-option-container"}),x=_e.createElement("div",{className:"e-type-option-container"}),w=_e.createElement("div",{className:"e-base-field-option-container"}),T=_e.createElement("div",{className:"e-base-item-option-container"}),M=_e.createElement("div",{className:"e-field-name-title"}),D=(M.innerText=this.parent.localeObj.getConstant("sourceName")+" ",_e.createElement("div",{className:"e-field-name-content"})),e=(D.innerText=this.parent.enableHtmlSanitizer?_e.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||document.getElementsByClassName(D.innerText)[0],_e.createElement("div",{className:"e-type-option-text"})),O=(e.innerText=this.parent.localeObj.getConstant("sourceCaption"),_e.createElement("div",{className:"e-base-field-option-text"})),P=(O.innerText=this.parent.localeObj.getConstant("summarizeValuesBy"),_e.createElement("div",{className:"e-base-item-option-text"})),N=(P.innerText=this.parent.localeObj.getConstant("baseField"),_e.createElement("div",{className:"e-type-option-text"})),E=(N.innerText=this.parent.localeObj.getConstant("baseItem"),_e.createElement("div",{className:"e-caption-input-container"})),I=_e.createElement("div",{id:this.parentElement.id+"_type_option"}),F=_e.createElement("div",{id:this.parentElement.id+"_base_field_option"}),L=_e.createElement("div",{id:this.parentElement.id+"_base_item_option"}),j=_e.createElement("input",{id:this.parentElement.id+"type_input_option",className:"e-caption-input-text",attrs:{type:"text"}}),q=(b.appendChild(M),b.appendChild(D),E.appendChild(e),E.appendChild(j),x.appendChild(O),w.appendChild(P),T.appendChild(N),x.appendChild(I),w.appendChild(F),T.appendChild(L),C.appendChild(b),C.appendChild(E),C.appendChild(x),C.appendChild(w),C.appendChild(T),g.appendChild(C),this),M=new G.DropDownList({dataSource:s,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:t,cssClass:pt+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){A.enabled=-1!==c.indexOf(e.value),R.enabled=-1!==u.indexOf(e.value),R.enabled&&1===R.dataSource.length&&(R.dataSource=S,R.dataBind())}}),A=(M.isStringTemplate=!0,M.appendTo(I),new G.DropDownList({dataSource:m,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:r,enabled:-1!==c.indexOf(t),cssClass:pt+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(t){var i=Ie.isDateField(t.value,a.parent.engineModule);S=q.parent.engineModule.fieldList[t.value].dateMember.map(function(e){return(i?e:a.parent.engineModule.getFormattedValue(e.actualText,t.value)).formattedText}),R.dataSource=S,R.value=S[0],R.filterBarPlaceholder=q.parent.localeObj.getConstant("example")+" "+S[0],R.itemData=null,R.dataBind()}})),R=(A.isStringTemplate=!0,A.appendTo(F),new G.DropDownList({dataSource:S,enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:n,allowFiltering:!0,filterBarPlaceholder:this.parent.localeObj.getConstant("example")+" "+S[0],enabled:-1!==u.indexOf(t),cssClass:ut+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%"})),D=(R.isStringTemplate=!0,R.appendTo(L),new H.MaskedTextBox({placeholder:"Enter field caption",enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:i,width:"100%",cssClass:this.parent.cssClass}));return D.isStringTemplate=!0,D.appendTo(j),g},ks.prototype.selectOptionInContextMenu=function(e){if(null!==e.item.text){var t=this.currentMenu.parentElement,i=Ie.getFieldInfo(t?t.getAttribute("data-uid"):"",this.parent);if(this.parent.actionObj.actionName=Hn,this.parent.actionObj.fieldInfo=i.fieldItem,!this.parent.actionBeginMethod()){var a=e.item.id.split("_").pop();try{if("MoreOption"===a||"PercentageOfDifferenceFrom"===a||"PercentageOfParentTotal"===a||"DifferenceFrom"===a)this.createValueSettingsDialog(t,this.parentElement,a);else{var r=t.getAttribute("data-uid"),n=this.parent.dataSourceSettings.values,s=t.querySelector("."+ge),o=e.item.text+" "+this.parent.localeObj.getConstant("of")+" "+this.parent.engineModule.fieldList[r].caption,o=this.parent.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(o):o;this.parent.dataSourceSettings.showAggregationOnValueField&&(s.innerText=o),s.setAttribute("title",o),t.setAttribute("data-type",a);for(var l,d=0;d<this.parent.dataSourceSettings.values.length;d++)this.parent.dataSourceSettings.values[d].name===r&&((l=_e.extend({},n[d].properties||n[d],null,!0)).type=a,this.parent.engineModule.fieldList[r].aggregateType=a,n.splice(d,1,l),this.parent.lastAggregationInfo=l);this.updateDataSource()}}catch(e){this.parent.actionFailureMethod(e)}}}},ks.prototype.updateDataSource=function(e){!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate||"pivotview"===this.parent.getModuleName()||this.parent.isAdaptive&&"pivotfieldlist"===this.parent.getModuleName()&&"Popup"===this.parent.renderMode?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(Rr,this),this.parent.pivotGridModule.engineModule=this.parent.engineModule):this.parent.triggerPopulateEvent()},ks.prototype.updateValueSettings=function(){var e,t,i=_e.getInstance(_e.select("#"+this.parentElement.id+"_ValueDialog",document),P.Dialog),a=i.element,r=_e.getInstance(_e.select("#"+this.parentElement.id+"type_input_option"),H.MaskedTextBox),n=_e.getInstance(_e.select("#"+this.parentElement.id+"_type_option"),G.DropDownList),s=_e.getInstance(_e.select("#"+this.parentElement.id+"_base_field_option"),G.DropDownList),o=_e.getInstance(_e.select("#"+this.parentElement.id+"_base_item_option"),G.DropDownList),a=a.getAttribute("data-field"),l=((e=this.parentElement.querySelector("."+Y)?this.parentElement.getElementsByClassName(Y+" "+a.replace(/[^A-Z0-9]/gi,""))[0]:e)&&(l=e.querySelector("."+ge),t=this.parent.dataSourceSettings.showAggregationOnValueField?this.parent.localeObj.getConstant(n.value)+" "+this.parent.localeObj.getConstant("of")+" "+r.value:r.value,t=this.parent.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(t):t,l.innerText=t,l.setAttribute("title",t),e.setAttribute("data-type",n.value),e.setAttribute("data-caption",r.value),e.setAttribute("data-basefield",s.value),e.setAttribute("data-baseitem",o.value)),Ie.getFieldByName(a,this.parent.dataSourceSettings.values));(l=l.properties||l).caption=r.value,l.type=n.value,l.baseField=s.value,l.baseItem=o.value,this.parent.engineModule.fieldList[a].aggregateType=l.type,i.close(),this.parent.lastAggregationInfo=l,this.updateDataSource(!0)},ks.prototype.removeDialog=function(){this.buttonElement&&_e.select("#"+this.buttonElement.id,this.parentElement)&&_e.select("#"+this.buttonElement.id,this.parentElement).focus();var e=_e.select("#"+this.parentElement.id+"_ValueDialog",document),e=e?_e.getInstance(e,P.Dialog):null;e&&!e.isDestroyed&&e.destroy(),document.getElementById(this.parentElement.id+"_ValueDialog")&&_e.remove(document.getElementById(this.parentElement.id+"_ValueDialog"))},ks.prototype.destroy=function(){this.parent&&this.parent.isDestroyed||(this.cleanupMenuInstances(),this.cleanupDialogs(),this.cleanupDOMElements(),this.currentMenu=null,this.buttonElement=null)},ks.prototype.cleanupMenuInstances=function(){if(this.menuInfo){for(var e=0;e<this.menuInfo.length;e++)this.menuInfo[e]&&!this.menuInfo[e].isDestroyed&&this.menuInfo[e].destroy();this.menuInfo=[]}for(var t=0,i=[document.getElementById(this.parent.element.id+"valueFieldContextMenu"),document.getElementById(this.parent.element.id+"valueFieldStringContextMenu")];t<i.length;t++){var a=i[t];a&&_e.remove(a)}},ks.prototype.cleanupDialogs=function(){var e,t;this.parentElement&&(e=_e.select("#"+this.parentElement.id+"_ValueDialog",document))&&((t=_e.getInstance(e,P.Dialog))&&!t.isDestroyed&&(this.cleanupDialogComponents(e),t.destroy()),_e.remove(e))},ks.prototype.cleanupDialogComponents=function(e){if(e&&this.parentElement){var t=_e.select("#"+this.parentElement.id+"type_input_option",e);t&&(t=_e.getInstance(t,H.MaskedTextBox))&&!t.isDestroyed&&t.destroy();for(var i=0,a=["#"+this.parentElement.id+"_type_option","#"+this.parentElement.id+"_base_field_option","#"+this.parentElement.id+"_base_item_option"];i<a.length;i++){var r=_e.select(a[i],e);r&&(r=_e.getInstance(r,G.DropDownList))&&!r.isDestroyed&&r.destroy()}}},ks.prototype.cleanupDOMElements=function(){for(var e=0,t=[this.parent.element.id+"valueFieldContextMenu",this.parent.element.id+"valueFieldStringContextMenu"];e<t.length;e++){var i=document.getElementById(t[e]);i&&_e.remove(i)}},ks);function ks(e){this.menuInfo=[],this.stringAggregateTypes=["Count","DistinctCount"],this.parent=e}i.prototype.render=function(e){e&&(this.timeOutObj&&(clearTimeout(this.timeOutObj),this.timeOutObj=void 0),this.removeAllHyperlinkEventHandlers(),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("."+Wt)?(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,e=this.parent.isTabular?this.parent.engineModule.rowMaxLevel+1:1,this.parent.grid.setProperties({frozenColumns:e,columns:this.frameStackedHeaders(),dataSource:("olap"===this.parent.dataType&&""!==this.parent.dataSourceSettings.url||this.parent.dataSourceSettings.dataSource&&0<this.parent.engineModule.data.length&&0<this.parent.dataSourceSettings.values.length)&&!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.width=this.calculateGridWidth(),this.parent.grid.refreshColumns(),this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+Ge)&&this.parent.groupingBarModule.setGridRowWidth(),this.isAutoFitEnabled?this.addPivotAutoFitClass():this.removePivotAutoFitClass(),!this.gridSettings.allowAutoResizing&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+Ge)&&this.parent.groupingBarModule.refreshUI(),this.parent.isScrolling||this.calculateGridHeight(!0)):(this.parent.element.innerHTML="",this.bindGrid(this.parent,!!this.engine.isEmptyData),e=_e.createElement("div",{id:this.parent.element.id+"_grid"}),this.parent.element.appendChild(e),this.parent.grid.isStringTemplate=!0,this.parent.grid.appendTo(e)),this.parent.grid.on(w.headerRefreshed,this.refreshHeader,this)},i.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},i.prototype.refreshHeader=function(){var e,t,i,a=this.parent.element.querySelector("."+li);this.parent.enableVirtualization&&!_e.isNullOrUndefined(a)&&(e=_e.closest(a,"."+Ci).querySelector("."+oi),t=this.parent.element.querySelector("."+hi),i=a.querySelector("."+si),this.parent.virtualHeaderDiv=t.querySelector("."+si),t.querySelector("."+si)?_e.remove(t.querySelector("."+si)):this.parent.virtualHeaderDiv=_e.createElement("div",{className:si}),t.appendChild(this.parent.virtualHeaderDiv),i&&_e.setStyleAttribute(this.parent.virtualHeaderDiv,{height:0,width:i.style.width}),t.querySelector("."+u)&&(_e.setStyleAttribute(t.querySelector("."+u),{transform:a.querySelector("."+u).style.transform.split(",")[0]+",0px)"}),i=parseInt(t.querySelector("."+u).style.transform.split("(")[1].split(",")[0].split("px")[0],10),this.parent.enableRtl?this.parent.element.querySelector("."+Qi).style.right=Number(i)+"px":this.parent.element.querySelector("."+Qi).style.left=Number(-i)+"px"),i=this.parent.isAdaptive?a:e&&"none"!==e.style.display?e:a.parentElement,t.scrollLeft=i.scrollLeft)},i.prototype.bindGrid=function(e,t){this.injectGridModules(e),this.parent.grid=new w.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.cellSelecting.bind(this),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))},i.prototype.actionComplete=function(e){e&&"refresh"===e.requestType&&this.isAutoFitEnabled&&this.removePivotAutoFitClass()},i.prototype.addPivotAutoFitClass=function(){document.body.classList.contains(Qt)||document.body.classList.add(Qt),document.body.classList.contains(Zi)||document.body.classList.add(Zi)},i.prototype.removePivotAutoFitClass=function(){document.body.classList.contains(Qt)&&document.body.classList.remove(Qt),document.body.classList.contains(Zi)&&document.body.classList.remove(Zi)},i.prototype.headerRefreshed=function(){var e=this.parent.element.querySelector("."+hi);this.parent.lastGridSettings&&-1<Object.keys(this.parent.lastGridSettings).indexOf("allowResizing")&&!_e.isNullOrUndefined(e)&&e.querySelector("."+u)&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+Ge)&&(this.parent.lastGridSettings=void 0,this.parent.groupingBarModule.setGridRowWidth())},i.prototype.beforeExcelExport=function(e){_e.isNullOrUndefined(e.gridObject.columns)||_e.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(br,e)},i.prototype.rowSelected=function(e){this.parent.renderModule.selected(),this.parent.trigger(Ea,e)},i.prototype.rowDeselected=function(e){this.parent.renderModule.selected(),this.parent.trigger(Ia,e)},i.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(Ta,e))},i.prototype.cellSelecting=function(e){var t=this.parent.grid.selectionModule.actualTarget;!_e.isNullOrUndefined(t)&&(t.classList.contains("e-expand")||t.classList.contains("e-collapse")||this.parent.allowGrouping&&!_e.isNullOrUndefined(t.closest(".e-valuescontent")))&&(e.cancel=!0),this.parent.trigger(Ma,e)},i.prototype.cellDeselected=function(e){this.parent.renderModule.selected(),this.parent.trigger(Na,e)},i.prototype.queryCellInfo=function(e){this.parent.renderModule.rowCellBoundEvent(e)},i.prototype.headerCellInfo=function(e){this.parent.renderModule.columnCellBoundEvent(e)},i.prototype.excelHeaderQueryCellInfo=function(e){this.parent.renderModule.excelColumnEvent(e)},i.prototype.pdfQueryCellInfo=function(e){this.parent.renderModule.pdfRowEvent(e)},i.prototype.excelQueryCellInfo=function(e){this.parent.renderModule.excelRowEvent(e)},i.prototype.pdfHeaderQueryCellInfo=function(e){this.parent.renderModule.pdfColumnEvent(e)},i.prototype.pdfExportComplete=function(e){void 0!==this.parent.lastColumn&&this.parent.lastColumn&&"auto"!==this.parent.lastColumn.width&&(this.parent.lastColumn.width="auto",this.parent.lastColumn=void 0);e={type:"PDF",promise:e.promise};this.parent.trigger(da,e)},i.prototype.excelExportComplete=function(e){void 0!==this.parent.lastColumn&&this.parent.lastColumn&&"auto"!==this.parent.lastColumn.width&&(this.parent.lastColumn.width="auto",this.parent.lastColumn=void 0);e={type:"Excel/CSV",promise:e.promise};this.parent.trigger(da,e)},i.prototype.dataBound=function(){this.parent.notEmpty&&this.calculateGridHeight(!0),this.parent.isScrolling=!1,this.setFocusOnLastCell(),_e.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(qr,{})},i.prototype.setFocusOnLastCell=function(){var e;this.parent.keyboardModule&&this.parent.keyboardModule.event&&"TD"===this.parent.keyboardModule.event.target.nodeName&&((e=this.parent.grid.serviceLocator.getService("focus")).setFocusedElement(this.parent.keyboardModule.event.target),e.focus(this.parent.keyboardModule.event),_e.addClass([this.parent.keyboardModule.event.target],["e-focused","e-focus"]),this.parent.keyboardModule.event.target.setAttribute("tabindex","0"),this.parent.keyboardModule.event=void 0)},i.prototype.getCellElement=function(e){var t=_e.closest(e,"td");return t=_e.isNullOrUndefined(t)?_e.closest(e,"th"):t},i.prototype.contextMenuOpen=function(f){for(var v=this,y=(f.element&&this.parent.cssClass&&_e.addClass([f.element.parentElement],this.parent.cssClass),this),e=0,t=f.items;e<t.length;e++){var i=function(n){var e=y.parent.lastCellClicked||(y.parent.isAdaptive?f.event.target:y.parent.lastCellClicked),s=y.getCellElement(e),t=void 0,i=void 0;if(!s||0===Number(s.getAttribute("index"))&&parseInt(s.getAttribute("aria-colindex"),10)-1==0)return f.cancel=!0,{value:void 0};(s.classList.contains("e-valuesheader")||s.classList.contains("e-stot"))&&(t=!0),y.parent.allowGrouping&&y.parent.groupingModule&&!y.validateField(s)&&(i=!0);var o,e=Number(s.getAttribute("index")),a=parseInt(s.getAttribute("aria-colindex"),10)-1,r=y.parent.pivotValues[e][a];switch(n.id){case y.parent.element.id+"_expand":0<s.querySelectorAll("."+vt).length?(_e.selectAll("#"+y.parent.element.id+"_expand",f.element)&&_e.select("#"+y.parent.element.id+"_expand",f.element).classList.add(b),_e.select("#"+y.parent.element.id+"_expand",f.element).classList.contains(b)&&_e.select("#"+y.parent.element.id+"_expand",f.element).classList.remove(b),_e.select("#"+y.parent.element.id+"_expand",f.element).classList.contains(Kt)&&(_e.select("#"+y.parent.element.id+"_expand",f.element).classList.remove(Kt),_e.select("#"+y.parent.element.id+"_collapse",f.element).classList.remove(Kt))):t?_e.select("#"+y.parent.element.id+"_expand",f.element).classList.add(Kt):_e.select("#"+y.parent.element.id+"_expand",f.element).classList.add(b);break;case y.parent.element.id+"_collapse":0<s.querySelectorAll("."+ft).length?(_e.select("#"+y.parent.element.id+"_expand",f.element)&&_e.select("#"+y.parent.element.id+"_expand",f.element).classList.add(b),_e.select("#"+y.parent.element.id+"_collapse",f.element).classList.contains(b)&&_e.select("#"+y.parent.element.id+"_collapse",f.element).classList.remove(b),_e.select("#"+y.parent.element.id+"_collapse",f.element).classList.contains(Kt)&&(_e.select("#"+y.parent.element.id+"_collapse",f.element).classList.remove(Kt),_e.select("#"+y.parent.element.id+"_expand",f.element).classList.remove(Kt))):t?_e.select("#"+y.parent.element.id+"_collapse",f.element).classList.add(Kt):_e.select("#"+y.parent.element.id+"_collapse",f.element).classList.add(b);break;case y.parent.element.id+"_custom_group":i||2!==f.items.length||(f.cancel=!0),_e.selectAll("#"+y.parent.element.id+"_custom_group",f.element)&&_e.addClass([_e.select("#"+y.parent.element.id+"_custom_group",f.element)],Kt),i&&_e.selectAll("#"+y.parent.element.id+"_custom_group",f.element)&&_e.removeClass([_e.select("#"+y.parent.element.id+"_custom_group",f.element)],Kt);break;case y.parent.element.id+"_custom_ungroup":if(_e.selectAll("#"+y.parent.element.id+"_custom_ungroup",f.element)&&_e.addClass([_e.select("#"+y.parent.element.id+"_custom_ungroup",f.element)],Kt),i){var l=!1,d=s.getAttribute("fieldname"),h=Ie.getFieldByName(d,y.parent.dataSourceSettings.groupSettings);if(h&&"Custom"===h.type||y.parent.engineModule.fieldList[d].isCustomField&&-1<d.indexOf("_custom_group")){if(h=Ie.getFieldByName(d.replace("_custom_group",""),y.parent.dataSourceSettings.groupSettings))for(var p=y.parent.engineModule.pivotValues[Number(s.getAttribute("index"))][parseInt(s.getAttribute("aria-colindex"),10)-1],u=y.parent.groupingModule.getSelectedCells(p.axis,d,p.actualText.toString()),c=(u.push({axis:p.axis,fieldName:d,name:p.actualText.toString(),cellInfo:p}),y.parent.groupingModule.getSelectedOptions(u)),g=0,m=h.customGroups;g<m.length;g++){var S=m[g];if(-1<c.indexOf(S.groupName)){l=!0;break}}}else(h&&("Date"===h.type||"Number"===h.type)||y.parent.engineModule.fieldList[d].isCustomField&&-1<d.indexOf("_date_group"))&&(l=!0);_e.selectAll("#"+y.parent.element.id+"_custom_ungroup",f.element)&&l&&_e.removeClass([_e.select("#"+y.parent.element.id+"_custom_ungroup",f.element)],Kt)}break;case y.parent.element.id+"_drillthrough":y.parent.allowDrillThrough?s.classList.contains("e-summary")?_e.select("#"+y.parent.element.id+"_drillthrough",f.element).classList.contains(b)&&_e.select("#"+y.parent.element.id+"_drillthrough",f.element).classList.remove(b):""===s.innerText&&_e.select("#"+y.parent.element.id+"_drillthrough",f.element)&&_e.select("#"+y.parent.element.id+"_drillthrough",f.element).classList.add(b):_e.select("#"+y.parent.element.id+"_drillthrough",f.element)&&_e.select("#"+y.parent.element.id+"_drillthrough",f.element).classList.add(b);break;case y.parent.element.id+"_sortasc":y.parent.enableValueSorting?0<s.querySelectorAll(".e-icon-descending").length?(_e.select("#"+y.parent.element.id+"_sortdesc",f.element)?_e.select("#"+y.parent.element.id+"_sortdesc",f.element).classList.add(b):_e.select("#"+y.parent.element.id+"_sortdesc",f.element).classList.remove(b),_e.select("#"+y.parent.element.id+"_sortasc",f.element).classList.contains(b)&&_e.select("#"+y.parent.element.id+"_sortasc",f.element).classList.remove(b)):_e.select("#"+y.parent.element.id+"_sortdesc",f.element).classList.contains(b)&&_e.select("#"+y.parent.element.id+"_sortdesc",f.element).classList.remove(b):_e.select("#"+y.parent.element.id+"_sortasc",f.element)&&_e.select("#"+y.parent.element.id+"_sortasc",f.element).classList.add(b);break;case y.parent.element.id+"_sortdesc":y.parent.enableValueSorting?0<s.querySelectorAll(".e-icon-ascending").length?(_e.select("#"+y.parent.element.id+"_sortasc",f.element)?_e.select("#"+y.parent.element.id+"_sortasc",f.element).classList.add(b):_e.select("#"+y.parent.element.id+"_sortasc",f.element).classList.remove(b),_e.select("#"+y.parent.element.id+"_sortdesc",f.element).classList.contains(b)&&_e.select("#"+y.parent.element.id+"_sortdesc",f.element).classList.remove(b)):_e.select("#"+y.parent.element.id+"_sortasc",f.element).classList.contains(b)&&_e.select("#"+y.parent.element.id+"_sortasc",f.element).classList.remove(b):_e.select("#"+y.parent.element.id+"_sortdesc",f.element)&&_e.select("#"+y.parent.element.id+"_sortdesc",f.element).classList.add(b);break;case y.parent.element.id+"_CalculatedField":y.parent.allowCalculatedField||_e.select("#"+y.parent.element.id+"_CalculatedField",f.element).classList.add(b);break;case y.parent.element.id+"_pdf":y.parent.allowPdfExport||_e.select("#"+y.parent.element.id+"_pdf",f.element).classList.add(b);break;case y.parent.element.id+"_excel":y.parent.allowExcelExport||_e.select("#"+y.parent.element.id+"_excel",f.element).classList.add(b);break;case y.parent.element.id+"_csv":y.parent.allowExcelExport||_e.select("#"+y.parent.element.id+"_csv",f.element).classList.add(b);break;case y.parent.element.id+"_exporting":y.parent.allowExcelExport||y.parent.allowPdfExport||_e.select("#"+y.parent.element.id+"_exporting",f.element).classList.add(b);break;case y.parent.element.id+"_aggregate":_e.select("#"+y.parent.element.id+"_aggregate",f.element)&&!_e.select("#"+y.parent.element.id+"_aggregate",f.element).classList.contains(b)&&_e.select("#"+y.parent.element.id+"_aggregate",f.element).classList.add(b),(s.classList.contains("e-valuesheader")||s.classList.contains("e-valuescontent")||s.classList.contains("e-stot")&&s.classList.contains("e-rowsheader"))&&"olap"!==y.parent.dataType&&(""!==s.innerText&&(o=y.parent.engineModule.fieldList[r.actualText.toString()].type),p={cancel:!1,fieldName:r.actualText.toString(),aggregateTypes:y.getMenuItem(o).slice(),displayMenuCount:7},y.parent.trigger(Dr,p,function(e){if(!e.cancel&&""!==s.innerText){for(var t=[],i=[],a=0;a<e.aggregateTypes.length;a++){var r=e.aggregateTypes[a];"number"!==o?-1<["Count","DistinctCount"].indexOf(r)&&i.indexOf(r)<0&&(t.push({text:v.parent.localeObj.getConstant(r),id:v.parent.element.id+"_Agg"+r}),i.push(r)):-1<v.parent.getAllSummaryType().indexOf(r)&&i.indexOf(r)<0&&(t.push({text:v.parent.localeObj.getConstant(r),id:v.parent.element.id+"_Agg"+r}),i.push(r))}t.length>e.displayMenuCount&&(t.splice(e.displayMenuCount),t.push({text:v.parent.localeObj.getConstant("MoreOption"),id:v.parent.element.id+"_AggMoreOption"})),t&&1<=t.length&&(n.items=t,_e.select("#"+v.parent.element.id+"_aggregate",f.element).classList.remove(b))}}))}}(t[e]);if("object"==typeof i)return i.value}this.parent.trigger(fr,f)},i.prototype.getMenuItem=function(e){for(var t=[],i=0;i<this.parent.aggregateTypes.length;i++){var a=this.parent.aggregateTypes[i];"string"!==e?-1<this.parent.getAllSummaryType().indexOf(a)&&-1===t.indexOf(a)&&t.push(a):-1<["Count","DistinctCount"].indexOf(a)&&-1===t.indexOf(a)&&t.push(a)}return t},i.prototype.contextMenuClick=function(e){var t,i=this,a=this.parent.lastCellClicked,r=e.item.id,n=this.getCellElement(a),a=Number(n.getAttribute("index")),s=parseInt(n.getAttribute("aria-colindex"),10)-1,o=this.parent.pivotValues[a][s];switch(-1<e.item.id.indexOf(this.parent.element.id+"_Agg")&&(this.field=this.parent.engineModule.fieldList[o.actualText.toString()].id,this.fieldCaption=this.parent.engineModule.fieldList[o.actualText.toString()].caption,t=e.item.id.split("_Agg")[1]),r){case this.parent.element.id+"_pdf":this.parent.trigger(la,{pdfDoc:void 0,isBlob:!1,isMultipleExport:!1,pdfExportProperties:{fileName:"Export.pdf"}},function(e){i.parent.pdfExport(e.pdfExportProperties,e.isMultipleExport,e.pdfDoc,e.isBlob)});break;case this.parent.element.id+"_excel":this.parent.trigger(la,{isBlob:!1,isMultipleExport:!1,workbook:void 0,excelExportProperties:{fileName:"Export.xlsx"}},function(e){i.parent.excelExport(e.excelExportProperties,e.isMultipleExport,e.workbook,e.isBlob)});break;case this.parent.element.id+"_csv":this.parent.trigger(la,{isBlob:!1,workbook:void 0,isMultipleExport:!1,excelExportProperties:{fileName:"Export.csv"}},function(e){i.parent.csvExport(e.excelExportProperties,e.isMultipleExport,e.workbook,e.isBlob)});break;case this.parent.element.id+"_drillthrough_menu":var l=new MouseEvent("dblclick",{view:window,bubbles:!0,cancelable:!0});n.dispatchEvent(l);break;case this.parent.element.id+"_sortasc":this.parent.setProperties({dataSourceSettings:{valueSortSettings:{columnHeaderText:o.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:{columnHeaderText:o.valueSort.levelName,headerDelimiter:this.parent.dataSourceSettings.valueSortSettings.headerDelimiter}}}),this.parent.dataSourceSettings.valueSortSettings.sortOrder="Descending";break;case this.parent.element.id+"_expand":n.querySelectorAll("."+vt)&&(l=n.querySelectorAll("."+vt)[0],this.parent.onDrill(l));break;case this.parent.element.id+"_collapse":n.querySelectorAll("."+ft)&&(l=n.querySelectorAll("."+ft)[0],this.parent.onDrill(l));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":n.setAttribute("id",this.field),n.setAttribute("data-caption",this.fieldCaption),n.setAttribute("data-field",this.field),n.setAttribute("data-type",this.engine.fieldList[o.actualText.toString()].aggregateType),n.setAttribute("data-basefield",this.engine.fieldList[o.actualText.toString()].baseField),n.setAttribute("data-baseItem",this.engine.fieldList[o.actualText.toString()].baseItem),this.aggMenu.createValueSettingsDialog(n,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":this.parent.groupingModule&&(l={target:n,option:r,parentElement:this.parent.element},this.parent.notify(Qr,l),this.parent.grid.contextMenuModule.contextMenu.close())}this.parent.trigger(Sr,e)},i.prototype.validateColumnTotalcell=function(e){for(var t=Object.keys(this.engine.headerContent),i=!1,a="",r=t.length-1;0<=r;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():"",(i="sum"===n.type?!0:i)&&n.members&&0<n.members.length)return!0}return!1},i.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 for(var i,a=e.getAttribute("fieldName"),r=(a&&""!==a||(i=Number(e.getAttribute("index")),e=parseInt(e.getAttribute("aria-colindex"),10)-1,a=this.engine.pivotValues[i][e].actualText),this.parent.dataSourceSettings.values),n=0;n<r.length;n++)if(this.parent.dataSourceSettings.values[n].name===a){t=!0;break}return t},i.prototype.updateAggregate=function(e){if(-1<this.parent.getAllSummaryType().indexOf(e))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)},i.prototype.injectGridModules=function(e){w.Grid.Inject(w.Freeze),e.allowExcelExport&&w.Grid.Inject(w.ExcelExport),e.allowPdfExport&&w.Grid.Inject(w.PdfExport),w.Grid.Inject(w.Selection,w.Reorder,w.Resize),this.gridSettings.contextMenuItems&&w.Grid.Inject(w.ContextMenu)},i.prototype.updateGridSettings=function(){var e;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&&(-1<(e=Object.keys(this.parent.lastGridSettings)).indexOf("height")&&(this.parent.grid.height=this.gridSettings.height),-1<e.indexOf("width")&&(this.parent.grid.width=this.gridSettings.width),this.updatePivotColumns(),-1<e.indexOf("allowTextWrap")||-1<e.indexOf("clipMode"))&&this.parent.layoutRefresh(),this.clearColumnSelection()},i.prototype.updatePivotColumns=function(){for(var e=Object.keys(this.parent.lastGridSettings),t=0;t<this.parent.pivotColumns.length;t++)for(var i=this.parent.pivotColumns[t],a=0;a<e.length;a++){var r=e[a];_e.isNullOrUndefined(this.parent.pivotColumns[t][r])||(i[r]=this.parent.lastGridSettings[r])}this.parent.fillGridColumns(this.parent.grid.columns)},i.prototype.clearColumnSelection=function(){_e.removeClass(this.parent.element.querySelectorAll("."+fi),[fi,ui])},i.prototype.appendValueSortIcon=function(e,t,i,a,r){var n,s="pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule,o=this.parent.dataSourceSettings.valueSortSettings,l=o&&"pivot"===this.parent.dataType&&"Server"!==this.parent.dataSourceSettings.mode?o.columnHeaderText:o.headerText,d=o&&"pivot"===this.parent.dataType&&"Server"!==this.parent.dataSourceSettings.mode?o.columnSortOrder:o.sortOrder;return this.parent.enableValueSorting&&o&&""!==l&&(n="grand sum"===e.type&&1===this.parent.dataSourceSettings.values.length&&!this.parent.dataSourceSettings.alwaysShowValueHeader||!(1<this.parent.dataSourceSettings.values.length||this.parent.dataSourceSettings.alwaysShowValueHeader)&&0===this.parent.dataSourceSettings.columns.length?0:s.headerContent.length-1,l=o&&l?e.valueSort.levelName===l:a===o.columnIndex,void 0!==o)&&l&&(i===n||i+1===n&&-1<e.level&&s.headerContent[i+1][a]&&-1===s.headerContent[i+1][a].level)&&t.querySelector("div div").appendChild(_e.createElement("span",{className:("Descending"===d?"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"===r.headerTextAlign?"float : left":""})),t},i.prototype.onResizeStop=function(e){var t;e.column.columns&&0<e.column.columns.length?this.getChildColumnWidth(e.column.columns):(t=this.parent.isTabular?e.column.index<this.parent.engineModule.rowMaxLevel+1?e.column.index+".formattedText":""+e.column.customAttributes.cell.valueSort.levelName:"0.formattedText"===e.column.field?"0.formattedText":""+e.column.customAttributes.cell.valueSort.levelName,this.parent.resizeInfo[t]=Number(e.column.width.toString().split("px")[0])),this.parent.enableVirtualization&&"0.formattedText"===e.column.field&&(1<this.parent.dataSourceSettings.values.length&&!_e.isNullOrUndefined(this.parent.grid.columns[this.parent.grid.columns.length-1].columns)?(t=this.parent.grid.columns[this.parent.grid.columns.length-1].columns)[t.length-1].minWidth=this.parent.gridSettings.columnWidth:this.parent.grid.columns[this.parent.grid.columns.length-1].minWidth=this.parent.gridSettings.columnWidth,this.parent.layoutRefresh(),this.parent.grid.headerModule.refreshUI()),this.setGroupWidth(e),this.calculateGridHeight(!0),this.parent.grid.hideScroll()},i.prototype.getChildColumnWidth=function(e){for(var t=0,i=e;t<i.length;t++){var a,r=i[t];r.columns&&0<r.columns.length?this.getChildColumnWidth(r.columns):(a=r.customAttributes.cell.valueSort.levelName,this.parent.resizeInfo[a]=Number(r.width.toString().split("px")[0]))}},i.prototype.setGroupWidth=function(e){var t;this.parent.enableVirtualization&&"0.formattedText"===e.column.field&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+Ge)&&Number(e.column.width.toString().split("px")[0])<250&&(e.cancel=!0),this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+Ge)&&(this.parent.groupingBarModule.refreshUI(),this.parent.element.querySelector(".e-group-row").offsetWidth<245&&!this.parent.firstColWidth&&(e.cancel=!0,(t=this.parent.grid.columns)&&0<t.length&&(t[0].width=this.resColWidth),this.parent.element.querySelector("."+gi).querySelector("col").style.width=this.resColWidth+"px",this.parent.element.querySelector("."+ue).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",t=this.parent.element.querySelector("."+gi).offsetHeight,this.parent.element.querySelector(".e-group-rows").style.height=t+"px"),e.cancel&&(t="0.formattedText"===e.column.field?"0.formattedText":e.column.customAttributes.cell.valueSort.levelName,this.parent.resizeInfo[t]=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?ba:ya,e)},i.prototype.selected=function(){clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.onSelect.bind(this),300)},i.prototype.onSelect=function(){for(var e={selectedCellsInfo:[],pivotValues:this.parent.pivotValues,currentCell:null},t=this.parent.element.querySelectorAll("."+pi+",."+ui),i=0;i<t.length;i++){var a=t[i],r=parseInt(a.getAttribute("aria-colindex"),10)-1,a=Number(a.getAttribute("index")),a=this.engine.pivotValues[a][r];a&&("value"===a.axis?e.selectedCellsInfo.push({currentCell:a,value:a.value,columnHeaders:a.columnHeaders,rowHeaders:a.rowHeaders,measure:a.actualText.toString()}):"column"===a.axis?e.selectedCellsInfo.push({currentCell:a,value:a.formattedText,columnHeaders:a.valueSort.levelName,rowHeaders:"",measure:""}):e.selectedCellsInfo.push({currentCell:a,value:a.formattedText,columnHeaders:"",rowHeaders:a.valueSort.levelName,measure:""}))}this.parent.trigger(Pa,e)},i.prototype.rowCellBoundEvent=function(e){var t=e.cell,i=_e.createElement("div",{className:"e-pivotrow-container"});if(t&&this.parent.notEmpty&&this.engine.headerContent){var a=this.parent.hyperlinkSettings.cssClass,r=e.column&&e.column.customAttributes&&e.column.customAttributes.cell?e.column.customAttributes.cell.colIndex:parseInt(t.getAttribute("aria-colindex"),10)-1,n=this.parent.isTabular?r.toString():"0",n=e.data[Number(n)],s=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),o=(t.setAttribute("index",n.rowIndex?n.rowIndex.toString():"0"),this.parent.pivotValues[n.rowIndex]&&this.parent.pivotValues[n.rowIndex][r]?this.parent.pivotValues[n.rowIndex][r]:null);if(r<=(this.parent.isTabular?this.parent.engineModule.rowMaxLevel:0)){if("pivot"===this.parent.dataType){var l=n.type&&"value"===n.type,d=(t.innerText="",n.valueSort?n.valueSort.levelName.toString():""),h=n.actualText?n.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,h=d.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(h&&h-1),p=h?h-1:0;if("Bottom"!==this.parent.dataSourceSettings.subTotalsPosition||_e.isNullOrUndefined(d)||(y=n.isSum?"value"===n.type?d.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+(this.parent.engineModule.valueAxisFields[n.actualText].caption||this.parent.engineModule.valueAxisFields[n.actualText].name))[0]:"":d,n.isSum&&("value"!==n.type||this.drilledLevelInfo[y])?p-=1:n.isSum||(1===y.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length&&(this.drilledLevelInfo={}),n.members&&0<n.members.length&&(this.drilledLevelInfo[y]=n.isDrilled))),!this.parent.isTabular){for(;0<p&&i.appendChild(_e.createElement("span",{className:0===p?"":Mt})),-1<--p;);p=h?h-1:0,this.lastSpan=h?this.lastSpan:0,!n.hasChild&&0<(l?0:p)&&i.appendChild(_e.createElement("span",{className:Dt}))}var u=void 0;if(0<this.parent.dataSourceSettings.rows.length&&(!n.valueSort||0<Object.keys(n.valueSort).length)){if(l)for(var c=0,g=this.parent.dataSourceSettings.values;c<g.length;c++){var m=g[c],S=m.caption||m.name;if(-1<d.indexOf(S)){u=m.name;break}}else u=-1<n.level&&this.parent.dataSourceSettings.rows[n.level]?this.parent.dataSourceSettings.rows[n.level].name:"";t.setAttribute("fieldname",u)}}else i=this.onOlapRowCellBoundEvent(t,i,n);var f,v,y=n.formattedText,l=(n.type&&("grand sum"===n.type?(this.rowGrandPos=n.rowIndex,t.classList.add("e-gtot"),h=this.parent.dataSourceSettings.values,y=_e.isNullOrUndefined(n.valueSort.axis)?0===this.parent.dataSourceSettings.rows.length&&1===h.length&&"row"===this.parent.dataSourceSettings.valueAxis?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(h[h.length-1].type)+" "+this.parent.localeObj.getConstant("of")+" "+(_e.isNullOrUndefined(h[h.length-1].caption)?h[h.length-1].name:h[h.length-1].caption):this.parent.localeObj.getConstant("grandTotal"):n.formattedText):n.valueSort.levelName===this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+n.formattedText?(t.classList.add("e-gtot"),y=s?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[n.actualText].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+n.formattedText:y):"sum"===n.type&&3!==n.memberType?y=n.formattedText.split("Total")[0]+this.parent.localeObj.getConstant("total"):t.classList.add("e-stot")),this.parent.isTabular?(this.setSpanAttributes("rowspan",n.rowSpan,t),this.setSpanAttributes("colspan",n.colSpan,t)):t.classList.add(bt),!0!==n.hasChild||n.isNamedSet||i.appendChild(_e.createElement("div",{className:(!0===n.isDrilled?ft:vt)+" "+W,attrs:{title:!0===n.isDrilled?this.parent.localeObj.getConstant("collapse"):this.parent.localeObj.getConstant("expand")}})),i.appendChild(_e.createElement("span",{className:xt,innerHTML:this.parent.isRowCellHyperlink||n.enableHyperlink?'<a data-url="'+y+'" class="e-hyperlinkcell '+a+'">'+y+"</a>":y})),this.parent.pivotView.dataSourceSettings.valueSortSettings);this.parent.enableValueSorting&&(h=l&&"pivot"===this.parent.dataType&&"Server"!==this.parent.dataSourceSettings.mode?l.rowHeaderText:l.headerText,y=l&&"pivot"===this.parent.dataType&&"Server"!==this.parent.dataSourceSettings.mode?l.rowSortOrder:l.sortOrder,v=Number(t.getAttribute("index")),b=Number(t.getAttribute("aria-colindex")),f=this.parent.pivotValues&&this.parent.pivotValues[Number(t.getAttribute("index"))]?this.parent.pivotValues[Number(t.getAttribute("index"))][b-1]:void 0,"pivot"!==this.parent.dataType||"Server"===this.parent.dataSourceSettings.mode||"row"!==this.parent.dataSourceSettings.valueAxis||-1!==this.parent.dataSourceSettings.valueIndex||this.parent.isTabular||f.valueSort.levelName!==h||"value"===f.type||("Bottom"!==this.parent.dataSourceSettings.subTotalsPosition?this.parent.pivotValues[v+1]&&"value"===this.parent.pivotValues[v+1][b-1].type&&(v="value"===f.type||3===f.memberType?v:v+1,this.modifiedHeaderText=this.parent.pivotValues[v][b-1].valueSort.levelName):"Bottom"===this.parent.dataSourceSettings.subTotalsPosition&&0<this.parent.dataSourceSettings.values.length&&(_e.isNullOrUndefined(l.measure)?this.modifiedHeaderText=h+l.headerDelimiter+this.parent.dataSourceSettings.values[0].name:_e.isNullOrUndefined(l.measure)||(this.modifiedHeaderText=h+l.headerDelimiter+l.measure))),h="row"===this.parent.dataSourceSettings.valueAxis&&this.modifiedHeaderText?this.modifiedHeaderText:h,v=!("pivot"===this.parent.dataType&&"Bottom"===this.parent.dataSourceSettings.subTotalsPosition&&1<this.parent.dataSourceSettings.rows.length&&f.hasChild),l)&&h&&f&&f.valueSort&&f.valueSort.levelName&&(!this.parent.isTabular&&f.valueSort.levelName===h&&v||this.parent.isTabular&&f.valueSort.levelName===h&&1===f.rowSpan)&&(i.appendChild(_e.createElement("span",{className:("Descending"===y?"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")+(f.hasChild?" e-value-sort-align":""),styles:"right"===i.style.textAlign?"float: left":""})),this.modifiedHeaderText=void 0),t.appendChild(i)}else{var b=t.innerText,l=(t.innerText="",t.classList.add("e-valuescontent"),n=e.data[r],(n=_e.isNullOrUndefined(n)?e.column.customAttributes.cell:n).isGrandSum=!!s||n.isGrandSum,n.isSum&&t.classList.add("e-summary"),_e.isNullOrUndefined(n.isGrandSum)&&!_e.isNullOrUndefined(this.parent.olapEngineModule)&&"column"===this.parent.olapEngineModule.olapValueAxis&&"olap"===this.parent.dataType&&this.colGrandPos-this.parent.dataSourceSettings.values.length<r);n.isGrandSum||l||this.colGrandPos===r||this.rowGrandPos===Number(t.getAttribute("index"))?t.classList.add("e-gtot"):("olap"===this.parent.dataType?n.isSum:this.validateColumnTotalcell(n.colIndex))&&t.classList.add("e-colstot"),o&&o.cssClass&&t.classList.add(o.cssClass),t.appendChild(_e.createElement("span",{className:xt,innerHTML:-1!==t.className.indexOf("e-summary")&&this.parent.isSummaryCellHyperlink||-1===t.className.indexOf("e-summary")&&this.parent.isValueCellHyperlink&&o||n.enableHyperlink?'<a data-url="'+b+'" class="e-hyperlinkcell '+a+'">'+b+"</a>":b})),this.parent.gridSettings.allowReordering&&t.setAttribute("aria-colindex",(e.column.customAttributes?e.column.customAttributes.cell.colIndex+1:e.column.index).toString())}this.parent.cellTemplate&&this.appendTemplate(t,o),this.unWireEvents(t),this.wireEvents(t)}e.pivotview=this.parent,this.parent.trigger(Sa,e)},i.prototype.appendTemplate=function(e,t){var i,t=this.parent.getCellTemplate()({targetCell:e,cellInfo:t},this.parent,"cellTemplate",this.parent.element.id+"_cellTemplate",null,null,e);t&&""!==t&&0<t.length&&(this.parent.enableHtmlSanitizer?this.parent.isVue||this.parent.isVue3?((i=_e.createElement("div")).innerHTML=_e.SanitizeHtmlHelper.sanitize(t),_e.append([i.firstChild],e)):this.parent.appendHtml(e,_e.SanitizeHtmlHelper.sanitize(t[0].outerHTML)):this.parent.isVue||this.parent.isVue3?_e.append(t,e):this.parent.appendHtml(e,t[0].outerHTML))},i.prototype.onOlapRowCellBoundEvent=function(e,t,i){e.innerText="";var a=this.engine.rowMeasurePos;if(this.parent.enableVirtualization){if(-1<i.ordinal&&0<this.parent.olapEngineModule.tupRowInfo.length){for(var r=this.parent.olapEngineModule.tupRowInfo[i.ordinal],n=(3===i.memberType?this.engine.fieldList[i.actualText.toString()].tag:i.actualText).toString(),n=r.uNameCollection.indexOf(n),s=(r.uNameCollection.substring(0,n)+(3===i.memberType?"":i.actualText.toString())).split("::[").map(function(e){return"["===e[0]?e:"["+e}),o=(3===i.memberType&&a&&s.push(i.actualText.toString()),-1),l=0,d=!1,h=0;h<s.length;h++){o+=s[h].split("~~").length;var p="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)||0<Number(r.members[h].querySelector("CHILDREN_CARDINALITY").textContent));l+=0<h&&d&&!p?1:0,d=p}for(var u=0,c=0;c<o;c++)t.appendChild(_e.createElement("span",{className:Mt})),u++;for(c=0;c<l&&0<o;c++)t.appendChild(_e.createElement("span",{className:Dt}));this.indentCollection[i.rowIndex]=u,this.maxIndent=this.maxIndent>u?this.maxIndent:u}}else{var n=i.hierarchy,g=i.valueSort?i.valueSort.levelName.toString():"",g=-1===i.level?this.measurePos:g.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-1,g=3===i.memberType?g+"."+i.levelUniqueName:i.levelUniqueName,p=i.hasChild,m=!1;if(i.isSum&&3===i.memberType){for(var S=this.lvlCollection[i.parentUniqueName].position,f=S+1;f<this.position;f++)delete this.lvlCollection[this.lvlPosCollection[f]],delete this.lvlPosCollection[f];this.position=this.position>S+1?S+1:this.position,m=!0,this.measurePos=this.lvlCollection[i.parentUniqueName].position}if(!this.lvlCollection[g]&&g)this.lvlPosCollection[this.position]=g,this.lvlCollection[g]={position:this.position,hasChild:p},this.position++;else if(g){for(var S=this.lvlCollection[g].position,v=S+1;v<this.position;v++)delete this.lvlCollection[this.lvlPosCollection[v]],delete this.lvlPosCollection[v];this.position=this.position>S+1?S+1:this.position}if(!this.hierarchyCollection[n]&&n)this.hierarchyPosCollection[this.hierarchyCount]=n,this.hierarchyCollection[n]={lvlPosition:this.position-1,hierarchyPOs:this.hierarchyCount},this.hierarchyCount++;else if(n){for(S=this.hierarchyCollection[n].hierarchyPOs,v=S+1;v<this.hierarchyCount;v++)delete this.hierarchyCollection[this.hierarchyPosCollection[v]],delete this.hierarchyPosCollection[v];this.hierarchyCount=this.hierarchyCount>S+1?S+1:this.hierarchyCount}3!==i.memberType&&g&&this.lvlCollection[g]&&(S=this.hierarchyCollection[n]?this.hierarchyCollection[n].hierarchyPOs:-1,this.measurePos=a<=S&&this.hierarchyPosCollection[a+1]?this.measurePos:this.lvlCollection[g].position);for(var y=this.lvlCollection[g]?this.lvlCollection[g].position:-1,y=m?y-1:y,b=0,u=0;b<=y&&0<y&&-1<i.level;){var C=this.lvlCollection[this.lvlPosCollection[b]].hasChild;(d=0<b&&this.lvlCollection[this.lvlPosCollection[b-1]].hasChild)&&!C&&t.appendChild(_e.createElement("span",{className:Dt})),b!==y&&(t.appendChild(_e.createElement("span",{className:Mt})),u++),b++}"Top"!==this.parent.dataSourceSettings.grandTotalsPosition||_e.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)||t.appendChild(_e.createElement("span",{className:Mt})),3===i.memberType&&-1===i.level&&1<Object.keys(this.lvlCollection).length&&(t.appendChild(_e.createElement("span",{className:Mt})),u++),this.indentCollection[i.rowIndex]=u,this.maxIndent=this.maxIndent>u?this.maxIndent:u}return t.setAttribute("fieldname",i.hierarchy),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"),t},i.prototype.columnCellBoundEvent=function(e){if(e.cell.column&&e.cell.column.customAttributes){var t=e.cell.column.customAttributes.cell,i=e.node;if(t){for(var a=this.parent.hyperlinkSettings.cssClass,r=!1,n=0,s=this.parent.dataSourceSettings.values;n<s.length;n++){var o=s[n];o.name===t.actualText&&(r=!0,i.setAttribute("fieldname",o.name))}-1===t.level&&!t.rowSpan||-1===t.rowSpan?e.node.style.display="none":1<t.rowSpan&&(e.node.setAttribute("rowspan",t.rowSpan.toString()),e.node.setAttribute("aria-rowspan",t.rowSpan.toString()),t.rowIndex+t.rowSpan===this.engine.headerContent.length)&&(e.node.style.borderBottomWidth="0px"),e.node.setAttribute("aria-colindex",(t.colIndex+1).toString()),e.node.setAttribute("index",t.rowIndex.toString());"pivot"===this.parent.dataType?(!r&&!(this.parent.dataSourceSettings.values&&"column"===this.parent.dataSourceSettings.valueAxis&&1<this.parent.dataSourceSettings.values.length&&r&&t.rowIndex===this.engine.headerContent.length-1)&&this.parent.dataSourceSettings.columns&&0<this.parent.dataSourceSettings.columns.length&&(h=-1<t.level&&this.parent.dataSourceSettings.columns[t.level]?this.parent.dataSourceSettings.columns[t.level].name:"",i.setAttribute("fieldname",h)),this.validateColumnTotalcell(t.colIndex)&&i.classList.add("e-colstot")):i=this.onOlapColumnCellBoundEvent(i,t);for(var l,d,h=0===this.parent.dataSourceSettings.columns.length&&"column"===this.parent.dataSourceSettings.valueAxis&&t.valueSort&&t.valueSort.levelName===this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+t.formattedText,p=((t.type||h)&&(i.classList.add("grand sum"===t.type?"e-gtot":"e-stot"),"grand sum"===t.type?this.colGrandPos=t.colIndex:t.type&&i.classList.add("e-colstot"),d="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,c="grand sum"===t.type?_e.isNullOrUndefined(t.valueSort.axis)||"olap"===this.parent.dataType?this.parent.localeObj.getConstant("grandTotal"):t.formattedText:t.formattedText.split("Total")[0]+this.parent.localeObj.getConstant("total"),c=h&&d.fieldList?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(d.fieldList[t.actualText].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+t.formattedText:c,null!==i.querySelector(".e-headertext")?i.querySelector(".e-headertext").innerText=c:i.querySelector(".e-stackedheadercelldiv").innerText=c),i.classList.add(yt),(this.parent.isColumnCellHyperlink||t.enableHyperlink)&&(i.querySelector(".e-stackedheadercelldiv")?(l=i.querySelector(".e-stackedheadercelldiv").innerText,i.querySelector(".e-stackedheadercelldiv").innerHTML='<a data-url="'+l+'" class="e-hyperlinkcell '+a+'">'+l+"</a>"):i.querySelector(".e-headertext")&&(l=i.querySelector(".e-headertext").innerText,i.querySelector(".e-headertext").innerHTML='<a data-url="'+l+'" class="e-hyperlinkcell '+a+'">'+l+"</a>")),!0!==t.hasChild||t.isNamedSet?this.updateWrapper(i):((h=i.querySelector(".e-headercelldiv"))&&(h.style.height="auto",h.style.lineHeight="normal"),d=_e.createElement("div",{className:(!0===t.isDrilled?ft:vt)+" "+W,attrs:{title:!0===t.isDrilled?this.parent.localeObj.getConstant("collapse"):this.parent.localeObj.getConstant("expand")}}),-1<window.navigator.userAgent.indexOf("Edge")||-1<window.navigator.userAgent.indexOf("Trident")?i.children[0].style.display="table":i.children[0].style.display="block",this.updateWrapper(i,d)),i=this.appendValueSortIcon(t,i,t.rowIndex,t.colIndex,e.cell.column),this.parent.cellTemplate&&this.appendTemplate(i,t),this.parent.dataSourceSettings.values.length),u=0;u<p;u++)this.parent.dataSourceSettings.values[u].name===t.actualText&&("olap"===this.parent.dataType&&this.parent.olapEngineModule.tupColumnInfo[t.ordinal]&&(0===this.parent.olapEngineModule.tupColumnInfo[t.ordinal].measurePosition?1===this.parent.olapEngineModule.tupColumnInfo[t.ordinal].allStartPos:0===this.parent.olapEngineModule.tupColumnInfo[t.ordinal].allStartPos)&&i.classList.add("e-gtot"),t.valueSort.levelName===this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+t.formattedText||t.valueSort.levelName==="Grand Total"+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+t.formattedText?i.classList.add("e-gtot"):i.classList.add("e-valuesheader"));this.unWireEvents(i),this.wireEvents(i)}}else{var c;this.parent.isTabular&&(c=e.cell&&e.cell.column&&e.cell.column.index,a=this.parent.engineModule.rowMaxLevel+1,0===c?(e.node.setAttribute("colspan",a.toString()),e.node.classList.add(ea)):this.parent.engineModule.rowMaxLevel>=c&&(e.node.style.display="none"))}this.parent.trigger(fa,e)},i.prototype.updateWrapper=function(e,t){var i,a;return(0<e.querySelectorAll(".e-headercelldiv").length||0<e.querySelectorAll(".e-stackedheadercelldiv").length)&&(i=_e.createElement("div",{className:"e-pivotcell-container"}),a=_e.createElement("div",{className:(t?"e-stackedheadertext":"e-headertext")+" "+xt,innerHTML:(0<e.querySelectorAll(".e-headercelldiv").length?e.querySelector(".e-headercelldiv"):e.querySelector(".e-stackedheadercelldiv")).innerHTML}),t&&i.append(t),i.append(a),e.children[0].innerHTML="",e.children[0].append(i)),e},i.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&&1<i.colSpan&&(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},i.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);)0<r.rowSpan&&(i=r.rowSpan,a=r.rowIndex),r=this.engine.headerContent[r.rowIndex-1]?this.engine.headerContent[r.rowIndex-1][t.colIndex]:void 0;return e<=a+i},i.prototype.onHyperCellClick=function(e){var t=e.target.closest("td.e-rowcell")?e.target.closest("td.e-rowcell"):e.target.closest("th"),i={currentCell:t,data:this.engine.pivotValues[Number(t.getAttribute("index"))][parseInt(t.getAttribute("aria-colindex"),10)-1],cancel:!0,nativeEvent:e};this.parent.trigger(va,i,function(e){e.cancel||(i.currentCell=_e.getElement(i.currentCell),e=(i.currentCell.getAttribute("data-url")?i.currentCell:i.currentCell.querySelector("a")).getAttribute("data-url"),window.open(e))})},i.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},i.prototype.frameDataSource=function(e){var t=[];if(("pivot"===this.parent.dataType&&this.parent.dataSourceSettings.dataSource&&0<this.parent.engineModule.data.length||"olap"===this.parent.dataType&&""!==this.parent.dataSourceSettings.url||"Server"===this.parent.dataSourceSettings.mode&&""!==this.parent.dataSourceSettings.url&&0<this.engine.pivotValues.length)&&0<this.parent.dataSourceSettings.values.length&&!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,s=r;s<n;s++)if(a[s]){t[i="header"===e?s:i]={};for(var o=0;o<a[s].length;o++)a[s][o]&&(t[i][o]=a[s][o]);i++}}else t="value"===e?this.engine.valueContent:this.engine.headerContent;else t=this.frameEmptyData();return t},i.prototype.frameEmptyData=function(){return[{0:{formattedText:this.parent.localeObj.getConstant("grandTotal")},1:{formattedText:this.parent.localeObj.getConstant("emptyData")}}]},i.prototype.calculateColWidth=function(e){_e.isNullOrUndefined(this.parent.resizedValue)||(this.parent.resizedValue=this.parent.showGroupingBar&&this.parent.resizedValue<250?250:this.parent.resizedValue),this.resColWidth=_e.isNullOrUndefined(this.parent.resizedValue)?this.resColWidth:this.parent.resizedValue;var t=this.calculateGridWidth(),i=this.parent.element.getBoundingClientRect().width?this.parent.element.getBoundingClientRect().width:this.parent.element.offsetWidth,i=isNaN(this.parent.width)?-1<this.parent.width.toString().indexOf("%")?parseFloat(this.parent.width.toString())/100*i:t:Number(this.parent.width),a=(i-=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<i),this.isOverflows||(t="auto"===(t=this.calculateGridHeight())?this.parent.getHeightAsNumber():t,a=this.engine&&this.engine.headerContent?Object.keys(this.engine.headerContent).length:1,t=t-this.gridSettings.rowHeight*a,this.engine&&this.engine.valueContent&&this.gridSettings.rowHeight*this.engine.valueContent.length>t&&(i-=w.getScrollBarWidth())),e*this.gridSettings.columnWidth<i?i/e:this.gridSettings.columnWidth);return this.isOverflows||this.gridSettings.allowAutoResizing?a:this.gridSettings.columnWidth},i.prototype.resizeColWidth=function(e){_e.isNullOrUndefined(this.parent.resizedValue)||(this.parent.resizedValue=this.parent.showGroupingBar&&this.parent.resizedValue<250?250:this.parent.resizedValue),this.resColWidth=_e.isNullOrUndefined(this.parent.resizedValue)?this.resColWidth:this.parent.resizedValue;var t=isNaN(this.parent.width)?-1<this.parent.width.toString().indexOf("%")?parseFloat(this.parent.width.toString())/100*this.parent.element.offsetWidth:this.parent.element.offsetWidth:Number(this.parent.width),t=(t-=this.gridSettings.columnWidth>this.resColWidth?this.gridSettings.columnWidth:this.resColWidth,this.isOverflows=!((e-=1)*this.gridSettings.columnWidth<t),e*this.gridSettings.columnWidth<t?t/e:this.gridSettings.columnWidth);return this.isOverflows||this.gridSettings.allowAutoResizing?t:this.gridSettings.columnWidth},i.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:-1<this.parent.width.toString().indexOf("%")?e=parseFloat(this.parent.width.toString())/100*t:-1<this.parent.width.toString().indexOf("px")&&(e=this.parent.width.toString().split("px")[0]):e=this.gridSettings.width,!this.gridSettings.allowAutoResizing&&e>this.parent.totColWidth?this.parent.totColWidth:e},i.prototype.calculateGridHeight=function(e){var t,i=this.parent.element.querySelector(".e-grid ."+ue),a=this.parent.height,r=this.parent.getHeightAsNumber();return i&&(r=isNaN(r)?r>this.parent.minHeight?r:this.parent.minHeight:i.offsetWidth<i.querySelector("."+u).offsetWidth?r-w.getScrollBarWidth():r,this.parent.showToolbar&&"Chart"!==this.parent.currentView||!this.parent.showToolbar&&"Chart"!==this.parent.displayOption.view)&&("auto"===this.gridSettings.height&&r&&this.parent.element.querySelector("."+bi)?(a=(a=r-(this.parent.element.querySelector("."+bi).offsetHeight+(this.parent.element.querySelector("."+qi)?this.parent.element.querySelector("."+qi).offsetHeight:0)+(this.parent.element.querySelector("."+Di)?42:0)+(this.parent.element.querySelector("."+Bi)?this.parent.element.querySelector("."+Bi).offsetHeight:0))-1)<40?40:a,e?(r=i.querySelector("."+u).offsetHeight,e=i.querySelector("."+u).offsetHeight,t=i.querySelector("."+u).offsetWidth,i=i.offsetWidth<=t,r<=a&&(!i||e<=a)&&!(i&&a-r<15)?this.parent.grid.height="auto":(this.parent.grid.height=a,this.parent.grid.dataBind())):a>this.engine.valueContent.length*this.gridSettings.rowHeight&&(a="auto")):a=this.gridSettings.height),a<this.parent.gridSettings.rowHeight?this.parent.gridSettings.rowHeight:a},i.prototype.frameStackedHeaders=function(){var e=this.parent.pivotColumns,t="pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule,i=this.parent.grid.columnModel,a=!1,r=!(!this.parent.toolbarModule||!this.parent.toolbarModule.isReportChange)||!!this.parent.actionObj&&("Sort value"===this.parent.actionObj.actionName&&1===t.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||0<this.parent.dataSourceSettings.values.length&&this.parent.dataSourceSettings.dataSource&&0<this.parent.engineModule.data.length||"Server"===this.parent.dataSourceSettings.mode&&0<this.parent.dataSourceSettings.values.length&&""!==this.parent.dataSourceSettings.url&&0<this.engine.pivotValues.length)&&!this.engine.isEmptyData){var n=this.engine.headerContent.length,s=[],o=[],l=this.calculateColWidth(this.engine.pivotValues&&this.engine.pivotValues[0]?this.engine.pivotValues[0].length:0),d="olap"===this.parent.dataType&&!_e.isNullOrUndefined(this.engine.colMeasurePos)&&this.engine.colDepth-1===this.parent.olapEngineModule.colMeasurePos;do{var h=[],p=0,u=(n--,this.engine.headerContent[n]),c=u?Object.keys(u).length:0;if(u&&0<c)for(var g=this.parent.isTabular?this.parent.engineModule.rowMaxLevel+1:u[0]?0:1,m=0,S=Object.keys(u).length+g;m<S;m++){var f=u[m]&&u[m].colSpan?3!==u[m].memberType||3===u[m].memberType&&!d||0===n?u[m].colSpan:s[m]:1,f="olap"===this.parent.dataType&&_e.isNullOrUndefined(f)?1:f,v=u[m]?"grand sum"===u[m].type?_e.isNullOrUndefined(u[m].valueSort.axis)?this.parent.localeObj.getConstant("grandTotal"):u[m].formattedText:"sum"===u[m].type?u[m].formattedText.split("Total")[0]+this.parent.localeObj.getConstant("total"):u[m].formattedText:"",v=this.parent.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(v):v;if(n===this.engine.headerContent.length-1)a=e.length-(f=1)===c&&!r&&!this.parent.isEmptyGrid&&e[p]&&e[p].autoFit,h[p]={field:m+".formattedText",headerText:v,customAttributes:{cell:this.cloneDataWithoutIndex(u[m])},width:a&&i[p]?i[p].width:u[m]&&u[m].valueSort?this.setSavedWidth(u[m].valueSort.levelName,l):this.resColWidth,minWidth:a&&p===c?i[i.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"},m===c&&(h[p].width=h[p].width-3,this.lastColumn=h[p]);else if(s[m]){for(var y=f,b=[],C=m;0<y;){if(h[p]){if(!this.pivotColumns[o[C]])break;b.push(this.pivotColumns[o[C]])}else{if(h[p]={headerText:v,field:u[m]?u[m].valueSort.levelName:"",customAttributes:{cell:this.cloneDataWithoutIndex(u[m])},width:a&&0===p&&!r&&!this.parent.isEmptyGrid&&e[0].autoFit?i[0].width:u[m]?this.setSavedWidth(u[m].valueSort.levelName,l):this.resColWidth,minWidth:30,allowReordering:this.parent.gridSettings.allowReordering,allowResizing:this.parent.gridSettings.allowResizing,visible:!0,headerTextAlign:this.parent.enableRtl?"Right":"Left"},!this.pivotColumns[o[C]])break;b=[this.pivotColumns[o[C]]]}this.isAutoFitEnabled=!!this.isAutoFitEnabled||a,y-=s[C],C+=s[C]}h[p].columns=b}h[p]&&(h[p].clipMode=this.gridSettings.clipMode),s[m]=f,o[m]=p,p++,m=m+f-1}}while(this.pivotColumns=0<h.length?h:this.pivotColumns,0<n);if(this.parent.isTabular)for(var x=0;x<this.parent.engineModule.rowMaxLevel+1;x++)if(this.parent.showGroupingBar&&!this.parent.isAdaptive){var w=this.parent.element.querySelector("."+$i),T=w.querySelectorAll(".e-pvt-btn-div"),M=0;M=this.parent.engineModule.rowMaxLevel!==T.length-1&&x===this.parent.engineModule.rowMaxLevel?this.getTotalColumnWidth(T,x):1===w.querySelectorAll(".e-pvt-btn-div").length?250:.8*this.parent.element.getBoundingClientRect().width<=this.getTotalColumnWidth(T,0)?this.gridSettings.columnWidth:(w.querySelectorAll(".e-pvt-btn-div")[x].getBoundingClientRect().width<this.parent.gridSettings.columnWidth?this.parent.gridSettings.columnWidth:w.querySelectorAll(".e-pvt-btn-div")[x].getBoundingClientRect().width)+6,this.pivotColumns[x]={field:x+".formattedText",width:M>this.gridSettings.columnWidth?M:this.resColWidth,minWidth:30,headerText:"",allowReordering:!1,allowResizing:this.parent.gridSettings.allowResizing,visible:!0,clipMode:this.parent.gridSettings.clipMode}}else for(var D=0;D<this.parent.engineModule.rowMaxLevel+1;D++)this.updatePivotColumn(this.pivotColumns,D,a,r,i);else this.updatePivotColumn(this.pivotColumns,0,a,r,i)}else this.resColWidth=this.parent.showGroupingBar&&this.parent.groupingBarModule?this.parent.isAdaptive?180:250:this.parent.isAdaptive?140:200,this.pivotColumns=this.frameEmptyColumns();return this.parent.toolbarModule&&this.parent.showToolbar&&(this.parent.toolbarModule.isReportChange=!1),this.parent.triggerColumnRenderEvent(this.pivotColumns),a=0<this.parent.pivotColumns.length&&this.parent.pivotColumns[this.parent.pivotColumns.length-1].autoFit,this.pivotColumns},i.prototype.setSavedWidth=function(e,t){if("0.formattedText"!==e||_e.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){var i=0,a=this.parent.element.querySelector("."+$i).querySelectorAll(".e-pvt-btn-div");if(1<a.length){for(var r=0;r<a.length;r++)i+=a[r].getBoundingClientRect().width+6;t=i}}t=this.parent.resizeInfo[e]||t}else t=this.parent.resizedValue;return t},i.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},i.prototype.getFormatList=function(){for(var e={},t=0;t<this.parent.dataSourceSettings.values.length;t++){var i,a=this.parent.dataSourceSettings.values[t],r="N";if("olap"===this.parent.dataType)this.parent.olapEngineModule.fieldList[a.name]&&!_e.isNullOrUndefined(this.parent.olapEngineModule.fieldList[a.name].formatString)&&(r=-1<(i="Standard"===(i=this.parent.olapEngineModule.formatFields[a.name]?this.parent.olapEngineModule.formatFields[a.name].format:this.parent.olapEngineModule.fieldList[a.name].formatString)?"Number":i).indexOf("#")||null!==i.match(/\d/)?i:i[0]+"2");else{var n=["PercentageOfDifferenceFrom","PercentageOfRowTotal","PercentageOfColumnTotal","PercentageOfGrandTotal","PercentageOfParentRowTotal","PercentageOfParentColumnTotal","PercentageOfParentTotal"];if(-1<n.indexOf(a.type)?r="P"+this.engine.getPercentFormat(this.engine.formatFields,a.name):-1<["PopulationStDev","SampleStDev","PopulationVar","SampleVar","Index"].indexOf(a.type)&&(r=void 0),0<this.parent.dataSourceSettings.formatSettings.length)for(var s=0;s<this.parent.dataSourceSettings.formatSettings.length;s++){var o=this.parent.dataSourceSettings.formatSettings[s];if(a.name===o.name){-1===n.indexOf(a.type)&&(r=o.format);break}}}e[a.name]=r}return e},i.prototype.getValidHeader=function(e,t){var i,a=this.parent.dataSourceSettings.values;if("row"===t){var r=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+r.value===r.data[0].valueSort.levelName)return this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[r.value.toString()].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+r.value.toString();if(1===a.length&&0===this.parent.dataSourceSettings.rows.length)return this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(a[a.length-1].type)+" "+this.parent.localeObj.getConstant("of")+" "+(_e.isNullOrUndefined(a[a.length-1].caption)?a[a.length-1].name:a[a.length-1].caption)}i=r.value}else if("column"===t){r=e;if((0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length)&&!_e.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+r.gridCell.column.customAttributes.cell.formattedText===r.gridCell.column.customAttributes.cell.valueSort.levelName)return this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[r.gridCell.column.customAttributes.cell.actualText].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+r.gridCell.column.customAttributes.cell.formattedText;i=r.cell.value}return i},i.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(ha,e)},i.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),0===e.gridCell.column.index&&(e.cell.colSpan=this.parent.isTabular?this.parent.engineModule.rowMaxLevel+1:1),this.parent.trigger(pa,e)},i.prototype.excelRowEvent=function(e){var t,i,a,r,n=this.parent.isTabular?this.parent.engineModule.rowMaxLevel:0,s=e.column?e.column.index:void 0;0<=s&&s<=n?(i=(n=e.data[s]).type&&"value"===n.type,r=0,r="olap"===this.parent.dataType?this.indentCollection[n.rowIndex]:(a=n.valueSort?n.valueSort.levelName.toString():"",n=n.actualText?n.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,(a=a.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(n&&n-1))?a-1:0),this.colPos=0,e.style={hAlign:"Left",indent:2*r},this.lastSpan=i?this.lastSpan:r,0!==e.data[s].rowSpan&&0!==e.data[s].colSpan||"CSV"!==this.parent.exportType||!this.parent.isTabular||(e.value="")):(this.colPos++,t=e.data[e.column.customAttributes.cell?e.column.customAttributes.cell.colIndex:this.colPos],_e.isNullOrUndefined(t.value)||_e.isNullOrUndefined(t.formattedText)||""===t.formattedText?e.value="Excel"===this.parent.exportType?null:"":(n="pivot"===this.parent.dataType&&this.parent.engineModule?this.parent.engineModule.aggregatedValueMatrix:void 0)&&n[t.rowIndex]&&n[t.rowIndex][t.colIndex]?e.value=n[t.rowIndex][t.colIndex]:e.value=_e.isNullOrUndefined(t.value)||"#DIV/0!"===t.formattedText?t.formattedText:t.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(ua,e),t&&!_e.isNullOrUndefined(e.value)&&""!==e.value&&(e.style&&this.formatList[t.actualText]?(e.style.type="number",e.style.numberFormat=e.style.numberFormat||this.formatList[t.actualText]):this.formatList[t.actualText]&&(e.style={numberFormat:this.formatList[t.actualText]}),e.column.format=this.formatList[t.actualText])},i.prototype.pdfRowEvent=function(e){var t,i,a,r;"0.formattedText"===(e=this.exportContentEvent(e)).column.field&&(t=(i=e.data[r=0]).type&&"value"===i.type,r="olap"===this.parent.dataType?this.indentCollection[i.rowIndex]:(a=i.valueSort?i.valueSort.levelName.toString():"",i=i.actualText?i.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,(a=a.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(i&&i-1))?a-1:0),e.style={paragraphIndent:10*r},this.lastSpan=t?this.lastSpan:r,0===this.parent.dataSourceSettings.rows.length)&&"row"===this.parent.dataSourceSettings.valueAxis&&(e.value=this.getValidHeader(e,"row")),this.parent.trigger(ca,e)},i.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=[],s=0;s<r.length;s++)-1!==r[s].rowSpan&&n.push(r[s]);t[a].cells=n}},i.prototype.exportHeaderEvent=function(e,t){var i,a=1;return e.gridCell.column.customAttributes?(a=0<(i=e.gridCell.column.customAttributes.cell).rowSpan?i.rowSpan:1,"XLSX"===t&&(0<i.rowSpan?a=i.rowSpan:_e.isNullOrUndefined(i.type)||0===i.level||(e.cell.rowSpan=a=1)),this.actualText=i.actualText):a=Object.keys(this.engine.headerContent).length,e.cell.rowSpan!==a&&0<a&&(e.cell.rowSpan=a),e},i.prototype.frameGridDataSource=function(e){for(var t=[],i=0;i<e.length;i++)for(var a=0,r=(t[i]={},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},i.prototype.cloneDataWithoutIndex=function(e){if(_e.isNullOrUndefined(e))return e;for(var t=Object.keys(e),i=0,a={};i<t.length;)"indexObject"!==t[i]&&"index"!==t[i]&&(a[t[i]]=e[t[i]]),i++;return a},i.prototype.exportContentEvent=function(e){var t=e.data[Number(e.column.field.split(".formattedText")[0])];return 0<t.rowSpan&&"row"===t.axis&&(e.cell.rowSpan=t.rowSpan),0<t.colSpan&&"row"===t.axis&&(e.colSpan=t.colSpan),e.value="grand sum"===t.type?_e.isNullOrUndefined(t.valueSort.axis)?this.parent.localeObj.getConstant("grandTotal"):t.formattedText:e.value,e},i.prototype.unWireEvents=function(e){e&&e.querySelector(".e-hyperlinkcell")&&_e.EventHandler.remove(e.querySelector(".e-hyperlinkcell"),this.parent.isAdaptive?"touchend":"click",this.onHyperCellClick)},i.prototype.wireEvents=function(e){e.querySelector(".e-hyperlinkcell")&&_e.EventHandler.add(e.querySelector(".e-hyperlinkcell"),this.parent.isAdaptive?"touchend":"click",this.onHyperCellClick,this)},i.prototype.setSpanAttributes=function(e,t,i){i.setAttribute(e,t?t.toString():"1"),i.classList.add(bt,ea,"e-tabular-layout-header"),0===t&&i.classList.add(Q)},i.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.gridSettings.allowResizing,visible:!0,clipMode:this.parent.gridSettings.clipMode}},i.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},i.prototype.destroy=function(){this.timeOutObj&&(clearTimeout(this.timeOutObj),this.timeOutObj=void 0),this.removeAllHyperlinkEventHandlers(),this.aggMenu&&(this.aggMenu.destroy(),this.aggMenu=void 0),this.engine=null,this.gridSettings=null,this.formatList=null,this.lastColumn=null,this.pivotColumns=[],this.indentCollection={},this.lvlCollection={},this.hierarchyCollection={},this.lvlPosCollection={},this.hierarchyPosCollection={},this.drilledLevelInfo={},this.aggMenu=null},i.prototype.removeAllHyperlinkEventHandlers=function(){if(this.parent&&this.parent.element)for(var e=this.parent.element.querySelectorAll(".e-hyperlinkcell"),t=0;t<e.length;t++)_e.EventHandler.remove(e[t],this.parent.isAdaptive?"touchend":"click",this.onHyperCellClick)};var js=i;function i(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 Rs(this.parent)}Hs.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)}},Hs.prototype.processComponentFocus=function(e){this.parent.element&&(this.parent.element.focus(),e.stopPropagation(),e.preventDefault())},Hs.prototype.getButtonElement=function(e){for(var t=[].slice.call(this.parent.element.querySelectorAll("."+Y)),i=0,a=t.length;i<a;i++)if(t[i].getAttribute("data-uid")===e.getAttribute("data-uid"))return t[i];return e},Hs.prototype.processEnter=function(e){var t=e.target;t&&_e.closest(t,"."+Y)&&(t.querySelector("."+B)&&_e.closest(t,"."+Ue)?t.querySelector("."+B).click():t.querySelector("."+Jt)?t.querySelector("."+Jt).click():!t.querySelector("."+me)||_e.closest(t,"."+Ue)||_e.closest(t,"."+zt)?t.querySelector("."+ve)&&!_e.closest(t,"."+Ue)&&t.querySelector("."+ve).click():(t.querySelector("."+me).click(),this.getButtonElement(t).focus()),e.preventDefault())},Hs.prototype.processSort=function(e){var t=e.target;t&&_e.closest(t,"."+Y)&&t.querySelector("."+me)&&!_e.closest(t,"."+Ue)&&!_e.closest(t,"."+zt)&&(t.querySelector("."+me).click(),this.getButtonElement(t).focus(),e.preventDefault())},Hs.prototype.processEdit=function(e){var t=e.target;t&&_e.closest(t,"."+Y)&&t.querySelector("."+Jt)&&(t.querySelector("."+Jt).click(),e.preventDefault())},Hs.prototype.processFilter=function(e){var t,i,a=e.target;a&&_e.closest(a,"."+Y)&&a.querySelector("."+ve)&&!_e.closest(a,"."+Ue)&&(a.querySelector("."+ve).click(),this.parent&&this.parent.control&&"pivotview"===this.parent.moduleName&&this.parent.control.grid&&this.parent.control.showGroupingBar&&this.parent.control.groupingBarModule&&_e.closest(a,"."+We)&&this.parent.filterDialog&&this.parent.filterDialog.dialogPopUp&&!this.parent.filterDialog.dialogPopUp.isDestroyed&&this.parent.filterDialog.dialogPopUp.element&&(t=this.parent.filterDialog.dialogPopUp.element,i=this.parent.filterDialog.allowExcelLikeFilter,clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){t&&t.classList.contains("e-popup-open")&&(i&&t.querySelector(".e-dlg-closeicon-btn")?t.querySelector(".e-dlg-closeicon-btn").focus():t.querySelector("input")&&t.querySelector("input").focus())})),e.preventDefault())},Hs.prototype.processFilterNodeSelection=function(e){var t,i,a=e.target;a&&_e.closest(a,"."+Nt)&&40===e.keyCode?(t=_e.closest(a,"."+De).querySelector("."+Oe))&&t.querySelector("li")&&(i=t.querySelector("li"),t.querySelector("li#_active")&&(_e.removeClass([t.querySelector("li#_active")],["e-node-focus"]),t.querySelector("li#_active").removeAttribute("id")),i.setAttribute("id","_active"),_e.addClass([i],["e-node-focus"]),i.focus(),e.preventDefault()):a&&_e.closest(a,"."+Oe)&&38===e.keyCode?(t=_e.closest(a,"."+Oe)).querySelector("li#_active.e-node-focus")&&t.querySelector("li")&&t.querySelector("li").classList.contains("e-prev-active-node")&&t.querySelector("li")===t.querySelector("li#_active.e-node-focus")&&(_e.removeClass(t.querySelectorAll("li.e-prev-active-node"),"e-prev-active-node"),t=_e.closest(a,"."+De).querySelector("."+Nt))&&t.querySelector("li")&&((i=t.querySelector("li")).setAttribute("id","_active"),_e.addClass([i],["e-node-focus"]),i.focus(),e.preventDefault()):a&&a.id===this.parent.parentID+"_inputbox"&&("upArrow"===e.action?a.parentElement.querySelector(".e-spin-up").click():"downArrow"===e.action&&a.parentElement.querySelector(".e-spin-down").click())},Hs.prototype.processDelete=function(e){var t=e.target;t&&_e.closest(t,"."+Y)&&t.querySelector("."+Ce)&&(t.querySelector("."+Ce).click(),e.preventDefault())},Hs.prototype.processClose=function(e){var t=e.target;if(t&&_e.closest(t,".e-popup.e-popup-open")){t=_e.getInstance(_e.closest(t,".e-popup.e-popup-open"),P.Dialog);if(t&&!t.closeOnEscape){var i=t.element.getAttribute("data-fieldName");if(t.hide(),this.parent.element)for(var a=0,r=[].slice.call(this.parent.element.querySelectorAll(".e-pivot-button"));a<r.length;a++){var n=r[a];if(n.getAttribute("data-uid")===i){n.focus();break}}e.preventDefault()}}},Hs.prototype.destroy=function(){this.timeOutObj&&(clearTimeout(this.timeOutObj),this.timeOutObj=null),this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null)};var qs=Hs;function Hs(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 _e.KeyboardEvents(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})}Us.prototype.updateSorting=function(e){if(!e.target.classList.contains(ve)&&!e.target.classList.contains(Ce)){this.parent.filterDialog.dialogPopUp&&this.parent.filterDialog.dialogPopUp.close();var e=e.target,t=void 0,i=void 0,i=0!==(e.id?(t=e.getAttribute("data-uid"),[].slice.call(e.querySelectorAll("."+fe))):(t=e.parentElement.getAttribute("data-uid"),[].slice.call(e.parentElement.querySelectorAll("."+fe)))).length,a=Ie.getFieldByName(t,this.parent.dataSourceSettings.sortSettings),r=this.parent.engineModule&&this.parent.engineModule.fieldList[t]&&this.parent.engineModule.fieldList[t].membersOrder?this.parent.engineModule.fieldList[t].membersOrder.slice():[];if(!_e.isNullOrUndefined(a))for(var n=0;n<this.parent.dataSourceSettings.sortSettings.length;n++)if(this.parent.dataSourceSettings.sortSettings[n].name===t){this.parent.dataSourceSettings.sortSettings.splice(n,1);break}a={name:t,order:i?"Ascending":"Descending",membersOrder:a?a.membersOrder:r};this.parent.dataSourceSettings.sortSettings.push(a),this.parent.control.lastSortInfo=this.parent.dataSourceSettings.sortSettings[this.parent.dataSourceSettings.sortSettings.length-1],i?_e.removeClass([e],fe):_e.addClass([e],fe)}},Us.prototype.updateFiltering=function(e){var e=e.target,t=e.parentElement.getAttribute("data-uid"),e=e.parentElement.textContent,i=!1,a=[],r=[];if(this.parent.dataSourceSettings.allowMemberFilter)if("olap"===this.parent.dataType)r=this.getOlapData(t,i);else{var n=this.parent.engineModule.fieldList[t],s=Ie.getClonedData(n.dateMember),o=(this.parent.isDateField=Ie.isDateField(t,this.parent.engineModule),n&&n.membersOrder?n.membersOrder.slice():[]),l=void 0,d=("Out of Range"===s[0].actualText?(l=s[0],s.splice(0,1)):"Out of Range"===s[s.length-1].actualText&&(l=s[s.length-1],s.splice(s.length-1,1)),{fieldName:t,sortOrder:n.sort,members:o&&0<o.length?o:Object.keys(s),IsOrderChanged:!1}),h=!1,n=!(!n||!n.isAlphanumeric)||void 0,o=(o&&0<o.length?s=Ie.applyCustomSort(d,s,n):(o=this.parent.dataSourceSettings.groupSettings.filter(function(e){return e.name===t&&"number"===e.type.toLocaleLowerCase()}),o=!_e.isNullOrUndefined(o)&&0<o.length,s=Ie.applyHeadersSort(s,d.sortOrder,n,o),h=!0),Ie.getFilterItemByName(t,this.parent.dataSourceSettings.filterSettings));if(_e.isNullOrUndefined(o)||(i=!(!this.isValidFilterItemsAvail(t,o)||"Include"!==o.type),a=o.items||[]),l&&("Ascending"===d.sortOrder?"Grand Total"===s[s.length-1].actualText?s.splice(s.length-1,0,l):s.splice(s.length,0,l):"Grand Total"===s[0].actualText?s.splice(1,0,l):s.splice(0,0,l)),h){for(var p=[],u=0,c=0;u<s.length;u++)"Grand Total"!==s[u].actualText&&(p[c++]=s[u].actualText);d.members=p}this.parent.control.trigger(mr,d),d.IsOrderChanged&&(s=Ie.applyCustomSort(d,s,n,!0)),r=this.getTreeData(i,s,a,t)}this.parent.filterDialog.dialogPopUp&&this.parent.filterDialog.dialogPopUp.close();o=this.parent.control.filterTargetID;_e.isNullOrUndefined(o)&&(o="pivotfieldlist"!==this.parent.moduleName?this.parent.element:document.getElementById(this.parent.parentID+"_Container")),this.parent.filterDialog.createFilterDialog(r,t,e,o)},Us.prototype.isValidFilterItemsAvail=function(e,t){var i=!1;if(t&&0<=["Include","Exclude"].indexOf(t.type))if("Include"===t.type&&0===t.items.length)i=!0;else for(var a=this.parent.engineModule,r=a.fieldList[e],n=void 0,n="Server"===this.parent.dataSourceSettings.mode||"olap"===this.parent.dataType?r.members:Ie.getFormattedMembers(r.members,e,a),s=0,o=t.items;s<o.length;s++)if(n[o[s]]){i=!0;break}return i},Us.prototype.getOlapData=function(e,t){var i=[],a=(this.parent.filterDialog.isSearchEnabled=!1,this.parent.engineModule),r=Ie.getFilterItemByName(e,this.parent.dataSourceSettings.filterSettings),n=(0===a.fieldList[e].filterMembers.length?this.parent.control.loadOnDemandInMemberEditor?r&&1<r.levelCount&&1<a.fieldList[e].levels.length?a.getFilterMembers(this.parent.dataSourceSettings,e,r.levelCount):(a.fieldList[e].levelCount=1,a.getMembers(this.parent.dataSourceSettings,e)):a.getMembers(this.parent.dataSourceSettings,e,!0):(a.fieldList[e].currrentMembers={},a.fieldList[e].searchMembers=[]),a.fieldList[e].isHierarchy),s=a.fieldList[e].filterMembers;_e.isNullOrUndefined(r)||(t=!r.type||"Include"===r.type,i=r.items||[]);for(var o={},l={},d=a.fieldList[e].members,h=0,p=i;h<p.length;h++){var u=p[h];d[l[o[u]=u]=u]&&(l=this.getParentNode(e,u,l))}return s=this.getFilteredTreeNodes(e,s,l,[]),s=this.getOlapTreeData(t,Ie.getClonedData(s),o,e,n),this.sortOlapFilterData(s,a.fieldList[e].sort)},Us.prototype.sortOlapFilterData=function(e,t){if(0<e.length){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]:e[1]).htmlAttributes["data-fieldName"],s=this.parent.engineModule.fieldList[n],s=s&&s.membersOrder?s.membersOrder.slice():[],n={fieldName:n,sortOrder:t,members:s&&0<s.length?s:a,IsOrderChanged:!1};if(s&&0<s.length?this.applyFilterCustomSort(e,n):(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 o=[],l=0,d=0;l<e.length;l++)"Grand Total"!==e[l].caption&&(o[d++]=e[l].caption);n.members=o}this.parent.control.trigger(mr,n),n.IsOrderChanged&&this.applyFilterCustomSort(e,n,!0)}return e},Us.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 s=0,o=0;s<e.length;s++){var l=e[s].caption;if(r[o]===l){if(e.splice(o++,0,e[s]),e.splice(++s,1),!(o<r.length)){i||n.splice(--o,0,l);break}s=-1}0<=s&&!i&&(n[s]=e[s].caption)}if(!i){for(s=n.length;s<e.length;s++)n[s]=e[s].caption;"Grand Total"===n[n.length-1]&&n.pop(),t.members=n}return a&&e.splice(0,0,a),e},Us.prototype.getParentIDs=function(e,t,i){for(var a,r=0,n=e.fields.dataSource;r<n.length;r++){var s=n[r];if(s.id===t){a=s.pid;break}}return a&&(i.push(a),this.getParentIDs(e,a,i)),i},Us.prototype.getChildIDs=function(e,t,i){for(var a,r=0,n=e.fields.dataSource;r<n.length;r++){var s=n[r];if(s.pid===t){a=s.id;break}}return a&&(i.push(a),this.getParentIDs(e,a,i)),i},Us.prototype.searchTreeNodes=function(e,t,i,a){if(i){for(var r=[],n=[],s=0,o=[].slice.call(t.element.querySelectorAll("li"));s<o.length;s++){var l=o[s];(-1<l.querySelector(".e-list-text").textContent.toLowerCase().indexOf(e.value.toLowerCase())?r:n).push(l)}if(t.enableNodes(r),_e.removeClass(r,Q),t.disableNodes(n),_e.addClass(n,Q),0<r.length&&0<n.length)for(var d=0,h=r;d<h.length;d++){var p=h[d].getAttribute("data-uid"),u=this.getParentIDs(t,p,[]),c=this.getChildIDs(t,p,[]),g=[];if(0<u.length)for(var m=0,S=n;m<S.length;m++){var f=S[m];-1!==Ie.inArray(f.getAttribute("data-uid"),u)&&g.push(f)}if(0<c.length)for(var v=0,y=n;v<y.length;v++){f=y[v];-1!==Ie.inArray(f.getAttribute("data-uid"),c)&&g.push(f)}t.enableNodes(g),_e.removeClass(g,Q)}0===[].slice.call(t.element.querySelectorAll("li."+Q)).length?t.collapseAll():t.expandAll(void 0,void 0,!0),this.searchListItem=r}else if(this.parent.searchTreeItems=[],"olap"!==this.parent.dataType||a){for(var r=[],b=0,b=1,C=0,x=this.parent.currentTreeItems;C<x.length;C++){var w=x[C];-1<w.name.toLowerCase().indexOf(e.value.toLowerCase())&&(this.parent.searchTreeItems.push(w),b<=this.parent.control.maxNodeLimitInMemberEditor&&r.push(w),b++)}--b>this.parent.control.maxNodeLimitInMemberEditor?(this.parent.editorLabelElement.innerText=b-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=b>this.parent.control.maxNodeLimitInMemberEditor,this.parent.editorLabelElement.parentElement.style.display=this.parent.isDataOverflow?"block":"none",t.fields={dataSource:r,id:"id",text:"name",isChecked:"isSelected",parentID:"pid"},t.dataBind()}else this.updateOlapSearchTree(e,t,a)},Us.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={},s={},o=this.parent.engineModule.fieldList[r].members,l=[],d=0,h=Object.keys(o);d<h.length;d++)!o[p=h[d]].isSelected||o[p].parent&&o[o[p].parent].isSelected||l.push(p);for(var p,u=0,c=l;u<c.length;u++)o[s[n[p=c[u]]=p]=p]&&(s=this.getParentNode(r,p,s));var g=this.parent.engineModule.fieldList[r].filterMembers,a=this.getFilteredTreeNodes(r,g,s,[]);a=this.getOlapTreeData(!0,Ie.getClonedData(a),n,r,i,!0)}else{this.parent.filterDialog.isSearchEnabled=!0;g=this.parent.engineModule.fieldList[r].searchMembers;a=Ie.getClonedData(g),a=this.getOlapSearchTreeData(!0,a,r)}t.fields={dataSource:a,id:"id",text:"name",isChecked:"isSelected",parentID:"pid"},t.dataBind()},Us.prototype.getTreeData=function(e,t,i,a){this.parent.currentTreeItems=[],this.parent.searchTreeItems=[],this.parent.currentTreeItemsPos={},this.parent.savedTreeFilterPos={};for(var r=this.parent.engineModule,n=[],s=1,o={},l=0,d=i;l<d.length;l++){var h=d[l];o[h]=h}for(var p=a.replace(/[^a-zA-Z0-9 ]/g,"_"),u=0,c=t;u<c.length;u++){var g=c[u],m=g.actualText.toString(),m=this.parent.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(m):m,S=this.parent.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(g.actualText):g.actualText,f={id:p+"_"+s,htmlAttributes:{"data-fieldName":a,"data-memberId":S.toString()},actualText:S,name:(this.parent.isDateField?g:r.getFormattedValue(S,a)).formattedText,isSelected:!e},v="Server"===this.parent.dataSourceSettings.mode?g.actualText:g.formattedText;void 0!==o[this.parent.isDateField?v:m]&&(f.isSelected=!!e),s<=this.parent.control.maxNodeLimitInMemberEditor&&n.push(f),f.isSelected||(this.parent.savedTreeFilterPos[s-1]=this.parent.isDateField?g.formattedText:m),this.parent.currentTreeItems.push(f),this.parent.searchTreeItems.push(f),this.parent.currentTreeItemsPos[S]={index:s-1,isSelected:f.isSelected},s++}return this.parent.isDataOverflow=s-1>this.parent.control.maxNodeLimitInMemberEditor,n},Us.prototype.getOlapTreeData=function(e,t,i,a,r,n){for(var s=this.parent.engineModule.fieldList[a],o=(this.parent.currentTreeItems=[],this.parent.searchTreeItems=[],this.parent.currentTreeItemsPos={},[]),l=1,d=0,h=t;d<h.length;d++){var p=h[d],u=p,c=p.id.toString();n||(u.isSelected=!e),void 0!==i[c]&&(u.isSelected=!!e),!n&&p.hasChildren&&this.updateChildNodeStates(s.filterMembers,a,p.id,u.isSelected),s.members[c].isSelected=u.isSelected,s.currrentMembers&&s.currrentMembers[c]&&(s.currrentMembers[c].isSelected=u.isSelected),l<=this.parent.control.maxNodeLimitInMemberEditor&&r&&o.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?o:t},Us.prototype.getOlapSearchTreeData=function(e,t,i){for(var a=this.parent.engineModule.fieldList[i].members,r=0,n=t;r<n.length;r++){var s=n[r],o=s.id.toString();a[o]&&(s.isSelected=a[o].isSelected),this.parent.searchTreeItems.push(s)}return t},Us.prototype.updateChildNodeStates=function(e,t,i,a){for(var r=this.parent.engineModule.fieldList[t].members,n=this.parent.engineModule.fieldList[t].currrentMembers,s=0,o=e;s<o.length;s++){var l=o[s];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)}},Us.prototype.getParentNode=function(e,t,i){var a=this.parent.engineModule.fieldList[e].members;return a[t].parent&&t!==a[t].parent&&(i[a=a[t].parent]=a,this.getParentNode(e,a,i)),i},Us.prototype.getFilteredTreeNodes=function(e,t,i,a){for(var r=[],n=this.parent.engineModule.fieldList[e].members,s=0,o=i?Object.keys(i):[];s<o.length;s++){var l=o[s],l=n[l]?n[l].parent:void 0;void 0!==l&&-1===Ie.inArray(l,r)&&r.push(l)}for(var d=0,h=t;d<h.length;d++){var p=h[d];_e.isNullOrUndefined(p.pid)||-1!==Ie.inArray(p.pid,r)?(a.push(p),_e.isNullOrUndefined(p.pid)&&-1!==Ie.inArray(p.id,r)?n[p.id].isNodeExpand=!0:_e.isNullOrUndefined(p.pid)||-1===Ie.inArray(p.pid,r)?n[p.id].isNodeExpand=!1:(n[p.id].isNodeExpand=!1,n[p.pid].isNodeExpand=!0)):n[p.id].isNodeExpand=!1}return a};var Vs=Us;function Us(e){this.searchListItem=[],this.parent=e}Bs.prototype.onStateModified=function(e,t){var i="",a=_e.closest(e.target,"."+qe),r=-1;if(this.parent.dataSourceUpdate.btnElement=e.element?e.element.parentElement:void 0,a&&(i=a.classList[1]===He?"rows":a.classList[1]===Ve?"columns":a.classList[1]===Ue?"values":a.classList[1]===Be?"filters":""),"olap"===this.parent.dataType||"pivot"===this.parent.dataType){var n,s,o="olap"===this.parent.dataType&&this.parent.engineModule.fieldList[t]&&this.parent.engineModule.fieldList[t].isCalculatedField?this.parent.engineModule.fieldList[t].tag:t;if(e.cancel&&""===i)return!1;if(this.parent.dataSourceUpdate.btnElement&&"true"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&("filters"===i||"values"===i)||this.parent.dataSourceUpdate.btnElement&&"false"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&-1<o.toLowerCase().indexOf("[measures].")&&"olap"===this.parent.dataType&&("filters"===i||"rows"===i||"columns"===i)||this.parent.dataSourceUpdate.btnElement&&"false"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&"olap"===this.parent.dataType&&-1===o.toLowerCase().indexOf("[measures].")&&this.parent.engineModule.fieldList[t]&&this.parent.engineModule.fieldList[t].isNamedSets&&("filters"===i||"values"===i)||this.parent.dataSourceUpdate.btnElement&&"false"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&"olap"===this.parent.dataType&&-1===o.toLowerCase().indexOf("[measures].")&&"values"===i)return n=this.parent.localeObj.getConstant("warning"),s=this.parent.localeObj.getConstant("fieldDropErrorAction"),this.parent.errorDialog.createErrorDialog(n,s),!1}else if(e.cancel&&""===i||this.parent.dataSourceUpdate.btnElement&&"true"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&("filters"===i||"values"===i||-1<i.indexOf(this.parent.dataSourceSettings.valueAxis)))return!1;if(""!==i){if("olap"===this.parent.dataType||"pivot"===this.parent.dataType)if(-1<(o="olap"===this.parent.dataType&&this.parent.engineModule.fieldList[t]&&this.parent.engineModule.fieldList[t].isCalculatedField?this.parent.engineModule.fieldList[t].tag:t).toLowerCase().indexOf("[measures].")&&"olap"===this.parent.dataType&&("filters"===i||"rows"===i||"columns"===i)||this.parent.engineModule.fieldList[t]&&this.parent.engineModule.fieldList[t].isNamedSets&&"filters"===i||"olap"===this.parent.dataType&&"values"===i&&-1===o.toLowerCase().indexOf("[measures]."))return n=this.parent.localeObj.getConstant("warning"),s=this.parent.localeObj.getConstant("fieldDropErrorAction"),this.parent.errorDialog.createErrorDialog(n,s),!1;if("pivot"===this.parent.dataType&&this.parent.engineModule.fieldList[t]&&"CalculatedField"===this.parent.engineModule.fieldList[t].aggregateType&&"values"!==i)return n=this.parent.localeObj.getConstant("warning"),s=this.parent.localeObj.getConstant("dropAction"),this.parent.errorDialog.createErrorDialog(n,s),!1;r=this.getButtonPosition(e.target,i)}else this.parent.engineModule.fieldList[t]&&(this.parent.engineModule.fieldList[t].isSelected=!1,"olap"===this.parent.dataType)&&this.parent.engineModule.updateFieldlistData(t);return this.parent.dataSourceUpdate.updateDataSource(t,i,r)},Bs.prototype.getButtonPosition=function(e,t){var i=-1,a=_e.closest(e,"."+pe);if(!_e.isNullOrUndefined(a))for(var a=a.querySelector("."+Y),e=this.parent.element.querySelector(".e-"+t),r=[].slice.call(e.querySelectorAll("."+Y)),n=0,s=r.length;n<s;n++)if(r[n].id===a.id){i=n;break}return i};var _s=Bs;function Bs(e){this.parent=e}zs.prototype.updateDataSource=function(i,a,r){for(var n,s,o=this,l=-1,d=!0,e=[this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.values,this.parent.dataSourceSettings.filters],t=0,h=e.length;t<h;t++)if(e[t])for(var p=0,u=e[t].length;p<u;p++)(e[t][p].name===i||"olap"===this.parent.dataType&&"[measures]"===e[t][p].name.toLowerCase()&&e[t][p].name.toLowerCase()===i)&&(s=0===t?"rows":1===t?"columns":2===t?"values":"filters",l=p),s=s||"fieldList";var c={fieldName:i,dropField:Ie.getFieldInfo(i,this.control).fieldItem,dataSourceSettings:Ie.getClonedDataSourceSettings(this.parent.dataSourceSettings),dropAxis:a,dropPosition:r,draggedAxis:s,cancel:!1},g="pivotfieldlist"===this.control.getModuleName()&&this.control.isPopupView?this.control.pivotGridModule:this.control;return g.trigger(oa,c,function(e){if(e.cancel)d=!1;else{var t;if(a=e.dropAxis,r=e.dropPosition,i=e.dropField?e.dropField.name:e.fieldName,n=e.dropField,o.control&&o.btnElement&&"true"===o.btnElement.getAttribute("isvalue"))switch(a){case"":o.control.setProperties({dataSourceSettings:{values:[]}},!0);break;case"rows":r=r===o.parent.dataSourceSettings.rows.length?-1:r,o.control.setProperties({dataSourceSettings:{valueAxis:"row",valueIndex:r}},!0);break;case"columns":r=r===o.parent.dataSourceSettings.columns.length?-1:r,o.control.setProperties({dataSourceSettings:{valueAxis:"column",valueIndex:r}},!0)}else o.removeFieldFromReport(i.toString()),"pivot"===o.parent.dataType&&o.control.showValuesButton&&1<o.parent.dataSourceSettings.values.length&&(t="row"===o.parent.dataSourceSettings.valueAxis&&"rows"===a?o.parent.dataSourceSettings.rows:"column"===o.parent.dataSourceSettings.valueAxis&&"columns"===a?o.parent.dataSourceSettings.columns:void 0,l<o.parent.dataSourceSettings.valueIndex&&("row"===o.parent.dataSourceSettings.valueAxis&&"rows"===s||"column"===o.parent.dataSourceSettings.valueAxis&&"columns"===s)&&o.control.setProperties({dataSourceSettings:{valueIndex:o.parent.dataSourceSettings.valueIndex-1}},!0),_e.isNullOrUndefined(t)||(-1===r&&-1===o.parent.dataSourceSettings.valueIndex?o.control.setProperties({dataSourceSettings:{valueIndex:t.length}},!0):-1<r&&r<=o.parent.dataSourceSettings.valueIndex?o.control.setProperties({dataSourceSettings:{valueIndex:o.parent.dataSourceSettings.valueIndex+1}},!0):-1<o.parent.dataSourceSettings.valueIndex&&r>o.parent.dataSourceSettings.valueIndex&&(r-=1))),"CalculatedField"===(n=o.getNewField(i.toString(),e.dropField)).type&&""!==a&&(a="values");"olap"===o.parent.dataType&&(o.removeFieldFromReport(i.toString()),n=o.getNewField(i.toString(),e.dropField),0===o.parent.dataSourceSettings.values.length&&o.removeFieldFromReport("[measures]"),"CalculatedField"===n.type)&&""!==a&&(a="values"),o.control&&(t={fieldName:i,droppedField:n,dataSourceSettings:Ie.getClonedDataSourceSettings(o.parent.dataSourceSettings),droppedAxis:a,droppedPosition:r},g.trigger(sa,t,function(e){if(n=e.droppedField){switch(r=e.droppedPosition,a=e.droppedAxis){case"filters":-1!==r?o.parent.dataSourceSettings.filters.splice(r,0,n):o.parent.dataSourceSettings.filters.push(n);break;case"rows":-1!==r?o.parent.dataSourceSettings.rows.splice(r,0,n):o.parent.dataSourceSettings.rows.push(n);break;case"columns":-1!==r?o.parent.dataSourceSettings.columns.splice(r,0,n):o.parent.dataSourceSettings.columns.push(n);break;case"values":-1!==r?o.parent.dataSourceSettings.values.splice(r,0,n):o.parent.dataSourceSettings.values.push(n),"olap"!==o.parent.dataType||o.parent.engineModule.isMeasureAvail||1<o.parent.dataSourceSettings.values.length||("row"===o.parent.dataSourceSettings.valueAxis?o.parent.dataSourceSettings.rows:o.parent.dataSourceSettings.columns).push({name:"[Measures]",caption:"Measures",showRemoveIcon:!0,allowDragAndDrop:!0})}e="columns"===a?g.dataSourceSettings.columns.length:"rows"===a?g.dataSourceSettings.rows.length:0;0!==e&&g.dataSourceSettings.valueIndex===e&&o.control.setProperties({dataSourceSettings:{valueIndex:-1}},!0)}}))}}),d},zs.prototype.removeFieldFromReport=function(e){for(var t=!1,i=[this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.values,this.parent.dataSourceSettings.filters],a=this.parent.engineModule.fieldList[e],r=0,n=i.length;r<n;r++)if(!t&&i[r])for(var s,o,l=0,d=i[r].length;l<d;l++)if(i[r][l].name===e||"olap"===this.parent.dataType&&"[measures]"===i[r][l].name.toLowerCase()&&i[r][l].name.toLowerCase()===e){(o=i[r][l].properties||i[r][l]).type=a&&"number"===a.type?o.type:"Count",i[r].splice(l,1),"olap"===this.parent.dataType&&(s=this.parent.engineModule)&&s.fieldList[e]&&(s.fieldList[e].currrentMembers={},s.fieldList[e].searchMembers=[]),t=!0;break}return o},zs.prototype.getNewField=function(e,t){var i;return"olap"===this.parent.dataType?(i=this.parent.engineModule.fieldList[e],{name:t?t.name:e,caption:(t||i).caption,isNamedSet:t?t.isNamedSet:i.isNamedSets,isCalculatedField:(t||i).isCalculatedField,type:t?void 0===t.type?"number"===i.type?"Sum":"Count":t.type:void 0===i.aggregateType?"number"===i.type?"Sum":"Count":i.aggregateType,showFilterIcon:(t||i).showFilterIcon,showSortIcon:(t||i).showSortIcon,showEditIcon:(t||i).showEditIcon,showRemoveIcon:(t||i).showRemoveIcon,showValueTypeIcon:(t||i).showValueTypeIcon,allowDragAndDrop:(t||i).allowDragAndDrop,showSubTotals:(t||i).showSubTotals,expandAll:(t||i).expandAll}):(i=this.parent.engineModule.fieldList[e],{name:t?t.name:e,caption:(t||i).caption,type:t?void 0===t.type||null===t.type?"number"===i.type?"Sum":"Count":t.type:void 0===i.aggregateType||null===i.aggregateType?"number"===i.type?"Sum":"Count":i.aggregateType,showNoDataItems:(t||i).showNoDataItems,baseField:(t||i).baseField,baseItem:(t||i).baseItem,allowDragAndDrop:(t||i).allowDragAndDrop,showSubTotals:(t||i).showSubTotals,showFilterIcon:(t||i).showFilterIcon,showSortIcon:(t||i).showSortIcon,showEditIcon:(t||i).showEditIcon,showRemoveIcon:(t||i).showRemoveIcon,showValueTypeIcon:(t||i).showValueTypeIcon,expandAll:(t||i).expandAll})};var Gs=zs;function zs(e){this.parent=e}Qs.prototype.createErrorDialog=function(e,t){var i=_e.createElement("div",{id:this.parent.parentID+"_ErrorDialog",className:je});this.parent.element.appendChild(i),this.errorPopUp=new P.Dialog({animationSettings:{effect:"Fade"},allowDragging:!1,header:e,content:t,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:Re+(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(i)},Qs.prototype.closeErrorDialog=function(){this.errorPopUp.close()},Qs.prototype.removeErrorDialog=function(){this.errorPopUp&&!this.errorPopUp.isDestroyed&&(this.errorPopUp.destroy(),this.errorPopUp=null),document.getElementById(this.parent.parentID+"_ErrorDialog")&&_e.remove(document.getElementById(this.parent.parentID+"_ErrorDialog"))};var Ws=Qs;function Qs(e){this.parent=e}Ks.prototype.createFilterDialog=function(t,i,a,e){var r=this,n=_e.createElement("div",{id:this.parent.parentID+"_EditorTreeView",className:"e-member-editor-dialog "+("olap"===this.parent.dataType?"e-olap-editor-dialog":"")+(this.parent.isDataOverflow?" "+Wi:""),attrs:{"data-fieldName":i,"aria-label":a}}),s=this.parent.engineModule.fieldList[i].caption,o=this.parent.localeObj.getConstant("filter")+' "'+a+'" '+this.parent.localeObj.getConstant("by"),o=(this.filterObject=this.getFilterObject(i),this.isSearchEnabled=!1,this.allowExcelLikeFilter=this.isExcelFilter(i),this.parent.element.appendChild(n),this.dialogPopUp=new P.Dialog({animationSettings:{effect:this.allowExcelLikeFilter?"None":"Fade"},allowDragging:!1,header:this.allowExcelLikeFilter?o:s,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?"":" "+Q)+(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:Re+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:this.closeFilterDialog.bind(this),isFlat:!1,buttonModel:{cssClass:ke+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}],closeOnEscape:"Popup"!==this.parent.renderMode,target:e,cssClass:this.parent.cssClass,close:this.removeFilterDialog.bind(this)}),this.dialogPopUp.isStringTemplate=!0,this.dialogPopUp.appendTo(n),{cancel:!1,fieldName:i,fieldMembers:this.parent.dataSourceSettings.allowMemberFilter?t:[],filterSetting:this.filterObject});("pivotfieldlist"===this.parent.moduleName&&this.parent.control.isPopupView?this.parent.control.pivotGridModule:this.parent.control).trigger(wr,o,function(e){e.cancel?(r.dialogPopUp.close(),r.dialogPopUp=void 0):(t=e.fieldMembers,r.allowExcelLikeFilter?(r.createTabMenu(t,a,i),_e.addClass([r.dialogPopUp.element],"e-excel-filter")):r.dialogPopUp.content=r.createTreeView(t,a,i),r.updateCheckedState(),_e.setStyleAttribute(r.dialogPopUp.element,{visibility:"visible"}),r.allowExcelLikeFilter&&r.dialogPopUp.element.querySelector(".e-dlg-closeicon-btn").focus(),r.memberTreeView.nodeChecked=r.parent.control.pivotButtonModule.nodeStateModified.bind(r.parent.control.pivotButtonModule),r.allMemberSelect.nodeChecked=r.parent.control.pivotButtonModule.nodeStateModified.bind(r.parent.control.pivotButtonModule))})},Ks.prototype.createTreeView=function(e,t,i){var a=this,r=_e.createElement("div",{id:this.parent.parentID+"EditorDiv",className:De+(this.allowExcelLikeFilter?" e-excelfilter":"")}),n=_e.createElement("button",{id:this.parent.parentID+"_LevelDiv",className:"e-level-container-class",attrs:{type:"button"}}),s=_e.createElement("div",{id:this.parent.parentID+"_SearchDiv",attrs:{tabindex:"-1"},className:Ot}),o=this.parent.engineModule.fieldList[i].caption,l=_e.createElement("input",{attrs:{type:"text",className:"e-editor-search-input"}}),d=this.parent.isDataOverflow?this.parent.currentTreeItems.length-this.parent.control.maxNodeLimitInMemberEditor+this.parent.control.localeObj.getConstant("editorDataLimitMsg"):"",h=_e.createElement("div",{id:this.parent.parentID+"_LabelDiv",attrs:{tabindex:"-1",title:d},className:"e-editor-label-container"}),d=(this.parent.editorLabelElement=_e.createElement("label",{className:"e-editor-label"}),this.parent.editorLabelElement.innerText=d,h.style.display=this.parent.isDataOverflow?"block":"none",h.appendChild(this.parent.editorLabelElement),s.appendChild(l),this.createSortOptions(i,s,e),_e.createElement("div",{id:this.parent.parentID+"_AllDiv",attrs:{tabindex:"-1"},className:"e-select-all-container"})),p=_e.createElement("div",{id:this.parent.parentID+"_SelectAllContainer",className:Nt}),u=_e.createElement("div",{className:Oe+"-outer-div"}),c=_e.createElement("div",{className:Oe}),g=_e.createElement("div",{className:Xt+" "+Q}),n=(g.innerText=this.parent.localeObj.getConstant("noMatches"),"olap"!==this.parent.dataType||!this.parent.control.loadOnDemandInMemberEditor||this.parent.engineModule.fieldList[i].isHierarchy||this.parent.engineModule.fieldList[i].isNamedSets||(s.appendChild(n),this.createLevelWrapper(n,i)),d.appendChild(p),r.appendChild(s),r.appendChild(d),r.appendChild(g),this.editorSearch=new H.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("search")+' "'+o+'"',enableRtl:this.parent.enableRtl,cssClass:Pt+(this.parent.cssClass?" "+this.parent.cssClass:""),showClearButton:!0,change:function(e){"olap"===a.parent.dataType?a.searchOlapTreeView(e,g):(a.parent.eventBase.searchTreeNodes(e,a.memberTreeView,!1),e=a.dialogPopUp.element,0===[].slice.call(a.memberTreeView.element.querySelectorAll("li")).length?(a.allMemberSelect.disableNodes([a.allMemberSelect.element.querySelector("li")]),e.querySelector("."+Re).setAttribute("disabled","disabled"),_e.removeClass([g],Q)):(a.allMemberSelect.enableNodes([a.allMemberSelect.element.querySelector("li")]),e.querySelector("."+Re).removeAttribute("disabled"),_e.addClass([g],Q)),a.updateCheckedState())}}),this.editorSearch.isStringTemplate=!0,this.editorSearch.appendTo(l),{"data-fieldName":i,"data-memberId":"all"}),s=[{id:"all",name:this.parent.localeObj.getConstant("all"),isSelected:!0,htmlAttributes:n}];if(this.allMemberSelect=new D.TreeView({fields:{dataSource:s,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){_e.removeClass([e.node],"e-active"),e.cancel=!0},cssClass:this.parent.cssClass}),this.allMemberSelect.isStringTemplate=!0,!_e.isNullOrUndefined(this.parent.currentTreeItems))for(var m=0;m<this.parent.currentTreeItems.length;m++)!this.parent.currentTreeItems[m].id.indexOf("\n")&&0!==this.parent.currentTreeItems[m].id.indexOf("\n")||(this.parent.currentTreeItems[m].id=this.parent.currentTreeItems[m].id.replace("\n"," "));return this.allMemberSelect.appendTo(p),u.appendChild(c),r.appendChild(u),this.memberTreeView=new D.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){_e.removeClass([e.node],"e-active"),e.cancel=!0},expandOn:"None",cssClass:this.parent.cssClass}),this.memberTreeView.isStringTemplate=!0,this.memberTreeView.appendTo(c),this.parent.isDataOverflow&&this.parent.control.maxNodeLimitInMemberEditor<this.parent.currentTreeItems.length&&r.appendChild(h),r},Ks.prototype.createSortOptions=function(e,t,i){var a,r;"pivot"===this.parent.dataType&&i&&0<i.length&&(i=this.parent.engineModule.fieldList[e].sort,a=_e.createElement("div",{className:ct+" e-btn-group"+(this.parent.enableRtl?" "+L:"")+(this.parent.cssClass?" "+this.parent.cssClass:""),id:this.parent.element.id+"_Member_Sort"}),this.parent.element.appendChild(a),r=_e.createElement("button",{className:("Ascending"===i?St+" ":"")+Se,id:this.parent.element.id+"_Sort_Ascend",attrs:{type:"button","aria-label":"button"}}),i=_e.createElement("button",{className:("Descending"===i?St+" ":"")+Se,id:this.parent.element.id+"_Sort_Descend",attrs:{type:"button","aria-label":"button"}}),new z.Button({iconCss:W+" "+gt,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}).appendTo(r),new z.Button({iconCss:W+" "+mt,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}).appendTo(i),a.appendChild(r),a.appendChild(i),t.appendChild(a),this.unWireEvent(r),this.unWireEvent(i),this.wireEvent(r,e),this.wireEvent(i,e))},Ks.prototype.createLevelWrapper=function(e,n){for(var s=this,t=this.parent.engineModule,i=t.fieldList[n].levels,t=t.fieldList[n].levelCount,o=[],a=0,r=i.length;a<r;a++)o.push({id:i[a].id,text:i[a].name});this.dropMenu=new O.DropDownButton({cssClass:"e-level-drop e-caret-hide"+(this.parent.cssClass?" "+this.parent.cssClass:""),items:o,iconCss:"e-icons e-dropdown-icon",disabled:t===i.length,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,beforeOpen:function(e){var t=[].slice.call(e.element.querySelectorAll("li")),i=s.parent.engineModule.fieldList[n].levelCount;_e.removeClass(t,b);for(var a=0,r=t.length;a<r;a++)a<i&&_e.addClass([t[a]],b)},select:function(e){for(var t,i=s.dialogPopUp.element.getAttribute("data-fieldname"),a=s.parent.engineModule,r=0,n=o.length;r<n;r++)o[r].id===e.item.id&&(t=r);a.getFilterMembers(s.parent.dataSourceSettings,i,t+1,!1,!0)},close:function(){var e=s.parent.engineModule,t=e.fieldList[n].levels;e.fieldList[n].levelCount===t.length?(s.dropMenu.disabled=!0,s.dropMenu.dataBind()):s.dropMenu.disabled=!1}}),this.dropMenu.appendTo(e)},Ks.prototype.searchOlapTreeView=function(n,s){var o=this;clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){var e,t=o.parent.engineModule,i=o.dialogPopUp.element,a=i.getAttribute("data-fieldname"),r=o.parent.control.maxNodeLimitInMemberEditor||5e3;t.fieldList[a].isHierarchy?o.parent.eventBase.searchTreeNodes(n,o.memberTreeView,!1,!0):(o.dropMenu&&""!==n.value?o.dropMenu.disabled=!0:o.dropMenu.disabled=!1,o.parent.control.loadOnDemandInMemberEditor?(e=t.fieldList[a].levelCount||1,t.getSearchMembers(o.parent.dataSourceSettings,a,n.value.toLowerCase(),r,!1,e)):t.getSearchMembers(o.parent.dataSourceSettings,a,n.value.toLowerCase(),r,!0),o.parent.eventBase.searchTreeNodes(n,o.memberTreeView,!1,!1)),0===[].slice.call(o.memberTreeView.element.querySelectorAll("li")).length?(o.allMemberSelect.disableNodes([o.allMemberSelect.element.querySelector("li")]),i.querySelector("."+Re).setAttribute("disabled","disabled"),_e.removeClass([s],Q)):(o.allMemberSelect.enableNodes([o.allMemberSelect.element.querySelector("li")]),i.querySelector("."+Re).removeAttribute("disabled"),_e.addClass([s],Q)),o.updateCheckedState()},500)},Ks.prototype.nodeCheck=function(e,t){var i,a=[t.node];t.event.target.classList.contains("e-fullrow")||"Enter"===t.event.key?"true"===(i=e?this.allMemberSelect:this.memberTreeView).getNode(t.node).isChecked?i.uncheckAll(a):i.checkAll(a):38!==t.event.keyCode||e||(_e.removeClass(this.memberTreeView.element.querySelectorAll("li.e-prev-active-node"),"e-prev-active-node"),_e.addClass(a,"e-prev-active-node"))},Ks.prototype.applySorting=function(e,t){var i,t=_e.closest(t.target,"."+Se);t&&(i=[].slice.call(_e.closest(t,"."+ct).querySelectorAll("."+Se)),t.querySelector("."+gt)&&!t.classList.contains(St)?(this.updateFilterMembers("Ascending",e),_e.addClass([t],St),_e.removeClass([i[1]],St)):t.querySelector("."+mt)&&!t.classList.contains(St)?(this.updateFilterMembers("Descending",e),_e.addClass([t],St),_e.removeClass([i[0]],St)):(this.updateFilterMembers("None",e),_e.removeClass(i,St)))},Ks.prototype.updateFilterMembers=function(e,t){var i=this.parent.engineModule.fieldList[t],a="None"===e?Ie.getClonedData(i.dateMember):this.parent.currentTreeItems.slice(),r=!!i.isAlphanumeric||void 0,n=!1,i=i&&i.membersOrder?i.membersOrder.slice():[],s={fieldName:t,sortOrder:e,members:i&&0<i.length?i:Object.keys(a),IsOrderChanged:!1},i=(i&&0<i.length?a=Ie.applyCustomSort(s,a,r):(i=this.parent.dataSourceSettings.groupSettings.filter(function(e){return e.name===t&&"number"===e.type.toLocaleLowerCase()}),i=!_e.isNullOrUndefined(i)&&0<i.length,a=Ie.applyHeadersSort(a,s.sortOrder,r,i),n=!0),"pivotfieldlist"===this.parent.moduleName&&this.parent.control.isPopupView?this.parent.control.pivotGridModule:this.parent.control);if(n){for(var o=[],l=0,d=0;l<a.length;l++)"Grand Total"!==a[l].actualText&&(o[d++]=a[l].actualText);s.members=o}i.trigger(mr,s),s.IsOrderChanged&&(a=Ie.applyCustomSort(s,a,r,!0)),this.parent.currentTreeItems=[],this.parent.searchTreeItems=[];for(var h,p=[],u=t.replace(/[^a-zA-Z0-9 ]/g,"_"),c=this.parent.engineModule,g=0,m=a.length;g<m;g++)"None"===e?(h=a[g].actualText.toString(),h={id:u+"_"+(g+1),htmlAttributes:{"data-fieldName":t,"data-memberId":h},actualText:a[g].actualText,name:(this.parent.isDateField?a[g]:c.getFormattedValue(h,t)).formattedText,isSelected:this.parent.currentTreeItemsPos[a[g].actualText].isSelected},this.parent.currentTreeItems.push(h),(""===this.editorSearch.value||-1<h.name.toLowerCase().indexOf(this.editorSearch.value.toLowerCase()))&&(this.parent.searchTreeItems.push(h),p.push(h))):(this.parent.currentTreeItems.push(a[g]),(""===this.editorSearch.value||-1<a[g].name.toLowerCase().indexOf(this.editorSearch.value.toLowerCase()))&&(this.parent.searchTreeItems.push(a[g]),p.push(a[g]))),this.parent.currentTreeItemsPos[a[g].actualText].index=g;n=this.memberTreeView.fields.dataSource.length;this.memberTreeView.fields={dataSource:p.slice(0,n),id:"id",text:"name",isChecked:"isSelected",parentID:"pid"},this.memberTreeView.dataBind()},Ks.prototype.updateChildNodes=function(e){if("olap"===this.parent.dataType){var t=this.parent.engineModule,i=e.node.getAttribute("data-fieldname"),a=t.fieldList[i],r=[];if(a&&0<a.filterMembers.length&&!this.isSearchEnabled&&!a.members[e.nodeData.id].isNodeExpand){for(var n=[],s=0,o=a.filterMembers;s<o.length;s++){var l=o[s];l.pid===e.nodeData.id.toString()&&n.push(l)}0===n.length&&(a.childMembers=[],t.getChildMembers(this.parent.dataSourceSettings,e.nodeData.id.toString(),i),n=a.childMembers,a.childMembers=[]);var d=Ie.getClonedData(n),h=this.memberTreeView.fields.dataSource,p=!1;_e.isNullOrUndefined(this.filterObject)||(p="Include"===this.filterObject.type,r=this.filterObject.items||[]),d=this.updateChildData(p,d,r,i,e.nodeData);for(var u=0,c=d=this.parent.eventBase.sortOlapFilterData(d,t.fieldList[i].sort);u<c.length;u++){var g=c[u];h.push(g)}a.members[e.nodeData.id].isNodeExpand=!0,this.memberTreeView.addNodes(d,e.node)}}},Ks.prototype.updateChildData=function(e,t,i,a,r){for(var n=Object.keys(this.parent.currentTreeItemsPos).length,s=this.parent.engineModule.fieldList[a],o=[],l=1,d=0,h=t;d<h.length;d++){var p=h[d],u=p,c=p.id.toString();s.members[c].isNodeExpand=!1,p.isSelected="true"===r.isChecked,l<=this.parent.control.maxNodeLimitInMemberEditor&&o.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,o},Ks.prototype.createTabMenu=function(e,t,i){for(var a=_e.createElement("div",{id:this.parent.parentID+"_FilterTabContainer",className:"e-filter-tab-container",attrs:{tabindex:"-1"}}),r=(this.dialogPopUp.content=a,this.dialogPopUp.dataBind(),["Label","Value","Include","Exclude"]),n="((-|\\+)?[0-9]+(\\.[0-9]+)?)+",s=Object.keys(this.parent.engineModule.fieldList[i].members)[0],o=this.parent.engineModule.fieldList[i].type,l=Ie.getFieldByName(i,this.parent.dataSourceSettings.formatSettings),d=[{header:{text:this.parent.localeObj.getConstant("member"),iconCss:this.filterObject&&1<r.indexOf(this.filterObject.type)?ot:""},content:this.createTreeView(e,t,i)}],h=0,p=r;h<p.length;h++){var u=p[h];("Label"===u&&this.parent.dataSourceSettings.allowLabelFilter||"Value"===u&&this.parent.dataSourceSettings.allowValueFilter)&&(u={header:{text:"Number"===(u="Label"===u&&s&&s.match(n)&&s.match(n)[0].length===s.length&&"number"===o?"Number":"Label"===u&&s&&"Invalid Date"!==new Date(s).toString()&&(l&&l.type||this.filterObject&&"Date"===this.filterObject.type)?"Date":u)?this.parent.localeObj.getConstant("label"):this.parent.localeObj.getConstant(u.toLowerCase()),iconCss:this.filterObject&&this.filterObject.type===u?ot:""},content:this.createCustomFilter(i,this.filterObject&&this.filterObject.type===u?this.filterObject:void 0,u.toLowerCase())},d.push(u))}e=this.filterObject?0<=["Label","Date","Number"].indexOf(this.filterObject.type)?1:"Value"===this.filterObject.type?this.parent.dataSourceSettings.allowLabelFilter&&this.parent.dataSourceSettings.allowValueFilter?2:1:0:0,e=this.parent.dataSourceSettings.allowMemberFilter||0!=e?e:1;this.tabObj=new D.Tab({heightAdjustMode:"Auto",items:d,height:"100%",selectedItem:e,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass}),this.tabObj.isStringTemplate=!0,this.tabObj.appendTo(a),this.parent.dataSourceSettings.allowMemberFilter||this.tabObj.hideTab(0),0<e&&_e.addClass([this.dialogPopUp.element.querySelector(".e-filter-div-content."+(1==e&&this.parent.dataSourceSettings.allowLabelFilter?"e-label-filter":"e-value-filter"))],"e-selected-tab")},Ks.prototype.createCustomFilter=function(e,t,i){for(var a=[],r=[],n=[],s=this.parent.dataSourceSettings.values,o="DoesNotEquals",l=0,d=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"]},p=["Between","NotBetween"],u="label"===i?h.label:"date"===i?h.date:h.value,c=0,g=u;c<g.length;c++){var m=g[c],o=t&&m===t.condition?0<=u.indexOf(t.condition)?t.condition:u[0]:o;a.push({value:m,text:this.parent.localeObj.getConstant(m)})}for(var S=s.length;S--;)r.unshift({value:s[S].name,text:s[S].caption||s[S].name}),l=t&&"Value"===t.type&&t.measure===s[S].name&&t.condition===o?S:l;if("olap"===this.parent.dataType){var h=this.parent.engineModule,f=h.fieldList[e].levels;if(this.parent.engineModule.fieldList[e].isHierarchy){for(var v=void 0,y=0,b=this.parent.engineModule.fieldListData;y<b.length;y++){var C=b[y];if(C&&C.pid===e){v=C;break}}n.push({value:v?v.id:e,text:v?v.caption:h.fieldList[e].name}),d=0,t&&t.name===e&&t.type.toLowerCase()===i&&(n[n.length-1].iconClass=W+" "+lt)}else for(var x=0,k=f.length;x<k;x++){d=t&&t.selectedField===f[x].id?x:d,n.push({value:f[x].id,text:f[x].name});for(var w=0,T=this.parent.dataSourceSettings.filterSettings;w<T.length;w++){var M=T[w];if(M.name===e&&M.selectedField===f[x].id&&M.type.toLowerCase()===i){n[n.length-1].iconClass=W+" "+lt;break}}}}var h=_e.createElement("div",{className:"e-filter-div-content e-"+(0<=["date","number"].indexOf(i)?"label":i)+"-filter"+(this.parent.isDataOverflow?" "+Wi:""),id:this.parent.parentID+"_"+i+"_filter_div_content",attrs:{"data-type":i,"data-fieldName":e,"data-operator":o,"data-selectedField":"olap"===this.parent.dataType&&0<n.length?n[d].value.toString():"","data-measure":0<this.parent.dataSourceSettings.values.length?this.parent.dataSourceSettings.values[l].name:"","data-value1":t&&o===t.condition&&t.value1?t.value1.toString():"","data-value2":t&&o===t.condition&&t.value2?t.value2.toString():""}}),D=_e.createElement("div",{className:"e-filter-text-div"}),O=(D.innerText=this.parent.localeObj.getConstant(i+"TextContent"),_e.createElement("div",{className:dt+" "+(-1===p.indexOf(o)?Q:"")})),P=(O.innerText=this.parent.localeObj.getConstant("And"),_e.createElement("div",{className:"e-separator-div"})),N=_e.createElement("div",{className:"e-filter-option-container-1"}),E=_e.createElement("div",{className:"e-level-option-container "+("olap"===this.parent.dataType?"":Q)}),I=_e.createElement("div",{className:"e-measure-option-container "+(0<=["label","date","number"].indexOf(i)?Q:"")}),F=_e.createElement("div",{className:"e-condition-option-container"}),L=_e.createElement("div",{className:"e-filter-option-container-2"}),A=_e.createElement("div",{id:this.parent.parentID+"_"+i+"_level_option_container"}),R=_e.createElement("div",{id:this.parent.parentID+"_"+i+"_measure_option_container"}),j=_e.createElement("div",{id:this.parent.parentID+"_"+i+"_contition_option_container"}),q=_e.createElement("div",{className:"e-filter-input-div-1"}),H=_e.createElement("div",{className:ht+" "+(-1===p.indexOf(o)?Q:"")}),V=_e.createElement("input",{id:this.parent.parentID+"_"+i+"_input_option_1",attrs:{type:"text"}}),U=_e.createElement("input",{id:this.parent.parentID+"_"+i+"_input_option_2",attrs:{type:"text"}});return q.appendChild(V),H.appendChild(U),E.appendChild(A),E.appendChild(P.cloneNode(!0)),I.appendChild(R),I.appendChild(P),F.appendChild(j),N.appendChild(E),N.appendChild(I),N.appendChild(F),L.appendChild(q),L.appendChild(O),L.appendChild(H),this.createElements(t,p,R,j,V,U,r,a,l,o,i,A,n,d),h.appendChild(D),h.appendChild(N),h.appendChild(L),h},Ks.prototype.createElements=function(e,n,t,i,h,p,u,a,r,s,o,l,d,c){var g,m,S,f,v,y,b=this,C=("olap"===this.parent.dataType&&((d=new G.DropDownList({dataSource:d,enableRtl:this.parent.enableRtl,fields:{value:"value",text:"text",iconCss:"iconClass"},index:c,cssClass:"e-level-options"+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){var t,i=b.dialogPopUp.element.querySelector(".e-selected-tab"),a=i.getAttribute("data-fieldName"),r=i.getAttribute("data-type");if(!_e.isNullOrUndefined(i)){b.updateInputValues(i,r,h,p),w.setStyleAndAttributes(i,{"data-selectedField":e.value});for(var n,s,o=0,l=b.parent.dataSourceSettings.filterSettings;o<l.length;o++){var d=l[o];if(d.name===a&&d.selectedField===e.value){t=d;break}}t&&("value"===r&&t.measure&&""!==t.measure&&(C.value=t.measure||u[0].value),t.condition?x.value=t.condition||"DoesNotEquals":x.value="DoesNotEquals",s=n=void 0,"value"===r?(n=_e.getInstance(h,H.NumericTextBox),s=_e.getInstance(p,H.NumericTextBox),n&&(n.value=t.value1?parseInt(t.value1,10):void 0),s&&(s.value=t.value2?parseInt(t.value2,10):void 0)):(n=_e.getInstance(h,H.MaskedTextBox),s=_e.getInstance(p,H.MaskedTextBox),n&&(n.value=t.value1||""),s&&(s.value=t.value2||""))),b.updateInputValues(i,r,h,p)}}})).isStringTemplate=!0,d.appendTo(l)),new G.DropDownList({dataSource:u,enableRtl:this.parent.enableRtl,fields:{value:"value",text:"text"},index:r,cssClass:pt+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){var t=b.dialogPopUp.element.querySelector(".e-selected-tab");_e.isNullOrUndefined(t)||(b.updateInputValues(t,o,h,p),w.setStyleAndAttributes(t,{"data-measure":e.value}))}})),x=(C.isStringTemplate=!0,C.appendTo(t),new G.DropDownList({dataSource:a,enableRtl:this.parent.enableRtl,fields:{value:"value",text:"text"},value:s,cssClass:ut+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){var t=b.dialogPopUp.element.querySelector(".e-selected-tab");if(!_e.isNullOrUndefined(t)){b.updateInputValues(t,o,h,p);for(var i=0,a=[dt,ht];i<a.length;i++){var r=a[i];0<=n.indexOf(e.value)?_e.removeClass([t.querySelector("."+r)],Q):_e.addClass([t.querySelector("."+r)],Q)}w.setStyleAndAttributes(t,{"data-operator":e.value})}}}));x.isStringTemplate=!0,x.appendTo(i),("date"===o?(g=new N.DateTimePicker({placeholder:this.parent.localeObj.getConstant("chooseDate"),enableRtl:this.parent.enableRtl,format:"dd/MM/yyyy hh:mm:ss a",showClearButton:!0,value:e&&s===e.condition?"string"==typeof e.value1?new Date(e.value1):e.value1:null,change:function(e){var t=b.dialogPopUp.element.querySelector(".e-selected-tab");_e.isNullOrUndefined(t)||w.setStyleAndAttributes(t,{"data-value1":e.value,"data-value2":m.value})},width:"100%",cssClass:this.parent.cssClass}),m=new N.DateTimePicker({placeholder:this.parent.localeObj.getConstant("chooseDate"),enableRtl:this.parent.enableRtl,format:"dd/MM/yyyy hh:mm:ss a",showClearButton:!0,value:e&&s===e.condition?"string"==typeof e.value2?new Date(e.value2):e.value2:null,change:function(e){var t=b.dialogPopUp.element.querySelector(".e-selected-tab");_e.isNullOrUndefined(t)||w.setStyleAndAttributes(t,{"data-value1":g.value,"data-value2":e.value})},width:"100%",cssClass:this.parent.cssClass}),g.isStringTemplate=!0,g.appendTo(h),m.isStringTemplate=!0,m):"value"===o?(S=new H.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,format:"###.##",value:e&&s===e.condition?parseInt(e.value1,10):void 0,change:function(e){var t=b.dialogPopUp.element.querySelector(".e-selected-tab");_e.isNullOrUndefined(t)||w.setStyleAndAttributes(t,{"data-value1":e.value?e.value.toString():"0","data-value2":f.value?f.value.toString():"0"})},width:"100%",cssClass:this.parent.cssClass}),f=new H.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,format:"###.##",value:e&&s===e.condition?parseInt(e.value2,10):void 0,change:function(e){var t=b.dialogPopUp.element.querySelector(".e-selected-tab");_e.isNullOrUndefined(t)||w.setStyleAndAttributes(t,{"data-value1":S.value?S.value.toString():"0","data-value2":e.value?e.value.toString():"0"})},width:"100%",cssClass:this.parent.cssClass}),S.isStringTemplate=!0,S.appendTo(h),f.isStringTemplate=!0,f):(v=new H.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,value:e&&s===e.condition?e.value1:"",change:function(e){var t=b.dialogPopUp.element.querySelector(".e-selected-tab");_e.isNullOrUndefined(t)||w.setStyleAndAttributes(t,{"data-value1":e.value,"data-value2":y.value})},width:"100%",cssClass:this.parent.cssClass}),y=new H.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,value:e&&s===e.condition?e.value2:"",change:function(e){var t=b.dialogPopUp.element.querySelector(".e-selected-tab");_e.isNullOrUndefined(t)||w.setStyleAndAttributes(t,{"data-value1":v.value,"data-value2":e.value})},width:"100%",cssClass:this.parent.cssClass}),v.isStringTemplate=!0,v.appendTo(h),y.isStringTemplate=!0,y)).appendTo(p)},Ks.prototype.updateInputValues=function(e,t,i,a){i=_e.getInstance(i,"date"===t?N.DateTimePicker:"value"===t?H.NumericTextBox:H.MaskedTextBox),a=_e.getInstance(a,"date"===t?N.DateTimePicker:"value"===t?H.NumericTextBox:H.MaskedTextBox),t=_e.isNullOrUndefined(i.value)?"":i.value.toString(),i=_e.isNullOrUndefined(a.value)?"":a.value.toString();w.setStyleAndAttributes(e,{"data-value1":t,"data-value2":i})},Ks.prototype.validateTreeNode=function(e){e.node.classList.contains(Q)&&(e.cancel=!0)},Ks.prototype.updateCheckedState=function(){var e=this.dialogPopUp.element,t=[].slice.call(this.memberTreeView.element.querySelectorAll("li")),i=e.getAttribute("data-fieldname"),a=this.getUnCheckedNodes(i),r=this.getCheckedNodes(i),n=this.allMemberSelect.element.querySelector("li").querySelector("span."+Fe);0<t.length?0<r?(0<a?(_e.removeClass([n],Le),_e.addClass([n],Ae),this.allMemberSelect.element.querySelector("li").setAttribute("aria-checked","false")):0===a&&(_e.removeClass([n],Ae),_e.addClass([n],Le)),this.dialogPopUp.buttons[0].buttonModel.disabled=!1,e.querySelector("."+Re).removeAttribute("disabled")):0<a&&0===r&&(_e.removeClass([n],[Le,Ae]),this.getCheckedNodes(i)===r)&&(this.dialogPopUp.buttons[0].buttonModel.disabled=!0,e.querySelector("."+Re).setAttribute("disabled","disabled")):(this.dialogPopUp.buttons[0].buttonModel.disabled=!0,e.querySelector("."+Re).setAttribute("disabled","disabled"))},Ks.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},Ks.prototype.getUnCheckedNodes=function(e){var t=[],i=this.parent.engineModule;if("olap"===this.parent.dataType&&i&&!i.fieldList[e].isHierarchy)return i=this.memberTreeView.getAllCheckedNodes(),this.memberTreeView.fields.dataSource.length-i.length;for(var a=0,r=this.parent.searchTreeItems;a<r.length;a++){var n=r[a];n.isSelected||t.push(n)}return t.length},Ks.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)},Ks.prototype.getFilterObject=function(e){var t=Ie.getFilterItemByName(e,Ie.cloneFilterSettings(this.parent.dataSourceSettings.filterSettings));if(t&&(0<=["Label","Date","Number"].indexOf(t.type)&&this.parent.dataSourceSettings.allowLabelFilter||"Value"===t.type&&this.parent.dataSourceSettings.allowValueFilter||0<=["Include","Exclude"].indexOf(t.type)&&this.parent.eventBase.isValidFilterItemsAvail(e,t)))return t},Ks.prototype.wireEvent=function(e,t){_e.EventHandler.add(e,"click",this.applySorting.bind(this,t),this)},Ks.prototype.unWireEvent=function(e){_e.EventHandler.remove(e,"click",this.applySorting)},Ks.prototype.closeFilterDialog=function(){this.dialogPopUp.close()},Ks.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")&&_e.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")&&_e.remove(document.getElementById(this.parent.parentID+"_EditorTreeView"))},Ks.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}}};var Ys=Ks;function Ks(e){this.parent=e}Js.prototype.destroy=function(){this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null)};var Xs=Js;function Js(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 _s(this),this.dataSourceUpdate=new Gs(this),this.eventBase=new Vs(this),this.filterDialog=new Ys(this),this.errorDialog=new Ws(this),this.keyboardModule=new qs(this),this}$s.prototype.getModuleName=function(){return"common"},$s.prototype.initiateCommonModule=function(){var e;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,this.parent.pivotCommon.moduleName=this.parent.getModuleName(),this.parent.pivotCommon.enableRtl=this.parent.enableRtl,this.parent.pivotCommon.isAdaptive=_e.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):(e={pivotEngine:"olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,dataSourceSettings: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:_e.Browser.isDevice,renderMode:"Popup",localeObj:this.parent.localeObj,dataType:this.parent.dataType,cssClass:this.parent.cssClass},this.parent.pivotCommon=new Xs(e)),this.parent.pivotCommon.control=this.parent},$s.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Ar,this.initiateCommonModule,this),this.parent.on(Rr,this.initiateCommonModule,this))},$s.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ar,this.initiateCommonModule),this.parent.off(Rr,this.initiateCommonModule))},$s.prototype.destroy=function(){this.removeEventListener(),this.parent.pivotCommon&&(this.parent.pivotCommon.destroy(),this.parent.pivotCommon=null)};var Zs=$s;function $s(e){this.parent=e,(this.parent.commonModule=this).addEventListener()}eo=function(e,t){return(eo=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])}))(e,t)};var eo,to,io=function(e,t){function i(){this.constructor=e}eo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},a=function(e,t,i,a){var r,n=arguments.length,s=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(n<3?r(s):3<n?r(t,i,s):r(t,i))||s);return 3<n&&s&&Object.defineProperty(t,i,s),s},ao=(to=_e.ChildProperty,io(ro,to),a([_e.Property()],ro.prototype,"name",void 0),a([_e.Property()],ro.prototype,"caption",void 0),a([_e.Property("Sum")],ro.prototype,"type",void 0),a([_e.Property()],ro.prototype,"axis",void 0),a([_e.Property(!1)],ro.prototype,"showNoDataItems",void 0),a([_e.Property()],ro.prototype,"baseField",void 0),a([_e.Property()],ro.prototype,"baseItem",void 0),a([_e.Property(!0)],ro.prototype,"showSubTotals",void 0),a([_e.Property(!1)],ro.prototype,"isNamedSet",void 0),a([_e.Property(!1)],ro.prototype,"isCalculatedField",void 0),a([_e.Property(!0)],ro.prototype,"showFilterIcon",void 0),a([_e.Property(!0)],ro.prototype,"showSortIcon",void 0),a([_e.Property(!0)],ro.prototype,"showRemoveIcon",void 0),a([_e.Property(!0)],ro.prototype,"showValueTypeIcon",void 0),a([_e.Property(!0)],ro.prototype,"showEditIcon",void 0),a([_e.Property(!0)],ro.prototype,"allowDragAndDrop",void 0),a([_e.Property()],ro.prototype,"dataType",void 0),a([_e.Property(!1)],ro.prototype,"expandAll",void 0),a([_e.Property()],ro.prototype,"groupName",void 0),ro);function ro(){return null!==to&&to.apply(this,arguments)||this}io(oo,no=ao);var no,so=oo;function oo(){return null!==no&&no.apply(this,arguments)||this}lo=_e.ChildProperty,io(po,lo),a([_e.Property()],po.prototype,"backgroundColor",void 0),a([_e.Property()],po.prototype,"color",void 0),a([_e.Property()],po.prototype,"fontFamily",void 0),a([_e.Property()],po.prototype,"fontSize",void 0);var lo,ho=po;function po(){return null!==lo&&lo.apply(this,arguments)||this}uo=_e.ChildProperty,io(go,uo),a([_e.Property()],go.prototype,"name",void 0),a([_e.Property("Include")],go.prototype,"type",void 0),a([_e.Property()],go.prototype,"items",void 0),a([_e.Property("DoesNotEquals")],go.prototype,"condition",void 0),a([_e.Property()],go.prototype,"value1",void 0),a([_e.Property()],go.prototype,"value2",void 0),a([_e.Property()],go.prototype,"measure",void 0),a([_e.Property(1)],go.prototype,"levelCount",void 0),a([_e.Property()],go.prototype,"selectedField",void 0);var uo,co=go;function go(){return null!==uo&&uo.apply(this,arguments)||this}mo=_e.ChildProperty,io(fo,mo),a([_e.Property()],fo.prototype,"measure",void 0),a([_e.Property()],fo.prototype,"label",void 0),a([_e.Property()],fo.prototype,"conditions",void 0),a([_e.Property()],fo.prototype,"value1",void 0),a([_e.Property()],fo.prototype,"value2",void 0),a([_e.Property()],fo.prototype,"style",void 0),a([_e.Property(!0)],fo.prototype,"applyGrandTotals",void 0);var mo,So=fo;function fo(){return null!==mo&&mo.apply(this,arguments)||this}vo=_e.ChildProperty,io(bo,vo),a([_e.Property()],bo.prototype,"name",void 0),a([_e.Property("Ascending")],bo.prototype,"order",void 0),a([_e.Property([])],bo.prototype,"membersOrder",void 0);var vo,yo=bo;function bo(){return null!==vo&&vo.apply(this,arguments)||this}Co=_e.ChildProperty,io(wo,Co),a([_e.Property()],wo.prototype,"name",void 0),a([_e.Property()],wo.prototype,"minimumFractionDigits",void 0),a([_e.Property()],wo.prototype,"maximumFractionDigits",void 0),a([_e.Property()],wo.prototype,"minimumSignificantDigits",void 0),a([_e.Property()],wo.prototype,"maximumSignificantDigits",void 0),a([_e.Property(!0)],wo.prototype,"useGrouping",void 0),a([_e.Property()],wo.prototype,"skeleton",void 0),a([_e.Property()],wo.prototype,"type",void 0),a([_e.Property()],wo.prototype,"currency",void 0),a([_e.Property()],wo.prototype,"minimumIntegerDigits",void 0),a([_e.Property()],wo.prototype,"format",void 0);var Co,xo=wo;function wo(){return null!==Co&&Co.apply(this,arguments)||this}To=_e.ChildProperty,io(Do,To),a([_e.Property()],Do.prototype,"name",void 0),a([_e.Property()],Do.prototype,"groupInterval",void 0),a([_e.Property()],Do.prototype,"startingAt",void 0),a([_e.Property()],Do.prototype,"endingAt",void 0),a([_e.Property("Date")],Do.prototype,"type",void 0),a([_e.Property()],Do.prototype,"rangeInterval",void 0),a([_e.Property()],Do.prototype,"caption",void 0),a([_e.Property()],Do.prototype,"customGroups",void 0);var To,Mo=Do;function Do(){return null!==To&&To.apply(this,arguments)||this}Oo=_e.ChildProperty,io(No,Oo),a([_e.Property()],No.prototype,"groupName",void 0),a([_e.Property([])],No.prototype,"items",void 0);var Oo,Po=No;function No(){return null!==Oo&&Oo.apply(this,arguments)||this}Eo=_e.ChildProperty,io(Fo,Eo),a([_e.Property()],Fo.prototype,"name",void 0),a([_e.Property()],Fo.prototype,"formula",void 0),a([_e.Property()],Fo.prototype,"hierarchyUniqueName",void 0),a([_e.Property()],Fo.prototype,"formatString",void 0);var Eo,Io=Fo;function Fo(){return null!==Eo&&Eo.apply(this,arguments)||this}Lo=_e.ChildProperty,io(Ro,Lo),a([_e.Property()],Ro.prototype,"name",void 0),a([_e.Property()],Ro.prototype,"items",void 0),a([_e.Property()],Ro.prototype,"delimiter",void 0);var Lo,Ao=Ro;function Ro(){return null!==Lo&&Lo.apply(this,arguments)||this}ko=_e.ChildProperty,io(qo,ko),a([_e.Property()],qo.prototype,"headerText",void 0),a([_e.Property(".")],qo.prototype,"headerDelimiter",void 0),a([_e.Property("None")],qo.prototype,"sortOrder",void 0),a([_e.Property()],qo.prototype,"rowHeaderText",void 0),a([_e.Property("Ascending")],qo.prototype,"rowSortOrder",void 0),a([_e.Property()],qo.prototype,"columnHeaderText",void 0),a([_e.Property("Ascending")],qo.prototype,"columnSortOrder",void 0),a([_e.Property()],qo.prototype,"measure",void 0);var ko,jo=qo;function qo(){return null!==ko&&ko.apply(this,arguments)||this}Ho=_e.ChildProperty,io(Uo,Ho),a([_e.Property()],Uo.prototype,"userName",void 0),a([_e.Property()],Uo.prototype,"password",void 0);var Ho,Vo=Uo;function Uo(){return null!==Ho&&Ho.apply(this,arguments)||this}_o=_e.ChildProperty,io(s,_o),a([_e.Property("Local")],s.prototype,"mode",void 0),a([_e.Property()],s.prototype,"catalog",void 0),a([_e.Property()],s.prototype,"cube",void 0),a([_e.Property()],s.prototype,"roles",void 0),a([_e.Property("Relational")],s.prototype,"providerType",void 0),a([_e.Property()],s.prototype,"url",void 0),a([_e.Property(1033)],s.prototype,"localeIdentifier",void 0),a([_e.Property()],s.prototype,"dataSource",void 0),a([_e.Collection([],ao)],s.prototype,"rows",void 0),a([_e.Collection([],ao)],s.prototype,"columns",void 0),a([_e.Collection([],ao)],s.prototype,"values",void 0),a([_e.Collection([],ao)],s.prototype,"filters",void 0),a([_e.Collection([],ao)],s.prototype,"fieldMapping",void 0),a([_e.Property([])],s.prototype,"excludeFields",void 0),a([_e.Property(!1)],s.prototype,"expandAll",void 0),a([_e.Property("column")],s.prototype,"valueAxis",void 0),a([_e.Property(-1)],s.prototype,"valueIndex",void 0),a([_e.Collection([],co)],s.prototype,"filterSettings",void 0),a([_e.Collection([],yo)],s.prototype,"sortSettings",void 0),a([_e.Property(!0)],s.prototype,"enableSorting",void 0),a([_e.Property("JSON")],s.prototype,"type",void 0),a([_e.Property(!0)],s.prototype,"allowMemberFilter",void 0),a([_e.Property(!1)],s.prototype,"allowLabelFilter",void 0),a([_e.Property(!1)],s.prototype,"allowValueFilter",void 0),a([_e.Property(!0)],s.prototype,"showSubTotals",void 0),a([_e.Property(!0)],s.prototype,"showRowSubTotals",void 0),a([_e.Property(!0)],s.prototype,"showColumnSubTotals",void 0),a([_e.Property("Auto")],s.prototype,"subTotalsPosition",void 0),a([_e.Property(!0)],s.prototype,"showGrandTotals",void 0),a([_e.Property("Bottom")],s.prototype,"grandTotalsPosition",void 0),a([_e.Property(!0)],s.prototype,"showRowGrandTotals",void 0),a([_e.Property(!0)],s.prototype,"showColumnGrandTotals",void 0),a([_e.Property(!1)],s.prototype,"alwaysShowValueHeader",void 0),a([_e.Property(!0)],s.prototype,"showHeaderWhenEmpty",void 0),a([_e.Property(!0)],s.prototype,"showAggregationOnValueField",void 0),a([_e.Collection([],xo)],s.prototype,"formatSettings",void 0),a([_e.Collection([],Ao)],s.prototype,"drilledMembers",void 0),a([_e.Complex({},jo)],s.prototype,"valueSortSettings",void 0),a([_e.Collection([],Io)],s.prototype,"calculatedFieldSettings",void 0),a([_e.Collection([],So)],s.prototype,"conditionalFormatSettings",void 0),a([_e.Property()],s.prototype,"emptyCellsTextContent",void 0),a([_e.Collection([],Mo)],s.prototype,"groupSettings",void 0),a([_e.Complex({},Vo)],s.prototype,"authentication",void 0);var _o,io=s;function s(){return null!==_o&&_o.apply(this,arguments)||this}Bo=function(e,t){return(Bo=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])}))(e,t)};var Bo,Go,a=function(e,t){function i(){this.constructor=e}Bo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},o=function(e,t,i,a){var r,n=arguments.length,s=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(n<3?r(s):3<n?r(t,i,s):r(t,i))||s);return 3<n&&s&&Object.defineProperty(t,i,s),s};Go=_e.ChildProperty,a(zo,Go),o([_e.Property("Row")],zo.prototype,"mode",void 0),o([_e.Property("Flow")],zo.prototype,"cellSelectionMode",void 0),o([_e.Property("Single")],zo.prototype,"type",void 0),o([_e.Property(!1)],zo.prototype,"checkboxOnly",void 0),o([_e.Property(!1)],zo.prototype,"persistSelection",void 0),o([_e.Property("Default")],zo.prototype,"checkboxMode",void 0),o([_e.Property(!1)],zo.prototype,"enableSimpleMultiRowSelection",void 0);function zo(){return null!==Go&&Go.apply(this,arguments)||this}Wo=_e.ChildProperty,a(l,Wo),o([_e.Property("auto")],l.prototype,"height",void 0),o([_e.Property("auto")],l.prototype,"width",void 0),o([_e.Property("Both")],l.prototype,"gridLines",void 0),o([_e.Property(!1)],l.prototype,"allowTextWrap",void 0),o([_e.Property(!1)],l.prototype,"allowReordering",void 0),o([_e.Property(!0)],l.prototype,"allowResizing",void 0),o([_e.Property(!0)],l.prototype,"allowAutoResizing",void 0),o([_e.Property(null)],l.prototype,"rowHeight",void 0),o([_e.Property(110)],l.prototype,"columnWidth",void 0),o([_e.Property("Compact")],l.prototype,"layout",void 0),o([_e.Property("Ellipsis")],l.prototype,"clipMode",void 0),o([_e.Property(!1)],l.prototype,"allowSelection",void 0),o([_e.Property(-1)],l.prototype,"selectedRowIndex",void 0),o([_e.Property({mode:"Row",cellSelectionMode:"Flow",type:"Single"})],l.prototype,"selectionSettings",void 0),o([_e.Property({wrapMode:"Both"})],l.prototype,"textWrapSettings",void 0),o([_e.Property("AllPages")],l.prototype,"printMode",void 0),o([_e.Property()],l.prototype,"contextMenuItems",void 0),o([_e.Event()],l.prototype,"beforeCopy",void 0),o([_e.Event()],l.prototype,"printComplete",void 0),o([_e.Event()],l.prototype,"beforePrint",void 0),o([_e.Event()],l.prototype,"beforePdfExport",void 0),o([_e.Event()],l.prototype,"beforeExcelExport",void 0),o([_e.Event()],l.prototype,"contextMenuOpen",void 0),o([_e.Event()],l.prototype,"contextMenuClick",void 0),o([_e.Event()],l.prototype,"queryCellInfo",void 0),o([_e.Event()],l.prototype,"headerCellInfo",void 0),o([_e.Event()],l.prototype,"rowSelecting",void 0),o([_e.Event()],l.prototype,"rowSelected",void 0),o([_e.Event()],l.prototype,"rowDeselecting",void 0),o([_e.Event()],l.prototype,"rowDeselected",void 0),o([_e.Event()],l.prototype,"cellSelecting",void 0),o([_e.Event()],l.prototype,"cellSelected",void 0),o([_e.Event()],l.prototype,"cellDeselecting",void 0),o([_e.Event()],l.prototype,"cellDeselected",void 0),o([_e.Event()],l.prototype,"resizeStart",void 0),o([_e.Event()],l.prototype,"resizing",void 0),o([_e.Event()],l.prototype,"resizeStop",void 0),o([_e.Event()],l.prototype,"pdfHeaderQueryCellInfo",void 0),o([_e.Event()],l.prototype,"pdfQueryCellInfo",void 0),o([_e.Event()],l.prototype,"excelHeaderQueryCellInfo",void 0),o([_e.Event()],l.prototype,"excelQueryCellInfo",void 0),o([_e.Event()],l.prototype,"columnDragStart",void 0),o([_e.Event()],l.prototype,"columnDrag",void 0),o([_e.Event()],l.prototype,"columnDrop",void 0),o([_e.Event()],l.prototype,"columnRender",void 0);var Wo,a=l;function l(){return null!==Wo&&Wo.apply(this,arguments)||this}Yo.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)}},Yo.prototype.getNextButton=function(e){var t=this.allpivotButtons(e);if(_e.removeClass(t,"e-btn-focused"),this.parent.grid.element.querySelector("."+Y))for(var i=t.length,a=0;a<i;a++)if(t[a].getAttribute("data-uid")===e.getAttribute("data-uid"))return t[a+1]||e;return e},Yo.prototype.getPrevButton=function(e){var t=this.allpivotButtons(e);if(_e.removeClass(t,"e-btn-focused"),this.parent.grid.element.querySelector("."+Y))for(var i=t.length,a=0;a<i;a++)if(t[a].getAttribute("data-uid")===e.getAttribute("data-uid"))return t[a-1]||e;return e},Yo.prototype.allpivotButtons=function(e){var t,i,a,r,n,s,o=[];return e&&this.parent.showGroupingBar&&(n=_e.closest(e,"."+qi),s=_e.closest(e,"."+Ui),t=_e.closest(e,"."+ki),e=e.classList.contains(bt),r=a=i=void 0,null!==n?a=n.classList.contains(qi):null!==s?r=s.classList.contains(Ui):null!==t&&(i=t.classList.contains(ki)),a||r||e?(n=[].slice.call(this.parent.element.querySelector("."+qi).querySelectorAll("."+Y)),s=[].slice.call(this.parent.element.querySelector("."+Ui).querySelectorAll("."+Y)),o=n.concat(s)):i&&(o=[].slice.call(this.parent.element.querySelector("."+ki).querySelectorAll("."+Y)))),o},Yo.prototype.processTab=function(e){var t=e.target;if(t&&(_e.closest(t,"."+Y)||t.classList.contains("e-group-row"))){if(this.parent.grid){var i=this.parent.grid.serviceLocator.getService("focus");if(t.classList.contains("e-group-row")&&t.querySelector(".e-btn-focused"))t=t.querySelector(".e-btn-focused");else if(t.classList.contains("e-group-row"))return i.focus(),a=i.getFocusedElement(),_e.addClass([a],["e-focused","e-focus"]),a.setAttribute("tabindex","0"),void e.preventDefault();var a,r=this.getNextButton(t);r.getAttribute("data-uid")!==t.getAttribute("data-uid")?(this.parent.element.querySelector(".e-focused")?(this.parent.element.querySelector(".e-focused").setAttribute("tabindex","-1"),_e.removeClass(this.parent.element.querySelectorAll(".e-focus"),"e-focus"),_e.removeClass(this.parent.element.querySelectorAll(".e-focused"),"e-focused"),i.setFocusedElement(this.parent.element.querySelector(".e-headercell")),this.parent.element.querySelector(".e-headercell").setAttribute("tabindex","0")):i.currentInfo.skipAction=!0,_e.addClass([r],"e-btn-focused"),r.focus()):(i.focus(),a=i.getFocusedElement(),_e.addClass([a],["e-focused","e-focus"]),a.setAttribute("tabindex","0")),e.preventDefault()}}else!this.parent.showGroupingBar&&this.parent.showFieldList&&t&&_e.closest(t,"."+X)?this.parent.grid&&((i=this.parent.grid.serviceLocator.getService("focus")).focus(),a=i.getFocusedElement(),_e.addClass([a],["e-focused","e-focus"]),a.setAttribute("tabindex","0"),e.preventDefault()):this.parent.showGroupingBar||this.parent.showFieldList||!t||!_e.closest(t,"."+Qt)||_e.closest(t,".e-popup.e-popup-open")?t&&_e.closest(t,"."+Di)&&this.parent.toolbar&&this.parent.toolbarModule?(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){_e.removeClass(_e.closest(t,"."+Di).querySelectorAll(".e-menu-item.e-focused"),"e-focused"),document.activeElement&&document.activeElement.classList.contains("e-menu-item")&&_e.addClass([document.activeElement],"e-focused")})):t.classList.contains("e-numerictextbox")&&((i=this.parent.grid.serviceLocator.getService("focus")).focus(),a=i.getFocusedElement(),_e.removeClass([a],["e-focused","e-focus"]),a.setAttribute("tabindex","0"),e.preventDefault()):this.parent.grid&&(r=_e.closest(t,"."+Qt),i=this.parent.grid.serviceLocator.getService("focus"),r=[].slice.call(r.getElementsByTagName("tr")),t.innerHTML===r[r.length-1].lastChild.innerHTML?i.currentInfo.skipAction=!0:(i.focus(),a=i.getFocusedElement(),_e.addClass([a],["e-focused","e-focus"]),a.setAttribute("tabindex","0"),e.preventDefault()))},Yo.prototype.processShiftTab=function(e){var t,i,a=e.target;if(a&&(_e.closest(a,"."+Y)||a.classList.contains("e-group-row"))){if(this.parent.grid){var r=this.parent.grid.serviceLocator.getService("focus");if(a.classList.contains("e-group-row")&&a.querySelector(".e-btn-focused"))a=a.querySelector(".e-btn-focused");else if(a.classList.contains("e-group-row")){var a=this.parent.element.querySelector(".e-btn-focused")?this.parent.element.querySelector(".e-btn-focused"):this.parent.element.querySelector("."+qi),n=this.allpivotButtons(a);if(0<n.length&&n[n.length-1])return r.currentInfo.skipAction=!0,n[n.length-1].focus(),_e.removeClass(n,"e-btn-focused"),_e.addClass([n[n.length-1]],"e-btn-focused"),void e.preventDefault()}n=this.getPrevButton(a);n.getAttribute("data-uid")!==a.getAttribute("data-uid")&&(r.currentInfo.skipAction=!0,n.focus(),e.preventDefault())}}else a&&this.parent.grid&&(a.classList.contains("e-movablefirst")||a.classList.contains("e-rowsheader")&&_e.closest(a,"tr").getAttribute("data-uid")===this.parent.grid.element.querySelector(".e-frozencontent tr").getAttribute("data-uid"))?(r=this.parent.grid.serviceLocator.getService("focus"),a.classList.contains("e-movablefirst")&&(a=this.parent.element.querySelector("."+We+" .e-btn-focused")?this.parent.element.querySelector("."+We+" .e-btn-focused"):this.parent.element.querySelector("."+We),i=r.getFocusedElement(),_e.removeClass([i],["e-focused","e-focus"])),0<(t=this.allpivotButtons(a)).length&&(r.currentInfo.skipAction=!0,setTimeout(function(){t[t.length-1].focus()}),_e.removeClass(t,"e-btn-focused"),_e.addClass([t[t.length-1]],"e-btn-focused"),e.preventDefault())):a&&_e.closest(a,"."+Di)&&this.parent.toolbar&&this.parent.toolbarModule?(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){_e.removeClass(_e.closest(a,"."+Di).querySelectorAll(".e-menu-item.e-focused"),"e-focused"),document.activeElement&&document.activeElement.classList.contains("e-menu-item")&&_e.addClass([document.activeElement],"e-focused")})):a.classList.contains("e-numerictextbox")&&((r=this.parent.grid.serviceLocator.getService("focus")).focus(),i=r.getFocusedElement(),_e.removeClass([i],["e-focused","e-focus"]),i.setAttribute("tabindex","0"),e.preventDefault())},Yo.prototype.processEnter=function(e){var t,i,a=e.target;a&&_e.closest(a,"."+Wt)&&(t=this.parent.grid.serviceLocator.getService("focus"),13!==e.keyCode||e.shiftKey||e.ctrlKey?13===e.keyCode&&e.shiftKey&&!e.ctrlKey?this.parent.enableValueSorting&&(this.event=e,a.click(),t.focus(),i=t.getFocusedElement(),_e.addClass([i],["e-focused","e-focus"]),i.setAttribute("tabindex","0")):13===e.keyCode&&!e.shiftKey&&e.ctrlKey&&this.parent.hyperlinkSettings&&a.querySelector("a")&&a.querySelector("a").click():a.querySelector("."+W)?(this.event=e,a.querySelector("."+W).click(),t.focus(),i=t.getFocusedElement(),_e.addClass([i],["e-focused","e-focus"]),i.setAttribute("tabindex","0")):a.classList.contains("e-valuescontent")?(a.dispatchEvent(new MouseEvent("dblclick",{view:window,bubbles:!0,cancelable:!0})),a.querySelector(".e-numerictextbox")&&a.click()):a.classList.contains("e-numerictextbox")&&(t.focus(),i=t.getFocusedElement(),_e.removeClass([i],["e-focused","e-focus"])),e.preventDefault())},Yo.prototype.clearSelection=function(){var e=this.parent;_e.removeClass(e.element.querySelectorAll("."+pi+",."+ui),[ui,pi,fi]),this.parent.renderModule.selected()},Yo.prototype.processSelection=function(t){var i,a,r,n,s,e,o=t.target;this.parent.grid&&this.parent.gridSettings.allowSelection&&"Row"!==this.parent.gridSettings.selectionSettings.mode&&!o.classList.contains("e-numerictextbox")?(i=this.parent,r=parseInt(t.target.getAttribute("aria-colindex"),10)-1,n=Number(t.target.getAttribute("index")),"TH"!==o.nodeName&&"TD"!==o.nodeName||(a="shiftUp"===t.action||"upArrow"===t.action?0===n||0===r||"TH"!==o.nodeName&&i.renderModule.rowStartPos!==n?null:this.getParentElement(i,a,r,n-1):"shiftDown"===t.action||"downArrow"===t.action?i.element.querySelector('th[aria-colindex="'+(r+1)+'"][index="'+(n+1)+'"]'):"shiftLeft"===t.action||"leftArrow"===t.action?t.target.previousSibling:t.target.nextSibling),_e.isNullOrUndefined(a)?("upArrow"===t.action?(a=i.element.querySelector('[aria-colindex="'+(r+1)+'"][index="'+(n-1)+'"]'),n--):"downArrow"===t.action&&(a=i.element.querySelector('[aria-colindex="'+(r+1)+'"][index="'+(n+1)+'"]'),n++),_e.isNullOrUndefined(a)||i.clearSelection(a,t)):"Both"===i.gridSettings.selectionSettings.mode&&a.classList.contains(Si)?i.clearSelection(a,t):(r=parseInt(a.getAttribute("aria-colindex"),10)-1,n=Number(a.getAttribute("index")),s=Number(a.getAttribute("aria-colspan")),i.clearSelection(a,t),e={cancel:!1,isCellClick:!0,currentCell:a,data:i.pivotValues[n][r]},i.trigger(Da,e,function(e){e.cancel||i.applyColumnSelection(t,a,r,r+(0<s?s-1:0),n)}))):o&&(37===t.keyCode||38===t.keyCode)&&this.parent&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&!o.classList.contains("e-numerictextbox")?this.parent.grid&&this.parent.element.querySelector(".e-frozenheader")&&0<this.parent.element.querySelector(".e-frozenheader").querySelectorAll(".e-focus").length&&(_e.removeClass(this.parent.element.querySelector(".e-frozenheader").querySelectorAll(".e-focus"),"e-focus"),_e.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(o),_e.addClass([o],["e-focused","e-focus"]),o.setAttribute("tabindex","0"),o.focus(),t.preventDefault()):!o.classList.contains("e-numerictextbox")||"rightArrow"!==t.action&&"leftArrow"!==t.action||o.click()},Yo.prototype.getParentElement=function(e,t,i,a){for(;!t;)t=e.element.querySelector('[aria-colindex="'+(i+1)+'"][index="'+a+'"]'),i--;return t},Yo.prototype.toggleFieldList=function(e){this.parent&&!this.parent.isDestroyed&&this.parent.showFieldList&&this.parent.pivotFieldListModule&&!this.parent.pivotFieldListModule.isDestroyed&&this.parent.element.querySelector("."+X)&&(this.parent.element.querySelector("."+X).classList.contains(k)?this.parent.element.querySelector("."+X).classList.contains(k)&&this.parent.pivotFieldListModule.dialogRenderer&&this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog&&!this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog.isDestroyed&&this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog.hide():(this.parent.element.querySelector("."+X).click(),e.preventDefault()))},Yo.prototype.destroy=function(){this.timeOutObj&&(clearTimeout(this.timeOutObj),this.timeOutObj=null),this.event=null,this.pivotViewKeyboardModule&&(this.pivotViewKeyboardModule.destroy(),this.pivotViewKeyboardModule=null)};var Qo=Yo;function Yo(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 _e.KeyboardEvents(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})}Xo.prototype.render=function(){this.renderContextMenu()},Xo.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"}],e={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)},t=_e.createElement("ul",{id:this.parent.element.id+"_PivotContextMenu"});this.parent.element.appendChild(t),this.menuObj=new D.ContextMenu(e),this.menuObj.isStringTemplate=!0,this.menuObj.appendTo(t)},Xo.prototype.onBeforeMenuOpen=function(e){var e=[].slice.call(e.element.querySelectorAll("li")),t=("olap"===this.parent.dataType?this.fieldElement:this.fieldElement.querySelector("."+ge)).getAttribute("data-type");if(_e.removeClass(e,b),"CalculatedField"===t||"isMeasureFieldsAvail"===t)for(var i=0,a=e;i<a.length;i++)(l=a[i]).textContent!==this.parent.localeObj.getConstant("addToValue")&&_e.addClass([l],b);else if("isMeasureAvail"===t)for(var r=0,n=e;r<n.length;r++)(l=n[r]).textContent!==this.parent.localeObj.getConstant("addToRow")&&l.textContent!==this.parent.localeObj.getConstant("addToColumn")&&_e.addClass([l],b);else if("olap"===this.parent.dataType){for(var s=0,o=e;s<o.length;s++)if((l=o[s]).textContent===this.parent.localeObj.getConstant("addToValue")){_e.addClass([l],b);break}}else if("true"===this.fieldElement.getAttribute("isvalue"))for(var l,d=0,h=e;d<h.length;d++)(l=h[d]).textContent!==this.parent.localeObj.getConstant("addToValue")&&l.textContent!==this.parent.localeObj.getConstant("addToFilter")||_e.addClass([l],b)},Xo.prototype.onSelectContextMenu=function(e){var t;null!==e.element.textContent&&(t=this.fieldElement.getAttribute("data-uid"),e=e.item.id.replace(this.parent.element.id+"_","").toLowerCase(),this.parent.pivotCommon.dataSourceUpdate.control="pivotview"!==this.parent.getModuleName()&&this.parent.pivotGridModule||this.parent,this.parent.pivotCommon.dataSourceUpdate.btnElement=this.fieldElement,this.parent.pivotCommon.dataSourceUpdate.updateDataSource(t,e,-1),this.parent.updateDataSource(!0),this.fieldElement=void 0)},Xo.prototype.destroy=function(){this.parent.isDestroyed&&this.menuObj&&!this.menuObj.isDestroyed&&(this.menuObj.destroy(),_e.select("#"+this.parent.element.id+"_PivotContextMenu",document))&&_e.remove(_e.select("#"+this.parent.element.id+"_PivotContextMenu",document))};var Ko=Xo;function Xo(e){this.parent=e,this.parent.contextMenuModule=this}Zo.prototype.getModuleName=function(){return"virtualscroll"},Zo.prototype.addInternalEvents=function(){this.parent.isDestroyed||this.parent.on(qr,this.wireEvents,this)},Zo.prototype.wireEvents=function(){var e,t,i,a;this.engineModule="pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule,"Chart"!==this.parent.displayOption.view&&(this.clearAllEventHandlers(),e=this.parent.element.querySelector("."+li),a=this.parent.element.querySelector("."+Ci),t=this.parent.element.querySelector("."+hi),i=a.querySelector("."+oi),this.boundElements=[e,a,t,i],this.engineModule&&(a=this.parent.isAdaptive?e:a.querySelector("."+oi),_e.EventHandler.add(a,"scroll touchmove pointermove",this.onHorizondalScroll(t,e),this),_e.EventHandler.add(e.parentElement,"scroll wheel touchmove pointermove",this.onHorizondalScroll(t,e),this),_e.EventHandler.add(e.parentElement,"scroll wheel touchmove pointermove keyup keydown",this.onVerticalScroll(e.parentElement,e),this),this.isFireFox?(_e.EventHandler.add(a,"mouseup touchend scroll",this.common(t,e,e),this),this.parent.isAdaptive||_e.EventHandler.add(e.parentElement,"mouseup touchend scroll",this.common(t,e.parentElement,e),this)):(_e.EventHandler.add(a,"mouseup touchend",this.common(t,e,e),this),this.parent.isAdaptive||_e.EventHandler.add(e.parentElement,"mouseup touchend",this.common(t,e.parentElement,e),this)),_e.EventHandler.add(i,"scroll",this.onCustomScrollbarScroll(e,t),this),_e.EventHandler.add(e,"scroll",this.onCustomScrollbarScroll(i,t),this),_e.EventHandler.add(t,"scroll",this.onCustomScrollbarScroll(i,e),this),_e.EventHandler.add(t,"touchstart pointerdown",this.setPageXY(),this),_e.EventHandler.add(t,"touchmove pointermove",this.onTouchScroll(t,e),this),_e.EventHandler.add(e,"touchstart pointerdown",this.setPageXY(),this),_e.EventHandler.add(e,"touchmove pointermove",this.onTouchScroll(t,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)},Zo.prototype.clearAllEventHandlers=function(){this.verticalScrollTimeoutObj&&(clearTimeout(this.verticalScrollTimeoutObj),this.verticalScrollTimeoutObj=null),this.horizontalScrollTimeoutObj&&(clearTimeout(this.horizontalScrollTimeoutObj),this.horizontalScrollTimeoutObj=null),this.boundElements.forEach(function(e){e&&_e.EventHandler.clearEvents(e)}),this.boundElements=[],this.parent&&this.parent.grid&&(this.parent.grid.off("check-scroll-reset"),this.parent.grid.off("prevent-frozen-scroll-refresh"))},Zo.prototype.onWheelScroll=function(e){var i=this,a=e;return function(e){var t=a.scrollTop+(1===e.deltaMode?30*e.deltaY:e.deltaY);i.frozenPreviousValues.top!==t&&(e.preventDefault(),i.frozenPreviousValues.top=t,i.eventType=e.type)}},Zo.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},Zo.prototype.onCustomScrollbarScroll=function(e,t){var i=this,a=e,r=t;return function(e){var t;null===i.parent.element.querySelector("."+ue).querySelector("tbody")||(t=(e=e.target).scrollLeft,i.previousValues.left===t)||i.isFireFox&&e.classList.contains(hi)||(a.scrollLeft=t,r.scrollLeft=t,i.parent.isDestroyed)}},Zo.prototype.onTouchScroll=function(n,s){var o=this,l=s;return function(e){var t,i,a,r;"mouse"===e.pointerType||(t=o.getPointXY(e),i=o.parent.element.querySelector(".e-grid ."+ue).scrollTop+(o.pageXY.y-t.y),r=(a=o.parent.isAdaptive?s:l.parentElement.parentElement.querySelector("."+oi)).scrollLeft+(o.pageXY.x-t.x),o.frozenPreviousValues.left===r)||r<0||(n.scrollLeft=r,a.scrollLeft=r,o.pageXY.x=t.x,o.frozenPreviousValues.left=r,o.frozenPreviousValues.top===i)||i<0||(o.pageXY.y=t.y,o.frozenPreviousValues.top=i,o.eventType=e.type)}},Zo.prototype.update=function(e,t,i,a,r,n){var s=this,o=this.parent.element.querySelector("."+li),l=(this.parent.isScrolling=!0,"pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule),d={dataSourceSettings:Ie.getClonedDataSourceSettings(this.parent.dataSourceSettings)},h=this.parent.virtualScrollSettings&&this.parent.virtualScrollSettings.allowSinglePage&&"pivot"===this.parent.dataType,p=this.parent.engineModule?this.parent.engineModule.viewportPageCount:3;if(this.parent.pageSettings&&l.pageSettings){if("vertical"===this.direction){var u=n.parentElement.scrollHeight-(e+n.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="Up"===this.scrollingDirection?Math.ceil(e/g):Math.ceil(e/g)-1;if((this.parent.scrollPosObject.vertical===(m+=h&&u<=0?1:0)||l.pageSettings.rowPageSize>=l.rowCount||o&&o.scrollHeight<o.parentElement.clientHeight*p)&&!h)return;this.parent.actionObj.actionName=kr,h&&this.parent.grid&&this.parent.grid.element.querySelector(".e-spinner-inner")&&_e.addClass([this.parent.grid.element.querySelector(".e-spinner-inner")],[Ki]),this.parent.actionBeginMethod(),h||this.parent.showWaitingPopup(),this.parent.scrollPosObject.vertical=m,this.parent.pageSettings.currentRowPage=l.pageSettings.currentRowPage=1<m?m:1;var S=0;this.parent.trigger(ra,d,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,!0),S=s.parent.engineModule.rowStartPos):(s.parent.olapEngineModule.scrollPage(),S=s.parent.olapEngineModule.pageRowStartPos),s.enginePopulatedEventMethod(l)});u=g*Math.ceil(S/(this.parent.pageSettings.rowPageSize*c))-l.rowFirstLvl*c*this.parent.gridSettings.rowHeight;this.parent.scrollPosObject.verticalSection=u}else{e=a.scrollWidth-(a.scrollLeft+a.offsetWidth),h="pivot"===this.parent.dataType&&"column"===this.parent.dataSourceSettings.valueAxis?this.parent.dataSourceSettings.values.length:1,g=this.parent.pageSettings.columnPageSize*h*this.parent.gridSettings.columnWidth,m=Math.ceil(Math.abs(t)/g),c=this.parent.virtualScrollSettings&&this.parent.virtualScrollSettings.allowSinglePage&&"pivot"===this.parent.dataType;if((this.parent.scrollPosObject.horizontal===(m+=c&&e<=0?1:0)||o&&o.scrollWidth<o.parentElement.clientWidth*p)&&!c)return;this.parent.actionObj.actionName=jr,c&&this.parent.grid&&this.parent.grid.element.querySelector(".e-spinner-inner")&&(_e.addClass([this.parent.grid.element.querySelector(".e-spinner-inner")],[Ki]),r)&&_e.removeClass([r,n],["e-virtual-pivot-content"]),this.parent.actionBeginMethod(),c||this.parent.showWaitingPopup();var f=this.parent,v=(f.scrollPosObject.horizontal=m,this.parent.pageSettings.currentColumnPage=l.pageSettings.currentColumnPage=1<m?m:1,0);this.parent.trigger(ra,d,function(){"pivot"===f.dataType?"Server"===s.parent.dataSourceSettings.mode?s.parent.getEngine("onScroll",null,null,null,null,null,null):(f.engineModule.generateGridData(f.dataSourceSettings,!0,!1,f.engineModule.headerCollection),v=f.engineModule.colStartPos):(f.olapEngineModule.scrollPage(),v=f.olapEngineModule.pageColStartPos),s.enginePopulatedEventMethod(l)});u=g*Math.ceil(v/(f.pageSettings.columnPageSize*h))-l.colFirstLvl*h*f.gridSettings.columnWidth;f.scrollPosObject.horizontalSection=u}this.parent.actionObj.actionName=this.parent.getActionCompleteName(),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()}},Zo.prototype.enginePopulatedEventMethod=function(e,t){var i=this,t=t||this.parent,e={dataSourceSettings:t.dataSourceSettings,pivotValues:e.pivotValues};t.trigger(na,e,function(e){i.parent.pivotValues=e.pivotValues})},Zo.prototype.setPageXY=function(){var t=this;return function(e){"mouse"!==e.pointerType&&(t.pageXY=t.getPointXY(e))}},Zo.prototype.common=function(a,r,n){var s=this;return function(e){var t,i=s.parent.virtualScrollSettings&&s.parent.virtualScrollSettings.allowSinglePage&&"pivot"===s.parent.dataType;!s.isScrolling&&i||(s.isScrolling=!1,t=s.parent.isAdaptive?r:_e.closest(r,"."+Ci).querySelector("."+oi),i&&("vertical"===s.direction?s.parent.element.querySelector("."+Yi)&&(_e.addClass([n],["e-virtual-pivot-content"]),_e.removeClass([s.parent.element.querySelector("."+Yi)],[Ki])):s.parent.element.querySelector("."+Yi)&&(_e.addClass([a,r],["e-virtual-pivot-content"]),_e.removeClass([s.parent.element.querySelector("."+Yi)],[Ki]))),s.update(s.parent.element.querySelector(".e-grid ."+ue).scrollTop*s.parent.verticalScrollScale,t.scrollLeft*s.parent.horizontalScrollScale,e,t,a,r))}},Zo.prototype.onHorizondalScroll=function(n,s){var o=this,l=this.parent.isAdaptive?s:_e.closest(s,"."+Ci).querySelector("."+oi),d=Math.abs(l.scrollLeft),h=d*this.parent.horizontalScrollScale,p=h-this.parent.scrollPosObject.horizontalSection-d,p=this.parent.enableRtl?p:-p;return"none"!==l.style.display&&this.alignFreezedCells(p,!1),function(e){var t,i,a,r;d=Math.abs(l.scrollLeft),h=d*o.parent.horizontalScrollScale,"wheel"!==e.type&&"touchmove"!==e.type&&"wheel"!==o.eventType&&"touchmove"!==o.eventType||(o.horizontalScrollTimeoutObj&&clearTimeout(o.horizontalScrollTimeoutObj),o.horizontalScrollTimeoutObj=setTimeout(function(){h="touchmove"===e.type?d:h,o.update(s.parentElement.scrollTop*o.parent.verticalScrollScale,h,e,l,n,s)},300)),o.previousValues.left!==h&&(o.parent.scrollDirection=o.direction="horizondal",o.isScrolling=!0,p=h-o.parent.scrollPosObject.horizontalSection-d,p=o.parent.enableRtl?p:-p,t=1<s.querySelector("."+u).style.transform.split(",").length?s.querySelector("."+u).style.transform.split(",")[1].trim():"0px)",d<o.parent.scrollerBrowserLimit&&(_e.setStyleAttribute(s.querySelector("."+u),{transform:"translate("+p+"px,"+t}),_e.setStyleAttribute(n.querySelector("."+u),{transform:"translate("+p+"px,0px)"}),o.alignFreezedCells(p,!1)),r=o.parent.scrollPosObject.horizontalSection>h?-(o.parent.scrollPosObject.horizontalSection-h):h+(n.offsetWidth-n.querySelector(".e-headercell.e-leftfreeze").offsetWidth)-(o.parent.scrollPosObject.horizontalSection+(s.querySelector("."+u).offsetWidth-s.querySelector("."+u).querySelector(".e-leftfreeze.e-rowsheader").offsetWidth)),i=Math.ceil(o.parent.scrollPosObject.horizontalSection/o.parent.horizontalScrollScale)<o.parent.scrollerBrowserLimit,(o.parent.scrollPosObject.horizontalSection>h||1<r&&i)&&(o.parent.virtualScrollSettings&&o.parent.virtualScrollSettings.allowSinglePage&&"pivot"===o.parent.dataType&&o.parent.element.querySelector("."+Yi)&&(_e.addClass([n,s],["e-virtual-pivot-content"]),_e.removeClass([o.parent.element.querySelector("."+Yi)],[Ki])),r=h>n.clientWidth?(o.parent.scrollPosObject.left<1&&(o.parent.scrollPosObject.left=n.clientWidth),o.parent.scrollPosObject.left=o.parent.scrollPosObject.left-50,o.parent.scrollPosObject.horizontalSection>h?r-o.parent.scrollPosObject.left:r+o.parent.scrollPosObject.left):-o.parent.scrollPosObject.horizontalSection,p=-(h-(o.parent.scrollPosObject.horizontalSection+r)-_e.closest(s,"."+Ci).querySelector("."+oi).scrollLeft),(i=o.parent.gridSettings.columnWidth*o.engineModule.columnCount)>o.parent.scrollerBrowserLimit&&(o.parent.horizontalScrollScale=i/o.parent.scrollerBrowserLimit,i=o.parent.scrollerBrowserLimit),i<p&&h<p&&(p=h,r=0),_e.setStyleAttribute(s.querySelector("."+u),{transform:"translate("+p+"px,"+t}),_e.setStyleAttribute(n.querySelector("."+u),{transform:"translate("+p+"px,0px)"}),o.alignFreezedCells(p,!1),o.parent.scrollPosObject.horizontalSection=o.parent.scrollPosObject.horizontalSection+r),(i=l.scrollWidth-(d+(l.offsetWidth-o.parent.element.querySelector("."+Wt).querySelector("."+Ct+"."+Qi).offsetWidth)))<=0&&((r=s.querySelector("."+si)).style.display="none",a=s.scrollWidth-(s.scrollLeft+s.offsetWidth),r.style.display="",r=s.scrollWidth-(s.scrollLeft+s.offsetWidth),o.parent.scrollPosObject.horizontalSection-=i<a?a:-r,p=d>o.parent.scrollerBrowserLimit?Number(s.querySelector("."+u).style.transform.split(",")[0].split("px")[0].trim()):-(d*o.parent.horizontalScrollScale-o.parent.scrollPosObject.horizontalSection-d),_e.setStyleAttribute(s.querySelector("."+u),{transform:"translate("+p+"px,"+t}),_e.setStyleAttribute(n.querySelector("."+u),{transform:"translate("+p+"px,0px)"}),o.alignFreezedCells(p,!1)),o.previousValues.left=h,o.frozenPreviousValues.left=h,o.eventType="",n.scrollLeft=l.scrollLeft,s.scrollLeft=l.scrollLeft)}},Zo.prototype.alignFreezedCells=function(e,t){for(var i,a=0,r=this.parent.element.querySelectorAll("."+Qi);a<r.length;a++)this.parent.isTabular&&1<this.parent.dataSourceSettings.rows.length?(i=r[a],this.setFrozenColumnPosition(e,i,a,r,t)):t?this.parent.enableRtl?r[a].style.right=-e+"px":r[a].style.left=e+"px":this.parent.enableRtl?r[a].style.right=Number(e)+"px":r[a].style.left=Number(-e)+"px"},Zo.prototype.onVerticalScroll=function(o,l){var d=this,h=o.querySelector("."+li)?o.querySelector("."+li):o;return function(i){var a,e,t,r,n,s=d.parent.engineModule?d.parent.engineModule.viewportPageCount:3;(d.parent.isAdaptive||h.scrollHeight>h.parentElement.clientHeight*s)&&(s=o.scrollTop*d.parent.verticalScrollScale,"wheel"!==i.type&&"touchmove"!==i.type&&"scroll"!==i.type&&"wheel"!==d.eventType&&"touchmove"!==d.eventType&&"keyup"!==i.type&&"keydown"!==i.type||(a=d.parent.isAdaptive?o:_e.closest(o,"."+Ci).querySelector("."+oi),d.verticalScrollTimeoutObj&&clearTimeout(d.verticalScrollTimeoutObj),d.verticalScrollTimeoutObj=setTimeout(function(){var e,t=0;t=(!d.parent.isAdaptive||(e=a.querySelector("."+li),a.scrollLeft===e.scrollLeft)?a:e).scrollLeft,d.update(o.scrollTop*d.parent.verticalScrollScale,t*d.parent.horizontalScrollScale,i,a,null,o)},300)),d.previousValues.top!==s)&&(d.parent.scrollPosObject.horizontalSection<0&&(d.parent.scrollPosObject.horizontalSection=0),d.parent.scrollDirection=d.direction="vertical",d.isScrolling=!0,r=-(s-d.parent.scrollPosObject.verticalSection-o.scrollTop),e=o.querySelector("."+u).style.transform.split(",")[0].trim(),r>d.parent.virtualDiv.clientHeight&&(r=d.parent.virtualDiv.clientHeight),o.scrollTop<d.parent.scrollerBrowserLimit&&(_e.setStyleAttribute(o.querySelector("."+u),{transform:"translate(0px,"+r+"px)"}),_e.setStyleAttribute(o.querySelector("."+u),{transform:e+","+r+"px)"})),t=d.parent.scrollPosObject.verticalSection>s?-(d.parent.scrollPosObject.verticalSection-s):s+o.clientHeight-(d.parent.scrollPosObject.verticalSection+o.querySelector("."+u).offsetHeight),n=Math.ceil(d.parent.scrollPosObject.verticalSection/d.parent.verticalScrollScale)<d.parent.scrollerBrowserLimit,(d.parent.scrollPosObject.verticalSection>s||1<t&&n)&&(d.parent.virtualScrollSettings&&d.parent.virtualScrollSettings.allowSinglePage&&"pivot"===d.parent.dataType&&d.parent.element.querySelector("."+Yi)&&(_e.addClass([l],["e-virtual-pivot-content"]),_e.removeClass([d.parent.element.querySelector("."+Yi)],[Ki])),t=s>o.clientHeight?(d.parent.scrollPosObject.top<1&&(d.parent.scrollPosObject.top=o.clientHeight),d.parent.scrollPosObject.top=d.parent.scrollPosObject.top-50,d.parent.scrollPosObject.verticalSection>s?t-d.parent.scrollPosObject.top:t+d.parent.scrollPosObject.top):-d.parent.scrollPosObject.verticalSection,n=d.parent.element.querySelector("."+ue).querySelector("."+u),r=-(s-(d.parent.scrollPosObject.verticalSection+t)-o.scrollTop),(n=d.parent.gridSettings.rowHeight*d.engineModule.rowCount+.1-n.clientHeight)>d.parent.scrollerBrowserLimit&&(d.parent.verticalScrollScale=n/d.parent.scrollerBrowserLimit,n=d.parent.scrollerBrowserLimit),n<r&&s<r&&(r=s,t=0),r>d.parent.virtualDiv.clientHeight&&(r=d.parent.virtualDiv.clientHeight),_e.setStyleAttribute(o.querySelector("."+u),{transform:"translate(0px,"+r+"px)"}),_e.setStyleAttribute(o.querySelector("."+u),{transform:e+","+r+"px)"}),d.parent.scrollPosObject.verticalSection=d.parent.scrollPosObject.verticalSection+t),d.scrollingDirection=d.previousValues.top<o.scrollTop?"Up":"Down",d.previousValues.top=s,d.frozenPreviousValues.top=s,d.eventType="")}},Zo.prototype.removeInternalEvents=function(){this.parent.isDestroyed||(this.parent.off(qr,this.wireEvents),this.clearAllEventHandlers())},Zo.prototype.destroy=function(){this.removeInternalEvents(),this.engineModule=null,this.keyboardEvents=null},Zo.prototype.setFrozenColumnPosition=function(e,t,i,a,r){if(t&&t instanceof HTMLTableCellElement){var n=0,s=t.cellIndex+1;if(1<s)for(var o=0;o<s-1;o++)n+=this.parent.pivotColumns[o].width;r?this.parent.enableRtl?a[i].style.right=-(e-n)+"px":a[i].style.left=e+n+"px":this.parent.enableRtl?a[i].style.right=Number(e+n)+"px":a[i].style.left=Number(-(e-n))+"px"}};var Jo=Zo;function Zo(e){this.previousValues={top:0,left:0},this.frozenPreviousValues={top:0,left:0},this.eventType="",this.isFireFox=-1<_e.Browser.userAgent.toLowerCase().indexOf("firefox"),this.isScrolling=!1,this.boundElements=[],this.scrollingDirection="Up",this.parent=e,this.addInternalEvents()}el.prototype.showDrillThroughDialog=function(e,t){for(var i,C=this,x=e.rawData,w=[],T={},a=0;a<e.rawData.length;a++)w.push(Ie.frameHeaderWithKeys(e.rawData[a]));try{"Table"===this.parent.currentView&&this.parent.editSettings.allowInlineEditing&&this.parent.editSettings.allowEditing&&1===e.rawData.length?(this.parent.actionObj.actionName=Rn,this.parent.actionBeginMethod()||this.editCell(e,x)):(this.removeDrillThroughDialog(),i=_e.createElement("div",{id:this.parent.element.id+"_drillthrough",className:"e-drillthrough-dialog"}),this.parent.element.appendChild(i),this.dialogPopUp=new P.Dialog({animationSettings:{effect:"Fade"},allowDragging:!1,header:this.parent.localeObj.getConstant("details"),content:this.createDrillThroughGrid(e,x,t),cssClass:this.parent.cssClass,beforeOpen:function(){C.drillThroughGrid.setProperties({dataSource:C.parent.editSettings.allowEditing?C.dataWithPrimarykey(e,x,T):x,height:C.parent.editSettings.allowEditing?220:300},!1)},beforeClose:function(){if(C.parent.editSettings.allowEditing&&C.isUpdated){"CSV"===C.parent.dataSourceSettings.type&&C.updateData(C.drillThroughGrid.dataSource);for(var e=[],t=0,i=Object.keys(T);t<i.length;t++){var a=i[t];e.push(T[a])}for(var r=Object.keys(T).length,n=[],s=[],o=0,l=0,d=C.drillThroughGrid.dataSource;l<d.length;l++){var h=d[l];if(C.isEdited||"0"!==h.__index&&""!==h.__index)0<r&&(delete T[h.__index.toString()],s.push(h),r--);else{for(var p=0,u=C.engine.fields;p<u.length;p++){var c=u[p];_e.isNullOrUndefined(h[c])&&delete h[c]}delete h.__index,n.push(h)}"Server"===C.parent.dataSourceSettings.mode&&(h.__index&&delete h.__index,x[o].__index)&&delete x[o].__index,o++}if(r=0,"Server"===C.parent.dataSourceSettings.mode){for(var g=[],m=Object.keys(T),S=0;S<m.length;S++)delete C.parent.drillThroughValue.indexObject[T[m[S]]],g.push({Key:m[S],Value:T[m[S]]});C.parent.getEngine("updateRawData",null,null,null,null,null,null,null,{addedData:n,removedData:g,updatedData:s,indexObject:C.parent.drillThroughValue.indexObject})}else{for(var f=[],v=0,y=C.parent.allowDataCompression?C.parent.engineModule.actualData:C.parent.engineModule.data;v<y.length;v++)delete(h=y[v]).__index,void 0===T[r.toString()]&&f.push(h),r++;var f=f.concat(n),b={currentData:C.drillThroughGrid.dataSource,previousData:w,previousPosition:e,cancel:!1};C.parent.trigger(La,b),b.cancel||(C.parent.setProperties({dataSourceSettings:{dataSource:f}},!0),C.engine.updateGridData(C.parent.dataSourceSettings),C.parent.pivotValues=C.engine.pivotValues)}C.parent.actionObj.actionName=Os;b={editInfo:{type:C.drillThroughGrid.editSettings.mode,action:"Update",currentData:C.drillThroughGrid.dataSource,previousData:w,previousPosition:e}};C.parent.actionObj.actionInfo=b}C.isUpdated=!1,C.isEdited=!1,T={}},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(i),_e.setStyleAttribute(this.dialogPopUp.element,{visibility:"visible"}),this.parent.editSettings.allowEditing&&(this.drillthroughKeyboardModule=new _e.KeyboardEvents(this.dialogPopUp.element,{keyAction:this.drillthroughKeyActionHandler.bind(this),keyConfigs:{escape:"escape"},eventName:"keydown"})))}catch(e){this.parent.actionFailureMethod(e)}},el.prototype.editCell=function(i,e){var a=this,t=this.parent.gridSettings.allowResizing,r=i.currentCell.actualText.toString(),n=Number(Object.keys(i.currentCell.indexObject)),s=(i.currentTarget.firstElementChild.style.display="none",Number(i.rawData[0][r])),o=Ie.frameHeaderWithKeys(i.rawData[i.rawData.length-1]),l=i.rawData[i.rawData.length-1],d=(this.parent.actionObj.actionInfo={editInfo:{type:"Inline editing",action:"update",data:e}},new H.NumericTextBox({value:s,enableRtl:this.parent.enableRtl,enabled:!0,format:"####.##",locale:this.parent.locale,cssClass:this.parent.cssClass,change:function(){var e=_e.isNullOrUndefined(d.value)?0:d.value,t=i.currentCell.indexObject[n];i.rawData[0][r]=e,a.parent.engineModule.data[t]=i.rawData[0]},blur:function(){var e={currentData:[l],previousData:[o],previousPosition:[l.index],cancel:!1};a.parent.trigger(La,e),e.cancel||("Server"===a.parent.dataSourceSettings.mode?((e={})[n]=n,a.parent.getEngine("updateRawData",null,null,null,null,null,null,null,{addedData:[],removedData:[],updatedData:[l],indexObject:e})):(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=t))}})),e=_e.createElement("input",{id:this.parent.element.id+"_inputbox"});i.currentTarget.appendChild(e),d.appendTo(e),i.currentCell.value=d.value,d.focusIn(),this.parent.gridSettings.allowResizing=!1},el.prototype.updateData=function(e){for(var t=0,i=this.parent.allowDataCompression?this.parent.engineModule.actualData:this.parent.engineModule.data;t<e.length;){for(var a=Object.keys(e[t]),r=0,n=[];r<a.length;)_e.isNullOrUndefined(this.parent.engineModule.fieldKeys[a[r]])||(n[this.parent.engineModule.fieldKeys[a[r]]]=e[t][a[r]]),r++;i[Number(e[t].__index)]=n,t++}this.parent.allowDataCompression?this.parent.engineModule.actualData=i:this.parent.engineModule.data=i},el.prototype.removeDrillThroughDialog=function(){this.dialogPopUp&&!this.dialogPopUp.isDestroyed&&(this.parent.actionObj.actionName=Ps,this.parent.actionObj.actionName&&this.parent.actionCompleteMethod(),this.dialogPopUp.destroy());var e=document.getElementById(this.parent.element.id+"_drillthrough");e&&_e.remove(e),document.getElementById(this.parent.element.id+"_drillthroughgrid_ccdlg")&&_e.remove(document.getElementById(this.parent.element.id+"_drillthroughgrid_ccdlg"))},el.prototype.createDrillThroughGrid=function(e,i,t){var a=this,r=_e.createElement("div",{id:this.parent.element.id+"_drillthroughbody",className:"e-drillthrough-body"}),n=_e.createElement("div",{id:this.parent.element.id+"_drillthroughbodyheader",className:"e-drillthrough-body-header-container"}),t=(""!==e.rowHeaders&&(n.innerHTML="<span class="+Ne+"><span class="+Pe+">"+this.parent.localeObj.getConstant("row")+"</span> : <span class="+Ee+">"+e.rowHeaders+"</span></span>"),""!==e.columnHeaders&&(n.innerHTML=n.innerHTML+"<span class="+Ne+"><span class="+Pe+">"+this.parent.localeObj.getConstant("column")+"</span> : <span class="+Ee+">"+e.columnHeaders+"</span></span>"),""!==e.value&&"0"!==(s=e.currentCell.formattedText)&&(n.innerHTML=n.innerHTML+"<span class="+Ne+"><span class="+Pe+">"+t+"</span> : <span class="+Ee+">"+s+"</span></span>"),["ColumnChooser"]),s=(this.parent.editSettings.allowEditing&&(t=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"]),_e.createElement("div",{id:this.parent.element.id+"_drillthroughgrid",className:"e-drillthrough-grid"})),o=(w.Grid.Inject(w.Selection,w.Reorder,w.Resize,w.Toolbar,w.ColumnChooser),this.drillThroughGrid=new w.Grid({cssClass:this.parent.cssClass,gridLines:"Default",allowResizing:!0,allowReordering:!0,showColumnChooser:!0,enableHover:!1,toolbar:t,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),this);if(this.parent.trigger(Fa,{cellInfo:e,gridObj:this.drillThroughGrid,type:"editing"}),this.drillThroughGrid.allowExcelExport&&w.Grid.Inject(w.ExcelExport),this.drillThroughGrid.allowPdfExport&&w.Grid.Inject(w.PdfExport),this.parent.editSettings.allowEditing){w.Grid.Inject(w.Edit,w.Page);try{this.drillThroughGrid.editSettings=this.parent.editSettings,this.drillThroughGrid.actionBegin=function(e){e="save"===e.requestType?kn:"add"===e.requestType?jn:"delete"===e.requestType?qn:"";a.parent.actionObj.actionName=e,a.parent.actionObj.actionName&&a.parent.actionBeginMethod()},this.parent.editSettings.allowCommandColumns?(this.drillThroughGrid.editSettings.mode="Normal",this.drillThroughGrid.editSettings.allowEditOnDblClick=!1,w.Grid.Inject(w.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||(o.isUpdated=!0),"batchsave"!==e.requestType&&"save"!==e.requestType||"edit"!==e.action||(o.isEdited=!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"===o.drillThroughGrid.editSettings.mode&&"save"===e.requestType&&0<o.drillThroughGrid.element.querySelectorAll(".e-tbar-btn:hover").length&&!o.parent.editSettings.allowCommandColumns||"batchsave"===e.requestType)&&o.dialogPopUp.hide()},this.drillThroughGrid.beforeBatchSave=function(){o.isUpdated=!0}}else w.Grid.Inject(w.VirtualScroll);return document.body.appendChild(s),this.drillThroughGrid.isStringTemplate=!0,this.drillThroughGrid.appendTo(s),r.appendChild(n),r.appendChild(s),r},el.prototype.frameGridColumns=function(e){this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule;var t="olap"===this.parent.dataType?e[0]?Object.keys(e[0]):[]:Object.keys(this.engine.fieldList),i=[],a={};if(0<this.parent.dataSourceSettings.formatSettings.length)for(var r=0;r<this.parent.dataSourceSettings.formatSettings.length;r++)a[this.parent.dataSourceSettings.formatSettings[r].name]=this.parent.dataSourceSettings.formatSettings[r].format;if("olap"===this.parent.dataType)for(var n=0,s=t;n<s.length;n++){var o=s[n];i.push({field:o.replace(/_x005B_|_x0020_|_x005D_|_x0024_/g,"").replace("].[","").split(".").reverse().join(""),headerText:o.replace(/_x005B_|_x005D_|_x0024_/g,"").replace(/_x0020_/g," ").replace("].[","").split(".").reverse().join("."),width:120,visible:!0,validationRules:{required:!0},format:_e.isNullOrUndefined(a[o])?null:a[o],type:_e.isNullOrUndefined(a[o])?"string":null})}else for(var l=0,d=t;l<d.length;l++){var h,p,u,o=d[l];"CalculatedField"!==this.engine.fieldList[o].aggregateType&&(h="",p=null,u=!("date"!==this.engine.fieldList[o].type&&"datetime"!==this.engine.fieldList[o].type||!(this.isDateFieldExist(o)||e[0]&&e[0][o]&&-1===e[0][o].toString().indexOf(" "))),"number"===this.engine.fieldList[o].type?(h="numericedit",p="number"):"date"===this.engine.fieldList[o].type&&u?(h="datepickeredit",p="date"):"datetime"===this.engine.fieldList[o].type&&u?(h="datetimepickeredit",p="date"):h="defaultedit",this.parent.engineModule.formatFields[o]&&(p=this.parent.engineModule.formatFields[o].type),u=this.parent.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(this.engine.fieldList[o].caption):this.engine.fieldList[o].caption,i.push({field:o,headerText:u,width:120,visible:this.engine.fieldList[o].isSelected,validationRules:{required:!0},editType:h,format:_e.isNullOrUndefined(a[o])?void 0:a[o],type:_e.isNullOrUndefined(a[o])?"string":p}))}return i},el.prototype.isDateFieldExist=function(e){for(var t=0;t<this.parent.dataSourceSettings.formatSettings.length;t++)if(this.parent.dataSourceSettings.formatSettings[t].name===e&&-1<this.parent.dataSourceSettings.formatSettings[t].type.indexOf("date"))return!0;for(t=0;t<this.parent.dataSourceSettings.fieldMapping.length;t++)if(this.parent.dataSourceSettings.fieldMapping[t].name===e&&this.parent.dataSourceSettings.fieldMapping[t].dataType&&-1<this.parent.dataSourceSettings.fieldMapping[t].dataType.indexOf("date"))return!0;return!1},el.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++}},el.prototype.dataWithPrimarykey=function(e,t,i){for(var a=0<this.indexString.length?this.indexString:Object.keys(e.currentCell.indexObject),e=t,r=0,n=0,s=e;n<s.length;n++)s[n].__index=a[r],i[a[r].toString()]=Number(a[r]),r++;return e},el.prototype.drillthroughKeyActionHandler=function(e){"escape"===e.action&&this.processClose(e)},el.prototype.processClose=function(e){var t=e.target;if(t&&_e.closest(t,".e-popup.e-popup-open")){t=_e.getInstance(_e.closest(t,".e-popup.e-popup-open"),P.Dialog);if(t&&!t.closeOnEscape){var i=t.element.getAttribute("data-fieldName");if(t.hide(),this.parent.element)for(var a=0,r=[].slice.call(this.parent.element.querySelectorAll(".e-pivot-button"));a<r.length;a++){var n=r[a];if(n.getAttribute("data-uid")===i){n.focus();break}}e.preventDefault()}}},el.prototype.destroy=function(){this.parent.isDestroyed||this.drillthroughKeyboardModule&&!this.drillthroughKeyboardModule.isDestroyed&&(this.drillthroughKeyboardModule.destroy(),this.drillthroughKeyboardModule=null)};var $o=el;function el(e){this.indexString=[],this.isUpdated=!1,this.isEdited=!1,this.parent=e,this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule}il.prototype.getModuleName=function(){return"drillThrough"},il.prototype.addInternalEvents=function(){this.parent&&this.parent.on(qr,this.wireEvents,this)},il.prototype.wireEvents=function(){this.unWireEvents(),this.parent&&this.parent.element&&_e.EventHandler.add(this.parent.element,"dblclick",this.mouseClickHandler,this)},il.prototype.unWireEvents=function(){this.parent.isDestroyed||this.parent&&this.parent.element&&!this.parent.isDestroyed&&_e.EventHandler.remove(this.parent.element,"dblclick",this.mouseClickHandler)},il.prototype.mouseClickHandler=function(e){var t,i;this.parent&&(t=null,(e=e.target).classList.contains("e-stackedheadercelldiv")||e.classList.contains("e-headercelldiv")||e.classList.contains("e-stackedheadertext")||e.classList.contains("e-headertext")?t=_e.closest(e.parentElement,"th"):e.classList.contains("e-cellvalue")?t=e.parentElement:(e.classList.contains("e-headercell")||e.classList.contains("e-rowcell"))&&(t=e),t)&&0<this.parent.pivotValues.length&&0<this.parent.dataSourceSettings.values.length&&(this.parent.allowDrillThrough||this.parent.editSettings.allowEditing)&&t.classList.contains("e-valuescontent")&&(e=parseInt(t.getAttribute("aria-colindex"),10)-1,i=Number(t.getAttribute("index")),_e.isNullOrUndefined(this.parent.pivotValues[i])||_e.isNullOrUndefined(this.parent.pivotValues[i][e])||this.executeDrillThrough(this.parent.pivotValues[i][e],i,e,t))},il.prototype.executeDrillThrough=function(e,t,i,a){this.parent.drillThroughElement=a,this.parent.drillThroughValue=e;var r="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,n="",s="",o=[];if(!_e.isNullOrUndefined(e.rowHeaders)&&!_e.isNullOrUndefined(e.columnHeaders)){if("olap"===this.parent.dataType){var l=void 0,l=(l="row"===this.parent.dataSourceSettings.valueAxis?r.tupRowInfo[e.rowOrdinal]:r.tupColumnInfo[e.colOrdinal])?r.getUniqueName(l.measureName):e.actualText;if(r.fieldList[l]&&r.fieldList[l].isCalculatedField)return void this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("drillError"));n=r.fieldList[l||e.actualText].caption,s=r.fieldList[l||e.actualText].aggregateType;try{this.parent.olapEngineModule.getDrillThroughData(e,this.parent.maxRowsInDrillThrough),o=JSON.parse(r.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||r.gridJSON),void(this.parent.olapEngineModule.errorInfo=void 0)}}else if(n=r.fieldList[e.actualText.toString()]?r.fieldList[e.actualText.toString()].caption:e.actualText.toString(),s=r.fieldList[e.actualText]?r.fieldList[e.actualText].aggregateType:"","Server"===this.parent.dataSourceSettings.mode)this.parent.getEngine("fetchRawData",null,null,null,null,null,null,{rowIndex:t,columnIndex:i});else if(this.parent.allowDataCompression){var d=Object.keys(e.indexObject);this.drillThroughDialog.indexString=[];for(var h=0,p=d;h<p.length;h++)for(var u=p[h],c=0,g=this.parent.engineModule.groupRawIndex[Number(u)];c<g.length;c++){var m=g[c];o.push(this.parent.engineModule.actualData[m]),this.drillThroughDialog.indexString.push(m.toString())}}else for(var S=0,f=d=Object.keys(e.indexObject);S<f.length;S++){var v=f[S];o.push(this.parent.engineModule.data[Number(v)])}"Server"!==this.parent.dataSourceSettings.mode&&this.triggerDialog(n,s,o,e,a)}},il.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},il.prototype.triggerDialog=function(e,t,i,a,r){var n,s,o;this.parent&&(n="CalculatedField"===t?e.toString():""!==t?this.parent.localeObj.getConstant(t)+" "+this.parent.localeObj.getConstant("of")+" "+e:e,n=this.parent.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(n):n,t="row"===this.parent.dataSourceSettings.valueAxis?this.parent.getRowText(Number(r.getAttribute("index")),0):""===a.rowHeaders?"":a.rowHeaders.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).join(" - "),s={currentTarget:r,currentCell:a,rawData:i,rowHeaders:t,columnHeaders:""===a.columnHeaders?"":a.columnHeaders.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).join(" - "),value:n+"("+a.formattedText+")",gridColumns:this.drillThroughDialog.frameGridColumns(i),cancel:!1},"CSV"===this.parent.dataSourceSettings.type&&(s=this.frameData(s)),(o=this).parent.trigger(xa,s,function(e){s.cancel||o.drillThroughDialog.showDrillThroughDialog(e,n)}))},il.prototype.destroy=function(){this.unWireEvents(),this.drillThroughDialog&&(this.drillThroughDialog.destroy(),this.drillThroughDialog=null)};var tl=il;function il(e){this.parent=e,this.drillThroughDialog=new $o(this.parent),this.addInternalEvents()}d.prototype.getModuleName=function(){return"pivotChart"},d.prototype.loadChart=function(e,t){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=t,!("olap"===e.dataType?""!==e.dataSourceSettings.url&&!e.olapEngineModule.isEmptyData&&0<e.olapEngineModule.tupColumnInfo.length&&0<e.olapEngineModule.tupRowInfo.length&&(!_e.isNullOrUndefined(e.olapEngineModule.colMeasurePos)||!_e.isNullOrUndefined(e.olapEngineModule.rowMeasurePos)):"Server"===this.parent.dataSourceSettings.mode?!_e.isNullOrUndefined(e.dataSourceSettings.url)&&""!==e.dataSourceSettings.url&&0<e.dataSourceSettings.values.length&&!e.engineModule.isEmptyData:0<e.dataSourceSettings.values.length&&e.dataSourceSettings.dataSource&&(0<e.dataSourceSettings.dataSource.length||e.dataSourceSettings.dataSource instanceof ce.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=[],0<this.parent.chart.axes.length&&(this.parent.chart.axes[0].title=""),this.parent.chart.primaryXAxis.zoomFactor=_e.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(qr,{}));this.parent.chart||!this.parent.element.querySelector(".e-chart")&&!this.parent.element.querySelector(".e-accumulationchart")||_e.remove(_e.select("#"+this.parent.element.id+"_chart",this.parent.element)),this.chartSettings.enableMultipleAxis&&this.accumulationType.indexOf(t.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type?this.measureList=this.dataSourceSettings.values.map(function(e){return e.name}):this.measureList=[""===t.value?this.dataSourceSettings.values[0].name:t.value];for(var k=0,j=this.dataSourceSettings.values;k<j.length;k++){var i=(n=j[k]).name.replace(/[^A-Z0-9]+/gi,"_");this.measuresNames[n.name]=i,this.measuresNames[i]=n.name,"Polar"!==this.chartSettings.chartSeries.type&&"Radar"!==this.chartSettings.chartSeries.type||(this.measuresNames[n.caption||n.name]=n.name)}this.columnGroupObject={},this.accEmptyPoint=!1;for(var q,H,a,r,n,s=this.engineModule.pivotValues,V=(this.currentMeasure=t.enableMultipleAxis&&this.accumulationType.indexOf(t.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type?this.measureList[0]:(""===t.value||0===this.dataSourceSettings.values.filter(function(e){return e.name===t.value}).length)&&0<this.dataSourceSettings.values.length?this.dataSourceSettings.values[0].name:t.value,this.getColumnTotalIndex(s)),o=Object.keys(s),l={},d=0,h=-.5,U=(this.headerColl={},this.maxLevel=0,{}),_="",B="",p="",G=(this.chartSeriesInfo={},this.selectedLegend=0,!1),z={},u=!1,c=this.parent.dataSourceSettings.valueSortSettings.headerDelimiter,W=0,Q=this.dataSourceSettings.values;W<Q.length;W++)z[i=(n=Q[W]).name]=n.caption||i,z[n.caption||i]=i;"olap"===this.parent.dataType&&(U=this.groupHierarchyWithLevels(s,e=[]),_=e[e.length-1],p=B=this.measurePos===e.length-1&&1<e.length?e[e.length-2]:_);for(var g=0,m=0,Y=0,K=!1,X=0,S=0,J=0,Z=0,$=o;Z<$.length;Z++){var f=$[Z],v=Number(f),ee=void 0,y=!1,b=void 0,f=void 0,b=K?s[v-S][this.parent.engineModule.rowMaxLevel]:s[v]&&s[v]["Tabular"===this.parent.gridSettings.layout?this.parent.engineModule.rowMaxLevel:0];if(b&&(f=S===b.level?1:S+1),"Tabular"===this.parent.gridSettings.layout&&(!this.parent.dataSourceSettings.showSubTotals||!this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals)&&b&&s[v-(S===b.level?1:S+1)]&&s[v-f][this.parent.engineModule.rowMaxLevel])for(var te,f=(K?s[v-(S+1)]:s[v-f])[this.parent.engineModule.rowMaxLevel],ie=f.valueSort.levelName.split(c),ae=b.valueSort.levelName.split(c),C=f.formattedText.split(" "),ee=Ie.isMemberDrilled(f,C,this.parent.dataSourceSettings.drilledMembers),x=ie.length-2-J;0<=x;x--)if(ie[x]!==ae[x]&&!ee){1!==X?(b=(K?s[v-(S+1)]:s[v-(S===b.level?1:S+1)])[x],K=y=!0,X++,S++,te=Number(o[o.length-1])+1,o[o.length]=te.toString(),ie[x-1]&&ie[x-1]!==ae[x-1]?(X=0,J++):J=0):X--;break}if(!_e.isNullOrUndefined(s[v-S])){var f="Tabular"===this.parent.gridSettings.layout?this.parent.engineModule.rowMaxLevel:0,C=s[v-S][f],w=C&&C.valueSort&&!_e.isNullOrUndefined(C.valueSort.levelName)?C.valueSort.levelName.toString().split(c):void 0,u=!1;if(w&&"Grand Total"!==w[0]&&!(u=t.enableMultipleAxis&&this.accumulationType.indexOf(t.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type||-1<w.indexOf(z[this.currentMeasure])?!0:u)){for(var re=0,ne=w;re<ne.length;re++)if(z[de=ne[re]]){u=!0;break}u=!u}if(C&&"row"===C.axis&&(0===this.dataSourceSettings.rows.length||"grand sum"!==C.type&&u)&&("Tabular"===this.parent.gridSettings.layout||!b.isSum)){var T="olap"===this.parent.dataType?this.engineModule.tupRowInfo[b.ordinal]:void 0,se=-1,f=b.level;if("olap"===this.parent.dataType)G="[Measures]"===b.hierarchy?G:this.isAttributeDrill(b.hierarchy,T.drillInfo),p=p===B||"[Measures]"===b.hierarchy||b.isNamedSet||this.engineModule.fieldList[b.hierarchy]&&!this.engineModule.fieldList[b.hierarchy].hasAllMember?B:p,se=T.drillInfo.length-1,3===b.memberType||T.measureName&&T.measureName!==this.dataSourceSettings.values[0].name||(l=0===(d=(H=void 0===H?b.levelUniqueName:H)===b.levelUniqueName?0:d)?{}:l,d=a&&H!==b.levelUniqueName?a.hierarchy===b.hierarchy?d+(b.level-a.level):_e.isNullOrUndefined(l[b.levelUniqueName])?U[b.hierarchy].start:l[b.levelUniqueName]:d,f=l[b.levelUniqueName]=d,h+=!a||p!==a.hierarchy||a.isDrilled&&a.hasChild?0:1,p=G?b.hierarchy:B,q=d,a=b);else if("value"!==b.type){if("Tabular"===this.parent.gridSettings.layout){for(var ae=b.valueSort.levelName.split(c),M=b.formattedText.split(" "),oe=(ee=Ie.isMemberDrilled(b,ae,this.parent.dataSourceSettings.drilledMembers),w.length-2!=this.parent.engineModule.rowMaxLevel-1?w.length-2:this.parent.engineModule.rowMaxLevel-1),D=0;D<=this.parent.engineModule.rowMaxLevel;D++)if(this.headerColl[h]&&this.headerColl[h][D]||y){if(b.isSum||y){if(0<b.level){h-=b.level===this.parent.engineModule.rowMaxLevel-1?g-1:m-1,b.formattedText=!this.parent.dataSourceSettings.showSubTotals||!this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals?b.formattedText:2<M.length?M.slice(0,M.length-1).join(" "):M[0],b.hasChild=!0;break}h-=Y-1,b.formattedText=!this.parent.dataSourceSettings.showSubTotals||!this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals?b.formattedText:2<M.length?M.slice(0,M.length-1).join(" "):M[0],b.hasChild=!0;break}if(this.headerColl[h][D]&&w[oe]!==this.headerColl[h][D].name){h++;break}}b.isSum||y||(g++,m++,Y++),this.parent.dataSourceSettings.expandAll?b.isDrilled=!ee:b.isDrilled=!!ee}else void 0===q||q<f||h++;q=f}this.maxLevel=f>this.maxLevel?f:this.maxLevel;var le="olap"===this.parent.dataType?b.formattedText:(b.actualText||b.formattedText).toString(),O=this.engineModule.fieldList[this.currentMeasure],O=0===this.parent.dataSourceSettings.rows.length?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(O.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+(_e.isNullOrUndefined(O.caption)?O.name:O.caption):b.formattedText?b.formattedText.toString():le,O=b.hasChild&&!b.isNamedSet?(b.isDrilled?" - ":" + ")+O:O,de=T?T.uNameCollection:b.valueSort.levelName.toString(),le={name:le,text:O,hasChild:b.hasChild,isDrilled:b.isDrilled,levelName:de,level:f,fieldName:b.valueSort.axis?b.valueSort.axis.toString():"",rowIndex:v-S,colIndex:0,cell:b},O=(("olap"===this.parent.dataType?3!==b.memberType:"value"!==b.type)&&(this.headerColl[h]||(this.headerColl[h]={}),this.headerColl[h][f]=le,"Tabular"===this.parent.gridSettings.layout)&&((b.isSum||y)&&(0<b.level?h+=b.level===this.parent.engineModule.rowMaxLevel-1?g-1:m-1:h+=Y-1),0===b.level?Y=g=m=0:b.level===this.parent.engineModule.rowMaxLevel-1?g=0:b.level<this.parent.engineModule.rowMaxLevel-1&&0!==b.level&&(m=g=0)),"Tabular"===this.parent.gridSettings.layout?s[v-S]:s[v]),he=Object.keys(O),P=void 0;if("olap"===this.parent.dataType)r=3!==b.memberType?b:r;else if(r="value"!==b.type?b:r,"value"!==b.type)r=b;else{var f=b&&b.valueSort&&b.valueSort.levelName&&b.valueSort.levelName.toString().split(c),pe=void 0;if(f&&0<f.length&&(f.splice(f.length-1,1),pe=f.join(c)),!(this.parent.dataSourceSettings.valueIndex<=0||this.engineModule.valueAxis&&this.dataSourceSettings.rows.length===this.engineModule.measureIndex||_e.isNullOrUndefined(r.valueSort)||pe===r.valueSort.levelName))for(var N=v;-1<N;)s[N]&&s[N][0]&&s[N][0].valueSort&&s[N][0].valueSort.levelName===pe&&(r=s[N][0],N=0),N--}for(var ue="Tabular"===this.parent.gridSettings.layout?this.parent.engineModule.rowMaxLevel:0;ue<he.length;ue++){var E=he[ue],E=Number(E),I=s[v-S][E],F=!_e.isNullOrUndefined(I.rowHeaders)||0===this.dataSourceSettings.rows.length,L="olap"===this.parent.dataType&&T&&T.measureName?T.measureName:I.actualText;if(("olap"!==this.parent.dataType||!I.isGrandSum)&&!V[I.colIndex]&&"value"===I.axis&&"header"!==b.type&&""!==L&&(t.enableMultipleAxis&&this.accumulationType.indexOf(t.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type||L===this.currentMeasure)){if(_e.isNullOrUndefined(b.members)&&(b.members=[]),"olap"===this.parent.dataType?_!==b.hierarchy&&!G||(3===b.memberType&&P?se!==this.measurePos||P.isDrilled&&P.hasChild:b.isDrilled&&b.hasChild):("value"===b.type&&P?!_e.isNullOrUndefined(P.members)&&P.hasChild&&P.isDrilled:b.hasChild&&b.isDrilled)||!F)break;if("olap"===this.parent.dataType&&!0===I.isSum&&"row"===this.parent.dataSourceSettings.valueAxis)continue;var F="",A=(F="olap"===this.parent.dataType?I.columnHeaders.toString().split(/~~|::/).join(" - "):(A=I.columnHeaders.toString().split(c),Ie.formatChartHeaders(A,this,!0,I)),""),R=(A="olap"===this.parent.dataType?I.rowHeaders.toString().split(/~~|::/).join(" - "):(R=I.rowHeaders.toString().split(c),Ie.formatChartHeaders(R,this,!1,I)),F+" | "+L),L=(this.chartSeriesInfo[F]={uniqueName:F,caption:I.hierarchyName&&I.hierarchyName.toString().split(c).join(" - "),colorIndex:[]},this.chartSeriesInfo[this.chartSeriesInfo[F].caption]=this.chartSeriesInfo[F],"pivot"===this.parent.dataType&&this.engineModule.aggregatedValueMatrix[v]&&!_e.isNullOrUndefined(this.engineModule.aggregatedValueMatrix[v][E])?Number(this.engineModule.aggregatedValueMatrix[v][E]):_e.isNullOrUndefined(I.value)?I.value:Number(I.value));0===(L=L===1/0?null:L)&&(this.accEmptyPoint=!0),this.columnGroupObject[R]?this.columnGroupObject[R].push({x:0===this.dataSourceSettings.rows.length?b.formattedText:A,y:L,rIndex:v-S,cIndex:E}):this.columnGroupObject[R]=[{x:0===this.dataSourceSettings.rows.length?b.formattedText:A,y:L,rIndex:v-S,cIndex:E}]}P=r}}}}this.refreshChart()},d.prototype.refreshChart=function(){this.chartSeries=[];for(var e=0,t={},i=Object.keys(this.columnGroupObject),a=(this.persistSettings=JSON.parse(this.parent.getChartSettings()).chartSettings,this.persistSettings.palettes&&0<this.persistSettings.palettes.length?this.persistSettings.palettes:y.getSeriesColor(this.chartSettings.theme)),r=this.parent.chartSettings.columnDelimiter||"-",r=this.parent.chartSettings.columnHeader&&""!==this.parent.chartSettings.columnHeader?this.parent.chartSettings.columnHeader.split(r).join(" - "):"",n=this.chartSettings.chartSeries?this.chartSettings.chartSeries.type:void 0,s={},o=0;o<this.parent.dataSourceSettings.values.length;o++)s[this.parent.dataSourceSettings.values[o].name]=_e.isNullOrUndefined(this.parent.dataSourceSettings.values[o].caption)?void 0:this.parent.dataSourceSettings.values[o].caption;if(-1<this.accumulationType.indexOf(n)&&0<i.length){this.currentColumn=-1<i.indexOf(r+" | "+this.currentMeasure)&&void 0!==r?r+" | "+this.currentMeasure:i[0];var l={};l=this.persistSettings.chartSeries?this.frameChartSeries(this.persistSettings.chartSeries):l,(_e.isNullOrUndefined(l.palettes)||0===l.palettes.length)&&!_e.isNullOrUndefined(this.persistSettings.palettes)&&0<this.persistSettings.palettes.length&&(l.palettes=this.persistSettings.palettes),l.dataSource=this.columnGroupObject[this.currentColumn],l.xName="x",l.yName="y",this.persistSettings.chartSeries&&this.persistSettings.chartSeries.dataLabel?(l.dataLabel=this.persistSettings.chartSeries.dataLabel,l.dataLabel.name="x"):(l.dataLabel={visible:!0,position:"Outside",name:"x"},this.parent.setProperties({chartSettings:{chartSeries:{dataLabel:{visible:!0,position:"Outside"}}}},!0)),this.accEmptyPoint&&l.emptyPointSettings?l.emptyPointSettings.mode="Zero":this.accEmptyPoint&&(l.emptyPointSettings={mode:"Zero"}),l.name=this.currentColumn,"Doughnut"===n?(l.type="Pie",l.innerRadius=this.chartSettings.chartSeries.innerRadius||"40%"):"Pie"===n&&(l.innerRadius=this.chartSettings.chartSeries.innerRadius||"0"),this.chartSeries=this.chartSeries.concat(l)}else for(var d=0,h=i;d<h.length;d++){var p=h[d],l={};l=this.persistSettings.chartSeries?this.frameChartSeries(this.persistSettings.chartSeries):l,!_e.isNullOrUndefined(l.palettes)&&0<l.palettes.length&&(_e.isNullOrUndefined(this.persistSettings.palettes)||0===this.persistSettings.palettes.length)&&(this.chartSettings.palettes=l.palettes);for(o=0;o<this.columnGroupObject[p].length;o++){var u=this.engineModule.fieldList[this.currentMeasure];this.columnGroupObject[p][o].x=0!==this.parent.dataSourceSettings.rows.length||this.chartSettings.showMultiLevelLabels?""===this.columnGroupObject[p][o].x?this.parent.localeObj.getConstant("blank"):this.columnGroupObject[p][o].x:this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(u.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+(_e.isNullOrUndefined(u.caption)?u.name:u.caption)}l.dataSource=this.columnGroupObject[p],l.xName="x",l.yName="y",l.visible=!0;for(var c,g=void 0,m=void 0,S=void 0,o=0,f=p.split(" | ");o<f.length;o++)this.measuresNames&&this.measuresNames[f[o]]&&(m=f[o],S=p.split(" | "+m)[0]);this.chartSettings.enableMultipleAxis&&(c=m,g=S+" | "+(c=_e.isNullOrUndefined(s[c])?c:s[c])),l.name=this.chartSettings.enableMultipleAxis?g:S,this.chartSettings.showPointColorByMembers&&this.chartSettings.enableMultipleAxis&&(l.name=S,c=this.chartSeriesInfo[l.name].caption,l.name=null!=c?c:l.name,t[l.name]?(l.fill=t[l.name].color,this.chartSeriesInfo[l.name].colorIndex.push(this.selectedLegend++),l.name=void 0):(e=a[e]?e:0,t[l.name]={name:l.name,color:a[e]},l.fill=a[e++],this.chartSeriesInfo[l.name].colorIndex.push(this.selectedLegend++))),["Radar","Polar"].indexOf(n)<0&&(g=m,l.tooltipMappingName=this.measuresNames[g],l.yAxisName=this.chartSettings.enableMultipleAxis&&"Combined"===this.chartSettings.multipleAxisMode?this.measureList.join("_"):this.measuresNames[g]||g),this.persistSettings.chartSeries&&this.persistSettings.chartSeries.emptyPointSettings&&(l.emptyPointSettings=this.persistSettings.chartSeries.emptyPointSettings),l.emptyPointSettings||(l.emptyPointSettings={mode:"Zero"}),this.chartSeries=this.chartSeries.concat(l)}var r={series:this.chartSeries,cancel:!1},v=this;this.parent.trigger(cr,r,function(e){e.cancel?(v.element&&_e.remove(v.element),v.parent.notify(qr,{})):v.bindChart()})},d.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},d.prototype.frameChartSeries=function(e){for(var t=Object.keys(e),i=0,a={};i<t.length;)-1<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])||this.accumulationType.indexOf(this.parent.chartSettings.chartSeries.type)<0&&-1<["endAngle","explode","explodeAll","explodeIndex","explodeOffset","gapRatio","groupMode","groupTo","neckHeight","neckWidth","pyramidMode","startAngle","dataLabel","innerRadius"].indexOf(t[i])||(a[t[i]]=e[t[i]]),i++;return a},d.prototype.bindChart=function(){this.parent.showWaitingPopup();var e=this.configXAxis(),t=this.configTooltipSettings(),i=this.configLegendSettings(),a=this.configZoomSettings(),r=this.frameAxesWithRows(),n=this.chartSettings.chartSeries.type,s=("Both"===this.parent.displayOption.view?this.element="Chart"===this.parent.displayOption.primary?this.parent.element.insertBefore(this.element||_e.createElement("div",{className:Ei,id:this.parent.element.id+"_chart"}),this.parent.element.querySelector("."+Wt)):this.parent.element.appendChild(this.element||_e.createElement("div",{className:Ei,id:this.parent.element.id+"_chart"})):this.element||(this.element=this.parent.element.appendChild(_e.createElement("div",{className:Ei,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("."+Ei).innerHTML="",this.chartElement=this.parent.element.querySelector("."+Ei).appendChild(_e.createElement("div",{className:Vi,id:this.parent.element.id+"_chartInner"}))),this.parent.element.querySelector("."+Vi)&&(this.parent.element.querySelector("."+Vi).innerHTML=""),this.parent.showGroupingBar?this.element.style.minWidth=this.parent.minWidth?this.parent.minWidth+"px":"400px !important":this.element.style.minWidth=this.parent.minWidth?this.parent.minWidth+"px":"310px !important",this.parent.width.toString()),o=(this.parent.showToolbar&&this.parent.grid&&(s=this.parent.getGridWidthAsNumber().toString()),this.getChartHeight());this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&this.accumulationType.indexOf(n)<0&&"Pareto"!==this.chartSettings.chartSeries.type&&(this.parent.element.querySelector("."+Ei).style.height=("auto"===o?this.getChartAutoHeight():o)+"px",this.parent.element.querySelector("."+Ei).style.width=s+"px","Polar"!==this.parent.chartSettings.chartSeries.type)&&"Radar"!==this.parent.chartSettings.chartSeries.type&&(this.parent.element.querySelector("."+Ei).style.overflow="auto",this.parent.element.querySelector("."+Ei).style.overflowX="hidden"),this.parent.chart&&("accumulationchart"===this.parent.chart.getModuleName()&&this.accumulationType.indexOf(n)<0||"chart"===this.parent.chart.getModuleName()&&-1<this.accumulationType.indexOf(n)&&"Pareto"!==this.chartSettings.chartSeries.type)&&(this.parent.chart.destroy(),_e.select("#"+this.parent.element.id+"_chart",this.parent.element))&&(_e.select("#"+this.parent.element.id+"_chart",this.parent.element).innerHTML="",_e.select("#"+this.parent.element.id+"_chart",this.parent.element).appendChild(_e.createElement("div",{className:Vi,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,_e.select("#"+this.parent.element.id+"_chart",this.parent.element).innerHTML="",_e.select("#"+this.parent.element.id+"_chart",this.parent.element).appendChild(_e.createElement("div",{className:Vi,id:this.parent.element.id+"_chartInner"})),this.parent.toolbarModule.isMultiAxisChange=!1),y.Chart.Inject(y.ColumnSeries,y.StackingColumnSeries,y.RangeColumnSeries,y.BarSeries,y.StackingBarSeries,y.ScatterSeries,y.BubbleSeries,y.LineSeries,y.StepLineSeries,y.SplineSeries,y.SplineAreaSeries,y.MultiColoredLineSeries,y.PolarSeries,y.RadarSeries,y.AreaSeries,y.RangeAreaSeries,y.StackingAreaSeries,y.StepAreaSeries,y.StackingLineSeries,y.MultiColoredAreaSeries,y.ParetoSeries,y.Legend,y.Tooltip,y.Category,y.MultiLevelLabel,y.ScrollBar,y.Zoom,y.Export,y.Crosshair,y.Selection,y.StripLine,y.DataLabel),y.AccumulationChart.Inject(y.PieSeries,y.FunnelSeries,y.PyramidSeries,y.AccumulationDataLabel,y.AccumulationLegend,y.AccumulationTooltip,y.Export),-1<this.accumulationType.indexOf(n)?this.parent.chart=new y.AccumulationChart({series:0<this.chartSeries.length?this.chartSeries:[{}],legendSettings:i,tooltip:t,width:s,height:o.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.chartSettings.enableExport,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 y.Chart({series:0<this.chartSeries.length?this.chartSeries:[{}],legendSettings:i,tooltip:t,zoomSettings:a,axes:"Polar"===n||"Radar"===n?[]:r.axes,rows:"Polar"===n||"Radar"===n?[{}]:"Bar"===n||"StackingBar"===n||"StackingBar100"===n||"Pareto"===n&&this.chartSettings.enableMultipleAxis?[{height:"100%"}]:r.rows,columns:"Polar"===n||"Radar"===n?[{}]:"Bar"===n||"StackingBar"===n||"StackingBar100"===n&&this.chartSettings.enableMultipleAxis?r.columns:[{width:"100%"}],primaryYAxis:"Polar"===n||"Radar"===n?r.axes[0]:{visible:!1},primaryXAxis:e,width:s,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&&0<this.parent.dataSourceSettings.values.length?Number(o)>235*this.parent.dataSourceSettings.values.length+100?isNaN(Number(o))?o:Number(o)-5:!isNaN(Number(o))||1<this.parent.dataSourceSettings.values.length?235*this.parent.dataSourceSettings.values.length+100:o:o).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:(_e.isNullOrUndefined(this.persistSettings.chartArea)?this.chartSettings: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.chartSettings.enableExport,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=i,this.parent.chart.selectionMode=this.parent.chartSettings.selectionMode,this.parent.chart.enableExport=this.chartSettings.enableExport,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,-1<this.accumulationType.indexOf(n)?(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"===n||"Radar"===n?(this.parent.chart.primaryXAxis=e,this.parent.chart.primaryYAxis.visible=!0,this.parent.chart.primaryYAxis=r.axes[0],this.parent.chart.axes=[],this.parent.chart.rows=[{}]):this.accumulationType.indexOf(n)<0&&"chart"===this.parent.chart.getModuleName()&&(this.parent.chart.primaryYAxis.visible=!1,this.parent.chart.primaryXAxis=e,this.parent.chart.axes=r.axes,"Bar"===n||"StackingBar"===n||"StackingBar100"===n&&this.chartSettings.enableMultipleAxis?(this.parent.chart.rows=[{height:"100%"}],this.parent.chart.columns=r.columns):("Pareto"===n&&this.chartSettings.enableMultipleAxis?this.parent.chart.rows=[{height:"100%"}]:this.parent.chart.rows=r.rows,this.parent.chart.columns=[{width:"100%"}])),this.parent.chart.refresh(),-1<this.accumulationType.indexOf(n)&&"accumulationchart"===this.parent.chart.getModuleName()&&(0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length)&&(this.parent.hideWaitingPopup(),this.parent.pivotFieldListModule)&&P.hideSpinner(this.parent.pivotFieldListModule.fieldListSpinnerElement)),this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis?this.parent.chart.appendTo(_e.select("#"+this.parent.element.id+"_chartInner",this.parent.element)):this.parent.chart.appendTo(_e.select("#"+this.parent.element.id+"_chart",this.parent.element))},d.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(Ga,e)},d.prototype.pointClick=function(e){var t,i,a=e.series.dataSource||this.parent.chart.series[e.seriesIndex].dataSource;(-1<["Pie","Funnel","Doughnut","Pyramid","Radar","Polar"].indexOf(this.parent.chartSettings.chartSeries.type)||!this.parent.chartSettings.showMultiLevelLabels)&&("olap"===this.parent.dataType||1<this.parent.dataSourceSettings.rows.length)?(this.pivotIndex={rIndex:a?a[e.pointIndex].rIndex:void 0,cIndex:a?a[e.pointIndex].cIndex:void 0},this.creatMenu(),i=this.parent.element.getBoundingClientRect(),t=(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(t+e.y,e.x+i.left+(window.scrollX||document.documentElement.scrollLeft))):(this.parent.allowDrillThrough||this.parent.editSettings.allowEditing)&&this.parent.drillThroughModule&&(t=a[e.pointIndex].rIndex,i=a[e.pointIndex].cIndex,this.parent.drillThroughModule.executeDrillThrough(this.parent.pivotValues[t][i],t,i)),this.parent.trigger(Pr,e)},d.prototype.frameAxesWithRows=function(){var e=[],t=[],i=[],a=[],r=this.persistSettings.chartSeries&&("StackingColumn100"===this.persistSettings.chartSeries.type||"StackingBar100"===this.persistSettings.chartSeries.type||"StackingArea100"===this.persistSettings.chartSeries.type||"StackingLine100"===this.persistSettings.chartSeries.type),n=["PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfDifferenceFrom","PercentageOfParentRowTotal","PercentageOfParentColumnTotal","PercentageOfParentTotal"];if(this.chartSettings.enableMultipleAxis)for(var s=0,o=100/this.dataSourceSettings.values.length+"%",l=0,d=this.dataSourceSettings.values;l<d.length;l++){for(var h=d[l],p=this.engineModule.fieldList[h.name],u=("olap"===this.parent.dataType?"":this.parent.localeObj.getConstant(p.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" ")+p.caption,c=(a.push(u),void 0),g=0,m=this.dataSourceSettings.formatSettings;g<m.length;g++){var S=m[g];if(S.name===h.name){c=S;break}}var f=-1!==Ie.inArray(p.aggregateType,n)?"P2":c?c.format:"olap"===this.parent.dataType?this.getFormat(p.formatString):"N",v="Polar"===this.chartSettings.chartSeries.type||"Radar"===this.chartSettings.chartSeries.type,y={};(y=this.persistSettings.primaryYAxis?this.frameObjectWithKeys(this.persistSettings.primaryYAxis):y).labelFormat=y.labelFormat||(r?"":v?"N":f),y.title=y.title||("Combined"===this.chartSettings.multipleAxisMode?a.join(" - "):u),y.zoomFactor=_e.isNullOrUndefined(this.chartSettings.primaryYAxis.zoomFactor)?1:this.chartSettings.primaryYAxis.zoomFactor,y.edgeLabelPlacement=this.chartSettings.primaryYAxis.edgeLabelPlacement||this.persistSettings.primaryYAxis.edgeLabelPlacement,"Bar"===this.chartSettings.chartSeries.type||"StackingBar"===this.chartSettings.chartSeries.type||"StackingBar100"===this.chartSettings.chartSeries.type?y.plotOffsetRight=y.plotOffsetRight||30:y.plotOffsetTop=y.plotOffsetTop||30,v||(y.name="Combined"===this.chartSettings.multipleAxisMode?this.measureList.join("_"):this.measuresNames[h.name]||h.name),e=e.concat(y),"Combined"===this.chartSettings.multipleAxisMode&&(e=[e[e.length-1]]),"Stacked"===this.chartSettings.multipleAxisMode?(y.rowIndex=s,y.columnIndex=s,t.push({height:o}),i.push({width:o})):(y.rowIndex=0,y.columnIndex=0,t=[{height:"100%"}],i=[{width:"100%"}]),s++}else{for(var p=this.engineModule.fieldList[this.currentMeasure],u=("olap"===this.parent.dataType?"":this.parent.localeObj.getConstant(p.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" ")+p.caption,c=void 0,b=0,C=this.dataSourceSettings.formatSettings;b<C.length;b++)if((h=C[b]).name===this.currentMeasure){c=h;break}y={},f=-1!==Ie.inArray(p.aggregateType,n)?"P2":c?c.format:"olap"===this.parent.dataType?this.getFormat(p.formatString):"N";(y=this.persistSettings.primaryYAxis?this.frameObjectWithKeys(this.persistSettings.primaryYAxis):y).zoomFactor=_e.isNullOrUndefined(this.chartSettings.primaryYAxis.zoomFactor)?1:this.chartSettings.primaryYAxis.zoomFactor,y.rowIndex=0,y.columnIndex=0,y.edgeLabelPlacement=this.chartSettings.primaryYAxis.edgeLabelPlacement||this.persistSettings.primaryYAxis.edgeLabelPlacement,"Polar"!==this.chartSettings.chartSeries.type&&"Radar"!==this.chartSettings.chartSeries.type&&(y.name=this.measuresNames[this.currentMeasure]||this.currentMeasure),y.labelFormat=y.labelFormat||(r?"":f),y.title=y.title||u,e=e.concat(y),t.push({height:"100%"}),i.push({width:"100%"})}return{axes:e,rows:t,columns:i}},d.prototype.getFormat=function(e){return e="Currency"===e?"C":"Percent"===e?"P":"N"},d.prototype.getColumnTotalIndex=function(e){for(var t={},i=0,a=Object.keys(e);i<a.length;i++){var r=a[i],n=e[Number(r)];if(!_e.isNullOrUndefined(n))for(var s=0,o=Object.keys(n);s<o.length;s++){var l=o[s],l=n[Number(l)];if(!_e.isNullOrUndefined(l)){if("column"!==l.axis)return t;"sum"!==l.type&&(this.dataSourceSettings&&this.dataSourceSettings.columns&&0===this.dataSourceSettings.columns.length||"grand sum"!==l.type)||-1===l.rowSpan||(t[l.colIndex]=l.colIndex)}}}return t},d.prototype.groupHierarchyWithLevels=function(e,t){var i,a={},r=0,n={};this.measurePos=this.engineModule.tupRowInfo[0].measurePosition;for(var s=0;s<e.length;s++){var o=e[s][0];o&&"row"===o.axis&&"grand sum"!==o.type&&(_e.isNullOrUndefined(a[o.hierarchy])?(3===o.memberType?r===this.measurePos?(t[this.measurePos]=o.hierarchy,a[o.hierarchy]=((i={})[o.levelUniqueName]=o.levelUniqueName,i)):r--:(t[r]=o.hierarchy,a[o.hierarchy]=((i={})[o.levelUniqueName]=o.levelUniqueName,i)),r++):a[o.hierarchy][o.levelUniqueName]=o.levelUniqueName)}for(var l=-1,d=0;d<t.length;d++)this.measurePos!==d&&(n[t[d]]={start:l+1,end:l+Object.keys(a[t[d]]).length},l=n[t[d]].end);return n},d.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),s=this.headerColl[n],o=0,l=!1;o<=this.maxLevel;)l?s[o]||(s[o]={name:s[o-1].name,text:"",hasChild:s[o-1].hasChild,isDrilled:s[o-1].isDrilled,levelName:s[o-1].levelName,level:s[o-1].level,fieldName:s[o-1].fieldName,rowIndex:s[o-1].rowIndex,colIndex:s[o-1].colIndex,span:-1}):s[o]?l=!0:s[o]=t[o],o++;t=this.headerColl[n]}for(var d={},h=0,p=e;h<p.length;h++){for(var r=p[h],n=Number(r),s=this.headerColl[n],u=0,c=Object.keys(s);u<c.length;u++){var g,m=c[u],m=Number(m);d[m]?(g=d[m].length,s[m].levelName===t[m].levelName?d[m][g-1].end=d[m][g-1].end+1:d[m].push({start:n,end:n+1,text:s[m].text,type:_e.isNullOrUndefined(this.persistSettings.primaryXAxis)||_e.isNullOrUndefined(this.persistSettings.primaryXAxis.border)||_e.isNullOrUndefined(this.persistSettings.primaryXAxis.border.type)?-1===s[m].span?"WithoutTopandBottomBorder":"WithoutTopBorder":this.persistSettings.primaryXAxis.border.type,customAttributes:s[m]})):d[m]=[{start:n,end:n+1,text:s[m].text,type:_e.isNullOrUndefined(this.persistSettings.primaryXAxis)||_e.isNullOrUndefined(this.persistSettings.primaryXAxis.border)||_e.isNullOrUndefined(this.persistSettings.primaryXAxis.border.type)?-1===s[m].span?"WithoutTopandBottomBorder":"WithoutTopBorder":this.persistSettings.primaryXAxis.border.type,customAttributes:s[m]}]}t=s}for(var S=[],f=Object.keys(d).length-1;-1<f;f--)S.push({categories:d[f],border:{width:1},overflow:"Trim"});return S},d.prototype.getZoomFactor=function(){this.calculatedWidth=this.getCalulatedWidth();var e=120<10*this.chartSeries.length?10*this.chartSeries.length:120,e=0<this.chartSeries.length?this.calculatedWidth/(Object.keys(this.chartSeries[0].dataSource).length*e):1;return e<1&&0<e?e:1},d.prototype.getCalulatedWidth=function(){return isNaN(Number(this.parent.width))?-1<this.parent.width.indexOf("%")?this.calculatedWidth=this.parent.element.clientWidth*(parseFloat(this.parent.width)/100):-1<this.parent.width.indexOf("px")?this.calculatedWidth=Number(this.parent.width.toString().split("px")[0]):this.calculatedWidth=this.parent.element.clientWidth:this.calculatedWidth=Number(this.parent.width),this.calculatedWidth},d.prototype.configTooltipSettings=function(){var e=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||this.parent.tooltipTemplate),e.header=e.header||"",e.enableMarker=void 0===e.enableMarker||e.enableMarker,e},d.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||25,e.shapePadding=e.shapePadding||10,e},d.prototype.configXAxis=function(){var e={};return(e=this.persistSettings.primaryXAxis?this.frameObjectWithKeys(this.persistSettings.primaryXAxis):e).valueType="Category",e.labelIntersectAction=e.labelIntersectAction||"Rotate45",e.title=e.title||this.dataSourceSettings.rows.map(function(e){return e.caption||e.name}).join(" / "),e.zoomFactor=_e.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:_e.isNullOrUndefined(this.persistSettings.primaryXAxis)||_e.isNullOrUndefined(this.persistSettings.primaryXAxis.border)||_e.isNullOrUndefined(this.persistSettings.primaryXAxis.border.type)?"WithoutTopandBottomBorder":this.persistSettings.primaryXAxis.border.type},e.majorTickLines={width:0,height:-10}):(e.multiLevelLabels=[],e.border={width:1,type:_e.isNullOrUndefined(this.persistSettings.primaryXAxis)||_e.isNullOrUndefined(this.persistSettings.primaryXAxis.border)||_e.isNullOrUndefined(this.persistSettings.primaryXAxis.border.type)?"Rectangle":this.persistSettings.primaryXAxis.border.type},e.majorTickLines={width:0,height:5}),e},d.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},d.prototype.tooltipRender=function(e){var t=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.currentMeasure,i=e.series.dataSource||this.parent.chart.series[e.data.seriesIndex].dataSource,a=i?i[e.data.pointIndex].rIndex:void 0,r=i?i[e.data.pointIndex].cIndex:void 0,t=this.engineModule.fieldList[this.measuresNames[t]||t],n="olap"===this.parent.dataType?"":this.parent.localeObj.getConstant(t.aggregateType),s=("olap"===this.parent.dataType?"":n+" "+this.parent.localeObj.getConstant("of")+" ")+t.caption,o=this.engineModule.pivotValues[a][r].formattedText,l=this.engineModule.formatFields[t.id],d=this.engineModule.getFormattedValue(e.point.y,t.id,o),l=l&&l.format&&null!==l.format.toLowerCase().match(/n|p|c/)&&this.chartSettings.useGroupingSeparator?"olap"===this.parent.dataType?d.toString():d.formattedText:o,d=this.parent.pivotValues[a][r],o=d.columnHeaders,h="",p=(h=_e.isNullOrUndefined(o)?void 0:("olap"===this.parent.dataType?this.chartSeriesInfo[o.toString().split(/~~|::/).join(" - ")]:(p=o.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter),o=Ie.formatChartHeaders(p,this,!0,d),this.chartSeriesInfo[o.toString()])).uniqueName,e.point.x);this.parent.tooltipTemplate&&void 0!==this.parent.getTooltipTemplate()||this.chartSettings.tooltip.template?(d=i?this.parent.getHeaderField(a,r,"row"):"",o=i?this.parent.getHeaderField(a,r,"Column"):"",i={rowHeaders:p,columnHeaders:h,aggregateType:n,value:l,valueField:t.caption,rowFields:d,columnFields:o},a=void 0,a=(this.parent.chartSettings&&this.parent.chartSettings.tooltip&&this.parent.chartSettings.tooltip.enable&&this.parent.chartSettings.tooltip.template?this.tooltipTemplateFn()(i,this,"tooltipTemplate",this.element.id+"1tooltipTemplate"):this.parent.getTooltipTemplate()(i,this,"tooltipTemplate",this.element.id+"tooltipTemplate"))[0].outerHTML,e.template=a):(e.text=s+": "+l+(0===this.dataSourceSettings.columns.length?"":" <br/>"+this.parent.localeObj.getConstant("column")+": "+h)+(0===this.dataSourceSettings.rows.length?"":" <br/>"+this.parent.localeObj.getConstant("row")+": "+p)+(e.data&&"Pareto"===e.data.seriesName?" <br/>"+this.parent.localeObj.getConstant("pareto")+": "+e.data.pointY+"%":""),this.parent.trigger(Ba,e))},d.prototype.tooltipTemplateFn=function(){return this.templateFn},d.prototype.loaded=function(e){this.parent.isChartLoaded=!0;var t=(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber()).toString(),i=(this.parent.chart&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.showFieldList&&"Chart"===this.parent.currentView&&this.parent.groupingBarModule.alignIcon(),this.chartSettings.showMultiLevelLabels&&(i=-1<Ie.inArray(this.chartSettings.chartSeries.type,["Bar","StackingBar","StackingBar100"])?"_chartYAxisMultiLevelLabel0":"_chartXAxisMultiLevelLabel0",_e.isNullOrUndefined(_e.select("#"+this.parent.element.id+i,this.parent.element))||this.parent.element.querySelector("#"+this.parent.element.id+i).setAttribute("cursor","pointer")),this.getChartHeight());this.parent.chart.height=i,this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&(0<=["Pie","Funnel","Pyramid","Doughnut","Radar","Polar","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)?this.parent.element.querySelector("."+Ei).style.overflow="visible":(this.parent.element.querySelector("."+Ei).style.overflow="auto",this.parent.element.querySelector("."+Ei).style.overflowX="hidden"),this.parent.element.querySelector("."+Ei).style.width=t+"px",this.parent.element.querySelector("."+Ei).style.height=i+"px"),this.updateView(),"Chart"!==this.parent.displayOption.primary&&"Chart"!==this.parent.displayOption.view||this.parent.notify(qr,{}),this.parent.trigger(za,e),("Server"===this.parent.dataSourceSettings.mode&&this.parent.isServerWaitingPopup||"Local"===this.parent.dataSourceSettings.mode)&&this.parent.hideWaitingPopup()},d.prototype.updateView=function(){var e,t;this.parent.grid&&this.parent.chart&&this.parent.showToolbar&&(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("."+le))&&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("."+le))&&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="")))},d.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"],t=[],i=0;i<e.length;i++)t.push({id:this.parent.element.id+"_DrillMenuChart_"+e[i],text:this.parent.localeObj.getConstant(e[i]),items:[]});for(var a=this.getMenuItems(),r=[],n=[],i=0;i<a.length;i++)"expand"===a[i].type?r.push({id:this.element.id+"drillExpand_"+a[i].key,text:a[i].value}):n.push({id:this.element.id+"drillCollapse_"+a[i].key,text:a[i].value});0<r.length&&(t[0].items=r),0<n.length&&(t[1].items=n);var s,o={cssClass:this.parent.element.id+"_accumulationChart"+(this.parent.cssClass?" "+this.parent.cssClass:""),items:t,enableRtl:this.parent.enableRtl,beforeOpen:this.drillMenuOpen.bind(this),select:this.drillMenuSelect.bind(this),locale:this.parent.locale};this.accumulationMenu=new D.ContextMenu(o),_e.select("#"+this.parent.element.id+"_accumulationChart",this.parent.element)?(s=_e.select("#"+this.parent.element.id+"_accumulationChart",this.parent.element)).innerHTML="":(s=_e.createElement("ul",{id:this.parent.element.id+"_accumulationChart"}),this.parent.element.appendChild(s)),this.accumulationMenu.isStringTemplate=!0,this.accumulationMenu.appendTo(s)},d.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)},d.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,s="olap"===this.parent.dataType?r.rowHeaders.toString().split(/~~|::/):r.rowHeaders.toString().split(this.engineModule.valueSortSettings.headerDelimiter);i[e][0];){var o,r=i[e][0];0!==s.length&&s.indexOf(r.formattedText.toString())===s.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),o=s.indexOf(r.formattedText.toString()),s.splice(o,1)),0===r.level&&r.hasChild&&!r.isNamedSet&&(n=void 0,a=[]),e--}return t},d.prototype.drillMenuSelect=function(e){var t,i,a,r,n=("olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule).pivotValues,s=e.element.id.split("_DrillMenuChart_")[1];0===e.element.id.indexOf(this.element.id+"drill")?(t=0<=e.element.id.split(this.element.id+"drill")[1].indexOf("Expand")?"drillExpand":"drillCollapse",t=n[e=Number(e.element.id.split(this.element.id+t+"_")[1])][0],i="olap"===this.parent.dataType?t.formattedText:(t.actualText||t.formattedText).toString(),a=t.formattedText?t.formattedText.toString():i,a=t.hasChild&&!t.isNamedSet?(t.isDrilled?" - ":" + ")+a:a,r=(r="olap"===this.parent.dataType?this.engineModule.tupRowInfo[t.ordinal]:void 0)?r.uNameCollection:t.valueSort.levelName.toString(),r={fieldName:t.valueSort.axis,level:t.level,hasChild:t.hasChild,levelName:r,name:i,text:a,rowIndex:e,colIndex:0,isDrilled:t.isDrilled,cell:t},"olap"===this.parent.dataType?this.parent.onDrill(void 0,r):this.onDrill({customAttributes:r})):"drillThrough"===s?this.parent.drillThroughModule.executeDrillThrough(n[this.pivotIndex.rIndex][this.pivotIndex.cIndex],this.pivotIndex.rIndex,this.pivotIndex.rIndex):"exit"===s&&this.accumulationMenu.close()},d.prototype.getChartHeight=function(){var e,t,i;return _e.isNullOrUndefined(this.parent.getHeightAsNumber())?e="auto":(t=this.parent.showToolbar?6:5,e=(this.parent.getHeightAsNumber()-t).toString(),t=this.parent.getHeightAsNumber()-t),_e.isNullOrUndefined(this.parent.getHeightAsNumber())?e="auto":(i=!1,null!==this.parent.element.querySelector(".e-chart-grouping-bar")&&"none"===this.parent.element.querySelector(".e-chart-grouping-bar").style.display.toLowerCase()&&(i=!0,this.parent.element.querySelector(".e-chart-grouping-bar").style.display="block"),this.parent.showToolbar&&this.parent.showGroupingBar?e=(t-(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=(t-(this.parent.element.querySelector(".e-pivot-toolbar")?this.parent.element.querySelector(".e-pivot-toolbar").clientHeight:42)).toString():this.parent.showGroupingBar?e=(t-(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||t<200)&&(e="200"),i&&(this.parent.element.querySelector(".e-chart-grouping-bar").style.display="none")),e},d.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},d.prototype.axisLabelRender=function(e){var t,i;this.chartSettings.showMultiLevelLabels&&"Pareto"!==this.chartSettings.chartSeries.type&&"primaryXAxis"===e.axis.name&&(e.text=""),"primaryXAxis"!==e.axis.name&&"StackingColumn100"!==this.parent.chartSettings.chartSeries.type&&"StackingBar100"!==this.parent.chartSettings.chartSeries.type&&"StackingArea100"!==this.parent.chartSettings.chartSeries.type&&"StackingLine100"!==this.parent.chartSettings.chartSeries.type&&(i=this.chartSettings.enableMultipleAxis&&"Combined"===this.chartSettings.multipleAxisMode?this.currentMeasure:"olap"===this.parent.dataType?this.measuresNames[e.axis.name]:e.axis.name,i=this.engineModule.formatFields[i]||null,t=this.engineModule.getFormattedValue(e.value,this.chartSettings.enableMultipleAxis&&"Combined"===this.chartSettings.multipleAxisMode?this.currentMeasure:e.axis.name,e.text),i=i&&i.format&&this.chartSettings.useGroupingSeparator?"olap"===this.parent.dataType?t.toString():t.formattedText:e.value.toString(),e.text=i),this.parent.trigger(ur,e)},d.prototype.multiLevelLabelClick=function(e){var t={axis:e.axis,text:e.text,cell:_e.isNullOrUndefined(e.customAttributes)?void 0:e.customAttributes.cell,cancel:!1};this.parent.trigger(Aa,t),!t.cancel&&e.customAttributes&&e.customAttributes.hasChild&&!e.customAttributes.cell.isNamedSet&&("olap"===this.parent.dataType?this.parent.onDrill(void 0,e.customAttributes):this.onDrill(e))},d.prototype.onDrill=function(e){var e=e.customAttributes,t=this.dataSourceSettings.drilledMembers[0]&&this.dataSourceSettings.drilledMembers[0].delimiter?this.dataSourceSettings.drilledMembers[0].delimiter:"**",i=e.fieldName,a="Tabular"===this.parent.gridSettings.layout?!this.parent.dataSourceSettings.showSubTotals||!this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals?e.level:this.parent.engineModule.rowMaxLevel:e.colIndex,a=this.engineModule.pivotValues[e.rowIndex][a],r=a.valueSort.levelName.split(this.engineModule.valueSortSettings.headerDelimiter).join(t),n=!1;if(0===this.dataSourceSettings.drilledMembers.length)this.parent.setProperties({dataSourceSettings:{drilledMembers:[{name:i,items:[r],delimiter:t}]}},!0);else{for(var s=0;s<this.dataSourceSettings.drilledMembers.length;s++){var o,l=this.dataSourceSettings.drilledMembers[s],r=r.split(t).join(l.delimiter||t),t=l.delimiter=l.delimiter||t;l.name===i&&(n=!0,-1<(o=l.items.indexOf(r))?l.items.splice(o,1):l.items.push(r))}n||this.dataSourceSettings.drilledMembers.push({name:i,items:[r],delimiter:t})}this.parent.showWaitingPopup();var d=this,e={fieldName:i,memberName:r,delimiter:t,axis:"row",action:e.isDrilled?"up":"down",currentCell:a},a={drillInfo:e,pivotview:d.parent},a=(d.parent.trigger(Oa,a),{dataSourceSettings:Ie.getClonedDataSourceSettings(this.parent.dataSourceSettings)}),a=(this.parent.trigger(ra,a),this.parent.setProperties({dataSourceSettings:a.dataSourceSettings},!0),d.parent.enableVirtualization||d.parent.enablePaging?"Server"===d.parent.dataSourceSettings.mode?d.parent.getEngine("onDrill",e,null,null,null,null,null):(d.engineModule.drilledMembers=d.dataSourceSettings.drilledMembers,d.engineModule.onDrill(e)):"Server"===d.parent.dataSourceSettings.mode?d.parent.getEngine("onDrill",e,null,null,null,null,null):d.engineModule.generateGridData(d.dataSourceSettings,!0),d.parent.allowServerDataBinding=!1,d.parent.setProperties({pivotValues:d.engineModule.pivotValues},!0),d.parent.allowServerDataBinding=!0,{dataSourceSettings:Ie.getClonedDataSourceSettings(this.parent.dataSourceSettings),pivotValues:this.parent.pivotValues});this.parent.trigger(na,a),d.engineModule.pivotValues=a.pivotValues,d.parent.renderPivotGrid()},d.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),s="",o=0;o<n.length;o++)t[o]&&t[o].uName&&(s=s+(""===s?"":this.dataSourceSettings.drilledMembers[a].delimiter)+(-1<t[o].uName.indexOf("[Measures]")?"[Measures]":t[o].uName));if(s===this.dataSourceSettings.drilledMembers[a].items[r]){i=!0;break}}return i},d.prototype.load=function(e){e.chart.zoomModule&&(e.chart.zoomModule.isZoomed=!0),this.parent.trigger(hr,e)},d.prototype.beforePrint=function(e){this.parent.trigger(Qa,e)},d.prototype.animationComplete=function(e){this.parent.trigger(Ya,e)},d.prototype.legendRender=function(e){this.parent.trigger(Ka,e)},d.prototype.textRender=function(e){this.parent.trigger(Xa,e)},d.prototype.pointRender=function(e){this.parent.trigger(Ja,e)},d.prototype.seriesRender=function(e){this.parent.trigger(Za,e)},d.prototype.chartMouseMove=function(e){this.parent.trigger($a,e)},d.prototype.chartMouseClick=function(e){this.parent.trigger(er,e)},d.prototype.pointMove=function(e){this.parent.trigger(tr,e)},d.prototype.chartMouseLeave=function(e){this.parent.trigger(ir,e)},d.prototype.chartMouseDown=function(e){this.parent.trigger(ar,e)},d.prototype.chartMouseUp=function(e){this.parent.trigger(rr,e)},d.prototype.dragComplete=function(e){this.parent.trigger(nr,e)},d.prototype.zoomComplete=function(e){this.parent.trigger(sr,e)},d.prototype.scrollStart=function(e){this.parent.trigger(or,e)},d.prototype.scrollEnd=function(e){this.parent.trigger(lr,e)},d.prototype.scrollChanged=function(e){this.parent.trigger(dr,e)},d.prototype.multiLevelLabelRender=function(e){this.parent.trigger(Wa,e)},d.prototype.resized=function(e){this.accumulationType.indexOf(this.chartSettings.chartSeries.type)<0&&(e.chart.primaryXAxis.zoomFactor=_e.isNullOrUndefined(this.parent.chartSettings.primaryXAxis.zoomFactor)?this.getZoomFactor():this.parent.chartSettings.primaryXAxis.zoomFactor,this.parent.chartSettings.zoomSettings.enableScrollbar||(e.chart.primaryXAxis.zoomFactor=_e.isNullOrUndefined(this.parent.chartSettings.primaryXAxis.zoomFactor)?1:this.parent.chartSettings.primaryXAxis.zoomFactor)),this.parent.trigger(pr,e)},d.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&&0<this.parent.dataSourceSettings.values.length?Number(this.parent.chart.height)>235*this.parent.dataSourceSettings.values.length+100?isNaN(Number(this.getChartHeight()))?this.getChartHeight():Number(this.getChartHeight())-5:!isNaN(Number(this.getChartHeight()))||1<this.parent.dataSourceSettings.values.length?235*this.parent.dataSourceSettings.values.length+100:this.getChartHeight():this.getChartHeight()).toString()},d.prototype.destroy=function(){if(!this.parent||!this.parent.isDestroyed){var e;if(this.accumulationMenu&&!this.accumulationMenu.isDestroyed&&(this.accumulationMenu.destroy(),this.accumulationMenu=null),_e.select("#"+this.parent.element.id+"_accumulationChart",document)&&_e.remove(_e.select("#"+this.parent.element.id+"_accumulationChart",document)),this.parent&&this.parent.chart&&!this.parent.chart.isDestroyed?(this.parent.chart.destroy(),this.parent.chart=null):this.parent&&!this.parent.chart&&(e=_e.select("#"+this.parent.element.id+"_chart",this.parent.element),_e.getInstance(e,y.Chart).destroy(),_e.remove(e)),this.chartElement&&(this.chartElement.parentNode&&this.chartElement.parentNode.removeChild(this.chartElement),this.chartElement=null),this.element&&(this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null),this.templateFn&&(this.templateFn=null),this.engineModule&&!this.parent.destroyEngine&&(this.engineModule.fieldList={},this.engineModule=null),this.chartSeries&&(this.chartSeries.length=0,this.chartSeries=null),this.columnGroupObject){for(var t in this.columnGroupObject)Object.prototype.hasOwnProperty.call(this.columnGroupObject,t)&&(this.columnGroupObject[t]=null);this.columnGroupObject=null}if(this.chartSeriesInfo){for(var t in this.chartSeriesInfo)Object.prototype.hasOwnProperty.call(this.chartSeriesInfo,t)&&(this.chartSeriesInfo[t]=null);this.chartSeriesInfo={},this.selectedLegend=null}if(this.headerColl){for(var t in this.headerColl)Object.prototype.hasOwnProperty.call(this.headerColl,t)&&(this.headerColl[t]=null);this.headerColl={}}if(this.measuresNames){for(var t in this.measuresNames)Object.prototype.hasOwnProperty.call(this.measuresNames,t)&&delete this.measuresNames[t];this.measuresNames={}}this.chartSettings=null,this.persistSettings=null,this.dataSourceSettings=null,this.currentColumn=null,this.currentMeasure=null,this.pivotIndex=null,this.measureList=null,this.maxLevel=0,this.measurePos=-1,this.accEmptyPoint=!1,this.isChartInitial=!0,this.calculatedWidth=null}};var al=d;function d(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}var rl,nl,o={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},sl={size:"14px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},ol={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},ll={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},dl={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},hl={size:"12px",fontWeight:"Regular",color:"#353535",fontStyle:"Normal",fontFamily:"Segoe UI"},h=(rl=function(e,t){return(rl=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])}))(e,t)},function(e,t){function i(){this.constructor=e}rl(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),p=function(e,t,i,a){var r,n=arguments.length,s=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(n<3?r(s):3<n?r(t,i,s):r(t,i))||s);return 3<n&&s&&Object.defineProperty(t,i,s),s},pl=(nl=_e.ChildProperty,h(ul,nl),p([_e.Property(!0)],ul.prototype,"enable",void 0),p([_e.Property(1e3)],ul.prototype,"duration",void 0),p([_e.Property(0)],ul.prototype,"delay",void 0),ul);function ul(){return null!==nl&&nl.apply(this,arguments)||this}cl=_e.ChildProperty,h(ml,cl),p([_e.Property(null)],ml.prototype,"value",void 0),p([_e.Property(null)],ml.prototype,"color",void 0),p([_e.Property("0")],ml.prototype,"dashArray",void 0);var cl,gl=ml;function ml(){return null!==cl&&cl.apply(this,arguments)||this}Sl=_e.ChildProperty,h(vl,Sl),p([_e.Property("Normal")],vl.prototype,"fontStyle",void 0),p([_e.Property("16px")],vl.prototype,"size",void 0),p([_e.Property("Normal")],vl.prototype,"fontWeight",void 0),p([_e.Property("")],vl.prototype,"color",void 0),p([_e.Property("Center")],vl.prototype,"textAlignment",void 0),p([_e.Property("Segoe UI")],vl.prototype,"fontFamily",void 0),p([_e.Property(1)],vl.prototype,"opacity",void 0),p([_e.Property("Trim")],vl.prototype,"textOverflow",void 0);var Sl,fl=vl;function vl(){return null!==Sl&&Sl.apply(this,arguments)||this}yl=_e.ChildProperty,h(Cl,yl),p([_e.Property(10)],Cl.prototype,"left",void 0),p([_e.Property(10)],Cl.prototype,"right",void 0),p([_e.Property(10)],Cl.prototype,"top",void 0),p([_e.Property(10)],Cl.prototype,"bottom",void 0);var yl,bl=Cl;function Cl(){return null!==yl&&yl.apply(this,arguments)||this}xl=_e.ChildProperty,h(Tl,xl),p([_e.Property("")],Tl.prototype,"color",void 0),p([_e.Property(1)],Tl.prototype,"width",void 0);var xl,wl=Tl;function Tl(){return null!==xl&&xl.apply(this,arguments)||this}Ml=_e.ChildProperty,h(Ol,Ml),p([_e.Property(0)],Ol.prototype,"x",void 0),p([_e.Property(0)],Ol.prototype,"y",void 0);var Ml,Dl=Ol;function Ol(){return null!==Ml&&Ml.apply(this,arguments)||this}Pl=_e.ChildProperty,h(El,Pl),p([_e.Property(0)],El.prototype,"series",void 0),p([_e.Property(0)],El.prototype,"point",void 0);var Pl,Nl=El;function El(){return null!==Pl&&Pl.apply(this,arguments)||this}Il=_e.ChildProperty,h(Ll,Il),p([_e.Complex({},wl)],Ll.prototype,"border",void 0),p([_e.Property("transparent")],Ll.prototype,"background",void 0),p([_e.Property(1)],Ll.prototype,"opacity",void 0),p([_e.Property(null)],Ll.prototype,"backgroundImage",void 0);var Il,Fl=Ll;function Ll(){return null!==Il&&Il.apply(this,arguments)||this}Al=_e.ChildProperty,h(kl,Al),p([_e.Property(!1)],kl.prototype,"enable",void 0),p([_e.Property("")],kl.prototype,"dashArray",void 0),p([_e.Complex({color:null,width:1},wl)],kl.prototype,"line",void 0),p([_e.Property("Both")],kl.prototype,"lineType",void 0);var Al,Rl=kl;function kl(){return null!==Al&&Al.apply(this,arguments)||this}jl=_e.ChildProperty,h(Hl,jl),p([_e.Property(!1)],Hl.prototype,"visible",void 0),p([_e.Property(null)],Hl.prototype,"name",void 0),p([_e.Property("transparent")],Hl.prototype,"fill",void 0),p([_e.Property(1)],Hl.prototype,"opacity",void 0),p([_e.Property(0)],Hl.prototype,"angle",void 0),p([_e.Property(!1)],Hl.prototype,"enableRotation",void 0),p([_e.Property("Auto")],Hl.prototype,"position",void 0),p([_e.Property(5)],Hl.prototype,"rx",void 0),p([_e.Property(5)],Hl.prototype,"ry",void 0),p([_e.Property("Center")],Hl.prototype,"alignment",void 0),p([_e.Complex({width:null,color:null},wl)],Hl.prototype,"border",void 0),p([_e.Complex({left:5,right:5,top:5,bottom:5},bl)],Hl.prototype,"margin",void 0),p([_e.Complex({size:"11px",color:"",fontStyle:"Normal",fontWeight:"Normal",fontFamily:"Segoe UI"},fl)],Hl.prototype,"font",void 0),p([_e.Property(null)],Hl.prototype,"template",void 0);var jl,ql=Hl;function Hl(){return null!==jl&&jl.apply(this,arguments)||this}Vl=_e.ChildProperty,h(_l,Vl),p([_e.Property("Line")],_l.prototype,"type",void 0),p([_e.Property(null)],_l.prototype,"color",void 0),p([_e.Property(1)],_l.prototype,"width",void 0),p([_e.Property(null)],_l.prototype,"length",void 0),p([_e.Property("")],_l.prototype,"dashArray",void 0);var Vl,Ul=_l;function _l(){return null!==Vl&&Vl.apply(this,arguments)||this}Bl=_e.ChildProperty,h(Gl,Bl),p([_e.Property(!0)],Gl.prototype,"visible",void 0),p([_e.Complex({width:null,color:null},wl)],Gl.prototype,"border",void 0),p([_e.Complex({size:"11px",color:"",fontStyle:"Normal",fontWeight:"Normal",fontFamily:"Segoe UI"},fl)],Gl.prototype,"font",void 0),p([_e.Property("transparent")],Gl.prototype,"fill",void 0),p([_e.Property(0)],Gl.prototype,"angle",void 0),p([_e.Property(!1)],Gl.prototype,"enableRotation",void 0),p([_e.Property("Outside")],Gl.prototype,"position",void 0),p([_e.Property(5)],Gl.prototype,"rx",void 0),p([_e.Property(5)],Gl.prototype,"ry",void 0),p([_e.Property(null)],Gl.prototype,"template",void 0),p([_e.Complex({},Ul)],Gl.prototype,"connectorStyle",void 0);var Bl,Ul=Gl;function Gl(){return null!==Bl&&Bl.apply(this,arguments)||this}zl=_e.ChildProperty,h(Wl,zl),p([_e.Property(!1)],Wl.prototype,"visible",void 0),p([_e.Property("Circle")],Wl.prototype,"shape",void 0),p([_e.Property("")],Wl.prototype,"imageUrl",void 0),p([_e.Property(5)],Wl.prototype,"width",void 0),p([_e.Property(5)],Wl.prototype,"height",void 0),p([_e.Complex({width:2,color:null},wl)],Wl.prototype,"border",void 0),p([_e.Complex({x:0,y:0},Dl)],Wl.prototype,"offset",void 0),p([_e.Property(null)],Wl.prototype,"fill",void 0),p([_e.Property(1)],Wl.prototype,"opacity",void 0),p([_e.Complex({},ql)],Wl.prototype,"dataLabel",void 0);var zl,Dl=Wl;function Wl(){return null!==zl&&zl.apply(this,arguments)||this}Ql=_e.ChildProperty,h(Kl,Ql),p([_e.Property(1)],Kl.prototype,"width",void 0),p([_e.Property(10)],Kl.prototype,"length",void 0),p([_e.Property(null)],Kl.prototype,"color",void 0),p([_e.Property(1)],Kl.prototype,"opacity",void 0);var Ql,Yl=Kl;function Kl(){return null!==Ql&&Ql.apply(this,arguments)||this}Xl=_e.ChildProperty,h(Jl,Xl),p([_e.Property(!1)],Jl.prototype,"visible",void 0),p([_e.Property("Fixed")],Jl.prototype,"type",void 0),p([_e.Property("Both")],Jl.prototype,"direction",void 0),p([_e.Property("Vertical")],Jl.prototype,"mode",void 0),p([_e.Property(1)],Jl.prototype,"verticalError",void 0),p([_e.Property(null)],Jl.prototype,"color",void 0),p([_e.Property(1)],Jl.prototype,"width",void 0),p([_e.Property(1)],Jl.prototype,"horizontalError",void 0),p([_e.Property(3)],Jl.prototype,"verticalNegativeError",void 0),p([_e.Property(3)],Jl.prototype,"verticalPositiveError",void 0),p([_e.Property(1)],Jl.prototype,"horizontalNegativeError",void 0),p([_e.Property(1)],Jl.prototype,"horizontalPositiveError",void 0),p([_e.Complex(null,Yl)],Jl.prototype,"errorBarCap",void 0);var Xl,c=Jl;function Jl(){return null!==Xl&&Xl.apply(this,arguments)||this}Zl=_e.ChildProperty,h(ed,Zl),p([_e.Property("")],ed.prototype,"name",void 0),p([_e.Property("0")],ed.prototype,"dashArray",void 0),p([_e.Property(!0)],ed.prototype,"visible",void 0),p([_e.Property(2)],ed.prototype,"period",void 0),p([_e.Property("Linear")],ed.prototype,"type",void 0),p([_e.Property(0)],ed.prototype,"backwardForecast",void 0),p([_e.Property(0)],ed.prototype,"forwardForecast",void 0),p([_e.Property(2)],ed.prototype,"polynomialOrder",void 0),p([_e.Complex({},Dl)],ed.prototype,"marker",void 0),p([_e.Property(!0)],ed.prototype,"enableTooltip",void 0),p([_e.Complex({},pl)],ed.prototype,"animation",void 0),p([_e.Property("")],ed.prototype,"fill",void 0),p([_e.Property(1)],ed.prototype,"width",void 0),p([_e.Property(null)],ed.prototype,"intercept",void 0),p([_e.Property("SeriesType")],ed.prototype,"legendShape",void 0);var Zl,$l=ed;function ed(){return null!==Zl&&Zl.apply(this,arguments)||this}td=_e.ChildProperty,h(ad,td),p([_e.Property(null)],ad.prototype,"fill",void 0),p([_e.Complex({color:"transparent",width:0},wl)],ad.prototype,"border",void 0),p([_e.Property("Zero")],ad.prototype,"mode",void 0);var td,id=ad;function ad(){return null!==td&&td.apply(this,arguments)||this}rd=_e.ChildProperty,h(sd,rd),p([_e.Property(0)],sd.prototype,"topLeft",void 0),p([_e.Property(0)],sd.prototype,"topRight",void 0),p([_e.Property(0)],sd.prototype,"bottomLeft",void 0),p([_e.Property(0)],sd.prototype,"bottomRight",void 0);var rd,nd=sd;function sd(){return null!==rd&&rd.apply(this,arguments)||this}od=_e.ChildProperty,h(dd,od),p([_e.Property(!1)],dd.prototype,"enable",void 0),p([_e.Property(null)],dd.prototype,"fill",void 0),p([_e.Complex(ol,fl)],dd.prototype,"textStyle",void 0);var od,ld=dd;function dd(){return null!==od&&od.apply(this,arguments)||this}hd=_e.ChildProperty,h(ud,hd),p([_e.Property(!0)],ud.prototype,"visible",void 0),p([_e.Property(!1)],ud.prototype,"startFromAxis",void 0),p([_e.Property(null)],ud.prototype,"start",void 0),p([_e.Property(null)],ud.prototype,"end",void 0),p([_e.Property(null)],ud.prototype,"size",void 0),p([_e.Property("#808080")],ud.prototype,"color",void 0),p([_e.Property(null)],ud.prototype,"dashArray",void 0),p([_e.Property("Auto")],ud.prototype,"sizeType",void 0),p([_e.Property(!1)],ud.prototype,"isRepeat",void 0),p([_e.Property(null)],ud.prototype,"repeatEvery",void 0),p([_e.Property(null)],ud.prototype,"repeatUntil",void 0),p([_e.Property(!1)],ud.prototype,"isSegmented",void 0),p([_e.Property(null)],ud.prototype,"segmentStart",void 0),p([_e.Property(null)],ud.prototype,"segmentEnd",void 0),p([_e.Property(null)],ud.prototype,"segmentAxisName",void 0),p([_e.Complex({color:"transparent",width:1},wl)],ud.prototype,"border",void 0),p([_e.Property("")],ud.prototype,"text",void 0),p([_e.Property(null)],ud.prototype,"rotation",void 0),p([_e.Property("Middle")],ud.prototype,"horizontalAlignment",void 0),p([_e.Property("Middle")],ud.prototype,"verticalAlignment",void 0),p([_e.Complex(hl,fl)],ud.prototype,"textStyle",void 0),p([_e.Property("Behind")],ud.prototype,"zIndex",void 0),p([_e.Property(1)],ud.prototype,"opacity",void 0);var hd,pd=ud;function ud(){return null!==hd&&hd.apply(this,arguments)||this}cd=_e.ChildProperty,h(md,cd),p([_e.Property("")],md.prototype,"color",void 0),p([_e.Property(1)],md.prototype,"width",void 0),p([_e.Property("Rectangle")],md.prototype,"type",void 0);var cd,gd=md;function md(){return null!==cd&&cd.apply(this,arguments)||this}Sd=_e.ChildProperty,h(vd,Sd),p([_e.Property(1)],vd.prototype,"width",void 0),p([_e.Property("")],vd.prototype,"dashArray",void 0),p([_e.Property(null)],vd.prototype,"color",void 0);var Sd,fd=vd;function vd(){return null!==Sd&&Sd.apply(this,arguments)||this}yd=_e.ChildProperty,h(Cd,yd),p([_e.Property(.7)],Cd.prototype,"width",void 0),p([_e.Property("")],Cd.prototype,"dashArray",void 0),p([_e.Property(null)],Cd.prototype,"color",void 0);var yd,bd=Cd;function Cd(){return null!==yd&&yd.apply(this,arguments)||this}xd=_e.ChildProperty,h(Td,xd),p([_e.Property(1)],Td.prototype,"width",void 0),p([_e.Property("")],Td.prototype,"dashArray",void 0),p([_e.Property(null)],Td.prototype,"color",void 0);var xd,wd=Td;function Td(){return null!==xd&&xd.apply(this,arguments)||this}Md=_e.ChildProperty,h(Od,Md),p([_e.Property(1)],Od.prototype,"width",void 0),p([_e.Property(5)],Od.prototype,"height",void 0),p([_e.Property(null)],Od.prototype,"color",void 0);var Md,Dd=Od;function Od(){return null!==Md&&Md.apply(this,arguments)||this}Pd=_e.ChildProperty,h(Ed,Pd),p([_e.Property(.7)],Ed.prototype,"width",void 0),p([_e.Property(5)],Ed.prototype,"height",void 0),p([_e.Property(null)],Ed.prototype,"color",void 0);var Pd,Nd=Ed;function Ed(){return null!==Pd&&Pd.apply(this,arguments)||this}Id=_e.ChildProperty,h(Ld,Id),p([_e.Property(0)],Ld.prototype,"x",void 0),p([_e.Property(0)],Ld.prototype,"y",void 0);var Id,Fd=Ld;function Ld(){return null!==Id&&Id.apply(this,arguments)||this}p([_e.Property("")],Ad.prototype,"color",void 0),p([_e.Property(1)],Ad.prototype,"width",void 0);function Ad(){}p([_e.Property(!0)],Rd.prototype,"enable",void 0),p([_e.Property(1e3)],Rd.prototype,"duration",void 0),p([_e.Property(0)],Rd.prototype,"delay",void 0);function Rd(){}p([_e.Property(null)],kd.prototype,"value",void 0),p([_e.Property(null)],kd.prototype,"color",void 0),p([_e.Property("0")],kd.prototype,"dashArray",void 0);function kd(){}p([_e.Property(!1)],jd.prototype,"visible",void 0),p([_e.Property("Circle")],jd.prototype,"shape",void 0),p([_e.Property("")],jd.prototype,"imageUrl",void 0),p([_e.Property(5)],jd.prototype,"height",void 0),p([_e.Property(5)],jd.prototype,"width",void 0),p([_e.Complex({width:2,color:null},wl)],jd.prototype,"border",void 0),p([_e.Property(null)],jd.prototype,"fill",void 0),p([_e.Property(1)],jd.prototype,"opacity",void 0),p([_e.Complex({},ql)],jd.prototype,"dataLabel",void 0);function jd(){}p([_e.Property(!1)],qd.prototype,"visible",void 0),p([_e.Property("Fixed")],qd.prototype,"type",void 0),p([_e.Property("Both")],qd.prototype,"direction",void 0),p([_e.Property("Vertical")],qd.prototype,"mode",void 0),p([_e.Property(null)],qd.prototype,"color",void 0),p([_e.Property(1)],qd.prototype,"verticalError",void 0),p([_e.Property(1)],qd.prototype,"width",void 0),p([_e.Property(1)],qd.prototype,"horizontalError",void 0),p([_e.Property(3)],qd.prototype,"verticalPositiveError",void 0),p([_e.Property(3)],qd.prototype,"verticalNegativeError",void 0),p([_e.Property(1)],qd.prototype,"horizontalPositiveError",void 0),p([_e.Property(1)],qd.prototype,"horizontalNegativeError",void 0),p([_e.Complex(null,Yl)],qd.prototype,"errorBarCap",void 0);function qd(){}p([_e.Property("")],Hd.prototype,"name",void 0),p([_e.Property("Linear")],Hd.prototype,"type",void 0),p([_e.Property(2)],Hd.prototype,"period",void 0),p([_e.Property(2)],Hd.prototype,"polynomialOrder",void 0),p([_e.Property(0)],Hd.prototype,"backwardForecast",void 0),p([_e.Property(0)],Hd.prototype,"forwardForecast",void 0),p([_e.Complex({},pl)],Hd.prototype,"animation",void 0),p([_e.Complex({},Dl)],Hd.prototype,"marker",void 0),p([_e.Property(!0)],Hd.prototype,"enableTooltip",void 0),p([_e.Property(null)],Hd.prototype,"intercept",void 0),p([_e.Property("")],Hd.prototype,"fill",void 0),p([_e.Property(1)],Hd.prototype,"width",void 0),p([_e.Property("SeriesType")],Hd.prototype,"legendShape",void 0);function Hd(){}p([_e.Property(null)],Vd.prototype,"fill",void 0),p([_e.Complex({color:"transparent",width:0},wl)],Vd.prototype,"border",void 0),p([_e.Property("Zero")],Vd.prototype,"mode",void 0);function Vd(){}p([_e.Property(0)],Ud.prototype,"topLeft",void 0),p([_e.Property(0)],Ud.prototype,"topRight",void 0),p([_e.Property(0)],Ud.prototype,"bottomLeft",void 0),p([_e.Property(0)],Ud.prototype,"bottomRight",void 0);function Ud(){}p([_e.Property("Normal")],_d.prototype,"fontStyle",void 0),p([_e.Property("16px")],_d.prototype,"size",void 0),p([_e.Property("Normal")],_d.prototype,"fontWeight",void 0),p([_e.Property("")],_d.prototype,"color",void 0),p([_e.Property("Center")],_d.prototype,"textAlignment",void 0),p([_e.Property("Segoe UI")],_d.prototype,"fontFamily",void 0),p([_e.Property(1)],_d.prototype,"opacity",void 0),p([_e.Property("Trim")],_d.prototype,"textOverflow",void 0);function _d(){}p([_e.Property(!1)],Bd.prototype,"enable",void 0),p([_e.Property(null)],Bd.prototype,"fill",void 0),p([_e.Complex(ol,fl)],Bd.prototype,"textStyle",void 0);function Bd(){}p([_e.Property(1)],Gd.prototype,"width",void 0),p([_e.Property(5)],Gd.prototype,"height",void 0),p([_e.Property(null)],Gd.prototype,"color",void 0);function Gd(){}p([_e.Property(1)],zd.prototype,"width",void 0),p([_e.Property("")],zd.prototype,"dashArray",void 0),p([_e.Property(null)],zd.prototype,"color",void 0);function zd(){}p([_e.Property(.7)],Wd.prototype,"width",void 0),p([_e.Property(5)],Wd.prototype,"height",void 0),p([_e.Property(null)],Wd.prototype,"color",void 0);function Wd(){}p([_e.Property(.7)],Qd.prototype,"width",void 0),p([_e.Property("")],Qd.prototype,"dashArray",void 0),p([_e.Property(null)],Qd.prototype,"color",void 0);function Qd(){}p([_e.Property(1)],Yd.prototype,"width",void 0),p([_e.Property("")],Yd.prototype,"dashArray",void 0),p([_e.Property(null)],Yd.prototype,"color",void 0);function Yd(){}p([_e.Property(!0)],Kd.prototype,"visible",void 0),p([_e.Property(!1)],Kd.prototype,"startFromAxis",void 0),p([_e.Property(null)],Kd.prototype,"start",void 0),p([_e.Property(null)],Kd.prototype,"end",void 0),p([_e.Property(null)],Kd.prototype,"size",void 0),p([_e.Property("#808080")],Kd.prototype,"color",void 0),p([_e.Property(null)],Kd.prototype,"dashArray",void 0),p([_e.Property("Auto")],Kd.prototype,"sizeType",void 0),p([_e.Property(!1)],Kd.prototype,"isRepeat",void 0),p([_e.Property(null)],Kd.prototype,"repeatEvery",void 0),p([_e.Property(null)],Kd.prototype,"repeatUntil",void 0),p([_e.Property(!1)],Kd.prototype,"isSegmented",void 0),p([_e.Property(null)],Kd.prototype,"segmentStart",void 0),p([_e.Property(null)],Kd.prototype,"segmentEnd",void 0),p([_e.Property(null)],Kd.prototype,"segmentAxisName",void 0),p([_e.Complex({color:"transparent",width:1},wl)],Kd.prototype,"border",void 0),p([_e.Property("")],Kd.prototype,"text",void 0),p([_e.Property(null)],Kd.prototype,"rotation",void 0),p([_e.Property("Middle")],Kd.prototype,"horizontalAlignment",void 0),p([_e.Property("Middle")],Kd.prototype,"verticalAlignment",void 0),p([_e.Complex(hl,fl)],Kd.prototype,"textStyle",void 0),p([_e.Property("Behind")],Kd.prototype,"zIndex",void 0),p([_e.Property(1)],Kd.prototype,"opacity",void 0);function Kd(){}p([_e.Property("")],Xd.prototype,"color",void 0),p([_e.Property(1)],Xd.prototype,"width",void 0),p([_e.Property("Rectangle")],Xd.prototype,"type",void 0);function Xd(){}p([_e.Complex({},wl)],Jd.prototype,"border",void 0),p([_e.Property("transparent")],Jd.prototype,"background",void 0),p([_e.Property(1)],Jd.prototype,"opacity",void 0);function Jd(){}p([_e.Property(!1)],Zd.prototype,"enable",void 0),p([_e.Property("")],Zd.prototype,"dashArray",void 0),p([_e.Complex({color:null,width:1},wl)],Zd.prototype,"line",void 0),p([_e.Property("Both")],Zd.prototype,"lineType",void 0);function Zd(){}p([_e.Property(!0)],$d.prototype,"visible",void 0),p([_e.Property(null)],$d.prototype,"height",void 0),p([_e.Property(null)],$d.prototype,"width",void 0),p([_e.Complex({x:0,y:0},Fd)],$d.prototype,"location",void 0),p([_e.Property("Auto")],$d.prototype,"position",void 0),p([_e.Property(8)],$d.prototype,"padding",void 0),p([_e.Property("Center")],$d.prototype,"alignment",void 0),p([_e.Complex(dl,fl)],$d.prototype,"textStyle",void 0),p([_e.Property(10)],$d.prototype,"shapeHeight",void 0),p([_e.Property(10)],$d.prototype,"shapeWidth",void 0),p([_e.Complex({},wl)],$d.prototype,"border",void 0),p([_e.Complex({left:0,right:0,top:0,bottom:0},bl)],$d.prototype,"margin",void 0),p([_e.Property(5)],$d.prototype,"shapePadding",void 0),p([_e.Property("transparent")],$d.prototype,"background",void 0),p([_e.Property(1)],$d.prototype,"opacity",void 0),p([_e.Property(!0)],$d.prototype,"toggleVisibility",void 0),p([_e.Property(null)],$d.prototype,"description",void 0),p([_e.Property(3)],$d.prototype,"tabIndex",void 0);function $d(){}p([_e.Property(0)],eh.prototype,"series",void 0),p([_e.Property(0)],eh.prototype,"point",void 0);function eh(){}p([_e.Property(10)],th.prototype,"left",void 0),p([_e.Property(10)],th.prototype,"right",void 0),p([_e.Property(10)],th.prototype,"top",void 0),p([_e.Property(10)],th.prototype,"bottom",void 0);function th(){}ih=_e.ChildProperty,h(g,ih),p([_e.Property(null)],g.prototype,"fill",void 0),p([_e.Property(null)],g.prototype,"endAngle",void 0),p([_e.Property(!1)],g.prototype,"explode",void 0),p([_e.Property(!1)],g.prototype,"explodeAll",void 0),p([_e.Property(null)],g.prototype,"explodeIndex",void 0),p([_e.Property(null)],g.prototype,"innerRadius",void 0),p([_e.Property("30%")],g.prototype,"explodeOffset",void 0),p([_e.Property(0)],g.prototype,"gapRatio",void 0),p([_e.Property("Value")],g.prototype,"groupMode",void 0),p([_e.Property(null)],g.prototype,"groupTo",void 0),p([_e.Property("20%")],g.prototype,"neckHeight",void 0),p([_e.Property("20%")],g.prototype,"neckWidth",void 0),p([_e.Property("Linear")],g.prototype,"pyramidMode",void 0),p([_e.Property([])],g.prototype,"palettes",void 0),p([_e.Property(0)],g.prototype,"startAngle",void 0),p([_e.Complex(null,pl)],g.prototype,"animation",void 0),p([_e.Complex(null,Ul)],g.prototype,"dataLabel",void 0),p([_e.Property("0")],g.prototype,"dashArray",void 0),p([_e.Property(1)],g.prototype,"width",void 0),p([_e.Property("X")],g.prototype,"segmentAxis",void 0),p([_e.Property("Line")],g.prototype,"drawType",void 0),p([_e.Property(!0)],g.prototype,"isClosed",void 0),p([_e.Collection([],gl)],g.prototype,"segments",void 0),p([_e.Property("")],g.prototype,"stackingGroup",void 0),p([_e.Complex({color:"transparent",width:0},wl)],g.prototype,"border",void 0),p([_e.Property(!0)],g.prototype,"visible",void 0),p([_e.Property(1)],g.prototype,"opacity",void 0),p([_e.Property("Line")],g.prototype,"type",void 0),p([_e.Complex(null,Dl)],g.prototype,"marker",void 0),p([_e.Complex(null,c)],g.prototype,"errorBar",void 0),p([_e.Property(!0)],g.prototype,"enableTooltip",void 0),p([_e.Collection([],$l)],g.prototype,"trendlines",void 0),p([_e.Property("")],g.prototype,"tooltipMappingName",void 0),p([_e.Property("SeriesType")],g.prototype,"legendShape",void 0),p([_e.Property(1)],g.prototype,"minRadius",void 0),p([_e.Property(null)],g.prototype,"selectionStyle",void 0),p([_e.Property("Natural")],g.prototype,"splineType",void 0),p([_e.Property(3)],g.prototype,"maxRadius",void 0),p([_e.Property(.5)],g.prototype,"cardinalSplineTension",void 0),p([_e.Property(null)],g.prototype,"columnWidth",void 0),p([_e.Complex(null,id)],g.prototype,"emptyPointSettings",void 0),p([_e.Complex(null,nd)],g.prototype,"cornerRadius",void 0),p([_e.Property(0)],g.prototype,"columnSpacing",void 0);var ih,ql=g;function g(){return null!==ih&&ih.apply(this,arguments)||this}ah=_e.ChildProperty,h(rh,ah),p([_e.Property("Rotate45")],rh.prototype,"labelIntersectAction",void 0),p([_e.Complex(o,fl)],rh.prototype,"labelStyle",void 0),p([_e.Property("")],rh.prototype,"title",void 0),p([_e.Property(null)],rh.prototype,"zoomFactor",void 0),p([_e.Complex({},ld)],rh.prototype,"crosshairTooltip",void 0),p([_e.Property("")],rh.prototype,"labelFormat",void 0),p([_e.Complex(sl,fl)],rh.prototype,"titleStyle",void 0),p([_e.Property(!1)],rh.prototype,"isIndexed",void 0),p([_e.Property(0)],rh.prototype,"plotOffset",void 0),p([_e.Property("Shift")],rh.prototype,"edgeLabelPlacement",void 0),p([_e.Property("BetweenTicks")],rh.prototype,"labelPlacement",void 0),p([_e.Property("Outside")],rh.prototype,"tickPosition",void 0),p([_e.Property(!1)],rh.prototype,"opposedPosition",void 0),p([_e.Property(!0)],rh.prototype,"visible",void 0),p([_e.Property("Outside")],rh.prototype,"labelPosition",void 0),p([_e.Property(0)],rh.prototype,"labelRotation",void 0),p([_e.Property(0)],rh.prototype,"minorTicksPerInterval",void 0),p([_e.Property(null)],rh.prototype,"maximum",void 0),p([_e.Property(null)],rh.prototype,"minimum",void 0),p([_e.Property(34)],rh.prototype,"maximumLabelWidth",void 0),p([_e.Property(null)],rh.prototype,"interval",void 0),p([_e.Complex({},Dd)],rh.prototype,"majorTickLines",void 0),p([_e.Property(!1)],rh.prototype,"enableTrim",void 0),p([_e.Complex({},fd)],rh.prototype,"majorGridLines",void 0),p([_e.Complex({},Nd)],rh.prototype,"minorTickLines",void 0),p([_e.Complex({},wd)],rh.prototype,"lineStyle",void 0),p([_e.Complex({},bd)],rh.prototype,"minorGridLines",void 0),p([_e.Property(!1)],rh.prototype,"isInversed",void 0),p([_e.Property(null)],rh.prototype,"description",void 0),p([_e.Property(0)],rh.prototype,"startAngle",void 0),p([_e.Property(100)],rh.prototype,"coefficient",void 0),p([_e.Collection([],pd)],rh.prototype,"stripLines",void 0),p([_e.Property(2)],rh.prototype,"tabIndex",void 0),p([_e.Complex({color:null,width:0,type:"Rectangle"},gd)],rh.prototype,"border",void 0);var ah,Yl=rh;function rh(){return null!==ah&&ah.apply(this,arguments)||this}nh=_e.ChildProperty,h(sh,nh),p([_e.Property(!1)],sh.prototype,"enableMarker",void 0),p([_e.Property(!0)],sh.prototype,"enable",void 0),p([_e.Property(null)],sh.prototype,"fill",void 0),p([_e.Property(!1)],sh.prototype,"shared",void 0),p([_e.Property(.75)],sh.prototype,"opacity",void 0),p([_e.Property(null)],sh.prototype,"header",void 0),p([_e.Property(null)],sh.prototype,"format",void 0),p([_e.Complex(ll,fl)],sh.prototype,"textStyle",void 0),p([_e.Property(null)],sh.prototype,"template",void 0),p([_e.Complex({color:"#cccccc",width:.5},wl)],sh.prototype,"border",void 0),p([_e.Property(!0)],sh.prototype,"enableAnimation",void 0);var nh,Fd=sh;function sh(){return null!==nh&&nh.apply(this,arguments)||this}oh=_e.ChildProperty,h(lh,oh),p([_e.Property("50%")],lh.prototype,"x",void 0),p([_e.Property("50%")],lh.prototype,"y",void 0);var oh,pl=lh;function lh(){return null!==oh&&oh.apply(this,arguments)||this}dh=_e.ChildProperty,h(hh,dh),p([_e.Property(!1)],hh.prototype,"enablePinchZooming",void 0),p([_e.Property(!0)],hh.prototype,"enableSelectionZooming",void 0),p([_e.Property(!1)],hh.prototype,"enableDeferredZooming",void 0),p([_e.Property(!1)],hh.prototype,"enableMouseWheelZooming",void 0),p([_e.Property("XY")],hh.prototype,"mode",void 0),p([_e.Property(["Zoom","ZoomIn","ZoomOut","Pan","Reset"])],hh.prototype,"toolbarItems",void 0),p([_e.Property(!0)],hh.prototype,"enableScrollbar",void 0),p([_e.Property(!1)],hh.prototype,"enablePan",void 0);var dh,Ul=hh;function hh(){return null!==dh&&dh.apply(this,arguments)||this}ph=_e.ChildProperty,h(m,ph),p([_e.Complex({},ql)],m.prototype,"chartSeries",void 0),p([_e.Complex({},Yl)],m.prototype,"primaryXAxis",void 0),p([_e.Complex({},Yl)],m.prototype,"primaryYAxis",void 0),p([_e.Property("")],m.prototype,"value",void 0),p([_e.Property("")],m.prototype,"columnHeader",void 0),p([_e.Property("-")],m.prototype,"columnDelimiter",void 0),p([_e.Property(!1)],m.prototype,"enableMultipleAxis",void 0),p([_e.Property("Stacked")],m.prototype,"multipleAxisMode",void 0),p([_e.Property(!1)],m.prototype,"enableScrollOnMultiAxis",void 0),p([_e.Property(!1)],m.prototype,"showMemberSeries",void 0),p([_e.Property(!1)],m.prototype,"showPointColorByMembers",void 0),p([_e.Complex({border:{color:null,width:.5},background:"transparent"},y.titleSettings)],m.prototype,"titleStyle",void 0),p([_e.Property("")],m.prototype,"title",void 0),p([_e.Complex({border:{color:null,width:.5},background:"transparent"},y.titleSettings)],m.prototype,"subTitleStyle",void 0),p([_e.Property("")],m.prototype,"subTitle",void 0),p([_e.Complex({color:"#DDDDDD",width:0},wl)],m.prototype,"border",void 0),p([_e.Complex({},bl)],m.prototype,"margin",void 0),p([_e.Complex({border:{color:null,width:.5},background:"transparent"},Fl)],m.prototype,"chartArea",void 0),p([_e.Property(null)],m.prototype,"background",void 0),p([_e.Property("Material")],m.prototype,"theme",void 0),p([_e.Property([])],m.prototype,"palettes",void 0),p([_e.Complex({},Rl)],m.prototype,"crosshair",void 0),p([_e.Complex({},Fd)],m.prototype,"tooltip",void 0),p([_e.Complex(null,pl)],m.prototype,"pieCenter",void 0),p([_e.Complex({},Ul)],m.prototype,"zoomSettings",void 0),p([_e.Property()],m.prototype,"legendSettings",void 0),p([_e.Property("None")],m.prototype,"selectionMode",void 0),p([_e.Property("None")],m.prototype,"accumulationSelectionMode",void 0),p([_e.Property(!0)],m.prototype,"enableSmartLabels",void 0),p([_e.Property(!0)],m.prototype,"enableBorderOnMouseMove",void 0),p([_e.Property("None")],m.prototype,"highlightMode",void 0),p([_e.Property("None")],m.prototype,"highlightPattern",void 0),p([_e.Property(!0)],m.prototype,"enableExport",void 0),p([_e.Property(!1)],m.prototype,"isMultiSelect",void 0),p([_e.Collection([],Nl)],m.prototype,"selectedDataIndexes",void 0),p([_e.Property(!0)],m.prototype,"enableAnimation",void 0),p([_e.Property(!1)],m.prototype,"enableCanvas",void 0),p([_e.Property(!0)],m.prototype,"useGroupingSeparator",void 0),p([_e.Property(!1)],m.prototype,"isTransposed",void 0),p([_e.Property(1)],m.prototype,"tabIndex",void 0),p([_e.Property(null)],m.prototype,"description",void 0),p([_e.Event()],m.prototype,"resized",void 0),p([_e.Property(!0)],m.prototype,"enableSideBySidePlacement",void 0),p([_e.Event()],m.prototype,"loaded",void 0),p([_e.Event()],m.prototype,"beforePrint",void 0),p([_e.Event()],m.prototype,"animationComplete",void 0),p([_e.Event()],m.prototype,"load",void 0),p([_e.Event()],m.prototype,"textRender",void 0),p([_e.Event()],m.prototype,"legendRender",void 0),p([_e.Event()],m.prototype,"seriesRender",void 0),p([_e.Event()],m.prototype,"multiLevelLabelRender",void 0),p([_e.Event()],m.prototype,"pointRender",void 0),p([_e.Event()],m.prototype,"tooltipRender",void 0),p([_e.Event()],m.prototype,"legendClick",void 0),p([_e.Event()],m.prototype,"axisLabelRender",void 0),p([_e.Event()],m.prototype,"multiLevelLabelClick",void 0),p([_e.Event()],m.prototype,"chartMouseClick",void 0),p([_e.Event()],m.prototype,"chartMouseMove",void 0),p([_e.Event()],m.prototype,"pointMove",void 0),p([_e.Event()],m.prototype,"pointClick",void 0),p([_e.Event()],m.prototype,"chartMouseDown",void 0),p([_e.Event()],m.prototype,"chartMouseLeave",void 0),p([_e.Event()],m.prototype,"dragComplete",void 0),p([_e.Event()],m.prototype,"chartMouseUp",void 0),p([_e.Event()],m.prototype,"scrollStart",void 0),p([_e.Event()],m.prototype,"zoomComplete",void 0),p([_e.Event()],m.prototype,"scrollChanged",void 0),p([_e.Event()],m.prototype,"scrollEnd",void 0),p([_e.Property(!0)],m.prototype,"showMultiLevelLabels",void 0);var ph,gl=m;function m(){return null!==ph&&ph.apply(this,arguments)||this}ch.getCellSets=function(e,t,i,a,r){this.engine=t,this.isMondrian=t.isMondrian,this.isMeasureAvail=t.isMeasureAvail,this.isPaging=t.isPaging,this.pageSettings=t.pageSettings,this.rows=t.rows,this.columns=t.columns,this.values=t.values,this.filters=t.filters,this.allowLabelFilter=t.allowLabelFilter,this.allowValueFilter=t.allowValueFilter,this.drilledMembers=t.updateDrilledItems(e.drilledMembers),this.calculatedFieldSettings=t.calculatedFieldSettings,this.valueAxis="row"===e.valueAxis?"rows":"columns",a&&(a.axis="row"===a.axis?"rows":"columns"),this.filterMembers=_e.extend({},t.filterMembers,null,!0),this.fieldDataObj=t.fieldListObj,this.fieldList=t.fieldList,this.cellSetInfo="\nDIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CHILDREN_CARDINALITY, MEMBER_TYPE, MEMBER_VALUE";var n=this.getMeasuresQuery(this.values),s=this.getDimensionsQuery(this.rows,n,"rows",a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""),n=this.getDimensionsQuery(this.columns,n,"columns",a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""),o=(this.isPaging&&i&&void 0!==this.pageSettings?(s=(o=this.getPagingQuery(s,n)).rowQuery,n=o.columnQuery):this.isPaging&&!i&&void 0!==this.pageSettings&&(s=(o=this.getPagingCountQuery(s,n)).rowQuery,n=o.columnQuery),s=0<s.length?s+(this.isPaging&&!i?"":this.cellSetInfo+" ON ROWS"):"",n=0<n.length?n+(this.isPaging&&!i?"":this.cellSetInfo+" ON COLUMNS"):"",this.getSlicersQuery(this.filters,"filters").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")),l=this.getfilterQuery(this.filterMembers,e.cube).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,"""),d=this.getCalculatedFieldQuery(this.calculatedFieldSettings).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,"""),s=this.frameMDXQuery(s,n,o,l,d,i),n={catalog:e.catalog,cube:e.cube,url:e.url,request:s,LCID:e.localeIdentifier.toString(),roles:e.roles};t.mdxQuery=s.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/%280/g,'"').replace(/'/g,"'"),a&&(a.axis="rows"===a.axis?"row":"column"),r||this.getTableCellData(n,(this.isPaging&&!i?this.engine.generatePagingData:this.engine.generateEngine).bind(this.engine),a?{action:a.action,drillInfo:a}:{dataSourceSettings:e,action:"loadTableElements"})},ch.getTableCellData=function(e,t,i){var a=this.engine.getConnectionInfo(e.url,e.LCID),e='<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,e,t,i),this.engine.errorInfo)throw this.engine.errorInfo},ch.frameMDXQuery=function(e,t,i,a,r,n){var s=this.isPaging&&!n?""!==r?"":"\nWITH":"\nSelect ";return 0<t.length&&(s+=t),s=r+(s=0<e.length?s+(!(0<t.length)||this.isPaging&&!n?"":", ")+e:s)+(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"},ch.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,s=this.engine.isExporting&&this.engine.exportSpeciedPages&&this.engine.exportSpeciedPages.columnSize?this.engine.exportSpeciedPages.columnSize:3*this.pageSettings.columnPageSize,a=this.engine.rowCount<a+n?this.engine.rowCount>n?this.engine.rowCount-n:0:a;return this.engine.pageRowStartPos=a,r=this.engine.columnCount<r+s?this.engine.columnCount>s?this.engine.columnCount-s: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+","+s+")":""}},ch.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":""}},ch.getDimensionsQuery=function(e,t,i,a){var r="";if(0<e.length){for(var r="\nNON EMPTY ( "+(0<this.drilledMembers.length?"HIERARCHIZE ({":""),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 s=this.getDrillQuery(e,t,i,a),s=(r=a&&a.axis===i?"\nNON EMPTY ( "+(0<this.drilledMembers.length?"HIERARCHIZE ({":"")+s.query:r+(""!==s.query?",":"")+s.query,this.getAttributeDrillQuery(e,t,i,a));r=r+(this.isPaging?(""!==s?"-":"")+s:"")+(0<this.drilledMembers.length?"})":"")+(this.isPaging?"":(""!==s?"-":"")+s)+")"}return r},ch.getAttributeDrillQuery=function(e,t,i,a){for(var r="",n=[],n=a&&a.axis===i&&"down"===a.action.toLowerCase()?[{name:a.fieldName,items:[a.memberName],delimiter:"~~"}]:this.drilledMembers,s=i===this.valueAxis?this.getMeasurePos(i):0,o=0,l=n;o<l.length;o++){var d=l[o];if(!!this.engine.fieldList[d.name]&&this.engine.fieldList[d.name].isHierarchy)for(var h=0,p=d.items;h<p.length;h++){for(var u=p[h],c=[],g=u.split(d.delimiter||"~~"),m=this.getDrillLevel(e,g),S=this.getDimensionPos(i,d.name),f=e.length-(S<s?1:0),v=!!this.isPaging&&this.isAttributeMemberExist(d.name,u.split(d.delimiter||"~~"),d.delimiter,g,i);0<m.level&&m.isDrill&&S+1!==s&&!v;){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&&b<f),e[b].isNamedSet,e[b].isCalculatedField,m.level,!1))}b++}0<y.length&&c.push("("+y.join("*")+")"),m.level--,f--}0<c.length&&(r=r+(""!==r?"-":"")+c.join(this.isPaging?"+":"-"))}}return r},ch.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},ch.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},ch.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,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,r++;return{level:this.isPaging?2:i,isDrill:a}},ch.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)"},ch.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 s=this.getDimensionPos(r,e),o=0;o<this.drilledMembers.length;o++)if(e!==this.drilledMembers[o].name)if(!!this.engine.fieldList[this.drilledMembers[o].name]&&this.engine.fieldList[this.drilledMembers[o].name].isHierarchy)for(var l=this.getDimensionPos(r,this.drilledMembers[o].name),d=0;d<this.drilledMembers[o].items.length;d++){var h=this.getDrillLevel("rows"===r?this.rows:this.columns,this.drilledMembers[o].items[d].split(this.drilledMembers[o].delimiter||"~~"));if((!this.isPaging||l<s&&h.isDrill)&&(0===this.drilledMembers[o].items[d].indexOf(t.join(i))||0===t.join(i).indexOf(this.drilledMembers[o].items[d]))){n=!0;break}}return n},ch.getDrillQuery=function(e,t,i,a){for(var r="",n=[],s=!1,o="",l=0,d=a&&a.axis===i&&"down"===a.action.toLowerCase()?(s=!0,[{name:a.fieldName,items:[a.memberName],delimiter:"~~"}]):this.drilledMembers;l<d.length;l++){var h=d[l];if(!(!!this.engine.fieldList[h.name]&&this.engine.fieldList[h.name].isHierarchy))for(var p=0,u=h.items;p<u.length;p++){for(var c,g=u[p],m=[],S=[],f=0,v=g.split(h.delimiter||"~~"),y=this.isAttributeMemberExist(h.name,g.split(h.delimiter||"~~"),h.delimiter||"~~",v,i);f<e.length&&!y;){if(v[f]&&-1!==v[f].indexOf(e[f].name))-1!==v[v.length-1].indexOf(e[f].name)?s?o=o+(""!==o?" * ":"")+"({"+v[f]+".CHILDREN})":(m.push("("+v[f]+".CHILDREN)"),S.push("("+v[f]+")")):"[measures]"===v[f].toLowerCase()&&""!==t?s?o=o+(""!==o?" * ":"")+"("+t+")":(m.push("("+t+")"),S.push("("+t+")")):-1!==v[f].toLowerCase().indexOf("[measures]")?s?o=o+(""!==o?" * ":"")+"({"+v[f]+"})":(m.push("({"+v[f]+"})"),S.push("({"+v[f]+"})")):s?o=o+(""!==o?" * ":"")+"({"+v[f]+"})":(m.push("("+v[f]+")"),S.push("("+v[f]+")"));else{if(v[f]||!e[f]){m=[];break}"[measures]"===e[f].name.toLowerCase()&&""!==t?s?o=o+(""!==o?" * ":"")+"("+t+")":(m.push("("+t+")"),S.push("("+t+")")):(c=this.getDimensionQuery(e[f],i),s?o=o+(""!==o?" * ":"")+"({"+c+"})":(m.push("("+c+")"),S.push("("+c+")")))}f++}0<m.length&&m.length<v.length&&(m=[],S=[]),r=r+(""!==r&&0<m.length?",":"")+(0<m.length?"("+m.toString()+")":""),0<S.length&&n.push("("+S.toString()+")")}}return{query:s?o:r,collection:s?[o]:n}},ch.getSlicersQuery=function(i,e){var a=this,t="",r=(r=_e.extend([],this.rows,null,!0)).concat(this.columns);if(0<i.length){for(var n=0;n<i.length;)0<r.filter(function(e){var e=a.getDimensionUniqueName(e.name),t=a.getDimensionUniqueName(i[n].name);return e===t&&!(a.isMondrian&&""===t&&""===e)}).length||(void 0===i[n].name||this.filterMembers[i[n].name]?this.filterMembers[i[n].name]&&(t=t+(""!==t?" * ":"")+"{"+this.filterMembers[i[n].name].toString()+"}"):t=t+(""!==t?" * ":"")+"{"+this.getDimensionQuery(i[n],e)+"}"),n++;t=""===t?"":"\nWHERE ("+t.replace(/DrilldownLevel/g,"")+")"}return t},ch.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)"},ch.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 0<i.length?i[0].pid:""}return e.split(".")[0]},ch.getMeasuresQuery=function(e){var t="";if(0<e.length){for(var t="{{",i="",a=0,r=e;a<r.length;a++)var n=r[a],n=n.isCalculatedField?this.fieldList[n.name].tag:n.name,i=0<i.length?i+", "+n:n;t=t+i+"}}"}return t},ch.getfilterQuery=function(e,t){for(var t="\nFROM ["+t+"]",i="\nFROM( SELECT (",a=[],r=[],n=[],s=[],o=0,l=this.rows;o<l.length;o++)e[(g=l[o]).name]&&0<e[g.name].length&&("string"==typeof e[g.name][0]?n.push(e[g.name]):(e[g.name][1]=e[g.name][0].type,a.push(e[g.name]),delete e[g.name]));for(var d,h=0,p=this.columns;h<p.length;h++)e[(g=p[h]).name]&&0<e[g.name].length&&("string"==typeof e[g.name][0]?s.push(e[g.name]):((d=e[g.name])[1]=d[0].type,a.push(e[g.name]),delete e[g.name]));for(var u=0,c=this.filters;u<c.length;u++){for(var g=c[u],m=!1,S=0,f=this.columns;S<f.length;S++){var v=f[S];m||this.getDimensionUniqueName(v.name)!==this.getDimensionUniqueName(g.name)||e[g.name]&&(s.push(e[g.name]),m=!0)}if(!m)for(var y=0,b=this.rows;y<b.length;y++){var C=b[y];m||this.getDimensionUniqueName(C.name)!==this.getDimensionUniqueName(g.name)||e[g.name]&&(n.push(e[g.name]),m=!0)}}if((this.allowLabelFilter||this.allowValueFilter)&&0<a.length)for(var x=0,w=["Value","Label"];x<w.length;x++)for(var T=w[x],M=0,D=a;M<D.length;M++){var O=D[M];O&&2===O.length&&"string"==typeof O[1]&&O[1]===T&&r.push(this.getAdvancedFilterQuery(O[0],i,"COLUMNS"))}for(var P=0,N=s.length;P<N;P++)i=0===P?i+"{"+s[P].toString()+"}":i+",{"+s[P].toString()+"}";0<s.length&&(i=0<n.length?i+" ) ON COLUMNS ,(":i+" ) ON COLUMNS");for(P=0,N=n.length;P<N;P++)i=0<P?i+",{"+n[P].toString()+"}":i+"{"+n[P].toString()+"}";var i=0<s.length&&0<n.length?i+") ON ROWS ":0===s.length&&0<n.length?i+") ON COLUMNS ":i,E="";return 0<(E=0<r.length?r.join(" ")+" "+(0<s.length||0<n.length?i:"")+" "+t+Array(r.length+1+(0<s.length||0<n.length?1:0)).join(")"):E).length?E:0===s.length&&0===n.length?t:i+t+")"},ch.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},ch.getAdvancedFilterCondtions=function(e,t,i,a,r,n){var s="";switch(t){case"Equals":s="("+("Value"!==r?e+'.CurrentMember.member_caption ="'+i+'"':n+" = "+i);break;case"DoesNotEquals":s="("+("Value"!==r?e+'.CurrentMember.member_caption <>"'+i+'"':n+" <>"+i);break;case"Contains":s="( InStr (1,"+e+'.CurrentMember.member_caption,"'+i+'") >0';break;case"DoesNotContains":s="( InStr (1,"+e+'.CurrentMember.member_caption,"'+i+'")=0';break;case"BeginWith":s="( Left ("+e+".CurrentMember.member_caption,"+i.length+')="'+i+'"';break;case"DoesNotBeginWith":s="( Left ("+e+".CurrentMember.member_caption,"+i.length+') <>"'+i+'"';break;case"EndsWith":s="( Right ("+e+".CurrentMember.member_caption,"+i.length+')="'+i+'"';break;case"DoesNotEndsWith":s="( Right ("+e+".CurrentMember.member_caption,"+i.length+') <>"'+i+'"';break;case"GreaterThan":s="("+("Value"!==r?e+'.CurrentMember.member_caption >"'+i+'"':n+" >"+i);break;case"GreaterThanOrEqualTo":s="("+("Value"!==r?e+'.CurrentMember.member_caption >="'+i+'"':n+" >="+i);break;case"LessThan":s="("+("Value"!==r?e+'.CurrentMember.member_caption <"'+i+'"':n+" <"+i);break;case"LessThanOrEqualTo":s="("+("Value"!==r?e+'.CurrentMember.member_caption <="'+i+'"':n+" <="+i);break;case"Between":s="("+("Value"!==r?e+'.CurrentMember.member_caption >="'+i+'"AND '+e+'.CurrentMember.member_caption <="'+a+'"':n+" >="+i+" AND "+n+" <="+a);break;case"NotBetween":s="("+("Value"!==r?e+'.CurrentMember.member_caption >="'+i+'"OR '+e+'.CurrentMember.member_caption <="'+a+'"':n+" >="+i+" OR "+n+" <="+a);break;default:s="( InStr (1,"+e+'.CurrentMember.member_caption,"'+i+'") >0'}return s},ch.getCalculatedFieldQuery=function(e){var t="";if(0<e.length)for(var t="\nWITH",i=0,a=e;i<a.length;i++){var r=a[i],n=(-1<r.formula.indexOf("Measure")?"[Measures].":r.hierarchyUniqueName+".")+"["+r.name+"]",s=_e.isNullOrUndefined(r.formatString)?null:r.formatString;t+="\nMEMBER "+n+"as ("+r.formula+") "+(_e.isNullOrUndefined(s)?"":', FORMAT_STRING ="'+s.trim()+'"')}return t};var uh=ch;function ch(){}S.prototype.renderEngine=function(e,t,i){this.isEmptyData=!1,this.getHeaderSortInfo=i,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 _e.Internationalization,this.locale=this.globalize.culture||"en-US",this.localeObj=t?t.localeObj:void 0,this.enableValueSorting=!!t&&t.enableValueSorting,e.url&&(this.dataSourceSettings=e,this.measureIndex=_e.isNullOrUndefined(e.valueIndex)?-1:e.valueIndex,this.valueAxis="row"===e.valueAxis?"row":"column",this.getAxisFields(),this.formats=e.formatSettings||[],this.enableSort=void 0===e.enableSorting||e.enableSorting,this.valueSortSettings=e.valueSortSettings||void 0,this.filterSettings=e.filterSettings||[],this.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||[],this.emptyCellTextContent=e.emptyCellsTextContent||"",this.pageSettings=t?t.pageSettings||this.pageSettings:void 0,this.isPaging=!(!this.pageSettings||!t.enablePaging&&!t.enableVirtualization),this.frameSortObject(),this.getFormattedFields(this.formats),this.savedFieldList=t?t.savedFieldList:void 0,this.savedFieldListData=t?t.savedFieldListData:void 0,this.fieldListData=[],this.fieldListObj={},this.setNamedSetsPosition(),this.savedFieldList&&0<Object.keys(this.savedFieldList).length&&this.savedFieldListData?this.updateFieldlist(!0):(this.getCubes(e),this.getFieldList(e)),this.loadCalculatedMemberElements(this.calculatedFieldSettings),i=this.getMeasureInfo(),this.olapVirtualization=this.isPaging&&e.showSubTotals&&i.measureIndex===("column"===i.measureAxis?e.columns.length-1:e.rows.length-1)&&!_e.isNullOrUndefined(this.pageSettings)&&e.showGrandTotals,this.isPaging=this.isPaging&&!this.olapVirtualization,this.measureReportItems=[],this.updateFilterItems(this.filterSettings),this.generateGridData(e))},S.prototype.generateGridData=function(e,t){t=!(!t||"navPaging"!==t||!this.isPaging||void 0===this.pageSettings);0<this.rows.length||0<this.columns.length||0<this.values.length||0<this.filters.length?uh.getCellSets(e,this,t):(uh.getCellSets(e,this,!0,void 0,!0),this.generateEngine(void 0,void 0,{dataSourceSettings:e,action:"loadTableElements"}))},S.prototype.generatePagingData=function(e,t,i){e=[].slice.call(e.querySelectorAll("Axes, CellData")),e=e[1]?e[1].querySelectorAll("FmtValue"):null,e&&0<e.length&&(this.columnCount=Number(e[0].textContent),this.rowCount=Number(e[1].textContent)),e=i.dataSourceSettings;uh.getCellSets(e,this,!0)},S.prototype.scrollPage=function(){var e;this.olapVirtualization?((e=this.getVirtualScrollingData(this.clonedColumnTuple,this.clonedRowTuple)).isCalculated&&(this.pivotValues=[],this.clearEngineProperties(),this.performEngine(e.columnTuple,e.rowTuple,e.valueTuple)),this.pivotValues=this.pivotValues.slice()):uh.getCellSets(this.dataSourceSettings,this,!0)},S.prototype.getVirtualScrollingData=function(e,t){var i,a,r,n,s,o,l,d,h,p,u,c=this.clonedValTuple.slice(),g=!1,m=(this.pageSettings.currentColumnPage-1)*this.pageSettings.columnPageSize,S=(this.pageSettings.currentRowPage-1)*this.pageSettings.rowPageSize,f=3*this.pageSettings.columnPageSize,v=3*this.pageSettings.rowPageSize,m=this.columnCount<m+f?this.columnCount>f?this.columnCount-f:0:m,S=this.rowCount<S+v?this.rowCount>v?this.rowCount-v:0:S;return m===this.pageColStartPos&&S===this.pageRowStartPos&&e.length<=f&&t.length<=v||(g=!0,n=this.getMeasureInfo(),l=!_e.isNullOrUndefined(e[0])&&0===Number(e[0].querySelectorAll("Member")[0].querySelector("LNum").textContent)&&e[0].querySelectorAll("Member")[0].querySelector("MEMBER_VALUE").textContent.startsWith("All"),i=!_e.isNullOrUndefined(t[0])&&0===Number(t[0].querySelectorAll("Member")[0].querySelector("LNum").textContent)&&t[0].querySelectorAll("Member")[0].querySelector("MEMBER_VALUE").textContent.startsWith("All"),o=!!l&&m+f>=e.length-1,a=!!i&&S+v>=t.length-1,r=l?this.getAxisdepth(e):"column"===n.measureAxis?n.valueInfo.length:1,n=i?this.getAxisdepth(t):"row"===n.measureAxis?n.valueInfo.length:1,d=(i?n:0)+S,h=e.slice(l=(l?r:0)+m,l+f),p=t.slice(d,d+v),s=h[0]?Number(h[0].querySelectorAll("Member")[0].querySelector("LNum").textContent):0,u=p[0]?Number(p[0].querySelectorAll("Member")[0].querySelector("LNum").textContent):0,s=this.getVirtualTotals(e.slice(0,l),s,o,"column",r),o=this.getVirtualTotals(t.slice(0,d),u,a,"row",n),l=h.length+s.totalsCollection.length>f?Math.max(h.length+s.totalsCollection.length-f):0,d=p.length+o.totalsCollection.length>v?Math.max(p.length+o.totalsCollection.length-v):0,h=s.totalsCollection.concat(h.slice(l,h.length)),p=o.totalsCollection.concat(p.slice(d,p.length)),u=this.getVirtualValues(c,m+l,S+d,f,v,s.indexCollection,o.indexCollection,e.length,t.length,r,n,i),e=h.slice(),t=p.slice(),c=u.slice()),this.pageColStartPos=m,this.pageRowStartPos=S,{columnTuple:e,rowTuple:t,valueTuple:c,isCalculated:g}},S.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},S.prototype.getVirtualTotals=function(e,t,i,a,r){var n=[],s=[];if(1!==t)for(var o=e.length-1;0<o;o--){var l=Number(e[o].querySelectorAll("Member")[0].querySelector("LNum").textContent);if(0===l)break;if(l<t)if(t=l,Number(e[o-1].querySelectorAll("Member")[0].querySelector("LNum").textContent)===l){for(var d=0;d<r;d++)n[n.length]=e[o-d],s[s.length]=o-d;o=1<r?o-(r-1):o}else n[n.length]=e[o],s[s.length]=o;else if(1===l)break}if(i)for(o=r;0<o;o--)n=n.concat([e[o-1]]),s=s.concat([o-1]);return{totalsCollection:n.reverse(),indexCollection:s.reverse()}},S.prototype.getVirtualValues=function(e,t,i,a,r,n,s,o,l,d,h,p){var u=[],c=e;if(r<l){for(var l=((p?h:0)+i)*o,c=e.slice(l,l+r*o),g=[],m=0;m<s.length;m++)g=g.concat(e.slice(s[m]*o,s[m]*o+o));c=g.concat(c)}for(var m=0,S=c.length/o;m<S;m++){for(var f=c.slice(m*o,m*o+o),v=f.slice(t+d,t+d+a),y=[],b=0;b<n.length;b++)y[y.length]=f[n[b]];u=u.concat(y.concat(v))}return u},S.prototype.generateEngine=function(e,t,i){"down"!==i.action&&this.clearEngineProperties(),this.xmlDoc=e?e.cloneNode(!0):void 0,this.request=t,this.customArgs=i,this.parentObjCollection={},this.curDrillEndPos=-1,this.onDemandDrillEngine=[],this.getSubTotalsVisibility(),this.xmlaCellSet=e?e.querySelectorAll("Axes, CellData"):void 0;var t=this.xmlaCellSet&&0<this.xmlaCellSet.length?[].slice.call(this.xmlaCellSet[0].querySelectorAll('Axis[name|="Axis0"] Tuple')):[],i=this.xmlaCellSet&&0<this.xmlaCellSet.length?[].slice.call(this.xmlaCellSet[0].querySelectorAll('Axis[name|="Axis1"] Tuple')):[],a=this.xmlaCellSet&&1<this.xmlaCellSet.length?[].slice.call(this.xmlaCellSet[1].querySelectorAll("Cell")):[];if(this.olapVirtualization&&!_e.isNullOrUndefined(this.pageSettings)){if(t.length*i.length!==a.length){for(var r=[],n=0;n<a.length;n++)_e.isNullOrUndefined(a[n])||(r[Number(a[n].getAttribute("CellOrdinal"))]=a[n]);a=r}this.clonedValTuple=a;var e=this.getDrillInfo("columns"),s=this.getActualTuples(t,e),e=this.getDrillInfo("rows"),e=this.getActualTuples(i,e,s.indexColls,t.length),s=(this.clonedColumnTuple=s.tupColls,this.clonedRowTuple=e.tupColls,this.columnCount=this.clonedColumnTuple.length,this.rowCount=this.clonedRowTuple.length,this.getVirtualScrollingData(this.clonedColumnTuple,this.clonedRowTuple));this.performEngine(s.columnTuple,s.rowTuple,s.valueTuple)}else this.performEngine(t,i,a)},S.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})),0<i.length)for(var a=0,r=this.drilledMembers.length;a<r;a++){var n=this.drilledMembers[a],s=i.indexOf(n.name);-1<s&&(t[s]||(t[s]=[]),t[s]=t[s].concat(n.items))}return t},S.prototype.getActualTuples=function(u,c,g,m){var t,S=[],f=[],v=[];if(0<u.length)for(var y=this,e=0,i=u.length;e<i;e++)!function(e){for(var t,i=u[e],a=!0,r=!1,n=!1,s=i.getElementsByTagName("MEMBER_TYPE"),o=i.getElementsByTagName("UName"),l=0,d=s.length;l<d;l++){var h=Number(s[l].textContent),p=o[l].textContent;if(n&&h<2?a=!1:2===h?r=!0:r&&h<2&&(a=!1),c[l]&&-1<c[l].indexOf(p)&&(n=!0),!a)break}a&&(S[S.length]=i,g?(t=y.clonedValTuple.slice(e*m,e*m+m),v=v.concat(g.map(function(e){return t[e]}))):f[f.length]=e)}(e);else g&&(t=this.clonedValTuple.slice(0,m),v=v.concat(g.map(function(e){return t[e]})));return 0<v.length&&(this.clonedValTuple=v),{tupColls:S,indexColls:f}},S.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},S.prototype.performEngine=function(e,t,i){this.totalCollection=[];for(var a,r,n,s=this.getMeasureInfo(),o=(0<this.drilledMembers.length&&(r=void 0,a=e.length&&t.length?e.length*t.length:e.length||t.length,e=(r=this.frameMeasureOrder(s,"column",e,i,e.length,a)).orderedHeaderTuples,i=r.orderedValueTuples,t=(r=this.frameMeasureOrder(s,"row",t,i,e.length,a)).orderedHeaderTuples,i=r.orderedValueTuples),"down"===this.customArgs.action&&this.updateTupCollection(("row"===this.customArgs.drillInfo.axis?t:e).length),{}),l=0;l<i.length;l++)_e.isNullOrUndefined(i[l])||(o[this.olapVirtualization?l:Number(i[l].getAttribute("CellOrdinal"))]=i[l]);if(this.valueSortSettings.columnIndex=void 0,this.enableValueSorting&&this.valueSortSettings&&!this.isPaging&&!this.olapVirtualization&&(n=this.getValueSortInfo(e,t,s)),"down"===this.customArgs.action&&"column"!==this.customArgs.drillInfo.axis||(this.frameColumnHeader(e),this.isPaging)||this.olapVirtualization||this.performColumnSorting(o,n),"down"===this.customArgs.action&&"row"!==this.customArgs.drillInfo.axis||(this.frameRowHeader(t),this.isPaging)||this.olapVirtualization||this.performRowSorting(o,n),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},S.prototype.getValueSortInfo=function(e,t,i){if(this.valueSortSettings.headerText){for(var a,r,n=this.valueSortSettings.headerText.split(this.valueSortSettings.headerDelimiter),s=n.indexOf("Grand Total"),o=(-1<s&&(a=n.join("").split(n[s]).join(""),(n=[])[i.measureIndex]=a),""),l=i.measureIndex,d=0;d<this.dataSourceSettings.values.length;d++)if(l=n.indexOf(this.dataSourceSettings.values[d].caption),this.dataSourceSettings.values[d].caption===n[l]){n[l]=this.fieldList[this.dataSourceSettings.values[d].name].name,o=n[l];break}-1!==l&&(l<i.measureIndex&&(n=this.reArrangeHeaders(n,i.measureIndex,o)),0<(a="column"===this.olapValueAxis?e:t).length)&&(r=a[0].getElementsByTagName("Member").length-(-1<s?l:0),r=this.getParentElement(a,n,r,i.measureIndex,o,-1<s)[0],r=a.indexOf(r))}return{memberIndex:r,columnLength:e.length,rowLength:t.length,isValueSorting:-1<r}},S.prototype.getParentElement=function(e,t,i,a,r,n){for(var s=[],o=0,l=!1,d=!1,h=e[0].getElementsByTagName("Member").length-i,p=0;p<e.length;p++){if(_e.isNullOrUndefined(e[p].getElementsByTagName("Member")[h])){s=[];break}var u=e[p].getElementsByTagName("UName")[h].textContent,c=e[p].getElementsByTagName("Caption")[h].textContent,g=Number(e[p].getElementsByTagName("LNum")[h].textContent),u=u===t[h]||c===t[h]||_e.isNullOrUndefined(t[h])&&0===g;if(u){if(s[s.length]=e[p],l=!0,o=g,n)break}else{if(l&&o<g){for(var m=[],S=p;S<e.length;S++){var f=e[S].getElementsByTagName("UName")[h].textContent,v=e[S].getElementsByTagName("Caption")[h].textContent,y=Number(e[S].getElementsByTagName("LNum")[h].textContent),f=f===t[1+h]||v===t[1+h]||_e.isNullOrUndefined(t[1+h])&&0===y;if(o+1===y&&f)m[m.length]=e[S],d=!0;else if(o+1<y){if(!d)break;m[m.length]=e[S]}else if(y<o+1)break}d&&((c=t.slice(0,h).concat(t.slice(1+h,t.length))).indexOf(r)<a&&(c=this.reArrangeHeaders(c,a,r)),s=this.getParentElement(m,c,m[0].getElementsByTagName("Member").length,a,r));break}if(l&&!u)break}}return n||h<t.length-1&&0<s.length&&!d&&(s=this.getParentElement(s,t,i-1,a,r)),s},S.prototype.reArrangeHeaders=function(e,t,i){var i=e.indexOf(i),a=e.slice(0,i),r=e.slice(i+1,e.length);return a[t]=e[i],a.concat(r)},S.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)}while(++e<3)},S.prototype.frameRowHeader=function(e){for(var t,i,a,r=this,k=(this.headerGrouping={},this.lastLevel=[],!0),n=this.pivotValues.length,s=[],o=[],l=("down"!==this.customArgs.action?(s=this.pivotValues,o=this.valueContent):n=this.customArgs.drillInfo.currentCell.rowIndex+1,this.rowStartPos=0<this.rowStartPos?this.rowStartPos:n,0),d=[],h={},j=[],p=!1,u=-1,c=-1,g=[],m=[{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"}}],q=[],H=this.customArgs.drillInfo&&"row"===this.customArgs.drillInfo.axis?this.customArgs.drillInfo.currentCell.ordinal+1:0;l<e.length;){var S=e[l].querySelectorAll("Member"),q=this.frameTupCollection(S,q,l+H,this.tupRowInfo,this.showRowSubTotals,this.hideRowTotalsObject,"row");l++}l=0;for(var f,V=e.length,U=("down"===this.customArgs.action&&(V+=l=f=this.customArgs.drillInfo.currentCell.ordinal+1,i=this.tupRowInfo[f-1].allCount,t=this.tupRowInfo[f-1].allStartPos,I=this.tupRowInfo[f-1]),l),v=0,y=[];l<V;){var S=e["down"===this.customArgs.action?l-(this.customArgs.drillInfo.currentCell.ordinal+1):l].querySelectorAll("Member"),b=0,C=void 0,x=this.tupRowInfo[l].allCount,w=this.tupRowInfo[l].allStartPos,T=this.tupRowInfo[l].measure,M=this.tupRowInfo[l].typeCollection,D=this.tupRowInfo[l].drillStartPos,_=this.tupRowInfo[l].startDrillUniquename;if(0===l||l===U){for(var O="down"===this.customArgs.action?this.tupRowInfo[0].members:S;b<O.length;)"1"===O[b].querySelector("MEMBER_TYPE").textContent&&0===Number(O[b].querySelector("LNum").textContent)?g[b]=0:g[b]=Number(O[b].querySelector("LNum").textContent),"1"===O[b].querySelector("MEMBER_TYPE").textContent?(h[b]=0,u=-1===u?b:u,c=b):(h[b]=1,p="3"!==O[b].querySelector("MEMBER_TYPE").textContent||p),b++;a=M.indexOf("3")}if((b=0)===l&&(S.length>x+(T?1:0)||1===S.length&&T)&&m.pop(),0===l&&this.isPaging?0===m.length:!p||x===i||w!==t||1===S.length&&T){var P=this.checkAttributeDrill(this.tupRowInfo[l].drillInfo,"rows"),N=!(-1<D)||!(0<x)||P||D<w,N=I&&N&&-1<D?I.startDrillUniquename!==_||!(c>I.measurePosition||I.measureName===this.tupRowInfo[l].measureName||w!==D+1&&this.tupRowInfo[l].measurePosition!==D+1):N,_=!(-1<u&&0<x)||P||c<w;if((D="Top"===this.dataSourceSettings.grandTotalsPosition&&0===this.olapRowValueIndex&&"row"===this.olapValueAxis&&this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&("row"!==this.olapValueAxis||1<this.dataSourceSettings.rows.length))&&1===m.length&&(m=this.frameGrandTotalValues(e,m,M,a)),S.length===x+(T?1:0)&&T&&!D){var E="Grand Total"+this.valueSortSettings.headerDelimiter+this.dataFields[this.getUniqueName(S[a].querySelector("UName").textContent)].caption?this.dataFields[this.getUniqueName(S[a].querySelector("UName").textContent)].caption:S[a].querySelector("Caption").textContent,P="3"===M[a]&&this.dataFields[this.getUniqueName(S[a].querySelector("UName").textContent)]&&this.dataFields[this.getUniqueName(S[a].querySelector("UName").textContent)].caption?this.dataFields[this.getUniqueName(S[a].querySelector("UName").textContent)].caption:S[a].querySelector("Caption").textContent;(m=this.frameGrandTotalAxisSet(m,this.getUniqueName(S[a].querySelector("UName").textContent),P,n,l,Number(M[a]),S[a].querySelector("PARENT_UNIQUE_NAME")?S[a].querySelector("PARENT_UNIQUE_NAME").textContent:void 0,S[a].querySelector("LName").textContent,S[a].getAttribute("Hierarchy"),{levelName:E,axis:S[a].getAttribute("Hierarchy")}))[m.length-1].valueSort[E]=1}else if(0!==w&&(0!==a||1!==w)&&N&&_){"Top"===this.dataSourceSettings.grandTotalsPosition&&k&&this.dataSourceSettings.showGrandTotals&&("row"!==this.olapValueAxis||1<this.dataSourceSettings.rows.length)&&(this.insertRowGrandTotal(m,o,s,e,n),n=this.pivotValues.length,k=!1);for(var I=this.tupRowInfo[l],B=n,F=b,C={},G=!1;b<S.length;){var L=S[b];if(L.querySelector("UName").textContent!==d[b]&&"2"!==M[b]&&(!(0<Object.keys(C).length?C.isDrilled&&!this.fieldList[C.hierarchy].isHierarchy:G)||"3"===M[b]&&h[b-1]&&0!==h[b+1])){var z=Number(L.querySelector("LNum").textContent)-(h[b]&&"3"!==M[b]?1:g[b]),W=!!this.namedSetsPosition.row[b],A=this.getUniqueName(L.querySelector("UName").textContent),Q=this.getDepth(this.tupRowInfo[l],A,Number(M[b])),E=this.getCaptionCollectionWithMeasure(this.tupRowInfo[l],b,!0);if(this.showSubTotalsAtBottom&&n>this.rowStartPos&&(B=n=this.insertRowSubTotal(s,o,y,n,z,E)),!(this.isPaging&&s[v][0]&&this.fieldList[s[v][0].hierarchy]&&this.fieldList[s[v][0].hierarchy].isHierarchy&&s[v][0].hasChild&&!s[v][0].isDrilled&&!this.rows[b].isNamedSet&&(0===this.rows[b].name.indexOf("[Measures]")||this.fieldList[L.getAttribute("Hierarchy")]&&(this.fieldList[L.getAttribute("Hierarchy")].isHierarchy||this.fieldList[L.getAttribute("Hierarchy")].hasAllMember))&&s[v][0].depth<Q)){s[n]=[{axis:"row",actualText:A,colIndex:0,formattedText:"3"===M[b]&&this.dataFields[A]&&this.dataFields[A].caption?this.dataFields[A].caption:L.querySelector("Caption").textContent,hasChild:!!(this.fieldList[L.getAttribute("Hierarchy")]&&this.fieldList[L.getAttribute("Hierarchy")].isHierarchy&&b<this.rows.length-1&&!this.rows[b+1].isNamedSet&&this.rows[b+1].name.indexOf("[Measures]")<0&&this.fieldList[this.rows[b+1].name]&&this.fieldList[this.rows[b+1].name].hasAllMember)||0<Number(L.querySelector("CHILDREN_CARDINALITY").textContent),level:z,depth:Q,rowIndex:n,index:[],ordinal:l,type:"header",colSpan:1,rowSpan:1,memberType:Number(M[b]),isDrilled:!(!this.fieldList[L.getAttribute("Hierarchy")]||!this.fieldList[L.getAttribute("Hierarchy")].isHierarchy||this.isAttributeDrill(L.getAttribute("Hierarchy"),this.tupRowInfo[l].drillInfo,"rows"))||this.tupRowInfo[l].drillInfo[b].isDrilled,parentUniqueName:L.querySelector("PARENT_UNIQUE_NAME")?L.querySelector("PARENT_UNIQUE_NAME").textContent:void 0,levelUniqueName:L.querySelector("LName").textContent,hierarchy:L.getAttribute("Hierarchy"),isNamedSet:W,valueSort:{levelName:"",axis:L.getAttribute("Hierarchy")}}],this.olapVirtualization&&"header"===s[n][0].type&&delete s[n][0].type,(C="3"!==M[b]?s[n][0]:C)||j.push(L.querySelector("Caption").textContent),E=this.getCaptionCollectionWithMeasure(this.tupRowInfo[l],b,!1),s[n][0].valueSort.levelName=E,s[n][0].valueSort[E]=1,o[n-this.rowStartPos]={},o[n-this.rowStartPos][0]=s[n][0],T&&b<a&&(d[a]="");for(var R=b+1;R<S.length;R++)d[R]="";d[b]=L.querySelector("UName").textContent,v=3!==Number(M[b])?n:v,n++,F=b}}else"2"===M[b]?F=b:this.tupRowInfo[l].drillInfo[b].isDrilled&&0===h[b]&&(G=!0);this.tupRowInfo[l].drillInfo[b].isDrilled&&this.tupRowInfo[l].showTotals&&(this.tupRowInfo[l].showTotals=!!this.showRowSubTotals&&void 0===this.hideRowTotalsObject[this.tupRowInfo[l].drillInfo[b].hierarchy]),b++}B<n&&F>=S.length-1&&(s[n-1][0].ordinal=l,"header"===s[n-1][0].type)&&delete s[n-1][0].type}i=x,t=w}l++}this.showSubTotalsAtBottom&&0<y.length&&(y.reverse(),y.forEach(function(e){s[n]=[e],o[n-r.rowStartPos]={},o[n-r.rowStartPos][0]=s[n][0],n++})),("Top"!==this.dataSourceSettings.grandTotalsPosition||"row"===this.olapValueAxis&&1===this.dataSourceSettings.rows.length&&"Top"===this.dataSourceSettings.grandTotalsPosition||0===this.dataSourceSettings.rows.length)&&this.insertRowGrandTotal(m,o,s,e,n)},S.prototype.insertRowSubTotal=function(e,t,i,a,r,n){var s=Ie.frameHeaderWithKeys(e[a-1][0]);if(s.level<r&&"grand sum"!==s.type&&(s.isDrilled||3===s.memberType))if(3===s.memberType){for(var o=[],l=1;3===e[a-l][0].memberType;)o[o.length]=e[a-l][0],l++;if(e[a-l][0].isDrilled&&0!==o.length){for(var d=0,h=o.length;d<h;d++)o[d].formattedText=e[a-l][0].formattedText+" "+o[d].formattedText,o[d].isSum=!0,o[d].type="sum",o[d].parentUniqueName=e[a-l][0].levelUniqueName,i[i.length]=o[d];a-=--l}}else s.hasChild=!1,s.isDrilled=!1,s.isSum=!0,s.type="sum",s.formattedText=s.formattedText+" Total",i[Object.keys(i).length]=s;if(0<i.length)for(var p=i.length-1,u=i[p].valueSort.levelName.split(".").length,c=n.split(".").length;c<=u&&(e[a]=[i[p]],t[a-this.rowStartPos]={},t[a-this.rowStartPos][0]=e[a][0],a++,i.splice(i.length-1,1),0<Object.keys(i).length);)u=i[--p].valueSort.levelName.split(".").length;return a},S.prototype.insertRowGrandTotal=function(e,t,i,a,r){if(1<e.length&&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 s=0;s<e.length;s++)i[e[s].rowIndex=r]=[e[s]],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},S.prototype.frameGrandTotalAxisSet=function(e,t,i,a,r,n,s,o,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:s,levelUniqueName:o,hierarchy:l,valueSort:d}),e},S.prototype.getDepth=function(e,t,i){for(var a=e.uNameCollection.indexOf(t),r=(e.uNameCollection.substring(0,a)+(3===i?"":t)).split("::[").map(function(e){return"["===e[0]?e:"["+e}),n=(3===i&&this.rowMeasurePos===r.length&&r.push(t),-1),s=0;s<r.length;s++)n+=r[s].split("~~").length;return n},S.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},S.prototype.frameTupCollection=function(e,t,i,a,r,n,s){for(var o,l,d,h,p=0,u=0,c=[],g=[],m=[],S="",f="",v=!0,y=-1;p<e.length;){var b=e[p],C=Number(b.querySelector("LNum").textContent),x=b.querySelector("UName").textContent,w=(3<Number(b.querySelector("MEMBER_TYPE").textContent)&&(b.querySelector("MEMBER_TYPE").textContent=0===x.indexOf("[Measures]")?"3":"1"),0===x.indexOf("[Measures]")?"3":3<Number(b.querySelector("MEMBER_TYPE").textContent)?"1":b.querySelector("MEMBER_TYPE").textContent),T=b.querySelector("Caption").textContent,M=(this.fieldList[T]&&"CalculatedField"===this.fieldList[T].type&&(T=this.fieldList[T].caption,b.querySelector("Caption").textContent=T),b.getAttribute("Hierarchy")),D=b.querySelector("PARENT_UNIQUE_NAME")?b.querySelector("PARENT_UNIQUE_NAME").textContent:"";if("2"===w?(this.isPaging||u++,o=_e.isNullOrUndefined(o)?p:o):"3"===w?(l=b,d=x,h=p,"column"===s?(this.colMeasures[x]=b,this.colMeasurePos=p):this.rowMeasurePos=p):y=n[M],"2"!==w){if(this.headerGrouping[p]){if(C>this.lastLevel[p])this.lastLevel[p]=C;else if(C<this.lastLevel[p]){for(var O=this.lastLevel[p];C<=O;)delete this.headerGrouping[p].UName[O],delete this.headerGrouping[p].Caption[O],O--;this.lastLevel[p]=C}this.headerGrouping[p].UName[C]=x,this.headerGrouping[p].Caption[C]=T}else this.lastLevel[p]=C,this.headerGrouping[p]={UName:((b={})[C]=x,b),Caption:((b={})[C]=T,b)};if(this.isPaging)for(var P=D;this.drilledSets[P];){var k=this.drilledSets[P].querySelector("Caption").textContent,N=Number(this.drilledSets[P].querySelector("LNum").textContent);this.headerGrouping[p].UName[N]=P,this.headerGrouping[p].Caption[N]=k,P=null===this.drilledSets[P].querySelector("PARENT_UNIQUE_NAME")?"":this.drilledSets[P].querySelector("PARENT_UNIQUE_NAME").textContent}for(var E="",I=Object.keys(this.headerGrouping[p].UName),F=0;F<I.length;F++)var L=I[F],E=0===F?this.headerGrouping[p].UName[Number(L)]:E+"~~"+this.headerGrouping[p].UName[Number(L)];for(var S=""===S?E:S+"::"+E,A="",R=Object.keys(this.headerGrouping[p].Caption),F=0;F<R.length;F++)L=R[F],A=0===F?this.headerGrouping[p].Caption[Number(L)]:A+"~~"+this.headerGrouping[p].Caption[Number(L)];p!==h&&(f=""===f?A:f+"::"+A)}c.push(w),g.push(C),(_e.isNullOrUndefined(t[p])||t[p]<C)&&(t[p]=C),m.push({level:C,uName:x,hierarchy:M,isDrilled:!1}),a[i-1]&&"1"===a[i-1].typeCollection[p]&&m[p].level>a[i-1].drillInfo[p].level&&((T=S.split(/~~|::\[/).map(function(e){return"["===e[0]?e:"["+e})).pop(),b=T.join("~~"),this.setDrillInfo(D,b,p,i,a)),p++}return-1<y&&(v="2"!==c[y+1]),a[i]={allCount:u,allStartPos:o,measure:l,measureName:d,measurePosition:h,members:e,typeCollection:c,uNameCollection:S,captionCollection:f,levelCollection:g,drillInfo:m,drillStartPos:-1,drillEndPos:-1,showTotals:!(!r&&0<u&&(0===h?1:0)<o)&&v},t},S.prototype.getCaptionCollectionWithMeasure=function(e,t,i){e.captionCollection;var a,r,n=!0;if(!i&&"3"!==e.typeCollection[t])for(var s=0;s<this.measurePosition;s++)if(e.drillInfo[t].hierarchy===this.dataSourceSettings.rows[s].name){n=!1;break}return(e.measure&&n?(i=this.getUniqueName(e.measure.querySelector("UName").textContent),i=this.dataFields[i]&&this.dataFields[i].caption?this.dataFields[i].caption:e.measure.querySelector("Caption").textContent,a=e.uNameCollection.split(/[~~::]+/g).indexOf(e.measureName),(r=e.captionCollection.split(/[~~::]+/g)).splice(a,0,i),r):r=e.captionCollection.split(/[~~::]+/g)).join(this.valueSortSettings.headerDelimiter)},S.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)}while(this.namedSetsPosition[e?"row":"column"]=t,++e<2)},S.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},S.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--},S.prototype.frameGrandTotalValues=function(e,t,i,a){for(var r=0,n=!1;r<e.length&&!n;){var s=e["down"===this.customArgs.action?r-(this.customArgs.drillInfo.currentCell.ordinal+1):r].querySelectorAll("Member"),o=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;0===r&&(s.length>o+(l?1:0)||1===s.length&&l)&&t.pop(),0===r&&this.isPaging&&0!==t.length||(this.checkAttributeDrill(this.tupRowInfo[r].drillInfo,"rows"),s.length===o+(l?1:0)&&l&&(o="Grand Total"+this.valueSortSettings.headerDelimiter+s[a].querySelector("Caption").textContent,l="3"===d[a]&&this.dataFields[this.getUniqueName(s[a].querySelector("UName").textContent)]&&this.dataFields[this.getUniqueName(s[a].querySelector("UName").textContent)].caption?this.dataFields[this.getUniqueName(s[a].querySelector("UName").textContent)].caption:s[a].querySelector("Caption").textContent,(t=this.frameGrandTotalAxisSet(t,this.getUniqueName(s[a].querySelector("UName").textContent),l,this.pivotValues.length,r,Number(d[a]),s[a].querySelector("PARENT_UNIQUE_NAME")?s[a].querySelector("PARENT_UNIQUE_NAME").textContent:void 0,s[a].querySelector("LName").textContent,s[a].getAttribute("Hierarchy"),{levelName:o,axis:s[a].getAttribute("Hierarchy")}))[t.length-1].valueSort["Grand Total"+this.valueSortSettings.headerDelimiter+s[a].querySelector("Caption").textContent]=1)),n=this.dataSourceSettings.values.length+1===t.length,r++}return t},S.prototype.frameColumnHeader=function(S){for(var f=this,v=(this.headerGrouping={},this.lastLevel=[],0),y=[],b=[],C=[],x=-1,w=-1,e=this.customArgs.drillInfo&&"column"===this.customArgs.drillInfo.axis?this.customArgs.drillInfo.currentCell.ordinal+1:0;v<S.length;){var t=S[v].querySelectorAll("Member"),y=this.frameTupCollection(t,y,v+e,this.tupColumnInfo,this.showColumnSubTotals,this.hideColumnTotalsObject,"column");v++}if(0<S.length)for(var t=S[0].querySelectorAll("Member"),i=0;i<t.length;)C[i]="1"===t[i].querySelector("MEMBER_TYPE").textContent&&0===Number(t[i].querySelector("LNum").textContent)?0:Number(t[i].querySelector("LNum").textContent),"1"!==t[i].querySelector("MEMBER_TYPE").textContent||!this.isPaging&&0!==Number(t[i].querySelector("LNum").textContent)?b[i]=1:(b[i]=0,x=-1===x?i:x,w=i),i++;for(var T,v=0,M=1,D={},O=!0,P=!1,N=this;v<S.length;)!function(){var e=S[v].querySelectorAll("Member"),t=N.tupColumnInfo[v].allCount,i=N.tupColumnInfo[v].allStartPos,a=N.tupColumnInfo[v].measure,r=N.tupColumnInfo[v].typeCollection,n=N.tupColumnInfo[v].drillInfo,s=N.tupColumnInfo[v].drillStartPos,o=N.tupColumnInfo[v].startDrillUniquename,l=N.tupColumnInfo[v].endDrillUniquename,d=N.tupColumnInfo[v].drillEndPos,h=N.tupColumnInfo[v].levelCollection,p="2"!==r[0]&&("3"!==r[0]||"2"!==r[1]),u=0,a=(y.map(function(e,t){u+=0===b[t]?e+(1-(1<C[t]?1:C[t])):0===e?f.isPaging&&"2"===r[t]?0:1:e}),N.colDepth=N.colDepth>u?N.colDepth:u,0===v&&e.length>t+(a?1:0)&&(P=!0,p=0<t&&p?x<i:p),!1);if("Top"===N.dataSourceSettings.grandTotalsPosition&&N.dataSourceSettings.showGrandTotals&&N.dataSourceSettings.showColumnGrandTotals){for(var c=0,g=0;g<e.length;g++)0===e[g].querySelector("Caption").textContent.indexOf("All")&&c++;a=c===("column"===N.olapValueAxis?N.dataSourceSettings.columns.length-1:N.dataSourceSettings.columns.length)}!p&&!a||0!==t&&!a||(m=[-1,-1,-1],N.tupColumnInfo[v-1]&&0===N.tupColumnInfo[v-1].allCount?m=N.levelCompare(h,N.tupColumnInfo[v-1].levelCollection):P&&T&&(m=N.levelCompare(h,T.levelCollection)),N.tupColumnInfo[v].drillStartPos<0||N.showSubTotalsAtTop?(!O&&-1<m[0]&&-1<m[2]&&(M=N.mergeTotCollection(M,t,y,C,b,i,n,m)),N.setParentCollection(e),N.frameCommonColumnLoop(e,v,M,y,b,C),N.tupColumnInfo[v].showTotals||M--,!O&&-1<m[0]&&-1<m[2]&&(M=N.mergeTotCollection(M,t,y,C,b,i,n,m)),O=!1,N.isColDrill?N.isColDrill=!1:M++):(D.drillStartPos!==s||D.startDrillUniquename!==o||D.allCount===t)&&(!O&&-1<m[0]&&-1<m[2]&&(M=N.mergeTotCollection(M,t,y,C,b,i,n,m),O=!0),N.setParentCollection(e),!P||w<=s)&&(a||(N.totalCollection[N.totalCollection.length]={allCount:t,ordinal:v,members:e,drillInfo:n}),D.allCount=t,D.allStartPos=i,D.drillStartPos=s,D.startDrillUniquename=o,D.endDrillUniquename=l),T=N.tupColumnInfo[v]);var m,h=N.checkAttributeDrill(N.tupColumnInfo[v].drillInfo,"columns");0<t&&(!P||p&&(h||w<i))&&(t!==D.allCount&&i===D.allStartPos||(m=d===s||D.endDrillUniquename===l,p=i!==D.allStartPos?D.startDrillUniquename!==o:m,-1<s&&!p)||(O||(M=N.mergeTotCollection(M,t,y,C,b,i,n),O=!0),N.setParentCollection(e),P&&-1<s&&!(w<=s))||(a||(N.totalCollection[N.totalCollection.length]={allCount:t,ordinal:v,members:e,allStartPos:i,drillInfo:n}),D.allCount=t,D.allStartPos=i,D.drillStartPos=s,D.startDrillUniquename=o,D.endDrillUniquename=l)),v++}();if(0<this.totalCollection.length)if(1<Object.keys(this.colMeasures).length)this.orderTotals(M,y,b,C);else{this.totalCollection=this.totalCollection.reverse();for(var a=0,r=this.totalCollection;a<r.length;a++){var n,s=r[a];(!(0===this.tupColumnInfo[s.ordinal].measurePosition?1===this.tupColumnInfo[s.ordinal].allStartPos:0===this.tupColumnInfo[s.ordinal].allStartPos)||this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals)&&(this.frameCommonColumnLoop(s.members,s.ordinal,M,y,C,b),n=this.checkAttributeDrill(this.tupColumnInfo[s.ordinal].drillInfo,"columns"),this.tupColumnInfo[s.ordinal].showTotals||n)&&M++}}},S.prototype.orderTotals=function(e,t,i,a){for(var r={},n=1,s=0,o=this.totalCollection;s<o.length;s++){var l,d=o[s];(!(0===this.tupColumnInfo[d.ordinal].measurePosition?1===this.tupColumnInfo[d.ordinal].allStartPos:0===this.tupColumnInfo[d.ordinal].allStartPos)||this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals)&&(r[l=this.tupColumnInfo[d.ordinal].measure.querySelector("UName").textContent]?(r[l].coll.push(d),r[l].count++,n=n<r[l].count?r[l].count:n):r[l]={coll:[d],count:1})}for(var h=Object.keys(r),p=n-1;-1<p;){for(var u=0,c=h;u<c.length;u++)(d=r[c[u]].coll[p])&&(this.frameCommonColumnLoop(d.members,d.ordinal,e,t,i,a),this.tupColumnInfo[d.ordinal].showTotals)&&e++;p--}},S.prototype.setParentCollection=function(e){for(var t=0;e.length>t;){var i,a,r=e[t],n=2<Number(r.querySelector("MEMBER_TYPE").textContent)?"3":r.querySelector("MEMBER_TYPE").textContent,s=Number(r.querySelector("LNum").textContent),o=r.querySelector("UName").textContent,l=r.querySelector("PARENT_UNIQUE_NAME")?r.querySelector("PARENT_UNIQUE_NAME").textContent:"",d=!0,h=!1;this.parentObjCollection[t]&&(i=Object.keys(this.parentObjCollection[t]),d=(a=this.parentObjCollection[t][s-1])?l===a.querySelector("UName").textContent:0===i.length,h="1"===this.tupColumnInfo[0].typeCollection[t]),"2"===n?delete this.parentObjCollection[t]:(!this.isPaging&&!h||d||delete this.parentObjCollection[t],this.parentObjCollection[t]?this.parentObjCollection[t][s]&&this.parentObjCollection[t][s].querySelector("UName").textContent===o||(this.parentObjCollection[t][s]=r):(this.parentObjCollection[t]={},this.parentObjCollection[t][s]=r)),t++}},S.prototype.setDrillInfo=function(e,t,i,a,r){for(a--;r[a]&&r[a].drillInfo[i].uName===e;){if(r[a].uNameCollection.split(/~~|::\[/).map(function(e){return"["===e[0]?e:"["+e}).join("~~").indexOf(t)<0)break;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--}},S.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},S.prototype.mergeTotCollection=function(e,t,i,a,r,n,s,o){for(var l=_e.isNullOrUndefined(n)?o[0]:n-(this.colMeasurePos===n-1?2:1),d=s[l]&&s[l].level,h=this.getLevelsAsString(l-1,s),p={},u=1,c=!1,g=0,m=this.totalCollection;g<m.length;g++){var S,f=m[g];(c||f.allCount<=t&&(!(-1<d&&f.drillInfo[l])||f.drillInfo[l].level>=d&&this.getLevelsAsString(l-1,f.drillInfo)===h))&&(p[S=this.tupColumnInfo[f.ordinal].measure?this.tupColumnInfo[f.ordinal].measure.querySelector("UName").textContent:"measure"]?(p[S].coll.push(f),p[S].count++,u=u<p[S].count?p[S].count:u):p[S]={coll:[f],count:1},c=!1)}for(var v=Object.keys(p),y=u-1;-1<y;){for(var b=0,C=v;b<C.length;b++){var x=p[C[b]].coll[y];x&&((!(0===this.tupColumnInfo[x.ordinal].measurePosition?1===this.tupColumnInfo[x.ordinal].allStartPos:0===this.tupColumnInfo[x.ordinal].allStartPos)||this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals)&&(this.frameCommonColumnLoop(x.members,x.ordinal,e,i,r,a),this.tupColumnInfo[x.ordinal].showTotals)&&e++,this.totalCollection.pop())}y--}return e},S.prototype.getLevelsAsString=function(e,t){for(var i=[],a=0;a<e;a++)i[a]=t[a].level;return 0<i.length?i.toString():""},S.prototype.frameCommonColumnLoop=function(e,t,i,a,r,n){var s=-1;if(this.tupColumnInfo[t].showTotals)for(var o=0,l=0;o<e.length;)l+=0<n[o]&&this.getMeasurePosition(this.tupColumnInfo[t].uNameCollection,this.tupColumnInfo[t].measurePosition)!==o?a[o]:a[o]+(1-r[o]),this.tupColumnInfo[t].drillInfo[o].isDrilled&&this.tupColumnInfo[t].showTotals&&(this.tupColumnInfo[t].showTotals=!!this.showColumnSubTotals&&void 0===this.hideColumnTotalsObject[this.tupColumnInfo[t].drillInfo[o].hierarchy],l-=a[o]-this.tupColumnInfo[t].levelCollection[o],s=this.tupColumnInfo[t].showTotals?-1:l-1),o++;var d=this.checkAttributeDrill(this.tupColumnInfo[t].drillInfo,"columns");if(this.tupColumnInfo[t].showTotals||d)for(var h=0,p=0,u={},c="0"===e[0].querySelector("LNum").textContent;h<e.length;){for(var g=e[h],m=2<Number(g.querySelector("MEMBER_TYPE").textContent)?"3":g.querySelector("MEMBER_TYPE").textContent,S=0,f=g.querySelector("LNum").textContent,v="2"===m||n[h]?1:r[h];v<=("3"===m?1:a[h]);v++){for(var y=!1,b=(this.pivotValues[p]||(this.pivotValues[p]=[]),Number(e[h].querySelector("LNum").textContent)>v&&"2"!==m?(this.parentObjCollection[h][v]||this.getDrilledParent(e[h],v,this.parentObjCollection[h]),this.parentObjCollection[h][v]&&(g=this.parentObjCollection[h][v]),y=!0):(g=e[h],S++),this.getUniqueName(g.querySelector("UName").textContent)),C=("2"!==m?u[b]="3"===m&&this.dataFields[b]&&this.dataFields[b].caption?this.dataFields[b].caption:g.querySelector("Caption").textContent:"2"===m&&"0"===f&&(c=c&&!(u[b]="Grand Total")),Object.keys(u)),x=h>=this.measurePosition&&0===Number(g.getElementsByTagName("LNum")[0].textContent)&&1===C.length?"Grand Total"+this.valueSortSettings.headerDelimiter:"",w=0;w<C.length;w++){var T=C[w];0===w?x+=u[T]:x=x+this.valueSortSettings.headerDelimiter+u[T]}var M=!!this.namedSetsPosition.column[h],D=this.getDepth(this.tupColumnInfo[t],b,Number(m));if(this.isPaging&&this.pivotValues[p-1]&&this.pivotValues[p-1][i]&&this.fieldList[this.pivotValues[p-1][i].hierarchy]&&this.fieldList[this.pivotValues[p-1][i].hierarchy].isHierarchy&&this.pivotValues[p-1][i].hasChild&&!this.pivotValues[p-1][i].isDrilled&&!this.columns[h].isNamedSet&&this.fieldList[g.getAttribute("Hierarchy")]&&(this.fieldList[g.getAttribute("Hierarchy")].isHierarchy||this.fieldList[g.getAttribute("Hierarchy")].hasAllMember)&&this.pivotValues[p-1][i].depth<D){this.isColDrill=!0;break}this.pivotValues[p][i]={axis:"column",actualText:b,colIndex:i,formattedText:"3"===m&&this.dataFields[b]&&this.dataFields[b].caption?this.dataFields[b].caption:g.querySelector("Caption").textContent,hasChild:!!(this.fieldList[g.getAttribute("Hierarchy")]&&this.fieldList[g.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)||0<Number(g.querySelector("CHILDREN_CARDINALITY").textContent),level:1<S?-1:Number(g.querySelector("LNum").textContent)-(n[h]&&"3"!==m?1:0),rowIndex:p,ordinal:t,memberType:Number(m),depth:D,isDrilled:!(!this.fieldList[g.getAttribute("Hierarchy")]||!this.fieldList[g.getAttribute("Hierarchy")].isHierarchy||this.isAttributeDrill(g.getAttribute("Hierarchy"),this.tupColumnInfo[t].drillInfo,"columns"))||y||this.tupColumnInfo[t].drillInfo[h].isDrilled,parentUniqueName:g.querySelector("PARENT_UNIQUE_NAME")?g.querySelector("PARENT_UNIQUE_NAME").textContent:void 0,levelUniqueName:g.querySelector("LName").textContent,hierarchy:g.getAttribute("Hierarchy"),isNamedSet:M,valueSort:((b={levelName:x})[x]=1,b.axis=g.getAttribute("Hierarchy"),b)},this.headerContent[p]||(this.headerContent[p]={}),this.headerContent[p][i]=this.pivotValues[p][i],p++}h++}else if(-1<s)this.pivotValues[s][i-1].ordinal=t;else if(0<this.tupColumnInfo[t].allCount){for(o=0,l=0;o<this.tupColumnInfo[t].allStartPos;)l+=0<n[o]&&this.getMeasurePosition(this.tupColumnInfo[t].uNameCollection,this.tupColumnInfo[t].measurePosition)!==o?a[o]:a[o]+(1-r[o]),o++;this.tupColumnInfo[t].allStartPos===this.tupColumnInfo[t].measurePosition+1?l-=a[this.tupColumnInfo[t].allStartPos-2]-this.tupColumnInfo[t].levelCollection[this.tupColumnInfo[t].allStartPos-2]+1:l-=a[this.tupColumnInfo[t].allStartPos-1]-this.tupColumnInfo[t].levelCollection[this.tupColumnInfo[t].allStartPos-1],this.pivotValues[l-1]&&(this.pivotValues[l-1][i-1].ordinal=t)}},S.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 s=this.drilledMembers[r].delimiter,o=this.drilledMembers[r].items[n].split(s),l="",d=0;d<o.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},S.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},S.prototype.getDrilledParent=function(e,t,i){for(var a=Number(e.querySelector("LNum").textContent),r=e,n=a-1;t<=n;n--){var s=this.drilledSets[r.querySelector("PARENT_UNIQUE_NAME").textContent];if(!s)break;r=i[n]=s}},S.prototype.performRowSorting=function(e,t){if((this.enableSort||this.enableValueSorting)&&0<this.tupRowInfo.length){for(var i=this.pivotValues.length,a={},r={},n=[],s=!1,o=this.tupRowInfo[0].typeCollection.lastIndexOf("1"),l=void 0,d=this.colDepth;d<i;d++){var h,p,u=this.pivotValues[d][0];this.showSubTotalsAtBottom&&u.isSum&&3!==u.memberType||(""!==(h=(p=this.tupRowInfo[u.ordinal])?0===p.measurePosition&&3===u.memberType?p.measureName:p.uNameCollection:"")&&(p=(h=-1<o?this.frameUniqueName(h,u,p):h).split(/~~|::\[/).length,3===u.memberType&&0<this.tupRowInfo[0].measurePosition?r[L=this.getParentUname(h,u,!0,!0)]?r[L].push(u):r[L]=[u]:a[p]?a[p][h]=[u]:a[p]=((p={})[h]=[u],p)),s&&n.push(u),"grand sum"===u.type&&(s=!0))}for(var c=0<Object.keys(r).length&&0<this.tupRowInfo[0].measurePosition,g=Object.keys(a).map(function(e){return Number(e)}).sort(function(e,t){return t<e?1:e<t?-1:0}),m={},S=g.length-1;0<=S;S--){for(var f={},v=a[g[S]],y=Object.keys(v),b=0;b<y.length;b++)f[L=0===S?"parent":this.getParentUname(y[b],v[y[b]][0],c,!1)]?f[L].push(v[y[b]][0]):f[L]=v[y[b]];for(var C=Object.keys(f),x=0;x<C.length;x++)f[C[x]]=this.sortRowHeaders(f[C[x]],e,t);if(m[g[S+1]])for(x=0;x<C.length;x++){for(var w=[],T=f[C[x]],M=0;M<T.length;M++){var D=this.tupRowInfo[T[M].ordinal],O=0===D.measurePosition&&3===T[M].memberType?D.measureName:D.uNameCollection,k=(w.push(T[M]),-1<o&&(O=this.frameUniqueName(O,T[M],D)),!1);if(c)if(r[L=this.getParentUname(O,T[M],c,!0)]){r[L]=this.sortRowHeaders(r[L],e,t);var P=O.lastIndexOf("::[")===O.indexOf("::[Measures]"),j=O.split("::[").length-1===D.measurePosition,q=!D.drillInfo[D.measurePosition-1].isDrilled,D=D.members.length>D.measurePosition+1;if(P&&j&&q&&D)for(var k=!0,N=0;N<r[L].length;N++){w.push(r[L][N]);var E=O.substring(0,O.indexOf("::[Measures]"))+"::"+r[L][N].actualText;m[g[S+1]][E]&&(w=w.concat(m[g[S+1]][E]))}else l=this.showSubTotalsAtBottom&&w[w.length-1].isDrilled,w=w.concat(r[L])}if(!k&&m[g[S+1]][O])if(this.showSubTotalsAtBottom&&3===w[w.length-1].memberType&&-1<w[w.length-1].level&&l){for(var I=[],H=0,F=w.length-1;0<=F;F--){if(3!==w[F].memberType){I=I.reverse(),H=F+1;break}I[I.length]=w[F]}w=w.slice(0,H).concat(m[g[S+1]][O]).concat(I)}else{u=w[w.length-1],P=void 0;this.showSubTotalsAtBottom&&u.isDrilled&&((P=Ie.frameHeaderWithKeys(u)).hasChild=!1,P.isDrilled=!1,P.isSum=!0,P.formattedText=P.formattedText+" Total"),w=w.concat(m[g[S+1]][O]),P&&(w[w.length]=P)}}f[C[x]]=w}else if(c)for(x=0;x<C.length;x++){for(T=f[C[x]],w=[],M=0;M<T.length;M++){w.push(T[M]);var L,O=this.tupRowInfo[T[M].ordinal].uNameCollection;-1<o&&(O=this.frameUniqueName(O,T[M],this.tupRowInfo[T[M].ordinal])),r[L=this.getParentUname(O,T[M],!0,!0)]&&(r[L]=this.sortRowHeaders(r[L],e,t),w=w.concat(r[L]))}f[C[x]]=w}m[g[S]]=f}for(var A=0,V=0,U=0,s=!1,n=this.sortRowHeaders(n,e,t),d=this.colDepth;d<i;d++){"Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&("column"===this.olapValueAxis&&this.colDepth+1===d||"row"===this.olapValueAxis&&this.colDepth+this.dataSourceSettings.values.length+1===d)&&(A=0,s=!1);var R=s?n:m[g[0]].parent,_="Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&this.colDepth===d?R.length:s?A-V:A;R[_]&&(this.pivotValues[d]=[R[_]],this.pivotValues[d][0].rowIndex=d,this.valueContent[U][0]=this.pivotValues[d][0]),A++,U++,"grand sum"===this.pivotValues[d][0].type&&(s=!0,V=A)}}},S.prototype.performColumnSorting=function(e,t){if(this.enableSort||this.enableValueSorting)for(var i=0;i<this.dataSourceSettings.columns.length;i++){for(var a=[],r=0,n=[],s=0;s<this.pivotValues.length;s++){for(var o=this.pivotValues[s],l=void 0,d={},h=[],p=1,u=(n[r]=[],a[r]=[],1),c=o[u].hierarchy,g=o[u].levelUniqueName;u<o.length;u++)if(!o[u].isNamedSet){if(2!==o[u].memberType&&"[Measures]"!==o[u].hierarchy&&-1!==o[u].level){if(_e.isNullOrUndefined(d[o[u].formattedText])||_e.isNullOrUndefined(this.pivotValues[s-1]))d[o[u].formattedText]||(d[o[u].formattedText]=[]),o[u+1]&&o[u].formattedText===o[u+1].formattedText||(h[h.length]=o[u]),d[o[u].formattedText][o[u].colIndex]=o[u];else if(d[o[u].formattedText]&&this.pivotValues[s-1]){var m=this.pivotValues[s-1][o[u].colIndex],S=Number(Object.keys(d[o[u].formattedText])[0]),S=d[o[u].formattedText][S].colIndex,S=this.pivotValues[s-1][S];if(m.formattedText!==S.formattedText){l=this.sortColumnHeaders(d,h,this.sortObject[o[u-1].levelUniqueName]||this.sortObject[o[u].hierarchy],e,t,c,g),a[r]=_e.isNullOrUndefined(a[r])?[]:a[r];for(var f=0;f<l.length;f++)for(var v=Object.keys(d[l[f]]).length,y=0;y<v;y++)p=0===a[r].length?1:0,a[r][a[r].length+p]=d[l[f]][Number(Object.keys(d[l[f]])[y])];h=[],(d={})[o[u].formattedText]=[],h[h.length]=o[u]}d[o[u].formattedText][o[u].colIndex]=o[u]}}else if(0<Object.keys(d).length){n[r][n[r].length+p]=o[u],l=this.sortColumnHeaders(d,h,this.sortObject[o[u-1].levelUniqueName]||this.sortObject[o[u].hierarchy],e,t,c,g),a[r]=_e.isNullOrUndefined(a[r])?[]:a[r];for(var b=0;b<l.length;b++)for(var C=Object.keys(d[l[b]]).length,x=0;x<C;x++)p=0===a[r].length?1:0,a[r][a[r].length+p]=d[l[b]][Number(Object.keys(d[l[b]])[x])]}else(-1===o[u].level||0===o[u].level)&&0<=Object.keys(d).length&&"[Measures]"!==o[u].hierarchy&&(n[r][n[r].length+p]=o[u]);if(-1!==o[u].level&&1===Object.keys(d).length&&"[Measures]"!==o[u].hierarchy&&!_e.isNullOrUndefined(o[u+1])&&-1===o[u+1].level){var w=Object.keys(d[o[u].formattedText]).length,T=Object.keys(d[o[u].formattedText]);if(1<w)for(var M=0;M<w;M++)p=0===n[r].length?1:0,n[r][n[r].length+p]=d[o[u].formattedText][Number(T[M])];else n[r][n[r].length+p]=o[u]}if(0<Object.keys(n[r]).length){var p=0===a[r].length?1:0,D=n[r].length;if(2<D)for(var O=1;O<D;O++)p=0===a[r].length?1:0,a[r][a[r].length+p]=n[r][O];else a[r][a[r].length+p]=n[r][1]||n[r][0];d={},h=[],n[r]=[]}}if(0<Object.keys(d).length){n[r][n[r].length+p]=o[u];var P=this.sortObject[o[u-1].levelUniqueName]||this.sortObject[o[u-1].hierarchy],l=this.sortColumnHeaders(d,h,P,e,t,c,g);a[r]=_e.isNullOrUndefined(a[r])?[]:a[r];for(var N=0;N<l.length;N++)for(var k=Object.keys(d[l[N]]).length,x=0;x<k;x++)p=0===a[r].length?1:0,a[r][a[r].length+p]=d[l[N]][Number(Object.keys(d[l[N]])[x])]}for(var E=1;E<a[r].length;E++)this.pivotValues[r][E]=a[r][E];for(var I=s;I<this.pivotValues.length;I++){var F=_e.extend({},this.pivotValues[I+1],null,!0),L=_e.extend({},this.pivotValues[I],null,!0);if(Object.keys(F).length===Object.keys(L).length&&2<Object.keys(F).length){for(var A=1;A<this.pivotValues[s].length;A++)0<Object.keys(F).length&&L[A].colIndex!==F[A].colIndex&&(this.pivotValues[I+1][A]=F[L[A].colIndex]);break}}r++,d={}}for(var R=0;R<this.pivotValues.length;R++)for(o=this.pivotValues[R],s=1;s<o.length;s++)o[s].colIndex=s}},S.prototype.frameUniqueName=function(e,t,i){var a=-1<e.indexOf(t.actualText.toString()+"::[Measures]"),t=(e=e.substring(0,e.indexOf(t.actualText.toString()))+t.actualText.toString()).split("::[").length<=this.getMeasurePosition(e,i.measurePosition);return e+=a||t?"::"+i.measureName:""},S.prototype.getMeasurePosition=function(e,t){for(var i=t,a=e.split("::["),r=0;r<a.length;r++)if(a[r]&&-1<a[r].indexOf("Measures")){i=r;break}return i},S.prototype.sortRowHeaders=function(e,t,i){if(this.enableValueSorting&&"column"===this.olapValueAxis&&i.isValueSorting&&!_e.isNullOrUndefined(this.valueSortSettings)){for(var a=[],r=0;r<e.length;r++){var n=e[r],s=t[n.ordinal*i.columnLength+i.memberIndex],o=s?s.getElementsByTagName("Value"):void 0,s=s&&0<o.length?Number(o[0].textContent):0;a.push({header:n,value:s})}e=Ie.getSortedValue(a,this.valueSortSettings.sortOrder)}else if(this.enableSort&&0<e.length&&3!==e[0].memberType&&!e[0].isNamedSet){for(var l=[],r=0;r<e.length;r++)l[r]=e[r].actualText;var d=!1,h=("Grand Total"!==e[0].actualText?e[0]:e[1]).hierarchy,p=this.fieldList[h]&&this.fieldList[h].membersOrder?this.fieldList[h].membersOrder.slice():[],h={fieldName:h,levelName:e[0].levelUniqueName,sortOrder:this.sortObject[e[0].hierarchy]||this.sortObject[e[0].levelUniqueName],members:p&&0<p.length?p:l,IsOrderChanged:!1};if(p&&0<p.length?Ie.applyCustomSort(h,e,"string",!1,!0):("Ascending"===h.sortOrder||void 0===h.sortOrder?e.sort(function(e,t){return e.formattedText>t.formattedText?1:t.formattedText>e.formattedText?-1:0}):"Descending"===h.sortOrder&&e.sort(function(e,t){return e.formattedText<t.formattedText?1:t.formattedText<e.formattedText?-1:0}),d=!0),d&&this.getHeaderSortInfo){for(var u=[],c=0,g=0;c<e.length;c++)"Grand Total"!==e[c].actualText&&(u[g++]=e[c].formattedText);h.members=u}this.getHeaderSortInfo&&this.getHeaderSortInfo(h),h.IsOrderChanged&&Ie.applyCustomSort(h,e,"string",!0,!0)}return e},S.prototype.sortColumnHeaders=function(e,t,i,a,r,n,s){var o=Object.keys(e);if(this.enableValueSorting&&"row"===this.olapValueAxis&&r.isValueSorting&&!_e.isNullOrUndefined(this.valueSortSettings)){for(var l=[],d=0;d<o.length;d++){var h=e[o[d]],h=this.showSubTotalsAtTop?h[0]:h[h.length-1],p=a[r.memberIndex*r.columnLength+h.ordinal],u=p?p.getElementsByTagName("Value"):void 0,p=p&&0<u.length?Number(u[0].textContent):0;l.push({header:h,value:p})}o=Ie.getSortedValue(l,this.valueSortSettings.sortOrder).map(function(e){return e.formattedText})}else if(this.enableSort){var c=!1,g=this.fieldList[n]&&this.fieldList[n].membersOrder?this.fieldList[n].membersOrder.slice():[],n={fieldName:n,levelName:s,sortOrder:i,members:g&&0<g.length?g:o,IsOrderChanged:!1};if(g&&0<g.length?this.applyCustomSort(o,n):("Ascending"===n.sortOrder||void 0===n.sortOrder?o.sort(function(e,t){return t<e?1:e<t?-1:0}):"Descending"===n.sortOrder&&o.sort(function(e,t){return e<t?1:t<e?-1:0}),c=!0),c&&this.getHeaderSortInfo){for(var m=[],S=0,f=0;S<o.length;S++)"Grand Total"!==o[S]&&(m[f++]=o[S]);n.members=m}this.getHeaderSortInfo&&this.getHeaderSortInfo(n),n.IsOrderChanged&&this.applyCustomSort(o,n,!0)}return o},S.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 s=0,o=0;s<e.length;s++){var l=e[s];if(r[o]===l){if(e.splice(o++,0,l),e.splice(++s,1),!(o<r.length)){i||n.splice(--o,0,l);break}s=-1}0<=s&&!i&&(n[s]=e[s])}if(!i){for(s=n.length;s<e.length;s++)n[s]=e[s];"Grand Total"===n[n.length-1]&&n.pop(),t.members=n}return a&&e.splice(0,0,a),e},S.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},S.prototype.getParentUname=function(e,t,i,a){var r="";if(i&&!a){for(var n,i=this.tupRowInfo[t.ordinal],s=[],o={},l=0;l<e.length;l++)"~"!==e[l]&&":"!==e[l]||(s.push(l),o[l]=e[l]+e[l],l++);r=this.getMeasurePosition(e,i.measurePosition)>=e.split("::[").length-1?-1<s[s.length-2]?e.substring(0,s[s.length-2])+o[s[s.length-1]]+i.measureName:"parent":-1<(n=e.lastIndexOf("~~")>e.lastIndexOf("::[")?e.lastIndexOf("~~"):e.lastIndexOf("::["))?e.substring(0,n):"parent"}else r=-1<(n=e.lastIndexOf("~~")>e.lastIndexOf("::[")?e.lastIndexOf("~~"):e.lastIndexOf("::["))?e.substring(0,n):"parent";return r},S.prototype.performColumnSpanning=function(){for(var h={},p=this.rowStartPos-1,u=Object.keys(this.colMeasures).length,c=this.tupColumnInfo[0]?this.tupColumnInfo[0].measurePosition:this.measureIndex,e=p;-1<e;e--)if(3===this.pivotValues[e][1].memberType){c=e;break}for(;-1<p;){h[p]={};for(var g=this.pivotValues[p].length-1,m=this;0<g;)!function(){h[p][g]=1;var t,e,i,a=m.pivotValues[p][g+1],r=m.pivotValues[p+1]&&1<m.rowStartPos-p?m.pivotValues[p+1][g]:void 0,n=m.pivotValues[p][g],s=!1,o=!1,l=m.tupColumnInfo[n.ordinal],d=l.allStartPos>("3"===l.typeCollection[0]?1:0),l=m.checkAttributeDrill(l.drillInfo,"columns");m.showSubTotalsAtTop&&n.isDrilled&&a&&a.actualText!==n.actualText&&-1<n.level&&(n.ordinal=m.getOrdinal(n,m.pivotValues[p+1])),r&&a&&(2===n.memberType||-1===n.level?a.actualText===n.actualText:3===n.memberType&&n.actualText===a.actualText||a.valueSort.levelName===n.valueSort.levelName)&&(2===n.memberType?d&&"sum"!==a.type?n.colSpan=1:n.colSpan=a.colSpan+1>(p<c?u:0)?1:a.colSpan+1:(t=m.dataSourceSettings.valueSortSettings.headerDelimiter,i=(e=[n,a].map(function(e){return e.valueSort.levelName.toString().split(t)}))[0],e=e[1],i.slice(0,-1).join(t)===e.slice(0,-1).join(t)?(n.colSpan=a.colSpan+1,n.ordinal=a.ordinal):n.colSpan=1),s=!0),2===n.memberType?(d?(l||(n.type="sum"),n.formattedText="Total",n.valueSort[n.valueSort.levelName.toString()]=1):(n.type="grand sum",n.formattedText="Grand Total",p<m.measureIndex&&(n.valueSort.levelName=i="Grand Total",n.valueSort[i.toString()]=1)),n.hasChild=!1):-1===n.level&&(n.type="sum",n.formattedText="Total",n.hasChild=!1,n.valueSort[n.valueSort.levelName.toString()]=1),r?2===n.memberType&&2===r.memberType||r.actualText===n.actualText?(h[p][g]=h[p+1]?h[p+1][g]+1:1,0===p||1===n.memberType&&-1<n.level&&1===r.memberType&&-1===r.level?(n.rowSpan=!n.isDrilled||m.fieldList[n.hierarchy]&&m.fieldList[n.hierarchy].isHierarchy&&!n.hasChild?h[p+1][g]+1:1,r.rowSpan=!r.isDrilled||m.fieldList[r.hierarchy]&&m.fieldList[r.hierarchy].isHierarchy&&!r.hasChild||-1!==r.level?r.rowSpan:h[p+1][g]):3===n.memberType?n.rowSpan=1:n.rowSpan=-1,o=!0):!n.isDrilled||m.fieldList[n.hierarchy]&&m.fieldList[n.hierarchy].isHierarchy&&!n.hasChild||-1!==n.level||2!==r.memberType?(n.rowSpan=0===p?h[p][g]:-1,r.rowSpan=-1<r.level&&(!r.isDrilled||m.fieldList[r.hierarchy]&&m.fieldList[r.hierarchy].isHierarchy&&!r.hasChild)||2!==n.memberType&&2===r.memberType?h[p+1][g]:1):(h[p][g]=h[p+1]?h[p+1][g]+1:1,n.rowSpan=-1,o=!0):n.rowSpan=-1<n.level||1===m.rowStartPos?h[p][g]:-1,s||(n.colSpan=1),o||(h[p][g]=1),g--}();p--}},S.prototype.getOrdinal=function(e,t){for(var i=0,a=e.colIndex;0<a;a--)if(-1===t[a].level){i=t[a].ordinal;break}return i},S.prototype.frameValues=function(e,t){var i,a=this.pivotValues.length,r=0<a?this.pivotValues.findIndex(function(e){return e&&!_e.isNullOrUndefined(e[0])}):this.colDepth,n=0;"down"===this.customArgs.action&&(i=Object.keys(this.onDemandDrillEngine),r=Number(i[0]),a=Number(i[i.length-1])+1,n=this.onDemandDrillEngine[r][0].ordinal);for(var s=r;s<a;s++)for(var o,l,d,h,p,u,c,g=this.pivotValues[s],m=g[0].ordinal,S=1;S<this.pivotValues[0].length;S++)this.pivotValues[this.colDepth-1][S]&&(o=this.pivotValues[this.colDepth-1][S].ordinal,l=this.pivotValues[this.colDepth-1][S],l=3===g[0].memberType?g[0].actualText.toString():this.tupColumnInfo[l.ordinal]&&this.tupColumnInfo[l.ordinal].measure?this.tupColumnInfo[l.ordinal].measure.querySelector("UName").textContent:g[0].actualText,"header"===g[0].type?g[S]={axis:"value",actualText:this.getUniqueName(l),formattedText:"",value:0,colIndex:S,rowIndex:s}:(h=void 0,p="0",l=this.getUniqueName(l),c=!0,u=!this.fieldList[g[0].hierarchy]||!this.fieldList[g[0].hierarchy].isHierarchy||g[0].isDrilled,c=this.tupRowInfo[m]?this.tupRowInfo[m].showTotals:(d=0===this.dataSourceSettings.rows.length||1===this.dataSourceSettings.rows.length&&"[Measures]"===this.dataSourceSettings.rows[0].name,this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals||d),d=e[(m-n)*t+o],h=this.showSubTotalsAtBottom&&g[0].isDrilled||!c&&u?"":_e.isNullOrUndefined(d)||_e.isNullOrUndefined(d.querySelector("FmtValue"))?this.emptyCellTextContent:d.querySelector("FmtValue").textContent,p=!c&&u?"0":_e.isNullOrUndefined(d)||_e.isNullOrUndefined(d.querySelector("Value"))?null:d.querySelector("Value").textContent,h=this.showSubTotalsAtBottom&&g[0].isDrilled?"":c&&!_e.isNullOrUndefined(p)?this.getFormattedValue(Number(p),l,""!==h?h:p):h,u=!this.tupColumnInfo[o]||0<this.tupColumnInfo[o].allCount||-1<this.tupColumnInfo[o].drillStartPos||!this.tupRowInfo[m]||0<this.tupRowInfo[m].allCount||-1<this.tupRowInfo[m].drillStartPos,c=!!this.tupRowInfo[m]&&(0===this.tupRowInfo[m].measurePosition?1===this.tupRowInfo[m].allStartPos:0===this.tupRowInfo[m].allStartPos)||!!this.tupColumnInfo[o]&&(0===this.tupColumnInfo[o].measurePosition?1===this.tupColumnInfo[o].allStartPos:0===this.tupColumnInfo[o].allStartPos),g[S]={axis:"value",actualText:l,formattedText:h,colOrdinal:o,rowOrdinal:m,columnHeaders:this.tupColumnInfo[o]?this.tupColumnInfo[o].captionCollection:"",rowHeaders:this.tupRowInfo[m]?this.tupRowInfo[m].captionCollection:"",value:_e.isNullOrUndefined(p)?null:Number(p),colIndex:S,rowIndex:s,isSum:u,isGrandSum:c}),this.valueContent[s-this.rowStartPos][S]=g[S])},S.prototype.getFormattedValue=function(e,t,i){return this.formatFields[t]&&!_e.isNullOrUndefined(e)&&(t=this.formatFields[t].properties||this.formatFields[t],delete(t=_e.extend({},t,null,!0)).name,!t.minimumSignificantDigits&&t.minimumSignificantDigits<1&&delete t.minimumSignificantDigits,!t.maximumSignificantDigits&&t.maximumSignificantDigits<1&&delete t.maximumSignificantDigits,i=t.type?this.globalize.formatDate(new Date(e.toString()),t):(delete t.type,this.globalize.formatNumber(e,t))),i},S.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(0<i.length){if(this.isMeasureAvail){for(var s=!1,o=0,l=0,d=this.rows.length;l<d;l++)if("[measures]"===this.rows[l].name.toLowerCase()){t="row",e=l,s=!0,o=this.dataSourceSettings.rows.length,this.olapRowValueIndex=e;break}if(!s)for(l=0,d=this.columns.length;l<d;l++)if("[measures]"===this.columns[l].name.toLowerCase()){t="column",e=l,s=!0,o=this.dataSourceSettings.columns.length;break}this.olapValueAxis=t,this.measurePosition=e,this.measureIndex=e===o-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:[]}},S.prototype.frameMeasureOrder=function(e,k,t,i,a,j){var r=[],n=[],s=[],o={},l=[],d=e.measureAxis,h=e.measureIndex,p=e.valueInfo;if(d===k&&0<p.length){for(var u={},c=[],g=0,q=t.length;g<q;g++){for(var m=t[g],H=[].slice.call(m.querySelectorAll("Member")),S="",f="",v=0;v<H.length;)S=S+(""!==S?"~~":"")+H[v].querySelector("UName").textContent,(v===h&&0===h||v===h-1)&&(f=S),v++;u[f]?u[f][u[f].length]=S:(u[f]=[S],c[c.length]=f),o[S]={index:g,node:m},l[l.length]=S}if(0<l.length&&0<c.length)if(0===h){for(var y=0,V=p;y<V.length;y++)for(var U=V[y],b=0,_=c;b<_.length;b++)if((w=_[b])===U)for(var C=0,B=u[w];C<B.length;C++){S=B[C];s[s.length]=o[S].index,r[r.length]=o[S].node}}else for(var x=0,G=c;x<G.length;x++)for(var w=G[x],T=0,z=p;T<z.length;T++)for(var W=z[T],M=0,Q=u[w];M<Q.length;M++)(S=Q[M]).split("~~")[h]===W&&(s[s.length]=o[S].index,r[r.length]=o[S].node);var Y=[];if(0<i.length){for(var D=[],O=[],P=0,N=0,E=0,g=0,I=j;g<I;g++){a-1<N?(N=0,D[++E]||(D[E]=[])):D[E]||(D[E]=[]),D[E][N]=g,N++;var F=void 0;i[P]?F=this.olapVirtualization?g:Number(i[P].getAttribute("CellOrdinal")):P++,F===g&&(Y[O[g]=F]=i[P],P++)}if(i=Y,"column"===d){if(0<D.length&&D[0].length===s.length)for(v=0,I=s.length;v<I;v++)for(g=0;g<D.length;){var L=g*a+v;!_e.isNullOrUndefined(D[g])&&!_e.isNullOrUndefined(s[v])&&(R=(O[L]||L).toString(),A=i[Number(D[g][s[v]])])&&(A.setAttribute("CellOrdinal",R.toString()),n[L]=A),g++}}else if(D.length===s.length)for(v=0,I=s.length;v<I;v++)for(g=0;g<D[s[v]].length;){var A,R=(O[L=v*a+g]||L).toString();(A=i[Number(D[s[v]][g])])&&(A.setAttribute("CellOrdinal",R.toString()),n[n.length]=A),g++}}return{orderedHeaderTuples:r,orderedValueTuples:n}}return{orderedHeaderTuples:t,orderedValueTuples:i}},S.prototype.getDrilledSets=function(e,t,i,a){for(var r=[],n=t.actualText.toString(),s="row"===a?this.tupRowInfo:this.tupColumnInfo,a=s[t.ordinal],o=0===s[0].typeCollection.indexOf("3")?1:0,l=0,d="1"===s[0].typeCollection[i];l<s.length;)(_e.isNullOrUndefined(s[l].allStartPos)||s[l].allStartPos>o)&&(r[r.length]=s[l].uNameCollection),l++;for(var h=e.split("::[").map(function(e){return"["===e[0]?e:"["+e}),p=[],u=0;u<=i;u++)if(h[u])if((d||this.isPaging)&&u===i){for(var c=h[u].split("~~"),g=c.indexOf(n),m=[],S=0;S<=g;S++)m.push(c[S]);p[p.length]=0<m.length?m.join("~~"):h[u]}else p[p.length]=h[u];e=p.join("::");for(var f=[],v={},y=0,b=r;y<b.length;y++){var C=b[y];if(0===C.indexOf(e)&&(f.push(C),this.isPaging))for(var C=C.split("::[")[i],x=(M=(C="["===C[0]?C:"["+C).split("~~")).indexOf(n);x<M.length;x++)v[M[x]]=M[x]}if(this.isPaging){for(var w=a.uNameCollection.split("::[").map(function(e){return"["===e[0]?e:"["+e}),T=[],x=0;x<w.length;x++)x!==i&&(T[x]=w[x]);for(var M=Object.keys(v),x=0;x<M.length;x++)T[i]=M[x],f.push(T.join("::"))}for(var D={},O=0,P=f;O<P.length;O++){for(var N=P[O].split("::[").map(function(e){return"["===e[0]?e:"["+e}),E="",I=0;I<=i;I++){var F=N[I];F&&(E=E+(""!==E?"~~":"")+(F=F.split("~~"))[F.length-1])}D[E]=E}return D},S.prototype.updateDrilledInfo=function(e){this.dataSourceSettings=e,this.drilledMembers=e.drilledMembers?this.updateDrilledItems(e.drilledMembers):[],this.generateGridData(e)},S.prototype.updateCalcFields=function(e,t){this.dataSourceSettings=e,this.calculatedFieldSettings=e.calculatedFieldSettings||[],this.getAxisFields(),this.updateFieldlist(),this.loadCalculatedMemberElements(this.calculatedFieldSettings),this.dataFields[t.name]?this.generateGridData(e):uh.getCellSets(e,this,!0,void 0,!0)},S.prototype.onSort=function(e,t){this.dataSourceSettings=e,t||(this.sortSettings=e.sortSettings||[],this.getAxisFields(),this.frameSortObject(),this.updateFieldlist()),0<this.xmlaCellSet.length&&this.xmlDoc?this.generateEngine(this.xmlDoc,this.request,this.customArgs):this.generateGridData(e)},S.prototype.updateFieldlist=function(e){for(var t=0;t<this.savedFieldListData.length;){var i,a=this.savedFieldListData[t].id,r=this.savedFieldListData[t].pid;if(this.savedFieldList[a]&&(i=this.enableSort?this.sortObject[a]||"Ascending":"None",this.savedFieldList[a].isSelected=!1,this.savedFieldList[a].isExcelFilter=!1,this.savedFieldList[a].sort=i,this.savedFieldList[a].allowDragAndDrop=!0,this.savedFieldList[a].showFilterIcon=!0,this.savedFieldList[a].showSortIcon=!0,this.savedFieldList[a].showEditIcon=!0,this.savedFieldList[a].showRemoveIcon=!0,this.savedFieldList[a].showValueTypeIcon=!0,this.savedFieldList[a].showSubTotals=!0,this.savedFieldListData[t].sort=i,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[a].filter=[],this.savedFieldList[a].actualFilter=[]),this.dataFields[a]&&this.savedFieldList[a]&&-1<this.selectedItems.indexOf(a)?(this.savedFieldList[a].isSelected=!0,this.savedFieldList[a].allowDragAndDrop=!this.dataFields[a]||this.dataFields[a].allowDragAndDrop,this.savedFieldList[a].showFilterIcon=!this.dataFields[a]||this.dataFields[a].showFilterIcon,this.savedFieldList[a].showSortIcon=!this.dataFields[a]||this.dataFields[a].showSortIcon,this.savedFieldList[a].showEditIcon=!this.dataFields[a]||this.dataFields[a].showEditIcon,this.savedFieldList[a].showRemoveIcon=!this.dataFields[a]||this.dataFields[a].showRemoveIcon,this.savedFieldList[a].showValueTypeIcon=!this.dataFields[a]||this.dataFields[a].showValueTypeIcon,this.savedFieldList[a].showSubTotals=!this.dataFields[a]||this.dataFields[a].showSubTotals,this.savedFieldListData[t].isSelected=!0,this.savedFieldListData[t].allowDragAndDrop=!this.dataFields[a]||this.dataFields[a].allowDragAndDrop,this.savedFieldListData[t].showFilterIcon=!this.dataFields[a]||this.dataFields[a].showFilterIcon,this.savedFieldListData[t].showSortIcon=!this.dataFields[a]||this.dataFields[a].showSortIcon,this.savedFieldListData[t].showEditIcon=!this.dataFields[a]||this.dataFields[a].showEditIcon,this.savedFieldListData[t].showRemoveIcon=!this.dataFields[a]||this.dataFields[a].showRemoveIcon,this.savedFieldListData[t].showValueTypeIcon=!this.dataFields[a]||this.dataFields[a].showValueTypeIcon,this.savedFieldListData[t].showSubTotals=!this.dataFields[a]||this.dataFields[a].showSubTotals):this.dataFields[r]&&this.savedFieldList[r]&&-1<this.selectedItems.indexOf(r)?this.savedFieldListData[t].isSelected=!0:this.savedFieldListData[t].isSelected=!1,this.savedFieldList[a]&&this.savedFieldList[a].isCalculatedField||"[calculated members].[_0]"===a.toLowerCase()){for(var n=!1,s=0,o=this.calculatedFieldSettings;s<o.length;s++){var l,d,h=o[s];a===h.name&&(l=h.formula,d=h.formatString,this.savedFieldListData[t].formula=l,this.savedFieldListData[t].formatString=d,this.savedFieldListData[t].parentHierarchy=-1<l.toLowerCase().indexOf("measure")?void 0:h.hierarchyUniqueName,this.savedFieldList[a].formula=l,this.savedFieldList[a].formatString=d,this.savedFieldList[a].parentHierarchy=this.savedFieldListData[t].parentHierarchy,n=!0)}(!n&&"[calculated members].[_0]"!==a.toLowerCase()||"[calculated members].[_0]"===a.toLowerCase()&&0===this.calculatedFieldSettings.length)&&(this.savedFieldListData.splice(t,1),t--,this.savedFieldList[a])&&delete this.savedFieldList[a]}t++}this.fieldList=this.savedFieldList,this.fieldListData=this.savedFieldListData},S.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}}},S.prototype.getFormattedFields=function(e){this.formatFields={};for(var t=e.length;t--;)this.formatFields[e[t].name]=e[t]},S.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},S.prototype.validateCube=function(e,t,i){for(var e=[].slice.call(e.querySelectorAll("row")),a=!1,r=0,n=e;r<n.length;r++)if(n[r].querySelector("CUBE_NAME").textContent===i.dataSourceSettings.cube){a=!0;break}!a&&0<e.length&&(this.errorInfo="Invalid cube name "+this.dataSourceSettings.cube)},S.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"})},S.prototype.getTreeData=function(e,t,i){var a=this.getConnectionInfo(e.url,e.LCID),e='<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,e,t,i),this.errorInfo)throw this.errorInfo},S.prototype.getAxisFields=function(){this.rows=this.dataSourceSettings.rows||[],this.columns=this.dataSourceSettings.columns||[],this.filters=this.dataSourceSettings.filters||[],this.values=this.dataSourceSettings.values||[];for(var e=_e.extend([],this.rows,null,!0),t=(e=e.concat(this.columns,this.values,this.filters)).length;t--;)this.dataFields[e[t].name]=e[t],"[measures]"===e[t].name.toLowerCase()?this.isMeasureAvail=!0:this.selectedItems.push(e[t].name);if(this.mappingFields={},this.dataSourceSettings.fieldMapping)for(var i=0,a=this.dataSourceSettings.fieldMapping;i<a.length;i++){var r=a[i];this.mappingFields[r.name]=r}!this.isMeasureAvail&&0<this.values.length&&(("row"===this.valueAxis?this.rows:this.columns).push({name:"[Measures]",caption:"Measures",showRemoveIcon:!0,allowDragAndDrop:!0}),this.isMeasureAvail=!0)},S.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}if(i)return i},S.prototype.getUniqueName=function(e){for(var t=e,i=0,a=this.calculatedFieldSettings;i<a.length;i++){var r=a[i];if(e===(-1<r.formula.toLowerCase().indexOf("measure")?"[Measures].":r.hierarchyUniqueName+".")+"["+r.name+"]"){t=r.name;break}}return t},S.prototype.updateFilterItems=function(e){for(var t=(t=_e.extend([],this.rows,null,!0)).concat(this.columns),i=0,a=e;i<a.length;i++){var r=a[i];if("Include"===r.type&&this.allowMemberFilter&&this.fieldList[r.name]){var n=this.fieldList[r.name].members,s=n&&0<Object.keys(n).length,o=(this.fieldList[r.name].actualFilter=r.items.slice(),_e.extend([],r.items,null,!0));if(s)for(var l=0;l<o.length;){for(var d=0,h=this.getParentNode(o[l],n,[]);d<h.length;d++){var p=h[d],p=Ie.inArray(p,r.items);-1!==p&&r.items.splice(p,1)}l++}for(var u=[],c=0,g=r.items;c<g.length;c++){var m=g[c],S=void 0;s||1!==r.items.length||(this.getMembers(this.dataSourceSettings,r.name,void 0,void 0,void 0,r.items[0]),S=this.fieldList[r.name].actualFilter[0]),u.push(m),s?this.fieldList[r.name].filter.push(n[m].caption):this.fieldList[r.name].filter.push(S||m)}this.filterMembers[r.name]=u,this.fieldList[r.name].isExcelFilter=!1}else if((this.allowValueFilter||this.allowLabelFilter)&&-1!==["Date","Label","Number","Value"].indexOf(r.type))for(var f=0,v=t;f<v.length;f++)if(v[f].name===r.name){var y=this.filterMembers[r.name];y&&"object"==typeof y[0]&&y[0].type===r.type?y[y.length]=r:this.filterMembers[r.name]=[r],this.fieldList[r.name].isExcelFilter=!0;break}}},S.prototype.getParentNode=function(e,t,i){return t[e].parent&&e!==t[e].parent&&(e=t[e].parent,i.push(e),this.getParentNode(e,t,i)),i},S.prototype.updateDrilledItems=function(e){for(var t=[],i=(i=_e.extend([],this.rows,null,!0)).concat(this.columns),a=0,r=e;a<r.length;a++)for(var n=r[a],s=0,o=i;s<o.length;s++){var l=o[s];if(n.name===l.name){t.push(n);break}}return t},S.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=[],s="",o=0;o<this.filters.length;o++)if(i=this.filterMembers[this.filters[o].name]){for(var l=0;l<i.length;l++)s+=i[l],s=l<i.length-1?s+",":s+"";n[o]=s,s=""}for(o=0;o<n.length;o++)s=""===s?"{"+n[o]+"}":s+",{"+n[o]+"}";for(var d="",h="",o=0;o<a.length;o++)d=(0<d.length?d+",":"")+(1<a[o].split("~~").length?a[o].split("~~")[a[o].split("~~").length-1]:a[o]);for(o=0;o<r.length;o++)h=(0<h.length?h+",":"")+(1<r[o].split("~~").length?r[o].split("~~")[r[o].split("~~").length-1]:r[o]);e=(e="DRILLTHROUGH MAXROWS "+t+" Select("+(0<d.length?d:"")+(0<d.length&&0<h.length?",":"")+(0<h.length?h:"")+") on 0 from "+(""===s?"["+this.dataSourceSettings.cube+"]":"(SELECT ("+s+") ON COLUMNS FROM ["+this.dataSourceSettings.cube+"])")).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,"""),t=this.getSoapMsg(this.dataSourceSettings,e),e=this.getConnectionInfo(this.dataSourceSettings.url,this.dataSourceSettings.localeIdentifier);if(this.doAjaxPost("POST",e.url,t,this.drillThroughSuccess.bind(this),{dataSourceSettings:this.dataSourceSettings,action:"drillThrough"}),this.errorInfo)throw this.errorInfo},S.prototype.drillThroughSuccess=function(e){var t=[].slice.call(e.querySelectorAll("row")),i="";if(0<t.length){for(var a=[],r=0;r<t.length;){for(var n=[].slice.call(t[r].children),s=0;s<n.length;)a.push('"'+n[s].tagName+'":"'+n[s].textContent+'"'),s++;r++}for(var o=a[0],l=0;l<a.length;)Object.keys(JSON.parse("[{"+a[l]+"}]")[0])[0]===Object.keys(JSON.parse("[{"+o+"}]")[0])[0]?i+=""===i?"[{"+a[l]:"}, {"+a[l]:i+=","+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},S.prototype.getFilterMembers=function(e,t,i,a,r){var n=this.fieldList[t].levels,s=this.fieldList[t].levelCount,s=r?"Descendants({"+n[s].id+"}, "+n[i-1].id+", "+(i-s==1?"SELF)":"SELF_AND_BEFORE)"):t+", Descendants({"+n[0].id+"}, "+n[i-1].id+", SELF_AND_BEFORE)";return this.fieldList[t].levelCount=i,a||this.getMembers(e,t,!1,s,r),s},S.prototype.getMembers=function(e,t,i,a,r,n){var s="DIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CHILDREN_CARDINALITY, MEMBER_TYPE, MEMBER_VALUE",o=this.fieldList[t].hasAllMember,l=(o?t:t+".LEVELS(0)").replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,"""),i=i||n?n?"SELECT {"+(n=n.replace(/&/g,"&"))+"} ON 0 FROM ["+e.cube+"] WHERE {}":"SELECT ({"+l+".ALLMEMBERS})"+s+" ON 0 FROM ["+e.cube+"]":"SELECT ({"+(a||(o?l+", "+l+".CHILDREN":l+".ALLMEMBERS"))+"})"+s+" ON 0 FROM ["+e.cube+"]",a=this.getSoapMsg(e,i),o=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",o.url,a,(n?this.getOlapFilterText:this.generateMembers).bind(this),{dataSourceSettings:e,fieldName:t,loadLevelMembers:r,action:"fetchMembers"}),this.errorInfo)throw this.errorInfo},S.prototype.getOlapFilterText=function(e,t,i){e=[].slice.call(e.querySelectorAll('Axis[name="Axis0"] Tuple'));0<e.length&&this.fieldList[i.fieldName]&&e[e.length-1].getElementsByTagName("Caption")&&e[e.length-1].getElementsByTagName("Caption")[0]&&(this.fieldList[i.fieldName].actualFilter[0]=e[e.length-1].getElementsByTagName("Caption")[0].textContent)},S.prototype.getChildMembers=function(e,t,i){var t="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+"]",t=this.getSoapMsg(e,t),a=this.getConnectionInfo(e.url,e.localeIdentifier);if(this.doAjaxPost("POST",a.url,t,this.generateMembers.bind(this),{dataSourceSettings:e,fieldName:i,action:"fetchChildMembers"}),this.errorInfo)throw this.errorInfo},S.prototype.getCalcChildMembers=function(e,t){this.calcChildMembers=[];var t="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+"]",i=this.getConnectionInfo(e.url,e.localeIdentifier),t=this.getSoapMsg(e,t);if(this.doAjaxPost("POST",i.url,t,this.generateMembers.bind(this),{dataSourceSettings:e,action:"fetchCalcChildMembers"}),this.errorInfo)throw this.errorInfo},S.prototype.getSearchMembers=function(e,t,i,a,r,n){if(this.fieldList[t].searchMembers=[],this.fieldList[t].currrentMembers={},""!==i){var s=t.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,"""),r="WITH SET [SearchMembersSet] AS 'FILTER("+(r?s+".ALLMEMBERS, ":"{"+(1<n?this.getFilterMembers(e,t,n,!0):s+", "+s+".CHILDREN")+"},")+"(INSTR(1, "+s+'.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+"]",n=this.getSoapMsg(e,r),s=this.getConnectionInfo(e.url,e.localeIdentifier);if(this.doAjaxPost("POST",s.url,n,this.generateMembers.bind(this),{dataSourceSettings:e,fieldName:t,action:"fetchSearchMembers"}),this.errorInfo)throw this.errorInfo}},S.prototype.generateMembers=function(e,t,i){for(var a,e=[].slice.call(e.querySelectorAll('Axis[name="Axis0"] Tuple')),r=i.fieldName,n={},s=0,o=e;s<o.length;s++){var l,d=o[s],h=d.querySelector("Member"),p=h.querySelector("MEMBER_TYPE").textContent,u=h.querySelector("UName").textContent,c=h.querySelector("Caption").textContent,h=h.querySelector("PARENT_UNIQUE_NAME")?h.querySelector("PARENT_UNIQUE_NAME").textContent:"",g={"data-fieldName":r,"data-memberId":u};""===h&&"1"===p?(n={hasChildren:!!d.querySelector("CHILDREN_CARDINALITY")&&"0"!==d.querySelector("CHILDREN_CARDINALITY").textContent,isSelected:!1,id:u,tag:u,name:c,caption:c,htmlAttributes:g},"fetchMembers"===i.action||"fetchChildMembers"===i.action?(this.fieldList[r].members[u]={name:u,caption:c,parent:void 0,isNodeExpand:!1,isSelected:!1},this.fieldList[r].filterMembers.push(n),this.fieldList[r].childMembers.push(n)):"fetchSearchMembers"===i.action?(this.fieldList[r].currrentMembers[u]={name:u,caption:c,parent:void 0,isNodeExpand:!1,isSelected:!1},this.fieldList[r].searchMembers.push(n),n.expanded=!0):this.calcChildMembers.push(n)):""!==h&&"1"===p?h===a&&"1"===p?(n={hasChildren:!!d.querySelector("CHILDREN_CARDINALITY")&&"0"!==d.querySelector("CHILDREN_CARDINALITY").textContent,id:u,name:c,isSelected:!1,caption:c,htmlAttributes:g,tag:u},"fetchMembers"===i.action||"fetchChildMembers"===i.action?(this.fieldList[r].filterMembers.push(n),this.fieldList[r].childMembers.push(n),this.fieldList[r].members[u]={name:u,caption:c,parent:void 0,isNodeExpand:!1,isSelected:!1}):"fetchSearchMembers"===i.action?(n.expanded=!0,this.fieldList[r].searchMembers.push(n),this.fieldList[r].currrentMembers[u]={name:u,caption:c,parent:void 0,isNodeExpand:!1,isSelected:!1}):this.calcChildMembers.push(n)):"fetchMembers"===i.action&&this.fieldList[r].members[u]||(l=!!i.loadLevelMembers&&this.fieldList[r].members[h].isSelected,n={hasChildren:!!d.querySelector("CHILDREN_CARDINALITY")&&"0"!==d.querySelector("CHILDREN_CARDINALITY").textContent,htmlAttributes:g,isSelected:!1,id:u,pid:h,name:c,caption:c,tag:u},"fetchMembers"===i.action||"fetchChildMembers"===i.action?(this.fieldList[r].isHierarchy=!1,this.fieldList[r].filterMembers.push(n),this.fieldList[r].childMembers.push(n),this.fieldList[r].members[u]={name:u,caption:c,parent:h,isNodeExpand:!1,isSelected:l}):"fetchSearchMembers"===i.action?(this.fieldList[r].searchMembers.push(n),n.expanded=!0,this.fieldList[r].currrentMembers[u]={name:u,caption:c,parent:h,isNodeExpand:!1,isSelected:!1}):this.calcChildMembers.push(n)):"2"===p&&(a=u)}},S.prototype.getFieldListItems=function(e,t,i){for(var a=[],r=0,n=[].slice.call(e.querySelectorAll("row"));r<n.length;r++){var s=n[r],o=0<[].slice.call(s.querySelectorAll("ALL_MEMBER")).length,l=s.querySelector("DIMENSION_UNIQUE_NAME").textContent,d=s.querySelector("HIERARCHY_UNIQUE_NAME").textContent,h=l===d&&"[measures]"!==l.toLowerCase()&&"[measures]"!==d.toLowerCase();a.push({pid:this.isMondrian||h?l+"~#^Dim":l,id:d,name:s.querySelector("HIERARCHY_CAPTION").textContent,caption:s.querySelector("HIERARCHY_CAPTION").textContent,tag:d,hasAllMember:o,allMember:o?s.querySelectorAll("ALL_MEMBER")[0].textContent:void 0,type:"string"})}this.fieldListObj={hierarchy:a,hierarchySuccess:e,measures:[]};e={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(e,this.loadDimensionElements.bind(this),i)},S.prototype.loadCalculatedMemberElements=function(e){if(0<e.length){var t=this.fieldListData,i={hasChildren:!0,isSelected:!1,id:"[Calculated Members].[_0]",name:"[Calculated Members].[_0]",caption:"Calculated Members",spriteCssClass:"e-calcMemberGroupCDB "+W,tag:"[Calculated Members].[_0]",type:"string"};0<t.length&&"[measures]"===t[0].id.toLowerCase()&&t.splice(0,0,i);for(var a=0,r=e;a<r.length;a++){var n,s,o,l,d=r[a];this.fieldList[d.name]||(s=(-1<(n=d.formula).toLowerCase().indexOf("measure")?"[Measures].":d.hierarchyUniqueName+".")+"["+d.name+"]",l=this.dataFields[d.name]&&this.dataFields[d.name].caption?this.dataFields[d.name].caption:this.mappingFields[d.name]&&this.mappingFields[d.name].caption?this.mappingFields[d.name].caption:d.name,o=d.formatString,l={hasChildren:!1,isSelected:!1,id:d.name,pid:"[Calculated Members].[_0]",name:d.name,caption:l,spriteCssClass:"e-calc-member "+(-1<n.toLowerCase().indexOf("measure")?"e-calc-measure-icon":"e-calc-dimension-icon")+" "+W,tag:s,formula:n,formatString:o,aggregateType:void 0,type:"CalculatedField",filter:[],dateMember:[],sort:"Ascending",actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},isHierarchy:!0,isExcelFilter:!1,isCalculatedField:!0,allowDragAndDrop:this.dataFields[d.name]?this.dataFields[d.name].allowDragAndDrop:!this.mappingFields[d.name]||this.mappingFields[d.name].allowDragAndDrop,showFilterIcon:this.dataFields[d.name]?this.dataFields[d.name].showFilterIcon:!this.mappingFields[d.name]||this.mappingFields[d.name].showFilterIcon,showSortIcon:this.dataFields[d.name]?this.dataFields[d.name].showSortIcon:!this.mappingFields[d.name]||this.mappingFields[d.name].showSortIcon,showEditIcon:this.dataFields[d.name]?this.dataFields[d.name].showEditIcon:!this.mappingFields[d.name]||this.mappingFields[d.name].showEditIcon,showRemoveIcon:this.dataFields[d.name]?this.dataFields[d.name].showRemoveIcon:!this.mappingFields[d.name]||this.mappingFields[d.name].showRemoveIcon,showValueTypeIcon:this.dataFields[d.name]?this.dataFields[d.name].showValueTypeIcon:!this.mappingFields[d.name]||this.mappingFields[d.name].showValueTypeIcon,showSubTotals:this.dataFields[d.name]?this.dataFields[d.name].showSubTotals:!this.mappingFields[d.name]||this.mappingFields[d.name].showSubTotals,fieldType:-1<n.toLowerCase().indexOf("measure")?"Measure":"Dimension",parentHierarchy:-1<n.toLowerCase().indexOf("measure")?void 0:d.hierarchyUniqueName},t.push(l),this.fieldList[l.id]=l,this.updateMembersOrder(d.name))}}},S.prototype.loadDimensionElements=function(e,t,i){for(var a=[],r=[].slice.call(e.querySelectorAll("row")),n={},s=0,o=r;s<o.length;s++){var l=o[s],d=l.querySelector("DIMENSION_UNIQUE_NAME").textContent,h=l.querySelector("DEFAULT_HIERARCHY").textContent,p=l.querySelector("DIMENSION_CAPTION").textContent,h=d===h;0<=d.toLowerCase().indexOf("[measure")?n={hasChildren:!0,isSelected:!1,id:d,name:d,caption:p,spriteCssClass:"[measures]"===d.toLowerCase()?"e-measureGroupCDB-icon "+W:"e-dimensionCDB-icon "+W,tag:d,type:"string"}:_e.isNullOrUndefined(r[0].querySelector("HIERARCHY_CAPTION"))&&a.push({hasChildren:!0,isSelected:!1,id:this.isMondrian||h?d+"~#^Dim":d,name:d,caption:p,spriteCssClass:"e-dimensionCDB-icon "+W,tag:d,defaultHierarchy:l.querySelector("DEFAULT_HIERARCHY").textContent,type:"string"})}a.splice(0,0,n),this.fieldListData=a;e={catalog:i.dataSourceSettings.catalog,cube:i.dataSourceSettings.cube,url:i.dataSourceSettings.url,LCID:i.dataSourceSettings.localeIdentifier.toString(),request:"MDSCHEMA_SETS",roles:i.dataSourceSettings.roles};this.getTreeData(e,this.loadNamedSetElements.bind(this),i)},S.prototype.loadNamedSetElements=function(e,t,i){for(var a=(a=_e.extend([],this.rows,null,!0)).concat(this.columns,this.filters),r=this.fieldListData,n=[],s=0,o=a;s<o.length;s++){var l=o[s];n.push(l.name)}for(var d=[],h=0,p=[].slice.call(e.querySelectorAll("row"));h<p.length;h++){var l=p[h],u=(0<=d.indexOf(l.querySelector("DIMENSIONS").textContent.split(".")[0])||(r.push({hasChildren:!0,isSelected:!1,pid:l.querySelector("DIMENSIONS").textContent.split(".")[0],id:l.querySelector("SET_DISPLAY_FOLDER").textContent+"_"+l.querySelector("DIMENSIONS").textContent.split(".")[0],name:l.querySelector("SET_DISPLAY_FOLDER").textContent,spriteCssClass:"e-folderCDB-icon "+W+" namedSets",caption:l.querySelector("SET_DISPLAY_FOLDER").textContent,type:"string"}),d.push(l.querySelector("DIMENSIONS").textContent.split(".")[0])),"["+l.querySelector("SET_NAME").textContent.trim()+"]"),c={hasChildren:!0,isNamedSets:!0,isSelected:0<=n.indexOf("["+l.querySelector("SET_NAME").textContent+"]"),pid:l.querySelector("SET_DISPLAY_FOLDER").textContent+"_"+l.querySelector("DIMENSIONS").textContent.split(".")[0],id:u,name:l.querySelector("SET_CAPTION").textContent,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("SET_CAPTION").textContent,spriteCssClass:"e-namedSetCDB-icon "+W,tag:l.querySelector("EXPRESSION").textContent,type:"string",filter:[],dateMember:[],actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},isHierarchy:!0,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};r.push(c),this.fieldList[u]=c,this.updateMembersOrder(u)}i.hierarchy=this.fieldListData,i.hierarchySuccess=this.fieldListObj.hierarchySuccess,this.loadHierarchyElements(i)},S.prototype.loadHierarchyElements=function(e){for(var t=e.hierarchySuccess,i=e.hierarchy,a=[],r=0,n=_e.extend([],this.rows,null,!0).concat(this.columns,this.filters);r<n.length;r++){var s=n[r];a.push(s.name)}for(var o=0,l=[].slice.call(t.querySelectorAll("row"));o<l.length;o++){for(var d=(s=l[o]).querySelector("DIMENSION_UNIQUE_NAME").textContent,h=s.querySelector("HIERARCHY_UNIQUE_NAME").textContent,p=0<[].slice.call(s.querySelectorAll("ALL_MEMBER")).length,u=void 0,c=(u=p?(c=s.querySelectorAll("ALL_MEMBER")[0].textContent.replace(/[&[\]']+/g,"").split("."))[c.length-1].trim():void 0,s.querySelector("HIERARCHY_DISPLAY_FOLDER")?s.querySelector("HIERARCHY_DISPLAY_FOLDER").textContent:""),g=[],m=0,S=i;m<S.length;m++)(y=S[m]).tag===d&&g.push(y);if(0<g.length){var f=d===h&&"[measures]"!==d.toLowerCase()&&"[measures]"!==h.toLowerCase();if("[measures]"!==d.toLowerCase()&&"[measures]"!==h.toLowerCase()){var v=d+(this.isMondrian||f?"~#^Dim":"");if(""!==c){for(var y,b=d+(this.isMondrian||f?"~#^Dim":"")+"_"+c,C=[],x=0,w=i;x<w.length;x++)(y=w[x]).tag===b&&y.pid===v&&C.push(y);0===C.length&&(f={hasChildren:!0,isSelected:!1,pid:d+(this.isMondrian||f?"~#^Dim":""),id:b,name:c,spriteCssClass:"e-folderCDB-icon "+W,tag:b,caption:c,type:"string"},i.push(f)),v=b}f={hasChildren:!s.querySelector("HIERARCHY_ORIGIN")||"2"!==s.querySelector("HIERARCHY_ORIGIN").textContent&&"6"!==s.querySelector("HIERARCHY_ORIGIN").textContent,isSelected:0<=a.indexOf(h),pid:v,id:h,name:s.querySelector("HIERARCHY_CAPTION").textContent,spriteCssClass:(!s.querySelector("HIERARCHY_ORIGIN")||"2"!==s.querySelector("HIERARCHY_ORIGIN").textContent&&"6"!==s.querySelector("HIERARCHY_ORIGIN").textContent?"e-hierarchyCDB-icon":"e-attributeCDB-icon")+" "+W,hasAllMember:p,allMember:u,tag:h,caption:this.dataFields[h]&&this.dataFields[h].caption?this.dataFields[h].caption:this.mappingFields[h]&&this.mappingFields[h].caption?this.mappingFields[h].caption:s.querySelector("HIERARCHY_CAPTION").textContent,type:"string",filter:[],dateMember:[],sort:this.enableSort?this.sortObject[h]||"Ascending":"None",actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},levels:[],levelCount:1,isHierarchy:!!s.querySelector("HIERARCHY_ORIGIN")&&("2"===s.querySelector("HIERARCHY_ORIGIN").textContent||"6"===s.querySelector("HIERARCHY_ORIGIN").textContent),isExcelFilter:!1,allowDragAndDrop:this.dataFields[h]?this.dataFields[h].allowDragAndDrop:!this.mappingFields[h]||this.mappingFields[h].allowDragAndDrop,showFilterIcon:this.dataFields[h]?this.dataFields[h].showFilterIcon:!this.mappingFields[h]||this.mappingFields[h].showFilterIcon,showSortIcon:this.dataFields[h]?this.dataFields[h].showSortIcon:!this.mappingFields[h]||this.mappingFields[h].showSortIcon,showEditIcon:this.dataFields[h]?this.dataFields[h].showEditIcon:!this.mappingFields[h]||this.mappingFields[h].showEditIcon,showRemoveIcon:this.dataFields[h]?this.dataFields[h].showRemoveIcon:!this.mappingFields[h]||this.mappingFields[h].showRemoveIcon,showValueTypeIcon:this.dataFields[h]?this.dataFields[h].showValueTypeIcon:!this.mappingFields[h]||this.mappingFields[h].showValueTypeIcon,showSubTotals:this.dataFields[h]?this.dataFields[h].showSubTotals:!this.mappingFields[h]||this.mappingFields[h].showSubTotals};i.push(f),this.fieldList[h]=f,this.updateMembersOrder(h)}}}t={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(t,this.loadLevelElements.bind(this),e)},S.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}}},S.prototype.loadLevelElements=function(e,t,i){for(var a=[],r=this.fieldListData,a=[],n=0,s=[].slice.call(e.querySelectorAll("row"));n<s.length;n++){var o,l,d,h=s[n];1!==parseInt(h.querySelector("LEVEL_TYPE").textContent,10)&&"[measures]"!==h.querySelector("HIERARCHY_UNIQUE_NAME").textContent.toLowerCase()&&(o=h.querySelector("HIERARCHY_UNIQUE_NAME").textContent,d=h.querySelector("LEVEL_UNIQUE_NAME").textContent,l=h.querySelector("LEVEL_CAPTION").textContent,d={hasChildren:!1,isChecked:!1,isSelected:this.fieldList[o].isSelected,pid:o,id:d,name:l,tag:d,spriteCssClass:"e-level-members e-hierarchy-level-"+parseInt(h.querySelector("LEVEL_NUMBER").textContent,10)+"-icon "+W,caption:l,type:"string"},a.push(d),this.fieldList[o]&&this.fieldList[o].spriteCssClass&&-1===this.fieldList[o].spriteCssClass.indexOf("e-attributeCDB-icon")?(this.fieldList[o].levels.push(d),this.fieldList[o].isHierarchy=!1):this.fieldList[o].isHierarchy=!0)}this.fieldListData=r=r.concat(a);e={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(e,this.loadMeasureElements.bind(this),i)},S.prototype.loadMeasureElements=function(e,t,i){for(var a,r,n=this.fieldListData,s=[],o=[],l=0,d=_e.extend([],this.values,null,!0);l<d.length;l++){var h=d[l];o.push(h.name)}"en-US"!==this.locale&&(r={catalog:i.dataSourceSettings.catalog,cube:i.dataSourceSettings.cube,url:i.dataSourceSettings.url,LCID:i.dataSourceSettings.localeIdentifier.toString(),request:"MDSCHEMA_MEASUREGROUPS",roles:i.dataSourceSettings.roles},this.getTreeData(r,this.loadMeasureGroups.bind(this),i));for(var p=0,u=[].slice.call(e.querySelectorAll("row"));p<u.length;p++){var h=u[p],c=_e.isNullOrUndefined(h.querySelector("MEASUREGROUP_NAME"))?"":h.querySelector("MEASUREGROUP_NAME").textContent,g=h.querySelector("MEASURE_UNIQUE_NAME").textContent,m=h.querySelector("DEFAULT_FORMAT_STRING")?h.querySelector("DEFAULT_FORMAT_STRING").textContent:"#,#",S=h.querySelector("MEASURE_AGGREGATOR")?h.querySelector("MEASURE_AGGREGATOR").textContent:"1";if(!(0<=s.indexOf(c))){if("en-US"!==this.locale){for(var f=[],v=0,y=this.fieldListObj.measuresGroups;v<y.length;v++){var b=y[v];b.querySelector("MEASUREGROUP_NAME").textContent===c&&f.push(b)}a=0<f.length?f[0].querySelector("MEASUREGROUP_CAPTION").textContent:c}else a=c;""!==c&&(n.push({hasChildren:!0,isChecked:!1,isSelected:!1,pid:"[Measures]",id:c,name:a,spriteCssClass:"e-measureCDB e-folderCDB-icon "+W,tag:c,caption:a,aggregateType:this.getAggregateType(c,S),type:"string"}),s.push(c))}S={hasChildren:!1,isSelected:0<=o.indexOf(g),pid:""===c?"[Measures]":c,id:g,name:h.querySelector("MEASURE_CAPTION").textContent,spriteCssClass:"e-measure-icon "+W,tag:g,caption:this.dataFields[g]&&this.dataFields[g].caption?this.dataFields[g].caption:this.mappingFields[g]&&this.mappingFields[g].caption?this.mappingFields[g].caption:h.querySelector("MEASURE_CAPTION").textContent,aggregateType:this.getAggregateType(g,S),type:"number",filter:[],actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},formatString:m,allowDragAndDrop:this.dataFields[g]?this.dataFields[g].allowDragAndDrop:!this.mappingFields[g]||this.mappingFields[g].allowDragAndDrop,showFilterIcon:this.dataFields[g]?this.dataFields[g].showFilterIcon:!this.mappingFields[g]||this.mappingFields[g].showFilterIcon,showSortIcon:this.dataFields[g]?this.dataFields[g].showSortIcon:!this.mappingFields[g]||this.mappingFields[g].showSortIcon,showEditIcon:this.dataFields[g]?this.dataFields[g].showEditIcon:!this.mappingFields[g]||this.mappingFields[g].showEditIcon,showRemoveIcon:this.dataFields[g]?this.dataFields[g].showRemoveIcon:!this.mappingFields[g]||this.mappingFields[g].showRemoveIcon,showValueTypeIcon:this.dataFields[g]?this.dataFields[g].showValueTypeIcon:!this.mappingFields[g]||this.mappingFields[g].showValueTypeIcon,showSubTotals:this.dataFields[g]?this.dataFields[g].showSubTotals:!this.mappingFields[g]||this.mappingFields[g].showSubTotals};n.push(S),this.fieldList[g]=S,0<=o.indexOf(g)&&o.splice(o.indexOf(g),1)}this.measureReportItems=o},S.prototype.loadMeasureGroups=function(e){_e.isNullOrUndefined(this.fieldListObj)&&(this.fieldListObj={}),this.fieldListObj.measuresGroups=[].slice.call(e.querySelectorAll("row"))},S.prototype.doAjaxPost=function(e,t,i,a,r){var n=this;new _e.Ajax({mode:!1,contentType:"text/xml",url:t,data:i,dataType:"xml",type:e,beforeSend:this.beforeSend.bind(this),onSuccess:function(e,t){var e=(new DOMParser).parseFromString(e,"text/xml"),i=e.querySelector("Body");i.querySelector("OlapInfo")||i.querySelector("DiscoverResponse")||(i.querySelector("Fault")&&i.querySelector("Fault").querySelector("faultstring")?n.errorInfo=i.querySelector("Fault").querySelector("faultstring").innerHTML:i.querySelector("return")&&i.querySelector("return").querySelector("Error")&&(n.errorInfo=i.querySelector("return").querySelector("Error").getAttribute("Description"))),a(e,t,r)},onFailure:function(e){n.errorInfo=e}}).send()},S.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))},S.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>"},S.prototype.getConnectionInfo=function(e,t){var i={url:"",LCID:_e.isNullOrUndefined(t)?"1033":t.toString()};if(""!==e)for(var a=0,r=e.split(";");a<r.length;a++){var n=r[a];n.toLowerCase().indexOf("locale")<0&&0===i.url.length?i.url=n:0<=n.toLowerCase().indexOf("locale")&&(i.LCID=n.replace(/ /g,"").split("=")[1])}return i},S.prototype.getMDXQuery=function(e){return uh.getCellSets(e,this,!0,void 0,!0),this.mdxQuery};var gh=S;function S(){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}Sh.prototype.drawHeader=function(e,t){var i=t.pageSettings.size,e=e.header,a=new U.PointF(0,e&&e.fromTop?e.fromTop:0),i=new U.SizeF(i.width-80,e&&e.height?.75*e.height:50),a=new U.RectangleF(a,i);t.template.top=this.drawPageTemplate(new U.PdfPageTemplateElement(a),e)},Sh.prototype.drawFooter=function(e,t){var i=t.pageSettings.size,e=e.footer,a=new U.PointF(0,i.width-80-(e&&e.fromBottom?.75*e.fromBottom:0)),i=new U.SizeF(i.width-80,e&&e.height?.75*e.height:50),a=new U.RectangleF(a,i);t.template.bottom=this.drawPageTemplate(new U.PdfPageTemplateElement(a),e)},Sh.prototype.drawPageTemplate=function(e,t){for(var i=0,a=t.contents;i<a.length;i++){var r=a[i];switch(this.processContentValidation(r),r.type){case"Text":if(""===r.value||_e.isNullOrUndefined(r.value)||"string"!=typeof r.value)throw new Error("please enter the valid input value in text content...");this.drawText(e,r);break;case"PageNumber":this.drawPageNumber(e,r);break;case"Image":if(_e.isNullOrUndefined(r.src)||""===r.src)throw new Error("please enter the valid base64 string in image content...");this.drawImage(e,r);break;case"Line":this.drawLine(e,r)}}return e},Sh.prototype.processContentValidation=function(e){if(_e.isNullOrUndefined(e.type))throw new Error("please set valid content type...");if("Line"===e.type){if(_e.isNullOrUndefined(e.points))throw new Error("please enter valid points in "+e.type+" content...");if(_e.isNullOrUndefined(e.points.x1)||"number"!=typeof e.points.x1)throw new Error("please enter valid x1 co-ordinate in "+e.type+" points...");if(_e.isNullOrUndefined(e.points.y1)||"number"!=typeof e.points.y1)throw new Error("please enter valid y1 co-ordinate in "+e.type+" points...");if(_e.isNullOrUndefined(e.points.x2)||"number"!=typeof e.points.x2)throw new Error("please enter valid x2 co-ordinate in "+e.type+" points...");if(_e.isNullOrUndefined(e.points.y2)||"number"!=typeof e.points.y2)throw new Error("please enter valid y2 co-ordinate in "+e.type+" points...")}else{if(_e.isNullOrUndefined(e.position))throw new Error("please enter valid position in "+e.type+" content...");if(_e.isNullOrUndefined(e.position.x)||"number"!=typeof e.position.x)throw new Error("please enter valid x co-ordinate in "+e.type+" position...");if(_e.isNullOrUndefined(e.position.y)||"number"!=typeof e.position.y)throw new Error("please enter valid y co-ordinate in "+e.type+" position...")}},Sh.prototype.drawText=function(e,t){var i=this.getFontFromContent(t),a=this.getBrushFromContent(t),r=null,n=(_e.isNullOrUndefined(t.style)||_e.isNullOrUndefined(t.style.textPenColor)||(n=this.hexDecToRgb(t.style.textPenColor),r=new U.PdfPen(new U.PdfColor(n.r,n.g,n.b))),null==a&&null==r&&(a=new U.PdfSolidBrush(new U.PdfColor(0,0,0))),t.value.toString()),s=.75*t.position.x,o=.75*t.position.y,l=new U.PdfStringFormat,t=(_e.isNullOrUndefined(t.stringFormat)||(l=t.stringFormat),this.setContentFormat(t,l));null===t||_e.isNullOrUndefined(t.format)||_e.isNullOrUndefined(t.size)?e.graphics.drawString(n,i,r,a,s,o,l):e.graphics.drawString(n,i,r,a,s,o,t.size.width,t.size.height,t.format)},Sh.prototype.drawPageNumber=function(e,t){var i,a,r,n=this.getFontFromContent(t),s=null,o=(s=_e.isNullOrUndefined(t.style)||_e.isNullOrUndefined(t.style.textBrushColor)?new U.PdfSolidBrush(new U.PdfColor(0,0,0)):(o=this.hexDecToRgb(t.style.textBrushColor),new U.PdfSolidBrush(new U.PdfColor(o.r,o.g,o.b))),new U.PdfPageNumberField(n,s)),o=(o.numberStyle=this.getPageNumberStyle(t.pageNumberType),r=_e.isNullOrUndefined(t.format)?new U.PdfCompositeField(n,s,a="{0}",o):(r="$current",-1!==t.format.indexOf(l="$total")&&-1!==t.format.indexOf(r)?((i=new U.PdfPageCountField(n)).numberStyle=this.getPageNumberStyle(t.pageNumberType),a=t.format.indexOf(l)>t.format.indexOf(r)?(a=t.format.replace(r,"0")).replace(l,"1"):(a=t.format.replace(r,"1")).replace(l,"0"),new U.PdfCompositeField(n,s,a,o,i)):-1!==t.format.indexOf(r)&&-1===t.format.indexOf(l)?(a=t.format.replace(r,"0"),new U.PdfCompositeField(n,s,a,o)):(i=new U.PdfPageCountField(n),a=t.format.replace(l,"0"),new U.PdfCompositeField(n,s,a,i))),.75*t.position.x),l=.75*t.position.y,n=this.setContentFormat(t,r.stringFormat);null===n||_e.isNullOrUndefined(n.format)||_e.isNullOrUndefined(n.size)||(r.stringFormat=n.format,r.bounds=new U.RectangleF(o,l,n.size.width,n.size.height)),r.draw(e.graphics,o,l)},Sh.prototype.drawImage=function(e,t){var i=.75*t.position.x,a=.75*t.position.y,r=_e.isNullOrUndefined(t.size)||_e.isNullOrUndefined(t.size.width)?void 0:.75*t.size.width,n=_e.isNullOrUndefined(t.size)||_e.isNullOrUndefined(t.size.height)?void 0:.75*t.size.height,t=new U.PdfBitmap(t.src);_e.isNullOrUndefined(r)?e.graphics.drawImage(t,i,a):e.graphics.drawImage(t,i,a,r,n)},Sh.prototype.drawLine=function(e,t){var i=.75*t.points.x1,a=.75*t.points.y1,r=.75*t.points.x2,n=.75*t.points.y2,s=this.getPenFromContent(t);_e.isNullOrUndefined(t.style)||(_e.isNullOrUndefined(t.style.penSize)||"number"!=typeof t.style.penSize||(s.width=.75*t.style.penSize),s.dashStyle=this.getDashStyle(t.style.dashStyle)),e.graphics.drawLine(s,i,a,r,n)},Sh.prototype.getFontFromContent=function(e){var t=_e.isNullOrUndefined(e.font)||_e.isNullOrUndefined(e.font.fontSize)?_e.isNullOrUndefined(e.style)||_e.isNullOrUndefined(e.style.fontSize)?9.75:.75*e.style.fontSize:.75*e.font.fontSize,i=_e.isNullOrUndefined(e.font)||_e.isNullOrUndefined(e.font.pdfFontFamily)?U.PdfFontFamily.TimesRoman:e.font.pdfFontFamily,a=U.PdfFontStyle.Regular;return _e.isNullOrUndefined(e.font)||_e.isNullOrUndefined(e.font.bold)||(a|=U.PdfFontStyle.Bold),_e.isNullOrUndefined(e.font)||_e.isNullOrUndefined(e.font.italic)||(a|=U.PdfFontStyle.Italic),_e.isNullOrUndefined(e.font)||_e.isNullOrUndefined(e.font.underline)||(a|=U.PdfFontStyle.Underline),_e.isNullOrUndefined(e.font)||_e.isNullOrUndefined(e.font.strikeout)||(a|=U.PdfFontStyle.Strikeout),new U.PdfStandardFont(i,t,a)},Sh.prototype.getPenFromContent=function(e){var t=new U.PdfPen(new U.PdfColor(0,0,0));return _e.isNullOrUndefined(e.style)||null===e.style||_e.isNullOrUndefined(e.style.penColor)||(e=this.hexDecToRgb(e.style.penColor),t=new U.PdfPen(new U.PdfColor(e.r,e.g,e.b))),t},Sh.prototype.getBrushFromContent=function(e){var t=null;return _e.isNullOrUndefined(e.style)||_e.isNullOrUndefined(e.style.textBrushColor)||(e=this.hexDecToRgb(e.style.textBrushColor),t=new U.PdfSolidBrush(new U.PdfColor(e.r,e.g,e.b))),t},Sh.prototype.setContentFormat=function(e,t){if(_e.isNullOrUndefined(e.size))return null;var i=.75*e.size.width,a=.75*e.size.height;if(t=new U.PdfStringFormat(U.PdfTextAlignment.Left,U.PdfVerticalAlignment.Middle),!_e.isNullOrUndefined(e.style)&&!_e.isNullOrUndefined(e.style.hAlign))switch(e.style.hAlign){case"Right":t.alignment=U.PdfTextAlignment.Right;break;case"Center":t.alignment=U.PdfTextAlignment.Center;break;case"Justify":t.alignment=U.PdfTextAlignment.Justify}if(!_e.isNullOrUndefined(e.style)&&!_e.isNullOrUndefined(e.style.vAlign))switch(e.style.vAlign){case"Bottom":t.lineAlignment=U.PdfVerticalAlignment.Bottom;break;case"Top":t.lineAlignment=U.PdfVerticalAlignment.Top}return{format:t,size:new U.SizeF(i,a)}},Sh.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}},Sh.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}},Sh.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);e=parseInt(e,16);return{r:e>>16&255,g:e>>8&255,b:255&e}};var mh=Sh;function Sh(){}vh.prototype.getModuleName=function(){return"chartExport"},vh.prototype.pdfChartExport=function(i,a,r,n){var s=this,e=[this.parent.chart],e=this.getChartInfo(e),o=e.width,l=e.height,d=this.parent.chart.svgObject;this.parent.enableRtl&&e.svg&&e.svg.querySelector("#"+this.parent.element.id+"_chart_svg").setAttribute("direction","rtl");this.parent.chart.enableCanvas||(d=_e.createElement("canvas",{id:"ej2-canvas",attrs:{width:o.toString(),height:l.toString()}}));var h=window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(e.svg)],{type:"image/svg+xml"})),p=new Image,u=d.getContext("2d");return p.src=h,new Promise(function(t){p.onload=function(){var e=_e.isNullOrUndefined(a)?new U.PdfDocument:a;u.drawImage(p,0,0),window.URL.revokeObjectURL(h),s.exportPdf(d,e,r,n,o,l,i),t(e)}})},vh.prototype.getChartInfo=function(e,a){var r,n=0,s=0,o=this.parent.chart.enableCanvas,l=new E.SvgRenderer("").createSvg({id:"Svg_Export_Element",width:200,height:200});return e.map(function(e){var t=e.svgObject.cloneNode(!0),i=e.renderer.createGroup({style:_e.isNullOrUndefined(a)||a?"transform: translateY("+s+"px)":"transform: translateX("+n+"px)"});"transparent"===(r=t.childNodes[0]?t.childNodes[0].getAttribute("fill"):"transparent")&&(r=-1<e.theme.indexOf("Dark")||"HighContrast"===e.theme?"rgba(0, 0, 0, 1)":"rgba(255, 255, 255, 1)"),o||i.appendChild(t),n=e.availableSize.width,s=e.availableSize.height,o||l.appendChild(i)}),o||(l.setAttribute("width",n+""),l.setAttribute("height",s+""),l.setAttribute("style","background-color: "+r+";")),{width:n,height:s,svg:l}},vh.prototype.exportPdf=function(e,t,i,a,r,n,s){var o,l=t.sections.add(),d=t.pageSettings.width,h=t.pageSettings.height,p=t.pageSettings.margins,r=r+p.left+p.right,p=(t.pageSettings.size=new U.SizeF(r,h),this.exportProperties.fileName||(_e.isNullOrUndefined(s)||_e.isNullOrUndefined(s.fileName)?"default":s.fileName)),h=(this.exportProperties.width||this.exportProperties.height?(t.pageSettings.orientation=this.exportProperties.width>this.exportProperties.height||!this.exportProperties.height&&this.exportProperties.width>h||!this.exportProperties.width&&d>this.exportProperties.height?U.PdfPageOrientation.Landscape:U.PdfPageOrientation.Portrait,t.pageSettings.size=new U.SizeF(this.exportProperties.width||d,this.exportProperties.height||h)):(t.pageSettings.orientation=0===this.exportProperties.orientation||this.exportProperties.orientation?this.exportProperties.orientation:_e.isNullOrUndefined(s)||_e.isNullOrUndefined(s.pageOrientation)||"Landscape"===s.pageOrientation?U.PdfPageOrientation.Landscape:U.PdfPageOrientation.Portrait,_e.isNullOrUndefined(s)||_e.isNullOrUndefined(s.pageSize)||(t.pageSettings.size=Ie.getPageSize(s.pageSize))),_e.isNullOrUndefined(this.exportProperties.pdfMargins)||((d=t.pageSettings.margins).top=(_e.isNullOrUndefined(this.exportProperties.pdfMargins.top)?d:this.exportProperties.pdfMargins).top,d.bottom=(_e.isNullOrUndefined(this.exportProperties.pdfMargins.bottom)?d:this.exportProperties.pdfMargins).bottom,d.left=(_e.isNullOrUndefined(this.exportProperties.pdfMargins.left)?d:this.exportProperties.pdfMargins).left,d.right=(_e.isNullOrUndefined(this.exportProperties.pdfMargins.right)?d:this.exportProperties.pdfMargins).right),l.setPageSettings(t.pageSettings),t.pageSettings.height),d=(d=e.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream")).slice(d.indexOf(",")+1),e=new U.PdfBitmap(d),d=l.pages.add(),l=(_e.isNullOrUndefined(s)||_e.isNullOrUndefined(s.header)||this.pdfExportHelper.drawHeader(s,t),_e.isNullOrUndefined(s)||_e.isNullOrUndefined(s.footer)||this.pdfExportHelper.drawFooter(s,t),d.graphics.drawImage(e,0,0,h<n||this.exportProperties.width||t.pageSettings.size?d.getClientSize().width:r,h<n?d.getClientSize().height:n),a||i?a&&(o=t.save()):(t.save(p+".pdf"),t.destroy()),{type:"PDF",promise:a?o:null});return this.parent.trigger(da,l),new Promise(function(){})},vh.prototype.destroy=function(){this.exportProperties&&(this.exportProperties=null),this.pdfExportHelper&&(this.pdfExportHelper=null)};var fh=vh;function vh(e){this.parent=e,this.pdfExportHelper=new mh}yh=function(e,t){return(yh=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])}))(e,t)};var yh,bh,Dl=function(e,t){function i(){this.constructor=e}yh(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},c=function(e,t,i,a){var r,n=arguments.length,s=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(n<3?r(s):3<n?r(t,i,s):r(t,i))||s);return 3<n&&s&&Object.defineProperty(t,i,s),s},Ch=function(n,s,o,l){return new(o=o||Promise)(function(e,t){function i(e){try{r(l.next(e))}catch(e){t(e)}}function a(e){try{r(l.throw(e))}catch(e){t(e)}}function r(t){t.done?e(t.value):new o(function(e){e(t.value)}).then(i,a)}r((l=l.apply(n,s||[])).next())})},xh=function(a,r){var n,s,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,s&&(o=2&t[0]?s.return:t[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,t[1])).done)return o;switch(s=0,(t=o?[2&t[0],o.value]:t)[0]){case 0:case 1:o=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(o=0<(o=l.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3]))l.label=t[1];else if(6===t[0]&&l.label<o[1])l.label=o[1],o=t;else{if(!(o&&l.label<o[2])){o[2]&&l.ops.pop(),l.trys.pop();continue}l.label=o[2],l.ops.push(t)}}t=r.call(a,l)}catch(e){t=[6,e],s=0}finally{n=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},$l=(bh=_e.ChildProperty,Dl(wh,bh),c([_e.Property(!0)],wh.prototype,"showFilterIcon",void 0),c([_e.Property(!0)],wh.prototype,"showSortIcon",void 0),c([_e.Property(!0)],wh.prototype,"showRemoveIcon",void 0),c([_e.Property(!0)],wh.prototype,"showValueTypeIcon",void 0),c([_e.Property("Both")],wh.prototype,"displayMode",void 0),c([_e.Property(!0)],wh.prototype,"allowDragAndDrop",void 0),c([_e.Property(!1)],wh.prototype,"showFieldsPanel",void 0),wh);function wh(){return null!==bh&&bh.apply(this,arguments)||this}Th=_e.ChildProperty,Dl(Mh,Th),c([_e.Property(!1)],Mh.prototype,"allowAdding",void 0),c([_e.Property(!1)],Mh.prototype,"allowEditing",void 0),c([_e.Property(!1)],Mh.prototype,"allowDeleting",void 0),c([_e.Property(!1)],Mh.prototype,"allowCommandColumns",void 0),c([_e.Property(!1)],Mh.prototype,"allowInlineEditing",void 0),c([_e.Property("Normal")],Mh.prototype,"mode",void 0),c([_e.Property(!0)],Mh.prototype,"allowEditOnDblClick",void 0),c([_e.Property(!0)],Mh.prototype,"showConfirmDialog",void 0),c([_e.Property(!1)],Mh.prototype,"showDeleteConfirmDialog",void 0);var Th,id=Mh;function Mh(){return null!==Th&&Th.apply(this,arguments)||this}Dh=_e.ChildProperty,Dl(Oh,Dh),c([_e.Property()],Oh.prototype,"measure",void 0),c([_e.Property()],Oh.prototype,"label",void 0),c([_e.Property("NotEquals")],Oh.prototype,"conditions",void 0),c([_e.Property()],Oh.prototype,"value1",void 0),c([_e.Property()],Oh.prototype,"value2",void 0);var Dh,nd=Oh;function Oh(){return null!==Dh&&Dh.apply(this,arguments)||this}Ph=_e.ChildProperty,Dl(Nh,Ph),c([_e.Property(!1)],Nh.prototype,"showHyperlink",void 0),c([_e.Property(!1)],Nh.prototype,"showRowHeaderHyperlink",void 0),c([_e.Property(!1)],Nh.prototype,"showColumnHeaderHyperlink",void 0),c([_e.Property(!1)],Nh.prototype,"showValueCellHyperlink",void 0),c([_e.Property(!1)],Nh.prototype,"showSummaryCellHyperlink",void 0),c([_e.Collection([],nd)],Nh.prototype,"conditionalSettings",void 0),c([_e.Property()],Nh.prototype,"headerText",void 0),c([_e.Property("")],Nh.prototype,"cssClass",void 0);var Ph,ld=Nh;function Nh(){return null!==Ph&&Ph.apply(this,arguments)||this}Eh=_e.ChildProperty,Dl(Ih,Eh),c([_e.Property(5)],Ih.prototype,"columnPageSize",void 0),c([_e.Property(5)],Ih.prototype,"rowPageSize",void 0),c([_e.Property(1)],Ih.prototype,"currentColumnPage",void 0),c([_e.Property(1)],Ih.prototype,"currentRowPage",void 0);var Eh,Dd=Ih;function Ih(){return null!==Eh&&Eh.apply(this,arguments)||this}Fh=_e.ChildProperty,Dl(Lh,Fh),c([_e.Property("Bottom")],Lh.prototype,"position",void 0),c([_e.Property(!1)],Lh.prototype,"isInversed",void 0),c([_e.Property(!0)],Lh.prototype,"showRowPager",void 0),c([_e.Property(!0)],Lh.prototype,"showColumnPager",void 0),c([_e.Property(!0)],Lh.prototype,"showRowPageSize",void 0),c([_e.Property(!0)],Lh.prototype,"showColumnPageSize",void 0),c([_e.Property([10,50,100,200])],Lh.prototype,"rowPageSizes",void 0),c([_e.Property([5,10,20,50,100])],Lh.prototype,"columnPageSizes",void 0),c([_e.Property(!1)],Lh.prototype,"enableCompactView",void 0),c([_e.Property()],Lh.prototype,"template",void 0);var Fh,fd=Lh;function Lh(){return null!==Fh&&Fh.apply(this,arguments)||this}Ah=_e.ChildProperty,Dl(Rh,Ah),c([_e.Property("Table")],Rh.prototype,"view",void 0),c([_e.Property("Table")],Rh.prototype,"primary",void 0);var Ah,Nd=Rh;function Rh(){return null!==Ah&&Ah.apply(this,arguments)||this}kh=_e.ChildProperty,Dl(jh,kh),c([_e.Property(!1)],jh.prototype,"allowSinglePage",void 0);var kh,wd=jh;function jh(){return null!==kh&&kh.apply(this,arguments)||this}qh=_e.Component,Dl(f,qh),f.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&&(0<this.toolbar.length||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},f.prototype.preRender=function(){this.dataSourceSettings&&"SSAS"===this.dataSourceSettings.providerType?(this.dataType="olap",this.olapEngineModule=new gh):(this.dataType="pivot",this.engineModule=new ia),this.isAdaptive=_e.Browser.isDevice,_e.Browser.isIE||"edge"===_e.Browser.info.name?this.scrollerBrowserLimit=15e5:"chrome"===_e.Browser.info.name&&(this.scrollerBrowserLimit=15e6),this.isTouchMode=!!_e.closest(this.element,"e-bigger"),this.initProperties(),this.renderToolTip(),this.keyboardModule=new Qo(this),this.contextMenuModule=new Ko(this),this.globalize=new _e.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 Zs(this)),!this.chartSettings.enableExport||"Both"!==this.displayOption.view&&"Chart"!==this.displayOption.view||(this.chartExportModule=new fh(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 _e.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.renderContextMenu(),this.isDragging=!1,this.pivotDeferLayoutUpdate=_e.isNullOrUndefined(this.pivotDeferLayoutUpdate)?this.allowDeferLayoutUpdate:this.pivotDeferLayoutUpdate,this.addInternalEvents()},f.prototype.onBeforeTooltipOpen=function(e){e.element.classList.add("e-pivottooltipwrap")},f.prototype.renderToolTip=function(){this.showTooltip?(this.tooltipTemplate?this.tooltip=new P.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 P.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()},f.prototype.renderContextMenu=function(){if(this.gridSettings.contextMenuItems||this.allowGrouping&&"pivot"===this.dataType){var e=[],t=[],i=[],a=[],r=[],n=[],s=[];if(this.gridSettings.contextMenuItems)for(var o=0,l=this.gridSettings.contextMenuItems;o<l.length;o++){var d,h=l[o];"string"==typeof h&&-1!==this.getDefaultItems().indexOf(h)?-1!==h.toString().toLowerCase().indexOf("aggregate")&&"pivot"===this.dataType?(s=[{text:this.localeObj.getConstant("Sum")}],(d=this.buildDefaultItems("Aggregate")).items=s,r.push(d)):(-1!==h.toString().toLowerCase().indexOf("export")?a:e).push(this.buildDefaultItems(h)):"string"!=typeof h&&i.push(h)}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"))),0<a.length&&((p=this.buildDefaultItems("export")).items=a,n.push(p));var p=[];Array.prototype.push.apply(p,r),Array.prototype.push.apply(p,e),Array.prototype.push.apply(p,t),Array.prototype.push.apply(p,n),Array.prototype.push.apply(p,i),this.setProperties({gridSettings:{contextMenuItems:p}},!0)}},f.prototype.getFieldByID=function(e,t){return new ce.DataManager({json:t}).executeLocal((new ce.Query).where("id","equal",e))[0]},f.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"]},f.prototype.getDefaultItems=function(){return["Drillthrough","Expand","Collapse","Pdf Export","Excel Export","Csv Export","Sort Ascending","Sort Descending","Aggregate","CalculatedField"]},f.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 "+W};break;case"export":t={text:this.localeObj.getConstant("export"),target:"td.e-valuescontent",id:this.element.id+"_exporting",iconCss:"e-pivotview-export "+W};break;case"Pdf Export":t={text:this.localeObj.getConstant("pdf"),id:this.element.id+"_pdf",iconCss:xi+" "+W};break;case"Excel Export":t={text:this.localeObj.getConstant("excel"),id:this.element.id+"_excel",iconCss:wi+" "+W};break;case"Csv Export":t={text:this.localeObj.getConstant("csv"),id:this.element.id+"_csv",iconCss:Ti+" "+W};break;case"Expand":t={text:this.localeObj.getConstant("expand"),target:"td.e-rowsheader,.e-columnsheader",id:this.element.id+"_expand",iconCss:"e-pivotview-expand "+W};break;case"Collapse":t={text:this.localeObj.getConstant("collapse"),target:"td.e-rowsheader,.e-columnsheader",id:this.element.id+"_collapse",iconCss:"e-pivotview-collapse "+W};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 "+W};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 "+W};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 "+W};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 "+W}}return this.defaultItems[e]={text:t.text,id:t.id,target:t.target,iconCss:t.iconCss},this.defaultItems[e]},f.prototype.initProperties=function(){var e;this.isTabular="Tabular"===this.gridSettings.layout,this.pivotRefresh=_e.Component.prototype.refresh,this.minHeight=_e.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||void 0,this.headerCellInfo=this.gridSettings.headerCellInfo||void 0,this.resizing=this.gridSettings.resizing||void 0,this.resizeStop=this.gridSettings.resizeStop||void 0,this.pdfHeaderQueryCellInfo=this.gridSettings.pdfHeaderQueryCellInfo||void 0,this.pdfQueryCellInfo=this.gridSettings.pdfQueryCellInfo||void 0,this.excelHeaderQueryCellInfo=this.gridSettings.excelHeaderQueryCellInfo||void 0,this.excelQueryCellInfo=this.gridSettings.excelQueryCellInfo||void 0,this.columnDragStart=this.gridSettings.columnDragStart||void 0,this.columnDrag=this.gridSettings.columnDrag||void 0,this.columnDrop=this.gridSettings.columnDrop||void 0,this.beforeColumnsRender=this.gridSettings.columnRender||void 0,this.selected=this.gridSettings.cellSelected||void 0,this.selecting=this.gridSettings.cellSelecting||void 0,this.cellDeselected=this.gridSettings.cellDeselected||void 0,this.rowSelected=this.gridSettings.rowSelected||void 0,this.rowDeselected=this.gridSettings.rowDeselected||void 0,this.chartTooltipRender=this.chartSettings.tooltipRender||void 0,this.chartLegendClick=this.chartSettings.legendClick||void 0,this.chartLoaded=this.chartSettings.loaded||void 0,this.chartLoad=this.chartSettings.load||void 0,this.chartResized=this.chartSettings.resized||void 0,this.chartAxisLabelRender=this.chartSettings.axisLabelRender||void 0,this.multiLevelLabelClick=this.chartSettings.multiLevelLabelClick||void 0,this.chartPointClick=this.chartSettings.pointClick||void 0,this.contextMenuClick=this.gridSettings.contextMenuClick||void 0,this.contextMenuOpen=this.gridSettings.contextMenuOpen||void 0,this.beforePdfExport=this.gridSettings.beforePdfExport||void 0,this.beforeExcelExport=this.gridSettings.beforeExcelExport||void 0,this.beforePrint=this.chartSettings.beforePrint||void 0,this.animationComplete=this.chartSettings.animationComplete||void 0,this.legendRender=this.chartSettings.legendRender||void 0,this.textRender=this.chartSettings.textRender||void 0,this.pointRender=this.chartSettings.pointRender||void 0,this.seriesRender=this.chartSettings.seriesRender||void 0,this.chartMouseMove=this.chartSettings.chartMouseMove||void 0,this.chartMouseClick=this.chartSettings.chartMouseClick||void 0,this.pointMove=this.chartSettings.pointMove||void 0,this.chartMouseLeave=this.chartSettings.chartMouseLeave||void 0,this.chartMouseDown=this.chartSettings.chartMouseDown||void 0,this.chartMouseUp=this.chartSettings.chartMouseUp||void 0,this.dragComplete=this.chartSettings.dragComplete||void 0,this.zoomComplete=this.chartSettings.zoomComplete||void 0,this.scrollStart=this.chartSettings.scrollStart||void 0,this.scrollEnd=this.chartSettings.scrollEnd||void 0,this.scrollChanged=this.chartSettings.scrollChanged||void 0,this.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 al(this)),this.currentView=this.currentView||("Both"===this.displayOption.view?this.displayOption.primary:this.displayOption.view),"pivot"!==this.dataType||"Server"===this.dataSourceSettings.mode||_e.isNullOrUndefined(this.dataSourceSettings.valueSortSettings.headerText)||""===this.dataSourceSettings.valueSortSettings.headerText||(e=void 0,"column"===this.dataSourceSettings.valueAxis?e={columnHeaderText:this.dataSourceSettings.valueSortSettings.headerText,columnSortOrder:this.dataSourceSettings.valueSortSettings.sortOrder}:"row"===this.dataSourceSettings.valueAxis&&(e={rowHeaderText:this.dataSourceSettings.valueSortSettings.headerText,rowSortOrder:this.dataSourceSettings.valueSortSettings.sortOrder}),this.setProperties({dataSourceSettings:{valueSortSettings:e}},!0))},f.prototype.updatePageSettings=function(e){var t,i,a;this.enableVirtualization&&((i=t=1)<this.dataSourceSettings.values.length&&"pivot"===this.dataType&&("row"===this.dataSourceSettings.valueAxis?i=this.dataSourceSettings.values.length:t=this.dataSourceSettings.values.length),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)})},f.prototype.render=function(){this.loadData()},f.prototype.loadData=function(){if(0<this.dataSourceSettings.formatSettings.length)for(var e=this.dataSourceSettings.formatSettings,t=0;t<e.length;t++)_e.isNullOrUndefined(e[t].maximumFractionDigits)&&_e.isNullOrUndefined(e[t].minimumFractionDigits)||null!==e[t].format.match(/^(P|N|C|P[0-9]|C[0-9]|N[0-9])$/g)||(e[t].maximumFractionDigits=void 0,e[t].minimumIntegerDigits=void 0);"pivot"===this.dataType&&this.dataSourceSettings.url&&""!==this.dataSourceSettings.url?"Server"===this.dataSourceSettings.mode?(this.guid=Ie.generateUUID(),this.initialLoad(),"Chart"!==this.displayOption.view?this.renderEmptyGrid():this.refreshData(),this.showWaitingPopup()):new _e.Fetch(this.dataSourceSettings.url,"GET").send().then(function(e){return"string"==typeof e?e:e.text()}).then(this.onReadyStateChange.bind(this)):this.initialLoad()},f.prototype.blobToString=function(t){return Ch(this,void 0,void 0,function(){return xh(this,function(e){switch(e.label){case 0:return[4,t];case 1:return[2,e.sent().text()]}})})},f.prototype.onSuccess=function(e){var t,i,a=this;if(this.request.readyState===XMLHttpRequest.DONE)if(this.isServerWaitingPopup=!0,"onExcelExport"===this.currentAction||"onCsvExport"===this.currentAction||"onPivotExcelExport"===this.currentAction||"onPivotCsvExport"===this.currentAction)200===this.request.status?(t=this.request.response,e=_e.isNullOrUndefined(e)?{}:e,e=_e.isNullOrUndefined(e.fileName)?"onExcelExport"===this.currentAction||"onPivotExcelExport"===this.currentAction?"default.xlsx":"default.csv":e.fileName,this.isBlobData||I.Save.save(e,t),e={type:"onExcelExport"===this.currentAction||"onPivotExcelExport"===this.currentAction?"xlsx":"csv",promise:this.isBlobData?t:null},this.isBlobData=!1,this.trigger(da,e),this.triggerAfterServiceInvoke()):this.blobToString(this.request.response).then(function(e){a.triggerAfterServiceInvoke(e)});else{try{this.triggerAfterServiceInvoke();var r=JSON.parse(this.request.responseText);if("fetchFieldMembers"===this.currentAction){for(var n=JSON.parse(r.members),s=[],o={},l=Ie.isDateField(r.memberName,this.engineModule),d="number"===this.engineModule.fieldList[r.memberName].type,h=Object.keys(n),p=0,u=h.length;p<u;p++){var c=n[h[p]],g=l?this.engineModule.getFormattedValue(c.Name,r.memberName):{formattedText:c.Caption};o[h[p]]={index:c.Index,ordinal:c.Ordinal,isDrilled:c.IsDrilled,caption:g.formattedText},s.push({formattedText:g.formattedText,actualText:l?g.actualText:!d||isNaN(Number(c.Name))?c.Name:Number(c.Name)})}this.engineModule.fieldList[r.memberName].members=o,this.engineModule.fieldList[r.memberName].dateMember=s,(this.showGroupingBar?this:this.pivotFieldListModule).pivotButtonModule.updateFilterEvents()}else if("fetchRawData"===this.currentAction){for(var m=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:"",f=JSON.parse(r.rawData),v=JSON.parse(r.indexObject),y={},b=0;b<v.length;b++)y[v[b].Key]=v[b].Value;this.drillThroughValue.indexObject=y,this.drillThroughModule.triggerDialog(m,S,f,this.drillThroughValue,this.drillThroughElement),this.hideWaitingPopup()}else{var C=JSON.parse(r.fieldList);if(this.engineModule.fieldList)for(h=Object.keys(this.engineModule.fieldList),p=0;p<h.length;p++)this.engineModule.fieldList[h[p]]&&C[h[p]]&&(C[h[p]].dateMember=this.engineModule.fieldList[h[p]].dateMember,C[h[p]].formattedMembers=this.engineModule.fieldList[h[p]].formattedMembers,C[h[p]].members=this.engineModule.fieldList[h[p]].members);this.engineModule.fieldList=C,this.engineModule.fields=JSON.parse(r.fields),this.engineModule.rowCount=JSON.parse(r.pivotCount).RowCount,this.engineModule.columnCount=JSON.parse(r.pivotCount).ColumnCount,this.engineModule.rowStartPos=JSON.parse(r.pivotCount).RowStartPosition,this.engineModule.colStartPos=JSON.parse(r.pivotCount).ColumnStartPosition,this.engineModule.rowFirstLvl=JSON.parse(r.pivotCount).RowFirstLevel,this.engineModule.colFirstLvl=JSON.parse(r.pivotCount).ColumnFirstLevel,this.engineModule.columnPageCount=JSON.parse(r.pivotCount).ColumnPageCount,this.engineModule.rowPageCount=JSON.parse(r.pivotCount).RowPageCount,this.engineModule.rowMaxLevel=JSON.parse(r.pivotCount).RowMaxLevel;for(var x=void 0,w=JSON.parse(r.pivotValue),T=0;T<w.length;T++)if(w[T]&&w[T][0]&&"row"===w[T][0].axis){x=T;break}this.engineModule.headerContent=Ie.frameContent(w,"header",x,this),this.engineModule.pageSettings=this.pageSettings;var M=JSON.parse(r.dataSourceSettings),D=(0<this.dataSourceSettings.groupSettings.length&&(this.setProperties({dataSourceSettings:{rows:M.rows}},!0),this.setProperties({dataSourceSettings:{columns:M.columns}},!0),this.setProperties({dataSourceSettings:{formatSettings:M.formatSettings}},!0)),M.valueSortSettings);this.engineModule.valueSortSettings={headerText:D.headerText,headerDelimiter:D.headerDelimiter,sortOrder:D.sortOrder,columnIndex:D.columnIndex},this.engineModule.pivotValues=w,this.engineModule.isEmptyData=r.isEmptyData,this.engineModule.isEngineUpdated=r.isEngineUpdated;for(var O=0,P=this.dataSourceSettings.values;O<P.length;O++){var N=P[O];this.engineModule.valueAxisFields[N.name]=N}this.engineModule.globalize=_e.isNullOrUndefined(this.globalize)?new _e.Internationalization:this.globalize,this.engineModule.formatFields=this.engineModule.setFormattedFields(this.dataSourceSettings.formatSettings)}}catch(e){this.engineModule.pivotValues=[]}"onScroll"===this.currentAction&&("vertical"===this.scrollDirection?(t="row"===this.dataSourceSettings.valueAxis?this.dataSourceSettings.values.length:1,i=this.pageSettings.rowPageSize*t*this.gridSettings.rowHeight*Math.ceil(this.engineModule.rowStartPos/(this.pageSettings.rowPageSize*t))-this.engineModule.rowFirstLvl*t*this.gridSettings.rowHeight,this.scrollPosObject.verticalSection=i):"horizondal"===this.scrollDirection&&(e="column"===this.dataSourceSettings.valueAxis?this.dataSourceSettings.values.length:1,i=this.pageSettings.columnPageSize*e*this.gridSettings.columnWidth*Math.ceil(this.engineModule.colStartPos/(this.pageSettings.columnPageSize*e))-this.engineModule.colFirstLvl*e*this.gridSettings.columnWidth,this.scrollPosObject.horizontalSection=i)),"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)}},f.prototype.triggerAfterServiceInvoke=function(e){e={action:this.currentAction,response:e||("string"==typeof this.request.response?this.request.responseText:this.request.response)};this.trigger(Er,e)},f.prototype.getEngine=function(e,t,i,a,r,n,s,o,l,d,h){for(var p=this,h=(this.engineModule.isEmptyData=!1,this.element.querySelector(".e-spin-hide")&&"onExcelExport"!==e&&"onCsvExport"!==e&&"onPivotExcelExport"!==e&&"onPivotCsvExport"!==e&&this.showWaitingPopup(),this.currentAction=e,this.isServerWaitingPopup=!1,{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(Ie.getLocalizedObject(this)),savedFieldList:"onDrop"===e&&null!==this.engineModule.fieldList?Ie.getClonedFieldList(this.engineModule.fieldList,!0):void 0,enableOptimizedRendering:this.enableVirtualization&&this.virtualScrollSettings&&this.virtualScrollSettings.allowSinglePage,requestType:"string",headers:{"Content-type":"application/json"},isTabular:this.isTabular,showFieldList:this.showFieldList||this.isStaticFieldList,showPivotChart:"Both"===this.displayOption.view||"Chart"===this.displayOption.view,chartType:this.chartSettings&&this.chartSettings.chartSeries&&this.chartSettings.chartSeries.type,showGroupingBar:this.showGroupingBar,showTooltip:this.showTooltip,chartSettings:h?JSON.parse(this.getPersistData()).chartSettings:null,gridSettings:h?JSON.parse(this.getPersistData()).gridSettings:null,enableAutoFit:this.grid&&this.grid.isAutoFitColumns}),u=(this.request.readyState!==XMLHttpRequest.UNSENT&&this.request.readyState!==XMLHttpRequest.OPENED||(this.request.withCredentials=!1),{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:s,fetchRawDataArgs:o,editArgs:l,hash:this.guid,excelExportProperties:d,exportAllPages:this.exportAllPages,isGroupingUpdated:"onRefresh"===this.currentAction&&0<this.dataSourceSettings.groupSettings.length||!!this.groupingModule&&this.groupingModule.isUpdate}),c=(this.trigger(Nr,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||"onPivotExcelExport"===u.action||"onPivotCsvExport"===u.action?this.request.responseType="blob":this.request.responseType="",Object.keys(u.internalProperties.headers)),g=0;g<c.length;g++){var m=c[g],S=String(u.internalProperties.headers[m]);this.request.setRequestHeader(m,S)}"string"===u.internalProperties.requestType?this.request.send(JSON.stringify(u)):"base64"===u.internalProperties.requestType&&this.request.send(btoa(JSON.stringify(u)))},f.prototype.getChartSettings=function(){var e=this.chartSettings.load,t=this.chartSettings.loaded,i=this.chartSettings.textRender,a=this.chartSettings.pointRender,r=this.chartSettings.seriesRender,n=this.chartSettings.legendRender,s=this.chartSettings.pointClick,o=this.chartSettings.tooltipRender,l=this.chartSettings.legendClick,d=this.chartSettings.multiLevelLabelRender,h=this.chartSettings.beforePrint,p=this.chartSettings.animationComplete,u=this.chartSettings.chartMouseMove,c=this.chartSettings.chartMouseClick,g=this.chartSettings.pointMove,m=this.chartSettings.chartMouseLeave,S=this.chartSettings.chartMouseDown,f=this.chartSettings.chartMouseUp,v=this.chartSettings.dragComplete,y=this.chartSettings.zoomComplete,b=this.chartSettings.scrollStart,C=this.chartSettings.scrollEnd,x=this.chartSettings.scrollChanged,w=(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,this.addOnPersist(["chartSettings"]));return this.chartSettings.load=e,this.chartSettings.loaded=t,this.chartSettings.textRender=i,this.chartSettings.pointRender=a,this.chartSettings.seriesRender=r,this.chartSettings.legendRender=n,this.chartSettings.pointClick=s,this.chartSettings.tooltipRender=o,this.chartSettings.legendClick=l,this.chartSettings.multiLevelLabelRender=d,this.chartSettings.beforePrint=h,this.chartSettings.animationComplete=p,this.chartSettings.chartMouseMove=u,this.chartSettings.chartMouseClick=c,this.chartSettings.pointMove=g,this.chartSettings.chartMouseLeave=m,this.chartSettings.chartMouseDown=S,this.chartSettings.chartMouseUp=f,this.chartSettings.dragComplete=v,this.chartSettings.zoomComplete=y,this.chartSettings.scrollStart=b,this.chartSettings.scrollEnd=C,this.chartSettings.scrollChanged=x,w},f.prototype.getPageSettings=function(){return this.addOnPersist(["pageSettings"])},f.prototype.onReadyStateChange=function(e){var t=[];if("CSV"===this.dataSourceSettings.type)for(var i=e.split(/\r?\n|\r/),a=0;a<i.length;a++)_e.isNullOrUndefined(i[a])||""===i[a]||t.push(i[a].split(","));else try{t=JSON.parse(e)}catch(e){t=[]}t&&0<t.length&&this.setProperties({dataSourceSettings:{dataSource:t}},!0),this.initialLoad()},f.prototype.initialLoad=function(){var t=this;try{this.cellTemplateFn=this.templateParser(this.cellTemplate),this.tooltipTemplateFn=this.templateParser(this.tooltipTemplate),this.spinnerTemplate?P.createSpinner({target:this.element,template:this.spinnerTemplate,cssClass:this.cssClass||void 0},this.createElement):P.createSpinner({target:this.element,cssClass:this.cssClass||void 0},this.createElement);var i={dataSourceSettings:this.dataSourceSettings,pivotview:this,fieldsType:{},defaultFieldListOrder:this.defaultFieldListOrder};this.trigger(aa,i,function(e){t.dataSourceSettings=e.dataSourceSettings,t.fieldsType=e.fieldsType,t.defaultFieldListOrder=i.defaultFieldListOrder,t.updateClass(),t.notify(Vr,{}),t.notify(Ar,{}),t.isAdaptive&&t.contextMenuModule.render(),t.notify(Gr,{}),t.notify(zr,{})})}catch(e){this.actionFailureMethod(e)}},f.prototype.addInternalEvents=function(){this.on(Ar,this.generateData,this),this.on(Hr,this.renderPivotGrid,this),this.on(qr,this.onContentReady,this)},f.prototype.removeInternalEvents=function(){this.off(Ar,this.generateData),this.off(Hr,this.renderPivotGrid),this.off(qr,this.onContentReady)},f.prototype.getPersistData=function(e){var t=this.gridSettings.columnRender,i=this.gridSettings.excelQueryCellInfo,a=this.gridSettings.excelHeaderQueryCellInfo,r=this.gridSettings.pdfQueryCellInfo,n=this.gridSettings.pdfHeaderQueryCellInfo,s=this.chartSettings.load,o=this.chartSettings.loaded,l=this.chartSettings.textRender,d=this.chartSettings.pointRender,h=this.chartSettings.seriesRender,p=this.chartSettings.legendRender,u=this.chartSettings.pointClick,c=this.chartSettings.tooltipRender,g=this.chartSettings.legendClick,m=this.chartSettings.multiLevelLabelRender,S=this.chartSettings.beforePrint,f=this.chartSettings.animationComplete,v=this.chartSettings.chartMouseMove,y=this.chartSettings.chartMouseClick,b=this.chartSettings.pointMove,C=this.chartSettings.chartMouseLeave,x=this.chartSettings.chartMouseDown,w=this.chartSettings.chartMouseUp,T=this.chartSettings.dragComplete,M=this.chartSettings.zoomComplete,D=this.chartSettings.scrollStart,O=this.chartSettings.scrollEnd,P=this.chartSettings.scrollChanged,N=(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,[]),E=(e&&(N=!this.dataSourceSettings.dataSource||this.dataSourceSettings.dataSource instanceof ce.DataManager?this.dataSourceSettings.dataSource:this.dataSourceSettings.dataSource.slice(),this.setProperties({dataSourceSettings:{dataSource:[]}},!0)),this.addOnPersist(["dataSourceSettings","pivotValues","gridSettings","chartSettings","displayOption","pageSettings"]));return this.gridSettings.columnRender=t,this.gridSettings.excelQueryCellInfo=i,this.gridSettings.excelHeaderQueryCellInfo=a,this.gridSettings.pdfQueryCellInfo=r,this.gridSettings.pdfHeaderQueryCellInfo=n,this.chartSettings.load=s,this.chartSettings.loaded=o,this.chartSettings.textRender=l,this.chartSettings.pointRender=d,this.chartSettings.seriesRender=h,this.chartSettings.legendRender=p,this.chartSettings.pointClick=u,this.chartSettings.tooltipRender=c,this.chartSettings.legendClick=g,this.chartSettings.multiLevelLabelRender=m,this.chartSettings.beforePrint=S,this.chartSettings.animationComplete=f,this.chartSettings.chartMouseMove=v,this.chartSettings.chartMouseClick=y,this.chartSettings.pointMove=b,this.chartSettings.chartMouseLeave=C,this.chartSettings.chartMouseDown=x,this.chartSettings.chartMouseUp=w,this.chartSettings.dragComplete=T,this.chartSettings.zoomComplete=M,this.chartSettings.scrollStart=D,this.chartSettings.scrollEnd=O,this.chartSettings.scrollChanged=P,e&&this.setProperties({dataSourceSettings:{dataSource:N}},!0),E},f.prototype.loadPersistData=function(e){e=JSON.parse(e);this.allowServerDataBinding=!1,this.setProperties({gridSettings:e.gridSettings,pivotValues:e.pivotValues,chartSettings:e.chartSettings,displayOption:e.displayOption},!0),"Chart"===e.displayOption.primary?this.currentView="Chart":this.currentView="Table",this.allowServerDataBinding=!0,this.dataSourceSettings&&this.dataSourceSettings.dataSource&&this.dataSourceSettings.dataSource instanceof ce.DataManager&&e.dataSourceSettings&&e.dataSourceSettings.dataSource&&e.dataSourceSettings.dataSource.dataSource&&this.dataSourceSettings.dataSource.dataSource&&e.dataSourceSettings.dataSource.dataSource.url===this.dataSourceSettings.dataSource.dataSource.url&&(e.dataSourceSettings.dataSource=this.dataSourceSettings.dataSource),this.dataSourceSettings=e.dataSourceSettings},f.prototype.mergePersistPivotData=function(){var e=window.localStorage.getItem(this.getModuleName()+this.element.id);_e.isNullOrUndefined(e)||""===e||(e=JSON.parse(e),this.dataSourceSettings&&this.dataSourceSettings.dataSource&&this.dataSourceSettings.dataSource instanceof ce.DataManager&&e.dataSourceSettings&&e.dataSourceSettings.dataSource&&e.dataSourceSettings.dataSource.dataSource&&this.dataSourceSettings.dataSource.dataSource&&e.dataSourceSettings.dataSource.dataSource.url===this.dataSourceSettings.dataSource.dataSource.url&&(e.dataSourceSettings.dataSource=this.dataSourceSettings.dataSource),this.setProperties(e,!0))},f.prototype.showConditionalFormattingDialog=function(){this.conditionalFormattingModule&&this.conditionalFormattingModule.showConditionalFormattingDialog()},f.prototype.createCalculatedFieldDialog=function(){this.calculatedFieldModule&&this.calculatedFieldModule.createCalculatedFieldDialog()},f.prototype.getModuleName=function(){return"pivotview"},f.prototype.copy=function(e){this.grid.copy(e)},f.prototype.onPropertyChanged=function(e,t){for(var i=!1,a=0,r=Object.keys(e);a<r.length;a++){var n,s,o=r[a];switch(o){case"dataSourceSettings":case"hyperlinkSettings":case"allowDrillThrough":case"editSettings":case"allowDataCompression":e.dataSourceSettings&&(!_e.isNullOrUndefined(e.dataSourceSettings.dataSource)&&!_e.isNullOrUndefined(this.clonedDataSet)&&this.clonedDataSet!==e.dataSourceSettings.dataSource&&!_e.isNullOrUndefined(e.dataSourceSettings.groupSettings)&&0<e.dataSourceSettings.groupSettings.length||1===Object.keys(e.dataSourceSettings).length&&"dataSource"===Object.keys(e.dataSourceSettings)[0]&&0<this.dataSourceSettings.groupSettings.length)&&(this.clonedDataSet=e.dataSourceSettings.dataSource,this.engineModule.groupingFields={}),e.dataSourceSettings&&1===Object.keys(e.dataSourceSettings).length&&e.dataSourceSettings.groupSettings&&"pivot"===this.dataType&&this.updateGroupingReport(e.dataSourceSettings.groupSettings,"Date"),-1<(_e.isNullOrUndefined(e.dataSourceSettings)?[]:Object.keys(e.dataSourceSettings)).indexOf("dataSource")&&"CSV"!==e.dataSourceSettings.type?(!_e.isNullOrUndefined(this.savedDataSourceSettings)&&0<this.dataSourceSettings.dataSource.length&&(Ie.updateDataSourceSettings(this,this.savedDataSourceSettings),this.savedDataSourceSettings=void 0),e.dataSourceSettings.dataSource&&0===e.dataSourceSettings.dataSource.length&&(this.savedDataSourceSettings=Ie.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(Ar,{})):Ie.isButtonIconRefesh(o,t,e)?(this.showGroupingBar&&this.groupingBarModule&&this.axisFieldModule.render(),this.showFieldList&&this.pivotFieldListModule&&(d=Ie.cloneFieldSettings(this.dataSourceSettings.rows),h=Ie.cloneFieldSettings(this.dataSourceSettings.columns),s=Ie.cloneFieldSettings(this.dataSourceSettings.values),n=Ie.cloneFieldSettings(this.dataSourceSettings.filters),this.pivotFieldListModule.setProperties({dataSourceSettings:{rows:d,columns:h,values:s,filters:n}},!0),this.pivotFieldListModule.axisFieldModule.render(),this.pivotFieldListModule.treeViewModule.fieldTable)&&!this.isAdaptive&&this.pivotFieldListModule.notify(Ur,{})):(this.remoteData=[],"pivot"===this.dataType&&this.dataSourceSettings.url&&""!==this.dataSourceSettings.url&&!_e.isNullOrUndefined(e.dataSourceSettings)&&("type"in e.dataSourceSettings||"url"in e.dataSourceSettings)?(this.engineModule.fieldList=null,this.loadData()):(e.dataSourceSettings&&("pivot"===this.dataType&&"dataSource"in e.dataSourceSettings||"olap"===this.dataType&&"url"in e.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(Ar,{})));break;case"height":case"width":this.layoutRefresh();break;case"pivotValues":case"displayOption":if(e.displayOption&&1===Object.keys(e.displayOption).length&&e.displayOption.view)switch(this.currentView="Both"===e.displayOption.view?this.displayOption.primary:e.displayOption.view,(this.showGroupingBar||this.showFieldList)&&(this.showFieldList&&this.pivotFieldListModule&&(this.pivotFieldListModule.destroyEngine=!0,this.pivotFieldListModule.destroy(),null!==_e.select("#"+this.element.id+"_PivotFieldList",this.element)&&_e.remove(_e.select("#"+this.element.id+"_PivotFieldList",this.element)),this.pivotFieldListModule.destroyEngine=!1),this.notify(Vr,this)),e.displayOption.view){case"Both":this.pivotChartModule||(this.pivotChartModule=new al(this)),this.grid||this.renderEmptyGrid();break;case"Chart":this.grid&&(this.grid.destroy(),this.grid=void 0,null!==(l=_e.select("#"+this.element.id+"_grid",this.element)))&&_e.remove(l),this.pivotChartModule||(this.pivotChartModule=new al(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&&!_e.isNullOrUndefined(e.displayOption)&&e.displayOption.view&&(this.currentView="Both"===e.displayOption.view?this.displayOption.primary:e.displayOption.view);this.showToolbar&&!_e.isNullOrUndefined(e.displayOption)&&e.displayOption.view&&("Chart"===e.displayOption.view?(this.toolbarModule.createChartMenu(),this.toggleButtonState(Pi,"add"),this.toggleButtonState(Ni,"remove")):"Table"===e.displayOption.view?((l=_e.select("#"+this.element.id+"_grid",this.element)).style.display="block",this.toggleButtonState(Ni,"add"),this.toggleButtonState(Pi,"remove")):(this.toolbarModule.createChartMenu(),this.toggleButtonState(Pi,"remove"),this.toggleButtonState(Ni,"remove")));var l,d="pivot"===this.dataType?this.engineModule:this.olapEngineModule;_e.isNullOrUndefined(d.fieldList)&&_e.isNullOrUndefined(d.pivotValues)||this.notify(Hr,{});break;case"gridSettings":this.isTabular="Tabular"===this.gridSettings.layout,this.lastGridSettings=e.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&&this.grid&&this.renderModule.updateGridSettings(),e.gridSettings.layout&&this.initialLoad();break;case"chartSettings":this.showGroupingBar&&this.groupingBarModule&&(-1!==Object.keys(e.chartSettings).indexOf("enableMultipleAxis")||e.chartSettings.chartSeries&&-1!==Object.keys(e.chartSettings.chartSeries).indexOf("type"))&&(this.groupingBarModule.renderLayout(),this.pivotChartModule)&&this.groupingBarModule.appendToElement(),_e.isNullOrUndefined(this.pivotChartModule)&&"Table"!==this.displayOption.view&&(this.pivotChartModule=new al(this));var h="pivot"===this.dataType?this.engineModule:this.olapEngineModule;_e.isNullOrUndefined(this.pivotChartModule)||_e.isNullOrUndefined(h.pivotValues)||this.pivotChartModule.loadChart(this,this.chartSettings),_e.isNullOrUndefined(h.pivotValues)||_e.isNullOrUndefined(h.fieldList)||this.notify(Rr,this);break;case"locale":case"currencyCode":case"enableRtl":this.tooltip&&this.tooltip.destroy(),this.dataSourceSettings.groupSettings&&0<this.dataSourceSettings.groupSettings.length&&this.clonedDataSet&&(s="CSV"===this.dataSourceSettings.type?Ie.getClonedCSVData(this.clonedDataSet):Ie.getClonedData(this.clonedDataSet),this.setProperties({dataSourceSettings:{dataSource:s}},!0)),qh.prototype.refresh.call(this),this.updateClass();break;case"enableValueSorting":this.enableValueSorting=e.enableValueSorting,this.updateDataSource();break;case"showGroupingBar":this.element.querySelector(".e-grouping-bar")?this.element.querySelector(".e-grouping-bar").remove():this.groupingBarModule&&(this.groupingBarModule.renderLayout(),this.commonModule||(this.commonModule=new Zs(this)),this.notify(Ar,{})),_e.isNullOrUndefined(e.showFieldList)&&this.renderPivotGrid();break;case"showFieldList":this.initialLoad();break;case"groupingBarSettings":this.showGroupingBar&&this.groupingBarModule&&(e.groupingBarSettings&&-1<Object.keys(e.groupingBarSettings).indexOf("showFieldsPanel")?(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:e.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:e.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.isStaticFieldList&&this.isStaticRefresh&&(this.isStaticRefresh=!1),this.initialLoad();break;case"cellTemplate":this.cellTemplateFn=this.templateParser(this.cellTemplate),i=!0;break;case"tooltipTemplate":this.tooltipTemplateFn=this.templateParser(this.tooltipTemplate),i=!0;break;case"allowCalculatedField":this.pivotFieldListModule&&(this.pivotFieldListModule.allowCalculatedField=this.allowCalculatedField);break;case"allowDeferLayoutUpdate":this.pivotDeferLayoutUpdate=this.allowDeferLayoutUpdate,this.pivotFieldListModule&&(this.pivotFieldListModule.allowDeferLayoutUpdate=this.allowDeferLayoutUpdate);break;case"allowGrouping":case"enableVirtualization":this.refresh()}}i&&this.grid&&this.grid.refreshColumns()},f.prototype.toggleButtonState=function(e,t){var e=this.element.querySelector("."+e);e&&(e=e.closest(".e-toolbar-item"))&&("add"===t?e.classList.add(b):"remove"===t&&e.classList.remove(b))},f.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?_e.compile(document.querySelector(t).innerHTML.trim()):_e.compile(t)}catch(e){return _e.compile(t)}},f.prototype.getCellTemplate=function(){return this.cellTemplateFn},f.prototype.appendHtml=function(e,t){var i=document.createElement("div");return i.innerHTML=t,_e.isNullOrUndefined(i.firstChild)||e.appendChild(i.firstChild),e},f.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")&&_e.addClass([this.chart.element],"e-ltr"),this.enableVirtualization&&(this.virtualscrollModule=new Jo(this)),(this.allowDrillThrough||this.editSettings.allowEditing)&&(this.drillThroughModule=new tl(this)),this.enablePaging&&this.notify(zr,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||new js(this),this.renderModule.render(!0)):this.grid&&_e.remove(this.grid.element);var e=this.actionObj.actionName===nn||this.actionObj.actionName===Dn,t=this.actionObj.actionName===On||this.actionObj.actionName===rn;!(this.showFieldList||this.allowNumberFormatting||this.allowCalculatedField||this.toolbar||this.allowGrouping||this.gridSettings.contextMenuItems)||e||t||(this.notify(Rr,this),this.pivotFieldListModule&&this.allowDeferLayoutUpdate&&(this.pivotFieldListModule.clonedDataSource=Ie.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("."+Ge)&&this.groupingBarModule.refreshUI(),this.toolbarModule&&this.toolbarModule.toolbar&&(this.toolbarModule.toolbar.width=this.getGridWidthAsNumber()),this.chartSettings.enableScrollOnMultiAxis&&this.chartSettings.enableMultipleAxis&&(this.element.querySelector("."+Ei).style.width=_e.formatUnit(this.getGridWidthAsNumber())),this.chart.width=_e.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&&(Ie.toggleFieldListIconVisibility(this),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="")},f.prototype.appendChartElement=function(){var e,t;_e.select("#"+this.element.id+"_chart",this.element)||("Both"===this.displayOption.view&&"Chart"===this.displayOption.primary?this.element.insertBefore(_e.createElement("div",{className:Ei,id:this.element.id+"_chart"}),this.element.querySelector("."+Wt)):this.element.appendChild(_e.createElement("div",{className:Ei,id:this.element.id+"_chart"})),e=this.width.toString(),this.showToolbar&&this.grid&&(e=this.getGridWidthAsNumber().toString()),t=this.pivotChartModule.getChartHeight(),new(this.chartSettings&&this.chartSettings.chartSeries&&-1<this.pivotChartModule.accumulationType.indexOf(this.chartSettings.chartSeries.type)?y.AccumulationChart:y.Chart)({width:e,height:t}).appendTo(_e.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)&&(_e.select("#"+this.element.id+"_chart",this.element).style.display="none"))},f.prototype.showWaitingPopup=function(){this.grid&&this.grid.element&&!this.spinnerTemplate&&"Table"===this.currentView?P.showSpinner(this.grid.element):P.showSpinner(this.element)},f.prototype.hideWaitingPopup=function(){this.grid&&this.grid.element&&!this.spinnerTemplate&&"Table"===this.currentView?P.hideSpinner(this.grid.element):P.hideSpinner(this.element)},f.prototype.updateDataSource=function(){var i=this,a=(this.showWaitingPopup(),this),r=!_e.isNullOrUndefined(a.lastSortInfo)&&0<Object.keys(a.lastSortInfo).length,n=!_e.isNullOrUndefined(a.lastFilterInfo)&&0<Object.keys(a.lastFilterInfo).length,s=!_e.isNullOrUndefined(a.lastAggregationInfo)&&0<Object.keys(a.lastAggregationInfo).length,o=!_e.isNullOrUndefined(a.lastCalcFieldInfo)&&0<Object.keys(a.lastCalcFieldInfo).length,e={dataSourceSettings:Ie.getClonedDataSourceSettings(a.dataSourceSettings)};a.trigger(ra,e,function(e){var t;(a.enableVirtualization||a.enablePaging)&&(r||n||s||o)||Ie.updateDataSourceSettings(a,e.dataSourceSettings),a.updatePageSettings(!1),!r||""===a.dataSourceSettings.valueSortSettings.headerText&&""===a.dataSourceSettings.valueSortSettings.rowHeaderText&&""===a.dataSourceSettings.valueSortSettings.columnHeaderText||a.setProperties({dataSourceSettings:{valueSortSettings:{headerText:"",rowHeaderText:"",columnHeaderText:""}}},!0),"pivot"===a.dataType&&(a.enableVirtualization||a.enablePaging)&&(r||n||s||o)?(r&&("Server"===i.dataSourceSettings.mode?a.getEngine("onSort",null,a.lastSortInfo,null,null,null,null):a.engineModule.onSort(a.lastSortInfo,a.dataSourceSettings),a.lastSortInfo={}),s&&("Server"===i.dataSourceSettings.mode?a.getEngine("onAggregation",null,null,a.lastAggregationInfo,null,null,null):a.engineModule.onAggregation(a.lastAggregationInfo,a.dataSourceSettings),a.lastAggregationInfo={}),o&&("Server"===i.dataSourceSettings.mode?a.getEngine("onCalcOperation",null,null,null,a.lastCalcFieldInfo,null,null):a.engineModule.onCalcOperation(a.lastCalcFieldInfo,a.dataSourceSettings),a.lastCalcFieldInfo={}),n&&("Server"===i.dataSourceSettings.mode?a.getEngine("onFilter",null,null,null,null,a.lastFilterInfo,null):a.engineModule.onFilter(a.lastFilterInfo,a.dataSourceSettings),a.lastFilterInfo={}),a.allowServerDataBinding=!1,a.setProperties({pivotValues:a.engineModule.pivotValues},!0),a.allowServerDataBinding=!0,"Server"!==a.dataSourceSettings.mode&&a.enginePopulatedEventMethod("updateDataSource")):"olap"===a.dataType?(t={mode:"",savedFieldList:a.olapEngineModule.fieldList,savedFieldListData:a.olapEngineModule.fieldListData,pageSettings:a.pageSettings,enableValueSorting:a.enableValueSorting,isDrillThrough:a.allowDrillThrough||a.editSettings.allowEditing,localeObj:a.localeObj,enableVirtualization:i.enableVirtualization},o||r?(a.olapEngineModule.savedFieldList=a.olapEngineModule.fieldList,a.olapEngineModule.savedFieldListData=a.olapEngineModule.fieldListData,o?(a.olapEngineModule.updateCalcFields(a.dataSourceSettings,a.lastCalcFieldInfo),a.lastCalcFieldInfo={}):(a.olapEngineModule.onSort(a.dataSourceSettings),a.lastSortInfo={})):Ie.renderOlapEngine(a,t),a.allowServerDataBinding=!1,a.setProperties({pivotValues:a.olapEngineModule.pivotValues},!0),a.allowServerDataBinding=!0,a.enginePopulatedEventMethod("updateDataSource")):(t={mode:"",savedFieldList:a.engineModule.fieldList,pageSettings:a.pageSettings,enableValueSorting:a.enableValueSorting,isDrillThrough:a.allowDrillThrough||a.editSettings.allowEditing,localeObj:a.localeObj,fieldsType:a.fieldsType,clonedReport:a.clonedReport,globalize:a.globalize,currenyCode:a.currencyCode,enablePaging:i.enablePaging,enableVirtualization:i.enableVirtualization,allowDataCompression:i.allowDataCompression,enableHtmlSanitizer:i.enableHtmlSanitizer,enableOptimizedRendering:i.enableVirtualization&&i.virtualscrollModule&&i.virtualScrollSettings.allowSinglePage,isTabularLayout:i.isTabular},"Server"===a.dataSourceSettings.mode?r?a.getEngine("onSort",null,a.lastSortInfo,null,null,null,null):s?a.getEngine("onAggregation",null,null,a.lastAggregationInfo,null,null,null):o?a.getEngine("onCalcOperation",null,null,null,a.lastCalcFieldInfo,null,null):n?a.getEngine("onFilter",null,null,null,null,a.lastFilterInfo,null):a.getEngine("onDrop",null,null,null,null,null,null):(a.engineModule.renderEngine(a.dataSourceSettings,t,a.aggregateCellInfo?a.getValueCellInfo.bind(a):void 0,a.onHeadersSort?a.getHeaderSortInfo.bind(a):void 0),a.allowServerDataBinding=!1,a.setProperties({pivotValues:a.engineModule.pivotValues},!0),a.allowServerDataBinding=!0,a.enginePopulatedEventMethod("updateDataSource")),a.lastSortInfo={},a.lastAggregationInfo={},a.lastCalcFieldInfo={},a.lastFilterInfo={})})},f.prototype.refreshPageData=function(){var e={dataSourceSettings:Ie.getClonedDataSourceSettings(this.dataSourceSettings)};this.actionBeginMethod(),this.showWaitingPopup(),this.trigger(ra,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,!0),this.setProperties({pivotValues:this.engineModule.pivotValues},!0),this.enginePopulatedEventMethod("updateDataSource")),this.actionObj.actionName=this.getActionCompleteName(),this.actionObj.actionName&&this.actionCompleteMethod()},f.prototype.excelExport=function(e,t,i,a){this.isBlobData=a,"Server"===this.dataSourceSettings.mode?this.getEngine("onExcelExport",null,null,null,null,null,null,null,null,e):(this.enableVirtualization||this.enablePaging||this.allowEngineExport||this.allowConditionalFormatting&&0<this.dataSourceSettings.conditionalFormatSettings.length?this.excelExportModule.exportToExcel("Excel",e,a):(this.exportType="Excel",this.grid.excelExport(e,t,i,a)),this.actionObj.actionName=this.getActionCompleteName(),t={exportInfo:{type:this.exportType,info:e}},this.actionObj.actionInfo=t,this.actionObj.actionName&&this.actionCompleteMethod())},f.prototype.exportAsPivot=function(e){"Server"===this.dataSourceSettings.mode&&("CSV"===e?this.getEngine("onPivotCsvExport",null,null,null,null,null,null,null,null,null,!0):this.getEngine("onPivotExcelExport",null,null,null,null,null,null,null,null,null,!0))},f.prototype.csvExport=function(e,t,i,a){"Server"===this.dataSourceSettings.mode?this.getEngine("onCsvExport",null,null,null,null,null,null,null,null,e):(this.enableVirtualization||this.enablePaging||this.allowEngineExport||this.allowConditionalFormatting&&0<this.dataSourceSettings.conditionalFormatSettings.length?this.excelExportModule.exportToExcel("CSV",e,a):(this.exportType="CSV",this.grid.csvExport(e,t,i,a)),this.actionObj.actionName=this.getActionCompleteName(),t={exportInfo:{type:this.exportType,info:e}},this.actionObj.actionInfo=t,this.actionObj.actionName&&this.actionCompleteMethod())},f.prototype.gridPdfExport=function(e,t,i,a){t={pdfExportProperties:e,isMultipleExport:t,isBlob:a,pdfDoc:i,currentExportView:"Table",pdfMargins:{}},a=null,this.trigger(la,t),this.pdfExportModule&&(this.pdfExportModule.exportProperties=t),a="Server"!==this.dataSourceSettings.mode&&(this.enableVirtualization||this.enablePaging||this.allowEngineExport||0<Object.keys(t.pdfMargins).length||t.height||t.width||this.allowConditionalFormatting&&0<this.dataSourceSettings.conditionalFormatSettings.length)?this.pdfExportModule.exportToPDF(t.pdfExportProperties,t.isMultipleExport,t.pdfDoc,t.isBlob):this.grid.pdfExport(t.pdfExportProperties,t.isMultipleExport,t.pdfDoc,t.isBlob),this.actionObj.actionName=this.getActionCompleteName(),i={exportInfo:{type:"PDF",info:e}};return this.actionObj.actionInfo=i,this.actionObj.actionName&&this.actionCompleteMethod(),a},f.prototype.chartExport=function(e,t,i,a,r){i={pdfExportProperties:t,isMultipleExport:i,isBlob:r,pdfDoc:a,type:e,currentExportView:"Chart",pdfMargins:{}},this.trigger(la,i),this.chartExportModule&&(this.chartExportModule.exportProperties=i),r=i.fileName||(_e.isNullOrUndefined(t)||_e.isNullOrUndefined(t.fileName)?"default":t.fileName),t="PDF"===e?this.chartExportModule.pdfChartExport(i.pdfExportProperties,i.pdfDoc,i.isMultipleExport,i.isBlob):(a=0===i.orientation||i.orientation?i.orientation:_e.isNullOrUndefined(t)||_e.isNullOrUndefined(t.pageOrientation)||"Landscape"===t.pageOrientation?U.PdfPageOrientation.Landscape:U.PdfPageOrientation.Portrait,this.chart.exportModule.export(i.type,r,a,null)),this.actionObj.actionName=this.getActionCompleteName(),i={exportInfo:{type:e,info:r}};return this.actionObj.actionInfo=i,this.actionObj.actionName&&this.actionCompleteMethod(),t},f.prototype.pdfExport=function(i,a,r,n,s){var o=this,l=null;return new Promise(function(t){var e;s&&"Both"===o.displayOption.view?"Chart"===o.displayOption.primary?o.chartExport("PDF",i,!0,r,!1).then(function(e){l=o.gridPdfExport(i,a,e,n),t(l)}):o.gridPdfExport(i,!0,r,!1).then(function(e){l=o.chartExport("PDF",i,a,e,n),t(l)}):(e=o.gridPdfExport(i,a,r,n),t(e))})},f.prototype.printChart=function(){this.chart&&this.chart.print()},f.prototype.onDrill=function(e,t){var i=this,a=this.dataSourceSettings.drilledMembers[0]&&this.dataSourceSettings.drilledMembers[0].delimiter?this.dataSourceSettings.drilledMembers[0].delimiter:"**",r="",n="",s="";if(s=t?(r=t.fieldName,n=t.cell.axis,t.isDrilled?"up":"down"):(r=("row"===(n=e.closest("td.e-rowsheader")?"row":"column")?_e.closest(e,"td"):_e.closest(e,"th")).getAttribute("fieldname"),e.classList.contains(ft)?"up":"down"),"pivot"===this.dataType){var o=Ie.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers),l="row"===n?parseInt(_e.closest(e,"td").getAttribute("aria-colindex"),10)-1:parseInt(_e.closest(e,"th").getAttribute("aria-colindex"),10)-1,d="row"===n?Number(_e.closest(e,"td").getAttribute("index")):Number(_e.closest(e,"th").getAttribute("index")),d=t?t.cell:this.engineModule.pivotValues[d][l],h=d.valueSort.levelName.split(this.engineModule.valueSortSettings.headerDelimiter).join(a),p=!1;if(0===this.dataSourceSettings.drilledMembers.length)this.setProperties({dataSourceSettings:{drilledMembers:[{name:r,items:[h],delimiter:a}]}},!0);else{for(var u=Ie.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers),c=0;c<u.length;c++){var g,m=u[c],h=h.split(a).join(m.delimiter||a),a=m.delimiter=m.delimiter||a;m.name===r&&(p=!0,-1<(g=m.items.indexOf(h))?m.items.splice(g,1):m.items.push(h))}this.setProperties({dataSourceSettings:{drilledMembers:u}},!0),p||this.dataSourceSettings.drilledMembers.push({name:r,items:[h],delimiter:a})}this.showWaitingPopup();var S=this,f={fieldName:r,memberName:h,delimiter:a,axis:n,action:s,currentCell:d};S.trigger(Oa,{drillInfo:f,pivotview:S,cancel:!1},function(e){e.cancel?(i.hideWaitingPopup(),i.setProperties({dataSourceSettings:{drilledMembers:o}},!0)):(e={dataSourceSettings:Ie.getClonedDataSourceSettings(i.dataSourceSettings)},S.trigger(ra,e),S.setProperties({dataSourceSettings:e.dataSourceSettings},!0),S.enableVirtualization||S.enablePaging?"Server"===i.dataSourceSettings.mode?i.getEngine("onDrill",f,null,null,null,null,null):(S.engineModule.drilledMembers=S.dataSourceSettings.drilledMembers,S.engineModule.onDrill(f)):"Server"===i.dataSourceSettings.mode?i.getEngine("onDrill",f,null,null,null,null,null):S.engineModule.generateGridData(S.dataSourceSettings,!0),"Server"!==i.dataSourceSettings.mode&&(S.allowServerDataBinding=!1,S.setProperties({pivotValues:S.engineModule.pivotValues},!0),S.allowServerDataBinding=!0,e={dataSourceSettings:Ie.getClonedDataSourceSettings(e.dataSourceSettings),pivotValues:i.pivotValues},i.trigger(na,e),S.engineModule.pivotValues=e.pivotValues,i.actionObj.actionInfo={drillInfo:f},S.renderPivotGrid()))})}else this.onOlapDrill(r,n,s,a,e,t)},f.prototype.onOlapDrill=function(k,e,t,j,i,a){var r=this,n=this,s=Ie.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers),a=(i=a?a.cell:(a="row"===e?parseInt(_e.closest(i,"td").getAttribute("aria-colindex"),10)-1:parseInt(_e.closest(i,"th").getAttribute("aria-colindex"),10)-1,i="row"===e?Number(_e.closest(i,"td").getAttribute("index")):Number(_e.closest(i,"th").getAttribute("index")),this.olapEngineModule.pivotValues[i][a]),("row"===e?this.olapEngineModule.tupRowInfo:this.olapEngineModule.tupColumnInfo)[i.ordinal]),o={axis:e,action:t,fieldName:k,delimiter:"~~",memberName:a.uNameCollection,currentCell:i},t=(this.showWaitingPopup(),{drillInfo:o,pivotview:n,cancel:!1}),l=this.olapEngineModule.fieldList[o.fieldName]&&this.olapEngineModule.fieldList[o.fieldName].isHierarchy,d=a.drillInfo.map(function(e){return e.hierarchy}).indexOf(i.hierarchy.toString()),h=Ie.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers);if(o&&"down"===o.action){for(var p=a.drillInfo.map(function(e){return e.uName}),u="",c=0;c<=d;c++)u=u+(""!==u?"~~":"")+(P=(O=p[c]).split("~~"))[P.length-1];for(var g=this.olapEngineModule.getDrilledSets(o.memberName,i,this.olapEngineModule.fieldList[i.hierarchy]&&!this.olapEngineModule.fieldList[i.hierarchy].hasAllMember?i.valueSort.levelName.split(this.dataSourceSettings.valueSortSettings.headerDelimiter).length-1:d,e),m=0,S=N=Object.keys(g);m<S.length;m++)for(var f=g[S[m]],v=0,y=h.length;v<y;v++){for(var b=h[v],C=f,x=(b.delimiter&&(C=C.replace(/~~/g,b.delimiter)),[]),w=0;w<b.items.length;w++)0!==b.items[w].indexOf(C)&&(x[x.length]=b.items[w]);b.items=x}this.olapEngineModule.drilledSets[i.actualText]=a.members[d],o.memberName=u;for(var T=[],M=0,D=h;M<D.length;M++)(O=D[M]).name===o.fieldName&&T.push(O);if(0<T.length){if(T[0].delimiter&&(u=u.replace(/~~/g,T[0].delimiter)),-1===Ie.inArray(u,T[0].items)&&T[0].items.push(u),l)for(v=0;v<T[0].items.length;)T[0].items[v]===u?T[0].items.splice(v,1):++v}else l||(F={name:o.fieldName,items:[u],delimiter:"~~"},h?h.push(F):h=[F]);t.drillInfo.memberName=u,this.setProperties({dataSourceSettings:{drilledMembers:h}},!0),n.trigger(Oa,t,function(e){e.cancel?(r.hideWaitingPopup(),r.setProperties({dataSourceSettings:{drilledMembers:s}},!0)):(e={dataSourceSettings:Ie.getClonedDataSourceSettings(r.dataSourceSettings)},r.trigger(ra,e),r.setProperties({dataSourceSettings:e.dataSourceSettings},!0),r.olapEngineModule.updateDrilledInfo(r.dataSourceSettings),r.allowServerDataBinding=!1,r.setProperties({pivotValues:r.olapEngineModule.pivotValues},!0),r.allowServerDataBinding=!0,e={dataSourceSettings:Ie.getClonedDataSourceSettings(e.dataSourceSettings),pivotValues:n.olapEngineModule.pivotValues},r.trigger(na,e),r.olapEngineModule.pivotValues=e.pivotValues,r.renderPivotGrid())})}else{delete this.olapEngineModule.drilledSets[i.actualText];for(var O,P,g=this.olapEngineModule.getDrilledSets(o.memberName,i,d,e),N=Object.keys(g),p=a.drillInfo.map(function(e){return e.uName}),u="",c=0;c<=d;c++)u=u+(""!==u?"~~":"")+(P=(O=p[c]).split("~~"))[P.length-1];for(var E=0,I=N;E<I.length;E++){for(var F,f=g[I[E]],L=[],v=0,y=h.length;v<y;v++){var A=f;if((T=h[v]).name===o.fieldName&&L.push(T),T.delimiter&&(A=f.replace(/~~/g,T.delimiter)),!l){for(x=[],w=0;w<T.items.length;w++)0!==T.items[w].indexOf(A)&&(x[x.length]=T.items[w]);T.items=x}}l&&(0<L.length?(L[0].delimiter&&(u=u.replace(/~~/g,L[0].delimiter)),-1===Ie.inArray(u,L[0].items)&&L[0].items.push(u)):(F={name:o.fieldName,items:[u],delimiter:"~~"},h?h.push(F):h=[F]))}for(var q=[],R=0,H=h;R<H.length;R++){var V=H[R];0<V.items.length&&q.push(V)}this.setProperties({dataSourceSettings:{drilledMembers:h}},!0),n.trigger(Oa,t,function(e){e.cancel?(r.hideWaitingPopup(),r.setProperties({dataSourceSettings:{drilledMembers:s}},!0)):(e={dataSourceSettings:Ie.getClonedDataSourceSettings(r.dataSourceSettings)},r.trigger(ra,e),r.setProperties({dataSourceSettings:e.dataSourceSettings},!0),r.setProperties({dataSourceSettings:{drilledMembers:q}},!0),r.olapEngineModule.updateDrilledInfo(r.dataSourceSettings),r.allowServerDataBinding=!1,r.setProperties({pivotValues:r.olapEngineModule.pivotValues},!0),r.allowServerDataBinding=!0,e={dataSourceSettings:Ie.getClonedDataSourceSettings(e.dataSourceSettings),pivotValues:n.olapEngineModule.pivotValues},r.trigger(na,e),r.olapEngineModule.pivotValues=e.pivotValues,r.renderPivotGrid())})}},f.prototype.onContentReady=function(){var e,t,i,a,r,n,s,o,l=w.getScrollBarWidth(),d=(this.isPopupClicked=!1,this.showFieldList&&this.pivotFieldListModule&&"Server"!==this.dataSourceSettings.mode?(this.pivotFieldListModule.element.style.display="block",P.hideSpinner(this.pivotFieldListModule.fieldListSpinnerElement)):this.fieldListSpinnerElement&&P.hideSpinner(this.fieldListSpinnerElement),this.isEmptyGrid?0<this.pivotValues.length&&(this.isEmptyGrid=!1,this.notEmpty=!0):("Server"===this.dataSourceSettings.mode&&this.isServerWaitingPopup||"Local"===this.dataSourceSettings.mode)&&this.hideWaitingPopup(),this.element.querySelector("."+li)?this.element.querySelector("."+li):this.element.querySelector("."+ue)),h=this.element.querySelector("."+hi),p=this.virtualScrollSettings&&this.virtualScrollSettings.allowSinglePage&&"pivot"===this.dataType;this.grid&&(n=this.element.querySelector("."+Ci),o=d.parentElement.offsetWidth<d.querySelector("."+u).offsetWidth,s="pivot"===this.dataType?this.engineModule:this.olapEngineModule,this.enableVirtualization&&s&&this.virtualscrollModule&&(p&&this.element.querySelector("."+Yi)&&(_e.removeClass([h,d],["e-virtual-pivot-content"]),_e.addClass([this.element.querySelector("."+Yi)],[Ki]),this.grid)&&this.grid.element.querySelector(".e-spinner-inner")&&_e.removeClass([this.grid.element.querySelector(".e-spinner-inner")],[Ki]),p&&((r=this.element.querySelector("."+Yi))||(r=_e.createElement("div",{className:Yi+" "+Ki,innerHTML:this.localeObj.getConstant("loading")}),this.grid.element&&!this.element.querySelector("."+Yi)&&this.grid.element.insertBefore(r,this.grid.element.firstElementChild)),this.element.querySelector("."+gi))&&this.element.querySelector("."+Ci)&&(t=this.element.querySelector("."+Ci).offsetHeight+this.element.querySelector("."+gi).offsetHeight,_e.setStyleAttribute(r,{height:t+"px",width:this.element.querySelector("."+gi).offsetWidth+"px",padding:Math.floor(t/2)+"px"})),this.element.querySelector("."+ue)&&!this.element.querySelector("."+ue).querySelector("."+si)&&(this.virtualDiv=_e.createElement("div",{className:si}),this.element.querySelector("."+ue).appendChild(this.virtualDiv)),this.element.querySelector("."+hi)&&!this.element.querySelector("."+hi).querySelector("."+si)?(this.virtualHeaderDiv=_e.createElement("div",{className:si}),this.element.querySelector("."+hi).appendChild(this.virtualHeaderDiv)):this.virtualHeaderDiv=this.element.querySelector("."+hi).querySelector("."+si),r=n.querySelector("."+oi),n&&!r&&(this.virtualTableDiv=_e.createElement("div",{className:oi}),n.appendChild(this.virtualTableDiv),r=n.querySelector("."+oi),this.virtualScrollDiv=_e.createElement("div",{className:di}),r.appendChild(this.virtualScrollDiv),_e.setStyleAttribute(r,{minHeight:0!==l?l:"15px",maxHeight:0!==l?l:"15px",overflowX:"scroll"}),_e.setStyleAttribute(this.virtualScrollDiv,{height:"0.1px"}),(t=_e.createElement("div",{className:li})).append.apply(t,Array.prototype.slice.call(d.childNodes)),d.appendChild(t),t.scrollLeft=0),t=this.element.querySelector("."+ue).querySelector("."+u),(t=this.gridSettings.rowHeight*s.rowCount+.1-t.clientHeight)>this.scrollerBrowserLimit&&(this.verticalScrollScale=t/this.scrollerBrowserLimit,t=this.scrollerBrowserLimit),(e=this.gridSettings.columnWidth*s.columnCount)>this.scrollerBrowserLimit&&(this.horizontalScrollScale=e/this.scrollerBrowserLimit,e=this.scrollerBrowserLimit),_e.setStyleAttribute(this.virtualDiv,{height:(.1<t?t:.1)+"px",width:(.1<e?e:.1)+"px"}),_e.setStyleAttribute(this.virtualHeaderDiv,{height:0,width:(.1<e?e:.1)+"px"}),this.isAdaptive&&(d.style.minHeight="1px",d.style.minHeight="1px"),s=!this.isAdaptive&&n.querySelector("."+oi)?n.querySelector("."+oi):d,t=d.parentElement.scrollTop>this.scrollerBrowserLimit?d.querySelector("."+u).style.transform.split(",")[1].trim():(p?d.parentElement.scrollTop:-(d.parentElement.scrollTop*this.verticalScrollScale-this.scrollPosObject.verticalSection-d.parentElement.scrollTop))+"px)",Number(t.split("px")[0])>this.virtualDiv.clientHeight&&(t=this.virtualDiv.clientHeight+"px)"),a=(i=Math.abs(s.scrollLeft))>this.scrollerBrowserLimit?d.querySelector("."+u).style.transform.split(",")[0].trim()+",":"translate("+(this.enableRtl?1:-1)*(i*this.horizontalScrollScale-this.scrollPosObject.horizontalSection-i)+"px,",_e.setStyleAttribute(d.querySelector("."+u),{transform:a+t}),_e.setStyleAttribute(h.querySelector("."+u),{transform:a+"0px)"}),!o&&n&&r||this.isAdaptive?r.style.display="none":r.style.display="block",r=Number(-d.querySelector("."+u).style.transform.split("(")[1].split(",")[0].split("px")[0]),this.virtualscrollModule.alignFreezedCells(r,!0),o&&(o=0,o=this.pivotColumns.length<25?e+d.querySelector("."+u).querySelector("."+Qi).offsetWidth+(n.offsetWidth-n.clientWidth):e+(n.offsetWidth-n.clientWidth),"auto"!==this.grid.height?this.grid.element.querySelector("."+di).style.width=o+l+"px":this.grid.element.querySelector("."+di).style.width=o+"px"),this.grid.element.querySelector("."+li)&&d.parentElement.scrollHeight===d.scrollHeight&&(d.style.overflowY=""),n="pivot"===this.dataType&&"column"===this.dataSourceSettings.valueAxis?this.dataSourceSettings.values.length:1,o=this.pageSettings.columnPageSize*n*this.gridSettings.columnWidth,n=s.scrollWidth-(Math.abs(i)+s.offsetWidth),this.virtualscrollModule)&&0<o&&n<=o&&0<i&&(s=void 0,(o=d.scrollWidth-(Math.abs(d.scrollLeft)+d.parentElement.offsetWidth))<1&&"horizondal"===this.scrollDirection&&(0<d.parentElement.scrollTop&&(s=d.parentElement.scrollTop),this.virtualDiv.style.display="none",o=d.scrollWidth-(Math.abs(d.scrollLeft)+d.parentElement.offsetWidth)),this.virtualDiv.style.display="",s&&(d.parentElement.scrollTop=s),s=d.scrollWidth-(Math.abs(d.scrollLeft)+d.parentElement.offsetWidth),1<o&&(this.scrollPosObject.horizontalSection-=n<=0?n<o?o:-s:s===o?o-n:o<s&&(n==s||o<n)?-(s-o):0,"auto"!==this.grid.height&&(this.scrollPosObject.horizontalSection-=l),this.scrollPosObject.horizontalSection=this.scrollPosObject.horizontalSection>=-this.element.querySelector("."+Wt).querySelector("."+Ct+"."+Qi).offsetWidth?this.scrollPosObject.horizontalSection:-this.element.querySelector("."+Wt).querySelector("."+Ct+"."+Qi).offsetWidth),a=i>this.scrollerBrowserLimit?d.querySelector("."+u).style.transform.split(",")[0].trim()+",":"translate("+(this.enableRtl?1:-1)*(i*this.horizontalScrollScale-this.scrollPosObject.horizontalSection-i)+"px,",_e.setStyleAttribute(d.querySelector("."+u),{transform:a+t}),_e.setStyleAttribute(h.querySelector("."+u),{transform:a+"0px)"}),r=Number(-d.querySelector("."+u).style.transform.split("(")[1].split(",")[0].split("px")[0]),this.virtualscrollModule.alignFreezedCells(r,!0)),"Chart"!==this.currentView&&this.grid.hideScroll(),this.showGroupingBar?(this.groupingBarModule&&this.element.querySelector("."+Ge)&&this.groupingBarModule.setGridRowWidth(),this.actionObj.fieldInfo&&this.actionObj.fieldInfo.fieldName&&(n=this.pivotButtonModule.parentElement.querySelector('[data-uid="'+this.actionObj.fieldInfo.fieldName+'"]'),_e.isNullOrUndefined(n)||n.focus()),this.element.style.minWidth=this.isAdaptive?this.minWidth?this.minWidth+"px":"310px":this.minWidth?this.minWidth+"px":"400px",this.grid.element.style.minWidth=this.isAdaptive?this.minWidth?this.minWidth+"px":"310px":this.minWidth?this.minWidth+"px":"400px"):(this.element.style.minWidth=this.minWidth?this.minWidth+"px":"310px",this.grid.element.style.minWidth=this.minWidth?this.minWidth+"px":"310px")),this.unwireEvents(),this.wireEvents(),this.isChartLoaded=!1,this.isEmptyGrid||this.trigger(ma),this.actionObj.actionName=this.getActionCompleteName(),this.actionObj.actionName&&(this.actionObj.actionName===Cs&&this.pivotCommon&&this.pivotCommon.filterDialog&&(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.pivotCommon.filterDialog.setFocus.bind(this.pivotCommon.filterDialog))),this.actionObj.actionName!==Vn)&&this.actionCompleteMethod(),this.groupingModule&&(this.groupingModule.isUpdate=!1),this.engineModule&&this.engineModule.clearProperties(),this.virtualscrollModule&&this.grid&&this.virtualscrollModule.onHorizondalScroll(h,d),!this.isAdaptive&&this.enableVirtualization&&d&&this.virtualscrollModule&&!p&&(s=d.parentElement.parentElement.querySelector(".e-movablescrolldiv"),e<3*d.parentElement.clientWidth?(d.style.overflowX="visible",s.style.display="none",h.scrollLeft=d.parentElement.scrollLeft,_e.setStyleAttribute(d.querySelector("."+u),{transform:"translate(0px,"+t}),_e.setStyleAttribute(h.querySelector("."+u),{transform:"translate(0px, 0px)"}),this.virtualscrollModule.alignFreezedCells(0,!0)):(_e.EventHandler.remove(this.element.querySelector("."+Ci).querySelector("."+ue),"scroll",this.headerScrollUpdate),o=this.element.querySelector("."+Ci).querySelector("."+ue).scrollLeft,d.style.overflowX="auto",s.style.display="block",0!==o&&(s.scrollLeft=o),s.scrollLeft!==d.scrollLeft&&0!==d.scrollLeft&&(s.scrollLeft=d.scrollLeft))),this.isStaticRefresh=!1},f.prototype.setToolTip=function(e){var t,i,a,r,n,s,o,l=this,d=parseInt(e.target.getAttribute("aria-colindex"),10)-1,h=Number(e.target.getAttribute("index")),p=0<this.dataSourceSettings.values.length&&this.pivotValues&&this.pivotValues[h]&&this.pivotValues[h][d]?this.pivotValues[h][d]:void 0,u=(this.tooltip.content="",!1);p&&"olap"===this.dataType?(a=p.actualText,_e.isNullOrUndefined(a)||!this.olapEngineModule.fieldList||this.olapEngineModule.fieldList[a]||(n=this.olapEngineModule.tupRowInfo,a=-1<p.rowOrdinal&&0<n.length&&n[p.rowOrdinal]&&!_e.isNullOrUndefined(n[p.rowOrdinal].measureName)?n[p.rowOrdinal].measureName:a),this.olapEngineModule.fieldList&&this.olapEngineModule.fieldList[a]&&(t=(r=this.olapEngineModule.fieldList[a]).isCalculatedField?r.type:r.aggregateType,i=(this.olapEngineModule.dataFields[a]&&this.olapEngineModule.dataFields[a].caption?this.olapEngineModule.dataFields[a]:r).caption,u=!0)):p&&this.engineModule.fieldList&&this.engineModule.fieldList[p.actualText]&&(t="DistinctCount"===(t=(r=this.engineModule.fieldList[p.actualText]).aggregateType)||"number"===r.type&&"include"!==r.type&&"exclude"!==r.type?void 0===t?"Sum":r.aggregateType:"Count",i=r.caption,u=!0),p&&u?(n=this.isTabular&&0<this.engineModule.rowMaxLevel?this.engineModule.rowMaxLevel:0,a=this.getRowText(h,n),r=this.getColText(0,d,h),u=""===p.formattedText?this.localeObj.getConstant("noValue"):p.formattedText,this.tooltipTemplate&&void 0!==this.getTooltipTemplate()?(n={rowHeaders:a,columnHeaders:r,aggregateType:t,valueField:i,value:u,rowFields:this.getHeaderField(h,d,"row"),columnFields:this.getHeaderField(h,d,"column")},"function"==typeof this.tooltipTemplate&&this.isReact?(s=document.createElement("div"),this.getTooltipTemplate()(n,this,"tooltipTemplate",this.element.id+"tooltipTemplate",null,null,s),this.renderReactTemplates(function(){l.enableHtmlSanitizer?l.tooltip.content=_e.SanitizeHtmlHelper.sanitize(s.outerHTML):l.tooltip.content=s.outerHTML})):(h=this.getTooltipTemplate()(n,this,"tooltipTemplate",this.element.id+"tooltipTemplate")[0].outerHTML,this.enableHtmlSanitizer?this.tooltip.content=_e.SanitizeHtmlHelper.sanitize(h):this.tooltip.content=h)):(o="<div class=e-pivottooltip><p class="+wt+">"+this.localeObj.getConstant("row")+":</p><p class="+Tt+">"+a+"</p></br><p class="+wt+">"+this.localeObj.getConstant("column")+":</p><p class="+Tt+">"+r+"</p></br>"+(""!==p.actualText?"<p class="+wt+">"+("olap"===this.dataType?"":this.localeObj.getConstant(t)+" "+this.localeObj.getConstant("of")+" ")+i+":</p><p class="+Tt+">"+u+"</p></div>":""),this.tooltip.content=_e.initializeCSPTemplate(function(){return o}))):e.cancel=!0},f.prototype.getTooltipTemplate=function(){return this.tooltipTemplateFn},f.prototype.getHeaderField=function(e,t,i){var a="",r="olap"===this.dataType?this.olapEngineModule:this.engineModule,n=r.valueSortSettings.headerDelimiter;if("row"===i)for(var s=this.pivotValues[e][0].valueSort.levelName.toString().split(n).length,o=0;o<s&&0<this.dataSourceSettings.rows.length&&this.dataSourceSettings.rows[o];o++)a+=(o?" - ":"")+(this.dataSourceSettings.rows[o].caption||this.dataSourceSettings.rows[o].name);else{0<this.dataSourceSettings.columns.length&&(i=0===this.dataSourceSettings.values.length?0:Number(Object.keys(r.headerContent)[Object.keys(r.headerContent).length-1]),s=this.pivotValues[i][t].valueSort.levelName.toString().split(n).length,s=1<this.dataSourceSettings.values.length?s-1:s);for(var l=0;l<s&&0<this.dataSourceSettings.columns.length&&this.dataSourceSettings.columns[l];l++)a+=(l?" - ":"")+(this.dataSourceSettings.columns[l].caption||this.dataSourceSettings.columns[l].name)}return a},f.prototype.getLevel=function(e){var t=e.valueSort?e.valueSort.levelName.toString():"",e=e.actualText?e.actualText.toString().split(this.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,t=t.split(this.dataSourceSettings.valueSortSettings.headerDelimiter).length-(e&&e-1);return t?t-1:0},f.prototype.getRowText=function(e,t){var i=this.pivotValues[e][t],a="";if(i){var r=this.getLevel(i);if(this.isTabular&&(0===r||this.engineModule&&r!==this.engineModule.rowMaxLevel)&&(t=r,i=this.pivotValues[e][t]),a="grand sum"===i.type?this.localeObj.getConstant("grandTotal"):i.formattedText,"row"===this.dataSourceSettings.valueAxis)a=(a=0===this.dataSourceSettings.rows.length&&1<this.dataSourceSettings.values.length?this.pivotValues[e][0].valueSort.levelName.toString().slice((this.localeObj.getConstant("grandTotal")+this.dataSourceSettings.valueSortSettings.headerDelimiter).length).toString():1===this.dataSourceSettings.values.length?_e.isNullOrUndefined(this.dataSourceSettings.values[0].caption)?this.dataSourceSettings.values[0].name:this.dataSourceSettings.values[this.isTabular?t:0].caption:this.pivotValues[e][this.isTabular?t:0].valueSort.levelName.toString()).split(this.dataSourceSettings.valueSortSettings.headerDelimiter).join(" - ");else if(this.isTabular)for(;0<r;)i=this.pivotValues[e][--t],a=a+this.dataSourceSettings.valueSortSettings.headerDelimiter+i.formattedText,r-=1;else for(;0<r||i&&void 0===i.index;)(i=this.pivotValues[--e][t])&&r>i.level&&(a=a+this.dataSourceSettings.valueSortSettings.headerDelimiter+i.formattedText,r-=1);a=a.split(this.dataSourceSettings.valueSortSettings.headerDelimiter).reverse().join(" - ")}return a},f.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&&e<i;)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},f.prototype.updateClass=function(){this.enableRtl?_e.addClass([this.element],L):_e.removeClass([this.element],L),this.isAdaptive?_e.addClass([this.element],A):_e.removeClass([this.element],A),this.cssClass&&_e.addClass([this.element],this.cssClass.split(" "))},f.prototype.mouseRclickHandler=function(e){3!==e.which&&0!==e.which||(this.lastCellClicked=e.target),this.lastCellClicked=e.target},f.prototype.mouseDownHandler=function(e){3===e.which&&(this.lastCellClicked=e.target),this.isCellBoxMultiSelection&&(this.isMouseDown=!e.target.closest("."+Y),this.isMouseUp=!1,this.lastSelectedElement=void 0)},f.prototype.mouseMoveHandler=function(e){var t,i,a=this;this.isCellBoxMultiSelection&&(e.preventDefault(),i=e.target||void 0,this.isMouseDown)&&i&&!i.classList.contains("e-expand")&&!i.classList.contains("e-collapse")&&(i="column"==(i.parentElement.classList.contains(bt)||i.classList.contains(bt)?"row":"column")?_e.closest(i,"th"):_e.closest(i,"td"))&&(e=parseInt(i.getAttribute("aria-colindex"),10)-1,t=Number(i.getAttribute("index")),t={cancel:!1,isCellClick:!0,currentCell:i,data:this.pivotValues[t][e]},this.trigger(Da,t,function(e){e.cancel||(a.grid.clearSelection(),e=a.parentAt(i,"TH"),a.lastSelectedElement&&a.lastSelectedElement!==e&&e.classList.contains(ui)?(a.lastSelectedElement.classList.remove(fi),a.lastSelectedElement.classList.remove(ui),a.lastSelectedElement=e):(a.lastSelectedElement=e).classList.contains(Ct)&&e.classList.contains(Qi)||(e.classList.add(fi),e.classList.add(ui)),a.renderModule.selected())}))},f.prototype.mouseUpHandler=function(){this.isCellBoxMultiSelection&&(this.isMouseDown=!1,this.isMouseUp=!0)},f.prototype.parentAt=function(e,t){for(;e.tagName!==t&&e.parentElement;)e=e.parentElement;return e},f.prototype.mouseClickHandler=function(e){3!==e.which&&0!==e.which||(this.lastCellClicked=e.target);var t=e.target;if(!_e.closest(t,"."+Y)){var i=null,a=t.closest("td.e-rowsheader"),r=t.closest("td.e-valuescontent"),a=a||r?"row":"column",i="column"==a?_e.closest(t,"th"):_e.closest(t,"td");if("column"!=a||i||"Row"===this.gridSettings.selectionSettings.mode||(i=_e.closest(t,"td")),t.classList.contains(ft)||t.classList.contains(vt)||!this.enableValueSorting||t.classList.contains("e-resized")||t.classList.contains("e-rhandler")&&t.classList.contains("e-rcursor")||"olap"===this.dataType&&this.enableVirtualization)if(t.classList.contains(ft)||t.classList.contains(vt)){r=t.parentElement.getAttribute("fieldname"),s=Ie.getFieldInfo(r,this),a=t.classList.contains(ft)?this.actionObj.actionName=Kr:t.classList.contains(vt)?this.actionObj.actionName=Xr:"";if(this.actionObj.actionName=a,this.actionObj.fieldInfo=s.fieldItem,!this.actionBeginMethod())try{this.onDrill(t)}catch(e){this.actionFailureMethod(e)}}else this.cellClicked(t,i,e);else{r="pivot"===this.dataType?this.engineModule:this.olapEngineModule,a=(this.cellClicked(t,i,e),i&&!_e.isNullOrUndefined(i.closest("."+gi))),t=i&&(!_e.isNullOrUndefined(i.closest(".e-row"))||i.classList.contains("e-rowsheader"));try{if(i&&(a||t)&&!this.allowGrouping&&"olap"!==this.dataType&&"Server"!==this.dataSourceSettings.mode||(this.allowGrouping||"olap"===this.dataType||"Server"===this.dataSourceSettings.mode)&&(a&&"column"===this.dataSourceSettings.valueAxis&&!i.classList.contains(Qi)||t&&"row"===this.dataSourceSettings.valueAxis)){var n=i.getAttribute("fieldname"),s=Ie.getFieldInfo(n,this);if(this.actionObj.actionName=Yr,this.actionObj.fieldInfo=s.fieldItem,!this.actionBeginMethod()){var o,l,d,h,p=parseInt(i.getAttribute("aria-colindex"),10)-1,u=Number(i.getAttribute("index")),c=("row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&t?(o=this.pivotValues[u][p],u=-1===this.dataSourceSettings.valueIndex&&t&&!this.isTabular&&"Bottom"!==this.dataSourceSettings.subTotalsPosition?"value"===o.type||3===o.memberType?u:u+1:this.getLevel(o)<=r.measureIndex&&o.members&&0<o.members.length?o.members[0].rowIndex:u):"column"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&a&&(p=parseInt(i.getAttribute("aria-colindex"),10)-1+Number(i.getAttribute("aria-colspan"))-1,u=r.headerContent.length-1),"pivot"===this.dataType&&"Server"!==this.dataSourceSettings.mode&&(a||t)?(l=this.pivotValues[u][p],d=t&&this.isTabular&&("row"===this.dataSourceSettings.valueAxis&&"value"===l.type||"column"===this.dataSourceSettings.valueAxis),(t&&(!this.isTabular||d)||a)&&((h=a?{columnIndex:Number(i.getAttribute("aria-colindex"))+Number(i.getAttribute("aria-colspan"))-1,columnHeaderText:this.pivotValues[u][p].valueSort.levelName,columnSortOrder:"Descending"===this.dataSourceSettings.valueSortSettings.columnSortOrder?"Ascending":"Descending"}:{rowIndex:Number(i.getAttribute("index"))+Number(i.getAttribute("aria-rowspan"))-1,rowSortOrder:"Descending"===this.dataSourceSettings.valueSortSettings.rowSortOrder?"Ascending":"Descending",rowHeaderText:this.pivotValues[u][p].valueSort.levelName}).headerDelimiter=this.dataSourceSettings.valueSortSettings.headerDelimiter||".",this.setProperties({dataSourceSettings:{valueSortSettings:h}},!0))):"olap"!==this.dataType&&"Server"!==this.dataSourceSettings.mode||this.setProperties({dataSourceSettings:{valueSortSettings:{columnIndex:Number(i.getAttribute("aria-colindex"))+Number(i.getAttribute("aria-colspan"))-1,sortOrder:"Descending"===this.dataSourceSettings.valueSortSettings.sortOrder?"Ascending":"Descending",headerText:this.pivotValues[u][p].valueSort.levelName,headerDelimiter:this.dataSourceSettings.valueSortSettings.headerDelimiter||"."}}},!0),this.showWaitingPopup(),this);if(r.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 S=m[g];c.engineModule.fieldList[S].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:r.pivotValues},!0),c.allowServerDataBinding=!0;var f={valueSortInfo:r.valueSortSettings};this.actionObj.actionInfo=f,c.renderPivotGrid()}}}catch(e){this.actionFailureMethod(e)}}}},f.prototype.updateTotColWidth=function(){for(var e=this.totColWidth=0,t=this.pivotColumns;e<t.length;e++){var i=t[e];this.totColWidth=this.totColWidth+i.width}},f.prototype.framePivotColumns=function(e){for(var t=0,i=e;t<i.length;t++){var a,r,n=i[t];n.columns&&0<n.columns.length?this.framePivotColumns(n.columns):(a="0.formattedText"!==n.field&&n.customAttributes&&n.customAttributes.cell&&n.customAttributes.cell.valueSort?n.customAttributes.cell.valueSort.levelName:"",r=this.renderModule.setSavedWidth("0.formattedText"===n.field?n.field:a,Number("auto"===n.width?n.minWidth:n.width)),this.pivotColumns.push({allowReordering:n.allowReordering,allowResizing:n.allowResizing,headerText:a,width:r,autoFit:n.autoFit}),this.totColWidth=this.totColWidth+Number(r))}},f.prototype.setGridColumns=function(e){if(!_e.isNullOrUndefined(this.totColWidth)&&0<this.totColWidth||this.renderModule.isAutoFitEnabled){for(var t=0,i=e;t<i.length;t++){var a,r=i[t];r.columns&&0<r.columns.length?this.setGridColumns(r.columns):this.renderModule.isAutoFitEnabled?(r.autoFit=this.pivotColumns[this.posCount].autoFit,this.posCount++):(a="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,a=this.renderModule.setSavedWidth("0.formattedText"===r.field?r.field:a,Number(this.pivotColumns[this.posCount].width)),r.autoFit?this.renderModule.isAutoFitEnabled=!0:"auto"!==r.width?r.width=a:r.minWidth=a,this.posCount++,r.allowReordering&&(this.gridSettings.allowReordering=!0),r.allowResizing&&(this.gridSettings.allowResizing=!0))}this.gridSettings.allowReordering&&w.Grid.Inject(w.Reorder),this.gridSettings.allowResizing&&w.Grid.Inject(w.Resize)}},f.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&&0<a.columns.length&&this.fillGridColumns(a.columns)}},f.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(wa,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)},f.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||r.width:"0.formattedText"!==r.field?r.columns?this.setCommonColumnsWidth(r.columns,t):this.setColumnWidth(r,t):r.width=this.firstColWidth||r.width}},f.prototype.getHeightAsNumber=function(){var e,t;return isNaN(this.height)?-1<this.height.toString().indexOf("%")?(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)):-1<this.height.toString().indexOf("px")&&(e=Number(this.height.toString().split("px")[0])):e=Number(this.height),e=e<this.minHeight||"auto"===this.height?this.minHeight:e},f.prototype.getWidthAsNumber=function(){var e;return isNaN(this.width)?(-1<this.width.toString().indexOf("%")?e=parseFloat(this.width.toString())/100*this.element.offsetWidth:-1<this.width.toString().indexOf("px")&&(e=Number(this.width.toString().split("px")[0])),isNaN(e)&&(e=this.element.offsetWidth)):e=Number(this.width),e<400&&!this.isAdaptive?e=this.minWidth||400:this.isAdaptive&&e<310&&(e=this.minWidth||310),e},f.prototype.getGridWidthAsNumber=function(){var e,t=this.element.offsetWidth||this.element.getBoundingClientRect().width;return isNaN(this.grid.width)?(-1<this.grid.width.toString().indexOf("%")?e=parseFloat(this.grid.width.toString())/100*t:-1<this.grid.width.toString().indexOf("px")&&(e=Number(this.grid.width.toString().split("px")[0])),isNaN(e)&&(e=t)):e=Number(this.grid.width),e},f.prototype.onWindowResize=function(){this.actionObj.actionName=Vn,this.actionBeginMethod()||(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.layoutRefresh.bind(this),500),this.actionObj.actionName=this.getActionCompleteName(),this.actionObj.actionName&&this.actionCompleteMethod())},f.prototype.refresh=function(){this.pivotRefresh()},f.prototype.layoutRefresh=function(){var e;this.element&&this.element.classList.contains("e-pivotview")&&("olap"===this.dataType?this.olapEngineModule&&this.olapEngineModule.pivotValues:this.engineModule&&this.engineModule.pivotValues)&&(this.grid&&(e="olap"===this.dataType&&0<this.olapEngineModule.pivotValues.length?this.olapEngineModule.pivotValues[0].length:0<this.dataSourceSettings.values.length&&this.engineModule&&0<this.engineModule.pivotValues.length?this.engineModule.pivotValues[0].length:2,e=this.renderModule.calculateColWidth(e),this.grid.width=this.renderModule.calculateGridWidth(),this.renderModule.calculateGridHeight(!0),this.gridSettings.allowAutoResizing&&this.setCommonColumnsWidth(this.grid.columns,e),this.triggerColumnRenderEvent(this.grid.columns),this.grid.refreshColumns(),this.renderModule.isAutoFitEnabled?this.renderModule.addPivotAutoFitClass():this.renderModule.removePivotAutoFitClass(),this.showGroupingBar&&this.groupingBarModule&&this.element.querySelector("."+Ge)&&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(zr,this),this.chart)&&(this.showToolbar&&"Chart"===this.currentView||!this.showToolbar)&&(this.chart.width=(this.showToolbar&&this.grid||"Both"===this.displayOption.view&&this.grid?this.getGridWidthAsNumber():this.getWidthAsNumber()).toString(),this.chart.height=this.pivotChartModule.getResizedChartHeight(),"Chart"===this.displayOption.view)&&this.showGroupingBar&&this.groupingBarModule&&this.element.querySelector("."+ki)&&this.groupingBarModule.refreshUI()},f.prototype.cellClicked=function(e,t,i){var a,r,n,s=this;e.classList.contains(yi)&&(e.classList.contains(vi)?this.isPopupClicked=!1:this.isPopupClicked=!0),t&&!_e.isNullOrUndefined(this.pivotValues)&&0<this.pivotValues.length?(a=parseInt(t.getAttribute("aria-colindex"),10)-1,r=Number(t.getAttribute("index")),n=Number(t.getAttribute("aria-colspan")),e={cancel:!1,isCellClick:!0,currentCell:t,data:this.pivotValues[r][a]},this.trigger(Da,e,function(e){s.gridSettings.allowSelection&&(("Both"===s.gridSettings.selectionSettings.mode?t.classList.contains(Si):"Row"===s.gridSettings.selectionSettings.mode)?s.clearSelection(t,i):e.cancel||(s.clearSelection(t,i),s.applyColumnSelection(i,t,a,a+(0<n?n-1:0),r)),"Column"===s.gridSettings.selectionSettings.mode||t.classList.contains(yt)||s.rowDeselect(t,i,r,s.gridSettings.selectionSettings.mode,e),"Column"===s.gridSettings.selectionSettings.mode||e.cancel||(("Multiple"===s.gridSettings.selectionSettings.type?i.ctrlKey||i.shiftKey:s.selectedRowIndex===r)?s.selectedRowIndex=void 0:(s.selectedRowIndex=r,s.grid.selectionModule.selectRow(r-s.renderModule.rowStartPos),t.classList.add("e-focused")))),s.cellClick&&e.isCellClick&&s.trigger(Ca,{currentCell:t,data:s.pivotValues[r][a],nativeEvent:i}),s.getSelectedCellsPos()})):this.clearSelection(null,i)},f.prototype.rowDeselect=function(e,t,i,a,r){!t.shiftKey&&!t.ctrlKey&&"Both"!==this.gridSettings.selectionSettings.mode||"Single"===this.gridSettings.selectionSettings.type?e.classList.contains(pi)||e.classList.contains(ui)||e.classList.contains(fi)?(_e.removeClass(this.element.querySelectorAll("."+pi),pi),_e.removeClass(this.element.querySelectorAll("."+ui),ui),_e.removeClass(this.element.querySelectorAll("."+fi),fi),r.cancel?this.setSavedSelectedCells():"Cell"===a?_e.addClass([e],[pi]):"Row"!==a&&"Single"!==this.gridSettings.selectionSettings.type||(_e.addClass(this.element.querySelectorAll('[index="'+i+'"]'),[ui,fi]),"Row"!==a&&e.classList.add(pi))):r.cancel?this.setSavedSelectedCells():(_e.removeClass(this.element.querySelectorAll("."+pi),pi),_e.removeClass(this.element.querySelectorAll("."+ui),ui),_e.removeClass(this.element.querySelectorAll("."+fi),fi)):(t.shiftKey||t.ctrlKey||"Both"===this.gridSettings.selectionSettings.mode)&&r.cancel&&(_e.removeClass(this.element.querySelectorAll("."+pi),pi),_e.removeClass(this.element.querySelectorAll("."+ui),ui),_e.removeClass(this.element.querySelectorAll("."+fi),fi),this.setSavedSelectedCells())},f.prototype.clearSelection=function(e,t){if(!t.shiftKey&&!t.ctrlKey||"Single"===this.gridSettings.selectionSettings.type){if("Cell"===this.gridSettings.selectionSettings.mode)e&&e.classList.contains(yt)?_e.removeClass(this.element.querySelectorAll("."+Si+"."+pi),pi):_e.removeClass(this.element.querySelectorAll("."+yt+"."+fi),[fi,ui]);else if("Both"===this.gridSettings.selectionSettings.mode)if(e&&e.classList.contains(Si))for(var i=0,a=[].slice.call(this.element.querySelectorAll("."+ui+", ."+pi));i<a.length;i++){var r=a[i];_e.removeClass([r],[fi,ui,pi])}else _e.removeClass(this.element.querySelectorAll("."+pi),pi)}else if("Both"===this.gridSettings.selectionSettings.mode&&"Multiple"===this.gridSettings.selectionSettings.type&&e.classList.contains(bt))for(var n=0,s=[].slice.call(this.element.querySelectorAll("."+yt+"."+ui));n<s.length;n++){var o=s[n],o=Number(o.getAttribute("aria-colindex"));if(o&&!isNaN(o))for(var l=0,d=[].slice.call(this.element.querySelectorAll("[aria-colindex='"+o+"']:not(."+fi+")"));l<d.length;l++){var h=d[l];_e.addClass([h],[fi,ui])}}},f.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;for(var r=a.level,n=t;(a=this.engineModule.pivotValues[++n][e])&&r<a.level;);this.isAdaptive?this.rowRangeSelection={enable:!0,startIndex:t-this.renderModule.rowStartPos,endIndex:n-(1+this.renderModule.rowStartPos)}:this.grid.selectionModule.selectRowsByRange(t-this.renderModule.rowStartPos,n-(1+this.renderModule.rowStartPos))}},f.prototype.applyColumnSelection=function(e,t,i,a,r){if(!t.classList.contains(bt)&&("Cell"!==this.gridSettings.selectionSettings.mode||t.classList.contains(yt))){for(var n=e.ctrlKey,s=(this.isAdaptive&&"Multiple"===this.gridSettings.selectionSettings.type&&(this.grid.selectionModule.showPopup(e),n=this.isPopupClicked?(this.element.querySelector("."+yi).classList.add(vi),!0):(this.element.querySelector("."+yi).classList.remove(vi),!1)),[]),o=this.gridSettings.selectionSettings.type,l=t.classList.contains(fi),d=[],h={},p=i;p<=a;p++)d.push(p.toString());if(n&&"Single"!==o)l=!1;else{for(var u=0,c=[].slice.call(this.element.querySelectorAll("."+fi+", ."+ui));u<c.length;u++){var g=c[u],m=(_e.removeClass([g],[fi,ui]),-1===d.indexOf((parseInt(g.getAttribute("aria-colindex"),10)-1).toString())&&(l=!1),parseInt(g.getAttribute("aria-colindex"),10)-1);h[m]=m}d=0<Object.keys(h).length?Object.keys(h).sort(function(e,t){return parseInt(e,10)-parseInt(t,10)}):d}"Multiple"===o&&e.shiftKey?(this.shiftLockedPos=0===this.shiftLockedPos.length?d:this.shiftLockedPos,Number(this.shiftLockedPos[0])<=i?i=Number(this.shiftLockedPos[0]):a=a<Number(this.shiftLockedPos[this.shiftLockedPos.length-1])?Number(this.shiftLockedPos[this.shiftLockedPos.length-1]):a):this.shiftLockedPos=[];var S=[];if(e.ctrlKey&&"Both"===this.gridSettings.selectionSettings.mode&&"Multiple"===o&&!t.classList.contains(bt))for(var f=0,v=[].slice.call(this.element.querySelectorAll("."+bt+"."+pi+",."+bt+"."+ui));f<v.length;f++){g=v[f];S.push(g.getAttribute("index"))}for(var y=i;y<=a;)s.push('[aria-colindex="'+(y+1)+'"]'+("Cell"===this.gridSettings.selectionSettings.mode?'[index="'+r+'"]':"")),y++;if(!l){r=t.classList.contains(Ct)?r:this.renderModule.rowStartPos-1;for(var b=t.classList.contains(fi),C=0,x=[].slice.call(this.element.querySelectorAll(s.toString()));C<x.length;C++){g=x[C];Number(g.getAttribute("index"))>=r&&(b&&n&&-1===S.indexOf(g.getAttribute("index"))?_e.removeClass([g],[fi,ui]):_e.addClass([g],[fi,ui]))}}this.renderModule.selected()}},f.prototype.getSelectedCellsPos=function(){this.savedSelectedCellsPos=[],this.cellSelectionPos=[];for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+ui));e<t.length;e++){var i=t[e];this.savedSelectedCellsPos.push({rowIndex:i.getAttribute("index"),colIndex:(parseInt(i.getAttribute("aria-colindex"),10)-1).toString()})}for(var a=0,r=[].slice.call(this.element.querySelectorAll("."+pi));a<r.length;a++){i=r[a];this.cellSelectionPos.push({rowIndex:i.getAttribute("index"),colIndex:(parseInt(i.getAttribute("aria-colindex"),10)-1).toString()})}},f.prototype.setSavedSelectedCells=function(){for(var e=0,t=[].slice.call(this.savedSelectedCellsPos);e<t.length;e++){var i=t[e],a='[aria-colindex="'+(parseInt(i.colIndex,10)+1)+'"][index="'+i.rowIndex+'"]';_e.addClass([this.element.querySelector(a)],[fi,ui])}for(var r=0,n=[].slice.call(this.cellSelectionPos);r<n.length;r++){i=n[r],a='[aria-colindex="'+(parseInt(i.colIndex,10)+1)+'"][index="'+i.rowIndex+'"]';_e.addClass([this.element.querySelector(a)],[pi])}},f.prototype.renderEmptyGrid=function(){var e,t=this;this.isEmptyGrid=!0,this.notEmpty=!1,this.isInitial=!0,this.renderModule=this.renderModule||new js(this),this.grid&&this.grid.element&&this.element.querySelector("."+Wt)?(this.notEmpty=!0,this.grid.setProperties({columns:this.renderModule.frameEmptyColumns(),dataSource:this.renderModule.frameEmptyData()},!0),this.grid.notify("datasource-modified",{}),this.grid.refreshColumns()):(this.element.querySelector("."+Wt)&&_e.remove(this.element.querySelector("."+Wt)),this.renderModule.bindGrid(this,!0),this.grid.showSpinner=function(){},this.grid.hideSpinner=function(){},e=_e.createElement("div",{id:this.element.id+"_grid"}),this.element.appendChild(e),this.grid.isStringTemplate=!0,this.grid.appendTo(e),this.grid.off("data-ready",this.grid.dataReady),this.grid.on("data-ready",function(){t.grid.scrollModule.setWidth(),t.grid.scrollModule.setHeight()}))},f.prototype.initEngine=function(){var i=this;if(this.element.querySelector(".e-spin-hide")&&this.showWaitingPopup(),"pivot"===this.dataType){var e=!_e.isNullOrUndefined(this.dataSourceSettings.dataSource)&&0<this.dataSourceSettings.dataSource.length?this.dataSourceSettings.dataSource[0]:_e.isNullOrUndefined(this.engineModule.data)?void 0:this.engineModule.data[0];if(e&&this.pivotCommon){e="[object Array]"===Object.prototype.toString.call(e);if(e&&"JSON"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidJSON"));if(!e&&"CSV"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidCSV"))}}e={dataSourceSettings:Ie.getClonedDataSourceSettings(this.dataSourceSettings)};this.trigger(ra,e,function(e){Ie.updateDataSourceSettings(i,e.dataSourceSettings),i.updatePageSettings(!1);var t,e={mode:"",savedFieldList:void 0,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:i.enablePaging,enableVirtualization:i.enableVirtualization,allowDataCompression:i.allowDataCompression,enableHtmlSanitizer:i.enableHtmlSanitizer,enableOptimizedRendering:i.enableVirtualization&&i.virtualScrollSettings&&i.virtualScrollSettings.allowSinglePage,isTabularLayout:i.isTabular};"pivot"===i.dataType?(i.dataSourceSettings.groupSettings&&0<i.dataSourceSettings.groupSettings.length&&(t=i.engineModule.data,i.clonedDataSet=i.clonedDataSet||("CSV"===i.dataSourceSettings.type?Ie.getClonedCSVData(t):Ie.getClonedData(t)),(t=JSON.parse(i.getPersistData()).dataSourceSettings).dataSource=[],i.clonedReport=i.clonedReport||t),"Server"!==i.dataSourceSettings.mode&&i.engineModule.renderEngine(i.dataSourceSettings,e,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("initEngine")):"SSAS"===i.dataSourceSettings.providerType&&"olap"===i.dataType&&(e.savedFieldList=i.olapEngineModule.fieldList,e.savedFieldListData=i.olapEngineModule.fieldListData,Ie.renderOlapEngine(i,e),i.allowServerDataBinding=!1,i.setProperties({pivotValues:i.olapEngineModule.pivotValues},!0),i.allowServerDataBinding=!0,i.enginePopulatedEventMethod("initEngine"))})},f.prototype.enginePopulatedEventMethod=function(e,t){var i,a;"initEngine"===e?(i=t||this,this.trigger(na,{pivotValues:this.pivotValues},function(e){"olap"===i.dataType?(i.olapEngineModule.pivotValues=e.pivotValues,i.setProperties({pivotValues:i.olapEngineModule.pivotValues},!0)):(i.engineModule.pivotValues=e.pivotValues,i.setProperties({pivotValues:i.engineModule.pivotValues},!0)),i.notify(Hr,{}),i.notEmpty=!0})):(e={dataSourceSettings:(a=t||this).dataSourceSettings,pivotValues:a.pivotValues},a.trigger(na,e,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.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()}))},f.prototype.generateData=function(){this.isStaticRefresh||("Chart"!==this.displayOption.view&&_e.isNullOrUndefined(this.grid)?(this.renderEmptyGrid(),this.showWaitingPopup()):(this.showWaitingPopup(),clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.refreshData.bind(this),100)))},f.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 ce.DataManager?"pivot"===e.dataType&&0<e.remoteData.length?(this.element.querySelector(".e-spinner-pane")||this.showWaitingPopup(),this.engineModule.data=e.remoteData,this.initEngine()):_e.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&&0<e.dataSourceSettings.dataSource.length||this.engineModule.data&&0<this.engineModule.data.length?("pivot"===e.dataType&&(this.hideWaitingPopup(),e.engineModule.data=e.dataSourceSettings.dataSource),e.initEngine()):"Server"===this.dataSourceSettings.mode?this.getEngine("onRefresh"):(this.notify(Hr,{}),this.hideWaitingPopup()):(this.notify(Hr,{}),this.hideWaitingPopup())},f.prototype.getValueCellInfo=function(e){return this.trigger(gr,e),e},f.prototype.getHeaderSortInfo=function(e){return this.trigger(mr,e),e},f.prototype.bindTriggerEvents=function(e){this.trigger(w.getObject("name",e),e)},f.prototype.getData=function(){(this.dataSourceSettings.dataSource.defaultQuery?this.dataSourceSettings.dataSource.executeQuery(this.dataSourceSettings.dataSource.defaultQuery):this.dataSourceSettings.dataSource.executeQuery(new ce.Query)).then(this.executeQuery.bind(this))},f.prototype.executeQuery=function(e){this.element.querySelector(".e-spinner-pane")||this.showWaitingPopup();this.engineModule.data=e.result,this.isEmptyGrid&&!_e.isNullOrUndefined(this.engineModule.data)&&0===this.engineModule.data.length?this.hideWaitingPopup():!_e.isNullOrUndefined(this.engineModule.data)&&0<this.engineModule.data.length?(this.isEmptyGrid=!1,this.initEngine()):(this.isEmptyGrid=!0,this.hideWaitingPopup(),this.renderEmptyGrid(),this.engineModule.fieldList=null,this.engineModule.isEmptyData=!0,this.pivotValues=[],this.engineModule.data=[],this.notify(Hr,{}))},f.prototype.applyFormatting=function(e){if(e){for(var t=[],i=e.length,a=0;a<i;a++)_e.isNullOrUndefined(e[a])||void 0!==e[a][0]||t.push(a);for(a=0;a<e.length;a++)for(var r=this.isTabular?this.engineModule.rowMaxLevel+1:1;e[a]&&r<e[a].length;r++)if("value"===e[a][r].axis&&""!==e[a][r].formattedText){e[a][r].style=void 0,e[a][r].cssClass=void 0;for(var n=this.dataSourceSettings.conditionalFormatSettings,s=0;s<n.length;s++)!0!==n[s].applyGrandTotals&&!_e.isNullOrUndefined(n[s].applyGrandTotals)&&e[a][r].isGrandSum||!this.checkCondition(e[a][r].value,n[s].conditions,n[s].value1,n[s].value2)||n[s].measure&&e[a][r].actualText!==n[s].measure||void 0!==n[s].measure&&""===n[s].measure||void 0!==n[s].label&&""===n[s].label||!(!n[s].label||-1<e[a][0].valueSort.levelName.indexOf(n[s].label)||-1<e[a][r].rowHeaders.indexOf(n[s].label)||-1<e[a][r].columnHeaders.indexOf(n[s].label))||(n[s].style&&n[s].style.backgroundColor&&(n[s].style.backgroundColor="#"===n[s].style.backgroundColor.charAt(0)&&this.conditionalFormattingModule.isHex(n[s].style.backgroundColor.substr(1))?n[s].style.backgroundColor:this.conditionalFormattingModule.colourNameToHex(n[s].style.backgroundColor)),n[s].style&&n[s].style.color&&(n[s].style.color="#"===n[s].style.color.charAt(0)&&this.conditionalFormattingModule.isHex(n[s].style.color.substr(1))?n[s].style.color:this.conditionalFormattingModule.colourNameToHex(n[s].style.color)),e[a][r].style=n[s].style,e[a][r].cssClass="format"+this.element.id+s)}for(var o=this.dataSourceSettings.conditionalFormatSettings,s=0;s<o.length;s++){var l=this.createStyleSheet.bind(this)(),d="color: "+o[s].style.color+"!important;background-color: "+o[s].style.backgroundColor+"!important;font-size: "+o[s].style.fontSize+"!important;font-family: "+o[s].style.fontFamily+" !important;",h=".format"+this.element.id+s;l.insertRule(h+", "+h+" .e-cellvalue{"+d+"}",0)}}},f.prototype.createStyleSheet=function(){var e=document.createElement("style");return e.appendChild(document.createTextNode("")),document.head.appendChild(e),e.sheet},f.prototype.applyHyperlinkSettings=function(){if(this.pivotValues){for(var e=this.pivotValues,t=[],i=e.length,a=0;a<i;a++)!_e.isNullOrUndefined(e[a])&&_e.isNullOrUndefined(e[a][0])&&t.push(a);if(0<this.hyperlinkSettings.conditionalSettings.length)for(a=0;a<e.length;a++)for(var r=this.isTabular?this.engineModule.rowMaxLevel+1:1;e[a]&&r<e[a].length;r++)if("value"===e[a][r].axis){e[a][r].enableHyperlink=!1;for(var n,s,o=this.hyperlinkSettings.conditionalSettings,l=0;l<o.length;l++)this.checkCondition(e[a][r].value,o[l].conditions,o[l].value1,o[l].value2)&&(n="row"===this.dataSourceSettings.valueAxis?a:"pivot"===this.dataType?this.engineModule.headerContent.length-1:this.olapEngineModule.headerContent.length-1,s="row"===this.dataSourceSettings.valueAxis?0:r,!o[l].measure||1===this.dataSourceSettings.values.length||e[n][s].valueSort&&e[n][s].actualText===o[l].measure)&&(!o[l].label||e[t[o[l].label.split(".").length-1]]&&e[t[o[l].label.split(".").length-1]][r]&&e[t[o[l].label.split(".").length-1]][r].valueSort&&e[t[o[l].label.split(".").length-1]][r].valueSort[o[l].label]||-1<e[a][0].valueSort.levelName.indexOf(o[l].label))&&(e[a][r].enableHyperlink=!0)}if(!_e.isNullOrUndefined(this.hyperlinkSettings.headerText))for(var d=this.dataSourceSettings.valueSortSettings.headerDelimiter||".",a=0;a<e.length;a++)for(r=this.isTabular?this.engineModule.rowMaxLevel+1:1;e[a]&&r<e[a].length;r++)if("value"===e[a][r].axis){var h=this.hyperlinkSettings.headerText;if(-1<e[a][0].valueSort.levelName.indexOf(h))e[a][0].enableHyperlink=!0,e[a][r].enableHyperlink=!0;else{for(var p=!1,l=0;l<t.length;l++)h=d+this.hyperlinkSettings.headerText,-1<(d+e[t[l]][r].valueSort.levelName).indexOf(h)&&(p=e[t[l]][r].enableHyperlink=!0);e[a][r].enableHyperlink=p}}}},f.prototype.checkCondition=function(e,t,i,a){switch(t){case"LessThan":return e<i;case"LessThanOrEqualTo":return e<=i;case"GreaterThan":return i<e;case"GreaterThanOrEqualTo":return i<=e;case"Equals":return e===i;case"NotEquals":return e!==i;case"Between":return i<a&&i<=e&&e<=a||a<i&&e<=i&&a<=e;case"NotBetween":return!(i<a&&i<=e&&e<=a||a<i&&e<=i&&a<=e);default:return!1}},f.prototype.updateGroupingReport=function(e,t){this.clonedDataSet||this.clonedReport||(i=this.engineModule.data,this.clonedDataSet="CSV"===this.dataSourceSettings.type?Ie.getClonedCSVData(i):Ie.getClonedData(i),(i=JSON.parse(this.getPersistData()).dataSourceSettings).dataSource=[],this.clonedReport=this.clonedReport||i);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/g,i="CSV"===this.dataSourceSettings.type?Ie.getClonedCSVData(this.clonedDataSet):Ie.getClonedData(this.clonedDataSet),l=this.dataSourceSettings,a=this.clonedReport.properties||this.clonedReport,d=[l.rows,l.columns,l.values,l.filters],r=[l.filterSettings,l.sortSettings,l.formatSettings,l.drilledMembers],h=(h=a.rows).concat(a.columns,a.values,a.filters);if(0===e.length||0<e.length){this.engineModule.groupingFields={},this.setProperties({dataSourceSettings:{dataSource:i,groupSettings:0<e.length?l.groupSettings:[]}},!0);for(var p,u="Date"===t,c=[],g=0,n=d.length;g<n;g++)for(var m,S,s=0,f=d[g].length;s<f;s++)!function(e,t){var i=d[g][e].name,a=(-1===c.indexOf(i)&&c.push(i),c.indexOf(i));if(!_e.isNullOrUndefined(i.match(o))&&u||-1!==i.indexOf("_custom_group")&&!Ie.getFieldByName(i.replace("_custom_group",""),l.groupSettings)){d[g].splice(e,1),c.splice(a,1),e--,t--;for(var r,i=i.split("_")[0],n=!1,s=0;s<d.length&&!(n=0<d[s].filter(function(e){return e.name===i}).length);s++);n||(p=i.split("_")[0],r=Ie.getFieldByName(p,h),h=h.filter(function(e){return e.name!==p}),c.push(p),r&&(n?d[g].splice(e,1,r):d[g].splice(++e,0,r)))}else(r=Ie.getFieldByName(i,h))?d[g].splice(e,1,r):p===i&&d[g].splice(e,1);m=e,S=t}(s,f),s=m,f=S;for(var v=0,y=c;v<y.length;v++)for(var b=y[v],C=Ie.getFilterItemByName(b,a.filterSettings),x=Ie.getFieldByName(b,a.sortSettings),w=Ie.getFieldByName(b,a.formatSettings),T=Ie.getFieldByName(b,a.drilledMembers),M=[C,x,w,T],g=0,n=r.length;g<n;g++){for(var D=!1,s=0,f=r[g].length;s<f;s++){var O=r[g][s].name;if(!_e.isNullOrUndefined(O.match(o))&&u||-1!==O.indexOf("_custom_group")&&!Ie.getFieldByName(O.replace("_custom_group",""),l.groupSettings))r[g].splice(s,1),s--,f--;else if(b===r[g][s].name){D=!0,M[g]?r[g].splice(s,1,M[g]):(r[g].splice(s,1),s--,f--);break}}!D&&0===g&&C&&r[g].push(C),!D&&1===g&&x&&r[g].push(x),!D&&2===g&&w&&r[g].push(w),!D&&3===g&&T&&r[g].push(T)}}},f.prototype.removeButtonFocus=function(){document.querySelectorAll(".e-btn-focused")&&_e.removeClass(document.querySelectorAll(".e-btn-focused"),"e-btn-focused")},f.prototype.wireEvents=function(){var e=this.virtualScrollSettings&&this.virtualScrollSettings.allowSinglePage&&"pivot"===this.dataType;"Chart"!==this.displayOption.view&&(_e.EventHandler.add(this.element,this.isAdaptive?"touchend":"click",this.mouseClickHandler,this),_e.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this),_e.EventHandler.add(this.element.querySelector("."+bi),"mousemove",this.mouseMoveHandler,this),_e.EventHandler.add(this.element,"mouseup",this.mouseUpHandler,this),_e.EventHandler.add(this.element,this.isAdaptive?"touchend":"contextmenu",this.mouseRclickHandler,this),this.virtualscrollModule)&&this.enableVirtualization&&!e&&_e.EventHandler.add(this.element.querySelector("."+Ci).querySelector("."+ue),"scroll",this.headerScrollUpdate,this),_e.EventHandler.add(document,this.isAdaptive?"touchend":"click",this.removeButtonFocus,this),window.addEventListener("resize",this.onWindowResize.bind(this),!0)},f.prototype.headerScrollUpdate=function(){this.element.querySelector("."+hi).scrollLeft!==this.element.querySelector("."+Ci).querySelector("."+ue).scrollLeft&&(this.virtualscrollModule.direction="horizondal"),this.element.querySelector("."+hi).scrollLeft=this.element.querySelector("."+Ci).querySelector("."+ue).scrollLeft},f.prototype.unwireEvents=function(){"Chart"!==this.displayOption.view&&(_e.EventHandler.remove(this.element,this.isAdaptive?"touchend":"click",this.mouseClickHandler),_e.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler),this.element.querySelector("."+bi)&&_e.EventHandler.remove(this.element.querySelector("."+bi),"mousemove",this.mouseMoveHandler),_e.EventHandler.remove(this.element,"mouseup",this.mouseUpHandler),_e.EventHandler.remove(this.element,this.isAdaptive?"touchend":"contextmenu",this.mouseRclickHandler),this.virtualscrollModule)&&this.enableVirtualization&&this.element.querySelector("."+Ci)&&_e.EventHandler.remove(this.element.querySelector("."+Ci).querySelector("."+ue),"scroll",this.headerScrollUpdate),_e.EventHandler.remove(document,this.isAdaptive?"touchend":"click",this.removeButtonFocus),window.removeEventListener("resize",this.onWindowResize.bind(this),!0)},f.prototype.actionBeginMethod=function(){var e={dataSourceSettings:Ie.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,cancel:!1};return this.trigger(Ir,e),e.cancel},f.prototype.actionCompleteMethod=function(){var e={dataSourceSettings:Ie.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,actionInfo:this.actionObj.actionInfo};this.trigger(Fr,e),this.actionObj.actionName="",this.actionObj.actionInfo=void 0,this.actionObj.fieldInfo=void 0},f.prototype.actionFailureMethod=function(e){e={actionName:this.actionObj.actionName,errorInfo:e};this.trigger(Lr,e)},f.prototype.getActionCompleteName=function(){var e;switch(this.actionObj.actionName){case rn:case On:e=ss;break;case nn:case Dn:e=os;break;case ln:e=ls;break;case dn:e=ds;break;case vn:e=hs;break;case yn:e=ps;break;case bn:e=us;break;case Cn:e=cs;break;case xn:e=gs;break;case wn:e=ms;break;case Tn:e=Ss;break;case Mn:e=fs;break;case Yr:e=vs;break;case An:e=Bn;break;case En:e=ys;break;case In:e=bs;break;case Fn:e=Cs;break;case Ln:e=xs;break;case Hn:e=ws;break;case Rn:e=Ts;break;case Pn:e=Ms;break;case kn:e=Gn;break;case jn:e=zn;break;case qn:e=Wn;break;case cn:e=as;break;case Sn:e=rs;break;case fn:e=ns;break;case un:e=is;break;case mn:e=ts;break;case gn:e=es;break;case Vn:e=Ds;break;case Zr:e=Kn;break;case Jr:e=Xn;break;case $r:e=Jn;break;case en:e=Zn;break;case jr:e=Es;break;case kr:e=Ns;break;case Un:e=Is;break;case _n:e=Fs;break;default:e=this.actionObj.actionName}return e},f.prototype.getStackedColumns=function(e,t){for(var i=0,a=e;i<a.length;i++){var r=a[i];t.push(r),r.columns&&0<r.columns.length&&this.getStackedColumns(r.columns,t)}return t},f.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)&&_e.select("#"+this.element.id+"_chart",this.element)&&_e.remove(_e.select("#"+this.element.id+"_chart",this.element)),this.grid&&!this.grid.isDestroyed&&(this.grid.destroy(),this.grid.isDestroyed)&&_e.select("#"+this.element.id+"_grid",this.element)&&_e.remove(_e.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!==_e.select("#"+this.element.id+"_PivotFieldList",this.element)&&_e.remove(_e.select("#"+this.element.id+"_PivotFieldList",this.element)),this.pivotFieldListModule.element.remove(),this.pivotFieldListModule.element=null),this.fieldListModule&&(this.fieldListModule.element=null),(this.allowDrillThrough||this.editSettings&&this.editSettings.allowEditing)&&this.drillThroughModule&&this.drillThroughModule.destroy(),this.chartExportModule&&this.chartExportModule.destroy(),this.unwireEvents(),qh.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="",_e.removeClass([this.element],F),_e.removeClass([this.element],L),_e.removeClass([this.element],A),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,this.virtualDiv=null,this.virtualHeaderDiv=null,this.virtualScrollDiv=null,this.virtualTableDiv=null,this.lastSelectedElement=null},f.prototype.showNumberFormattingDialog=function(){this.allowNumberFormatting&&this.numberFormattingModule.showNumberFormattingDialog()},f.prototype.getValuesHeader=function(e,t){var i=this.dataSourceSettings.values;return"value"===t&&!_e.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"===t&&1===i.length&&"row"===this.dataSourceSettings.valueAxis&&e.formattedText===this.localeObj.getConstant("grandTotal")?this.localeObj.getConstant("total")+" "+this.localeObj.getConstant(i[i.length-1].type)+" "+this.localeObj.getConstant("of")+" "+(_e.isNullOrUndefined(i[i.length-1].caption)?i[i.length-1].name:i[i.length-1].caption):e.formattedText},f.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)},c([_e.Property("USD")],f.prototype,"currencyCode",void 0),c([_e.Property(!1)],f.prototype,"showFieldList",void 0),c([_e.Complex({},a)],f.prototype,"gridSettings",void 0),c([_e.Complex({},gl)],f.prototype,"chartSettings",void 0),c([_e.Complex({},$l)],f.prototype,"groupingBarSettings",void 0),c([_e.Complex({},ld)],f.prototype,"hyperlinkSettings",void 0),c([_e.Complex({},Dd)],f.prototype,"pageSettings",void 0),c([_e.Complex({},fd)],f.prototype,"pagerSettings",void 0),c([_e.Complex({},io)],f.prototype,"dataSourceSettings",void 0),c([_e.Complex({},id)],f.prototype,"editSettings",void 0),c([_e.Complex({},Nd)],f.prototype,"displayOption",void 0),c([_e.Complex({},wd)],f.prototype,"virtualScrollSettings",void 0),c([_e.Property()],f.prototype,"pivotValues",void 0),c([_e.Property(!1)],f.prototype,"showGroupingBar",void 0),c([_e.Property(!0)],f.prototype,"showTooltip",void 0),c([_e.Property(!1)],f.prototype,"showToolbar",void 0),c([_e.Property([])],f.prototype,"toolbar",void 0),c([_e.Property(!1)],f.prototype,"showValuesButton",void 0),c([_e.Property(!1)],f.prototype,"allowCalculatedField",void 0),c([_e.Property(!1)],f.prototype,"enableFieldSearching",void 0),c([_e.Property(!1)],f.prototype,"enableValueSorting",void 0),c([_e.Property(!1)],f.prototype,"allowConditionalFormatting",void 0),c([_e.Property(!1)],f.prototype,"allowNumberFormatting",void 0),c([_e.Property("auto")],f.prototype,"height",void 0),c([_e.Property("auto")],f.prototype,"width",void 0),c([_e.Property(!1)],f.prototype,"allowExcelExport",void 0),c([_e.Property(!1)],f.prototype,"enableVirtualization",void 0),c([_e.Property(!1)],f.prototype,"enablePaging",void 0),c([_e.Property(!1)],f.prototype,"allowDrillThrough",void 0),c([_e.Property(!1)],f.prototype,"allowPdfExport",void 0),c([_e.Property(!1)],f.prototype,"allowDeferLayoutUpdate",void 0),c([_e.Property(!1)],f.prototype,"allowDataCompression",void 0),c([_e.Property(1e3)],f.prototype,"maxNodeLimitInMemberEditor",void 0),c([_e.Property(1e4)],f.prototype,"maxRowsInDrillThrough",void 0),c([_e.Property(!0)],f.prototype,"loadOnDemandInMemberEditor",void 0),c([_e.Property(!1)],f.prototype,"enableHtmlSanitizer",void 0),c([_e.Property()],f.prototype,"cellTemplate",void 0),c([_e.Property()],f.prototype,"toolbarTemplate",void 0),c([_e.Property()],f.prototype,"tooltipTemplate",void 0),c([_e.Property()],f.prototype,"spinnerTemplate",void 0),c([_e.Property(!1)],f.prototype,"allowGrouping",void 0),c([_e.Property(!0)],f.prototype,"exportAllPages",void 0),c([_e.Property(["Sum","Count","DistinctCount","Product","Min","Max","Avg","Median","Index","PopulationVar","SampleVar","PopulationStDev","SampleStDev","RunningTotals","PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfParentColumnTotal","PercentageOfParentRowTotal","DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"])],f.prototype,"aggregateTypes",void 0),c([_e.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"])],f.prototype,"chartTypes",void 0),c([_e.Property("")],f.prototype,"cssClass",void 0),c([_e.Event()],f.prototype,"queryCellInfo",void 0),c([_e.Event()],f.prototype,"headerCellInfo",void 0),c([_e.Event()],f.prototype,"resizing",void 0),c([_e.Event()],f.prototype,"resizeStop",void 0),c([_e.Event()],f.prototype,"pdfHeaderQueryCellInfo",void 0),c([_e.Event()],f.prototype,"pdfQueryCellInfo",void 0),c([_e.Event()],f.prototype,"excelHeaderQueryCellInfo",void 0),c([_e.Event()],f.prototype,"excelQueryCellInfo",void 0),c([_e.Event()],f.prototype,"columnDragStart",void 0),c([_e.Event()],f.prototype,"columnDrag",void 0),c([_e.Event()],f.prototype,"columnDrop",void 0),c([_e.Event()],f.prototype,"beforePdfExport",void 0),c([_e.Event()],f.prototype,"beforeExcelExport",void 0),c([_e.Event()],f.prototype,"beforeColumnsRender",void 0),c([_e.Event()],f.prototype,"selected",void 0),c([_e.Event()],f.prototype,"selecting",void 0),c([_e.Event()],f.prototype,"cellDeselected",void 0),c([_e.Event()],f.prototype,"rowSelected",void 0),c([_e.Event()],f.prototype,"rowDeselected",void 0),c([_e.Event()],f.prototype,"chartTooltipRender",void 0),c([_e.Event()],f.prototype,"chartLegendClick",void 0),c([_e.Event()],f.prototype,"beforePrint",void 0),c([_e.Event()],f.prototype,"animationComplete",void 0),c([_e.Event()],f.prototype,"legendRender",void 0),c([_e.Event()],f.prototype,"textRender",void 0),c([_e.Event()],f.prototype,"pointRender",void 0),c([_e.Event()],f.prototype,"seriesRender",void 0),c([_e.Event()],f.prototype,"chartMouseMove",void 0),c([_e.Event()],f.prototype,"chartMouseClick",void 0),c([_e.Event()],f.prototype,"pointMove",void 0),c([_e.Event()],f.prototype,"chartMouseLeave",void 0),c([_e.Event()],f.prototype,"chartMouseDown",void 0),c([_e.Event()],f.prototype,"chartMouseUp",void 0),c([_e.Event()],f.prototype,"dragComplete",void 0),c([_e.Event()],f.prototype,"zoomComplete",void 0),c([_e.Event()],f.prototype,"scrollStart",void 0),c([_e.Event()],f.prototype,"scrollEnd",void 0),c([_e.Event()],f.prototype,"scrollChanged",void 0),c([_e.Event()],f.prototype,"multiLevelLabelRender",void 0),c([_e.Event()],f.prototype,"chartLoaded",void 0),c([_e.Event()],f.prototype,"chartLoad",void 0),c([_e.Event()],f.prototype,"chartResized",void 0),c([_e.Event()],f.prototype,"chartAxisLabelRender",void 0),c([_e.Event()],f.prototype,"multiLevelLabelClick",void 0),c([_e.Event()],f.prototype,"chartPointClick",void 0),c([_e.Event()],f.prototype,"contextMenuClick",void 0),c([_e.Event()],f.prototype,"contextMenuOpen",void 0),c([_e.Event()],f.prototype,"onPdfCellRender",void 0),c([_e.Event()],f.prototype,"saveReport",void 0),c([_e.Event()],f.prototype,"fetchReport",void 0),c([_e.Event()],f.prototype,"loadReport",void 0),c([_e.Event()],f.prototype,"renameReport",void 0),c([_e.Event()],f.prototype,"removeReport",void 0),c([_e.Event()],f.prototype,"newReport",void 0),c([_e.Event()],f.prototype,"toolbarRender",void 0),c([_e.Event()],f.prototype,"toolbarClick",void 0),c([_e.Event()],f.prototype,"load",void 0),c([_e.Event()],f.prototype,"enginePopulating",void 0),c([_e.Event()],f.prototype,"enginePopulated",void 0),c([_e.Event()],f.prototype,"onFieldDropped",void 0),c([_e.Event()],f.prototype,"fieldDrop",void 0),c([_e.Event()],f.prototype,"fieldDragStart",void 0),c([_e.Event()],f.prototype,"dataBound",void 0),c([_e.Event()],f.prototype,"created",void 0),c([_e.Event()],f.prototype,"destroyed",void 0),c([_e.Event()],f.prototype,"beforeExport",void 0),c([_e.Event()],f.prototype,"exportComplete",void 0),c([_e.Event()],f.prototype,"conditionalFormatting",void 0),c([_e.Event()],f.prototype,"memberFiltering",void 0),c([_e.Event()],f.prototype,"cellClick",void 0),c([_e.Event()],f.prototype,"drillThrough",void 0),c([_e.Event()],f.prototype,"editCompleted",void 0),c([_e.Event()],f.prototype,"beginDrillThrough",void 0),c([_e.Event()],f.prototype,"hyperlinkCellClick",void 0),c([_e.Event()],f.prototype,"cellSelecting",void 0),c([_e.Event()],f.prototype,"drill",void 0),c([_e.Event()],f.prototype,"cellSelected",void 0),c([_e.Event()],f.prototype,"chartSeriesCreated",void 0),c([_e.Event()],f.prototype,"aggregateCellInfo",void 0),c([_e.Event()],f.prototype,"fieldListRefreshed",void 0),c([_e.Event()],f.prototype,"memberEditorOpen",void 0),c([_e.Event()],f.prototype,"calculatedFieldCreate",void 0),c([_e.Event()],f.prototype,"numberFormatting",void 0),c([_e.Event()],f.prototype,"aggregateMenuOpen",void 0),c([_e.Event()],f.prototype,"fieldRemove",void 0),c([_e.Event()],f.prototype,"beforeServiceInvoke",void 0),c([_e.Event()],f.prototype,"afterServiceInvoke",void 0),c([_e.Event()],f.prototype,"actionBegin",void 0),c([_e.Event()],f.prototype,"actionComplete",void 0),c([_e.Event()],f.prototype,"actionFailure",void 0),c([_e.Event()],f.prototype,"onHeadersSort",void 0);var qh,Hh=c([_e.NotifyPropertyChanges],f);function f(e,t){e=qh.call(this,e,t)||this;return e.verticalScrollScale=1,e.horizontalScrollScale=1,e.scrollerBrowserLimit=8e6,e.lastSortInfo={},e.lastFilterInfo={},e.lastAggregationInfo={},e.lastCalcFieldInfo={},e.isScrolling=!1,e.allowEngineExport=!1,e.isInitial=!0,e.shiftLockedPos=[],e.savedSelectedCellsPos=[],e.cellSelectionPos=[],e.isPopupClicked=!1,e.isMouseDown=!1,e.isMouseUp=!1,e.fieldsType={},e.remoteData=[],e.defaultItems={},e.isCellBoxMultiSelection=!1,e.isBlobData=!1,e.gridCellCollection={},e.rowRangeSelection={enable:!1,startIndex:0,endIndex:0},e.isStaticRefresh=!1,e.isStaticFieldList=!1,e.resizeInfo={},e.scrollPosObject={vertical:0,horizontal:0,verticalSection:0,horizontalSection:0,top:0,left:0,scrollDirection:{direction:"",position:0}},e.pivotColumns=[],e.totColWidth=0,e.posCount=0,e.isModified=!1,e.isInitialRendering=!1,e.needsID=!0,e.pivotRefresh=_e.Component.prototype.refresh,e.request="undefined"!=typeof window?new XMLHttpRequest:null,e.isServerWaitingPopup=!1,e.actionObj={},e.defaultFieldListOrder="None",e.destroyEngine=!1,e.pivotView=e,_e.setValue("mergePersistData",e.mergePersistPivotData,e),e}Uh.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},Uh.getClonedPivotValueObj=function(e){var t=0,i={};if(null!=e)for(var a=Object.keys(e);t<a.length;)i[a[t]]=e[a[t]],t++;else i=e;return i},Uh.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};var Vh=Uh;function Uh(){}_h.prototype.getModuleName=function(){return"excelExport"},_h.prototype.addHeaderAndFooter=function(e,t,i,a){this.rows||(this.rows=[]);var r=[];if(_e.isNullOrUndefined(e.rows))""!==t&&("footer"===i&&this.actualrCnt++,r.push({index:1,value:t}),this.rows.push({index:this.actualrCnt+1,cells:r}),this.actualrCnt="header"===i?this.actualrCnt+2:this.actualrCnt);else{this.actualrCnt="footer"===i?this.actualrCnt+a-e.rows[0].cells.length:this.actualrCnt;for(var n=e.rows,s=0;s<n.length;s++){for(var o=0,r=[],l=n[s],d=0;d<l.cells.length;d++)r.push({index:o+1,value:l.cells[d].value,colSpan:l.cells[d].colSpan,rowSpan:l.cells[d].rowSpan,style:l.cells[d].style}),o+=r[d].colSpan;this.actualrCnt++,this.rows.push({index:this.actualrCnt,cells:r})}this.actualrCnt="header"===i?a:this.actualrCnt}},_h.prototype.exportToExcel=function(e,t,i){this.rows=[],this.actualrCnt=0;for(var a,r,n,s,o,l=!_e.isNullOrUndefined(t)&&!_e.isNullOrUndefined(t.header),d=!_e.isNullOrUndefined(t)&&!_e.isNullOrUndefined(t.footer),h=!_e.isNullOrUndefined(t)&&!_e.isNullOrUndefined(t.fileName),p=(this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,Vh.getClonedPivotValues(this.engine.pivotValues)),h=h?t.fileName:"CSV"===e?"default.csv":"default.xlsx",u=(this.parent.exportAllPages&&(this.parent.enableVirtualization||this.parent.enablePaging)?(L=this.engine.pageSettings,A=void 0,this.engine.isPagingOrVirtualizationEnabled=!1,"olap"===this.parent.dataType?(this.updateOlapPageSettings(!0),A=this.parent.olapEngineModule.mdxQuery.slice(0)):this.engine.pageSettings=null,this.engine.generateGridData(this.parent.dataSourceSettings,!0,!0),this.parent.applyFormatting(this.engine.pivotValues),a=Vh.getClonedPivotValues(this.engine.pivotValues),this.engine.pivotValues=p,this.engine.pageSettings=L,this.engine.isPagingOrVirtualizationEnabled=!0,"olap"===this.parent.dataType&&(this.updateOlapPageSettings(!1),this.parent.olapEngineModule.mdxQuery=A)):a=p,{fileName:h,header:"",footer:"",dataCollections:[a],excelExportProperties:t}),c=(this.parent.trigger(la,u,function(e){r=e.fileName,n=e.header,s=e.footer,o=e.dataCollections}),!l&&_e.isNullOrUndefined(u.excelExportProperties)&&""!==n?this.addHeaderAndFooter({},n,"header",void 0):_e.isNullOrUndefined(u.excelExportProperties)||_e.isNullOrUndefined(u.excelExportProperties.header)||this.addHeaderAndFooter(u.excelExportProperties.header,"","header",u.excelExportProperties.header.headerRows),[]),g=0;g<o.length;g++){for(var m=o[g],S=0,f=m.length,v=this.parent.renderModule.getFormatList(),y=0,b=0;b<f;b++)if(m[b]){this.actualrCnt++;for(var C,x,w,T,M,D,O,P,S=m[b].length,N=[],E=0;E<S;E++)m[b][E]?(D=m[b][E],C="row"===this.parent.dataSourceSettings.valueAxis&&"olap"===this.parent.dataType&&D.rowOrdinal&&this.engine.tupRowInfo[D.rowOrdinal]?this.engine.tupRowInfo[D.rowOrdinal].measureName:D.actualText,C="row"===D.axis?{hAlign:"Left",bold:!0,wrapText:!0}:{numberFormat:v[C],bold:!1,wrapText:!0},P={bold:!0,vAlign:"Center",wrapText:!0,indent:0===E?10*D.level:0},(-1!==D.level||D.rowSpan)&&(M=this.engine.aggregatedValueMatrix,M="value"===D.axis?M[b]&&M[b][E]?M[b][E]:"#DIV/0!"===D.formattedText?D.formattedText:D.value:D.formattedText,x=0===this.parent.dataSourceSettings.rows.length&&"row"===this.parent.dataSourceSettings.valueAxis||0===this.parent.dataSourceSettings.columns.length&&"column"===this.parent.dataSourceSettings.valueAxis,M="grand sum"!==D.type||1===this.parent.dataSourceSettings.values.length&&"row"===this.parent.dataSourceSettings.valueAxis&&"column"===D.axis?"sum"===D.type?M.toString().replace("Total",this.parent.localeObj.getConstant("total")):!_e.isNullOrUndefined(D.valueSort)&&this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+D.formattedText===D.valueSort.levelName&&x?this.parent.getValuesHeader(D,"value"):M:x?this.parent.getValuesHeader(D,"grandTotal"):this.parent.localeObj.getConstant("grandTotal"),-1!==D.level||D.rowSpan)&&0!==D.rowSpan&&(N.push({index:E+1,value:M,colSpan:D.colSpan,rowSpan:-1===D.rowSpan?1:D.rowSpan}),x=N[N.length-1],"value"===D.axis?((isNaN(D.value)||""===D.formattedText||void 0===D.formattedText||_e.isNullOrUndefined(D.value))&&(x.value="Excel"===e?null:""),C.numberFormat="string"==typeof M?void 0:C.numberFormat,x.style=C):(x.style=P,"row"===D.axis&&(this.parent.isTabular?E<this.parent.engineModule.rowMaxLevel+1:0===E)&&(x.style=C,y="olap"===this.parent.dataType?(w=this.parent.renderModule.indentCollection[b],x.style.indent=2*w,w<y?y:w):(w=D.valueSort?D.valueSort.levelName.toString():"",O=D.actualText?D.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,O=w.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(O&&O-1),x.style.indent=2*(O=O?O-1:0),y<O?O:y))),(D.style||x.style.backColor||x.style.fontColor||x.style.fontName||x.style.fontSize)&&(x.style.backColor=x.style.backColor||D.style.backgroundColor,x.style.fontColor=x.style.fontColor||D.style.color,x.style.fontName=x.style.fontName||D.style.fontFamily,_e.isNullOrUndefined(x.style.fontSize)&&_e.isNullOrUndefined(D.style.fontSize)||(x.style.fontSize=_e.isNullOrUndefined(x.style.fontSize)?Number(D.style.fontSize.split("px")[0]):Number(x.style.fontSize))),O=void(x.style.borders={color:"#000000",lineStyle:"thin"}),T=void 0,"column"===D.axis?this.parent.trigger(ha,O={style:P,cell:D}):this.parent.trigger(ua,T={style:C,cell:D,column:void 0,data:m,value:M}),x.value="column"===D.axis?O.cell.formattedText:T.value,x.style=("column"===D.axis?O:T).style),E+=D.colSpan?D.colSpan-1:0):(D={formattedText:"",colSpan:1,rowSpan:1},O=void(0===b&&0===E&&(D.colSpan=m[0].length-this.engine.columnCount,D.rowSpan=Object.keys(m).length-this.engine.rowCount)),D&&this.parent.trigger(ha,O={style:{borders:{color:"#000000",lineStyle:"thin"}},cell:D}),P=O.cell,N.push({index:E+1,colSpan:P.colSpan,rowSpan:P.rowSpan,value:D.formattedText,style:O.style}));this.rows.push({index:this.actualrCnt,cells:N})}d?this.addHeaderAndFooter(t.footer,"","footer",t.footer.footerRows):!d&&""!==s&&_e.isNullOrUndefined(u.excelExportProperties)?this.addHeaderAndFooter({},s,"footer",void 0):_e.isNullOrUndefined(u.excelExportProperties)||_e.isNullOrUndefined(u.excelExportProperties.footer)||this.addHeaderAndFooter(u.excelExportProperties.footer,"","footer",u.excelExportProperties.footer.footerRows);for(var I=[],E=0;E<S;E++)I.push({index:E+1,width:100});0<y&&(I[0].width=100+20*y),c.push({columns:I,rows:this.rows})}var F,L=new R.Workbook({worksheets:c},"Excel"===e?"xlsx":"csv",void 0,this.parent.currencyCode),A=r.split(".").pop(),p=(i?F=L.saveAsBlob("xlsx"===A||"Excel"===e?"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"text/csv"):L.save("xlsx"===A||"csv"===A?r:r+("Excel"===e?".xlsx":".csv")),{type:e,promise:i?F:null});this.parent.trigger(da,p)},_h.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)},_h.prototype.destroy=function(){this.rows=[],this.actualrCnt=0,this.engine&&(this.engine=null),this.rows&&(this.rows=null)};bd=_h;function _h(e){this.actualrCnt=0,this.parent=e,this.rows=[]}Bh.prototype.getModuleName=function(){return"pdfExport"},Bh.prototype.addPage=function(e,t){-1===this.createdDocuments.indexOf(e.document)&&this.createdDocuments.push(e.document),t=t||this.exportProperties.pdfExportProperties;var i=e.document.sections.add(),a=e.document.pageSettings.height,r=e.document.pageSettings.width,a=(this.exportProperties.width||this.exportProperties.height?(e.document.pageSettings.orientation=this.exportProperties.width>this.exportProperties.height||!this.exportProperties.height&&this.exportProperties.width>a||!this.exportProperties.width&&r>this.exportProperties.height?U.PdfPageOrientation.Landscape:U.PdfPageOrientation.Portrait,e.document.pageSettings.size=new U.SizeF(this.exportProperties.width||r,this.exportProperties.height||a)):(e.document.pageSettings.orientation=0===this.exportProperties.orientation||this.exportProperties.orientation?this.exportProperties.orientation:_e.isNullOrUndefined(t)||_e.isNullOrUndefined(t.pageOrientation)||"Landscape"===t.pageOrientation?U.PdfPageOrientation.Landscape:U.PdfPageOrientation.Portrait,_e.isNullOrUndefined(t)||_e.isNullOrUndefined(t.pageSize)||(e.document.pageSettings.size=Ie.getPageSize(t.pageSize))),_e.isNullOrUndefined(this.exportProperties.pdfMargins)||((r=e.document.pageSettings.margins).top=(_e.isNullOrUndefined(this.exportProperties.pdfMargins.top)?r:this.exportProperties.pdfMargins).top,r.bottom=(_e.isNullOrUndefined(this.exportProperties.pdfMargins.bottom)?r:this.exportProperties.pdfMargins).bottom,r.left=(_e.isNullOrUndefined(this.exportProperties.pdfMargins.left)?r:this.exportProperties.pdfMargins).left,r.right=(_e.isNullOrUndefined(this.exportProperties.pdfMargins.right)?r:this.exportProperties.pdfMargins).right),i.setPageSettings(e.document.pageSettings),i.pages.add());return _e.isNullOrUndefined(t)||_e.isNullOrUndefined(t.header)||this.pdfExportHelper.drawHeader(t,e.document),_e.isNullOrUndefined(t)||_e.isNullOrUndefined(t.footer)||this.pdfExportHelper.drawFooter(t,e.document),a},Bh.prototype.getFontStyle=function(e){var t=U.PdfFontStyle.Regular;return!_e.isNullOrUndefined(e)&&e.bold&&(t|=U.PdfFontStyle.Bold),!_e.isNullOrUndefined(e)&&e.italic&&(t|=U.PdfFontStyle.Italic),!_e.isNullOrUndefined(e)&&e.underline&&(t|=U.PdfFontStyle.Underline),!_e.isNullOrUndefined(e)&&e.strikeout&&(t|=U.PdfFontStyle.Strikeout),t},Bh.prototype.getBorderStyle=function(e){var t,i,a,r=new U.PdfBorders;return _e.isNullOrUndefined(e)?(t=new U.PdfColor(234,234,234),r.all=new U.PdfPen(t)):(t=e.width,t=_e.isNullOrUndefined(t)||"number"!=typeof t?void 0:.75*t,i=new U.PdfColor(196,196,196),_e.isNullOrUndefined(e.color)||(a=this.pdfExportHelper.hexDecToRgb(e.color),i=new U.PdfColor(a.r,a.g,a.b)),a=new U.PdfPen(i,t),_e.isNullOrUndefined(e.dashStyle)||(a.dashStyle=this.pdfExportHelper.getDashStyle(e.dashStyle)),r.all=a),r},Bh.prototype.getStyle=function(){var e,t,i,a,r=new U.PdfBorders;return _e.isNullOrUndefined(this.gridStyle)?{brush:new U.PdfSolidBrush(new U.PdfColor),border:r,font:void 0}:(r=_e.isNullOrUndefined(this.gridStyle.header.fontName)?U.PdfFontFamily.Helvetica:this.getFontFamily(this.gridStyle.header.fontName),e=this.getFontStyle(this.gridStyle.header),t=_e.isNullOrUndefined(this.gridStyle.header.fontSize)?10.5:this.gridStyle.header.fontSize,i=new U.PdfColor,_e.isNullOrUndefined(this.gridStyle.header.fontColor)||(a=this.pdfExportHelper.hexDecToRgb(this.gridStyle.header.fontColor),i=new U.PdfColor(a.r,a.g,a.b)),a=new U.PdfStandardFont(r,t,e),_e.isNullOrUndefined(this.gridStyle.header.font)||(a=this.gridStyle.header.font),{border:this.getBorderStyle(this.gridStyle.header.border),font:a,brush:new U.PdfSolidBrush(i)})},Bh.prototype.setRecordThemeStyle=function(e,t){_e.isNullOrUndefined(this.gridStyle)||_e.isNullOrUndefined(this.gridStyle.record)||(r=_e.isNullOrUndefined(this.gridStyle.record.fontName)?U.PdfFontFamily.Helvetica:this.getFontFamily(this.gridStyle.record.fontName),a=_e.isNullOrUndefined(this.gridStyle.record.fontSize)?9.75:this.gridStyle.record.fontSize,i=this.getFontStyle(this.gridStyle.record),r=new U.PdfStandardFont(r,a,i),_e.isNullOrUndefined(this.gridStyle.record.font)||(r=this.gridStyle.record.font),e.style.setFont(r),a=new U.PdfColor,_e.isNullOrUndefined(this.gridStyle.record.fontColor)||(i=this.pdfExportHelper.hexDecToRgb(this.gridStyle.record.fontColor),a=new U.PdfColor(i.r,i.g,i.b)),e.style.setTextBrush(new U.PdfSolidBrush(a)));var i,a,r=this.gridStyle&&this.gridStyle.record&&this.gridStyle.record.border?this.getBorderStyle(this.gridStyle.record.border):t;return e.style.setBorder(r),e},Bh.prototype.exportToPDF=function(e,i,t,a){var r,n=this,s=(this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,this.gridStyle=_e.isNullOrUndefined(this.exportProperties.pdfExportProperties)?void 0:this.exportProperties.pdfExportProperties.theme,this.applyEvent()),o=(_e.isNullOrUndefined(t)||(s.document=t),this.getStyle()),l=_e.isNullOrUndefined(this.exportProperties)||_e.isNullOrUndefined(this.exportProperties.fileName)?_e.isNullOrUndefined(e)||_e.isNullOrUndefined(e.fileName)?"default":e.fileName:this.exportProperties.fileName,t=this.parent.renderModule.maxIndent||5,d=Math.floor((540-(100+20*t))/90)+1,h=0,p=s.args.pivotValues[h];(this.exportProperties.columnSize||this.exportProperties.width||this.exportProperties.height)&&(d=0<this.exportProperties.columnSize?this.exportProperties.columnSize:p[0].length),this.exportProperties.allowRepeatHeader=!0===this.exportProperties.allowRepeatHeader||_e.isNullOrUndefined(this.exportProperties.allowRepeatHeader);var u,k=(this.exportProperties.allowRepeatHeader||!1)&&1<d;this.parent.isTabular&&(d=(u=this.parent.engineModule.rowMaxLevel)+1<d?d:u+2);for(var c=0;k&&c<p.length;c++)for(var g=d;p[c]&&g<p[c].length;g+=d){var j=this.parent.isTabular?p[c].slice(0,u+1):[p[c][0]];(r=p[c]).splice.apply(r,[g,0].concat(j))}var m=p&&0<p.length?p[0].length:0,S=0;do{_e.isNullOrUndefined(e)||(this.exportProperties.header=_e.isNullOrUndefined(e.header)||_e.isNullOrUndefined(e.header.contents)||_e.isNullOrUndefined(e.header.contents[0].value)?this.exportProperties.header:e.header.contents[0].value,this.exportProperties.footer=_e.isNullOrUndefined(e.footer)||_e.isNullOrUndefined(e.footer.contents)||_e.isNullOrUndefined(e.footer.contents[0].value)?this.exportProperties.footer:e.footer.contents[0].value);var q=this.addPage(s,e),f=new U.PdfGrid,v=0<d?d:5;if(p&&0<p.length){f.columns.add(p[0].length-S>=v?v:p[0].length-S);for(var H=p.length,y=0,b=0,C=0,x=0;x<H;x++)if(p[x]){for(var w=!(p[x][0]&&"row"===p[x][0].axis),V=p[x].length>S+v?S+v:p[x].length,T=0,M=(w&&f.headers.add(1),w?f.headers.getHeader(y):f.rows.addRow()),D=(w?(M.style.setBorder(o.border),o.font&&M.style.setFont(o.font),M.style.setTextBrush(o.brush)):this.setRecordThemeStyle(M,o.border),0),O=!0,P=S;P<V;P++){var N,E,I,F,L,A=!1,R=(p[x][P]&&0!==p[x][P].rowSpan?(R=(E=p[x][P]).formattedText,R=0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length?this.parent.getValuesHeader(E,"value"):R,R="grand sum"===E.type?0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length?this.parent.getValuesHeader(E,"grandTotal"):this.parent.localeObj.getConstant("grandTotal"):"sum"===E.type?R.toString().replace("Total",this.parent.localeObj.getConstant("total")):R,-1===E.level&&!E.rowSpan||(-1===E.level&&!E.rowSpan||(M.cells.getCell(D).columnSpan=E.colSpan?v-D<E.colSpan?v-D:E.colSpan:1,(w&&E.rowSpan&&1<E.rowSpan||!w&&E.rowSpan&&1<E.rowSpan&&this.parent.isTabular)&&(M.cells.getCell(D).rowSpan=E.rowSpan||1),M.cells.getCell(D).value=R?R.toString():""),""===R)||(O=!1),b=E.level>b?E.level:b,A="value"===E.axis,P+=M.cells.getCell(D).columnSpan?M.cells.getCell(D).columnSpan-1:0,D+=M.cells.getCell(D).columnSpan?M.cells.getCell(D).columnSpan-1:0,N={style:void 0,pivotCell:E,cell:(M=E.style?this.applyStyle(M,E,D):M).cells.getCell(D),column:f.columns.getColumn(D)},this.parent.trigger(ga,N),"column"===E.axis?(N={style:N.style,cell:N.cell,gridCell:N.pivotCell},this.parent.trigger(pa,N),M.cells.getCell(D).value=N.gridCell.formattedText||R):(N={style:N.style,cell:N.cell,column:void 0,data:N.pivotCell,value:R},this.parent.trigger(ca,N),M.cells.getCell(D).value=N.value||R),N.style&&this.processCellStyle(M.cells.getCell(D),N)):(N={style:void 0,pivotCell:void 0,cell:M.cells.getCell(D),column:f.columns.getColumn(D)},this.parent.trigger(ga,N),C=N.column.width,"column"===(E={formattedText:""}).axis&&(N={style:N.style,cell:N.cell,gridCell:N.pivotCell},this.parent.trigger(pa,N)),N.style&&this.processCellStyle(M.cells.getCell(D),N),M.cells.getCell(D).value="",this.parent.isTabular&&0===T?(0===P&&w&&this.parent.dataSourceSettings.columns&&0<this.parent.dataSourceSettings.columns.length?(f.headers.getHeader(0).cells.getCell(0).rowSpan=Object.keys(this.engine.headerContent).length+1,f.headers.getHeader(0).cells.getCell(0).columnSpan=this.parent.engineModule.rowMaxLevel+1):0!==P&&w&&this.parent.dataSourceSettings.columns&&0<this.parent.dataSourceSettings.columns.length&&f.headers.getHeader(0).cells.getCell(0).rowSpan<Object.keys(this.engine.headerContent).length&&(f.headers.getHeader(0).cells.getCell(0).rowSpan=Object.keys(this.engine.headerContent).length,f.headers.getHeader(0).cells.getCell(0).columnSpan=this.parent.engineModule.rowMaxLevel+1),T++):(0===P&&w&&this.parent.dataSourceSettings.columns&&0<this.parent.dataSourceSettings.columns.length||0!==P&&w&&this.parent.dataSourceSettings.columns&&0<this.parent.dataSourceSettings.columns.length&&f.headers.getHeader(0).cells.getCell(0).rowSpan<Object.keys(this.engine.headerContent).length)&&f.headers.getHeader(0).cells.getCell(0).rowSpan++),new U.PdfStringFormat);"olap"===this.parent.dataType?(I=!w&&0===D&&p[x][P]?this.parent.renderModule.indentCollection[p[x][P].rowIndex]:0,R.paragraphIndent=15*I,b=I<b?b:I):(R.paragraphIndent=0,!w&&0===D&&p[x][P]&&-1!==p[x][P].level&&(L=(I=p[x][P]).valueSort?I.valueSort.levelName.toString():"",F=I.actualText?I.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,L=L.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(F&&F-1),R.paragraphIndent=10*(L?L-1:0))),R.alignment=A?U.PdfTextAlignment.Right:U.PdfTextAlignment.Left,R.lineAlignment=U.PdfVerticalAlignment.Middle,M.cells.getCell(D).style.stringFormat=R,D++}O&&(M.height=16),y++}f.columns.getColumn(0).width=0<C?C:100+20*b}}while(0===S&&this.parent.dataSourceSettings.columns&&0<this.parent.dataSourceSettings.columns.length&&f.headers.getHeader(0).cells.getCell(0).rowSpan--,f.draw(q,new U.PointF(this.drawPosition.xPosition,this.drawPosition.yPosition)),m<=(S+=v)&&s.args.pivotValues.length>h+1&&(m=(p=s.args.pivotValues[++h])&&0<p.length?p[0].length:0,S=0),S<m);return new Promise(function(e){var t;a||i?a&&(t=s.document.save()):(s.document.save(l+".pdf"),s.document.destroy()),n.parent.trigger(da,{type:"PDF",promise:a?t:null}),e(s.document)})},Bh.prototype.applyStyle=function(e,t,i){var a=this.parent.conditionalFormattingModule.hexToRgb(t.style.backgroundColor),r=new U.PdfSolidBrush(new U.PdfColor(a.r,a.g,a.b)),n=(e.cells.getCell(i).style.backgroundBrush=r,Number(t.style.fontSize.split("px")[0])),n=new U.PdfStandardFont(U.PdfFontFamily.TimesRoman,n,U.PdfFontStyle.Regular);return e.cells.getCell(i).style.font=n,a=this.parent.conditionalFormattingModule.hexToRgb(t.style.color),r=new U.PdfSolidBrush(new U.PdfColor(a.r,a.g,a.b)),e.cells.getCell(i).style.textBrush=r,e},Bh.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}},Bh.prototype.getFont=function(e){var t,i,a;return e.style.font||(t=e.cell.cellStyle.font&&e.cell.cellStyle.font.fontSize?e.cell.cellStyle.font.fontSize:_e.isNullOrUndefined(e.style.fontSize)?9.75:.75*e.style.fontSize,i=_e.isNullOrUndefined(e.style.fontFamily)?U.PdfFontFamily.TimesRoman:this.getFontFamily(e.style.fontFamily),a=U.PdfFontStyle.Regular,!_e.isNullOrUndefined(e.style.bold)&&e.style.bold&&(a|=U.PdfFontStyle.Bold),!_e.isNullOrUndefined(e.style.italic)&&e.style.italic&&(a|=U.PdfFontStyle.Italic),!_e.isNullOrUndefined(e.style.underline)&&e.style.underline&&(a|=U.PdfFontStyle.Underline),!_e.isNullOrUndefined(e.style.strikeout)&&e.style.strikeout&&(a|=U.PdfFontStyle.Strikeout),new U.PdfStandardFont(i,t,a))},Bh.prototype.processCellStyle=function(e,t){var i,a,r,n;_e.isNullOrUndefined(t.style.backgroundColor)||(i=this.pdfExportHelper.hexDecToRgb(t.style.backgroundColor),e.style.backgroundBrush=new U.PdfSolidBrush(new U.PdfColor(i.r,i.g,i.b))),_e.isNullOrUndefined(t.style.textBrushColor)||(i=this.pdfExportHelper.hexDecToRgb(t.style.textBrushColor),e.style.textBrush=new U.PdfSolidBrush(new U.PdfColor(i.r,i.g,i.b))),_e.isNullOrUndefined(t.style.textPenColor)||(i=this.pdfExportHelper.hexDecToRgb(t.style.textPenColor),e.style.textPen=new U.PdfPen(new U.PdfColor(i.r,i.g,i.b))),_e.isNullOrUndefined(t.style.fontFamily)&&_e.isNullOrUndefined(t.style.fontSize)&&_e.isNullOrUndefined(t.style.bold)&&_e.isNullOrUndefined(t.style.italic)&&_e.isNullOrUndefined(t.style.underline)&&_e.isNullOrUndefined(t.style.strikeout)||(e.style.font=this.getFont(t)),_e.isNullOrUndefined(t.style.border)||(i=new U.PdfBorders,a=t.style.border.width,a=_e.isNullOrUndefined(a)||"number"!=typeof a?void 0:.75*a,r=new U.PdfColor(196,196,196),_e.isNullOrUndefined(t.style.border.color)||(n=this.pdfExportHelper.hexDecToRgb(t.style.border.color),r=new U.PdfColor(n.r,n.g,n.b)),n=new U.PdfPen(r,a),_e.isNullOrUndefined(t.style.border.dashStyle)||(n.dashStyle=this.pdfExportHelper.getDashStyle(t.style.border.dashStyle)),i.all=n,e.style.borders=i)},Bh.prototype.applyEvent=function(){var e,t,i=Vh.getClonedPivotValues(this.engine.pivotValues),a=(this.parent.exportAllPages&&(this.parent.enableVirtualization||this.parent.enablePaging)&&"Server"!==this.parent.dataSourceSettings.mode?(a=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=Vh.getClonedPivotValues(this.engine.pivotValues),this.engine.pivotValues=i,this.engine.pageSettings=a,this.engine.isPagingOrVirtualizationEnabled=!0,"olap"===this.parent.dataType&&(this.updateOlapPageSettings(!1),this.parent.olapEngineModule.mdxQuery=t)):e=i,{pivotValues:[e]});return this.parent.trigger(na,a),this.document=new U.PdfDocument,{document:this.document,args:a}},Bh.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)},Bh.prototype.cleanupDocument=function(e){e&&(e.destroy(),-1!==(e=this.createdDocuments.indexOf(e)))&&this.createdDocuments.splice(e,1)},Bh.prototype.destroy=function(){for(var e=0;e<this.createdDocuments.length;e++)this.cleanupDocument(this.createdDocuments[e]);this.createdDocuments=[],this.document&&(this.cleanupDocument(this.document),this.document=null),this.pdfExportHelper&&(this.pdfExportHelper=null),this.engine&&(this.engine=null),this.exportProperties&&(this.exportProperties=null),this.gridStyle&&(this.gridStyle=null)};pd=Bh;function Bh(e){this.createdDocuments=[],this.drawPosition={xPosition:0,yPosition:0},this.parent=e,this.pdfExportHelper=new mh}Gh.prototype.getModuleName=function(){return"pager"},Gh.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(zr,this.createPager,this)},Gh.prototype.removeEventListener=function(){this.parent.isDestroyed||(_e.isNullOrUndefined(this.parent.pagerSettings.template)&&this.unWireEvent(),this.parent.off(zr,this.createPager))},Gh.prototype.trackUIComponent=function(e,t){t&&"object"==typeof t&&this.uiComponents.push({type:e,instance:t})},Gh.prototype.createPager=function(){var e,t,i=_e.select("#"+this.parent.element.id+"pivot-pager",this.parent.element),i=(null!==i&&(_e.remove(i),this.destroy(),this.addEventListener()),this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber()),a=this.parent.pagerSettings;this.parent.enablePaging&&(t=_e.createElement("div",{id:this.parent.element.id+"pivot-pager",className:Bi+" "+(this.parent.isAdaptive||i<650?A:"")+" "+(this.parent.enableRtl?L:"")+" "+("Top"===this.parent.pagerSettings.position?" e-pivot-pager-top":" e-pivot-pager-bottom")+" "+(a.enableCompactView||i<400?"e-compact-view":""),styles:"width:"+(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())+"px"}),this.parent.showFieldList&&_e.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)&&"Top"===a.position?this.parent.element.insertBefore(t,_e.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)):this.parent.showGroupingBar&&_e.select("#"+this.parent.element.id+" ."+qi,this.parent.element)&&"Top"===a.position?this.parent.element.insertBefore(t,_e.select("#"+this.parent.element.id+" ."+qi,this.parent.element)):"Top"===this.parent.pagerSettings.position?this.parent.element.insertBefore(t,_e.select("#"+this.parent.element.id+"_grid",this.parent.element)):this.parent.element.append(t),(e=this).pager=new w.Pager({enableRtl:this.parent.enableRtl,locale:this.parent.locale,template:""===a.template||a.template?a.template:_e.initializeCSPTemplate(function(){return e.createPagerContainer()}),cssClass:this.parent.cssClass}),this.pager.isVue=this.parent.isVue,this.pager.appendTo(t),_e.isNullOrUndefined(a.template))&&(a.showRowPager&&(!a.enableCompactView&&400<i&&((t=new H.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:i<669?"50px":"64px",change:this.rowPageChange.bind(this),cssClass:this.parent.cssClass})).appendTo(_e.select("#"+this.parent.element.id+"_row_textbox",this.parent.element)),this.trackUIComponent("NumericTextBox",t)),a.showRowPageSize)&&(t=this.parent.pagerSettings.rowPageSizes.slice(0),-1===this.parent.pagerSettings.rowPageSizes.indexOf(this.parent.pageSettings.rowPageSize)&&(t.push(this.parent.pageSettings.rowPageSize),t.sort(function(e,t){return e-t})),(t=new G.DropDownList({dataSource:t,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(_e.select("#"+this.parent.element.id+"_row_size_list",this.parent.element)),this.trackUIComponent("DropDownList",t)),a.showColumnPager&&(!a.enableCompactView&&400<i&&((t=new H.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:i<669?"50px":"64px",change:this.columnPageChange.bind(this),cssClass:this.parent.cssClass})).appendTo(_e.select("#"+this.parent.element.id+"_column_textbox",this.parent.element)),this.trackUIComponent("NumericTextBox",t)),a.showColumnPageSize)&&(i=this.parent.pagerSettings.columnPageSizes.slice(0),-1===this.parent.pagerSettings.columnPageSizes.indexOf(this.parent.pageSettings.columnPageSize)&&(i.push(this.parent.pageSettings.columnPageSize),i.sort(function(e,t){return e-t})),(t=new G.DropDownList({dataSource:i,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(_e.select("#"+this.parent.element.id+"_column_size_list",this.parent.element)),this.trackUIComponent("DropDownList",t)),this.unWireEvent(),this.wireEvent())},Gh.prototype.wireEvent=function(){for(var e=[].slice.call(this.parent.element.querySelectorAll("."+j+", ."+V+", ."+_+", ."+q)),t=0;t<e.length;t++)_e.EventHandler.add(e[t],"click",this.updatePageSettings,this)},Gh.prototype.unWireEvent=function(){for(var e=[].slice.call(this.parent.element.querySelectorAll("."+j+", ."+V+", ."+_+", ."+q)),t=0;t<e.length;t++)_e.EventHandler.remove(e[t],"click",this.updatePageSettings)},Gh.prototype.columnPageChange=function(e){this.parent.pageSettings.currentColumnPage=e.value},Gh.prototype.rowPageChange=function(e){this.parent.pageSettings.currentRowPage=e.value},Gh.prototype.columnPageSizeChange=function(e){this.parent.pageSettings.columnPageSize=Number(e.value)},Gh.prototype.rowPageSizeChange=function(e){this.parent.pageSettings.rowPageSize=Number(e.value)},Gh.prototype.updatePageSettings=function(e){e=e.target.id;switch(e){case this.parent.element.id+"_row_firstIcon":this.parent.pageSettings.currentRowPage=1;break;case this.parent.element.id+"_row_prevIcon":this.parent.pageSettings.currentRowPage=1<this.parent.pageSettings.currentRowPage?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=1<this.parent.pageSettings.currentColumnPage?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!==e.indexOf("_row")?this.parent.actionObj.actionName=Un:-1!==e.indexOf("_column")&&(this.parent.actionObj.actionName=_n)},Gh.prototype.createPagerContainer=function(){var e,t,i=this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber(),a=this.parent.pagerSettings,r=(a.showRowPager&&(e=this.createPagerItems("row",a,i)),a.showColumnPager&&(t=this.createPagerItems("column",a,i)),_e.createElement("div",{id:this.parent.element.id+"_mainDiv",className:"e-pivot-pager-maindiv "+(a.showRowPager&&a.showColumnPager?"":"e-pivot-pager-single-maindiv")+" "+(a.isInversed?"e-inverse-view":"")})),i=_e.createElement("div",{id:this.parent.element.id+"_vertical_separator",className:this.parent.isAdaptive||i<650?"e-pivotview-hseparator":"e-pivotview-vseparator"});return a.isInversed&&a.showColumnPager&&a.showRowPager?r.append(t,i,e):a.showColumnPager&&a.showRowPager?r.append(e,i,t):a.showRowPager&&!a.showColumnPager?r.append(e):!a.showRowPager&&a.showColumnPager&&r.append(t),r.outerHTML},Gh.prototype.createPagerItems=function(e,t,i){var a=!t.showRowPager||!t.showColumnPager,r=_e.createElement("div",{id:this.parent.element.id+"_"+e+"_mainDiv",className:"row"===e?"e-pivot-pager-row-maindiv "+(t.showRowPageSize?"":zi):"e-pivot-pager-column-maindiv "+(t.showColumnPageSize?"":zi)}),n=_e.createElement("div",{id:this.parent.element.id+"_"+e+"_pagerSettings",className:"row"===e?"e-pivot-row-pager-settings":"e-pivot-column-pager-settings"}),s=(this.parent.pagerSettings.showColumnPager&&this.parent.pagerSettings.showRowPager&&n.classList.add("e-pivot-both-pager-settings"),"column"===e&&1===this.parent.pageSettings.currentColumnPage||"row"===e&&1===this.parent.pageSettings.currentRowPage),o="column"===e&&this.parent.pageSettings.currentColumnPage===this.parent.engineModule.columnPageCount||"row"===e&&this.parent.pageSettings.currentRowPage===this.parent.engineModule.rowPageCount,l=_e.createElement("div",{id:this.parent.element.id+"_"+e+"_NavContainer",attrs:{class:"e-pivot-pager-nav-container "+Gi}}),d=_e.createElement("div",{id:this.parent.element.id+"_"+e+"_PageInfoContainer",attrs:{class:"e-pivot-pager-info-container "+Gi}}),h=_e.createElement("div",{id:this.parent.element.id+"_"+e+"_firstIcon",attrs:{class:"e-first e-icons e-icon-first"+(s?" e-firstpagedisabled "+Q:" e-firstpage e-pager-default"),title:this.parent.localeObj.getConstant("goToFirstPage"),"aria-label":this.parent.localeObj.getConstant("goToFirstPage"),tabindex:"0",role:"button"}}),s=_e.createElement("div",{id:this.parent.element.id+"_"+e+"_prevIcon",attrs:{class:"e-prev e-icons e-icon-prev"+(s?" e-prevpagedisabled "+Q:" e-prevpage e-pager-default"),title:this.parent.localeObj.getConstant("goToPreviousPage"),"aria-label":this.parent.localeObj.getConstant("goToPreviousPage"),tabindex:"0",role:"button"}}),p=_e.createElement("span",{id:this.parent.element.id+"_"+e+"_pagerString",className:"row"===e?"e-pivotview-row-pagerString":"e-pivotview-column-pagerString"}),u=(p.innerText="row"===e?this.parent.localeObj.getConstant("rowPage"):this.parent.localeObj.getConstant("columnPage"),_e.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"}})),c=_e.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"}),g=_e.createElement("span",{id:this.parent.element.id+"_"+e+"_ofString",className:"row"===e?"e-pivot-row-of-string":"e-pivot-column-of-string"}),m=(g.innerText=this.parent.localeObj.getConstant("of")+" ",_e.createElement("span",{id:this.parent.element.id+"_"+e+"_pagerNumber",className:"row"===e?"e-pivotview-row-pagerNumber":"e-pivotview-column-pagerNumber"})),S=(m.innerText=("row"===e?this.parent.engineModule.rowPageCount:this.parent.engineModule.columnPageCount).toString(),_e.createElement("div",{id:this.parent.element.id+"_"+e+"_nextIcon",attrs:{class:"e-next e-icons e-icon-next"+(o?" e-nextpagedisabled "+Q:" e-nextpage e-pager-default"),title:this.parent.localeObj.getConstant("goToNextPage"),"aria-label":this.parent.localeObj.getConstant("goToNextPage"),tabindex:"0",role:"button"}})),o=_e.createElement("div",{id:this.parent.element.id+"_"+e+"_lastIcon",attrs:{class:"e-last e-icons e-icon-last"+(o?" e-lastpagedisabled "+Q:" e-lastpage e-pager-default"),title:this.parent.localeObj.getConstant("goToLastPage"),"aria-label":this.parent.localeObj.getConstant("goToLastPage"),tabindex:"0",role:"button"}}),f=_e.createElement("span",{id:this.parent.element.id+"_"+e+"_size",className:"row"===e?"e-pivotview-row-size":"e-pivotview-column-size"}),v=(f.innerText="row"===e?this.parent.localeObj.getConstant("rowPerPage"):this.parent.localeObj.getConstant("columnPerPage"),_e.createElement("div",{id:this.parent.element.id+"_"+e+"_size_list_maindiv",className:"e-pager-dropdown "+Gi})),y=_e.createElement("div",{id:this.parent.element.id+"_"+e+"_size_list",className:"row"===e?"e-pivot-row-size-list":"e-pivot-column-size-list"}),b=_e.createElement("div",{id:this.parent.element.id+"_"+e+"_text_div",className:"e-pivotview-text-div"}),C=_e.createElement("div",{id:this.parent.element.id+"_"+e+"_text_div_1",className:"e-pivotview-text-div-1"});return v.append(y),t.enableCompactView||i<400?(l.append(s,S),n.append(l)):(c.append(g,m),l.append(h,s,S,o),d.append(u,c),n.append(l,d)),("row"===e&&t.showRowPager||"column"===e&&t.showColumnPager)&&(("column"===e&&!t.showRowPager||"row"===e&&!t.showColumnPager)&&a&&C.append(f,v),t.showColumnPager&&t.showRowPager||!a?("row"===e&&t.showRowPageSize||"column"===e&&t.showColumnPageSize?!t.enableCompactView&&400<i?(b.append(p,f),C.append(n,v)):(b.append(p,n),C.append(f,v)):("row"===e&&!t.showRowPageSize||"column"===e&&!t.showColumnPageSize)&&(b.append(p),C.append(n)),r.append(b,C)):("row"===e&&(t.showRowPageSize?r.append(n,p,C):r.append(n,p)),"column"===e&&(t.showColumnPageSize?r.append(n,p,C):r.append(n,p)))),r},Gh.prototype.cleanupUIComponents=function(){if(this.uiComponents&&0<this.uiComponents.length){for(var e=0;e<this.uiComponents.length;e++){var t=this.uiComponents[e].instance;t&&"function"==typeof t.destroy&&t.destroy()}this.uiComponents=[]}},Gh.prototype.destroy=function(){if(this.removeEventListener(),this.unWireEvent(),this.cleanupUIComponents(),this.parent.pagerModule){for(var e=0,t=["#"+this.parent.element.id+"_column_textbox","#"+this.parent.element.id+"_row_textbox","#"+this.parent.element.id+"_column_size_list","#"+this.parent.element.id+"_row_size_list"];e<t.length;e++){var i=t[e],a=_e.select(i,this.parent.element);a&&(a=_e.getInstance(a,i.includes("textbox")?H.NumericTextBox:G.DropDownList))&&"function"==typeof a.destroy&&a.destroy()}this.pager&&this.pager.destroy(),this.pager=null}};gd=Gh;function Gh(e){this.uiComponents=[],this.parent=e,(this.parent.pagerModule=this).addEventListener()}Wh.prototype.render=function(){var e=_e.createElement("div",{id:this.parent.element.id+"_Container",className:K+" "+("olap"===this.parent.dataType?"e-olapfieldlist-container":""),styles:"width:"+this.parent.element.style.width});this.parent.isAdaptive?_e.addClass([e],A):_e.removeClass([e],A),this.parent.enableRtl?_e.addClass([e],L):_e.removeClass([e],L),this.parent.cssClass&&_e.addClass([e],this.parent.cssClass.split(" ")),this.parent.enableFieldSearching?_e.addClass([e],ie):_e.removeClass([e],ie),this.parentElement=_e.createElement("div",{className:"e-field-list-container"}),this.parent.element.appendChild(e),this.parent.isAdaptive&&(e.removeAttribute("style"),this.parentElement=_e.createElement("div",{className:"e-adaptive-container"}),this.renderAdaptiveLayout(e)),"Popup"===this.parent.renderMode?(this.renderFieldListDialog(e),this.unWireDialogEvent(this.parent.element.querySelector("."+X)),this.wireDialogEvent(this.parent.element.querySelector("."+X))):this.renderStaticLayout(e)},Wh.prototype.renderStaticLayout=function(e){var t,i;this.parent.isAdaptive||(t=_e.createElement("div",{className:"e-field-list-title"}),(i=_e.createElement("div",{className:"e-title-content"})).innerText=this.parent.localeObj.getConstant("staticFieldList"),t.appendChild(i),t.appendChild(this.createCalculatedButton()),_e.addClass([e],J),e.appendChild(t),e.appendChild(this.parentElement),_e.addClass([e],J),this.parent.allowDeferLayoutUpdate&&(e.appendChild(this.createDeferUpdateButtons()),this.renderDeferUpdateButtons(e)))},Wh.prototype.renderDeferUpdateButtons=function(e){this.parent.allowDeferLayoutUpdate&&(this.deferUpdateCheckBox=new z.CheckBox({label:this.parent.localeObj.getConstant("deferLayoutUpdate"),checked:this.parent.isPopupView&&this.parent.pivotGridModule?!!_e.isNullOrUndefined(this.parent.pivotGridModule.pivotDeferLayoutUpdate)||this.parent.pivotGridModule.pivotDeferLayoutUpdate:!!_e.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(_e.select("#"+this.parent.element.id+"DeferUpdateCheckBox",e)),this.deferUpdateApplyButton=new z.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?!_e.isNullOrUndefined(this.parent.pivotGridModule.pivotDeferLayoutUpdate)&&!this.parent.pivotGridModule.pivotDeferLayoutUpdate:!_e.isNullOrUndefined(this.parent.isDeferLayoutUpdate)&&!this.parent.isDeferLayoutUpdate}),this.deferUpdateApplyButton.isStringTemplate=!0,this.deferUpdateApplyButton.appendTo(_e.select("#"+this.parent.element.id+"_DeferUpdateButton1",e)),this.deferUpdateApplyButton.element.onclick=("Fixed"===this.parent.renderMode?this.applyButtonClick:this.onDeferUpdateClick).bind(this)),this.deferUpdateCancelButton=new z.Button({cssClass:"e-defer-cancel-button "+ke+(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||_e.isNullOrUndefined(this.parent.pivotGridModule.pivotDeferLayoutUpdate)||this.parent.pivotGridModule.pivotDeferLayoutUpdate):!(!this.parent.refreshing||_e.isNullOrUndefined(this.parent.isDeferLayoutUpdate)||!this.parent.allowDeferLayoutUpdate||this.parent.isDeferLayoutUpdate)}),this.deferUpdateCancelButton.isStringTemplate=!0,this.deferUpdateCancelButton.appendTo(_e.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)},Wh.prototype.createDeferUpdateButtons=function(){var e=_e.createElement("div",{className:"e-layout-footer"}),t=(this.parent.allowDeferLayoutUpdate&&(i=_e.createElement("div",{className:"e-checkbox-layout",attrs:{title:this.parent.localeObj.getConstant("deferLayoutUpdate")}}),t=_e.createElement("input",{id:this.parent.element.id+"DeferUpdateCheckBox"}),i.appendChild(t),e.appendChild(i)),_e.createElement("div",{className:"e-button-layout"})),i=(this.parent.allowDeferLayoutUpdate&&(i=_e.createElement("button",{id:this.parent.element.id+"_DeferUpdateButton1",attrs:{type:"button",title:this.parent.localeObj.getConstant("apply")}}),t.appendChild(i)),_e.createElement("button",{id:this.parent.element.id+"_DeferUpdateButton2",attrs:{type:"button",title:this.parent.localeObj.getConstant("cancel")}}));return t.appendChild(i),e.appendChild(t),e},Wh.prototype.onCheckChange=function(e){e.checked&&(this.parent.clonedDataSource=Ie.getClonedDataSourceSettings(this.parent.dataSourceSettings),"olap"===this.parent.dataType&&(this.parent.clonedFieldListData=Ie.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData)),this.parent.clonedFieldList=Ie.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)},Wh.prototype.applyButtonClick=function(){"pivotfieldlist"===this.parent.getModuleName()&&this.parent.allowDeferLayoutUpdate&&(this.parent.pivotChange=!1),this.parent.isDeferUpdateApplied=!0,this.parent.isPopupView||"Server"!==this.parent.dataSourceSettings.mode||(this.parent.isRequiredUpdate=!0),this.parent.updateDataSource(!1);var e=this.parent;e.axisFieldModule.render(),e.clonedDataSource=Ie.getClonedDataSourceSettings(e.dataSourceSettings),"olap"===this.parent.dataType&&(this.parent.clonedFieldListData=Ie.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData)),e.clonedFieldList=Ie.getClonedFieldList(e.pivotFieldList)},Wh.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=Ie.getClonedFieldList(this.parent.clonedFieldList),this.parent.olapEngineModule.fieldListData=Ie.cloneOlapFieldSettings(this.parent.clonedFieldListData),this.parent.isPopupView)this.parent.isPopupView&&this.parent.clonedFieldListData&&0<Object.keys(this.parent.clonedFieldListData).length&&(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],r=this.parent.clonedFieldList[r];this.parent.olapEngineModule.updateFieldlistData(r.id,r.isSelected)}else this.parent.engineModule.fieldList=Ie.getClonedFieldList(this.parent.clonedFieldList);this.parent.updateDataSource(!1,!0)}var n,s;(!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=Ie.getClonedFieldList(this.parent.clonedFieldList),n=Object.keys(this.parent.engineModule.fieldList),this.parent.allowCalculatedField)&&n.length!==this.parent.engineModule.fields.length&&(s=[],this.parent.engineModule.fields.forEach(function(e){-1!==n.indexOf(e)&&(s[s.length]=e)}),this.parent.engineModule.fields=s),"Popup"!==this.parent.renderMode||t?this.parent.actionObj.actionName=Ls:(this.parent.dialogRenderer.fieldListDialog.hide(),this.parent.actionObj.actionName=Qn),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()},Wh.prototype.renderFieldListDialog=function(e){var t,i=_e.createElement("div",{className:X+" "+W+" e-select-table",attrs:{tabindex:"0",title:this.parent.localeObj.getConstant("fieldList"),"aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("fieldList"),role:"button"}});this.parent.element.appendChild(i),this.parent.isAdaptive?(t='<div class=e-title-mobile-header><span class="'+W+" "+mi+'"></span><div class=e-title-mobile-content>'+this.parent.localeObj.getConstant("fieldList")+"</div></div>",i=[{click:this.showFieldListDialog.bind(this),isFlat:!1,buttonModel:{cssClass:et+" "+it+" "+at+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:W+" "+rt,isPrimary:!0}},{click:this.showCalculatedField.bind(this),isFlat:!1,buttonModel:{cssClass:tt+" "+it+" "+at+" "+Q+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:W+" "+rt,enableRtl:this.parent.enableRtl,isPrimary:!0}}],this.fieldListDialog=new P.Dialog({animationSettings:{effect:this.parent.enableRtl?"SlideRight":"SlideLeft"},header:t,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:i,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),_e.setStyleAttribute(_e.select("#"+e.id+"_dialog-content",e),{padding:"0"}),i=e.querySelector(".e-footer-content"),_e.addClass([i],ne),_e.removeClass([i.querySelector("."+tt)],"e-flat"),_e.removeClass([i.querySelector("."+et)],"e-flat"),this.fieldListDialog.element.querySelector("."+mi).onclick=(this.parent.allowDeferLayoutUpdate?this.onDeferUpdateClick:this.onCloseFieldList).bind(this)):(i=this.createDeferUpdateButtons().outerHTML,t="<div class="+Ze+"><div class=e-title-content>"+this.parent.localeObj.getConstant("fieldList")+"</div></div>",this.fieldListDialog=new P.Dialog({animationSettings:{effect:"Zoom"},header:t,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:i,closeOnEscape:!1,cssClass:this.parent.cssClass,target:_e.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),_e.setStyleAttribute(_e.select("#"+e.id+"_title",e),{width:"100%"}),e.querySelector("."+Ze).appendChild(this.createCalculatedButton()))},Wh.prototype.dialogOpen=function(){4===this.lastTabIndex?(this.adaptiveElement.items[this.lastTabIndex].content="",this.adaptiveElement.dataBind(),this.parent.notify(Br,{})):this.adaptiveElement.refresh()},Wh.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.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)},Wh.prototype.onDeferUpdateClick=function(){this.parent.isPopupView&&"Server"===this.parent.dataSourceSettings.mode&&(this.parent.isRequiredUpdate=!0),this.parent.updateDataSource(),this.parent.dialogRenderer.fieldListDialog.hide()},Wh.prototype.renderAdaptiveLayout=function(e){var t=_e.createElement("div",{className:ne}),i=(e.appendChild(this.parentElement),[{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||i.pop(),this.adaptiveElement=new D.Tab({heightAdjustMode:"Auto",items:i,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?(t.appendChild(this.createAddButton()),_e.addClass([e],J),this.adaptiveElement.isStringTemplate=!0,this.adaptiveElement.appendTo(this.parentElement),this.parentElement.appendChild(t)):(this.adaptiveElement.isStringTemplate=!0,this.adaptiveElement.appendTo(this.parentElement))},Wh.prototype.tabSelect=function(e){var t=_e.closest(this.parentElement,"."+K);this.lastTabIndex=e.selectedIndex,t&&t.querySelector("."+et)&&(4!==e.selectedIndex?(_e.addClass([t.querySelector("."+tt)],Q),_e.removeClass([t.querySelector("."+et)],Q)):(_e.removeClass([t.querySelector("."+tt)],Q),_e.addClass([t.querySelector("."+et)],Q))),4===e.selectedIndex?(this.adaptiveElement.items[4].content="",this.adaptiveElement.dataBind(),this.parent.notify(Br,{})):this.parent.axisFieldModule.render()},Wh.prototype.createCalculatedButton=function(){var e=_e.createElement("button",{id:this.parent.element.id+"_CalculatedField",attrs:{type:"button",tabindex:"0","aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("CalculatedField")}}),t=new z.Button({cssClass:"e-calculated-field "+Q+(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 t.isStringTemplate=!0,t.appendTo(e),this.parent.calculatedFieldModule&&_e.removeClass([e],Q),t.element.onclick=this.showCalculatedField.bind(this),e},Wh.prototype.createAddButton=function(){var e=_e.createElement("div",{className:ne+"-content"}),t=_e.createElement("div",{}),i=_e.createElement("div",{}),a=new z.Button({cssClass:tt+" "+it+" "+at+" "+Q+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:W+" "+rt,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),r=new z.Button({cssClass:et+" "+it+" "+at+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:W+" "+rt,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});return r.isStringTemplate=!0,r.appendTo(t),a.isStringTemplate=!0,a.appendTo(i),e.appendChild(t),e.appendChild(i),a.element.onclick=this.showCalculatedField.bind(this),r.element.onclick=this.showFieldListDialog.bind(this),e},Wh.prototype.createAxisTable=function(e){var t=_e.createElement("div",{className:$+"-"+e}),e=_e.createElement("div",{className:de+" e-"+e}),i=_e.createElement("span",{className:he});return i.innerText=this.parent.localeObj.getConstant("addPrompt"),t.appendChild(e),t.appendChild(i),t},Wh.prototype.showCalculatedField=function(){try{if(!this.parent.isAdaptive){if(this.parent.actionObj.actionName=An,this.parent.actionBeginMethod())return;this.parent.dialogRenderer.fieldListDialog&&(this.parent.dialogRenderer.fieldListDialog.hide(),_e.addClass([this.parent.element.querySelector("."+X)],k))}this.parent.notify(Br,{})}catch(e){this.parent.actionFailureMethod(e)}},Wh.prototype.showFieldListDialog=function(){var e=this.adaptiveElement.selectedItem;this.parent.treeViewModule.render(e)},Wh.prototype.onShowFieldList=function(){if(this.parent.actionObj.actionName=on,!this.parent.actionBeginMethod()){this.parent.actionObj.actionName="";try{this.parent.allowDeferLayoutUpdate&&(this.parent.isAdaptive&&this.parent.axisFieldModule.render(),this.parent.clonedDataSource=Ie.getClonedDataSourceSettings(this.parent.dataSourceSettings),"olap"===this.parent.dataType&&(this.parent.clonedFieldListData=Ie.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData)),this.parent.clonedFieldList=Ie.getClonedFieldList(this.parent.pivotFieldList)),_e.addClass([this.parent.element.querySelector("."+X)],k),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)}}},Wh.prototype.removeFieldListIcon=function(){this.parent.isAdaptive&&this.parent.allowCalculatedField&&this.parent.calculatedFieldModule&&this.adaptiveElement&&4===this.adaptiveElement.selectedItem&&(_e.select("#"+this.parent.element.id+"droppable",this.adaptiveElement.element)?this.parent.calculatedFieldModule.updateAdaptiveCalculatedField(!1):this.parent.notify(Br,{edit:!1})),document.getElementById(this.parent.element.id+"calculateddialog")||_e.removeClass([this.parent.element.querySelector("."+X)],k)},Wh.prototype.keyPress=function(e){13===e.keyCode&&e.target&&(e.target.click(),e.preventDefault())},Wh.prototype.wireDialogEvent=function(e){_e.EventHandler.add(e,"keydown",this.keyPress,this),_e.EventHandler.add(e,"click",this.onShowFieldList,this)},Wh.prototype.unWireDialogEvent=function(e){_e.EventHandler.remove(e,"keydown",this.keyPress),_e.EventHandler.remove(e,"click",this.onShowFieldList)},Wh.prototype.destroy=function(){"Popup"===this.parent.renderMode&&(e=this.parent.element.querySelector("."+X))&&this.unWireDialogEvent(e),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);var e=document.getElementById(this.parent.element.id+"_CalculatedField");if(e&&(t=_e.getInstance(e,z.Button))&&!t.isDestroyed&&t.destroy(),"Popup"===this.parent.renderMode){if(this.fieldListDialog&&!this.fieldListDialog.isDestroyed){for(var t,i=this.fieldListDialog.element.querySelectorAll("button"),a=0;a<i.length;a++)(t=_e.getInstance(i[a],z.Button))&&!t.isDestroyed&&t.destroy();this.fieldListDialog.destroy(),this.fieldListDialog=null}e=document.getElementById(this.parent.element.id+"_Container");e&&_e.remove(e)}this.lastTabIndex=null};var zh=Wh;function Wh(e){this.parent=e}v.prototype.render=function(e){var t,i,a;this.parentElement=this.parent.dialogRenderer.parentElement,this.fieldListSort=(this.parent.pivotGridModule||this.parent).defaultFieldListOrder,this.fieldListSort="Ascending"===this.fieldListSort?"Ascend":"Descending"===this.fieldListSort?"Descend":"None",this.parent.isAdaptive?this.renderTreeDialog(e):(e=_e.createElement("div",{className:"e-field-table "+("olap"===this.parent.dataType?"e-olap-field-table":"")}),(i=_e.createElement("div",{className:"e-field-header",attrs:{title:this.parent.localeObj.getConstant("allFields")}})).innerText=this.parent.localeObj.getConstant("allFields"),t=_e.createElement("div",{className:ee+" "+Ut}),this.treeViewElement=_e.createElement("div",{id:this.parent.element.id+"_TreeView",className:$+" "+("olap"===this.parent.dataType?"e-olap-field-list-tree":"")}),(a=_e.createElement("div",{className:"e-field-header-container"})).appendChild(i),e.appendChild(a),this.updateSortElements(a),this.parent.enableFieldSearching&&(i=_e.createElement("div",{id:this.parent.element.id+"_SearchDiv",attrs:{tabindex:"-1"},className:"e-field-list-search"}),a=_e.createElement("input",{attrs:{type:"text"}}),i.appendChild(a),this.fieldSearch=new H.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(a),this.fieldSearch.addIcon("append","e-field-list-search-icon "+W),(a=_e.createElement("div",{className:Xt+" "+Q})).innerText=this.parent.localeObj.getConstant("noMatches"),e.appendChild(i),e.appendChild(a)),t.appendChild(this.treeViewElement),e.appendChild(t),this.parentElement.appendChild(e),"Fixed"===this.parent.renderMode&&(i=_e.createElement("div",{className:"e-center-div"}),(a=_e.createElement("div",{className:"e-center-title"})).innerText=this.parent.localeObj.getConstant("centerHeader"),this.parentElement.appendChild(i),this.parentElement.appendChild(a)),this.renderTreeView())},v.prototype.updateSortElements=function(e){for(var t={None:"sortNone",Ascend:"sortAscending",Descend:"sortDescending"},i=0,a=Object.keys(t);i<a.length;i++){var r=a[i],r=_e.createElement("span",{attrs:{tabindex:"0","aria-disabled":"false","aria-label":"Sort "+r,"data-sort":r,title:this.parent.localeObj.getConstant(t[r]),role:"button"},className:W+" e-sort-"+r.toLowerCase()+" "+(this.fieldListSort===r?"e-selected":"")});e.appendChild(r),this.unWireFieldListEvent(r),this.wireFieldListEvent(r)}},v.prototype.renderTreeView=function(){this.fieldTable=new D.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){_e.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;_e.isNullOrUndefined(e.querySelector("."+$))||(_e.getInstance(e.querySelector("."+$),D.TreeView).dragObj.enableAutoScroll=!1)},v.prototype.updateNodeIcon=function(e){var t;"olap"===this.parent.dataType&&(e.node&&e.node.querySelector(".e-list-icon")&&-1<e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-icon")?(t=e.node.querySelector(".e-list-icon"),_e.removeClass([t],"e-folderCDB-icon"),_e.addClass([t],"e-folderCDB-open-icon")):e.node&&e.node.querySelector(".e-list-icon")&&-1<e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-open-icon")&&(t=e.node.querySelector(".e-list-icon"),_e.removeClass([t],"e-folderCDB-open-icon"),_e.addClass([t],"e-folderCDB-icon")))},v.prototype.updateTreeNode=function(e){var t,i=!1,a=("olap"===this.parent.dataType?i=this.updateOlapTreeNode(e):e.nodeData.hasChildren?(i=!1,e.node.querySelector("."+ci).style.display="none",_e.addClass([e.node],ae)):i=!0,_e.isNullOrUndefined(e.nodeData.pid)||_e.addClass([e.node],re),e.node.querySelector("."+$e));if(e.node.querySelector(".e-list-icon")&&a&&(t=e.node.querySelector(".e-list-icon"),a.insertBefore(t,e.node.querySelector(".e-list-text"))),i&&!this.parent.isAdaptive&&(t=Ie.getFieldInfo(e.nodeData.id,this.parent),i=!1,i=_e.createElement("span",{attrs:{tabindex:"-1",title:!t.fieldItem||t.fieldItem.allowDragAndDrop?this.parent.localeObj.getConstant("drag"):"","aria-disabled":"false"},className:W+" "+xe+" "+(!t.fieldItem||t.fieldItem.allowDragAndDrop?"":we)}),e.node.querySelector("."+ci))&&!e.node.querySelector(".cls.DRAG_CLASS")&&a&&a.insertBefore(i,e.node.querySelector("."+ci)),e.node.querySelector("."+Le)&&_e.addClass([e.node.querySelector("."+nt)],st),this.parent.enableFieldSearching&&this.isSearching&&"pivot"===this.parent.dataType)for(var r=e.node,n=0;n<this.nonSearchList.length;n++){if(r.textContent===this.nonSearchList[n].textContent){_e.addClass([r],Q);break}if(r.innerText===this.nonSearchList[n].textContent){_e.addClass([r],Q);break}}},v.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("."+ci).style.display="none"),e.node&&e.node.querySelector(".e-list-icon")&&-1<e.node.querySelector(".e-list-icon").className.indexOf("e-level-members")&&(this.parent.isAdaptive?e.node.querySelector("."+ci).style.display="none":e.node.querySelector("."+ci).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"))&&(t=(e.node.querySelector(".e-measure-icon")&&(e.node.querySelector(".e-list-icon").style.display="none"),!0))):t=!0,t},v.prototype.renderTreeDialog=function(e){var t=_e.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(t),this.fieldDialog=new P.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:ke+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}},{click:this.onFieldAdd.bind(this),isFlat:!1,buttonModel:{cssClass:Re+(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:_e.closest(this.parentElement,"."+K)}),this.fieldDialog.isStringTemplate=!0,this.fieldDialog.appendTo(t)},v.prototype.createTreeView=function(e){var t=_e.createElement("div",{id:this.parent.element.id+"EditorDiv",className:De}),i=_e.createElement("div",{id:this.parent.element.id+"_SearchDiv",attrs:{tabindex:"-1"},className:Ot}),a=_e.createElement("input",{attrs:{type:"text"}}),r=(i.appendChild(a),_e.createElement("div",{className:ee})),n=_e.createElement("div",{className:Oe+" "+("olap"===this.parent.dataType?"e-olap-field-list-tree":"")}),i=(t.appendChild(i),this.editorSearch=new H.MaskedTextBox({showClearButton:!0,placeholder:this.parent.localeObj.getConstant("search"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:Pt+(this.parent.cssClass?" "+this.parent.cssClass:""),change:this.textChange.bind(this)}),this.editorSearch.isStringTemplate=!0,this.editorSearch.appendTo(a),_e.createElement("div",{className:Xt+" "+Q}));return i.innerText=this.parent.localeObj.getConstant("noMatches"),t.appendChild(i),r.appendChild(n),t.appendChild(r),this.fieldTable=new D.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){_e.removeClass([e.node],"e-active"),e.cancel=!0}}),this.fieldTable.isStringTemplate=!0,this.fieldTable.appendTo(n),t},v.prototype.textChange=function(e){var t,i=this;"olap"===this.parent.dataType?""===e.value?(this.fieldTable.fields.dataSource=this.olapFieldListData,setTimeout(function(){i.fieldTable.collapseAll()}),this.isSearching=!1,this.promptVisibility(!1)):(this.fieldTable.fields.dataSource=this.performeSearching(e.value),setTimeout(function(){i.fieldTable.expandAll()}),this.isSearching=!0,this.promptVisibility(0===this.fieldTable.fields.dataSource.length)):(this.parent.pivotCommon.eventBase.searchTreeNodes(e,this.fieldTable,!0),e=[].slice.call(this.fieldTable.element.querySelectorAll("li")),t=[].slice.call(this.fieldTable.element.querySelectorAll("li."+Q)),this.promptVisibility(e.length===t.length),this.isSearching=0<t.length,this.nonSearchList=t)},v.prototype.promptVisibility=function(e){var t,i;this.parent.isAdaptive?t=this.fieldDialog.element.querySelector("."+Xt):(t=this.parentElement.querySelector("."+Xt),i=this.parentElement.querySelector("."+Ut)),e?(_e.removeClass([t],Q),this.parent.isAdaptive||(_e.addClass([i],Q),_e.removeClass([t],te))):(_e.addClass([t],Q),this.parent.isAdaptive||(_e.removeClass([i],Q),_e.addClass([t],te)))},v.prototype.performeSearching=function(e){var a=this,r=new ce.DataManager(this.olapFieldListData),e=r.executeLocal((new ce.Query).where(new ce.Predicate(this.fieldTable.fields.text,"contains",e,!0))),n=[],s=new Set;return e.forEach(function(e){var t,i;e&&(t=[],i=[],e.pid&&(t=a.getParentItems(r,"id",e.pid)),e.hasChildren&&(i=r.executeLocal((new ce.Query).where("pid","equal",e.id,!1))),t.concat([e]).concat(i).forEach(function(e){e=e.id;s.has(e)||(s.add(e),n.push(new ce.Predicate("id","equal",e,!1)))}))}),0<n.length?r.executeLocal((new ce.Query).where(ce.Predicate.or.apply(ce.Predicate,n))):[]},v.prototype.getParentItems=function(e,t,i){i=e.executeLocal((new ce.Query).where(t,"equal",i,!1));return i=i&&i[0]&&i[0].pid?this.getParentItems(e,t,i[0].pid).concat(i):i},v.prototype.dragStart=function(a){var e,r=this;a.event.target.classList.contains(xe)&&!a.event.target.classList.contains(we)?(e={fieldName:(e=Ie.getFieldInfo(a.draggedNode.getAttribute("data-uid"),this.parent)).fieldName,fieldItem:e.fieldItem,axis:e.axis,dataSourceSettings:this.parent.dataSourceSettings,cancel:!1},(this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(Or,e,function(e){if(e.cancel)r.parent.isDragging=!1,a.cancel=!0;else{r.parent.isDragging=!0,_e.addClass([a.draggedNode.querySelector("."+nt)],Je);e=void 0;if((e=("olap"===r.parent.dataType?r.parent.olapEngineModule:r.parent.engineModule).fieldList[a.draggedNode.getAttribute("data-uid")])&&"CalculatedField"===e.aggregateType)for(var t=0,i=[He,Ve,Be];t<i.length;t++)_e.addClass([r.parentElement.querySelector("."+i[t])],Xe);e=a.clonedNode;e&&"Popup"===("pivotfieldlist"===r.parent.getModuleName()&&r.parent.renderMode)&&(e.style.zIndex=(r.parent.dialogRenderer.fieldListDialog.zIndex+1).toString())}})):(this.parent.isDragging=!1,a.cancel=!0)},v.prototype.dragStop=function(e){e.cancel=!0,this.parent.isDragging=!1;for(var t=0,i=[He,Ve,Be];t<i.length;t++)_e.removeClass([this.parentElement.querySelector("."+i[t])],Xe);_e.removeClass([e.draggedNode.querySelector("."+nt)],Je),this.parent.pivotCommon.filterDialog.dialogPopUp&&this.parent.pivotCommon.filterDialog.dialogPopUp.close();var a,r=e.draggedNodeData.id.toString();this.isNodeDropped(e,r)&&(a=this.parent.pivotFieldList[r],this.parent.pivotCommon.dataSourceUpdate.control="pivotview"!==this.parent.getModuleName()&&this.parent.isPopupView&&this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent,this.parent.pivotCommon.nodeStateModified.onStateModified(e,r))&&((this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&this.parent.pivotGridModule.pivotDeferLayoutUpdate?(a.isSelected=!0,this):this.parent).updateDataSource(),this.parent.axisFieldModule.render())},v.prototype.isNodeDropped=function(e,t){var i=!0;if("true"===e.draggedNodeData.isChecked){var a=this.getButton(t),t=_e.closest(a,"."+qe),r=_e.closest(e.target,"."+qe);if(a&&t===r){for(var n,s=[].slice.call(t.querySelectorAll("."+Y)),o=_e.closest(e.target,"."+pe),l=void 0,d=-1,h=0,p=s.length;h<p;h++)s[h].id===a.id&&(l=h),o&&(n=o.querySelector("."+Y),s[h].id===n.id)&&(d=h);(l===d||l===s.length-1&&-1===d)&&(r=document.getElementById(this.parent.element.id+"_Container"),_e.removeClass([].slice.call(r.querySelectorAll("."+Te)),Me),i=!1)}}return i},v.prototype.getButton=function(e){for(var t,i=document.getElementById(this.parent.element.id+"_Container"),a=[].slice.call(i.querySelectorAll("."+Y)),r=0,n=a.length;r<n;r++)if(a[r].getAttribute("data-uid")===e){t=a[r];break}return t},v.prototype.nodeChecked=function(e){var t,i;this.isSpaceKey&&(t=_e.closest(e.node,"."+$e),_e.isNullOrUndefined(t)||(i=_e.closest(t,"li").getAttribute("data-uid"),this.parent.isAdaptive?this.addNode(void 0,i,"check"===e.action,t):this.nodeStateChange(void 0,i,"check"===e.action,t))),this.isSpaceKey=!1},v.prototype.nodeStateChange=function(e,i,a,r){var n=this;r=_e.isNullOrUndefined(r)?e.node:r,i=_e.isNullOrUndefined(i)?r.getAttribute("data-uid"):i,this.parent.pivotCommon.filterDialog.dialogPopUp&&this.parent.pivotCommon.filterDialog.dialogPopUp.close();var s=this.parent.pivotFieldList[i];if(!_e.isNullOrUndefined(e)){if(this.isSpaceKey=e.event.action&&"space"===e.event.action,_e.isNullOrUndefined(s)||r.classList.contains(Q)||e.event.target&&(e.event.target.classList.contains(Xi)||e.event.target.classList.contains(Ji))||e.event.action&&"enter"!==e.event.action)return;a=!1;var t=this.fieldTable.getNode(r);a=e.event&&e.event.target&&!e.event.target.closest("."+ci)?"true"===t.isChecked?(this.fieldTable.uncheckAll([r]),!1):(this.fieldTable.checkAll([r]),!0):"true"===t.isChecked}var o=this.parent.isPopupView?this.parent.pivotGridModule:this.parent,l=Ie.getFieldInfo(i,this.parent),d=r.closest("."+ae);a?(e={fieldName:i,dropField:l.fieldItem,dataSourceSettings:Ie.getClonedDataSourceSettings(this.parent.dataSourceSettings),dropAxis:"number"===s.type||"CalculatedField"===s.type&&s.formula&&-1<s.formula.indexOf("Measure")&&"olap"===this.parent.dataType?"values":"rows",dropPosition:l.position,draggedAxis:"fieldlist",cancel:!1},o.trigger(oa,e,function(e){var t;e.cancel?n.updateCheckState(s,"check"):(_e.addClass([r.querySelector("."+nt)],st),d&&_e.addClass([d.querySelector("."+nt)],st),n.updateSelectedNodes(r,"check"),t=n.parent.pivotCommon.dataSourceUpdate.getNewField(i,l.fieldItem),n.updateReportSettings(t,e),n.updateNodeStateChange(i,s,a))})):(t={cancel:!1,fieldName:i,dataSourceSettings:Ie.getClonedDataSourceSettings(this.parent.dataSourceSettings),fieldItem:l.fieldItem,axis:l.axis},o.trigger(Tr,t,function(e){e.cancel?n.updateCheckState(s,"uncheck"):(_e.removeClass([r.querySelector("."+nt)],st),d&&_e.isNullOrUndefined(d.querySelector("."+re+" ."+Le))&&_e.removeClass([d.querySelector("."+nt)],st),n.updateSelectedNodes(r,"uncheck"),n.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport(i),"pivot"===n.parent.dataType&&n.parent.showValuesButton&&1<n.parent.dataSourceSettings.values.length&&l&&l.position<n.parent.dataSourceSettings.valueIndex&&("row"===n.parent.dataSourceSettings.valueAxis&&"rows"===l.axis||"column"===n.parent.dataSourceSettings.valueAxis&&"columns"===l.axis)&&o.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,s,a))}))},v.prototype.updateReportSettings=function(e,t){var i,a=t.dropPosition,t=t.dropAxis;switch("pivot"===this.parent.dataType&&this.parent.showValuesButton&&1<this.parent.dataSourceSettings.values.length&&(i="row"===this.parent.dataSourceSettings.valueAxis&&"rows"===t?this.parent.dataSourceSettings.rows:"column"===this.parent.dataSourceSettings.valueAxis&&"columns"===t?this.parent.dataSourceSettings.columns:void 0,_e.isNullOrUndefined(i)||(-1===a&&-1===this.parent.dataSourceSettings.valueIndex?this.parent.setProperties({dataSourceSettings:{valueIndex:i.length}},!0):-1<a&&a<=this.parent.dataSourceSettings.valueIndex?this.parent.setProperties({dataSourceSettings:{valueIndex:this.parent.dataSourceSettings.valueIndex+1}},!0):-1<this.parent.dataSourceSettings.valueIndex&&a>this.parent.dataSourceSettings.valueIndex&&(a-=1))),t){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":-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||1<this.parent.dataSourceSettings.values.length||("row"===this.parent.dataSourceSettings.valueAxis?this.parent.dataSourceSettings.rows:this.parent.dataSourceSettings.columns).push({name:"[Measures]",caption:"Measures",baseField:void 0,baseItem:void 0})}},v.prototype.updateCheckState=function(e,t){for(var i=this.fieldTable.element.querySelectorAll("."+ci),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]))},v.prototype.updateNodeStateChange=function(e,t,i){!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate?this.parent.updateDataSource(!0):(t.isSelected=i,"olap"===this.parent.dataType&&this.parent.olapEngineModule.updateFieldlistData(e,i),this.updateDataSource());var t=this.treeViewElement.querySelector('[data-uid="'+e+'"]'),a=(t.focus(),_e.removeClass([t],"e-hover"),this.parent);setTimeout(function(){a.axisFieldModule.render()})},v.prototype.updateSelectedNodes=function(e,t){if(e&&e.querySelector("ul"))for(var i=0,a=[].slice.call(e.querySelectorAll("li"));i<a.length;i++){var r=a[i];"check"===t?_e.addClass([r.querySelector("."+nt)],st):_e.removeClass([r.querySelector("."+nt)],st)}},v.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(Rr,this)):this.parent.triggerPopulateEvent()},v.prototype.addNode=function(e,t,i,a){var r=this;a=_e.isNullOrUndefined(a)?e.node:a,t=_e.isNullOrUndefined(t)?a.getAttribute("data-uid"):t;var n=this.parent.pivotFieldList[t];if(!_e.isNullOrUndefined(e)){if(this.isSpaceKey=e.event.key&&" "===e.event.key,_e.isNullOrUndefined(n)||e.node.classList.contains(Q)||e.event.target&&(e.event.target.classList.contains(Xi)||e.event.target.classList.contains(Ji))||e.event.key&&"Enter"!==e.event.key)return;i=!1;a=this.fieldTable.getNode(e.node);i=e.event&&e.event.target&&!e.event.target.classList.contains(Fe)?"true"===a.isChecked?(this.fieldTable.uncheckAll([e.node]),!1):(this.fieldTable.checkAll([e.node]),!0):"true"===a.isChecked}t=Ie.getFieldInfo(n.id.toString(),this.parent),e=this.parent.isPopupView?this.parent.pivotGridModule:this.parent;i?(a={fieldName:t.fieldName,dropField:t.fieldItem,dataSourceSettings:Ie.getClonedDataSourceSettings(this.parent.dataSourceSettings),dropAxis:["filters","columns","rows","values"][this.parent.dialogRenderer.adaptiveElement.selectedItem],draggedAxis:"fieldlist",cancel:!1},e.trigger(oa,a,function(e){e.cancel?r.updateCheckState(n,"check"):r.selectedNodes.push(n.id.toString())})):(i={cancel:!1,fieldName:t.fieldName,dataSourceSettings:Ie.getClonedDataSourceSettings(this.parent.dataSourceSettings),fieldItem:t.fieldItem,axis:t.axis},e.trigger(Tr,i,function(e){if(e.cancel)r.updateCheckState(n,"uncheck");else for(var t=r.selectedNodes.length;t--;)if(r.selectedNodes[t]===n.id.toString()){r.selectedNodes.splice(t,1);break}}))},v.prototype.refreshTreeView=function(){var e;this.fieldTable&&(e=this.getUpdatedData(),this.fieldTable.fields={dataSource:e,id:"id",text:"caption",isChecked:"isSelected",parentID:"pid",iconCss:"spriteCssClass"},this.fieldTable.dataBind())},v.prototype.getUpdatedData=function(){var e=this.getTreeData(),t=this.fieldTable.expandedNodes;return this.updateExpandedNodes(e,t),this.applySorting(e,this.fieldListSort)},v.prototype.getTreeData=function(e){var t=[];if("olap"===this.parent.dataType)t=this.getOlapTreeData(e),this.isSearching&&0<this.olapFieldListData.length&&(t=this.performeSearching(this.fieldSearch.value));else{for(var i=this.parent.pivotFieldList?Object.keys(this.parent.pivotFieldList).reverse():[],a={},r=0,n=i;r<n.length;r++){var s,o=n[r],l=this.parent.pivotFieldList[o];a[o]={id:l.id,pid:l.pid,caption:l.caption,isSelected:l.isSelected},_e.isNullOrUndefined(l.pid)||a[o].hasChildren||(s=l.pid+"_group_name",a[o].pid=s,a[s]={id:s,caption:l.pid,isSelected:(a[s]&&a[s].isSelected?a[s]:l).isSelected,hasChildren:!0})}if(this.parent.isAdaptive){for(var e=[this.parent.dataSourceSettings.filters,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.values][e],d=i.length;d--;)a[i[d]].isSelected=!1;for(var h=0,p=e;h<p.length;h++)a[p[h].name].isSelected=!0}for(var u=0,c=Object.keys(a);u<c.length;u++){l=c[u];t.push(a[l])}}return t},v.prototype.getOlapTreeData=function(e){var t=[],i=this.parent.olapEngineModule.fieldListData||[];if(this.parent.isAdaptive)for(var a=[this.parent.dataSourceSettings.filters,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.values][e],r=0;r<i.length;){var n=i[r],s=void 0;if(3===e){if("[measures]"!==n.id.toLowerCase()&&(0===n.id.toLowerCase().indexOf("[measures]")||n.spriteCssClass&&-1!==n.spriteCssClass.indexOf("e-measureCDB"))||"[calculated members].[_0]"===n.id.toLowerCase()||n.spriteCssClass&&-1!==n.spriteCssClass.indexOf("e-calc-measure-icon")){(s={id:n.id,caption:n.caption,hasChildren:n.hasChildren,type:n.type,aggregateType:n.aggregateType,isSelected:n.isSelected,pid:n.pid,spriteCssClass:n.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 o=0,l=a;o<l.length;o++){var d=l[o];if(s.id===d.name){s.isSelected=!0;break}}t.push(s)}}else if(!(0===n.id.toLowerCase().indexOf("[measures]")||n.spriteCssClass&&-1!==n.spriteCssClass.indexOf("e-measureCDB")||n.spriteCssClass&&-1!==n.spriteCssClass.indexOf("e-calc-measure-icon"))){(s={id:n.id,caption:n.caption,hasChildren:n.hasChildren,type:n.type,aggregateType:n.aggregateType,isSelected:n.isSelected,pid:n.pid,spriteCssClass:n.spriteCssClass}).isSelected=!1;for(var h=0,p=a;h<p.length;h++){var u=p[h];if(s.id===u.name){s.isSelected=!0;break}}t.push(s)}r++}else t=_e.isNullOrUndefined(this.parent.olapEngineModule.fieldListData)?[]:Ie.getClonedData(this.parent.olapEngineModule.fieldListData);return this.olapFieldListData=t},v.prototype.updateExpandedNodes=function(e,t){if(0<t.length)for(var i=0,a=0,r=e;a<r.length;a++){var n=r[a];if(-1<t.indexOf(n.id)&&(i++,n.expanded=!0,n.spriteCssClass=n.spriteCssClass&&-1<n.spriteCssClass.toString().indexOf("e-folderCDB-icon")?n.spriteCssClass.toString().replace("e-folderCDB-icon","e-folderCDB-open-icon"):n.spriteCssClass,i===t.length))break}},v.prototype.updateSorting=function(e){var t=e.target,e=t.getAttribute("data-sort");if(this.parent.actionObj.actionName=Nn,!this.parent.actionBeginMethod()){try{if(-1===t.className.indexOf("e-selected")){switch(e){case"None":this.fieldListSort="None",_e.addClass([t],"e-selected"),_e.removeClass([this.parentElement.querySelector(".e-sort-ascend")],"e-selected"),_e.removeClass([this.parentElement.querySelector(".e-sort-descend")],"e-selected");break;case"Ascend":this.fieldListSort="Ascend",_e.addClass([t],"e-selected"),_e.removeClass([this.parentElement.querySelector(".e-sort-none")],"e-selected"),_e.removeClass([this.parentElement.querySelector(".e-sort-descend")],"e-selected");break;case"Descend":this.fieldListSort="Descend",_e.addClass([t],"e-selected"),_e.removeClass([this.parentElement.querySelector(".e-sort-ascend")],"e-selected"),_e.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()}},v.prototype.applySorting=function(e,t){var i,a;return 0<e.length&&("olap"===this.parent.dataType?(a=i=void 0,0<this.parent.dataSourceSettings.calculatedFieldSettings.length&&"[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)):this.fieldTable.sortOrder="Ascend"===t?"Ascending":"Descend"===t?"Descending":"None"),e},v.prototype.onFieldAdd=function(){this.parent.dialogRenderer.updateDataSource(this.selectedNodes),this.closeTreeDialog()},v.prototype.closeTreeDialog=function(){this.selectedNodes=[],this.fieldDialog.hide(),this.fieldDialog.destroy(),document.getElementById(this.parent.element.id+"_FieldListTreeView")&&_e.remove(document.getElementById(this.parent.element.id+"_FieldListTreeView")),this.fieldDialog=null},v.prototype.keyPress=function(e){13===e.keyCode&&e.target&&(e.target.click(),e.preventDefault())},v.prototype.wireFieldListEvent=function(e){_e.EventHandler.add(e,"keydown",this.keyPress,this),_e.EventHandler.add(e,"click",this.updateSorting,this)},v.prototype.unWireFieldListEvent=function(e){_e.EventHandler.remove(e,"keydown",this.keyPress),_e.EventHandler.remove(e,"click",this.updateSorting)},v.prototype.addEventListener=function(){this.parent.on(Ur,this.refreshTreeView,this)},v.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Ur,this.refreshTreeView)},v.prototype.destroy=function(){if(this.removeEventListener(),this.parentElement)for(var e=0,t=[this.parentElement.querySelector(".e-sort-none"),this.parentElement.querySelector(".e-sort-ascend"),this.parentElement.querySelector(".e-sort-descend")];e<t.length;e++){var i=t[e];i&&this.unWireFieldListEvent(i)}if(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){if(this.fieldTable.element)for(var a=this.fieldTable.element.querySelectorAll("li"),r=0;r<a.length;r++)_e.EventHandler.clearEvents(a[r]);this.fieldTable.destroy(),this.fieldTable=null}this.fieldDialog&&!this.fieldDialog.isDestroyed&&(this.fieldDialog.destroy(),this.fieldDialog=null),this.treeViewElement&&this.treeViewElement.parentNode&&(this.treeViewElement.innerHTML=""),this.selectedNodes=[],this.nonSearchList=null,this.parentIDs=[]};var Qh=v;function v(e){this.selectedNodes=[],this.isSearching=!1,this.parentIDs=[],this.isSpaceKey=!1,this.olapFieldListData=[],this.parent=e,this.addEventListener()}Kh.prototype.render=function(){var e;this.parent.isAdaptive||(e=_e.createElement("div",{className:"e-axis-table "+("olap"===this.parent.dataType?"e-olap-axis-table":"")}),this.leftAxisPanel=_e.createElement("div",{className:se}),this.rightAxisPanel=_e.createElement("div",{className:oe}),this.parent.dialogRenderer.parentElement.appendChild(e),e.appendChild(this.leftAxisPanel),e.appendChild(this.rightAxisPanel),this.axisTable=e,this.renderAxisTable()),this.parent.axisFieldModule.render()},Kh.prototype.renderAxisTable=function(){for(var e=["filters","rows","columns","values"],t=0,i=e.length;t<i;t++){var a=_e.createElement("div",{className:$+"-"+e[t]}),r=_e.createElement("div",{className:Gt+"-container"}),n=_e.createElement("div",{className:"e-axis-header",attrs:{title:this.parent.localeObj.getConstant(e[t])}}),n=(n.innerText=this.parent.localeObj.getConstant(e[t]),r.appendChild(this.getIconupdate(e[t])),r.appendChild(n),_e.createElement("div",{className:de+" e-"+e[t]})),s=void 0,s="rows"===e[t]?this.parent.localeObj.getConstant("dropRowPrompt"):"columns"===e[t]?this.parent.localeObj.getConstant("dropColPrompt"):"values"===e[t]?this.parent.localeObj.getConstant("dropValPrompt"):this.parent.localeObj.getConstant("dropFilterPrompt"),o=_e.createElement("span",{className:he}),s=(o.innerText=s,new _e.Droppable(n,{}));this.droppableInstances.push(s),a.appendChild(r),a.appendChild(n),a.appendChild(o),(t<=1?this.leftAxisPanel:this.rightAxisPanel).appendChild(a),this.unWireEvent(n),this.wireEvent(n)}},Kh.prototype.getIconupdate=function(e){var t=_e.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:Gt+"-icon-container"}),e=_e.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:W+" "+Gt+"-"+e});return t.appendChild(e),t},Kh.prototype.wireEvent=function(e){_e.EventHandler.add(e,"mouseover",this.updateDropIndicator,this),_e.EventHandler.add(e,"mouseleave",this.updateDropIndicator,this)},Kh.prototype.unWireEvent=function(e){_e.EventHandler.remove(e,"mouseover",this.updateDropIndicator),_e.EventHandler.remove(e,"mouseleave",this.updateDropIndicator)},Kh.prototype.updateDropIndicator=function(e){var t,i=this.parent.dialogRenderer.parentElement;this.parent.isDragging&&e.target.classList.contains(de)&&"mouseover"===e.type?(_e.removeClass([].slice.call(i.querySelectorAll("."+Te)),Me),_e.removeClass([].slice.call(i.querySelectorAll("."+Te+"-last")),Me),0<(t=[].slice.call(e.target.querySelectorAll("."+pe))).length&&_e.addClass([t[t.length-1].querySelector("."+Te+"-last")],Me)):this.parent.isDragging&&(e.target.classList.contains(qe)||"mouseleave"!==e.type)||(_e.removeClass([].slice.call(i.querySelectorAll("."+Te)),Me),_e.removeClass([].slice.call(i.querySelectorAll("."+Te+"-last")),Me))},Kh.prototype.destroy=function(){if(this.axisTable)for(var e=this.axisTable.querySelectorAll("."+de),t=0;t<e.length;t++)this.unWireEvent(e[t]);for(t=0;t<this.droppableInstances.length;t++)this.droppableInstances[t]&&!this.droppableInstances[t].isDestroyed&&this.droppableInstances[t].destroy();this.droppableInstances=[],this.axisTable&&this.axisTable.parentNode&&this.axisTable.parentNode.removeChild(this.axisTable),this.axisTable=null,this.leftAxisPanel=null,this.rightAxisPanel=null};var Yh=Kh;function Kh(e){this.droppableInstances=[],this.parent=e}C.prototype.renderPivotButton=function(e){var t,i=this,r=(this.parentElement="pivotview"===this.parent.getModuleName()?this.parent.element:document.getElementById(this.parent.element.id+"_Container"),Array.prototype.slice.call(this.parentElement.querySelectorAll(".e-group-"+e.axis))),n=("rows"===e.axis&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&_e.isNullOrUndefined(this.parentElement.querySelector("."+Ui))&&(r.push(this.parent.groupingBarModule.rowPanel),t=this.parent.groupingBarModule.rowPanel),_e.extend([],e.field,null,!0)),a=e.axis,s=-1,o="pivot"===this.parent.dataType&&("pivotfieldlist"===this.parent.getModuleName()&&this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent).showValuesButton;if(("row"===this.parent.dataSourceSettings.valueAxis&&"rows"===e.axis||"column"===this.parent.dataSourceSettings.valueAxis&&"columns"===e.axis)&&o&&1<this.parent.dataSourceSettings.values.length&&_e.isNullOrUndefined(Ie.getFieldByName("[Measures]",n))&&(o=Ie.getFieldByName("[Measures]",this.parent.dataSourceSettings.fieldMapping),e={name:"[Measures]",caption:this.parent.localeObj.getConstant("values"),axis:e.axis,showRemoveIcon:!(o&&"showRemoveIcon"in o)||o.showRemoveIcon,allowDragAndDrop:!(o&&"allowDragAndDrop"in o)||o.allowDragAndDrop},-1===this.parent.dataSourceSettings.valueIndex||this.parent.dataSourceSettings.valueIndex>n.length?(s=n.length,n.push(e),this.parent.setProperties({dataSourceSettings:{valueIndex:-1}},!0)):(s=this.parent.dataSourceSettings.valueIndex,n.splice(s,0,e))),"pivotfieldlist"===this.parent.getModuleName()){if(this.parentElement=document.getElementById(this.parent.element.id+"_Container"),!this.parentElement.querySelector("."+$+"-"+a))return;var l=this.parentElement.querySelector("."+$+"-"+a).querySelector("."+he);0===n.length?_e.removeClass([l],Q):_e.addClass([l],Q),t=this.parentElement.querySelector("."+$+"-"+a).querySelector("."+de)}else this.parentElement=this.parent.element,_e.isNullOrUndefined(this.parentElement.querySelector(".e-group-"+a))||(t=this.parentElement.querySelector(".e-group-"+a));if(t)if("pivotview"===this.parent.getModuleName()&&0===n.length)for(var d=0;d<r.length;d++)(b=r[d]).classList.contains(Li)||b.classList.contains(Fi)||((l=_e.createElement("span",{className:he})).innerText=this.parent.groupingBarSettings.allowDragAndDrop?"rows"===a?this.parent.localeObj.getConstant("rowAxisPrompt"):"columns"===a?this.parent.localeObj.getConstant("columnAxisPrompt"):"values"===a?this.parent.localeObj.getConstant("valueAxisPrompt"):"filters"===a?this.parent.localeObj.getConstant("filterAxisPrompt"):this.parent.localeObj.getConstant("allFields"):"",b.appendChild(l));else{for(var d=0,k=n.length;d<k;d++)for(var h="pivotfieldlist"===this.parent.getModuleName()?[t]:r,p=0;p<h.length;p++){var u,c,g,m,S,f,v,y,b=h[p];(this.parent.olapEngineModule&&(this.parent.olapEngineModule.fieldList[n[d].name]||"[Measures]"===n[d].name)||this.parent.engineModule)&&(u="olap"===this.parent.dataType&&("[measures]"===n[d].name.toLowerCase()||"values"===a),g="olap"===this.parent.dataType&&"values"===a,b.classList.contains(Li)||b.classList.contains(Fi)||(c=_e.createElement("div",{className:pe+(0===d&&"all-fields"!==a?" e-first-btn":"")+(this.parent.isTabular?" e-tabular-pvt-btn":""),attrs:{"data-tag":a+":"+n[d].name}}),this.parent.isTabular&&(c.style.width="auto"),m=n[d].caption||n[d].name,m=this.parent.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(m):m,g=_e.createElement("div",{id:this.parent.element.id+"_"+n[d].name,className:Y+" "+n[d].name.replace(/[^A-Z0-9]/gi,"")+(this.parent.isTabular?" e-tabular-row-btn":""),attrs:{"data-uid":n[d].name,tabindex:"pivotview"===this.parent.getModuleName()&&this.parent.grid&&"rows"===a&&!b.classList.contains(Ii)?"-1":"0",isvalue:d===s||u&&!g?"true":"false","aria-disabled":"false","aria-label":m,"data-type":"olap"===this.parent.dataType?g?"isMeasureFieldsAvail":u?"isMeasureAvail":n[d].type:n[d].type,"data-caption":m,"data-basefield":this.parent.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(n[d].baseField):n[d].baseField,"data-baseitem":this.parent.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(n[d].baseItem):n[d].baseItem,role:"button"}}),m=_e.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:Te}),y=_e.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:Te+"-last"}),S=this.createButtonDragIcon(n[d],g),f=this.createButtonText(n,d,a,s),g.appendChild(f),"all-fields"!==a?(u||n[d].isNamedSet||n[d].isCalculatedField||(-1!==["filters","values"].indexOf(a)||s===d||"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(g,n[d].name,n[d]),"values"!==a&&s!==d&&this.createFilterOption(g,n[d].name,a,n[d]),"values"===a&&this.getTypeStatus(n,d,g)),!n[d].isCalculatedField&&"CalculatedField"!==n[d].type||(v=_e.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("editCalculatedField")},className:W+" "+Jt}),this.parent.allowCalculatedField&&this.parent.calculatedFieldModule&&(n[d].showEditIcon||void 0===n[d].showEditIcon)?_e.removeClass([v],Q):_e.addClass([v],Q),g.appendChild(v)),v=_e.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("remove")},className:W+" "+Ce}),"pivotview"===this.parent.getModuleName()?this.parent.groupingBarSettings.showRemoveIcon&&(n[d].showRemoveIcon||void 0===n[d].showRemoveIcon)?_e.removeClass([v],Q):_e.addClass([v],Q):n[d].showRemoveIcon||void 0===n[d].showRemoveIcon?_e.removeClass([v],Q):_e.addClass([v],Q),g.appendChild(v),c.appendChild(m),c.appendChild(g),c.appendChild(y)):(c.appendChild(m),c.appendChild(g)),b.appendChild(c),(y=new z.Button({enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass})).isStringTemplate=!0,y.appendTo(g),this.unWireEvent(c,d===s&&"all-fields"!==a?"values":a,u),this.wireEvent(c,d===s&&"all-fields"!==a?"values":a,u),("pivotview"!==this.parent.getModuleName()||this.parent.isAdaptive)&&"pivotfieldlist"!==this.parent.getModuleName())||(this.createDraggable(n[d],"pivotview"===this.parent.getModuleName()?f:S),_e.getInstance(g.querySelector("."+Z),_e.Draggable).enableAutoScroll=!1))}if("values"===a)for(var C=_e.select("."+Ai,this.parentElement)?_e.getInstance(_e.select("."+Ai,this.parentElement),G.DropDownList):null,x=this,d=0;d<r.length;d++)!function(e){var t,i,a,e=r[e];e.classList.contains(Li)&&x.parent.pivotChartModule&&(t=n.map(function(e){return{text:e.caption||e.name,value:e.name}}),i=x.parent,C&&e.querySelector("."+Ai)?(C.dataSource=t,C.value=i.chartSettings.enableMultipleAxis?t[0].value:i.pivotChartModule.currentMeasure):(a=_e.createElement("div",{className:Ai}),e.appendChild(a),(C=new G.DropDownList({dataSource:t,enableRtl:x.parent.enableRtl,locale:x.parent.locale,value:i.chartSettings.enableMultipleAxis?t[0].value:i.pivotChartModule.currentMeasure,width:x.parent.isAdaptive?150:200,fields:{value:"value",text:"text"},cssClass:"e-group-chart-values-drodown"+(x.parent.cssClass?" "+x.parent.cssClass:""),change:function(e){e.e&&null!==e.e&&(i.chartSettings.value=e.value)}})).isStringTemplate=!0,C.appendTo(a)))}(d);else if("columns"===a)for(var w=void 0,T=_e.select("."+Ri,this.parentElement)?_e.getInstance(_e.select("."+Ri,this.parentElement),G.DropDownList):null,d=0;d<r.length;d++)if((b=r[d]).classList.contains(Fi)&&this.parent.pivotChartModule){for(var j=this.parent.pivotChartModule.currentMeasure,M=this.parent.chartSettings.columnDelimiter||"-",q=this.parent.chartSettings.columnHeader&&""!==this.parent.chartSettings.columnHeader?this.parent.chartSettings.columnHeader.split(M).join(" - "):"",D="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,O=D.pivotValues,H=this.parent.pivotChartModule.getColumnTotalIndex(O),P=[],N=!1,E=0,V=Object.keys(O);E<V.length;E++){var U=V[E];if(N)break;var I=Number(U);if(O[I]&&O[I][0]&&"row"===O[I][0].axis&&(0===this.parent.dataSourceSettings.rows.length||"grand sum"!==O[I][0].type))for(var _=O[I][0],F="olap"===this.parent.dataType?D.tupRowInfo[_.ordinal]:void 0,U=O[I],L=0,B=Object.keys(U);L<B.length;L++){var A=B[L],A=Number(A),A=O[I][A],R="olap"===this.parent.dataType&&F&&F.measureName?F.measureName:A.actualText;H[A.colIndex]||"value"!==A.axis||"header"===_.type||""===R||R!==j||(N=!0,R=("olap"===this.parent.dataType?A.columnHeaders.toString().split(/~~|::/):A.columnHeaders.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter)).join(" - "),P.push({value:R,text:R,title:((A={}).title=R,A)}),R===q&&(w=P.length))}}T&&b.querySelector("."+Ri)?(T.dataSource=P,T.value=(void 0!==w?P[w-1]:P[0]).value):(M=_e.createElement("div",{className:Ri}),b.appendChild(M),(T=new G.DropDownList({dataSource:P,enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:w?P[w-1].value:P[0]?P[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){var t;e.e&&null!==e.e&&(t=i.parent.chartSettings.columnDelimiter||"-",i.parent.chartSettings.columnHeader=e.value.split(" - ").join(t))}})).isStringTemplate=!0,T.appendTo(M))}}},C.prototype.createButtonText=function(e,t,i,a){"filters"===i&&(n=this.updateButtontext(e[t].name)),(s="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule).fieldList&&void 0!==s.fieldList[e[t].name]&&(r="DistinctCount"===(r=s.fieldList[e[t].name].aggregateType)||"number"===s.fieldList[e[t].name].type&&"include"!==s.fieldList[e[t].name].type&&"exclude"!==s.fieldList[e[t].name].type?void 0===r?"Sum":s.fieldList[e[t].name].aggregateType:"Count");var r,n,s,o=e[t].caption||e[t].name,o=this.parent.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(o):o,a=_e.createElement("span",{attrs:{title:"filters"===i?"olap"===this.parent.dataType&&"CalculatedField"===s.fieldList[e[t].name].type?o:o+" ("+n+")":"olap"!==this.parent.dataType&&this.parent.dataSourceSettings.showAggregationOnValueField&&"values"===i&&"CalculatedField"!==r?this.parent.localeObj.getConstant(r)+" "+this.parent.localeObj.getConstant("of")+" "+o:o,tabindex:"-1","aria-disabled":"false",oncontextmenu:"return false;","data-type":a===t?"":r},className:ge+" "+("pivotview"!==this.parent.getModuleName()||this.parent.groupingBarSettings.allowDragAndDrop&&(e[t].allowDragAndDrop||void 0===e[t].allowDragAndDrop)?"":we)});return a.innerText="filters"===i?"olap"===this.parent.dataType&&"CalculatedField"===s.fieldList[e[t].name].type?o:o+" ("+n+")":"olap"!==this.parent.dataType&&this.parent.dataSourceSettings.showAggregationOnValueField&&"values"===i&&"CalculatedField"!==r?this.parent.localeObj.getConstant(r)+" "+this.parent.localeObj.getConstant("of")+" "+o:o,a},C.prototype.getTypeStatus=function(e,t,i){var a="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule;a.fieldList&&(a=a.fieldList[e[t].name])&&"CalculatedField"!==a.aggregateType&&this.validateDropdown(a.type)&&this.createSummaryType(i,e[t].name,e[t])},C.prototype.validateDropdown=function(e){var t=this.parent.aggregateTypes;if("number"!==e)return-1<t.indexOf("Count")||-1<t.indexOf("DistinctCount");for(var i=0;i<t.length;i++)if(-1<this.parent.getAllSummaryType().indexOf(t[i]))return!0;return!1},C.prototype.createSummaryType=function(e,t,i){var a=_e.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("format")},className:W+" "+B});return"pivotview"===this.parent.getModuleName()?this.parent.groupingBarSettings.showValueTypeIcon&&i.showValueTypeIcon?_e.removeClass([a],Q):_e.addClass([a],Q):i.showValueTypeIcon?_e.removeClass([a],Q):_e.addClass([a],Q),e.appendChild(a),a},C.prototype.createMenuOption=function(e){this.menuOption.render(e,this.parentElement),this.parent.pivotButtonModule=this},C.prototype.openCalculatedFieldDialog=function(e){var e=e.target.parentElement.getAttribute("data-uid"),t=Ie.getFieldInfo(e,this.parent);if(this.parent.actionObj.actionName=En,this.parent.actionObj.fieldInfo=t,!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("."+X).click(),this.parent.pivotFieldListModule.dialogRenderer.adaptiveElement.select(4),this.parent.pivotFieldListModule.calculatedFieldModule.updateAdaptiveCalculatedField(!0,e)):(this.parent.isAdaptive||(this.parent.calculatedFieldModule.buttonCall=!0),this.parent.notify(Br,{edit:!0,fieldName:e})):"pivotfieldlist"===this.parent.getModuleName()&&(this.parent.isAdaptive?(this.parent.dialogRenderer.adaptiveElement.select(4),this.parent.calculatedFieldModule.updateAdaptiveCalculatedField(!0,e),this.parent.calculatedFieldModule.buttonCall=!0):(this.parent.dialogRenderer.fieldListDialog&&(this.parent.dialogRenderer.fieldListDialog.hide(),_e.addClass([this.parent.element.querySelector("."+X)],k)),this.parent.notify(Br,{edit:!0,fieldName:e}),this.parent.calculatedFieldModule&&(this.parent.calculatedFieldModule.buttonCall=!0)))}catch(e){this.parent.actionFailureMethod(e)}},C.prototype.createDraggable=function(e,t){this.draggable=new _e.Draggable(t,{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?"":"."+Y:e.allowDragAndDrop?"":"."+Y})},C.prototype.createButtonDragIcon=function(e,t){var i=_e.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false"}}),e=_e.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("drag")},className:W+" "+xe+" "+(e.allowDragAndDrop||void 0===e.allowDragAndDrop?"":we)});return i.appendChild(e),"pivotfieldlist"===this.parent.getModuleName()&&t.appendChild(i),i},C.prototype.createSortOption=function(e,t,i){var a="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule;if(!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate)r="Descending"===a.fieldList[t].sort?fe:"";else for(var r="",n=0;n<this.parent.dataSourceSettings.sortSettings.length;n++)this.parent.dataSourceSettings.sortSettings[n].name===t&&(r="Descending"===this.parent.dataSourceSettings.sortSettings[n].order?fe:"");return a=a.fieldList&&"None"===a.fieldList[t].sort?_e.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("sort")},className:W}):_e.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("sort")},className:W+" "+me+" "+r}),this.parent.dataSourceSettings.enableSorting?"pivotview"===this.parent.getModuleName()?i.showSortIcon&&this.parent.groupingBarSettings.showSortIcon?_e.removeClass([a],Q):_e.addClass([a],Q):i.showSortIcon?_e.removeClass([a],Q):_e.addClass([a],Q):_e.addClass([a],Q),e.appendChild(a),a},C.prototype.createFilterOption=function(e,t,i,a){var r="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,n=Ie.getFieldByName(t,this.parent.dataSourceSettings.filterSettings);if(!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate)r.fieldList[t].filter=null===r.fieldList[t].filter?[]:r.fieldList[t].filter,s=!("Server"===this.parent.dataSourceSettings.mode&&!n||"Local"===this.parent.dataSourceSettings.mode&&0===r.fieldList[t].filter.length)||r.fieldList[t].isExcelFilter?be:ye;else for(var s=ye,o=0;o<this.parent.dataSourceSettings.filterSettings.length;o++)this.parent.dataSourceSettings.filterSettings[o].name===t&&(s=be);n=_e.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("filter")},className:ve+" "+W+" "+s});return(this.parent.dataSourceSettings.allowLabelFilter||this.parent.dataSourceSettings.allowValueFilter)&&"filters"!==i||this.parent.dataSourceSettings.allowMemberFilter?_e.removeClass([n],Q):_e.addClass([n],Q),"pivotview"===this.parent.getModuleName()?((this.parent.dataSourceSettings.allowLabelFilter||this.parent.dataSourceSettings.allowValueFilter)&&"filters"!==i||this.parent.dataSourceSettings.allowMemberFilter)&&this.parent.groupingBarSettings.showFilterIcon&&a.showFilterIcon?_e.removeClass([n],Q):_e.addClass([n],Q):a.showFilterIcon&&((this.parent.dataSourceSettings.allowLabelFilter||this.parent.dataSourceSettings.allowValueFilter)&&"filters"!==i||this.parent.dataSourceSettings.allowMemberFilter)?_e.removeClass([n],Q):_e.addClass([n],Q),e.appendChild(n),n},C.prototype.updateButtontext=function(e){var t,i="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,a=i.fieldList[e].filter.length,r=i.fieldList[e].filterType,n=i.fieldList[e].dateMember.length,s=i.fieldList[e].filter[0];if("olap"===this.parent.dataType)t=this.updateOlapButtonText(i,e,s,a);else if("include"===r)1===a?t=s:1<a&&(t=a===n?this.parent.localeObj.getConstant("all"):this.parent.localeObj.getConstant("multipleItems"));else if("exclude"===r){if(1===a)t=2===n?s!==i.fieldList[e].dateMember[0].actualText?s:i.fieldList[e].dateMember[0].actualText:this.parent.localeObj.getConstant("multipleItems");else if(1<a){var o=void 0,l=Object.keys(i.fieldList[e].members),d=i.fieldList[e].filter;if(a===l.length-1)for(o=0;o<l.length;o++){var h=l[o];if(-1===d.indexOf(h)){t=l[o];break}}else t=this.parent.localeObj.getConstant("multipleItems")}}else t=this.parent.localeObj.getConstant("all");return t},C.prototype.updateOlapButtonText=function(e,t,i,a){var r,n=e.fieldList[t].actualFilter;if(0<n.length){var s=e.fieldList[t].members,o=[];if(0<e.fieldList[t].filterMembers.length){for(var l={},d=0,h=n;d<h.length;d++)s[l[p=h[d]]=p]&&(l=this.parent.pivotCommon.eventBase.getParentNode(t,p,l));for(var p,u=0,c=l?Object.keys(l):[];u<c.length;u++)!s[p=c[u]].isSelected||s[p].parent&&s[s[p].parent].isSelected||o.push(p);i=1===o.length?s[o[0]].caption:i}a=0===o.length?a:o.length}return 0===a?r=e.fieldList[t].allMember||this.parent.localeObj.getConstant("all"):1===a?r=i:1<a&&(r=this.parent.localeObj.getConstant("multipleItems")),r},C.prototype.createDragClone=function(e){var e=_e.closest(e.element,"."+Y),t=_e.createElement("div",{id:this.parent.element.id+"_DragClone",className:"e-button-drag-clone"+(this.parent.cssClass?" "+this.parent.cssClass:"")}),i=_e.createElement("span",{className:$e});return i.innerText=this.parent.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(e.textContent):e.textContent,t.appendChild(i),document.body.appendChild(t),t},C.prototype.onDragStart=function(s){var o=this,l=_e.closest(s.element,"."+Y),d=document.getElementById(this.parent.element.id+"_DragClone"),e=Ie.getFieldInfo(l.getAttribute("data-uid"),this.parent),e={fieldName:e.fieldName,fieldItem:e.fieldItem,axis:e.axis,dataSourceSettings:Ie.getClonedDataSourceSettings(this.parent.dataSourceSettings),cancel:!1};("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(Or,e,function(e){if(e.cancel)o.parent.isDragging=!1,o.draggable.intDestroy(s.event),_e.detach(d);else{o.parent.isDragging=!0;var t,e=("olap"===o.parent.dataType?o.parent.olapEngineModule:o.parent.engineModule).fieldList[l.getAttribute("data-uid")],i=[He,Ve,Be];if(_e.addClass([l],Je),d&&"Popup"===("pivotfieldlist"===o.parent.getModuleName()&&o.parent.renderMode)&&(t=o.parent,d.style.zIndex=(t.dialogRenderer.fieldListDialog.zIndex+1).toString()),e&&"CalculatedField"===e.aggregateType)for(var a=0,r=i;a<r.length;a++){var n=r[a];_e.addClass([o.parentElement.querySelector("."+n)],Xe),o.parentElement.querySelector("."+n).querySelectorAll(".e-pivot-button").forEach(function(e){e.style.cursor="no-drop"})}}})},C.prototype.onDragging=function(e){this.draggable.setProperties({cursorAt:{top:!_e.isNullOrUndefined(e.event.targetTouches)||_e.Browser.isDevice?60:-20}})},C.prototype.onDragStop=function(e){this.parent.isDragging=!1,e.target&&e.element&&_e.closest(e.element,"."+ze)&&!_e.closest(e.target,"."+qe)&&(e.cancel=!0);var t=_e.closest(e.element,"."+Y);_e.removeClass([].slice.call(this.parentElement.querySelectorAll("."+Y)),Je),_e.removeClass([].slice.call(this.parentElement.querySelectorAll("."+Te)),Me);for(var i=0,a=[He,Ve,Be];i<a.length;i++){var r=a[i];_e.removeClass([this.parentElement.querySelector("."+r)],Xe),this.parentElement.querySelector("."+r).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")&&_e.remove(document.getElementById(this.parent.element.id+"_DragClone")),document.body.style.cursor="auto",this.isButtonDropped(e.target,t)&&!e.cancel&&(this.parent.pivotCommon.dataSourceUpdate.control="pivotview"!==this.parent.getModuleName()&&this.parent.pivotGridModule||this.parent,this.parent.pivotCommon.nodeStateModified.onStateModified(e,t.getAttribute("data-uid")))&&(this.updateDataSource(),this.parent.axisFieldModule.render())},C.prototype.isButtonDropped=function(e,t){var i=_e.closest(t,"."+qe),a=_e.closest(e,"."+qe),r=!0;if(i&&i===a){for(var n,s=[].slice.call(i.querySelectorAll("."+Y)),o=_e.closest(e,"."+pe),l=void 0,d=-1,h=0,p=s.length;h<p;h++)s[h].id===t.id&&(l=h),o&&(n=o.querySelector("."+Y),s[h].id===n.id)&&(d=h);(l===d||l===s.length-1&&-1===d)&&(_e.removeClass([].slice.call(this.parentElement.querySelectorAll("."+Te)),Me),r=!1)}return r},C.prototype.updateSorting=function(e){var t,i=_e.closest(e.target,"."+Y),a=Ie.getFieldInfo(i?i.getAttribute("data-uid"):"",this.parent);if(!e.target.classList.contains(ve)&&!e.target.classList.contains(Ce)&&!e.target.classList.contains(xe)&&i&&a.fieldItem&&(a.fieldItem.showSortIcon||_e.isNullOrUndefined(a.fieldItem.showSortIcon))&&!a.fieldItem.isCalculatedField&&(this.parent.actionObj.actionName=In,this.parent.actionObj.fieldInfo=a,!this.parent.actionBeginMethod()))try{!(this.parent instanceof ap||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)||(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())&&(t={sortInfo:this.parent.lastSortInfo},this.parent.actionObj.actionInfo=t,this.updateDataSource(!0)),this.parent instanceof ap&&(this.axisField.render(),this.parent.isPopupView&&this.parent.pivotGridModule?this.parent.pivotGridModule.notify(Rr,this):this.parent.staticPivotGridModule&&this.parent.staticPivotGridModule.notify(Rr,this)))}catch(e){this.parent.actionFailureMethod(e)}},C.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(Rr,this),this.parent.pivotGridModule.setProperties({dataSourceSettings:this.parent.dataSourceSettings.properties},!0)):this.parent.triggerPopulateEvent()},C.prototype.updateFiltering=function(e){var t=this.parent.pivotGridModule||this.parent,i=e.target.parentElement.getAttribute("data-uid"),a=Ie.getFieldInfo(i,this.parent);if(this.parent.actionObj.actionName=Fn,this.parent.actionObj.fieldInfo=a,!this.parent.actionBeginMethod())try{"pivotfieldlist"===t.getModuleName()?P.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&&0<Object.keys(this.parent.engineModule.fieldList[i].members).length?this.updateFilterEvents():this.parent.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)}},C.prototype.updateFilterEvents=function(){var e=this.parent.pivotGridModule||this.parent,t=(this.parent.pivotCommon.eventBase.updateFiltering(e.mouseEventArgs),e.mouseEventArgs.target);this.fieldName=t.parentElement.getAttribute("data-uid"),this.parent.pivotCommon.filterDialog.dialogPopUp&&this.bindDialogEvents(),"pivotfieldlist"===e.getModuleName()?P.hideSpinner(e.fieldListSpinnerElement):e.hideWaitingPopup()},C.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())},C.prototype.buttonModel=function(){return[{isFlat:!1,buttonModel:{cssClass:"e-clear-filter-button"+(this.parent.pivotCommon.filterDialog.allowExcelLikeFilter?"":" "+Q)+(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:Re+(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:ke+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}]},C.prototype.tabSelect=function(e){this.index=e.selectedIndex,this.updateDialogButtonEvents(),_e.removeClass([].slice.call(this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelectorAll(".e-selected-tab")),"e-selected-tab"),0<e.selectedIndex&&_e.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("."+Re).removeAttribute("disabled"))},C.prototype.updateDialogButtonEvents=function(){this.parent.pivotCommon.filterDialog.dialogPopUp.buttons=this.buttonModel(),this.parent.pivotCommon.filterDialog.dialogPopUp.dataBind()},C.prototype.updateCustomFilter=function(){var t,i=this,e=this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector(".e-selected-tab"),a=e.getAttribute("data-fieldname"),r=e.getAttribute("data-selectedField"),n=e.getAttribute("data-type"),s=e.getAttribute("data-measure"),o=e.getAttribute("data-operator"),l=e.getAttribute("data-value1"),d=e.getAttribute("data-value2"),h="value"===n?"Value":"date"===n?"Date":"number"===n?"Number":"Label",p={name:a,type:h,measure:s,condition:o,value1:"date"===n?new Date(l):l,value2:"date"===n?new Date(d):d};if("olap"===this.parent.dataType){p.selectedField=r,this.removeDataSourceSettings(a,r,h);for(var u=0,c=this.parent.dataSourceSettings.filterSettings;u<c.length;u++){var g=c[u];g.name===a&&g.selectedField===r&&(t=g)}}else t=Ie.getFilterItemByName(a,this.parent.dataSourceSettings.filterSettings);_e.isNullOrUndefined(l)||""===l||-1<["Between","NotBetween"].indexOf(o)&&(_e.isNullOrUndefined(d)||""===d)?(s=h.toLowerCase()+(_e.isNullOrUndefined(l)||""===l?"_input_option_1":"_input_option_2"),n=_e.select("#"+this.parent.element.id+"_"+s,e),_e.addClass([n],$t),n.focus()):(o={cancel:!1,filterSettings:p,dataSourceSettings:Ie.getClonedDataSourceSettings(this.parent.dataSourceSettings)},("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(Cr,o,function(e){e.cancel||(p=e.filterSettings,t?((t=t.properties||t).type=p.type,t.measure=p.measure,t.condition=p.condition,t.value1=p.value1,t.value2=p.value2,"olap"===i.parent.dataType&&(t.selectedField=p.selectedField)):i.parent.dataSourceSettings.filterSettings.push(p)),"Value"!==h&&(i.parent.lastFilterInfo=Ie.getFilterItemByName(a,i.parent.dataSourceSettings.filterSettings),i.parent.lastFilterInfo=i.parent.lastFilterInfo.properties||i.parent.lastFilterInfo),i.parent.pivotCommon.filterDialog.dialogPopUp.close(),e.cancel||(i.refreshPivotButtonState(a,!0),i.updateDataSource(!0))}))},C.prototype.ClearFilter=function(){var e=this.parent.pivotCommon.filterDialog.dialogPopUp.element,t=e.getAttribute("data-fieldname"),e=e.querySelector(".e-selected-tab"),e=(this.parent.pivotCommon.filterDialog.dialogPopUp.close(),"olap"===this.parent.dataType&&e?(e=e.getAttribute("data-selectedField"),this.removeDataSourceSettings(t,e)):this.removeDataSourceSettings(t),Ie.getFilterItemByName(t,this.parent.dataSourceSettings.filterSettings));this.refreshPivotButtonState(t,!!e),this.updateDataSource(!0)},C.prototype.removeButton=function(e){var t=this,i=e.target,a=i.parentElement.getAttribute("data-uid"),r=Ie.getFieldInfo(a,this.parent);if(this.parent.actionObj.actionName=Ln,this.parent.actionObj.fieldInfo=r,!this.parent.actionBeginMethod()){e={cancel:!1,fieldName:a,dataSourceSettings:Ie.getClonedDataSourceSettings(this.parent.dataSourceSettings),fieldItem:r.fieldItem,axis:r.axis};try{("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(Tr,e,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&&1<t.parent.dataSourceSettings.values.length&&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)}}},C.prototype.nodeStateModified=function(e){var t,i=_e.closest(e.node,"li"),a=i.getAttribute("data-fieldname");"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)):("olap"===this.parent.dataType&&this.parent.olapEngineModule&&!this.parent.olapEngineModule.fieldList[a].isHierarchy&&(t=this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes(),this.updateNodeStates(t,a)),t=this.parent.pivotCommon.currentTreeItemsPos[i.getAttribute("data-memberId")].index,this.parent.pivotCommon.currentTreeItems[t]&&(this.parent.pivotCommon.currentTreeItems[t].isSelected="check"===e.action,this.parent.pivotCommon.currentTreeItemsPos[i.getAttribute("data-memberId")].isSelected="check"===e.action)),this.parent.pivotCommon.filterDialog.updateCheckedState()},C.prototype.checkedStateAll=function(e){for(var t={},i=0,a=this.parent.pivotCommon.searchTreeItems;i<a.length;i++)(r=a[i]).isSelected="check"===e,t[r.htmlAttributes["data-memberId"]]=r.htmlAttributes["data-memberId"];for(var r,n=0,s=this.parent.pivotCommon.currentTreeItems;n<s.length;n++)void 0!==t[(r=s[n]).htmlAttributes["data-memberId"]]&&(r.isSelected="check"===e,this.parent.pivotCommon.currentTreeItemsPos[r.htmlAttributes["data-memberId"]].isSelected="check"===e)},C.prototype.updateNodeStates=function(e,t){var i=this.parent.pivotCommon.engineModule.fieldList[t],a=i.members,r=i.currrentMembers;if(0<i.searchMembers.length){for(var n=0,s=Object.keys(r);n<s.length;n++)r[h=s[n]]&&(r[h].isSelected=!1),a[h]&&(a[h].isSelected=!1,this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+h+'"]'))&&(o=this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+h+'"]'))&&!o.querySelector("ul")&&this.parent.pivotCommon.eventBase.updateChildNodeStates(i.filterMembers,t,h,!1);for(var o,l=0,d=e;l<d.length;l++)a[c=d[l]]&&this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+c+'"]')&&(o=this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+c+'"]'))&&!o.querySelector("ul")&&(a[c].isSelected=!0,this.parent.pivotCommon.eventBase.updateChildNodeStates(i.filterMembers,t,c,!0)),r[c]&&(r[c].isSelected=!0)}else{for(var h,p=0,u=Object.keys(a);p<u.length;p++)a[h=u[p]].isSelected&&(a[h].isSelected=!1);for(var c,g=0,m=e;g<m.length;g++)a[c=m[g]]&&(a[c].isSelected=!0,this.parent.pivotCommon.eventBase.updateChildNodeStates(i.filterMembers,t,c,!0))}},C.prototype.updateFilterState=function(n){var s=this,o=!1,l={items:[],name:n,type:"Include"},e="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule;if("olap"===this.parent.dataType&&e&&!e.fieldList[n].isHierarchy){var t=e.fieldList[n].members,i=e.fieldList[n].currrentMembers;l.items=this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes(),l.levelCount=e.fieldList[n].levelCount,o=l.items.length!==this.parent.pivotCommon.filterDialog.memberTreeView.fields.dataSource.length,0<e.fieldList[n].searchMembers.length&&!o&&(g=Object.keys(t).length,o=g!==Object.keys(i).length||g!==l.items.length);for(var a=0,r=l.items;a<r.length;a++){var d=r[a];0<e.fieldList[n].searchMembers.length&&i[d]?i[d].isSelected=!0:t[d]&&(t[d].isSelected=!0)}}else{for(var h=0,p=this.parent.pivotCommon.searchTreeItems;h<p.length;h++){var u=p[h];u.isSelected&&(this.parent.pivotCommon.isDateField?l.items.push("Server"===this.parent.dataSourceSettings.mode?u.actualText:u.name):l.items.push(u.htmlAttributes["data-memberId"]))}o=l.items.length!==this.parent.pivotCommon.currentTreeItems.length}if("olap"===this.parent.dataType&&this.removeDataSourceSettings(n),this.parent.allowDeferLayoutUpdate){e.fieldList[l.name].filterType=l.type.toLowerCase(),e.fieldList[l.name].filter=[];for(var c=0;c<l.items.length;c++)e.fieldList[l.name].filter.push(l.items[c])}var g={filterSettings:l,dataSourceSettings:Ie.getClonedDataSourceSettings(this.parent.dataSourceSettings),cancel:!1};("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(Cr,g,function(e){if(l=e.filterSettings,!e.cancel){if(Ie.getFilterItemByName(n,s.parent.dataSourceSettings.filterSettings))for(var t=0;t<s.parent.dataSourceSettings.filterSettings.length;t++)if(s.parent.dataSourceSettings.filterSettings[t].name===n){s.parent.dataSourceSettings.filterSettings.splice(t,1);break}s.parent.dataSourceSettings.filterSettings.push(l)}s.parent.pivotCommon.filterDialog.dialogPopUp.close(),e.cancel||(s.refreshPivotButtonState(n,o),o||(s.removeDataSourceSettings(n),l={}),s.parent.lastFilterInfo=l,e={filterInfo:s.parent.lastFilterInfo},s.parent.actionObj.actionInfo=e,s.updateDataSource(!0),(e=s).parent instanceof ap&&e.axisField.render());for(var i=0,a=[].slice.call(s.parentElement.querySelectorAll(".e-pivot-button"));i<a.length;i++){var r=a[i];if(r.getAttribute("data-uid")===n){r.focus();break}}})},C.prototype.refreshPivotButtonState=function(e,t){for(var i,a=0,r=[].slice.call(this.parentElement.querySelectorAll(".e-pivot-button"));a<r.length;a++){var n=r[a];if(n.getAttribute("data-uid")===e){i=n.querySelector("."+ve);break}}i&&(t?(_e.removeClass([i],ye),_e.addClass([i],be)):(_e.removeClass([i],be),_e.addClass([i],ye)))},C.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--}},C.prototype.updateDropIndicator=function(e){this.parent.isDragging&&(_e.removeClass([].slice.call(this.parentElement.querySelectorAll("."+Te+"-last")),Me),_e.removeClass([].slice.call(this.parentElement.querySelectorAll("."+Te)),Me),_e.closest(e.target,"."+qe))&&(e=_e.closest(e.target,"."+pe),_e.addClass([e.querySelector("."+Te)],Me))},C.prototype.wireEvent=function(e,t,i){_e.EventHandler.add(e,"mouseover",this.updateDropIndicator,this),i||(-1===["filters","values"].indexOf(t)&&null!==e.querySelector("."+Y)&&_e.EventHandler.add(e.querySelector("."+Y),"click",this.updateSorting,this),"values"!==t&&null!==e.querySelector("."+ve)&&_e.EventHandler.add(e.querySelector("."+ve),"click",this.updateFiltering,this),"values"===t&&null!==e.querySelector("."+B)&&_e.EventHandler.add(e.querySelector("."+B),"click",this.createMenuOption,this)),null!==e.querySelector("."+Jt)&&_e.EventHandler.add(e.querySelector("."+Jt),"click",this.openCalculatedFieldDialog,this),null!==e.querySelector("."+Ce)&&_e.EventHandler.add(e.querySelector("."+Ce),"click",this.removeButton,this)},C.prototype.unWireEvent=function(e,t,i){_e.EventHandler.remove(e,"mouseover",this.updateDropIndicator),i||(-1===["filters","values"].indexOf(t)&&null!==e.querySelector("."+Y)&&_e.EventHandler.remove(e.querySelector("."+Y),"click",this.updateSorting),"values"!==t&&null!==e.querySelector("."+ve)&&_e.EventHandler.remove(e.querySelector("."+ve),"click",this.updateFiltering),"values"===t&&null!==e.querySelector("."+B)&&_e.EventHandler.remove(e.querySelector("."+B),"click",this.createMenuOption)),null!==e.querySelector("."+Jt)&&_e.EventHandler.remove(e.querySelector("."+Jt),"click",this.openCalculatedFieldDialog),null!==e.querySelector("."+Ce)&&_e.EventHandler.remove(e.querySelector("."+Ce),"click",this.removeButton)},C.prototype.addEventListener=function(){this.handlers={load:this.renderPivotButton},this.parent.isDestroyed||this.parent.on(_r,this.handlers.load,this)},C.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(_r,this.handlers.load)},C.prototype.destroy=function(){this.removeEventListener(),this.cleanupButtonElements(),this.menuOption&&(this.menuOption.destroy(),this.menuOption=null),this.cleanupDropdowns(),this.draggable&&!this.draggable.isDestroyed&&(this.draggable.destroy(),this.draggable=null);var e=document.getElementById(this.parent.element.id+"_DragClone");e&&_e.remove(e),this.axisField&&(this.axisField=null),this.handlers=null,this.isDestroyed=!0},C.prototype.cleanupButtonElements=function(){if(this.parentElement="pivotview"===this.parent.getModuleName()?this.parent.element:document.getElementById(this.parent.element.id+"_Container"),this.parentElement){var e=this.parentElement.querySelectorAll("."+pe);if(e&&0<e.length)for(var t=0;t<e.length;t++){var i,a=e[t],a=(_e.EventHandler.remove(a,"mouseover",this.updateDropIndicator),a.querySelector("."+Y));a&&(_e.EventHandler.remove(a,"click",this.updateSorting),(i=_e.getInstance(a,z.Button))&&!i.isDestroyed&&(i.destroy(),i=null),a.remove(),a=null)}}},C.prototype.cleanupDropdowns=function(){var e;this.parentElement&&((e=_e.select("."+Ai,this.parentElement))&&(e=_e.getInstance(e,G.DropDownList))&&!e.isDestroyed&&e.destroy(),e=_e.select("."+Ri,this.parentElement))&&(e=_e.getInstance(e,G.DropDownList))&&!e.isDestroyed&&e.destroy()};var Xh=C;function C(e){this.parent=e,this.menuOption=new Rs(this.parent),(this.parent.pivotButtonModule=this).addEventListener(),this.parent instanceof ap&&(this.axisField=new Jh(this.parent)),this.isDestroyed=!1}Zh.prototype.render=function(){(!this.parent.pivotButtonModule||this.parent.pivotButtonModule&&this.parent.pivotButtonModule.isDestroyed)&&new Xh(this.parent),this.parent.pivotButtonModule.cleanupButtonElements(),this.createPivotButtons()},Zh.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("."+$+"-filters")&&(t.querySelector("."+$+"-filters").querySelector("."+de).innerHTML=""),t.querySelector("."+$+"-rows")&&(t.querySelector("."+$+"-rows").querySelector("."+de).innerHTML=""),t.querySelector("."+$+"-columns")&&(t.querySelector("."+$+"-columns").querySelector("."+de).innerHTML=""),t.querySelector("."+$+"-values")&&(t.querySelector("."+$+"-values").querySelector("."+de).innerHTML=""),"pivot"===this.parent.dataType&&this.parent.dataSourceSettings.dataSource&&(!(this.parent.dataSourceSettings.dataSource instanceof ce.DataManager)&&0<this.parent.dataSourceSettings.dataSource.length||this.parent.dataSourceSettings.dataSource instanceof ce.DataManager&&this.parent.engineModule.data&&0<this.parent.engineModule.data.length)||"olap"===this.parent.dataType&&this.parent.dataSourceSettings.url&&""!==this.parent.dataSourceSettings.url||"Server"===this.parent.dataSourceSettings.mode&&""!==this.parent.dataSourceSettings.url)for(var i,a=["rows","columns","values","filters"],r=0,n=e.length;r<n;r++)e[r]&&(i={field:e[r],axis:a[r].toString()},this.parent.notify(_r,i))},Zh.prototype.destroy=function(){var e=this.parent.dialogRenderer.parentElement;if(e)for(var t=0,i=["."+$+"-filters","."+$+"-rows","."+$+"-columns","."+$+"-values"];t<i.length;t++){var a=e.querySelector(i[t]);a&&a.querySelector("."+de)&&(a.querySelector("."+de).innerHTML="")}};var Jh=Zh;function Zh(e){this.parent=e}ep.prototype.render=function(){this.parent.dialogRenderer.render(),this.parent.isAdaptive||this.parent.treeViewModule.render(),this.parent.axisTableModule.render()};var $h=ep;function ep(e){this.parent=e,this.parent.dialogRenderer=new zh(this.parent),this.parent.treeViewModule=new Qh(this.parent),this.parent.axisTableModule=new Yh(this.parent),this.parent.axisFieldModule=new Jh(this.parent)}tp=function(e,t){return(tp=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])}))(e,t)};var tp,ip,fl=function(e,t){function i(){this.constructor=e}tp(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},h=function(e,t,i,a){var r,n=arguments.length,s=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(n<3?r(s):3<n?r(t,i,s):r(t,i))||s);return 3<n&&s&&Object.defineProperty(t,i,s),s},ap=(ip=_e.Component,fl(x,ip),x.prototype.requiredModules=function(){var e=[];return this.allowCalculatedField&&e.push({args:[this],member:"calculatedField"}),e},x.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"]},x.prototype.preRender=function(){this.dataSourceSettings&&"SSAS"===this.dataSourceSettings.providerType?(this.olapEngineModule=new gh,this.dataType="olap"):(this.engineModule=new ia,this.dataType="pivot"),this.isAdaptive=_e.Browser.isDevice,this.globalize=new _e.Internationalization(this.locale),this.renderModule=new $h(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 _e.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.isDragging=!1,this.isDeferLayoutUpdate=_e.isNullOrUndefined(this.isDeferLayoutUpdate)&&!this.isPopupView?this.allowDeferLayoutUpdate:this.isDeferLayoutUpdate,this.wireEvent()},x.prototype.frameCustomProperties=function(e,t){this.pivotGridModule&&this.pivotGridModule.updatePageSettings(!1);var i=!!this.pivotGridModule&&this.pivotGridModule.isTabular,a=(this.pivotGridModule||this).pageSettings,r=!!this.pivotGridModule&&this.pivotGridModule.enablePaging,n=!!this.pivotGridModule&&this.pivotGridModule.enableVirtualization,s=(this.pivotGridModule||this).enableHtmlSanitizer,o=(this.pivotGridModule||this.staticPivotGridModule||this).localeObj,l=!this.pivotGridModule||this.pivotGridModule.allowDrillThrough||this.pivotGridModule.editSettings.allowEditing,d=(this.pivotGridModule||this.staticPivotGridModule||this).enableValueSorting,h=!(!this.pivotGridModule||!this.pivotGridModule.allowDataCompression)&&this.pivotGridModule.allowDataCompression,p=this.pivotGridModule&&this.pivotGridModule.enableVirtualization&&this.pivotGridModule.virtualScrollSettings&&this.pivotGridModule.virtualScrollSettings.allowSinglePage,t="olap"===this.dataType?{mode:"",savedFieldList:t||void 0,savedFieldListData:e||void 0,pageSettings:a,enableValueSorting:d,isDrillThrough:l,localeObj:o,enableVirtualization:n,allowDataCompression:h}:{mode:"",savedFieldList:void 0,pageSettings:a,enableValueSorting:d,isDrillThrough:l,localeObj:o,clonedReport:this.clonedReport,globalize:this.globalize,currenyCode:this.currencyCode,enablePaging:r,enableVirtualization:n,enableHtmlSanitizer:s,allowDataCompression:h,enableOptimizedRendering:p,isTabularLayout:i};return t},x.prototype.render=function(){"pivot"===this.dataType&&this.dataSourceSettings.url&&""!==this.dataSourceSettings.url?"Server"===this.dataSourceSettings.mode?(this.guid=Ie.generateUUID(),this.initialLoad()):new _e.Fetch(this.dataSourceSettings.url,"GET").send().then(function(e){return"string"==typeof e?e:e.text()}).then(this.onReadyStateChange.bind(this)):this.initialLoad()},x.prototype.getEngine=function(e,t,i,a,r,n,s,o,l){for(var d=this,h=(this.currentAction=e,this.pivotGridModule&&this.pivotGridModule.updatePageSettings(!1),{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(Ie.getLocalizedObject(this)),savedFieldList:"onDrop"===e&&null!==this.engineModule.fieldList?Ie.getClonedFieldList(this.engineModule.fieldList,!0):void 0,enableOptimizedRendering:this.pivotGridModule&&this.pivotGridModule.enableVirtualization&&this.pivotGridModule.virtualScrollSettings&&this.pivotGridModule.virtualScrollSettings.allowSinglePage,requestType:"string",headers:{"Content-type":"application/json"},enablePaging:this.pivotGridModule&&this.pivotGridModule.enablePaging,enableVirtualization:this.pivotGridModule&&this.pivotGridModule.enableVirtualization,allowDataCompression:this.pivotGridModule&&this.pivotGridModule.allowDataCompression,isTabular:this.pivotGridModule&&this.pivotGridModule.isTabular}),p=(this.request.readyState!==XMLHttpRequest.UNSENT&&this.request.readyState!==XMLHttpRequest.OPENED||(this.request.withCredentials=!1),{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:s,fetchRawDataArgs:o,editArgs:l,hash:(this.pivotGridModule||this.staticPivotGridModule||this).guid,isGroupingUpdated:"onRefresh"===this.currentAction&&0<this.dataSourceSettings.groupSettings.length||!(!this.pivotGridModule||!this.pivotGridModule.groupingModule)&&this.pivotGridModule.groupingModule.isUpdate}),u=((this.isPopupView?this.pivotGridModule:this).trigger(Nr,p,function(e){d.request=e.request,p.internalProperties=e.internalProperties,p.customProperties=e.customProperties,p.dataSourceSettings=e.dataSourceSettings,p.calculatedItem=e.calculatedItem,p.drillItem=e.drillItem,p.editArgs=e.editArgs,p.fetchRawDataArgs=e.fetchRawDataArgs,p.filterItem=e.filterItem,p.hash=e.hash,p.memberName=e.memberName,p.sortItem=e.sortItem}),this.request.open("POST",this.dataSourceSettings.url,!0),this.request.onreadystatechange=this.onSuccess.bind(this),Object.keys(p.internalProperties.headers)),c=0;c<u.length;c++){var g=u[c],m=String(p.internalProperties.headers[g]);this.request.setRequestHeader(g,m)}"string"===p.internalProperties.requestType?this.request.send(JSON.stringify(p)):"base64"===p.internalProperties.requestType&&this.request.send(btoa(JSON.stringify(p)))},x.prototype.onSuccess=function(){if(this.request.readyState===XMLHttpRequest.DONE){try{var e={action:this.currentAction,response:this.request.responseText},t=((this.isPopupView?this.pivotGridModule:this).trigger(Er,e),JSON.parse(this.request.responseText));if("fetchFieldMembers"===this.currentAction){for(var i=JSON.parse(t.members),a=[],r={},n=(this.engineModule.globalize=_e.isNullOrUndefined(this.globalize)?new _e.Internationalization:this.globalize,this.engineModule.formatFields=this.engineModule.setFormattedFields(this.dataSourceSettings.formatSettings),Ie.isDateField(t.memberName,this.engineModule)),s="number"===this.engineModule.fieldList[t.memberName].type,o=Object.keys(i),l=0,d=o.length;l<d;l++){var h=i[o[l]],p=n?this.engineModule.getFormattedValue(h.Name,t.memberName):{formattedText:h.Caption};r[o[l]]={index:h.Index,ordinal:h.Ordinal,isDrilled:h.IsDrilled,caption:p.formattedText},a.push({formattedText:p.formattedText,actualText:n?p.actualText:!s||isNaN(Number(h.Name))?h.Name:Number(h.Name)})}this.engineModule.fieldList[t.memberName].members=r,this.engineModule.fieldList[t.memberName].dateMember=a,this.pivotButtonModule.updateFilterEvents()}else{var u=JSON.parse(t.fieldList);if(this.engineModule.fieldList)for(o=Object.keys(this.engineModule.fieldList),l=0;l<o.length;l++)this.engineModule.fieldList[o[l]]&&u[o[l]]&&(u[o[l]].dateMember=this.engineModule.fieldList[o[l]].dateMember,u[o[l]].formattedMembers=this.engineModule.fieldList[o[l]].formattedMembers,u[o[l]].members=this.engineModule.fieldList[o[l]].members);this.engineModule.fieldList=u,this.engineModule.fields=JSON.parse(t.fields),this.engineModule.rowCount=JSON.parse(t.pivotCount).RowCount,this.engineModule.columnCount=JSON.parse(t.pivotCount).ColumnCount,this.engineModule.rowStartPos=JSON.parse(t.pivotCount).RowStartPosition,this.engineModule.colStartPos=JSON.parse(t.pivotCount).ColumnStartPosition,this.engineModule.rowFirstLvl=JSON.parse(t.pivotCount).RowFirstLevel,this.engineModule.colFirstLvl=JSON.parse(t.pivotCount).ColumnFirstLevel,this.engineModule.rowMaxLevel=JSON.parse(t.pivotCount).RowMaxLevel,this.pivotGridModule&&this.pivotGridModule.enablePaging&&(this.engineModule.rowPageCount=JSON.parse(t.pivotCount).RowPageCount,this.engineModule.columnPageCount=JSON.parse(t.pivotCount).ColumnPageCount);for(var c=void 0,g=JSON.parse(t.pivotValue),m=0;m<g.length;m++)if(g[m]&&g[m][0]&&"row"===g[m][0].axis){c=m;break}this.engineModule.headerContent=Ie.frameContent(g,"header",c,this),this.engineModule.pageSettings=this.pivotGridModule?this.pivotGridModule.pageSettings:void 0;var S=JSON.parse(t.dataSourceSettings).valueSortSettings;this.engineModule.valueSortSettings={headerText:S.headerText,headerDelimiter:S.headerDelimiter,sortOrder:S.sortOrder,columnIndex:S.columnIndex},this.engineModule.pivotValues=g,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)}},x.prototype.onReadyStateChange=function(e){var t=[];if("CSV"===this.dataSourceSettings.type)for(var i=e.split(/\r?\n|\r/),a=0;a<i.length;a++)_e.isNullOrUndefined(i[a])||""===i[a]||t.push(i[a].split(","));else try{t=JSON.parse(e)}catch(e){t=[]}t&&0<t.length&&this.setProperties({dataSourceSettings:{dataSource:t}},!0),this.initialLoad()},x.prototype.initialLoad=function(){var t=this,i={dataSourceSettings:this.dataSourceSettings,defaultFieldListOrder:this.defaultFieldListOrder};this.trigger(aa,i,function(e){t.dataSourceSettings=e.dataSourceSettings,t.defaultFieldListOrder=i.defaultFieldListOrder,_e.addClass([t.element],F),t.enableRtl?_e.addClass([t.element],L):_e.removeClass([t.element],L),t.isAdaptive?_e.addClass([t.element],A):_e.removeClass([t.element],A),t.cssClass&&_e.addClass([t.element],t.cssClass.split(" ")),t.notify(Ar,{})})},x.prototype.wireEvent=function(){this.on(Ar,this.generateData,this),this.on(Hr,this.fieldListRender,this)},x.prototype.unWireEvent=function(){this.pivotGridModule&&this.pivotGridModule.isDestroyed||(this.off(Ar,this.generateData),this.off(Hr,this.fieldListRender))},x.prototype.getPersistData=function(){return this.addOnPersist(["dataSourceSettings"])},x.prototype.getModuleName=function(){return"pivotfieldlist"},x.prototype.onPropertyChanged=function(e,t){for(var i=!1,a=0,r=Object.keys(e);a<r.length;a++){var n,s,o,l,d,h=r[a];switch(h){case"locale":ip.prototype.refresh.call(this);break;case"dataSourceSettings":e.dataSourceSettings&&(!_e.isNullOrUndefined(e.dataSourceSettings.dataSource)&&this.clonedDataSet!==e.dataSourceSettings.dataSource&&e.dataSourceSettings.groupSettings||1===Object.keys(e.dataSourceSettings).length&&"dataSource"===Object.keys(e.dataSourceSettings)[0]&&0<this.dataSourceSettings.groupSettings.length)&&(this.clonedDataSet=e.dataSourceSettings.dataSource,this.engineModule.groupingFields={}),e.dataSourceSettings&&1===Object.keys(e.dataSourceSettings).length&&e.dataSourceSettings.groupSettings&&"pivot"===this.dataType&&(n=this.isPopupView?this.pivotGridModule:this.staticPivotGridModule)&&n.updateGroupingReport(e.dataSourceSettings.groupSettings,"Date"),_e.isNullOrUndefined(e.dataSourceSettings.dataSource)&&("olap"!==this.dataType||_e.isNullOrUndefined(e.dataSourceSettings.url))||("olap"!==this.dataType&&(_e.isNullOrUndefined(this.savedDataSourceSettings)||(Ie.updateDataSourceSettings(this.staticPivotGridModule,this.savedDataSourceSettings),this.savedDataSourceSettings=void 0),e.dataSourceSettings.dataSource)&&0===e.dataSourceSettings.dataSource.length&&!_e.isNullOrUndefined(this.staticPivotGridModule)&&(this.savedDataSourceSettings=Ie.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),_e.isNullOrUndefined(this.staticPivotGridModule)||(this.staticPivotGridModule.pivotValues=[]),this.initialLoad()),Ie.isButtonIconRefesh(h,t,e)?(this.isPopupView&&this.pivotGridModule&&this.pivotGridModule.showGroupingBar&&this.pivotGridModule.groupingBarModule?(d=Ie.cloneFieldSettings(this.dataSourceSettings.filters),l=Ie.cloneFieldSettings(this.dataSourceSettings.values),s=Ie.cloneFieldSettings(this.dataSourceSettings.rows),o=Ie.cloneFieldSettings(this.dataSourceSettings.columns),this.pivotGridModule.setProperties({dataSourceSettings:{rows:s,columns:o,values:l,filters:d}},!0),this.pivotGridModule.axisFieldModule.render()):this.isPopupView||!this.staticPivotGridModule||this.staticPivotGridModule.isDestroyed||((n=this.staticPivotGridModule).showGroupingBar&&n.groupingBarModule&&n.axisFieldModule.render(),n.showFieldList&&n.pivotFieldListModule&&(s=Ie.cloneFieldSettings(n.dataSourceSettings.rows),o=Ie.cloneFieldSettings(n.dataSourceSettings.columns),l=Ie.cloneFieldSettings(n.dataSourceSettings.values),d=Ie.cloneFieldSettings(n.dataSourceSettings.filters),n.pivotFieldListModule.setProperties({dataSourceSettings:{rows:s,columns:o,values:l,filters:d}},!0),n.pivotFieldListModule.axisFieldModule.render(),n.pivotFieldListModule.treeViewModule.fieldTable)&&!n.isAdaptive&&n.pivotFieldListModule.notify(Ur,{})),this.axisFieldModule.render(),this.treeViewModule.fieldTable&&!this.isAdaptive&&this.notify(Ur,{})):(this.remoteData=[],"pivot"===this.dataType&&this.dataSourceSettings.url&&""!==this.dataSourceSettings.url&&("type"in e.dataSourceSettings||"url"in e.dataSourceSettings)&&(this.engineModule.fieldList=null,this.render()));break;case"aggregateTypes":this.axisFieldModule&&this.axisFieldModule.render(),this.pivotGridModule&&this.pivotGridModule.axisFieldModule&&(this.pivotGridModule.setProperties({aggregateTypes:e.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:e.showValuesButton},!0),this.pivotGridModule.axisFieldModule.render());break;case"enableRtl":this.enableRtl?_e.addClass([this.element],L):_e.removeClass([this.element],L),i=!0;break;case"enableFieldSearching":case"allowCalculatedField":this.refresh();break;case"allowDeferLayoutUpdate":this.isDeferLayoutUpdate=this.allowDeferLayoutUpdate,this.fieldListRender(),this.pivotGridModule&&this.pivotGridModule.showGroupingBar&&this.pivotGridModule.groupingBarModule&&this.pivotGridModule.showFieldList&&this.pivotGridModule.groupingBarModule.alignIcon()}i&&this.fieldListRender()}},x.prototype.initEngine=function(){var r=this;if("pivot"===this.dataType){var e=_e.isNullOrUndefined(this.dataSourceSettings.dataSource)?_e.isNullOrUndefined(this.engineModule.data)?void 0:this.engineModule.data[0]:this.dataSourceSettings.dataSource[0];if(e&&this.pivotCommon){e="[object Array]"===Object.prototype.toString.call(e);if(e&&"JSON"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidJSON"));if(!e&&"CSV"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidCSV"))}}var e={dataSourceSettings:Ie.getClonedDataSourceSettings(this.dataSourceSettings)},n=this.isPopupView?this.pivotGridModule:this;n.trigger(ra,e,function(e){var t,i,a;Ie.updateDataSourceSettings(r,e.dataSourceSettings),"pivot"===r.dataType?(r.dataSourceSettings.groupSettings&&0<r.dataSourceSettings.groupSettings.length&&(e=r.engineModule.data,r.clonedDataSet=r.clonedDataSet||("CSV"===r.dataSourceSettings.type?Ie.getClonedCSVData(e):Ie.getClonedData(e)),(e=JSON.parse(r.getPersistData()).dataSourceSettings).dataSource=[],r.clonedReport=r.clonedReport||e),(e=r.frameCustomProperties()).enableValueSorting=(r.staticPivotGridModule||r).enableValueSorting,"Server"!==r.dataSourceSettings.mode&&r.engineModule.renderEngine(r.dataSourceSettings,e,r.aggregateCellInfo?r.getValueCellInfo.bind(r):void 0,r.onHeadersSort?r.getHeaderSortInfo.bind(r):void 0),r.pivotFieldList=r.engineModule.fieldList,i={pivotFieldList:r.pivotFieldList,pivotValues:r.engineModule.pivotValues},t=r,n.trigger(na,i,function(e){t.pivotFieldList=e.pivotFieldList,t.engineModule.pivotValues=e.pivotValues,t.notify(Hr,{}),t.trigger(ma)})):"olap"===r.dataType&&(Ie.renderOlapEngine(r),r.pivotFieldList=r.olapEngineModule.fieldList,i={pivotFieldList:r.pivotFieldList,pivotValues:r.olapEngineModule.pivotValues},a=r,n.trigger(na,i,function(e){a.pivotFieldList=e.pivotFieldList,a.olapEngineModule.pivotValues=e.pivotValues,a.notify(Hr,{}),a.trigger(ma)}))}),"None"!==this.defaultFieldListOrder&&this.treeViewModule.fieldTable&&!this.isAdaptive&&this.notify(Ur,{})},x.prototype.generateData=function(){this.pivotFieldList={},this.dataSourceSettings&&(this.dataSourceSettings.dataSource||this.dataSourceSettings.url)?""!==this.dataSourceSettings.url&&"olap"===this.dataType||!_e.isNullOrUndefined(this.dataSourceSettings.dataSource)&&0<this.dataSourceSettings.dataSource.length?("pivot"===this.dataType&&(this.engineModule.data=this.dataSourceSettings.dataSource),this.initEngine()):this.dataSourceSettings.dataSource instanceof ce.DataManager?"pivot"===this.dataType&&0<this.remoteData.length?(this.engineModule.data=this.remoteData,this.initEngine()):setTimeout(this.getData.bind(this),100):"Server"===this.dataSourceSettings.mode?this.getEngine("onRefresh"):this.notify(Hr,{}):(this.notify(Hr,{}),this.trigger(ma))},x.prototype.getValueCellInfo=function(e){return this.trigger(gr,e),e},x.prototype.getHeaderSortInfo=function(e){return this.trigger(mr,e),e},x.prototype.getData=function(){(this.dataSourceSettings.dataSource.defaultQuery?this.dataSourceSettings.dataSource.executeQuery(this.dataSourceSettings.dataSource.defaultQuery):this.dataSourceSettings.dataSource.executeQuery(new ce.Query)).then(this.executeQuery.bind(this))},x.prototype.executeQuery=function(e){this.engineModule.data=e.result,this.initEngine()},x.prototype.fieldListRender=function(){this.element.innerHTML="","Popup"===this.renderMode&&this.dialogRenderer&&this.dialogRenderer.fieldListDialog&&!this.dialogRenderer.fieldListDialog.isDestroyed&&(e=this.dialogRenderer.fieldListDialog.visible,this.dialogRenderer.fieldListDialog.destroy(),_e.remove(document.getElementById(this.element.id+"_Container"))),this.renderModule.render(),"Popup"===this.renderMode&&this.dialogRenderer?(this.fieldListSpinnerElement=this.dialogRenderer.fieldListDialog.element,e&&this.dialogRenderer.fieldListDialog.show()):this.fieldListSpinnerElement=this.element.querySelector(".e-pivotfieldlist-container"),this.spinnerTemplate?P.createSpinner({target:this.fieldListSpinnerElement,template:this.spinnerTemplate,cssClass:this.cssClass||void 0},this.createElement):P.createSpinner({target:this.fieldListSpinnerElement,cssClass:this.cssClass||void 0},this.createElement);var e={pivotEngine:"olap"===this.dataType?this.olapEngineModule:this.engineModule,dataSourceSettings:this.dataSourceSettings,id:this.element.id,element:"Popup"===this.renderMode&&this.dialogRenderer?this.dialogRenderer.fieldListDialog.element:_e.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},e=(this.pivotCommon=new Xs(e),(this.pivotCommon.control=this).allowDeferLayoutUpdate&&(this.clonedDataSource=Ie.getClonedDataSourceSettings(this.dataSourceSettings),"olap"===this.dataType&&(this.clonedFieldListData=Ie.cloneOlapFieldSettings(this.olapEngineModule.fieldListData)),this.clonedFieldList=Ie.getClonedFieldList(this.pivotFieldList)),this.isPopupView?this.pivotGridModule:this.staticPivotGridModule);e&&e.toolbarModule&&Ie.toggleFieldListIconVisibility(e)},x.prototype.getFieldCaption=function(e){var t=this.getFields(e),i="olap"===this.dataType?this.olapEngineModule:this.engineModule;if(0<t.length&&i&&i.fieldList)for(var a=t.length;a--;)if(t[a])for(var r=0,n=t[a];r<n.length;r++){var s=n[r];s&&i.fieldList[s.name]&&(s.caption?i.fieldList[s.name].caption=s.caption:i.fieldList[s.name].caption=s.name)}},x.prototype.getFields=function(e){return[e.rows,e.columns,e.values,e.filters]},x.prototype.updateDataSource=function(i,a){var r=this,n=(this.pivotGridModule&&this.pivotGridModule.showWaitingPopup(),P.showSpinner(this.fieldListSpinnerElement),this),s=n.isPopupView?n.pivotGridModule:n,o=!1,l=n.pivotGridModule&&(n.pivotGridModule.enableVirtualization||n.pivotGridModule.enablePaging)?n.pivotGridModule.pageSettings:void 0,d=0<Object.keys(n.lastCalcFieldInfo).length,h=0<Object.keys(n.lastSortInfo).length,p=0<Object.keys(n.lastAggregationInfo).length,u=0<Object.keys(n.lastFilterInfo).length,e={dataSourceSettings:Ie.getClonedDataSourceSettings(n.dataSourceSettings)};s.trigger(ra,e,function(e){var t;l&&(h||u||p||d)||(Ie.updateDataSourceSettings(n,e.dataSourceSettings),Ie.updateDataSourceSettings(n.pivotGridModule,e.dataSourceSettings)),_e.isNullOrUndefined(a)?(e=!h&&(n.pivotGridModule||n.staticPivotGridModule||n).enableValueSorting,!h||""===n.dataSourceSettings.valueSortSettings.headerText&&""===n.dataSourceSettings.valueSortSettings.rowHeaderText&&""===n.dataSourceSettings.valueSortSettings.columnHeaderText||(n.pivotGridModule&&n.pivotGridModule.setProperties({dataSourceSettings:{valueSortSettings:{headerText:"",rowHeaderText:"",columnHeaderText:""}}},!0),n.setProperties({dataSourceSettings:{valueSortSettings:{headerText:"",rowHeaderText:"",columnHeaderText:""}}},!0)),"pivot"===n.dataType?((t=n.frameCustomProperties()).enableValueSorting=e,t.savedFieldList=n.pivotFieldList,l&&(h||u||p||d)&&!n.allowDeferLayoutUpdate?(h&&("Server"===s.dataSourceSettings.mode?s.getEngine("onSort",null,n.lastSortInfo,null,null,null,null):n.engineModule.onSort(n.lastSortInfo),n.lastSortInfo={}),u&&("Server"===s.dataSourceSettings.mode?s.getEngine("onFilter",null,null,null,null,n.lastFilterInfo,null):n.engineModule.onFilter(n.lastFilterInfo,n.dataSourceSettings),n.lastFilterInfo={}),p&&("Server"===s.dataSourceSettings.mode?s.getEngine("onAggregation",null,null,n.lastAggregationInfo,null,null,null):n.engineModule.onAggregation(n.lastAggregationInfo),n.lastAggregationInfo={}),d&&("Server"===s.dataSourceSettings.mode?s.getEngine("onCalcOperation",null,null,null,n.lastCalcFieldInfo,null,null):n.engineModule.onCalcOperation(n.lastCalcFieldInfo,n.dataSourceSettings),n.lastCalcFieldInfo={})):("Server"===n.dataSourceSettings.mode?h?n.getEngine("onSort",null,n.lastSortInfo,null,null,null,null):p?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,t,n.aggregateCellInfo?n.getValueCellInfo.bind(n):void 0,n.onHeadersSort?n.getHeaderSortInfo.bind(n):void 0),n.lastSortInfo={},n.lastAggregationInfo={},n.lastCalcFieldInfo={},n.lastFilterInfo={})):o=n.updateOlapDataSource(n,h,d,o,e,u),n.getFieldCaption(n.dataSourceSettings)):(n.axisFieldModule.render(),n.pivotGridModule&&n.pivotGridModule.notify(Rr,n),n.isRequiredUpdate=!1),"Server"===n.dataSourceSettings.mode&&i?(n.allowDeferLayoutUpdate&&!n.isRequiredUpdate||n.isRequiredUpdate)&&(P.hideSpinner(r.fieldListSpinnerElement),r.pivotGridModule)&&r.pivotGridModule.hideWaitingPopup():n.enginePopulatedEventMethod(n,i,o)})},x.prototype.enginePopulatedEventMethod=function(t,i,a){var r=this,e=t.isPopupView?t.pivotGridModule:t,n={dataSourceSettings:t.dataSourceSettings,pivotFieldList:("pivot"===t.dataType?t.engineModule:t.olapEngineModule).fieldList,pivotValues:("pivot"===t.dataType?t.engineModule:t.olapEngineModule).pivotValues},e=(e.trigger(na,n,function(e){t.dataSourceSettings=e.dataSourceSettings,t.pivotCommon.dataSourceSettings=t.dataSourceSettings,t.pivotFieldList=e.pivotFieldList,"olap"===t.dataType?(t.olapEngineModule.pivotValues=e.pivotValues,t.pivotCommon.engineModule=t.olapEngineModule):(t.engineModule.pivotValues=e.pivotValues,t.pivotCommon.engineModule=t.engineModule),i||!t.treeViewModule.fieldTable||t.isAdaptive||t.notify(Ur,{}),t.isRequiredUpdate?(t.allowDeferLayoutUpdate&&(t.clonedDataSource=Ie.getClonedDataSourceSettings(t.dataSourceSettings),"olap"===r.dataType&&(r.clonedFieldListData=Ie.cloneOlapFieldSettings(r.olapEngineModule.fieldListData)),t.clonedFieldList=Ie.getClonedFieldList(t.pivotFieldList)),t.updateView(t.pivotGridModule)):r.isPopupView&&(r.isDeferLayoutUpdate||t.pivotGridModule&&t.pivotGridModule.pivotDeferLayoutUpdate)&&(t.pivotGridModule.engineModule=t.engineModule,t.pivotGridModule.setProperties({dataSourceSettings:t.dataSourceSettings.properties},!0),t.pivotGridModule.notify(Rr,t),P.hideSpinner(t.fieldListSpinnerElement)),(r.isPopupView&&t.pivotGridModule&&t.pivotGridModule.allowDeferLayoutUpdate&&!t.isRequiredUpdate||!_e.isNullOrUndefined(t.pivotGridModule))&&(P.hideSpinner(t.fieldListSpinnerElement),t.pivotGridModule.hideWaitingPopup()),t.isRequiredUpdate=!0,!t.pivotGridModule||a?P.hideSpinner(t.fieldListSpinnerElement):t.pivotGridModule.fieldListSpinnerElement=t.fieldListSpinnerElement}),this.getActionCompleteName());this.actionObj.actionName=e,this.actionObj.actionName&&this.actionCompleteMethod()},x.prototype.updateOlapDataSource=function(e,t,i,a,r,n){var s=e.frameCustomProperties(e.olapEngineModule.fieldListData,e.olapEngineModule.fieldList);return s.enableValueSorting=r,s.savedFieldList=e.pivotFieldList,!i&&!t||n?Ie.renderOlapEngine(e,s):(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},x.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: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).treeViewModule.fieldTable&&!this.isAdaptive&&this.notify(Ur,{}),this.axisFieldModule.render(),!this.isPopupView)&&this.allowDeferLayoutUpdate&&(this.clonedDataSource=Ie.getClonedDataSourceSettings(this.dataSourceSettings),"olap"===this.dataType&&(this.clonedFieldListData=Ie.cloneOlapFieldSettings(this.olapEngineModule.fieldListData)),this.clonedFieldList=Ie.getClonedFieldList(this.pivotFieldList))},x.prototype.updateView=function(e){var t;e&&(t="Calculated field applied"===this.actionObj.actionName&&"olap"===e.dataType,e.element.querySelector(".e-spin-hide")&&!t&&(!this.allowDeferLayoutUpdate||this.isDeferUpdateApplied||e.isInitial&&"Chart"!==e.currentView)&&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:this.engineModule).pivotValues),t={dataSourceSettings:Ie.getClonedDataSourceSettings(e.dataSourceSettings),pivotValues:e.pivotValues},e.trigger(vr,t),this.isPopupView||!("olap"===this.dataType?this.olapEngineModule:this.engineModule).isEngineUpdated&&!this.isInitial||((this.staticPivotGridModule=e).isStaticRefresh=!0,e.isStaticFieldList=!0),this.isDeferUpdateApplied=!1,this.staticPivotGridModule&&(this.staticPivotGridModule.isServerWaitingPopup=!0),e.dataBind())},x.prototype.triggerPopulateEvent=function(){var t=this,e=this.isPopupView?this.pivotGridModule:this,i={dataSourceSettings:this.dataSourceSettings,pivotFieldList:("olap"===this.dataType?this.olapEngineModule:this.engineModule).fieldList,pivotValues:("olap"===this.dataType?this.olapEngineModule:this.engineModule).pivotValues};e.trigger(na,i,function(e){t.dataSourceSettings=e.dataSourceSettings,t.pivotFieldList=e.pivotFieldList,"olap"===t.dataType?t.olapEngineModule.pivotValues=e.pivotValues:t.engineModule.pivotValues=e.pivotValues})},x.prototype.actionBeginMethod=function(){var e={dataSourceSettings:Ie.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,cancel:!1};return(this.isPopupView?this.pivotGridModule:this).trigger(Ir,e),e.cancel},x.prototype.actionCompleteMethod=function(){var e={dataSourceSettings:Ie.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,actionInfo:this.actionObj.actionInfo};(this.isPopupView?this.pivotGridModule:this).trigger(Fr,e),this.actionObj.actionName="",this.actionObj.actionInfo=void 0,this.actionObj.fieldInfo=void 0},x.prototype.actionFailureMethod=function(e){e={actionName:this.actionObj.actionName,errorInfo:e};(this.isPopupView?this.pivotGridModule:this).trigger(Lr,e)},x.prototype.getActionCompleteName=function(){return this.actionObj.actionName===An?Bn:this.actionObj.actionName===En?ys:this.actionObj.actionName===In?bs:this.actionObj.actionName===Fn?Cs:this.actionObj.actionName===Ln?xs:this.actionObj.actionName===Hn?ws:this.actionObj.actionName===Nn?Yn:this.actionObj.actionName},x.prototype.destroy=function(){this.unWireEvent(),this.fieldListSpinnerElement&&(P.hideSpinner(this.fieldListSpinnerElement),this.fieldListSpinnerElement=null),this.request&&(this.request.abort(),this.request=null),this.contextMenuModule&&(this.contextMenuModule.destroy(),this.contextMenuModule=null),this.calculatedFieldModule&&(this.calculatedFieldModule.destroy(),this.calculatedFieldModule=null),this.pivotButtonModule&&(this.pivotButtonModule.destroy(),this.pivotButtonModule=null),this.axisFieldModule&&(this.axisFieldModule.destroy(),this.axisFieldModule=null),this.axisTableModule&&(this.axisTableModule.destroy(),this.axisTableModule=null),this.treeViewModule&&(this.treeViewModule.destroy(),this.treeViewModule=null),this.dialogRenderer&&(this.dialogRenderer.destroy(),this.dialogRenderer=null),this.renderModule&&(this.renderModule=null),this.pivotCommon&&(this.pivotCommon.destroy(),this.pivotCommon=null),this.engineModule&&!this.destroyEngine&&(this.engineModule.fieldList={},this.engineModule.rMembers=null,this.engineModule.cMembers=null,this.engineModule.valueMatrix=[],this.engineModule.pivotValues=[],this.engineModule.data=[],this.engineModule=null),this.olapEngineModule&&!this.destroyEngine&&(this.olapEngineModule.fieldList={},this.olapEngineModule.fieldListData=null,this.olapEngineModule.pivotValues=[],this.olapEngineModule=null),this.pivotFieldList&&(this.pivotFieldList=null),this.clonedDataSet=[],this.clonedDataSource={},this.clonedFieldList={},this.clonedFieldListData=[],this.clonedReport={},this.lastSortInfo={},this.lastFilterInfo={},this.lastAggregationInfo={},this.lastCalcFieldInfo={},this.remoteData=[],this.actionObj={},this.savedDataSourceSettings=null,this.localeObj=null,this.defaultLocale=null,this.globalize=null,this.pivotGridModule=null,this.staticPivotGridModule=null,this.filterTargetID=null,this.element&&(this.element.innerHTML="",_e.removeClass([this.element],F),_e.removeClass([this.element],L),_e.removeClass([this.element],A))},h([_e.Complex({},io)],x.prototype,"dataSourceSettings",void 0),h([_e.Property("Popup")],x.prototype,"renderMode",void 0),h([_e.Property()],x.prototype,"target",void 0),h([_e.Property("")],x.prototype,"cssClass",void 0),h([_e.Property(!1)],x.prototype,"enableHtmlSanitizer",void 0),h([_e.Property(!1)],x.prototype,"allowCalculatedField",void 0),h([_e.Property(!1)],x.prototype,"enableFieldSearching",void 0),h([_e.Property(!1)],x.prototype,"showValuesButton",void 0),h([_e.Property(!1)],x.prototype,"allowDeferLayoutUpdate",void 0),h([_e.Property(1e3)],x.prototype,"maxNodeLimitInMemberEditor",void 0),h([_e.Property(!0)],x.prototype,"loadOnDemandInMemberEditor",void 0),h([_e.Property()],x.prototype,"spinnerTemplate",void 0),h([_e.Property(["Sum","Count","DistinctCount","Product","Min","Max","Avg","Median","Index","PopulationVar","SampleVar","PopulationStDev","SampleStDev","RunningTotals","PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfParentColumnTotal","PercentageOfParentRowTotal","DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"])],x.prototype,"aggregateTypes",void 0),h([_e.Property("USD")],x.prototype,"currencyCode",void 0),h([_e.Event()],x.prototype,"load",void 0),h([_e.Event()],x.prototype,"enginePopulating",void 0),h([_e.Event()],x.prototype,"memberFiltering",void 0),h([_e.Event()],x.prototype,"enginePopulated",void 0),h([_e.Event()],x.prototype,"onFieldDropped",void 0),h([_e.Event()],x.prototype,"fieldDrop",void 0),h([_e.Event()],x.prototype,"fieldDragStart",void 0),h([_e.Event()],x.prototype,"aggregateCellInfo",void 0),h([_e.Event()],x.prototype,"memberEditorOpen",void 0),h([_e.Event()],x.prototype,"calculatedFieldCreate",void 0),h([_e.Event()],x.prototype,"aggregateMenuOpen",void 0),h([_e.Event()],x.prototype,"fieldRemove",void 0),h([_e.Event()],x.prototype,"dataBound",void 0),h([_e.Event()],x.prototype,"created",void 0),h([_e.Event()],x.prototype,"destroyed",void 0),h([_e.Event()],x.prototype,"beforeServiceInvoke",void 0),h([_e.Event()],x.prototype,"afterServiceInvoke",void 0),h([_e.Event()],x.prototype,"actionBegin",void 0),h([_e.Event()],x.prototype,"actionComplete",void 0),h([_e.Event()],x.prototype,"actionFailure",void 0),h([_e.Event()],x.prototype,"onHeadersSort",void 0),h([_e.NotifyPropertyChanges],x));function x(e,t){e=ip.call(this,e,t)||this;return e.pivotChange=!1,e.isRequiredUpdate=!0,e.lastSortInfo={},e.lastFilterInfo={},e.lastAggregationInfo={},e.lastCalcFieldInfo={},e.isPopupView=!1,e.enableValueSorting=!1,e.request="undefined"!=typeof window?new XMLHttpRequest:null,e.remoteData=[],e.actionObj={},e.destroyEngine=!1,e.defaultFieldListOrder="None",e.isDeferUpdateApplied=!1,e.isInitial=!0,e}var rp="Count",np="Sum",sp="DistinctCount",op="Product",lp="SampleStDev",dp="PopulationStDev",hp="SampleVar",pp="PopulationVar",up="CalculatedField",ql=(T.prototype.getModuleName=function(){return"calculatedField"},T.prototype.keyActionHandler=function(e){var t=e.currentTarget.querySelector(".e-node-focus");if(t)switch(e.action){case"moveRight":case"shiftE":"pivot"===this.parent.dataType&&this.displayMenu(t);break;case"delete":"LI"===t.tagName&&!t.querySelector(".e-list-icon.e-format")&&!t.querySelector(".e-list-icon").classList.contains(".e-icons")&&t.querySelector("."+Mi)&&t.querySelector("."+Mi).classList.contains("e-list-icon")&&this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),{},!0,t);break;case"enter":var i=t.getAttribute("data-field"),a=_e.getInstance(_e.select("#"+this.parentID+"calculateddialog",document),P.Dialog),r=t.getAttribute("data-type"),a=_e.select("#"+this.parentID+"droppable",a.element);"pivot"===this.parent.dataType?""===a.value?a.value=r===up?t.getAttribute("data-uid"):'"'+r+"("+i+')"':""!==a.value&&(a.value=r===up?a.value+t.getAttribute("data-uid"):a.value+'"'+r+"("+i+')"'):(this.parent.olapEngineModule&&this.parent.olapEngineModule.fieldList[i]&&this.parent.olapEngineModule.fieldList[i].isCalculatedField&&(i=this.parent.olapEngineModule.fieldList[i].tag),""===a.value?a.value=i:""!==a.value&&(a.value=a.value+i))}},T.prototype.fieldClickHandler=function(e){var t=_e.closest(e.event.target,"li");(e.event.target.classList.contains(jt)||e.event.target.classList.contains(Jt)||e.event.target.classList.contains(Zt)||e.event.target.classList.contains(Mi))&&(this.parent.isAdaptive?"olap"===this.parent.dataType&&this.parent.isAdaptive&&("LI"===t.tagName&&t.querySelector(".e-list-edit-icon").classList.contains(Jt)&&e.event.target.classList.contains(Jt)?(this.isEdit=!0,this.currentFieldName=t.getAttribute("data-field"),this.fieldText=t.getAttribute("data-caption"),this.formulaText=t.getAttribute("data-formula"),this.formatType=t.getAttribute("data-formatString"),this.formatText="Custom"===this.formatType?t.getAttribute("data-customformatstring"):null,this.fieldType=t.getAttribute("data-membertype"),this.parentHierarchy="Dimension"===this.fieldType?t.getAttribute("data-hierarchy"):null,_e.addClass([t.querySelector(".e-list-edit-icon")],Zt),_e.removeClass([t.querySelector(".e-list-edit-icon")],Jt),this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)):"LI"===t.tagName&&t.querySelector(".e-list-edit-icon").classList.contains(Zt)&&e.event.target.classList.contains(Zt)?(this.isEdit=!1,this.fieldText=this.formatText=this.formulaText=this.currentFieldName=null,this.parentHierarchy=this.fieldType=this.formatType=null,_e.addClass([t.querySelector(".e-list-edit-icon")],Jt),_e.removeClass([t.querySelector(".e-list-edit-icon")],Zt)):"LI"===t.tagName&&t.querySelector("."+Mi).classList.contains("e-icons")&&e.event.target.classList.contains(Mi)&&this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),{},!0,e.node)):this.displayMenu(t,e.node,e.event.target))},T.prototype.accordionClickHandler=function(e){var t,i,a,r,n,s;e.item&&-1!==e.item.iconCss.indexOf("e-list-icon")&&_e.closest(e.originalEvent.target,".e-acrdn-header-icon")&&(i=(t=_e.closest(e.originalEvent.target,".e-acrdn-header").querySelector("."+Et)).getAttribute("data-field"),a=t.getAttribute("data-caption"),r=Ie.getFieldByName(i,this.parent.dataSourceSettings.formatSettings),n=_e.closest(e.originalEvent.target,".e-acrdn-header-icon"),r&&(s=(s=this.getFormat(r.format))?-1<this.formatTypes.indexOf(s)?r.format:"Custom":"None",this.formatType=s),n.querySelector("."+Jt)&&e.originalEvent.target.classList.contains(Jt)?(this.isEdit=!0,this.currentFieldName=i,this.fieldText=a||i,this.formulaText=this.parent.engineModule.fieldList[i].formula,this.formatText=r?r.format:"",_e.addClass([n.querySelector(".e-list-icon")],Zt),_e.removeClass([n.querySelector(".e-list-icon")],Jt),this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)):n.querySelector("."+Zt)&&e.originalEvent.target.classList.contains(Zt)?(this.isEdit=!1,this.fieldText=this.formatText=this.formulaText=this.currentFieldName=null,_e.addClass([n.querySelector(".e-list-icon")],Jt),_e.removeClass([n.querySelector(".e-list-icon")],Zt)):n.querySelector("."+Mi)&&e.originalEvent.target.classList.contains(Mi)&&this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),{},!0,t))},T.prototype.accordionCreated=function(){for(var e,t=_e.getInstance(_e.select("#"+this.parentID+"accordDiv",document),D.Accordion).element.querySelectorAll(".e-acrdn-item"),i=0;i<t.length;i++)(t[i].querySelector("."+Jt)||t[i].querySelector("."+Zt))&&(e=_e.createElement("span",{className:"e-list-icon "+Mi+" e-icons"}),_e.append([e],t[i].querySelector(".e-acrdn-header-icon")),_e.addClass([t[i]],"e-select"))},T.prototype.clearFormula=function(){this.treeObj&&this.treeObj.element.querySelector("li")&&(_e.removeClass(this.treeObj.element.querySelectorAll("li"),"e-active"),this.displayMenu(this.treeObj.element.querySelector("li")))},T.prototype.displayMenu=function(e,t,i){var a,r,n,s,o,l,d,h,p,u,c,g,m,S,f,v,y=!i||i.classList.contains(Jt),b=!i||i.classList.contains(Zt),C=_e.getInstance(_e.select("#"+this.parentID+"calculateddialog",document),P.Dialog),x=_e.getInstance(_e.select("#"+this.parentID+"ddlelement",document),H.MaskedTextBox);try{"pivot"!==this.parent.dataType||!e.querySelector(".e-list-icon.e-format")||!e.querySelector(".e-list-icon.e-format").classList.contains(W)||e.querySelector(".e-list-icon").classList.contains(Zt)||e.querySelector(".e-list-icon").classList.contains(Mi)||e.querySelector(".e-list-icon").classList.contains(Jt)||"LI"!==e.tagName?"LI"===e.tagName&&(e.querySelector("."+Jt)&&e.querySelector("."+Jt).classList.contains("e-list-icon")&&y||"olap"===this.parent.dataType&&e.getAttribute("data-type")===up&&e.classList.contains("e-active")&&(i&&!i.classList.contains(Mi)||!i))?(this.isEdit=!0,a=e.getAttribute("data-field"),r=e.getAttribute("data-caption"),this.currentFieldName=a,x.value=r,x.dataBind(),n=e.getAttribute("data-formatString"),h=C.element,c=_e.getInstance(_e.select("#"+this.parentID+"Format_Div",h),G.DropDownList),p=_e.getInstance(_e.select("#"+this.parentID+"Custom_Format_Element",h),H.MaskedTextBox),s=e.getAttribute("data-customformatstring"),"olap"===this.parent.dataType?(o=e.getAttribute("data-membertype"),l=e.getAttribute("data-hierarchy"),d=e.getAttribute("data-formula"),m=_e.select("#"+this.parentID+"_FieldNameTitle",h),g=_e.getInstance(_e.select("#"+this.parentID+"Member_Type_Div",h),G.DropDownList),u=_e.getInstance(_e.select("#"+this.parentID+"Hierarchy_List_Div",h),G.DropDownList),m.innerText=this.parent.localeObj.getConstant("caption"),_e.select("#"+this.parentID+"droppable",document).value=d,g.readonly=!0,g.value=o,g.dataBind(),"Dimension"===o&&(u.value=l)):(_e.addClass(this.treeObj.element.querySelectorAll("."+Zt),Jt),_e.removeClass(this.treeObj.element.querySelectorAll("."+Zt),Zt),_e.addClass([e.querySelector(".e-list-icon")],Zt),_e.removeClass([e.querySelector(".e-list-icon")],Jt),e.querySelector("."+Zt).setAttribute("title",this.parent.localeObj.getConstant("clearCalculatedField")),_e.select("#"+this.parentID+"droppable",document).value=e.getAttribute("data-uid")),""!==n&&(c.value=n,c.dataBind()),p.value=s,p.dataBind()):"LI"===e.tagName&&(e.querySelector("."+Zt)&&e.querySelector("."+Zt).classList.contains("e-list-icon")&&b||"olap"===this.parent.dataType&&!e.classList.contains("e-active"))?(this.isEdit=!1,x.value="",x.dataBind(),h=C.element,(p=_e.getInstance(_e.select("#"+this.parentID+"Custom_Format_Element",h),H.MaskedTextBox)).value="",p.dataBind(),"olap"===this.parent.dataType?(u=_e.getInstance(_e.select("#"+this.parentID+"Hierarchy_List_Div",h),G.DropDownList),c=_e.getInstance(_e.select("#"+this.parentID+"Format_Div",h),G.DropDownList),g=_e.getInstance(_e.select("#"+this.parentID+"Member_Type_Div",h),G.DropDownList),(m=_e.select("#"+this.parentID+"_FieldNameTitle",h)).innerText=this.parent.localeObj.getConstant("fieldTitle"),u.index=0,u.dataBind(),c.index=0,c.dataBind(),g.index=0,g.readonly=!1,g.dataBind()):(_e.addClass(this.treeObj.element.querySelectorAll("."+Zt),Jt),_e.removeClass(this.treeObj.element.querySelectorAll("."+Zt),Zt),e.querySelector("."+Jt).setAttribute("title",this.parent.localeObj.getConstant("edit"))),_e.select("#"+this.parentID+"droppable",document).value=""):"LI"===e.tagName&&e.querySelector("."+Mi)&&e.querySelector("."+Mi).classList.contains("e-list-icon")&&!y&&!b&&(this.parent.actionObj.actionName=Ln,this.parent.actionBeginMethod()||(S=_e.select("#"+this.parentID+"droppable",document),f={name:this.isEdit?this.currentFieldName:x.value,caption:x.value,formula:S.value},this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),f,!0,t))):((v=_e.select("#"+this.parentID+"CalcContextmenu",document)?_e.getInstance(_e.select("#"+this.parentID+"CalcContextmenu",document),D.ContextMenu):null)&&!v.isDestroyed&&v.destroy(),this.curMenu=e.querySelector("."+nt),this.openContextMenu(e))}catch(e){this.parent.actionFailureMethod(e)}},T.prototype.removeCalcField=function(e){var t=this.parent.dataSourceSettings,i=e.getAttribute("data-field"),a=t.calculatedFieldSettings;"pivot"===this.parent.dataType&&(this.parent.isAdaptive?"number"==typeof(d=parseInt(e.getAttribute("id").split(this.parentID+"_")[1],10))&&_e.getInstance(_e.select("#"+this.parentID+"accordDiv",document),D.Accordion).hideItem(d):this.treeObj.removeNodes([e]));for(var r=0;r<a.length;r++)if(a[r]&&a[r].name===i){a.splice(r,1);break}if("olap"===this.parent.dataType){for(var n,s=(n=this.parent.olapEngineModule).fieldListData||[],o=0,l=Object.keys(s);o<l.length;o++){var d,h=l[o];if(s[parseInt(h,10)].name===i)if("number"==typeof(d=parseInt(h,10))){s.splice(d,1);break}}var p=this.treeObj.getNode(e).parentID;this.treeObj.removeNodes([e]),a.length<=0&&this.treeObj.removeNodes([p])}else n=this.parent.engineModule;if(n.fields)for(r=0;r<n.fields.length;r++)if(n.fields[r]===i){n.fields.splice(r,1);break}n.savedFieldList&&n.savedFieldList[i]&&delete n.savedFieldList[i],n.fieldList&&n.fieldList[i]&&delete n.fieldList[i];for(var u=t.formatSettings,r=0;r<u.length;r++)if(u[r]&&u[r].name===i){u.splice(r,1);break}for(var c=[t.values,t.rows,t.columns,t.filters],r=0,g=c.length;r<g;r++)for(var m=0,S=c[r].length;m<S;m++)if(c[r][m].name===i){c[r].splice(m,1);break}this.isEdit&&this.currentFieldName===i&&(e=_e.getInstance(_e.select("#"+this.parentID+"ddlelement",document),H.MaskedTextBox),this.isEdit=!1,e.value="",this.currentFieldName=this.formatText=this.fieldText=this.formatType=null,this.formulaText=this.fieldType=this.parentHierarchy=null),(!_e.isNullOrUndefined(this.parent.isDeferLayoutUpdate)&&!this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!this.parent.pivotGridModule.pivotDeferLayoutUpdate||"pivotfieldlist"!==this.parent.getModuleName())&&this.parent.updateDataSource(),this.closeErrorDialog()},T.prototype.openContextMenu=function(l){var d=this,e=l.getAttribute("data-field"),t="number"!==this.parent.engineModule.fieldList[e].type?"string":"number",h="string"==t?this.getValidSummaryType().slice(0,2):this.getValidSummaryType(),e={cancel:!1,fieldName:e,aggregateTypes:this.getMenuItems(t).slice()};("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(Dr,e,function(e){if(!e.cancel){for(var t=[],i=[],a=0,r=e.aggregateTypes;a<r.length;a++){var n=r[a];-1<h.indexOf(n)&&-1===t.indexOf(n)&&(t.push(n),i.push({id:d.parent.element.id+"Calc_"+n,text:d.parent.localeObj.getConstant(n)}))}d.createMenu(i,l);var e=l.getBoundingClientRect(),s=window.scrollY||document.documentElement.scrollTop,o=_e.getInstance(_e.select("#"+d.parentID+"CalcContextmenu",document),D.ContextMenu);d.parent.enableRtl?o.open(e.top+s,e.left-100):o.open(e.top+s,e.left+150)}})},T.prototype.selectContextMenu=function(e){var t;null!==e.element.textContent&&(t=_e.closest(this.curMenu,".e-list-item").getAttribute("data-caption"),_e.closest(this.curMenu,".e-list-item").setAttribute("data-type",e.element.id.split("_").pop()),this.curMenu.textContent=t+" ("+e.element.textContent+")",_e.addClass([this.curMenu.parentElement.parentElement],["e-node-focus","e-hover"]),this.curMenu.parentElement.parentElement.setAttribute("tabindex","0"),this.curMenu.parentElement.parentElement.focus())},T.prototype.createMenu=function(e,t){var i=this,e={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(){i.treeObj.element.focus(),_e.addClass([t],["e-hover","e-node-focus"])}},a=_e.select("#"+this.parentID+"CalcContextmenu",document)?_e.select("#"+this.parentID+"CalcContextmenu",document):_e.createElement("ul",{id:this.parentID+"CalcContextmenu"}),e=(_e.getInstance(_e.select("#"+this.parentID+"calculateddialog",document),P.Dialog).element.appendChild(a),new D.ContextMenu(e));e.isStringTemplate=!0,e.appendTo(a)},T.prototype.applyFormula=function(){var S=this,f=this,v=!1,e=(_e.removeClass([document.getElementById(this.parentID+"ddlelement")],$t),_e.getInstance(_e.select("#"+this.parentID+"ddlelement",document),H.MaskedTextBox)),e=(this.newFields=_e.extend([],this.parent.dataSourceSettings.calculatedFieldSettings,null,!0),{fieldName:this.isEdit?this.currentFieldName:e.value,calculatedField:this.getCalculatedFieldInfo(),calculatedFieldSettings:Ie.cloneCalculatedFieldSettings(this.parent.dataSourceSettings.calculatedFieldSettings),cancel:!1});("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(xr,e,function(e){if(e.cancel)S.endDialog(),S.parent.lastCalcFieldInfo={},S.isFormula=!1;else{var t=e.calculatedField;if(!S.isEdit)if("olap"===f.parent.dataType){var i=t.name;f.parent.olapEngineModule.fieldList[i]&&"CalculatedField"!==f.parent.olapEngineModule.fieldList[i].type&&(v=!0)}else for(var a=0,r=Object.keys(f.parent.engineModule.fieldList);a<r.length;a++){var n=r[a];t.name&&t.name===n&&"CalculatedField"!==f.parent.engineModule.fieldList[n].aggregateType&&(v=!0)}if(v)f.parent.pivotCommon.errorDialog.createErrorDialog(f.parent.localeObj.getConstant("error"),f.parent.localeObj.getConstant("fieldExist"));else{S.existingReport=_e.extend({},S.parent.dataSourceSettings,null,!0);var s=S.parent.dataSourceSettings;if(_e.isNullOrUndefined(t.name)||""===t.name||_e.isNullOrUndefined(t.caption)||""===t.caption||!t.formula||""===t.formula)_e.isNullOrUndefined(t.name)||""===t.name||_e.isNullOrUndefined(t.caption)||""===t.caption?(_e.getInstance(_e.select("#"+S.parentID+"ddlelement",document),H.MaskedTextBox).value="",_e.addClass([document.getElementById(S.parentID+"ddlelement")],$t),document.getElementById(S.parentID+"ddlelement").focus()):S.triggerActionCompleteEvent();else{i=void 0;if("olap"===S.parent.dataType){if(i={name:t.name,formula:t.formula,formatString:t.formatString},_e.isNullOrUndefined(t.hierarchyUniqueName)||(i.hierarchyUniqueName=t.hierarchyUniqueName),S.isFieldExist=!1,S.isEdit){for(c=0;c<s.calculatedFieldSettings.length;c++)if(s.calculatedFieldSettings[c].name===i.name&&S.isEdit){s.calculatedFieldSettings[c].hierarchyUniqueName=t.hierarchyUniqueName,S.parent.olapEngineModule.fieldList[i.name].caption=t.caption,s.calculatedFieldSettings[c].formatString=i.formatString,s.calculatedFieldSettings[c].formula=i.formula,i=s.calculatedFieldSettings[c],S.updateFormatSettings(s,i.name,t.formatString),S.parent.olapEngineModule.getFormattedFields(s.formatSettings),S.parent.olapEngineModule.formatFields[i.name]&&(S.parent.olapEngineModule.formatFields[i.name].format?S.parent.olapEngineModule.formatFields[i.name].format=S.getFormat(i.formatString):delete S.parent.olapEngineModule.formatFields[i.name]),S.isFieldExist=!0;break}for(var o=!1,l=0,d=[s.rows,s.columns,s.values,s.filters];l<d.length;l++){for(var h=0,p=d[l];h<p.length;h++){var u=p[h];if(u.isCalculatedField&&null!==i.name&&u.name===i.name&&S.isEdit){u.caption=t.caption,o=S.isFieldExist=!0;break}}if(o)break}}else for(var c=0;c<s.calculatedFieldSettings.length;c++)if(s.calculatedFieldSettings[c].name===i.name)return void S.createConfirmDialog(f.parent.localeObj.getConstant("alert"),f.parent.localeObj.getConstant("confirmText"),t);S.isFieldExist||(s.calculatedFieldSettings.push(i),S.updateFormatSettings(s,i.name,t.formatString),S.parent.olapEngineModule.getFormattedFields(s.formatSettings),S.parent.olapEngineModule.formatFields[i.name]&&(S.parent.olapEngineModule.formatFields[i.name].format?S.parent.olapEngineModule.formatFields[i.name].format=S.getFormat(i.formatString):delete S.parent.olapEngineModule.formatFields[i.name])),S.parent.lastCalcFieldInfo=i}else{i={name:t.name,caption:t.caption,type:"CalculatedField"};var g={name:t.name,formula:t.formula};if(_e.isNullOrUndefined(t.formatString)||(g.formatString=t.formatString),S.isFieldExist=!0,S.isEdit){for(c=0;c<s.values.length;c++)if(s.values[c].type===up&&null!==i.name&&s.values[c].name===i.name&&S.isEdit)for(m=0;m<s.calculatedFieldSettings.length;m++)s.calculatedFieldSettings[m].name===i.name&&(s.values.splice(c,1),s.values.splice(c,0,i),S.currentFormula=s.calculatedFieldSettings[m].formula,s.calculatedFieldSettings.splice(m,1),s.calculatedFieldSettings.splice(m,0,g),S.updateFormatSettings(s,i.name,t.formatString),S.isFieldExist=!1)}else for(var c=0;c<s.values.length;c++)if(s.values[c].type===up&&s.values[c].name===i.name){for(var m=0;m<s.calculatedFieldSettings.length;m++)if(s.calculatedFieldSettings[m].name===i.name)return void S.createConfirmDialog(f.parent.localeObj.getConstant("alert"),f.parent.localeObj.getConstant("confirmText"),t);S.isFieldExist=!1}S.isFieldExist&&(s.values.push(i),s.calculatedFieldSettings.push(g),S.updateFormatSettings(s,i.name,t.formatString)),S.parent.lastCalcFieldInfo=g}S.addFormula(s,i.name)}}}})},T.prototype.getCalculatedFieldInfo=function(){var e=_e.select("#"+this.parentID+"calculateddialog",document),e=e?_e.getInstance(e,P.Dialog):void 0,t=_e.getInstance(_e.select("#"+this.parentID+"ddlelement",document),H.MaskedTextBox),i=_e.select("#"+this.parentID+"droppable",document),e=(this.parent.isAdaptive?this.parent.dialogRenderer.adaptiveElement:e).element,a=_e.getInstance(_e.select("#"+this.parentID+"Custom_Format_Element",e),H.MaskedTextBox),t={name:this.isEdit?this.currentFieldName:t.value,caption:t.value,formula:i.value},i=_e.getInstance(_e.select("#"+this.parentID+"Format_Div",e),G.DropDownList);return t.formatString="Custom"===i.value?a.value:"None"===i.value?null:i.value,"olap"===this.parent.dataType&&(a=_e.getInstance(_e.select("#"+this.parentID+"Member_Type_Div",e),G.DropDownList),i=_e.getInstance(_e.select("#"+this.parentID+"Hierarchy_List_Div",e),G.DropDownList),"Dimension"===a.value)&&(t.hierarchyUniqueName=i.value),t},T.prototype.updateFormatSettings=function(e,t,i){for(var a={name:t,format:i,useGrouping:!0},r=!1,n=0;n<e.formatSettings.length;n++)if(e.formatSettings[n].name===t){if("undefined"===i||void 0===i||""===i){e.formatSettings.splice(n,1),r=!0;break}var s=e.formatSettings[n].properties||e.formatSettings[n];s.format=i,e.formatSettings.splice(n,1,s),r=!0;break}r||""===i||_e.isNullOrUndefined(i)||e.formatSettings.push(a)},T.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},a=(this.parent.actionObj.actionInfo=i,this.parent.actionObj.actionName===En?ys:Bn),r=(this.parent.actionObj.actionName=a,this.parent.updateDataSource(!1),"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()}},T.prototype.endDialog=function(){this.isEdit=!1;var e,t,i=_e.select("#"+this.parentID+"calculateddialog",document),i=i?_e.getInstance(i,P.Dialog):void 0;i?i.close():(_e.getInstance(_e.select("#"+this.parentID+"ddlelement",document),H.MaskedTextBox).value="",this.currentFieldName=this.formatText=this.fieldText=this.formatType=null,this.formulaText=this.fieldType=this.parentHierarchy=null,i=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:i.element,this.parent.dialogRenderer.parentElement.querySelector("."+It).value="",_e.select("#"+this.parentID+"droppable",this.parent.dialogRenderer.parentElement).value="",_e.select("#"+this.parentID+"Custom_Format_Element",this.parent.dialogRenderer.parentElement).value="","olap"===this.parent.dataType&&(e=_e.getInstance(_e.select("#"+this.parentID+"Member_Type_Div",i),G.DropDownList),t=_e.getInstance(_e.select("#"+this.parentID+"Hierarchy_List_Div",i),G.DropDownList),e.index=0,e.readonly=!1,e.dataBind(),t.index=0,t.enabled=!1,t.dataBind()),e=_e.getInstance(_e.select("#"+this.parentID+"Custom_Format_Element",i),H.MaskedTextBox),(t=_e.getInstance(_e.select("#"+this.parentID+"Format_Div",i),G.DropDownList)).index="olap"===this.parent.dataType?0:4,t.dataBind(),e.enabled=!1,e.dataBind())},T.prototype.showError=function(){if(this.parent.engineModule.fieldList[this.field]&&delete this.parent.engineModule.fieldList[this.field],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.triggerActionCompleteEvent(),this.parent.updateDataSource(!1),this.isFormula=!1},T.prototype.getFieldListData=function(e){var t=[];if("olap"===this.parent.dataType)for(var i=0,a=t=Ie.getClonedData(e.olapEngineModule.fieldListData||[]);i<a.length;i++){var r=a[i];r.spriteCssClass&&(-1<r.spriteCssClass.indexOf("e-attributeCDB-icon")||-1<r.spriteCssClass.indexOf("e-level-members"))?r.hasChildren=!0:r.spriteCssClass&&-1<r.spriteCssClass.indexOf("e-namedSetCDB-icon")?r.hasChildren=!1:r.spriteCssClass&&-1<r.spriteCssClass.indexOf("e-calcMemberGroupCDB")&&(r.expanded=this.isEdit)}else for(var n=0,s=e.engineModule.fieldList?Object.keys(e.engineModule.fieldList):[];n<s.length;n++){var o=s[n],l=null,d=e.engineModule.fieldList[o],l="number"===d.type&&"include"!==e.engineModule.fieldList[o].type&&"exclude"!==e.engineModule.fieldList[o].type||"DistinctCount"===d.aggregateType?void 0!==d.aggregateType?d.aggregateType:np:rp,h=this.parent.localeObj.getConstant(l);t.push({index:d.index,name:(this.parent.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(d.caption):d.caption)+" ("+h+")",type:l,icon:jt+" "+W,formula:this.parent.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(d.formula):d.formula,field:this.parent.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(o):o,caption:this.parent.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(d.caption||o):d.caption||o})}return t},T.prototype.fieldDropped=function(e){e.cancel=!0;var t,i,a,r,n,s,o=_e.getInstance(_e.select("#"+this.parentID+"calculateddialog",document),P.Dialog),o=_e.select("#"+this.parentID+"droppable",o.element),l=(_e.removeClass([o],"e-copy-drop"),_e.removeClass([e.draggedNode.querySelector("."+nt)],Je),e.draggedNode.getAttribute("data-field"));"olap"===this.parent.dataType?(this.parent.olapEngineModule.fieldList[l]&&this.parent.olapEngineModule.fieldList[l].isCalculatedField&&(l=this.parent.olapEngineModule.fieldList[l].tag),e.target.id===this.parentID+"droppable"&&""===o.value?(o.value=l,o.focus()):e.target.id===this.parentID+"droppable"&&""!==o.value?(r=o.value,a=o.selectionStart,s=r.substring(a,r.length),i=(n=r.substring(0,a))+l,o.value=n+l+s,o.focus(),o.setSelectionRange(i.length,i.length)):e.cancel=!0):(t=e.draggedNode.getAttribute("data-type"),e.target.id===this.parentID+"droppable"&&""===o.value?(o.value=t===up?e.draggedNodeData.id.toString():'"'+t+"("+l+')"',o.focus()):e.target.id===this.parentID+"droppable"&&""!==o.value?(i=void 0,a=o.selectionStart,n=(r=o.value).substring(0,a),s=r.substring(a,r.length),t===up?(i=n+e.draggedNodeData.id.toString(),o.value=n+e.draggedNodeData.id.toString()+s):o.value=(i=n+'"'+t+"("+l+')"')+s,o.focus(),o.setSelectionRange(i.length,i.length)):e.cancel=!0)},T.prototype.createDialog=function(){var e=this;if(null!==_e.select("#"+this.parentID+"calculateddialog",document))for(_e.remove(_e.select("#"+this.parentID+"calculateddialog",document));!_e.isNullOrUndefined(document.querySelector("."+this.parentID+"calculatedmenu"));)_e.remove(document.querySelector("."+this.parentID+"calculatedmenu"));var t,i=_e.createElement("div",{id:this.parentID+"calculateddialog",className:"e-pivot-calc-dialog-div "+("olap"===this.parent.dataType?"e-olap-calc-dialog-div":"")}),a=(this.parent.element.appendChild(i),[{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}}]),r=("olap"===this.parent.dataType&&(t={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,t)),new P.Dialog({allowDragging:!0,position:{X:"center",Y:"center"},buttons:a,close:this.closeDialog.bind(this),beforeOpen:this.beforeOpen.bind(this),open:function(){_e.select("#"+e.parentID+"ddlelement",r.element)&&_e.select("#"+e.parentID+"ddlelement",r.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}));r.isStringTemplate=!0,r.appendTo(i)},T.prototype.cancelClick=function(){_e.getInstance(_e.select("#"+this.parentID+"calculateddialog",document),P.Dialog).close(),this.isEdit=!1},T.prototype.beforeOpen=function(){_e.getInstance(_e.select("#"+this.parentID+"calculateddialog",document),P.Dialog).element.querySelector(".e-dlg-header").setAttribute("title",this.parent.localeObj.getConstant("createCalculatedField"))},T.prototype.closeDialog=function(){"pivotfieldlist"===this.parent.getModuleName()&&("Abort"!==this.parent.actionObj.actionName&&this.parent.axisFieldModule.render(),"Fixed"!==this.parent.renderMode)&&(_e.addClass([this.parent.element.querySelector("."+X)],k),this.parent.dialogRenderer.fieldListDialog.show()),this.destroy(),_e.isNullOrUndefined(document.getElementById(this.parentID+"calculateddialog"))||_e.remove(document.getElementById(this.parentID+"calculateddialog")),_e.isNullOrUndefined(document.querySelector("."+this.parentID+"calculatedmenu"))||_e.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))},T.prototype.setFocus=function(){var e;if("pivotview"===this.parent.getModuleName()&&this.parent.element?e=this.parent.element: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}}},T.prototype.renderDialogElements=function(){var e,t,i,a,r,n,s,o=_e.createElement("div",{id:this.parentID+"outerDiv",className:("olap"===this.parent.dataType?"e-olap-calc-outer-div ":"")+"e-pivot-calc-outer-div"}),l=_e.createElement("div",{id:this.parentID+"Olap_Tree_Div",className:"e-olap-field-tree-div"}),d=_e.createElement("div",{id:this.parentID+"Pivot_Calc_Div",className:"e-pivot-calculated-div"});return"pivotfieldlist"===this.parent.getModuleName()&&null!==this.parent.dialogRenderer.parentElement.querySelector("."+qt)&&this.parent.isAdaptive?(a=_e.createElement("div",{id:this.parentID+"accordDiv",className:"e-pivot-accord"}),o.appendChild(a),a=_e.createElement("div",{id:this.parentID+"buttonDiv",className:Bt}),(e=_e.createElement("button",{id:this.parentID+"addBtn",className:"e-pivot-add-button",attrs:{type:"button"}})).innerText=this.parent.localeObj.getConstant("add"),(i=_e.createElement("button",{id:this.parentID+"cancelBtn",className:"e-pivot-cancel-button",attrs:{type:"button"}})).innerText=this.parent.localeObj.getConstant("cancel"),a.appendChild(i),a.appendChild(e),o.appendChild(a)):(this.parent.isAdaptive||"olap"!==this.parent.dataType||((t=_e.createElement("div",{className:"e-pivot-field-name-title",id:this.parentID+"_FieldNameTitle"})).innerText=this.parent.localeObj.getConstant("fieldTitle"),d.appendChild(t)),i=_e.createElement("div",{id:this.parentID+"innerDiv",className:"e-pivot-calc-input-div"}),e=_e.createElement("input",{id:this.parentID+"ddlelement",attrs:{type:"text"},className:It}),i.appendChild(e),("olap"!==this.parent.dataType||this.parent.isAdaptive?o:d).appendChild(i),e=_e.createElement("div",{id:this.parentID+"control_container",className:Vt}),this.parent.isAdaptive||((i=_e.createElement("div",{className:Yt})).innerText="olap"===this.parent.dataType?this.parent.localeObj.getConstant("allFields"):this.parent.localeObj.getConstant("formulaField"),"olap"===this.parent.dataType?((n=_e.createElement("div",{className:Yt+"-container"})).appendChild(i),r=_e.createElement("span",{attrs:{tabindex:"0","aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("fieldTooltip"),role:"button"},className:W+" e-info"}),n.appendChild(r),new P.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(n),e.appendChild(n)):o.appendChild(i)),r=_e.createElement("div",{className:Ht+"-outer-div"}),e.appendChild(r),n=_e.createElement("div",{id:this.parentID+"tree",className:Ht}),r.appendChild(n),("olap"!==this.parent.dataType||this.parent.isAdaptive?o:l).appendChild(e),this.parent.isAdaptive||((t=_e.createElement("div",{className:"e-pivot-formula-title"})).innerText="olap"===this.parent.dataType?this.parent.localeObj.getConstant("expressionField"):this.parent.localeObj.getConstant("formula"),("olap"===this.parent.dataType?d:o).appendChild(t)),i=_e.createElement("textarea",{id:this.parentID+"droppable",className:qt+" 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")}}),("olap"!==this.parent.dataType||this.parent.isAdaptive?o:d).appendChild(i),this.parent.isAdaptive&&(a=_e.createElement("div",{id:this.parentID+"buttonDiv",className:Bt}),(s=_e.createElement("button",{id:this.parentID+"okBtn",className:_t,attrs:{type:"button"}})).innerText=this.parent.localeObj.getConstant("apply"),a.appendChild(s),o.appendChild(a)),"olap"===this.parent.dataType&&(this.parent.isAdaptive||((r=_e.createElement("div",{className:"e-olap-member-title"})).innerText=this.parent.localeObj.getConstant("memberType"),d.appendChild(r)),n=_e.createElement("div",{id:this.parentID+"Member_Type_Div",className:Rt}),this.parent.isAdaptive?o.appendChild(n):(d.appendChild(n),(e=_e.createElement("div",{className:"e-olap-hierarchy-title"})).innerText=this.parent.localeObj.getConstant("selectedHierarchy"),d.appendChild(e)),t=_e.createElement("div",{id:this.parentID+"Hierarchy_List_Div",className:Lt}),(this.parent.isAdaptive?o:d).appendChild(t)),this.parent.isAdaptive||((i=_e.createElement("div",{className:"e-pivot-format-title"})).innerText=this.parent.localeObj.getConstant("formatString"),d.appendChild(i)),a=_e.createElement("div",{id:this.parentID+"Format_Div",className:At}),(this.parent.isAdaptive?o:d).appendChild(a),r=_e.createElement("div",{id:this.parentID+"custom_Format_Div",className:"e-pivot-calc-custom-format-div"}),n=_e.createElement("input",{id:this.parentID+"Custom_Format_Element",attrs:{type:"text"},className:Ft}),r.appendChild(n),d.appendChild(r),(this.parent.isAdaptive?o:d).appendChild(r),"pivotfieldlist"===this.parent.getModuleName()&&null===this.parent.dialogRenderer.parentElement.querySelector("."+qt)&&this.parent.isAdaptive?(s=o.querySelector("."+_t),o.appendChild(s)):("olap"===this.parent.dataType&&o.appendChild(l),o.appendChild(d))),o},T.prototype.renderAdaptiveLayout=function(e){var t=this.parent.dialogRenderer.adaptiveElement;e?(_e.select("#"+this.parentID+"droppable",t.element)&&(e=_e.getInstance(_e.select("#"+this.parentID+"ddlelement",document),H.MaskedTextBox),this.formulaText=_e.select("#"+this.parentID+"droppable",document).value,this.fieldText=e.value),t.element.querySelector("."+Rt)&&(e=_e.getInstance(_e.select("#"+this.parentID+"Member_Type_Div",t.element),G.DropDownList),this.fieldType=e.value),t.element.querySelector("."+Lt)&&(e=_e.getInstance(_e.select("#"+this.parentID+"Hierarchy_List_Div",t.element),G.DropDownList),this.parentHierarchy="Dimension"===this.fieldType?e.value:null),t.element.querySelector("."+At)&&(e=_e.getInstance(_e.select("#"+this.parentID+"Format_Div",t.element),G.DropDownList),this.formatType=e.value),t.element.querySelector("."+Ft)&&(e=_e.getInstance(_e.select("#"+this.parentID+"Custom_Format_Element",t.element),H.MaskedTextBox),this.formatText="Custom"===("olap"===this.parent.dataType?this.formatType:this.getFormat(this.formatType))?e.value:null)):(this.currentFieldName=this.formulaText=this.fieldText=this.formatText=null,this.fieldType=this.formatType=this.parentHierarchy=null),this.renderMobileLayout(t)},T.prototype.updateAdaptiveCalculatedField=function(e,t){var i=this.parent.dialogRenderer.adaptiveElement.element,a=(this.isEdit=e)?("pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule).fieldList[t]:{id:null,caption:null,formula:null,fieldType:"Measure",formatString:"pivot"===this.parent.dataType?null:"Standard",parentHierarchy:null},r=(this.currentFieldName=a.id,_e.getInstance(_e.select("#"+this.parentID+"ddlelement",document),H.MaskedTextBox));_e.select("#"+this.parentID+"droppable",document)&&(this.formulaText=_e.select("#"+this.parentID+"droppable",document).value=a.formula,this.fieldText=r.value=a.caption,r.dataBind()),i.querySelector("."+Rt)&&(r=_e.getInstance(_e.select("#"+this.parentID+"Member_Type_Div",i),G.DropDownList),this.fieldType=r.value=a.fieldType,r.readonly=!!e,r.dataBind()),i.querySelector("."+Lt)&&(e=_e.getInstance(_e.select("#"+this.parentID+"Hierarchy_List_Div",i),G.DropDownList),"Dimension"===this.fieldType?this.parentHierarchy=e.value=a.parentHierarchy:(this.parentHierarchy=null,e.index=0),e.dataBind()),i.querySelector("."+At)&&(r=_e.getInstance(_e.select("#"+this.parentID+"Format_Div",i),G.DropDownList),this.formatType=r.value=-1<this.formatTypes.indexOf(a.formatString)?a.formatString:"Custom"),i.querySelector("."+Ft)&&(e=_e.getInstance(_e.select("#"+this.parentID+"Custom_Format_Element",i),H.MaskedTextBox),r=Ie.getFieldByName(t,this.parent.dataSourceSettings.formatSettings),"pivot"===this.parent.dataType?this.formatText=e.value=r?r.format:null:this.formatText=e.value="Custom"===this.formatType?a.formatString:null,e.dataBind())},T.prototype.createDropElements=function(){for(var t=this,e=_e.select("#"+this.parentID+"calculateddialog",document)?_e.getInstance(_e.select("#"+this.parentID+"calculateddialog",document),P.Dialog):null,e=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:e.element,i=[],a=[],r=0,n=this.formatTypes;r<n.length;r++){var s=n[r];i.push({value:"pivot"===this.parent.dataType?this.getFormat(s):s,text:this.parent.localeObj.getConstant(s)})}if("olap"===this.parent.dataType){for(var o=[],l=0,d=["Measure","Dimension"];l<d.length;l++){var h=d[l];o.push({value:h,text:this.parent.localeObj.getConstant(h)})}for(var p=0,u=Ie.getClonedData(this.parent.olapEngineModule.fieldListData);p<u.length;p++){var c=u[p];c.spriteCssClass&&(-1<c.spriteCssClass.indexOf("e-attributeCDB-icon")||-1<c.spriteCssClass.indexOf("e-hierarchyCDB-icon"))&&a.push({value:c.id,text:c.caption})}var g=new G.DropDownList({dataSource:o,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:null!==this.fieldType?this.fieldType:o[0].value,readonly:this.isEdit,cssClass:kt+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){m.enabled="Dimension"===e.value,t.fieldType=e.value,t.formulaText=_e.select("#"+t.parentID+"droppable",document).value,m.dataBind()}}),m=(g.isStringTemplate=!0,g.appendTo(_e.select("#"+this.parentID+"Member_Type_Div",e)),new G.DropDownList({dataSource:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,allowFiltering:!0,enabled:"Dimension"===g.value,filterBarPlaceholder:this.parent.localeObj.getConstant("example")+" "+a[0].text.toString(),fields:{value:"value",text:"text"},value:null!==this.parentHierarchy&&"Dimension"===g.value?this.parentHierarchy:a[0].value,cssClass:kt+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){t.parentHierarchy=e.value,t.formulaText=_e.select("#"+t.parentID+"droppable",document).value}}));m.isStringTemplate=!0,m.appendTo(_e.select("#"+this.parentID+"Hierarchy_List_Div",e))}var g=new G.DropDownList({dataSource:i,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?i[0]:i[4]).value,cssClass:kt+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){S.enabled="Custom"===e.value,t.formatType=e.value,t.formulaText=_e.select("#"+t.parentID+"droppable",document).value,S.dataBind()}}),S=(g.isStringTemplate=!0,g.appendTo(_e.select("#"+this.parentID+"Format_Div",e)),new H.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("customFormat"),locale:this.parent.locale,enableRtl:this.parent.enableRtl,value:null!==this.formatText&&"Custom"===g.value?this.formatText:null,enabled:"Custom"===g.value,change:function(e){t.formatText=e.value,t.formulaText=_e.select("#"+t.parentID+"droppable",document).value},cssClass:this.parent.cssClass}));S.isStringTemplate=!0,S.appendTo(_e.select("#"+this.parentID+"Custom_Format_Element",e))},T.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},T.prototype.createTreeView=function(){var t=this,e=_e.select("#"+this.parentID+"calculateddialog",document)?_e.getInstance(_e.select("#"+this.parentID+"calculateddialog",document),P.Dialog):null,e=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:e.element;"olap"===this.parent.dataType?this.treeObj=new D.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(qt)?(_e.removeClass([e.clonedNode],Xe),_e.addClass([e.event.target],"e-copy-drop")):(_e.addClass([e.clonedNode],Xe),_e.removeClass([e.event.target],"e-copy-drop"),e.dropIndicator="e-no-drop",_e.addClass([e.clonedNode.querySelector("."+W)],"e-icon-expandable"),_e.removeClass([e.clonedNode.querySelector("."+W)],"e-list-icon"))},nodeClicked:this.fieldClickHandler.bind(this),nodeSelected:function(e){e.node.getAttribute("data-type")===up?t.displayMenu(e.node):(_e.removeClass([e.node],"e-active"),e.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 D.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(_e.select("#"+this.parentID+"tree",e))},T.prototype.updateNodeIcon=function(e){if(e.node&&e.node.querySelector(".e-list-icon")&&e.node.querySelector(".e-icon-expandable.e-process")&&-1<e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-icon")){var t=e.node.querySelector(".e-list-icon");_e.removeClass([t],"e-folderCDB-icon"),_e.addClass([t],"e-folderCDB-open-icon")}else if(e.node&&e.node.querySelector(".e-list-icon")&&e.node.querySelector(".e-icon-expandable")&&-1<e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-open-icon")){t=e.node.querySelector(".e-list-icon");_e.removeClass([t],"e-folderCDB-open-icon"),_e.addClass([t],"e-folderCDB-icon")}else{for(var i=this.treeObj.fields.dataSource,a=[],r=0,n=i;r<n.length;r++){var s=n[r];s.pid===e.nodeData.id.toString()&&a.push(s)}if(0===a.length){this.parent.olapEngineModule.calcChildMembers=[],this.parent.olapEngineModule.getCalcChildMembers(this.parent.dataSourceSettings,e.nodeData.id.toString()),a=this.parent.olapEngineModule.calcChildMembers,this.parent.olapEngineModule.calcChildMembers=[];for(var o=0,l=a;o<l.length;o++)(t=l[o]).pid=e.nodeData.id.toString(),t.hasChildren=!1,t.spriteCssClass="e-level-members",t.caption=""===t.caption?this.parent.localeObj.getConstant("blank"):t.caption,i.push(t);this.treeObj.addNodes(a,e.node)}}},T.prototype.nodeCollapsing=function(e){e.cancel=!0},T.prototype.dragStart=function(e){var t=!1,i=e.clonedNode;(t=i&&("olap"===this.parent.dataType&&(i.querySelector(".e-calc-dimension-icon,.e-calc-measure-icon,.e-measure-icon")||i.querySelector(".e-attributeCDB-icon,.e-hierarchyCDB-icon")||i.querySelector(".e-level-members,.e-namedSetCDB-icon"))||"pivot"===this.parent.dataType&&e.event.target.classList.contains(xe))?!0:t)?(_e.addClass([e.draggedNode.querySelector("."+nt)],Je),_e.addClass([i],"e-pivot-calc"),t=_e.getInstance(_e.select("#"+this.parentID+"calculateddialog",document),P.Dialog),i.style.zIndex=(t.zIndex+1).toString(),i.style.display="inline"):e.cancel=!0},T.prototype.drawTreeNode=function(e){var t,i,a,r,n,s;"olap"===this.parent.dataType?(e.node.querySelector(".e-measure-icon")&&(e.node.querySelector(".e-list-icon").style.display="none"),t=e.nodeData,e.node.setAttribute("data-field",t.id),e.node.setAttribute("data-caption",t.caption),i=e.node.querySelector("."+$e),e.nodeData&&e.nodeData.type===up&&i&&e.node.querySelector(".e-list-icon.e-calc-member")&&(e.node.setAttribute("data-type",t.type),e.node.setAttribute("data-membertype",t.fieldType),e.node.setAttribute("data-hierarchy",t.parentHierarchy||""),e.node.setAttribute("data-formula",t.formula),r=t.formatString?-1<this.formatTypes.indexOf(t.formatString)?t.formatString:"Custom":"None",e.node.setAttribute("data-formatString",r),e.node.setAttribute("data-customformatstring","Custom"===r?t.formatString:""),a=_e.createElement("span",{className:Mi+" e-icons e-list-icon"}),i.classList.add("e-calcfieldmember"),this.parent.isAdaptive?(n=_e.createElement("span",{className:"e-list-edit-icon"+(this.isEdit&&this.currentFieldName===t.id?" e-edited ":" e-edit ")+W}),(s=_e.createElement("div",{className:"e-list-header-icon"})).appendChild(n),s.appendChild(a),i.appendChild(s)):i.appendChild(a)),this.parent.isAdaptive&&(n=e.node.querySelector("."+$e),e.node&&e.node.querySelector(".e-list-icon")&&n&&(s=e.node.querySelector(".e-list-icon"),n.insertBefore(s,e.node.querySelector(".e-list-text"))),e.node&&e.node.querySelector(".e-calcMemberGroupCDB,.e-measureGroupCDB-icon,.e-folderCDB-icon")&&(e.node.querySelector("."+ci).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"))&&_e.addClass([e.node],Z)):(t=e.nodeData.field,e.node.setAttribute("data-field",t),e.node.setAttribute("data-caption",e.nodeData.caption),e.node.setAttribute("data-type",e.nodeData.type),i=Ie.getFieldByName(t,this.parent.dataSourceSettings.formatSettings),e.node.setAttribute("data-formatString",i?i.format:""),i&&(r=(a=this.getFormat(i.format))?-1<this.formatTypes.indexOf(a)?i.format:"Custom":"None",e.node.setAttribute("data-customformatstring","Custom"===r?a:""),e.node.setAttribute("data-formatString",i?r:"")),n=_e.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("dragField")},className:W+" e-drag"}),s=_e.createElement("div",{className:" e-iconspace"}),_e.prepend([n],e.node.querySelector("."+$e)),_e.append([s,e.node.querySelector("."+jt)],e.node.querySelector("."+$e)),this.getMenuItems(this.parent.engineModule.fieldList[t].type).length<=0?_e.removeClass([e.node.querySelector("."+jt)],W):e.node.querySelector("."+jt).setAttribute("title",this.parent.localeObj.getConstant("format")),this.parent.engineModule.fieldList[t].aggregateType===up&&(e.node.querySelector("."+jt).setAttribute("title",this.parent.localeObj.getConstant("remove")),_e.addClass([e.node.querySelector("."+jt)],Mi),_e.addClass([e.node.querySelector(".e-iconspace")],[Jt,W,"e-list-icon"]),e.node.querySelector("."+Jt).setAttribute("title",this.parent.localeObj.getConstant("edit")),e.node.querySelector("."+Jt).setAttribute("aria-disabled","false"),e.node.querySelector("."+Jt).setAttribute("tabindex","-1"),_e.removeClass([e.node.querySelector("."+jt)],jt),_e.removeClass([e.node.querySelector(".e-iconspace")],"e-iconspace")))},T.prototype.createTypeContainer=function(e){for(var t=_e.createElement("div",{id:this.parentID+"control_container",className:Vt}),i=this.getMenuItems(this.parent.engineModule.fieldList[e].type),a=0;a<i.length;a++){var r=_e.createElement("input",{id:this.parentID+"radio"+e+i[a],attrs:{type:"radio","data-ftxt":e,"data-value":i[a]},className:"e-pivot-calc-radio"});t.appendChild(r)}return t},T.prototype.getMenuItems=function(e,t){for(var i=_e.isNullOrUndefined(t)?this.parent.aggregateTypes:t,a=[],r=this.getValidSummaryType(),n=0;n<i.length;n++)-1<r.indexOf(i[n])&&a.indexOf(i[n])<0&&((i[n]!==rp&&i[n]!==sp||"number"===e)&&"number"!==e||a.push(i[n]));return a},T.prototype.getValidSummaryType=function(){return[rp,sp,np,"Avg","Median","Min","Max",op,lp,dp,hp,pp]},T.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="+Et+' 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===up||this.getMenuItems(this.parent.engineModule.fieldList[n].type).length<1?"":this.createTypeContainer(n).outerHTML,iconCss:this.parent.engineModule.fieldList[n].aggregateType===up?"e-list-icon "+(this.isEdit&&this.currentFieldName===n?"e-edited":"e-edit"):""})}return t},T.prototype.renderMobileLayout=function(e){var t,i=this,e=(e.items[4].content=this.renderDialogElements().outerHTML,e.dataBind(),_e.select("#"+this.parentID+"calculateddialog",document)?_e.getInstance(_e.select("#"+this.parentID+"calculateddialog",document),P.Dialog):null),e=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:e.element,a=(this.parent.isAdaptive&&null!==this.parent.dialogRenderer.parentElement.querySelector("."+qt)&&this.createDropElements(),new z.Button({cssClass:this.parent.cssClass,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}));a.isStringTemplate=!0,a.appendTo(_e.select("#"+this.parentID+"cancelBtn",e)),a.element&&(a.element.onclick=this.cancelBtnClick.bind(this)),null!==this.parent.dialogRenderer.parentElement.querySelector("."+qt)&&this.parent.isAdaptive?((a=new z.Button({cssClass:this.parent.cssClass,isPrimary:!0,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer})).isStringTemplate=!0,a.appendTo(_e.select("#"+this.parentID+"okBtn",e)),(t=new H.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("fieldName"),locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:function(e){i.fieldText=e.value,i.formulaText=_e.select("#"+i.parentID+"droppable",document).value},cssClass:this.parent.cssClass})).isStringTemplate=!0,t.appendTo(_e.select("#"+this.parentID+"ddlelement",e)),null!==this.formulaText&&null!==_e.select("#"+this.parentID+"droppable",this.parent.dialogRenderer.parentElement)&&(_e.select("#"+this.parentID+"droppable",this.parent.dialogRenderer.parentElement).value=this.formulaText),null!==this.fieldText&&null!==this.parent.dialogRenderer.parentElement.querySelector("."+It)&&(this.parent.dialogRenderer.parentElement.querySelector("."+It).value=this.fieldText,t.value=this.fieldText),a.element&&(a.element.onclick=this.applyFormula.bind(this))):this.parent.isAdaptive&&((t=new z.Button({cssClass:this.parent.cssClass,isPrimary:!0,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer})).isStringTemplate=!0,t.appendTo(_e.select("#"+this.parentID+"addBtn",e)),"olap"===this.parent.dataType?(this.treeObj=new D.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){_e.removeClass([e.node],"e-active"),e.cancel=!0},cssClass:this.parent.cssClass}),this.treeObj.isStringTemplate=!0,this.treeObj.appendTo(_e.select("#"+this.parentID+"accordDiv",e))):((a=new D.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)})).isStringTemplate=!0,a.appendTo(_e.select("#"+this.parentID+"accordDiv",e)),this.updateType()),t.element)&&(t.element.onclick=this.addBtnClick.bind(this))},T.prototype.accordionExpand=function(e){if(0===e.element.querySelectorAll(".e-radio-wrapper").length)for(var t=Object.keys(this.parent.engineModule.fieldList),i=0,a=t.length;i<a;i++){var r=t[i],n="number"!==this.parent.engineModule.fieldList[r].type?[rp,sp]:[np,rp,"Avg","Median","Min","Max",sp,op,lp,dp,hp,pp],s=void 0;if(r===e.element.querySelector("[data-field").getAttribute("data-field"))for(var o=0;o<n.length;o++)(s=new z.RadioButton({label:this.parent.localeObj.getConstant(n[o]),name:"AggregateType"+r,checked:e.element.querySelector("[data-type").getAttribute("data-type")===n[o],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(_e.select("#"+this.parentID+"radio"+r+n[o],e.element))}},T.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"))},T.prototype.updateType=function(){for(var e=Object.keys(this.parent.engineModule.fieldList),t=_e.select("#"+this.parentID+"calculateddialog",document)?_e.getInstance(_e.select("#"+this.parentID+"calculateddialog",document),P.Dialog):null,i=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:t.element,a=0,r=e.length;a<r;a++){var n=e[a],s=null,s="number"===this.parent.engineModule.fieldList[n].type&&"include"!==this.parent.engineModule.fieldList[n].type&&"exclude"!==this.parent.engineModule.fieldList[n].type||"DistinctCount"===this.parent.engineModule.fieldList[n].aggregateType?void 0!==this.parent.engineModule.fieldList[n].aggregateType?this.parent.engineModule.fieldList[n].aggregateType:np:rp,o=new z.CheckBox({label:this.parent.engineModule.fieldList[n].caption+" ("+this.parent.localeObj.getConstant(s)+")",locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass});o.isStringTemplate=!0,o.appendTo(_e.select("#"+this.parentID+"_"+a,i)),_e.select("#"+this.parentID+"_"+a,i).setAttribute("data-field",n),_e.select("#"+this.parentID+"_"+a,i).setAttribute("data-type",s)}},T.prototype.cancelBtnClick=function(){this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)},T.prototype.addBtnClick=function(){var e,t="",i=null;if("pivot"===this.parent.dataType){for(var a=document.querySelectorAll(".e-accordion .e-check"),r=0;r<a.length;r++)if(e=a[r].parentElement.querySelector("[data-field]").getAttribute("data-field"),-1===(i=a[r].parentElement.querySelector("[data-field]").getAttribute("data-type")).indexOf(up))t=t+'"'+i+"("+e+')"';else for(var n=0;n<this.parent.dataSourceSettings.calculatedFieldSettings.length;n++)if(this.parent.dataSourceSettings.calculatedFieldSettings[n].name===e){t+=this.parent.dataSourceSettings.calculatedFieldSettings[n].formula;break}}else for(var s=this.treeObj.getAllCheckedNodes(),o=this.parent.olapEngineModule,l=0,d=s;l<d.length;l++){var h=d[l];t+=o.fieldList[h]&&o.fieldList[h].type===up?o.fieldList[h].tag:h}this.formulaText=null!==this.formulaText?this.formulaText+t:t,this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)},T.prototype.createCalculatedFieldDialog=function(e){var t;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):this.parent.isAdaptive||(this.isEdit=!(!e||void 0===e.edit)&&e.edit,this.renderDialogLayout(),e&&e.edit&&(e=this.treeObj.element.querySelector('li[data-field="'+e.fieldName+'"]'))&&(_e.addClass([e],["e-active","e-node-focus"]),e.setAttribute("aria-selected","true"),e.id=this.treeObj.element.id+"_active","pivot"===this.parent.dataType?(t={event:{target:e.querySelector(".e-list-icon.e-edit.e-icons")}},this.fieldClickHandler(t)):this.displayMenu(e)),(t=_e.getInstance(_e.select("#"+this.parentID+"calculateddialog",document),P.Dialog)).element.style.top=parseInt(t.element.style.top,10)<0?"0px":t.element.style.top)},T.prototype.renderDialogLayout=function(){this.newFields=_e.extend([],this.parent.dataSourceSettings.calculatedFieldSettings,null,!0),this.createDialog();var e=_e.getInstance(_e.select("#"+this.parentID+"calculateddialog",document),P.Dialog),t=(e.content=this.renderDialogElements(),e.refresh(),new H.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("fieldName"),locale:this.parent.locale,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass}));t.isStringTemplate=!0,t.appendTo(_e.select("#"+this.parentID+"ddlelement",e.element)),this.createDropElements(),this.createTreeView(),this.droppable=new _e.Droppable(_e.select("#"+this.parentID+"droppable",e.element)),this.keyboardEvents=new _e.KeyboardEvents(e.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:{moveRight:"rightarrow",enter:"enter",shiftE:"shift+E",delete:"delete"},eventName:"keydown"})},T.prototype.createConfirmDialog=function(e,t,i,a,r){var n=_e.createElement("div",{id:this.parentID+"_CalculatedFieldErrorDialog",className:je}),i=(this.parent.element.appendChild(n),new P.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:a?this.removeCalcField.bind(this,r):this.replaceFormula.bind(this,i),isFlat:!1,buttonModel:{cssClass:Re+(this.parent.cssClass?" "+this.parent.cssClass:""),content:a?this.parent.localeObj.getConstant("yes"):this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:this.closeErrorDialog.bind(this),isFlat:!1,buttonModel:{cssClass:ke+(this.parent.cssClass?" "+this.parent.cssClass:""),content:a?this.parent.localeObj.getConstant("no"):this.parent.localeObj.getConstant("cancel")}}],header:e,content:t,isModal:!0,visible:!0,closeOnEscape:!0,target:document.body,cssClass:this.parent.cssClass,close:this.removeErrorDialog.bind(this,r)}));i.isStringTemplate=!0,i.appendTo(n)},T.prototype.replaceFormula=function(e){var t=this.parent.dataSourceSettings;if("olap"===this.parent.dataType){for(var i=0;i<t.calculatedFieldSettings.length;i++)if(t.calculatedFieldSettings[i].name===e.name){_e.isNullOrUndefined(e.hierarchyUniqueName)||(t.calculatedFieldSettings[i].hierarchyUniqueName=e.hierarchyUniqueName),t.calculatedFieldSettings[i].formatString=e.formatString,t.calculatedFieldSettings[i].formula=e.formula,this.parent.lastCalcFieldInfo=t.calculatedFieldSettings[i];break}}else for(var a=0;a<t.values.length;a++)if(t.values[a].type===up&&t.values[a].name===e.name)for(i=0;i<t.calculatedFieldSettings.length;i++)t.calculatedFieldSettings[i].name===e.name&&(t.calculatedFieldSettings[i].formula=e.formula,this.parent.lastCalcFieldInfo=t.calculatedFieldSettings[i].properties||t.calculatedFieldSettings[i],this.updateFormatSettings(t,e.name,e.formatString));this.addFormula(t,e.name),this.removeErrorDialog()},T.prototype.removeErrorDialog=function(e){var t=_e.select("#"+this.parentID+"_CalculatedFieldErrorDialog",document),t=t?_e.getInstance(t,P.Dialog):null;t&&!t.isDestroyed&&t.destroy(),null!==_e.select("#"+this.parentID+"_CalculatedFieldErrorDialog",document)&&_e.remove(_e.select("#"+this.parentID+"_CalculatedFieldErrorDialog",document)),e&&(e.setAttribute("tabindex","0"),e.focus())},T.prototype.closeErrorDialog=function(){_e.getInstance(_e.select("#"+this.parentID+"_CalculatedFieldErrorDialog",document),P.Dialog).close()},T.prototype.triggerActionCompleteEvent=function(){var e={dataSourceSettings:Ie.getClonedDataSourceSettings(this.parent.dataSourceSettings),actionName:As,fieldInfo:this.parent.actionObj.fieldInfo,actionInfo:this.parent.actionObj.actionInfo},t=this.parent.isPopupView?this.parent.pivotGridModule:this.parent;t.trigger(Fr,e),"Abort"!==e.actionName&&this.parent.pivotCommon&&this.parent.pivotCommon.errorDialog?this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("invalidFormula")):(this.parent&&this.parent.actionObj&&(this.parent.actionObj.actionName=e.actionName),this.closeDialog()),this.parent&&this.parent.actionObj&&(this.parent.actionObj.actionName=""),t&&t.actionObj&&(t.actionObj.actionName="")},T.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(Br,this.createCalculatedFieldDialog,this)},T.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Br,this.createCalculatedFieldDialog)},T.prototype.destroy=function(){var e=_e.select("#"+this.parentID+"_CalculatedFieldErrorDialog",document),t=(e&&((t=_e.getInstance(e,P.Dialog))&&!t.isDestroyed&&t.destroy(),_e.remove(e)),_e.select("#"+this.parentID+"CalcContextmenu",document)),e=(t&&((e=_e.getInstance(t,D.ContextMenu))&&!e.isDestroyed&&e.destroy(),_e.remove(t)),this.treeObj&&!this.treeObj.isDestroyed&&(this.treeObj.destroy(),this.treeObj=null),this.droppable&&(this.droppable=null),this.keyboardEvents&&(this.keyboardEvents.destroy(),this.keyboardEvents=null),_e.select("#"+this.parentID+"ddlelement",document)),e=(e&&(t=_e.getInstance(e,H.MaskedTextBox))&&!t.isDestroyed&&t.destroy(),_e.select("#"+this.parentID+"Custom_Format_Element",document)),e=(e&&(t=_e.getInstance(e,H.MaskedTextBox))&&!t.isDestroyed&&t.destroy(),this.destroyDropdowns(),this.destroyAdaptiveComponents(),_e.select("#"+this.parentID+"calculateddialog",document)),t=(e&&((t=_e.getInstance(e,P.Dialog))&&!t.isDestroyed&&t.destroy(),_e.remove(e)),_e.select("#"+this.parentID+"accordDiv",document));t&&(e=_e.getInstance(t,D.Accordion))&&!e.isDestroyed&&e.destroy(),this.newFields=null,this.curMenu=null,this.existingReport=null,this.formulaText=null,this.fieldText=null,this.formatText=null,this.formatType=null,this.fieldType=null,this.parentHierarchy=null,this.currentFieldName=null},T.prototype.destroyDropdowns=function(){var e=_e.select("#"+this.parentID+"Format_Div",document),e=(e&&(e=_e.getInstance(e,G.DropDownList))&&!e.isDestroyed&&e.destroy(),_e.select("#"+this.parentID+"Member_Type_Div",document)),e=(e&&(e=_e.getInstance(e,G.DropDownList))&&!e.isDestroyed&&e.destroy(),_e.select("#"+this.parentID+"Hierarchy_List_Div",document));e&&(e=_e.getInstance(e,G.DropDownList))&&!e.isDestroyed&&e.destroy()},T.prototype.destroyAdaptiveComponents=function(){var e;this.parent.isAdaptive&&(["#"+this.parentID+"addBtn","#"+this.parentID+"cancelBtn","#"+this.parentID+"okBtn"].forEach(function(e){var e=_e.select(e,document);e&&(e=_e.getInstance(e,z.Button))&&!e.isDestroyed&&e.destroy()}),e=document.getElementById(this.parent.element.id+"_PivotFieldList_Container"))&&("pivot"===this.parent.dataType&&e.querySelectorAll(".e-radio-wrapper").forEach(function(e){e=_e.getInstance(e,z.RadioButton);e&&!e.isDestroyed&&e.destroy()}),e.querySelectorAll("."+Et).forEach(function(e){e=_e.getInstance(e,z.CheckBox);e&&!e.isDestroyed&&e.destroy()}))},T);function T(e){this.isFormula=!1,this.isRequireUpdate=!1,this.formatTypes=["Standard","Currency","Percent","Custom","None"],this.parent=e,this.existingReport=null,(this.parent.calculatedFieldModule=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}ap.Inject(ql);cp.prototype.getModuleName=function(){return"fieldList"},cp.prototype.initiateModule=function(){var e;_e.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)||(this.element=_e.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===_e.select("#"+this.parent.element.id+"containerwrapper",document)?(e=_e.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)):_e.select("#"+this.parent.element.id+"containerwrapper",document).appendChild(this.element),this.parent.pivotFieldListModule=new ap({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))},cp.prototype.updateControl=function(){if(this.parent.allowDeferLayoutUpdate&&(this.parent.actionObj.actionName="Field list refreshed"),this.element){for(var e=void 0,t=0;t<this.parent.toolbar.length;t++)"FieldList"===this.parent.toolbar[t]&&(e=!0);e&&this.parent.showToolbar&&"Server"===this.parent.dataSourceSettings.mode?this.element.style.display="none":this.element.style.display="block",_e.prepend([this.element],this.parent.element),this.parent.showGroupingBar&&this.parent.groupingBarModule?(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.update.bind(this))):_e.isNullOrUndefined(this.element.querySelector("."+X))||(_e.setStyleAttribute(this.element.querySelector("."+X),{left:"auto"}),this.parent.enableRtl?_e.removeClass([this.element.querySelector("."+X)],"e-fieldlist-left"):_e.addClass([this.element.querySelector("."+X)],"e-fieldlist-left")),_e.setStyleAttribute(this.element,{width:_e.formatUnit(this.parent.element.offsetWidth)})}this.parent.pivotFieldListModule.update(this.parent)},cp.prototype.update=function(){"Table"!==this.parent.currentView&&this.parent.chart?e=this.parent.pivotChartModule.getCalulatedWidth():this.parent.grid&&(e=this.parent.grid.element.offsetWidth);var e,t=this.element.querySelector("."+X);e&&!_e.isNullOrUndefined(t)&&t&&(t=e<400?this.parent.minWidth||400:e,_e.setStyleAttribute(this.element.querySelector("."+X),{left:_e.formatUnit(this.parent.enableRtl?-Math.abs(t-this.element.querySelector("."+X).offsetWidth):t-this.element.querySelector("."+X).offsetWidth)}),this.parent.enableRtl?_e.addClass([this.element.querySelector("."+X)],"e-fieldlist-left"):_e.removeClass([this.element.querySelector("."+X)],"e-fieldlist-left"))},cp.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Vr,this.initiateModule,this),this.parent.on(Rr,this.updateControl,this))},cp.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Vr,this.initiateModule),this.parent.off(Rr,this.updateControl))},cp.prototype.destroy=function(){this.timeOutObj&&(clearTimeout(this.timeOutObj),this.timeOutObj=null),this.removeEventListener(),this.element=null,this.parent.pivotFieldListModule&&!this.parent.pivotFieldListModule.isDestroyed&&(this.parent.pivotFieldListModule.destroy(),this.parent.pivotFieldListModule=null,_e.isNullOrUndefined(_e.select("#"+this.parent.element.id+"_PivotFieldList",document))||_e.remove(_e.select("#"+this.parent.element.id+"_PivotFieldList",document)))};Yl=cp;function cp(e){this.parent=e,(this.parent.fieldListModule=this).addEventListener()}mp.prototype.render=function(){(!this.parent.pivotButtonModule||this.parent.pivotButtonModule&&this.parent.pivotButtonModule.isDestroyed)&&new Xh(this.parent),this.parent.pivotButtonModule.cleanupButtonElements(),this.createPivotButtons();for(var e=[],t=(e=e.concat([].slice.call(this.parent.groupingBarModule.rowPanel.querySelectorAll("."+pe)))).length,i=0;i<t;i++){var a;this.parent.isTabular||(a=_e.createElement("span",{className:"e-indent-div",styles:this.parent.isTabular?"auto":"width:"+24*i+"px"}),this.tempElements.push(a),_e.prepend([a],e[i]))}},mp.prototype.createPivotButtons=function(){var e=[this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.values,this.parent.dataSourceSettings.filters],t=Array.prototype.slice.call(this.parent.element.querySelectorAll("."+ze+",."+We+",."+Qe+",."+Ye+",."+Ke));_e.isNullOrUndefined(this.parent.element.querySelector("."+Ui))&&t.push(this.parent.groupingBarModule.rowPanel);for(var i=0;i<t.length;i++){var a=t[i];0<this.parent.dataSourceSettings.values.length&&a.classList.contains(Li)&&0<this.parent.dataSourceSettings.columns.length&&a.classList.contains(Fi)||(a.innerHTML="")}if("pivot"===this.parent.dataType&&this.parent.dataSourceSettings.dataSource&&(!(this.parent.dataSourceSettings.dataSource instanceof ce.DataManager)&&0<this.parent.dataSourceSettings.dataSource.length||this.parent.dataSourceSettings.dataSource instanceof ce.DataManager&&this.parent.engineModule.data&&0<this.parent.engineModule.data.length)||"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 r=["rows","columns","values","filters"];if("pivot"===this.parent.dataType&&this.parent.groupingBarSettings.showFieldsPanel){r.push("all-fields"),e.push([]);for(var n=0,s=this.parent.engineModule&&this.parent.engineModule.fieldList?Object.keys(this.parent.engineModule.fieldList):[];n<s.length;n++){var o=s[n];this.parent.engineModule.fieldList[o]&&!this.parent.engineModule.fieldList[o].isSelected&&e[e.length-1].push(Ie.getFieldInfo(o,this.parent,!0).fieldItem)}}for(var l,i=0,d=e.length;i<d;i++)e[i]&&(l={field:e[i],axis:r[i].toString()},this.parent.notify(_r,l))}},mp.prototype.destroy=function(){for(var e=0;e<this.tempElements.length;e++){var t=this.tempElements[e];t&&t.parentNode&&t.parentNode.removeChild(t)}this.tempElements=[]};var gp=mp;function mp(e){this.tempElements=[],this.parent=e}Sp.prototype.getModuleName=function(){return"groupingBar"},Sp.prototype.renderLayout=function(){this.groupingTable=_e.createElement("div",{className:Ge});var e=_e.createElement("div",{className:se}),t=(this.rightAxisPanel=_e.createElement("div",{className:oe}),_e.createElement("div",{className:"e-axis-row e-axiscontainer"})),i=_e.createElement("div",{className:"e-axis-column e-axiscontainer"}),a=_e.createElement("div",{className:"e-axis-value e-axiscontainer"}),r=_e.createElement("div",{className:zt+" "+Gt+"container"}),n=(this.rowPanel=_e.createElement("div",{className:We+" "+He+(this.parent.isTabular?" e-tabular-group-rows":"")}),_e.createElement("div",{className:Qe+" "+Ve})),s=_e.createElement("div",{className:Ye+" "+Ue}),o=_e.createElement("div",{className:Ke+" "+Be});t.appendChild(this.rowPanel),i.appendChild(n),a.appendChild(s),r.appendChild(o),this.rowAxisPanel=t,e.appendChild(a),e.appendChild(t),this.rightAxisPanel.appendChild(r),this.rightAxisPanel.appendChild(i),this.groupingTable.appendChild(_e.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(qi),this.groupingTable.querySelector("."+We).classList.add(Ui);for(var l=0,d=[this.rowPanel,n,s,o];l<d.length;l++){var h=d[l];this.parent.groupingBarSettings.allowDragAndDrop&&new _e.Droppable(h,{}),this.unWireEvent(h),this.wireEvent(h)}"Table"!==this.parent.displayOption.view&&"Table"!==this.parent.groupingBarSettings.displayMode?(this.groupingChartTable=this.groupingTable.cloneNode(!0),_e.select("#"+this.parent.element.id+"_AllFields",this.groupingChartTable)&&(_e.select("#"+this.parent.element.id+"_AllFields",this.groupingChartTable).remove(),this.chartPanel=this.createToolbarUI(this.groupingChartTable)),this.groupingChartTable.classList.add(ki),this.groupingChartTable.classList.remove(qi),this.groupingChartTable.querySelector("."+We).classList.add(Ii),this.groupingChartTable.querySelector("."+We).classList.remove(Ui),this.parent.chartSettings.enableMultipleAxis&&this.parent.chartSettings.chartSeries&&["Pie","Pyramid","Doughnut","Funnel"].indexOf(this.parent.chartSettings.chartSeries.type)<0?this.groupingChartTable.querySelector("."+Ye).classList.add("e-group-chart-multi-values"):this.groupingChartTable.querySelector("."+Ye).classList.add(Li),this.parent.chartSettings.chartSeries&&-1<["Pie","Pyramid","Doughnut","Funnel"].indexOf(this.parent.chartSettings.chartSeries.type)?this.groupingChartTable.querySelector("."+Qe).classList.add(Fi):this.groupingChartTable.querySelector("."+Qe).classList.add("e-group-chart-accumulation-column"),this.groupingChartTable.querySelector("."+Ke).classList.add("e-group-chart-filters")):this.groupingChartTable=void 0,"Chart"!==this.parent.displayOption.view&&"Chart"!==this.parent.groupingBarSettings.displayMode||(this.groupingTable=void 0)},Sp.prototype.appendToElement=function(){var e=this.groupingTable||this.groupingChartTable;if(!_e.isNullOrUndefined(e)){var t=e.getElementsByClassName(se)[0],i=e.getElementsByClassName(Ke+" "+Be)[0],a=e.getElementsByClassName(Qe+" "+Ve)[0],e=e.getElementsByClassName(Ye+" "+Ue)[0];if((this.parent.element.querySelector("."+Wt)||this.parent.element.querySelector("."+Ei))&&this.parent.showGroupingBar){if(this.parent.element.querySelector("."+Ge))for(var r=this.parent.element.querySelectorAll("."+Ge),n=0;n<r.length;n++){var s=r[n];_e.remove(s)}if(this.groupingChartTable&&(_e.select("#"+this.parent.element.id+"_chart",this.parent.element)?(_e.setStyleAttribute(this.groupingChartTable,{width:_e.formatUnit(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())}),l=this.groupingChartTable.getElementsByClassName(se)[0],o=this.groupingChartTable.getElementsByClassName(Ye+" "+Ue)[0],this.parent.isAdaptive&&(this.parent.isTabular?(l.style.minWidth=this.parent.dataSourceSettings.rows.length*this.parent.gridSettings.columnWidth+"px",o.style.minWidth=this.parent.dataSourceSettings.rows.length*this.parent.gridSettings.columnWidth+"px"):(l.style.minWidth="180px",o.style.minWidth="180px")),this.parent.element.insertBefore(this.groupingChartTable,_e.select("#"+this.parent.element.id+"_chart",this.parent.element)),this.groupingChartTable.querySelector("."+le)&&null!=this.chartPanel&&!this.chartPanel.isDestroyed&&(l=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2,this.chartPanel.width=!this.parent.isAdaptive&&l<400?this.parent.minWidth||"398px":l,this.chartPanel.refreshOverflow(),this.parent.showFieldList)&&this.parent.pivotFieldListModule&&this.parent.pivotFieldListModule.element&&(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.alignIcon.bind(this)))):this.groupingChartTable=void 0),"Chart"!==this.parent.displayOption.view&&this.groupingTable){this.parent.isAdaptive&&(this.parent.isTabular?(t.style.minWidth=this.parent.dataSourceSettings.rows.length*this.parent.gridSettings.columnWidth+"px",e.style.minWidth=this.parent.dataSourceSettings.rows.length*this.parent.gridSettings.columnWidth+"px"):(t.style.minWidth="180px",e.style.minWidth="180px")),this.parent.firstColWidth&&(t.style.minWidth="auto",e.style.minWidth="auto"),i.removeAttribute("style"),a.removeAttribute("style"),this.rowPanel.removeAttribute("style");var o=void 0,o="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,o=(_e.isNullOrUndefined(o)||((l=this.parent.element.querySelector("."+gi).querySelector(".e-columnheader")).removeAttribute("style"),_e.addClass([l.querySelector("."+Ct)],"e-group-row"),l.querySelector(".e-group-row").querySelector(".e-headercelldiv").style.display="none",l.querySelector(".e-group-row").querySelector(".e-sortfilterdiv").style.display="none"),this.parent.element.insertBefore(this.groupingTable,this.parent.element.querySelector("."+Wt)),_e.setStyleAttribute(this.groupingTable,{width:_e.formatUnit(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())}),this.groupingTable&&this.groupingTable.querySelector("."+le)&&null!=this.gridPanel&&!this.gridPanel.isDestroyed&&(t=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2,this.gridPanel.width=!this.parent.isAdaptive&&t<400?this.parent.minWidth||"398px":t,this.gridPanel.refreshOverflow()),this.groupingTable.style.minWidth=this.parent.minWidth?this.parent.minWidth+"px":"400px",this.parent.axisFieldModule.render(),this.setGridRowWidth(),this.parent.element.querySelector("."+gi).querySelector("colgroup").children[0]),l=this.parent.isTabular?this.rowAxisWidth:parseInt(o.style.width,10),t=_e.formatUnit(this.groupingTable.offsetWidth-l),o=(_e.setStyleAttribute(e,{width:l+"px"}),_e.setStyleAttribute(this.rightAxisPanel,{width:t}),this.groupingTable.style.display="",e.offsetHeight/2),l=("Chart"===this.parent.displayOption.primary&&(this.groupingTable.style.display="none"),o>a.offsetHeight&&(_e.setStyleAttribute(i,{height:_e.formatUnit(o)}),_e.setStyleAttribute(a,{height:_e.formatUnit(2+o)})),this.parent.element.querySelector("."+gi).offsetHeight);_e.setStyleAttribute(this.rowPanel,{height:l+"px"}),this.parent.element.querySelector("."+gi).querySelector(".e-rhandler")&&(this.parent.element.querySelector("."+gi).querySelector(".e-rhandler").style.height=l+"px");for(var t=[].slice.call(this.parent.element.querySelector("."+gi).querySelector("thead").querySelectorAll("tr")).filter(function(e){return 0<e.childNodes.length}),d=l/t.length,h=0,p=t;h<p.length;h++){var u=p[h];_e.setStyleAttribute(u,{height:d+"px"});for(var c=0,g=[].slice.call(u.querySelectorAll(".e-rhandler"));c<g.length;c++){var m=g[c];_e.setStyleAttribute(m,{height:d+"px"})}}}else this.parent.axisFieldModule.render(),this.updateChartAxisHeight();this.parent.showToolbar&&"Both"===this.parent.displayOption.view&&(e="Table"===this.parent.currentView?".e-chart-grouping-bar":".e-pivot-grouping-bar",i=this.parent.element.querySelector(e))&&(i.style.display="none")}}},Sp.prototype.updateChartAxisHeight=function(){var e,t,i,a,r,n,s;this.groupingChartTable&&_e.select("#"+this.parent.element.id+"_chart",this.parent.element)&&(e=this.groupingChartTable.querySelector("."+oe),t=this.groupingChartTable.querySelector("."+se),s=this.groupingChartTable.querySelector("."+We),i=this.groupingChartTable.querySelector("."+Ye),a=this.groupingChartTable.querySelector("."+Ke),r=this.groupingChartTable.querySelector("."+Qe),s&&r&&(s.style.height="auto",r.style.height="auto",0<s.offsetHeight)&&0<r.offsetHeight&&(n=(s.offsetHeight>r.offsetHeight?s:r).offsetHeight,_e.setStyleAttribute(s,{height:_e.formatUnit(n)}),_e.setStyleAttribute(r,{height:_e.formatUnit(n)})),i&&a&&(i.style.height="auto",a.style.height="auto",0<i.offsetHeight)&&0<a.offsetHeight&&(n=(i.offsetHeight>a.offsetHeight?i:a).offsetHeight,_e.setStyleAttribute(i,{height:_e.formatUnit(n)}),_e.setStyleAttribute(a,{height:_e.formatUnit(n)})),s=_e.formatUnit(this.groupingChartTable.offsetWidth-Math.ceil(t.getBoundingClientRect().width)),_e.setStyleAttribute(i,{width:Math.ceil(i.getBoundingClientRect().width)+"px"}),_e.setStyleAttribute(e,{width:s}))},Sp.prototype.refreshUI=function(){if(this.groupingChartTable&&(_e.setStyleAttribute(this.groupingChartTable,{width:_e.formatUnit(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())}),this.groupingChartTable.querySelector("."+le)&&null!=this.chartPanel&&!this.chartPanel.isDestroyed&&(e=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2,this.chartPanel.width=!this.parent.isAdaptive&&e<400?this.parent.minWidth||"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))),this.groupingTable){var e=this.groupingTable.getElementsByClassName(Ye+" "+Ue)[0],t=(_e.setStyleAttribute(this.groupingTable,{width:_e.formatUnit(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())}),this.groupingTable&&this.groupingTable.querySelector("."+le)&&null!=this.gridPanel&&!this.gridPanel.isDestroyed&&(t=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2,this.gridPanel.width=!this.parent.isAdaptive&&t<400?this.parent.minWidth||"398px":t,this.gridPanel.refreshOverflow()),this.groupingTable.style.minWidth=this.parent.minWidth?this.parent.minWidth+"px":"400px",this.parent.element.querySelector("."+gi).querySelector("colgroup").children[0]),t=this.parent.isTabular?this.rowAxisWidth:parseInt(t.style.width,10),i=_e.formatUnit(this.groupingTable.offsetWidth-t);if(_e.setStyleAttribute(e,{width:t+"px"}),_e.setStyleAttribute(this.rightAxisPanel,{width:i}),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")){e=this.parent.element.querySelector("."+gi).querySelector(".e-columnheader"),t=(_e.addClass([e.querySelector("."+Ct)],"e-group-row"),_e.setStyleAttribute(this.rowPanel,{height:this.parent.element.querySelector("."+gi).offsetHeight+"px"}),e.querySelector(".e-group-row").appendChild(this.rowAxisPanel),_e.setStyleAttribute(e.querySelector(".e-group-row").querySelector(".e-headercelldiv"),{display:"none"}),_e.setStyleAttribute(e.querySelector(".e-group-row").querySelector(".e-sortfilterdiv"),{display:"none"}),this.parent.element.querySelector("."+gi).offsetHeight);_e.setStyleAttribute(this.rowPanel,{height:t+"px"}),this.parent.element.querySelector("."+gi).querySelector(".e-rhandler")&&(this.parent.element.querySelector("."+gi).querySelector(".e-rhandler").style.height=t+"px");for(var i=[].slice.call(this.parent.element.querySelector("."+gi).querySelector("thead").querySelectorAll("tr")).filter(function(e){return 0<e.childNodes.length}),a=t/i.length,r=0,n=i;r<n.length;r++){var s=n[r];_e.setStyleAttribute(s,{height:a+"px"});for(var o=0,l=[].slice.call(s.querySelectorAll(".e-rhandler"));o<l.length;o++){var d=l[o];d.parentElement.parentElement.querySelector("."+Qi)||_e.setStyleAttribute(d,{height:a+"px"})}}}}},Sp.prototype.alignIcon=function(){var e,t,i;this.parent.pivotFieldListModule&&(e=this.parent.pivotFieldListModule.element,i=void 0,i="Table"===this.parent.currentView?this.parent.grid?this.parent.grid.element.offsetWidth:i:this.parent.chart?this.parent.pivotChartModule.getCalulatedWidth():i)&&(t=i<(t=this.parent.minWidth||(this.parent.isAdaptive?300:400))?t:i,_e.setStyleAttribute(e.querySelector("."+X),{left:_e.formatUnit(this.parent.enableRtl?-Math.abs(t-e.querySelector("."+X).offsetWidth):t-e.querySelector("."+X).offsetWidth)}))},Sp.prototype.setGridRowWidth=function(){var e=this.parent.element.querySelector("."+gi).querySelector(".e-columnheader"),e=(_e.addClass([e.querySelector("."+Ct)],"e-group-row"),e.querySelector(".e-group-row").appendChild(this.rowAxisPanel),this.parent.element.querySelector("."+gi).querySelector("colgroup").children[0]);if(this.parent.isTabular&&this.setTabularWidth(),this.rowPanel.querySelector("."+Y))if(this.parent.isAdaptive){if(!this.parent.firstColWidth){if((i=this.parent.grid.columns)&&0<i.length)if(this.parent.isTabular){this.rowAxisWidth=this.parent.dataSourceSettings.rows.length*this.parent.gridSettings.columnWidth;for(var t=0;t<this.parent.engineModule.rowMaxLevel;t++)i[t].width=this.parent.gridSettings.columnWidth}else i[0].width=this.resColWidth;this.parent.posCount=0,this.parent.grid.headerModule.refreshUI()}}else{for(var i,a,r,n=[].slice.call(this.rowPanel.querySelectorAll("."+pe)),s=n[n.length-1],o=this.parent.isTabular?0:s.querySelector(".e-indent-div").offsetWidth+20,s=s.querySelector("."+Y).offsetWidth+o,o=_e.formatUnit(s<this.resColWidth?this.resColWidth:s),s=this.parent.element.querySelector("."+gi).querySelector("."+Ct),l=this.parent.element.querySelector("."+ue).querySelector("colgroup").children[0],d=parseInt(o,10),h=0<this.parent.pivotColumns.length,p=((i=this.parent.grid.columns)&&0<i.length&&(i[0].width=i[0].autoFit?i[0].width:d>this.resColWidth?d:this.resColWidth),void 0),p="olap"===this.parent.dataType?this.parent.renderModule.calculateColWidth(0<this.parent.olapEngineModule.pivotValues.length?this.parent.olapEngineModule.pivotValues[0].length:2):this.parent.renderModule.calculateColWidth(0<this.parent.dataSourceSettings.values.length&&0<this.parent.engineModule.pivotValues.length?this.parent.engineModule.pivotValues[0].length:2),u=0;u<i.length;u++)0!==u&&(i[u].columns?this.parent.setCommonColumnsWidth(this.parent.renderModule.pivotColumns[u].columns,p):"auto"!==i[u].width?(a=i[u].customAttributes?i[u].customAttributes.cell.valueSort.levelName:"",a=this.parent.renderModule.setSavedWidth(a,p),i[u].width=i[u].autoFit||h&&this.parent.pivotColumns[u].autoFit?i[u].width:this.parent.renderModule.lastColumn&&this.parent.renderModule.lastColumn.field===i[u].field?a-3:a):i[u].minWidth=p);this.parent.isTabular&&((r=this.parent.pivotValues[d=0])&&_e.isNullOrUndefined(r[0])&&(d=r.lastIndexOf("Server"===this.parent.dataSourceSettings.mode?null:void 0)+1),250<this.rowAxisWidth)&&1<d&&(r=n[0].getBoundingClientRect().width+6,o=this.rowAxisWidth<d*r||1<d?r+"px":this.rowAxisWidth-(d-1)*r+"px"),this.parent.posCount=0,this.parent.setGridColumns(this.parent.grid.columns),this.parent.firstColWidth||(o=this.parent.isTabular?this.resColWidth.toString():i[0].autoFit?i[0].width.toString():o,e.style.width=o,l.style.width=o,s.style.width=o,_e.setStyleAttribute(s,{width:o}))}else this.parent.grid.columns&&0<this.parent.grid.columns.length&&(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()},Sp.prototype.wireEvent=function(e){_e.EventHandler.add(e,"mouseover",this.dropIndicatorUpdate,this),_e.EventHandler.add(e,"mouseleave",this.dropIndicatorUpdate,this)},Sp.prototype.unWireEvent=function(e){e&&(_e.EventHandler.remove(e,"mouseover",this.dropIndicatorUpdate),_e.EventHandler.remove(e,"mouseleave",this.dropIndicatorUpdate))},Sp.prototype.dropIndicatorUpdate=function(e){(this.parent.isDragging&&e.target.classList.contains(qe)&&"mouseover"===e.type||!this.parent.isDragging||!e.target.classList.contains(qe)&&"mouseleave"===e.type)&&(_e.removeClass([].slice.call(this.parent.element.querySelectorAll("."+Te)),Me),_e.removeClass([].slice.call(this.parent.element.querySelectorAll("."+Te+"-last")),Me))},Sp.prototype.tapHoldHandler=function(e){var t,e=_e.closest(e.originalEvent.target,"."+Y);!_e.isNullOrUndefined(e)&&this.parent.isAdaptive&&(t=e.getBoundingClientRect(),this.parent.contextMenuModule.fieldElement=e,this.parent.contextMenuModule.menuObj.open(t.top,t.left))},Sp.prototype.RefreshFieldsPanel=function(){if("pivot"===this.parent.dataType&&null!=this.parent.groupingBarSettings){if(0<_e.selectAll("#"+this.parent.element.id+"_AllFields",this.parent.element).length)for(var e=0,t=_e.selectAll("#"+this.parent.element.id+"_AllFields",this.parent.element);e<t.length;e++)t[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())}},Sp.prototype.createToolbarUI=function(e){_e.select("#"+this.parent.element.id+"_AllFields",e)&&_e.select("#"+this.parent.element.id+"_AllFields",e).remove(),e.prepend(_e.createElement("div",{id:this.parent.element.id+"_AllFields"}));var t=new D.Toolbar({cssClass:le+(this.parent.cssClass?" "+this.parent.cssClass:""),enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,items:[{template:"<div class="+ze+"></div>"}],allowKeyboard:!1,width:this.parent.gridSettings.allowAutoResizing?"auto":this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2});return t.appendTo(_e.select("#"+this.parent.element.id+"_AllFields",e)),t},Sp.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Vr,this.renderLayout,this),this.parent.on(Rr,this.appendToElement,this))},Sp.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Rr,this.appendToElement),this.parent.off(Vr,this.renderLayout))},Sp.prototype.destroy=function(){var t=this;if(!this.isDestroyed){this.timeOutObj&&(clearTimeout(this.timeOutObj),this.timeOutObj=null),this.removeEventListener();[this.rowPanel,this.groupingTable?this.groupingTable.querySelector("."+Qe):null,this.groupingTable?this.groupingTable.querySelector("."+Ye):null,this.groupingTable?this.groupingTable.querySelector("."+Ke):null].forEach(function(e){e&&t.unWireEvent(e)}),this.parent.pivotButtonModule&&(this.parent.pivotButtonModule.destroy(),this.parent.pivotButtonModule=null),this.parent.axisFieldModule&&(this.parent.axisFieldModule.destroy(),this.parent.axisFieldModule=null),this.gridPanel&&!this.gridPanel.isDestroyed&&(this.gridPanel.destroy(),this.gridPanel=null),this.chartPanel&&!this.chartPanel.isDestroyed&&(this.chartPanel.destroy(),this.chartPanel=null),this.touchObj&&!this.touchObj.isDestroyed&&(this.touchObj.destroy(),this.touchObj=null);var e=this.parent.element.querySelectorAll("."+Ge);if(0<e.length)for(var i=0;i<e.length;i++)_e.remove(e[i]);e=null,this.groupingChartTable&&(this.removeAllEventListeners(this.groupingChartTable),this.groupingChartTable=null),this.groupingTable&&(this.removeAllEventListeners(this.groupingTable),this.groupingTable=null),this.rowPanel=null,this.rowAxisPanel=null,this.rightAxisPanel=null,this.rowAxisWidth=0,this.resColWidth=0,this.isDestroyed=!0}},Sp.prototype.removeAllEventListeners=function(e){if(e){for(var t=e.querySelectorAll("."+qe),i=0;i<t.length;i++)this.unWireEvent(t[i]);for(var a=e.querySelectorAll("."+Y),i=0;i<a.length;i++)_e.EventHandler.remove(a[i],"mouseover",this.dropIndicatorUpdate),_e.EventHandler.remove(a[i],"mouseleave",this.dropIndicatorUpdate)}},Sp.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},Sp.prototype.setTabularWidth=function(){var e;"row"===this.parent.dataSourceSettings.valueAxis?this.rowAxisWidth=this.rowAxisPanel.querySelector(".e-tabular-group-rows").getBoundingClientRect().width:(e=this.rowAxisPanel.querySelectorAll("."+pe),this.rowAxisWidth=this.getPivotButtonsTotalWidth(e),0===this.parent.engineModule.rowMaxLevel&&1===e.length&&(this.rowAxisWidth=250),.8*this.parent.element.getBoundingClientRect().width<=this.rowAxisWidth&&(this.rowAxisWidth=e.length*this.parent.gridSettings.columnWidth))};wl=Sp;function Sp(e){this.rowAxisWidth=0,this.isDestroyed=!1,this.parent=e,(this.parent.groupingBarModule=this).resColWidth=this.parent.isAdaptive?180:249,this.addEventListener(),this.parent.axisFieldModule=new gp(this.parent),this.touchObj=new _e.Touch(this.parent.element,{tapHold:this.tapHoldHandler.bind(this)})}fp.prototype.getModuleName=function(){return"conditionalFormatting"},fp.prototype.createDialog=function(){null!==_e.select("#"+this.parentID+"conditionalformatting",document)&&_e.remove(_e.select("#"+this.parentID+"conditionalformatting",document));var e=_e.createElement("div",{id:this.parentID+"conditionalformatting",className:"e-pivot-formatting-dialog"}),t=(this.parent.element.appendChild(e),[{click:this.addButtonClick.bind(this),isFlat:!1,buttonModel:{cssClass:(this.parent.isAdaptive?"e-small e-round "+ei:ei)+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:W+" "+rt,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")}}]),t=this.parent.isAdaptive?new P.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:t,beforeOpen:this.beforeOpen.bind(this),close:this.removeDialog.bind(this),cssClass:this.parent.cssClass,header:this.parent.localeObj.getConstant("conditionalFormatting"),target:document.body}):new P.Dialog({allowDragging:!0,position:{X:"center",Y:this.parent.element.offsetTop},buttons:t,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});t.isStringTemplate=!0,t.appendTo(e)},fp.prototype.beforeOpen=function(){_e.select("#"+this.parentID+"conditionalformatting",document).querySelector("."+ni).setAttribute("title",this.parent.localeObj.getConstant("conditionalFormatting"))},fp.prototype.addButtonClick=function(){var t=this,i=this;this.parent.trigger(yr,{conditions:"LessThan",value1:0,applyGrandTotals:!0,style:{backgroundColor:"white",color:"black",fontFamily:"Arial",fontSize:"12px"}},function(e){i.refreshConditionValues(),t.destroyColorPickers(),i.newFormat.push(e),i.addFormat()})},fp.prototype.applyButtonClick=function(){var e;this.refreshConditionValues()&&(this.parent.setProperties({dataSourceSettings:{conditionalFormatSettings:this.newFormat}},!0),e={conditionalFormattingInfo:this.parent.dataSourceSettings.conditionalFormatSettings},this.parent.actionObj.actionInfo=e,0<this.parent.dataSourceSettings.values.length&&this.parent.renderPivotGrid(),_e.getInstance(_e.select("#"+this.parentID+"conditionalformatting",document),P.Dialog).close())},fp.prototype.cancelButtonClick=function(){_e.getInstance(_e.select("#"+this.parentID+"conditionalformatting",document),P.Dialog).close(),this.newFormat=[]},fp.prototype.refreshConditionValues=function(){for(var e=0;e<this.newFormat.length;e++){if(""===_e.select("#"+this.parentID+"conditionvalue1"+e,document).value||""===_e.select("#"+this.parentID+"conditionvalue2"+e,document).value)return(""===_e.select("#"+this.parentID+"conditionvalue1"+e,document).value?_e.select("#"+this.parentID+"conditionvalue1"+e,document):_e.select("#"+this.parentID+"conditionvalue2"+e,document)).focus(),!1;this.newFormat[e].value1=Number(_e.select("#"+this.parentID+"conditionvalue1"+e,document).value),this.newFormat[e].value2=Number(_e.select("#"+this.parentID+"conditionvalue2"+e,document).value)}return!0},fp.prototype.addFormat=function(){for(var e,t,i=_e.createElement("div",{id:this.parentID+"formatDiv",className:"e-new-format"}),a=0;a<this.newFormat.length;a++)i.appendChild(this.createDialogElements(a));0===this.newFormat.length&&(e=this.createDialogElements(),(t=_e.createElement("p",{id:this.parentID+"emptyFormat",className:"e-pivot-conditional-empty-format"})).innerText=this.parent.localeObj.getConstant("emptyFormat"),e.appendChild(t),i.appendChild(e)),_e.getInstance(_e.select("#"+this.parentID+"conditionalformatting",document),P.Dialog).setProperties({content:i},!1);for(a=0;a<this.newFormat.length;a++)this.renderDropDowns(a),this.renderColorPicker(a)},fp.prototype.createDialogElements=function(e){var t,i,a,r,n,s,o,l,d,h=_e.createElement("div",{id:this.parentID+"outerDiv"+e,className:"e-format-outer-div"});return void 0!==e&&(n=this.newFormat[e],t=_e.createElement("button",{id:this.parentID+"removeButton"+e,className:"e-format-delete-button",attrs:{type:"button",title:this.parent.localeObj.getConstant("delete")}}),h.appendChild(t),t=_e.createElement("div",{id:this.parentID+"innerDiv"+e,className:"e-format-inner-div"}),o=_e.createElement("table",{id:this.parentID+"_valueTable"+e,className:ti,attrs:{role:"table"}}),r=_e.createElement("tr"),a=_e.createElement("td"),(l=_e.createElement("span",{id:this.parentID+"valuelabel"+e,className:"e-format-value-label"})).innerText=this.parent.localeObj.getConstant("value"),a.appendChild(l),r.appendChild(a),o.appendChild(r),r=_e.createElement("tr"),a=_e.createElement("td"),l=_e.createElement("div",{id:this.parentID+"measure"+e}),i=_e.createElement("input",{id:this.parentID+"measureinput"+e,attrs:{type:"text",tabindex:"0"}}),l.appendChild(i),a.appendChild(l),r.appendChild(a),a=_e.createElement("td"),i=_e.createElement("div",{id:this.parentID+"condition"+e}),l=_e.createElement("input",{id:this.parentID+"conditioninput"+e,attrs:{type:"text",tabindex:"0"}}),i.appendChild(l),a.appendChild(i),r.appendChild(a),a=_e.createElement("td",{attrs:{style:"display:table"},className:"e-format-input-value"}),l="Between"!==n.conditions&&"NotBetween"!==n.conditions?ai:"",i=_e.createElement("div",{attrs:{style:"display: table-row;"}}),d=_e.createElement("div",{id:this.parentID+"ConditionValue1"+e,attrs:{style:"display: table-cell;"}}),s=_e.createElement("input",{id:this.parentID+"conditionvalue1"+e,attrs:{type:"text",tabindex:"0",value:_e.isNullOrUndefined(n.value1)?"0":n.value1.toString(),placeholder:this.parent.localeObj.getConstant("emptyInput")}}),d.appendChild(s),i.appendChild(d),s=_e.createElement("span",{id:this.parentID+"valuespan"+e,className:"e-format-value-span "+l,innerHTML:"&"}),i.appendChild(s),d=_e.createElement("div",{id:this.parentID+"ConditionValue2"+e,attrs:{style:"display: table-cell;"}}),l=_e.createElement("input",{id:this.parentID+"conditionvalue2"+e,attrs:{type:"text",tabindex:"0",value:_e.isNullOrUndefined(n.value2)?"0":n.value2.toString(),placeholder:this.parent.localeObj.getConstant("emptyInput")}}),d.appendChild(l),i.appendChild(d),a.appendChild(i),r.appendChild(a),o.appendChild(r),t.appendChild(o),s=_e.createElement("table",{id:this.parentID+"_grandTotalTable"+e,className:ti+" e-grandtotal-checkbox-table",attrs:{role:"table"}}),n=_e.createElement("tr"),l=_e.createElement("td"),s.appendChild(n),d=_e.createElement("input",{id:this.parentID+"grandtotalcheckbox"+e,attrs:{type:"checkbox",tabindex:"0"}}),l.appendChild(d),n.appendChild(l),s.appendChild(n),t.appendChild(s),i=_e.createElement("table",{id:this.parentID+"_formatTable"+e,className:ti,attrs:{role:"table"}}),a=_e.createElement("tr"),r=_e.createElement("td"),(o=_e.createElement("span",{id:this.parentID+"formatlabel"+e,className:"e-format-label"})).innerText=this.parent.localeObj.getConstant("formatLabel"),r.appendChild(o),a.appendChild(r),i.appendChild(a),a=_e.createElement("tr"),r=_e.createElement("td"),d=_e.createElement("div",{id:this.parentID+"fontname"+e}),l=_e.createElement("input",{id:this.parentID+"fontnameinput"+e,attrs:{type:"text",tabindex:"0"}}),d.appendChild(l),r.appendChild(d),a.appendChild(r),r=_e.createElement("td"),n=_e.createElement("div",{id:this.parentID+"fontsize"+e}),s=_e.createElement("input",{id:this.parentID+"fontsizeinput"+e,attrs:{type:"text",tabindex:"0"}}),n.appendChild(s),r.appendChild(n),a.appendChild(r),this.parent.isAdaptive&&(i.appendChild(a),a=_e.createElement("tr"),i.appendChild(a),a=_e.createElement("tr")),r=_e.createElement("td"),o=_e.createElement("input",{id:this.parentID+"fontcolor"+e,attrs:{type:"color",tabindex:"0"},className:"e-format-font-color"}),r.appendChild(o),l=_e.createElement("input",{id:this.parentID+"backgroundcolor"+e,attrs:{type:"color",tabindex:"0"},className:"e-format-back-color"}),r.appendChild(l),a.appendChild(r),r=_e.createElement("td"),d=_e.createElement("input",{id:this.parentID+"valuepreview"+e,className:ii+" e-format-value-preview",attrs:{tabindex:"-1",readonly:"true",value:"123.45"}}),r.appendChild(d),a.appendChild(r),i.appendChild(a),t.appendChild(i),h.appendChild(t)),h},fp.prototype.renderDropDowns=function(e){var t=_e.getInstance(_e.select("#"+this.parentID+"conditionalformatting",document),P.Dialog).element,i=this.newFormat[e],a=[];a.push({index:0,name:this.parent.localeObj.getConstant("AllValues"),field:this.parent.localeObj.getConstant("AllValues")});for(var r=0;r<this.parent.dataSourceSettings.values.length;r++){var n=this.parent.dataSourceSettings.values[r].caption||this.parent.dataSourceSettings.values[r].name,n=this.parent.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(n):n;a.push({index:r+1,name:n,field:this.parent.dataSourceSettings.values[r].name})}var s=_e.isNullOrUndefined(i.measure)?this.parent.localeObj.getConstant("AllValues"):i.measure,o=[],o=(o[e]=new G.DropDownList({dataSource:a,fields:{text:"name",value:"field"},value:s,width:"100%",cssClass:this.parent.cssClass,popupHeight:"200px",popupWidth:"auto",locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:this.measureChange.bind(this,e)}),o[e].isStringTemplate=!0,o[e].appendTo(_e.select("#"+this.parentID+"measureinput"+e,t)),[{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")}]),s=_e.isNullOrUndefined(i.conditions)?"LessThan":i.conditions,l=[],o=(l[e]=new G.DropDownList({dataSource:o,fields:{value:"value",text:"name"},value:s,width:"100%",cssClass:this.parent.cssClass,popupHeight:"200px",popupWidth:"auto",locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:this.conditionChange.bind(this,e)}),l[e].isStringTemplate=!0,l[e].appendTo(_e.select("#"+this.parentID+"conditioninput"+e,t)),"Between"!==this.newFormat[e].conditions&&"NotBetween"!==this.newFormat[e].conditions?ai:""),l=new H.TextBox({enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-format-value1 "+this.parent.cssClass,width:"auto"}),l=(l.isStringTemplate=!0,l.appendTo(_e.select("#"+this.parentID+"conditionvalue1"+e,t)),new H.TextBox({enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-format-value2 "+o+" "+this.parent.cssClass,width:"auto"})),o=(l.isStringTemplate=!0,l.appendTo(_e.select("#"+this.parentID+"conditionvalue2"+e,t)),new z.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})),l=(o.isStringTemplate=!0,o.appendTo(_e.select("#"+this.parentID+"grandtotalcheckbox"+e,t)),s=_e.isNullOrUndefined(i.style.fontFamily)?"Arial":i.style.fontFamily,[]),o=(l[e]=new G.DropDownList({dataSource:[{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"}],fields:{text:"name"},value:s,width:"100%",cssClass:this.parent.cssClass,popupHeight:"200px",popupWidth:"auto",locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:this.fontNameChange.bind(this,e)}),l[e].isStringTemplate=!0,l[e].appendTo(_e.select("#"+this.parentID+"fontnameinput"+e,t)),s=_e.isNullOrUndefined(i.style.fontSize)?"12px":i.style.fontSize,[]);o[e]=new G.DropDownList({dataSource:[{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"}],fields:{text:"name"},popupHeight:"200px",popupWidth:"auto",value:s,width:"100%",change:this.fontSizeChange.bind(this,e),locale:this.parent.locale,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass}),o[e].isStringTemplate=!0,o[e].appendTo(_e.select("#"+this.parentID+"fontsizeinput"+e,t))},fp.prototype.conditionChange=function(e,t){this.newFormat[e].conditions=t.value;var i=_e.select("#"+this.parentID+"valuespan"+e,document),e=_e.select("#"+this.parentID+"conditionvalue2"+e,document);"Between"===t.value||"NotBetween"===t.value?(i.classList.remove(ai),e.parentElement.classList.remove(ai)):(i.classList.add(ai),e.parentElement.classList.add(ai))},fp.prototype.onCheckChange=function(e,t){this.newFormat[e].applyGrandTotals=t.checked},fp.prototype.fontNameChange=function(e,t){this.newFormat[e].style.fontFamily=t.value.toString(),_e.select("#"+this.parentID+"valuepreview"+e,document).style.fontFamily=t.value},fp.prototype.fontSizeChange=function(e,t){this.newFormat[e].style.fontSize=t.value.toString(),_e.select("#"+this.parentID+"valuepreview"+e,document).style.fontSize=t.value},fp.prototype.measureChange=function(e,t){this.newFormat[e].measure=t.value.toString()===this.parent.localeObj.getConstant("AllValues")?void 0:t.value.toString()},fp.prototype.renderColorPicker=function(e){var t=_e.getInstance(_e.select("#"+this.parentID+"conditionalformatting",document),P.Dialog).element,i=this.newFormat[e],a=_e.isNullOrUndefined(i.style.color)?"black":i.style.color,r="#"===a.charAt(0)&&this.isHex(a.substr(1))?a:this.colourNameToHex(a),a=(_e.select("#"+this.parentID+"valuepreview"+e,document).style.color=r,this.fontColor[e]=new H.ColorPicker({cssClass:ri+" e-format-font-color-picker"+(this.parent.cssClass?" "+this.parent.cssClass:""),value:r,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(_e.select("#"+this.parentID+"fontcolor"+e,t)),_e.addClass([this.fontColor[e].element.nextElementSibling.querySelector(".e-selected-color")],W),r="#"===(a=_e.isNullOrUndefined(i.style.backgroundColor)?"white":i.style.backgroundColor).charAt(0)&&this.isHex(a.substr(1))?a:this.colourNameToHex(a),_e.select("#"+this.parentID+"valuepreview"+e,document).style.backgroundColor=r,_e.select("#"+this.parentID+"valuepreview"+e,document).style.fontFamily=i.style.fontFamily,_e.select("#"+this.parentID+"valuepreview"+e,document).style.fontSize=i.style.fontSize,this.backgroundColor[e]=new H.ColorPicker({cssClass:ri+(this.parent.cssClass?" "+this.parent.cssClass:""),value:r,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(_e.select("#"+this.parentID+"backgroundcolor"+e,t)),_e.addClass([this.backgroundColor[e].element.nextElementSibling.querySelector(".e-selected-color")],W),new z.Button({iconCss:W+" 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}));a.isStringTemplate=!0,a.appendTo(_e.select("#"+this.parentID+"removeButton"+e,t)),a.element.onclick=this.toggleButtonClick.bind(this,e)},fp.prototype.backColorChange=function(e,t){this.newFormat[e].style.backgroundColor=t.currentValue.hex,_e.select("#"+this.parentID+"valuepreview"+e,document).style.backgroundColor=t.currentValue.hex},fp.prototype.fontColorChange=function(e,t){this.newFormat[e].style.color=t.currentValue.hex,_e.select("#"+this.parentID+"valuepreview"+e,document).style.color=t.currentValue.hex},fp.prototype.toggleButtonClick=function(e){this.destroyColorPickers(),this.newFormat.splice(e,1),this.addFormat()},fp.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},fp.prototype.hexToRgb=function(e){e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null},fp.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=0;r<i.length-1;r++)i[r]=(+i[r]).toString(16),1===i[r].length&&(i[r]="0"+i[r]),a+=i[r];return"#"+a+Math.round(255*+i[3]).toString(16)}if(0!==e.search("rgb"))return"#d5d5d5";for(i=e.substr(4).split(")")[0].split(","),a="",r=0;r<i.length;r++)i[r]=(+i[r]).toString(16),1===i[r].length&&(i[r]="0"+i[r]),a+=i[r];return"#"+a},fp.prototype.removeDialog=function(){var e=_e.select("#"+this.parentID+"conditionalformatting",document),t=e?_e.getInstance(e,P.Dialog):null;t&&!t.isDestroyed&&(this.destroyColorPickers(),this.removeEventListeners(),t.destroy()),e&&_e.remove(e),this.fontColor=[],this.backgroundColor=[],this.newFormat=[]},fp.prototype.removeEventListeners=function(){for(var e=0;e<(this.newFormat?this.newFormat.length:0);e++){var t=_e.select("#"+this.parentID+"removeButton"+e,document);t&&(t.onclick=null)}},fp.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(),this.destroyDropDowns(e),this.destroyOtherComponents(e)},fp.prototype.destroyDropDowns=function(e){var t,i=_e.select("#"+this.parentID+"conditionalformatting",document);i&&((t=_e.select("#"+this.parentID+"measureinput"+e,i))&&(t=_e.getInstance(t,G.DropDownList))&&!t.isDestroyed&&t.destroy(),(t=_e.select("#"+this.parentID+"conditioninput"+e,i))&&(t=_e.getInstance(t,G.DropDownList))&&!t.isDestroyed&&t.destroy(),(t=_e.select("#"+this.parentID+"fontnameinput"+e,i))&&(t=_e.getInstance(t,G.DropDownList))&&!t.isDestroyed&&t.destroy(),t=_e.select("#"+this.parentID+"fontsizeinput"+e,i))&&(e=_e.getInstance(t,G.DropDownList))&&!e.isDestroyed&&e.destroy()},fp.prototype.destroyOtherComponents=function(e){var t,i=_e.select("#"+this.parentID+"conditionalformatting",document);i&&((t=_e.select("#"+this.parentID+"conditionvalue1"+e,i))&&(t=_e.getInstance(t,H.TextBox))&&!t.isDestroyed&&t.destroy(),(t=_e.select("#"+this.parentID+"conditionvalue2"+e,i))&&(t=_e.getInstance(t,H.TextBox))&&!t.isDestroyed&&t.destroy(),(t=_e.select("#"+this.parentID+"grandtotalcheckbox"+e,i))&&(t=_e.getInstance(t,z.CheckBox))&&!t.isDestroyed&&t.destroy(),t=_e.select("#"+this.parentID+"removeButton"+e,i))&&(e=_e.getInstance(t,z.Button))&&!e.isDestroyed&&e.destroy()},fp.prototype.showConditionalFormattingDialog=function(){this.newFormat=[];for(var e=0;e<this.parent.dataSourceSettings.conditionalFormatSettings.length;e++)this.newFormat.push(_e.extend({},this.parent.dataSourceSettings.conditionalFormatSettings[e].properties,null,!0));this.createDialog(),_e.getInstance(_e.select("#"+this.parentID+"conditionalformatting",document),P.Dialog).refresh(),this.addFormat()},fp.prototype.destroy=function(){var e=_e.select("#"+this.parentID+"conditionalformatting",document),e=e?_e.getInstance(e,P.Dialog):null;e&&!e.isDestroyed&&e.close()};bl=fp;function fp(e){this.parent=e,(this.parent.conditionalFormattingModule=this).parentID=this.parent.element.id,this.fontColor=[],this.backgroundColor=[],this.newFormat=[]}M.prototype.getModuleName=function(){return"toolbar"},M.prototype.createToolbar=function(){this.parent.isModified=!1,this.renderDialog(),null!==_e.select("#"+this.parent.element.id+"pivot-toolbar",this.parent.element)&&_e.remove(_e.select("#"+this.parent.element.id+"pivot-toolbar",this.parent.element));var e=_e.createElement("div",{id:this.parent.element.id+"pivot-toolbar",className:Di}),t=(this.parent.showFieldList&&_e.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)?this.parent.element.insertBefore(e,_e.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)):this.parent.showGroupingBar&&_e.select("#"+this.parent.element.id+" .e-pivot-grouping-bar",this.parent.element)?this.parent.element.insertBefore(e,_e.select("#"+this.parent.element.id+" .e-pivot-grouping-bar",this.parent.element)):!(t=_e.select("#"+this.parent.element.id+"_chart",this.parent.element))||"Chart"!==this.parent.displayOption.view&&"Chart"!==this.parent.displayOption.primary?this.parent.element.insertBefore(e,_e.select("#"+this.parent.element.id+"_grid",this.parent.element)):this.parent.element.insertBefore(e,t),this.toolbar=new D.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,"viewContainerRef");this.parent[t]&&(_e.setValue("registeredTemplate",{},this.toolbar),this.toolbar[t]=this.parent[t]),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("."+Di)),this.toolbar.element.classList.add(Di)):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():this.parent.getWidthAsNumber()).toString()},!0),this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+Ge)&&this.parent.groupingBarModule.refreshUI()},M.prototype.fetchReports=function(){var e={reportName:[]};return this.parent.trigger(ka,e),e},M.prototype.fetchReportsArgs=function(){var t=new ce.Deferred;return this.parent.trigger(ka,{reportName:[]},function(e){t.resolve(e)}),t},M.prototype.getItems=function(){for(var e=this.parent.toolbar.filter(function(e,t,i){return i.indexOf(e)===t}),t=[],i=0,a=e;i<a.length;i++){var r=a[i];switch(r){case"New":t.push({prefixIcon:"e-new-report "+W,tooltipText:this.parent.localeObj.getConstant("new"),click:this.actionClick.bind(this),id:this.parent.element.id+"new"});break;case"Save":t.push({prefixIcon:"e-save-report "+W,tooltipText:this.parent.localeObj.getConstant("save"),click:this.actionClick.bind(this),id:this.parent.element.id+"save"});break;case"SaveAs":t.push({prefixIcon:"e-saveas-report "+W,tooltipText:this.parent.localeObj.getConstant("saveAs"),click:this.actionClick.bind(this),id:this.parent.element.id+"saveas"});break;case"Rename":t.push({prefixIcon:"e-rename-report "+W,tooltipText:this.parent.localeObj.getConstant("rename"),click:this.actionClick.bind(this),id:this.parent.element.id+"rename"});break;case"Remove":t.push({prefixIcon:Mi+" "+W,tooltipText:this.parent.localeObj.getConstant("deleteReport"),click:this.actionClick.bind(this),id:this.parent.element.id+"remove"});break;case"Load":t.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 n="Chart"===this.parent.displayOption.view;t.push({prefixIcon:Pi+" "+W,tooltipText:this.parent.localeObj.getConstant("grid"),id:this.parent.element.id+"grid",cssClass:(n?b:"")+(this.parent.cssClass?" "+this.parent.cssClass:""),click:this.menuItemClick.bind(this)});break;case"Chart":n="Table"===this.parent.displayOption.view;t.push({template:'<ul id="'+this.parent.element.id+'chart_menu"></ul>',id:this.parent.element.id+"chartmenu",cssClass:(n?b:"")+(this.parent.cssClass?" "+this.parent.cssClass:"")});break;case"MDX":"olap"===this.parent.dataType&&t.push({prefixIcon:"e-mdx "+W,id:this.parent.element.id+"mdxQuery",click:this.actionClick.bind(this),tooltipText:this.parent.localeObj.getConstant("mdxQuery")});break;case"Export":t.push({template:'<ul id="'+this.parent.element.id+'export_menu"></ul>',id:this.parent.element.id+"exportmenu"});break;case"SubTotal":t.push({template:'<ul id="'+this.parent.element.id+'subtotal_menu"></ul>',id:this.parent.element.id+"subtotalmenu"});break;case"GrandTotal":t.push({template:'<ul id="'+this.parent.element.id+'grandtotal_menu"></ul>',id:this.parent.element.id+"grandtotalmenu"});break;case"ConditionalFormatting":t.push({prefixIcon:"e-toolbar-formatting "+W,id:this.parent.element.id+"formatting",click:this.actionClick.bind(this),tooltipText:this.parent.localeObj.getConstant("toolbarFormatting")});break;case"NumberFormatting":t.push({prefixIcon:"e-pivot-format-toolbar "+W,id:this.parent.element.id+"numberFormatting",click:this.actionClick.bind(this),tooltipText:this.parent.localeObj.getConstant("numberFormat")});break;case"Formatting":t.push({template:'<ul id="'+this.parent.element.id+'formatting_menu"></ul>',id:this.parent.element.id+"formattingmenu"});break;case"FieldList":t.push({prefixIcon:"e-toolbar-fieldlist "+W,tooltipText:this.parent.localeObj.getConstant("fieldList"),click:this.actionClick.bind(this),align:"Right",id:this.parent.element.id+"fieldlist"}),this.parent.element.querySelector("."+X)&&(this.parent.element.querySelector("."+X).style.display="none");break;default:"object"==typeof r&&t.push(r)}}return this.parent.showFieldList&&-1===e.indexOf("FieldList")&&_e.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)&&"none"===_e.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element).style.display&&(_e.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element).style.display="block"),this.parent.trigger(Ua,{customToolbar:t}),t},M.prototype.reportChange=function(e){if(this.parent.actionObj.actionName=Pn,this.isReportChange=!0,this.parent.actionBeginMethod())e.cancel=!0;else 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)}},M.prototype.reportLoad=function(e){var t,i=this;"Save"!==this.action&&"Rename"!==this.action&&"New"!==this.action&&(t={reportName:e.itemData.value},e={reportName:e.itemData.value},this.parent.actionObj.actionInfo=e,this.parent.trigger(ja,t,function(e){i.currentReport=e.reportName,i.parent.isModified=!1}))},M.prototype.saveReport=function(e){var t,i;this.currentReport&&""!==this.currentReport&&e.item.id===this.parent.element.id+"save"?(t={report:this.getCurrentReport(),reportName:this.currentReport},this.parent.actionObj.actionName=this.parent.getActionCompleteName(),i={reportName:this.currentReport},this.parent.actionObj.actionInfo=i,this.parent.trigger(Ra,t),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod(),this.parent.isModified=!1):""!==this.currentReport||e.item.id!==this.parent.element.id+"save"&&e.item.id!==this.parent.element.id+"saveas"?this.dialogShow(e,"saveAs"):this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("emptyReport"))},M.prototype.mdxQueryDialog=function(){_e.select("#"+this.parent.element.id+"mdx-dialog",document)||this.renderMDXDialog();var e=_e.getInstance(_e.select("#"+this.parent.element.id+"mdx-dialog",document),P.Dialog),t=_e.createElement("div",{className:"e-mdx-query"}),i=_e.createElement("textarea",{className:Hi,attrs:{readonly:"readonly","aria-label":this.parent.localeObj.getConstant("mdxQuery")}});i.innerText=this.parent.olapEngineModule.getMDXQuery(this.parent.dataSourceSettings).trim(),t.appendChild(i),e.content=t,e.show()},M.prototype.dialogShow=function(e,t){var i,a,r;e&&((i=_e.getInstance(_e.select("#"+this.parent.element.id+"report-dialog",document),P.Dialog)).header=e.item.tooltipText,e=_e.createElement("div",{className:"e-report-outer"}),(a=_e.createElement("div",{className:"e-pivotview-report-label"})).innerText=this.parent.localeObj.getConstant("reportName"),(r=_e.createElement("input",{className:Oi+" "+ii,attrs:{placeholder:this.parent.localeObj.getConstant("emptyReportName"),value:t&&"rename"===t?this.currentReport:""}})).innerText=t&&"rename"===t?this.currentReport:"",r.setSelectionRange(r.textContent.length,r.textContent.length),e.appendChild(a),e.appendChild(r),i.content=e,i.refresh(),i.show())},M.prototype.renameReport=function(e){this.parent.trigger(_a,e),this.currentReport&&""!==this.currentReport?this.dialogShow(e,"rename"):this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("emptyReport"))},M.prototype.actionClick=function(e){var t=e.item.id===this.parent.element.id+"new"?Jr:e.item.id===this.parent.element.id+"save"?Zr:e.item.id===this.parent.element.id+"saveas"?$r:e.item.id===this.parent.element.id+"rename"?en:e.item.id===this.parent.element.id+"remove"?tn:e.item.id===this.parent.element.id+"load"?an:e.item.id===this.parent.element.id+"formatting"?rn:e.item.id===this.parent.element.id+"numberFormatting"?nn:e.item.id===this.parent.element.id+"mdxQuery"?sn:e.item.id===this.parent.element.id+"fieldlist"?on:"";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)}},M.prototype.renderDialog=function(){null!==_e.select("#"+this.parent.element.id+"report-dialog",this.parent.element)&&_e.remove(_e.select("#"+this.parent.element.id+"report-dialog",this.parent.element));var e=_e.createElement("div",{id:this.parent.element.id+"report-dialog",className:"e-pivotview-report-dialog"}),t=(this.parent.element.appendChild(e),new P.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}));t.isStringTemplate=!0,t.appendTo(e)},M.prototype.renderMDXDialog=function(){null!==_e.select("#"+this.parent.element.id+"mdx-dialog",this.parent.element)&&_e.remove(_e.select("#"+this.parent.element.id+"mdx-dialog",this.parent.element));var e=_e.createElement("div",{id:this.parent.element.id+"mdx-dialog",className:"e-pivotview-mdx-dialog"}),t=(this.parent.element.appendChild(e),new P.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}));t.isStringTemplate=!0,t.appendTo(e)},M.prototype.copyMDXQuery=function(){var e=_e.getInstance(_e.select("#"+this.parent.element.id+"mdx-dialog",document),P.Dialog).element.querySelector("."+Hi);try{e.select(),document.execCommand("copy")}catch(e){window.alert("Oops, unable to copy")}},M.prototype.okBtnClick=function(){var r=this,e=_e.getInstance(_e.select("#"+this.parent.element.id+"report-dialog",document),P.Dialog),n=e.element.querySelector("."+Oi);if(n&&""===n.value)n.focus();else{if(this.parent.localeObj||(this.parent=_e.getInstance(_e.select("#"+this.parent.element.id,document),Hh)),e.header!==this.parent.localeObj.getConstant("save")&&e.header!==this.parent.localeObj.getConstant("saveAs")||!n.value||""===n.value){if(e.header===this.parent.localeObj.getConstant("new")&&n.value&&""!==n.value){this.action="New",this.currentReport=n.value;var s=!1,o=this,l={reportName:[]};this.parent.trigger(ka,l,function(e){for(var t,i,a=0;a<e.reportName.length;a++)if(n.value===l.reportName[a]){s=!0;break}s?o.createConfirmDialog(o.parent.localeObj.getConstant("alert"),o.parent.localeObj.getConstant("replaceConfirmBefore")+'"'+n.value+'"'+o.parent.localeObj.getConstant("replaceConfirmAfter")):(o.parent.trigger(Va),t={report:o.getCurrentReport(),reportName:n.value},i={reportName:n.value},r.parent.actionObj.actionInfo=i,o.parent.trigger(Ra,t),o.parent.isModified=!1,o.updateReportList(),_e.getInstance(_e.select("#"+r.parent.element.id+"report-dialog",document),P.Dialog).hide())})}else if(e.header===this.parent.localeObj.getConstant("rename")&&n.value&&""!==n.value){if(this.currentReport===n.value)return void e.hide();for(var t=!(this.action="Rename"),i=(this.renameText=n.value,this.fetchReports()),a=0;a<i.reportName.length;a++)if(n.value===i.reportName[a]){t=!0;break}if(t)return void this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("replaceConfirmBefore")+'"'+n.value+'"'+this.parent.localeObj.getConstant("replaceConfirmAfter"));var d={reportName:this.currentReport,rename:n.value},h={reportName:{oldName:this.currentReport,newName:n.value}};this.parent.actionObj.actionInfo=h,this.parent.trigger(qa,d),this.currentReport=n.value,this.updateReportList(),e.hide()}}else{this.action="Save",this.currentReport=n.value;var p=!1,u=this,i={reportName:[]};this.parent.trigger(ka,i,function(e){for(var t,i,a=0;a<e.reportName.length;a++)if(n.value===e.reportName[a]){p=!0;break}p?u.createConfirmDialog(u.parent.localeObj.getConstant("alert"),u.parent.localeObj.getConstant("replaceConfirmBefore")+'"'+n.value+'"'+u.parent.localeObj.getConstant("replaceConfirmAfter")):(t={report:u.getCurrentReport(),reportName:n.value},i={reportName:n.value},r.parent.actionObj.actionInfo=i,u.parent.trigger(Ra,t),u.parent.isModified=!1,u.updateReportList(),_e.getInstance(_e.select("#"+r.parent.element.id+"report-dialog",document),P.Dialog).hide())})}this.parent.actionObj.actionName=this.parent.getActionCompleteName(),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()}},M.prototype.createNewReport=function(e){this.dialogShow(e)},M.prototype.cancelBtnClick=function(){_e.getInstance(_e.select("#"+this.parent.element.id+"report-dialog",document),P.Dialog).hide()},M.prototype.createConfirmDialog=function(e,t){document.getElementById(this.parent.element.id+"_ConfirmDialog")&&_e.remove(document.getElementById(this.parent.element.id+"_ConfirmDialog").parentElement);var i=_e.createElement("div",{id:this.parent.element.id+"_ConfirmDialog",className:je}),t=(this.parent.element.appendChild(i),new P.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,header:e,content:t,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:Re+(this.parent.cssClass?" "+this.parent.cssClass:"")},click:this.okButtonClick.bind(this)},{isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("no"),cssClass:ke+(this.parent.cssClass?" "+this.parent.cssClass:"")},click:this.cancelButtonClick.bind(this)}]}));t.isStringTemplate=!0,t.appendTo(i),t.element.querySelector(".e-dlg-header").innerText=this.parent.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(e):e},M.prototype.okButtonClick=function(){var e,t,i,a,r=this,n=_e.getInstance(_e.select("#"+this.parent.element.id+"report-dialog",document),P.Dialog);"Remove"===this.action?(e={reportName:this.currentReport},t={reportName:this.currentReport},this.parent.actionObj.actionInfo=t,this.parent.trigger(Ha,e),(e=this.fetchReports()).reportName&&0<e.reportName.length?(a={reportName:e.reportName[e.reportName.length-1]},this.parent.trigger(ja,a,function(e){r.currentReport=e.reportName,r.parent.isModified=!1}),this.currentReport=e.reportName[e.reportName.length-1]):(this.currentReport="",this.parent.isModified=!1,this.action=""),this.updateReportList(),this.parent.actionObj.actionName=$n,this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()):"New"===this.action||"Save"!==this.action&&"Rename"!==this.action&&"New"!==this.action?this.currentReport&&""!==this.currentReport&&this.parent.isModified?(i={report:this.getCurrentReport(),reportName:this.currentReport},t={reportName:this.currentReport},this.parent.actionObj.actionInfo=t,this.parent.actionObj.actionName=Kn,this.parent.actionObj.actionName&&this.parent.actionCompleteMethod(),this.parent.trigger(Ra,i),this.parent.isModified=!1,"New"===this.action?(this.parent.actionObj.actionName=Jr,this.createNewReport(this.newArgs)):(this.parent.actionObj.actionName=Pn,this.reportLoad(this.dropArgs))):"New"===this.action&&(this.parent.trigger(Va),i={report:this.getCurrentReport(),reportName:this.currentReport},this.parent.trigger(Ra,i),this.parent.isModified=!1,this.updateReportList(),n.hide()):"Save"===this.action?(i={report:this.getCurrentReport(),reportName:this.currentReport},this.parent.trigger(Ra,i),this.parent.isModified=!1,this.updateReportList(),n.hide()):"Rename"===this.action&&(a={reportName:this.currentReport,rename:this.renameText,isReportExists:!0},this.parent.trigger(qa,a),this.currentReport=this.renameText,this.parent.isModified=!1,this.updateReportList(),n.hide()),_e.getInstance(_e.select("#"+this.parent.element.id+"_ConfirmDialog",document),P.Dialog).hide()},M.prototype.cancelButtonClick=function(){var e,t=_e.getInstance(_e.select("#"+this.parent.element.id+"report-dialog",document),P.Dialog);"New"===this.action?this.parent.isModified?this.createNewReport(this.newArgs):t.hide():"Save"===this.action?(_e.select("#"+this.parent.element.id+"_reportlist",this.parent.element)&&(e=_e.getInstance(_e.select("#"+this.parent.element.id+"_reportlist",this.parent.element),G.DropDownList),this.currentReport=e.value),t.hide()):"Rename"===this.action?t.hide():this.dropArgs&&"Remove"!==this.action&&this.reportLoad(this.dropArgs),_e.getInstance(_e.select("#"+this.parent.element.id+"_ConfirmDialog",document),P.Dialog).hide()},M.prototype.createChartMenu=function(){var e=this;if(_e.select("#"+this.parent.element.id+"chart_menu",this.parent.element)){for(var t=_e.select("#"+this.parent.element.id+"chart_menu",this.parent.element),i=[],a=this.getValidChartType(),r=0;r<a.length&&r<7;r++){var n=a[r];i.push({text:this.parent.localeObj.getConstant(n.toLowerCase()),id:this.parent.element.id+"_"+n})}7===i.length&&(i.splice(6),i.push({text:this.parent.localeObj.getConstant("MoreOption"),id:this.parent.element.id+"_ChartMoreOption"}));var s=i.length<=0||"Table"===this.parent.displayOption.view,s=(i.push({separator:!0}),i.push({text:this.parent.localeObj.getConstant("multipleAxes"),id:this.parent.element.id+"_multipleAxes"}),i.push({text:this.parent.localeObj.getConstant("showLegend"),id:this.parent.element.id+"_showLegend"}),[{iconCss:Ni+" "+W,items:s?[]:i}]),o=t?_e.getInstance(t,D.Menu):null;o&&!o.isDestroyed&&(o.destroy(),o=null),(o=new D.Menu({items:s,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:_i+(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,o.appendTo(t)}},M.prototype.create=function(){var e,t,i=this,a=(_e.select("#"+this.parent.element.id+"chart_menu",this.parent.element)&&this.createChartMenu(),_e.select("#"+this.parent.element.id+"export_menu",this.parent.element)&&(e=_e.select("#"+this.parent.element.id+"export_menu",this.parent.element),a=[{iconCss:"e-export "+W,items:[{text:this.parent.localeObj.getConstant("pdf"),iconCss:xi+" "+W,id:this.parent.element.id+"pdf"},{text:this.parent.localeObj.getConstant("excel"),iconCss:wi+" "+W,id:this.parent.element.id+"excel"},{text:this.parent.localeObj.getConstant("csv"),iconCss:Ti+" "+W,id:this.parent.element.id+"csv"},{text:this.parent.localeObj.getConstant("png"),iconCss:"e-pivotview-png-export "+W,id:this.parent.element.id+"png"},{text:this.parent.localeObj.getConstant("jpeg"),iconCss:"e-pivotview-jpeg-export "+W,id:this.parent.element.id+"jpeg"},{text:this.parent.localeObj.getConstant("svg"),iconCss:"e-pivotview-svg-export "+W,id:this.parent.element.id+"svg"}]}],(t=new D.Menu({items:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:_i+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this),beforeOpen:this.updateExportMenu.bind(this),onClose:function(){i.focusToolBar()}})).isStringTemplate=!0,t.appendTo(e)),_e.select("#"+this.parent.element.id+"subtotal_menu",this.parent.element)&&(t=_e.select("#"+this.parent.element.id+"subtotal_menu",this.parent.element),a=[{iconCss:"e-sub-total "+W,items:[{text:this.parent.localeObj.getConstant("showSubTotals"),id:this.parent.element.id+"subtotal",iconCss:r+" "+W},{text:this.parent.localeObj.getConstant("doNotShowSubTotals"),id:this.parent.element.id+"notsubtotal",iconCss:r+" "+W},{text:this.parent.localeObj.getConstant("showSubTotalsRowsOnly"),id:this.parent.element.id+"subtotalrow",iconCss:r+" "+W},{text:this.parent.localeObj.getConstant("showSubTotalsColumnsOnly"),id:this.parent.element.id+"subtotalcolumn",iconCss:r+" "+W},{separator:!0},{text:this.parent.localeObj.getConstant("subTotalPosition"),id:this.parent.element.id+"subtotalpositions",iconCss:ji+" "+W,items:[{text:this.parent.localeObj.getConstant("auto"),id:this.parent.element.id+"sub-none-position",iconCss:r+" "+W},{text:this.parent.localeObj.getConstant("top"),id:this.parent.element.id+"sub-top-position",iconCss:r+" "+W},{text:this.parent.localeObj.getConstant("bottom"),id:this.parent.element.id+"sub-bottom-position",iconCss:r+" "+W}]}]}],(e=new D.Menu({items:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:_i+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this),beforeOpen:this.updateSubtotalSelection.bind(this),onClose:function(){i.focusToolBar()}})).isStringTemplate=!0,e.appendTo(t)),_e.select("#"+this.parent.element.id+"grandtotal_menu",this.parent.element)&&(e=_e.select("#"+this.parent.element.id+"grandtotal_menu",this.parent.element),a=[{iconCss:"e-grand-total "+W,items:[{text:this.parent.localeObj.getConstant("showGrandTotals"),id:this.parent.element.id+"grandtotal",iconCss:r+" "+W},{text:this.parent.localeObj.getConstant("doNotShowGrandTotals"),id:this.parent.element.id+"notgrandtotal",iconCss:r+" "+W},{text:this.parent.localeObj.getConstant("showGrandTotalsRowsOnly"),id:this.parent.element.id+"grandtotalrow",iconCss:r+" "+W},{text:this.parent.localeObj.getConstant("showGrandTotalsColumnsOnly"),id:this.parent.element.id+"grandtotalcolumn",iconCss:r+" "+W},{separator:!0},{text:this.parent.localeObj.getConstant("grandTotalPosition"),id:this.parent.element.id+"grandtotalpositions",iconCss:ji+" "+W,items:[{text:this.parent.localeObj.getConstant("top"),id:this.parent.element.id+"top-position",iconCss:r+" "+W},{text:this.parent.localeObj.getConstant("bottom"),id:this.parent.element.id+"bottom-position",iconCss:r+" "+W}]}]}],(t=new D.Menu({items:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:_i+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this),beforeOpen:this.updateGrandtotalSelection.bind(this),onClose:function(){i.focusToolBar()}})).isStringTemplate=!0,t.appendTo(e)),_e.select("#"+this.parent.element.id+"formatting_menu",this.parent.element)&&(t=_e.select("#"+this.parent.element.id+"formatting_menu",this.parent.element),a=[{iconCss:"e-pivot-format-menu "+W,items:[{text:this.parent.localeObj.getConstant("numberFormatMenu"),iconCss:"e-pivot-number-format-menu "+W,id:this.parent.element.id+"numberFormattingMenu"},{text:this.parent.localeObj.getConstant("conditionalFormattingMenu"),iconCss:"e-pivot-conditional-format-menu "+W,id:this.parent.element.id+"conditionalFormattingMenu"}]}],(e=new D.Menu({items:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:_i+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this)})).isStringTemplate=!0,e.appendTo(t)),{report:this.parent.getPersistData(),reportName:this.parent.localeObj.getConstant("defaultReport")});this.currentReport=this.parent.localeObj.getConstant("defaultReport"),this.parent.trigger(Ra,a),_e.select("#"+this.parent.element.id+"_reportlist",this.parent.element)&&(e=_e.select("#"+this.parent.element.id+"_reportlist",this.parent.element),t=this.fetchReports(),(a=new G.DropDownList({dataSource:t.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})).isStringTemplate=!0,a.appendTo(e)),this.updateItemElements()},M.prototype.getCurrentReport=function(){var e,t=this.parent.getPersistData();return"CSV"===this.parent.dataSourceSettings.type&&"Server"!==this.parent.dataSourceSettings.mode&&((e=JSON.parse(t)).dataSourceSettings.dataSource.splice(0,0,this.parent.engineModule.fields),t=JSON.stringify(e)),t},M.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")}},M.prototype.whitespaceRemove=function(e){e=e.element.querySelector(".e-separator");e&&(e.style.margin="0px")},M.prototype.multipleAxesCheckbox=function(e){var t,i,a,r=this;this.parent.element.id+"_multipleAxes"===e.element.id?((t=_e.createElement("input",{id:this.parent.element.id+"_checkBox"})).style.display="none",this.parent.element.appendChild(t),i=new z.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(r.parent.element.id+"_multipleAxes").click()},enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),e.element.innerText="",i.appendTo(t),-1<["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)&&!e.element.classList.contains(b)?(e.element.classList.add(b),i.disabled=!0):["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)<0&&e.element.classList.contains(b)&&(e.element.classList.remove(b),i.disabled=!1),a=this.parent.element.querySelector("."+ci+".e-multipleAxes"),e.element.appendChild(a)):this.parent.element.id+"_showLegend"===e.element.id&&((t=_e.createElement("input",{id:this.parent.element.id+"_showLegendCheckBox"})).style.display="none",this.parent.element.appendChild(t),i=new z.CheckBox({label:this.parent.localeObj.getConstant("showLegend"),checked:this.getLableState(),cssClass:"e-showLegend"+(this.parent.cssClass?" "+this.parent.cssClass:""),change:function(){document.getElementById(r.parent.element.id+"_showLegend").click()},enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),e.element.innerText="",i.appendTo(t),a=this.parent.element.querySelector("."+ci+".e-showLegend"),e.element.appendChild(a))},M.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},M.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"]},M.prototype.updateExportMenu=function(e){e=[].slice.call(e.element.querySelectorAll("li"));"Table"===this.parent.currentView?(_e.addClass(e.slice(3),Kt),_e.removeClass(e.slice(1,3),Kt)):(_e.addClass(e.slice(1,3),Kt),_e.removeClass(e.slice(3),Kt))},M.prototype.updateSubtotalSelection=function(e){e.parentItem.id!==this.parent.element.id+"subtotalpositions"?(_e.select("#"+this.parent.element.id+"subtotal ."+r,e.element).classList.contains(ji)||_e.select("#"+this.parent.element.id+"subtotal ."+r,e.element).classList.add(ji),_e.select("#"+this.parent.element.id+"notsubtotal ."+r,e.element).classList.contains(ji)||_e.select("#"+this.parent.element.id+"notsubtotal ."+r,e.element).classList.add(ji),_e.select("#"+this.parent.element.id+"subtotalrow ."+r,e.element).classList.contains(ji)||_e.select("#"+this.parent.element.id+"subtotalrow ."+r,e.element).classList.add(ji),_e.select("#"+this.parent.element.id+"subtotalcolumn ."+r,e.element).classList.contains(ji)||_e.select("#"+this.parent.element.id+"subtotalcolumn ."+r,e.element).classList.add(ji),this.parent.dataSourceSettings.showSubTotals&&this.parent.dataSourceSettings.showRowSubTotals&&!this.parent.dataSourceSettings.showColumnSubTotals?_e.select("#"+this.parent.element.id+"subtotalrow ."+r,e.element).classList.remove(ji):this.parent.dataSourceSettings.showSubTotals&&!this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals?_e.select("#"+this.parent.element.id+"subtotalcolumn ."+r,e.element).classList.remove(ji):this.parent.dataSourceSettings.showSubTotals&&this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals?_e.select("#"+this.parent.element.id+"subtotal ."+r,e.element).classList.remove(ji):this.parent.dataSourceSettings.showSubTotals&&(this.parent.dataSourceSettings.showRowSubTotals||this.parent.dataSourceSettings.showColumnSubTotals)||_e.select("#"+this.parent.element.id+"notsubtotal ."+r,e.element).classList.remove(ji)):(_e.select("#"+this.parent.element.id+"sub-none-position ."+r,e.element).classList.add(ji),"Auto"===this.parent.dataSourceSettings.subTotalsPosition&&_e.select("#"+this.parent.element.id+"sub-none-position ."+r,e.element).classList.remove(ji),_e.select("#"+this.parent.element.id+"sub-top-position ."+r,e.element).classList.add(ji),"Top"===this.parent.dataSourceSettings.subTotalsPosition&&_e.select("#"+this.parent.element.id+"sub-top-position ."+r,e.element).classList.remove(ji),_e.select("#"+this.parent.element.id+"sub-bottom-position ."+r,e.element).classList.add(ji),"Bottom"===this.parent.dataSourceSettings.subTotalsPosition&&_e.select("#"+this.parent.element.id+"sub-bottom-position ."+r,e.element).classList.remove(ji))},M.prototype.updateGrandtotalSelection=function(e){e.parentItem.id!==this.parent.element.id+"grandtotalpositions"?(_e.select("#"+this.parent.element.id+"grandtotal ."+r,e.element).classList.contains(ji)||_e.select("#"+this.parent.element.id+"grandtotal ."+r,e.element).classList.add(ji),_e.select("#"+this.parent.element.id+"notgrandtotal ."+r,e.element).classList.contains(ji)||_e.select("#"+this.parent.element.id+"notgrandtotal ."+r,e.element).classList.add(ji),_e.select("#"+this.parent.element.id+"grandtotalrow ."+r,e.element).classList.contains(ji)||_e.select("#"+this.parent.element.id+"grandtotalrow ."+r,e.element).classList.add(ji),_e.select("#"+this.parent.element.id+"grandtotalcolumn ."+r,e.element).classList.contains(ji)||_e.select("#"+this.parent.element.id+"grandtotalcolumn ."+r,e.element).classList.add(ji),this.parent.dataSourceSettings.showGrandTotals&&this.parent.dataSourceSettings.showRowGrandTotals&&!this.parent.dataSourceSettings.showColumnGrandTotals?_e.select("#"+this.parent.element.id+"grandtotalrow ."+r,e.element).classList.remove(ji):this.parent.dataSourceSettings.showGrandTotals&&!this.parent.dataSourceSettings.showRowGrandTotals&&this.parent.dataSourceSettings.showColumnGrandTotals?_e.select("#"+this.parent.element.id+"grandtotalcolumn ."+r,e.element).classList.remove(ji):this.parent.dataSourceSettings.showGrandTotals&&this.parent.dataSourceSettings.showRowGrandTotals&&this.parent.dataSourceSettings.showColumnGrandTotals?_e.select("#"+this.parent.element.id+"grandtotal ."+r,e.element).classList.remove(ji):this.parent.dataSourceSettings.showGrandTotals&&(this.parent.dataSourceSettings.showRowGrandTotals||this.parent.dataSourceSettings.showColumnGrandTotals)||_e.select("#"+this.parent.element.id+"notgrandtotal ."+r,e.element).classList.remove(ji)):(_e.select("#"+this.parent.element.id+"top-position ."+r,e.element).classList.add(ji),"Top"===this.parent.dataSourceSettings.grandTotalsPosition&&_e.select("#"+this.parent.element.id+"top-position ."+r,e.element).classList.remove(ji),_e.select("#"+this.parent.element.id+"bottom-position ."+r,e.element).classList.add(ji),"Bottom"===this.parent.dataSourceSettings.grandTotalsPosition&&_e.select("#"+this.parent.element.id+"bottom-position ."+r,e.element).classList.remove(ji))},M.prototype.updateReportList=function(){var e,t;_e.select("#"+this.parent.element.id+"_reportlist",this.parent.element)&&(e=this.fetchReports(),(t=_e.getInstance(_e.select("#"+this.parent.element.id+"_reportlist",this.parent.element),G.DropDownList)).dataSource=e.reportName,""===this.currentReport&&0<t.dataSource.length?(t.value=t.dataSource[t.dataSource.length-1],t.text=t.dataSource[t.dataSource.length-1],this.currentReport=t.dataSource[t.dataSource.length-1]):(t.value=this.currentReport,t.text=this.currentReport),t.refresh())},M.prototype.menuItemClick=function(e){var t,i,a=this,r={},n=e.item.id===this.parent.element.id+"grid"?ln:e.item.id===this.parent.element.id+"_Column"||e.item.id===this.parent.element.id+"_Bar"||e.item.id===this.parent.element.id+"_Line"||e.item.id===this.parent.element.id+"_Area"||e.item.id===this.parent.element.id+"_Scatter"||e.item.id===this.parent.element.id+"_Polar"||e.item.id===this.parent.element.id+"_ChartMoreOption"?dn:e.item.id===this.parent.element.id+"_multipleAxes"?hn:e.item.id===this.parent.element.id+"_showLegend"?pn:e.item.id===this.parent.element.id+"pdf"?un:e.item.id===this.parent.element.id+"png"?cn:e.item.id===this.parent.element.id+"excel"?gn:e.item.id===this.parent.element.id+"csv"?mn:e.item.id===this.parent.element.id+"jpeg"?Sn:e.item.id===this.parent.element.id+"svg"?fn:e.item.id===this.parent.element.id+"notsubtotal"?vn:e.item.id===this.parent.element.id+"subtotalrow"?yn:e.item.id===this.parent.element.id+"subtotalcolumn"?bn:e.item.id===this.parent.element.id+"subtotal"?Cn:e.item.id===this.parent.element.id+"notgrandtotal"?xn:e.item.id===this.parent.element.id+"grandtotalrow"?wn:e.item.id===this.parent.element.id+"grandtotalcolumn"?Tn:e.item.id===this.parent.element.id+"grandtotal"?Mn:e.item.id===this.parent.element.id+"numberFormattingMenu"?Dn:e.item.id===this.parent.element.id+"conditionalFormattingMenu"?On:"";if(this.parent.actionObj.actionName=n,!this.parent.actionBeginMethod()){(-1<this.getAllChartItems().indexOf(e.item.id.split(this.parent.element.id+"_")[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":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"),i={toolbarInfo:{displayOption:this.parent.displayOption,gridSettings:this.parent.gridSettings}},this.parent.actionObj.actionInfo=i,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":r={excelExportProperties:{fileName:"Export.xlsx"},isBlob:void 0,isMultipleExport:void 0,workbook:void 0},this.parent.trigger(la,r,function(e){a.parent.excelExport(e.excelExportProperties,e.isMultipleExport,e.workbook,e.isBlob)});break;case this.parent.element.id+"csv":r={excelExportProperties:{fileName:"Export.csv"},isBlob:!1,isMultipleExport:!1,workbook:void 0},this.parent.trigger(la,r,function(e){"Server"===a.parent.dataSourceSettings.mode?a.parent.getEngine("onCsvExport",null,null,null,null,null,null,null,null,e.excelExportProperties):a.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)):-1<this.getAllChartItems().indexOf(t)?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)}}},M.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(Gr,this.createToolbar,this)},M.prototype.getValidChartType=function(){for(var e=[],t=0;t<=this.parent.chartTypes.length;t++){var i=this.parent.chartTypes[t];-1<this.getAllChartItems().indexOf(i)&&e.indexOf(i)<0&&e.push(i)}return e},M.prototype.createChartTypeDialog=function(){var e=this,t=this.parent.element.appendChild(_e.createElement("div",{id:this.parent.element.id+"_ChartTypeDialog",className:"e-pivotchart-type-dialog"})),i=new P.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:Re+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:function(){e.removeDialog()},isFlat:!1,buttonModel:{cssClass:ke+(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)});i.isStringTemplate=!0,i.appendTo(t)},M.prototype.chartTypeDialogUpdate=function(){var e=_e.getInstance(_e.select("#"+this.parent.element.id+"_ChartTypeOption"),G.DropDownList).value,t=_e.getInstance(_e.select("#"+this.parent.element.id+"_DialogMultipleAxis"),z.CheckBox).checked,i=_e.getInstance(_e.select("#"+this.parent.element.id+"_DialogShowLabel"),z.CheckBox).checked;this.parent.chart.legendSettings.visible=i,this.chartLableState&&(this.parent.chart.legendSettings.visible=i,this.parent.chartSettings.legendSettings?this.parent.chartSettings.legendSettings.visible=i:this.parent.setProperties({chartSettings:{legendSettings:{visible:i}}},!0)),this.updateChartType(e,!1),this.parent.chartSettings.enableMultipleAxis=t,this.parent.chartSettings.multipleAxisMode=_e.getInstance(_e.select("#"+this.parent.element.id+"_AxisModeOption"),G.DropDownList).value,(_e.select("#"+this.parent.element.id+"_ChartTypeDialog",document)?_e.getInstance(_e.select("#"+this.parent.element.id+"_ChartTypeDialog",document),P.Dialog):null).close()},M.prototype.updateChartType=function(e,t){var i;-1<this.getAllChartItems().indexOf(e)&&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("."+Ei).style.width=_e.formatUnit(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber()),this.parent.element.querySelector("."+Ei).style.height=_e.formatUnit(this.parent.pivotChartModule.getChartHeight())),this.parent.chart.setProperties({width:_e.formatUnit(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber()),height:_e.formatUnit(this.parent.pivotChartModule.getChartHeight())},!0),this.parent.chartSettings.chartSeries.type=e,i={toolbarInfo:{displayOption:this.parent.displayOption,chartSettings:this.parent.chartSettings}},this.parent.actionObj.actionInfo=i,this.parent.chartSettings.chartSeries.type!==e||t||this.parent.chart.refresh())},M.prototype.getDialogContent=function(){for(var e=_e.createElement("div",{className:"e-chart-type-div-content"}),t=_e.createElement("div",{className:"e-chart-type-option-container"}),i=_e.createElement("div",{className:"e-multiple-axes-mode-container"}),a=_e.createElement("div",{className:"e-chart-type-option-text"}),r=(a.innerText=this.parent.localeObj.getConstant("ChartType"),_e.createElement("div",{className:"e-multiple-axes-mode-text"})),n=(r.innerText=this.parent.localeObj.getConstant("multipleAxisMode"),_e.createElement("div",{id:this.parent.element.id+"_ChartTypeOption"})),s=_e.createElement("div",{id:this.parent.element.id+"_AxisModeOption"}),o=(t.appendChild(a),t.appendChild(n),[]),a=[{value:"Stacked",text:this.parent.localeObj.getConstant("stacked")},{value:"Single",text:this.parent.localeObj.getConstant("single")},{value:"Combined",text:this.parent.localeObj.getConstant("combined")}],l=this.getValidChartType(),d=0;d<l.length;d++)o.push({value:l[d],text:this.parent.localeObj.getConstant(l[d].toLowerCase())});var h=new G.DropDownList({dataSource:o,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:this.parent.chartSettings.chartSeries.type||this.getValidChartType()[0],width:"100%",change:this.changeDropDown.bind(this),cssClass:this.parent.cssClass}),h=(h.isStringTemplate=!0,h.appendTo(n),e.appendChild(t),_e.createElement("input",{id:this.parent.element.id+"_DialogMultipleAxis",attrs:{type:"checkbox"}})),n=(e.appendChild(h),_e.createElement("input",{id:this.parent.element.id+"_DialogShowLabel",attrs:{type:"checkbox"}})),t=(e.appendChild(n),i.appendChild(r),i.appendChild(s),e.appendChild(i),new G.DropDownList({dataSource:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:this.parent.chartSettings.multipleAxisMode||"Stacked",width:"100%",enabled:this.parent.chartSettings.enableMultipleAxis,cssClass:this.parent.cssClass}));return t.isStringTemplate=!0,t.appendTo(s),e},M.prototype.changeDropDown=function(e){var t=JSON.parse(this.parent.getChartSettings()).chartSettings;t&&t.legendSettings&&void 0!==t.legendSettings.visible||(_e.getInstance(_e.select("#"+this.parent.element.id+"_DialogShowLabel"),z.CheckBox).checked=!0),-1<["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(e.value.toString())?(_e.getInstance(_e.select("#"+this.parent.element.id+"_DialogMultipleAxis"),z.CheckBox).disabled=!0,_e.getInstance(_e.select("#"+this.parent.element.id+"_AxisModeOption"),G.DropDownList).enabled=!1):((t=_e.getInstance(_e.select("#"+this.parent.element.id+"_DialogMultipleAxis"),z.CheckBox)).disabled=!1,_e.getInstance(_e.select("#"+this.parent.element.id+"_AxisModeOption"),G.DropDownList).enabled=t.checked)},M.prototype.beforeOpen=function(){var t=this,e=new z.CheckBox({label:this.parent.localeObj.getConstant("multipleAxes"),cssClass:"e-dialog-multiple-axis"+(this.parent.cssClass?" "+this.parent.cssClass:""),checked:this.parent.chartSettings.enableMultipleAxis||!1,change:function(e){_e.getInstance(_e.select("#"+t.parent.element.id+"_AxisModeOption"),G.DropDownList).enabled=e.checked},enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),i=new z.CheckBox({label:this.parent.localeObj.getConstant("showLegend"),checked:this.getLableState(),change:function(){t.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}),a=_e.select("#"+this.parent.element.id+"_ChartTypeDialog",document)?_e.getInstance(_e.select("#"+this.parent.element.id+"_ChartTypeDialog",document),P.Dialog):null,i=(i.appendTo(_e.select("#"+this.parent.element.id+"_DialogShowLabel",a.element)),e.appendTo(_e.select("#"+this.parent.element.id+"_DialogMultipleAxis",a.element)),-1<["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)&&(e.disabled=!0,_e.getInstance(_e.select("#"+this.parent.element.id+"_AxisModeOption"),G.DropDownList).enabled=!1),JSON.parse(this.parent.getChartSettings()).chartSettings);i&&i.legendSettings&&void 0!==i.legendSettings.visible?this.chartLableState=!0:this.chartLableState=!1},M.prototype.refreshToolbar=function(){this.destroy(),this.createToolbar()},M.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Gr,this.createToolbar)},M.prototype.destroy=function(){this.removeEventListener();var e=_e.select("#"+this.parent.element.id+"_ConfirmDialog",document),t=e?_e.getInstance(e,P.Dialog):null,t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=_e.select("#"+this.parent.element.id+"report-dialog",document))?_e.getInstance(e,P.Dialog):null),t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=_e.select("#"+this.parent.element.id+"mdx-dialog",document))?_e.getInstance(e,P.Dialog):null),t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=_e.select("#"+this.parent.element.id+"_ChartTypeDialog",document))?_e.getInstance(e,P.Dialog):null);t&&!t.isDestroyed&&(t.destroy(),t=null),this.destroyToolbarComponents(),this.toolbar&&!this.toolbar.isDestroyed&&(this.toolbar.destroy(),this.toolbar=null),(e=_e.select("#"+this.parent.element.id+"pivot-toolbar",document))&&_e.remove(e),this.dropArgs=null,this.newArgs=null,this.currentReport=null},M.prototype.destroyToolbarComponents=function(){["#"+this.parent.element.id+"chart_menu","#"+this.parent.element.id+"export_menu","#"+this.parent.element.id+"subtotal_menu","#"+this.parent.element.id+"grandtotal_menu","#"+this.parent.element.id+"formatting_menu"].forEach(function(e){var e=_e.select(e,document);e&&(e=_e.getInstance(e,D.Menu))&&!e.isDestroyed&&e.destroy()});var e=_e.select("#"+this.parent.element.id+"_reportlist",document),e=(e&&(e=_e.getInstance(e,G.DropDownList))&&!e.isDestroyed&&e.destroy(),_e.select("#"+this.parent.element.id+"_ChartTypeOption",document)),e=(e&&(e=_e.getInstance(e,G.DropDownList))&&!e.isDestroyed&&e.destroy(),_e.select("#"+this.parent.element.id+"_AxisModeOption",document));e&&(e=_e.getInstance(e,G.DropDownList))&&!e.isDestroyed&&e.destroy(),["#"+this.parent.element.id+"_DialogMultipleAxis","#"+this.parent.element.id+"_DialogShowLabel","#"+this.parent.element.id+"_checkBox"].forEach(function(e){var e=_e.select(e,document);e&&(e=_e.getInstance(e,z.CheckBox))&&!e.isDestroyed&&e.destroy()})},M.prototype.removeDialog=function(){var e,t=_e.select("#"+this.parent.element.id+"_ChartTypeDialog",this.parent.element)?_e.getInstance(_e.select("#"+this.parent.element.id+"_ChartTypeDialog",this.parent.element),P.Dialog):null;t&&!t.isDestroyed&&((e=_e.select("#"+this.parent.element.id+"_ChartTypeOption",t.element)?_e.getInstance(_e.select("#"+this.parent.element.id+"_ChartTypeOption",t.element),G.DropDownList):null)&&!e.isDestroyed&&e.destroy(),(e=_e.select("#"+this.parent.element.id+"_AxisModeOption",t.element)?_e.getInstance(_e.select("#"+this.parent.element.id+"_AxisModeOption",t.element),G.DropDownList):null)&&!e.isDestroyed&&e.destroy(),(e=_e.select("#"+this.parent.element.id+"_DialogMultipleAxis",t.element)?_e.getInstance(_e.select("#"+this.parent.element.id+"_DialogMultipleAxis",t.element),z.CheckBox):null)&&!e.isDestroyed&&e.destroy(),(e=_e.select("#"+this.parent.element.id+"_DialogShowLabel",t.element)?_e.getInstance(_e.select("#"+this.parent.element.id+"_DialogShowLabel",t.element),z.CheckBox):null)&&!e.isDestroyed&&e.destroy(),t.destroy()),document.getElementById(this.parent.element.id+"_ChartTypeDialog")&&_e.remove(document.getElementById(this.parent.element.id+"_ChartTypeDialog"))},M.prototype.focusToolBar=function(){_e.removeClass(document.querySelector("."+Di).querySelectorAll(".e-menu-item.e-focused"),"e-focused"),_e.removeClass(document.querySelector("."+Di).querySelectorAll(".e-menu-item.e-selected"),"e-selected"),document.querySelector(".e-toolbar-items")&&_e.addClass([document.querySelector(".e-toolbar-items")],"e-focused")};Fl=M;function M(e){this.isMultiAxisChange=!1,this.isReportChange=!1,this.currentReport="",this.parent=e,(this.parent.toolbarModule=this).addEventListener()}vp.prototype.getModuleName=function(){return"numberFormatting"},vp.prototype.showNumberFormattingDialog=function(){for(var e,t=this,i=_e.createElement("div",{id:this.parent.element.id+"_FormatDialog",className:"e-pivot-format-dialog"}),a=(this.parent.element.appendChild(i),this.dialog=new P.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:Re+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("apply"),isPrimary:!0}},{click:function(){t.dialog.hide()},isFlat:!1,buttonModel:{cssClass:ke+(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("."+ni).innerText=this.parent.localeObj.getConstant("numberFormat"),this.newFormat=[{name:this.parent.localeObj.getConstant("AllValues"),format:"N0",useGrouping:!0,type:void 0}],[]),r=0;r<this.parent.dataSourceSettings.formatSettings.length;r++)e={name:this.parent.dataSourceSettings.formatSettings[r].name,format:this.parent.dataSourceSettings.formatSettings[r].format,useGrouping:this.parent.dataSourceSettings.formatSettings[r].useGrouping,type:this.parent.dataSourceSettings.formatSettings[r].type},this.newFormat.push(e);for(r=0;r<this.newFormat.length;r++)a.push(this.newFormat[r].name);for(var n=0;n<this.parent.dataSourceSettings.values.length;n++)-1===a.indexOf(this.parent.dataSourceSettings.values[n].name)&&(e={name:this.parent.dataSourceSettings.values[n].name,format:"N0",useGrouping:!0},this.newFormat.push(e));this.renderControls()},vp.prototype.getDialogContent=function(){var e=_e.createElement("div",{id:this.parent.element.id+"_FormatDialogOuter",className:"e-pivot-format-dialog-outer"}),t=_e.createElement("table",{id:this.parent.element.id+"_FormatTable",className:"e-pivot-format-table",attrs:{role:"tableItems"}}),i=_e.createElement("tr"),a=_e.createElement("td"),r=_e.createElement("div",{id:this.parent.element.id+"_FormatValueLable",className:"e-pivot-format-value-lable"}),n=(r.innerText=this.parent.localeObj.getConstant("values"),_e.createElement("div",{id:this.parent.element.id+"_FormatValueDrop"})),r=(a.appendChild(r),a.appendChild(n),i.appendChild(a),t.appendChild(i),i=_e.createElement("tr"),a=_e.createElement("td"),_e.createElement("div",{id:this.parent.element.id+"_FormatLable",className:"e-pivot-format-lable"})),n=(r.innerText=this.parent.localeObj.getConstant("formatType"),_e.createElement("div",{id:this.parent.element.id+"_FormatDrop"})),r=(a.appendChild(r),a.appendChild(n),i.appendChild(a),t.appendChild(i),i=_e.createElement("tr"),a=_e.createElement("td"),_e.createElement("div",{id:this.parent.element.id+"_GroupingLable",className:"e-pivot-format-grouping-lable"})),n=(r.innerText=this.parent.localeObj.getConstant("grouping"),_e.createElement("div",{id:this.parent.element.id+"_GroupingDrop"})),r=(a.appendChild(r),a.appendChild(n),i.appendChild(a),t.appendChild(i),i=_e.createElement("tr"),a=_e.createElement("td"),_e.createElement("div",{id:this.parent.element.id+"_DecimalLable",className:"e-pivot-format-decimal-lable"})),n=(r.innerText=this.parent.localeObj.getConstant("decimalPlaces"),_e.createElement("div",{id:this.parent.element.id+"_DecimalDrop"}));return a.appendChild(r),a.appendChild(n),i.appendChild(a),t.appendChild(i),i=_e.createElement("tr"),a=_e.createElement("td"),this.customLable=_e.createElement("div",{id:this.parent.element.id+"_CustomLable",className:"e-pivot-format-custom-lable"}),this.customLable.innerText=this.parent.localeObj.getConstant("customFormatString"),this.customText=_e.createElement("input",{id:this.parent.element.id+"_CustomText",attrs:{type:"text",tabindex:"0"},className:ii+" e-pivot-format-custom-text"}),a.appendChild(this.customLable),a.appendChild(this.customText),i.appendChild(a),t.appendChild(i),i=_e.createElement("tr"),t.appendChild(i),e.appendChild(t),e},vp.prototype.renderControls=function(){var e,t,i,a;if(_e.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 s=this.parent.dataSourceSettings.values[n].caption||this.parent.dataSourceSettings.values[n].name,s=this.parent.enableHtmlSanitizer?_e.SanitizeHtmlHelper.sanitize(s):s;r.push({index:n+1,name:s,field:this.parent.dataSourceSettings.values[n].name})}(e=new G.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(_e.select("#"+this.parent.element.id+"_FormatValueDrop",this.dialog.element))}_e.select("#"+this.parent.element.id+"_FormatDrop",this.dialog.element)&&(t=[{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")}],(a=new G.DropDownList({dataSource:t,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,a.appendTo(_e.select("#"+this.parent.element.id+"_FormatDrop",this.dialog.element))),_e.select("#"+this.parent.element.id+"_GroupingDrop",this.dialog.element)&&(t=[{index:0,name:this.parent.localeObj.getConstant("true")},{index:1,name:this.parent.localeObj.getConstant("false")}],(i=new G.DropDownList({dataSource:t,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,i.appendTo(_e.select("#"+this.parent.element.id+"_GroupingDrop",this.dialog.element))),_e.select("#"+this.parent.element.id+"_DecimalDrop",this.dialog.element)&&((i=new G.DropDownList({dataSource:t=[{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}],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)})).isStringTemplate=!0,i.appendTo(_e.select("#"+this.parent.element.id+"_DecimalDrop",this.dialog.element))),a.value!==this.parent.localeObj.getConstant("Custom")&&(this.customText.disabled=!0),0!==this.lastFormattedValue.length&&(e.value=this.lastFormattedValue[0].name,i=""===(t=this.lastFormattedValue[0].format)?"":t.split("")[0].toLowerCase(),a=this.lastFormattedValue[0].useGrouping?this.parent.localeObj.getConstant("true"):this.parent.localeObj.getConstant("false"),this.updateFormattingDialog(t,i,a))},vp.prototype.valueChange=function(e){for(var t=this.newFormat,i=!1,a=0;a<t.length;a++)if(t[a].name===e.value){var r=t[a].format,n=""===r?"":r.split("")[0].toLowerCase(),s=t[a].useGrouping?this.parent.localeObj.getConstant("true"):this.parent.localeObj.getConstant("false");this.updateFormattingDialog(r,n,s),i=!0;break}i||(_e.getInstance(_e.select("#"+this.parent.element.id+"_FormatDrop",this.parent.element),G.DropDownList).value=this.parent.localeObj.getConstant("number"),_e.getInstance(_e.select("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),G.DropDownList).value=0,_e.getInstance(_e.select("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),G.DropDownList).value=this.parent.localeObj.getConstant("true"))},vp.prototype.updateFormattingDialog=function(e,t,i){var a=_e.getInstance(_e.select("#"+this.parent.element.id+"_FormatDrop",this.parent.element),G.DropDownList);2===e.length&&-1<["n","p","c"].indexOf(t)?(a.value="n"===t?this.parent.localeObj.getConstant("number"):"p"===t?this.parent.localeObj.getConstant("percentage"):"c"===t?this.parent.localeObj.getConstant("currency"):this.parent.localeObj.getConstant("number"),_e.getInstance(_e.select("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),G.DropDownList).value=Number(e.split("")[1]),_e.getInstance(_e.select("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),G.DropDownList).value=i):(a.value=this.parent.localeObj.getConstant("Custom"),this.customText.value=e)},vp.prototype.customUpdate=function(){var e;_e.getInstance(_e.select("#"+this.parent.element.id+"_FormatDrop",this.parent.element),G.DropDownList).value===this.parent.localeObj.getConstant("Custom")&&(e=this.getIndexValue(),this.newFormat[e].format=this.customText.value)},vp.prototype.dropDownChange=function(e){var t=this.getIndexValue(),i=_e.getInstance(_e.select("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),G.DropDownList),a=_e.getInstance(_e.select("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),G.DropDownList);e.value===this.parent.localeObj.getConstant("Custom")?(this.customText.disabled=!1,i.enabled=!1,a.enabled=!1,this.newFormat[t].format=this.customText.value):(e=this.formattedText(),this.newFormat[t].format=e,this.customText.disabled=!0,i.enabled=!0,a.enabled=!0,this.customText.value="")},vp.prototype.groupingChange=function(){var e=this.getIndexValue(),t=_e.getInstance(_e.select("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),G.DropDownList);this.newFormat[e].useGrouping=t.value===this.parent.localeObj.getConstant("true")},vp.prototype.getIndexValue=function(){for(var e=[],t=0;t<this.newFormat.length;t++)e.push(this.newFormat[t].name);var i=_e.getInstance(_e.select("#"+this.parent.element.id+"_FormatValueDrop",this.parent.element),G.DropDownList);return e.indexOf(i.value.toString())},vp.prototype.decimalChange=function(){var e=this.getIndexValue(),t=this.formattedText();this.newFormat[e].format=t},vp.prototype.formattedText=function(){var e=_e.getInstance(_e.select("#"+this.parent.element.id+"_FormatDrop",this.parent.element),G.DropDownList),t=_e.getInstance(_e.select("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),G.DropDownList);return e.value===this.parent.localeObj.getConstant("number")||e.value===this.parent.localeObj.getConstant("percentage")||e.value===this.parent.localeObj.getConstant("currency")?(e.value===this.parent.localeObj.getConstant("number")?"N":e.value===this.parent.localeObj.getConstant("currency")?"C":"P")+t.value:this.customText.value},vp.prototype.removeDialog=function(){this.dialog&&!this.dialog.isDestroyed&&this.dialog.destroy(),document.getElementById(this.parent.element.id+"_FormatDialog")&&_e.remove(document.getElementById(this.parent.element.id+"_FormatDialog"))},vp.prototype.updateFormatting=function(){for(var r=this,e=this.formattedText(),t=this.getIndexValue(),i=(this.newFormat=this.newFormat.splice(t,1),_e.extend([],this.newFormat,!0)),a=this.parent.dataSourceSettings.formatSettings,n=0;n<a.length;n++)this.insertFormat(a[n].name,a[n].format,a[n].type,a[n].currency,a[n].useGrouping);t=_e.getInstance(_e.select("#"+this.parent.element.id+"_FormatValueDrop",this.parent.element),G.DropDownList);if(t.value===this.parent.localeObj.getConstant("AllValues"))for(n=0;n<this.parent.dataSourceSettings.values.length;n++)this.insertFormat(this.parent.dataSourceSettings.values[n].name,e);else this.insertFormat(t.value.toString(),e);t={formatSettings:Ie.cloneFormatSettings(this.newFormat),formatName:t.value.toString(),cancel:!1};this.parent.trigger(Mr,t,function(a){if(a.cancel)r.dialog.close(),r.parent.setProperties({dataSourceSettings:{formatSettings:i}},!0);else{if("olap"===r.parent.dataType)for(var e=0;e<a.formatSettings.length;e++)!function(t){var i=Ie.getFieldInfo(a.formatSettings[t].name,r.parent);r.parent.dataSourceSettings.calculatedFieldSettings.forEach(function(e){e.name===i.fieldName&&(e.formatString=a.formatSettings[t].format)})}(e);r.parent.setProperties({dataSourceSettings:{formatSettings:a.formatSettings}},!0);var t={numberFormattingInfo:r.parent.dataSourceSettings.formatSettings};r.parent.actionObj.actionInfo=t;try{r.parent.updateDataSource(),r.dialog.close()}catch(e){r.parent.setProperties({dataSourceSettings:{formatSettings:i}},!0),r.parent.pivotCommon.errorDialog.createErrorDialog(r.parent.localeObj.getConstant("error"),r.parent.localeObj.getConstant("invalidFormat")),r.parent.hideWaitingPopup()}}})},vp.prototype.insertFormat=function(e,t,i,a,r){for(var n=!1,s=_e.getInstance(_e.select("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),G.DropDownList),o={name:e,format:t,useGrouping:_e.isNullOrUndefined(r)?s.value===this.parent.localeObj.getConstant("true"):r,type:i,currency:a},l=this.newFormat,d=0;d<l.length;d++)l[d].name===e&&(l[d]=o,n=!0);n||l.push(o),this.lastFormattedValue=[],this.lastFormattedValue.push(o)},vp.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(Wr,this.showNumberFormattingDialog,this)},vp.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Wr,this.showNumberFormattingDialog)},vp.prototype.destroy=function(){this.dialog&&!this.dialog.isDestroyed&&(this.dialog.destroy(),this.dialog=null),this.removeEventListener()};Rl=vp;function vp(e){this.parent=e,(this.parent.numberFormattingModule=this).removeEventListener(),this.addEventListener(),this.newFormat=[],this.lastFormattedValue=[]}yp.prototype.getModuleName=function(){return"grouping"},yp.prototype.render=function(e){var t=e.target,i=e.option,e=e.parentElement,a=[],r=(this.parentElement=e,this.isUpdate=!1,parseInt(t.getAttribute("aria-colindex"),10)-1),t=Number(t.getAttribute("index")),t=this.parent.engineModule.pivotValues[t][r],r=t.valueSort.axis.toString();(a=this.getSelectedCells(t.axis,r,t.actualText.toString())).push({axis:t.axis,fieldName:r,name:t.actualText.toString(),cellInfo:t}),-1!==i.replace(e.id,"").indexOf("_custom_group")?this.createGroupSettings(r,a):this.updateUnGroupSettings(r,a)},yp.prototype.getSelectedOptions=function(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];-1===Ie.inArray(r.name,t)&&t.push(r.name)}return t},yp.prototype.createGroupSettings=function(e,t){var i,a,r,n,s=this.parent.engineModule.fieldList[e],o=this.getGroupSettings(e);0<t.length&&(i=void 0,a=!1,s.isCustomField?o?"Custom"===o.type?1===t.length?a=!0:(a=!1,i="custom"):o&&"Number"===o.type&&(a=!1,i="number"):(r=this.getGroupSettings(e.replace(this.dateGroup,"")),n=this.getGroupSettings(e.replace(/_custom_group/g,"")),r?(a=!1,i="date",e=e.replace(this.dateGroup,"")):n&&(a=1===t.length,i="custom")):o?"Number"===o.type||"Date"===o.type?(a=!1,i="Date"===o.type?"date":"number"):"Custom"===o.type&&(a=1===t.length,i="custom"):"number"===s.type||-1!==["datetime","date"].indexOf(s.type)||this.isDateType(e)?(a=!1,i=1===t.length?-1!==["datetime","date"].indexOf(s.type)||this.isDateType(e)?"date":"number":"custom"):"string"===s.type&&(a=1===t.length,i="custom"),a?(this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("warning"),this.parent.localeObj.getConstant("invalidSelection")),this.parent.grid.clearSelection()):i&&""!==i&&this.createGroupDialog(e,i,t))},yp.prototype.updateUnGroupSettings=function(e,t){var i,a,r=this.parent.engineModule.fieldList[e],n=Ie.cloneGroupSettings(this.parent.dataSourceSettings.groupSettings),s=this.getGroupSettings(e);0<t.length&&(i=void 0,r.isCustomField?s?"Custom"===s.type&&(i="custom"):(r=this.getGroupSettings(e.replace(this.dateGroup,"")),a=this.getGroupSettings(e.replace(/_custom_group/g,"")),r?(i="date",e=e.replace(this.dateGroup,"")):a&&(i="custom")):!s||"Number"!==s.type&&"Date"!==s.type||(i="Date"===s.type?"date":"number"),"date"===i||"number"===i?n=this.validateSettings(e,n,i,[]):"custom"===i&&(r=this.getSelectedOptions(t),n=this.validateSettings(e,n,i,r)),this.updateDateSource(n,i))},yp.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())},yp.prototype.removeGroupSettings=function(e,t,i,a){var r=a.indexOf(e);if(-1!==r)for(var n,s=i[r],o=0,l=s.customGroups.length;o<l;o++)s.customGroups[o]&&(n=s.customGroups[o],-1!==Ie.inArray(n.groupName,t))&&(i=this.modifyParentGroupItems(e,i,[n.groupName],n.items,a),s.customGroups.splice(o,1),this.isUpdate=!0,o--,l--);return delete this.parent.engineModule.groupingFieldsInfo[e],i},yp.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}},yp.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},yp.prototype.getSelectedCells=function(e,t,i){for(var a=[],r=this.parent.element.querySelectorAll("."+pi+",."+ui),n=0;n<r.length;n++){var s=r[n],o=parseInt(s.getAttribute("aria-colindex"),10)-1,s=Number(s.getAttribute("index")),s=this.parent.engineModule.pivotValues[s][o];s&&s.axis===e&&"grand sum"!==s.type&&"sum"!==s.type&&s.valueSort.axis===t&&i!==s.actualText.toString()&&a.push({axis:s.axis,fieldName:s.valueSort.axis.toString(),name:s.actualText.toString(),cellInfo:s})}return a},yp.prototype.createGroupDialog=function(e,t,i){var a=_e.createElement("div",{id:this.parentElement.id+"_GroupDialog",className:"e-group-field-settings",attrs:{"data-field":e,"data-type":t}}),r=(this.parentElement.appendChild(a),new P.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,header:this.parent.localeObj.getConstant("grouping"),content:this.createGroupOptions(e,t),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,i),isFlat:!1,buttonModel:{cssClass:Re+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:function(){r.hide()},isFlat:!1,buttonModel:{cssClass:ke+(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}));r.isStringTemplate=!0,r.appendTo(a)},yp.prototype.createGroupOptions=function(e,i){var a=this,r=this,t=_e.createElement("div",{className:"e-group-field-div-content",id:this.parentElement.id+"_group_field_div_content",attrs:{"data-fieldName":e,"data-type":i}}),n=_e.createElement("div",{className:"e-group-option-container"}),s=(t.appendChild(n),this.parent.dataSourceSettings),o=Ie.getFieldByName(e,s.groupSettings);switch(i){case"custom":var l=void 0,d=(d=s.rows).concat(s.columns,s.values,s.filters),h=Ie.getFieldByName(e.replace(/_custom_group/g,""),d),p=(_e.isNullOrUndefined(h)&&!_e.isNullOrUndefined(this.parent.clonedReport)&&(u=(u=(p=this.parent.clonedReport).rows).concat(p.columns,p.values,p.filters),h=Ie.getFieldByName(e.replace(/_custom_group/g,""),u)),Ie.getFieldByName(e,d)),u=Ie.getFieldByName(e+"_custom_group",d),d=(p&&(l=u?u.caption:this.parent.engineModule.fieldList[h.name].caption+((e+"_custom_group").match(/_custom_group/g).length+1)),_e.createElement("div",{className:"e-caption-option-text"})),p=(d.innerText=this.parent.localeObj.getConstant("groupFieldCaption"),_e.createElement("div",{className:"e-group-caption-container"})),u=_e.createElement("input",{id:this.parentElement.id+"group_caption_option",className:"e-group-caption-text",attrs:{type:"text"}}),h=(p.appendChild(d),p.appendChild(u),n.appendChild(p),_e.createElement("div",{className:"e-input-option-text"})),d=(h.innerText=this.parent.localeObj.getConstant("groupTitle"),_e.createElement("div",{className:"e-group-input-container"})),p=_e.createElement("input",{id:this.parentElement.id+"group_input_option",className:"e-group-input-text",attrs:{type:"text"}}),h=(d.appendChild(h),d.appendChild(p),n.appendChild(d),new H.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("captionName"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:l,width:"100%",cssClass:this.parent.cssClass})),d=(h.isStringTemplate=!0,h.appendTo(u),new H.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("groupName"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,width:"100%",cssClass:this.parent.cssClass}));d.isStringTemplate=!0,d.appendTo(p);break;case"date":case"number":var c,g,m,S,l=_e.createElement("div",{className:"e-group-start-option-container"}),h=_e.createElement("input",{id:this.parentElement.id+"group_start_option",className:"e-group_start_option",attrs:{type:"checkbox"}}),u=_e.createElement("input",{id:this.parentElement.id+"group_start_input",className:"e-group_start_input",attrs:{type:"text"}}),d=(l.appendChild(h),l.appendChild(u),n.appendChild(l),_e.createElement("div",{className:"e-group-end-option-container"})),p=_e.createElement("input",{id:this.parentElement.id+"group_end_option",className:"e-group_end_option",attrs:{type:"checkbox"}}),l=_e.createElement("input",{id:this.parentElement.id+"group_end_input",className:"e-group_end_input",attrs:{type:"text"}}),d=(d.appendChild(p),d.appendChild(l),n.appendChild(d),_e.createElement("div",{className:"e-group-interval-option-container"})),f=_e.createElement("div",{className:"e-group-inerval-option-text"}),v=(f.innerText=this.parent.localeObj.getConstant("groupBy"),_e.createElement("input",{id:this.parentElement.id+"group_interval_input",className:"e-group_interval_input",attrs:{type:"text"}})),f=(d.appendChild(f),d.appendChild(v),n.appendChild(d),void 0),d=void 0,y=("date"===i?(S=[],g=[{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")}],o&&"Date"===o.type?(S=o.groupInterval,f=o.startingAt?o.startingAt.toString():void 0,d=o.endingAt?o.endingAt.toString():void 0):S=["Months"],(y=new N.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===f),width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,y.appendTo(u),(m=new N.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===d),width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,m.appendTo(l),G.MultiSelect.Inject(G.CheckBoxSelection),(c=new G.MultiSelect({dataSource:g,value:S,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(){_e.getInstance(_e.select("#"+r.parentElement.id+"_GroupDialog",document),P.Dialog).element.querySelector("."+Re).removeAttribute("disabled")},removed:function(){var e=c.liCollections,t=0;e.forEach(function(e){e.classList.contains("e-active")&&t++}),0===t&&_e.getInstance(_e.select("#"+r.parentElement.id+"_GroupDialog",document),P.Dialog).element.querySelector("."+Re).setAttribute("disabled","disabled")}})).isStringTemplate=!0,c.appendTo(v),y.value=void 0===f?null:new Date(f),y.dataBind(),m.value=void 0===d?null:new Date(d),m.dataBind()):(g=void 0,o&&"Number"===o.type?(g=o.rangeInterval,f=o.startingAt?o.startingAt.toString():void 0,d=o.endingAt?o.endingAt.toString():void 0):g=2,(y=new H.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,showClearButton:!0,format:"###.##########",value:void 0===f?void 0:parseFloat(f),enabled:!(void 0===f),width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,y.appendTo(u),(m=new H.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,showClearButton:!0,format:"###.##########",value:void 0===d?void 0:parseFloat(d),enabled:!(void 0===d),width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,m.appendTo(l),(S=new H.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,showClearButton:!0,format:"###.##########",min:0,value:g,width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,S.appendTo(v)),new z.CheckBox({label:this.parent.localeObj.getConstant("startAt"),checked:!(void 0===f),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass,change:function(e){var t="date"===i?_e.getInstance(_e.select("#"+a.parentElement.id+"group_start_input"),N.DateTimePicker):_e.getInstance(_e.select("#"+a.parentElement.id+"group_start_input"),H.NumericTextBox);t.enabled=e.checked,t.dataBind()}})),u=(y.isStringTemplate=!0,y.appendTo(h),new z.CheckBox({label:this.parent.localeObj.getConstant("endAt"),checked:!(void 0===d),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass,change:function(e){var t="date"===i?_e.getInstance(_e.select("#"+a.parentElement.id+"group_end_input"),N.DateTimePicker):_e.getInstance(_e.select("#"+a.parentElement.id+"group_end_input"),H.NumericTextBox);t.enabled=e.checked,t.dataBind()}}));u.isStringTemplate=!0,u.appendTo(p)}return t},yp.prototype.updateGroupSettings=function(e){var t=_e.getInstance(_e.select("#"+this.parentElement.id+"_GroupDialog",document),P.Dialog),i=t.element,a=i.getAttribute("data-type"),r=i.getAttribute("data-field"),n=Ie.cloneGroupSettings(this.parent.dataSourceSettings.groupSettings);if(0!==n.length||this.parent.clonedDataSet||this.parent.clonedReport||(i=this.parent.engineModule.data,this.parent.clonedDataSet="CSV"===this.parent.dataSourceSettings.type?Ie.getClonedCSVData(i):Ie.getClonedData(i),this.parent.setProperties({dataSourceSettings:{dataSource:[]}},!0),this.parent.clonedReport=_e.extend({},this.parent.dataSourceSettings,null,!0),this.parent.setProperties({dataSourceSettings:{dataSource:i}},!0)),"custom"===a){var i=_e.getInstance(_e.select("#"+this.parentElement.id+"group_input_option"),H.MaskedTextBox),s=_e.getInstance(_e.select("#"+this.parentElement.id+"group_caption_option"),H.MaskedTextBox);if(_e.removeClass([i.element],$t),null===i.value||""===i.value)return _e.addClass([i.element],$t),void i.element.focus();for(var o=this.getSelectedOptions(e),l={groupName:i.value,items:o},d=[],h=[],p={name:r,caption:s.value,type:"Custom",customGroups:[]},u=!1,c=0,g=n.length;c<g;c++)if(n[c].name===r){(p=n[c]).caption=s.value;for(var m,S=0,f=p.customGroups.length;S<f;S++)p.customGroups[S]&&(m=p.customGroups[S]).items&&Vh.isContainCommonElements(m.items,o)&&(d=this.mergeArray(d,[m.groupName]),h=this.mergeArray(h,m.items),p.customGroups.splice(S,1),S--,f--);for(var v=0,y=o;v<y.length;v++){var b=y[v],b=h.indexOf(b);-1!==b&&h.splice(b,1)}h=this.mergeArray(h,[l.groupName]),p.customGroups.push(l),u=this.isUpdate=!0;break}u||(p.customGroups.push(l),this.isUpdate=!0,n.push(p)),n=this.validateSettings(r,n,a,0===d.length?l.items:d,h)}else if("date"===a||"number"===a){var e=_e.getInstance(_e.select("#"+this.parentElement.id+"group_start_option"),z.CheckBox),i=_e.getInstance(_e.select("#"+this.parentElement.id+"group_end_option"),z.CheckBox),C="date"===a?_e.getInstance(_e.select("#"+this.parentElement.id+"group_start_input"),N.DateTimePicker):_e.getInstance(_e.select("#"+this.parentElement.id+"group_start_input"),H.NumericTextBox),x="date"===a?_e.getInstance(_e.select("#"+this.parentElement.id+"group_end_input"),N.DateTimePicker):_e.getInstance(_e.select("#"+this.parentElement.id+"group_end_input"),H.NumericTextBox),w="date"===a?_e.getInstance(_e.select("#"+this.parentElement.id+"group_interval_input"),G.MultiSelect):_e.getInstance(_e.select("#"+this.parentElement.id+"group_interval_input"),H.NumericTextBox),p={name:r,startingAt:e.checked?C.value.toString():void 0,endingAt:i.checked?x.value.toString():void 0};if("date"===a){for(var T=[],M=0,D=w.value;M<D.length;M++){var O=D[M];T.push(O)}p.type="Date",p.groupInterval=T}else p.type="Number",p.rangeInterval=w.value;for(u=!1,c=0,g=n.length;c<g;c++)if(n[c].name===r){n.splice(c,1,p),u=this.isUpdate=!0;break}u||(this.isUpdate=!0,n.push(p)),n=this.validateSettings(r,n,a,[],[])}t.close(),this.updateDateSource(n,a)},yp.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},yp.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},yp.prototype.validateSettings=function(i,e,t,a,r){var n=[],s=this.getGroupBasedSettings(e),e=["Date","Number","Custom"];if(s[e[2]]&&"custom"===t){for(var o=this.getGroupByName(s[e[2]]),l=(o[i.replace(/_custom_group/g,"")]&&(u=(f=o[i.replace(/_custom_group/g,"")]).map(function(e){return e.name}),f=r?this.modifyParentGroupItems(i,f,a,r,u):this.removeGroupSettings(i.replace("_custom_group",""),a,f,u)),[]),d=0,h=Object.keys(o);d<h.length;d++)var p=h[d],u=o[p].map(function(e){return e.name}),l=this.reOrderSettings(o[p],u,l,p,i);s[e[2]]=l}else if(("date"===t||"number"===t)&&!r){a="date"===t?s[e[0]]:s[e[1]];if("date"===t){s[e[0]]=a.filter(function(e){return e.name!==i});var c=["_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===s[e[0]].length){delete this.parent.engineModule.groupingFieldsInfo[i];var g=this;for(m in this.parent.engineModule.groupingFieldsInfo)!function(t){c.some(function(e){return t===""+i+e})&&delete g.parent.engineModule.groupingFieldsInfo[t]}(m);var m,S=this;for(m in this.parent.engineModule.fieldList)!function(t){c.some(function(e){return t===""+i+e})&&delete S.parent.engineModule.fieldList[t]}(m);var f=this.parent.engineModule.fields.filter(function(t){return!c.some(function(e){return t===""+i+e})});this.parent.engineModule.fields=f}}else s[e[1]]=a.filter(function(e){return e.name!==i});this.isUpdate=!0}for(var v=0,y=e;v<y.length;v++){var b=y[v];s[b]&&(n=n.concat(s[b]))}return n},yp.prototype.reOrderSettings=function(e,t,i,a,r){var n=t.indexOf(a);return-1<n&&e[n].customGroups&&0<e[n].customGroups.length?(i.push(e[n]),this.reOrderSettings(e,t,i,a+"_custom_group")):-1<n&&e[n].customGroups&&0===e[n].customGroups.length&&!_e.isNullOrUndefined(r)&&(delete this.parent.engineModule.fieldList[r],delete this.parent.engineModule.groupingFieldsInfo[r],t=this.parent.engineModule.fields.filter(function(e){return e!==r}),this.parent.engineModule.fields=t),i},yp.prototype.modifyParentGroupItems=function(e,t,i,a,r){r=r.indexOf(e+"_custom_group");if(-1!==r){var n=t[r];if(n.customGroups&&0<n.customGroups.length)for(var s=0,o=n.customGroups.length;s<o;s++)if(n.customGroups[s]){var l=!1,d=n.customGroups[s];if(d.items){for(var h=0,p=i;h<p.length;h++){var u=p[h],u=d.items.indexOf(u);-1!==u&&(d.items.splice(u,1),l=this.isUpdate=!0)}l&&(d.items=this.mergeArray(d.items,a))}}}return t},yp.prototype.mergeArray=function(e,t){for(var i=[],a=e.concat(t),r=a.length,n={};r--;){var s=String(a[r]);n[s]||(i.unshift(s),n[s]=!0)}return i},yp.prototype.removeDialog=function(){var e;this.parent.grid&&this.parent.grid.isDestroyed||_e.isNullOrUndefined(this.parent.grid)||(this.parent.grid.clearSelection(),(e=(e=_e.select("#"+this.parent.element.id+"_GroupDialog",document))?_e.getInstance(e,P.Dialog):null)&&!e.isDestroyed&&e.destroy(),this.parent.element&&document.getElementById(this.parent.element.id+"_GroupDialog")&&_e.remove(document.getElementById(this.parent.element.id+"_GroupDialog")))},yp.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(Qr,this.render,this)},yp.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.removeDialog(),this.parent.off(Qr,this.render))},yp.prototype.destroy=function(){this.removeEventListener()};Fd=yp;function yp(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).addEventListener()}e.AggregateMenu=Rs,e.Authentication=Vo,e.AxisFieldRenderer=Jh,e.AxisTableRenderer=Yh,e.CalculatedField=ql,e.CalculatedFieldSettings=Io,e.CellEditSettings=id,e.Common=Zs,e.CommonKeyboardInteraction=qs,e.ConditionalFormatSettings=So,e.ConditionalFormatting=bl,e.ConditionalSettings=nd,e.CustomGroups=Po,e.DataSourceSettings=io,e.DataSourceUpdate=Gs,e.DialogRenderer=zh,e.DisplayOption=Nd,e.DrillOptions=Ao,e.DrillThrough=tl,e.ErrorDialog=Ws,e.EventBase=Vs,e.ExcelExport=bd,e.FieldList=Yl,e.FieldListFieldOptions=so,e.FieldOptions=ao,e.Filter=co,e.FilterDialog=Ys,e.FormatSettings=xo,e.GroupSettings=Mo,e.Grouping=Fd,e.GroupingBar=wl,e.GroupingBarSettings=$l,e.HyperlinkSettings=ld,e.KeyboardInteraction=Qo,e.MDXQuery=uh,e.MdxQuery=sn,e.NodeStateModified=_s,e.NumberFormatting=Rl,e.OlapEngine=gh,e.PDFExport=pd,e.PageSettings=Dd,e.Pager=gd,e.PagerSettings=fd,e.PivotChart=al,e.PivotCommon=Xs,e.PivotContextMenu=Ko,e.PivotEngine=ia,e.PivotFieldList=ap,e.PivotUtil=Ie,e.PivotView=Hh,e.Render=js,e.Sort=yo,e.Style=ho,e.Toolbar=Fl,e.TreeViewRenderer=Qh,e.ValueSortSettings=jo,e.VirtualScroll=Jo,e.VirtualScrollSettings=wd,e.actionBegin=Ir,e.actionComplete=Fr,e.actionDropped=Ls,e.actionFailure=Lr,e.addNewRecord=jn,e.addNewReport=Jr,e.afterPivotTableRender="afterPivotTableRender",e.afterServiceInvoke=Er,e.aggregateCellInfo=gr,e.aggregateField=Hn,e.aggregateMenuOpen=Dr,e.animationComplete=Ya,e.axisLabelFont=o,e.axisTitleFont=sl,e.beforeColumnsRender=wa,e.beforeExcelExport=br,e.beforeExport=la,e.beforePdfExport="beforePdfExport",e.beforePivotTableRender="beforePivotTableRender",e.beforePrint=Qa,e.beforeServiceInvoke=Nr,e.beginDrillThrough=Fa,e.calculatedFieldApplied=Bn,e.calculatedFieldCreate=xr,e.calculatedFieldEdited=ys,e.cellClick=Ca,e.cellDeselected=Na,e.cellSelected=Pa,e.cellSelecting=Da,e.chartAxisLabelRender=ur,e.chartLegendClick=Ga,e.chartLoad=hr,e.chartLoaded=za,e.chartMouseClick=er,e.chartMouseDown=ar,e.chartMouseLeave=ir,e.chartMouseMove=$a,e.chartMouseUp=rr,e.chartPointClick=Pr,e.chartResized=pr,e.chartSeriesCreated=cr,e.chartSubTitleFont={size:"11px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.chartTitleFont={size:"15px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.chartTooltipRender=Ba,e.chartView=dn,e.chartViewed=ds,e.click="click",e.closeFieldlist=Qn,e.columnPageNavigated=Fs,e.columnPageNavigation=_n,e.conditionalFormatting=yr,e.conditionalFormattingMenu=On,e.conditionallyFormatted=ss,e.contentReady=qr,e.contextMenuCalculatedField="CalculatedField Context menu",e.contextMenuClick=Sr,e.contextMenuOpen=fr,e.crosshairLabelFont=ol,e.csvExport=mn,e.csvExported=ts,e.dataBound=ma,e.dataReady=Hr,e.dragComplete=nr,e.drill=Oa,e.drillDown=Xr,e.drillThrough=xa,e.drillThroughClosed=Ps,e.drillUp=Kr,e.editCalculatedField=En,e.editCompleted=La,e.editRecord=Rn,e.editedRecordsSaved=Gn,e.enginePopulated=na,e.enginePopulating=ra,e.excelExport=gn,e.excelExported=es,e.excelHeaderQueryCellInfo=ha,e.excelQueryCellInfo=ua,e.exportComplete=da,e.fetchReport=ka,e.fieldAggregated=ws,e.fieldDragStart=Or,e.fieldDrop=oa,e.fieldFiltered=Cs,e.fieldListRefreshed=vr,e.fieldRemove=Tr,e.fieldRemoved=xs,e.fieldSorted=bs,e.fieldTreeSorted=Yn,e.filterField=Fn,e.grandTotalsColumn=Tn,e.grandTotalsColumnShown=Ss,e.grandTotalsHidden=gs,e.grandTotalsRow=wn,e.grandTotalsRowShown=ms,e.grandTotalsShown=fs,e.headerCellInfo=fa,e.hideGrandTotals=xn,e.hideSubTotals=vn,e.horizontalScroll=jr,e.horizontalScrolled=Es,e.hyperlinkCellClick=va,e.initCalculatedField=Br,e.initFormatting=Wr,e.initGrouping=Qr,e.initPivotPager=zr,e.initSubComponent=Vr,e.initToolbar=Gr,e.initialLoad=Ar,e.invalidFormula=As,e.jpegExport=Sn,e.jpegExported=rs,e.legendLabelFont=dl,e.legendRender=Ka,e.load=aa,e.loadReport=ja,e.loadReports=an,e.memberEditorOpen=wr,e.memberFiltering=Cr,e.multiLevelLabelClick=Aa,e.multiLevelLabelRender=Wa,e.multipleAxis=hn,e.newRecordAdded=zn,e.newReport=Va,e.newReportAdded=Xn,e.numberFormatted=os,e.numberFormatting=Mr,e.numberFormattingMenu=Dn,e.onFieldDropped=sa,e.onHeadersSort=mr,e.onPdfCellRender=ga,e.openCalculatedField=An,e.openConditionalFormatting=rn,e.openNumberFormatting=nn,e.pdfExport=un,e.pdfExported=is,e.pdfHeaderQueryCellInfo=pa,e.pdfQueryCellInfo=ca,e.pivotButtonUpdate=_r,e.pngExport=cn,e.pngExported=as,e.pointMove=tr,e.pointRender=Ja,e.queryCellInfo=Sa,e.recordEdited=Ts,e.recordRemoved=Wn,e.recordUpdated=Os,e.removeCurrentReport=tn,e.removeField=Ln,e.removeRecord=qn,e.removeReport=Ha,e.renameCurrentReport=en,e.renameReport=qa,e.reportChange=Pn,e.reportChanged=Ms,e.reportReSaved=Jn,e.reportRemoved=$n,e.reportRenamed=Zn,e.reportSaved=Kn,e.resizeStop=ba,e.resizing=ya,e.rowDeselected=Ia,e.rowPageNavigated=Is,e.rowPageNavigation=Un,e.rowSelected=Ea,e.saveAsCurrentReport=$r,e.saveCurrentReport=Zr,e.saveEditedRecords=kn,e.saveReport=Ra,e.scroll="scroll",e.scrollChanged=dr,e.scrollEnd=lr,e.scrollStart=or,e.selected=Ta,e.selecting=Ma,e.seriesRender=Za,e.showFieldList=on,e.showGrandTotals=Mn,e.showLegend=pn,e.showSubTotals=Cn,e.sortField=In,e.sortFieldTree=Nn,e.sortValue=Yr,e.stockEventFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.stripLineLabelFont=hl,e.subTotalsColumn=bn,e.subTotalsColumnShown=us,e.subTotalsHidden=hs,e.subTotalsRow=yn,e.subTotalsRowShown=ps,e.subTotalsShown=cs,e.svgExport=fn,e.svgExported=ns,e.tableView=ln,e.tableViewed=ls,e.textRender=Xa,e.toolbarClick=_a,e.toolbarRender=Ua,e.tooltipLabelFont=ll,e.treeViewUpdate=Ur,e.uiUpdate=Rr,e.valueSorted=vs,e.verticalScroll=kr,e.verticalScrolled=Ns,e.windowResize=Vn,e.windowResized=Ds,e.zoomComplete=sr,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=ej2-pivotview.umd.min.js.map