UNPKG

@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.

10 lines 1.14 MB
/*! * filename: ej2-pivotview.umd.min.js * version : 31.1.23 * Copyright Syncfusion Inc. 2001 - 2025. 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,ne,U,P,w,O,H,V,E,I,N,y,F,L,R){"use strict";var A="e-pivotfieldlist",k="e-rtl",j="e-device",_="e-icons",B="e-disable",q="e-hide",G="e-icon-first",z="e-icon-last",W="e-icon-prev",Q="e-icon-next",Y="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",se="e-field-list-footer",oe="e-left-axis-fields",le="e-right-axis-fields",de="e-all-fields-axis",he="e-axis-content",pe="e-draggable-prompt",ue="e-pvt-btn-div",v="e-pivot-button",ce="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",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 ne.DataManager({json:t}).executeLocal((new ne.Query).where("name","equal",e));if(t&&0<t.length)return t[t.length-1]},n.getFieldByName=function(e,t){return new ne.DataManager({json:t}).executeLocal((new ne.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"===String(e.actualText)||"Grand Total"===String(t.actualText)?0:String(e.actualText).localeCompare(String(t.actualText),void 0,{sensitivity:"base"}):"Grand Total"===String(e.actualText)||"Grand Total"===String(t.actualText)?0:String(t.actualText).localeCompare(String(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.beforeServiceInvoke?t.getBeforeServiceInvoke.bind(t):void 0,t.afterServiceInvoke?t.getAfterServiceInvoke.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 ea=function(){return(ea=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)},ta=(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 ne.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,